Britecharts 3.0 beta
· 3 min read
Britecharts 3.0 is in beta, and it is a new set of packages: @britecharts/core for the charts, @britecharts/react for the React components, and @britecharts/wrappers, the layer the React components are built on and the seam for other frameworks.
npm install @britecharts/core@beta
What is new
- Modern modules. Built on the current d3 modules, shipped as ES modules, CommonJS, UMD and CDN builds, with an
exportsmap and TypeScript typings for every chart. Vite, Rollup, esbuild and webpack all work out of the box. - One tooltip.
tooltipandminiTooltipare one component that never gets cut off at the chart's edges, follows the pointer smoothly and works the same way on every chart. - Negative values on the bar, stacked bar, grouped bar and brush charts, stacking down from zero.
- Loading states for every chart,
colorMapto name the colour of each category,animationDurationon every animated chart, and charts that are responsive by default. - React 19 is tested: the React package is installed into a React 19 project under
StrictModeon every change.
Moving from version 2
Most of the work is renaming: the migration guide walks through every breaking change with a before and after for each. The ones you will hit first:
- Imports. The charts are named exports of
@britecharts/core(import { bar } from '@britecharts/core') instead of files underbritecharts/dist/umd. The CommonJS, UMD and CDN paths are in the guide too. - Loading states.
loadingState()is gone; render the chart withisLoading(true)and a dataset, empty or not. - Renamed accessors.
localeisvalueLocaleon the bar, grouped bar, stacked bar and scatter plot; the value formatters of the grouped and stacked bar arenumberFormat; the line and stacked area swapxAxisFormatandxAxisCustomFormatback to what their names say;aspectRatiois removed. - Tooltips. The line, stacked area, stacked bar and grouped bar charts now dispatch
customMouseMovethe same way every other chart does, as(dataPoint, [x, y], [width, height], colorMap). If you drivetooltip.updateyourself, it still accepts the old argument order and warns once. exportChartreturns a promise.
Version 2 ends at 2.18.4 and will not be updated.
Where to start
- The installation and getting started tutorials build a first chart from scratch, and styling charts covers themes and CSS.
- The API reference has a page per chart and one for the tooltip.
- The Storybook shows every chart, in core and in React, with its options live.
Tell us what breaks
The beta is there to find what we missed. Open an issue with the chart, the data and what you expected. And if you would like to help keep Britecharts going, the contributing guide is the place to start: we are looking for maintainers.
