Skip to content

feat: axis wordbreak geometry#961

Open
patricnordstrom wants to merge 2 commits intoqlik-oss:masterfrom
patricnordstrom:feat/axis-wordbreak-geometry
Open

feat: axis wordbreak geometry#961
patricnordstrom wants to merge 2 commits intoqlik-oss:masterfrom
patricnordstrom:feat/axis-wordbreak-geometry

Conversation

@patricnordstrom
Copy link

Checklist

Patric Nordström and others added 2 commits March 24, 2026 15:08
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>
@veinfors veinfors changed the title Feat/axis wordbreak geometry feat: axis wordbreak geometry Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant