Bklit is now built on d3
Every chart in Bklit used to sit on visx, a set of React wrappers around d3. The charts now use d3 directly, with small Bklit-owned components for the parts visx used to render. You get a lighter install and a smaller bundle, and your charts look and move exactly as before.
Fewer packages
The 13 @visx/* packages and @use-gesture are gone, and so is react-use-measure. Together with the duplicate d3 copies and types they pulled in, that's 28 fewer packages in the repo's lockfile. Installing the chart library's dependencies now pulls 40 packages instead of 80, about 3 MB less on disk. A chart's registry item now lists only the d3 modules it uses, such as d3-shape and d3-scale.
The tooltip no longer needs a measuring library to adapt to its content: when the rows change, the panel now springs to its new size with Motion, keeping text crisp and the panel in place. Set animateSize={false} on ChartTooltip to turn it off; it is also off under reduced motion.
Smaller and faster
Every chart ships less JavaScript (gzipped, React and Motion excluded):
| Chart | Before | After | Change |
|---|---|---|---|
| Choropleth | 44.4 KB | 27.2 KB | −38.6% |
| Sankey | 24.6 KB | 16.6 KB | −32.6% |
| Area with brush | 59.5 KB | 50.7 KB | −14.7% |
| Bar | 42.2 KB | 36.2 KB | −14.4% |
| Pie | 15.4 KB | 13.6 KB | −11.4% |
| Line | 58.1 KB | 53.3 KB | −8.3% |
| Whole library | 207.6 KB | 188.8 KB | −9.0% |
Choropleth maps project their first render about 2.8× faster (34 ms → 12 ms for the world map) and no longer reproject when they re-render with the same data. Line and area paths are memoized, so a 200-point line re-renders about 16× faster when only hover or styling changes; animated data transitions still redraw every frame. Timings are relative, measured in Node.
Nothing to relearn
Props, markup, animations and hover behaviour are unchanged. Before each step of the move, 357 recorded chart variants were compared against the old visx output, covering geometry, text, hover and interactions, and every one matched.
Breaking changes
These only affect you if you installed components from the registry and edited or imported their internals:
- Curves import from
d3-shapeinstead of@visx/curve, for exampleimport { curveMonotoneX } from "d3-shape". - Gradients:
LinearGradient,RadialGradientand the gradient presets are now Bklit components (@bklit/gradients) with the same API. - Class names: lines, areas, grid and heatmap no longer render
visx-*class names. If you styled them, target your ownclassNameinstead. The brush keeps itsvisx-brush-*classes. - Choropleth:
TransformMatrixis now a local type with the same shape.
To update installed charts, follow Upgrading from visx. It includes a prompt you can paste into your coding agent.