geom: a called-out label is broken or shrunk before it is dropped - #51
Merged
Merged
Conversation
A label called out of a thin slice at nine or three o'clock has only the margin beside the chart, and the long names were dropped there - the ones a callout exists for. A called-out label is now fitted to the room on its own side the way a box label is fitted to its box: one line at the layer's size, then broken over two or three lines where Wrap allows it, then shrunk down to MinFontSize, and only then dropped. The shape is settled before stacking, and labels on one side are stacked apart by half of each neighbour's height, so a block takes as many lines of the column as it has. Labels that fitted before are unchanged; the golden files and documentation figures are the same. See the amendment to ADR 0082. Co-Authored-By: Claude Opus 5 (1M context) <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.
Why
A label called out of a thin slice at nine or three o'clock has only the margin beside the chart. In a sunburst whose panel is not much wider than the ring, the long names were dropped there — the ones a reader cannot guess from the colour, and the ones a callout exists for.
What
A called-out label is fitted to the room on its own side the way a box label is fitted to its box, in the same order:
Wrapallows it,MinFontSize, on whichever shape holds the largest type,The shape is settled before stacking; labels on one side are stacked apart by half of each neighbour's height plus a pixel (for one-line labels: the same step as before). The leader meets a wrapped block in its middle.
Labels that fitted before are unchanged — golden files and the gallery are the same.
geom/text.go:calloutShape, per-callout font/shape/block, height-aware stackinggeom/textfit_test.go: wrapped instead of dropped, shrunk withoutWrap(dropped withMinFontSizeat the layer's size), stacked by block heightCallout/WrapdocsTests
go test ./...,backend/ggincl. gallery (viago.work),go vet ./...🤖 Generated with Claude Code