Class: SharedCanvasState
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
highlighter():undefined
|CellHighlighter
Returns active highlight for the diagram cells.
Experimental: this feature will likely change in the future.
Returns
undefined
| CellHighlighter
Defined in
diagram/sharedCanvasState.ts:214
widgets
get
widgets():ReadonlyMap
<string
,CanvasWidgetDescription
>
Live collection of canvas widgets rendered on each canvas.
Returns
ReadonlyMap
<string
, CanvasWidgetDescription
>
Defined in
diagram/sharedCanvasState.ts:154
Methods
findAllCanvases()
findAllCanvases():
CanvasApi
[]
Returns all canvases that use this shared state.
Returns
Defined in
diagram/sharedCanvasState.ts:137
findAnyCanvas()
findAnyCanvas():
undefined
|CanvasApi
Returns any canvas that uses this shared state or undefined
if none found.
Returns
undefined
| CanvasApi
Defined in
diagram/sharedCanvasState.ts:146
setCanvasWidget()
setCanvasWidget(
key
,widget
):void
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
Defined in
diagram/sharedCanvasState.ts:165
setHandlerForNextDropOnPaper()
setHandlerForNextDropOnPaper(
handler
):void
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
Defined in
diagram/sharedCanvasState.ts:186
setHighlighter()
setHighlighter(
value
):void
Sets or removes an active highlight for the diagram cells.
Experimental: this feature will likely change in the future.
Parameters
Parameter | Type |
---|---|
|
|
Returns
void
Defined in
diagram/sharedCanvasState.ts:220
tryHandleDropOnPaper()
tryHandleDropOnPaper(
e
):boolean
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