Add curve prop for monotone area/line interpolation#20
Open
KyleKreuter wants to merge 1 commit into
Open
Conversation
|
✅ Comp AI code review complete — no issues found. Reviewed commit Posted by Comp AI Code Reviews. |
There was a problem hiding this comment.
No blocking issues found across the changed files.
Posted by Comp AI Code Reviews.
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
Adds an opt-in
curveprop to<Area>/<Line>so continuous series can be drawn with monotone-cubic interpolation instead of the straight-segment default.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 (
resampleindither-paint.ts), so with few data points the fill and outline show hard kinks at every point.resampleMonotonesmooths 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 (
curveis optional and never set for<Bar>).Tests
tests/dither-paint.test.tscovers node pass-through, sample count, the single-value case, no-overshoot on monotonic input, and endpoint parity withresample. 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.