antvis/G6

Do you want to work on this issue?

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

[Bug]: Add combo and render will cause strange behavior #6804

Rey-Wang posted onGitHub

Describe the bug / 问题描述

When using antv-dagre layout, if user setData to add a combo, and calls graph.render immediately would cause the wrong result

you can check the image below (I provided the sandbox link but all examples in sandbox throw an error 😥)

Image

https://codesandbox.io/p/sandbox/55lk55

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

No response

Version / 版本

5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他

It seems like you're experiencing an issue with the antv-dagre layout in G6 when adding a combo and rendering immediately. This can sometimes lead to unexpected behavior due to the sequence of operations.

Here are a few suggestions you might try to resolve or work around the issue:

  1. Delay Rendering: After adding the combo with setData, try introducing a slight delay before calling graph.render(). This can sometimes help in ensuring that all data changes are fully processed before rendering.

  2. Check Data Integrity: Ensure that the data being passed to setData is correctly structured and complete. Incomplete or incorrect data can sometimes lead to rendering issues.

  3. Use graph.updateLayout(): Instead of calling graph.render() immediately, you might want to try using graph.updateLayout() to see if it resolves the issue.

  4. Debugging: Use console logs or debugging tools to inspect the state of the graph and data before and after calling setData and render. This might give you insights into what's going wrong.

If these suggestions do not resolve the issue, it might be beneficial to look into the specific implementation details or consider reaching out to the G6 community for more targeted assistance.

If you have any further questions or need more detailed help, feel free to ask!

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

posted by petercat-assistant[bot] 2 months ago

BTW, when I use graph render in my local, graph render would not resolve in this scenario

posted by Rey-Wang 2 months ago

ah, once antv-dagre meets empty combo, it would cause the issue

posted by Rey-Wang 2 months ago

and it may related, that the render would cause the page to freeze.

posted by Rey-Wang 2 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests