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

[Bug]: zIndex change issue for created edges #6745

Open
2 of 10 tasks
ChenKun1997 opened this issue Jan 23, 2025 · 1 comment
Open
2 of 10 tasks

[Bug]: zIndex change issue for created edges #6745

ChenKun1997 opened this issue Jan 23, 2025 · 1 comment
Labels
status: waiting for maintainer These issues have not yet been reviewed by a maintainer

Comments

@ChenKun1997
Copy link
Contributor

Describe the bug / 问题描述

自己创建的边给复制zIndex为-100,点击边去获取边数据发现边的zIndex并不是-100,都会被重置为1,我的需求是让自建的边放在最下层

Reproduction link / 复现链接

https://stackblitz.com/edit/vitejs-vite-mx6nimms?file=src%2Fmain.jsx&terminal=dev

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

  1. 挪动节点,让边变成折线,

Image

  1. 点击下方节点的连接装开始创建边,边连接到另一个节点,这时候可以看到重叠部分自己创建的边确实在下面

Image

  1. hover一下自建的边,重叠部分自建的边就覆盖了原先的边

Image

  1. 去点击边在控制台可以看到边的zIndex跟我设置的并不是一样的,zIndex变成了1

Image

G6 Version / G6 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@ChenKun1997 ChenKun1997 added the status: waiting for maintainer These issues have not yet been reviewed by a maintainer label Jan 23, 2025
Copy link

您提到的问题是关于在使用 G6 创建边时,zIndex 的值被重置的问题。您希望自建的边能够保持在最下层,但发现 zIndex 被重置为 1。

这个问题可能与 G6 的内部机制有关,尤其是在边的状态发生变化时(例如 hover 或点击),G6 可能会重新计算 zIndex。

为了帮助您解决这个问题,您可以尝试以下方法:

  1. 自定义渲染:尝试使用 G6 的自定义渲染功能,手动设置边的 zIndex。您可以在边的创建和状态变化时,手动设置 zIndex。

  2. 事件监听:监听边的状态变化事件(如 hover、click),在事件触发时重新设置 zIndex。

  3. 检查配置:确保在创建边时,正确配置了 zIndex,并且没有其他代码段在后续操作中修改了 zIndex。

如果这些方法仍然无法解决问题,建议您查看 G6 的文档或源码,了解更多关于 zIndex 的处理逻辑。

如果您需要进一步的帮助或想要提交一个问题给 G6 的开发团队,请告诉我,我可以协助您创建一个 GitHub issue。

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

@github-actions github-actions bot changed the title [Bug]: 创建边的zIndex变化问题 [Bug]: zIndex change issue for created edges Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues have not yet been reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant