@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.
Files changed (188) hide show
  1. package/README.md +4 -0
  2. package/components/annotations/index.cjs +1 -1
  3. package/components/annotations/index.cjs.map +1 -1
  4. package/components/annotations/index.d.ts +18 -100
  5. package/components/annotations/index.js +18 -20
  6. package/components/annotations/index.js.map +1 -1
  7. package/components/area/index.cjs +1 -1
  8. package/components/area/index.cjs.map +1 -1
  9. package/components/area/index.d.ts +12 -64
  10. package/components/area/index.js +31 -32
  11. package/components/area/index.js.map +1 -1
  12. package/components/axis/index.cjs +1 -1
  13. package/components/axis/index.cjs.map +1 -1
  14. package/components/axis/index.d.ts +12 -82
  15. package/components/axis/index.js +29 -28
  16. package/components/axis/index.js.map +1 -1
  17. package/components/boxplot/index.cjs +2 -0
  18. package/components/boxplot/index.cjs.map +1 -0
  19. package/components/boxplot/index.d.ts +19 -0
  20. package/components/boxplot/index.js +31 -0
  21. package/components/boxplot/index.js.map +1 -0
  22. package/components/boxplot/index2.cjs +2 -0
  23. package/components/boxplot/index2.cjs.map +1 -0
  24. package/components/boxplot/index2.js +7 -0
  25. package/components/boxplot/index2.js.map +1 -0
  26. package/components/brush/index.cjs +1 -1
  27. package/components/brush/index.cjs.map +1 -1
  28. package/components/brush/index.d.ts +12 -62
  29. package/components/brush/index.js +26 -28
  30. package/components/brush/index.js.map +1 -1
  31. package/components/chord-diagram/index.cjs +1 -1
  32. package/components/chord-diagram/index.cjs.map +1 -1
  33. package/components/chord-diagram/index.d.ts +12 -60
  34. package/components/chord-diagram/index.js +30 -32
  35. package/components/chord-diagram/index.js.map +1 -1
  36. package/components/crosshair/index.cjs +1 -1
  37. package/components/crosshair/index.cjs.map +1 -1
  38. package/components/crosshair/index.d.ts +12 -66
  39. package/components/crosshair/index.js +20 -24
  40. package/components/crosshair/index.js.map +1 -1
  41. package/components/donut/index.cjs +1 -1
  42. package/components/donut/index.cjs.map +1 -1
  43. package/components/donut/index.d.ts +12 -64
  44. package/components/donut/index.js +24 -26
  45. package/components/donut/index.js.map +1 -1
  46. package/components/free-brush/index.cjs +1 -1
  47. package/components/free-brush/index.cjs.map +1 -1
  48. package/components/free-brush/index.d.ts +12 -62
  49. package/components/free-brush/index.js +25 -28
  50. package/components/free-brush/index.js.map +1 -1
  51. package/components/graph/index.cjs +1 -1
  52. package/components/graph/index.cjs.map +1 -1
  53. package/components/graph/index.d.ts +11 -135
  54. package/components/graph/index.js +70 -66
  55. package/components/graph/index.js.map +1 -1
  56. package/components/grouped-bar/index.cjs +1 -1
  57. package/components/grouped-bar/index.cjs.map +1 -1
  58. package/components/grouped-bar/index.d.ts +12 -62
  59. package/components/grouped-bar/index.js +27 -28
  60. package/components/grouped-bar/index.js.map +1 -1
  61. package/components/heatmap/index.cjs +2 -0
  62. package/components/heatmap/index.cjs.map +1 -0
  63. package/components/heatmap/index.d.ts +19 -0
  64. package/components/heatmap/index.js +49 -0
  65. package/components/heatmap/index.js.map +1 -0
  66. package/components/heatmap/index2.cjs +2 -0
  67. package/components/heatmap/index2.cjs.map +1 -0
  68. package/components/heatmap/index2.js +7 -0
  69. package/components/heatmap/index2.js.map +1 -0
  70. package/components/line/index.cjs +1 -1
  71. package/components/line/index.cjs.map +1 -1
  72. package/components/line/index.d.ts +12 -60
  73. package/components/line/index.js +28 -30
  74. package/components/line/index.js.map +1 -1
  75. package/components/nested-donut/index.cjs +1 -1
  76. package/components/nested-donut/index.cjs.map +1 -1
  77. package/components/nested-donut/index.d.ts +12 -65
  78. package/components/nested-donut/index.js +26 -29
  79. package/components/nested-donut/index.js.map +1 -1
  80. package/components/plotband/index.cjs +1 -1
  81. package/components/plotband/index.cjs.map +1 -1
  82. package/components/plotband/index.d.ts +12 -63
  83. package/components/plotband/index.js +17 -18
  84. package/components/plotband/index.js.map +1 -1
  85. package/components/plotline/index.cjs +1 -1
  86. package/components/plotline/index.cjs.map +1 -1
  87. package/components/plotline/index.d.ts +12 -64
  88. package/components/plotline/index.js +18 -19
  89. package/components/plotline/index.js.map +1 -1
  90. package/components/radial-bar/index.cjs +2 -0
  91. package/components/radial-bar/index.cjs.map +1 -0
  92. package/components/radial-bar/index.d.ts +19 -0
  93. package/components/radial-bar/index.js +54 -0
  94. package/components/radial-bar/index.js.map +1 -0
  95. package/components/radial-bar/index2.cjs +2 -0
  96. package/components/radial-bar/index2.cjs.map +1 -0
  97. package/components/radial-bar/index2.js +7 -0
  98. package/components/radial-bar/index2.js.map +1 -0
  99. package/components/sankey/index.cjs +1 -1
  100. package/components/sankey/index.cjs.map +1 -1
  101. package/components/sankey/index.d.ts +12 -106
  102. package/components/sankey/index.js +42 -41
  103. package/components/sankey/index.js.map +1 -1
  104. package/components/scatter/index.cjs +1 -1
  105. package/components/scatter/index.cjs.map +1 -1
  106. package/components/scatter/index.d.ts +12 -65
  107. package/components/scatter/index.js +33 -35
  108. package/components/scatter/index.js.map +1 -1
  109. package/components/stacked-bar/index.cjs +1 -1
  110. package/components/stacked-bar/index.cjs.map +1 -1
  111. package/components/stacked-bar/index.d.ts +12 -62
  112. package/components/stacked-bar/index.js +29 -29
  113. package/components/stacked-bar/index.js.map +1 -1
  114. package/components/timeline/index.cjs +1 -1
  115. package/components/timeline/index.cjs.map +1 -1
  116. package/components/timeline/index.d.ts +12 -88
  117. package/components/timeline/index.js +20 -24
  118. package/components/timeline/index.js.map +1 -1
  119. package/components/tooltip/index.cjs +1 -1
  120. package/components/tooltip/index.cjs.map +1 -1
  121. package/components/tooltip/index.d.ts +19 -99
  122. package/components/tooltip/index.js +15 -17
  123. package/components/tooltip/index.js.map +1 -1
  124. package/components/topojson-map/index.cjs +1 -1
  125. package/components/topojson-map/index.cjs.map +1 -1
  126. package/components/topojson-map/index.d.ts +12 -78
  127. package/components/topojson-map/index.js +66 -39
  128. package/components/topojson-map/index.js.map +1 -1
  129. package/components/treemap/index.cjs +1 -1
  130. package/components/treemap/index.cjs.map +1 -1
  131. package/components/treemap/index.d.ts +12 -69
  132. package/components/treemap/index.js +25 -26
  133. package/components/treemap/index.js.map +1 -1
  134. package/components/xy-labels/index.cjs +1 -1
  135. package/components/xy-labels/index.cjs.map +1 -1
  136. package/components/xy-labels/index.d.ts +12 -66
  137. package/components/xy-labels/index.js +36 -39
  138. package/components/xy-labels/index.js.map +1 -1
  139. package/components.d.ts +30 -27
  140. package/containers/single-container/index.cjs +1 -1
  141. package/containers/single-container/index.cjs.map +1 -1
  142. package/containers/single-container/index.d.ts +11 -26
  143. package/containers/single-container/index.js +26 -26
  144. package/containers/single-container/index.js.map +1 -1
  145. package/containers/xy-container/index.cjs +1 -1
  146. package/containers/xy-container/index.cjs.map +1 -1
  147. package/containers/xy-container/index.d.ts +12 -45
  148. package/containers/xy-container/index.js +25 -30
  149. package/containers/xy-container/index.js.map +1 -1
  150. package/containers.d.ts +2 -2
  151. package/html-components/bullet-legend/index.cjs +1 -1
  152. package/html-components/bullet-legend/index.cjs.map +1 -1
  153. package/html-components/bullet-legend/index.d.ts +18 -74
  154. package/html-components/bullet-legend/index.js +24 -25
  155. package/html-components/bullet-legend/index.js.map +1 -1
  156. package/html-components/flow-legend/index.cjs +1 -1
  157. package/html-components/flow-legend/index.cjs.map +1 -1
  158. package/html-components/flow-legend/index.d.ts +19 -85
  159. package/html-components/flow-legend/index.js +21 -23
  160. package/html-components/flow-legend/index.js.map +1 -1
  161. package/html-components/leaflet-flow-map/index.cjs +1 -1
  162. package/html-components/leaflet-flow-map/index.cjs.map +1 -1
  163. package/html-components/leaflet-flow-map/index.d.ts +12 -112
  164. package/html-components/leaflet-flow-map/index.js +46 -48
  165. package/html-components/leaflet-flow-map/index.js.map +1 -1
  166. package/html-components/leaflet-map/index.cjs +1 -1
  167. package/html-components/leaflet-map/index.cjs.map +1 -1
  168. package/html-components/leaflet-map/index.d.ts +12 -99
  169. package/html-components/leaflet-map/index.js +37 -39
  170. package/html-components/leaflet-map/index.js.map +1 -1
  171. package/html-components/rolling-pin-legend/index.cjs +1 -1
  172. package/html-components/rolling-pin-legend/index.cjs.map +1 -1
  173. package/html-components/rolling-pin-legend/index.d.ts +18 -50
  174. package/html-components/rolling-pin-legend/index.js +22 -24
  175. package/html-components/rolling-pin-legend/index.js.map +1 -1
  176. package/index.cjs +2 -2
  177. package/index.js +101 -92
  178. package/index.js.map +1 -1
  179. package/package.json +14 -13
  180. package/utils/context.cjs.map +1 -1
  181. package/utils/context.d.ts +1 -0
  182. package/utils/context.js +1 -1
  183. package/utils/context.js.map +1 -1
  184. package/utils/props.cjs +1 -1
  185. package/utils/props.cjs.map +1 -1
  186. package/utils/props.d.ts +2 -4
  187. package/utils/props.js +9 -9
  188. package/utils/props.js.map +1 -1
