Migrating from v2
Raster 3.0 is a charts library. Everything else from raster 2 has been removed. The 2.x source and docs stay available at the v2.0.1 tag, and 2.0.1 stays on npm.
If you only use charts
Section titled “If you only use charts”-
Load the stylesheet once at your app root, and remove any
tokens.cssorprimitives.cssimport:import "@eekodigital/raster/tokens.css";import "@eekodigital/raster/styles.css";Chart CSS is no longer injected when you import a chart. Remove bare
import "@eekodigital/raster"side-effect imports and[class*="LineChart_…"]-style overrides; class names are now stable (raster-*). -
Map your theme onto the chart contract. Charts no longer read
--color-*,--font-*or--spacing-*. Set--raster-*instead (see Theming charts):v2 token v3 property --color-text--raster-text(and--raster-tooltip-bg)--color-text-subtle--raster-text-subtle--color-text-inverse--raster-tooltip-text--color-border--raster-grid/--raster-axis--color-focus-ring--raster-focus--color-surface--raster-surface--color-interactive,--color-success, … (default series)--raster-series-1…--raster-series-8Fonts are inherited from the page. If you set nothing, charts use
currentColor-based fallbacks and a new default palette. -
Import GeoChart from its own entry, and install
topojson-clientif you haven’t:import { GeoChart } from "@eekodigital/raster";import { GeoChart } from "@eekodigital/raster/geo";The
topologyprop now takes a structuralGeoTopologytype, so you no longer need@types/topojson-specification. -
Default series colours changed. The default palette is now eight Okabe–Ito-derived colours (see Theming charts) instead of your
--color-interactive/--color-success/… tokens. Passcolorprops or set--raster-series-*to keep your old colours. -
Charts are titled figures. Replace
aria-labelwithtitle, which is now shown above the chart. If your page already has a heading for it, passhideTitleto keep the title for screen readers only:<LineChart aria-label="Visitors this week" … /><LineChart title="Visitors this week" hideTitle … />Sparkline also takes
title(it isn’t displayed; it leads the text summary). Gauge and LinearGauge droparia-label:labelis now required and names the meter. -
LineChart’s x-axis
labelsis nowcategories.labelsis now the object of generated strings (see Accessibility):<LineChart labels={["Mon", "Tue"]} … /><LineChart categories={["Mon", "Tue"]} … /> -
Numbers are formatted with
Intl.NumberFormatby default (1200shows as1,200). PassformatValueto keep your own formatting, orlabels={{ locale: "de" }}to change the locale. -
The data table is visible on request. Each chart shows a Show data table button that reveals a real table. To keep the old always-present, visually hidden table (for example when the page already shows the data), pass
dataTable="visually-hidden". -
Marks are only buttons when interactive. Points, bars and segments become
role="button"witharia-pressedonly when you passonSelect,selectedIndexor a click handler; otherwise clicking does nothing. ScatterChart, RadarChart and GeoChart gainselectedIndex/onSelect. -
Sizes follow the container.
aspectRatiois an alternative toheight. DonutChart, Gauge, RadarChart and Sparkline fill their container’s width when you omitsize/width; in v2 DonutChart defaulted tosize={160}, Gauge tosize={120}and Sparkline towidth={80}, so pass those to keep the old size. GeoChart loseswidthand fills its container (16:9 by default, orheight/aspectRatio). Gauge and LinearGauge gainmin. -
Multi-series points use marker shapes (circle, square, triangle, diamond, …) as well as colour.
ChartTooltip and useChartTooltip are now exported, and every chart has its own entry point (@eekodigital/raster/line-chart, …).
If you use UI components
Section titled “If you use UI components”Button, Dialog, AlertDialog, DropdownMenu, Popover, Tooltip, Tabs, Select, form fields, Pagination and the other UI components are gone. Move them into your app, on Base UI or plain semantic HTML. Base UI supplies the accessible behaviour (focus management, positioning, dismissal, form participation); your app supplies the styling.
If you use DataTable
Section titled “If you use DataTable”@eekodigital/raster/data-table is gone. Copy the component from the v2.0.1 tag into your app and add @tanstack/react-table as a direct dependency.
If you use the design tokens
Section titled “If you use the design tokens”tokens.css and primitives.css are gone. Copy the values you use from src/tokens/primitives.css at the v2.0.1 tag into your app’s own token file.