8000 Prototype the eligible charts histogram on Mantine's BarChart by noahm · Pull Request #649 · noahm/DDRCardDraw · GitHub
[go: up one dir, main page]

Skip to content

Prototype the eligible charts histogram on Mantine's BarChart - #649

Draft
noahm wants to merge 3 commits into
claude/mantine-ui-migration-sju0b6from
claude/mantine-charts-prototype-xed83z
Draft

noahm wants to merge 3 commits into
claude/mantine-ui-migration-sju0b6from
claude/mantine-charts-prototype-xed83z

Conversation

@noahm
@noahm noahm commented Sep 9, 2026
Copy link
Copy Markdown
Owner

Swaps the Victory stacked bar chart in the eligible charts view for @mantine/charts' BarChart (recharts under the hood), so the one chart in the app picks up the same theming as the rest of the Mantine migration.

  • Reshapes the histogram data into one row per level keyed by difficulty rather than one Victory series per difficulty. Levels between the lowest and highest in use are included with zero counts so gaps in the eligible range keep their space on the x axis, the way Victory's index-based x placement did.
  • Drops the manual light/dark foreground color plumbing: Mantine's chart CSS variables handle axis, grid, and label colors in both schemes.
  • Drops the hand-rolled every-other-tick label thinning in favor of recharts' own tick interval handling, which reads much better in granular level mode.
  • Replaces the per-segment Victory tooltips with a single ChartTooltip listing every difficulty present at the hovered level plus the total, with empty difficulties filtered out.
  • Keeps the stack totals above each bar, but only when the bars are wide enough to read them.
  • maxBarWidth replaces Victory's domainPadding hack for configs that span only a level or two.

Removes the victory dependency, which nothing else used.

Claude-Session: https://claude.ai/code/session_012isD1LDZ1V8LyAJCioiYy3

Swaps the Victory stacked bar chart in the eligible charts view for
@mantine/charts' BarChart (recharts under the hood), so the one chart in
the app picks up the same theming as the rest of the Mantine migration.

- Reshapes the histogram data into one row per level keyed by difficulty
  rather than one Victory series per difficulty. Levels between the
  lowest and highest in use are included with zero counts so gaps in the
  eligible range keep their space on the x axis, the way Victory's
  index-based x placement did.
- Drops the manual light/dark foreground color plumbing: Mantine's chart
  CSS variables handle axis, grid, and label colors in both schemes.
- Drops the hand-rolled every-other-tick label thinning in favor of
  recharts' own tick interval handling, which reads much better in
  granular level mode.
- Replaces the per-segment Victory tooltips with a single ChartTooltip
  listing every difficulty present at the hovered level plus the total,
  with empty difficulties filtered out.
- Keeps the stack totals above each bar, but only when the bars are wide
  enough to read them.
- maxBarWidth replaces Victory's domainPadding hack for configs that
  span only a level or two.

Removes the victory dependency, which nothing else used.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012isD1LDZ1V8LyAJCioiYy3
@noahm
noahm added this pull request to stack #650 September 9, 2026 21:59
…-charts-prototype-xed83z

Only conflict was histogram.tsx, where the base branch moved
chartLevelOrTier out of game-data-utils into utils/chart-level. Took the
new import path; the base branch's useTheme import isn't needed here
since the Mantine chart handles light/dark on its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012isD1LDZ1V8LyAJCioiYy3
@vercel
vercel Bot commented Sep 22, 2026 •
Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ddr-tools Ready Ready Preview Sep 23, 2026 6:09pm UTC

… chart CSS

recharts 3 depends on @reduxjs/toolkit/react-redux/reselect/immer, and
since the app pinned RTK 2.7.0 and react-redux ^9.2.0, yarn resolved
recharts' ranges to separate newer copies. The lazy chart chunk was
shipping a second full redux stack. Bumping the app to RTK 2.12.0 and
react-redux ^9.3.0 and deduping those packages lets the chart chunk reuse
the copies already in main.

Also moves the @mantine/charts stylesheet import out of app.tsx and into
the histogram module, so it loads with the eligible charts view instead
of the main stylesheet.

Production build, gzip -9 (min):
- chart chunk: 110.9K (395K) -> 101.5K (372K); Victory was 84.0K (264K)
- main.js: 286.8K -> 287.7K (immer 10 -> 11 now that RTK shares it)
- main.css: 39.7K -> 38.0K, back to the pre-Mantine-charts size

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KQg9za5DmhLxCJyDFq9fZ9

This branch was successfully deployed

1 active deployment
Preview — ed9a493d Deployed Sep 22, 2026 by vercel[bot]
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.

2 participants

0