@@ -1,18 +1,21 @@
1
- import { defineComponent as p, inject as m, computed as f, ref as b, onMounted as v, nextTick as F, onUnmounted as y, watch as s, createElementBlock as B, openBlock as L } from "vue";
2
- import { Treemap as c } from "@unovis/ts";
3
- import { useForwardProps as T, arePropsEqual as _ } from "../../utils/props.js";
4
- import { componentAccessorKey as g } from "../../utils/context.js";
5
- const S = { "data-vis-component": "" }, w = c.selectors, C = /* @__PURE__ */ p({
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: d }) {
37
- const o = m(g), l = u, a = f(() => o.data.value ?? l.data), n = T(l), t = b();
38
- return v(() => {
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
- var e;
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
- }), y(() => {
44
- var e;
45
- (e = t.value) == null || e.destroy(), o.destroy();
46
- }), s(n, (e, i) => {
47
- var r;
48
- _(e, i) || (r = t.value) == null || r.setConfig(n.value);
49
- }), s(a, () => {
50
- var e;
51
- (e = t.value) == null || e.setData(a.value);
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
- w as VisTreemapSelectors,
59
- C as default
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 { Treemap, TreemapConfigInterface, StringAccessor } from '@unovis/ts'\nimport { onMounted, onUnmounted, computed, ref, watch, nextTick, inject } from 'vue'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\nimport { componentAccessorKey } from '../../utils/context'\n\nconst accessor = inject(componentAccessorKey)\n\n// data and required props \ntype Props = TreemapConfigInterface<Datum>\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst data = computed(() => accessor.data.value ?? props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<Treemap<Datum>>()\n\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 }\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\n\n"],"names":["VisTreemapSelectors","Treemap","accessor","inject","componentAccessorKey","props","__props","data","computed","config","useForwardProps","component","ref","onMounted","nextTick","_a","onUnmounted","watch","curr","prev","arePropsEqual","__expose"],"mappings":";;;;wCAkDaA,IAAsBC,EAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA3CrC,UAAAC,IAAWC,EAAOC,CAAoB,GAItCC,IAAQC,GAERC,IAAOC,EAAS,MAAMN,EAAS,KAAK,SAASG,EAAM,IAAI,GAEvDI,IAASC,EAAgBL,CAAK,GAG9BM,IAAYC,EAAoB;AAGtC,WAAAC,EAAU,MAAM;AACd,MAAAC,EAAS,MAAM;;AACb,QAAAH,EAAU,QAAQ,IAAIV,EAAeQ,EAAO,KAAK,IACvCM,IAAAJ,EAAA,UAAA,QAAAI,EAAO,QAAQR,EAAK,QACrBL,EAAA,OAAOS,EAAU,KAAK;AAAA,MAAA,CAChC;AAAA,IAAA,CACF,GAEDK,EAAY,MAAM;;AAChB,OAAAD,IAAAJ,EAAU,UAAV,QAAAI,EAAiB,WACjBb,EAAS,QAAQ;AAAA,IAAA,CAClB,GAEKe,EAAAR,GAAQ,CAACS,GAAMC,MAAS;;AAC5B,MAAKC,EAAcF,GAAMC,CAAI,MACjBJ,IAAAJ,EAAA,UAAA,QAAAI,EAAO,UAAUN,EAAO;AAAA,IACpC,CACD,GAEDQ,EAAMV,GAAM,MAAM;;AACN,OAAAQ,IAAAJ,EAAA,UAAA,QAAAI,EAAO,QAAQR,EAAK;AAAA,IAAK,CACpC,GAEYc,EAAA;AAAA,MACX,WAAAV;AAAA,IAAA,CACD;;;"}
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 t=require("vue"),i=require("@unovis/ts"),u=require("../../utils/props.cjs"),v=require("../../utils/context.cjs"),b={"data-vis-component":""},m=i.XYLabels.selectors,y=t.defineComponent({__name:"index",props:{color:{},y:{},xPositioning:{},yPositioning:{},labelFontSize:{},label:{},backgroundColor:{},cursor:{},labelTextBrightnessRatio:{},clustering:{type:Boolean},clusterLabel:{},clusterFontSize:{},clusterBackgroundColor:{},clusterCursor:{},clusterLabelColor:{},x:{},id:{type:Function},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(d,{expose:p}){const n=t.inject(v.componentAccessorKey),c=d,a=t.computed(()=>n.data.value??c.data),s=u.useForwardProps(c),o=t.ref();return t.onMounted(()=>{t.nextTick(()=>{var e;o.value=new i.XYLabels(s.value),(e=o.value)==null||e.setData(a.value),n.update(o.value)})}),t.onUnmounted(()=>{var e;(e=o.value)==null||e.destroy(),n.destroy()}),t.watch(s,(e,r)=>{var l;u.arePropsEqual(e,r)||(l=o.value)==null||l.setConfig(s.value)}),t.watch(a,()=>{var e;(e=o.value)==null||e.setData(a.value)}),p({component:o}),(e,r)=>(t.openBlock(),t.createElementBlock("div",b))}});exports.VisXYLabelsSelectors=m;exports.default=y;
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 { XYLabels, XYLabelsConfigInterface, NumericAccessor } from '@unovis/ts'\nimport { onMounted, onUnmounted, computed, ref, watch, nextTick, inject } from 'vue'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\nimport { componentAccessorKey } from '../../utils/context'\n\nconst accessor = inject(componentAccessorKey)\n\n// data and required props \ntype Props = XYLabelsConfigInterface<Datum>\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst data = computed(() => accessor.data.value ?? props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<XYLabels<Datum>>()\n\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 }\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\n\n"],"names":["VisXYLabelsSelectors","XYLabels","accessor","inject","componentAccessorKey","props","__props","data","computed","config","useForwardProps","component","ref","onMounted","nextTick","_a","onUnmounted","watch","curr","prev","arePropsEqual","__expose"],"mappings":"+PAkDaA,EAAuBC,EAAAA,SAAS,wfA3CvC,MAAAC,EAAWC,SAAOC,sBAAoB,EAItCC,EAAQC,EAERC,EAAOC,EAAAA,SAAS,IAAMN,EAAS,KAAK,OAASG,EAAM,IAAI,EAEvDI,EAASC,kBAAgBL,CAAK,EAG9BM,EAAYC,EAAAA,IAAqB,EAGvCC,OAAAA,EAAAA,UAAU,IAAM,CACdC,EAAAA,SAAS,IAAM,OACbH,EAAU,MAAQ,IAAIV,WAAgBQ,EAAO,KAAK,GACxCM,EAAAJ,EAAA,QAAA,MAAAI,EAAO,QAAQR,EAAK,OACrBL,EAAA,OAAOS,EAAU,KAAK,CAAA,CAChC,CAAA,CACF,EAEDK,EAAAA,YAAY,IAAM,QAChBD,EAAAJ,EAAU,QAAV,MAAAI,EAAiB,UACjBb,EAAS,QAAQ,CAAA,CAClB,EAEKe,EAAAA,MAAAR,EAAQ,CAACS,EAAMC,IAAS,OACvBC,EAAA,cAAcF,EAAMC,CAAI,IACjBJ,EAAAJ,EAAA,QAAA,MAAAI,EAAO,UAAUN,EAAO,MACpC,CACD,EAEDQ,EAAA,MAAMV,EAAM,IAAM,QACNQ,EAAAJ,EAAA,QAAA,MAAAI,EAAO,QAAQR,EAAK,MAAK,CACpC,EAEYc,EAAA,CACX,UAAAV,CAAA,CACD"}
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 { XYLabels, NumericAccessor } from '@unovis/ts';
2
- export declare const VisXYLabelsSelectors: typeof import("@unovis/ts/dist/components/xy-labels/style");
3
- declare const _default: <Datum>(__VLS_props: any, __VLS_ctx?: {
4
- attrs: any;
5
- emit: any;
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
- x: NumericAccessor<Datum>;
42
- y: NumericAccessor<Datum>;
43
- label?: import("@unovis/ts").StringAccessor<Datum>;
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: any;
68
- }>) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
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?: any;
17
+ __ctx?: Awaited<typeof __VLS_setup>;
72
18
  };
73
19
  export default _default;
@@ -1,27 +1,28 @@
1
- import { defineComponent as d, inject as m, computed as v, ref as b, onMounted as f, nextTick as y, onUnmounted as x, watch as l, createElementBlock as g, openBlock as _ } from "vue";
2
- import { XYLabels as u } from "@unovis/ts";
3
- import { useForwardProps as C, arePropsEqual as F } from "../../utils/props.js";
4
- import { componentAccessorKey as B } from "../../utils/context.js";
5
- const k = { "data-vis-component": "" }, j = u.selectors, w = /* @__PURE__ */ d({
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: p }) {
34
- const t = m(B), c = i, a = v(() => t.data.value ?? c.data), n = C(c), o = b();
35
- return f(() => {
36
- y(() => {
37
- var e;
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
- }), x(() => {
41
- var e;
42
- (e = o.value) == null || e.destroy(), t.destroy();
43
- }), l(n, (e, r) => {
44
- var s;
45
- F(e, r) || (s = o.value) == null || s.setConfig(n.value);
46
- }), l(a, () => {
47
- var e;
48
- (e = o.value) == null || e.setData(a.value);
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
- j as VisXYLabelsSelectors,
56
- w as default
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 { XYLabels, XYLabelsConfigInterface, NumericAccessor } from '@unovis/ts'\nimport { onMounted, onUnmounted, computed, ref, watch, nextTick, inject } from 'vue'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\nimport { componentAccessorKey } from '../../utils/context'\n\nconst accessor = inject(componentAccessorKey)\n\n// data and required props \ntype Props = XYLabelsConfigInterface<Datum>\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst data = computed(() => accessor.data.value ?? props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<XYLabels<Datum>>()\n\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 }\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\n\n"],"names":["VisXYLabelsSelectors","XYLabels","accessor","inject","componentAccessorKey","props","__props","data","computed","config","useForwardProps","component","ref","onMounted","nextTick","_a","onUnmounted","watch","curr","prev","arePropsEqual","__expose"],"mappings":";;;;wCAkDaA,IAAuBC,EAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA3CvC,UAAAC,IAAWC,EAAOC,CAAoB,GAItCC,IAAQC,GAERC,IAAOC,EAAS,MAAMN,EAAS,KAAK,SAASG,EAAM,IAAI,GAEvDI,IAASC,EAAgBL,CAAK,GAG9BM,IAAYC,EAAqB;AAGvC,WAAAC,EAAU,MAAM;AACd,MAAAC,EAAS,MAAM;;AACb,QAAAH,EAAU,QAAQ,IAAIV,EAAgBQ,EAAO,KAAK,IACxCM,IAAAJ,EAAA,UAAA,QAAAI,EAAO,QAAQR,EAAK,QACrBL,EAAA,OAAOS,EAAU,KAAK;AAAA,MAAA,CAChC;AAAA,IAAA,CACF,GAEDK,EAAY,MAAM;;AAChB,OAAAD,IAAAJ,EAAU,UAAV,QAAAI,EAAiB,WACjBb,EAAS,QAAQ;AAAA,IAAA,CAClB,GAEKe,EAAAR,GAAQ,CAACS,GAAMC,MAAS;;AAC5B,MAAKC,EAAcF,GAAMC,CAAI,MACjBJ,IAAAJ,EAAA,UAAA,QAAAI,EAAO,UAAUN,EAAO;AAAA,IACpC,CACD,GAEDQ,EAAMV,GAAM,MAAM;;AACN,OAAAQ,IAAAJ,EAAA,UAAA,QAAAI,EAAO,QAAQR,EAAK;AAAA,IAAK,CACpC,GAEYc,EAAA;AAAA,MACX,WAAAV;AAAA,IAAA,CACD;;;"}
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 "./components/area/index";
2
- export { default as VisAxis, VisAxisSelectors } from "./components/axis/index";
3
- export { default as VisBrush, VisBrushSelectors } from "./components/brush/index";
4
- export { default as VisCrosshair, VisCrosshairSelectors } from "./components/crosshair/index";
5
- export { default as VisFreeBrush, VisFreeBrushSelectors } from "./components/free-brush/index";
6
- export { default as VisGroupedBar, VisGroupedBarSelectors } from "./components/grouped-bar/index";
7
- export { default as VisLine, VisLineSelectors } from "./components/line/index";
8
- export { default as VisScatter, VisScatterSelectors } from "./components/scatter/index";
9
- export { default as VisStackedBar, VisStackedBarSelectors } from "./components/stacked-bar/index";
10
- export { default as VisTimeline, VisTimelineSelectors } from "./components/timeline/index";
11
- export { default as VisXYLabels, VisXYLabelsSelectors } from "./components/xy-labels/index";
12
- export { default as VisPlotband, VisPlotbandSelectors } from "./components/plotband/index";
13
- export { default as VisPlotline, VisPlotlineSelectors } from "./components/plotline/index";
14
- export { default as VisChordDiagram, VisChordDiagramSelectors } from "./components/chord-diagram/index";
15
- export { default as VisDonut, VisDonutSelectors } from "./components/donut/index";
16
- export { default as VisGraph, VisGraphSelectors } from "./components/graph/index";
17
- export { default as VisNestedDonut, VisNestedDonutSelectors } from "./components/nested-donut/index";
18
- export { default as VisSankey, VisSankeySelectors } from "./components/sankey/index";
19
- export { default as VisTopoJSONMap, VisTopoJSONMapSelectors } from "./components/topojson-map/index";
20
- export { default as VisTreemap, VisTreemapSelectors } from "./components/treemap/index";
21
- export { default as VisTooltip, VisTooltipSelectors } from "./components/tooltip/index";
22
- export { default as VisAnnotations, VisAnnotationsSelectors } from "./components/annotations/index";
23
- export { default as VisLeafletMap, VisLeafletMapSelectors } from "./html-components/leaflet-map/index";
24
- export { default as VisLeafletFlowMap, VisLeafletFlowMapSelectors } from "./html-components/leaflet-flow-map/index";
25
- export { default as VisBulletLegend, VisBulletLegendSelectors } from "./html-components/bullet-legend/index";
26
- export { default as VisFlowLegend, VisFlowLegendSelectors } from "./html-components/flow-legend/index";
27
- export { default as VisRollingPinLegend, VisRollingPinLegendSelectors } from "./html-components/rolling-pin-legend/index";
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"),u=require("@unovis/ts"),a=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:{},data:{}},setup(d,{expose:p}){const r=d,{data:i}=e.toRefs(r),l=v.useForwardProps(r);let o;const t=e.reactive({component:void 0,tooltip:void 0,annotations:void 0}),s=e.ref(),c=()=>{o||s.value&&t.component&&(o=new u.SingleContainer(s.value,{...e.toRaw(t)},i.value))};return e.watchEffect(()=>{var n;c(),(n=t.component)==null||n.config,o==null||o.updateContainer({...e.toRaw(l.value),...e.toRaw(t)})}),e.watch(i,()=>{o?o.setData(i.value,!0):c()}),e.onUnmounted(()=>o==null?void 0:o.destroy()),e.provide(a.componentAccessorKey,{data:i,update:n=>t.component=n,destroy:()=>t.component=void 0}),e.provide(a.tooltipAccessorKey,{data:i,update:n=>t.tooltip=n,destroy:()=>{t.tooltip=void 0}}),e.provide(a.annotationsAccessorKey,{data:i,update:n=>t.annotations=n,destroy:()=>{t.annotations=void 0}}),p({component:o}),(n,m)=>(e.openBlock(),e.createElementBlock("div",{"data-vis-single-container":"",ref_key:"elRef",ref:s,class:"unovis-single-container"},[e.renderSlot(n.$slots,"default")],512))}});exports.default=f;
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","_a","watch","onUnmounted","provide","componentAccessorKey","c","tooltipAccessorKey","t","annotationsAccessorKey","a","__expose"],"mappings":"ycAMA,MAAMA,EAAQC,EACR,CAAE,KAAAC,CAAA,EAASC,EAAA,OAAOH,CAAK,EACvBI,EAAcC,kBAAgBL,CAAK,EAErC,IAAAM,EACJ,MAAMC,EAASC,EAAAA,SAAS,CACtB,UAAW,OACX,QAAS,OACT,YAAa,MAAA,CACd,EACKC,EAAQC,EAAAA,IAAoB,EAE5BC,EAAY,IAAM,CAClBL,GACAG,EAAM,OAASF,EAAO,YAChBD,EAAA,IAAIM,EAAAA,gBAAgBH,EAAM,MAAO,CAAE,GAAGI,EAAA,MAAMN,CAAM,CAAA,EAAKL,EAAK,KAAK,EAC7E,EAEAY,OAAAA,EAAAA,YAAY,IAAM,OACNH,EAAA,GAEAI,EAAAR,EAAO,YAAP,MAAAQ,EAAkB,OACrBT,GAAA,MAAAA,EAAA,gBAAgB,CAAE,GAAGO,QAAMT,EAAY,KAAK,EAAG,GAAGS,EAAAA,MAAMN,CAAM,GAAG,CACzE,EAEDS,EAAA,MAAMd,EAAM,IAAM,CACZI,EACIA,EAAA,QAAQJ,EAAK,MAAO,EAAI,EAEpBS,EAAA,CACZ,CACD,EAEWM,cAAA,IAAMX,GAAA,YAAAA,EAAO,SAAS,EAElCY,EAAAA,QAAQC,EAAAA,qBAAsB,CAC5B,KAAAjB,EACA,OAASkB,GAAwBb,EAAO,UAAYa,EACpD,QAAS,IAAMb,EAAO,UAAY,MAAA,CACnC,EAEDW,EAAAA,QAAQG,EAAAA,mBAAoB,CAC1B,KAAAnB,EACA,OAASoB,GAAef,EAAO,QAAUe,EACzC,QAAS,IAAM,CAAEf,EAAO,QAAU,MAAA,CAAU,CAC7C,EAEDW,EAAAA,QAAQK,EAAAA,uBAAwB,CAC9B,KAAArB,EACA,OAASsB,GAAmBjB,EAAO,YAAciB,EACjD,QAAS,IAAM,CAAEjB,EAAO,YAAc,MAAA,CAAU,CACjD,EAGYkB,EAAA,CACX,UAAWnB,CAAA,CACZ"}
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, ComponentCore, Tooltip, Annotations } from '@unovis/ts';
2
- declare const _default: <T>(__VLS_props: any, __VLS_ctx?: {
3
- attrs: any;
4
- emit: any;
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
- width?: string | number;
11
- component?: ComponentCore<T, import("@unovis/ts").ComponentConfigInterface>;
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: any;
30
- }>) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
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?: any;
18
+ __ctx?: Awaited<typeof __VLS_setup>;
34
19
  };
35
20
  export default _default;
@@ -1,7 +1,7 @@
1
- import { defineComponent as m, toRefs as f, reactive as u, ref as v, watchEffect as g, watch as y, onUnmounted as w, provide as a, createElementBlock as _, openBlock as C, renderSlot as R, toRaw as s } from "vue";
2
- import { SingleContainer as h } from "@unovis/ts";
3
- import { componentAccessorKey as k, tooltipAccessorKey as x, annotationsAccessorKey as A } from "../../utils/context.js";
4
- import { useForwardProps as K } from "../../utils/props.js";
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(c, { expose: d }) {
23
- const r = c, { data: n } = f(r), l = K(r);
24
- let o;
25
- const e = u({
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
- }), i = v(), p = () => {
30
- o || i.value && e.component && (o = new h(i.value, { ...s(e) }, n.value));
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
- var t;
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
- o ? o.setData(n.value, !0) : p();
37
- }), w(() => o == null ? void 0 : o.destroy()), a(k, {
36
+ t ? t.setData(n.value, !0) : c();
37
+ }), h(() => t?.destroy()), i(F, {
38
38
  data: n,
39
- update: (t) => e.component = t,
40
- destroy: () => e.component = void 0
41
- }), a(x, {
39
+ update: (e) => o.component = e,
40
+ destroy: () => o.component = void 0
41
+ }), i(k, {
42
42
  data: n,
43
- update: (t) => e.tooltip = t,
43
+ update: (e) => o.tooltip = e,
44
44
  destroy: () => {
45
- e.tooltip = void 0;
45
+ o.tooltip = void 0;
46
46
  }
47
- }), a(A, {
47
+ }), i(x, {
48
48
  data: n,
49
- update: (t) => e.annotations = t,
49
+ update: (e) => o.annotations = e,
50
50
  destroy: () => {
51
- e.annotations = void 0;
51
+ o.annotations = void 0;
52
52
  }
53
53
  }), d({
54
- component: o
55
- }), (t, B) => (C(), _("div", {
54
+ component: t
55
+ }), (e, K) => (w(), _("div", {
56
56
  "data-vis-single-container": "",
57
57
  ref_key: "elRef",
58
- ref: i,
58
+ ref: a,
59
59
  class: "unovis-single-container"
60
60
  }, [
61
- R(t.$slots, "default")
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","_a","watch","onUnmounted","provide","componentAccessorKey","c","tooltipAccessorKey","annotationsAccessorKey","a","__expose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAMA,UAAMA,IAAQC,GACR,EAAE,MAAAC,EAAA,IAASC,EAAOH,CAAK,GACvBI,IAAcC,EAAgBL,CAAK;AAErC,QAAAM;AACJ,UAAMC,IAASC,EAAS;AAAA,MACtB,WAAW;AAAA,MACX,SAAS;AAAA,MACT,aAAa;AAAA,IAAA,CACd,GACKC,IAAQC,EAAoB,GAE5BC,IAAY,MAAM;AACtB,MAAIL,KACAG,EAAM,SAASF,EAAO,cAChBD,IAAA,IAAIM,EAAgBH,EAAM,OAAO,EAAE,GAAGI,EAAMN,CAAM,EAAA,GAAKL,EAAK,KAAK;AAAA,IAC7E;AAEA,WAAAY,EAAY,MAAM;;AACN,MAAAH,EAAA,IAEAI,IAAAR,EAAO,cAAP,QAAAQ,EAAkB,QACrBT,KAAA,QAAAA,EAAA,gBAAgB,EAAE,GAAGO,EAAMT,EAAY,KAAK,GAAG,GAAGS,EAAMN,CAAM;IAAG,CACzE,GAEDS,EAAMd,GAAM,MAAM;AAChB,MAAII,IACIA,EAAA,QAAQJ,EAAK,OAAO,EAAI,IAEpBS,EAAA;AAAA,IACZ,CACD,GAEWM,EAAA,MAAMX,KAAA,gBAAAA,EAAO,SAAS,GAElCY,EAAQC,GAAsB;AAAA,MAC5B,MAAAjB;AAAA,MACA,QAAQ,CAACkB,MAAwBb,EAAO,YAAYa;AAAA,MACpD,SAAS,MAAMb,EAAO,YAAY;AAAA,IAAA,CACnC,GAEDW,EAAQG,GAAoB;AAAA,MAC1B,MAAAnB;AAAA,MACA,QAAQ,CAAC,MAAeK,EAAO,UAAU;AAAA,MACzC,SAAS,MAAM;AAAE,QAAAA,EAAO,UAAU;AAAA,MAAA;AAAA,IAAU,CAC7C,GAEDW,EAAQI,GAAwB;AAAA,MAC9B,MAAApB;AAAA,MACA,QAAQ,CAACqB,MAAmBhB,EAAO,cAAcgB;AAAA,MACjD,SAAS,MAAM;AAAE,QAAAhB,EAAO,cAAc;AAAA,MAAA;AAAA,IAAU,CACjD,GAGYiB,EAAA;AAAA,MACX,WAAWlB;AAAA,IAAA,CACZ;;;;;;;;;;"}
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;;;"}