nuxt-echarts 0.0.7 → 0.0.8
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/LICENSE +21 -21
- package/README.md +1 -1
- package/dist/module.d.mts +8 -7
- package/dist/module.d.ts +8 -7
- package/dist/module.json +1 -1
- package/dist/runtime/components/VChart.client.d.ts +126 -126
- package/dist/runtime/components/VChart.server.vue +5 -5
- package/dist/runtime/components/VChartIsland.server.vue +34 -34
- package/dist/runtime/components/VChartLight.vue +55 -55
- package/dist/runtime/components/VChartLight.vue.d.ts +26 -0
- package/dist/runtime/components/VChartServer.vue +50 -50
- package/dist/runtime/composables/autoresize.d.ts +11 -0
- package/dist/runtime/composables/loading.d.ts +1 -1
- package/dist/runtime/utils/injection.d.ts +3 -3
- package/dist/runtime/utils/wc.d.ts +6 -0
- package/package.json +5 -4
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 - present, Yue JIN
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 - present, Yue JIN
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Nuxt Module for Apache ECharts™
|
|
|
13
13
|
>
|
|
14
14
|
> Nuxt ECharts is currently in active development and based on [experimental `<NuxtIsland>`](https://nuxt.com/docs/api/components/nuxt-island). If you found any issue, design flaw, or have ideas to improve it, please open an [issue](https://github.com/kingyue737/nuxt-echarts/issues) or a [Discussion](https://github.com/kingyue737/nuxt-echarts/discussions).
|
|
15
15
|
|
|
16
|
-
- [📖 Documentation
|
|
16
|
+
- [📖 Documentation](https://echarts.nuxt.dev)
|
|
17
17
|
|
|
18
18
|
- [✨ Release Notes](/CHANGELOG.md)
|
|
19
19
|
- [🎞️ Online Demo](https://nuxt-echarts.nuxt.dev/)
|
package/dist/module.d.mts
CHANGED
|
@@ -9,26 +9,27 @@ type FeaturesName = keyof typeof echartsFeatures;
|
|
|
9
9
|
type RendererName = 'canvas' | 'svg';
|
|
10
10
|
interface ModuleOptions {
|
|
11
11
|
/**
|
|
12
|
+
* Register the renderer used by `<VChart>`
|
|
12
13
|
* @default 'canvas'
|
|
13
14
|
*/
|
|
14
15
|
renderer?: RendererName | RendererName[];
|
|
15
16
|
/**
|
|
16
|
-
* Register the
|
|
17
|
-
* (imported only if
|
|
17
|
+
* Register the charts used by `<VChart>`
|
|
18
|
+
* (imported only if `<VChart>` is used)
|
|
18
19
|
*/
|
|
19
20
|
charts?: ChartName[];
|
|
20
21
|
/**
|
|
21
|
-
* Register the
|
|
22
|
-
* (imported only if
|
|
22
|
+
* Register the components used by `<VChart>`
|
|
23
|
+
* (imported only if `<VChart>` is used)
|
|
23
24
|
*/
|
|
24
25
|
components?: ComponentName[];
|
|
25
26
|
/**
|
|
26
|
-
* Register the
|
|
27
|
-
* (imported only if
|
|
27
|
+
* Register the features used by `<VChart>`
|
|
28
|
+
* (imported only if `<VChart>` is used)
|
|
28
29
|
*/
|
|
29
30
|
features?: FeaturesName[];
|
|
30
31
|
/**
|
|
31
|
-
* This
|
|
32
|
+
* This option indicates if `<VChart>` should also render on server.
|
|
32
33
|
* By default, it only render on client.
|
|
33
34
|
*
|
|
34
35
|
* @default false
|
package/dist/module.d.ts
CHANGED
|
@@ -9,26 +9,27 @@ type FeaturesName = keyof typeof echartsFeatures;
|
|
|
9
9
|
type RendererName = 'canvas' | 'svg';
|
|
10
10
|
interface ModuleOptions {
|
|
11
11
|
/**
|
|
12
|
+
* Register the renderer used by `<VChart>`
|
|
12
13
|
* @default 'canvas'
|
|
13
14
|
*/
|
|
14
15
|
renderer?: RendererName | RendererName[];
|
|
15
16
|
/**
|
|
16
|
-
* Register the
|
|
17
|
-
* (imported only if
|
|
17
|
+
* Register the charts used by `<VChart>`
|
|
18
|
+
* (imported only if `<VChart>` is used)
|
|
18
19
|
*/
|
|
19
20
|
charts?: ChartName[];
|
|
20
21
|
/**
|
|
21
|
-
* Register the
|
|
22
|
-
* (imported only if
|
|
22
|
+
* Register the components used by `<VChart>`
|
|
23
|
+
* (imported only if `<VChart>` is used)
|
|
23
24
|
*/
|
|
24
25
|
components?: ComponentName[];
|
|
25
26
|
/**
|
|
26
|
-
* Register the
|
|
27
|
-
* (imported only if
|
|
27
|
+
* Register the features used by `<VChart>`
|
|
28
|
+
* (imported only if `<VChart>` is used)
|
|
28
29
|
*/
|
|
29
30
|
features?: FeaturesName[];
|
|
30
31
|
/**
|
|
31
|
-
* This
|
|
32
|
+
* This option indicates if `<VChart>` should also render on server.
|
|
32
33
|
* By default, it only render on client.
|
|
33
34
|
*
|
|
34
35
|
* @default false
|
package/dist/module.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { type PropType } from 'vue';
|
|
2
|
-
import type { Option, Theme, UpdateOptions } from '../types.js';
|
|
2
|
+
import type { Option, Theme, InitOptions, UpdateOptions } from '../types.js';
|
|
3
3
|
import { type EChartsElement } from '../utils/wc.js';
|
|
4
4
|
import '#build/echarts.mjs';
|
|
5
5
|
declare const _default: import("vue").DefineComponent<{
|
|
6
6
|
loading: BooleanConstructor;
|
|
7
7
|
loadingOptions: PropType<import("../types").LoadingOptions>;
|
|
8
8
|
autoresize: PropType<boolean | {
|
|
9
|
-
throttle?: number
|
|
10
|
-
onResize?: (
|
|
9
|
+
throttle?: number;
|
|
10
|
+
onResize?: () => void;
|
|
11
11
|
}>;
|
|
12
|
-
option: PropType<
|
|
12
|
+
option: PropType<Option>;
|
|
13
13
|
theme: {
|
|
14
14
|
type: PropType<Theme>;
|
|
15
15
|
};
|
|
16
|
-
initOptions: PropType<
|
|
17
|
-
updateOptions: PropType<
|
|
16
|
+
initOptions: PropType<InitOptions>;
|
|
17
|
+
updateOptions: PropType<UpdateOptions>;
|
|
18
18
|
group: StringConstructor;
|
|
19
19
|
manualUpdate: BooleanConstructor;
|
|
20
20
|
}, {
|
|
@@ -22,138 +22,138 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
22
22
|
getHeight: () => number;
|
|
23
23
|
getDom: () => HTMLElement;
|
|
24
24
|
getOption: () => import("echarts/core").EChartsCoreOption;
|
|
25
|
-
resize: (opts?: import("echarts/core").ResizeOpts
|
|
25
|
+
resize: (opts?: import("echarts/core").ResizeOpts) => void;
|
|
26
26
|
dispatchAction: (payload: import("echarts/core").Payload, opt?: boolean | {
|
|
27
|
-
silent?: boolean
|
|
27
|
+
silent?: boolean;
|
|
28
28
|
flush?: boolean | undefined;
|
|
29
|
-
}
|
|
29
|
+
}) => void;
|
|
30
30
|
convertToPixel: {
|
|
31
31
|
(finder: string | {
|
|
32
|
-
seriesIndex?:
|
|
33
|
-
seriesId?: (
|
|
34
|
-
seriesName?: (
|
|
35
|
-
geoIndex?:
|
|
36
|
-
geoId?: (
|
|
37
|
-
geoName?: (
|
|
38
|
-
bmapIndex?:
|
|
39
|
-
bmapId?: (
|
|
40
|
-
bmapName?: (
|
|
41
|
-
xAxisIndex?:
|
|
42
|
-
xAxisId?: (
|
|
43
|
-
xAxisName?: (
|
|
44
|
-
yAxisIndex?:
|
|
45
|
-
yAxisId?: (
|
|
46
|
-
yAxisName?: (
|
|
47
|
-
gridIndex?:
|
|
48
|
-
gridId?: (
|
|
49
|
-
gridName?: (
|
|
50
|
-
dataIndex?: number
|
|
51
|
-
dataIndexInside?: number
|
|
32
|
+
seriesIndex?: number | false | number[] | "all" | "none";
|
|
33
|
+
seriesId?: (string | number) | (string | number)[];
|
|
34
|
+
seriesName?: (string | number) | (string | number)[];
|
|
35
|
+
geoIndex?: number | false | number[] | "all" | "none";
|
|
36
|
+
geoId?: (string | number) | (string | number)[];
|
|
37
|
+
geoName?: (string | number) | (string | number)[];
|
|
38
|
+
bmapIndex?: number | false | number[] | "all" | "none";
|
|
39
|
+
bmapId?: (string | number) | (string | number)[];
|
|
40
|
+
bmapName?: (string | number) | (string | number)[];
|
|
41
|
+
xAxisIndex?: number | false | number[] | "all" | "none";
|
|
42
|
+
xAxisId?: (string | number) | (string | number)[];
|
|
43
|
+
xAxisName?: (string | number) | (string | number)[];
|
|
44
|
+
yAxisIndex?: number | false | number[] | "all" | "none";
|
|
45
|
+
yAxisId?: (string | number) | (string | number)[];
|
|
46
|
+
yAxisName?: (string | number) | (string | number)[];
|
|
47
|
+
gridIndex?: number | false | number[] | "all" | "none";
|
|
48
|
+
gridId?: (string | number) | (string | number)[];
|
|
49
|
+
gridName?: (string | number) | (string | number)[];
|
|
50
|
+
dataIndex?: number;
|
|
51
|
+
dataIndexInside?: number;
|
|
52
52
|
}, value: (string | number) | Date): number;
|
|
53
53
|
(finder: string | {
|
|
54
|
-
seriesIndex?:
|
|
55
|
-
seriesId?: (
|
|
56
|
-
seriesName?: (
|
|
57
|
-
geoIndex?:
|
|
58
|
-
geoId?: (
|
|
59
|
-
geoName?: (
|
|
60
|
-
bmapIndex?:
|
|
61
|
-
bmapId?: (
|
|
62
|
-
bmapName?: (
|
|
63
|
-
xAxisIndex?:
|
|
64
|
-
xAxisId?: (
|
|
65
|
-
xAxisName?: (
|
|
66
|
-
yAxisIndex?:
|
|
67
|
-
yAxisId?: (
|
|
68
|
-
yAxisName?: (
|
|
69
|
-
gridIndex?:
|
|
70
|
-
gridId?: (
|
|
71
|
-
gridName?: (
|
|
72
|
-
dataIndex?: number
|
|
73
|
-
dataIndexInside?: number
|
|
54
|
+
seriesIndex?: number | false | number[] | "all" | "none";
|
|
55
|
+
seriesId?: (string | number) | (string | number)[];
|
|
56
|
+
seriesName?: (string | number) | (string | number)[];
|
|
57
|
+
geoIndex?: number | false | number[] | "all" | "none";
|
|
58
|
+
geoId?: (string | number) | (string | number)[];
|
|
59
|
+
geoName?: (string | number) | (string | number)[];
|
|
60
|
+
bmapIndex?: number | false | number[] | "all" | "none";
|
|
61
|
+
bmapId?: (string | number) | (string | number)[];
|
|
62
|
+
bmapName?: (string | number) | (string | number)[];
|
|
63
|
+
xAxisIndex?: number | false | number[] | "all" | "none";
|
|
64
|
+
xAxisId?: (string | number) | (string | number)[];
|
|
65
|
+
xAxisName?: (string | number) | (string | number)[];
|
|
66
|
+
yAxisIndex?: number | false | number[] | "all" | "none";
|
|
67
|
+
yAxisId?: (string | number) | (string | number)[];
|
|
68
|
+
yAxisName?: (string | number) | (string | number)[];
|
|
69
|
+
gridIndex?: number | false | number[] | "all" | "none";
|
|
70
|
+
gridId?: (string | number) | (string | number)[];
|
|
71
|
+
gridName?: (string | number) | (string | number)[];
|
|
72
|
+
dataIndex?: number;
|
|
73
|
+
dataIndexInside?: number;
|
|
74
74
|
}, value: ((string | number) | Date)[]): number[];
|
|
75
75
|
};
|
|
76
76
|
convertFromPixel: {
|
|
77
77
|
(finder: string | {
|
|
78
|
-
seriesIndex?:
|
|
79
|
-
seriesId?: (
|
|
80
|
-
seriesName?: (
|
|
81
|
-
geoIndex?:
|
|
82
|
-
geoId?: (
|
|
83
|
-
geoName?: (
|
|
84
|
-
bmapIndex?:
|
|
85
|
-
bmapId?: (
|
|
86
|
-
bmapName?: (
|
|
87
|
-
xAxisIndex?:
|
|
88
|
-
xAxisId?: (
|
|
89
|
-
xAxisName?: (
|
|
90
|
-
yAxisIndex?:
|
|
91
|
-
yAxisId?: (
|
|
92
|
-
yAxisName?: (
|
|
93
|
-
gridIndex?:
|
|
94
|
-
gridId?: (
|
|
95
|
-
gridName?: (
|
|
96
|
-
dataIndex?: number
|
|
97
|
-
dataIndexInside?: number
|
|
78
|
+
seriesIndex?: number | false | number[] | "all" | "none";
|
|
79
|
+
seriesId?: (string | number) | (string | number)[];
|
|
80
|
+
seriesName?: (string | number) | (string | number)[];
|
|
81
|
+
geoIndex?: number | false | number[] | "all" | "none";
|
|
82
|
+
geoId?: (string | number) | (string | number)[];
|
|
83
|
+
geoName?: (string | number) | (string | number)[];
|
|
84
|
+
bmapIndex?: number | false | number[] | "all" | "none";
|
|
85
|
+
bmapId?: (string | number) | (string | number)[];
|
|
86
|
+
bmapName?: (string | number) | (string | number)[];
|
|
87
|
+
xAxisIndex?: number | false | number[] | "all" | "none";
|
|
88
|
+
xAxisId?: (string | number) | (string | number)[];
|
|
89
|
+
xAxisName?: (string | number) | (string | number)[];
|
|
90
|
+
yAxisIndex?: number | false | number[] | "all" | "none";
|
|
91
|
+
yAxisId?: (string | number) | (string | number)[];
|
|
92
|
+
yAxisName?: (string | number) | (string | number)[];
|
|
93
|
+
gridIndex?: number | false | number[] | "all" | "none";
|
|
94
|
+
gridId?: (string | number) | (string | number)[];
|
|
95
|
+
gridName?: (string | number) | (string | number)[];
|
|
96
|
+
dataIndex?: number;
|
|
97
|
+
dataIndexInside?: number;
|
|
98
98
|
}, value: number): number;
|
|
99
99
|
(finder: string | {
|
|
100
|
-
seriesIndex?:
|
|
101
|
-
seriesId?: (
|
|
102
|
-
seriesName?: (
|
|
103
|
-
geoIndex?:
|
|
104
|
-
geoId?: (
|
|
105
|
-
geoName?: (
|
|
106
|
-
bmapIndex?:
|
|
107
|
-
bmapId?: (
|
|
108
|
-
bmapName?: (
|
|
109
|
-
xAxisIndex?:
|
|
110
|
-
xAxisId?: (
|
|
111
|
-
xAxisName?: (
|
|
112
|
-
yAxisIndex?:
|
|
113
|
-
yAxisId?: (
|
|
114
|
-
yAxisName?: (
|
|
115
|
-
gridIndex?:
|
|
116
|
-
gridId?: (
|
|
117
|
-
gridName?: (
|
|
118
|
-
dataIndex?: number
|
|
119
|
-
dataIndexInside?: number
|
|
100
|
+
seriesIndex?: number | false | number[] | "all" | "none";
|
|
101
|
+
seriesId?: (string | number) | (string | number)[];
|
|
102
|
+
seriesName?: (string | number) | (string | number)[];
|
|
103
|
+
geoIndex?: number | false | number[] | "all" | "none";
|
|
104
|
+
geoId?: (string | number) | (string | number)[];
|
|
105
|
+
geoName?: (string | number) | (string | number)[];
|
|
106
|
+
bmapIndex?: number | false | number[] | "all" | "none";
|
|
107
|
+
bmapId?: (string | number) | (string | number)[];
|
|
108
|
+
bmapName?: (string | number) | (string | number)[];
|
|
109
|
+
xAxisIndex?: number | false | number[] | "all" | "none";
|
|
110
|
+
xAxisId?: (string | number) | (string | number)[];
|
|
111
|
+
xAxisName?: (string | number) | (string | number)[];
|
|
112
|
+
yAxisIndex?: number | false | number[] | "all" | "none";
|
|
113
|
+
yAxisId?: (string | number) | (string | number)[];
|
|
114
|
+
yAxisName?: (string | number) | (string | number)[];
|
|
115
|
+
gridIndex?: number | false | number[] | "all" | "none";
|
|
116
|
+
gridId?: (string | number) | (string | number)[];
|
|
117
|
+
gridName?: (string | number) | (string | number)[];
|
|
118
|
+
dataIndex?: number;
|
|
119
|
+
dataIndexInside?: number;
|
|
120
120
|
}, value: number[]): number[];
|
|
121
121
|
};
|
|
122
122
|
containPixel: (finder: string | {
|
|
123
|
-
seriesIndex?:
|
|
124
|
-
seriesId?: (
|
|
125
|
-
seriesName?: (
|
|
126
|
-
geoIndex?:
|
|
127
|
-
geoId?: (
|
|
128
|
-
geoName?: (
|
|
129
|
-
bmapIndex?:
|
|
130
|
-
bmapId?: (
|
|
131
|
-
bmapName?: (
|
|
132
|
-
xAxisIndex?:
|
|
133
|
-
xAxisId?: (
|
|
134
|
-
xAxisName?: (
|
|
135
|
-
yAxisIndex?:
|
|
136
|
-
yAxisId?: (
|
|
137
|
-
yAxisName?: (
|
|
138
|
-
gridIndex?:
|
|
139
|
-
gridId?: (
|
|
140
|
-
gridName?: (
|
|
141
|
-
dataIndex?: number
|
|
142
|
-
dataIndexInside?: number
|
|
123
|
+
seriesIndex?: number | false | number[] | "all" | "none";
|
|
124
|
+
seriesId?: (string | number) | (string | number)[];
|
|
125
|
+
seriesName?: (string | number) | (string | number)[];
|
|
126
|
+
geoIndex?: number | false | number[] | "all" | "none";
|
|
127
|
+
geoId?: (string | number) | (string | number)[];
|
|
128
|
+
geoName?: (string | number) | (string | number)[];
|
|
129
|
+
bmapIndex?: number | false | number[] | "all" | "none";
|
|
130
|
+
bmapId?: (string | number) | (string | number)[];
|
|
131
|
+
bmapName?: (string | number) | (string | number)[];
|
|
132
|
+
xAxisIndex?: number | false | number[] | "all" | "none";
|
|
133
|
+
xAxisId?: (string | number) | (string | number)[];
|
|
134
|
+
xAxisName?: (string | number) | (string | number)[];
|
|
135
|
+
yAxisIndex?: number | false | number[] | "all" | "none";
|
|
136
|
+
yAxisId?: (string | number) | (string | number)[];
|
|
137
|
+
yAxisName?: (string | number) | (string | number)[];
|
|
138
|
+
gridIndex?: number | false | number[] | "all" | "none";
|
|
139
|
+
gridId?: (string | number) | (string | number)[];
|
|
140
|
+
gridName?: (string | number) | (string | number)[];
|
|
141
|
+
dataIndex?: number;
|
|
142
|
+
dataIndexInside?: number;
|
|
143
143
|
}, value: number[]) => boolean;
|
|
144
144
|
getDataURL: (opts?: {
|
|
145
|
-
type?: "
|
|
146
|
-
pixelRatio?: number
|
|
147
|
-
backgroundColor?: import("echarts/core").Color
|
|
148
|
-
excludeComponents?: string[]
|
|
149
|
-
}
|
|
145
|
+
type?: "png" | "jpeg" | "svg";
|
|
146
|
+
pixelRatio?: number;
|
|
147
|
+
backgroundColor?: import("echarts/core").Color;
|
|
148
|
+
excludeComponents?: string[];
|
|
149
|
+
}) => string;
|
|
150
150
|
getConnectedDataURL: (opts?: {
|
|
151
|
-
type?: "
|
|
152
|
-
pixelRatio?: number
|
|
153
|
-
backgroundColor?: import("echarts/core").Color
|
|
154
|
-
connectedBackgroundColor?: import("echarts/core").Color
|
|
155
|
-
excludeComponents?: string[]
|
|
156
|
-
}
|
|
151
|
+
type?: "png" | "jpeg" | "svg";
|
|
152
|
+
pixelRatio?: number;
|
|
153
|
+
backgroundColor?: import("echarts/core").Color;
|
|
154
|
+
connectedBackgroundColor?: import("echarts/core").Color;
|
|
155
|
+
excludeComponents?: string[];
|
|
156
|
+
}) => string;
|
|
157
157
|
appendData: (params: {
|
|
158
158
|
seriesIndex: number;
|
|
159
159
|
data: any;
|
|
@@ -163,7 +163,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
163
163
|
dispose: () => void;
|
|
164
164
|
chart: import("vue").ShallowRef<import("echarts/core").ECharts | undefined>;
|
|
165
165
|
root: import("vue").ShallowRef<EChartsElement | undefined>;
|
|
166
|
-
inner: import("vue").ShallowRef<
|
|
166
|
+
inner: import("vue").ShallowRef<HTMLElement | undefined>;
|
|
167
167
|
setOption: (option: Option, updateOptions?: UpdateOptions) => void;
|
|
168
168
|
nonEventAttrs: import("vue").ComputedRef<{
|
|
169
169
|
[x: string]: any;
|
|
@@ -234,15 +234,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
234
234
|
loading: BooleanConstructor;
|
|
235
235
|
loadingOptions: PropType<import("../types").LoadingOptions>;
|
|
236
236
|
autoresize: PropType<boolean | {
|
|
237
|
-
throttle?: number
|
|
238
|
-
onResize?: (
|
|
237
|
+
throttle?: number;
|
|
238
|
+
onResize?: () => void;
|
|
239
239
|
}>;
|
|
240
|
-
option: PropType<
|
|
240
|
+
option: PropType<Option>;
|
|
241
241
|
theme: {
|
|
242
242
|
type: PropType<Theme>;
|
|
243
243
|
};
|
|
244
|
-
initOptions: PropType<
|
|
245
|
-
updateOptions: PropType<
|
|
244
|
+
initOptions: PropType<InitOptions>;
|
|
245
|
+
updateOptions: PropType<UpdateOptions>;
|
|
246
246
|
group: StringConstructor;
|
|
247
247
|
manualUpdate: BooleanConstructor;
|
|
248
248
|
}>> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<script setup lang="ts"></script>
|
|
2
|
-
|
|
3
|
-
<template>
|
|
4
|
-
<VChartServer v-bind="$attrs" />
|
|
5
|
-
</template>
|
|
1
|
+
<script setup lang="ts"></script>
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<VChartServer v-bind="$attrs" />
|
|
5
|
+
</template>
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import * as echarts from 'echarts'
|
|
3
|
-
import { ref } from 'vue'
|
|
4
|
-
import type { Option, InitOptions, Theme } from '../types'
|
|
5
|
-
|
|
6
|
-
const props = defineProps<{
|
|
7
|
-
option?: Option
|
|
8
|
-
initOptions?: InitOptions
|
|
9
|
-
theme?: Theme
|
|
10
|
-
}>()
|
|
11
|
-
|
|
12
|
-
const svgStr = ref('')
|
|
13
|
-
const initOptions: InitOptions = echarts.util.merge(
|
|
14
|
-
{ renderer: 'svg', ssr: true } satisfies InitOptions,
|
|
15
|
-
props.initOptions || {},
|
|
16
|
-
)
|
|
17
|
-
let chart = echarts.init(null, props.theme, initOptions)
|
|
18
|
-
chart.setOption(props.option || {})
|
|
19
|
-
svgStr.value = chart.renderToSVGString()
|
|
20
|
-
|
|
21
|
-
chart.dispose()
|
|
22
|
-
|
|
23
|
-
// @ts-expect-error release memory
|
|
24
|
-
chart = null
|
|
25
|
-
|
|
26
|
-
defineSlots<{ fallback: any }>()
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<template>
|
|
30
|
-
<div class="vue-echarts-container">
|
|
31
|
-
<!--eslint-disable-next-line vue/no-v-html-->
|
|
32
|
-
<div class="vue-echarts-inner" v-html="svgStr" />
|
|
33
|
-
</div>
|
|
34
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import * as echarts from 'echarts'
|
|
3
|
+
import { ref } from 'vue'
|
|
4
|
+
import type { Option, InitOptions, Theme } from '../types'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
option?: Option
|
|
8
|
+
initOptions?: InitOptions
|
|
9
|
+
theme?: Theme
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const svgStr = ref('')
|
|
13
|
+
const initOptions: InitOptions = echarts.util.merge(
|
|
14
|
+
{ renderer: 'svg', ssr: true } satisfies InitOptions,
|
|
15
|
+
props.initOptions || {},
|
|
16
|
+
)
|
|
17
|
+
let chart = echarts.init(null, props.theme, initOptions)
|
|
18
|
+
chart.setOption(props.option || {})
|
|
19
|
+
svgStr.value = chart.renderToSVGString()
|
|
20
|
+
|
|
21
|
+
chart.dispose()
|
|
22
|
+
|
|
23
|
+
// @ts-expect-error release memory
|
|
24
|
+
chart = null
|
|
25
|
+
|
|
26
|
+
defineSlots<{ fallback: any }>()
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<div class="vue-echarts-container">
|
|
31
|
+
<!--eslint-disable-next-line vue/no-v-html-->
|
|
32
|
+
<div class="vue-echarts-inner" v-html="svgStr" />
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
@@ -4,58 +4,58 @@ export default defineComponent({
|
|
|
4
4
|
inheritAttrs: false,
|
|
5
5
|
emits: {}
|
|
6
6
|
});
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<script setup lang="ts">
|
|
10
|
-
defineProps<{
|
|
11
|
-
option?: Option
|
|
12
|
-
theme?: Theme
|
|
13
|
-
initOptions?: InitOptions
|
|
14
|
-
}>()
|
|
15
|
-
|
|
16
|
-
type ECSSRHandler = (params: ECSSRClientEventParams) => string | undefined
|
|
17
|
-
type ECSSREventOn = `on${Capitalize<ECSSREvent>}`
|
|
18
|
-
|
|
19
|
-
const root = ref<InstanceType<typeof VChartServer> | null>(null)
|
|
20
|
-
const attrs = useAttrs() as Partial<Record<ECSSREventOn, ECSSRHandler>>
|
|
21
|
-
let container: HTMLElement
|
|
22
|
-
function hydrateChart() {
|
|
23
|
-
container = root.value?.$el
|
|
24
|
-
if (container) {
|
|
25
|
-
// Use the lightweight runtime to give the chart interactive capabilities
|
|
26
|
-
hydrate(container, {
|
|
27
|
-
on: {
|
|
28
|
-
click: attrs.onClick,
|
|
29
|
-
mouseout: attrs.onMouseout,
|
|
30
|
-
mouseover: attrs.onMouseover,
|
|
31
|
-
},
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
let observer: MutationObserver
|
|
37
|
-
onMounted(async () => {
|
|
38
|
-
await nextTick()
|
|
39
|
-
hydrateChart()
|
|
40
|
-
observer = new MutationObserver(async () => {
|
|
41
|
-
hydrateChart()
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
// call 'observe' on that MutationObserver instance,
|
|
45
|
-
// passing it the element to observe, and the options object
|
|
46
|
-
observer.observe(root.value!.$el, {
|
|
47
|
-
characterData: false,
|
|
48
|
-
childList: true,
|
|
49
|
-
attributes: false,
|
|
50
|
-
})
|
|
51
|
-
})
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<template>
|
|
55
|
-
<VChartServer
|
|
56
|
-
ref="root"
|
|
57
|
-
:option="option"
|
|
58
|
-
:init-options="initOptions"
|
|
59
|
-
:theme="theme"
|
|
60
|
-
/>
|
|
61
|
-
</template>
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
defineProps<{
|
|
11
|
+
option?: Option
|
|
12
|
+
theme?: Theme
|
|
13
|
+
initOptions?: InitOptions
|
|
14
|
+
}>()
|
|
15
|
+
|
|
16
|
+
type ECSSRHandler = (params: ECSSRClientEventParams) => string | undefined
|
|
17
|
+
type ECSSREventOn = `on${Capitalize<ECSSREvent>}`
|
|
18
|
+
|
|
19
|
+
const root = ref<InstanceType<typeof VChartServer> | null>(null)
|
|
20
|
+
const attrs = useAttrs() as Partial<Record<ECSSREventOn, ECSSRHandler>>
|
|
21
|
+
let container: HTMLElement
|
|
22
|
+
function hydrateChart() {
|
|
23
|
+
container = root.value?.$el
|
|
24
|
+
if (container) {
|
|
25
|
+
// Use the lightweight runtime to give the chart interactive capabilities
|
|
26
|
+
hydrate(container, {
|
|
27
|
+
on: {
|
|
28
|
+
click: attrs.onClick,
|
|
29
|
+
mouseout: attrs.onMouseout,
|
|
30
|
+
mouseover: attrs.onMouseover,
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let observer: MutationObserver
|
|
37
|
+
onMounted(async () => {
|
|
38
|
+
await nextTick()
|
|
39
|
+
hydrateChart()
|
|
40
|
+
observer = new MutationObserver(async () => {
|
|
41
|
+
hydrateChart()
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
// call 'observe' on that MutationObserver instance,
|
|
45
|
+
// passing it the element to observe, and the options object
|
|
46
|
+
observer.observe(root.value!.$el, {
|
|
47
|
+
characterData: false,
|
|
48
|
+
childList: true,
|
|
49
|
+
attributes: false,
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<template>
|
|
55
|
+
<VChartServer
|
|
56
|
+
ref="root"
|
|
57
|
+
:option="option"
|
|
58
|
+
:init-options="initOptions"
|
|
59
|
+
:theme="theme"
|
|
60
|
+
/>
|
|
61
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ECSSRClientEventParams, type ECSSREvent } from 'echarts/ssr/client/index';
|
|
2
|
+
import type { InitOptions, Option, Theme } from '../types.js';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
4
|
+
option?: Option;
|
|
5
|
+
theme?: Theme;
|
|
6
|
+
initOptions?: InitOptions;
|
|
7
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<ECSSREvent, (params: ECSSRClientEventParams) => string | undefined>, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
8
|
+
option?: Option;
|
|
9
|
+
theme?: Theme;
|
|
10
|
+
initOptions?: InitOptions;
|
|
11
|
+
}>>> & {
|
|
12
|
+
onClick?: ((params: ECSSRClientEventParams) => any) | undefined;
|
|
13
|
+
onMouseout?: ((params: ECSSRClientEventParams) => any) | undefined;
|
|
14
|
+
onMouseover?: ((params: ECSSRClientEventParams) => any) | undefined;
|
|
15
|
+
}, {}, {}>;
|
|
16
|
+
export default _default;
|
|
17
|
+
|
|
18
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
|
+
type __VLS_TypePropsToOption<T> = {
|
|
20
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
21
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
22
|
+
} : {
|
|
23
|
+
type: import('vue').PropType<T[K]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, unref, inject, ref } from 'vue'
|
|
3
|
-
import type { InitOptions, Option, Theme } from '../types'
|
|
4
|
-
import { THEME_KEY, INIT_OPTIONS_KEY } from '../utils/injection'
|
|
5
|
-
import type VChartIsland from './VChartLight.vue'
|
|
6
|
-
|
|
7
|
-
const defaultTheme = inject(THEME_KEY, null)
|
|
8
|
-
const defaultInitOptions = inject(INIT_OPTIONS_KEY, null)
|
|
9
|
-
|
|
10
|
-
const props = defineProps<{
|
|
11
|
-
option?: Option
|
|
12
|
-
theme?: Theme
|
|
13
|
-
initOptions?: InitOptions
|
|
14
|
-
}>()
|
|
15
|
-
const emits = defineEmits<{ (event: 'error', error: unknown): void }>()
|
|
16
|
-
|
|
17
|
-
const realTheme = computed(() => props.theme || unref(defaultTheme) || {})
|
|
18
|
-
const realInitOptions = computed(
|
|
19
|
-
// @ts-expect-error unknown computed type error
|
|
20
|
-
() => props.initOptions || unref(defaultInitOptions) || {},
|
|
21
|
-
)
|
|
22
|
-
function onError(e: unknown) {
|
|
23
|
-
// https://github.com/nuxt/nuxt/issues/27491
|
|
24
|
-
if (
|
|
25
|
-
e instanceof TypeError &&
|
|
26
|
-
e.message === "Cannot read properties of undefined (reading 'link')"
|
|
27
|
-
) {
|
|
28
|
-
// @ts-expect-error https://github.com/nuxt/nuxt/issues/27730
|
|
29
|
-
root.value.refresh()
|
|
30
|
-
}
|
|
31
|
-
emits('error', e)
|
|
32
|
-
}
|
|
33
|
-
const root = ref<InstanceType<typeof VChartIsland> | null>(null)
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<template>
|
|
37
|
-
<div class="vue-echarts-server">
|
|
38
|
-
<VChartIsland
|
|
39
|
-
ref="root"
|
|
40
|
-
:theme="realTheme"
|
|
41
|
-
:option="option"
|
|
42
|
-
:init-options="realInitOptions"
|
|
43
|
-
@error="onError"
|
|
44
|
-
>
|
|
45
|
-
<template #fallback>
|
|
46
|
-
<slot name="fallback" />
|
|
47
|
-
</template>
|
|
48
|
-
</VChartIsland>
|
|
49
|
-
</div>
|
|
50
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, unref, inject, ref } from 'vue'
|
|
3
|
+
import type { InitOptions, Option, Theme } from '../types'
|
|
4
|
+
import { THEME_KEY, INIT_OPTIONS_KEY } from '../utils/injection'
|
|
5
|
+
import type VChartIsland from './VChartLight.vue'
|
|
6
|
+
|
|
7
|
+
const defaultTheme = inject(THEME_KEY, null)
|
|
8
|
+
const defaultInitOptions = inject(INIT_OPTIONS_KEY, null)
|
|
9
|
+
|
|
10
|
+
const props = defineProps<{
|
|
11
|
+
option?: Option
|
|
12
|
+
theme?: Theme
|
|
13
|
+
initOptions?: InitOptions
|
|
14
|
+
}>()
|
|
15
|
+
const emits = defineEmits<{ (event: 'error', error: unknown): void }>()
|
|
16
|
+
|
|
17
|
+
const realTheme = computed(() => props.theme || unref(defaultTheme) || {})
|
|
18
|
+
const realInitOptions = computed(
|
|
19
|
+
// @ts-expect-error unknown computed type error
|
|
20
|
+
() => props.initOptions || unref(defaultInitOptions) || {},
|
|
21
|
+
)
|
|
22
|
+
function onError(e: unknown) {
|
|
23
|
+
// https://github.com/nuxt/nuxt/issues/27491
|
|
24
|
+
if (
|
|
25
|
+
e instanceof TypeError &&
|
|
26
|
+
e.message === "Cannot read properties of undefined (reading 'link')"
|
|
27
|
+
) {
|
|
28
|
+
// @ts-expect-error https://github.com/nuxt/nuxt/issues/27730
|
|
29
|
+
root.value.refresh()
|
|
30
|
+
}
|
|
31
|
+
emits('error', e)
|
|
32
|
+
}
|
|
33
|
+
const root = ref<InstanceType<typeof VChartIsland> | null>(null)
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<div class="vue-echarts-server">
|
|
38
|
+
<VChartIsland
|
|
39
|
+
ref="root"
|
|
40
|
+
:theme="realTheme"
|
|
41
|
+
:option="option"
|
|
42
|
+
:init-options="realInitOptions"
|
|
43
|
+
@error="onError"
|
|
44
|
+
>
|
|
45
|
+
<template #fallback>
|
|
46
|
+
<slot name="fallback" />
|
|
47
|
+
</template>
|
|
48
|
+
</VChartIsland>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Ref, type PropType } from 'vue';
|
|
2
|
+
import { type EChartsType } from '../types.js';
|
|
3
|
+
type AutoresizeProp = boolean | {
|
|
4
|
+
throttle?: number;
|
|
5
|
+
onResize?: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function useAutoresize(chart: Ref<EChartsType | undefined>, autoresize: Ref<AutoresizeProp | undefined>, root: Ref<HTMLElement | undefined>): void;
|
|
8
|
+
export declare const autoresizeProps: {
|
|
9
|
+
autoresize: PropType<AutoresizeProp>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -3,6 +3,6 @@ import type { EChartsType, LoadingOptions } from '../types.js';
|
|
|
3
3
|
export declare const LOADING_OPTIONS_KEY: InjectionKey<LoadingOptions | Ref<LoadingOptions>>;
|
|
4
4
|
export declare function useLoading(chart: Ref<EChartsType | undefined>, loading: Ref<boolean>, loadingOptions: Ref<LoadingOptions | undefined>): void;
|
|
5
5
|
export declare const loadingProps: {
|
|
6
|
-
loading:
|
|
6
|
+
loading: BooleanConstructor;
|
|
7
7
|
loadingOptions: PropType<LoadingOptions>;
|
|
8
8
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InjectionKey } from 'vue';
|
|
2
|
-
import type { UpdateOptionsInjection } from '../types.js';
|
|
3
|
-
export declare const THEME_KEY: InjectionKey<
|
|
4
|
-
export declare const INIT_OPTIONS_KEY: InjectionKey<
|
|
2
|
+
import type { ThemeInjection, InitOptionsInjection, UpdateOptionsInjection } from '../types.js';
|
|
3
|
+
export declare const THEME_KEY: InjectionKey<ThemeInjection>;
|
|
4
|
+
export declare const INIT_OPTIONS_KEY: InjectionKey<InitOptionsInjection>;
|
|
5
5
|
export declare const UPDATE_OPTIONS_KEY: InjectionKey<UpdateOptionsInjection>;
|
|
6
6
|
export { LOADING_OPTIONS_KEY } from '../composables.js';
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-echarts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Nuxt Module for Apache ECharts™",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
7
7
|
"nuxt",
|
|
8
8
|
"echarts",
|
|
9
9
|
"data-visualization",
|
|
10
|
-
"charts"
|
|
10
|
+
"charts",
|
|
11
|
+
"ssr"
|
|
11
12
|
],
|
|
12
13
|
"author": "Yue JIN <yuejin13@fudan.edu.cn>",
|
|
13
14
|
"repository": "kingyue737/nuxt-echarts",
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
"eslint": "^9.5.0",
|
|
57
58
|
"nuxt": "^3.12.2",
|
|
58
59
|
"prettier": "^3.3.2",
|
|
59
|
-
"typescript": "
|
|
60
|
+
"typescript": "^5.5.2",
|
|
60
61
|
"vite": "^5.3.1",
|
|
61
62
|
"vitest": "^1.6.0",
|
|
62
63
|
"vue-tsc": "^2.0.22"
|
|
@@ -78,4 +79,4 @@
|
|
|
78
79
|
"stackblitz": {
|
|
79
80
|
"startCommand": "pnpm run dev:prepare && pnpm run dev"
|
|
80
81
|
}
|
|
81
|
-
}
|
|
82
|
+
}
|