节点跟随
节点(A)可以跟随另一个节点(B)移动而移动,这种情况下,B节点称为宿主节点,A节点称为跟随节点
- host - 宿主节点
- addFollower - 添加跟随节点
- clearFollowers - 清除跟随节点
示例
设置节点A跟随Host,节点B跟随A
var host = graph.createNode("Host");
var a = graph.createNode("A follow Host", -50, 50);
a.host = host;
var b = graph.createNode("B follow A", 50, 50);
b.host = a;
运行效果: