antvis / G6

♾ A Graph Visualization Framework in JavaScript.
https://g6.antv.antgroup.com/
MIT License
11.03k stars 1.31k forks source link

力导向图在网格和弹性碰撞之前来回切换,onclick回调次数会增加,越来越卡顿 #5978

Closed guapizyq closed 2 months ago

guapizyq commented 2 months ago

Describe the bug / 问题描述

随着两个窗口之间来回点击,JS调用绘制函数调用onclick次数增加,导致耗时增加 越来越卡

Reproduction link / 重现链接 https://g6-next.antv.antgroup.com/zh/examples/layout/force-directed/#mesh

Reproduction link / 重现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

随着执行次数增加,JS调用绘制函数调用onclick次数增加,导致耗时增加 越来越卡

Reproduction link / 重现链接 https://g6-next.antv.antgroup.com/zh/examples/layout/force-directed/#mesh

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome

Additional context / 补充说明

随着执行次数增加,JS调用绘制函数调用onclick次数增加,导致耗时增加 越来越卡

Reproduction link / 重现链接 https://g6-next.antv.antgroup.com/zh/examples/layout/force-directed/#mesh

Aarebecca commented 2 months ago

duplicated with: https://github.com/antvis/G6/issues/5971

这两个布局会持续布局一段时间,此时虽然看起来已经布局完成,但仍在布局过程中,等待布局完成后(300个tick),性能会回复。官网案例切换不会走销毁过程,因此不会停止布局,因此看起来会卡。