@ac-design/design-system 2.6.1 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/charts/graph.d.ts +9 -15
- package/dist/lib/charts/graph.js +79 -75
- package/dist/lib/charts/index.d.ts +4 -2
- package/dist/lib/charts/index.js +2 -1
- package/dist/lib/charts/nodeSymbol.d.ts +15 -0
- package/dist/lib/charts/nodeSymbol.js +27 -0
- package/dist/lib/charts/tree.d.ts +15 -0
- package/dist/lib/charts/tree.js +89 -0
- package/dist/lib/compat.css +113 -0
- package/dist/lib/components/AcAccordionItem.vue.d.ts +3 -1
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +35 -26
- package/dist/lib/components/AcAlert.vue.d.ts +1 -1
- package/dist/lib/components/AcBadge.vue.d.ts +1 -1
- package/dist/lib/components/AcBanner.vue.d.ts +1 -1
- package/dist/lib/components/AcCard.vue.d.ts +1 -1
- package/dist/lib/components/AcCellValue.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckList.vue.d.ts +1 -1
- package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcFeatureCard.vue.d.ts +1 -1
- package/dist/lib/components/AcGraphChart.vue.d.ts +53 -3
- package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +401 -233
- package/dist/lib/components/AcList.js +5 -0
- package/dist/lib/components/AcList.vue.d.ts +56 -0
- package/dist/lib/components/AcList.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/lib/components/AcListItem.js +5 -0
- package/dist/lib/components/AcListItem.vue.d.ts +53 -0
- package/dist/lib/components/AcListItem.vue_vue_type_script_setup_true_lang.js +105 -0
- package/dist/lib/components/AcMapChart.vue.d.ts +66 -3
- package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +403 -201
- package/dist/lib/components/AcMonthPicker.js +5 -0
- package/dist/lib/components/AcMonthPicker.vue.d.ts +102 -0
- package/dist/lib/components/AcMonthPicker.vue_vue_type_script_setup_true_lang.js +595 -0
- package/dist/lib/components/AcNavbarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
- package/dist/lib/components/AcSideTabs.vue.d.ts +3 -1
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +53 -33
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcStatCard.vue.d.ts +1 -1
- package/dist/lib/components/AcTreeChart.js +5 -0
- package/dist/lib/components/AcTreeChart.vue.d.ts +135 -0
- package/dist/lib/components/AcTreeChart.vue_vue_type_script_setup_true_lang.js +809 -0
- package/dist/lib/components/AcUsageCard.vue.d.ts +1 -1
- package/dist/lib/components/index.d.ts +5 -2
- package/dist/lib/composables/copyText.d.ts +5 -1
- package/dist/lib/composables/copyText.js +15 -3
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.js +85 -81
- package/package.json +1 -1
|
@@ -3,23 +3,32 @@ import { statusMeta as t } from "./status.js";
|
|
|
3
3
|
import n from "../charts/ChartFrame.js";
|
|
4
4
|
import { bindItemHover as r, loadOnce as i, useEChart as a } from "../charts/echarts.js";
|
|
5
5
|
import { chartColor as o, formatCompact as s } from "../charts/shared.js";
|
|
6
|
-
import { computed as c, createBlock as
|
|
7
|
-
import { MapPinOff as
|
|
8
|
-
import { registerMap as
|
|
9
|
-
import { EffectScatterChart as
|
|
10
|
-
import { GeoComponent as
|
|
11
|
-
import { LabelLayout as
|
|
6
|
+
import { computed as c, createBlock as ee, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as te, createTextVNode as f, createVNode as p, defineComponent as m, getCurrentInstance as ne, normalizeStyle as h, openBlock as g, ref as _, renderSlot as re, shallowRef as ie, toDisplayString as v, unref as y, useId as ae, watch as b, withCtx as x } from "vue";
|
|
7
|
+
import { MapPinOff as oe, Minus as se, Plus as ce, RotateCcw as le } from "@lucide/vue";
|
|
8
|
+
import { registerMap as S, use as ue } from "echarts/core";
|
|
9
|
+
import { EffectScatterChart as de, ScatterChart as fe } from "echarts/charts";
|
|
10
|
+
import { GeoComponent as pe } from "echarts/components";
|
|
11
|
+
import { LabelLayout as me } from "echarts/features";
|
|
12
12
|
//#region src/lib/components/AcMapChart.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
-
var
|
|
13
|
+
var he = { class: "absolute top-2 right-2 flex flex-col gap-1" }, ge = { class: "flex items-center gap-1.5 font-medium text-heading" }, _e = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "mt-0.5 text-muted"
|
|
16
|
-
},
|
|
16
|
+
}, ve = { class: "font-medium text-heading" }, ye = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "mt-0.5 text-muted"
|
|
19
|
+
}, be = {
|
|
17
20
|
key: 2,
|
|
18
21
|
class: "mt-1.5 flex justify-between gap-4 border-t border-border pt-1.5"
|
|
19
|
-
},
|
|
22
|
+
}, xe = { class: "text-muted" }, Se = { class: "font-medium text-heading tabular-nums" }, C = 2, Ce = 1.9, w = .75, T = 8, we = 8, Te = .7, Ee = 111.32, De = 4, Oe = /*@__PURE__*/ m({
|
|
20
23
|
__name: "AcMapChart",
|
|
21
24
|
props: {
|
|
22
25
|
points: {},
|
|
26
|
+
areas: { default: () => [] },
|
|
27
|
+
areaLabels: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !0
|
|
30
|
+
},
|
|
31
|
+
selected: { default: void 0 },
|
|
23
32
|
height: { default: 360 },
|
|
24
33
|
pointSize: {
|
|
25
34
|
type: [Number, Function],
|
|
@@ -56,6 +65,7 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
|
|
|
56
65
|
default: void 0
|
|
57
66
|
},
|
|
58
67
|
pointsLabel: { default: "locations" },
|
|
68
|
+
areasLabel: { default: "areas" },
|
|
59
69
|
tooltip: {
|
|
60
70
|
type: Boolean,
|
|
61
71
|
default: !0
|
|
@@ -73,75 +83,115 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
|
|
|
73
83
|
default: !0
|
|
74
84
|
}
|
|
75
85
|
},
|
|
76
|
-
emits: ["point-click"],
|
|
77
|
-
setup(
|
|
78
|
-
|
|
86
|
+
emits: ["point-click", "area-click"],
|
|
87
|
+
setup(m, { expose: Oe, emit: ke }) {
|
|
88
|
+
ue([
|
|
89
|
+
pe,
|
|
79
90
|
fe,
|
|
80
91
|
de,
|
|
81
|
-
|
|
82
|
-
pe
|
|
92
|
+
me
|
|
83
93
|
]);
|
|
84
|
-
let
|
|
94
|
+
let E = m, Ae = ke, D = [
|
|
85
95
|
"success",
|
|
86
96
|
"info",
|
|
87
97
|
"pending",
|
|
88
98
|
"warning",
|
|
89
99
|
"danger",
|
|
90
100
|
"neutral"
|
|
91
|
-
],
|
|
101
|
+
], je = {
|
|
92
102
|
success: o("success", 0),
|
|
93
103
|
info: o("info", 0),
|
|
94
104
|
pending: o("pending", 0),
|
|
95
105
|
warning: o("warning", 0),
|
|
96
106
|
danger: o("danger", 0),
|
|
97
107
|
neutral: o("chart-7", 0)
|
|
98
|
-
},
|
|
108
|
+
}, Me = {
|
|
99
109
|
success: "Healthy",
|
|
100
110
|
info: "Info",
|
|
101
111
|
pending: "Pending",
|
|
102
112
|
warning: "Degraded",
|
|
103
113
|
danger: "Down",
|
|
104
114
|
neutral: "Unknown"
|
|
105
|
-
},
|
|
106
|
-
function
|
|
115
|
+
}, Ne = ae(), Pe = ne()?.vnode.props, Fe = !!Pe?.onPointClick, Ie = !!Pe?.onAreaClick, Le = _(), O = _([]), k = _(0), A = _(null), j = _("point"), M = _(), N = ie(), Re = 0, P = null;
|
|
116
|
+
function F(e) {
|
|
107
117
|
return e.status?.trim() || "neutral";
|
|
108
118
|
}
|
|
109
|
-
function
|
|
110
|
-
if (
|
|
119
|
+
function I(e) {
|
|
120
|
+
if (D.includes(e)) return e;
|
|
111
121
|
let n = t(e).tone;
|
|
112
122
|
return n === "default" ? "neutral" : n;
|
|
113
123
|
}
|
|
114
|
-
function
|
|
115
|
-
return
|
|
124
|
+
function L(e) {
|
|
125
|
+
return E.statusLabels?.[e] ?? Me[e] ?? t(e).label;
|
|
116
126
|
}
|
|
117
|
-
function
|
|
118
|
-
let t =
|
|
119
|
-
return t ? o(t, 0) :
|
|
127
|
+
function ze(e) {
|
|
128
|
+
let t = E.statusColors?.[e];
|
|
129
|
+
return t ? o(t, 0) : je[I(e)];
|
|
120
130
|
}
|
|
121
|
-
function
|
|
122
|
-
return e.color ? o(e.color, 0) :
|
|
131
|
+
function Be(e) {
|
|
132
|
+
return e.color ? o(e.color, 0) : ze(F(e));
|
|
123
133
|
}
|
|
124
|
-
function
|
|
125
|
-
return typeof
|
|
134
|
+
function Ve(e) {
|
|
135
|
+
return typeof E.pointSize == "function" ? E.pointSize(e) : E.pointSize;
|
|
126
136
|
}
|
|
127
|
-
function
|
|
128
|
-
return
|
|
137
|
+
function R(e) {
|
|
138
|
+
return E.valueFormatter ? E.valueFormatter(e) : s(e);
|
|
129
139
|
}
|
|
130
|
-
function
|
|
131
|
-
if (!
|
|
132
|
-
let t =
|
|
133
|
-
return
|
|
140
|
+
function He(e) {
|
|
141
|
+
if (!E.pulse) return !1;
|
|
142
|
+
let t = F(e);
|
|
143
|
+
return E.pulse === !0 ? I(t) === "success" : E.pulse.includes(t) || E.pulse.includes(I(t));
|
|
134
144
|
}
|
|
135
|
-
function
|
|
145
|
+
function Ue(e) {
|
|
136
146
|
return /^.[a-z]/.test(e) ? e.charAt(0).toLowerCase() + e.slice(1) : e;
|
|
137
147
|
}
|
|
138
|
-
function
|
|
148
|
+
function z(e) {
|
|
139
149
|
return `${`${Math.abs(e.latitude).toFixed(2)}° ${e.latitude >= 0 ? "N" : "S"}`}, ${`${Math.abs(e.longitude).toFixed(2)}° ${e.longitude >= 0 ? "E" : "W"}`}`;
|
|
140
150
|
}
|
|
141
|
-
function
|
|
142
|
-
return Math.min(
|
|
151
|
+
function B(e) {
|
|
152
|
+
return Math.min(E.zoomExtent[1], Math.max(E.zoomExtent[0], e));
|
|
153
|
+
}
|
|
154
|
+
function V(e) {
|
|
155
|
+
let t = E.selected;
|
|
156
|
+
return Array.isArray(t) ? t.includes(e) : t === e;
|
|
157
|
+
}
|
|
158
|
+
function H(e) {
|
|
159
|
+
return o(e.color, E.areas.indexOf(e));
|
|
160
|
+
}
|
|
161
|
+
function U(e) {
|
|
162
|
+
return e.replace(/[{}]/g, "");
|
|
163
|
+
}
|
|
164
|
+
function W() {
|
|
165
|
+
let e = N.value;
|
|
166
|
+
if (!e || !k.value) return 0;
|
|
167
|
+
let t = k.value - 16, n = q.value - 16;
|
|
168
|
+
return Math.min(t / ((e[2] - e[0]) * w), n / (e[3] - e[1]));
|
|
143
169
|
}
|
|
144
170
|
function G(e) {
|
|
171
|
+
let t = e.radius / Ee, n = t / w;
|
|
172
|
+
return [
|
|
173
|
+
e.longitude - n,
|
|
174
|
+
e.longitude + n,
|
|
175
|
+
e.latitude - t,
|
|
176
|
+
e.latitude + t
|
|
177
|
+
];
|
|
178
|
+
}
|
|
179
|
+
function We(e, t) {
|
|
180
|
+
return 2 * e.radius * W() * t / Ee;
|
|
181
|
+
}
|
|
182
|
+
function K([e, t, n, r]) {
|
|
183
|
+
let i = [(e + t) / 2, (n + r) / 2], a = W();
|
|
184
|
+
if (!a) return {
|
|
185
|
+
zoom: B(1),
|
|
186
|
+
center: i
|
|
187
|
+
};
|
|
188
|
+
let o = k.value - 16, s = q.value - 16;
|
|
189
|
+
return {
|
|
190
|
+
zoom: B(Math.min(o / (Math.max(t - e, we) * a * w), s / (Math.max(r - n, we) * a)) * Te),
|
|
191
|
+
center: i
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
function Ge(e) {
|
|
145
195
|
let t = [
|
|
146
196
|
Infinity,
|
|
147
197
|
Infinity,
|
|
@@ -160,14 +210,14 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
|
|
|
160
210
|
for (let t of e.features) n(t.geometry?.coordinates);
|
|
161
211
|
return t;
|
|
162
212
|
}
|
|
163
|
-
function
|
|
213
|
+
function Ke(e, t, n) {
|
|
164
214
|
let r = (e) => n ? e[0] >= t : e[0] <= t, i = [];
|
|
165
215
|
return e.forEach((n, a) => {
|
|
166
216
|
let o = e[(a + e.length - 1) % e.length];
|
|
167
217
|
r(o) !== r(n) && i.push([t, o[1] + (n[1] - o[1]) * (t - o[0]) / (n[0] - o[0])]), r(n) && i.push(n);
|
|
168
218
|
}), i;
|
|
169
219
|
}
|
|
170
|
-
function
|
|
220
|
+
function qe(e) {
|
|
171
221
|
if (!e.some((e) => e.some((t, n) => n > 0 && Math.abs(t[0] - e[n - 1][0]) > 180))) return [e];
|
|
172
222
|
let t = e.map((e) => {
|
|
173
223
|
let t = e[0][0];
|
|
@@ -183,11 +233,11 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
|
|
|
183
233
|
0,
|
|
184
234
|
360
|
|
185
235
|
].flatMap((e) => {
|
|
186
|
-
let n = t.map((t) =>
|
|
236
|
+
let n = t.map((t) => Ke(Ke(t.map((t) => [t[0] + e, t[1]]), -180, !0), 180, !1)).filter((e) => e.length >= 3);
|
|
187
237
|
return n.length ? [n] : [];
|
|
188
238
|
});
|
|
189
239
|
}
|
|
190
|
-
async function
|
|
240
|
+
async function Je() {
|
|
191
241
|
let [{ feature: e }, t] = await Promise.all([import("topojson-client"), import("world-atlas/countries-110m.json")]), n = t.default, r = {
|
|
192
242
|
type: "FeatureCollection",
|
|
193
243
|
features: e(n, n.objects.countries).features.filter((e) => e.properties?.name !== "Antarctica").map((e) => {
|
|
@@ -198,105 +248,187 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
|
|
|
198
248
|
...e,
|
|
199
249
|
geometry: {
|
|
200
250
|
type: "MultiPolygon",
|
|
201
|
-
coordinates: n.flatMap(
|
|
251
|
+
coordinates: n.flatMap(qe)
|
|
202
252
|
}
|
|
203
253
|
};
|
|
204
254
|
})
|
|
205
255
|
};
|
|
206
|
-
return
|
|
256
|
+
return S("ac-world", r), r;
|
|
207
257
|
}
|
|
208
|
-
async function
|
|
209
|
-
let e =
|
|
258
|
+
async function Ye() {
|
|
259
|
+
let e = E.geoJson;
|
|
210
260
|
if (e) {
|
|
211
|
-
let t = `ac-map-${
|
|
212
|
-
|
|
261
|
+
let t = `ac-map-${Ne}-${++Re}`;
|
|
262
|
+
S(t, e), N.value = Ge(e), M.value = t;
|
|
213
263
|
return;
|
|
214
264
|
}
|
|
215
|
-
let t = await i("world-map",
|
|
216
|
-
|
|
265
|
+
let t = await i("world-map", Je);
|
|
266
|
+
E.geoJson || (N.value = Ge(t), M.value = "ac-world");
|
|
217
267
|
}
|
|
218
|
-
let
|
|
268
|
+
let Xe = c(() => {
|
|
219
269
|
let e = /* @__PURE__ */ new Map();
|
|
220
|
-
for (let t of
|
|
270
|
+
for (let t of E.points) e.set(F(t), (e.get(F(t)) ?? 0) + 1);
|
|
221
271
|
let t = [...e.keys()];
|
|
222
|
-
return t.sort((e, t) =>
|
|
272
|
+
return t.sort((e, t) => D.indexOf(I(e)) - D.indexOf(I(t))), t.map((t) => ({
|
|
223
273
|
key: t,
|
|
224
|
-
label:
|
|
225
|
-
color:
|
|
274
|
+
label: L(t),
|
|
275
|
+
color: ze(t),
|
|
226
276
|
count: e.get(t)
|
|
227
277
|
}));
|
|
228
|
-
}),
|
|
278
|
+
}), Ze = c(() => Xe.value.map((e) => ({
|
|
229
279
|
key: e.key,
|
|
230
280
|
name: e.label,
|
|
231
281
|
color: e.color,
|
|
232
|
-
value:
|
|
233
|
-
}))),
|
|
282
|
+
value: E.legendValues ? String(e.count) : void 0
|
|
283
|
+
}))), q = c(() => E.fitToPoints || !k.value ? E.height : Math.min(E.height, Math.round(k.value / Ce))), J = c(() => E.points.some((e) => e.status)), Y = c(() => E.points.some((e) => e.description) || E.areas.some((e) => e.description)), X = c(() => E.points.some((e) => typeof e.value == "number")), Qe = c(() => ({
|
|
234
284
|
columns: [
|
|
235
285
|
"Name",
|
|
236
|
-
...
|
|
237
|
-
...
|
|
238
|
-
...
|
|
239
|
-
"Coordinates"
|
|
286
|
+
...J.value ? ["Status"] : [],
|
|
287
|
+
...Y.value ? ["Details"] : [],
|
|
288
|
+
...X.value ? [E.valueLabel] : [],
|
|
289
|
+
"Coordinates",
|
|
290
|
+
...E.areas.length ? ["Radius"] : []
|
|
240
291
|
],
|
|
241
|
-
rows:
|
|
292
|
+
rows: [...E.areas.map((e) => [
|
|
242
293
|
e.label,
|
|
243
|
-
...
|
|
244
|
-
...
|
|
245
|
-
...
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
294
|
+
...J.value ? ["–"] : [],
|
|
295
|
+
...Y.value ? [e.description ?? ""] : [],
|
|
296
|
+
...X.value ? ["–"] : [],
|
|
297
|
+
z(e),
|
|
298
|
+
`${Math.round(e.radius).toLocaleString()} km`
|
|
299
|
+
]), ...E.points.map((e) => [
|
|
300
|
+
e.label,
|
|
301
|
+
...J.value ? [L(F(e))] : [],
|
|
302
|
+
...Y.value ? [e.description ?? ""] : [],
|
|
303
|
+
...X.value ? [typeof e.value == "number" ? R(e.value) : "–"] : [],
|
|
304
|
+
z(e),
|
|
305
|
+
...E.areas.length ? ["–"] : []
|
|
306
|
+
])]
|
|
307
|
+
})), $e = c(() => {
|
|
308
|
+
let e = Xe.value.map((e) => `${e.count} ${Ue(e.label)}`).join(", "), t = E.areas.length ? ` in ${E.areas.length} ${E.areasLabel}` : "", n = `World map, ${E.points.length} ${E.pointsLabel}${t}${J.value ? `: ${e}` : ""}.`;
|
|
309
|
+
return [E.title, E.description || n].filter(Boolean).join(". ");
|
|
310
|
+
}), Z = c(() => {
|
|
311
|
+
let e = N.value;
|
|
253
312
|
if (!e) return {
|
|
254
|
-
zoom:
|
|
313
|
+
zoom: B(1),
|
|
255
314
|
center: void 0
|
|
256
315
|
};
|
|
257
316
|
let t = {
|
|
258
|
-
zoom:
|
|
317
|
+
zoom: B(1),
|
|
259
318
|
center: [(e[0] + e[2]) / 2, (e[1] + e[3]) / 2]
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
319
|
+
}, n = [...E.points.map((e) => [
|
|
320
|
+
e.longitude,
|
|
321
|
+
e.longitude,
|
|
322
|
+
e.latitude,
|
|
323
|
+
e.latitude
|
|
324
|
+
]), ...E.areas.map(G)];
|
|
325
|
+
return !E.fitToPoints || !n.length || !k.value ? t : K([
|
|
326
|
+
Math.min(...n.map((e) => e[0])),
|
|
327
|
+
Math.max(...n.map((e) => e[1])),
|
|
328
|
+
Math.min(...n.map((e) => e[2])),
|
|
329
|
+
Math.max(...n.map((e) => e[3]))
|
|
330
|
+
]);
|
|
272
331
|
});
|
|
273
|
-
function
|
|
274
|
-
let n =
|
|
332
|
+
function et(e, t) {
|
|
333
|
+
let n = Be(t), r = V(t.id);
|
|
275
334
|
return {
|
|
276
335
|
name: t.label,
|
|
277
336
|
value: [t.longitude, t.latitude],
|
|
278
|
-
point:
|
|
279
|
-
symbolSize:
|
|
280
|
-
itemStyle:
|
|
337
|
+
point: E.points.indexOf(t),
|
|
338
|
+
symbolSize: Ve(t) + (r ? De : 0),
|
|
339
|
+
itemStyle: r ? {
|
|
340
|
+
color: e.color(n),
|
|
341
|
+
borderColor: e.heading,
|
|
342
|
+
borderWidth: 2
|
|
343
|
+
} : { color: e.color(n) },
|
|
281
344
|
emphasis: { itemStyle: {
|
|
282
345
|
shadowBlur: 10,
|
|
283
346
|
shadowColor: e.alpha(n, .6)
|
|
284
347
|
} }
|
|
285
348
|
};
|
|
286
349
|
}
|
|
287
|
-
function
|
|
288
|
-
|
|
289
|
-
|
|
350
|
+
function tt(e, t) {
|
|
351
|
+
return [...t.filter((e) => !V(e.id)), ...t.filter((e) => V(e.id))].map((t) => et(e, t));
|
|
352
|
+
}
|
|
353
|
+
function Q(e, t) {
|
|
354
|
+
return E.areas.map((n, r) => {
|
|
355
|
+
let i = H(n), a = V(n.id);
|
|
356
|
+
return {
|
|
357
|
+
name: n.label,
|
|
358
|
+
value: [n.longitude, n.latitude],
|
|
359
|
+
area: r,
|
|
360
|
+
symbolSize: We(n, t),
|
|
361
|
+
itemStyle: {
|
|
362
|
+
color: e.alpha(i, a ? .16 : .07),
|
|
363
|
+
borderColor: e.alpha(i, a ? 1 : .45),
|
|
364
|
+
borderWidth: a ? 2 : 1.5
|
|
365
|
+
},
|
|
366
|
+
emphasis: { itemStyle: {
|
|
367
|
+
color: e.alpha(i, .16),
|
|
368
|
+
borderColor: e.alpha(i, a ? 1 : .75),
|
|
369
|
+
borderWidth: 2
|
|
370
|
+
} }
|
|
371
|
+
};
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
function nt(e, t) {
|
|
375
|
+
let n = {
|
|
376
|
+
fontFamily: e.font,
|
|
377
|
+
textBorderColor: e.surface,
|
|
378
|
+
textBorderWidth: 2
|
|
379
|
+
};
|
|
380
|
+
return {
|
|
381
|
+
id: "areas",
|
|
382
|
+
type: "scatter",
|
|
290
383
|
coordinateSystem: "geo",
|
|
291
384
|
symbol: "circle",
|
|
292
|
-
|
|
385
|
+
z: 1,
|
|
386
|
+
cursor: Ie ? "pointer" : "default",
|
|
387
|
+
animationDurationUpdate: 0,
|
|
388
|
+
emphasis: { scale: !1 },
|
|
389
|
+
data: Q(e, t),
|
|
390
|
+
label: {
|
|
391
|
+
show: E.areaLabels,
|
|
392
|
+
position: "bottom",
|
|
393
|
+
distance: 4,
|
|
394
|
+
align: "center",
|
|
395
|
+
formatter: (e) => {
|
|
396
|
+
let t = E.areas[e.data.area ?? -1];
|
|
397
|
+
return t ? t.description ? `{name|${U(t.label)}}\n{note|${U(t.description)}}` : `{name|${U(t.label)}}` : "";
|
|
398
|
+
},
|
|
399
|
+
rich: {
|
|
400
|
+
name: {
|
|
401
|
+
...n,
|
|
402
|
+
color: e.heading,
|
|
403
|
+
fontSize: 11,
|
|
404
|
+
fontWeight: 500,
|
|
405
|
+
lineHeight: 15
|
|
406
|
+
},
|
|
407
|
+
note: {
|
|
408
|
+
...n,
|
|
409
|
+
color: e.muted,
|
|
410
|
+
fontSize: 10,
|
|
411
|
+
lineHeight: 13
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
labelLayout: { hideOverlap: !0 }
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
function rt(e) {
|
|
419
|
+
if (!M.value) return {};
|
|
420
|
+
let t = P ?? Z.value, n = E.animation && !e.reducedMotion, r = E.points.filter((e) => !O.value.includes(F(e))), i = e.reducedMotion ? [] : r.filter(He), a = r.filter((e) => !i.includes(e)), o = {
|
|
421
|
+
coordinateSystem: "geo",
|
|
422
|
+
symbol: "circle",
|
|
423
|
+
cursor: Fe ? "pointer" : "default",
|
|
424
|
+
animationDurationUpdate: 0,
|
|
293
425
|
itemStyle: {
|
|
294
426
|
borderColor: e.surface,
|
|
295
427
|
borderWidth: 1.5
|
|
296
428
|
},
|
|
297
429
|
emphasis: { scale: 1.4 },
|
|
298
430
|
label: {
|
|
299
|
-
show:
|
|
431
|
+
show: E.labels,
|
|
300
432
|
position: "bottom",
|
|
301
433
|
distance: 4,
|
|
302
434
|
formatter: "{b}",
|
|
@@ -311,20 +443,20 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
|
|
|
311
443
|
return {
|
|
312
444
|
animation: n,
|
|
313
445
|
geo: {
|
|
314
|
-
map:
|
|
315
|
-
roam:
|
|
446
|
+
map: M.value,
|
|
447
|
+
roam: E.zoom,
|
|
316
448
|
silent: !0,
|
|
317
449
|
zoom: t.zoom,
|
|
318
450
|
center: t.center,
|
|
319
451
|
scaleLimit: {
|
|
320
|
-
min:
|
|
321
|
-
max:
|
|
452
|
+
min: E.zoomExtent[0],
|
|
453
|
+
max: E.zoomExtent[1]
|
|
322
454
|
},
|
|
323
|
-
aspectScale:
|
|
324
|
-
left:
|
|
325
|
-
right:
|
|
326
|
-
top:
|
|
327
|
-
bottom:
|
|
455
|
+
aspectScale: w,
|
|
456
|
+
left: T,
|
|
457
|
+
right: T,
|
|
458
|
+
top: T,
|
|
459
|
+
bottom: T,
|
|
328
460
|
preserveAspect: "contain",
|
|
329
461
|
label: { show: !1 },
|
|
330
462
|
itemStyle: {
|
|
@@ -335,64 +467,92 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
|
|
|
335
467
|
emphasis: { disabled: !0 },
|
|
336
468
|
select: { disabled: !0 }
|
|
337
469
|
},
|
|
338
|
-
series: [
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
470
|
+
series: [
|
|
471
|
+
nt(e, t.zoom),
|
|
472
|
+
{
|
|
473
|
+
...o,
|
|
474
|
+
id: "still",
|
|
475
|
+
type: "scatter",
|
|
476
|
+
data: tt(e, a)
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
...o,
|
|
480
|
+
id: "pulsing",
|
|
481
|
+
type: "effectScatter",
|
|
482
|
+
data: tt(e, i),
|
|
483
|
+
showEffectOn: "render",
|
|
484
|
+
rippleEffect: {
|
|
485
|
+
brushType: "stroke",
|
|
486
|
+
scale: 3,
|
|
487
|
+
period: 2.5
|
|
488
|
+
}
|
|
353
489
|
}
|
|
354
|
-
|
|
490
|
+
]
|
|
355
491
|
};
|
|
356
492
|
}
|
|
357
|
-
function
|
|
358
|
-
|
|
359
|
-
if (
|
|
360
|
-
let
|
|
361
|
-
|
|
493
|
+
function it(e, t, n) {
|
|
494
|
+
if (!E.tooltip || !e) return;
|
|
495
|
+
if (e.area !== void 0) return at(e.area, t, n);
|
|
496
|
+
let r = E.points[e.point ?? -1];
|
|
497
|
+
if (!r) return;
|
|
498
|
+
let i = F(r), a = typeof r.value == "number" ? r.value : null;
|
|
499
|
+
j.value = "point", A.value = {
|
|
362
500
|
clientX: t,
|
|
363
501
|
clientY: n,
|
|
364
502
|
title: r.label,
|
|
365
503
|
items: [{
|
|
366
504
|
key: i,
|
|
367
|
-
name:
|
|
368
|
-
color:
|
|
505
|
+
name: L(i),
|
|
506
|
+
color: Be(r),
|
|
369
507
|
value: a,
|
|
370
|
-
formatted: a === null ? "" :
|
|
508
|
+
formatted: a === null ? "" : R(a)
|
|
371
509
|
}],
|
|
372
510
|
datum: r,
|
|
373
511
|
index: e.point
|
|
374
512
|
};
|
|
375
513
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
514
|
+
function at(e, t, n) {
|
|
515
|
+
let r = E.areas[e];
|
|
516
|
+
r && (j.value = "area", A.value = {
|
|
517
|
+
clientX: t,
|
|
518
|
+
clientY: n,
|
|
519
|
+
title: r.label,
|
|
520
|
+
items: [{
|
|
521
|
+
key: r.id,
|
|
522
|
+
name: r.label,
|
|
523
|
+
color: H(r),
|
|
524
|
+
value: null,
|
|
525
|
+
formatted: ""
|
|
526
|
+
}],
|
|
527
|
+
datum: r,
|
|
528
|
+
index: e
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
let { chart: ot, theme: $ } = a({
|
|
532
|
+
host: Le,
|
|
533
|
+
renderer: () => E.renderer,
|
|
534
|
+
prepare: Ye,
|
|
535
|
+
option: rt,
|
|
381
536
|
setup: (e) => {
|
|
382
|
-
r(e, (e) =>
|
|
383
|
-
let t =
|
|
384
|
-
|
|
537
|
+
r(e, (e) => it(e.data, e.clientX, e.clientY), () => A.value = null), e.on("click", (e) => {
|
|
538
|
+
let t = e.data, n = E.areas[t?.area ?? -1];
|
|
539
|
+
if (n) return Ae("area-click", n);
|
|
540
|
+
let r = E.points[t?.point ?? -1];
|
|
541
|
+
r && Ae("point-click", r);
|
|
385
542
|
}), e.on("georoam", () => {
|
|
386
543
|
let t = e.getOption().geo?.[0];
|
|
387
|
-
t?.zoom !== void 0 && t.center && (
|
|
544
|
+
t?.zoom !== void 0 && t.center && (P = {
|
|
388
545
|
zoom: t.zoom,
|
|
389
546
|
center: [...t.center]
|
|
390
|
-
}
|
|
547
|
+
}, E.areas.length && $.value && e.setOption({ series: [{
|
|
548
|
+
id: "areas",
|
|
549
|
+
data: Q($.value, t.zoom)
|
|
550
|
+
}] }));
|
|
391
551
|
});
|
|
392
552
|
}
|
|
393
553
|
});
|
|
394
|
-
function
|
|
395
|
-
let t =
|
|
554
|
+
function st(e) {
|
|
555
|
+
let t = ot.value;
|
|
396
556
|
t && t.dispatchAction({
|
|
397
557
|
type: "geoRoam",
|
|
398
558
|
geoIndex: 0,
|
|
@@ -401,96 +561,138 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
|
|
|
401
561
|
originY: t.getHeight() / 2
|
|
402
562
|
});
|
|
403
563
|
}
|
|
404
|
-
function
|
|
405
|
-
|
|
406
|
-
}
|
|
407
|
-
function
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
function
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
}] }
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
564
|
+
function ct() {
|
|
565
|
+
st(C);
|
|
566
|
+
}
|
|
567
|
+
function lt() {
|
|
568
|
+
st(1 / C);
|
|
569
|
+
}
|
|
570
|
+
function ut(e) {
|
|
571
|
+
let t = ot.value;
|
|
572
|
+
if (!t) return;
|
|
573
|
+
let n = $.value ? { series: [{
|
|
574
|
+
id: "areas",
|
|
575
|
+
data: Q($.value, e.zoom)
|
|
576
|
+
}] } : {};
|
|
577
|
+
t.setOption({
|
|
578
|
+
geo: [{
|
|
579
|
+
zoom: e.zoom,
|
|
580
|
+
center: e.center
|
|
581
|
+
}],
|
|
582
|
+
...n
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
function dt(e) {
|
|
586
|
+
let t = ft(e);
|
|
587
|
+
t && (P = t, ut(t));
|
|
588
|
+
}
|
|
589
|
+
function ft(e) {
|
|
590
|
+
if (!e) return;
|
|
591
|
+
if (typeof e != "string") return {
|
|
592
|
+
zoom: B(e.zoom ?? P?.zoom ?? Z.value.zoom),
|
|
593
|
+
center: [e.longitude, e.latitude]
|
|
594
|
+
};
|
|
595
|
+
let t = E.areas.find((t) => t.id === e);
|
|
596
|
+
if (t) return K(G(t));
|
|
597
|
+
let n = E.points.find((t) => t.id === e);
|
|
598
|
+
if (n) return K([
|
|
599
|
+
n.longitude,
|
|
600
|
+
n.longitude,
|
|
601
|
+
n.latitude,
|
|
602
|
+
n.latitude
|
|
603
|
+
]);
|
|
604
|
+
}
|
|
605
|
+
function pt() {
|
|
606
|
+
P = null, ut(Z.value);
|
|
607
|
+
}
|
|
608
|
+
return b(() => E.geoJson, () => void Ye()), b([() => E.zoom, () => E.fitToPoints], () => P = null), Oe({
|
|
609
|
+
focus: dt,
|
|
610
|
+
resetView: pt,
|
|
611
|
+
zoomIn: ct,
|
|
612
|
+
zoomOut: lt
|
|
613
|
+
}), (t, r) => (g(), ee(n, {
|
|
614
|
+
hidden: O.value,
|
|
615
|
+
"onUpdate:hidden": r[0] ||= (e) => O.value = e,
|
|
616
|
+
width: k.value,
|
|
617
|
+
"onUpdate:width": r[1] ||= (e) => k.value = e,
|
|
423
618
|
testid: "ac-map-chart",
|
|
424
|
-
height:
|
|
425
|
-
loading:
|
|
426
|
-
empty: !
|
|
427
|
-
"empty-text":
|
|
428
|
-
"empty-icon":
|
|
429
|
-
legend:
|
|
430
|
-
"legend-items":
|
|
431
|
-
summary:
|
|
432
|
-
title:
|
|
433
|
-
description:
|
|
434
|
-
table:
|
|
435
|
-
tip:
|
|
436
|
-
tooltip:
|
|
437
|
-
},
|
|
438
|
-
tooltip:
|
|
619
|
+
height: q.value,
|
|
620
|
+
loading: m.loading,
|
|
621
|
+
empty: !m.points.length && !m.areas.length,
|
|
622
|
+
"empty-text": m.emptyText,
|
|
623
|
+
"empty-icon": y(oe),
|
|
624
|
+
legend: m.legend,
|
|
625
|
+
"legend-items": Ze.value,
|
|
626
|
+
summary: $e.value,
|
|
627
|
+
title: m.title,
|
|
628
|
+
description: m.description,
|
|
629
|
+
table: Qe.value,
|
|
630
|
+
tip: A.value,
|
|
631
|
+
tooltip: m.tooltip
|
|
632
|
+
}, te({
|
|
633
|
+
tooltip: x(({ datum: e, items: n }) => [j.value === "area" ? re(t.$slots, "area-tooltip", {
|
|
634
|
+
area: e,
|
|
635
|
+
color: n[0]?.color ?? ""
|
|
636
|
+
}, () => [d("p", ge, [d("span", {
|
|
637
|
+
class: "size-2 shrink-0 rounded-full",
|
|
638
|
+
style: h({ backgroundColor: n[0]?.color }),
|
|
639
|
+
"aria-hidden": "true"
|
|
640
|
+
}, null, 4), f(" " + v(e.label), 1)]), e.description ? (g(), u("p", _e, v(e.description), 1)) : l("", !0)], void 0, 0) : re(t.$slots, "tooltip", {
|
|
439
641
|
point: e,
|
|
440
642
|
statusLabel: n[0]?.name ?? "",
|
|
441
643
|
color: n[0]?.color ?? "",
|
|
442
644
|
formattedValue: n[0]?.formatted ?? ""
|
|
443
645
|
}, () => [
|
|
444
|
-
|
|
445
|
-
e.description ? (
|
|
446
|
-
e.status && n[0] ? (
|
|
646
|
+
d("p", ve, v(e.label), 1),
|
|
647
|
+
e.description ? (g(), u("p", ye, v(e.description), 1)) : l("", !0),
|
|
648
|
+
e.status && n[0] ? (g(), u("p", {
|
|
447
649
|
key: 1,
|
|
448
650
|
class: "mt-2 inline-flex h-5 items-center gap-1.5 rounded-full px-2 font-medium text-heading",
|
|
449
|
-
style:
|
|
450
|
-
}, [
|
|
651
|
+
style: h({ backgroundColor: `color-mix(in srgb, ${n[0].color} 14%, transparent)` })
|
|
652
|
+
}, [d("span", {
|
|
451
653
|
class: "size-1.5 shrink-0 rounded-full",
|
|
452
|
-
style:
|
|
654
|
+
style: h({ backgroundColor: n[0].color }),
|
|
453
655
|
"aria-hidden": "true"
|
|
454
|
-
}, null, 4),
|
|
455
|
-
n[0]?.formatted ? (
|
|
456
|
-
])]),
|
|
457
|
-
default:
|
|
656
|
+
}, null, 4), f(" " + v(n[0].name), 1)], 4)) : l("", !0),
|
|
657
|
+
n[0]?.formatted ? (g(), u("p", be, [d("span", xe, v(m.valueLabel), 1), d("span", Se, v(n[0].formatted), 1)])) : l("", !0)
|
|
658
|
+
], void 0, 1)]),
|
|
659
|
+
default: x(() => [d("div", {
|
|
458
660
|
ref_key: "host",
|
|
459
|
-
ref:
|
|
661
|
+
ref: Le,
|
|
460
662
|
class: "size-full"
|
|
461
663
|
}, null, 512)]),
|
|
462
664
|
_: 2
|
|
463
|
-
}, [
|
|
665
|
+
}, [m.zoom ? {
|
|
464
666
|
name: "controls",
|
|
465
|
-
fn:
|
|
466
|
-
|
|
667
|
+
fn: x(() => [d("div", he, [
|
|
668
|
+
p(e, {
|
|
467
669
|
color: "white",
|
|
468
670
|
size: "xs",
|
|
469
671
|
"icon-only": "",
|
|
470
672
|
title: "Zoom in",
|
|
471
|
-
onClick:
|
|
673
|
+
onClick: ct
|
|
472
674
|
}, {
|
|
473
|
-
icon:
|
|
675
|
+
icon: x(() => [p(y(ce), { "aria-hidden": "true" })]),
|
|
474
676
|
_: 1
|
|
475
677
|
}),
|
|
476
|
-
|
|
678
|
+
p(e, {
|
|
477
679
|
color: "white",
|
|
478
680
|
size: "xs",
|
|
479
681
|
"icon-only": "",
|
|
480
682
|
title: "Zoom out",
|
|
481
|
-
onClick:
|
|
683
|
+
onClick: lt
|
|
482
684
|
}, {
|
|
483
|
-
icon:
|
|
685
|
+
icon: x(() => [p(y(se), { "aria-hidden": "true" })]),
|
|
484
686
|
_: 1
|
|
485
687
|
}),
|
|
486
|
-
|
|
688
|
+
p(e, {
|
|
487
689
|
color: "white",
|
|
488
690
|
size: "xs",
|
|
489
691
|
"icon-only": "",
|
|
490
692
|
title: "Reset view",
|
|
491
|
-
onClick:
|
|
693
|
+
onClick: pt
|
|
492
694
|
}, {
|
|
493
|
-
icon:
|
|
695
|
+
icon: x(() => [p(y(le), { "aria-hidden": "true" })]),
|
|
494
696
|
_: 1
|
|
495
697
|
})
|
|
496
698
|
])]),
|
|
@@ -515,4 +717,4 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
|
|
|
515
717
|
}
|
|
516
718
|
});
|
|
517
719
|
//#endregion
|
|
518
|
-
export {
|
|
720
|
+
export { Oe as default };
|