antvis/G6

如何用addItem添加自定义节点 #4741

neolee6053 posted onGitHub

问题描述

G6.registerNode( 'aggregated-node',{}); graph.addItem('aggregated-node', {});

有什么办法可以加自定义节点?难道一定要changeData()才可以?

参考 https://g6.antv.antgroup.com/en/examples/case/graphDemos#largeGraph https://g6.antv.antgroup.com/en/examples/case/graphDemos#simplifyCluster

重现链接

https://codesandbox.io/s/new

重现步骤

如上

预期行为

如上

平台

  • 操作系统: [ Windows]
  • 网页浏览器: [Firefox]
  • G6 版本: [4.8.15 ]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


graph.addItem('node', {type: 'aggregated-node'});

posted by GemT27 almost 2 years ago

graph.addItem('node', {type: 'aggregated-node'});

我觉得我笨了

posted by neolee6053 almost 2 years ago

Fund this Issue

$0.00
Funded

Pull requests