Repository navigation
feat(s2): bar direct label collision hiding, overflow and dataKey - #993
Open
c-lamoureux wants to merge 4 commits into
Open
c-lamoureux wants to merge 4 commits into
c-lamoureux wants to merge 4 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c-lamoureux
force-pushed
the
feat/s2-bar-dashboard
branch
from
October 12, 2026 16:17
cf4d7a7 to
7c27a88
Compare
c-lamoureux
force-pushed
the
feat/s2-bar-direct-label-visibility
branch
from
October 12, 2026 16:17
f03bad7 to
342ba97
Compare
Use Vega's native bar-bound anchors and collision layout across dodged categories. Filter excluded and inside-fit rows before placement, preserve draw-in fades, and cover geometry updates with runtime regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cover label positions, signs, layouts, collision policies, data updates and animation comparisons. Handle empty obstacle sets in native Vega layout and defer invisible draw-in candidates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Round the native label bitmap size to integers so fractional trellis facets detect bar collisions, and rasterize labels in a padded frame so later label sets see earlier outside labels. During draw-in, lay labels out from the final background geometry and fade the whole layer in afterwards so plot bounds don't shift. Collapse rejected labels so they don't affect autosize. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Contributor
|
🎨 Storybook -> https://opensource.adobe.com/react-spectrum-charts/PR-993/ 🎨 S2 Storybook -> https://opensource.adobe.com/react-spectrum-charts/PR-993-s2/ 🎨 S2 Dev Storybook -> https://opensource.adobe.com/react-spectrum-charts/PR-993-s2-dev/ 📚 Docs -> https://opensource.adobe.com/react-spectrum-charts/PR-993-docs/ |
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.




Summary
Stacked on #989. Bar direct labels no longer overlap each other or the bars.
labeltransform and hidden if they would overlap a bar or another label. Dodged groups use the full chart size for this, not the group's band width.start,middle,end) are hidden when the text doesn't fit in the bar.overflowprop.'hide'(default) or'spill', which moves a label that doesn't fit outside the bar tip, where it is still hidden on collision.startdefaults to'spill'.dataKeyprop. Labels only the rows where that field is truthy, e.g. calling out a single bar. These labels follow the same fit and collision rules.Docs and dev
spectrum2/bar.mdgets a "Labeling specific bars" section and the new props.Testing
dataKeyfiltering and mark insertion.yarn verifypasses.