@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
|
@@ -1,184 +1,170 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import * as
|
|
7
|
-
import { injectIntl as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
class
|
|
3
|
+
import Y from "./BaseLayer.js";
|
|
4
|
+
import q from "../data/DataProvider.js";
|
|
5
|
+
import G from "../data/DataConsumer.js";
|
|
6
|
+
import * as T from "d3";
|
|
7
|
+
import { injectIntl as H } from "react-intl";
|
|
8
|
+
import X from "papaparse";
|
|
9
|
+
import K from "./BreaksStyles.js";
|
|
10
|
+
class Q extends Y {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(), this.createDataLayer = this.createDataLayer.bind(this);
|
|
13
13
|
}
|
|
14
|
-
createDataLayer(
|
|
14
|
+
createDataLayer(t) {
|
|
15
15
|
const {
|
|
16
|
-
format:
|
|
17
|
-
path:
|
|
18
|
-
tooltip:
|
|
16
|
+
format: i,
|
|
17
|
+
path: s,
|
|
18
|
+
tooltip: u,
|
|
19
19
|
markFillColor: n,
|
|
20
|
-
markBorderColor:
|
|
21
|
-
markSizeScale:
|
|
20
|
+
markBorderColor: m,
|
|
21
|
+
markSizeScale: g,
|
|
22
22
|
//circle size
|
|
23
|
-
featureJoinAttribute:
|
|
24
|
-
apiJoinAttribute:
|
|
25
|
-
projection:
|
|
26
|
-
breaks:
|
|
27
|
-
markSizeScale2:
|
|
23
|
+
featureJoinAttribute: e,
|
|
24
|
+
apiJoinAttribute: v,
|
|
25
|
+
projection: o,
|
|
26
|
+
breaks: l,
|
|
27
|
+
markSizeScale2: p,
|
|
28
28
|
//arrow size
|
|
29
|
-
measures:
|
|
30
|
-
zoom:
|
|
31
|
-
offsetPixels:
|
|
32
|
-
waitForFilters:
|
|
33
|
-
} = this.props,
|
|
34
|
-
breaks:
|
|
29
|
+
measures: f,
|
|
30
|
+
zoom: k,
|
|
31
|
+
offsetPixels: x = 10,
|
|
32
|
+
waitForFilters: $
|
|
33
|
+
} = this.props, _ = f[0], D = new K({
|
|
34
|
+
breaks: l,
|
|
35
35
|
defaultFillColor: n,
|
|
36
|
-
defaultBorderColor:
|
|
37
|
-
defaultSize:
|
|
36
|
+
defaultBorderColor: m,
|
|
37
|
+
defaultSize: p
|
|
38
38
|
});
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
this.g =
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
],
|
|
39
|
+
i.style === "compacted" || i.style, i.style, i.currency, parseInt(i.minimumFractionDigits), parseInt(i.maximumFractionDigits);
|
|
40
|
+
const I = t.features.filter((r) => r.properties._value != null);
|
|
41
|
+
this.g = T.select(this.gRef.current), this.g.attr("class", "base-layer zoomable flow"), this.props.transform && this.g.attr("transform", this.props.transform), this.g.selectAll(".flow-line").remove(), this.g.selectAll(".start-point").remove(), this.g.selectAll(".end-point").remove(), this.g.select("defs").selectAll("*").remove();
|
|
42
|
+
const B = this.props.transform ? this.props.transform.k : 1, z = [];
|
|
43
|
+
I.forEach((r) => {
|
|
44
|
+
z.push(r), r.properties.destinations.sort((h, y) => h[_] - y[_]).forEach((h) => {
|
|
45
|
+
const y = h[_];
|
|
46
|
+
t.features.filter((a) => a.properties[e] == h.value).forEach((a) => {
|
|
47
|
+
a.properties.meta = h;
|
|
48
|
+
const M = r.properties[e], w = r.properties[e] + "--" + a.properties[e], E = s.centroid(r), A = s.centroid(a), F = A[0] - E[0], j = A[1] - E[1], O = Math.sqrt(F * F + j * j), V = F / O, J = j / O, N = [
|
|
49
|
+
A[0] - V * x,
|
|
50
|
+
A[1] - J * x
|
|
51
|
+
], R = o.invert(N), U = {
|
|
52
52
|
type: "LineString",
|
|
53
53
|
coordinates: [
|
|
54
|
-
|
|
54
|
+
o.invert(E),
|
|
55
55
|
// Start in geo coords
|
|
56
|
-
|
|
56
|
+
R
|
|
57
57
|
// New endpoint before d2
|
|
58
58
|
]
|
|
59
|
-
},
|
|
60
|
-
this.g.select("defs").append("marker").attr("id", "arrow" +
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
63
|
-
Object.keys(
|
|
64
|
-
|
|
65
|
-
}), Object.keys(
|
|
66
|
-
|
|
67
|
-
}), Object.keys(
|
|
68
|
-
|
|
59
|
+
}, c = this.g;
|
|
60
|
+
this.g.select("defs").append("marker").attr("id", "arrow" + w).attr("markerUnits", "strokeWidth").attr("markerWidth", "6").attr("markerHeight", "6").attr("viewBox", "0 0 24 24").attr("refX", "6").attr("refY", "6").attr("orient", "auto").append("path").attr("d", "M2,2 L10,6 L2,10 L6,6 L2,2").attr("d", "M2,2 L10,6 L2,10 L6,6 L2,2").attr("style", (L) => "fill: " + D.getColor(y) + ";"), c.append("path").attr("d", s(U)).attr("id", w).attr("class", "flow-line").style("fill", "none").style("cursor", "pointer").style("stroke-dasharray", "0").style("stroke", (L) => D.getColor(y)).style("stroke-width", (L) => D.getSize(y)).attr("marker-end", "url(#arrow" + w + ")").on("mouseenter", (L, tt) => {
|
|
61
|
+
if (c.selectAll("marker").transition().duration("200").style("opacity", 0), c.selectAll(".start-point").transition().duration("200").style("opacity", 0), c.selectAll(".flow-line").transition().duration("200").style("opacity", 0), T.select(L.target).transition().duration("200").style("opacity", 1), c.selectAll("#arrow" + w).transition().duration("200").style("opacity", 1), c.selectAll(".start-point.circle_" + M).transition().duration("200").style("opacity", 1), y) {
|
|
62
|
+
const P = {}, C = {};
|
|
63
|
+
Object.keys(r.properties).forEach((d) => {
|
|
64
|
+
P["origin_" + d] = r.properties[d];
|
|
65
|
+
}), Object.keys(a.properties).forEach((d) => {
|
|
66
|
+
C["target_" + d] = a.properties[d];
|
|
67
|
+
}), Object.keys(a.properties.meta).forEach((d) => {
|
|
68
|
+
C["target_" + d] = a.properties.meta[d];
|
|
69
69
|
});
|
|
70
|
-
const
|
|
71
|
-
...
|
|
72
|
-
...
|
|
70
|
+
const W = {
|
|
71
|
+
...P,
|
|
72
|
+
...C,
|
|
73
73
|
meta: {
|
|
74
|
-
[
|
|
75
|
-
...
|
|
76
|
-
value:
|
|
74
|
+
[v]: r.properties.meta ? r.properties.meta.value : "",
|
|
75
|
+
...r.properties.meta,
|
|
76
|
+
value: y
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
this.showToolTip(
|
|
79
|
+
this.showToolTip(u, W, D.getColor(a.properties._value));
|
|
80
80
|
}
|
|
81
|
-
}).on("mouseout", (
|
|
82
|
-
this.hiddenToolTip(),
|
|
83
|
-
}),
|
|
81
|
+
}).on("mouseout", (L) => {
|
|
82
|
+
this.hiddenToolTip(), T.selectAll(".flow-line").transition().duration("100").style("opacity", 1), c.selectAll(".start-point").transition().duration("100").style("opacity", 1), c.selectAll("marker").transition().duration("100").style("opacity", 1);
|
|
83
|
+
}), c.append("text").append("textPath").attr("xlink:href", w).style("text-anchor", "middle").attr("startOffset", "50%").attr("fill", "#fff").text("Yay, my text is on a wavy path");
|
|
84
84
|
});
|
|
85
85
|
});
|
|
86
|
-
}),
|
|
87
|
-
this.g.append("circle").attr("fill", n).attr("stroke",
|
|
88
|
-
this.showToolTip("{name_en}",
|
|
89
|
-
}).on("mouseout", (
|
|
86
|
+
}), z.forEach((r) => {
|
|
87
|
+
this.g.append("circle").attr("fill", n).attr("stroke", m).attr("class", "start-point circle_" + r.properties[e]).attr("stroke-width", 2).style("vector-effect", "non-scaling-stroke").attr("cx", s.centroid(r)[0]).attr("cy", s.centroid(r)[1]).attr("r", () => g * 1 / B).on("mouseenter", (h) => {
|
|
88
|
+
this.showToolTip("{name_en}", r.properties, "");
|
|
89
|
+
}).on("mouseout", (h) => {
|
|
90
90
|
this.hiddenToolTip();
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
_buildLayer(t) {
|
|
95
95
|
const {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
csv:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
featureJoinAttribute: u,
|
|
109
|
-
editing: v,
|
|
110
|
-
data: l,
|
|
111
|
-
breaks: N,
|
|
112
|
-
markFillColor: E,
|
|
113
|
-
markSizeScale: x,
|
|
114
|
-
measures: _,
|
|
115
|
-
flowValuesFrom: J
|
|
116
|
-
} = this.props;
|
|
117
|
-
a != "none" && this.loadJSON(a).then((S) => {
|
|
118
|
-
const t = S.features.map((e) => {
|
|
119
|
-
const o = e.properties[u];
|
|
120
|
-
if (r != "csv" && l && l.children) {
|
|
121
|
-
const c = l.children.filter((i) => i.value.indexOf(o) > -1);
|
|
122
|
-
if (c.length > 0) {
|
|
123
|
-
const i = c[0][_[0]];
|
|
124
|
-
e.properties.meta = c[0], e.properties._value = i, e.properties.destinations = c[0].children;
|
|
125
|
-
}
|
|
126
|
-
} else if (r == "csv") {
|
|
127
|
-
const c = K.parse(n, { header: !0, dynamicTyping: !0 }), i = e.properties[u];
|
|
128
|
-
c.data.filter((h) => h.origin == i);
|
|
129
|
-
const f = c.data.filter((h) => h.origin == i)[0];
|
|
130
|
-
f != null && (alert("CSV Not implemented Yet, please do it if you have time"), e.properties.meta = f, e.properties._value = f.value, e.properties.destinations = f.destination);
|
|
96
|
+
featureJoinAttribute: i,
|
|
97
|
+
app: s,
|
|
98
|
+
data: u,
|
|
99
|
+
measures: n,
|
|
100
|
+
csv: m
|
|
101
|
+
} = this.props, g = t.features.map((e) => {
|
|
102
|
+
const v = e.properties[i];
|
|
103
|
+
if (s != "csv" && u && u.children) {
|
|
104
|
+
const o = u.children.filter((l) => l.value.indexOf(v) > -1);
|
|
105
|
+
if (o.length > 0) {
|
|
106
|
+
const l = o[0][n[0]];
|
|
107
|
+
e.properties.meta = o[0], e.properties._value = l, e.properties.destinations = o[0].children;
|
|
131
108
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
109
|
+
} else if (s == "csv") {
|
|
110
|
+
const o = X.parse(m, { header: !0, dynamicTyping: !0 }), l = e.properties[i], p = o.data.filter((f) => f.origin == l)[0];
|
|
111
|
+
p != null && (alert("CSV Not implemented Yet, please do it if you have time"), e.properties.meta = p, e.properties._value = p.value, e.properties.destinations = p.destination);
|
|
112
|
+
}
|
|
113
|
+
return e;
|
|
135
114
|
});
|
|
115
|
+
this.createDataLayer({ ...t, features: g });
|
|
116
|
+
}
|
|
117
|
+
create() {
|
|
118
|
+
const { file: t } = this.props;
|
|
119
|
+
t != "none" && (this.state.json ? this._buildLayer(this.state.json) : this.loadJSON(t).then((i) => {
|
|
120
|
+
this.setState({ json: i }), this._buildLayer(i);
|
|
121
|
+
}));
|
|
136
122
|
}
|
|
137
|
-
componentDidUpdate(
|
|
138
|
-
const { projection:
|
|
139
|
-
(n ||
|
|
123
|
+
componentDidUpdate(t, i, s) {
|
|
124
|
+
const { projection: u, editing: n, data: m } = this.props;
|
|
125
|
+
(n || t.data !== m || t.path !== this.props.path) && this.create(), t.visible != this.props.visible && this.g.style("display", this.props.visible ? "" : "none");
|
|
140
126
|
}
|
|
141
127
|
componentDidMount() {
|
|
142
128
|
this.create(), this.props.zoom.current.fullView();
|
|
143
129
|
}
|
|
144
130
|
render() {
|
|
145
|
-
const { id:
|
|
146
|
-
return /* @__PURE__ */
|
|
131
|
+
const { id: t } = this.props;
|
|
132
|
+
return /* @__PURE__ */ b("g", { id: "data-" + t, className: "data " + t, ref: this.gRef, children: /* @__PURE__ */ b("defs", {}) });
|
|
147
133
|
}
|
|
148
134
|
}
|
|
149
|
-
const
|
|
135
|
+
const Z = (S) => {
|
|
150
136
|
const {
|
|
151
|
-
id:
|
|
152
|
-
unique:
|
|
153
|
-
filters:
|
|
154
|
-
csv:
|
|
137
|
+
id: t,
|
|
138
|
+
unique: i,
|
|
139
|
+
filters: s,
|
|
140
|
+
csv: u,
|
|
155
141
|
app: n,
|
|
156
|
-
group:
|
|
157
|
-
flowOrigin:
|
|
158
|
-
editing:
|
|
159
|
-
flowDestination:
|
|
160
|
-
dvzProxyDatasetId:
|
|
161
|
-
waitForFilters:
|
|
162
|
-
} =
|
|
163
|
-
return
|
|
164
|
-
|
|
165
|
-
}), /* @__PURE__ */
|
|
166
|
-
|
|
142
|
+
group: m = "default",
|
|
143
|
+
flowOrigin: g,
|
|
144
|
+
editing: e,
|
|
145
|
+
flowDestination: v,
|
|
146
|
+
dvzProxyDatasetId: o,
|
|
147
|
+
waitForFilters: l
|
|
148
|
+
} = S, p = { dvzProxyDatasetId: o }, f = s || {};
|
|
149
|
+
return f && f.forEach && f.forEach((k) => {
|
|
150
|
+
k.value != null && k.value.filter((x) => x != null && x.toString().trim() != "").length > 0 && (p[k.param] = k.value);
|
|
151
|
+
}), /* @__PURE__ */ b(
|
|
152
|
+
q,
|
|
167
153
|
{
|
|
168
|
-
editing:
|
|
169
|
-
params:
|
|
170
|
-
waitForFilters:
|
|
154
|
+
editing: e,
|
|
155
|
+
params: p,
|
|
156
|
+
waitForFilters: l,
|
|
171
157
|
app: n,
|
|
172
|
-
csv: decodeURIComponent(
|
|
173
|
-
group:
|
|
158
|
+
csv: decodeURIComponent(u),
|
|
159
|
+
group: m,
|
|
174
160
|
ignoreErrors: !0,
|
|
175
161
|
isSvg: !0,
|
|
176
|
-
store: [n,
|
|
177
|
-
source:
|
|
178
|
-
children: /* @__PURE__ */
|
|
162
|
+
store: [n, i, t],
|
|
163
|
+
source: g + "/" + v,
|
|
164
|
+
children: /* @__PURE__ */ b(G, { children: /* @__PURE__ */ b(Q, { ...S }) })
|
|
179
165
|
}
|
|
180
166
|
);
|
|
181
|
-
}, pt =
|
|
167
|
+
}, pt = H(Z);
|
|
182
168
|
export {
|
|
183
169
|
pt as default
|
|
184
170
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _ = [
|
|
2
2
|
{
|
|
3
3
|
value: "blues",
|
|
4
4
|
label: "blues",
|
|
@@ -108,16 +108,21 @@ const c = [
|
|
|
108
108
|
endColor: "#800026"
|
|
109
109
|
}
|
|
110
110
|
];
|
|
111
|
-
class
|
|
112
|
-
constructor(
|
|
113
|
-
const { gradientScheme: r, gradientReverse:
|
|
114
|
-
this.defaultFillColor =
|
|
111
|
+
class v {
|
|
112
|
+
constructor(t) {
|
|
113
|
+
const { gradientScheme: r, gradientReverse: a, data: o = [], defaultFillColor: d, measure: f, gradientStartColor: C, gradientEndColor: u } = t;
|
|
114
|
+
this.defaultFillColor = d, this.measure = f, this.gradientStartColor = C, this.gradientEndColor = u, this.valueColors = this.createGradient(r, o, a), this.getColor = this.getColor.bind(this);
|
|
115
115
|
}
|
|
116
|
-
createGradient(
|
|
117
|
-
|
|
116
|
+
createGradient(t, r, a) {
|
|
117
|
+
let o = {
|
|
118
|
+
startColor: this.gradientStartColor || "#ffffff",
|
|
119
|
+
endColor: this.gradientEndColor || "#000000"
|
|
120
|
+
};
|
|
121
|
+
t !== "custom" && (o = _.find((e) => e.value == t) || {
|
|
118
122
|
startColor: "#ffffff",
|
|
119
123
|
endColor: "#000000"
|
|
120
|
-
}
|
|
124
|
+
});
|
|
125
|
+
const d = r.slice().sort((e, l) => e[this.measure] - l[this.measure]);
|
|
121
126
|
function f(e) {
|
|
122
127
|
return e = e.replace(/^#/, ""), e.length === 3 && (e = e.split("").map((l) => l + l).join("")), {
|
|
123
128
|
r: parseInt(e.substr(0, 2), 16),
|
|
@@ -125,31 +130,33 @@ class _ {
|
|
|
125
130
|
b: parseInt(e.substr(4, 2), 16)
|
|
126
131
|
};
|
|
127
132
|
}
|
|
128
|
-
function
|
|
129
|
-
const
|
|
130
|
-
return `#${
|
|
133
|
+
function C({ r: e, g: l, b: i }) {
|
|
134
|
+
const s = (g) => g.toString(16).padStart(2, "0");
|
|
135
|
+
return `#${s(e)}${s(l)}${s(i)}`;
|
|
131
136
|
}
|
|
132
|
-
const
|
|
137
|
+
const u = a ? o.endColor : o.startColor, p = a ? o.startColor : o.endColor;
|
|
138
|
+
this.startColor = u, this.endColor = p;
|
|
139
|
+
const n = f(u), b = f(p), c = [];
|
|
133
140
|
for (let e = 0; e < r.length; e++) {
|
|
134
|
-
const l = e / (r.length - 1),
|
|
135
|
-
|
|
141
|
+
const l = r.length > 1 ? e / (r.length - 1) : 1, i = Math.round(n.r + (b.r - n.r) * l), s = Math.round(n.g + (b.g - n.g) * l), g = Math.round(n.b + (b.b - n.b) * l);
|
|
142
|
+
c.push({ value: d[e][this.measure], color: C({ r: i, g: s, b: g }) });
|
|
136
143
|
}
|
|
137
|
-
return
|
|
144
|
+
return c;
|
|
138
145
|
}
|
|
139
|
-
getColor(
|
|
146
|
+
getColor(t) {
|
|
140
147
|
if (this.valueColors.length > 0) {
|
|
141
|
-
const r = this.valueColors.find((
|
|
148
|
+
const r = this.valueColors.find((a) => a.value == t);
|
|
142
149
|
return (r == null ? void 0 : r.color) || this.defaultFillColor;
|
|
143
150
|
}
|
|
144
151
|
return this.defaultFillColor;
|
|
145
152
|
}
|
|
146
153
|
getStartColor() {
|
|
147
|
-
return this.
|
|
154
|
+
return this.startColor;
|
|
148
155
|
}
|
|
149
156
|
getEndColor() {
|
|
150
|
-
return this.
|
|
157
|
+
return this.endColor;
|
|
151
158
|
}
|
|
152
159
|
}
|
|
153
160
|
export {
|
|
154
|
-
|
|
161
|
+
v as default
|
|
155
162
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
2
|
import I from "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import j from "../data/DataProvider.js";
|
|
4
|
+
import N from "../data/DataConsumer.js";
|
|
5
5
|
import * as p from "d3";
|
|
6
|
-
import { injectIntl as
|
|
7
|
-
import * as
|
|
8
|
-
import
|
|
9
|
-
class
|
|
6
|
+
import { injectIntl as O } from "react-intl";
|
|
7
|
+
import * as U from "react-dom";
|
|
8
|
+
import V from "./Tooltip.js";
|
|
9
|
+
class X extends I.Component {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(), this.create = this.create.bind(this), this.showToolTip = this.showToolTip.bind(this), this.moveToolTip = this.moveToolTip.bind(this), this.resize = this.resize.bind(this), this.gRef = I.createRef();
|
|
12
12
|
}
|
|
13
|
-
showToolTip(e, n,
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
showToolTip(e, n, s, r) {
|
|
14
|
+
const a = p.select("body").append("div").attr("class", "d3MapTooltip").style("position", "absolute").html("").style("left", r.pageX + 15 + "px").style("top", r.pageY - 50 + "px");
|
|
15
|
+
U.render(/* @__PURE__ */ v(
|
|
16
|
+
V,
|
|
17
17
|
{
|
|
18
18
|
intl: this.props.intl,
|
|
19
19
|
tooltip: e,
|
|
20
20
|
data: n,
|
|
21
21
|
tooltipEnableMarkdown: !1
|
|
22
22
|
}
|
|
23
|
-
),
|
|
23
|
+
), a._groups[0][0]);
|
|
24
24
|
}
|
|
25
25
|
moveToolTip(e) {
|
|
26
26
|
p.select(".d3MapTooltip").style("left", e.pageX + 15 + "px").style("top", e.pageY - 50 + "px");
|
|
@@ -32,65 +32,65 @@ class U extends I.Component {
|
|
|
32
32
|
const {
|
|
33
33
|
app: e,
|
|
34
34
|
tooltip: n,
|
|
35
|
-
data:
|
|
36
|
-
markFillColor:
|
|
37
|
-
markBorderColor:
|
|
35
|
+
data: s,
|
|
36
|
+
markFillColor: r,
|
|
37
|
+
markBorderColor: a,
|
|
38
38
|
markSizeScale: m,
|
|
39
39
|
markerLabelSize: g,
|
|
40
40
|
measures: y,
|
|
41
41
|
projection: c,
|
|
42
42
|
id: T,
|
|
43
|
-
format:
|
|
43
|
+
format: l,
|
|
44
44
|
intl: x,
|
|
45
45
|
useBreaks: L,
|
|
46
46
|
breaks: d,
|
|
47
|
-
pointDimensionStyles:
|
|
47
|
+
pointDimensionStyles: u = [],
|
|
48
48
|
pointStyleBy: f,
|
|
49
|
-
dimension2:
|
|
49
|
+
dimension2: b,
|
|
50
50
|
visible: D = !0,
|
|
51
51
|
showDim2OnLegends: A,
|
|
52
|
-
dim2LegendLabel:
|
|
52
|
+
dim2LegendLabel: q
|
|
53
53
|
} = this.props, E = {
|
|
54
|
-
style:
|
|
55
|
-
notation:
|
|
56
|
-
currency:
|
|
57
|
-
minimumFractionDigits: parseInt(
|
|
58
|
-
maximumFractionDigits: parseInt(
|
|
54
|
+
style: l.style === "compacted" ? "decimal" : l.style,
|
|
55
|
+
notation: l.style === "compacted" ? "compact" : "standard",
|
|
56
|
+
currency: l.currency,
|
|
57
|
+
minimumFractionDigits: parseInt(l.minimumFractionDigits),
|
|
58
|
+
maximumFractionDigits: parseInt(l.maximumFractionDigits)
|
|
59
59
|
}, B = p.scaleThreshold().domain(d.map((t) => t.end)).range(d.map((t) => m + t.size)), C = p.scaleThreshold().domain(d.map((t) => t.end)).range(d.map((t) => t.color)), M = p.scaleThreshold().domain(d.map((t) => t.end)).range(d.map((t) => t.borderColor));
|
|
60
60
|
let S = [];
|
|
61
61
|
const z = p.select(this.gRef.current);
|
|
62
|
-
if (e != "csv" &&
|
|
63
|
-
S =
|
|
62
|
+
if (e != "csv" && s && s.children)
|
|
63
|
+
S = s.children.map((t) => {
|
|
64
64
|
const o = t.value.split(",");
|
|
65
|
-
let
|
|
66
|
-
return f === "measure" ? (i = t[y[0]],
|
|
67
|
-
color:
|
|
68
|
-
size:
|
|
69
|
-
border:
|
|
65
|
+
let h = { color: r, size: m, border: a }, i = 1;
|
|
66
|
+
return f === "measure" ? (i = t[y[0]], h = { color: C(i), size: B(i), border: M(i) }) : f === "dimension" && t.children && A && (i = t.children[0].value, h = {
|
|
67
|
+
color: u[i + "_color"] || r,
|
|
68
|
+
size: u[i + "_size"] || m,
|
|
69
|
+
border: u[i + "_border"] || a
|
|
70
70
|
}), {
|
|
71
71
|
x: o[0],
|
|
72
72
|
y: o[1],
|
|
73
73
|
value: i,
|
|
74
74
|
metadata: t,
|
|
75
|
-
pointStyle:
|
|
75
|
+
pointStyle: h
|
|
76
76
|
};
|
|
77
77
|
}), S.sort((t, o) => t.pointStyle.size - o.pointStyle.size);
|
|
78
78
|
else if (e == "csv") {
|
|
79
|
-
const t =
|
|
80
|
-
S =
|
|
81
|
-
let
|
|
79
|
+
const t = s.meta.fields[0], o = s.meta.fields[1], h = s.meta.fields[2];
|
|
80
|
+
S = s.data.map((i) => {
|
|
81
|
+
let _ = { color: r, size: m, border: a };
|
|
82
82
|
return {
|
|
83
83
|
x: i[t],
|
|
84
84
|
y: i[o],
|
|
85
|
-
value: i[
|
|
85
|
+
value: i[h],
|
|
86
86
|
meta: i,
|
|
87
|
-
pointStyle:
|
|
87
|
+
pointStyle: _
|
|
88
88
|
};
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
const F = (t) => {
|
|
92
|
-
const { pointStyleBy: o, dimension2:
|
|
93
|
-
return
|
|
92
|
+
const { pointStyleBy: o, dimension2: h } = this.props, i = {};
|
|
93
|
+
return h != "none" && (i[h] = t.metadata.children[0].value), { ...i, ...t, ...t.metadata };
|
|
94
94
|
}, R = this.props.transform ? this.props.transform.k : 1;
|
|
95
95
|
z.attr("class", "zoomable lat-long " + T), z.selectAll(".point-group").remove();
|
|
96
96
|
const w = z.selectAll(".point-group").data(S).enter().append("g").attr("class", "point-group");
|
|
@@ -112,17 +112,17 @@ class U extends I.Component {
|
|
|
112
112
|
this.hiddenToolTip(t);
|
|
113
113
|
}), this.props.transform && z.attr("transform", this.props.transform);
|
|
114
114
|
}
|
|
115
|
-
componentDidUpdate(e, n,
|
|
116
|
-
const { editing:
|
|
117
|
-
if ((
|
|
118
|
-
const T = y.selectAll(".point-group circle").filter((
|
|
115
|
+
componentDidUpdate(e, n, s) {
|
|
116
|
+
const { editing: r, selectedItem: a, onZoomToPoint: m, data: g } = this.props, y = p.select(this.gRef.current);
|
|
117
|
+
if ((r || e.data !== g || e.path !== this.props.path) && this.create(), e.visible != this.props.visible && p.select(this.gRef.current).style("display", this.props.visible ? "block" : "none"), a != null && this.props.selectedItem != e.selectedItem) {
|
|
118
|
+
const T = y.selectAll(".point-group circle").filter((l) => l.metadata.children.find((x) => x.value == a) != null);
|
|
119
119
|
m({ x: T.datum().x, y: T.datum().y });
|
|
120
120
|
}
|
|
121
121
|
this.resize();
|
|
122
122
|
}
|
|
123
123
|
resize() {
|
|
124
|
-
const { markerLabelSize: e } = this.props, n = p.select(this.gRef.current),
|
|
125
|
-
n && (n.selectAll(".point-group circle").attr("r", (
|
|
124
|
+
const { markerLabelSize: e } = this.props, n = p.select(this.gRef.current), s = this.props.transform ? this.props.transform.k : 1;
|
|
125
|
+
n && (n.selectAll(".point-group circle").attr("r", (r) => r.pointStyle.size * 1 / s), n.selectAll(".point-group text.point-label").attr("font-size", (r) => e * (10 / s) + "px"));
|
|
126
126
|
}
|
|
127
127
|
componentDidMount() {
|
|
128
128
|
this.create();
|
|
@@ -131,44 +131,44 @@ class U extends I.Component {
|
|
|
131
131
|
const {
|
|
132
132
|
id: e
|
|
133
133
|
} = this.props;
|
|
134
|
-
return /* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ v("g", { className: "latLong " + e, ref: this.gRef });
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
const
|
|
137
|
+
const Y = (k) => {
|
|
138
138
|
const {
|
|
139
139
|
id: e,
|
|
140
140
|
unique: n,
|
|
141
|
-
filters:
|
|
142
|
-
csv:
|
|
143
|
-
app:
|
|
141
|
+
filters: s,
|
|
142
|
+
csv: r,
|
|
143
|
+
app: a,
|
|
144
144
|
group: m = "default",
|
|
145
145
|
apiJoinAttribute: g,
|
|
146
146
|
editing: y,
|
|
147
147
|
dimension2: c,
|
|
148
148
|
pointStyleBy: T,
|
|
149
|
-
dvzProxyDatasetId:
|
|
149
|
+
dvzProxyDatasetId: l,
|
|
150
150
|
settings: x,
|
|
151
151
|
waitForFilters: L
|
|
152
|
-
} = k, d = c != "none" ? "/" + c : "",
|
|
153
|
-
return f && f.forEach && f.forEach((
|
|
154
|
-
|
|
155
|
-
}),
|
|
156
|
-
|
|
152
|
+
} = k, d = c != "none" ? "/" + c : "", u = {}, f = s || {};
|
|
153
|
+
return f && f.forEach && f.forEach((b) => {
|
|
154
|
+
b.value != null && b.value.filter((D) => D != null && D.toString().trim() != "").length > 0 && (u[b.param] = b.value);
|
|
155
|
+
}), l && (u.dvzProxyDatasetId = l), /* @__PURE__ */ v(
|
|
156
|
+
j,
|
|
157
157
|
{
|
|
158
158
|
editing: y,
|
|
159
|
-
params:
|
|
159
|
+
params: u,
|
|
160
160
|
waitForFilters: L,
|
|
161
|
-
app:
|
|
162
|
-
csv: decodeURIComponent(
|
|
161
|
+
app: a,
|
|
162
|
+
csv: decodeURIComponent(r),
|
|
163
163
|
group: m,
|
|
164
164
|
ignoreErrors: !0,
|
|
165
165
|
isSvg: !0,
|
|
166
|
-
store: [
|
|
166
|
+
store: [a, n, e],
|
|
167
167
|
source: [g + d],
|
|
168
|
-
children: /* @__PURE__ */
|
|
168
|
+
children: /* @__PURE__ */ v(N, { children: /* @__PURE__ */ v(X, { ...k }) })
|
|
169
169
|
}
|
|
170
170
|
);
|
|
171
|
-
}, K =
|
|
171
|
+
}, K = O(Y);
|
|
172
172
|
export {
|
|
173
173
|
K as default
|
|
174
174
|
};
|