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.
- package/dist/components/AreaChart/AreaChart.js +95 -116
- package/dist/components/AreaChart/types.d.ts +1 -205
- package/dist/components/BarChart/BarChart.js +9 -9
- package/dist/components/BarChart/types.d.ts +1 -191
- package/dist/components/BubbleChart/BubbleChart.js +4 -4
- package/dist/components/BubbleChart/types.d.ts +1 -172
- package/dist/components/DagreGraph/DagreGraph.js +65 -62
- package/dist/components/DagreGraph/types.d.ts +1 -1
- package/dist/components/DonutChart/DonutChart.js +5 -5
- package/dist/components/DonutChart/types.d.ts +2 -68
- package/dist/components/DualChart/DualChart.js +125 -122
- package/dist/components/DualChart/types.d.ts +1 -1
- package/dist/components/GanttChart/GanttChart.js +6 -6
- package/dist/components/GanttChart/types.d.ts +1 -124
- package/dist/components/LineChart/LineChart.js +7 -12
- package/dist/components/LineChart/types.d.ts +1 -2
- package/dist/components/Maps/DottedMap/DottedMap.js +66 -79
- package/dist/components/Maps/DottedMap/DottedMap.vue.d.ts +0 -1
- package/dist/components/Maps/DottedMap/core.js +2 -2
- package/dist/components/Maps/DottedMap/core.vue.d.ts +1 -1
- package/dist/components/Maps/DottedMap/mapUtils.js +1 -1
- package/dist/components/Maps/TopoJSONMap/TopoJSONMap.js +54 -56
- package/dist/components/Maps/TopoJSONMap/types.d.ts +5 -1
- package/dist/components/Maps/types.d.ts +0 -1
- package/dist/components/SankeyChart/SankeyChart.js +59 -56
- package/dist/components/SankeyChart/types.d.ts +1 -1
- package/dist/components/Tooltip.js +5 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- 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
- package/dist/node_modules/.pnpm/robust-predicates@3.0.2/node_modules/robust-predicates/esm/orient2d.js +1 -1
- package/dist/packages/shared/dist/donut-chart.js +7 -0
- package/dist/packages/shared/dist/index.js +19 -0
- package/dist/types.d.ts +7 -101
- package/package.json +8 -2
- package/dist/components/DonutChart/types.js +0 -4
- package/dist/components/Maps/DottedMap/MapLegend.vue.d.ts +0 -6
- package/dist/components/Maps/DottedMap/MapZoomControls.js +0 -44
- package/dist/components/Maps/DottedMap/MapZoomControls.vue.d.ts +0 -13
- package/dist/components/Maps/DottedMap/MapZoomControls2.js +0 -4
- package/dist/types.js +0 -6
- /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
|
|
2
|
-
import { REGIONS as
|
|
3
|
-
import { USA_PINS as
|
|
4
|
-
import { useMapPanZoom as
|
|
5
|
-
import
|
|
6
|
-
|
|
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(
|
|
38
|
-
const e =
|
|
39
|
-
offset:
|
|
40
|
-
scale:
|
|
41
|
-
zoomIn:
|
|
42
|
-
zoomOut:
|
|
43
|
-
resetView:
|
|
44
|
-
wasClick:
|
|
45
|
-
onWheel:
|
|
46
|
-
onMouseDown:
|
|
47
|
-
} =
|
|
48
|
-
const i =
|
|
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 ??
|
|
51
|
-
pins: e.pins ??
|
|
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
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
if (
|
|
83
|
-
const r =
|
|
84
|
-
(
|
|
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
|
|
88
|
-
l("pin-remove",
|
|
83
|
+
const n = c.value.splice(r, 1)[0];
|
|
84
|
+
l("pin-remove", n, r);
|
|
89
85
|
} else {
|
|
90
|
-
const
|
|
91
|
-
lat:
|
|
92
|
-
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
|
-
|
|
92
|
+
c.value.push(n), l("pin-add", n);
|
|
97
93
|
}
|
|
98
94
|
}
|
|
99
95
|
};
|
|
100
|
-
return
|
|
96
|
+
return M(
|
|
101
97
|
[() => e.regionName, () => e.defaultZoom],
|
|
102
98
|
() => {
|
|
103
|
-
|
|
99
|
+
p(o.value.defaultZoom);
|
|
104
100
|
},
|
|
105
101
|
{ immediate: !0 }
|
|
106
|
-
),
|
|
107
|
-
zoomIn:
|
|
108
|
-
zoomOut:
|
|
109
|
-
resetView: () =>
|
|
110
|
-
}), (i,
|
|
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:
|
|
108
|
+
style: f({
|
|
113
109
|
width: "100%",
|
|
114
110
|
height: e.maxHeight
|
|
115
111
|
})
|
|
116
112
|
}, [
|
|
117
|
-
|
|
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:
|
|
120
|
-
transform: `translate(${
|
|
115
|
+
style: f({
|
|
116
|
+
transform: `translate(${a(u).x}px, ${a(u).y}px) scale(${a(S)})`
|
|
121
117
|
}),
|
|
122
|
-
onMousedown:
|
|
123
|
-
(...r) =>
|
|
124
|
-
onWheel:
|
|
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) =>
|
|
122
|
+
(...r) => a(g) && a(g)(...r),
|
|
127
123
|
["prevent"]
|
|
128
124
|
))
|
|
129
125
|
}, [
|
|
130
|
-
|
|
126
|
+
I(U, _(i.$attrs, {
|
|
131
127
|
width: "100%",
|
|
132
128
|
height: "100%",
|
|
133
|
-
"map-height":
|
|
134
|
-
color:
|
|
135
|
-
"dot-size":
|
|
136
|
-
grid:
|
|
137
|
-
shape:
|
|
138
|
-
countries:
|
|
139
|
-
region:
|
|
140
|
-
pins:
|
|
141
|
-
"stroke-width":
|
|
142
|
-
"stroke-opacity":
|
|
143
|
-
"country-colors":
|
|
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:
|
|
149
|
-
onPointClick:
|
|
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
|
-
|
|
153
|
-
|
|
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
|
-
|
|
151
|
+
k(i.$slots, "default")
|
|
165
152
|
], 4));
|
|
166
153
|
}
|
|
167
154
|
});
|
|
168
155
|
export {
|
|
169
|
-
|
|
156
|
+
J as default
|
|
170
157
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Y, computed as u,
|
|
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) => (
|
|
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.
|
|
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
|
|
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
|
|
3
|
+
import { TopoJSONMap as s } from "@unovis/ts";
|
|
4
4
|
import G from "../../Tooltip.js";
|
|
5
|
-
import { LegendPosition as I } from "../../../
|
|
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__ */
|
|
9
|
+
}, et = /* @__PURE__ */ M({
|
|
10
10
|
__name: "TopoJSONMap",
|
|
11
11
|
props: {
|
|
12
12
|
mapFeatureKey: {},
|
|
13
13
|
data: {},
|
|
14
|
-
|
|
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,
|
|
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 =
|
|
54
|
-
var t,
|
|
55
|
-
return (t = e.legendPosition) != null && t.includes("left") ? "flex-start" : (
|
|
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
|
-
[
|
|
62
|
-
const
|
|
63
|
-
return n.value = { ...
|
|
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
|
-
[
|
|
66
|
-
},
|
|
67
|
-
var
|
|
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
|
|
70
|
-
return e.linkColor ?? t.color ?? (
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
}, N = (t,
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
return (t,
|
|
78
|
-
style:
|
|
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
|
-
|
|
84
|
+
l(r(D), {
|
|
85
85
|
duration: e.duration,
|
|
86
|
-
data:
|
|
86
|
+
data: a.value,
|
|
87
87
|
height: e.height,
|
|
88
88
|
width: e.width,
|
|
89
89
|
padding: e.padding
|
|
90
90
|
}, {
|
|
91
|
-
default:
|
|
92
|
-
|
|
91
|
+
default: A(() => [
|
|
92
|
+
l(r(K), {
|
|
93
93
|
ref_key: "map",
|
|
94
|
-
ref:
|
|
95
|
-
data:
|
|
96
|
-
"point-data":
|
|
97
|
-
"link-data":
|
|
98
|
-
topojson: e.
|
|
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:
|
|
106
|
+
pointColor: x,
|
|
107
107
|
pointCursor: e.pointCursor,
|
|
108
108
|
pointStrokeWidth: e.pointStrokeWidth,
|
|
109
|
-
linkColor:
|
|
110
|
-
linkWidth:
|
|
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(
|
|
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(
|
|
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 ?
|
|
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 ? (
|
|
132
|
+
e.categories && !e.hideLegend ? (c(), h("div", {
|
|
135
133
|
key: 0,
|
|
136
|
-
style:
|
|
134
|
+
style: d({
|
|
137
135
|
display: "flex",
|
|
138
136
|
justifyContent: P.value
|
|
139
137
|
})
|
|
140
138
|
}, [
|
|
141
|
-
|
|
142
|
-
style:
|
|
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((
|
|
147
|
-
...
|
|
148
|
-
color: Array.isArray(
|
|
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)) :
|
|
152
|
-
|
|
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
|
-
|
|
155
|
+
l(G, {
|
|
158
156
|
data: n.value,
|
|
159
157
|
categories: e.categories ?? {},
|
|
160
|
-
"title-formatter": e.tooltipTitleFormatter ??
|
|
158
|
+
"title-formatter": e.tooltipTitleFormatter ?? J,
|
|
161
159
|
"y-formatter": e.yFormatter
|
|
162
160
|
}, null, 8, ["data", "categories", "title-formatter", "y-formatter"])
|
|
163
|
-
]) :
|
|
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
|
-
|
|
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;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { SankeyNodeAlign as
|
|
3
|
-
import { VisSingleContainer as
|
|
4
|
-
import
|
|
5
|
-
import { LegendPosition as
|
|
6
|
-
const
|
|
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
|
-
},
|
|
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:
|
|
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:
|
|
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:
|
|
47
|
-
const
|
|
48
|
-
function
|
|
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(),
|
|
51
|
+
return (n, u) => (d(), b("div", {
|
|
52
52
|
style: r({
|
|
53
53
|
display: "flex",
|
|
54
|
-
flexDirection:
|
|
54
|
+
flexDirection: W.value ? "column-reverse" : "column",
|
|
55
55
|
gap: "var(--vis-legend-spacing)"
|
|
56
56
|
}),
|
|
57
|
-
onClick: u[0] || (u[0] = (l) =>
|
|
57
|
+
onClick: u[0] || (u[0] = (l) => S("click", l))
|
|
58
58
|
}, [
|
|
59
|
-
a(o(
|
|
59
|
+
a(o(z), {
|
|
60
60
|
padding: e.padding,
|
|
61
61
|
height: e.height,
|
|
62
62
|
duration: e.duration
|
|
63
63
|
}, {
|
|
64
|
-
default:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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(),
|
|
101
|
+
!t.hideLegend && t.categories ? (d(), b("div", {
|
|
99
102
|
key: 0,
|
|
100
103
|
style: r({
|
|
101
104
|
display: "flex",
|
|
102
|
-
justifyContent:
|
|
105
|
+
justifyContent: x.value
|
|
103
106
|
})
|
|
104
107
|
}, [
|
|
105
|
-
a(o(
|
|
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
|
-
|
|
117
|
-
o(
|
|
119
|
+
N("div", j, [
|
|
120
|
+
o(C).tooltip ? m(n.$slots, "tooltip", {
|
|
118
121
|
key: 0,
|
|
119
122
|
node: i.value
|
|
120
|
-
}) : i.value ?
|
|
121
|
-
a(
|
|
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
|
-
|
|
135
|
+
I as default
|
|
133
136
|
};
|