ModelAdapter
Interface for model adapters that handle the data management of a flow diagram
Methods
Section titled “Methods”destroy()
Section titled “destroy()”destroy():
void
Destroy the model adapter and clean up resources This should be called when the model is no longer needed to prevent memory leaks
Returns
Section titled “Returns”void
getEdges()
Section titled “getEdges()”getEdges():
Edge
<object
>[]
Get all edges in the model
Returns
Section titled “Returns”Edge
<object
>[]
getMetadata()
Section titled “getMetadata()”getMetadata():
Metadata
Get metadata associated with the model
Returns
Section titled “Returns”getNodes()
Section titled “getNodes()”getNodes():
Node
[]
Get all nodes in the model
Returns
Section titled “Returns”Node
[]
onChange()
Section titled “onChange()”onChange(
callback
):void
Register a callback to be called when the model changes
Parameters
Section titled “Parameters”callback
Section titled “callback”(__namedParameters
) => void
Function to be called on changes
Returns
Section titled “Returns”void
redo()
Section titled “redo()”redo():
void
Redo the last undone change
Returns
Section titled “Returns”void
toJSON()
Section titled “toJSON()”toJSON():
string
Convert the model to a JSON string
Returns
Section titled “Returns”string
undo()
Section titled “undo()”undo():
void
Undo the last change
Returns
Section titled “Returns”void
unregisterOnChange()
Section titled “unregisterOnChange()”unregisterOnChange(
callback
):void
Unregister a callback from being called when the model changes
Parameters
Section titled “Parameters”callback
Section titled “callback”(__namedParameters
) => void
Function to unregister from changes
Returns
Section titled “Returns”void
updateEdges()
Section titled “updateEdges()”updateEdges(
edges
):void
Update edges in the model
Parameters
Section titled “Parameters”Edge
<object
>[]
Array of edges to set
Returns
Section titled “Returns”void
updateMetadata()
Section titled “updateMetadata()”updateMetadata(
metadata
):void
Set metadata for the model
Parameters
Section titled “Parameters”metadata
Section titled “metadata”Metadata to set
Returns
Section titled “Returns”void
updateNodes()
Section titled “updateNodes()”updateNodes(
nodes
):void
Update nodes in the model
Parameters
Section titled “Parameters”Node
[]
Array of nodes to set
Returns
Section titled “Returns”void