Skip to content

Conversation

@ChimdumebiNebolisa
Copy link

@ChimdumebiNebolisa ChimdumebiNebolisa commented Jan 16, 2026

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Fixes treemap dispatchAction({ type: 'select', dataIndex }) so that selection targets a single node even when multiple nodes share the same name.

Fixed issues

Details

Before: What was the problem?

When using dispatchAction({ type: 'select', dataIndex }) on a treemap that contains multiple nodes with the same name and no explicit id, the selection logic could select multiple nodes or behave inconsistently.

This happened because the internal selection state (selectedMap) was keyed by node name first, causing key collisions when names were duplicated.

After: How does it behave after the fixing?

Selection is now keyed by data.getId(dataIndex), which is guaranteed to be unique.

As a result:

  • dispatchAction({ type: 'select', dataIndex }) deterministically selects only the intended treemap node
  • Duplicate node names no longer cause selection collisions
  • Existing behavior for series that already rely on IDs remains unchanged

A minimal reproduction case (test/treemap-select-21480.html) confirms that only the targeted node is selected.

Document Info

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Misc

Security Checking

  • This PR uses security-sensitive Web APIs.

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

N.A.

Merging options

  • Please squash the commits into a single one when merging.

Other information

N/A

@echarts-bot
Copy link

echarts-bot bot commented Jan 16, 2026

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant