@chartts/vue 0.1.3
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 -0
- package/dist/index.cjs +345 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +5992 -0
- package/dist/index.d.ts +5992 -0
- package/dist/index.js +120 -0
- package/dist/index.js.map +1 -0
- package/package.json +34 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 chartts
|
|
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/dist/index.cjs
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var core = require('@chartts/core');
|
|
5
|
+
|
|
6
|
+
// src/index.ts
|
|
7
|
+
function useChart(containerRef, chartType, getData, getOptions) {
|
|
8
|
+
let instance = null;
|
|
9
|
+
vue.onMounted(() => {
|
|
10
|
+
if (!containerRef.value) return;
|
|
11
|
+
instance = core.createChart(containerRef.value, chartType, getData(), getOptions());
|
|
12
|
+
});
|
|
13
|
+
vue.watch(getData, (data) => {
|
|
14
|
+
instance?.setData(data);
|
|
15
|
+
}, { deep: true });
|
|
16
|
+
vue.watch(getOptions, (opts) => {
|
|
17
|
+
instance?.setOptions(opts);
|
|
18
|
+
}, { deep: true });
|
|
19
|
+
vue.onUnmounted(() => {
|
|
20
|
+
instance?.destroy();
|
|
21
|
+
instance = null;
|
|
22
|
+
});
|
|
23
|
+
return { getInstance: () => instance };
|
|
24
|
+
}
|
|
25
|
+
var chartProps = {
|
|
26
|
+
data: { type: Object, required: true },
|
|
27
|
+
theme: { type: [String, Object] },
|
|
28
|
+
width: { type: Number },
|
|
29
|
+
height: { type: Number },
|
|
30
|
+
xLabel: { type: String },
|
|
31
|
+
yLabel: { type: String },
|
|
32
|
+
xGrid: { type: Boolean },
|
|
33
|
+
yGrid: { type: Boolean },
|
|
34
|
+
xAxis: { type: Boolean },
|
|
35
|
+
yAxis: { type: Boolean },
|
|
36
|
+
legend: { type: [Boolean, String] },
|
|
37
|
+
tooltip: { type: [Boolean, Object] },
|
|
38
|
+
animate: { type: Boolean },
|
|
39
|
+
colors: { type: Array },
|
|
40
|
+
curve: { type: String },
|
|
41
|
+
barRadius: { type: Number },
|
|
42
|
+
barGap: { type: Number },
|
|
43
|
+
yMin: { type: Number },
|
|
44
|
+
yMax: { type: Number },
|
|
45
|
+
ariaLabel: { type: String }
|
|
46
|
+
};
|
|
47
|
+
function propsToOptions(props) {
|
|
48
|
+
const opts = {};
|
|
49
|
+
const skip = /* @__PURE__ */ new Set(["data", "class", "style"]);
|
|
50
|
+
for (const [key, value] of Object.entries(props)) {
|
|
51
|
+
if (skip.has(key) || value === void 0) continue;
|
|
52
|
+
opts[key] = value;
|
|
53
|
+
}
|
|
54
|
+
return opts;
|
|
55
|
+
}
|
|
56
|
+
function createVueChart(chartType, name) {
|
|
57
|
+
return vue.defineComponent({
|
|
58
|
+
name,
|
|
59
|
+
props: chartProps,
|
|
60
|
+
setup(props, { expose }) {
|
|
61
|
+
const container = vue.ref();
|
|
62
|
+
const { getInstance } = useChart(
|
|
63
|
+
container,
|
|
64
|
+
chartType,
|
|
65
|
+
() => props.data,
|
|
66
|
+
() => propsToOptions(props)
|
|
67
|
+
);
|
|
68
|
+
expose({ getInstance });
|
|
69
|
+
return () => vue.h("div", { ref: container });
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
var LineChart = createVueChart(core.lineChartType, "LineChart");
|
|
74
|
+
var BarChart = createVueChart(core.barChartType, "BarChart");
|
|
75
|
+
var StackedBarChart = createVueChart(core.stackedBarChartType, "StackedBarChart");
|
|
76
|
+
var HorizontalBarChart = createVueChart(core.horizontalBarChartType, "HorizontalBarChart");
|
|
77
|
+
var PieChart = createVueChart(core.pieChartType, "PieChart");
|
|
78
|
+
var DonutChart = createVueChart(core.donutChartType, "DonutChart");
|
|
79
|
+
var ScatterChart = createVueChart(core.scatterChartType, "ScatterChart");
|
|
80
|
+
var SparklineChart = createVueChart(core.sparklineChartType, "SparklineChart");
|
|
81
|
+
var AreaChart = createVueChart(core.areaChartType, "AreaChart");
|
|
82
|
+
var RadarChart = createVueChart(core.radarChartType, "RadarChart");
|
|
83
|
+
var BubbleChart = createVueChart(core.bubbleChartType, "BubbleChart");
|
|
84
|
+
var CandlestickChart = createVueChart(core.candlestickChartType, "CandlestickChart");
|
|
85
|
+
var GaugeChart = createVueChart(core.gaugeChartType, "GaugeChart");
|
|
86
|
+
var WaterfallChart = createVueChart(core.waterfallChartType, "WaterfallChart");
|
|
87
|
+
var FunnelChart = createVueChart(core.funnelChartType, "FunnelChart");
|
|
88
|
+
var HeatmapChart = createVueChart(core.heatmapChartType, "HeatmapChart");
|
|
89
|
+
var BoxplotChart = createVueChart(core.boxplotChartType, "BoxplotChart");
|
|
90
|
+
var HistogramChart = createVueChart(core.histogramChartType, "HistogramChart");
|
|
91
|
+
var TreemapChart = createVueChart(core.treemapChartType, "TreemapChart");
|
|
92
|
+
var PolarChart = createVueChart(core.polarChartType, "PolarChart");
|
|
93
|
+
var RadialBarChart = createVueChart(core.radialBarChartType, "RadialBarChart");
|
|
94
|
+
var LollipopChart = createVueChart(core.lollipopChartType, "LollipopChart");
|
|
95
|
+
var BulletChart = createVueChart(core.bulletChartType, "BulletChart");
|
|
96
|
+
var DumbbellChart = createVueChart(core.dumbbellChartType, "DumbbellChart");
|
|
97
|
+
var CalendarChart = createVueChart(core.calendarChartType, "CalendarChart");
|
|
98
|
+
var ComboChart = createVueChart(core.comboChartType, "ComboChart");
|
|
99
|
+
var SankeyChart = createVueChart(core.sankeyChartType, "SankeyChart");
|
|
100
|
+
var SunburstChart = createVueChart(core.sunburstChartType, "SunburstChart");
|
|
101
|
+
var TreeChart = createVueChart(core.treeChartType, "TreeChart");
|
|
102
|
+
var GraphChart = createVueChart(core.graphChartType, "GraphChart");
|
|
103
|
+
var ParallelChart = createVueChart(core.parallelChartType, "ParallelChart");
|
|
104
|
+
var ThemeRiverChart = createVueChart(core.themeRiverChartType, "ThemeRiverChart");
|
|
105
|
+
var PictorialBarChart = createVueChart(core.pictorialBarChartType, "PictorialBarChart");
|
|
106
|
+
var ChordChart = createVueChart(core.chordChartType, "ChordChart");
|
|
107
|
+
var GeoChart = createVueChart(core.geoChartType, "GeoChart");
|
|
108
|
+
var LinesChart = createVueChart(core.linesChartType, "LinesChart");
|
|
109
|
+
var MatrixChart = createVueChart(core.matrixChartType, "MatrixChart");
|
|
110
|
+
var CustomChart = createVueChart(core.customChartType, "CustomChart");
|
|
111
|
+
var OHLCChart = createVueChart(core.ohlcChartType, "OHLCChart");
|
|
112
|
+
var StepChart = createVueChart(core.stepChartType, "StepChart");
|
|
113
|
+
var VolumeChart = createVueChart(core.volumeChartType, "VolumeChart");
|
|
114
|
+
var RangeChart = createVueChart(core.rangeChartType, "RangeChart");
|
|
115
|
+
var BaselineChart = createVueChart(core.baselineChartType, "BaselineChart");
|
|
116
|
+
var KagiChart = createVueChart(core.kagiChartType, "KagiChart");
|
|
117
|
+
var RenkoChart = createVueChart(core.renkoChartType, "RenkoChart");
|
|
118
|
+
|
|
119
|
+
Object.defineProperty(exports, "areaChartType", {
|
|
120
|
+
enumerable: true,
|
|
121
|
+
get: function () { return core.areaChartType; }
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(exports, "barChartType", {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
get: function () { return core.barChartType; }
|
|
126
|
+
});
|
|
127
|
+
Object.defineProperty(exports, "baselineChartType", {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
get: function () { return core.baselineChartType; }
|
|
130
|
+
});
|
|
131
|
+
Object.defineProperty(exports, "boxplotChartType", {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function () { return core.boxplotChartType; }
|
|
134
|
+
});
|
|
135
|
+
Object.defineProperty(exports, "bubbleChartType", {
|
|
136
|
+
enumerable: true,
|
|
137
|
+
get: function () { return core.bubbleChartType; }
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(exports, "bulletChartType", {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
get: function () { return core.bulletChartType; }
|
|
142
|
+
});
|
|
143
|
+
Object.defineProperty(exports, "calendarChartType", {
|
|
144
|
+
enumerable: true,
|
|
145
|
+
get: function () { return core.calendarChartType; }
|
|
146
|
+
});
|
|
147
|
+
Object.defineProperty(exports, "candlestickChartType", {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
get: function () { return core.candlestickChartType; }
|
|
150
|
+
});
|
|
151
|
+
Object.defineProperty(exports, "chordChartType", {
|
|
152
|
+
enumerable: true,
|
|
153
|
+
get: function () { return core.chordChartType; }
|
|
154
|
+
});
|
|
155
|
+
Object.defineProperty(exports, "comboChartType", {
|
|
156
|
+
enumerable: true,
|
|
157
|
+
get: function () { return core.comboChartType; }
|
|
158
|
+
});
|
|
159
|
+
Object.defineProperty(exports, "customChartType", {
|
|
160
|
+
enumerable: true,
|
|
161
|
+
get: function () { return core.customChartType; }
|
|
162
|
+
});
|
|
163
|
+
Object.defineProperty(exports, "donutChartType", {
|
|
164
|
+
enumerable: true,
|
|
165
|
+
get: function () { return core.donutChartType; }
|
|
166
|
+
});
|
|
167
|
+
Object.defineProperty(exports, "dumbbellChartType", {
|
|
168
|
+
enumerable: true,
|
|
169
|
+
get: function () { return core.dumbbellChartType; }
|
|
170
|
+
});
|
|
171
|
+
Object.defineProperty(exports, "funnelChartType", {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
get: function () { return core.funnelChartType; }
|
|
174
|
+
});
|
|
175
|
+
Object.defineProperty(exports, "gaugeChartType", {
|
|
176
|
+
enumerable: true,
|
|
177
|
+
get: function () { return core.gaugeChartType; }
|
|
178
|
+
});
|
|
179
|
+
Object.defineProperty(exports, "geoChartType", {
|
|
180
|
+
enumerable: true,
|
|
181
|
+
get: function () { return core.geoChartType; }
|
|
182
|
+
});
|
|
183
|
+
Object.defineProperty(exports, "graphChartType", {
|
|
184
|
+
enumerable: true,
|
|
185
|
+
get: function () { return core.graphChartType; }
|
|
186
|
+
});
|
|
187
|
+
Object.defineProperty(exports, "heatmapChartType", {
|
|
188
|
+
enumerable: true,
|
|
189
|
+
get: function () { return core.heatmapChartType; }
|
|
190
|
+
});
|
|
191
|
+
Object.defineProperty(exports, "histogramChartType", {
|
|
192
|
+
enumerable: true,
|
|
193
|
+
get: function () { return core.histogramChartType; }
|
|
194
|
+
});
|
|
195
|
+
Object.defineProperty(exports, "horizontalBarChartType", {
|
|
196
|
+
enumerable: true,
|
|
197
|
+
get: function () { return core.horizontalBarChartType; }
|
|
198
|
+
});
|
|
199
|
+
Object.defineProperty(exports, "kagiChartType", {
|
|
200
|
+
enumerable: true,
|
|
201
|
+
get: function () { return core.kagiChartType; }
|
|
202
|
+
});
|
|
203
|
+
Object.defineProperty(exports, "lineChartType", {
|
|
204
|
+
enumerable: true,
|
|
205
|
+
get: function () { return core.lineChartType; }
|
|
206
|
+
});
|
|
207
|
+
Object.defineProperty(exports, "linesChartType", {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function () { return core.linesChartType; }
|
|
210
|
+
});
|
|
211
|
+
Object.defineProperty(exports, "lollipopChartType", {
|
|
212
|
+
enumerable: true,
|
|
213
|
+
get: function () { return core.lollipopChartType; }
|
|
214
|
+
});
|
|
215
|
+
Object.defineProperty(exports, "matrixChartType", {
|
|
216
|
+
enumerable: true,
|
|
217
|
+
get: function () { return core.matrixChartType; }
|
|
218
|
+
});
|
|
219
|
+
Object.defineProperty(exports, "ohlcChartType", {
|
|
220
|
+
enumerable: true,
|
|
221
|
+
get: function () { return core.ohlcChartType; }
|
|
222
|
+
});
|
|
223
|
+
Object.defineProperty(exports, "parallelChartType", {
|
|
224
|
+
enumerable: true,
|
|
225
|
+
get: function () { return core.parallelChartType; }
|
|
226
|
+
});
|
|
227
|
+
Object.defineProperty(exports, "pictorialBarChartType", {
|
|
228
|
+
enumerable: true,
|
|
229
|
+
get: function () { return core.pictorialBarChartType; }
|
|
230
|
+
});
|
|
231
|
+
Object.defineProperty(exports, "pieChartType", {
|
|
232
|
+
enumerable: true,
|
|
233
|
+
get: function () { return core.pieChartType; }
|
|
234
|
+
});
|
|
235
|
+
Object.defineProperty(exports, "polarChartType", {
|
|
236
|
+
enumerable: true,
|
|
237
|
+
get: function () { return core.polarChartType; }
|
|
238
|
+
});
|
|
239
|
+
Object.defineProperty(exports, "radarChartType", {
|
|
240
|
+
enumerable: true,
|
|
241
|
+
get: function () { return core.radarChartType; }
|
|
242
|
+
});
|
|
243
|
+
Object.defineProperty(exports, "radialBarChartType", {
|
|
244
|
+
enumerable: true,
|
|
245
|
+
get: function () { return core.radialBarChartType; }
|
|
246
|
+
});
|
|
247
|
+
Object.defineProperty(exports, "rangeChartType", {
|
|
248
|
+
enumerable: true,
|
|
249
|
+
get: function () { return core.rangeChartType; }
|
|
250
|
+
});
|
|
251
|
+
Object.defineProperty(exports, "renkoChartType", {
|
|
252
|
+
enumerable: true,
|
|
253
|
+
get: function () { return core.renkoChartType; }
|
|
254
|
+
});
|
|
255
|
+
Object.defineProperty(exports, "sankeyChartType", {
|
|
256
|
+
enumerable: true,
|
|
257
|
+
get: function () { return core.sankeyChartType; }
|
|
258
|
+
});
|
|
259
|
+
Object.defineProperty(exports, "scatterChartType", {
|
|
260
|
+
enumerable: true,
|
|
261
|
+
get: function () { return core.scatterChartType; }
|
|
262
|
+
});
|
|
263
|
+
Object.defineProperty(exports, "sparklineChartType", {
|
|
264
|
+
enumerable: true,
|
|
265
|
+
get: function () { return core.sparklineChartType; }
|
|
266
|
+
});
|
|
267
|
+
Object.defineProperty(exports, "stackedBarChartType", {
|
|
268
|
+
enumerable: true,
|
|
269
|
+
get: function () { return core.stackedBarChartType; }
|
|
270
|
+
});
|
|
271
|
+
Object.defineProperty(exports, "stepChartType", {
|
|
272
|
+
enumerable: true,
|
|
273
|
+
get: function () { return core.stepChartType; }
|
|
274
|
+
});
|
|
275
|
+
Object.defineProperty(exports, "sunburstChartType", {
|
|
276
|
+
enumerable: true,
|
|
277
|
+
get: function () { return core.sunburstChartType; }
|
|
278
|
+
});
|
|
279
|
+
Object.defineProperty(exports, "themeRiverChartType", {
|
|
280
|
+
enumerable: true,
|
|
281
|
+
get: function () { return core.themeRiverChartType; }
|
|
282
|
+
});
|
|
283
|
+
Object.defineProperty(exports, "treeChartType", {
|
|
284
|
+
enumerable: true,
|
|
285
|
+
get: function () { return core.treeChartType; }
|
|
286
|
+
});
|
|
287
|
+
Object.defineProperty(exports, "treemapChartType", {
|
|
288
|
+
enumerable: true,
|
|
289
|
+
get: function () { return core.treemapChartType; }
|
|
290
|
+
});
|
|
291
|
+
Object.defineProperty(exports, "volumeChartType", {
|
|
292
|
+
enumerable: true,
|
|
293
|
+
get: function () { return core.volumeChartType; }
|
|
294
|
+
});
|
|
295
|
+
Object.defineProperty(exports, "waterfallChartType", {
|
|
296
|
+
enumerable: true,
|
|
297
|
+
get: function () { return core.waterfallChartType; }
|
|
298
|
+
});
|
|
299
|
+
exports.AreaChart = AreaChart;
|
|
300
|
+
exports.BarChart = BarChart;
|
|
301
|
+
exports.BaselineChart = BaselineChart;
|
|
302
|
+
exports.BoxplotChart = BoxplotChart;
|
|
303
|
+
exports.BubbleChart = BubbleChart;
|
|
304
|
+
exports.BulletChart = BulletChart;
|
|
305
|
+
exports.CalendarChart = CalendarChart;
|
|
306
|
+
exports.CandlestickChart = CandlestickChart;
|
|
307
|
+
exports.ChordChart = ChordChart;
|
|
308
|
+
exports.ComboChart = ComboChart;
|
|
309
|
+
exports.CustomChart = CustomChart;
|
|
310
|
+
exports.DonutChart = DonutChart;
|
|
311
|
+
exports.DumbbellChart = DumbbellChart;
|
|
312
|
+
exports.FunnelChart = FunnelChart;
|
|
313
|
+
exports.GaugeChart = GaugeChart;
|
|
314
|
+
exports.GeoChart = GeoChart;
|
|
315
|
+
exports.GraphChart = GraphChart;
|
|
316
|
+
exports.HeatmapChart = HeatmapChart;
|
|
317
|
+
exports.HistogramChart = HistogramChart;
|
|
318
|
+
exports.HorizontalBarChart = HorizontalBarChart;
|
|
319
|
+
exports.KagiChart = KagiChart;
|
|
320
|
+
exports.LineChart = LineChart;
|
|
321
|
+
exports.LinesChart = LinesChart;
|
|
322
|
+
exports.LollipopChart = LollipopChart;
|
|
323
|
+
exports.MatrixChart = MatrixChart;
|
|
324
|
+
exports.OHLCChart = OHLCChart;
|
|
325
|
+
exports.ParallelChart = ParallelChart;
|
|
326
|
+
exports.PictorialBarChart = PictorialBarChart;
|
|
327
|
+
exports.PieChart = PieChart;
|
|
328
|
+
exports.PolarChart = PolarChart;
|
|
329
|
+
exports.RadarChart = RadarChart;
|
|
330
|
+
exports.RadialBarChart = RadialBarChart;
|
|
331
|
+
exports.RangeChart = RangeChart;
|
|
332
|
+
exports.RenkoChart = RenkoChart;
|
|
333
|
+
exports.SankeyChart = SankeyChart;
|
|
334
|
+
exports.ScatterChart = ScatterChart;
|
|
335
|
+
exports.SparklineChart = SparklineChart;
|
|
336
|
+
exports.StackedBarChart = StackedBarChart;
|
|
337
|
+
exports.StepChart = StepChart;
|
|
338
|
+
exports.SunburstChart = SunburstChart;
|
|
339
|
+
exports.ThemeRiverChart = ThemeRiverChart;
|
|
340
|
+
exports.TreeChart = TreeChart;
|
|
341
|
+
exports.TreemapChart = TreemapChart;
|
|
342
|
+
exports.VolumeChart = VolumeChart;
|
|
343
|
+
exports.WaterfallChart = WaterfallChart;
|
|
344
|
+
//# sourceMappingURL=index.cjs.map
|
|
345
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["onMounted","createChart","watch","onUnmounted","defineComponent","ref","h","lineChartType","barChartType","stackedBarChartType","horizontalBarChartType","pieChartType","donutChartType","scatterChartType","sparklineChartType","areaChartType","radarChartType","bubbleChartType","candlestickChartType","gaugeChartType","waterfallChartType","funnelChartType","heatmapChartType","boxplotChartType","histogramChartType","treemapChartType","polarChartType","radialBarChartType","lollipopChartType","bulletChartType","dumbbellChartType","calendarChartType","comboChartType","sankeyChartType","sunburstChartType","treeChartType","graphChartType","parallelChartType","themeRiverChartType","pictorialBarChartType","chordChartType","geoChartType","linesChartType","matrixChartType","customChartType","ohlcChartType","stepChartType","volumeChartType","rangeChartType","baselineChartType","kagiChartType","renkoChartType"],"mappings":";;;;;;AAyBA,SAAS,QAAA,CACP,YAAA,EACA,SAAA,EACA,OAAA,EACA,UAAA,EACA;AACA,EAAA,IAAI,QAAA,GAAiC,IAAA;AAErC,EAAAA,aAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,aAAa,KAAA,E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,IAAM,WAAA,GAAc,cAAA,CAAeC,oBAAA,EAAiB,aAAa;AACjE,IAAM,WAAA,GAAc,cAAA,CAAeC,oBAAA,EAAiB,aAAa;AACjE,IAAM,SAAA,GAAY,cAAA,CAAeC,kBAAA,EAAe,WAAW;AAC3D,IAAM,SAAA,GAAY,cAAA,CAAeC,kBAAA,EAAe,WAAW;AAC3D,IAAM,WAAA,GAAc,cAAA,CAAeC,oBAAA,EAAiB,aAAa;AACjE,IAAM,UAAA,GAAa,cAAA,CAAeC,mBAAA,EAAgB,YAAY;AAC9D,IAAM,aAAA,GAAgB,cAAA,CAAeC,sBAAA,EAAmB,eAAe;AACvE,IAAM,SAAA,GAAY,cAAA,CAAeC,kBAAA,EAAe,WAAW;AAC3D,IAAM,UAAA,GAAa,cAAA,CAAeC,mBAAA,EAAgB,YAAY","file":"index.cjs","sourcesContent":["import {\n defineComponent, ref, onMounted, onUnmounted, watch, h,\n type PropType,\n} from 'vue'\nimport {\n createChart,\n lineChartType, barChartType, stackedBarChartType, horizontalBarChartType,\n pieChartType, donutChartType, scatterChartType, sparklineChartType,\n areaChartType, radarChartType, bubbleChartType, candlestickChartType,\n gaugeChartType, waterfallChartType, funnelChartType, heatmapChartType,\n boxplotChartType, histogramChartType, treemapChartType, polarChartType,\n radialBarChartType, lollipopChartType, bulletChartType, dumbbellChartType,\n calendarChartType, comboChartType, sankeyChartType,\n sunburstChartType, treeChartType, graphChartType, parallelChartType,\n themeRiverChartType, pictorialBarChartType, chordChartType,\n geoChartType, linesChartType, matrixChartType, customChartType,\n ohlcChartType, stepChartType, volumeChartType, rangeChartType,\n baselineChartType, kagiChartType, renkoChartType,\n type ChartData, type ChartOptions, type ChartInstance, type ChartTypePlugin,\n} from '@chartts/core'\n\n// ---------------------------------------------------------------------------\n// Shared composable\n// ---------------------------------------------------------------------------\n\nfunction useChart(\n containerRef: ReturnType<typeof ref<HTMLDivElement | undefined>>,\n chartType: ChartTypePlugin,\n getData: () => ChartData,\n getOptions: () => ChartOptions,\n) {\n let instance: ChartInstance | null = null\n\n onMounted(() => {\n if (!containerRef.value) return\n instance = createChart(containerRef.value, chartType, getData(), getOptions())\n })\n\n watch(getData, (data) => {\n instance?.setData(data)\n }, { deep: true })\n\n watch(getOptions, (opts) => {\n instance?.setOptions(opts)\n }, { deep: true })\n\n onUnmounted(() => {\n instance?.destroy()\n instance = null\n })\n\n return { getInstance: () => instance }\n}\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nconst chartProps = {\n data: { type: Object as PropType<ChartData>, required: true as const },\n theme: { type: [String, Object] as PropType<ChartOptions['theme']> },\n width: { type: Number },\n height: { type: Number },\n xLabel: { type: String },\n yLabel: { type: String },\n xGrid: { type: Boolean },\n yGrid: { type: Boolean },\n xAxis: { type: Boolean },\n yAxis: { type: Boolean },\n legend: { type: [Boolean, String] as PropType<ChartOptions['legend']> },\n tooltip: { type: [Boolean, Object] as PropType<ChartOptions['tooltip']> },\n animate: { type: Boolean },\n colors: { type: Array as PropType<string[]> },\n curve: { type: String as PropType<ChartOptions['curve']> },\n barRadius: { type: Number },\n barGap: { type: Number },\n yMin: { type: Number },\n yMax: { type: Number },\n ariaLabel: { type: String },\n}\n\nfunction propsToOptions(props: Record<string, unknown>): ChartOptions {\n const opts: ChartOptions = {}\n const skip = new Set(['data', 'class', 'style'])\n for (const [key, value] of Object.entries(props)) {\n if (skip.has(key) || value === undefined) continue\n ;(opts as Record<string, unknown>)[key] = value\n }\n return opts\n}\n\n// ---------------------------------------------------------------------------\n// Factory\n// ---------------------------------------------------------------------------\n\nfunction createVueChart(chartType: ChartTypePlugin, name: string) {\n return defineComponent({\n name,\n props: chartProps,\n setup(props, { expose }) {\n const container = ref<HTMLDivElement>()\n const { getInstance } = useChart(\n container,\n chartType,\n () => props.data!,\n () => propsToOptions(props),\n )\n expose({ getInstance })\n return () => h('div', { ref: container })\n },\n })\n}\n\n// ---------------------------------------------------------------------------\n// Chart components — one per chart type\n// ---------------------------------------------------------------------------\n\nexport const LineChart = createVueChart(lineChartType, 'LineChart')\nexport const BarChart = createVueChart(barChartType, 'BarChart')\nexport const StackedBarChart = createVueChart(stackedBarChartType, 'StackedBarChart')\nexport const HorizontalBarChart = createVueChart(horizontalBarChartType, 'HorizontalBarChart')\nexport const PieChart = createVueChart(pieChartType, 'PieChart')\nexport const DonutChart = createVueChart(donutChartType, 'DonutChart')\nexport const ScatterChart = createVueChart(scatterChartType, 'ScatterChart')\nexport const SparklineChart = createVueChart(sparklineChartType, 'SparklineChart')\nexport const AreaChart = createVueChart(areaChartType, 'AreaChart')\nexport const RadarChart = createVueChart(radarChartType, 'RadarChart')\nexport const BubbleChart = createVueChart(bubbleChartType, 'BubbleChart')\nexport const CandlestickChart = createVueChart(candlestickChartType, 'CandlestickChart')\nexport const GaugeChart = createVueChart(gaugeChartType, 'GaugeChart')\nexport const WaterfallChart = createVueChart(waterfallChartType, 'WaterfallChart')\nexport const FunnelChart = createVueChart(funnelChartType, 'FunnelChart')\nexport const HeatmapChart = createVueChart(heatmapChartType, 'HeatmapChart')\nexport const BoxplotChart = createVueChart(boxplotChartType, 'BoxplotChart')\nexport const HistogramChart = createVueChart(histogramChartType, 'HistogramChart')\nexport const TreemapChart = createVueChart(treemapChartType, 'TreemapChart')\nexport const PolarChart = createVueChart(polarChartType, 'PolarChart')\nexport const RadialBarChart = createVueChart(radialBarChartType, 'RadialBarChart')\nexport const LollipopChart = createVueChart(lollipopChartType, 'LollipopChart')\nexport const BulletChart = createVueChart(bulletChartType, 'BulletChart')\nexport const DumbbellChart = createVueChart(dumbbellChartType, 'DumbbellChart')\nexport const CalendarChart = createVueChart(calendarChartType, 'CalendarChart')\nexport const ComboChart = createVueChart(comboChartType, 'ComboChart')\nexport const SankeyChart = createVueChart(sankeyChartType, 'SankeyChart')\nexport const SunburstChart = createVueChart(sunburstChartType, 'SunburstChart')\nexport const TreeChart = createVueChart(treeChartType, 'TreeChart')\nexport const GraphChart = createVueChart(graphChartType, 'GraphChart')\nexport const ParallelChart = createVueChart(parallelChartType, 'ParallelChart')\nexport const ThemeRiverChart = createVueChart(themeRiverChartType, 'ThemeRiverChart')\nexport const PictorialBarChart = createVueChart(pictorialBarChartType, 'PictorialBarChart')\nexport const ChordChart = createVueChart(chordChartType, 'ChordChart')\nexport const GeoChart = createVueChart(geoChartType, 'GeoChart')\nexport const LinesChart = createVueChart(linesChartType, 'LinesChart')\nexport const MatrixChart = createVueChart(matrixChartType, 'MatrixChart')\nexport const CustomChart = createVueChart(customChartType, 'CustomChart')\nexport const OHLCChart = createVueChart(ohlcChartType, 'OHLCChart')\nexport const StepChart = createVueChart(stepChartType, 'StepChart')\nexport const VolumeChart = createVueChart(volumeChartType, 'VolumeChart')\nexport const RangeChart = createVueChart(rangeChartType, 'RangeChart')\nexport const BaselineChart = createVueChart(baselineChartType, 'BaselineChart')\nexport const KagiChart = createVueChart(kagiChartType, 'KagiChart')\nexport const RenkoChart = createVueChart(renkoChartType, 'RenkoChart')\n\n// ---------------------------------------------------------------------------\n// Re-exports\n// ---------------------------------------------------------------------------\n\nexport {\n lineChartType, barChartType, stackedBarChartType, horizontalBarChartType,\n pieChartType, donutChartType, scatterChartType, sparklineChartType,\n areaChartType, radarChartType, bubbleChartType, candlestickChartType,\n gaugeChartType, waterfallChartType, funnelChartType, heatmapChartType,\n boxplotChartType, histogramChartType, treemapChartType, polarChartType,\n radialBarChartType, lollipopChartType, bulletChartType, dumbbellChartType,\n calendarChartType, comboChartType, sankeyChartType,\n sunburstChartType, treeChartType, graphChartType, parallelChartType,\n themeRiverChartType, pictorialBarChartType, chordChartType,\n geoChartType, linesChartType, matrixChartType, customChartType,\n ohlcChartType, stepChartType, volumeChartType, rangeChartType,\n baselineChartType, kagiChartType, renkoChartType,\n} from '@chartts/core'\nexport type { ChartData, ChartOptions, ChartInstance, ChartTypePlugin } from '@chartts/core'\n"]}
|