X6 icon indicating copy to clipboard operation
X6 copied to clipboard

画布节点较多时,virtual开启,fromJSON,zoomToFit,centerContent同时调用会偶现连线丢失

Open favorite58 opened this issue 1 year ago • 7 comments

Describe the bug

目前画布节点1000多个,virtual可视区域加载开启,在流程图初始进入时,fromJSON,zoomToFit和centerContent同时调用会偶现连线丢失问题,再就是render:done事件无效

Your Example Website or App

公司内部项目

Steps to Reproduce the Bug or Issue

1、画布节点1000多个,virtual可视区域加载开启 2、在流程图初始进入时,fromJSON,zoomToFit和centerContent同时调用

Expected behavior

大画布开启可视化区域加载后,希望同时调用fromJSON,zoomToFit和centerContent能正常渲染画布,不会出现连线丢失问题,或者是在batchUpdate批量更新中去同时执行这三个操作,画布正常渲染,连线无丢失

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 2.11.1]
  • Vue: 3.2.31
  • @antv/x6: 2.15.1
  • @antv/x6-vue-shape: 2.1.1

Additional context

No response

favorite58 avatar Sep 22 '23 04:09 favorite58

👋 @favorite58

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 Sep 22 '23 04:09 x6-bot[bot]

在本地无法复现你的问题,最好还是搞个复现的 demo。此外 render:done 事件在最新的 2.15.1 版本中已经加上。

NewByVector avatar Sep 25 '23 09:09 NewByVector

还发现一个问题,在项目中有多个流程图都开启了clipboard本地存储,但是我在A流程图复制后,在b粘贴就会有问题,因为节点类型不一样,甚至没有,有考虑添加clipboard 自定义存储key的功能吗?

favorite58 avatar Sep 26 '23 03:09 favorite58

欢迎提 PR 呀。

NewByVector avatar Sep 26 '23 06:09 NewByVector

我之前也偶发这个问题,后面我觉得是不是我改的东西多了导致的bug,就把virtual关了

cuidong626 avatar Sep 27 '23 07:09 cuidong626

virtual 是不是和小地图插件不兼容呢,小地图上展示不全

Lewis-li-0 avatar Nov 07 '23 10:11 Lewis-li-0

是不是这里的原因啊?我遇到的渲染丢失改了这个以后解决了。

image

这个函数不仅在 scheduler 内部调用,cell 属性更改的时候也会通过 cellview - renderer 调用,并且把原来设定的 flag 直接覆盖掉。如果这个 cell 刚好还没挂载,它的 FLAG_INSERT 就会被抹掉,永远也不会挂载了。

https://github.com/antvis/X6/blob/f4d1412efd16b27757b6b6ed89222545bb85136d/packages/x6/src/renderer/scheduler.ts#L92-L107

https://github.com/antvis/X6/blob/e18a0ce17b0188c776e9dca313c821812a74e2be/packages/x6/src/view/cell.ts#L277

OpportunityLiu avatar Mar 29 '24 03:03 OpportunityLiu