What
Adds an opt-in curve prop to <Area> / <Line> so continuous series can be drawn with monotone-cubic interpolation instead of the straight-segment default.
<Area dataKey="visits" curve="monotone" />
<Line dataKey="mobile" curve="monotone" />The default stays "linear", so existing charts render exactly as before — this is non-breaking.
Why
The value line is resampled to the backing columns with a linear pass (resample in dither-paint.ts), so with few data points the fill and outline show hard kinks at every point. resampleMonotone smooths the line while staying honest: Fritsch–Carlson tangents guarantee monotonicity, so no false peaks or valleys are introduced between data points (unlike Catmull-Rom / natural cubics).
How
dither-paint.ts— addresampleMonotone(pure, no new dependency).chart-context.tsx—Curvetype + optionalcurveonSeriesSpec.area.tsx— thread thecurveprop through series registration.cartesian-canvas.tsx— pick the resampler per series;topandflooruse the same one so the band stays consistent.index.ts— exportCurve.
Bars are unaffected (curve is optional and never set for <Bar>).
Tests
tests/dither-paint.test.ts covers node pass-through, sample count, the single-value case, no-overshoot on monotonic input, and endpoint parity with resample. Full suite: 33 passing.
Registry regenerated with npm run build:registry (r/core.json, r/area-chart.json, r/dither-kit.json).
Summary by Comp AI
No blocking issues found.
Written for commit b1d0aea. New commits will trigger a re-review. Generated by Comp AI.
Activity
5No blocking issues found across the changed files.
Posted by Comp AI Code Reviews.
✅ Comp AI code review complete — no issues found.
Reviewed commit
b1d0aea.Posted by Comp AI Code Reviews.