@classic-homes/charts-react 0.2.1 → 0.3.0

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/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # @classic-homes/charts-react
2
+
3
+ React ECharts components for the Classic Theme design system. Charts pick up the Classic light and dark themes from `@classic-homes/charts-core`.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @classic-homes/charts-react echarts react react-dom
9
+ ```
10
+
11
+ Peer dependencies: `echarts@^5.5.0`, `react@^18 || ^19`, `react-dom@^18 || ^19`.
12
+
13
+ ## Quick Start
14
+
15
+ ```tsx
16
+ import { LineChart } from '@classic-homes/charts-react';
17
+
18
+ const data = {
19
+ categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
20
+ series: [
21
+ { name: '2024', data: [120, 132, 101, 134, 90, 230] },
22
+ { name: '2025', data: [220, 182, 191, 234, 290, 330] },
23
+ ],
24
+ };
25
+
26
+ export function RevenueChart() {
27
+ return <LineChart data={data} />;
28
+ }
29
+ ```
30
+
31
+ ## Exports
32
+
33
+ - **Core charts**: `LineChart`, `BarChart`, `PieChart`, `AreaChart`, `ScatterChart`, `DonutChart`
34
+ - **Extended charts**: `RadarChart`, `FunnelChart`, `GaugeChart`, `HeatmapChart`, `TreemapChart`, `CandlestickChart`, `SankeyChart`
35
+ - **Base components**: `ChartContainer`, `ChartSkeleton`, `ChartError`, `ChartEmpty`, `ChartLegend`
36
+ - **Hooks**: `useChart`, `useChartTheme`, `useChartResize`, `useReducedMotion`, `registerClassicThemes`, `useChartLegend`
37
+ - **Utilities**: `cn`
38
+ - **Types**: component props (`LineChartComponentProps`, ...) and the chart data and event types re-exported from `@classic-homes/charts-core`
39
+
40
+ Chart data and option types come from `@classic-homes/charts-core/types`.
41
+
42
+ ```tsx
43
+ import type { LineChartData } from '@classic-homes/charts-core/types';
44
+ ```