rusackas opened a new pull request, #41400:
URL: https://github.com/apache/superset/pull/41400

   ### SUMMARY
   
   The deck.gl Polygon legend builds each bucket label by pairing adjacent 
breakpoints as `a - b`, so every interior breakpoint shows up in two labels — 
e.g. `1 - 81`, `81 - 212`, `212 - 369`, where `81` and `212` each appear twice 
and the ranges read as overlapping. The binning itself is fine (coloring uses 
d3 `scaleThreshold`, which is half-open, so a value of exactly `81` lands in 
exactly one bucket); it's only the label text that's ambiguous.
   
   This swaps `getBuckets` over to half-open interval notation — `[1, 81)`, 
`[81, 212)`, `[212, 369]` — with the final bucket closed on the right so the 
max value is still included. That matches what the color scale actually does 
and reads as a clean, non-overlapping partition. As the issue notes, just 
incrementing the lower bound (`82 - 212`) doesn't generalize, since breakpoints 
and values can be fractional — interval notation sidesteps that.
   
   The `Legend` formatter learned to recognize interval-notation keys so it 
still number-formats each bound (via the chart's d3 format) while preserving 
the brackets. The legacy `a - b` delimiter path is untouched, so the manual 
color-breakpoints legend keeps formatting as before.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Before: `1 - 81`, `81 - 212`, `212 - 369` (shared endpoints)
   After: `[1, 81)`, `[81, 212)`, `[212, 369]` (clean partition)
   
   ### TESTING INSTRUCTIONS
   
   1. Create a deck.gl Polygon chart with a numeric metric.
   2. Leave Bucket break points empty (use the default Number of buckets).
   3. Check the legend — bins now read as `[a, b)` intervals with no shared 
endpoints, and number formatting still applies to each bound.
   
   Unit tests cover it too: `getBuckets` asserts the non-overlapping interval 
labels, and a new `Legend.test.tsx` pins both the interval formatting and the 
legacy `a - b` path.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: Fixes #40786
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to