@latsabben-hq/charts-glow
v1.0.6
Published
Glowing operational time series, mirrored churn curves, bars and tiny SVG sparklines matching Hubben’s revenue dashboards.
Readme
Glow charts
Purpose
Glowing operational time series, mirrored churn curves, bars and tiny SVG sparklines matching Hubben’s revenue dashboards.
Install
bun add @latsabben-hq/charts-glow@^1.0.4Usage
import { GlowLineChart, Sparkline } from '@latsabben-hq/charts-glow'
<GlowLineChart data={[{ x: 'Nov', flat: 120000, churn: 9000 }]}
series={[{ key: 'flat', label: 'Platform', color: 'yellow' }]}
mirror={[{ key: 'churn', label: 'Churn' }]} format="money" />
<Sparkline values={[3, 5, 4, 8]} color="green" />API
GlowLineChart: data rows with x plus numeric series keys; series/mirror descriptors; format, height, showLegend, yTicks. BarChart: data[{x,value}], color, format, height, label. Sparkline: values, color, width, height, fill. ChartFormat presets: money, compact, hours, number, percent.
Integration
Add @source "../../node_modules/@latsabben-hq"; to your app CSS so Tailwind scans the installed packages.
Install tokens and utils, load tokens.css and install Recharts. Give the parent usable width. Use the string format presets when rendering from an async Server Component. Hubben’s charts consume raw cents for format=money, then format ticks/tooltips internally.
Customizing
Pass named series colors, legend labels, dashed flags and height props. Wrap charts in Card + CardHeader + CardBody. Show an EmptyState instead of a blank chart for no data.
Gotchas
Do not pass a formatting function across the server/client boundary; functions are allowed only within client code. Mirror values are converted to negative magnitudes automatically. Sparkline is server-renderable, decorative (aria-hidden) and needs at least two points. Provide a textual metric summary for accessibility. These frozen charts contain their own 700–900ms Recharts entrances; MotionProvider does not control those animations.
