antvis / antvis/G6

[Bug]: after removing last node new nodes not shown (they added but not shown)

Open
#6,828 4 comments 0 reactions 0 assignees View on GitHub
bug 🐛 good first issue
Dominant language
TypeScript
Stars
12.3k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug / 问题描述

In my project i delete nodes like this (picture below). After deleting i call render function so that everything is displayed correctly. as soon as i delete last node and then try to add new node, i don't see it on canvas. In fact it is added and it is transparent. If transparent node is moved, it will become visible. I also tried to use function for updating zindex after adding new node from this issue: https://github.com/antvis/G6/issues/6649, but it doesn't work for all my nodes. Is there any other and more correct solution?
![Image](https://github.com/user-attachments/assets/e8afe742-f2c1-494e-981b-6574948a06ac)
![Image](https://github.com/user-attachments/assets/d9d770a8-ef2e-4e7d-aea0-62a9b06f7413)
![Image](https://github.com/user-attachments/assets/64687dbd-a965-4c4f-a364-9f1c6845d917)

### Reproduction link / 复现链接

_No response_

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

_No response_

### Version / 版本

Please select / 请选择

### 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

The issue names no files or tests and provides no reproduction link, steps, version, or code. Start by reproducing the delete-last-node, render, and add-node sequence in the G6 canvas, then compare the suggested z-index update from issue 6649. Done means newly added nodes remain visible without being moved.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.