Skip to content

fix(data): color past leaders in the weekly top models chart - #66118

Merged
adamdotdevin merged 1 commit into
devfrom
weekly-model-colors
Nov 24, 2026
Merged

adamdotdevin merged 1 commit into
devfrom
weekly-model-colors

Conversation

@adamdotdevin

Copy link
Copy Markdown
Member

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

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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?

  • New test in 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.ts passes.
  • bun typecheck in packages/data/core and packages/data/app.
  • I didn't render the page against production data locally.

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="currentColor"><style>.p{opacity:.2;animation:c 3s ease-in-out infinite alternate}@keyframes c{0%,30%{opacity:.2}70%,100%{opacity:.85}}@media (prefers-reduced-motion:reduce){.p{animation:none;opacity:.85}}</style><g opacity=".2"><rect x="12" y="20" width="24" height="44"/><rect x="48" y="14" width="24" height="50"/><rect x="84" y="24" width="24" height="40"/></g><rect class="p" x="12" y="20" width="24" height="30"/><rect class="p" x="48" y="14" width="24" height="38"/><rect class="p" x="84" y="24" width="24" height="22"/><g opacity=".85"><rect x="120" y="40" width="24" height="24"/><rect x="156" y="34" width="24" height="30"/><rect x="192" y="28" width="24" height="36"/></g><g opacity=".2"><rect x="120" y="32" width="24" height="7"/><rect x="156" y="26" width="24" height="7"/><rect x="192" y="20" width="24" height="7"/></g></svg>

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@adamdotdevin adamdotdevin Nov 24, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@adamdotdevin
adamdotdevin merged commit 3281a5d into dev Nov 24, 2026
11 checks passed
@adamdotdevin
adamdotdevin deleted the weekly-model-colors branch November 24, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant