apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.11k stars 19.6k forks source link

[Bug] Tree chart creates branches without nodes #18587

Open eswarkallam opened 1 year ago

eswarkallam commented 1 year ago

Version

5.4.2

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?code=LYTwwgFghgTgLgOgM4QPYHcAyqoBMCWAdgOYAUAlANwCwAUHQMaqFJwAEuUcUAjGwLxsA3nTZi2AIkJRgAUwkAuSQA8QALwkAaUeIkMI-ADa4YsworYBtHePEjatx7ulyLEqIcMSbjgL7aHJ2EfIMkXeSV3ODgYPlkARwBXDzYATQBRAGVvQKd_EPEfAF06XxpaJhZ2Tm4AJgFg3LCZCMkPLwDbPQNjU3Mlaybbe1Cu8LdCVFxZHhzQ_KG7AqcpFomp2Vq5oIXQkdGxVddI1Q1ltl9i0vKxRIAHGtkAES4oUhreKh1QSFhEA2m2DwRDIX0CSFkcAAKvg5KhEnBSAAzRKEBhwfDMCj7W4PLjPV7vV61MFifxsADMAAYaWC6Ci0RjmGx7o8XtwidxyPsftB4MhIQB5O5MwikHHiCEwfCyJADc4SpxwEB3WRKADkMVksnVnVGHwGHyKetChigACNZIYlIqgndUEh8KKNYZZEi4LrzrYAG6yeD4BgeACChnwxEIGuA-FwuFdnsWTg8YYjbHV0uIEA9JtGSOYcEy-DUarYAE4vRds05XVBfXLGgcxGbLdb6w2xPbHc7U-nM_G22Jff7A4YQ8nI9HYzrK6Mk-GXW6PeWyeXdqNZMA7tBHXXbU5cwxEnX1dMkAwzJxCIuE-JV3kCiUmpdApo2DFErIwb4gA

Steps to Reproduce

  1. Generate a tree chart with some data, using the setOption method to set the data
  2. After the initial tree load, update the data using the setOption method again

Current Behavior

Tree creates an empty branch without a node

Expected Behavior

Chart should be updated with the new data without extra branches

Environment

- OS:MacOS Monterey, Windows 11
- Browser: Chrome
- Framework: JS, Angular

Any additional comments?

Bug seems to be related to the node names. When I use different names for some of the nodes, the bug disappears. For example, I see the correct behavior if the root node's name on data2 object in the minimal reproduction is updated to something else

echarts-bot[bot] commented 1 year ago

I'm sorry to close this issue for it lacks the necessary title. Please provide a descriptive and as concise as possible title to describe your problems or requests and then the maintainers or I will reopen this issue.

Every good bug report or feature request starts with a title. Your issue title is a critical element as it's the first thing maintainers see.

A good issue title makes it easier for maintainers to understand what the issue is, easily locate it, and know what steps they'll need to take to fix it.

Moreover, it's better to include keywords, as this makes it easier to find the issue self and similar issues in searches.

helgasoft commented 1 year ago

This name duplication bug adds another twist to already reported #18448 (and in #17266, #18490). And is present for both edgeShape:'polyline' and edgeShape: 'curve' although in a different way. There is a pending PR fix for #18448 from @linghaoSu, maybe needs revision ? Similar #15923, #16566, #16578 were apparently fixed.