@classic-homes/charts-svelte 0.3.0 → 0.3.2
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,50 @@
|
|
|
1
|
+
# @classic-homes/charts-svelte
|
|
2
|
+
|
|
3
|
+
Svelte 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-svelte echarts svelte
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependencies: `echarts@^5.5.0`, `svelte@^5.20.0`.
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```svelte
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
import { LineChart } from '@classic-homes/charts-svelte';
|
|
18
|
+
|
|
19
|
+
const data = {
|
|
20
|
+
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
|
|
21
|
+
series: [
|
|
22
|
+
{ name: '2024', data: [120, 132, 101, 134, 90, 230] },
|
|
23
|
+
{ name: '2025', data: [220, 182, 191, 234, 290, 330] },
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<LineChart title="Monthly Revenue" {data} smooth height={400} />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Exports
|
|
32
|
+
|
|
33
|
+
- **Charts**: `LineChart`, `BarChart`, `PieChart`, `AreaChart`, `ScatterChart`, `DonutChart`, `RadarChart`, `FunnelChart`, `GaugeChart`, `HeatmapChart`, `TreemapChart`, `CandlestickChart`, `SankeyChart`, `ComboChart`, `DotPlotChart`, `BulletChart`, `HistogramChart`, `BoxPlotChart`, `WaterfallChart`
|
|
34
|
+
- **Stat helpers**: `Sparkline`, `StatCard`, `StatGroup`
|
|
35
|
+
- **Base components**: `ChartContainer`, `ChartSkeleton`, `ChartError`, `ChartEmpty`, `ChartLegend`, `ChartDataTable`
|
|
36
|
+
- **Composables**: `useChart`, `useChartTheme`, `useChartResize`, `useChartLegend`, `useReducedMotion`, `registerClassicThemes`, `registerEchartsModules`, `exportChartImage`
|
|
37
|
+
- **Data helpers** (from `@classic-homes/charts-core`): `fromRecords`, `toSliceData`, `binValues`, `boxplotStats`, `waterfallLayout`, `formatValue`, `computeDelta`, `tableToCsv`, `downloadCsv`
|
|
38
|
+
|
|
39
|
+
Chart data and option types are exported from the package root, and also from `@classic-homes/charts-core/types`.
|
|
40
|
+
|
|
41
|
+
```svelte
|
|
42
|
+
<script lang="ts">
|
|
43
|
+
import { ChartSkeleton, DonutChart, type PieSliceData } from '@classic-homes/charts-svelte';
|
|
44
|
+
</script>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Related Packages
|
|
48
|
+
|
|
49
|
+
- `@classic-homes/charts-core`: shared themes, types, and utilities
|
|
50
|
+
- `@classic-homes/charts-react`: React equivalents for the core and extended charts
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<button
|
|
44
44
|
type="button"
|
|
45
45
|
onclick={onRetry}
|
|
46
|
-
class="rounded-md bg-destructive px-3 py-1.5 text-xs font-medium text-destructive-foreground
|
|
46
|
+
class="rounded-md bg-destructive px-3 py-1.5 text-xs font-medium text-destructive-foreground hover:bg-destructive/90"
|
|
47
47
|
>
|
|
48
48
|
Retry
|
|
49
49
|
</button>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classic-homes/charts-svelte",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Svelte ECharts components for Classic Theme",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"svelte": "./dist/lib/index.js",
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@classic-homes/charts-core": "*",
|
|
29
|
-
"@classic-homes/theme-tokens": "*",
|
|
30
29
|
"clsx": "^2.1.0",
|
|
31
30
|
"tailwind-merge": "^2.2.0"
|
|
32
31
|
},
|