antvis / X6

🚀 JavaScript diagramming library that uses SVG and HTML for rendering.
https://x6.antv.antgroup.com
MIT License
5.7k stars 1.7k forks source link

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

Open favorite58 opened 1 year ago

favorite58 commented 1 year ago

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

Additional context

No response

x6-bot[bot] commented 1 year ago

👋 @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.

NewByVector commented 1 year ago

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

favorite58 commented 1 year ago

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

NewByVector commented 1 year ago

欢迎提 PR 呀。

cuidong626 commented 1 year ago

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

Lewis-li-0 commented 11 months ago

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

OpportunityLiu commented 6 months ago

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

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