Repository navigation
fix(visualMap): show a single handle label when both handles have the same value - #21885
Open
Resbi-Anik wants to merge 1 commit into
Open
Resbi-Anik wants to merge 1 commit into
Resbi-Anik 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. |
Resbi-Anik
force-pushed
the
fix/visualmap-single-label-same-value
branch
from
November 30, 2026 13:03
153786d to
6932d37
Compare
… same value When the two handle labels of a calculable continuous visualMap overlap and display the same text (the same value, or values formatted identically by `precision`/`formatter`), show only one label centered on the handles instead of two duplicated labels. The single label drags both handles together. Labels that are far apart keep two labels even if their text is the same. Add unit tests and a visual test case. Close apache#21884
Resbi-Anik
force-pushed
the
fix/visualmap-single-label-same-value
branch
from
November 30, 2026 13:06
6932d37 to
7479473
Compare
Author
|
Hi @Justin-ZS, |
asifhl
approved these changes
Nov 30, 2026
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?
Shows one handle label, not two identical ones, when the two handle labels of a calculable continuous visualMap overlap and show the same text.
This fixes a bug on the
masterbranch (introduced by #21637, verified on the latest commit 34f4d92). It is not in the 6.1.0 release, so this PR targetsmaster.Fixed issues
Details
Before: What was the problem?
On the current
masterbranch (verified on 34f4d92): since #21637, overlapping handle labels are pushed apart instead of merged. When both handles have the same value, or values that format to the same text viaprecision/formatter, the same number is shown twice (50 50, or50stacked above50in vertical layout).After: How does it behave after the fixing?
One label is shown, centered on the handles:
_updateHandle. Labels that are far apart with the same text (e.g. a constantformatter) keep two labels.precision) are also covered.'all'drag mode fixRegression: Fix the implementation of visualMap labels overlap. Fix #21586. #21637 uses for close labels). The handle thumbs can still pull the handles apart.invisible+silent, so it can't catch pointer events. Both are reset on every_updateHandle, so no extra state is kept.visualMap.formatter/formatValueTextare unchanged.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/ut/spec/component/visualMap/continuousHandleLabel.test.ts(horizontal + vertical: same value, same formatted value, same text but far apart, and back to two labels).test/visualMap-continuous.html.Merging options
Other information
Related: #21766 / #21807 (vertical labels overlapping when the handles are close). That push-apart behavior is unchanged here; the single-label path only applies when the overlapping labels have the same text.