feat(charts): smooth lines render as native cubic Beziers via PathNode#170
Merged
Conversation
W3 of the path workstream: LineChartLayout drops the fixed 8-sub-segment Catmull-Rom sampler entirely - smooth runs (3+ points) compile into one stroked PathNode per run with Catmull-Rom-derived Bezier control points (c1 = p1 + (p2-p0)/6, c2 = p2 - (p3-p1)/6, the exact continuous curve the sampler approximated), and smooth area fills close the very same curve down to the baseline so fill and stroke edges coincide. Two-point runs stay straight segments; non-smooth charts are untouched (committed snapshot baselines unaffected - verified, all chart snapshot tests green). Resolver tests rewritten: one-native-run, curved-area shape, two-point fallback. Regenerated chart-showcase and feature-catalog previews - the smooth page now has zero facets.
…ooth z-order assertion, build() reuse contract
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
W3 — the payoff of the path workstream (#168 primitive, #169 DSL):
ChartSpec.line().smooth(true)stops tessellating.LineChartLayoutdrops the fixed 8-sub-segment Catmull-Rom sampler entirely: a smooth run (3+ points) compiles into one strokedPathNodewith Catmull-Rom-derived Bézier control points (c1 = p1 + (p2−p0)/6,c2 = p2 − (p3−p1)/6— the exact continuous curve the sampler approximated). Native PDFcurveTooperators, zero facets at any zoom, and fewer content-stream ops than the old 8×N segments.Verification
ChartLayoutSnapshotTest(committed baselines) green without re-baselining.chart-showcase.pdf+feature-catalog.pdfpreviews; the smooth-area page eyeballed — perfectly smooth, fill hugs the stroke../mvnw verify -pl .— see commit; BUILD SUCCESS.