Skip to content
Ritesh FirodiyaGet in touch

Work / Chitragupt / Wiki / Decisions

2026-05-31-mobile-charts-svg-primitives

Decisioncanonicalverified 2026-06-26

DECISION.2026-05-31.MOBILE-CHARTS-SVG-PRIMITIVES

Mobile charts: hand-rolled react-native-svg primitives

Decision

Build mobile charts as hand-rolled react-native-svg primitives in apps/mobile/src/components/charts/. Do not introduce Victory Native / Skia or any chart library in V1.

Why

Mobile-wireframe charts (donut, line+area, dashed compare, horizontal bars) all use raw SVG paths; matching them 1:1 with a chart lib (Victory Native / Skia) means fighting the lib's defaults. react-native-svg is already a dep. A library-free implementation is ~30 LOC per primitive, zero learning curve, and keeps apps/mobile light.

Impact

  • New folder apps/mobile/src/components/charts/ exports <DonutChart>, <LineChart> (with optional area gradient + dashed comparison series + grid lines), <BarRow>.
  • Used by Dashboard (Tax readiness ring), Tax (claimed donut + regime bars), Expense (locked preview donut + 12mo line), Portfolio (allocation donut + NAV-vs-Nifty line + sector bars).
  • Do not introduce Victory / Skia unless a future need calls for gestures or 60fps animation that the SVG primitives can't deliver.
  • Affects pillar-dashboard, pillar-tax, pillar-expense, pillar-portfolio.

Status

Active.

Sources

  • .context/wiki/decisions/* § "2026-05-31 — Mobile charts: hand-rolled react-native-svg primitives"

Every project of mine is written down like this.

Read the résumé