@devgateway/dvz-ui-react 1.1.1 → 1.2.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.
Files changed (34) hide show
  1. package/dist/cjs/embeddable/big-number/index.js +1 -1
  2. package/dist/cjs/embeddable/chart/Bar.js +1 -1
  3. package/dist/cjs/embeddable/chart/index.js +1 -1
  4. package/dist/cjs/embeddable/d3Map/BaseLayer.js +1 -1
  5. package/dist/cjs/embeddable/d3Map/DataLayer.js +1 -1
  6. package/dist/cjs/embeddable/d3Map/FlowLayer.js +1 -1
  7. package/dist/cjs/embeddable/d3Map/ZoomControl.js +1 -1
  8. package/dist/cjs/embeddable/d3Map/index.js +1 -1
  9. package/dist/cjs/embeddable/posts-with-filters/DropDownFilter.js +1 -0
  10. package/dist/cjs/embeddable/posts-with-filters/Post.js +1 -1
  11. package/dist/cjs/embeddable/posts-with-filters/index.js +1 -1
  12. package/dist/cjs/embeddable/reducers/data-api.js +1 -1
  13. package/dist/cjs/layout/containers/SlugPostContainer.js +1 -1
  14. package/dist/cjs/styles.css +1 -1
  15. package/dist/esm/embeddable/big-number/index.js +92 -85
  16. package/dist/esm/embeddable/chart/Bar.js +128 -123
  17. package/dist/esm/embeddable/chart/index.js +229 -225
  18. package/dist/esm/embeddable/d3Map/BaseLayer.js +40 -27
  19. package/dist/esm/embeddable/d3Map/DataLayer.js +196 -204
  20. package/dist/esm/embeddable/d3Map/FlowLayer.js +104 -101
  21. package/dist/esm/embeddable/d3Map/ZoomControl.js +64 -54
  22. package/dist/esm/embeddable/d3Map/index.js +110 -99
  23. package/dist/esm/embeddable/posts-with-filters/DropDownFilter.js +25 -0
  24. package/dist/esm/embeddable/posts-with-filters/Post.js +49 -24
  25. package/dist/esm/embeddable/posts-with-filters/index.js +120 -119
  26. package/dist/esm/embeddable/reducers/data-api.js +13 -11
  27. package/dist/esm/layout/containers/SlugPostContainer.js +3 -3
  28. package/dist/esm/styles.css +1 -1
  29. package/dist/types/embeddable/chart/Bar.d.ts +2 -0
  30. package/dist/types/embeddable/d3Map/BaseLayer.d.ts +1 -0
  31. package/dist/types/embeddable/d3Map/ZoomControl.d.ts +2 -1
  32. package/dist/types/embeddable/posts-with-filters/DropDownFilter.d.ts +4 -0
  33. package/dist/types/embeddable/posts-with-filters/Post.d.ts +4 -2
  34. package/package.json +4 -2
@@ -7,48 +7,49 @@ import * as M from "d3";
7
7
  import { injectIntl as dt } from "react-intl";
8
8
  import Y from "./BreaksStyles.js";
9
9
  import ot from "./GradientColors.js";
10
- const W = (D) => D ? D.toString().replace(/ /g, "_") : "", C = (D) => D ? "pattern_" + W(D) : "";
10
+ const W = (D) => D ? D.toString().replace(/ /g, "_") : "", k = (D) => D ? "pattern_" + W(D) : "";
11
11
  class ht extends pt {
12
12
  constructor() {
13
13
  super(), this.state = { geoJson: null, json: null }, this.getTooltipVariables = this.getTooltipVariables.bind(this), this.resize = this.resize.bind(this), this.createLayer = this.createLayer.bind(this), this.createCentroids = this.createCentroids.bind(this), this.createPatterns = this.createPatterns.bind(this), this.createPaths = this.createPaths.bind(this);
14
14
  }
15
15
  createLayer(e) {
16
- const p = this.joinData(e, this.props.app, this.props.featureJoinAttribute, this.props.data, this.props.measures, this.props.patternDiscriminator);
17
- this.createDataLayer(p);
16
+ const l = this.joinData(e, this.props.app, this.props.featureJoinAttribute, this.props.data, this.props.measures, this.props.patternDiscriminator);
17
+ this.createDataLayer(l), this.props.onReady && this.props.onReady();
18
18
  }
19
19
  resize() {
20
20
  const {
21
21
  markerLabelSize: e,
22
- markFillColor: p,
23
- markBorderColor: v,
22
+ markFillColor: l,
23
+ markBorderColor: C,
24
24
  markSizeScale: i,
25
25
  measures: u,
26
26
  data: h,
27
27
  breaks: c,
28
- gradientScheme: F,
29
- gradientReverse: l
30
- } = this.props, d = new Y({
28
+ gradientScheme: x,
29
+ gradientReverse: o,
30
+ labelFontSize: f
31
+ } = this.props, n = this.props.transform ? this.props.transform.k : 1;
32
+ super.resize();
33
+ const d = new Y({
31
34
  breaks: c,
32
- defaultFillColor: p,
33
- defaultBorderColor: v,
35
+ defaultFillColor: l,
36
+ defaultBorderColor: C,
34
37
  defaultSize: i
35
38
  });
36
39
  new ot({
37
40
  data: h.children,
38
41
  measure: u[0],
39
- defaultFillColor: p,
40
- gradientScheme: F,
41
- gradientReverse: l
42
- });
43
- const s = this.props.transform ? this.props.transform.k : 1;
44
- this.g.selectAll(".centroids .point").attr("r", (n) => d.getSize(n.properties._value) * 1 / s), this.g.selectAll(".centroids .point-label").attr("font-size", (n) => e * (1 / s) + "px");
42
+ defaultFillColor: l,
43
+ gradientScheme: x,
44
+ gradientReverse: o
45
+ }), this.g.selectAll(".centroids .point").attr("r", (p) => d.getSize(p.properties._value) * 1 / n), this.g.selectAll(".point-label").attr("font-size", (p) => e * (1 / n) + "px");
45
46
  }
