X6 icon indicating copy to clipboard operation
X6 copied to clipboard

给graph增加一个销毁画布的功能

Open woshikay opened this issue 9 months ago • 4 comments

功能描述

需求:在调用X6进行绘制图形的时候,有时会需要销毁画布并重新生成一个画布 应用场景:在同一个组件中需要根据不同的配置创建不同的图形,如流程图,架构图,泳道图,ER图等等,每一个图形在新生成的时候都要加载自己不同的配置和方法,这个时候就需要把上一个实例化的graph销毁掉,然后重新new一个出来,在实际调用时发现官方并未提供该方法,所以导致必须将每一个都提前实例化出来,导致性能浪费,而且有很多效果无法实现!

期望解决方案

希望可以给graph增加一个destory()方法用于销毁掉之前实例化出来的graph

woshikay avatar May 07 '24 05:05 woshikay

👋 @woshikay

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

x6-bot[bot] avatar May 07 '24 05:05 x6-bot[bot]

this.graph.dispose(); 这个

ouyangtieniu avatar May 09 '24 09:05 ouyangtieniu

https://x6.antv.vision/zh/docs/tutorial/basic/graph

ouyangtieniu avatar May 09 '24 09:05 ouyangtieniu

踩坑文档:https://www.yuque.com/sxd_panda/antv/x6

zlecheng avatar May 15 '24 08:05 zlecheng