vue-chrts 2.1.0-beta-6 → 2.1.0-beta-8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/components/AreaChart/AreaChart.js +95 -116
  2. package/dist/components/AreaChart/types.d.ts +1 -205
  3. package/dist/components/BarChart/BarChart.js +9 -9
  4. package/dist/components/BarChart/types.d.ts +1 -191
  5. package/dist/components/BubbleChart/BubbleChart.js +4 -4
  6. package/dist/components/BubbleChart/types.d.ts +1 -172
  7. package/dist/components/DagreGraph/DagreGraph.js +65 -62
  8. package/dist/components/DagreGraph/types.d.ts +1 -1
  9. package/dist/components/DonutChart/DonutChart.js +5 -5
  10. package/dist/components/DonutChart/types.d.ts +2 -68
  11. package/dist/components/DualChart/DualChart.js +125 -122
  12. package/dist/components/DualChart/types.d.ts +1 -1
  13. package/dist/components/GanttChart/GanttChart.js +6 -6
  14. package/dist/components/GanttChart/types.d.ts +1 -124
  15. package/dist/components/LineChart/LineChart.js +7 -12
  16. package/dist/components/LineChart/types.d.ts +1 -2
  17. package/dist/components/Maps/DottedMap/DottedMap.js +66 -79
  18. package/dist/components/Maps/DottedMap/DottedMap.vue.d.ts +0 -1
  19. package/dist/components/Maps/DottedMap/core.js +2 -2
  20. package/dist/components/Maps/DottedMap/core.vue.d.ts +1 -1
  21. package/dist/components/Maps/DottedMap/mapUtils.js +1 -1
  22. package/dist/components/Maps/TopoJSONMap/TopoJSONMap.js +54 -56
  23. package/dist/components/Maps/TopoJSONMap/types.d.ts +5 -1
  24. package/dist/components/Maps/types.d.ts +0 -1
  25. package/dist/components/SankeyChart/SankeyChart.js +59 -56
  26. package/dist/components/SankeyChart/types.d.ts +1 -1
  27. package/dist/components/Tooltip.js +5 -5
  28. package/dist/index.d.ts +3 -3
  29. package/dist/index.js +2 -2
  30. package/dist/node_modules/.pnpm/{@turf_boolean-point-in-polygon@7.3.1 → @turf_boolean-point-in-polygon@7.3.2}/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js +1 -1
  31. package/dist/node_modules/.pnpm/robust-predicates@3.0.2/node_modules/robust-predicates/esm/orient2d.js +1 -1
  32. package/dist/packages/shared/dist/donut-chart.js +7 -0
  33. package/dist/packages/shared/dist/index.js +19 -0
  34. package/dist/types.d.ts +7 -101
  35. package/package.json +8 -2
  36. package/dist/components/DonutChart/types.js +0 -4
  37. package/dist/components/Maps/DottedMap/MapLegend.vue.d.ts +0 -6
  38. package/dist/components/Maps/DottedMap/MapZoomControls.js +0 -44
  39. package/dist/components/Maps/DottedMap/MapZoomControls.vue.d.ts +0 -13
  40. package/dist/components/Maps/DottedMap/MapZoomControls2.js +0 -4
  41. package/dist/types.js +0 -6
  42. /package/dist/node_modules/.pnpm/{@turf_invariant@7.3.1 → @turf_invariant@7.3.2}/node_modules/@turf/invariant/dist/esm/index.js +0 -0
