G6
G6 copied to clipboard
自定义dom节点报错,按照官网API例子写的
Describe the bug
报错信息如下 TypeError: ShapeBase[shapeType] is not a constructor at Container.addShape (container.js?330d:203:1)
我是这么注册使用 G6.registerNode( 'dom-node', { draw: (cfg, group) => { return group.addShape('dom', { ...
Your Example Website or App
null
Steps to Reproduce the Bug or Issue
页面直接加载
Expected behavior
页面加载时
Screenshots or Videos
No response
Platform
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 91.1]
Additional context
No response
实例化图的时候,是不是没配置 renderer: 'svg'?
尊敬的用户,您好。我们很重视您的 issue,但由于长时间没有答复,我们暂时认为这个问题已经解决。如果还有任何问题,请随时根据 issue 模版再开启新的 issue。
https://antv-g6.gitee.io/zh/docs/manual/middle/elements/nodes/custom-node#5-%E4%BD%BF%E7%94%A8-dom-%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8A%82%E7%82%B9 官网的例子copy下来完全跑不起来,就是报上面这个错,其他地方又看不到例子,百度谷歌更是搜不到类似报错原因,直接劝退啊。 官网中的edges: [(source: 'node1'), (target: 'node2')]是上个什么东西...
上面报错的原因就是 renderer 没有指定为 'svg',是文档里面的代码片段确实的锅
[(source: 'node1'), (target: 'node2')]
这个也写错了 [{ source: 'node1', target: 'node2' }]
感谢指出,上面两个问题会尽快更新