HTMLGraph

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:

NameTypeDescriptionRequiredDefault
idanyIdentifier of the node to updateyes
updateRequestNodeUpdateRequestProperties to updateno{}

NodeUpdateRequest Parameters

NameTypeDescriptionRequired
xnumberX-coordinate of the nodeno
ynumberY-coordinate of the nodeno
prioritynumberZ-index of the nodeno
centerFnfunctionFunction to determine the node’s centerno