apache / apache/echarts

[Bug] Tree chart: expanded/collapsed state of parent nodes is reset on zoom

Open
#19,289 9 comments 0 reactions 0 assignees View on GitHub
bug en pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

5.4.3

### Link to Minimal Reproduction

https://jsfiddle.net/undeletable/zrau5scd/

### Steps to Reproduce

1. Create tree chart.
2. Expand/collapse some nodes, so that overall state is different from the initial one.
3. Change chart zoom.

### Current Behavior

Expanded/collapsed state of nodes is reset to the initial one. Obviously, that occurs because change of `series` value call triggers chart rerender. Note that this is the case even if reference to `series` remains unchanged (see https://jsfiddle.net/undeletable/z8cvfg23/).

### Expected Behavior

According to https://github.com/apache/echarts/issues/16743, `dataZoom` property is not supported for tree charts. So the only way to change zoom is to change `series.zoom` property in options. Obviously, this triggers chart rerender, but as a user I'd expect chart state to be persisted if only zoom changes - no matter if it's done using current way, or if any analog for `dataZoom` is introduced.

### Environment

```markdown
- OS:Linux Mint 19.3
- Browser:Google Chrome 119.0.6045.123
- Framework:Vanilla JS, React
```

### Any additional comments?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.