apache / apache/echarts

[Bug] treemapRootToNode doesn't properly work with leafDepth 1

Open
#21,010 4 comments 0 reactions 0 assignees View on GitHub
bug en pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
15h 17m
Merged PRs (30d)
5

Description

### Version

5.4.3

### Link to Minimal Reproduction

https://codesandbox.io/p/devbox/beautiful-chebyshev-3lgfcx?workspaceId=ws_P5axcbk322QJHWwfpQvWGp

### Steps to Reproduce

1. create a treemap chart with a series option `leafDepth: 1`
2. dispatch a treemapRootToNode action with a targetNodeId for a node with leaf depth > 1

Please see the setTimeout in the codesandbox `index.js`. If you remove "/child1" from the `targetNodeId` the action works. It also behaves correctly if you remove leafDepth: 1 from the series option.

### Current Behavior

The svg renders nothing

### Expected Behavior

The correct node is rendered, the same way as when you click on the nodes individually.

### Environment

### Any additional comments?

_No response_

Contributor guide

Open the contributing guide

Research direction

The reproduction is in the linked CodeSandbox, with the relevant dispatch in index.js; start by running it with leafDepth: 1 and targetNodeId including /child1. Trace the treemapRootToNode action and compare it with clicking nodes; done means the correct node renders instead of a blank SVG.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.