G6
G6 copied to clipboard
afteradditem 回调函数里面e.item.get('parent')为null
- G6 Version: 3.3.5
- Platform: MAC OS
- Mini Showcase(like screenshots):
- CodePen Link:
在afteradditem回调中无法获取parent
是 TreeGraph 吗?想拿到的 parent 是 group 还是父节点?
TreeGraph 想拿到parent实例
https://codesandbox.io/s/purple-snow-hdj0t
树图在 addChild 的时候,先 addItem 创建了新的 item 实例之后,才能把 parent 挂在到 item 上面,所以在 afteradditem 的时候还没有挂在 parent。
为满足这个需求,v3.3.7 在 TreeGraph 上增加了 beforeaddchild 和 afteraddchild 时机事件。