@unovis/vue 1.7.0-pre.1 → 1.7.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 -0
- package/components/annotations/index.cjs +1 -1
- package/components/annotations/index.cjs.map +1 -1
- package/components/annotations/index.d.ts +18 -100
- package/components/annotations/index.js +18 -20
- package/components/annotations/index.js.map +1 -1
- package/components/area/index.cjs +1 -1
- package/components/area/index.cjs.map +1 -1
- package/components/area/index.d.ts +12 -64
- package/components/area/index.js +31 -32
- package/components/area/index.js.map +1 -1
- package/components/axis/index.cjs +1 -1
- package/components/axis/index.cjs.map +1 -1
- package/components/axis/index.d.ts +12 -82
- package/components/axis/index.js +29 -28
- package/components/axis/index.js.map +1 -1
- package/components/boxplot/index.cjs +2 -0
- package/components/boxplot/index.cjs.map +1 -0
- package/components/boxplot/index.d.ts +19 -0
- package/components/boxplot/index.js +31 -0
- package/components/boxplot/index.js.map +1 -0
- package/components/boxplot/index2.cjs +2 -0
- package/components/boxplot/index2.cjs.map +1 -0
- package/components/boxplot/index2.js +7 -0
- package/components/boxplot/index2.js.map +1 -0
- package/components/brush/index.cjs +1 -1
- package/components/brush/index.cjs.map +1 -1
- package/components/brush/index.d.ts +12 -62
- package/components/brush/index.js +26 -28
- package/components/brush/index.js.map +1 -1
- package/components/chord-diagram/index.cjs +1 -1
- package/components/chord-diagram/index.cjs.map +1 -1
- package/components/chord-diagram/index.d.ts +12 -60
- package/components/chord-diagram/index.js +30 -32
- package/components/chord-diagram/index.js.map +1 -1
- package/components/crosshair/index.cjs +1 -1
- package/components/crosshair/index.cjs.map +1 -1
- package/components/crosshair/index.d.ts +12 -66
- package/components/crosshair/index.js +20 -24
- package/components/crosshair/index.js.map +1 -1
- package/components/donut/index.cjs +1 -1
- package/components/donut/index.cjs.map +1 -1
- package/components/donut/index.d.ts +12 -64
- package/components/donut/index.js +24 -26
- package/components/donut/index.js.map +1 -1
- package/components/free-brush/index.cjs +1 -1
- package/components/free-brush/index.cjs.map +1 -1
- package/components/free-brush/index.d.ts +12 -62
- package/components/free-brush/index.js +25 -28
- package/components/free-brush/index.js.map +1 -1
- package/components/graph/index.cjs +1 -1
- package/components/graph/index.cjs.map +1 -1
- package/components/graph/index.d.ts +11 -135
- package/components/graph/index.js +70 -66
- package/components/graph/index.js.map +1 -1
- package/components/grouped-bar/index.cjs +1 -1
- package/components/grouped-bar/index.cjs.map +1 -1
- package/components/grouped-bar/index.d.ts +12 -62
- package/components/grouped-bar/index.js +27 -28
- package/components/grouped-bar/index.js.map +1 -1
- package/components/heatmap/index.cjs +2 -0
- package/components/heatmap/index.cjs.map +1 -0
- package/components/heatmap/index.d.ts +19 -0
- package/components/heatmap/index.js +49 -0
- package/components/heatmap/index.js.map +1 -0
- package/components/heatmap/index2.cjs +2 -0
- package/components/heatmap/index2.cjs.map +1 -0
- package/components/heatmap/index2.js +7 -0
- package/components/heatmap/index2.js.map +1 -0
- package/components/line/index.cjs +1 -1
- package/components/line/index.cjs.map +1 -1
- package/components/line/index.d.ts +12 -60
- package/components/line/index.js +28 -30
- package/components/line/index.js.map +1 -1
- package/components/nested-donut/index.cjs +1 -1
- package/components/nested-donut/index.cjs.map +1 -1
- package/components/nested-donut/index.d.ts +12 -65
- package/components/nested-donut/index.js +26 -29
- package/components/nested-donut/index.js.map +1 -1
- package/components/plotband/index.cjs +1 -1
- package/components/plotband/index.cjs.map +1 -1
- package/components/plotband/index.d.ts +12 -63
- package/components/plotband/index.js +17 -18
- package/components/plotband/index.js.map +1 -1
- package/components/plotline/index.cjs +1 -1
- package/components/plotline/index.cjs.map +1 -1
- package/components/plotline/index.d.ts +12 -64
- package/components/plotline/index.js +18 -19
- package/components/plotline/index.js.map +1 -1
- package/components/radial-bar/index.cjs +2 -0
- package/components/radial-bar/index.cjs.map +1 -0
- package/components/radial-bar/index.d.ts +19 -0
- package/components/radial-bar/index.js +54 -0
- package/components/radial-bar/index.js.map +1 -0
- package/components/radial-bar/index2.cjs +2 -0
- package/components/radial-bar/index2.cjs.map +1 -0
- package/components/radial-bar/index2.js +7 -0
- package/components/radial-bar/index2.js.map +1 -0
- package/components/sankey/index.cjs +1 -1
- package/components/sankey/index.cjs.map +1 -1
- package/components/sankey/index.d.ts +12 -106
- package/components/sankey/index.js +42 -41
- package/components/sankey/index.js.map +1 -1
- package/components/scatter/index.cjs +1 -1
- package/components/scatter/index.cjs.map +1 -1
- package/components/scatter/index.d.ts +12 -65
- package/components/scatter/index.js +33 -35
- package/components/scatter/index.js.map +1 -1
- package/components/stacked-bar/index.cjs +1 -1
- package/components/stacked-bar/index.cjs.map +1 -1
- package/components/stacked-bar/index.d.ts +12 -62
- package/components/stacked-bar/index.js +29 -29
- package/components/stacked-bar/index.js.map +1 -1
- package/components/timeline/index.cjs +1 -1
- package/components/timeline/index.cjs.map +1 -1
- package/components/timeline/index.d.ts +12 -88
- package/components/timeline/index.js +20 -24
- package/components/timeline/index.js.map +1 -1
- package/components/tooltip/index.cjs +1 -1
- package/components/tooltip/index.cjs.map +1 -1
- package/components/tooltip/index.d.ts +19 -99
- package/components/tooltip/index.js +15 -17
- package/components/tooltip/index.js.map +1 -1
- package/components/topojson-map/index.cjs +1 -1
- package/components/topojson-map/index.cjs.map +1 -1
- package/components/topojson-map/index.d.ts +12 -78
- package/components/topojson-map/index.js +66 -39
- package/components/topojson-map/index.js.map +1 -1
- package/components/treemap/index.cjs +1 -1
- package/components/treemap/index.cjs.map +1 -1
- package/components/treemap/index.d.ts +12 -69
- package/components/treemap/index.js +25 -26
- package/components/treemap/index.js.map +1 -1
- package/components/xy-labels/index.cjs +1 -1
- package/components/xy-labels/index.cjs.map +1 -1
- package/components/xy-labels/index.d.ts +12 -66
- package/components/xy-labels/index.js +36 -39
- package/components/xy-labels/index.js.map +1 -1
- package/components.d.ts +30 -27
- package/containers/single-container/index.cjs +1 -1
- package/containers/single-container/index.cjs.map +1 -1
- package/containers/single-container/index.d.ts +11 -26
- package/containers/single-container/index.js +26 -26
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/index.cjs +1 -1
- package/containers/xy-container/index.cjs.map +1 -1
- package/containers/xy-container/index.d.ts +12 -45
- package/containers/xy-container/index.js +25 -30
- package/containers/xy-container/index.js.map +1 -1
- package/containers.d.ts +2 -2
- package/html-components/bullet-legend/index.cjs +1 -1
- package/html-components/bullet-legend/index.cjs.map +1 -1
- package/html-components/bullet-legend/index.d.ts +18 -74
- package/html-components/bullet-legend/index.js +24 -25
- package/html-components/bullet-legend/index.js.map +1 -1
- package/html-components/flow-legend/index.cjs +1 -1
- package/html-components/flow-legend/index.cjs.map +1 -1
- package/html-components/flow-legend/index.d.ts +19 -85
- package/html-components/flow-legend/index.js +21 -23
- package/html-components/flow-legend/index.js.map +1 -1
- package/html-components/leaflet-flow-map/index.cjs +1 -1
- package/html-components/leaflet-flow-map/index.cjs.map +1 -1
- package/html-components/leaflet-flow-map/index.d.ts +12 -112
- package/html-components/leaflet-flow-map/index.js +46 -48
- package/html-components/leaflet-flow-map/index.js.map +1 -1
- package/html-components/leaflet-map/index.cjs +1 -1
- package/html-components/leaflet-map/index.cjs.map +1 -1
- package/html-components/leaflet-map/index.d.ts +12 -99
- package/html-components/leaflet-map/index.js +37 -39
- package/html-components/leaflet-map/index.js.map +1 -1
- package/html-components/rolling-pin-legend/index.cjs +1 -1
- package/html-components/rolling-pin-legend/index.cjs.map +1 -1
- package/html-components/rolling-pin-legend/index.d.ts +18 -50
- package/html-components/rolling-pin-legend/index.js +22 -24
- package/html-components/rolling-pin-legend/index.js.map +1 -1
- package/index.cjs +2 -2
- package/index.js +101 -92
- package/index.js.map +1 -1
- package/package.json +14 -13
- package/utils/context.cjs.map +1 -1
- package/utils/context.d.ts +1 -0
- package/utils/context.js +1 -1
- package/utils/context.js.map +1 -1
- package/utils/props.cjs +1 -1
- package/utils/props.cjs.map +1 -1
- package/utils/props.d.ts +2 -4
- package/utils/props.js +9 -9
- package/utils/props.js.map +1 -1
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { defineComponent as p, inject as
|
|
2
|
-
import { Treemap as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as p, inject as d, computed as m, ref as f, onMounted as y, nextTick as F, onUnmounted as b, watch as r, openBlock as v, createElementBlock as S } from "vue";
|
|
2
|
+
import { Treemap as s } from "@unovis/ts";
|
|
3
|
+
import { componentAccessorKey as B } from "../../utils/context.js";
|
|
4
|
+
import { useForwardProps as T, arePropsEqual as g } from "../../utils/props.js";
|
|
5
|
+
const L = { "data-vis-component": "" }, z = s.selectors, k = /* @__PURE__ */ p({
|
|
6
6
|
__name: "index",
|
|
7
7
|
props: {
|
|
8
8
|
id: { type: Function },
|
|
9
|
-
value: {},
|
|
9
|
+
value: { type: [Function, Number, null] },
|
|
10
10
|
layers: {},
|
|
11
11
|
numberFormat: { type: Function },
|
|
12
12
|
tileLabel: { type: Function },
|
|
13
|
-
tileColor: {},
|
|
13
|
+
tileColor: { type: [Function, String, Array, null] },
|
|
14
|
+
tileFunction: { type: Function },
|
|
15
|
+
tileSort: { type: [Function, null] },
|
|
14
16
|
tilePadding: {},
|
|
15
17
|
tilePaddingTop: {},
|
|
18
|
+
tileShowHtmlTooltip: { type: Boolean },
|
|
16
19
|
labelInternalNodes: { type: Boolean },
|
|
17
20
|
labelOffsetX: {},
|
|
18
21
|
labelOffsetY: {},
|
|
@@ -33,29 +36,25 @@ const S = { "data-vis-component": "" }, w = c.selectors, C = /* @__PURE__ */ p({
|
|
|
33
36
|
attributes: {},
|
|
34
37
|
data: {}
|
|
35
38
|
},
|
|
36
|
-
setup(u, { expose:
|
|
37
|
-
const
|
|
38
|
-
return
|
|
39
|
+
setup(u, { expose: c }) {
|
|
40
|
+
const a = u, t = d(B), o = m(() => t.data.value ?? a.data), n = T(a), e = f();
|
|
41
|
+
return y(() => {
|
|
39
42
|
F(() => {
|
|
40
|
-
|
|
41
|
-
t.value = new c(n.value), (e = t.value) == null || e.setData(a.value), o.update(t.value);
|
|
43
|
+
e.value = new s(n.value), e.value?.setData(o.value), t.update(e.value);
|
|
42
44
|
});
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}), d({
|
|
53
|
-
component: t
|
|
54
|
-
}), (e, i) => (L(), B("div", S));
|
|
45
|
+
}), b(() => {
|
|
46
|
+
e.value?.destroy(), t.destroy();
|
|
47
|
+
}), r(n, (l, i) => {
|
|
48
|
+
g(l, i) || (e.value?.setConfig(n.value), e.value?.render());
|
|
49
|
+
}), r(o, () => {
|
|
50
|
+
e.value?.setData(o.value);
|
|
51
|
+
}), c({
|
|
52
|
+
component: e
|
|
53
|
+
}), (l, i) => (v(), S("div", L));
|
|
55
54
|
}
|
|
56
55
|
});
|
|
57
56
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
z as VisTreemapSelectors,
|
|
58
|
+
k as default
|
|
60
59
|
};
|
|
61
60
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/treemap/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum\">\n// !!! This code was automatically generated. You should not change it !!!\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/treemap/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum\">\n// !!! This code was automatically generated. You should not change it !!!\nimport type { TreemapConfigInterface } from '@unovis/ts'\nimport { Treemap } from '@unovis/ts'\nimport { computed, inject, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'\nimport { componentAccessorKey } from '../../utils/context'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\n\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst accessor = inject(componentAccessorKey)\n\n// data and required props\ntype Props = TreemapConfigInterface<Datum>\nconst data = computed(() => accessor.data.value ?? props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<Treemap<Datum>>()\n\nonMounted(() => {\n nextTick(() => {\n component.value = new Treemap<Datum>(config.value)\n component.value?.setData(data.value)\n accessor.update(component.value)\n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n accessor.destroy()\n})\n\nwatch(config, (curr, prev) => {\n if (!arePropsEqual(curr, prev)) {\n component.value?.setConfig(config.value)\n component.value?.render()\n }\n})\n\nwatch(data, () => {\n component.value?.setData(data.value)\n})\n\ndefineExpose({\n component,\n})\n</script>\n\n<script lang=\"ts\">\nexport const VisTreemapSelectors = Treemap.selectors\n</script>\n\n<template>\n <div data-vis-component />\n</template>\n"],"names":["VisTreemapSelectors","Treemap","props","__props","accessor","inject","componentAccessorKey","data","computed","config","useForwardProps","component","ref","onMounted","nextTick","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_openBlock","_createElementBlock","_hoisted_1"],"mappings":";;;;wCAmDaA,IAAsBC,EAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA3C3C,UAAMC,IAAQC,GAERC,IAAWC,EAAOC,CAAoB,GAItCC,IAAOC,EAAS,MAAMJ,EAAS,KAAK,SAASF,EAAM,IAAI,GAEvDO,IAASC,EAAgBR,CAAK,GAG9BS,IAAYC,EAAA;AAElB,WAAAC,EAAU,MAAM;AACd,MAAAC,EAAS,MAAM;AACb,QAAAH,EAAU,QAAQ,IAAIV,EAAeQ,EAAO,KAAK,GACjDE,EAAU,OAAO,QAAQJ,EAAK,KAAK,GACnCH,EAAS,OAAOO,EAAU,KAAK;AAAA,MACjC,CAAC;AAAA,IACH,CAAC,GAEDI,EAAY,MAAM;AAChB,MAAAJ,EAAU,OAAO,QAAA,GACjBP,EAAS,QAAA;AAAA,IACX,CAAC,GAEDY,EAAMP,GAAQ,CAACQ,GAAMC,MAAS;AAC5B,MAAKC,EAAcF,GAAMC,CAAI,MAC3BP,EAAU,OAAO,UAAUF,EAAO,KAAK,GACvCE,EAAU,OAAO,OAAA;AAAA,IAErB,CAAC,GAEDK,EAAMT,GAAM,MAAM;AAChB,MAAAI,EAAU,OAAO,QAAQJ,EAAK,KAAK;AAAA,IACrC,CAAC,GAEDa,EAAa;AAAA,MACX,WAAAT;AAAA,IAAA,CACD,cAQCU,EAAA,GAAAC,EAA0B,OAA1BC,CAA0B;AAAA;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("@unovis/ts"),y=require("../../utils/context.cjs"),a=require("../../utils/props.cjs"),d={"data-vis-component":""},F=i.XYLabels.selectors,g=e.defineComponent({__name:"index",props:{color:{type:[Function,String,Array,null]},y:{type:[Function,Number,null]},xPositioning:{type:[Function,String,null]},yPositioning:{type:[Function,String,null]},labelFontSize:{type:[Function,Number,null]},label:{type:[Function,String,null]},backgroundColor:{type:[Function,String,Array,null]},cursor:{type:[Function,String,null]},labelTextBrightnessRatio:{},clustering:{type:Boolean},clusterLabel:{type:[Function,String,null]},clusterFontSize:{type:[Function,Number,null]},clusterBackgroundColor:{type:[Function,String,Array,null]},clusterCursor:{type:[Function,String,null]},clusterLabelColor:{type:[Function,String,Array,null]},x:{type:[Function,Number,null]},id:{type:Function},colorKeys:{},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(s,{expose:p}){const u=s,n=e.inject(y.componentAccessorKey),o=e.computed(()=>n.data.value??u.data),l=a.useForwardProps(u),t=e.ref();return e.onMounted(()=>{e.nextTick(()=>{t.value=new i.XYLabels(l.value),t.value?.setData(o.value),n.update(t.value)})}),e.onUnmounted(()=>{t.value?.destroy(),n.destroy()}),e.watch(l,(r,c)=>{a.arePropsEqual(r,c)||(t.value?.setConfig(l.value),t.value?.render())}),e.watch(o,()=>{t.value?.setData(o.value)}),p({component:t}),(r,c)=>(e.openBlock(),e.createElementBlock("div",d))}});exports.VisXYLabelsSelectors=F;exports.default=g;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/xy-labels/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum\">\n// !!! This code was automatically generated. You should not change it !!!\nimport {
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/xy-labels/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum\">\n// !!! This code was automatically generated. You should not change it !!!\nimport type { XYLabelsConfigInterface } from '@unovis/ts'\nimport { XYLabels } from '@unovis/ts'\nimport { computed, inject, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'\nimport { componentAccessorKey } from '../../utils/context'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\n\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst accessor = inject(componentAccessorKey)\n\n// data and required props\ntype Props = XYLabelsConfigInterface<Datum>\nconst data = computed(() => accessor.data.value ?? props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<XYLabels<Datum>>()\n\nonMounted(() => {\n nextTick(() => {\n component.value = new XYLabels<Datum>(config.value)\n component.value?.setData(data.value)\n accessor.update(component.value)\n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n accessor.destroy()\n})\n\nwatch(config, (curr, prev) => {\n if (!arePropsEqual(curr, prev)) {\n component.value?.setConfig(config.value)\n component.value?.render()\n }\n})\n\nwatch(data, () => {\n component.value?.setData(data.value)\n})\n\ndefineExpose({\n component,\n})\n</script>\n\n<script lang=\"ts\">\nexport const VisXYLabelsSelectors = XYLabels.selectors\n</script>\n\n<template>\n <div data-vis-component />\n</template>\n"],"names":["VisXYLabelsSelectors","XYLabels","props","__props","accessor","inject","componentAccessorKey","data","computed","config","useForwardProps","component","ref","onMounted","nextTick","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_openBlock","_createElementBlock","_hoisted_1"],"mappings":"+PAmDaA,EAAuBC,EAAAA,SAAS,u5BA3C7C,MAAMC,EAAQC,EAERC,EAAWC,EAAAA,OAAOC,sBAAoB,EAItCC,EAAOC,EAAAA,SAAS,IAAMJ,EAAS,KAAK,OAASF,EAAM,IAAI,EAEvDO,EAASC,EAAAA,gBAAgBR,CAAK,EAG9BS,EAAYC,EAAAA,IAAA,EAElBC,OAAAA,EAAAA,UAAU,IAAM,CACdC,EAAAA,SAAS,IAAM,CACbH,EAAU,MAAQ,IAAIV,WAAgBQ,EAAO,KAAK,EAClDE,EAAU,OAAO,QAAQJ,EAAK,KAAK,EACnCH,EAAS,OAAOO,EAAU,KAAK,CACjC,CAAC,CACH,CAAC,EAEDI,EAAAA,YAAY,IAAM,CAChBJ,EAAU,OAAO,QAAA,EACjBP,EAAS,QAAA,CACX,CAAC,EAEDY,EAAAA,MAAMP,EAAQ,CAACQ,EAAMC,IAAS,CACvBC,EAAAA,cAAcF,EAAMC,CAAI,IAC3BP,EAAU,OAAO,UAAUF,EAAO,KAAK,EACvCE,EAAU,OAAO,OAAA,EAErB,CAAC,EAEDK,EAAAA,MAAMT,EAAM,IAAM,CAChBI,EAAU,OAAO,QAAQJ,EAAK,KAAK,CACrC,CAAC,EAEDa,EAAa,CACX,UAAAT,CAAA,CACD,UAQCU,YAAA,EAAAC,qBAA0B,MAA1BC,CAA0B"}
|
|
@@ -1,73 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
slots: any;
|
|
7
|
-
}, __VLS_expose?: any, __VLS_setup?: Promise<{
|
|
8
|
-
props: {
|
|
9
|
-
duration?: number;
|
|
10
|
-
events?: {
|
|
11
|
-
[selector: string]: {
|
|
12
|
-
touchstart?: import("@unovis/ts").VisEventCallback<any>;
|
|
13
|
-
touchmove?: import("@unovis/ts").VisEventCallback<any>;
|
|
14
|
-
touchend?: import("@unovis/ts").VisEventCallback<any>;
|
|
15
|
-
mouseover?: import("@unovis/ts").VisEventCallback<any>;
|
|
16
|
-
mousemove?: import("@unovis/ts").VisEventCallback<any>;
|
|
17
|
-
mousedown?: import("@unovis/ts").VisEventCallback<any>;
|
|
18
|
-
mouseup?: import("@unovis/ts").VisEventCallback<any>;
|
|
19
|
-
click?: import("@unovis/ts").VisEventCallback<any>;
|
|
20
|
-
auxclick?: import("@unovis/ts").VisEventCallback<any>;
|
|
21
|
-
contextmenu?: import("@unovis/ts").VisEventCallback<any>;
|
|
22
|
-
dblclick?: import("@unovis/ts").VisEventCallback<any>;
|
|
23
|
-
mouseenter?: import("@unovis/ts").VisEventCallback<any>;
|
|
24
|
-
mouseleave?: import("@unovis/ts").VisEventCallback<any>;
|
|
25
|
-
mouseout?: import("@unovis/ts").VisEventCallback<any>;
|
|
26
|
-
scroll?: import("@unovis/ts").VisEventCallback<any>;
|
|
27
|
-
select?: import("@unovis/ts").VisEventCallback<any>;
|
|
28
|
-
wheel?: import("@unovis/ts").VisEventCallback<any>;
|
|
29
|
-
pointerdown?: import("@unovis/ts").VisEventCallback<any>;
|
|
30
|
-
pointerup?: import("@unovis/ts").VisEventCallback<any>;
|
|
31
|
-
pointerout?: import("@unovis/ts").VisEventCallback<any>;
|
|
32
|
-
pointermove?: import("@unovis/ts").VisEventCallback<any>;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
attributes?: {
|
|
36
|
-
[selector: string]: {
|
|
37
|
-
[attr: string]: string | number | boolean | ((datum: any) => string | number | boolean);
|
|
38
|
-
};
|
|
39
|
-
};
|
|
1
|
+
import { XYLabelsConfigInterface, XYLabels } from '@unovis/ts';
|
|
2
|
+
|
|
3
|
+
export declare const VisXYLabelsSelectors: typeof import("@unovis/ts/components/xy-labels/style");
|
|
4
|
+
declare const _default: <Datum>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & (XYLabelsConfigInterface<Datum> & {
|
|
40
6
|
data?: Datum[];
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
color?: import("@unovis/ts").ColorAccessor<Datum>;
|
|
45
|
-
cursor?: import("@unovis/ts").StringAccessor<Datum>;
|
|
46
|
-
id?: (d: Datum, i: number, ...any: any[]) => string;
|
|
47
|
-
xScale?: import("@unovis/ts").ContinuousScale;
|
|
48
|
-
yScale?: import("@unovis/ts").ContinuousScale;
|
|
49
|
-
excludeFromDomainCalculation?: boolean;
|
|
50
|
-
labelFontSize?: NumericAccessor<Datum>;
|
|
51
|
-
labelTextBrightnessRatio?: number;
|
|
52
|
-
xPositioning?: import("@unovis/ts").GenericAccessor<string, Datum>;
|
|
53
|
-
yPositioning?: import("@unovis/ts").GenericAccessor<string, Datum>;
|
|
54
|
-
backgroundColor?: import("@unovis/ts").ColorAccessor<Datum>;
|
|
55
|
-
clustering?: boolean;
|
|
56
|
-
clusterLabel?: import("@unovis/ts").StringAccessor<import("@unovis/ts").XYLabel<Datum>[]>;
|
|
57
|
-
clusterFontSize?: NumericAccessor<import("@unovis/ts").XYLabel<Datum>[]>;
|
|
58
|
-
clusterBackgroundColor?: import("@unovis/ts").ColorAccessor<import("@unovis/ts").XYLabel<Datum>[]>;
|
|
59
|
-
clusterCursor?: import("@unovis/ts").StringAccessor<import("@unovis/ts").XYLabel<Datum>[]>;
|
|
60
|
-
clusterLabelColor?: import("@unovis/ts").ColorAccessor<import("@unovis/ts").XYLabel<Datum>[]>;
|
|
61
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
62
|
-
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
63
|
-
component: import("vue").Ref<XYLabels<Datum>, XYLabels<Datum>>;
|
|
7
|
+
}), keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
8
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
9
|
+
component: import('vue').Ref<XYLabels<Datum>, XYLabels<Datum>>;
|
|
64
10
|
}>): void;
|
|
65
11
|
attrs: any;
|
|
66
|
-
slots: {}
|
|
67
|
-
emit:
|
|
68
|
-
}>) => import(
|
|
12
|
+
slots: ReturnType<() => {}>;
|
|
13
|
+
emit: typeof __VLS_emit;
|
|
14
|
+
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
69
15
|
[key: string]: any;
|
|
70
16
|
}> & {
|
|
71
|
-
__ctx?:
|
|
17
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
72
18
|
};
|
|
73
19
|
export default _default;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { XYLabels as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as p, inject as y, computed as d, ref as m, onMounted as F, nextTick as g, onUnmounted as b, watch as c, openBlock as v, createElementBlock as S } from "vue";
|
|
2
|
+
import { XYLabels as a } from "@unovis/ts";
|
|
3
|
+
import { componentAccessorKey as f } from "../../utils/context.js";
|
|
4
|
+
import { useForwardProps as x, arePropsEqual as _ } from "../../utils/props.js";
|
|
5
|
+
const C = { "data-vis-component": "" }, L = a.selectors, N = /* @__PURE__ */ p({
|
|
6
6
|
__name: "index",
|
|
7
7
|
props: {
|
|
8
|
-
color: {},
|
|
9
|
-
y: {},
|
|
10
|
-
xPositioning: {},
|
|
11
|
-
yPositioning: {},
|
|
12
|
-
labelFontSize: {},
|
|
13
|
-
label: {},
|
|
14
|
-
backgroundColor: {},
|
|
15
|
-
cursor: {},
|
|
8
|
+
color: { type: [Function, String, Array, null] },
|
|
9
|
+
y: { type: [Function, Number, null] },
|
|
10
|
+
xPositioning: { type: [Function, String, null] },
|
|
11
|
+
yPositioning: { type: [Function, String, null] },
|
|
12
|
+
labelFontSize: { type: [Function, Number, null] },
|
|
13
|
+
label: { type: [Function, String, null] },
|
|
14
|
+
backgroundColor: { type: [Function, String, Array, null] },
|
|
15
|
+
cursor: { type: [Function, String, null] },
|
|
16
16
|
labelTextBrightnessRatio: {},
|
|
17
17
|
clustering: { type: Boolean },
|
|
18
|
-
clusterLabel: {},
|
|
19
|
-
clusterFontSize: {},
|
|
20
|
-
clusterBackgroundColor: {},
|
|
21
|
-
clusterCursor: {},
|
|
22
|
-
clusterLabelColor: {},
|
|
23
|
-
x: {},
|
|
18
|
+
clusterLabel: { type: [Function, String, null] },
|
|
19
|
+
clusterFontSize: { type: [Function, Number, null] },
|
|
20
|
+
clusterBackgroundColor: { type: [Function, String, Array, null] },
|
|
21
|
+
clusterCursor: { type: [Function, String, null] },
|
|
22
|
+
clusterLabelColor: { type: [Function, String, Array, null] },
|
|
23
|
+
x: { type: [Function, Number, null] },
|
|
24
24
|
id: { type: Function },
|
|
25
|
+
colorKeys: {},
|
|
25
26
|
xScale: { type: [Object, Function] },
|
|
26
27
|
yScale: { type: [Object, Function] },
|
|
27
28
|
excludeFromDomainCalculation: { type: Boolean },
|
|
@@ -30,29 +31,25 @@ const k = { "data-vis-component": "" }, j = u.selectors, w = /* @__PURE__ */ d({
|
|
|
30
31
|
attributes: {},
|
|
31
32
|
data: {}
|
|
32
33
|
},
|
|
33
|
-
setup(i, { expose:
|
|
34
|
-
const
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
o.value = new u(n.value), (e = o.value) == null || e.setData(a.value), t.update(o.value);
|
|
34
|
+
setup(i, { expose: s }) {
|
|
35
|
+
const l = i, e = y(f), n = d(() => e.data.value ?? l.data), o = x(l), t = m();
|
|
36
|
+
return F(() => {
|
|
37
|
+
g(() => {
|
|
38
|
+
t.value = new a(o.value), t.value?.setData(n.value), e.update(t.value);
|
|
39
39
|
});
|
|
40
|
-
}),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}), p({
|
|
50
|
-
component: o
|
|
51
|
-
}), (e, r) => (_(), g("div", k));
|
|
40
|
+
}), b(() => {
|
|
41
|
+
t.value?.destroy(), e.destroy();
|
|
42
|
+
}), c(o, (r, u) => {
|
|
43
|
+
_(r, u) || (t.value?.setConfig(o.value), t.value?.render());
|
|
44
|
+
}), c(n, () => {
|
|
45
|
+
t.value?.setData(n.value);
|
|
46
|
+
}), s({
|
|
47
|
+
component: t
|
|
48
|
+
}), (r, u) => (v(), S("div", C));
|
|
52
49
|
}
|
|
53
50
|
});
|
|
54
51
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
L as VisXYLabelsSelectors,
|
|
53
|
+
N as default
|
|
57
54
|
};
|
|
58
55
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/xy-labels/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum\">\n// !!! This code was automatically generated. You should not change it !!!\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/xy-labels/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum\">\n// !!! This code was automatically generated. You should not change it !!!\nimport type { XYLabelsConfigInterface } from '@unovis/ts'\nimport { XYLabels } from '@unovis/ts'\nimport { computed, inject, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'\nimport { componentAccessorKey } from '../../utils/context'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\n\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst accessor = inject(componentAccessorKey)\n\n// data and required props\ntype Props = XYLabelsConfigInterface<Datum>\nconst data = computed(() => accessor.data.value ?? props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<XYLabels<Datum>>()\n\nonMounted(() => {\n nextTick(() => {\n component.value = new XYLabels<Datum>(config.value)\n component.value?.setData(data.value)\n accessor.update(component.value)\n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n accessor.destroy()\n})\n\nwatch(config, (curr, prev) => {\n if (!arePropsEqual(curr, prev)) {\n component.value?.setConfig(config.value)\n component.value?.render()\n }\n})\n\nwatch(data, () => {\n component.value?.setData(data.value)\n})\n\ndefineExpose({\n component,\n})\n</script>\n\n<script lang=\"ts\">\nexport const VisXYLabelsSelectors = XYLabels.selectors\n</script>\n\n<template>\n <div data-vis-component />\n</template>\n"],"names":["VisXYLabelsSelectors","XYLabels","props","__props","accessor","inject","componentAccessorKey","data","computed","config","useForwardProps","component","ref","onMounted","nextTick","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_openBlock","_createElementBlock","_hoisted_1"],"mappings":";;;;wCAmDaA,IAAuBC,EAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA3C7C,UAAMC,IAAQC,GAERC,IAAWC,EAAOC,CAAoB,GAItCC,IAAOC,EAAS,MAAMJ,EAAS,KAAK,SAASF,EAAM,IAAI,GAEvDO,IAASC,EAAgBR,CAAK,GAG9BS,IAAYC,EAAA;AAElB,WAAAC,EAAU,MAAM;AACd,MAAAC,EAAS,MAAM;AACb,QAAAH,EAAU,QAAQ,IAAIV,EAAgBQ,EAAO,KAAK,GAClDE,EAAU,OAAO,QAAQJ,EAAK,KAAK,GACnCH,EAAS,OAAOO,EAAU,KAAK;AAAA,MACjC,CAAC;AAAA,IACH,CAAC,GAEDI,EAAY,MAAM;AAChB,MAAAJ,EAAU,OAAO,QAAA,GACjBP,EAAS,QAAA;AAAA,IACX,CAAC,GAEDY,EAAMP,GAAQ,CAACQ,GAAMC,MAAS;AAC5B,MAAKC,EAAcF,GAAMC,CAAI,MAC3BP,EAAU,OAAO,UAAUF,EAAO,KAAK,GACvCE,EAAU,OAAO,OAAA;AAAA,IAErB,CAAC,GAEDK,EAAMT,GAAM,MAAM;AAChB,MAAAI,EAAU,OAAO,QAAQJ,EAAK,KAAK;AAAA,IACrC,CAAC,GAEDa,EAAa;AAAA,MACX,WAAAT;AAAA,IAAA,CACD,cAQCU,EAAA,GAAAC,EAA0B,OAA1BC,CAA0B;AAAA;;"}
|
package/components.d.ts
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
export { default as VisArea, VisAreaSelectors } from
|
|
2
|
-
export { default as VisAxis, VisAxisSelectors } from
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as
|
|
10
|
-
export { default as
|
|
11
|
-
export { default as
|
|
12
|
-
export { default as
|
|
13
|
-
export { default as
|
|
14
|
-
export { default as
|
|
15
|
-
export { default as
|
|
16
|
-
export { default as
|
|
17
|
-
export { default as
|
|
18
|
-
export { default as
|
|
19
|
-
export { default as
|
|
20
|
-
export { default as
|
|
21
|
-
export { default as
|
|
22
|
-
export { default as
|
|
23
|
-
export { default as
|
|
24
|
-
export { default as
|
|
25
|
-
export { default as
|
|
26
|
-
export { default as
|
|
27
|
-
export { default as
|
|
1
|
+
export { default as VisArea, VisAreaSelectors } from './components/area/index';
|
|
2
|
+
export { default as VisAxis, VisAxisSelectors } from './components/axis/index';
|
|
3
|
+
export { default as VisBoxplot, VisBoxplotSelectors } from './components/boxplot/index';
|
|
4
|
+
export { default as VisBrush, VisBrushSelectors } from './components/brush/index';
|
|
5
|
+
export { default as VisCrosshair, VisCrosshairSelectors } from './components/crosshair/index';
|
|
6
|
+
export { default as VisFreeBrush, VisFreeBrushSelectors } from './components/free-brush/index';
|
|
7
|
+
export { default as VisGroupedBar, VisGroupedBarSelectors } from './components/grouped-bar/index';
|
|
8
|
+
export { default as VisLine, VisLineSelectors } from './components/line/index';
|
|
9
|
+
export { default as VisScatter, VisScatterSelectors } from './components/scatter/index';
|
|
10
|
+
export { default as VisStackedBar, VisStackedBarSelectors } from './components/stacked-bar/index';
|
|
11
|
+
export { default as VisTimeline, VisTimelineSelectors } from './components/timeline/index';
|
|
12
|
+
export { default as VisXYLabels, VisXYLabelsSelectors } from './components/xy-labels/index';
|
|
13
|
+
export { default as VisPlotband, VisPlotbandSelectors } from './components/plotband/index';
|
|
14
|
+
export { default as VisPlotline, VisPlotlineSelectors } from './components/plotline/index';
|
|
15
|
+
export { default as VisChordDiagram, VisChordDiagramSelectors } from './components/chord-diagram/index';
|
|
16
|
+
export { default as VisDonut, VisDonutSelectors } from './components/donut/index';
|
|
17
|
+
export { default as VisGraph, VisGraphSelectors } from './components/graph/index';
|
|
18
|
+
export { default as VisHeatmap, VisHeatmapSelectors } from './components/heatmap/index';
|
|
19
|
+
export { default as VisNestedDonut, VisNestedDonutSelectors } from './components/nested-donut/index';
|
|
20
|
+
export { default as VisRadialBar, VisRadialBarSelectors } from './components/radial-bar/index';
|
|
21
|
+
export { default as VisSankey, VisSankeySelectors } from './components/sankey/index';
|
|
22
|
+
export { default as VisTopoJSONMap, VisTopoJSONMapSelectors } from './components/topojson-map/index';
|
|
23
|
+
export { default as VisTreemap, VisTreemapSelectors } from './components/treemap/index';
|
|
24
|
+
export { default as VisTooltip, VisTooltipSelectors } from './components/tooltip/index';
|
|
25
|
+
export { default as VisAnnotations, VisAnnotationsSelectors } from './components/annotations/index';
|
|
26
|
+
export { default as VisLeafletMap, VisLeafletMapSelectors } from './html-components/leaflet-map/index';
|
|
27
|
+
export { default as VisLeafletFlowMap, VisLeafletFlowMapSelectors } from './html-components/leaflet-flow-map/index';
|
|
28
|
+
export { default as VisBulletLegend, VisBulletLegendSelectors } from './html-components/bullet-legend/index';
|
|
29
|
+
export { default as VisFlowLegend, VisFlowLegendSelectors } from './html-components/flow-legend/index';
|
|
30
|
+
export { default as VisRollingPinLegend, VisRollingPinLegendSelectors } from './html-components/rolling-pin-legend/index';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("@unovis/ts"),r=require("../../utils/context.cjs"),v=require("../../utils/props.cjs"),f=e.defineComponent({__name:"index",props:{component:{},tooltip:{},annotations:{},onRenderComplete:{type:Function},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},colorFunction:{type:Function},data:{}},setup(p,{expose:d}){const s=p,{data:i}=e.toRefs(s),u=v.useForwardProps(s);let t;const o=e.reactive({component:void 0,tooltip:void 0,annotations:void 0}),a=e.ref(),c=()=>{t||a.value&&o.component&&(t=new l.SingleContainer(a.value,{...e.toRaw(o)},i.value))};return e.watchEffect(()=>{c(),o.component?.config,t?.updateContainer({...e.toRaw(u.value),...e.toRaw(o)})}),e.watch(i,()=>{t?t.setData(i.value,!0):c()}),e.onUnmounted(()=>t?.destroy()),e.provide(r.componentAccessorKey,{data:i,update:n=>o.component=n,destroy:()=>o.component=void 0}),e.provide(r.tooltipAccessorKey,{data:i,update:n=>o.tooltip=n,destroy:()=>{o.tooltip=void 0}}),e.provide(r.annotationsAccessorKey,{data:i,update:n=>o.annotations=n,destroy:()=>{o.annotations=void 0}}),d({component:t}),(n,m)=>(e.openBlock(),e.createElementBlock("div",{"data-vis-single-container":"",ref_key:"elRef",ref:a,class:"unovis-single-container"},[e.renderSlot(n.$slots,"default")],512))}});exports.default=f;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/containers/single-container/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { SingleContainer, ComponentCore, SingleContainerConfigInterface, Tooltip, Annotations } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, watchEffect, reactive, toRaw } from 'vue'\nimport { annotationsAccessorKey, componentAccessorKey, tooltipAccessorKey, } from \"../../utils/context\"\nimport { useForwardProps } from \"../../utils/props\"\n\nconst props = defineProps<SingleContainerConfigInterface<T> & { data?: T }>()\nconst { data } = toRefs(props)\nconst parsedProps = useForwardProps(props)\n\nlet chart: SingleContainer<T>\nconst config = reactive({\n component: undefined,\n tooltip: undefined,\n annotations: undefined,\n}) as SingleContainerConfigInterface<T>\nconst elRef = ref<HTMLDivElement>()\n\nconst initChart = () => {\n if (chart) return\n if (elRef.value && config.component)\n chart = new SingleContainer(elRef.value, { ...toRaw(config) }, data.value)\n}\n\nwatchEffect(() => {\n initChart()\n // watch deep changes in components config\n const t = config.component?.config\n chart?.updateContainer({ ...toRaw(parsedProps.value), ...toRaw(config) })\n})\n\nwatch(data, () => {\n if (chart) {\n chart.setData(data.value, true)\n } else {\n initChart()\n }\n})\n\nonUnmounted(() => chart?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: ComponentCore<T>) => config.component = c,\n destroy: () => config.component = undefined,\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => config.tooltip = t,\n destroy: () => { config.tooltip = undefined },\n})\n\nprovide(annotationsAccessorKey, {\n data,\n update: (a: Annotations) => config.annotations = a,\n destroy: () => { config.annotations = undefined },\n})\n\n\ndefineExpose({\n component: chart\n})\n</script>\n\n<template>\n <div data-vis-single-container ref=\"elRef\" class='unovis-single-container'>\n <slot />\n </div>\n</template>\n\n\n\n<style>\n.unovis-single-container {\n display: block;\n position: relative;\n width: 100%;\n}\n</style>\n"],"names":["props","__props","data","toRefs","parsedProps","useForwardProps","chart","config","reactive","elRef","ref","initChart","SingleContainer","toRaw","watchEffect","
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/containers/single-container/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { SingleContainer, ComponentCore, SingleContainerConfigInterface, Tooltip, Annotations } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, watchEffect, reactive, toRaw } from 'vue'\nimport { annotationsAccessorKey, componentAccessorKey, tooltipAccessorKey, } from \"../../utils/context\"\nimport { useForwardProps } from \"../../utils/props\"\n\nconst props = defineProps<SingleContainerConfigInterface<T> & { data?: T }>()\nconst { data } = toRefs(props)\nconst parsedProps = useForwardProps(props)\n\nlet chart: SingleContainer<T>\nconst config = reactive({\n component: undefined,\n tooltip: undefined,\n annotations: undefined,\n}) as SingleContainerConfigInterface<T>\nconst elRef = ref<HTMLDivElement>()\n\nconst initChart = () => {\n if (chart) return\n if (elRef.value && config.component)\n chart = new SingleContainer(elRef.value, { ...toRaw(config) }, data.value)\n}\n\nwatchEffect(() => {\n initChart()\n // watch deep changes in components config\n const t = config.component?.config\n chart?.updateContainer({ ...toRaw(parsedProps.value), ...toRaw(config) })\n})\n\nwatch(data, () => {\n if (chart) {\n chart.setData(data.value, true)\n } else {\n initChart()\n }\n})\n\nonUnmounted(() => chart?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: ComponentCore<T>) => config.component = c,\n destroy: () => config.component = undefined,\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => config.tooltip = t,\n destroy: () => { config.tooltip = undefined },\n})\n\nprovide(annotationsAccessorKey, {\n data,\n update: (a: Annotations) => config.annotations = a,\n destroy: () => { config.annotations = undefined },\n})\n\n\ndefineExpose({\n component: chart\n})\n</script>\n\n<template>\n <div data-vis-single-container ref=\"elRef\" class='unovis-single-container'>\n <slot />\n </div>\n</template>\n\n\n\n<style>\n.unovis-single-container {\n display: block;\n position: relative;\n width: 100%;\n}\n</style>\n"],"names":["props","__props","data","toRefs","parsedProps","useForwardProps","chart","config","reactive","elRef","ref","initChart","SingleContainer","toRaw","watchEffect","watch","onUnmounted","provide","componentAccessorKey","c","tooltipAccessorKey","t","annotationsAccessorKey","a","__expose","_createElementBlock","_renderSlot","_ctx"],"mappings":"ueAMA,MAAMA,EAAQC,EACR,CAAE,KAAAC,CAAA,EAASC,EAAAA,OAAOH,CAAK,EACvBI,EAAcC,EAAAA,gBAAgBL,CAAK,EAEzC,IAAIM,EACJ,MAAMC,EAASC,EAAAA,SAAS,CACtB,UAAW,OACX,QAAS,OACT,YAAa,MAAA,CACd,EACKC,EAAQC,EAAAA,IAAA,EAERC,EAAY,IAAM,CAClBL,GACAG,EAAM,OAASF,EAAO,YACxBD,EAAQ,IAAIM,EAAAA,gBAAgBH,EAAM,MAAO,CAAE,GAAGI,EAAAA,MAAMN,CAAM,CAAA,EAAKL,EAAK,KAAK,EAC7E,EAEAY,OAAAA,EAAAA,YAAY,IAAM,CAChBH,EAAA,EAEUJ,EAAO,WAAW,OAC5BD,GAAO,gBAAgB,CAAE,GAAGO,QAAMT,EAAY,KAAK,EAAG,GAAGS,EAAAA,MAAMN,CAAM,EAAG,CAC1E,CAAC,EAEDQ,EAAAA,MAAMb,EAAM,IAAM,CACZI,EACFA,EAAM,QAAQJ,EAAK,MAAO,EAAI,EAE9BS,EAAA,CAEJ,CAAC,EAEDK,cAAY,IAAMV,GAAO,SAAS,EAElCW,EAAAA,QAAQC,EAAAA,qBAAsB,CAC5B,KAAAhB,EACA,OAASiB,GAAwBZ,EAAO,UAAYY,EACpD,QAAS,IAAMZ,EAAO,UAAY,MAAA,CACnC,EAEDU,EAAAA,QAAQG,EAAAA,mBAAoB,CAC1B,KAAAlB,EACA,OAASmB,GAAed,EAAO,QAAUc,EACzC,QAAS,IAAM,CAAEd,EAAO,QAAU,MAAU,CAAA,CAC7C,EAEDU,EAAAA,QAAQK,EAAAA,uBAAwB,CAC9B,KAAApB,EACA,OAASqB,GAAmBhB,EAAO,YAAcgB,EACjD,QAAS,IAAM,CAAEhB,EAAO,YAAc,MAAU,CAAA,CACjD,EAGDiB,EAAa,CACX,UAAWlB,CAAA,CACZ,wBAICmB,EAAAA,mBAEM,MAAA,CAFD,4BAAA,WAA8B,QAAJ,IAAIhB,EAAQ,MAAM,yBAAA,GAC/CiB,aAAQC,EAAA,OAAA,SAAA,CAAA"}
|
|
@@ -1,35 +1,20 @@
|
|
|
1
|
-
import { SingleContainer,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
slots: any;
|
|
6
|
-
}, __VLS_expose?: any, __VLS_setup?: Promise<{
|
|
7
|
-
props: {
|
|
8
|
-
duration?: number;
|
|
1
|
+
import { SingleContainer, SingleContainerConfigInterface } from '@unovis/ts';
|
|
2
|
+
|
|
3
|
+
declare const _default: <T>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & (SingleContainerConfigInterface<T> & {
|
|
9
5
|
data?: T;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
tooltip?: Tooltip;
|
|
13
|
-
onRenderComplete?: (svgNode: SVGSVGElement, margin: import("@unovis/ts").Spacing, containerWidth: number, containerHeight: number, componentWidth: number, componentHeight: number) => void;
|
|
14
|
-
annotations?: Annotations;
|
|
15
|
-
margin?: import("@unovis/ts").Spacing;
|
|
16
|
-
padding?: import("@unovis/ts").Spacing;
|
|
17
|
-
sizing?: string;
|
|
18
|
-
height?: string | number;
|
|
19
|
-
svgDefs?: string;
|
|
20
|
-
ariaLabel?: string;
|
|
21
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
22
|
-
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
6
|
+
}), keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
7
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
23
8
|
component: SingleContainer<T>;
|
|
24
9
|
}>): void;
|
|
25
10
|
attrs: any;
|
|
26
|
-
slots: {
|
|
11
|
+
slots: ReturnType<() => {
|
|
27
12
|
default?(_: {}): any;
|
|
28
|
-
}
|
|
29
|
-
emit:
|
|
30
|
-
}>) => import(
|
|
13
|
+
}>;
|
|
14
|
+
emit: typeof __VLS_emit;
|
|
15
|
+
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
31
16
|
[key: string]: any;
|
|
32
17
|
}> & {
|
|
33
|
-
__ctx?:
|
|
18
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
34
19
|
};
|
|
35
20
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as m, toRefs as
|
|
2
|
-
import { SingleContainer as
|
|
3
|
-
import { componentAccessorKey as
|
|
4
|
-
import { useForwardProps as
|
|
1
|
+
import { defineComponent as m, toRefs as u, reactive as f, ref as v, watchEffect as g, watch as y, onUnmounted as h, provide as i, openBlock as w, createElementBlock as _, renderSlot as C, toRaw as r } from "vue";
|
|
2
|
+
import { SingleContainer as R } from "@unovis/ts";
|
|
3
|
+
import { componentAccessorKey as F, tooltipAccessorKey as k, annotationsAccessorKey as x } from "../../utils/context.js";
|
|
4
|
+
import { useForwardProps as A } from "../../utils/props.js";
|
|
5
5
|
const S = /* @__PURE__ */ m({
|
|
6
6
|
__name: "index",
|
|
7
7
|
props: {
|
|
@@ -17,48 +17,48 @@ const S = /* @__PURE__ */ m({
|
|
|
17
17
|
height: {},
|
|
18
18
|
svgDefs: {},
|
|
19
19
|
ariaLabel: {},
|
|
20
|
+
colorFunction: { type: Function },
|
|
20
21
|
data: {}
|
|
21
22
|
},
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
let
|
|
25
|
-
const
|
|
23
|
+
setup(p, { expose: d }) {
|
|
24
|
+
const s = p, { data: n } = u(s), l = A(s);
|
|
25
|
+
let t;
|
|
26
|
+
const o = f({
|
|
26
27
|
component: void 0,
|
|
27
28
|
tooltip: void 0,
|
|
28
29
|
annotations: void 0
|
|
29
|
-
}),
|
|
30
|
-
|
|
30
|
+
}), a = v(), c = () => {
|
|
31
|
+
t || a.value && o.component && (t = new R(a.value, { ...r(o) }, n.value));
|
|
31
32
|
};
|
|
32
33
|
return g(() => {
|
|
33
|
-
|
|
34
|
-
p(), (t = e.component) == null || t.config, o == null || o.updateContainer({ ...s(l.value), ...s(e) });
|
|
34
|
+
c(), o.component?.config, t?.updateContainer({ ...r(l.value), ...r(o) });
|
|
35
35
|
}), y(n, () => {
|
|
36
|
-
|
|
37
|
-
}),
|
|
36
|
+
t ? t.setData(n.value, !0) : c();
|
|
37
|
+
}), h(() => t?.destroy()), i(F, {
|
|
38
38
|
data: n,
|
|
39
|
-
update: (
|
|
40
|
-
destroy: () =>
|
|
41
|
-
}),
|
|
39
|
+
update: (e) => o.component = e,
|
|
40
|
+
destroy: () => o.component = void 0
|
|
41
|
+
}), i(k, {
|
|
42
42
|
data: n,
|
|
43
|
-
update: (
|
|
43
|
+
update: (e) => o.tooltip = e,
|
|
44
44
|
destroy: () => {
|
|
45
|
-
|
|
45
|
+
o.tooltip = void 0;
|
|
46
46
|
}
|
|
47
|
-
}),
|
|
47
|
+
}), i(x, {
|
|
48
48
|
data: n,
|
|
49
|
-
update: (
|
|
49
|
+
update: (e) => o.annotations = e,
|
|
50
50
|
destroy: () => {
|
|
51
|
-
|
|
51
|
+
o.annotations = void 0;
|
|
52
52
|
}
|
|
53
53
|
}), d({
|
|
54
|
-
component:
|
|
55
|
-
}), (
|
|
54
|
+
component: t
|
|
55
|
+
}), (e, K) => (w(), _("div", {
|
|
56
56
|
"data-vis-single-container": "",
|
|
57
57
|
ref_key: "elRef",
|
|
58
|
-
ref:
|
|
58
|
+
ref: a,
|
|
59
59
|
class: "unovis-single-container"
|
|
60
60
|
}, [
|
|
61
|
-
|
|
61
|
+
C(e.$slots, "default")
|
|
62
62
|
], 512));
|
|
63
63
|
}
|
|
64
64
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/containers/single-container/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { SingleContainer, ComponentCore, SingleContainerConfigInterface, Tooltip, Annotations } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, watchEffect, reactive, toRaw } from 'vue'\nimport { annotationsAccessorKey, componentAccessorKey, tooltipAccessorKey, } from \"../../utils/context\"\nimport { useForwardProps } from \"../../utils/props\"\n\nconst props = defineProps<SingleContainerConfigInterface<T> & { data?: T }>()\nconst { data } = toRefs(props)\nconst parsedProps = useForwardProps(props)\n\nlet chart: SingleContainer<T>\nconst config = reactive({\n component: undefined,\n tooltip: undefined,\n annotations: undefined,\n}) as SingleContainerConfigInterface<T>\nconst elRef = ref<HTMLDivElement>()\n\nconst initChart = () => {\n if (chart) return\n if (elRef.value && config.component)\n chart = new SingleContainer(elRef.value, { ...toRaw(config) }, data.value)\n}\n\nwatchEffect(() => {\n initChart()\n // watch deep changes in components config\n const t = config.component?.config\n chart?.updateContainer({ ...toRaw(parsedProps.value), ...toRaw(config) })\n})\n\nwatch(data, () => {\n if (chart) {\n chart.setData(data.value, true)\n } else {\n initChart()\n }\n})\n\nonUnmounted(() => chart?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: ComponentCore<T>) => config.component = c,\n destroy: () => config.component = undefined,\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => config.tooltip = t,\n destroy: () => { config.tooltip = undefined },\n})\n\nprovide(annotationsAccessorKey, {\n data,\n update: (a: Annotations) => config.annotations = a,\n destroy: () => { config.annotations = undefined },\n})\n\n\ndefineExpose({\n component: chart\n})\n</script>\n\n<template>\n <div data-vis-single-container ref=\"elRef\" class='unovis-single-container'>\n <slot />\n </div>\n</template>\n\n\n\n<style>\n.unovis-single-container {\n display: block;\n position: relative;\n width: 100%;\n}\n</style>\n"],"names":["props","__props","data","toRefs","parsedProps","useForwardProps","chart","config","reactive","elRef","ref","initChart","SingleContainer","toRaw","watchEffect","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/containers/single-container/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { SingleContainer, ComponentCore, SingleContainerConfigInterface, Tooltip, Annotations } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, watchEffect, reactive, toRaw } from 'vue'\nimport { annotationsAccessorKey, componentAccessorKey, tooltipAccessorKey, } from \"../../utils/context\"\nimport { useForwardProps } from \"../../utils/props\"\n\nconst props = defineProps<SingleContainerConfigInterface<T> & { data?: T }>()\nconst { data } = toRefs(props)\nconst parsedProps = useForwardProps(props)\n\nlet chart: SingleContainer<T>\nconst config = reactive({\n component: undefined,\n tooltip: undefined,\n annotations: undefined,\n}) as SingleContainerConfigInterface<T>\nconst elRef = ref<HTMLDivElement>()\n\nconst initChart = () => {\n if (chart) return\n if (elRef.value && config.component)\n chart = new SingleContainer(elRef.value, { ...toRaw(config) }, data.value)\n}\n\nwatchEffect(() => {\n initChart()\n // watch deep changes in components config\n const t = config.component?.config\n chart?.updateContainer({ ...toRaw(parsedProps.value), ...toRaw(config) })\n})\n\nwatch(data, () => {\n if (chart) {\n chart.setData(data.value, true)\n } else {\n initChart()\n }\n})\n\nonUnmounted(() => chart?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: ComponentCore<T>) => config.component = c,\n destroy: () => config.component = undefined,\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => config.tooltip = t,\n destroy: () => { config.tooltip = undefined },\n})\n\nprovide(annotationsAccessorKey, {\n data,\n update: (a: Annotations) => config.annotations = a,\n destroy: () => { config.annotations = undefined },\n})\n\n\ndefineExpose({\n component: chart\n})\n</script>\n\n<template>\n <div data-vis-single-container ref=\"elRef\" class='unovis-single-container'>\n <slot />\n </div>\n</template>\n\n\n\n<style>\n.unovis-single-container {\n display: block;\n position: relative;\n width: 100%;\n}\n</style>\n"],"names":["props","__props","data","toRefs","parsedProps","useForwardProps","chart","config","reactive","elRef","ref","initChart","SingleContainer","toRaw","watchEffect","watch","onUnmounted","provide","componentAccessorKey","c","tooltipAccessorKey","t","annotationsAccessorKey","a","__expose","_createElementBlock","_renderSlot","_ctx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAMA,UAAMA,IAAQC,GACR,EAAE,MAAAC,EAAA,IAASC,EAAOH,CAAK,GACvBI,IAAcC,EAAgBL,CAAK;AAEzC,QAAIM;AACJ,UAAMC,IAASC,EAAS;AAAA,MACtB,WAAW;AAAA,MACX,SAAS;AAAA,MACT,aAAa;AAAA,IAAA,CACd,GACKC,IAAQC,EAAA,GAERC,IAAY,MAAM;AACtB,MAAIL,KACAG,EAAM,SAASF,EAAO,cACxBD,IAAQ,IAAIM,EAAgBH,EAAM,OAAO,EAAE,GAAGI,EAAMN,CAAM,EAAA,GAAKL,EAAK,KAAK;AAAA,IAC7E;AAEA,WAAAY,EAAY,MAAM;AAChB,MAAAH,EAAA,GAEUJ,EAAO,WAAW,QAC5BD,GAAO,gBAAgB,EAAE,GAAGO,EAAMT,EAAY,KAAK,GAAG,GAAGS,EAAMN,CAAM,GAAG;AAAA,IAC1E,CAAC,GAEDQ,EAAMb,GAAM,MAAM;AAChB,MAAII,IACFA,EAAM,QAAQJ,EAAK,OAAO,EAAI,IAE9BS,EAAA;AAAA,IAEJ,CAAC,GAEDK,EAAY,MAAMV,GAAO,SAAS,GAElCW,EAAQC,GAAsB;AAAA,MAC5B,MAAAhB;AAAA,MACA,QAAQ,CAACiB,MAAwBZ,EAAO,YAAYY;AAAA,MACpD,SAAS,MAAMZ,EAAO,YAAY;AAAA,IAAA,CACnC,GAEDU,EAAQG,GAAoB;AAAA,MAC1B,MAAAlB;AAAA,MACA,QAAQ,CAACmB,MAAed,EAAO,UAAUc;AAAA,MACzC,SAAS,MAAM;AAAE,QAAAd,EAAO,UAAU;AAAA,MAAU;AAAA,IAAA,CAC7C,GAEDU,EAAQK,GAAwB;AAAA,MAC9B,MAAApB;AAAA,MACA,QAAQ,CAACqB,MAAmBhB,EAAO,cAAcgB;AAAA,MACjD,SAAS,MAAM;AAAE,QAAAhB,EAAO,cAAc;AAAA,MAAU;AAAA,IAAA,CACjD,GAGDiB,EAAa;AAAA,MACX,WAAWlB;AAAA,IAAA,CACZ,mBAICmB,EAEM,OAAA;AAAA,MAFD,6BAAA;AAAA,eAA8B;AAAA,MAAJ,KAAIhB;AAAA,MAAQ,OAAM;AAAA,IAAA;MAC/CiB,EAAQC,EAAA,QAAA,SAAA;AAAA,IAAA;;;"}
|