Update Node
Updates specified properties of a node.
canvas.updateNode("node-1", { x: 100, y: 100, })
All available parameters are demonstrated in the following example:
canvas.updateNode("node-1", { x: 100, y: 100, priority: 10, centerFn: () => ({ x: 0, y: 0 }), })
When called without parameters, the coordinates of all edges connected to the node will be updated.
canvas.updateNode("node-1")
Parameters for updateNode
:
Name | Type | Description | Required | Default |
---|---|---|---|---|
id | any | Identifier of the node to update | yes | |
updateRequest | NodeUpdateRequest | Properties to update | no | {} |
NodeUpdateRequest
Parameters
Name | Type | Description | Required |
---|---|---|---|
x | number | X-coordinate of the node | no |
y | number | Y-coordinate of the node | no |
priority | number | Z-index of the node | no |
centerFn | function | Function to determine the node’s center | no |