Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x6怎么回事,拖拽的时候明显掉帧啊? #2388

Closed
komagic opened this issue Jul 20, 2022 · 13 comments
Closed

x6怎么回事,拖拽的时候明显掉帧啊? #2388

komagic opened this issue Jul 20, 2022 · 13 comments
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions

Comments

@komagic
Copy link

komagic commented Jul 20, 2022

Describe the bug

x6 物体拖拽的时候有明显卡顿情况

Your Example Website or App

code

Steps to Reproduce the Bug or Issue

任意一个demo

Expected behavior

拖拽物体,理论上不应该掉帧这么严重

Screenshots or Videos

No response

Platform

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

Additional context

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Jul 20, 2022

👋 @komagic

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.

@babachao
Copy link

如果有明显卡顿,需要看一下具体的代码,可以放个codesandbox的demo么?或者上传一个视频

@babachao
Copy link

https://x6.antv.vision/zh/examples/node/group#expand-shrink

就是随便打开一个,一个拉拉的水库,没有一个简单的拖拉,可以拖着一卡一卡的,都不是随便拖拖拉拉的

说的是fabric.js?

@babachao
Copy link

我下代码,敢肯定,这个东西顿时,页面会出现明显的停顿,都 没有缓存计算 没有工人 大量使用动态显示大量使用没有 转移这种操作的方法数据存储完全 优化 没有检测到离屏渲染

建议你可以先了解一下X6的定位,可以看下这个
X6是基于SVG,性能肯定是不如Canvas的,但是自定义节点成本低,像制作流程图之类的,而且流程图场景一般不需要渲染大量的节点

@babachao
Copy link

如果你有大量数据可视化场景,可以了解一下G6

@komagic
Copy link
Author

komagic commented Jul 21, 2022

为啥不用 canvas +blob 渲染svg

@babachao
Copy link

😌我做了营销活动的流程图,也是有大量表单交互,可以自己写HTML定义节点,我觉得很方便

@babachao
Copy link

用canvas的话想自定义实现产品要的图形节点就会比较复杂了

@NewByVector
Copy link
Contributor

@komagic @babachao 拖动过程中一直动态修改 dom 元素位置,掉帧现在肯定存在,但是一卡一卡的我猜想是因为移动是以网格为单位,而不是像素为单位,你可以将网格大小分别设大或者小一点查看效果。

@babachao
Copy link

@komagic @babachao 拖动过程中一直动态修改 dom 元素位置,掉帧现在肯定存在,但是一卡一卡的我猜想是因为移动是以网格为单位,而不是像素为单位,你可以将网格大小分别设大或者小一点查看效果。

嗦嘎,明白了😌

@komagic
Copy link
Author

komagic commented Jul 21, 2022

我的眼 能够分辨电脑的144帧和60帧,所以对这些有些敏感。
哈哈,可以,这个讨论起到了效果。不错,不错。

脱离文档流,减少reflow 有可能不

@NewByVector NewByVector added the type: discussion 讨论 Usage questions, guidance, and other discussions label Jul 22, 2022
@NewByVector
Copy link
Contributor

请问上面的回答有解决你的问题吗,为了高效沟通,我们暂时关闭这个 issue,如果有必要,请重新开一个新的 issue。

@x6-bot
Copy link
Contributor

x6-bot bot commented Aug 22, 2023

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators Aug 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions
Projects
None yet
Development

No branches or pull requests

3 participants