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]: after removing last node new nodes not shown (they added but not shown) #6828

Open
2 of 10 tasks
IksanovRoman opened this issue Mar 4, 2025 · 4 comments
Open
2 of 10 tasks
Labels
bug 🐛 Something isn't working good first issue Good for newcomers

Comments

@IksanovRoman
Copy link

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: #6649, but it doesn't work for all my nodes. Is there any other and more correct solution?
Image
Image
Image

Reproduction link / 复现链接

No response

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

No response

Version / 版本

Please select / 请选择

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@IksanovRoman IksanovRoman added the waiting for maintainer Triage or intervention needed from a maintainer. label Mar 4, 2025
@IksanovRoman
Copy link
Author

I rewrote the setNodeZIndex function a bit. Now after specifying the setElementZIndex index I also do setElementVisibility with the visible parameter. Is this normal? At the same time, it would have been possible to use line 268 of the code (which is now commented out), calling the setElementState function instead of setElementVisibility and that would have worked too. It seems that this is a temporary solution for me.

Image

@zhongyunWan zhongyunWan added bug 🐛 Something isn't working good first issue Good for newcomers and removed waiting for maintainer Triage or intervention needed from a maintainer. labels Mar 5, 2025
@RackweLLizm
Copy link

This issue also exists in antv g6 v4. Is there a plan to fix this?

@zhongyunWan
Copy link
Contributor

This issue also exists in antv g6 v4. Is there a plan to fix this?antv g6 v4 中也存在此问题。有计划修复此问题吗?

We will solve this problem in version 5. It is caused by the failure to reset the element status after deleting the nodes.

@RackweLLizm
Copy link

RackweLLizm commented Mar 12, 2025

@zhongyunWan

This problem does not only occur when deleting or adding an element, but also when working with combos in v4, the comboCombined layout does not run outerLayout graph.updateLayout() method. To overcome this, you must either manually expand/combine the combos or run graph.render. When you expand/combine, the layout does not work properly as it does in render.

For this reason, would you consider doing this update in v4 as well? Or would you suggest an alternative?

I am not sure if other problems will occur if I try the solution above.

I was using v5 too, but I went back to v4 due to performance and stability issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants