@opengis/bi 1.1.0 → 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.
Files changed (40) hide show
  1. package/config.js +12 -12
  2. package/dist/assets/charts/bar.png +0 -0
  3. package/dist/assets/charts/funnel.png +0 -0
  4. package/dist/assets/charts/no_data.jpg +0 -0
  5. package/dist/assets/charts/number.png +0 -0
  6. package/dist/assets/charts/pie.png +0 -0
  7. package/dist/assets/charts/progress.png +0 -0
  8. package/dist/assets/charts/stat.png +0 -0
  9. package/dist/assets/images/bar.png +0 -0
  10. package/dist/assets/images/funnel.png +0 -0
  11. package/dist/assets/images/no_data.jpg +0 -0
  12. package/dist/assets/images/number.png +0 -0
  13. package/dist/assets/images/pie.png +0 -0
  14. package/dist/assets/images/progress.png +0 -0
  15. package/dist/assets/images/stat.png +0 -0
  16. package/dist/bi.js +4 -0
  17. package/dist/bi.umd.cjs +749 -0
  18. package/dist/favicon.ico +0 -0
  19. package/dist/import-file-XFI3CaVb.js +63458 -0
  20. package/dist/style.css +7 -0
  21. package/dist/vs-donut-al85JwBt.js +148 -0
  22. package/dist/vs-funnel-bar-mWZ8lvEq.js +116 -0
  23. package/dist/vs-list-1QDnN3pH.js +18510 -0
  24. package/dist/vs-map-CwR6ZYur.js +285 -0
  25. package/dist/vs-map-cluster-YdXTBIVf.js +314 -0
  26. package/dist/vs-number-CRUhHKym.js +55 -0
  27. package/dist/vs-table-OddIdr1s.js +71 -0
  28. package/dist/vs-text-CQ9vn0qO.js +40 -0
  29. package/package.json +7 -12
  30. package/server/plugins/vite.js +69 -69
  31. package/server/routes/dashboard/controllers/utils/yaml.js +11 -11
  32. package/server/routes/dataset/controllers/createDatasetPost.js +1 -2
  33. package/server/routes/dataset/utils/convertJSONToXls.js +1 -3
  34. package/server/routes/map/controllers/cluster.js +125 -125
  35. package/server/routes/map/controllers/clusterVtile.js +166 -166
  36. package/server/routes/map/controllers/geojson.js +127 -127
  37. package/server/routes/map/controllers/map.js +69 -69
  38. package/server/routes/map/controllers/utils/downloadClusterData.js +44 -44
  39. package/server/routes/map/controllers/vtile.js +183 -183
  40. package/utils.js +12 -12
