refactor(charts): unify on Chart.js, remove Chartist #11

Merged
notid merged 2 commits from integreat-unify-charts into staging 2026-06-02 09:23:29 -07:00
Owner

Summary

The codebase had two charting libraries. The dashboard and expense report already use Chart.js, while the admin page was the sole remaining consumer of Chartist. This unifies everything on Chart.js.

Changes

  • admin.clj — converted both admin charts from Chartist to Chart.js, using the same Alpine x-data/x-init <canvas> pattern as the dashboard:
    • Growth in clients → Chart.js bar
    • Changes by hour → Chart.js line
    • Reshaped data from Chartist's {:labels … :series [[…]]} to Chart.js's {:labels … :data …}.
    • Dropped the now-unused [hiccup2.core :as hiccup] require (only used for the Chartist <script> tags).
  • ui.clj — removed the global Chartist CSS/JS CDN includes from the base page.
  • card.cljcontent-card used overflow-scroll (always-on scrollbar tracks); switched to overflow-auto so the chart cards no longer show superfluous scrollbars while wide data tables still scroll on overflow.
  • Added a gitignored ./tmp/ scratch dir (tracked via .gitkeep) and documented it in AGENTS.md.

Verification

  • No chartist references remain in src/clj.
  • All touched namespaces compile; lein cljfmt check passes.
  • Started a dev server, logged in via /dev-login, and confirmed both admin charts render via live Chart.js instances with no superfluous scrollbars.
## Summary The codebase had two charting libraries. The dashboard and expense report already use **Chart.js**, while the admin page was the sole remaining consumer of **Chartist**. This unifies everything on Chart.js. ## Changes - `admin.clj` — converted both admin charts from Chartist to Chart.js, using the same Alpine `x-data`/`x-init` `<canvas>` pattern as the dashboard: - **Growth in clients** → Chart.js `bar` - **Changes by hour** → Chart.js `line` - Reshaped data from Chartist's `{:labels … :series [[…]]}` to Chart.js's `{:labels … :data …}`. - Dropped the now-unused `[hiccup2.core :as hiccup]` require (only used for the Chartist `<script>` tags). - `ui.clj` — removed the global Chartist CSS/JS CDN includes from the base page. - `card.clj` — `content-card` used `overflow-scroll` (always-on scrollbar tracks); switched to `overflow-auto` so the chart cards no longer show superfluous scrollbars while wide data tables still scroll on overflow. - Added a gitignored `./tmp/` scratch dir (tracked via `.gitkeep`) and documented it in AGENTS.md. ## Verification - No `chartist` references remain in `src/clj`. - All touched namespaces compile; `lein cljfmt check` passes. - Started a dev server, logged in via `/dev-login`, and confirmed both admin charts render via live Chart.js instances with no superfluous scrollbars.
notid added 2 commits 2026-06-02 09:22:54 -07:00
The admin page was the only consumer of Chartist while the dashboard and
expense report already use Chart.js. Convert the admin "Growth in clients"
(bar) and "Changes by hour" (line) charts to Chart.js using the same
Alpine x-data/x-init canvas pattern as the dashboard, and drop the global
Chartist CSS/JS includes from the base page.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
content-card used `overflow-scroll`, which renders scrollbar tracks even
when the content fits — visible as superfluous bars around the admin chart
cards. Switch to `overflow-auto` so scrollbars only appear when content
genuinely overflows (e.g. wide data tables still scroll).

Also add a gitignored ./tmp/ scratch directory (tracked via .gitkeep) and
document in AGENTS.md that temp files belong there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
notid merged commit 55650c2dab into staging 2026-06-02 09:23:29 -07:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: notid/integreat#11