antvis/G6

新版本的聚类的折叠/扩展交互案例无法正常运行 #5269

zhudafu posted onGitHub

G6 版本

4.x

问题描述

新版本的聚类的折叠/扩展交互案例无法正常运行,只有这个链接上的代码可以正常运行 在新版案例中不能正常运行 https://g6.antv.vision/examples/case/graphDemos/#simplifyCluster 将旧版代码中的以下部分

<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.1.1/build/g6.js"></script>

替换为新版后代码不能正常运行:

<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>

此外 if (!ge.get('sourceNode').get('visible') && sourceModel.cluster !== model.cluster) { ... } else if (ge.get('targetNode').get('visible') && targetModel.cluster !== model.cluster) { ... }
处,else if后应该改成(!ge.get('targetNode').get('visible') && targetModel.cluster !== model.cluster) 否则会出现点击聚类节点时,普通节点的边会被漏掉无法显示

重现链接

https://g6.antv.vision/examples/case/graphDemos/#simplifyCluster

重现步骤

直接点击

预期行为

期望看到图正确加载 image 但是一直卡在这个页面 image 本地把https://antv-2018.alipay.com/zh-cn/g6/3.x/demo/case/cluster-simplify.html 的代码按问题描述修改也出现同样问题

平台

  • 操作系统: [Windows]
  • 网页浏览器: [Edge]
  • G6 版本: [4.8.21]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


hi @zhudafu, welcome!

posted by github-actions[bot] over 1 year ago

Hi @zhudafu, Please star this repo if you find it useful! Thanks :star:! 你好 @zhudafu。如果该仓库对你有用,可以 star 一下,感谢你的 :star:!

posted by github-actions[bot] over 1 year ago

3.x 和 4.x 是两个大版本,存在较大差异,不能简单通过替换包来切换。 官网案例问题这边会尽快修复

posted by Aarebecca over 1 year ago

目前分析是迭代次数过多+webworker 异常导致的,你可以通过以下调整临时解决:

 layout: {
    type: 'fruchterman',
    maxIteration: 1000,  // 调小迭代次数
    gravity: 10,
    clustering: true,
    clusterGravity: 30,
    // workerEnabled: true,  // 关闭 worker
}
posted by Aarebecca over 1 year ago

中文版本: 即使弄出来了,但是交互性太差了,加载时间长,双击图形时有的图形无法变大,而是闪一下就变小,还有悬浮框停留的位置与鼠标重叠等等问题。下面是操作来源:https://antv-2018.alipay.com/zh-cn/g6/3.x/demo/case/cluster-simplify.html

Here is the English version: Even if it is out, the interactivity is too poor, the loading time is long, some graphics cannot be made larger when double-clicking the graphics, but it becomes smaller when it flashes, and the position of the suspension box is overlapped with the mouse and so on. Here are the sources of action: https://antv-2018.alipay.com/zh-cn/g6/3.x/demo/case/cluster-simplify.html

posted by zzsf-com over 1 year ago

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] 10 months ago

Fund this Issue

$0.00
Funded

Pull requests