feat: axis wordbreak geometry#961
Open
patricnordstrom wants to merge 2 commits intoqlik-oss:masterfrom
Open
Conversation
Add `wordBreak` ('break-word' | 'break-all' | false) and `maxLines`
(number) to axis label defaults. Thread both settings through the
axis pipeline — axis-node-builder computes a per-tick `maxHeight`
slot (full bandwidth height for left/right; fixed `maxLines × h`
for top/bottom; geometry-aware for tilted), and axis-label-node
stamps `wordBreak`/`maxLines` onto each text node struct so the
existing SVG renderer's `onLineBreak()` picks them up automatically.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… wrapped labels axis-label-size: suppress auto-tilt when wordBreak is active; reserve correct dock height (lineHeight × maxLines for horizontal, width-based projection for tilted); compute tilted lineMultiplier dynamically from the available bandwidth slot so maxLines never over-reserves space. line-break-resolver: center the rendered N-line block within its reserved slot. Uses two coordinate models — for left/right axes y is at the slot top (text-before-edge), offset = (maxHeight − N×lh) / 2; for bottom/top axes y is at the slot bottom, offset = h − (maxHeight + N×lh) / 2 — so every label's visual midpoint aligns to the slot center regardless of how many lines actually wrap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Checklist