antvis/G6

addItem 报错 Cannot read properties of undefined (reading 'getModel') #4487

MorningStarHu posted onGitHub

Describe the bug

我是自定义的节点,报错 。但是有时候可以正常运行,请问这个是什么原因呢 TypeError: Cannot read properties of undefined (reading 'getModel') at AbstractGraph2.addItem (graph.js:1114:51) at index.vue:905:10 at Array.forEach (<anonymous>) at addNodeAndEdgeToGraph (index.vue:903:5) at getGraphDataINIT (index.vue:1047:11) at callWithErrorHandling (runtime-core.esm-bundler.js:155:22) at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:164:21) at emit$1 (runtime-core.esm-bundler.js:718:9) at runtime-core.esm-bundler.js:7232:53

<img width="715" alt="image" src="https://user-images.githubusercontent.com/31729631/237051552-57cc7ee1-ede8-4b29-b188-470d301be905.png"> <img width="493" alt="image" src="https://user-images.githubusercontent.com/31729631/237051703-ed3d2081-24cf-4ba4-a398-3ee04601ac95.png">

Your Example Website or App

Steps to Reproduce the Bug or Issue

Expected behavior

节点可以成功添加

Screenshots or Videos

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context


看下数据是不是不正确,比如节点和边的 id 必须是唯一的 string,边的 source 和 target 要有节点的 id 和它对应

posted by Yanyan-Wang almost 2 years ago

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] 10 months ago

Fund this Issue

$0.00
Funded

Pull requests