StencilApi
What useStencil returns: the underlying ui.Stencil view plus
imperative drag controls (startCellDrag, cancelCellDrag). Provided through
Stencil's React context, so call useStencil from any component
rendered inside <Stencil>.
Properties
cancelCellDrag
readonly cancelCellDrag: (options?) => void;
Cancels the active drag (if any). The clone returns to the stencil.
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | { dropAnimation?: DropAnimation; } | Optional override for the drop animation. |
options.dropAnimation? | DropAnimation | Override the drop animation used when the clone returns to the stencil. |
Returns
void
startCellDrag
readonly startCellDrag: (cell, event, options?) => void;
Programmatically starts dragging a cell or plain CellRecord from the stencil.
Parameters
| Parameter | Type | Description |
|---|---|---|
cell | | Cell<Attributes<Selectors>, ModelSetOptions> | AnyCellRecord | A dia.Cell instance or a plain CellRecord object: used as the drag preview. |
event | | Event | MouseEvent<Element, MouseEvent> | TouchEvent<Element> | The originating mouse/touch event. |
options? | StartCellDragOptions | Optional per-drag overrides. |
Returns
void
stencil
readonly stencil: StencilView;
The underlying JointJS ui.Stencil view (joint-react-plus's StencilView subclass).