Bklit charts
Thirteen animated charts from Bklit UI, built on visx and Motion and themed with the Nooxit tokens.
Bklit UI's charts ship inside the package. Every part is exported from one path:
import {
Area,
AreaChart,
ChartTooltip,
Grid,
XAxis,
} from "nooxit-design-system/components/charts"Each page shows one chart on Nooxit data. Open View code under it for a file that runs as-is.
| Chart | Parts |
|---|---|
| Area | AreaChart, Area |
| Bar | BarChart, Bar, BarXAxis |
| Line | LineChart, Line |
| Composed | ComposedChart with SeriesBar, Area and Line |
| Scatter | ScatterChart, Scatter |
| Pie | PieChart, PieSlice, PieCenter |
| Ring | RingChart, Ring, RingCenter |
| Radar | RadarChart, RadarGrid, RadarAxis, RadarLabels, RadarArea |
| Gauge | Gauge |
| Heatmap | HeatmapChart, HeatmapCells, HeatmapXAxis, HeatmapYAxis, HeatmapLegend, HeatmapTooltip |
| Funnel | FunnelChart |
| Sankey | SankeyChart, SankeyLink, SankeyNode, SankeyTooltip |
| Sunburst | SunburstChart, SunburstSegment, SunburstCenter, SunburstLabels |
| Stat cards | A Card with ChartStatFlow over an area or line chart |
Grid, XAxis, YAxis, ChartTooltip, Legend, ChartMarkers,
ReferenceArea and ProjectionLine work inside the time-series charts.
Color
The charts follow the chart palette. Their own variables
live in styles/charts.css, which theme.css loads, and point at Nooxit
tokens:
| Variables | Token |
|---|---|
--chart-line-primary (a series with no color) | primary |
--chart-grid, --chart-brush-border, --legend-track | border |
--chart-label, --chart-foreground-muted, --chart-crosshair | muted-foreground |
--chart-tooltip-background, --chart-tooltip-foreground | popover, popover-foreground |
--chart-marker-background, --chart-segment-background | muted |
--chart-scale-01 to --chart-scale-05 | The orange ramp |
Give a series its color as var(--chart-1) to var(--chart-5), never as a
hex value.
A sankey colors its nodes: channels in blues, the agent's check in lime (matches) and light orange (differs), and the outcomes from green through yellow to orange. Green is only ever the posted outcome.
What changed from Bklit
- Installed by hand, not with the CLI. Bklit's install overwrites
lib/utils.tswith a plaincnand writes its own grey--chart-1to--chart-5, which would turn the shadcn charts grey. The files were copied instead, withcnimported fromnooxit-design-system/lib/utils. - Hard-coded colors use tokens. The fuchsia pattern stroke, the lime and
emerald gauge gradient, the red and emerald scatter gradient and the zinc date
pill now use
chart-1,chart-2,chart-5andprimary. - Bold and semibold text is medium, as everywhere in Nooxit.
ShimmeringText, the loading label, sits in the charts folder. Bklit's own import path to it breaks once installed.- The stat cards use
Badgeand Phosphor arrows instead of Central Icons, a commercial icon set. - Sankey nodes take a
color, which their links blend from and into.SankeyNodetakes aunitandSankeyTooltipavalueLabel; Bklit wrote "sessions" after every number. - Heatmaps take
levelThresholds, where levels 1 to 4 start. Bklit fixed them at 1, 2, 3 and 4, which suits commits but not a few dozen cases a day. GiveHeatmapLegendthe same thresholds. LineCharttakes a fixedyDomain, such as[0, 100]for percentages. Bklit always starts at 0 and adds 10% above the highest value, so 100% read as 120%.- Dates read day first ("17 Sept"), as across the product.
- Animated numbers no longer break hydration.
ChartStatFlowshowed NumberFlow in the browser but plain text on the server whenever the page had loaded NumberFlow before. - Left out: the choropleth map, candlestick, live line and profit/loss charts. Bklit's brush is not in its registry, so it is not here either.
In another project
The charts are one registry item, @nooxit/charts. It installs every file to
components/charts/ and needs @nooxit/nooxit-theme for the colors:
npx shadcn@latest add @nooxit/chartsBklit UI's charts are MIT licensed; the notice is in THIRD-PARTY-NOTICES.md.