Skip to content

fix(text): inline sparklines smooth with the chart Catmull-Rom curve#174

Merged
DemchaAV merged 2 commits into
developfrom
fix/sparkline-smooth
Jun 12, 2026
Merged

fix(text): inline sparklines smooth with the chart Catmull-Rom curve#174
DemchaAV merged 2 commits into
developfrom
fix/sparkline-smooth

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

What

The hero sparklines in chart-showcase read as angular segment chains (5 data points across 42 pt → ~10 pt facets). SparklineGeometry now densifies the value run with the same uniform Catmull-Rom spline the chart engine draws as native Béziers — 12 sub-segments per span keeps every facet under half a point at sparkline sizes, while inline shapes stay deterministic polygon rings (no new inline machinery).

  • Area silhouette and constant-thickness ribbon both smoothed; API unchanged — every call site benefits automatically.
  • Ribbon correctness guard: the band centre clamps into [half, 1−half] before the ±half offsets, so spline overshoot at extremes can't thin the band (caught by the pair-distance assertion across all smoothed samples during development).
  • Note: the "Revenue trend" wedge stays wedge-shaped by data (monotone ramp) — smoothing doesn't invent curvature.

Verification

  • SparklineGeometryTest re-pinned: smoothed ring sizes, original data points surviving at span boundaries, constant thickness across all samples, flat-run centring, error contracts.
  • Regenerated chart-showcase.pdf + feature-catalog.pdf previews ("profit" line now reads smooth).
  • Full gate: ./mvnw verify -pl .1261 tests, 0 failures, BUILD SUCCESS.

SparklineGeometry densifies the value run with the same uniform Catmull-Rom spline the chart engine draws as native Beziers (12 sub-segments per span - facets stay under half a point at sparkline sizes), for both the area silhouette and the constant-thickness ribbon. Ribbon clamps the band CENTRE into [half, 1-half] before offsetting so spline overshoot at extremes cannot eat the thickness (pinned by the pair-distance test across all smoothed samples). API unchanged - every sparkline call site gets smooth runs automatically. Regenerated chart-showcase and feature-catalog previews. Full gate: 1261 tests, BUILD SUCCESS.
@DemchaAV DemchaAV merged commit 255e226 into develop Jun 12, 2026
11 checks passed
@DemchaAV DemchaAV deleted the fix/sparkline-smooth branch June 12, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant