How to add orange diamond tool to custom shapes?

333 views Asked by At

I've noticed that some shapes in draw.io/diagrams.net come with a little orange diamond that allows internal shape modification like say rim thickness

enter image description here enter image description here

Is it possible to add something like this to my own custom shapes?

1

There are 1 answers

0
Nikolay On

AFAIK there is no explicit documentation available on this, but you can just use the source code as a reference. The "orange diamond" is called "handle", you need to look for "custom handles", createHandle in the source code. You can take a "basic triangle" as an example.

This one provides a good starting point: https://github.com/jgraph/drawio/blob/d60ab053c39cf9b9925dd329306536c00c364c84/src/main/webapp/shapes/mxBasic.js#L598