@devgateway/dvz-ui-react 1.6.20 → 1.7.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/cjs/_virtual/_commonjsHelpers.js +1 -0
- package/dist/cjs/_virtual/debounce.js +1 -0
- package/dist/cjs/embeddable/big-filter/BigNumberGroup.js +1 -0
- package/dist/cjs/embeddable/big-filter/BigNumberItem.js +1 -0
- package/dist/cjs/embeddable/big-filter/DataProvider.js +1 -0
- package/dist/cjs/embeddable/big-filter/index.js +1 -0
- package/dist/cjs/embeddable/big-number/index.js +1 -1
- package/dist/cjs/embeddable/big-number-trend/Alternative.js +1 -0
- package/dist/cjs/embeddable/big-number-trend/Classic.js +1 -0
- package/dist/cjs/embeddable/big-number-trend/index.js +1 -1
- package/dist/cjs/embeddable/chart/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/Line.js +1 -1
- package/dist/cjs/embeddable/chart/data/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/data/Line.js +1 -1
- package/dist/cjs/embeddable/chart/data/Utils.js +1 -1
- package/dist/cjs/embeddable/chart/index.js +1 -1
- package/dist/cjs/embeddable/d3Map/BaseLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/BreaksStyles.js +1 -1
- package/dist/cjs/embeddable/d3Map/DataLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/FlowLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/GradientColors.js +1 -1
- package/dist/cjs/embeddable/d3Map/LatLongLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/Layer.js +1 -1
- package/dist/cjs/embeddable/d3Map/Legends.js +1 -1
- package/dist/cjs/embeddable/d3Map/ProjectedContainer.js +1 -1
- package/dist/cjs/embeddable/d3Map/Utils.js +1 -1
- package/dist/cjs/embeddable/d3Map/ZoomControl.js +1 -1
- package/dist/cjs/embeddable/d3Map/index.js +1 -1
- package/dist/cjs/embeddable/data/CategoriesProvider.js +1 -1
- package/dist/cjs/embeddable/data/D3MapDataConsumer.js +1 -0
- package/dist/cjs/embeddable/data/D3MapDataProvider.js +1 -0
- package/dist/cjs/embeddable/data/DataContext.js +1 -1
- package/dist/cjs/embeddable/data/DataProvider.js +1 -1
- package/dist/cjs/embeddable/data-paragraph/index.js +1 -0
- package/dist/cjs/embeddable/download/dom-to-image.js +2 -2
- package/dist/cjs/embeddable/download/index.js +5 -5
- package/dist/cjs/embeddable/filter/index.js +1 -1
- package/dist/cjs/embeddable/grouped-bars/GroupedBars.js +1 -0
- package/dist/cjs/embeddable/grouped-bars/index.js +1 -0
- package/dist/cjs/embeddable/index.js +1 -1
- package/dist/cjs/embeddable/posts-filter/CategoricalFilter.js +1 -1
- package/dist/cjs/embeddable/reducers/data-api.js +1 -1
- package/dist/cjs/embeddable/reducers/data.js +1 -1
- package/dist/cjs/embeddable/utils/common.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/layout/Customizer.js +1 -1
- package/dist/cjs/layout/SearchControl.js +1 -1
- package/dist/cjs/layout/containers/SlugPostContainer.js +1 -1
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js +1 -0
- package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js +1 -0
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/_virtual/_commonjsHelpers.js +8 -0
- package/dist/esm/_virtual/debounce.js +7 -0
- package/dist/esm/embeddable/big-filter/BigNumberGroup.js +129 -0
- package/dist/esm/embeddable/big-filter/BigNumberItem.js +107 -0
- package/dist/esm/embeddable/big-filter/DataProvider.js +53 -0
- package/dist/esm/embeddable/big-filter/index.js +130 -0
- package/dist/esm/embeddable/big-number/index.js +154 -102
- package/dist/esm/embeddable/big-number-trend/Alternative.js +227 -0
- package/dist/esm/embeddable/big-number-trend/Classic.js +190 -0
- package/dist/esm/embeddable/big-number-trend/index.js +12 -147
- package/dist/esm/embeddable/chart/Bar.js +450 -395
- package/dist/esm/embeddable/chart/Line.js +216 -184
- package/dist/esm/embeddable/chart/data/Bar.js +16 -18
- package/dist/esm/embeddable/chart/data/Line.js +27 -24
- package/dist/esm/embeddable/chart/data/Utils.js +3 -1
- package/dist/esm/embeddable/chart/index.js +168 -162
- package/dist/esm/embeddable/d3Map/BaseLayer.js +25 -28
- package/dist/esm/embeddable/d3Map/BreaksStyles.js +17 -10
- package/dist/esm/embeddable/d3Map/DataLayer.js +290 -289
- package/dist/esm/embeddable/d3Map/FlowLayer.js +122 -136
- package/dist/esm/embeddable/d3Map/GradientColors.js +27 -20
- package/dist/esm/embeddable/d3Map/LatLongLayer.js +62 -62
- package/dist/esm/embeddable/d3Map/Layer.js +31 -27
- package/dist/esm/embeddable/d3Map/Legends.js +204 -190
- package/dist/esm/embeddable/d3Map/ProjectedContainer.js +1 -3
- package/dist/esm/embeddable/d3Map/Utils.js +12 -8
- package/dist/esm/embeddable/d3Map/ZoomControl.js +41 -41
- package/dist/esm/embeddable/d3Map/index.js +135 -117
- package/dist/esm/embeddable/data/CategoriesProvider.js +39 -26
- package/dist/esm/embeddable/data/D3MapDataConsumer.js +7 -0
- package/dist/esm/embeddable/data/D3MapDataProvider.js +83 -0
- package/dist/esm/embeddable/data/DataContext.js +2 -2
- package/dist/esm/embeddable/data/DataProvider.js +124 -55
- package/dist/esm/embeddable/data-paragraph/index.js +168 -0
- package/dist/esm/embeddable/download/dom-to-image.js +163 -148
- package/dist/esm/embeddable/download/index.js +102 -76
- package/dist/esm/embeddable/filter/index.js +335 -298
- package/dist/esm/embeddable/grouped-bars/GroupedBars.js +549 -0
- package/dist/esm/embeddable/grouped-bars/index.js +16 -0
- package/dist/esm/embeddable/index.js +33 -30
- package/dist/esm/embeddable/posts-filter/CategoricalFilter.js +18 -18
- package/dist/esm/embeddable/reducers/data-api.js +39 -35
- package/dist/esm/embeddable/reducers/data.js +141 -182
- package/dist/esm/embeddable/utils/common.js +3 -3
- package/dist/esm/index.js +111 -94
- package/dist/esm/layout/Customizer.js +10 -9
- package/dist/esm/layout/SearchControl.js +103 -113
- package/dist/esm/layout/containers/SlugPostContainer.js +1 -1
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +16 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js +14 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +21 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +11 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js +60 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +12 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +15 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js +13 -0
- package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js +28 -0
- package/dist/esm/styles.css +1 -1
- package/dist/types/embeddable/big-filter/BigNumberGroup.d.ts +3 -0
- package/dist/types/embeddable/big-filter/BigNumberItem.d.ts +2 -0
- package/dist/types/embeddable/big-filter/DataProvider.d.ts +7 -0
- package/dist/types/embeddable/big-filter/index.d.ts +5 -0
- package/dist/types/embeddable/big-number-trend/Alternative.d.ts +5 -0
- package/dist/types/embeddable/big-number-trend/Classic.d.ts +5 -0
- package/dist/types/embeddable/big-number-trend/index.d.ts +2 -4
- package/dist/types/embeddable/chart/Bar.d.ts +3 -0
- package/dist/types/embeddable/chart/Line.d.ts +6 -0
- package/dist/types/embeddable/d3Map/GradientColors.d.ts +6 -2
- package/dist/types/embeddable/d3Map/Layer.d.ts +1 -1
- package/dist/types/embeddable/d3Map/Utils.d.ts +1 -1
- package/dist/types/embeddable/data/D3MapDataProvider.d.ts +7 -0
- package/dist/types/embeddable/data/index.d.ts +6 -0
- package/dist/types/embeddable/data-paragraph/index.d.ts +5 -0
- package/dist/types/embeddable/filter/index.d.ts +13 -1
- package/dist/types/embeddable/grouped-bars/GroupedBars.d.ts +5 -0
- package/dist/types/embeddable/grouped-bars/index.d.ts +3 -0
- package/dist/types/embeddable/reducers/data-api.d.ts +5 -0
- package/dist/types/embeddable/reducers/data.d.ts +16 -9
- package/dist/types/embeddable/utils/index.d.ts +1 -0
- package/dist/types/embeddable/utils/parseUtils.d.ts +0 -6
- package/dist/types/index.d.ts +6 -0
- package/dist/types/layout/Customizer.d.ts +1 -0
- package/dist/types/layout/containers/PageContainer.d.ts +8 -0
- package/dist/types/layout/containers/PostContainer.d.ts +0 -0
- package/dist/types/layout/index.d.ts +1 -0
- package/dist/types/utils/Logger.d.ts +1 -0
- package/package.json +3 -2
- /package/dist/types/embeddable/data/{DataConsumerMap.d.ts → D3MapDataConsumer.d.ts} +0 -0
|
@@ -25,13 +25,11 @@ class f extends n.Component {
|
|
|
25
25
|
"div",
|
|
26
26
|
{
|
|
27
27
|
className: "projected",
|
|
28
|
-
width: i,
|
|
29
|
-
height: e,
|
|
30
28
|
style: {
|
|
31
29
|
margin: "auto",
|
|
32
30
|
backgroundColor: o,
|
|
33
31
|
height: `${e}px`,
|
|
34
|
-
width:
|
|
32
|
+
width: "100%"
|
|
35
33
|
},
|
|
36
34
|
children: h.map(d, (j) => n.cloneElement(j, {
|
|
37
35
|
...this.state,
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
const
|
|
3
|
-
i.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import * as a from "d3";
|
|
2
|
+
const n = {}, o = {}, u = 3 * 60 * 1e3, r = (t) => JSON.parse(JSON.stringify(t)), l = (t) => {
|
|
3
|
+
const i = Date.now(), e = t;
|
|
4
|
+
if (n[e])
|
|
5
|
+
return n[e].then(r);
|
|
6
|
+
if (o[e] && i - o[e].timestamp < u)
|
|
7
|
+
return Promise.resolve(r(o[e].data));
|
|
8
|
+
const s = a.json(t).then((c) => (o[e] = { data: c, timestamp: Date.now() }, c)).finally(() => {
|
|
9
|
+
delete n[e];
|
|
7
10
|
});
|
|
8
|
-
|
|
11
|
+
return n[e] = s, s.then(r);
|
|
12
|
+
}, m = (t) => l(t);
|
|
9
13
|
export {
|
|
10
|
-
|
|
14
|
+
m as loadJSON
|
|
11
15
|
};
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r, jsxs as I } from "react/jsx-runtime";
|
|
2
2
|
import y from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as u from "d3";
|
|
4
4
|
import { Icon as b, Popup as k } from "semantic-ui-react";
|
|
5
|
-
import { FormattedMessage as
|
|
6
|
-
class
|
|
5
|
+
import { FormattedMessage as E } from "react-intl";
|
|
6
|
+
class O extends y.Component {
|
|
7
7
|
constructor(t) {
|
|
8
|
-
super(t), this.zoomRef = y.createRef(), this.lastInternalZoom = null, this.lastUserTransform = null, this.zoomed = this.zoomed.bind(this), this.zoomEnd = this.zoomEnd.bind(this), this.zoomIn = this.zoomIn.bind(this), this.zoomOut = this.zoomOut.bind(this), this.reset = this.reset.bind(this), this.fullView = this.fullView.bind(this), this.transition2fullView = this.transition2fullView.bind(this), this._fullView = this._fullView.bind(this), this.initialized = !1, this.zoom =
|
|
8
|
+
super(t), this.zoomRef = y.createRef(), this.lastInternalZoom = null, this.lastUserTransform = null, this.zoomed = this.zoomed.bind(this), this.zoomEnd = this.zoomEnd.bind(this), this.zoomIn = this.zoomIn.bind(this), this.zoomOut = this.zoomOut.bind(this), this.reset = this.reset.bind(this), this.fullView = this.fullView.bind(this), this.transition2fullView = this.transition2fullView.bind(this), this._fullView = this._fullView.bind(this), this.initialized = !1, this.zoom = u.zoom().scaleExtent([0.1, 300]).on("zoom", this.zoomed).on("end", this.zoomEnd);
|
|
9
9
|
}
|
|
10
10
|
componentDidMount() {
|
|
11
11
|
const { zoomEnabled: t = !0 } = this.props, i = this.getSelection();
|
|
12
|
-
this._fullView(!1), t && (
|
|
12
|
+
this._fullView(!1), t && (i.on("dblclick.zoom", null), i.on("dblclick", (o) => {
|
|
13
13
|
o.preventDefault(), i.transition().duration(250).call(this.zoom.scaleBy, 1.5);
|
|
14
14
|
}), i.on("wheel.zoom", null), i.on("wheel", (o) => {
|
|
15
15
|
o.preventDefault();
|
|
16
16
|
const s = o.deltaY > 0 ? 1 / 1.5 : 1.5;
|
|
17
17
|
i.transition().duration(250).call(this.zoom.scaleBy, s);
|
|
18
|
-
}), i.call(this.zoom))
|
|
18
|
+
}), i.call(this.zoom)), this.fullView();
|
|
19
19
|
}
|
|
20
20
|
componentDidUpdate(t) {
|
|
21
21
|
const i = this.getSelection(), {
|
|
22
22
|
zoomEnabled: o,
|
|
23
23
|
initialPosition: s,
|
|
24
|
-
readyState:
|
|
25
|
-
height:
|
|
24
|
+
readyState: d,
|
|
25
|
+
height: f,
|
|
26
26
|
width: h,
|
|
27
27
|
selectedPoint: e,
|
|
28
|
-
projection:
|
|
29
|
-
editing:
|
|
28
|
+
projection: a,
|
|
29
|
+
editing: l
|
|
30
30
|
} = this.props;
|
|
31
31
|
!this.initialized && this.props.readyToZoom && (this.fullView(), this.initialized = !0);
|
|
32
|
-
const
|
|
33
|
-
if (t.zoomEnabled !== o || l)
|
|
34
|
-
if (o && i ||
|
|
32
|
+
const m = JSON.stringify(t.initialPosition) !== JSON.stringify(s);
|
|
33
|
+
if (console.log("zoomChanged", m), t.zoomEnabled !== o || m && !l)
|
|
34
|
+
if (o && i || l) {
|
|
35
35
|
if (s && this.lastInternalZoom) {
|
|
36
|
-
const
|
|
37
|
-
if (Math.abs(
|
|
36
|
+
const n = (x, S = 3) => Number(x.toFixed(S)), { x: c, y: z, k: p } = s, { x: g, y: w, k: V } = this.lastInternalZoom;
|
|
37
|
+
if (Math.abs(n(c) - n(g)) < 1 && Math.abs(n(z) - n(w)) < 1 && Math.abs(n(p) - n(V)) < 1e-3) {
|
|
38
38
|
this.lastInternalZoom = null;
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
i.call(this.zoom).on(".zoom", this.zoom), this.transition2fullView();
|
|
43
43
|
} else i && i.on(".zoom", null);
|
|
44
|
-
!t.readyState &&
|
|
44
|
+
!t.readyState && d && this.fullView(), (t.height !== f || t.width !== h) && this.fullView(), e != t.selectedPoint && e && this.zoomTo(a([e.y, e.x]));
|
|
45
45
|
}
|
|
46
46
|
zoomed(t) {
|
|
47
47
|
var o, s;
|
|
@@ -49,20 +49,20 @@ class T extends y.Component {
|
|
|
49
49
|
i && (i.selectAll("g.zoomable").attr("transform", t.transform), (s = (o = this.props).onZoomed) == null || s.call(o, t.transform), this.props.editing && t.sourceEvent && (this.lastUserTransform = t.transform));
|
|
50
50
|
}
|
|
51
51
|
zoomEnd(t) {
|
|
52
|
-
var e,
|
|
53
|
-
const { identifier: i, editing: o, width: s, height:
|
|
54
|
-
if (this.lastUserTransform = null, (
|
|
55
|
-
const
|
|
56
|
-
this.lastInternalZoom =
|
|
57
|
-
const
|
|
52
|
+
var e, a;
|
|
53
|
+
const { identifier: i, editing: o, width: s, height: d, postMessageOrigin: f = "*" } = this.props, h = this.lastUserTransform || t.transform;
|
|
54
|
+
if (this.lastUserTransform = null, (a = (e = this.props).onZoomed) == null || a.call(e, h), o) {
|
|
55
|
+
const l = (g, w = 3) => Number(g.toFixed(w)), { x: m, y: n, k: c } = h, z = { x: l(m), y: l(n), k: l(c) };
|
|
56
|
+
this.lastInternalZoom = z;
|
|
57
|
+
const p = {
|
|
58
58
|
type: `d3_map_${i}`,
|
|
59
59
|
value: {
|
|
60
|
-
...
|
|
60
|
+
...z,
|
|
61
61
|
width: s,
|
|
62
|
-
height:
|
|
62
|
+
height: d
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
-
window.parent.postMessage(
|
|
65
|
+
window.parent.postMessage(p, f);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
zoomIn() {
|
|
@@ -73,7 +73,7 @@ class T extends y.Component {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
zoomTo(t) {
|
|
76
|
-
const i =
|
|
76
|
+
const i = u.zoomIdentity.translate(this.props.width / 2, this.props.height / 2).scale(200).translate(-t[0], -t[1]), o = this.getSelection();
|
|
77
77
|
this.props.editing || this.props.transitionDuration, o.transition().duration(750).call(this.zoom.transform, i);
|
|
78
78
|
}
|
|
79
79
|
zoomOut() {
|
|
@@ -85,18 +85,18 @@ class T extends y.Component {
|
|
|
85
85
|
}
|
|
86
86
|
reset() {
|
|
87
87
|
const t = this.getSelection();
|
|
88
|
-
t && (this.props.editing ? t.call(this.zoom.transform,
|
|
88
|
+
t && (this.props.editing ? t.call(this.zoom.transform, u.zoomIdentity.translate(0, 0).scale(1)) : this.transition2fullView());
|
|
89
89
|
}
|
|
90
90
|
getSelection() {
|
|
91
|
-
return
|
|
91
|
+
return u.select(this.zoomRef.current.parentNode.querySelector("svg"));
|
|
92
92
|
}
|
|
93
93
|
_fullView(t = !0) {
|
|
94
|
-
const { initialPosition: i, width: o, height: s, transform:
|
|
94
|
+
const { initialPosition: i, width: o, height: s, transform: d } = this.props;
|
|
95
95
|
if (!i) return;
|
|
96
|
-
const { x:
|
|
97
|
-
if (!
|
|
98
|
-
const l = this.getSelection();
|
|
99
|
-
|
|
96
|
+
const { x: f = 100, y: h = 23, k: e = 1, width: a, height: l } = i;
|
|
97
|
+
if (!a || !l || !e) return;
|
|
98
|
+
const m = f + (o - a) / 2 * (1 - e), n = h + (s - l) / 2 * (1 - e), c = this.getSelection();
|
|
99
|
+
c && c.transition().duration(t ? 750 : 0).attr("transform", d).call(this.zoom.transform, u.zoomIdentity.translate(m, n).scale(e));
|
|
100
100
|
}
|
|
101
101
|
transition2fullView() {
|
|
102
102
|
this._fullView(!0);
|
|
@@ -106,19 +106,19 @@ class T extends y.Component {
|
|
|
106
106
|
}
|
|
107
107
|
render() {
|
|
108
108
|
const { editing: t, zoomEnabled: i = !0 } = this.props;
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ r("div", { ref: this.zoomRef, className: `zoom ignore ${i ? "" : "disabled"}`, children: (t || i) && /* @__PURE__ */ I("div", { children: [
|
|
110
|
+
/* @__PURE__ */ r("div", { className: "button plus", onClick: this.zoomIn, children: /* @__PURE__ */ r(b, { name: "plus", size: "small" }) }),
|
|
111
|
+
/* @__PURE__ */ r("div", { className: "button minus", onClick: this.zoomOut, children: /* @__PURE__ */ r(b, { name: "minus", size: "small" }) }),
|
|
112
|
+
/* @__PURE__ */ r(
|
|
113
113
|
k,
|
|
114
114
|
{
|
|
115
|
-
content: /* @__PURE__ */
|
|
116
|
-
trigger: /* @__PURE__ */
|
|
115
|
+
content: /* @__PURE__ */ r(E, { id: "map.reset.tooltip", defaultMessage: "Reset zoom" }),
|
|
116
|
+
trigger: /* @__PURE__ */ r("div", { className: "button reset", onClick: this.reset, children: /* @__PURE__ */ r(b, { name: "repeat", size: "small" }) })
|
|
117
117
|
}
|
|
118
118
|
)
|
|
119
119
|
] }) });
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
export {
|
|
123
|
-
|
|
123
|
+
O as default
|
|
124
124
|
};
|
|
@@ -1,167 +1,185 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as l, useRef as
|
|
3
|
-
import { connect as
|
|
4
|
-
import { parse as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const
|
|
1
|
+
import { jsx as i, jsxs as Q } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l, useRef as F, useEffect as C } from "react";
|
|
3
|
+
import { connect as U } from "react-redux";
|
|
4
|
+
import { parse as c, compareJsonProps as j, decode as X } from "../utils/parseUtils.js";
|
|
5
|
+
import Y from "./Map.js";
|
|
6
|
+
import _ from "./BaseLayer.js";
|
|
7
|
+
import tt from "./DataLayer.js";
|
|
8
|
+
import et from "./LatLongLayer.js";
|
|
9
|
+
import ot from "./ZoomControl.js";
|
|
10
|
+
import it from "./ProjectedContainer.js";
|
|
11
|
+
import nt from "./Legends.js";
|
|
12
|
+
import rt from "./FlowLayer.js";
|
|
13
|
+
const at = (g) => {
|
|
14
14
|
const {
|
|
15
15
|
unique: d,
|
|
16
|
-
editing:
|
|
17
|
-
"data-identifier":
|
|
18
|
-
"data-group":
|
|
19
|
-
"data-layers":
|
|
16
|
+
editing: n,
|
|
17
|
+
"data-identifier": x,
|
|
18
|
+
"data-group": f,
|
|
19
|
+
"data-layers": h = "[]",
|
|
20
20
|
"data-height": V = 400,
|
|
21
|
-
"data-width":
|
|
22
|
-
"data-back-ground-color":
|
|
23
|
-
"data-map-position":
|
|
24
|
-
"data-projection":
|
|
25
|
-
"data-zoom-enabled":
|
|
21
|
+
"data-width": ct = 1e3,
|
|
22
|
+
"data-back-ground-color": k = "#88e8dc",
|
|
23
|
+
"data-map-position": w = "{}",
|
|
24
|
+
"data-projection": A = "geoMercator",
|
|
25
|
+
"data-zoom-enabled": I = !0,
|
|
26
26
|
"data-rotation-enabled": z = !1,
|
|
27
|
-
"data-wait-for-filters":
|
|
27
|
+
"data-wait-for-filters": m = "false",
|
|
28
28
|
intl: p
|
|
29
|
-
} =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
29
|
+
} = g, [R, Z] = l(null), v = R, E = Number(V), [P, N] = l(c(w, n), []), [r, b] = l(c(h), []), s = F(null);
|
|
30
|
+
C(() => {
|
|
31
|
+
if (!s.current) return;
|
|
32
|
+
const t = s.current.clientWidth;
|
|
33
|
+
t > 0 && Z(t);
|
|
34
|
+
let o = null;
|
|
35
|
+
const e = () => {
|
|
36
|
+
o && cancelAnimationFrame(o), o = requestAnimationFrame(() => {
|
|
37
|
+
if (!s.current) return;
|
|
38
|
+
const W = s.current.clientWidth;
|
|
39
|
+
W > 0 && Z(W);
|
|
40
|
+
});
|
|
41
|
+
}, a = new ResizeObserver(e);
|
|
42
|
+
return a.observe(s.current), () => {
|
|
43
|
+
a.disconnect(), o && cancelAnimationFrame(o);
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
46
|
+
const u = F(null), [L, S] = l(null), [M, q] = l(null), [D, B] = l(null);
|
|
47
|
+
C(() => {
|
|
48
|
+
const t = c(w, n);
|
|
49
|
+
j(P, t) || N(t);
|
|
50
|
+
}, [w]), C(() => {
|
|
51
|
+
const t = c(h);
|
|
52
|
+
j(r, t) || b(t);
|
|
53
|
+
}, [h]);
|
|
54
|
+
const H = (t) => {
|
|
55
|
+
const o = r.slice(), e = o.find((a) => a.id == t);
|
|
56
|
+
e && (e.visible = !e.visible), b(o);
|
|
57
|
+
}, J = (t) => {
|
|
58
|
+
const o = r.slice(), e = o.find((a) => a.id == t);
|
|
59
|
+
e && (e.patternsVisible = e.patternsVisible == null ? !1 : !e.patternsVisible), b(o);
|
|
60
|
+
}, O = (t) => {
|
|
61
|
+
B(t);
|
|
62
|
+
}, $ = (t) => {
|
|
63
|
+
const o = r.slice(), e = o.find((a) => a.id == t);
|
|
64
|
+
e && (e.colorLayerVisible = e.colorLayerVisible == null ? !1 : !e.colorLayerVisible), b(o);
|
|
65
|
+
}, [G, K] = l(!1), T = F(0);
|
|
49
66
|
r.length;
|
|
50
67
|
const y = () => {
|
|
51
|
-
|
|
68
|
+
T.current += 1, T.current >= r.length && K(!0);
|
|
52
69
|
};
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
|
|
70
|
+
return R ? /* @__PURE__ */ i("div", { ref: s, className: "d3map-container", style: { width: "100%" }, children: /* @__PURE__ */ Q(
|
|
71
|
+
it,
|
|
55
72
|
{
|
|
56
|
-
backgroundColor:
|
|
57
|
-
height:
|
|
58
|
-
width:
|
|
59
|
-
projectionName:
|
|
60
|
-
editing:
|
|
61
|
-
initialPosition:
|
|
73
|
+
backgroundColor: X(k),
|
|
74
|
+
height: E,
|
|
75
|
+
width: v,
|
|
76
|
+
projectionName: A,
|
|
77
|
+
editing: n,
|
|
78
|
+
initialPosition: P,
|
|
62
79
|
children: [
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
if (
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
|
|
80
|
+
/* @__PURE__ */ i(Y, { rotationEnabled: c(z, n), children: r.map((t, o) => {
|
|
81
|
+
if (t.type === "base")
|
|
82
|
+
return /* @__PURE__ */ i(
|
|
83
|
+
_,
|
|
67
84
|
{
|
|
68
|
-
minLabelZoomVisible:
|
|
85
|
+
minLabelZoomVisible: t.minLabelZoomVisible,
|
|
69
86
|
onReady: y,
|
|
70
|
-
transform:
|
|
87
|
+
transform: L,
|
|
71
88
|
intl: p,
|
|
72
|
-
zoom:
|
|
89
|
+
zoom: u,
|
|
73
90
|
unique: d,
|
|
74
|
-
...
|
|
91
|
+
...t
|
|
75
92
|
},
|
|
76
|
-
t
|
|
93
|
+
t.id
|
|
77
94
|
);
|
|
78
|
-
if (
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
|
|
95
|
+
if (t.type === "data")
|
|
96
|
+
return /* @__PURE__ */ i(
|
|
97
|
+
tt,
|
|
81
98
|
{
|
|
82
|
-
minLabelZoomVisible:
|
|
83
|
-
editing:
|
|
99
|
+
minLabelZoomVisible: t.minLabelZoomVisible,
|
|
100
|
+
editing: n,
|
|
84
101
|
onLayerCreated: (e) => {
|
|
85
102
|
},
|
|
86
103
|
onReady: y,
|
|
87
|
-
transform:
|
|
104
|
+
transform: L,
|
|
88
105
|
intl: p,
|
|
89
|
-
group:
|
|
90
|
-
zoom:
|
|
106
|
+
group: f,
|
|
107
|
+
zoom: u,
|
|
91
108
|
unique: d,
|
|
92
|
-
...
|
|
93
|
-
settings:
|
|
94
|
-
togglePatterns:
|
|
95
|
-
initialPosition:
|
|
96
|
-
waitForFilters:
|
|
109
|
+
...t,
|
|
110
|
+
settings: g.wordress,
|
|
111
|
+
togglePatterns: J,
|
|
112
|
+
initialPosition: P,
|
|
113
|
+
waitForFilters: m == "true" || m == !0
|
|
97
114
|
},
|
|
98
|
-
t
|
|
115
|
+
t.id
|
|
99
116
|
);
|
|
100
|
-
if (
|
|
101
|
-
return /* @__PURE__ */
|
|
102
|
-
|
|
117
|
+
if (t.type === "flow")
|
|
118
|
+
return /* @__PURE__ */ i(
|
|
119
|
+
rt,
|
|
103
120
|
{
|
|
104
121
|
onReady: y,
|
|
105
|
-
transform:
|
|
122
|
+
transform: L,
|
|
106
123
|
intl: p,
|
|
107
|
-
group:
|
|
108
|
-
zoom:
|
|
124
|
+
group: f,
|
|
125
|
+
zoom: u,
|
|
109
126
|
unique: d,
|
|
110
|
-
...
|
|
111
|
-
waitForFilters:
|
|
127
|
+
...t,
|
|
128
|
+
waitForFilters: m == "true" || m == !0
|
|
112
129
|
},
|
|
113
|
-
t
|
|
130
|
+
t.id
|
|
114
131
|
);
|
|
115
|
-
if (
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
-
|
|
132
|
+
if (t.type === "dataPoints")
|
|
133
|
+
return /* @__PURE__ */ i(
|
|
134
|
+
et,
|
|
118
135
|
{
|
|
119
136
|
onReady: y,
|
|
120
|
-
onZoomToPoint:
|
|
121
|
-
selectedItem:
|
|
122
|
-
transform:
|
|
137
|
+
onZoomToPoint: O,
|
|
138
|
+
selectedItem: M,
|
|
139
|
+
transform: L,
|
|
123
140
|
intl: p,
|
|
124
|
-
group:
|
|
125
|
-
zoom:
|
|
141
|
+
group: f,
|
|
142
|
+
zoom: u,
|
|
126
143
|
unique: d,
|
|
127
|
-
...
|
|
128
|
-
waitForFilters:
|
|
144
|
+
...t,
|
|
145
|
+
waitForFilters: m == "true" || m == !0
|
|
129
146
|
},
|
|
130
|
-
t
|
|
147
|
+
t.id
|
|
131
148
|
);
|
|
132
149
|
}) }),
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
|
|
150
|
+
/* @__PURE__ */ i(
|
|
151
|
+
nt,
|
|
135
152
|
{
|
|
136
|
-
selectedItem:
|
|
137
|
-
|
|
153
|
+
selectedItem: M,
|
|
154
|
+
unique: d,
|
|
155
|
+
d2Click: (t) => q(t),
|
|
138
156
|
patternsData: null,
|
|
139
157
|
layers: r,
|
|
140
|
-
group:
|
|
141
|
-
onItemClick:
|
|
142
|
-
toggleColorLayer:
|
|
158
|
+
group: f,
|
|
159
|
+
onItemClick: H,
|
|
160
|
+
toggleColorLayer: $
|
|
143
161
|
}
|
|
144
162
|
),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
163
|
+
/* @__PURE__ */ i(
|
|
164
|
+
ot,
|
|
147
165
|
{
|
|
148
|
-
readyToZoom:
|
|
166
|
+
readyToZoom: G,
|
|
149
167
|
selectedPoint: D,
|
|
150
|
-
rootationEmabled:
|
|
151
|
-
zoomEnabled:
|
|
152
|
-
onZoomed:
|
|
153
|
-
width:
|
|
154
|
-
height:
|
|
155
|
-
ref:
|
|
156
|
-
group:
|
|
157
|
-
identifier:
|
|
158
|
-
editing:
|
|
168
|
+
rootationEmabled: c(z, n),
|
|
169
|
+
zoomEnabled: c(I, n),
|
|
170
|
+
onZoomed: S,
|
|
171
|
+
width: v,
|
|
172
|
+
height: E,
|
|
173
|
+
ref: u,
|
|
174
|
+
group: f,
|
|
175
|
+
identifier: x,
|
|
176
|
+
editing: n
|
|
159
177
|
}
|
|
160
178
|
)
|
|
161
179
|
]
|
|
162
180
|
}
|
|
163
|
-
) });
|
|
164
|
-
},
|
|
181
|
+
) }) : /* @__PURE__ */ i("div", { ref: s, className: "d3map-container", style: { width: "100%", height: `${V}px` } });
|
|
182
|
+
}, st = (g, d) => ({}), lt = {}, Ft = U(st, lt)(at);
|
|
165
183
|
export {
|
|
166
|
-
|
|
184
|
+
Ft as default
|
|
167
185
|
};
|
|
@@ -1,40 +1,53 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { connect as
|
|
4
|
-
import { injectIntl as
|
|
5
|
-
import { CategoriesContext as
|
|
6
|
-
import { getCategories as
|
|
7
|
-
import { Container as
|
|
8
|
-
|
|
1
|
+
import { jsx as r, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import x from "react";
|
|
3
|
+
import { connect as L } from "react-redux";
|
|
4
|
+
import { injectIntl as J } from "react-intl";
|
|
5
|
+
import { CategoriesContext as M } from "./DataContext.js";
|
|
6
|
+
import { loadFilterItems as N, getCategories as T } from "../reducers/data.js";
|
|
7
|
+
import { Container as D, Segment as v } from "semantic-ui-react";
|
|
8
|
+
const j = ({ data: t, children: e }) => {
|
|
9
|
+
const o = x.useMemo(() => t ? t.toJS() : null, [t]);
|
|
10
|
+
return /* @__PURE__ */ r(M.Provider, { value: o, children: e });
|
|
11
|
+
};
|
|
12
|
+
class k extends x.Component {
|
|
9
13
|
componentDidMount() {
|
|
10
|
-
const { categories:
|
|
11
|
-
!
|
|
14
|
+
const { categories: e } = this.props;
|
|
15
|
+
!e && !this.props.loading && this.props.onLoadData(this.props);
|
|
12
16
|
}
|
|
13
|
-
componentDidUpdate(
|
|
14
|
-
const { app:
|
|
15
|
-
(
|
|
17
|
+
componentDidUpdate(e, o, n) {
|
|
18
|
+
const { app: a, parentSelectedItems: p, filters: c, source: m, store: u, params: i, csv: l, group: s, editing: d } = this.props;
|
|
19
|
+
e.parentSelectedItems && p && p.length != e.parentSelectedItems.length && this.props.onReLoadItems(this.props), (c != e.filters || JSON.stringify(i) != JSON.stringify(e.params) || a != e.app || e.source != m || l != e.csv) && (a === "csv" ? this.props.onSetData({ app: a, csv: l, store: u, params: i, group: s }) : (d && (i.v = (Math.random() + 1).toString(36).substring(7)), this.setState({ showLoading: !1 }), this.props.onLoadData(this.props), setTimeout(this.checkLoadingTime, 100)));
|
|
16
20
|
}
|
|
17
21
|
render() {
|
|
18
|
-
const { data:
|
|
19
|
-
return
|
|
22
|
+
const { data: e, loading: o, error: n } = this.props;
|
|
23
|
+
return o ? /* @__PURE__ */ r(D, { children: /* @__PURE__ */ r("div", { className: "filter-skeleton-placeholder", children: /* @__PURE__ */ r("div", { className: "filter-skeleton-shimmer" }) }) }) : e ? /* @__PURE__ */ r(j, { data: e, children: this.props.children }) : n ? /* @__PURE__ */ C(v, { color: "red", children: [
|
|
20
24
|
/* @__PURE__ */ r("h1", { children: "500" }),
|
|
21
25
|
/* @__PURE__ */ r("p", { children: "Wasn't able to load data" })
|
|
22
|
-
] }) : /* @__PURE__ */ r(
|
|
26
|
+
] }) : /* @__PURE__ */ r(D, { children: /* @__PURE__ */ C(v, { color: "red", children: [
|
|
23
27
|
/* @__PURE__ */ r("h1", { children: "404" }),
|
|
24
28
|
/* @__PURE__ */ r("p", { children: "Can't find this page" })
|
|
25
29
|
] }) });
|
|
26
30
|
}
|
|
27
31
|
}
|
|
28
|
-
const
|
|
29
|
-
const { app:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const R = (t, e) => {
|
|
33
|
+
const { app: o, group: n, type: a, parentType: p, param: c, parentParam: m, params: u, dvzProxyDatasetId: i, uniqueStorage: l } = e, s = ["data", "categories", o];
|
|
34
|
+
i && s.push(i), l && s.push(l);
|
|
35
|
+
const d = t.getIn([...s, "items"]), h = d ? d.toJS() : [], y = t.getIn(["data", "filters", o, n, c]), g = h.filter((f) => f.type == a);
|
|
36
|
+
g && g.length > 0 && g[0].items;
|
|
37
|
+
let I = [], S = [];
|
|
38
|
+
return p && (I = h.filter((f) => f.type == p), S = t.getIn(["data", "filters", o, n, m])), {
|
|
39
|
+
parentSelectedItems: S,
|
|
40
|
+
selectedItems: y,
|
|
41
|
+
items: h,
|
|
42
|
+
parentItems: I,
|
|
43
|
+
data: t.getIn([...s, "items"]),
|
|
44
|
+
error: t.getIn([...s, "error"]),
|
|
45
|
+
loading: t.getIn([...s, "loading"])
|
|
34
46
|
};
|
|
35
|
-
},
|
|
36
|
-
onLoadData:
|
|
37
|
-
|
|
47
|
+
}, b = {
|
|
48
|
+
onLoadData: T,
|
|
49
|
+
onReLoadItems: N
|
|
50
|
+
}, U = L(R, b)(J(k));
|
|
38
51
|
export {
|
|
39
|
-
|
|
52
|
+
U as default
|
|
40
53
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import r from "react";
|
|
3
|
+
import { DataContext as m } from "./DataContext.js";
|
|
4
|
+
const c = (t) => /* @__PURE__ */ e(m.Consumer, { children: (n) => /* @__PURE__ */ e(r.Fragment, { children: r.Children.map(t.children, (o) => r.cloneElement(o, { data: n })) }) });
|
|
5
|
+
export {
|
|
6
|
+
c as default
|
|
7
|
+
};
|