line.simplify applies a
shape-preserving simplification pass to the rendered path:
Live example:
app/demo/line-denoising.tsx
shows the same deterministic signal raw and simplified, with live tolerance and
curve controls.What stays exact
Simplification changes only the line and area-fill geometry. It does not mutate thedata shared value, and the original points still drive:
- Y-axis range fitting and extrema
- the live value and dot
- markers anchored by time
- scrub interpolation and callback values
- threshold and reference-line calculations
Choosing a tolerance
Start with0.75–1.5 pixels. That typically removes sub-pixel jitter while
leaving the recognizable signal unchanged.
Because tolerance is measured after mapping values to the canvas, a setting has
a consistent visual meaning across datasets with very different value ranges.
Zooming or resizing naturally recalculates the path for the new screen geometry.
Curve interpolation
simplify and curve control different stages. Simplification selects the
screen-space points to retain; curve then connects them with either the default
monotone cubic or straight segments:
Multi-series
Set the sharedline.simplify to apply one tolerance to every series:
SeriesConfig can override that value. Passing 0 opts a series
out while the other lines keep the shared setting: