-
Notifications
You must be signed in to change notification settings - Fork 19.8k
fix(visualMap): fix range comparison #21104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The currently behavior is by design. Historically, the visualMap "range" (which represents the selected range of data values) has a special meaning when it reaches both upper and lower bounds (i.e., option I think in most cases that doesn't matter, but there would be some scenarios overlooked.
Nevertheless, I think a strict mapping is supposed to be supported - as proposed in this PR. But changing this behavior by default would introduce a breaking change: user would no longer to be able to "select all" if some data values fall outside Therefore, I suggest that introduce an extra option, such as |
|
Since this issue was opened by @abdurrahmanyildirim , please try to answer the above questions to help us better understand the requirement. Thanks! |
Thank you for your patience and detailed technical explanation! Your explanation of the historical design philosophy of visualMap has given me a deeper understanding of this issue. |
Thank you for your detailed explanation. visualMap: [
{
show: true,
type: 'continuous',
inverse: false,
seriesIndex: [0],
min: 50,
max: 98,
range: [50, 98],
strictRange: true,
// ...will meet your requirement. |
Thanks for the detailed explanation. When I use a range, I expect it to prevent values outside of the defined limits. It only works as expected when I input a value smaller than the max, like in the screenshot:
That said, your approach makes sense. At least it won’t introduce breaking changes. Alternatively, the range could be enforced strictly if |




Brief Information
This pull request is in the type of:
What does this PR do?
Fixed issues
#21098
Details
Before: What was the problem?
After: How does it behave after the fixing?
Document Info
One of the following should be checked.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information