@cascivo/charts 0.4.1 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@cascivo/charts",
3
- "version": "0.4.1",
3
+ "version": "0.5.1",
4
4
  "private": false,
5
- "description": "Chart components built from scratch — scales, shapes, and signal-driven rendering, zero dependencies",
5
+ "description": "Chart components built from scratch — scales, shapes, and signal-driven rendering, zero dependencies. Colors come from @cascivo/themes; components from @cascivo/react. Docs offline: npx @cascivo/docs",
6
6
  "keywords": [
7
7
  "cascivo",
8
8
  "charts",
@@ -44,8 +44,8 @@
44
44
  "provenance": true
45
45
  },
46
46
  "dependencies": {
47
- "@cascivo/core": "^0.5.2",
48
- "@cascivo/i18n": "^0.2.10"
47
+ "@cascivo/core": "^0.5.3",
48
+ "@cascivo/i18n": "^0.2.11"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@preact/signals": "^2",
package/readme.body.md CHANGED
@@ -1,5 +1,7 @@
1
1
  Accessible, signal-driven chart library for cascivo — AreaChart, BarChart, LineChart, Sparkline, Heatmap, and more. All charts are keyboard-navigable with `aria-live` tooltips. CVD-safe palettes (Okabe-Ito, oklch) verified in CI across all {{count.themes}} themes.
2
2
 
3
+ > **Docs offline?** The full cascivo reference ships as an npm package — `npx -y @cascivo/docs`, no website needed.
4
+
3
5
  ## Install
4
6
 
5
7
  ```sh
@@ -31,6 +33,24 @@ export function Traffic() {
31
33
  Charts are CSS-token-themed: drop them inside any element carrying a `data-theme` (or import a
32
34
  theme stylesheet) and they pick up the same palette, radii, and typography as the rest of cascivo.
33
35
 
36
+ ### Sizing — responsive by default
37
+
38
+ **Omit `width`** and the chart fills and tracks its container (a `ResizeObserver`
39
+ watches the slot), so a chart drops cleanly into a responsive `Card` or grid cell with
40
+ no measuring on your part. `height` defaults to `300` (px); set it to change the aspect.
41
+
42
+ Pass an explicit `width` only for a fixed-size export — and even then it is **clamped to
43
+ the container** (`max-inline-size: 100%`), so an over-wide `width` scales down instead of
44
+ overflowing and clipping data. To size another element to match a chart, or to build a
45
+ custom chart, use the exported `useChartSize()` hook.
46
+
47
+ ```tsx
48
+ <Card>
49
+ <LineChart data={data} /> {/* fills the card, resizes with it */}
50
+ </Card>
51
+ <LineChart data={data} height={160} /> {/* shorter, still full-width */}
52
+ ```
53
+
34
54
  > **Vite SSR (TanStack Start, Remix, vite-ssr, workerd)?** Like the rest of cascivo, the
35
55
  > chart CSS ships as side-effect imports a bare server loader can't resolve — mark
36
56
  > `ssr: { noExternal: [/^@cascivo\//] }` (the pattern already covers `@cascivo/charts`) and