Sparkline
A tiny inline trend line — no axes, grid, or tooltip. Pass a data number array and it draws one 2px path sized to fit. Color inherits from the text color, so a text-chart-* token on the element sets the stroke.
12.4k
Installation
Copy the piece and its math helper into your app — they compile with your build and the code is yours:
puzzle add piece sparkline
Geometry is computed in the view with lib/chart-math.js, so the shared helper is a required dependency.
Usage
import Sparkline from '@/components/ui/Sparkline.pzl';
<Sparkline data={ data } width={ 160 } height={ 40 } />