@opendata-ai/openchart-vue 8.9.0 → 9.0.0-rc.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 +1 -1
- package/dist/index.d.ts +154 -38
- package/dist/index.js +131 -59
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
} from "@opendata-ai/openchart-engine";
|
|
26
26
|
|
|
27
27
|
// src/BarList.ts
|
|
28
|
+
import { mergeThemeConfig } from "@opendata-ai/openchart-core";
|
|
28
29
|
import {
|
|
29
30
|
createBarList
|
|
30
31
|
} from "@opendata-ai/openchart-vanilla";
|
|
@@ -87,7 +88,7 @@ var BarList = defineComponent({
|
|
|
87
88
|
const contextTheme = inject2(VizThemeKey, void 0);
|
|
88
89
|
const contextDarkMode = inject2(VizDarkModeKey, void 0);
|
|
89
90
|
function resolveTheme() {
|
|
90
|
-
return props.theme
|
|
91
|
+
return mergeThemeConfig(contextTheme?.value, props.theme);
|
|
91
92
|
}
|
|
92
93
|
function resolveDarkMode() {
|
|
93
94
|
return props.darkMode ?? contextDarkMode?.value;
|
|
@@ -100,7 +101,7 @@ var BarList = defineComponent({
|
|
|
100
101
|
darkMode: resolveDarkMode(),
|
|
101
102
|
onRowClick: (row) => emit("row-click", row),
|
|
102
103
|
onRowHover: (row) => emit("row-hover", row),
|
|
103
|
-
|
|
104
|
+
autoResize: true
|
|
104
105
|
};
|
|
105
106
|
instance = createBarList(container, props.spec, options);
|
|
106
107
|
prevSpec = JSON.stringify(props.spec);
|
|
@@ -157,10 +158,13 @@ var BarList = defineComponent({
|
|
|
157
158
|
});
|
|
158
159
|
|
|
159
160
|
// src/Chart.ts
|
|
160
|
-
import {
|
|
161
|
+
import { mergeThemeConfig as mergeThemeConfig2 } from "@opendata-ai/openchart-core";
|
|
162
|
+
import {
|
|
163
|
+
createChart,
|
|
164
|
+
createChartReaderBinding
|
|
165
|
+
} from "@opendata-ai/openchart-vanilla";
|
|
161
166
|
import {
|
|
162
167
|
defineComponent as defineComponent2,
|
|
163
|
-
getCurrentInstance,
|
|
164
168
|
h as h2,
|
|
165
169
|
inject as inject3,
|
|
166
170
|
onMounted as onMounted2,
|
|
@@ -171,6 +175,11 @@ import {
|
|
|
171
175
|
var Chart = defineComponent2({
|
|
172
176
|
name: "Chart",
|
|
173
177
|
props: {
|
|
178
|
+
reader: {
|
|
179
|
+
type: [Boolean, Object],
|
|
180
|
+
default: void 0
|
|
181
|
+
},
|
|
182
|
+
readerSelection: { type: Object, default: void 0 },
|
|
174
183
|
spec: {
|
|
175
184
|
type: Object,
|
|
176
185
|
required: true
|
|
@@ -187,6 +196,25 @@ var Chart = defineComponent2({
|
|
|
187
196
|
type: String,
|
|
188
197
|
default: void 0
|
|
189
198
|
},
|
|
199
|
+
// Declared listener props make presence reactive. Vue excludes declared
|
|
200
|
+
// emits listeners from update checks, which would leave the inferred
|
|
201
|
+
// interaction mode stale when a parent adds or removes a listener.
|
|
202
|
+
// `@edit`, `@select`, and `@deselect` bind to these props.
|
|
203
|
+
onEdit: {
|
|
204
|
+
type: Function,
|
|
205
|
+
default: void 0
|
|
206
|
+
},
|
|
207
|
+
onSelect: {
|
|
208
|
+
type: Function,
|
|
209
|
+
default: void 0
|
|
210
|
+
},
|
|
211
|
+
onDeselect: {
|
|
212
|
+
type: Function,
|
|
213
|
+
default: void 0
|
|
214
|
+
},
|
|
215
|
+
rowHover: { type: Boolean, default: void 0 },
|
|
216
|
+
autoResize: { type: Boolean, default: void 0 },
|
|
217
|
+
revision: { type: [String, Number], default: void 0 },
|
|
190
218
|
class: {
|
|
191
219
|
type: String,
|
|
192
220
|
default: void 0
|
|
@@ -203,39 +231,41 @@ var Chart = defineComponent2({
|
|
|
203
231
|
type: [Array, null],
|
|
204
232
|
default: void 0
|
|
205
233
|
},
|
|
206
|
-
|
|
207
|
-
type:
|
|
234
|
+
interaction: {
|
|
235
|
+
type: String,
|
|
208
236
|
default: void 0
|
|
209
237
|
}
|
|
210
238
|
},
|
|
211
239
|
emits: {
|
|
240
|
+
"reader-change": (_selection, _meta) => true,
|
|
212
241
|
"mark-click": (_event) => true,
|
|
213
242
|
"mark-hover": (_event) => true,
|
|
214
243
|
"mark-leave": () => true,
|
|
215
244
|
"legend-toggle": (_series, _visible) => true,
|
|
216
|
-
"annotation-click": (_annotation, _event) => true,
|
|
217
|
-
"
|
|
218
|
-
|
|
219
|
-
select: (_element) => true,
|
|
220
|
-
deselect: (_element) => true,
|
|
221
|
-
"text-edit": (_element, _oldText, _newText) => true,
|
|
222
|
-
"data-point-click": (_data) => true
|
|
245
|
+
"annotation-click": (_annotation, _event, _element) => true,
|
|
246
|
+
"highlight-change": (_values) => true,
|
|
247
|
+
reveal: (_guess) => true
|
|
223
248
|
},
|
|
224
249
|
setup(props, { emit, expose }) {
|
|
225
250
|
const containerRef = ref2(null);
|
|
226
251
|
let instance = null;
|
|
227
252
|
let prevSpec = "";
|
|
253
|
+
const readerBinding = createChartReaderBinding();
|
|
254
|
+
function syncReader() {
|
|
255
|
+
if (containerRef.value && instance)
|
|
256
|
+
readerBinding.sync(
|
|
257
|
+
containerRef.value,
|
|
258
|
+
instance,
|
|
259
|
+
props.spec,
|
|
260
|
+
props.reader,
|
|
261
|
+
props.readerSelection,
|
|
262
|
+
(state, meta) => emit("reader-change", state, meta)
|
|
263
|
+
);
|
|
264
|
+
}
|
|
228
265
|
const contextTheme = inject3(VizThemeKey, void 0);
|
|
229
266
|
const contextDarkMode = inject3(VizDarkModeKey, void 0);
|
|
230
|
-
const vm = getCurrentInstance();
|
|
231
|
-
const vnodeProps = vm?.vnode.props ?? {};
|
|
232
|
-
const hasAnnotationEditListener = "onAnnotation-edit" in vnodeProps || "onAnnotationEdit" in vnodeProps;
|
|
233
|
-
const hasEditListener = "onEdit" in vnodeProps;
|
|
234
|
-
const hasSelectListener = "onSelect" in vnodeProps;
|
|
235
|
-
const hasDeselectListener = "onDeselect" in vnodeProps;
|
|
236
|
-
const hasTextEditListener = "onText-edit" in vnodeProps || "onTextEdit" in vnodeProps;
|
|
237
267
|
function resolveTheme() {
|
|
238
|
-
return props.theme
|
|
268
|
+
return mergeThemeConfig2(contextTheme?.value, props.theme);
|
|
239
269
|
}
|
|
240
270
|
function resolveDarkMode() {
|
|
241
271
|
return props.darkMode ?? contextDarkMode?.value;
|
|
@@ -247,34 +277,33 @@ var Chart = defineComponent2({
|
|
|
247
277
|
theme: resolveTheme(),
|
|
248
278
|
darkMode: resolveDarkMode(),
|
|
249
279
|
renderer: props.renderer,
|
|
250
|
-
onDataPointClick: (data) => emit("data-point-click", data),
|
|
251
280
|
onMarkClick: (event) => emit("mark-click", event),
|
|
252
281
|
onMarkHover: (event) => emit("mark-hover", event),
|
|
253
282
|
onMarkLeave: () => emit("mark-leave"),
|
|
254
283
|
onLegendToggle: (series, visible) => emit("legend-toggle", series, visible),
|
|
255
|
-
onAnnotationClick: (annotation, event) => emit("annotation-click", annotation, event),
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
} : {},
|
|
261
|
-
...
|
|
262
|
-
...
|
|
263
|
-
...hasDeselectListener ? { onDeselect: (element) => emit("deselect", element) } : {},
|
|
264
|
-
...hasTextEditListener ? {
|
|
265
|
-
onTextEdit: (element, oldText, newText) => emit("text-edit", element, oldText, newText)
|
|
266
|
-
} : {},
|
|
267
|
-
...props.editable != null ? { editable: props.editable } : {},
|
|
284
|
+
onAnnotationClick: (annotation, event, element) => emit("annotation-click", annotation, event, element),
|
|
285
|
+
onHighlightChange: (values) => emit("highlight-change", values),
|
|
286
|
+
onReveal: (guess) => emit("reveal", guess),
|
|
287
|
+
// Only include selection/edit callbacks when the parent binds a listener:
|
|
288
|
+
// their presence infers the interaction mode when `interaction` is omitted.
|
|
289
|
+
...props.onSelect ? { onSelect: (element) => props.onSelect?.(element) } : {},
|
|
290
|
+
...props.onDeselect ? { onDeselect: (element) => props.onDeselect?.(element) } : {},
|
|
291
|
+
...props.interaction != null ? { interaction: props.interaction } : {},
|
|
268
292
|
...props.selectedElement ? { selectedElement: props.selectedElement } : {},
|
|
269
|
-
|
|
293
|
+
rowHover: props.rowHover,
|
|
294
|
+
autoResize: props.autoResize,
|
|
295
|
+
revision: props.revision,
|
|
296
|
+
...props.onEdit ? { onEdit: (tx) => props.onEdit?.(tx) } : {}
|
|
270
297
|
};
|
|
271
298
|
instance = createChart(container, props.spec, options);
|
|
272
299
|
prevSpec = JSON.stringify(props.spec);
|
|
300
|
+
syncReader();
|
|
273
301
|
if (props.highlight !== void 0) {
|
|
274
302
|
instance.setHighlight(props.highlight ?? null);
|
|
275
303
|
}
|
|
276
304
|
}
|
|
277
305
|
function destroyChart() {
|
|
306
|
+
readerBinding.detach();
|
|
278
307
|
instance?.destroy();
|
|
279
308
|
instance = null;
|
|
280
309
|
prevSpec = "";
|
|
@@ -300,12 +329,16 @@ var Chart = defineComponent2({
|
|
|
300
329
|
destroyChart();
|
|
301
330
|
});
|
|
302
331
|
watch2(
|
|
303
|
-
() => JSON.stringify(props.spec),
|
|
304
|
-
(
|
|
332
|
+
() => [JSON.stringify(props.spec), props.revision],
|
|
333
|
+
([newSpec, newRevision], [, oldRevision]) => {
|
|
305
334
|
if (!instance) return;
|
|
306
|
-
if (
|
|
307
|
-
prevSpec =
|
|
308
|
-
instance.update(props.spec, {
|
|
335
|
+
if (newSpec !== prevSpec || newRevision !== oldRevision) {
|
|
336
|
+
prevSpec = newSpec;
|
|
337
|
+
instance.update(props.spec, {
|
|
338
|
+
selectedElement: props.selectedElement,
|
|
339
|
+
revision: props.revision
|
|
340
|
+
});
|
|
341
|
+
syncReader();
|
|
309
342
|
}
|
|
310
343
|
}
|
|
311
344
|
);
|
|
@@ -327,12 +360,18 @@ var Chart = defineComponent2({
|
|
|
327
360
|
instance.setHighlight(newVal ?? null);
|
|
328
361
|
}
|
|
329
362
|
);
|
|
363
|
+
watch2([() => props.reader, () => props.readerSelection], () => syncReader(), { deep: false });
|
|
330
364
|
watch2(
|
|
331
365
|
[
|
|
366
|
+
() => Boolean(props.onEdit),
|
|
367
|
+
() => Boolean(props.onSelect),
|
|
368
|
+
() => Boolean(props.onDeselect),
|
|
369
|
+
() => props.rowHover,
|
|
370
|
+
() => props.autoResize,
|
|
332
371
|
() => props.theme,
|
|
333
372
|
() => props.darkMode,
|
|
334
373
|
() => props.renderer,
|
|
335
|
-
() => props.
|
|
374
|
+
() => props.interaction,
|
|
336
375
|
() => contextTheme?.value,
|
|
337
376
|
() => contextDarkMode?.value
|
|
338
377
|
],
|
|
@@ -510,8 +549,7 @@ function useChart(spec, options) {
|
|
|
510
549
|
const mountOpts = {
|
|
511
550
|
theme: options?.theme,
|
|
512
551
|
darkMode: options?.darkMode,
|
|
513
|
-
|
|
514
|
-
responsive: options?.responsive,
|
|
552
|
+
autoResize: options?.autoResize,
|
|
515
553
|
renderer: options?.renderer
|
|
516
554
|
};
|
|
517
555
|
const instance = createChart2(container, spec.value, mountOpts);
|
|
@@ -742,6 +780,7 @@ function useTableState(initialState) {
|
|
|
742
780
|
}
|
|
743
781
|
|
|
744
782
|
// src/DataTable.ts
|
|
783
|
+
import { mergeThemeConfig as mergeThemeConfig3 } from "@opendata-ai/openchart-core";
|
|
745
784
|
import {
|
|
746
785
|
createTable as createTable2
|
|
747
786
|
} from "@opendata-ai/openchart-vanilla";
|
|
@@ -802,7 +841,7 @@ var DataTable = defineComponent4({
|
|
|
802
841
|
const contextTheme = inject4(VizThemeKey, void 0);
|
|
803
842
|
const contextDarkMode = inject4(VizDarkModeKey, void 0);
|
|
804
843
|
function resolveTheme() {
|
|
805
|
-
return props.theme
|
|
844
|
+
return mergeThemeConfig3(contextTheme?.value, props.theme);
|
|
806
845
|
}
|
|
807
846
|
function resolveDarkMode() {
|
|
808
847
|
return props.darkMode ?? contextDarkMode?.value;
|
|
@@ -818,7 +857,7 @@ var DataTable = defineComponent4({
|
|
|
818
857
|
theme: resolveTheme(),
|
|
819
858
|
darkMode: resolveDarkMode(),
|
|
820
859
|
onRowClick: (row) => emit("row-click", row),
|
|
821
|
-
|
|
860
|
+
autoResize: true,
|
|
822
861
|
onStateChange: (state) => {
|
|
823
862
|
if (state.sort !== void 0) emit("update:sort", state.sort);
|
|
824
863
|
if (state.search !== void 0) emit("update:search", state.search);
|
|
@@ -890,8 +929,10 @@ var DataTable = defineComponent4({
|
|
|
890
929
|
});
|
|
891
930
|
|
|
892
931
|
// src/GeoMap.ts
|
|
932
|
+
import { mergeThemeConfig as mergeThemeConfig4 } from "@opendata-ai/openchart-core";
|
|
893
933
|
import {
|
|
894
|
-
createGeoMap
|
|
934
|
+
createGeoMap,
|
|
935
|
+
createGeoReaderBinding
|
|
895
936
|
} from "@opendata-ai/openchart-vanilla";
|
|
896
937
|
import {
|
|
897
938
|
defineComponent as defineComponent5,
|
|
@@ -905,6 +946,12 @@ import {
|
|
|
905
946
|
var GeoMap = defineComponent5({
|
|
906
947
|
name: "GeoMap",
|
|
907
948
|
props: {
|
|
949
|
+
reader: { type: [Boolean, Object], default: void 0 },
|
|
950
|
+
readerSelection: { type: Object, default: void 0 },
|
|
951
|
+
labelInventory: {
|
|
952
|
+
type: [Boolean, Object],
|
|
953
|
+
default: void 0
|
|
954
|
+
},
|
|
908
955
|
spec: {
|
|
909
956
|
type: Object,
|
|
910
957
|
required: true
|
|
@@ -927,18 +974,31 @@ var GeoMap = defineComponent5({
|
|
|
927
974
|
}
|
|
928
975
|
},
|
|
929
976
|
emits: {
|
|
977
|
+
"reader-change": (_selection, _meta) => true,
|
|
930
978
|
"mark-click": (_event) => true,
|
|
931
979
|
"mark-hover": (_event) => true,
|
|
932
|
-
"camera-change": (_camera) => true
|
|
980
|
+
"camera-change": (_camera, _meta) => true
|
|
933
981
|
},
|
|
934
982
|
setup(props, { emit, expose }) {
|
|
935
983
|
const containerRef = ref10(null);
|
|
936
984
|
let instance = null;
|
|
937
985
|
let prevSpec = "";
|
|
986
|
+
const readerBinding = createGeoReaderBinding();
|
|
987
|
+
function syncReader() {
|
|
988
|
+
if (containerRef.value && instance)
|
|
989
|
+
readerBinding.sync(
|
|
990
|
+
containerRef.value,
|
|
991
|
+
instance,
|
|
992
|
+
props.spec,
|
|
993
|
+
props.reader,
|
|
994
|
+
props.readerSelection,
|
|
995
|
+
(state, meta) => emit("reader-change", state, meta)
|
|
996
|
+
);
|
|
997
|
+
}
|
|
938
998
|
const contextTheme = inject5(VizThemeKey, void 0);
|
|
939
999
|
const contextDarkMode = inject5(VizDarkModeKey, void 0);
|
|
940
1000
|
function resolveTheme() {
|
|
941
|
-
return props.theme
|
|
1001
|
+
return mergeThemeConfig4(contextTheme?.value, props.theme);
|
|
942
1002
|
}
|
|
943
1003
|
function resolveDarkMode() {
|
|
944
1004
|
return props.darkMode ?? contextDarkMode?.value;
|
|
@@ -951,13 +1011,16 @@ var GeoMap = defineComponent5({
|
|
|
951
1011
|
darkMode: resolveDarkMode(),
|
|
952
1012
|
onMarkClick: (feature) => emit("mark-click", feature),
|
|
953
1013
|
onMarkHover: (feature) => emit("mark-hover", feature),
|
|
954
|
-
onCameraChange: (camera) => emit("camera-change", camera),
|
|
955
|
-
|
|
1014
|
+
onCameraChange: (camera, meta) => meta ? emit("camera-change", camera, meta) : emit("camera-change", camera),
|
|
1015
|
+
autoResize: true,
|
|
1016
|
+
labelInventory: props.labelInventory
|
|
956
1017
|
};
|
|
957
1018
|
instance = createGeoMap(container, props.spec, options);
|
|
958
1019
|
prevSpec = JSON.stringify(props.spec);
|
|
1020
|
+
syncReader();
|
|
959
1021
|
}
|
|
960
1022
|
function destroyMap() {
|
|
1023
|
+
readerBinding.detach();
|
|
961
1024
|
instance?.destroy();
|
|
962
1025
|
instance = null;
|
|
963
1026
|
prevSpec = "";
|
|
@@ -980,9 +1043,15 @@ var GeoMap = defineComponent5({
|
|
|
980
1043
|
if (newVal !== prevSpec) {
|
|
981
1044
|
prevSpec = newVal;
|
|
982
1045
|
instance.update(props.spec);
|
|
1046
|
+
syncReader();
|
|
983
1047
|
}
|
|
984
1048
|
}
|
|
985
1049
|
);
|
|
1050
|
+
watch8(
|
|
1051
|
+
() => props.labelInventory,
|
|
1052
|
+
(value) => instance?.setLabelInventory(value)
|
|
1053
|
+
);
|
|
1054
|
+
watch8([() => props.reader, () => props.readerSelection], () => syncReader(), { deep: false });
|
|
986
1055
|
watch8(
|
|
987
1056
|
[
|
|
988
1057
|
() => props.theme,
|
|
@@ -1009,6 +1078,7 @@ var GeoMap = defineComponent5({
|
|
|
1009
1078
|
});
|
|
1010
1079
|
|
|
1011
1080
|
// src/Graph.ts
|
|
1081
|
+
import { mergeThemeConfig as mergeThemeConfig5 } from "@opendata-ai/openchart-core";
|
|
1012
1082
|
import {
|
|
1013
1083
|
createGraph
|
|
1014
1084
|
} from "@opendata-ai/openchart-vanilla";
|
|
@@ -1083,7 +1153,7 @@ var Graph = defineComponent6({
|
|
|
1083
1153
|
const contextTheme = inject6(VizThemeKey, void 0);
|
|
1084
1154
|
const contextDarkMode = inject6(VizDarkModeKey, void 0);
|
|
1085
1155
|
function resolveTheme() {
|
|
1086
|
-
return props.theme
|
|
1156
|
+
return mergeThemeConfig5(contextTheme?.value, props.theme);
|
|
1087
1157
|
}
|
|
1088
1158
|
function resolveDarkMode() {
|
|
1089
1159
|
return props.darkMode ?? contextDarkMode?.value;
|
|
@@ -1113,7 +1183,7 @@ var Graph = defineComponent6({
|
|
|
1113
1183
|
onLegendToggle: (activeValues) => emit("legend-toggle", activeValues),
|
|
1114
1184
|
onHighlightChange: (nodeIds) => emit("highlight-change", nodeIds),
|
|
1115
1185
|
onCameraChange: (camera) => emit("camera-change", camera),
|
|
1116
|
-
|
|
1186
|
+
autoResize: true,
|
|
1117
1187
|
suppressEntrance: mountedOnce && !playEntrance
|
|
1118
1188
|
};
|
|
1119
1189
|
instance = createGraph(container, props.spec, options);
|
|
@@ -1174,8 +1244,8 @@ var Graph = defineComponent6({
|
|
|
1174
1244
|
getActiveCategories() {
|
|
1175
1245
|
return instance?.getActiveCategories() ?? [];
|
|
1176
1246
|
},
|
|
1177
|
-
|
|
1178
|
-
instance?.
|
|
1247
|
+
update(spec) {
|
|
1248
|
+
instance?.update(spec);
|
|
1179
1249
|
},
|
|
1180
1250
|
get instance() {
|
|
1181
1251
|
return instance;
|
|
@@ -1231,6 +1301,7 @@ var Graph = defineComponent6({
|
|
|
1231
1301
|
});
|
|
1232
1302
|
|
|
1233
1303
|
// src/Sankey.ts
|
|
1304
|
+
import { mergeThemeConfig as mergeThemeConfig6 } from "@opendata-ai/openchart-core";
|
|
1234
1305
|
import {
|
|
1235
1306
|
createSankey
|
|
1236
1307
|
} from "@opendata-ai/openchart-vanilla";
|
|
@@ -1280,7 +1351,7 @@ var Sankey = defineComponent7({
|
|
|
1280
1351
|
const contextTheme = inject7(VizThemeKey, void 0);
|
|
1281
1352
|
const contextDarkMode = inject7(VizDarkModeKey, void 0);
|
|
1282
1353
|
function resolveTheme() {
|
|
1283
|
-
return props.theme
|
|
1354
|
+
return mergeThemeConfig6(contextTheme?.value, props.theme);
|
|
1284
1355
|
}
|
|
1285
1356
|
function resolveDarkMode() {
|
|
1286
1357
|
return props.darkMode ?? contextDarkMode?.value;
|
|
@@ -1295,7 +1366,7 @@ var Sankey = defineComponent7({
|
|
|
1295
1366
|
onLinkClick: (link) => emit("link-click", link),
|
|
1296
1367
|
onNodeHover: (node) => emit("node-hover", node),
|
|
1297
1368
|
onLinkHover: (link) => emit("link-hover", link),
|
|
1298
|
-
|
|
1369
|
+
autoResize: true
|
|
1299
1370
|
};
|
|
1300
1371
|
instance = createSankey(container, props.spec, options);
|
|
1301
1372
|
prevSpec = JSON.stringify(props.spec);
|
|
@@ -1375,6 +1446,7 @@ var VizThemeProvider = defineComponent8({
|
|
|
1375
1446
|
});
|
|
1376
1447
|
|
|
1377
1448
|
// src/TileMap.ts
|
|
1449
|
+
import { mergeThemeConfig as mergeThemeConfig7 } from "@opendata-ai/openchart-core";
|
|
1378
1450
|
import {
|
|
1379
1451
|
createTileMap
|
|
1380
1452
|
} from "@opendata-ai/openchart-vanilla";
|
|
@@ -1422,7 +1494,7 @@ var TileMap = defineComponent9({
|
|
|
1422
1494
|
const contextTheme = inject8(VizThemeKey, void 0);
|
|
1423
1495
|
const contextDarkMode = inject8(VizDarkModeKey, void 0);
|
|
1424
1496
|
function resolveTheme() {
|
|
1425
|
-
return props.theme
|
|
1497
|
+
return mergeThemeConfig7(contextTheme?.value, props.theme);
|
|
1426
1498
|
}
|
|
1427
1499
|
function resolveDarkMode() {
|
|
1428
1500
|
return props.darkMode ?? contextDarkMode?.value;
|
|
@@ -1435,7 +1507,7 @@ var TileMap = defineComponent9({
|
|
|
1435
1507
|
darkMode: resolveDarkMode(),
|
|
1436
1508
|
onTileClick: (tile) => emit("tile-click", tile),
|
|
1437
1509
|
onTileHover: (tile) => emit("tile-hover", tile),
|
|
1438
|
-
|
|
1510
|
+
autoResize: true
|
|
1439
1511
|
};
|
|
1440
1512
|
instance = createTileMap(container, props.spec, options);
|
|
1441
1513
|
prevSpec = JSON.stringify(props.spec);
|