The Remove element tool renders a remove button at a given position above the element. It accepts a few additional arguments, which can be passed as an object to the element tool constructor:
| x | string | number | Use percentage strings (e.g. '40%') to position the button relatively to the element width/height. A number means distance from the top-left corner of the element. Default is 0. |
|---|---|---|
| y | ||
| rotate | boolean | Should the button rotate according to the element angle around the element center? Default is false. |
| offset | object | Additional offset of the button from the position defined by x and y. Default is { x: 0, y: 0 }. |
| action | function | What should happen when the user clicks the remove button? Default:
|
| markup | JSONMarkup | The markup of the button, provided in the JointJS JSON format. Default is undefined (no content). |
Example:
var removeButton = new joint.elementTools.Remove({
focusOpacity: 0.5,
rotate: true,
// top-mid
x: '50%',
y: '0%',
offset: { x: 10, y: 10 }
});