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