fix(visualMap): prevent tooltip label overlap#21586
Open
Resbi-Anik wants to merge 2 commits intoapache:masterfrom
Open
fix(visualMap): prevent tooltip label overlap#21586Resbi-Anik wants to merge 2 commits intoapache:masterfrom
Resbi-Anik wants to merge 2 commits intoapache:masterfrom
Conversation
- Introduced a new margin constant for handle label overlap detection. - Added logic to merge handle labels when they overlap, improving visual clarity. - Refactored handle label position updates to accommodate new merging behavior. - Implemented a method to calculate the bounding rectangle of handle labels for accurate overlap testing. Resolves: apache#21585
|
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. |
Contributor
|
Thanks for the fix, the overlap handling logic looks solid and the Could you also add a small regression case in
That would help guard against future regressions in label visibility/draggability transitions. |
- Implemented two new test cases: 'Color HueRange handles: merge on overlap' and 'Color HueRange handles: dual drag when apart'. - Each test case generates a dataset and configures the chart options to validate visualMap behavior. Resolves: apache#21585
Author
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.

Resolves: #21585
Brief Information
This pull request is in the type of:
What does this PR do?
Prevents overlapping of visualMap handle tooltip labels when the slider handles are positioned close to each other.
Fixed issues
Details
Before: What was the problem?
When using visualMap with
calculable: true, the tooltip labels for the min and max values overlap when the slider handles are positioned close to each other.This makes the labels unreadable and affects usability.
After: How does it behave after the fixing?
The tooltip labels no longer overlap when the handles are close.
When the distance between handles is below a threshold, the labels are adjusted/merged to maintain readability and avoid visual collision.
When there is enough spece no "-" between the values
when the values are close enough
Document Info
One of the following should be checked.
Misc
Security Checking
ZRender Changes
Merging options
Other information
Tested with heatmap and visualMap slider in minimal configuration. The fix works without requiring additional user configuration.