Graphic object supports the set membership. Child may be added or deleted. Or parent node can be modified. The graphics can form a relation of tree-form graph in GraphModel. 

  • #children - child collection
  • #parent - parent node
  • #addChild - add child
  • #clearChildren - clear child node
  • #forEachChild - traverse child node
  • #getChildAt - get child node
  • #getChildIndex - get child order number


Set up the set membership of nodes 

var node = graph.createNode();
var child = graph.createNode("child");
child.parent = node;
//or use#addChild(...)