Repository navigation
fix(data): color past leaders in the weekly top models chart - #66118
Conversation
There was a problem hiding this comment.
Looks good to me. I copied the new test onto the base branch and it fails there: the August-only model lands in Other. With this PR it gets its own weekly segment and the daily series stays the same. home.test.ts passes and tsc --noEmit passes in packages/data/core and packages/data/app. I didn't render the page against production data.
Public API unchanged: this only touches the data site's internal series building and chart colors.
One question inline: whether 2 past leaders are enough for the week that was reported.
| const NEW_MODEL_WINDOW_DAYS = 30 | ||
| const TOP_MODEL_SEGMENT_LIMIT = 9 | ||
| // The weekly series also colors this many past leaders that fell out of the past 7 days' top models. | ||
| const WEEKLY_PAST_LEADER_LIMIT = 2 |
There was a problem hiding this comment.
The report mentions several older DeepSeek models, and this adds only the 2 biggest models over the 20 weeks that aren't in the current top 9. They're ranked by their 20-week total, not by peak week. If the Aug 10 week was led by 3 or more models that have since dropped out, or a model with a steady long tail beats a short spike, part of that week would still show as Other. Could you check against production data that the reported week is now mostly colored? If it isn't, the cap or the ranking (for example, by best single week) may need adjusting.
There was a problem hiding this comment.
Checked it against the public per-model weekly numbers on opencode.ai/data. The chart puts the Aug 10 week at 125T. Of that, deepseek-v4-flash is 107T and deepseek-v4-pro is 8T.
Over the 20 weeks, deepseek-v4-flash is the largest model not in this week's top 9, at 352T. Only deepseek-v4.1-flash (1,124T) is bigger, and it's already in the top 9. So v4-flash takes one of the two slots, and about 86% of that week gets its own color instead of 0%. The rest is v4-pro, mimo-v2.5 (3T) and a long tail, which is small enough to leave in Other.
Ranking by best single week would color short spikes over the models that carried the chart for months, so I'm keeping the 20-week total and the cap of 2.
Issue for this PR
Reported in #data: older DeepSeek models show up as Other in the weekly view of the data site's Top models chart.
Type of change
What does this PR do?
The weekly view (#65307) colored the top 9 models from the past 7 days and used them for all 20 weeks. A model that was big in August but isn't in this week's top 9 counted as Other, so the Aug 10 week was all Other.
The weekly series now colors this week's top 9 plus the 2 biggest models over the 20 weeks that aren't already in it. The daily view is unchanged.
Other used to take the 10th rank color (orange). It now keeps orange in both views, and the palette has one more color so the weekly view's 11 models each get their own.
How did you verify your code works?
packages/data/core/src/domain/home.test.ts: a model that only has usage in an August week gets its own segment in the weekly series and stays out of the daily one.bun test src/domain/home.test.tspasses.bun typecheckinpackages/data/coreandpackages/data/app.Visual
Checklist