@opengis/bi 1.1.2 → 1.2.1
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/bi.js +11 -2
- package/dist/bi.umd.cjs +72 -720
- package/dist/import-file-D06AZEtP.js +3493 -0
- package/dist/style.css +1 -7
- package/dist/{vs-funnel-bar-mWZ8lvEq.js → vs-funnel-bar-C8m-602x.js} +11 -11
- package/dist/vs-list-BJ0NjSm5.js +525 -0
- package/dist/vs-map-PLlJqaaW.js +294 -0
- package/dist/vs-map-cluster-9tV6eiDA.js +356 -0
- package/dist/{vs-number-CRUhHKym.js → vs-number-B2V_BPer.js} +3 -3
- package/dist/{vs-table-OddIdr1s.js → vs-table-WGE9jyDq.js} +6 -6
- package/dist/vs-text-DkLKRC7F.js +1528 -0
- package/package.json +77 -84
- package/plugin.js +13 -13
- package/server/plugins/vite.js +69 -69
- package/server/routes/dashboard/controllers/utils/yaml.js +11 -11
- package/server/routes/data/controllers/data.js +7 -6
- package/server/routes/data/controllers/util/chartSQL.js +2 -2
- 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/server/utils/getWidget.js +3 -3
- package/utils.js +12 -12
- package/config.js +0 -12
- package/dist/import-file-XFI3CaVb.js +0 -63458
- package/dist/vs-donut-al85JwBt.js +0 -148
- package/dist/vs-list-1QDnN3pH.js +0 -18510
- package/dist/vs-map-CwR6ZYur.js +0 -285
- package/dist/vs-map-cluster-YdXTBIVf.js +0 -314
- package/dist/vs-text-CQ9vn0qO.js +0 -40
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { _ as y, c as D, i as g, a as c, b as h, P as l } from "./import-file-XFI3CaVb.js";
|
|
2
|
-
import { createElementBlock as b, openBlock as x } from "vue";
|
|
3
|
-
const _ = {
|
|
4
|
-
name: "VsPie",
|
|
5
|
-
props: ["currentWidget"],
|
|
6
|
-
mixins: [D],
|
|
7
|
-
data() {
|
|
8
|
-
return {
|
|
9
|
-
chartInstance: null,
|
|
10
|
-
// Unused variable – оставлен для потенциального будущего использования
|
|
11
|
-
resizeObserver: null
|
|
12
|
-
};
|
|
13
|
-
},
|
|
14
|
-
computed: {
|
|
15
|
-
// Генерируем уникальный ID на основе свойства widget из миксина
|
|
16
|
-
uniqueID() {
|
|
17
|
-
return this.widget;
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
async mounted() {
|
|
21
|
-
var r;
|
|
22
|
-
await this.$nextTick(), await this.getData();
|
|
23
|
-
const { series: t } = this.prepareData() || {};
|
|
24
|
-
t && this.initChart(t);
|
|
25
|
-
const e = (r = this.$refs) == null ? void 0 : r.chart;
|
|
26
|
-
e && (this.resizeObserver = new ResizeObserver(() => {
|
|
27
|
-
this.chartInstance && this.chartInstance.resize();
|
|
28
|
-
}), this.resizeObserver.observe(e));
|
|
29
|
-
},
|
|
30
|
-
beforeUnmount() {
|
|
31
|
-
var t;
|
|
32
|
-
(t = this.resizeObserver) == null || t.disconnect();
|
|
33
|
-
},
|
|
34
|
-
methods: {
|
|
35
|
-
// Не используется, оставлен для потенциального будущего применения
|
|
36
|
-
onChangedData() {
|
|
37
|
-
try {
|
|
38
|
-
if (this.sourceData) {
|
|
39
|
-
const { series: t, xs: e, ys: r } = this.prepareData();
|
|
40
|
-
t && this.initChart(t, e, r);
|
|
41
|
-
}
|
|
42
|
-
} catch (t) {
|
|
43
|
-
console.error(t);
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
buildTooltipForDonut(t, e) {
|
|
47
|
-
const { name: r, value: i, percent: a } = t;
|
|
48
|
-
return `
|
|
49
|
-
<div style="background-color:${e[0]}; font-size:12px; font-family:Helvetica, Arial, sans-serif; color:#ffff; padding:5px; border-radius:5px;">
|
|
50
|
-
${r == null ? void 0 : r.replace("null", "Не визначено")}: ${c(i)} (${a}%)
|
|
51
|
-
</div>`;
|
|
52
|
-
},
|
|
53
|
-
prepareData() {
|
|
54
|
-
var t, e, r;
|
|
55
|
-
try {
|
|
56
|
-
const i = Array.from(
|
|
57
|
-
new Set(this.sourceData.map((s) => s[this.dimensions[0]]))
|
|
58
|
-
), a = Array.from(
|
|
59
|
-
new Set(this.sourceData.map((s) => s[this.dimensions[1]]))
|
|
60
|
-
), n = parseInt(
|
|
61
|
-
this.sourceData.reduce((s, o) => s + parseFloat(o == null ? void 0 : o.metric), 0),
|
|
62
|
-
10
|
|
63
|
-
), d = i.map((s, o) => {
|
|
64
|
-
const f = (a[o] / n * 100).toFixed(2);
|
|
65
|
-
return {
|
|
66
|
-
name: `${s} (${f}%)`,
|
|
67
|
-
value: a[o]
|
|
68
|
-
};
|
|
69
|
-
}), u = ((t = this.styleData) == null ? void 0 : t.innerRadius) || "80%", p = ((e = this.styleData) == null ? void 0 : e.outerRadius) || "100%", m = [u, p];
|
|
70
|
-
return this.styleData.legend = l.getLegendOpions({
|
|
71
|
-
borderRadius: 10,
|
|
72
|
-
height: "100%",
|
|
73
|
-
padding: 10,
|
|
74
|
-
bottom: "0",
|
|
75
|
-
type: "scroll",
|
|
76
|
-
itemWidth: 14,
|
|
77
|
-
itemHeight: 14,
|
|
78
|
-
formatter: (s) => s == null ? void 0 : s.replace("null", "Не визначено"),
|
|
79
|
-
...this.styleData.legend
|
|
80
|
-
}), this.styleData.label = l.getLabelOptions(
|
|
81
|
-
this.styleData.label
|
|
82
|
-
), this.styleData.show_legend = ((r = this.styleData) == null ? void 0 : r.show_legend) || !0, { series: [
|
|
83
|
-
{
|
|
84
|
-
name: this.titleCharts ? this.titleCharts : this.dimensions[0],
|
|
85
|
-
type: "pie",
|
|
86
|
-
radius: m,
|
|
87
|
-
center: ["50%", "60%"],
|
|
88
|
-
height: "75%",
|
|
89
|
-
...h(this.styleData),
|
|
90
|
-
data: d
|
|
91
|
-
}
|
|
92
|
-
] };
|
|
93
|
-
} catch (i) {
|
|
94
|
-
return console.error(i), null;
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
async initChart(t) {
|
|
98
|
-
try {
|
|
99
|
-
const e = this.$refs.chart;
|
|
100
|
-
this.chartInstance = g(e);
|
|
101
|
-
const r = parseInt(
|
|
102
|
-
this.sourceData.reduce((a, n) => a + parseFloat(n == null ? void 0 : n.metric), 0),
|
|
103
|
-
10
|
|
104
|
-
), i = {
|
|
105
|
-
tooltip: {
|
|
106
|
-
trigger: "item",
|
|
107
|
-
formatter: (a) => this.buildTooltipForDonut(a, [a.color]),
|
|
108
|
-
borderWidth: 0,
|
|
109
|
-
appendToBody: !0,
|
|
110
|
-
borderColor: "transparent",
|
|
111
|
-
textStyle: { color: "#000" },
|
|
112
|
-
padding: [15, 15],
|
|
113
|
-
shadowColor: "transparent",
|
|
114
|
-
backgroundColor: "transparent"
|
|
115
|
-
},
|
|
116
|
-
series: t,
|
|
117
|
-
...h({ ...this.styleData }),
|
|
118
|
-
title: {
|
|
119
|
-
text: c(r),
|
|
120
|
-
left: "center",
|
|
121
|
-
top: "41%",
|
|
122
|
-
textStyle: {
|
|
123
|
-
color: "black",
|
|
124
|
-
fontWeight: 400,
|
|
125
|
-
fontSize: "22px"
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
this.chartInstance.setOption(i), this.$emit("update:currentWidget", this.chartInstance), this.chartInstance.resize(), window.addEventListener("resize", () => {
|
|
130
|
-
this.chartInstance.resize();
|
|
131
|
-
});
|
|
132
|
-
} catch (e) {
|
|
133
|
-
console.error(e);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}, $ = ["id"];
|
|
138
|
-
function I(t, e, r, i, a, n) {
|
|
139
|
-
return x(), b("div", {
|
|
140
|
-
id: n.uniqueID,
|
|
141
|
-
ref: "chart",
|
|
142
|
-
class: "h-full min-h-[200px] flex items-center"
|
|
143
|
-
}, null, 8, $);
|
|
144
|
-
}
|
|
145
|
-
const C = /* @__PURE__ */ y(_, [["render", I]]);
|
|
146
|
-
export {
|
|
147
|
-
C as default
|
|
148
|
-
};
|