Remove
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. |
---|---|---|
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). |
scale | number | Scale the button up or down on a 2D plane. The default is 1 . |
Example:
import { elementTools } from '@joint/core';
const removeButton = new elementTools.Remove({
focusOpacity: 0.5,
rotate: true,
// top-mid
x: '50%',
y: '0%',
offset: { x: 10, y: 10 }
});