package/dist/style.css ADDED
@@ -0,0 +1,7 @@
1
+ @font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7SUc.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7SUc.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7SUc.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7SUc.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7SUc.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7SUc.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7SUc.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7SUc.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7SUc.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7SUc.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7SUc.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7SUc.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}body{font-family:Inter,Segoe UI,Helvetica Neue,Roboto,sans-serif;font-weight:400}h1{font-family:Inter,Segoe UI,Helvetica Neue,Roboto,sans-serif;font-weight:700}em{font-family:Inter,Segoe UI,Helvetica Neue,Roboto,sans-serif;font-style:italic}.custom-x-scrollbar{overflow-x:auto;overflow-y:clip}.custom-x-scrollbar::-webkit-scrollbar{height:6px}.custom-x-scrollbar::-webkit-scrollbar-thumb{background-color:#e0e0e0}.custom-x-scrollbar::-webkit-scrollbar-track{background-color:#f1f1f1}.custom-scrollbar{overflow-y:auto;overflow-x:clip}.custom-scrollbar::-webkit-scrollbar{width:6px;margin-right:0}.custom-scrollbar::-webkit-scrollbar-thumb{background-color:#e0e0e0;border-radius:10px}.custom-scrollbar::-webkit-scrollbar-track{background-color:#f1f1f1}.vs-chart{width:100%;height:100%}.vs-chart-tooltip{border-radius:7px;max-height:100px;max-width:340px;min-width:140px;background-color:#fff;box-shadow:0 0 8px #0000002e}.vs-chart-tooltip__head{padding:5px;border-bottom:1px solid #eee;margin-bottom:5px}.vs-chart-tooltip__head-title{font-size:14px;font-weight:700;display:flex;align-items:center}.vs-chart-tooltip__head-value{margin-right:5px}.vs-chart-tooltip__head-series{font-size:14px;display:flex;align-items:center}.vs-chart-tooltip__color{width:12px;height:12px;display:block;border-radius:50%;margin-right:5px}.vs-chart-tooltip__body{padding:5px;font-size:14px;display:flex;align-items:start;flex-direction:column}.vs-chart-tooltip__body .vs-chart-tooltip__color{border-radius:3px}.vs-chart-tooltip__item{width:100%;display:flex;align-items:center;justify-content:space-between}.vs-chart-tooltip__text{margin-right:auto}.vs-chart-tooltip__body svg{margin-right:8px}body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}/*!
2
+ Theme: Ashes
3
+ Author: Jannik Siebert (https://github.com/janniks)
4
+ License: ~ MIT (or more permissive) [via base16-schemes-source]
5
+ Maintainer: @highlightjs/core-team
6
+ Version: 2021.09.0
7
+ */pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#c7ccd1;background:#1c2023}.hljs ::selection,.hljs::selection{background-color:#565e65;color:#c7ccd1}.hljs-comment{color:#747c84}.hljs-tag{color:#adb3ba}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#c7ccd1}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#c7ae95}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#c7c795}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#aec795}.hljs-strong{font-weight:700;color:#aec795}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#95c7ae}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#95aec7}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#ae95c7}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c795ae}.hljs-emphasis{color:#c795ae;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#c79595}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}.custom-scrollbar[data-v-89cc241e]{overflow-y:auto;overflow-x:clip}.custom-scrollbar[data-v-89cc241e]::-webkit-scrollbar{width:6px}.custom-scrollbar[data-v-89cc241e]::-webkit-scrollbar-thumb{background-color:#e0e0e0;border-radius:10px}.custom-scrollbar[data-v-89cc241e]::-webkit-scrollbar-track{background-color:#f1f1f1}.text-widget h1{font-size:18px}.text-widget h2{font-size:14px}.map__settings{display:flex;padding:3px 1px;background:#fff;position:absolute;right:0;bottom:15px;height:30px;align-items:center;font-weight:100;text-align:center}.map__settings-item{display:flex;white-space:nowrap;padding:0 2px;font-size:10px;font-weight:400}.map__settings-attribution{padding:0}.map__settings-menu{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:15px!important;position:absolute;background-color:#fff;bottom:60px;right:90px;width:260px}.map__settings-menu-item{display:flex;align-items:center;color:#2c2c2c;margin-bottom:5px;font-size:12px;justify-content:space-between;height:28px}.map__settings-menu-item-text{height:28px;line-height:28px;background-color:#fff;background-image:none;border-radius:4px;border:1px solid #dcdfe6;-webkit-box-sizing:border-box;box-sizing:border-box;color:#606266;display:inline-block;font-size:12px;height:40px;line-height:40px;outline:0;padding:0 10px}.map__settings-menu-item--checktext{color:#000!important;font-size:12px;display:inline-block;padding-left:10px;line-height:19px;cursor:pointer}.checked{color:#409eff!important}.vs-map-slot-layers{position:absolute;display:none;bottom:10px;left:15px}.vs-map-slot-layers__layer{width:50px;height:50px;background-color:#fff;box-shadow:0 0 7px #434c5626;padding:5px;border-radius:5px;margin-top:10px;margin-right:10px;cursor:pointer;transition:all .3s}.vs-map-slot-layers__layer:hover{background-color:#eee}.vs-map-slot-layers__image{width:100%;border-radius:5px;object-fit:contain}.focused{background-color:#1989fa!important}.maplibregl-popup-content{padding:0}
@@ -0,0 +1,148 @@
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
+ };
@@ -0,0 +1,116 @@
1
+ import { _ as n, c, i as h, b as o, d as l, a as d } from "./import-file-XFI3CaVb.js";
2
+ import { createElementBlock as p, openBlock as u } from "vue";
3
+ const m = {
4
+ name: "VsFunnelBar",
5
+ mixins: [c],
6
+ data() {
7
+ return {
8
+ chartInstance: null,
9
+ uniqueID: null
10
+ };
11
+ },
12
+ async mounted() {
13
+ this.uniqueID = this.widget, await this.$nextTick(), await this.getData();
14
+ const { series: t } = this.prepareData();
15
+ t && this.initChart(t);
16
+ },
17
+ methods: {
18
+ buildTooltipForDonut(t, r) {
19
+ const { name: s, value: a, percent: e } = t;
20
+ return `
21
+ <div style="background-color:${r[0]};font-size: 12px; font-family: Helvetica, Arial, sans-serif;color:#ffff; padding:5px; border-radius:5px; ![box-shadow:none]">
22
+ ${l(s)}: ${d(a)} (${e}%)
23
+ </div>`;
24
+ },
25
+ onChangedData() {
26
+ try {
27
+ if (this.sourceData) {
28
+ const { series: t, xs: r, ys: s } = this.prepareData();
29
+ t && (this == null || this.initChart(t, r, s));
30
+ }
31
+ } catch {
32
+ }
33
+ },
34
+ prepareData() {
35
+ try {
36
+ const t = Array.from(
37
+ new Set(this.sourceData.map((e) => e[this.dimensions[0]]))
38
+ ), r = Array.from(
39
+ new Set(this.sourceData.map((e) => e[this.dimensions[1]]))
40
+ ), s = t.map((e, i) => ({
41
+ name: e,
42
+ value: r[i]
43
+ }));
44
+ return { series: [
45
+ {
46
+ name: this.titleCharts ? this.titleCharts : this.dimensions[0],
47
+ type: "funnel",
48
+ ...o(this.styleData),
49
+ data: s,
50
+ height: "80%",
51
+ emphasis: {
52
+ label: {
53
+ show: !1
54
+ }
55
+ }
56
+ }
57
+ ] };
58
+ } catch (t) {
59
+ console.error(t);
60
+ }
61
+ },
62
+ async initChart(t) {
63
+ try {
64
+ const r = this.$refs.chart, s = h(r), a = {
65
+ series: t,
66
+ ...o(this.styleData),
67
+ tooltip: {
68
+ trigger: "item",
69
+ formatter: (e) => this.buildTooltipForDonut(e, [e.color]),
70
+ borderWidth: 0,
71
+ appendToBody: !0,
72
+ borderColor: "transparent",
73
+ textStyle: {
74
+ color: "#000"
75
+ },
76
+ padding: [10, 15],
77
+ shadowColor: "transparent",
78
+ backgroundColor: "transparent"
79
+ },
80
+ itemStyle: {
81
+ height: "15px"
82
+ },
83
+ legend: {
84
+ borderRadius: 10,
85
+ type: "scroll",
86
+ itemWidth: 14,
87
+ itemHeight: 14,
88
+ ...this.styleData.legend
89
+ },
90
+ labelLine: {
91
+ show: !1
92
+ },
93
+ grid: {
94
+ bottom: "0"
95
+ }
96
+ };
97
+ s.setOption(a), s.resize(), window.addEventListener("resize", () => {
98
+ s.resize();
99
+ });
100
+ } catch (r) {
101
+ console.error(r);
102
+ }
103
+ }
104
+ }
105
+ }, f = ["id"];
106
+ function y(t, r, s, a, e, i) {
107
+ return u(), p("div", {
108
+ ref: "chart",
109
+ id: e.uniqueID,
110
+ class: "h-[90%] custom-scrollbar min-h-[200px]"
111
+ }, null, 8, f);
112
+ }
113
+ const g = /* @__PURE__ */ n(m, [["render", y]]);
114
+ export {
115
+ g as default
116
+ };