@@ -1,13 +1,9 @@
1
- import { defineComponent as M, ref as $, computed as c, watch as I, createElementBlock as y, openBlock as C, normalizeStyle as S, createElementVNode as O, createCommentVNode as H, renderSlot as m, withModifiers as B, unref as n, createVNode as z, mergeProps as E } from "vue";
2
- import { REGIONS as V, COUNTRIES as _, DEFAULT_ZOOM as D } from "./regions.js";
3
- import { USA_PINS as R, WORLD_PINS as L } from "./pins.js";
4
- import { useMapPanZoom as U } from "./useMapPanZoom.js";
5
- import j from "./core.js";
6
- import A from "./MapZoomControls.js";
7
- const T = {
8
- key: 0,
9
- class: "absolute top-0 right-0"
10
- }, F = { class: "absolute bottom-4 right-4 flex flex-col gap-2" }, Y = /* @__PURE__ */ M({
1
+ import { defineComponent as x, ref as W, computed as d, watch as M, openBlock as Z, createElementBlock as H, normalizeStyle as f, createElementVNode as v, withModifiers as $, unref as a, createVNode as I, mergeProps as _, renderSlot as k } from "vue";
2
+ import { REGIONS as B, COUNTRIES as E, DEFAULT_ZOOM as D } from "./regions.js";
3
+ import { USA_PINS as V, WORLD_PINS as L } from "./pins.js";
4
+ import { useMapPanZoom as R } from "./useMapPanZoom.js";
5
+ import U from "./core.js";
6
+ const j = { class: "absolute bottom-4 right-4 flex flex-col gap-2" }, J = /* @__PURE__ */ x({
11
7
  __name: "DottedMap",
12
8
  props: {
13
9
  regionName: { default: "world" },
@@ -34,21 +30,21 @@ const T = {
34
30
  backgroundColor: {}
35
31
  },
36
32
  emits: ["pin-click", "point-click", "pin-add", "pin-remove"],
37
- setup(p, { expose: P, emit: b }) {
38
- const e = p, l = b, {
39
- offset: g,
40
- scale: N,
41
- zoomIn: h,
42
- zoomOut: f,
43
- resetView: d,
44
- wasClick: v,
45
- onWheel: k,
46
- onMouseDown: w
47
- } = U(), u = $([]), Z = c(() => e.pins ? e.pins : u.value), t = c(() => {
48
- const i = V[e.regionName || "world"], o = _[e.regionName || "world"], r = D[e.regionName || "world"] ?? 1, a = e.regionName === "usa" ? R : L, s = {
33
+ setup(w, { expose: y, emit: C }) {
34
+ const e = w, l = C, {
35
+ offset: u,
36
+ scale: S,
37
+ zoomIn: z,
38
+ zoomOut: P,
39
+ resetView: p,
40
+ wasClick: m,
41
+ onWheel: g,
42
+ onMouseDown: h
43
+ } = R(), c = W([]), O = d(() => e.pins ? e.pins : c.value), o = d(() => {
44
+ const i = B[e.regionName || "world"], t = E[e.regionName || "world"], r = D[e.regionName || "world"] ?? 1, n = e.regionName === "usa" ? V : L, s = {
49
45
  region: e.region ?? i,
50
- countries: e.countries ?? o,
51
- pins: e.pins ?? a,
46
+ countries: e.countries ?? t,
47
+ pins: e.pins ?? n,
52
48
  defaultZoom: e.defaultZoom ?? r,
53
49
  color: e.color,
54
50
  countryColors: e.countryColors,
@@ -75,96 +71,87 @@ const T = {
75
71
  return { ...s, grid: e.grid ?? "vertical" };
76
72
  }
77
73
  });
78
- c(() => e.legend);
79
- const W = (i) => {
80
- v() && l("pin-click", i);
81
- }, x = (i, o) => {
82
- if (v() && (l("point-click", i, o), !e.pins)) {
83
- const r = u.value.findIndex(
84
- (a) => Math.abs(a.lat - o.lat) < 1e-4 && Math.abs(a.lng - o.lng) < 1e-4
74
+ d(() => e.legend);
75
+ const b = (i) => {
76
+ m() && l("pin-click", i);
77
+ }, N = (i, t) => {
78
+ if (m() && (l("point-click", i, t), !e.pins)) {
79
+ const r = c.value.findIndex(
80
+ (n) => Math.abs(n.lat - t.lat) < 1e-4 && Math.abs(n.lng - t.lng) < 1e-4
85
81
  );
86
82
  if (r > -1) {
87
- const a = u.value.splice(r, 1)[0];
88
- l("pin-remove", a, r);
83
+ const n = c.value.splice(r, 1)[0];
84
+ l("pin-remove", n, r);
89
85
  } else {
90
- const a = {
91
- lat: o.lat,
92
- lng: o.lng,
86
+ const n = {
87
+ lat: t.lat,
88
+ lng: t.lng,
93
89
  svgOptions: { color: "var(--ui-text)", radius: 0.15 },
94
90
  data: { city: "Custom Pin", region: "Other" }
95
91
  };
96
- u.value.push(a), l("pin-add", a);
92
+ c.value.push(n), l("pin-add", n);
97
93
  }
98
94
  }
99
95
  };
100
- return I(
96
+ return M(
101
97
  [() => e.regionName, () => e.defaultZoom],
102
98
  () => {
103
- d(t.value.defaultZoom);
99
+ p(o.value.defaultZoom);
104
100
  },
105
101
  { immediate: !0 }
106
- ), P({
107
- zoomIn: h,
108
- zoomOut: f,
109
- resetView: () => d(t.value.defaultZoom)
110
- }), (i, o) => (C(), y("div", {
102
+ ), y({
103
+ zoomIn: z,
104
+ zoomOut: P,
105
+ resetView: () => p(o.value.defaultZoom)
106
+ }), (i, t) => (Z(), H("div", {
111
107
  class: "w-full h-full overflow-hidden relative",
112
- style: S({
108
+ style: f({
113
109
  width: "100%",
114
110
  height: e.maxHeight
115
111
  })
116
112
  }, [
117
- O("div", {
113
+ v("div", {
118
114
  class: "w-full h-full flex items-center justify-center cursor-grab active:cursor-grabbing select-none touch-none",
119
- style: S({
120
- transform: `translate(${n(g).x}px, ${n(g).y}px) scale(${n(N)})`
115
+ style: f({
116
+ transform: `translate(${a(u).x}px, ${a(u).y}px) scale(${a(S)})`
121
117
  }),
122
- onMousedown: o[0] || (o[0] = //@ts-ignore
123
- (...r) => n(w) && n(w)(...r)),
124
- onWheel: o[1] || (o[1] = B(
118
+ onMousedown: t[0] || (t[0] = //@ts-ignore
119
+ (...r) => a(h) && a(h)(...r)),
120
+ onWheel: t[1] || (t[1] = $(
125
121
  //@ts-ignore
126
- (...r) => n(k) && n(k)(...r),
122
+ (...r) => a(g) && a(g)(...r),
127
123
  ["prevent"]
128
124
  ))
129
125
  }, [
130
- z(j, E(i.$attrs, {
126
+ I(U, _(i.$attrs, {
131
127
  width: "100%",
132
128
  height: "100%",
133
- "map-height": t.value.mapHeight || 60,
134
- color: t.value.color || "var(--ui-text-dimmed)",
135
- "dot-size": t.value.dotSize || 0.36,
136
- grid: t.value.grid,
137
- shape: t.value.shape,
138
- countries: t.value.countries,
139
- region: t.value.region,
140
- pins: Z.value,
141
- "stroke-width": t.value.strokeWidth,
142
- "stroke-opacity": t.value.strokeOpacity,
143
- "country-colors": t.value.countryColors,
129
+ "map-height": o.value.mapHeight || 60,
130
+ color: o.value.color || "var(--ui-text-dimmed)",
131
+ "dot-size": o.value.dotSize || 0.36,
132
+ grid: o.value.grid,
133
+ shape: o.value.shape,
134
+ countries: o.value.countries,
135
+ region: o.value.region,
136
+ pins: O.value,
137
+ "stroke-width": o.value.strokeWidth,
138
+ "stroke-opacity": o.value.strokeOpacity,
139
+ "country-colors": o.value.countryColors,
144
140
  "avoid-outer-pins": e.avoidOuterPins,
145
141
  "precomputed-map": e.precomputedMap,
146
142
  "background-color": e.backgroundColor,
147
143
  class: "w-full h-full object-contain",
148
- onPinClick: W,
149
- onPointClick: x
144
+ onPinClick: b,
145
+ onPointClick: N
150
146
  }), null, 16, ["map-height", "color", "dot-size", "grid", "shape", "countries", "region", "pins", "stroke-width", "stroke-opacity", "country-colors", "avoid-outer-pins", "precomputed-map", "background-color"])
151
147
  ], 36),
152
- p.showControls ? (C(), y("div", T, [
153
- m(i.$slots, "controls", {}, () => [
154
- z(A, {
155
- onZoomIn: n(h),
156
- onZoomOut: n(f),
157
- onReset: o[2] || (o[2] = (r) => n(d)(t.value.defaultZoom))
158
- }, null, 8, ["onZoomIn", "onZoomOut"])
159
- ])
160
- ])) : H("", !0),
161
- O("div", F, [
162
- m(i.$slots, "legend")
148
+ v("div", j, [
149
+ k(i.$slots, "legend")
163
150
  ]),
164
- m(i.$slots, "default")
151
+ k(i.$slots, "default")
165
152
  ], 4));
166
153
  }
167
154
  });
168
155
  export {
169
- Y as default
156
+ J as default
170
157
  };
@@ -16,7 +16,6 @@ interface Props extends DottedMapProps {
16
16
  declare function __VLS_template(): {
17
17
  attrs: Partial<{}>;
18
18
  slots: {
19
- controls?(_: {}): any;
20
19
  legend?(_: {}): any;
21
20
  default?(_: {}): any;
22
21
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as Y, computed as u, createElementBlock as q, openBlock as F, normalizeStyle as L, renderSlot as T, createElementVNode as J } from "vue";
1
+ import { defineComponent as Y, computed as u, openBlock as q, createElementBlock as F, normalizeStyle as L, renderSlot as T, createElementVNode as J } from "vue";
2
2
  import { getMap as R, getPin as V } from "./mapUtils.js";
3
3
  import D from "../../../data/countries.geo.json.js";
4
4
  const G = ["innerHTML"], Z = /* @__PURE__ */ Y({
@@ -94,7 +94,7 @@ const G = ["innerHTML"], Z = /* @__PURE__ */ Y({
94
94
  O("point-click", n, l);
95
95
  }
96
96
  }
97
- return (n, e) => (F(), q("div", {
97
+ return (n, e) => (q(), F("div", {
98
98
  class: "dotted-world-map-container",
99
99
  style: L({
100
100
  backgroundColor: p.backgroundColor,
@@ -19,8 +19,8 @@ declare const __VLS_component: import('vue').DefineComponent<DottedMapProps, {},
19
19
  "onPoint-click"?: ((event: MouseEvent, point: any) => any) | undefined;
20
20
  "onPin-click"?: ((point: any) => any) | undefined;
21
21
  }>, {
22
- grid: "vertical" | "diagonal";
23
22
  color: string;
23
+ grid: "vertical" | "diagonal";
24
24
  avoidOuterPins: boolean;
25
25
  dotSize: number;
26
26
  strokeWidth: number;
@@ -1,5 +1,5 @@
1
1
  import y from "../../../node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/index.js";
2
- import Y from "../../../node_modules/.pnpm/@turf_boolean-point-in-polygon@7.3.1/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js";
2
+ import Y from "../../../node_modules/.pnpm/@turf_boolean-point-in-polygon@7.3.2/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js";
3
3
  y.defs("GOOGLE") || y.defs("GOOGLE", "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs");
4
4
  const h = {
5
5
  lat: { min: -56, max: 71 },
@@ -1,17 +1,17 @@
1
- import { defineComponent as O, useSlots as A, useTemplateRef as y, ref as C, computed as c, createElementBlock as h, openBlock as d, normalizeStyle as f, createVNode as s, createCommentVNode as m, createElementVNode as J, unref as r, withCtx as R, createBlock as $, renderSlot as v } from "vue";
1
+ import { defineComponent as M, useSlots as O, useTemplateRef as y, ref as C, computed as u, openBlock as c, createElementBlock as h, normalizeStyle as d, createVNode as l, unref as r, withCtx as A, createBlock as R, createCommentVNode as f, createElementVNode as $, renderSlot as v } from "vue";
2
2
  import { VisSingleContainer as D, VisTopoJSONMap as K, VisTooltip as H, VisBulletLegend as q } from "@unovis/vue";
3
- import { TopoJSONMap as p } from "@unovis/ts";
3
+ import { TopoJSONMap as s } from "@unovis/ts";
4
4
  import G from "../../Tooltip.js";
5
- import { LegendPosition as I } from "../../../types.js";
5
+ import { LegendPosition as I } from "../../../packages/shared/dist/index.js";
6
6
  const Q = {
7
7
  ref: "slotWrapper",
8
8
  style: { display: "none" }
9
- }, et = /* @__PURE__ */ O({
9
+ }, et = /* @__PURE__ */ M({
10
10
  __name: "TopoJSONMap",
11
11
  props: {
12
12
  mapFeatureKey: {},
13
13
  data: {},
14
- topojson: {},
14
+ topoJson: {},
15
15
  zoomFactor: { default: 1 },
16
16
  zoomExtent: { default: () => [0.5, 6] },
17
17
  projection: {},
@@ -47,55 +47,55 @@ const Q = {
47
47
  },
48
48
  emits: ["mouseenter", "mouseleave", "feature-click", "point-click"],
49
49
  setup(T, { emit: S }) {
50
- const e = T, a = S, w = A(), g = y("slotWrapper"), n = C(), F = c(() => {
50
+ const e = T, m = S, w = O(), g = y("slotWrapper"), n = C(), F = u(() => {
51
51
  var t;
52
52
  return (t = e.legendPosition) == null ? void 0 : t.startsWith("top");
53
- }), P = c(() => {
54
- var t, i;
55
- return (t = e.legendPosition) != null && t.includes("left") ? "flex-start" : (i = e.legendPosition) != null && i.includes("right") ? "flex-end" : "center";
53
+ }), P = u(() => {
54
+ var t, o;
55
+ return (t = e.legendPosition) != null && t.includes("left") ? "flex-start" : (o = e.legendPosition) != null && o.includes("right") ? "flex-end" : "center";
56
56
  });
57
57
  function k(t) {
58
58
  return typeof window > "u" ? "" : g.value ? g.value.innerHTML : "";
59
59
  }
60
60
  const V = {
61
- [p.selectors.feature]: (t) => {
62
- const i = t.data ?? t.datum ?? {}, o = t.properties ?? {};
63
- return n.value = { ...o, ...i, ...t }, k();
61
+ [s.selectors.feature]: (t) => {
62
+ const o = t.data ?? t.datum ?? {}, i = t.properties ?? {};
63
+ return n.value = { ...i, ...o, ...t }, k();
64
64
  },
65
- [p.selectors.point]: (t) => (n.value = t, k())
66
- }, u = y("map"), z = (t) => e.pointLabel ? e.pointLabel(t) : t.label, W = (t) => typeof e.pointSize == "function" ? e.pointSize(t) : e.pointSize ?? t.radius ?? 5, j = (t) => typeof e.pointColor == "function" ? e.pointColor(t) : e.pointColor ?? t.color, x = (t) => {
67
- var o;
65
+ [s.selectors.point]: (t) => (n.value = t, k())
66
+ }, p = y("map"), z = (t) => e.pointLabel ? e.pointLabel(t) : t.label, W = (t) => typeof e.pointSize == "function" ? e.pointSize(t) : e.pointSize ?? t.radius ?? 5, x = (t) => typeof e.pointColor == "function" ? e.pointColor(t) : e.pointColor ?? t.color, _ = (t) => {
67
+ var i;
68
68
  if (typeof e.linkColor == "function") return e.linkColor(t);
69
- const i = typeof t.source == "object" ? t.source : (o = e.data.points) == null ? void 0 : o.find((M) => M.id === t.target);
70
- return e.linkColor ?? t.color ?? (i == null ? void 0 : i.color);
71
- }, _ = (t) => typeof e.areaColor == "function" ? e.areaColor(t) : e.areaColor ?? t.color, b = (t) => typeof e.linkWidth == "function" ? e.linkWidth(t) : e.linkWidth ?? t.width ?? 1, L = C(null), B = (t, i) => {
72
- a("feature-click", t, i);
73
- }, N = (t, i) => {
74
- var o;
75
- L.value = t, a("point-click", t, i), (o = u.value) != null && o.component && u.value.component._fitToPoints([t], 0.1);
76
- }, E = (t) => e.tooltipTitleFormatter ? e.tooltipTitleFormatter(t) : t ? ((t == null ? void 0 : t.properties) ?? {}).name ?? "" : "", l = c(() => e.data);
77
- return (t, i) => (d(), h("div", {
78
- style: f({
69
+ const o = typeof t.source == "object" ? t.source : (i = e.data.points) == null ? void 0 : i.find((E) => E.id === t.target);
70
+ return e.linkColor ?? t.color ?? (o == null ? void 0 : o.color);
71
+ }, b = (t) => typeof e.areaColor == "function" ? e.areaColor(t) : e.areaColor ?? t.color, L = (t) => typeof e.linkWidth == "function" ? e.linkWidth(t) : e.linkWidth ?? t.width ?? 1, j = C(null), B = (t, o) => {
72
+ m("feature-click", t, o);
73
+ }, N = (t, o) => {
74
+ var i;
75
+ j.value = t, m("point-click", t, o), (i = p.value) != null && i.component && p.value.component._fitToPoints([t], 0.1);
76
+ }, J = (t) => e.tooltipTitleFormatter ? e.tooltipTitleFormatter(t) : t ? ((t == null ? void 0 : t.properties) ?? {}).name ?? "" : "", a = u(() => e.data);
77
+ return (t, o) => (c(), h("div", {
78
+ style: d({
79
79
  display: "flex",
80
80
  flexDirection: F.value ? "column-reverse" : "column",
81
81
  gap: "var(--vis-legend-spacing)"
82
82
  })
83
83
  }, [
84
- s(r(D), {
84
+ l(r(D), {
85
85
  duration: e.duration,
86
- data: l.value,
86
+ data: a.value,
87
87
  height: e.height,
88
88
  width: e.width,
89
89
  padding: e.padding
90
90
  }, {
91
- default: R(() => [
92
- s(r(K), {
91
+ default: A(() => [
92
+ l(r(K), {
93
93
  ref_key: "map",
94
- ref: u,
95
- data: l.value.areas,
96
- "point-data": l.value.points,
97
- "link-data": l.value.links,
98
- topojson: e.topojson,
94
+ ref: p,
95
+ data: a.value.areas,
96
+ "point-data": a.value.points,
97
+ "link-data": a.value.links,
98
+ topojson: e.topoJson,
99
99
  projection: e.projection,
100
100
  "zoom-factor": e.zoomFactor,
101
101
  "zoom-extent": e.zoomExtent,
@@ -103,64 +103,62 @@ const Q = {
103
103
  fitViewPadding: e.fitViewPadding,
104
104
  pointLabel: z,
105
105
  pointRadius: W,
106
- pointColor: j,
106
+ pointColor: x,
107
107
  pointCursor: e.pointCursor,
108
108
  pointStrokeWidth: e.pointStrokeWidth,
109
- linkColor: x,
110
- linkWidth: b,
109
+ linkColor: _,
110
+ linkWidth: L,
111
111
  linkCursor: e.linkCursor,
112
112
  mapFitToPoints: e.mapFitToPoints,
113
- areaColor: _,
113
+ areaColor: b,
114
114
  areaCursor: e.areaCursor,
115
115
  "map-feature-name": e.mapFeatureKey,
116
116
  events: {
117
- [r(p).selectors.feature]: {
118
- click: B,
119
- mouseover: (o) => a("mouseenter", o),
120
- mouseout: (o) => a("mouseleave", o)
117
+ [r(s).selectors.feature]: {
118
+ click: B
121
119
  },
122
- [r(p).selectors.point]: {
120
+ [r(s).selectors.point]: {
123
121
  click: N
124
122
  }
125
123
  }
126
124
  }, null, 8, ["data", "point-data", "link-data", "topojson", "projection", "zoom-factor", "zoom-extent", "fitView", "fitViewPadding", "pointCursor", "pointStrokeWidth", "linkCursor", "mapFitToPoints", "areaCursor", "map-feature-name", "events"]),
127
- e.hideTooltip ? m("", !0) : (d(), $(r(H), {
125
+ e.hideTooltip ? f("", !0) : (c(), R(r(H), {
128
126
  key: 0,
129
127
  triggers: V
130
128
  }))
131
129
  ]),
132
130
  _: 1
133
131
  }, 8, ["duration", "data", "height", "width", "padding"]),
134
- e.categories && !e.hideLegend ? (d(), h("div", {
132
+ e.categories && !e.hideLegend ? (c(), h("div", {
135
133
  key: 0,
136
- style: f({
134
+ style: d({
137
135
  display: "flex",
138
136
  justifyContent: P.value
139
137
  })
140
138
  }, [
141
- s(r(q), {
142
- style: f([
139
+ l(r(q), {
140
+ style: d([
143
141
  e.legendStyle,
144
142
  "display: flex; gap: var(--vis-legend-spacing);"
145
143
  ]),
146
- items: Object.values(e.categories).map((o) => ({
147
- ...o,
148
- color: Array.isArray(o.color) ? o.color[0] : o.color
144
+ items: Object.values(e.categories).map((i) => ({
145
+ ...i,
146
+ color: Array.isArray(i.color) ? i.color[0] : i.color
149
147
  }))
150
148
  }, null, 8, ["style", "items"])
151
- ], 4)) : m("", !0),
152
- J("div", Q, [
149
+ ], 4)) : f("", !0),
150
+ $("div", Q, [
153
151
  r(w).tooltip ? v(t.$slots, "tooltip", {
154
152
  key: 0,
155
153
  values: n.value
156
154
  }) : n.value ? v(t.$slots, "fallback", { key: 1 }, () => [
157
- s(G, {
155
+ l(G, {
158
156
  data: n.value,
159
157
  categories: e.categories ?? {},
160
- "title-formatter": e.tooltipTitleFormatter ?? E,
158
+ "title-formatter": e.tooltipTitleFormatter ?? J,
161
159
  "y-formatter": e.yFormatter
162
160
  }, null, 8, ["data", "categories", "title-formatter", "y-formatter"])
163
- ]) : m("", !0)
161
+ ]) : f("", !0)
164
162
  ], 512)
165
163
  ], 4));
166
164
  }
@@ -4,7 +4,11 @@ import { MapData, MapPoint } from '../types';
4
4
  export type MapsData<T extends Record<string, any>> = {
5
5
  mapFeatureKey: keyof T;
6
6
  data: MapData;
7
- topojson: any;
7
+ /**
8
+ * TopoJSON data for the map.
9
+ * @see https://github.com/topojson/topojson-specification/
10
+ */
11
+ topoJson: any;
8
12
  zoomFactor?: number;
9
13
  zoomExtent?: [number, number];
10
14
  projection?: GeoProjection;
@@ -22,7 +22,6 @@ export type MapData = {
22
22
  areas?: MapArea[];
23
23
  };
24
24
  export interface TopoJSONMapProps {
25
- mapType: 'uk' | 'france' | 'usa';
26
25
  data: MapData;
27
26
  width?: number;
28
27
  height?: number;
@@ -1,12 +1,12 @@
1
- import { defineComponent as W, useSlots as x, useTemplateRef as V, ref as L, computed as f, createElementBlock as c, openBlock as d, normalizeStyle as r, createVNode as a, createCommentVNode as s, createElementVNode as p, unref as o, withCtx as P, createBlock as w, renderSlot as h } from "vue";
2
- import { SankeyNodeAlign as A, Sankey as B } from "@unovis/ts";
3
- import { VisSingleContainer as N, VisTooltip as H, VisSankey as T, VisBulletLegend as z } from "@unovis/vue";
4
- import M from "../Tooltip.js";
5
- import { LegendPosition as O } from "../../types.js";
6
- const F = {
1
+ import { defineComponent as L, useSlots as p, useTemplateRef as P, ref as w, computed as y, openBlock as d, createElementBlock as b, normalizeStyle as r, createVNode as a, unref as o, withCtx as A, createBlock as B, createCommentVNode as s, createElementVNode as N, renderSlot as m } from "vue";
2
+ import { SankeyNodeAlign as H, Sankey as T } from "@unovis/ts";
3
+ import { VisSingleContainer as z, VisTooltip as M, VisSankey as O, VisBulletLegend as F } from "@unovis/vue";
4
+ import D from "../Tooltip.js";
5
+ import { LegendPosition as $ } from "../../packages/shared/dist/index.js";
6
+ const j = {
7
7
  ref: "slotWrapper",
8
8
  style: { display: "none" }
9
- }, J = /* @__PURE__ */ W({
9
+ }, I = /* @__PURE__ */ L({
10
10
  __name: "SankeyChart",
11
11
  props: {
12
12
  data: {},
@@ -19,7 +19,7 @@ const F = {
19
19
  }) },
20
20
  categories: {},
21
21
  hideLegend: { type: Boolean, default: !1 },
22
- legendPosition: { default: O.BottomCenter },
22
+ legendPosition: { default: $.BottomCenter },
23
23
  legendStyle: { default: void 0 },
24
24
  label: {},
25
25
  subLabel: {},
@@ -27,12 +27,12 @@ const F = {
27
27
  linkColor: {},
28
28
  linkValue: {},
29
29
  nodeWidth: { default: 10 },
30
- nodeAlign: { default: A.Justify },
30
+ nodeAlign: { default: H.Justify },
31
31
  nodePadding: { default: 10 },
32
32
  nodeSort: {},
33
33
  linkSort: {},
34
34
  iterations: { default: 32 },
35
- hideTooltip: { type: Boolean },
35
+ hideTooltip: { type: Boolean, default: !1 },
36
36
  tooltip: { default: () => ({
37
37
  followCursor: !0
38
38
  }) },
@@ -43,66 +43,69 @@ const F = {
43
43
  duration: { default: 600 }
44
44
  },
45
45
  emits: ["click"],
46
- setup(e, { emit: y }) {
47
- const b = y, t = e, m = x(), k = V("slotWrapper"), i = L(), S = f(() => t.legendPosition.startsWith("top")), C = f(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center");
48
- function v(n) {
46
+ setup(e, { emit: k }) {
47
+ const S = k, t = e, C = p(), v = P("slotWrapper"), i = w(), W = y(() => t.legendPosition.startsWith("top")), x = y(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center");
48
+ function V(n) {
49
49
  i.value = n;
50
50
  }
51
- return (n, u) => (d(), c("div", {
51
+ return (n, u) => (d(), b("div", {
52
52
  style: r({
53
53
  display: "flex",
54
- flexDirection: S.value ? "column-reverse" : "column",
54
+ flexDirection: W.value ? "column-reverse" : "column",
55
55
  gap: "var(--vis-legend-spacing)"
56
56
  }),
57
- onClick: u[0] || (u[0] = (l) => b("click", l))
57
+ onClick: u[0] || (u[0] = (l) => S("click", l))
58
58
  }, [
59
- a(o(N), {
59
+ a(o(z), {
60
60
  padding: e.padding,
61
61
  height: e.height,
62
62
  duration: e.duration
63
63
  }, {
64
- default: P(() => [
65
- e.hideTooltip ? s("", !0) : (d(), w(o(H), {
66
- key: 0,
67
- followCursor: t.tooltip.followCursor,
68
- "show-delay": t.tooltip.showDelay,
69
- "hide-delay": t.tooltip.hideDelay,
70
- triggers: {
71
- [o(B).selectors.node]: (l) => {
72
- var g;
73
- return v(l), l ? (g = k.value) == null ? void 0 : g.innerHTML : "";
64
+ default: A(() => {
65
+ var l, g, f;
66
+ return [
67
+ e.hideTooltip ? s("", !0) : (d(), B(o(M), {
68
+ key: 0,
69
+ followCursor: (l = t.tooltip) == null ? void 0 : l.followCursor,
70
+ "show-delay": (g = t.tooltip) == null ? void 0 : g.showDelay,
71
+ "hide-delay": (f = t.tooltip) == null ? void 0 : f.hideDelay,
72
+ triggers: {
73
+ [o(T).selectors.node]: (c) => {
74
+ var h;
75
+ return V(c), c ? (h = v.value) == null ? void 0 : h.innerHTML : "";
76
+ }
74
77
  }
75
- }
76
- }, null, 8, ["followCursor", "show-delay", "hide-delay", "triggers"])),
77
- a(o(T), {
78
- data: e.data,
79
- label: e.label,
80
- subLabel: e.subLabel,
81
- nodeColor: e.nodeColor,
82
- linkColor: e.linkColor,
83
- linkValue: e.linkValue,
84
- nodeWidth: e.nodeWidth,
85
- nodeAlign: e.nodeAlign,
86
- nodePadding: e.nodePadding,
87
- nodeSort: e.nodeSort,
88
- linkSort: e.linkSort,
89
- iterations: e.iterations,
90
- highlightSubtreeOnHover: e.highlightSubtreeOnHover,
91
- labelFontSize: e.labelFontSize,
92
- labelColor: e.labelColor,
93
- labelMaxWidth: e.labelMaxWidth
94
- }, null, 8, ["data", "label", "subLabel", "nodeColor", "linkColor", "linkValue", "nodeWidth", "nodeAlign", "nodePadding", "nodeSort", "linkSort", "iterations", "highlightSubtreeOnHover", "labelFontSize", "labelColor", "labelMaxWidth"])
95
- ]),
78
+ }, null, 8, ["followCursor", "show-delay", "hide-delay", "triggers"])),
79
+ a(o(O), {
80
+ data: e.data,
81
+ label: e.label,
82
+ subLabel: e.subLabel,
83
+ nodeColor: e.nodeColor,
84
+ linkColor: e.linkColor,
85
+ linkValue: e.linkValue,
86
+ nodeWidth: e.nodeWidth,
87
+ nodeAlign: e.nodeAlign,
88
+ nodePadding: e.nodePadding,
89
+ nodeSort: e.nodeSort,
90
+ linkSort: e.linkSort,
91
+ iterations: e.iterations,
92
+ highlightSubtreeOnHover: e.highlightSubtreeOnHover,
93
+ labelFontSize: e.labelFontSize,
94
+ labelColor: e.labelColor,
95
+ labelMaxWidth: e.labelMaxWidth
96
+ }, null, 8, ["data", "label", "subLabel", "nodeColor", "linkColor", "linkValue", "nodeWidth", "nodeAlign", "nodePadding", "nodeSort", "linkSort", "iterations", "highlightSubtreeOnHover", "labelFontSize", "labelColor", "labelMaxWidth"])
97
+ ];
98
+ }),
96
99
  _: 1
97
100
  }, 8, ["padding", "height", "duration"]),
98
- !t.hideLegend && t.categories ? (d(), c("div", {
101
+ !t.hideLegend && t.categories ? (d(), b("div", {
99
102
  key: 0,
100
103
  style: r({
101
104
  display: "flex",
102
- justifyContent: C.value
105
+ justifyContent: x.value
103
106
  })
104
107
  }, [
105
- a(o(z), {
108
+ a(o(F), {
106
109
  style: r([
107
110
  t.legendStyle,
108
111
  "display: flex; gap: var(--vis-legend-spacing);"
@@ -113,12 +116,12 @@ const F = {
113
116
  }))
114
117
  }, null, 8, ["style", "items"])
115
118
  ], 4)) : s("", !0),
116
- p("div", F, [
117
- o(m).tooltip ? h(n.$slots, "tooltip", {
119
+ N("div", j, [
120
+ o(C).tooltip ? m(n.$slots, "tooltip", {
118
121
  key: 0,
119
122
  node: i.value
120
- }) : i.value ? h(n.$slots, "fallback", { key: 1 }, () => [
121
- a(M, {
123
+ }) : i.value ? m(n.$slots, "fallback", { key: 1 }, () => [
124
+ a(D, {
122
125
  data: i.value,
123
126
  categories: t.categories ?? {},
124
127
  "title-formatter": (l) => l.label || l.id || "Node"
@@ -129,5 +132,5 @@ const F = {
129
132
  }
130
133
  });
131
134
  export {
132
- J as default
135
+ I as default
133
136
  };