Vis Node: show the whole y-axis label, and say what the bars count - #463
Merged
Merged
Conversation
Plotting categorical scores (e.g. an LLM Scorer's categories) puts the score
values on the y axis, but the left margin was worked out from the series
names instead -- often a single model name -- so the labels were cut off
("...ion model"). The score values also skipped the shortening helper that
adds line breaks, so a long one could never wrap.
The y-axis labels are now collected as they're set, whichever branch runs,
and the margin is sized to fit those; score values go through the same
shortening as everywhere else.
The x axis of that chart also read "Number of 'true' values", left over from
the boolean case. It counts the scores in each category, so it now says
"Number of scores", with the metric's name when one is selected.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The categorical bar chart replaced layout.yaxis wholesale, dropping the axis
colour the base layout sets for the current theme. Its tick labels fell back
to Plotly's gray, which is hard to read on a dark background. It now keeps
what the base layout set.
Long labels also broke every 32 characters regardless of where that fell,
hyphenating mid-word ("program s-tate"). They now break between words, and
only a word too long for a line is split with a hyphen.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Two reasons dragging the resize handle left the plot at its old size: - The ResizeObserver was created in a ref callback, but disconnected by a separate effect's cleanup. In development, StrictMode mounts effects twice (mount, clean up, mount), so the cleanup disconnected the observer and React never called the ref callback again to make a new one. It's now created and disconnected by the same effect, keyed on the div. - Plotly.Plots.resize measures the plot's own div, which has no size of its own here -- it just matches the plot -- so resizing was a no-op. The plot is now told the size of the div the handle drags, and is also fitted when its data changes, since it's first drawn while that div is empty. Co-Authored-By: Claude Opus 5 <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.
Two small problems in the same chart: plotting categorical scores (e.g. the categories of an LLM Scorer) as a horizontal bar chart.
Cut-off y-axis labels
That chart puts the score values on the y axis, but the left margin was sized from the series names (often just one model name, e.g. "Jev"), so the labels were clipped: "...ion model", "...stic oracle". The score values also skipped
genUniqueShortnames, the helper the other charts use, so a long value could never wrap onto a second line.The labels that actually land on the y axis are now collected as each branch sets them, and the margin is sized to fit those; score values go through the same shortening (and line breaking) as everywhere else.
"Number of 'true' values"
The x-axis title was hardcoded from the boolean case, but this chart counts how many scores fall in each category. It now reads "Number of scores", or "Number of scores ()" when the scores are keyed by metric, e.g. per judge.
Before / after, on a scorer with 14 categories and one judge: the y axis read "...ion model" over "Number of 'true' values"; it now reads "Decision model" over "Number of scores (Jev)".
Testing
🤖 Generated with Claude Code