@internetstiftelsen/charts 0.17.0 → 0.18.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 +4 -4
- package/dist/index.d.ts +26 -0
- package/dist/index.js +24 -0
- package/docs/getting-started.md +13 -9
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -88,10 +88,7 @@ Builds the demo app using the default Vite config.
|
|
|
88
88
|
## Quick Start
|
|
89
89
|
|
|
90
90
|
```javascript
|
|
91
|
-
import { XYChart } from '@internetstiftelsen/charts
|
|
92
|
-
import { Line } from '@internetstiftelsen/charts/line';
|
|
93
|
-
import { XAxis } from '@internetstiftelsen/charts/x-axis';
|
|
94
|
-
import { YAxis } from '@internetstiftelsen/charts/y-axis';
|
|
91
|
+
import { Line, XAxis, XYChart, YAxis } from '@internetstiftelsen/charts';
|
|
95
92
|
|
|
96
93
|
const data = [
|
|
97
94
|
{ date: '2023', revenue: 100, expenses: 80 },
|
|
@@ -109,6 +106,9 @@ chart
|
|
|
109
106
|
chart.render('#chart-container');
|
|
110
107
|
```
|
|
111
108
|
|
|
109
|
+
Subpath imports like `@internetstiftelsen/charts/xy-chart` remain available when
|
|
110
|
+
you want to import individual modules directly.
|
|
111
|
+
|
|
112
112
|
Use top-level `width` and `height` for fixed-size charts, or omit them to size
|
|
113
113
|
from the render container.
|
|
114
114
|
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export * from './area.js';
|
|
2
|
+
export * from './bar.js';
|
|
3
|
+
export * from './base-chart.js';
|
|
4
|
+
export * from './chart-group.js';
|
|
5
|
+
export * from './chart-interface.js';
|
|
6
|
+
export * from './donut-center-content.js';
|
|
7
|
+
export * from './donut-chart.js';
|
|
8
|
+
export * from './gauge-chart.js';
|
|
9
|
+
export * from './grid.js';
|
|
10
|
+
export * from './legend.js';
|
|
11
|
+
export * from './line.js';
|
|
12
|
+
export * from './pie-chart.js';
|
|
13
|
+
export * from './scatter.js';
|
|
14
|
+
export * from './text.js';
|
|
15
|
+
export * from './theme.js';
|
|
16
|
+
export * from './title.js';
|
|
17
|
+
export * from './tooltip.js';
|
|
18
|
+
export * from './types.js';
|
|
19
|
+
export * from './word-cloud-chart.js';
|
|
20
|
+
export * from './x-axis.js';
|
|
21
|
+
export * from './xy-chart.js';
|
|
22
|
+
export * from './y-axis.js';
|
|
23
|
+
export { mountChartWhenVisible } from './lazy-mount.js';
|
|
24
|
+
export type { LazyChartFactory, LazyChartMountHandle, LazyChartMountOptions, LazyMountableChart, } from './lazy-mount.js';
|
|
25
|
+
export { toChartData } from './utils.js';
|
|
26
|
+
export type { GroupedStringParseOptions, ToChartDataOptions } from './utils.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export * from './area.js';
|
|
2
|
+
export * from './bar.js';
|
|
3
|
+
export * from './base-chart.js';
|
|
4
|
+
export * from './chart-group.js';
|
|
5
|
+
export * from './chart-interface.js';
|
|
6
|
+
export * from './donut-center-content.js';
|
|
7
|
+
export * from './donut-chart.js';
|
|
8
|
+
export * from './gauge-chart.js';
|
|
9
|
+
export * from './grid.js';
|
|
10
|
+
export * from './legend.js';
|
|
11
|
+
export * from './line.js';
|
|
12
|
+
export * from './pie-chart.js';
|
|
13
|
+
export * from './scatter.js';
|
|
14
|
+
export * from './text.js';
|
|
15
|
+
export * from './theme.js';
|
|
16
|
+
export * from './title.js';
|
|
17
|
+
export * from './tooltip.js';
|
|
18
|
+
export * from './types.js';
|
|
19
|
+
export * from './word-cloud-chart.js';
|
|
20
|
+
export * from './x-axis.js';
|
|
21
|
+
export * from './xy-chart.js';
|
|
22
|
+
export * from './y-axis.js';
|
|
23
|
+
export { mountChartWhenVisible } from './lazy-mount.js';
|
|
24
|
+
export { toChartData } from './utils.js';
|
package/docs/getting-started.md
CHANGED
|
@@ -11,15 +11,16 @@ npm install @internetstiftelsen/charts
|
|
|
11
11
|
## Vanilla JavaScript
|
|
12
12
|
|
|
13
13
|
```javascript
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
import {
|
|
15
|
+
Grid,
|
|
16
|
+
Legend,
|
|
17
|
+
Line,
|
|
18
|
+
Title,
|
|
19
|
+
Tooltip,
|
|
20
|
+
XAxis,
|
|
21
|
+
XYChart,
|
|
22
|
+
YAxis,
|
|
23
|
+
} from '@internetstiftelsen/charts';
|
|
23
24
|
|
|
24
25
|
// Your data
|
|
25
26
|
const data = [
|
|
@@ -57,6 +58,9 @@ chart.update(newData);
|
|
|
57
58
|
chart.destroy();
|
|
58
59
|
```
|
|
59
60
|
|
|
61
|
+
Subpath imports like `@internetstiftelsen/charts/xy-chart` remain available when
|
|
62
|
+
you want to import individual modules directly.
|
|
63
|
+
|
|
60
64
|
## Lifecycle Events
|
|
61
65
|
|
|
62
66
|
Charts support lifecycle listeners with `on()` and `off()`.
|
package/package.json
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.18.0",
|
|
3
3
|
"name": "@internetstiftelsen/charts",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"main": "./dist/index.js",
|
|
6
9
|
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json",
|
|
7
15
|
"./*": {
|
|
8
16
|
"types": "./dist/*.d.ts",
|
|
9
17
|
"import": "./dist/*.js"
|
|
10
|
-
}
|
|
11
|
-
"./package.json": "./package.json"
|
|
18
|
+
}
|
|
12
19
|
},
|
|
13
20
|
"files": [
|
|
14
21
|
"dist",
|