Keep model labels inside the plot, not out in the axis gutter - #1088
Open
rahuldoval wants to merge 1 commit into
Open
Keep model labels inside the plot, not out in the axis gutter#1088rahuldoval wants to merge 1 commit into
rahuldoval wants to merge 1 commit into
Conversation
The board's viewBox is extended left by GUTTER so the axis tick labels and the rotated title can hang there. The label placement search was bounded by that same extended edge, so a point label was free to land in the gutter too, well outside the plot frame. With every model selected, Claude Opus 5 and Claude Sonnet 4.6 ended up floating to the left of the chart. Point labels are now held to the plot column. Only the axis hangs. The fallback path had no horizontal bound at all, so it takes whichever side fits and drops the label if neither does, rather than placing it outside. This survived earlier checks because those measured labels against the svg element, whose bounds include the gutter by design — a label sitting out there was inside the element and counted as fine. The check now measures against the plot frame, taken from the gridlines the dots actually sit in. Against the merged code it fails on exactly the two labels reported; with this change it passes at 390 through 1920, in the default view and with all 30 selected, with no label overlaps and no model left unlabelled. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Hotfix for #1079. One file, 23 lines.
The bug
The board's viewBox is extended left by
GUTTERso the axis tick labels and the rotated axis title can hang there. The label placement search was bounded by that same extended edge:So a model label was free to land in the gutter as well — well outside the plot frame. With every model selected, Claude Opus 5 and Claude Sonnet 4.6 floated to the left of the chart.
Point labels are now held to the plot column; only the axis hangs. The fallback path had no horizontal bound at all, so it now takes whichever side fits and drops the label if neither does, rather than placing it outside.
Why the existing checks missed it
They measured labels against the svg element, whose bounds include the gutter by design — a label sitting out there was inside the element and counted as fine. And it only reproduces with all 30 models selected, not in the default 20-model view.
The check now measures against the plot frame, derived from the gridlines the dots actually sit in. Run against the merged code it fails on exactly the two reported labels:
With this change, every width passes.
Verification
At 390 / 768 / 1024 / 1440 / 1920, in the default view and with all 30 selected:
prettier,tsc,eslint,next build(325 pages) and all three benchmark audits (22/22 contracts) pass.🤖 Generated with Claude Code