I'll start by exploring the project structure.
Now I'll set up the theme foundation with CSS variables for light/dark chart palettes.
Now the data engine — a deterministic generator with realistic academic seasonality, plus aggregation logic.
Now the chart primitives library — measurement, value tweening, and path math.
Now the chart components — custom SVG line, bar, donut, and sparkline with tooltips and tweened transitions.
Now the UI primitives — cards, filter controls, icons, and KPI cards.
Now the sortable, filterable data table with search, pagination, and CSV export.
Now the filter bar with date-range presets, custom dates, and segment chips.
Now the main dashboard application that wires everything together.
A few refinements: normalize the comparison window, fix a type reference, and update the page shell.
Now let me build to verify everything compiles.
Two polish fixes: guard against a zero-duration tween edge case, and keep tooltips inside the plot area.
The build is clean. Here's what I created:
NotesCool · Master Analytics
Data engine (src/lib/data.ts)
- A deterministic, seeded generator producing 400 days × 48 segments (~19K rows) across Plan (Free/Scholar/Pro/Campus), Platform (Web/iOS/Android) and Region (NA/EU/APAC/LATAM)
- Realistic behavior baked in: compounding growth, weekday rhythm (Sat lowest, Tue–Thu peaks), academic seasonality (exam crunch in Nov–Dec & Apr–May, summer slump), an "AI Recall" product-launch bump at day 250, and a marketing campaign spike
- Aggregation auto-buckets the timeline (daily → weekly → bi-weekly → monthly) and normalizes clipped comparison windows so period-over-period deltas stay honest
Charts (src/components/charts.tsx) — all hand-built SVG, no chart library
- Line chart: smooth cubic spline, gradient area fill, crosshair + multi-series hover tooltip, optional dashed "previous period" overlay
- Stacked/grouped bar charts: band highlighting, per-series tooltip with totals, dimming of inactive bars
- Donut: hover-expanding arcs, live center readout with share %, interactive legend
- Sparklines and ranked bars for KPI cards, regions and the funnel
- A custom
useTween hook interpolates every value with eased rAF animation, so charts morph between filter states rather than snapping
Interactivity
- Sticky filter bar: 7D/30D/90D/6M/12M presets + custom date pickers, and toggleable plan/platform/region chips — every KPI, chart, funnel and table cell recomputes live
- 5 KPI cards with count-up numbers, sparklines and trend pills
- Sortable table (8 columns), search across title/owner/subject/ID, subject dropdown, status filters, pagination and CSV export
- Animated dark-mode toggle persisted to
localStorage, with a CSS-variable chart palette that swaps automatically
Layout is fully responsive — a 5-up KPI row collapsing to 1, 2/3 + 1/3 chart grids stacking on tablet, and progressive column hiding in the table on small screens.
Files built: src/index.css, src/lib/data.ts, src/lib/chart.ts, src/components/charts.tsx, src/components/ui.tsx, src/components/DataTable.tsx, src/components/FilterBar.tsx, src/App.tsx, index.html