@classic-homes/charts-core 0.3.0 → 0.3.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/README.md +43 -0
- package/package.json +25 -10
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @classic-homes/charts-core
|
|
2
|
+
|
|
3
|
+
Framework-agnostic utilities, types, and ECharts themes for Classic Theme chart components. This package is the shared foundation for `@classic-homes/charts-react` and `@classic-homes/charts-svelte`.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @classic-homes/charts-core echarts
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependency: `echarts@^5.5.0`.
|
|
12
|
+
|
|
13
|
+
## Exports
|
|
14
|
+
|
|
15
|
+
| Import | Contents |
|
|
16
|
+
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| `@classic-homes/charts-core` | Themes, chart color helpers, prop and data types, formatting and data utilities |
|
|
18
|
+
| `@classic-homes/charts-core/theme` | `generateLightTheme`, `generateDarkTheme`, `lightTheme`, `darkTheme`, `THEME_LIGHT`, `THEME_DARK`, `lightChartColors`, `darkChartColors`, `getChartColors`, `colorWithAlpha` |
|
|
19
|
+
| `@classic-homes/charts-core/types` | Chart prop, data, and event types (`LineChartData`, `BarChartProps`, `ChartEventHandlers`, ...) |
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
### Themes
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { lightTheme, darkTheme } from '@classic-homes/charts-core/theme';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Types
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import type { LineChartData, BarChartData, PieSliceData } from '@classic-homes/charts-core/types';
|
|
33
|
+
|
|
34
|
+
const revenue: LineChartData = {
|
|
35
|
+
categories: ['Jan', 'Feb', 'Mar'],
|
|
36
|
+
series: [{ name: '2025', data: [120, 132, 101] }],
|
|
37
|
+
};
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Related Packages
|
|
41
|
+
|
|
42
|
+
- `@classic-homes/charts-react`: React ECharts components
|
|
43
|
+
- `@classic-homes/charts-svelte`: Svelte ECharts components
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classic-homes/charts-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Core utilities and theme for Classic Theme charts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -8,19 +8,34 @@
|
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.cts",
|
|
17
|
+
"default": "./dist/index.cjs"
|
|
18
|
+
}
|
|
14
19
|
},
|
|
15
20
|
"./theme": {
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/theme/index.d.ts",
|
|
23
|
+
"default": "./dist/theme/index.js"
|
|
24
|
+
},
|
|
25
|
+
"require": {
|
|
26
|
+
"types": "./dist/theme/index.d.cts",
|
|
27
|
+
"default": "./dist/theme/index.cjs"
|
|
28
|
+
}
|
|
19
29
|
},
|
|
20
30
|
"./types": {
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./dist/types/index.d.ts",
|
|
33
|
+
"default": "./dist/types/index.js"
|
|
34
|
+
},
|
|
35
|
+
"require": {
|
|
36
|
+
"types": "./dist/types/index.d.cts",
|
|
37
|
+
"default": "./dist/types/index.cjs"
|
|
38
|
+
}
|
|
24
39
|
}
|
|
25
40
|
},
|
|
26
41
|
"sideEffects": false,
|