kokhlo opened a new pull request, #44469:
URL: https://github.com/apache/superset/pull/44469
### Summary
Follow-up to #43144 / #43178, fixes #44466.
The `MIN_LABEL_SEGMENT_SIZE_PX` legibility floor added for the **Auto**
value-label position was only reachable through the `labelLayout` callback that
`transformSeries` spreads solely when `valueLabelPosition === Auto`
(`transformers.ts`). The shipped default (**Outside End**) — and every other
manual position — resolved with no `labelLayout` callback at all, so near-zero
non-zero segments next to a large-magnitude outlier kept drawing value labels
at near-identical coordinates: a garbled, colliding cluster of text instead of
readable per-segment values.
### Changes
- `transformSeries` now attaches a suppression-only `labelLayout` callback
to every `plotType === 'bar'` series with shown values when the Auto callback
does not apply.
- The callback reuses the existing floor: a segment whose value-axis extent
drops below `MIN_LABEL_SEGMENT_SIZE_PX` (16px) loses its label through the
already-supported `HIDDEN_LABEL_LAYOUT` (`fontSize: 0`) mechanism; everything
else returns an empty layout, so the configured manual position is untouched —
no repositioning, no outside-move logic from the Auto path.
### Before/After
Stacked bar chart, "Show Value" on, default Outside End position, one
`-4,000,000` outlier alongside `-1…-5` segments (repro data from #38037):
previously ~145 of 150 labels had a colliding neighbor (24 groups at
byte-identical coordinates); sub-floor segments now draw no label, legible
segments keep theirs.
### Testing
- `transformers.test.ts`: the two suites pinning `labelLayout === undefined`
for manual positions are updated to pin the new contract (fixed position kept +
floor callback present); new tests cover
- each manual position suppressing a sub-floor segment while keeping a
legible one untouched,
- the stacked Outside-End-near-outlier scenario from #44466 (sub-pixel
segment hidden, outlier label kept),
- no callback when values are not shown.
- Local: RED on main (5 failures), GREEN with the fix — 53/53 pass; `oxlint`
warnings identical to pristine main; `tsc` error count unchanged (704
pre-existing workspace-build errors on both sides).
### Additional notes
- The floor does not apply to zero-value segments — those are already
suppressed by #43178.
- Goes one step toward the legible-by-default goal of the Auto position
without changing any configured placement.
### Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/apache/superset/blob/master/CONTRIBUTING.md)
guide.
- [x] All new and existing tests passed locally (`npx jest
plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts`).
- [x] Lint passed (`npx oxlint --config oxlint.json` — no new warnings vs
main).
--
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]