@opengis/bi 1.1.1 → 1.1.2
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/config.js +12 -12
- package/dist/bi.js +1 -1
- package/dist/bi.umd.cjs +104 -104
- package/dist/{import-file-ZfIxjCYO.js → import-file-XFI3CaVb.js} +10185 -10409
- package/dist/vs-donut-al85JwBt.js +148 -0
- package/dist/{vs-funnel-bar-BNzjr6Wy.js → vs-funnel-bar-mWZ8lvEq.js} +5 -5
- package/dist/{vs-list-B2mp3dCt.js → vs-list-1QDnN3pH.js} +1532 -1535
- package/dist/{vs-map-C_48NvNE.js → vs-map-CwR6ZYur.js} +110 -119
- package/dist/{vs-map-cluster-Xj2mZ5dv.js → vs-map-cluster-YdXTBIVf.js} +71 -72
- package/dist/{vs-number-CA07snAP.js → vs-number-CRUhHKym.js} +3 -3
- package/dist/{vs-table-CDujqyoC.js → vs-table-OddIdr1s.js} +6 -6
- package/dist/{vs-text-BlAqTDjw.js → vs-text-CQ9vn0qO.js} +4 -4
- package/package.json +7 -12
- package/server/plugins/vite.js +69 -69
- package/server/routes/dashboard/controllers/utils/yaml.js +11 -11
- package/server/routes/dataset/controllers/createDatasetPost.js +1 -2
- package/server/routes/dataset/utils/convertJSONToXls.js +1 -3
- package/server/routes/map/controllers/cluster.js +125 -125
- package/server/routes/map/controllers/clusterVtile.js +166 -166
- package/server/routes/map/controllers/geojson.js +127 -127
- package/server/routes/map/controllers/map.js +69 -69
- package/server/routes/map/controllers/utils/downloadClusterData.js +44 -44
- package/server/routes/map/controllers/vtile.js +183 -183
- package/utils.js +12 -12
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as C, c as P } from "./import-file-
|
|
3
|
-
import { resolveComponent as u,
|
|
1
|
+
import { c as L, l as $, p as T, V as B, a as H, b as O, d as F, m as S, e as N } from "./vs-list-1QDnN3pH.js";
|
|
2
|
+
import { _ as C, c as P } from "./import-file-XFI3CaVb.js";
|
|
3
|
+
import { resolveComponent as u, createElementBlock as p, openBlock as i, Fragment as v, createElementVNode as r, createBlock as E, createCommentVNode as m, createVNode as f, Teleport as R, toDisplayString as b, renderList as k, normalizeStyle as I, normalizeClass as V } from "vue";
|
|
4
4
|
const A = {
|
|
5
|
-
components: { legendIcon:
|
|
5
|
+
components: { legendIcon: $, closeIcon: L },
|
|
6
6
|
props: {
|
|
7
7
|
mapId: { type: String },
|
|
8
8
|
colors: { type: Array },
|
|
@@ -26,11 +26,11 @@ const A = {
|
|
|
26
26
|
return this.cluster ? "rounded-sm" : "rounded-full";
|
|
27
27
|
},
|
|
28
28
|
sortedSizes() {
|
|
29
|
-
return [...this.sizes].sort((e,
|
|
29
|
+
return [...this.sizes].sort((e, t) => e - t);
|
|
30
30
|
},
|
|
31
31
|
maxWidht() {
|
|
32
|
-
var
|
|
33
|
-
const e = ((
|
|
32
|
+
var s;
|
|
33
|
+
const e = ((s = this.sizes) == null ? void 0 : s.length) - 1;
|
|
34
34
|
return this.calcSize(e);
|
|
35
35
|
}
|
|
36
36
|
},
|
|
@@ -45,81 +45,81 @@ const A = {
|
|
|
45
45
|
return (e + 1) / this.sortedSizes.length;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
}, G = { class: "w-full absolute max-w-[200px] bg-white border rounded-lg bottom-[10px] right-[50px]" }, W = { class: "flex items-center justify-between border-b border-[#0000001A] px-2" }, Z = { class: "w-full flex flex-col gap-[8px] px-2 py-2 max-h-[200px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent" },
|
|
48
|
+
}, G = { class: "w-full absolute max-w-[200px] bg-white border rounded-lg bottom-[10px] right-[50px]" }, W = { class: "flex items-center justify-between border-b border-[#0000001A] px-2" }, Z = { class: "w-full flex flex-col gap-[8px] px-2 py-2 max-h-[200px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent" }, q = {
|
|
49
49
|
key: 0,
|
|
50
50
|
class: "flex flex-col w-full"
|
|
51
|
-
},
|
|
51
|
+
}, j = {
|
|
52
52
|
key: 0,
|
|
53
53
|
class: "text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"
|
|
54
|
-
},
|
|
54
|
+
}, J = { class: "flex flex-col gap-[6px]" }, K = { class: "text-xs text-[#1F2937] font-normal leading-[1.2]" }, Q = {
|
|
55
55
|
key: 1,
|
|
56
56
|
class: "flex flex-col w-full"
|
|
57
|
-
},
|
|
57
|
+
}, U = {
|
|
58
58
|
key: 0,
|
|
59
59
|
class: "text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"
|
|
60
|
-
},
|
|
61
|
-
function ee(e,
|
|
62
|
-
var
|
|
60
|
+
}, X = { class: "flex flex-col gap-[6px]" }, Y = { class: "flex flex-row items-center justify-start" }, D = { class: "text-xs text-[#1F2937] font-normal leading-[1.2]" };
|
|
61
|
+
function ee(e, t, s, o, l, a) {
|
|
62
|
+
var x, y;
|
|
63
63
|
const n = u("legendIcon"), h = u("closeIcon");
|
|
64
|
-
return i(),
|
|
65
|
-
|
|
64
|
+
return i(), p(v, null, [
|
|
65
|
+
r("div", {
|
|
66
66
|
class: "flex justify-center items-center rounded-md w-[32px] h-[32px] cursor-pointer bg-white p-1 border-[2px]",
|
|
67
|
-
onClick:
|
|
67
|
+
onClick: t[0] || (t[0] = (d) => l.isOpenLegend = !l.isOpenLegend)
|
|
68
68
|
}, [
|
|
69
|
-
|
|
69
|
+
f(n)
|
|
70
70
|
]),
|
|
71
|
-
|
|
71
|
+
l.isOpenLegend ? (i(), E(R, {
|
|
72
72
|
key: 0,
|
|
73
|
-
to: `#wrapper-${
|
|
73
|
+
to: `#wrapper-${s.mapId}`
|
|
74
74
|
}, [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
r("div", G, [
|
|
76
|
+
r("div", W, [
|
|
77
|
+
t[2] || (t[2] = r("h3", { class: "text-[16px] font-normal text-black" }, "Легенда", -1)),
|
|
78
|
+
r("button", {
|
|
79
79
|
type: "button",
|
|
80
80
|
class: "inline-flex items-center text-sm font-medium text-gray-500 rounded-lg gap-x-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 dark:hover:text-blue-500 dark:focus:text-blue-500",
|
|
81
|
-
onClick:
|
|
81
|
+
onClick: t[1] || (t[1] = (d) => l.isOpenLegend = !1)
|
|
82
82
|
}, [
|
|
83
|
-
|
|
83
|
+
f(h, { class: "w-[20px]" })
|
|
84
84
|
])
|
|
85
85
|
]),
|
|
86
|
-
|
|
87
|
-
(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
(i(!0),
|
|
91
|
-
key:
|
|
86
|
+
r("div", Z, [
|
|
87
|
+
(x = s.colors) != null && x.length ? (i(), p("div", q, [
|
|
88
|
+
s.colorTitle ? (i(), p("h4", j, b(s.colorTitle), 1)) : m("", !0),
|
|
89
|
+
r("div", J, [
|
|
90
|
+
(i(!0), p(v, null, k(s.colors, (d, c) => (i(), p("div", {
|
|
91
|
+
key: c,
|
|
92
92
|
class: "flex items-center gap-[10px]"
|
|
93
93
|
}, [
|
|
94
|
-
d.color ? (i(),
|
|
94
|
+
d.color ? (i(), p("div", {
|
|
95
95
|
key: 0,
|
|
96
96
|
class: "w-[12px] h-[12px] rounded-full",
|
|
97
97
|
style: I({
|
|
98
98
|
backgroundColor: d.color
|
|
99
99
|
})
|
|
100
100
|
}, null, 4)) : m("", !0),
|
|
101
|
-
|
|
101
|
+
r("p", K, b(d.text || d.val), 1)
|
|
102
102
|
]))), 128))
|
|
103
103
|
])
|
|
104
104
|
])) : m("", !0),
|
|
105
|
-
(
|
|
106
|
-
e.sizeTitle ? (i(),
|
|
107
|
-
|
|
108
|
-
a.sortedSizes.length ? (i(!0),
|
|
109
|
-
var g,
|
|
110
|
-
return i(),
|
|
111
|
-
|
|
112
|
-
|
|
105
|
+
(y = s.sizes) != null && y.length ? (i(), p("div", Q, [
|
|
106
|
+
e.sizeTitle ? (i(), p("h4", U, b(e.sizeTitle), 1)) : m("", !0),
|
|
107
|
+
r("div", X, [
|
|
108
|
+
a.sortedSizes.length ? (i(!0), p(v, { key: 0 }, k(a.sortedSizes, (d, c) => {
|
|
109
|
+
var g, w, z, _, M;
|
|
110
|
+
return i(), p("div", null, [
|
|
111
|
+
r("div", Y, [
|
|
112
|
+
r("div", {
|
|
113
113
|
class: V([a.maxWidht ? `w-[${a.maxWidht}]` : "", "mr-[10px]"])
|
|
114
114
|
}, [
|
|
115
|
-
|
|
116
|
-
class: V(a.sizeClass(
|
|
115
|
+
r("div", {
|
|
116
|
+
class: V(a.sizeClass(c)),
|
|
117
117
|
style: I({
|
|
118
|
-
backgroundColor: ((
|
|
118
|
+
backgroundColor: ((w = (g = l.palette) == null ? void 0 : g[s.color]) == null ? void 0 : w[c]) || s.color
|
|
119
119
|
})
|
|
120
120
|
}, null, 6)
|
|
121
121
|
], 2),
|
|
122
|
-
|
|
122
|
+
r("p", D, b(c === ((z = a.sortedSizes) == null ? void 0 : z.length) - 1 ? ">" + d : c == ((_ = a.sortedSizes) == null ? void 0 : _.length) - 1 ? ">" + a.sortedSizes[((M = a.sortedSizes) == null ? void 0 : M.length) - 1] : d + "-" + a.sortedSizes[c + 1]), 1)
|
|
123
123
|
])
|
|
124
124
|
]);
|
|
125
125
|
}), 256)) : m("", !0)
|
|
@@ -132,11 +132,11 @@ function ee(e, o, t, s, r, a) {
|
|
|
132
132
|
}
|
|
133
133
|
const te = /* @__PURE__ */ C(A, [["render", ee]]), se = {
|
|
134
134
|
components: {
|
|
135
|
-
VsMapSetting:
|
|
136
|
-
VsMapSlotLayers:
|
|
135
|
+
VsMapSetting: F,
|
|
136
|
+
VsMapSlotLayers: O,
|
|
137
137
|
VsMapLegend: te,
|
|
138
|
-
VsMapGoHome:
|
|
139
|
-
VsList:
|
|
138
|
+
VsMapGoHome: H,
|
|
139
|
+
VsList: B
|
|
140
140
|
},
|
|
141
141
|
data() {
|
|
142
142
|
return {
|
|
@@ -153,7 +153,6 @@ const te = /* @__PURE__ */ C(A, [["render", ee]]), se = {
|
|
|
153
153
|
},
|
|
154
154
|
methods: {
|
|
155
155
|
async createMap() {
|
|
156
|
-
var o, t;
|
|
157
156
|
const e = {
|
|
158
157
|
version: 8,
|
|
159
158
|
glyphs: "https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",
|
|
@@ -164,7 +163,7 @@ const te = /* @__PURE__ */ C(A, [["render", ee]]), se = {
|
|
|
164
163
|
container: this.mapId,
|
|
165
164
|
style: e,
|
|
166
165
|
center: [31, 48.5],
|
|
167
|
-
zoom:
|
|
166
|
+
zoom: 5,
|
|
168
167
|
minZoom: 3,
|
|
169
168
|
maxZoom: 20,
|
|
170
169
|
attributionControl: !1
|
|
@@ -174,39 +173,39 @@ const te = /* @__PURE__ */ C(A, [["render", ee]]), se = {
|
|
|
174
173
|
})
|
|
175
174
|
), this.map.on("load", () => {
|
|
176
175
|
this.loadHandler();
|
|
177
|
-
}), this.map.on("mousemove", (
|
|
178
|
-
this.moveMouseHadler(
|
|
176
|
+
}), this.map.on("mousemove", (t) => {
|
|
177
|
+
this.moveMouseHadler(t);
|
|
179
178
|
}), this.map.on("mouseout", () => {
|
|
180
|
-
var
|
|
181
|
-
this.showLegend = !1, this.showSetting = !1, this.coordinatesByMouse = 0, (
|
|
179
|
+
var t;
|
|
180
|
+
this.showLegend = !1, this.showSetting = !1, this.coordinatesByMouse = 0, (t = this.popup) == null || t.remove();
|
|
182
181
|
});
|
|
183
182
|
},
|
|
184
183
|
getPopoverTitle(e) {
|
|
185
|
-
var
|
|
186
|
-
return (
|
|
184
|
+
var t, s, o, l, a;
|
|
185
|
+
return (s = (t = this.data) == null ? void 0 : t.colors) != null && s.find((n) => n.val === e) ? (a = (l = (o = this.data) == null ? void 0 : o.colors) == null ? void 0 : l.find((n) => n.val === e)) == null ? void 0 : a.text : e;
|
|
187
186
|
},
|
|
188
187
|
moveMouseHadler(e) {
|
|
189
|
-
var
|
|
188
|
+
var t;
|
|
190
189
|
try {
|
|
191
|
-
const
|
|
192
|
-
if (!
|
|
190
|
+
const s = this.map.queryRenderedFeatures(e.point), o = ((t = s[0]) == null ? void 0 : t.properties) || {};
|
|
191
|
+
if (!s.length) {
|
|
193
192
|
this.map.getCanvas().style.cursor = "", this.popupElement && this.popupElement.remove();
|
|
194
193
|
return;
|
|
195
194
|
}
|
|
196
195
|
this.map.getCanvas().style.cursor = "pointer", this.popupElement && this.popupElement.remove(), this.popupElement = document.createElement("div"), this.popupElement.className = "absolute text-gray-800 border border-gray-200 rounded-lg shadow-md min-w-28", this.popupElement.style.backgroundColor = "rgba(255, 255, 255, 0.7)", this.popupElement.innerHTML = `<div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 rounded-t-lg px-2 py-1">
|
|
197
|
-
${this.getPopoverTitle((
|
|
196
|
+
${this.getPopoverTitle((o == null ? void 0 : o.x) || (o == null ? void 0 : o.title) || (o == null ? void 0 : o.name)) || ""}
|
|
198
197
|
</div>
|
|
199
198
|
|
|
200
199
|
<div class="flex justify-between items-center text-xs px-2 py-0.5 text-gray-500 ">
|
|
201
200
|
<span class="flex items-center">
|
|
202
201
|
<span class="font-medium mr-[6px]">Значення</span>
|
|
203
202
|
</span>
|
|
204
|
-
<span>${(
|
|
203
|
+
<span>${(o == null ? void 0 : o.metric) || 0}</span>
|
|
205
204
|
</div>`;
|
|
206
|
-
const
|
|
207
|
-
this.popupElement.style.left = `${
|
|
208
|
-
} catch (
|
|
209
|
-
console.error(
|
|
205
|
+
const l = this.map.project(e.lngLat);
|
|
206
|
+
this.popupElement.style.left = `${l.x}px`, this.popupElement.style.top = `${l.y - 60}px`, this.map.getContainer().appendChild(this.popupElement);
|
|
207
|
+
} catch (s) {
|
|
208
|
+
console.error(s);
|
|
210
209
|
}
|
|
211
210
|
}
|
|
212
211
|
}
|
|
@@ -218,77 +217,69 @@ const te = /* @__PURE__ */ C(A, [["render", ee]]), se = {
|
|
|
218
217
|
},
|
|
219
218
|
methods: {
|
|
220
219
|
async getMapData() {
|
|
221
|
-
const
|
|
220
|
+
const t = await (await fetch(
|
|
222
221
|
`/api/bi-map?widget=${this.widget}&dashboard=${this.dashboard}`
|
|
223
222
|
)).json();
|
|
224
|
-
this.data =
|
|
225
|
-
var t;
|
|
226
|
-
return (t = this.map) == null ? void 0 : t.resize();
|
|
227
|
-
});
|
|
223
|
+
this.data = t;
|
|
228
224
|
},
|
|
229
225
|
async loadHandler() {
|
|
230
|
-
const e = ["#69D2E7", "yellow", "#FE4365"],
|
|
226
|
+
const e = ["#69D2E7", "yellow", "#FE4365"], t = this.data.colors ? ["match", ["get", "x"]].concat(
|
|
231
227
|
this.data.colors.reduce(
|
|
232
228
|
(a, n, h) => a.concat(n.val, (n == null ? void 0 : n.color) || e[h]),
|
|
233
229
|
[]
|
|
234
230
|
)
|
|
235
|
-
).concat(["gray"]) : "blue",
|
|
231
|
+
).concat(["gray"]) : "blue", s = [5, 7, 9, 11, 13], o = this.data.sizes ? ["case"] : 5;
|
|
236
232
|
this.data.sizes && (this.data.sizes.reverse().forEach((a, n) => {
|
|
237
|
-
|
|
238
|
-
}),
|
|
239
|
-
const
|
|
233
|
+
o.push([">", ["get", "metric"], a]), o.push(s[n]);
|
|
234
|
+
}), o.push(5));
|
|
235
|
+
const l = {
|
|
240
236
|
type: "circle",
|
|
241
|
-
color:
|
|
237
|
+
color: t,
|
|
242
238
|
width: 2,
|
|
243
|
-
radius:
|
|
239
|
+
radius: o,
|
|
244
240
|
stroke: "#eee"
|
|
245
241
|
};
|
|
246
|
-
Object.assign(
|
|
242
|
+
Object.assign(l, this.data.style || {}), this.addVtileLayer({
|
|
247
243
|
id: "bi",
|
|
248
244
|
url: `${window.top.location.origin}/api/bi-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,
|
|
249
|
-
style:
|
|
245
|
+
style: l
|
|
250
246
|
});
|
|
251
247
|
}
|
|
252
248
|
}
|
|
253
|
-
}, ae =
|
|
254
|
-
function
|
|
255
|
-
var d,
|
|
256
|
-
const n = u("VsMapSetting"), h = u("VsMapSlotLayers"),
|
|
257
|
-
return i(),
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
},
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
249
|
+
}, ae = ["id"], le = ["id"], re = { class: "absolute flex flex-col right-[10px] top-[105px] gap-1" };
|
|
250
|
+
function ne(e, t, s, o, l, a) {
|
|
251
|
+
var d, c, g;
|
|
252
|
+
const n = u("VsMapSetting"), h = u("VsMapSlotLayers"), x = u("VsMapLegend"), y = u("VsMapGoHome");
|
|
253
|
+
return i(), p("div", {
|
|
254
|
+
class: "relative w-full h-full",
|
|
255
|
+
id: `wrapper-${e.mapId}`
|
|
256
|
+
}, [
|
|
257
|
+
r("div", {
|
|
258
|
+
id: e.mapId,
|
|
259
|
+
class: "w-full flex items-end relative h-[250px]"
|
|
260
|
+
}, null, 8, le),
|
|
261
|
+
e.showSetting ? (i(), E(n, {
|
|
262
|
+
key: 0,
|
|
263
|
+
map: e.map,
|
|
264
|
+
coordinates: e.coordinatesByMouse
|
|
265
|
+
}, null, 8, ["map", "coordinates"])) : m("", !0),
|
|
266
|
+
f(h, { map: e.map }, null, 8, ["map"]),
|
|
267
|
+
r("div", re, [
|
|
268
|
+
f(x, {
|
|
269
|
+
mapId: e.mapId,
|
|
270
|
+
colors: (d = e.data) == null ? void 0 : d.colors,
|
|
271
|
+
sizes: (c = e.data) == null ? void 0 : c.sizes,
|
|
272
|
+
color: e.color,
|
|
273
|
+
resizeItem: "true"
|
|
274
|
+
}, null, 8, ["mapId", "colors", "sizes", "color"]),
|
|
275
|
+
f(y, {
|
|
271
276
|
map: e.map,
|
|
272
|
-
|
|
273
|
-
}, null, 8, ["map", "
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
x(y, {
|
|
277
|
-
mapId: e.mapId,
|
|
278
|
-
colors: (d = e.data) == null ? void 0 : d.colors,
|
|
279
|
-
sizes: (p = e.data) == null ? void 0 : p.sizes,
|
|
280
|
-
color: e.color,
|
|
281
|
-
resizeItem: "true"
|
|
282
|
-
}, null, 8, ["mapId", "colors", "sizes", "color"]),
|
|
283
|
-
x(b, {
|
|
284
|
-
map: e.map,
|
|
285
|
-
bbox: (g = e.data) == null ? void 0 : g.bounds
|
|
286
|
-
}, null, 8, ["map", "bbox"])
|
|
287
|
-
])
|
|
288
|
-
], 8, ne)
|
|
289
|
-
]);
|
|
277
|
+
bbox: (g = e.data) == null ? void 0 : g.bounds
|
|
278
|
+
}, null, 8, ["map", "bbox"])
|
|
279
|
+
])
|
|
280
|
+
], 8, ae);
|
|
290
281
|
}
|
|
291
|
-
const
|
|
282
|
+
const ce = /* @__PURE__ */ C(oe, [["render", ne]]);
|
|
292
283
|
export {
|
|
293
|
-
|
|
284
|
+
ce as default
|
|
294
285
|
};
|