antvis/G6

Do you want to work on this issue?

You can request for a bounty in order to promote it!

[Bug]: In v4, when there is a combo layout, the edge cannot be placed at the bottom layer #6807

Deathyin posted onGitHub

Describe the bug / 问题描述

Image 在v4版本包含combo的布局中,期望所有的边线均置于combo、node的底部,但实际上配置了goupByTypes: false,以及用了toFront、toBack等方法后也没有用。 但在v5中默认边线就在最底层,请问v4中有办法实现这个逻辑吗?

https://g6-v4.antv.vision/examples/interaction/combo/#rect

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

Image

使用官方示例即可复现,在graph配置中添加goupByTypes: false,将所有combo、node用item.toFront(),将edge用item.toBack()改变层级后也没法实现

Image

但是在v5版本中默认边线就是在最底层

Image

v5 demo链接: https://g6.antv.antgroup.com/examples/behavior/combo/#basic

Version / 版本

4.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他

在 G6 v4 版本中,您遇到了在包含 combo 布局的情况下,边线无法置于最底层的问题。您已经尝试了配置 groupByTypes: false 以及使用 toFronttoBack 方法,但仍未能实现预期效果。在 v5 版本中,边线默认就在最底层。

对于 v4 版本,您可以尝试以下方法来解决这个问题:

  1. 手动调整 zIndex: 尝试手动设置边的 zIndex 属性,使其低于节点和 combo 的 zIndex

  2. 自定义渲染顺序: 如果 zIndex 无法满足需求,可以考虑自定义渲染顺序。通过监听图的 afterrender 事件,手动调整 DOM 元素的顺序。

  3. 升级到 v5: 如果可能的话,考虑升级到 G6 v5 版本,因为它已经默认解决了这个问题。

如果以上方法仍然无法解决您的问题,建议查看 G6 的更新日志和文档,或者在社区中寻求帮助。

如果您需要进一步的帮助,请随时告知。

<details> <summary>🪧 Tips</summary> For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me. </details>

posted by petercat-assistant[bot] 2 months ago

@petercat-assistant 上述方法不生效,但又无法快速升级到v5版本,还有其他办法吗?

posted by Deathyin about 2 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests