@devgateway/dvz-ui-react 1.9.12 → 1.9.14

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.
@@ -1,170 +1,176 @@
1
1
  import { jsx as b } from "react/jsx-runtime";
2
2
  import "react";
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 {
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(t) {
15
+ createDataLayer(e) {
15
16
  const {
16
17
  format: i,
17
18
  path: s,
18
- tooltip: u,
19
+ tooltip: c,
19
20
  markFillColor: n,
20
21
  markBorderColor: m,
21
- markSizeScale: g,
22
+ markSizeScale: k,
22
23
  //circle size
23
- featureJoinAttribute: e,
24
- apiJoinAttribute: v,
24
+ featureJoinAttribute: r,
25
+ apiJoinAttribute: x,
25
26
  projection: o,
26
- breaks: l,
27
- markSizeScale2: p,
27
+ breaks: a,
28
+ markSizeScale2: f,
28
29
  //arrow size
29
- measures: f,
30
- zoom: k,
31
- offsetPixels: x = 10,
32
- waitForFilters: $
33
- } = this.props, _ = f[0], D = new K({
34
- breaks: l,
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: p
38
+ defaultSize: f
38
39
  });
39
40
  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 = {
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(E),
55
+ o.invert(_),
55
56
  // Start in geo coords
56
- R
57
+ W
57
58
  // New endpoint before d2
58
59
  ]
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];
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 W = {
71
- ...P,
72
- ...C,
71
+ const q = {
72
+ ...I,
73
+ ...T,
73
74
  meta: {
74
- [v]: r.properties.meta ? r.properties.meta.value : "",
75
- ...r.properties.meta,
76
- value: y
75
+ [x]: t.properties.meta ? t.properties.meta.value : "",
76
+ ...t.properties.meta,
77
+ value: v
77
78
  }
78
79
  };
79
- this.showToolTip(u, W, D.getColor(a.properties._value));
80
+ this.showToolTip(c, q, A.getColor(p.properties._value));
80
81
  }
81
82
  }).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");
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
- }), 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) => {
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(t) {
95
+ _buildLayer(e) {
95
96
  const {
96
97
  featureJoinAttribute: i,
97
98
  app: s,
98
- data: u,
99
+ data: c,
99
100
  measures: n,
100
101
  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);
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 l = o[0][n[0]];
107
- e.properties.meta = o[0], e.properties._value = l, e.properties.destinations = o[0].children;
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 = 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);
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 e;
114
+ return r;
114
115
  });
115
- this.createDataLayer({ ...t, features: g });
116
+ this.createDataLayer({ ...e, features: k });
116
117
  }
117
118
  create() {
118
- const { file: t } = this.props;
119
- t != "none" && (this.state.json ? this._buildLayer(this.state.json) : this.loadJSON(t).then((i) => {
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(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");
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: t } = this.props;
132
- return /* @__PURE__ */ b("g", { id: "data-" + t, className: "data " + t, ref: this.gRef, children: /* @__PURE__ */ b("defs", {}) });
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 Z = (S) => {
136
+ const tt = (C) => {
136
137
  const {
137
- id: t,
138
+ id: e,
138
139
  unique: i,
139
140
  filters: s,
140
- csv: u,
141
+ csv: c,
141
142
  app: n,
142
143
  group: m = "default",
143
- flowOrigin: g,
144
- editing: e,
145
- flowDestination: v,
144
+ flowOrigin: k,
145
+ editing: r,
146
+ flowDestination: x,
146
147
  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,
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: e,
155
- params: p,
156
- waitForFilters: l,
160
+ editing: r,
161
+ params: y,
162
+ waitForFilters: f,
157
163
  app: n,
158
- csv: decodeURIComponent(u),
164
+ csv: decodeURIComponent(c),
159
165
  group: m,
160
166
  ignoreErrors: !0,
161
167
  isSvg: !0,
162
- store: [n, i, t],
163
- source: g + "/" + v,
164
- children: /* @__PURE__ */ b(G, { children: /* @__PURE__ */ b(Q, { ...S }) })
168
+ store: [n, i, e],
169
+ source: k + "/" + x,
170
+ children: /* @__PURE__ */ b(X, { children: /* @__PURE__ */ b($, { ...C }) })
165
171
  }
166
172
  );
167
- }, pt = H(Z);
173
+ }, ut = K(tt);
168
174
  export {
169
- pt as default
175
+ ut as default
170
176
  };
@@ -1,128 +1,129 @@
1
- import { jsx as v } from "react/jsx-runtime";
2
- import I from "react";
3
- import j from "../data/DataProvider.js";
4
- import N from "../data/DataConsumer.js";
5
- import * as p from "d3";
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 {
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 = I.createRef();
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, 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,
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
- ), a._groups[0][0]);
24
+ ), l._groups[0][0]);
24
25
  }
25
26
  moveToolTip(e) {
26
- p.select(".d3MapTooltip").style("left", e.pageX + 15 + "px").style("top", e.pageY - 50 + "px");
27
+ c.select(".d3MapTooltip").style("left", e.pageX + 15 + "px").style("top", e.pageY - 50 + "px");
27
28
  }
28
29
  hiddenToolTip(e) {
29
- p.selectAll(".d3MapTooltip").remove();
30
+ c.selectAll(".d3MapTooltip").remove();
30
31
  }
31
32
  create() {
32
33
  const {
33
34
  app: e,
34
35
  tooltip: n,
35
- data: s,
36
- markFillColor: r,
37
- markBorderColor: a,
36
+ data: r,
37
+ markFillColor: s,
38
+ markBorderColor: l,
38
39
  markSizeScale: m,
39
- markerLabelSize: g,
40
- measures: y,
41
- projection: c,
42
- id: T,
43
- format: l,
44
- intl: x,
45
- useBreaks: L,
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: u = [],
48
- pointStyleBy: f,
49
- dimension2: b,
50
- visible: D = !0,
51
- showDim2OnLegends: A,
52
- dim2LegendLabel: q
53
- } = this.props, E = {
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
- }, 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
- let S = [];
61
- const z = p.select(this.gRef.current);
62
- if (e != "csv" && s && s.children)
63
- S = s.children.map((t) => {
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 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
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: h
75
+ metadata: { ...t, ...X(t) },
76
+ pointStyle: f
76
77
  };
77
- }), S.sort((t, o) => t.pointStyle.size - o.pointStyle.size);
78
+ }), D.sort((t, o) => t.pointStyle.size - o.pointStyle.size);
78
79
  else if (e == "csv") {
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 };
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[h],
86
- meta: i,
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: h } = this.props, i = {};
93
- return h != "none" && (i[h] = t.metadata.children[0].value), { ...i, ...t, ...t.metadata };
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
- z.attr("class", "zoomable lat-long " + T), z.selectAll(".point-group").remove();
96
- const w = z.selectAll(".point-group").data(S).enter().append("g").attr("class", "point-group");
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 c([t.y, t.x])[0];
99
+ return p([t.y, t.x])[0];
99
100
  }).attr("cy", function(t) {
100
- return c([t.y, t.x])[1];
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) => c([t.y, t.x])[0]).attr("y", (t) => c([t.y, t.x])[1]).attr("font-size", (t) => g * (10 / R) + "px").attr("fill", "#EEE").text((t) => x.formatNumber(t.value, E)).on("mouseenter", (t, o) => {
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 && z.attr("transform", this.props.transform);
114
+ }), this.props.transform && k.attr("transform", this.props.transform);
114
115
  }
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
- m({ x: T.datum().x, y: T.datum().y });
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 = 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"));
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__ */ v("g", { className: "latLong " + e, ref: this.gRef });
135
+ return /* @__PURE__ */ S("g", { className: "latLong " + e, ref: this.gRef });
135
136
  }
136
137
  }
137
- const Y = (k) => {
138
+ const q = (L) => {
138
139
  const {
139
140
  id: e,
140
141
  unique: n,
141
- filters: s,
142
- csv: r,
143
- app: a,
142
+ filters: r,
143
+ csv: s,
144
+ app: l,
144
145
  group: m = "default",
145
- apiJoinAttribute: g,
146
- editing: y,
147
- dimension2: c,
148
- pointStyleBy: T,
149
- dvzProxyDatasetId: l,
150
- settings: x,
151
- waitForFilters: L
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,
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: y,
159
- params: u,
160
- waitForFilters: L,
161
- app: a,
162
- csv: decodeURIComponent(r),
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: [a, n, e],
167
- source: [g + d],
168
- children: /* @__PURE__ */ v(N, { children: /* @__PURE__ */ v(X, { ...k }) })
172
+ store: [l, n, e],
173
+ source: [T + x],
174
+ children: /* @__PURE__ */ S(V, { children: /* @__PURE__ */ S(Y, { ...L }) })
169
175
  }
170
176
  );
171
- }, K = O(Y);
177
+ }, $ = N(q);
172
178
  export {
173
- K as default
179
+ $ as default
174
180
  };