antvis/G6

G6 TypeError: Cannot read property 'get' of undefined at Node.ItemBase.setOriginStyle (item.js?425b:168) #4593

Anbelin posted onGitHub

问题描述

Once the registerFn function is called, the browser immediately reports an error as stated in the title. Please see the link for details.

重现链接

https://stackblitz.com/edit/vue-xdf3uz?file=public%2Findex.html,src%2FApp.vue,src%2Fcomponents%2FHelloWorld.vue,src%2Fmain.js

重现步骤

once load page, errors occur

预期行为

resolve the errors and run my code

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • G6 版本: [4.5.1 ... ]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


刚刚解决了上述问题。上述报错是由于在自定义节点函数内的group.addShape方法中,没有设置name属性,以及draw方法没有返回 keyShape。

posted by Anbelin almost 2 years ago

Fund this Issue

$0.00
Funded

Pull requests