Skip to content

feat(usage): size treemap labels by tile share - #2513

Open
Devehab wants to merge 1 commit into
kenn-io:mainfrom
Devehab:feat/treemap-label-size
Open

Devehab wants to merge 1 commit into
kenn-io:mainfrom
Devehab:feat/treemap-label-size

Conversation

@Devehab

@Devehab Devehab commented Oct 29, 2026 •

Copy link
Copy Markdown

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 labelSize in Treemap.svelte. The 28 and 18 are judgment calls, and I'm happy to tune them.

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-ci

roborev-ci Bot commented Oct 29, 2026

Copy link
Copy Markdown

roborev: Combined Review (d692d7d)

Verdict: No findings at or above medium severity.


Reviewers: 2x codex, codex (security), codex (test-value) | Synthesis: codex | Total: 2m32s

@mariusvniekerk mariusvniekerk self-assigned this Oct 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Token Attribution: scale label font size with tile share so the largest categories read at a glance

2 participants