antvis/G6

Do you want to work on this issue?

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

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

IksanovRoman posted onGitHub

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

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 / 其他

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

posted by IksanovRoman about 2 months ago

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

posted by RackweLLizm about 2 months ago

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.

posted by zhongyunWan about 2 months ago

@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.

posted by RackweLLizm about 2 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests