Repository navigation
Conversation
Large Token Attribution tiles now scale their label from 11px up to 18px with the square root of their share of the total, so the biggest categories stand out. Small tiles keep their current labels.
roborev: Combined Review (
|
This branch has not been deployed
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.
Closes #2388.
User-facing: in Usage → Token Attribution, a tile's label now grows with its share of the total, so the categories that dominate are the first names you see.
On large tiles, the label size is
28 * sqrt(share), clamped between the existing 11px and 18px. I used sqrt because tile area already grows linearly with share, so a linear size would blow up the top tile and flatten the rest. The size is also capped by the tile's height, so the value and meta lines under the label still fit. Those lines move down by the same amount the label grows.Medium and small tiles are unchanged. Medium tiles keep the 9px label, and the smallest tiles still show no text, just the hover title. That already covers the issue's point about hiding labels on tiny tiles.
The main thing to look at is
labelSizeinTreemap.svelte. The 28 and 18 are judgment calls, and I'm happy to tune them.