antvis / antvis/G6

[Bug]: zIndex change issue for created edges

Open
#6,745 1 comment 0 reactions 0 assignees View on GitHub
waiting for maintainer
Dominant language
TypeScript
Stars
12.3k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

### 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](https://github.com/user-attachments/assets/249bd11c-6811-454d-ba90-11f79b09cca8)

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

![Image](https://github.com/user-attachments/assets/0190a16c-44be-47bd-b5d9-2a12af2115e0)

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

![Image](https://github.com/user-attachments/assets/e44722fb-dd23-410c-bbf9-e04e000be048)

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

![Image](https://github.com/user-attachments/assets/3a84a260-17cb-4460-9612-be78eaf192b1)

### G6 Version / G6 版本

🆕 5.x

### OS / 操作系统

- [ ] macOS
- [x] Windows
- [ ] Linux
- [ ] Others / 其他

### Browser / 浏览器

- [x] Chrome
- [ ] Edge
- [ ] Firefox
- [ ] Safari (Limited support / 有限支持)
- [ ] IE (Nonsupport / 不支持)
- [ ] Others / 其他

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked StackBlitz reproduction and trace edge creation, hover behavior, and zIndex updates in the G6 5.x implementation. Confirm the configured zIndex remains -100 after hovering or selecting the created edge, and that overlapping created edges stay below the original edge.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.