Skip to main content
Version: 4.3

ClipboardApi

Handle returned by useClipboard: the underlying ui.Clipboard instance plus graph-bound copy/cut/paste operations.

Properties

clearClipboard

readonly clearClipboard: (options?) => void;

Empties the clipboard, discarding any copied cells.

Parameters

ParameterType
options?BaseOptions

Returns

void


clipboard

readonly clipboard: Clipboard;

The underlying ui.Clipboard instance.


copyCells

readonly copyCells: (selection, options?) => Cell<Attributes<Selectors>, ModelSetOptions>[];

Copies the given cells, together with any links between them, into the clipboard. Accepts cells, records, ids, or an mvc.Collection, and returns the copied cells.

Parameters

ParameterType
selectionCopyInput
options?BaseOptions

Returns

Cell<Attributes<Selectors>, ModelSetOptions>[]


cutCells

readonly cutCells: (selection, options?) => Cell<Attributes<Selectors>, ModelSetOptions>[];

Copies the given cells into the clipboard and removes them, with their links, from the graph. Accepts cells, records, ids, or an mvc.Collection, and returns the cells that were cut.

Parameters

ParameterType
selectionCopyInput
options?CutElementsOptions

Returns

Cell<Attributes<Selectors>, ModelSetOptions>[]


isClipboardEmpty

readonly isClipboardEmpty: (options?) => boolean;

Returns true when the clipboard holds no cells.

Parameters

ParameterType
options?BaseOptions

Returns

boolean


pasteCells

readonly pasteCells: (options?) => Cell<Attributes<Selectors>, ModelSetOptions>[];

Pastes the clipboard contents into the graph and returns the newly added cells.

Parameters

ParameterType
options?PasteCellsOptions

Returns

Cell<Attributes<Selectors>, ModelSetOptions>[]


pasteCellsAtPoint

readonly pasteCellsAtPoint: (point, options?) => Cell<Attributes<Selectors>, ModelSetOptions>[];

Pastes the clipboard contents into the graph, positioned so a chosen point of the cells' bounding box lands at the given point - by default the box is centered on the point; pass options.origin to anchor a different bbox point. Returns the newly added cells.

Parameters

ParameterType
pointPlainPoint
options?PasteCellsAtPointOptions

Returns

Cell<Attributes<Selectors>, ModelSetOptions>[]