46
47
  getTooltipVariables(e) {
47
- const { apiJoinAttribute: p } = this.props;
48
+ const { apiJoinAttribute: l } = this.props;
48
49
  return e.properties._value ? {
49
50
  ...e.properties,
50
51
  meta: {
51
- [p]: e.properties.meta ? e.properties.meta.value : "",
52
+ [l]: e.properties.meta ? e.properties.meta.value : "",
52
53
  ...e.properties.meta,
53
54
  value: e.properties._value
54
55
  }
@@ -56,22 +57,22 @@ class ht extends pt {
56
57
  }
57
58
  createDataLayer(e) {
58
59
  const {
59
- app: p,
60
- svg: v,
60
+ app: l,
61
+ svg: C,
61
62
  format: i,
62
63
  id: u,
63
64
  file: h,
64
65
  path: c,
65
- onLayerCreated: F,
66
- labelFilter: l = [],
67
- labelField: d,
68
- labelFontSize: s,
69
- labelColor: n,
70
- fillColor: L,
71
- borderColor: f,
72
- tooltip: x,
73
- markFillColor: g,
74
- markLabelColor: P,
66
+ onLayerCreated: x,
67
+ labelFilter: o = [],
68
+ labelField: f,
69
+ labelFontSize: n,
70
+ labelColor: d,
71
+ fillColor: p,
72
+ borderColor: m,
73
+ tooltip: z,
74
+ markFillColor: b,
75
+ markLabelColor: T,
75
76
  markBorderColor: J,
76
77
  markSizeScale: N,
77
78
  markerLabelSize: H,
@@ -79,13 +80,13 @@ class ht extends pt {
79
80
  apiJoinAttribute: K,
80
81
  measures: I,
81
82
  editing: et,
82
- data: z,
83
- patternDiscriminator: k,
83
+ data: w,
84
+ patternDiscriminator: S,
84
85
  patternDiscriminatorLabel: Q,
85
86
  breaks: $,
86
87
  gradientScheme: G,
87
88
  gradientReverse: E,
88
- patterns: w,
89
+ patterns: L,
89
90
  projection: rt,
90
91
  useBreaks: X,
91
92
  useGradients: V,
@@ -93,36 +94,35 @@ class ht extends pt {
93
94
  usePattern: j,
94
95
  waitForFilters: at,
95
96
  intl: q,
96
- patternsVisible: B = !0,
97
- togglePatterns: R,
97
+ patternsVisible: R = !0,
98
+ togglePatterns: B,
98
99
  colorLayerVisible: O = !0,
99
100
  visible: it
100
101
  } = this.props;
101
102
  if (this.gRef && this.gRef.current) {
102
- debugger;
103
- this.g = M.select(this.gRef.current.parentNode), this.g.attr("class", "base-layer");
104
- const S = e.features.filter((A) => A.properties._value != null);
105
- this.createPaths(e), U || this.createColors(S), j && this.createPatterns(e), d != "none" && this.createLabels(e), U && this.createCentroids(S);
103
+ this.g = M.select(this.gRef.current), this.g.attr("class", "base-layer");
104
+ const F = e.features.filter((A) => A.properties._value != null);
105
+ this.createPaths(e), U || this.createColors(F), j && this.createPatterns(e), f != "none" && this.createLabels(e), U && this.createCentroids(F);
106
106
  }
107
107
  }
108
108
  createColors(e) {
109
109
  const {
110
- app: p,
111
- svg: v,
110
+ app: l,
111
+ svg: C,
112
112
  format: i,
113
113
  id: u,
114
114
  file: h,
115
115
  path: c,
116
- onLayerCreated: F,
117
- labelFilter: l = [],
118
- labelField: d,
119
- labelFontSize: s,
120
- labelColor: n,
121
- fillColor: L,
122
- borderColor: f,
123
- tooltip: x,
124
- markFillColor: g,
125
- markLabelColor: P,
116
+ onLayerCreated: x,
117
+ labelFilter: o = [],
118
+ labelField: f,
119
+ labelFontSize: n,
120
+ labelColor: d,
121
+ fillColor: p,
122
+ borderColor: m,
123
+ tooltip: z,
124
+ markFillColor: b,
125
+ markLabelColor: T,
126
126
  markBorderColor: J,
127
127
  markSizeScale: N,
128
128
  markerLabelSize: H,
@@ -130,13 +130,13 @@ class ht extends pt {
130
130
  apiJoinAttribute: K,
131
131
  measures: I,
132
132
  editing: et,
133
- data: z,
134
- patternDiscriminator: k,
133
+ data: w,
134
+ patternDiscriminator: S,
135
135
  patternDiscriminatorLabel: Q,
136
136
  breaks: $,
137
137
  gradientScheme: G,
138
138
  gradientReverse: E,
139
- patterns: w,
139
+ patterns: L,
140
140
  projection: rt,
141
141
  useBreaks: X,
142
142
  useGradients: V,
@@ -144,51 +144,48 @@ class ht extends pt {
144
144
  usePattern: j,
145
145
  waitForFilters: at,
146
146
  intl: q,
147
- patternsVisible: B = !0,
148
- togglePatterns: R,
147
+ patternsVisible: R = !0,
148
+ togglePatterns: B,
149
149
  colorLayerVisible: O = !0,
150
150
  visible: it
151
- } = this.props, S = new Y({
151
+ } = this.props, F = new Y({
152
152
  breaks: $,
153
- defaultFillColor: g,
153
+ defaultFillColor: b,
154
154
  defaultBorderColor: J,
155
155
  defaultSize: N
156
156
  }), A = new ot({
157
- data: z.children,
157
+ data: w.children,
158
158
  measure: I[0],
159
- defaultFillColor: g,
159
+ defaultFillColor: b,
160
160
  gradientScheme: G,
161
161
  gradientReverse: E
162
162
  });
163
- if (this.g) {
164
- debugger;
165
- this.g.selectAll("path").attr("fill", (o) => !o || !o.properties || !o.properties._value ? L : V ? A.getColor(o.properties._value) : S.getColor(o.properties._value)).attr("stroke", f).attr("id", "state-borders").attr("d", c).on("mouseenter", (o, b) => {
166
- b.properties._value && this.showToolTip(x, this.getTooltipVariables(b), V ? A.getColor(b.properties._value) : S.getColor(b.properties._value), b);
167
- }).on("mouseleave", (o) => {
168
- this.hiddenToolTip(o);
169
- }).on("mousemove", (o) => {
170
- this.moveToolTip(o);
171
- }), O || this.g.selectAll(".borders").style("fill", this.props.fillColor), this.g.attr("transform", this.props.transform);
172
- }
163
+ this.g && (this.g.selectAll("path").attr("fill", (s) => !s || !s.properties || !s.properties._value ? p : V ? A.getColor(s.properties._value) : F.getColor(s.properties._value)).attr("stroke", m).attr("id", "state-borders").attr("d", c).on("mouseenter", (s, y) => {
164
+ y.properties._value && this.showToolTip(z, this.getTooltipVariables(y), V ? A.getColor(y.properties._value) : F.getColor(y.properties._value), y);
165
+ }).on("mouseleave", (s) => {
166
+ this.hiddenToolTip(s);
167
+ }).on("mousemove", (s) => {
168
+ this.moveToolTip(s);
169
+ }), O || this.g.selectAll(".borders").style("fill", this.props.fillColor), this.g.attr("transform", this.props.transform));
173
170
  }
174
171
  createCentroids(e) {
175
172
  const {
176
- app: p,
177
- svg: v,
173
+ app: l,
174
+ svg: C,
178
175
  format: i,
179
176
  id: u,
180
177
  file: h,
181
178
  path: c,
182
- onLayerCreated: F,
183
- labelFilter: l = [],
184
- labelField: d,
185
- labelFontSize: s,
186
- labelColor: n,
187
- fillColor: L,
188
- borderColor: f,
189
- tooltip: x,
190
- markFillColor: g,
191
- markLabelColor: P,
179
+ onLayerCreated: x,
180
+ labelFilter: o = [],
181
+ labelField: f,
182
+ labelFontSize: n,
183
+ labelColor: d,
184
+ fillColor: p,
185
+ borderColor: m,
186
+ tooltip: z,
187
+ markFillColor: b,
188
+ markLabelColor: T,
192
189
  markBorderColor: J,
193
190
  markSizeScale: N,
194
191
  markerLabelSize: H,
@@ -196,13 +193,13 @@ class ht extends pt {
196
193
  apiJoinAttribute: K,
197
194
  measures: I,
198
195
  editing: et,
199
- data: z,
200
- patternDiscriminator: k,
196
+ data: w,
197
+ patternDiscriminator: S,
201
198
  patternDiscriminatorLabel: Q,
202
199
  breaks: $,
203
200
  gradientScheme: G,
204
201
  gradientReverse: E,
205
- patterns: w,
202
+ patterns: L,
206
203
  projection: rt,
207
204
  useBreaks: X,
208
205
  useGradients: V,
@@ -210,35 +207,35 @@ class ht extends pt {
210
207
  usePattern: j,
211
208
  waitForFilters: at,
212
209
  intl: q,
213
- patternsVisible: B = !0,
214
- togglePatterns: R,
210
+ patternsVisible: R = !0,
211
+ togglePatterns: B,
215
212
  colorLayerVisible: O = !0,
216
213
  visible: it
217
- } = this.props, S = new Y({
214
+ } = this.props, F = new Y({
218
215
  breaks: $,
219
- defaultFillColor: g,
216
+ defaultFillColor: b,
220
217
  defaultBorderColor: J,
221
218
  defaultSize: N
222
219
  }), A = new ot({
223
- data: z.children,
220
+ data: w.children,
224
221
  measure: I[0],
225
- defaultFillColor: g,
222
+ defaultFillColor: b,
226
223
  gradientScheme: G,
227
224
  gradientReverse: E
228
225
  });
229
226
  if (this.g) {
230
- const o = {
227
+ const s = {
231
228
  style: i.style === "compacted" ? "decimal" : i.style,
232
229
  notation: i.style === "compacted" ? "compact" : "standard",
233
230
  currency: i.currency,
234
231
  minimumFractionDigits: parseInt(i.minimumFractionDigits),
235
232
  maximumFractionDigits: parseInt(i.maximumFractionDigits)
236
- }, b = this.props.transform ? this.props.transform.k : 1;
233
+ }, y = this.props.transform ? this.props.transform.k : 1;
237
234
  this.g.selectAll(".centroids").remove();
238
- const m = this.g.selectAll("centroids").data(e).enter().append("g").attr("class", "centroids");
239
- m.append("circle").attr("fill", (a) => V ? A.getColor(a.properties._value) : S.getColor(a.properties._value, !0)).attr("stroke", J).attr("class", "point").attr("stroke-width", 2).style("vector-effect", "non-scaling-stroke").attr("cx", (a) => c.centroid(a)[0]).attr("cy", (a) => c.centroid(a)[1]).attr("r", (a) => S.getSize(a.properties._value) * 1 / b).on("mouseenter", (a, t) => {
235
+ const g = this.g.selectAll("centroids").data(e).enter().append("g").attr("class", "centroids");
236
+ g.append("circle").attr("fill", (a) => V ? A.getColor(a.properties._value) : F.getColor(a.properties._value, !0)).attr("stroke", J).attr("class", "point").attr("stroke-width", 2).style("vector-effect", "non-scaling-stroke").attr("cx", (a) => c.centroid(a)[0]).attr("cy", (a) => c.centroid(a)[1]).attr("r", (a) => F.getSize(a.properties._value) * 1 / y).on("mouseenter", (a, t) => {
240
237
  if (t.properties._value) {
241
- const y = {
238
+ const v = {
242
239
  ...t.properties,
243
240
  meta: {
244
241
  [K]: t.properties.meta ? t.properties.meta.value : "",
@@ -246,32 +243,32 @@ class ht extends pt {
246
243
  value: t.properties._value
247
244
  }
248
245
  };
249
- this.showToolTip(x, y, V ? A.getColor(t.properties._value) : S.getColor(t.properties._value));
246
+ this.showToolTip(z, v, V ? A.getColor(t.properties._value) : F.getColor(t.properties._value));
250
247
  }
251
248
  }).on("mouseleave", (a) => {
252
249
  this.hiddenToolTip();
253
- }), m.append("text").attr("class", "point-label").attr("x", (a) => c.centroid(a)[0]).attr("y", (a) => c.centroid(a)[1]).attr("font-size", (a) => H * (1 / b) + "px").attr("text-anchor", "middle").attr("dominant-baseline", "middle").style("pointer-events", "none").attr("fill", P).text((a) => q.formatNumber(i.style === "percent" ? a.properties._value / 100 : a.properties._value, o)).on("mouseover", (a) => {
250
+ }), g.append("text").attr("class", "point-label").attr("x", (a) => c.centroid(a)[0]).attr("y", (a) => c.centroid(a)[1]).attr("font-size", (a) => H * (1 / y) + "px").attr("text-anchor", "middle").attr("dominant-baseline", "middle").style("pointer-events", "none").attr("fill", T).text((a) => q.formatNumber(i.style === "percent" ? a.properties._value / 100 : a.properties._value, s)).on("mouseover", (a) => {
254
251
  }), O || this.g.selectAll(".centroids").style("display", "none");
255
252
  }
256
253
  }
257
254
  createPatterns(e) {
258
255
  const {
259
- app: p,
260
- svg: v,
256
+ app: l,
257
+ svg: C,
261
258
  format: i,
262
259
  id: u,
263
260
  file: h,
264
261
  path: c,
265
- onLayerCreated: F,
266
- labelFilter: l = [],
267
- labelField: d,
268
- labelFontSize: s,
269
- labelColor: n,
270
- fillColor: L,
271
- borderColor: f,
272
- tooltip: x,
273
- markFillColor: g,
274
- markLabelColor: P,
262
+ onLayerCreated: x,
263
+ labelFilter: o = [],
264
+ labelField: f,
265
+ labelFontSize: n,
266
+ labelColor: d,
267
+ fillColor: p,
268
+ borderColor: m,
269
+ tooltip: z,
270
+ markFillColor: b,
271
+ markLabelColor: T,
275
272
  markBorderColor: J,
276
273
  markSizeScale: N,
277
274
  markerLabelSize: H,
@@ -279,13 +276,13 @@ class ht extends pt {
279
276
  apiJoinAttribute: K,
280
277
  measures: I,
281
278
  editing: et,
282
- data: z,
283
- patternDiscriminator: k,
279
+ data: w,
280
+ patternDiscriminator: S,
284
281
  patternDiscriminatorLabel: Q,
285
282
  breaks: $,
286
283
  gradientScheme: G,
287
284
  gradientReverse: E,
288
- patterns: w,
285
+ patterns: L,
289
286
  projection: rt,
290
287
  useBreaks: X,
291
288
  useGradients: V,
@@ -293,49 +290,49 @@ class ht extends pt {
293
290
  usePattern: j,
294
291
  waitForFilters: at,
295
292
  intl: q,
296
- patternsVisible: B = !0,
297
- togglePatterns: R,
293
+ patternsVisible: R = !0,
294
+ togglePatterns: B,
298
295
  colorLayerVisible: O = !0,
299
296
  visible: it
300
- } = this.props, S = new Y({
297
+ } = this.props, F = new Y({
301
298
  breaks: $,
302
- defaultFillColor: g,
299
+ defaultFillColor: b,
303
300
  defaultBorderColor: J,
304
301
  defaultSize: N
305
- }), A = this.props.transform ? this.props.transform.k : 1, o = 10 * 1 / A, b = 10 * 1 / A;
306
- let m = [];
307
- if (p == "csv" && k != "none")
308
- m = [...new Set(z.data.map((t) => t[k]))].map((t) => ({
302
+ }), A = this.props.transform ? this.props.transform.k : 1, s = 10 * 1 / A, y = 10 * 1 / A;
303
+ let g = [];
304
+ if (l == "csv" && S != "none")
305
+ g = [...new Set(w.data.map((t) => t[S]))].map((t) => ({
309
306
  key: t,
310
- type: w[t + "_symbol"],
311
- color: w[t + "_color"],
312
- rotation: w[t + "_rotation"]
307
+ type: L[t + "_symbol"],
308
+ color: L[t + "_color"],
309
+ rotation: L[t + "_rotation"]
313
310
  }));
314
- else if (k != "none") {
315
- const t = z.metadata ? z.metadata.types.filter((y) => y.dimension == k) : [];
316
- m = t && t.length > 0 ? t[0].items.map((y) => {
317
- const _ = y.value;
311
+ else if (S != "none") {
312
+ const t = w.metadata ? w.metadata.types.filter((v) => v.dimension == S) : [];
313
+ g = t && t.length > 0 ? t[0].items.map((v) => {
314
+ const _ = v.value;
318
315
  return {
319
316
  key: _,
320
- type: w[_ + "_symbol"],
321
- color: w[_ + "_color"],
322
- rotation: w[_ + "_rotation"]
317
+ type: L[_ + "_symbol"],
318
+ color: L[_ + "_color"],
319
+ rotation: L[_ + "_rotation"]
323
320
  };
324
321
  }) : [];
325
322
  }
326
323
  this.g.selectAll("defs").remove();
327
324
  const a = this.g.append("defs");
328
- if (a.selectAll("pattern").remove(), a.selectAll("pattern").data(m).enter().append("pattern").attr("id", (t) => C(t.key)).attr("patternUnits", "userSpaceOnUse").attr("width", o).attr("height", b).attr("x", 0).attr("y", 0).attr("patternTransform", (t) => `rotate(${t.rotation})`), m.forEach((t) => {
329
- t.type === "lines" && a.select("#" + C(t.key)).append("rect").attr("x", 0.05).attr("width", o / 2).attr("height", b).attr("opacity", 1).attr("fill", t.color), t.type === "squares" && a.select("#" + C(t.key)).append("rect").attr("width", o / 2).attr("height", b / 2).attr("fill", t.color).attr("opacity", 1).attr("stroke-width", 1), t.type === "dots" && a.select("#" + C(t.key)).append("circle").attr("cx", o / 2).attr("cy", b / 2).attr("r", o / 2.5).attr("fill", t.color).attr("opacity", 1).attr("stroke-width", 1), t.type === "triangle" && a.select("#" + C(t.key)).append("polygon").attr("points", `${o / 2} 0, 0 ${o}, ${o} ${o} `).attr("fill", t.color).attr("opacity", 1).attr("stroke-width", 1);
330
- }), m = m.filter((t) => t.type != null).sort((t, y) => new Intl.Collator(q.locale, { caseFirst: "upper", numeric: !0, sensitivity: "variant" }).compare(t.key, y.key)), j && e && e.features) {
331
- this.g.selectAll(".shape-pattern").remove(), B && e.features.forEach((r) => {
332
- let T = [];
333
- r.properties && r.properties.meta && (T = p != "csv" ? r.properties.meta[k] ? r.properties.meta[k] : [] : [r.properties.meta[k]], T && T.length > 0 && T.forEach((lt) => {
325
+ if (a.selectAll("pattern").remove(), a.selectAll("pattern").data(g).enter().append("pattern").attr("id", (t) => k(t.key)).attr("patternUnits", "userSpaceOnUse").attr("width", s).attr("height", y).attr("x", 0).attr("y", 0).attr("patternTransform", (t) => `rotate(${t.rotation})`), g.forEach((t) => {
326
+ t.type === "lines" && a.select("#" + k(t.key)).append("rect").attr("x", 0.05).attr("width", s / 2).attr("height", y).attr("opacity", 1).attr("fill", t.color), t.type === "squares" && a.select("#" + k(t.key)).append("rect").attr("width", s / 2).attr("height", y / 2).attr("fill", t.color).attr("opacity", 1).attr("stroke-width", 1), t.type === "dots" && a.select("#" + k(t.key)).append("circle").attr("cx", s / 2).attr("cy", y / 2).attr("r", s / 2.5).attr("fill", t.color).attr("opacity", 1).attr("stroke-width", 1), t.type === "triangle" && a.select("#" + k(t.key)).append("polygon").attr("points", `${s / 2} 0, 0 ${s}, ${s} ${s} `).attr("fill", t.color).attr("opacity", 1).attr("stroke-width", 1);
327
+ }), g = g.filter((t) => t.type != null).sort((t, v) => new Intl.Collator(q.locale, { caseFirst: "upper", numeric: !0, sensitivity: "variant" }).compare(t.key, v.key)), j && e && e.features) {
328
+ this.g.selectAll(".shape-pattern").remove(), R && e.features.forEach((r) => {
329
+ let P = [];
330
+ r.properties && r.properties.meta && (P = l != "csv" ? r.properties.meta[S] ? r.properties.meta[S] : [] : [r.properties.meta[S]], P && P.length > 0 && P.forEach((lt) => {
334
331
  this.g.append("path").attr("d", c(r)).datum(lt).attr("class", "shape-pattern").attr("opacity", (st) => {
335
332
  if (X)
336
333
  return 0.7;
337
- }).attr("fill", (st) => "transparent").attr("style", () => "none;fill:url(#" + C(lt) + ");").on("mouseenter", () => {
338
- this.showToolTip(x, this.getTooltipVariables(r), V ? gradientColors.getColor(r.properties._value) : S.getColor(r.properties._value));
334
+ }).attr("fill", (st) => "transparent").attr("style", () => "none;fill:url(#" + k(lt) + ");").on("mouseenter", () => {
335
+ this.showToolTip(z, this.getTooltipVariables(r), V ? gradientColors.getColor(r.properties._value) : F.getColor(r.properties._value));
339
336
  }).on("mousemove", (st) => {
340
337
  this.moveToolTip();
341
338
  }).on("mouseleave", (st) => {
@@ -343,58 +340,53 @@ class ht extends pt {
343
340
  });
344
341
  }));
345
342
  }), M.select(this.gRef.current.parentNode.parentNode).select(`.layer_${W(u)}`).select("svg").remove();
346
- debugger;
347
343
  const t = M.select(this.gRef.current.parentNode.parentNode).select(`.layer_${W(u)}`).append("svg");
348
- t.attr("height", 30 + m.length * 23 + "px");
349
- const y = t.append("svg").append("g"), _ = y.append("defs");
350
- _.selectAll("pattern").remove(), B && (_.selectAll("pattern").data(m).enter().append("pattern").attr("id", (r) => "l_" + C(r.key)).attr("patternUnits", "userSpaceOnUse").attr("width", 5).attr("height", 5).attr("x", 0).attr("y", 0).attr("patternTransform", (r) => `rotate(${r.rotation ? r.rotation : 0})`), m.forEach((r) => {
351
- r.type === "lines" && _.select("#l_" + C(r.key)).append("rect").attr("x", 0).attr("width", 1).attr("height", 10).attr("opacity", 0.75).attr("fill", r.color), r.type === "squares" && _.select("#l_" + C(r.key)).append("rect").attr("width", 3).attr("height", 3).attr("fill", r.color).attr("opacity", 1).attr("stroke-width", 1), r.type === "dots" && _.select("#l_" + C(r.key)).append("circle").attr("cx", 2).attr("cy", 2).attr("r", 2).attr("fill", r.color).attr("opacity", 1).attr("stroke-width", 1), r.type === "triangle" && _.select("#l_" + C(r.key)).append("polygon").attr("points", "5,0 8,8 0,5").attr("fill", r.color).attr("opacity", 1).attr("stroke-width", 1);
344
+ t.attr("height", 30 + g.length * 23 + "px");
345
+ const v = t.append("svg").append("g"), _ = v.append("defs");
346
+ _.selectAll("pattern").remove(), R && (_.selectAll("pattern").data(g).enter().append("pattern").attr("id", (r) => "l_" + k(r.key)).attr("patternUnits", "userSpaceOnUse").attr("width", 5).attr("height", 5).attr("x", 0).attr("y", 0).attr("patternTransform", (r) => `rotate(${r.rotation ? r.rotation : 0})`), g.forEach((r) => {
347
+ r.type === "lines" && _.select("#l_" + k(r.key)).append("rect").attr("x", 0).attr("width", 1).attr("height", 10).attr("opacity", 0.75).attr("fill", r.color), r.type === "squares" && _.select("#l_" + k(r.key)).append("rect").attr("width", 3).attr("height", 3).attr("fill", r.color).attr("opacity", 1).attr("stroke-width", 1), r.type === "dots" && _.select("#l_" + k(r.key)).append("circle").attr("cx", 2).attr("cy", 2).attr("r", 2).attr("fill", r.color).attr("opacity", 1).attr("stroke-width", 1), r.type === "triangle" && _.select("#l_" + k(r.key)).append("polygon").attr("points", "5,0 8,8 0,5").attr("fill", r.color).attr("opacity", 1).attr("stroke-width", 1);
352
348
  }));
353
- let nt = B ? "☑ " : "☐ ";
354
- y.append("text").attr("class", "patterns-checkbox").attr("x", 10).attr("y", 20).text((r) => nt).attr("font-size", "22px").on("click", () => {
355
- R && R(u);
356
- }), y.append("text").attr("class", "patterns-title").attr("x", 25).attr("y", 7).text((r) => p === "csv" ? k : Q).on("click", () => {
357
- R && R(u);
358
- }), B && (y.selectAll(".legend-squares").data(m).enter().append("rect").attr("width", 15).attr("height", 15).attr("y", (r, T) => T * 22 + 30).attr("x", 15).attr("stroke", f).attr("style", (r) => "none;fill:url(#l_" + C(r.key) + ");"), y.selectAll(".patterns-labels").data(m).enter().append("text").attr("class", "patterns-labels").attr("y", (r, T) => T * 22 + 30).attr("x", 32).text((r) => r.key));
349
+ let nt = R ? "☑ " : "☐ ";
350
+ v.append("text").attr("class", "patterns-checkbox").attr("x", 10).attr("y", 20).text((r) => nt).attr("font-size", "22px").on("click", () => {
351
+ B && B(u);
352
+ }), v.append("text").attr("class", "patterns-title").attr("x", 25).attr("y", 7).text((r) => l === "csv" ? S : Q).on("click", () => {
353
+ B && B(u);
354
+ }), R && (v.selectAll(".legend-squares").data(g).enter().append("rect").attr("width", 15).attr("height", 15).attr("y", (r, P) => P * 22 + 30).attr("x", 15).attr("stroke", m).attr("style", (r) => "none;fill:url(#l_" + k(r.key) + ");"), v.selectAll(".patterns-labels").data(g).enter().append("text").attr("class", "patterns-labels").attr("y", (r, P) => P * 22 + 30).attr("x", 32).text((r) => r.key));
359
355
  }
360
356
  }
361
- joinData(e, p, v, i, u, h) {
362
- const c = e.features.map((l) => {
363
- const d = l.properties[v];
364
- if (p != "csv" && i && i.children) {
365
- const s = i.children.filter((n) => n.value == d);
366
- if (s.length > 0) {
367
- const n = s[0][u[0]];
368
- if (l.properties.meta = s[0], l.properties._value = n, h && h != "none") {
369
- const L = s[0] && s[0].children ? s[0].children.filter((f) => f.type == h).map((f) => f.value) : [];
370
- l.properties.meta[h] = L;
357
+ joinData(e, l, C, i, u, h) {
358
+ const c = e.features.map((o) => {
359
+ const f = o.properties[C];
360
+ if (l != "csv" && i && i.children) {
361
+ const n = i.children.filter((d) => d.value == f);
362
+ if (n.length > 0) {
363
+ const d = n[0][u[0]];
364
+ if (o.properties.meta = n[0], o.properties._value = d, h && h != "none") {
365
+ const p = n[0] && n[0].children ? n[0].children.filter((m) => m.type == h).map((m) => m.value) : [];
366
+ o.properties.meta[h] = p;
371
367
  }
372
368
  } else
373
- l.properties._value = null;
374
- } else if (p == "csv") {
375
- const s = i.data.filter((n) => n[i.meta.fields[0]] == d);
376
- s.length > 0 ? (l.properties.meta = s[0], l.properties._value = s[0][i.meta.fields[1]]) : l.properties._value = null;
369
+ o.properties._value = null;
370
+ } else if (l == "csv") {
371
+ const n = i.data.filter((d) => d[i.meta.fields[0]] == f);
372
+ n.length > 0 ? (o.properties.meta = n[0], o.properties._value = n[0][i.meta.fields[1]]) : o.properties._value = null;
377
373
  } else
378
- l.properties._value = null;
379
- return l;
374
+ o.properties._value = null;
375
+ return o;
380
376
  });
381
377
  return { ...e, features: c };
382
378
  }
383
- componentDidUpdate(e, p, v) {
384
- const { app: i, file: u, featureJoinAttribute: h, data: c, measures: F, patternDiscriminator: l, editing: d } = this.props;
385
- if (d || JSON.stringify(e.data) !== JSON.stringify(c)) {
386
- debugger;
387
- this.create();
388
- }
389
- if (e.visible != this.props.visible) {
379
+ componentDidUpdate(e, l, C) {
380
+ const { app: i, file: u, featureJoinAttribute: h, data: c, measures: x, patternDiscriminator: o, editing: f, usePattern: n } = this.props;
381
+ if ((f || JSON.stringify(e.data) !== JSON.stringify(c)) && this.create(), e.visible != this.props.visible) {
390
382
  debugger;
391
383
  this.g.style("display", this.props.visible ? "" : "none");
392
384
  }
393
385
  if (e.patternsVisible != this.props.patternsVisible) {
394
- const n = M.select(this.gRef.current.parentNode.parentNode).select(`.layer_${W(this.props.id)}`);
395
- n.select(".patterns-checkbox").text(this.props.patternsVisible ? "☑ " : "☐ "), n.selectAll(".patterns-labels").style("display", this.props.patternsVisible ? "" : "none"), n.selectAll("rect").style("display", this.props.patternsVisible ? "" : "none"), n.select("svg").attr("height", this.props.patternsVisible ? 30 + (n.selectAll("rect").size() - 1) * 23 + "px" : "30px"), this.g.selectAll(".shape-pattern").style("display", this.props.patternsVisible ? "" : "none");
386
+ const p = M.select(this.gRef.current.parentNode.parentNode).select(`.layer_${W(this.props.id)}`);
387
+ p.select(".patterns-checkbox").text(this.props.patternsVisible ? "☑ " : "☐ "), p.selectAll(".patterns-labels").style("display", this.props.patternsVisible ? "" : "none"), p.selectAll("rect").style("display", this.props.patternsVisible ? "" : "none"), p.select("svg").attr("height", this.props.patternsVisible ? 30 + (p.selectAll("rect").size() - 1) * 23 + "px" : "30px"), this.g.selectAll(".shape-pattern").style("display", this.props.patternsVisible ? "" : "none");
396
388
  }
397
- e.colorLayerVisible != this.props.colorLayerVisible && (this.g.selectAll(".borders").style("fill", (s) => {
389
+ e.colorLayerVisible != this.props.colorLayerVisible && (this.g.selectAll(".borders").style("fill", (d) => {
398
390
  debugger;
399
391
  return this.props.colorLayerVisible ? null : this.props.fillColor;
400
392
  }), this.g.selectAll(".centroids").style("display", this.props.colorLayerVisible ? "block" : "none")), e.usePattern != this.props.usePattern && (this.props.usePattern || M.select(this.gRef.current.parentNode.parentNode).select(`.layer_${W(this.props.id)}`).select("svg").remove()), this.g && this.resize();
@@ -405,19 +397,19 @@ class ht extends pt {
405
397
  render() {
406
398
  const {
407
399
  id: e,
408
- file: p,
409
- path: v,
400
+ file: l,
401
+ path: C,
410
402
  zoom: i,
411
403
  labelFilter: u = [],
412
404
  labelField: h,
413
405
  labelFontSize: c,
414
- labelColor: F,
415
- fillColor: l,
416
- borderColor: d,
417
- featureJoinAttribute: s,
418
- apiJoinAttribute: n,
419
- dvzProxyDatasetId: L,
420
- editing: f
406
+ labelColor: x,
407
+ fillColor: o,
408
+ borderColor: f,
409
+ featureJoinAttribute: n,
410
+ apiJoinAttribute: d,
411
+ dvzProxyDatasetId: p,
412
+ editing: m
421
413
  } = this.props;
422
414
  return /* @__PURE__ */ Z("g", { id: "data-" + e, className: "data " + e, ref: this.gRef });
423
415
  }
@@ -425,38 +417,38 @@ class ht extends pt {
425
417
  const ft = (D) => {
426
418
  const {
427
419
  id: e,
428
- unique: p,
429
- filters: v,
420
+ unique: l,
421
+ filters: C,
430
422
  csv: i,
431
423
  app: u,
432
424
  group: h = "default",
433
425
  apiJoinAttribute: c,
434
- editing: F,
435
- patternDiscriminator: l,
436
- dvzProxyDatasetId: d,
437
- intl: s,
438
- settings: n,
439
- waitForFilters: L
440
- } = D, f = {}, x = v || {};
441
- return x && x.forEach && x.forEach((g) => {
442
- g.value != null && g.value.filter((P) => P != null && P.toString().trim() != "").length > 0 && (f[g.param] = g.value);
443
- }), d && (f.dvzProxyDatasetId = d), /* @__PURE__ */ Z(
426
+ editing: x,
427
+ patternDiscriminator: o,
428
+ dvzProxyDatasetId: f,
429
+ intl: n,
430
+ settings: d,
431
+ waitForFilters: p
432
+ } = D, m = {}, z = C || {};
433
+ return z && z.forEach && z.forEach((b) => {
434
+ b.value != null && b.value.filter((T) => T != null && T.toString().trim() != "").length > 0 && (m[b.param] = b.value);
435
+ }), f && (m.dvzProxyDatasetId = f), /* @__PURE__ */ Z(
444
436
  ct,
445
437
  {
446
- waitForFilters: L,
447
- editing: F,
448
- params: f,
438
+ waitForFilters: p,
439
+ editing: x,
440
+ params: m,
449
441
  app: u,
450
442
  csv: decodeURIComponent(i),
451
443
  group: h,
452
444
  ignoreErrors: !0,
453
445
  isSvg: !0,
454
- store: [u, p, e],
455
- source: c + (l != "none" ? "/" + l : ""),
446
+ store: [u, l, e],
447
+ source: c + (o != "none" ? "/" + o : ""),
456
448
  children: /* @__PURE__ */ Z(ut, { children: /* @__PURE__ */ Z(ht, { ...D }) })
457
449
  }
458
450
  );
459
- }, _t = dt(ft);
451
+ }, Ft = dt(ft);
460
452
  export {
461
- _t as default
453
+ Ft as default
462
454
  };