Class: SharedCanvasState
Defined in: diagram/sharedCanvasState.ts:79
Stores common state and settings for multiple canvases.
Properties
Property | Modifier | Type | Description |
---|---|---|---|
| Default element template to use as a fallback. | ||
| Default layout algorithm function to use if it's not specified explicitly. | ||
| Default link template to use as a fallback. | ||
| Event for the shared canvas state. | ||
|
| A strategy to rename diagram links (change labels). |
Accessors
highlighter
Get Signature
get highlighter():
undefined
|CellHighlighter
Defined in: diagram/sharedCanvasState.ts:210
Returns active highlight for the diagram cells.
Experimental: this feature will likely change in the future.
Returns
undefined
| CellHighlighter
widgets
Get Signature
get widgets():
ReadonlyMap
<string
,CanvasWidgetDescription
>
Defined in: diagram/sharedCanvasState.ts:150
Live collection of canvas widgets rendered on each canvas.
Returns
ReadonlyMap
<string
, CanvasWidgetDescription
>
Methods
findAllCanvases()
findAllCanvases():
CanvasApi
[]
Defined in: diagram/sharedCanvasState.ts:133
Returns all canvases that use this shared state.
Returns
findAnyCanvas()
findAnyCanvas():
undefined
|CanvasApi
Defined in: diagram/sharedCanvasState.ts:142
Returns any canvas that uses this shared state or undefined
if none found.
Returns
undefined
| CanvasApi
setCanvasWidget()
setCanvasWidget(
key
,widget
):void
Defined in: diagram/sharedCanvasState.ts:161
Adds, changes or removes a canvas widget from being rendered on the canvases.
Parameters
Parameter | Type | Description |
---|---|---|
|
| unique key for a widget |
|
| widget description with a target widget layer to render on
or |
Returns
void
setHandlerForNextDropOnPaper()
setHandlerForNextDropOnPaper(
handler
):void
Defined in: diagram/sharedCanvasState.ts:182
Sets the handler for the next drop event from drag-and-drop operation on a canvas.
Experimental: this feature will likely change in the future.
Parameters
Parameter | Type |
---|---|
|
|
Returns
void
setHighlighter()
setHighlighter(
value
):void
Defined in: diagram/sharedCanvasState.ts:216
Sets or removes an active highlight for the diagram cells.
Experimental: this feature will likely change in the future.
Parameters
Parameter | Type |
---|---|
|
|
Returns
void
tryHandleDropOnPaper()
tryHandleDropOnPaper(
e
):boolean
Defined in: diagram/sharedCanvasState.ts:194
Tries to run previously set drop handler on a canvas, then removes the handler if it was set.
Experimental: this feature will likely change in the future.
Parameters
Parameter | Type |
---|---|
|
Returns
boolean
true
if a handler was set, otherwise false