G6 icon indicating copy to clipboard operation
G6 copied to clipboard

render使用问题

Open AntarcticPresident opened this issue 1 year ago • 1 comments

问题描述

graph.addItem('node', { id: "id", label: "label", style: { fill: "red" } }) 画布上新增一个节点,位于画布左上角 graph.render() 这个节点消失了 我本想通过render让它重新算布局,结果节点都没有了。 这是为啥?

重现链接

https://codesandbox.io/p/sandbox/romantic-pine-9l7v36?file=%2Fsrc%2Findex.html%3A8%2C9

重现步骤

graph.addItem('node', { id: "id", label: "label", style: { fill: "red" } }) 画布上新增一个节点,位于画布左上角 graph.render() 这个节点消失了

预期行为

我本想通过render让它重新算布局,结果节点都没有了。

平台

  • 操作系统: [Windows]
  • 网页浏览器: [Google Chrome]
  • G6 版本: [4.8.23]

屏幕截图或视频(可选)

No response

补充说明(可选)

AntarcticPresident avatar Jun 05 '24 06:06 AntarcticPresident

重新布局调用layout方法

zyh0yh avatar Jun 06 '24 02:06 zyh0yh