feat(toolbox): support select.iconStyle for the icons toggled on. close #21672 - #21772
Open
noodleslove wants to merge 1 commit into
Open
noodleslove wants to merge 1 commit into
noodleslove wants to merge 1 commit into
Conversation
|
Thanks for your contribution! 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. Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the |
noodleslove
marked this pull request as ready for review
September 30, 2026 04:26
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief Information
This pull request is in the type of:
What does this PR do?
Add
select.iconStyletotoolboxand its features, so that the icons that are toggled on can be styled separately from the hovered ones.Fixed issues
Details
Before: What was the problem?
Toolbox icons only have two styles,
iconStyleandemphasis.iconStyle. The icons that are toggled on, such as the current type ofmagicType, are displayed by keeping them in the emphasis state. So they always look the same as the hovered icons and can not be styled separately.After: How does it behave after the fixing?
select.iconStylecan be specified ontoolboxand on each feature. The feature one overrides the toolbox one.The icons that are toggled on are in the
selectstate instead of the emphasis state:magicTypeline,bar,stackdataZoomzoombrushrect,polygon,lineX,lineY,keepWhen a selected icon is hovered, the emphasis style is applied on top of the select style, the same as series.
Backward compatibility
select.iconStyle. If it is not specified on either the feature or the toolbox,emphasis.iconStyleis used. So the existing charts are displayed the same as before, including the ones that customizedemphasis.iconStyle.iconStatus: { xxx: 'emphasis' }specified in the option still works, and is cleared when another icon in the same group is clicked.Document Info
One of the following should be checked.
Misc
Security Checking
ZRender Changes
Related test cases or examples to use the new APIs
test/toolbox-select-iconStyle.htmltest/ut/spec/component/toolbox/iconStatus.test.tsMerging options
Other information
Some decisions that I would like to be reviewed:
backofdataZoomandclearofbrushstill use the emphasis state. They are not toggles. The highlight indicates that they are available, so the select style does not seem to fit them. This is narrower than what I described in the issue.iconStatusof the icons toggled on become'select'instead of'emphasis'.iconStatusis not documented, but this is visible in the result ofgetOption().iconStatus: { bar: 'select' }can be used for that currently. WhethermagicTypeshould infer it from the series can be discussed separately.A known issue that is not related to this PR: the icon
clearofbrushis not updated until the next full update. For example, it stays highlighted after clicked. It can be reproduced onmaster, and is tracked in #21771.