@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.
- 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/cjs/layout/PreviewComponent.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/esm/layout/PreviewComponent.js +8 -8
- package/dist/types/embeddable/d3Map/Utils.d.ts +4 -0
- package/package.json +1 -1
|
@@ -6,136 +6,136 @@ import { injectIntl as X } from "react-intl";
|
|
|
6
6
|
import Y from "../data/D3MapDataProvider.js";
|
|
7
7
|
import Z from "../data/D3MapDataConsumer.js";
|
|
8
8
|
import ee from "./GradientColors.js";
|
|
9
|
-
import { Icon as
|
|
10
|
-
const
|
|
9
|
+
import { Icon as V } from "semantic-ui-react";
|
|
10
|
+
const A = ({ breaks: l, isPoint: c, numberFormat: m, intl: C }) => l.length > 0 && /* @__PURE__ */ e("div", { className: "legend-breaks", children: l.map((s, u) => s.type !== "graterThan" ? /* @__PURE__ */ a("div", { className: "break", children: [
|
|
11
11
|
/* @__PURE__ */ e(
|
|
12
12
|
"div",
|
|
13
13
|
{
|
|
14
|
-
className: `break-item ${
|
|
14
|
+
className: `break-item ${c ? "point" : ""}`,
|
|
15
15
|
style: {
|
|
16
|
-
backgroundColor:
|
|
17
|
-
border: `1px solid ${
|
|
16
|
+
backgroundColor: s.color,
|
|
17
|
+
border: `1px solid ${s.borderColor}`
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
),
|
|
21
21
|
/* @__PURE__ */ a("div", { className: "break-label", children: [
|
|
22
22
|
" < ",
|
|
23
|
-
|
|
23
|
+
C.formatNumber(s.end, m)
|
|
24
24
|
] })
|
|
25
25
|
] }) : /* @__PURE__ */ a("div", { className: "break", children: [
|
|
26
26
|
/* @__PURE__ */ e(
|
|
27
27
|
"div",
|
|
28
28
|
{
|
|
29
|
-
className: `break-item ${
|
|
29
|
+
className: `break-item ${c ? "point" : ""}`,
|
|
30
30
|
style: {
|
|
31
|
-
backgroundColor:
|
|
32
|
-
border: `1px solid ${
|
|
31
|
+
backgroundColor: s.color,
|
|
32
|
+
border: `1px solid ${s.borderColor}`
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
),
|
|
36
36
|
/* @__PURE__ */ a("div", { className: "break-label", children: [
|
|
37
37
|
" > ",
|
|
38
|
-
|
|
38
|
+
C.formatNumber(s.end, m)
|
|
39
39
|
] })
|
|
40
40
|
] })) }), re = (l) => {
|
|
41
41
|
const {
|
|
42
|
-
name:
|
|
43
|
-
breaks:
|
|
44
|
-
pointStyleBy:
|
|
45
|
-
dimension2:
|
|
46
|
-
pointDimensionStyles:
|
|
47
|
-
markFillColor:
|
|
48
|
-
markBorderColor:
|
|
49
|
-
measures:
|
|
50
|
-
visible:
|
|
51
|
-
format:
|
|
42
|
+
name: c,
|
|
43
|
+
breaks: m,
|
|
44
|
+
pointStyleBy: C,
|
|
45
|
+
dimension2: s,
|
|
46
|
+
pointDimensionStyles: u = {},
|
|
47
|
+
markFillColor: o,
|
|
48
|
+
markBorderColor: g,
|
|
49
|
+
measures: f,
|
|
50
|
+
visible: p,
|
|
51
|
+
format: h,
|
|
52
52
|
intl: D,
|
|
53
53
|
id: r,
|
|
54
|
-
onItemClick:
|
|
55
|
-
customMeasuresLabels:
|
|
56
|
-
} = l,
|
|
57
|
-
style:
|
|
58
|
-
notation:
|
|
59
|
-
currency:
|
|
60
|
-
minimumFractionDigits: parseInt(
|
|
61
|
-
maximumFractionDigits: parseInt(
|
|
54
|
+
onItemClick: v,
|
|
55
|
+
customMeasuresLabels: k
|
|
56
|
+
} = l, t = {
|
|
57
|
+
style: h.style === "compacted" ? "decimal" : h.style,
|
|
58
|
+
notation: h.style === "compacted" ? "compact" : "standard",
|
|
59
|
+
currency: h.currency,
|
|
60
|
+
minimumFractionDigits: parseInt(h.minimumFractionDigits),
|
|
61
|
+
maximumFractionDigits: parseInt(h.maximumFractionDigits)
|
|
62
62
|
};
|
|
63
|
-
let
|
|
64
|
-
return
|
|
63
|
+
let d = f[0];
|
|
64
|
+
return k && (d = k[f[0]]), [...new Set(Object.keys(u).map((b) => b.split("_")[0]))], /* @__PURE__ */ e("div", { className: "legend", children: /* @__PURE__ */ a("div", { children: [
|
|
65
65
|
/* @__PURE__ */ a("div", { className: "legend-item", children: [
|
|
66
66
|
/* @__PURE__ */ e(
|
|
67
67
|
"div",
|
|
68
68
|
{
|
|
69
69
|
className: "legend-color legend-check",
|
|
70
|
-
onClick: (b) =>
|
|
70
|
+
onClick: (b) => v(r),
|
|
71
71
|
style: {
|
|
72
|
-
backgroundColor:
|
|
73
|
-
borderColor:
|
|
72
|
+
backgroundColor: o,
|
|
73
|
+
borderColor: g
|
|
74
74
|
},
|
|
75
|
-
children:
|
|
75
|
+
children: p != !1 && /* @__PURE__ */ e($, { children: "✓" })
|
|
76
76
|
}
|
|
77
77
|
),
|
|
78
78
|
/* @__PURE__ */ a("div", { className: "legend-label", children: [
|
|
79
|
-
|
|
79
|
+
c,
|
|
80
80
|
" (",
|
|
81
|
-
|
|
81
|
+
d,
|
|
82
82
|
")"
|
|
83
83
|
] })
|
|
84
84
|
] }),
|
|
85
|
-
|
|
85
|
+
p != !1 && /* @__PURE__ */ e(A, { breaks: m, symbol: "arrow", numberFormat: t, intl: D })
|
|
86
86
|
] }) });
|
|
87
87
|
}, ae = (l) => {
|
|
88
88
|
const {
|
|
89
|
-
id:
|
|
90
|
-
name:
|
|
91
|
-
breaks:
|
|
92
|
-
intl:
|
|
93
|
-
pointStyleBy:
|
|
94
|
-
format:
|
|
95
|
-
dimension2:
|
|
96
|
-
pointDimensionStyles:
|
|
97
|
-
markFillColor:
|
|
98
|
-
markBorderColor:
|
|
89
|
+
id: c,
|
|
90
|
+
name: m,
|
|
91
|
+
breaks: C,
|
|
92
|
+
intl: s,
|
|
93
|
+
pointStyleBy: u,
|
|
94
|
+
format: o,
|
|
95
|
+
dimension2: g,
|
|
96
|
+
pointDimensionStyles: f = {},
|
|
97
|
+
markFillColor: p,
|
|
98
|
+
markBorderColor: h,
|
|
99
99
|
measures: D,
|
|
100
100
|
visible: r,
|
|
101
|
-
onItemClick:
|
|
102
|
-
customMeasuresLabels:
|
|
103
|
-
allCategories:
|
|
104
|
-
showDim2OnLegends:
|
|
101
|
+
onItemClick: v,
|
|
102
|
+
customMeasuresLabels: k,
|
|
103
|
+
allCategories: t,
|
|
104
|
+
showDim2OnLegends: d,
|
|
105
105
|
dim2LegendLabel: b,
|
|
106
106
|
type: L,
|
|
107
107
|
d2Click: x,
|
|
108
108
|
selectedItem: F
|
|
109
|
-
} = l,
|
|
110
|
-
style:
|
|
111
|
-
notation:
|
|
112
|
-
currency:
|
|
113
|
-
minimumFractionDigits: parseInt(
|
|
114
|
-
maximumFractionDigits: parseInt(
|
|
109
|
+
} = l, y = {
|
|
110
|
+
style: o.style === "compacted" ? "decimal" : o.style,
|
|
111
|
+
notation: o.style === "compacted" ? "compact" : "standard",
|
|
112
|
+
currency: o.currency,
|
|
113
|
+
minimumFractionDigits: parseInt(o.minimumFractionDigits),
|
|
114
|
+
maximumFractionDigits: parseInt(o.maximumFractionDigits)
|
|
115
115
|
};
|
|
116
116
|
let S = D[0];
|
|
117
|
-
|
|
118
|
-
const w =
|
|
117
|
+
k && (S = k[D[0]]);
|
|
118
|
+
const w = g && t ? t.filter((i) => i.type.toUpperCase() == g.toUpperCase()) : [], N = (w.length > 0 ? w[0].items : []).map((i) => i.value), P = u === "dimension" || d ? g : S;
|
|
119
119
|
return /* @__PURE__ */ e("div", { className: "legend", children: /* @__PURE__ */ a("div", { children: [
|
|
120
120
|
/* @__PURE__ */ a("div", { className: "legend-item", children: [
|
|
121
121
|
/* @__PURE__ */ e(
|
|
122
122
|
"div",
|
|
123
123
|
{
|
|
124
124
|
className: "legend-color legend-check",
|
|
125
|
-
onClick: (i) =>
|
|
126
|
-
style:
|
|
127
|
-
backgroundColor:
|
|
128
|
-
borderColor:
|
|
125
|
+
onClick: (i) => v(c),
|
|
126
|
+
style: u === "measure" || d ? {} : {
|
|
127
|
+
backgroundColor: p,
|
|
128
|
+
borderColor: h
|
|
129
129
|
},
|
|
130
130
|
children: r != !1 && /* @__PURE__ */ e($, { children: "✓" })
|
|
131
131
|
}
|
|
132
132
|
),
|
|
133
133
|
/* @__PURE__ */ a("div", { className: "legend-label", children: [
|
|
134
|
-
|
|
134
|
+
m,
|
|
135
135
|
" "
|
|
136
136
|
] })
|
|
137
137
|
] }),
|
|
138
|
-
|
|
138
|
+
u === "measure" && r != !1 && /* @__PURE__ */ e("div", { className: "legend-breaks", children: C.map((i, z) => /* @__PURE__ */ a("div", { className: "break", children: [
|
|
139
139
|
/* @__PURE__ */ e("div", { className: "break-item", style: {
|
|
140
140
|
backgroundColor: i.color,
|
|
141
141
|
border: `1px solid ${i.borderColor}`,
|
|
@@ -143,12 +143,12 @@ const U = ({ breaks: l, isPoint: o, numberFormat: d, intl: v }) => l.length > 0
|
|
|
143
143
|
} }),
|
|
144
144
|
/* @__PURE__ */ a("div", { className: "break-label", children: [
|
|
145
145
|
" < ",
|
|
146
|
-
|
|
146
|
+
s.formatNumber(i.end, y)
|
|
147
147
|
] })
|
|
148
148
|
] })) }),
|
|
149
|
-
r != !1 &&
|
|
150
|
-
r != !1 &&
|
|
151
|
-
|
|
149
|
+
r != !1 && d != !1 && /* @__PURE__ */ e("div", { className: "legend", children: /* @__PURE__ */ e("div", { className: "legend-item", children: /* @__PURE__ */ e("div", { className: "legend-label", children: b || P }) }) }),
|
|
150
|
+
r != !1 && d != !1 && /* @__PURE__ */ e("div", { className: "legend-breaks", children: N.map((i) => /* @__PURE__ */ a("div", { className: "break", children: [
|
|
151
|
+
u === "measure" ? /* @__PURE__ */ e(
|
|
152
152
|
"span",
|
|
153
153
|
{
|
|
154
154
|
className: "break-item dim2-item"
|
|
@@ -158,8 +158,8 @@ const U = ({ breaks: l, isPoint: o, numberFormat: d, intl: v }) => l.length > 0
|
|
|
158
158
|
{
|
|
159
159
|
className: "break-item",
|
|
160
160
|
style: {
|
|
161
|
-
backgroundColor:
|
|
162
|
-
border: `1px solid ${
|
|
161
|
+
backgroundColor: f[i + "_color"] || p,
|
|
162
|
+
border: `1px solid ${f[i + "_border"] || h}`,
|
|
163
163
|
borderRadius: L == "dataPoints" ? "50%" : "0"
|
|
164
164
|
}
|
|
165
165
|
}
|
|
@@ -168,55 +168,55 @@ const U = ({ breaks: l, isPoint: o, numberFormat: d, intl: v }) => l.length > 0
|
|
|
168
168
|
] })) })
|
|
169
169
|
] }) });
|
|
170
170
|
}, ie = (l) => {
|
|
171
|
-
const { fillColor:
|
|
171
|
+
const { fillColor: c, borderColor: m, name: C, visible: s, id: u, onItemClick: o } = l;
|
|
172
172
|
return /* @__PURE__ */ e("div", { className: "legend", children: /* @__PURE__ */ a("div", { className: "legend-item", children: [
|
|
173
173
|
/* @__PURE__ */ e(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: "legend-color legend-check",
|
|
177
|
-
onClick: (
|
|
178
|
-
style: { backgroundColor:
|
|
179
|
-
children:
|
|
177
|
+
onClick: (g) => o(u),
|
|
178
|
+
style: { backgroundColor: c, borderColor: m },
|
|
179
|
+
children: s != !1 && /* @__PURE__ */ e($, { children: "✓" })
|
|
180
180
|
}
|
|
181
181
|
),
|
|
182
|
-
/* @__PURE__ */ e("div", { className: "legend-label", children:
|
|
182
|
+
/* @__PURE__ */ e("div", { className: "legend-label", children: C })
|
|
183
183
|
] }) });
|
|
184
184
|
}, le = (l) => {
|
|
185
185
|
const {
|
|
186
|
-
markFillColor:
|
|
187
|
-
fillColor:
|
|
188
|
-
markSizeScale:
|
|
189
|
-
markBorderColor:
|
|
190
|
-
useCentroidPoint:
|
|
191
|
-
name:
|
|
192
|
-
useBreaks:
|
|
193
|
-
useGradients:
|
|
194
|
-
breaks:
|
|
195
|
-
intl:
|
|
186
|
+
markFillColor: c,
|
|
187
|
+
fillColor: m,
|
|
188
|
+
markSizeScale: C,
|
|
189
|
+
markBorderColor: s,
|
|
190
|
+
useCentroidPoint: u,
|
|
191
|
+
name: o,
|
|
192
|
+
useBreaks: g,
|
|
193
|
+
useGradients: f,
|
|
194
|
+
breaks: p,
|
|
195
|
+
intl: h,
|
|
196
196
|
usePattern: D,
|
|
197
197
|
patternsData: r,
|
|
198
|
-
patternDiscriminator:
|
|
199
|
-
patternDiscriminatorLabel:
|
|
200
|
-
measures:
|
|
201
|
-
borderColor:
|
|
198
|
+
patternDiscriminator: v,
|
|
199
|
+
patternDiscriminatorLabel: k,
|
|
200
|
+
measures: t,
|
|
201
|
+
borderColor: d,
|
|
202
202
|
data: b,
|
|
203
203
|
app: L,
|
|
204
204
|
customMeasuresLabels: x,
|
|
205
205
|
divRef: F,
|
|
206
|
-
id:
|
|
206
|
+
id: y,
|
|
207
207
|
patternWidth: S = 0.35,
|
|
208
208
|
patternHeight: w = 0.25,
|
|
209
|
-
group:
|
|
209
|
+
group: j,
|
|
210
210
|
format: N,
|
|
211
211
|
csv: P,
|
|
212
212
|
visible: i,
|
|
213
213
|
onItemClick: z,
|
|
214
|
-
gradientScheme:
|
|
215
|
-
gradientReverse:
|
|
216
|
-
toggleColorLayer:
|
|
214
|
+
gradientScheme: G,
|
|
215
|
+
gradientReverse: J,
|
|
216
|
+
toggleColorLayer: E,
|
|
217
217
|
colorLayerVisible: B = !0,
|
|
218
|
-
gradientStartColor:
|
|
219
|
-
gradientEndColor:
|
|
218
|
+
gradientStartColor: U,
|
|
219
|
+
gradientEndColor: q
|
|
220
220
|
} = l;
|
|
221
221
|
let I = "";
|
|
222
222
|
const R = {
|
|
@@ -225,62 +225,62 @@ const U = ({ breaks: l, isPoint: o, numberFormat: d, intl: v }) => l.length > 0
|
|
|
225
225
|
currency: N.currency,
|
|
226
226
|
minimumFractionDigits: parseInt(N.minimumFractionDigits),
|
|
227
227
|
maximumFractionDigits: parseInt(N.maximumFractionDigits)
|
|
228
|
-
},
|
|
229
|
-
data:
|
|
230
|
-
measure:
|
|
231
|
-
defaultFillColor:
|
|
232
|
-
gradientScheme:
|
|
233
|
-
gradientReverse:
|
|
234
|
-
gradientStartColor:
|
|
235
|
-
gradientEndColor:
|
|
228
|
+
}, T = (n) => new ee({
|
|
229
|
+
data: n.children,
|
|
230
|
+
measure: t[0],
|
|
231
|
+
defaultFillColor: c,
|
|
232
|
+
gradientScheme: G,
|
|
233
|
+
gradientReverse: J,
|
|
234
|
+
gradientStartColor: U,
|
|
235
|
+
gradientEndColor: q
|
|
236
236
|
});
|
|
237
237
|
if (L != "csv" && x)
|
|
238
|
-
I = x[
|
|
238
|
+
I = x[t[0]];
|
|
239
239
|
else {
|
|
240
|
-
const
|
|
241
|
-
I =
|
|
240
|
+
const n = Q.parse(P, { header: !0, dynamicTyping: !0 });
|
|
241
|
+
I = n.meta.fields.length > 0 ? n.meta.fields[1] : "";
|
|
242
242
|
}
|
|
243
|
-
const M = (
|
|
243
|
+
const M = (n) => n ? n.toString().replace(/ /g, "_").toLocaleLowerCase() : "";
|
|
244
244
|
if (F.current) {
|
|
245
|
-
const
|
|
246
|
-
`.legend.layer_${M(
|
|
245
|
+
const n = F.current.querySelector(
|
|
246
|
+
`.legend.layer_${M(y)} svg`
|
|
247
247
|
);
|
|
248
|
-
|
|
248
|
+
n && (n.style.display = i === !1 ? "none" : "block");
|
|
249
249
|
}
|
|
250
|
-
const
|
|
251
|
-
return /* @__PURE__ */ e("div", { className: `legend layer_${M(
|
|
250
|
+
const H = (n) => Math.min(...n.children.map((_) => _[t[0]])), O = (n) => Math.max(...n.children.map((_) => _[t[0]]));
|
|
251
|
+
return /* @__PURE__ */ e("div", { className: `legend layer_${M(y)}`, id: M(`${j} ${o} ${y}`), children: /* @__PURE__ */ a("div", { children: [
|
|
252
252
|
/* @__PURE__ */ a("div", { className: "legend-item", children: [
|
|
253
253
|
/* @__PURE__ */ e(
|
|
254
254
|
"div",
|
|
255
255
|
{
|
|
256
256
|
className: "legend-color legend-check",
|
|
257
|
-
onClick: (
|
|
258
|
-
style: { backgroundColor:
|
|
257
|
+
onClick: (n) => z(y),
|
|
258
|
+
style: { backgroundColor: m, borderColor: d },
|
|
259
259
|
children: i != !1 && /* @__PURE__ */ e($, { children: "✓" })
|
|
260
260
|
}
|
|
261
261
|
),
|
|
262
|
-
/* @__PURE__ */ e("div", { className: "legend-label", children:
|
|
262
|
+
/* @__PURE__ */ e("div", { className: "legend-label", children: o })
|
|
263
263
|
] }),
|
|
264
|
-
|
|
264
|
+
u && !g && i != !1 && /* @__PURE__ */ e("div", { className: "legend-breaks", children: /* @__PURE__ */ a("div", { className: "break", children: [
|
|
265
265
|
/* @__PURE__ */ e(
|
|
266
266
|
"div",
|
|
267
267
|
{
|
|
268
268
|
className: `break-item point ${B ? "checked" : ""}`,
|
|
269
|
-
onClick: (
|
|
269
|
+
onClick: (n) => E(y),
|
|
270
270
|
style: {
|
|
271
|
-
backgroundColor:
|
|
272
|
-
border: `1px solid ${
|
|
271
|
+
backgroundColor: c,
|
|
272
|
+
border: `1px solid ${s}`
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
),
|
|
276
276
|
I
|
|
277
277
|
] }) }),
|
|
278
|
-
|
|
278
|
+
g && i != !1 && /* @__PURE__ */ a("div", { children: [
|
|
279
279
|
/* @__PURE__ */ e("div", { className: "legend-breaks", children: /* @__PURE__ */ a(
|
|
280
280
|
"div",
|
|
281
281
|
{
|
|
282
282
|
className: "legend-section-title",
|
|
283
|
-
onClick: (
|
|
283
|
+
onClick: (n) => E(y),
|
|
284
284
|
children: [
|
|
285
285
|
/* @__PURE__ */ e("div", { className: `legend-section-title-checkbox ${B ? "checked" : ""}` }),
|
|
286
286
|
/* @__PURE__ */ e("span", { className: "measure-label", children: I })
|
|
@@ -288,25 +288,25 @@ const U = ({ breaks: l, isPoint: o, numberFormat: d, intl: v }) => l.length > 0
|
|
|
288
288
|
}
|
|
289
289
|
) }),
|
|
290
290
|
B && /* @__PURE__ */ e(
|
|
291
|
-
|
|
291
|
+
A,
|
|
292
292
|
{
|
|
293
|
-
isPoint:
|
|
293
|
+
isPoint: u,
|
|
294
294
|
numberFormat: R,
|
|
295
|
-
breaks:
|
|
295
|
+
breaks: p,
|
|
296
296
|
visible: i,
|
|
297
|
-
intl:
|
|
297
|
+
intl: h
|
|
298
298
|
}
|
|
299
299
|
)
|
|
300
300
|
] }),
|
|
301
|
-
|
|
302
|
-
/* @__PURE__ */ e("div", { className: "gradient-label", style: { float: "right" }, children:
|
|
303
|
-
/* @__PURE__ */ e("div", { className: "gradient-label", style: { float: "left" }, children:
|
|
301
|
+
f && b && b.children && b.children.length > 0 && i != !1 && /* @__PURE__ */ a("div", { className: "gradient-container", children: [
|
|
302
|
+
/* @__PURE__ */ e("div", { className: "gradient-label", style: { float: "right" }, children: h.formatNumber(O(b), R) }),
|
|
303
|
+
/* @__PURE__ */ e("div", { className: "gradient-label", style: { float: "left" }, children: h.formatNumber(H(b), R) }),
|
|
304
304
|
/* @__PURE__ */ e(
|
|
305
305
|
"div",
|
|
306
306
|
{
|
|
307
307
|
className: "gradient-bar",
|
|
308
308
|
style: {
|
|
309
|
-
background: `linear-gradient(to right, ${
|
|
309
|
+
background: `linear-gradient(to right, ${T(b).getStartColor()}, ${T(b).getEndColor()})`,
|
|
310
310
|
width: "120px",
|
|
311
311
|
height: "10px"
|
|
312
312
|
}
|
|
@@ -315,42 +315,46 @@ const U = ({ breaks: l, isPoint: o, numberFormat: d, intl: v }) => l.length > 0
|
|
|
315
315
|
] })
|
|
316
316
|
] }) });
|
|
317
317
|
}, te = (l) => {
|
|
318
|
-
const
|
|
319
|
-
return /* @__PURE__ */ a("div", { className: `legends ${
|
|
320
|
-
/* @__PURE__ */ e("div", { className: "legend-collapsible-control", onClick: () =>
|
|
318
|
+
const c = W(null), [m, C] = K(!1), s = ({ size: r = 16, color: v = "currentColor" }) => /* @__PURE__ */ e(V, { name: "chevron down" }), u = ({ size: r = 16, color: v = "currentColor" }) => /* @__PURE__ */ e(V, { name: "chevron right" }), { layers: o = [], onItemClick: g, patternsData: f, group: p, intl: h, toggleColorLayer: D } = l;
|
|
319
|
+
return /* @__PURE__ */ a("div", { className: `legends ${m ? "collapsed" : ""}`, ref: c, children: [
|
|
320
|
+
/* @__PURE__ */ e("div", { className: "legend-collapsible-control", onClick: () => C(!m), children: m ? /* @__PURE__ */ a("div", { children: [
|
|
321
321
|
" ",
|
|
322
|
-
/* @__PURE__ */ e(
|
|
322
|
+
/* @__PURE__ */ e(u, { size: 14 }),
|
|
323
323
|
" Show Legend"
|
|
324
324
|
] }) : /* @__PURE__ */ a("div", { children: [
|
|
325
|
-
/* @__PURE__ */ e(
|
|
325
|
+
/* @__PURE__ */ e(s, { size: 14 }),
|
|
326
326
|
"Hide Legend"
|
|
327
327
|
] }) }),
|
|
328
|
-
/* @__PURE__ */ e("div", { className: "legends-content", children:
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}), r.dvzProxyDatasetId && (
|
|
333
|
-
r.
|
|
328
|
+
/* @__PURE__ */ e("div", { className: "legends-content", children: o && o.map((r) => {
|
|
329
|
+
const v = {}, k = r.filters || {};
|
|
330
|
+
if (k && k.forEach && k.forEach((t) => {
|
|
331
|
+
t.value != null && t.value.filter((d) => d != null && d.toString().trim() != "").length > 0 && (v[t.param] = t.value);
|
|
332
|
+
}), r.dvzProxyDatasetId && (v.dvzProxyDatasetId = r.dvzProxyDatasetId), r.extraTooltipColumns && r.extraTooltipColumns.length > 0) {
|
|
333
|
+
const t = r.extraTooltipColumns.filter((d) => d && d !== r.apiJoinAttribute && d !== r.patternDiscriminator);
|
|
334
|
+
t.length > 0 && (v.includeColumns = t.join(","));
|
|
335
|
+
}
|
|
336
|
+
return /* @__PURE__ */ a("div", { children: [
|
|
337
|
+
r.type == "base" && /* @__PURE__ */ e(ie, { ...r, group: p, onItemClick: g }),
|
|
334
338
|
r.type == "data" && r.apiJoinAttribute && /* @__PURE__ */ e(
|
|
335
339
|
Y,
|
|
336
340
|
{
|
|
337
341
|
waitForFilters: !0,
|
|
338
342
|
editing: r.editing,
|
|
339
|
-
params:
|
|
343
|
+
params: v,
|
|
340
344
|
app: r.app,
|
|
341
345
|
verbose: !1,
|
|
342
346
|
csv: decodeURIComponent(r.csv),
|
|
343
|
-
group:
|
|
347
|
+
group: p,
|
|
344
348
|
ignoreErrors: !0,
|
|
345
349
|
isSvg: !0,
|
|
346
350
|
mySelf: "Legends",
|
|
347
351
|
store: [r.app, l.unique, r.id],
|
|
348
352
|
source: r.apiJoinAttribute + (r.patternDiscriminator != "none" ? "/" + r.patternDiscriminator : ""),
|
|
349
|
-
children: /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(le, { group:
|
|
353
|
+
children: /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(le, { group: p, patternsData: f ? f[r.id] : null, divRef: c, ...r, intl: l.intl, onItemClick: g, toggleColorLayer: D }) })
|
|
350
354
|
}
|
|
351
355
|
),
|
|
352
|
-
r.type == "dataPoints" && /* @__PURE__ */ e(ae, { selectedItem: l.selectedItem, d2Click: l.d2Click, intl: l.intl, group:
|
|
353
|
-
r.type == "flow" && /* @__PURE__ */ e(re, { group:
|
|
356
|
+
r.type == "dataPoints" && /* @__PURE__ */ e(ae, { selectedItem: l.selectedItem, d2Click: l.d2Click, intl: l.intl, group: p, ...r, onItemClick: g }),
|
|
357
|
+
r.type == "flow" && /* @__PURE__ */ e(re, { group: p, ...r, onItemClick: g, intl: l.intl })
|
|
354
358
|
] }, r.id);
|
|
355
359
|
}) })
|
|
356
360
|
] });
|
|
@@ -1,28 +1,72 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import g from "string-template";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
const b = /(\+?\%)[\(]([A-z0-9,.,-]+)\)/gi, h = /(\+?\#)[\(]([A-z0-9,.,-]+)\)/gi, x = /(\+?\#C)[\(]([A-z0-9,.,-]+)\)/gi, S = /(\$)[\(]([A-Za-z0-9,.]+)\)/gi, A = [
|
|
5
|
+
{
|
|
6
|
+
name: "USD Dollar",
|
|
7
|
+
code: "USD",
|
|
8
|
+
symbol: "$"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "Naira",
|
|
12
|
+
code: "NGN",
|
|
13
|
+
symbol: "₦"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "South Africa Rand",
|
|
17
|
+
code: "ZAR",
|
|
18
|
+
symbol: "R"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "Ethiopian Birr",
|
|
22
|
+
code: "ETB",
|
|
23
|
+
symbol: "Br"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "Zambian Kwacha",
|
|
27
|
+
code: "ZMW",
|
|
28
|
+
symbol: "ZK"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "Kenyan Shilling",
|
|
32
|
+
code: "KES",
|
|
33
|
+
symbol: "KSh"
|
|
13
34
|
}
|
|
35
|
+
], l = (t) => t && t.trim().toLowerCase(), E = (t, n) => {
|
|
36
|
+
let o, s = n;
|
|
37
|
+
for (; (o = t.exec(n)) !== null; )
|
|
38
|
+
if (o.length > 2) {
|
|
39
|
+
const a = o[0], c = o[2], e = A.find((r) => l(r.code) == l(c) || l(r.name) == l(c) || l(r.symbol) == l(c));
|
|
40
|
+
e && (s = s.replaceAll(a, e.symbol));
|
|
41
|
+
}
|
|
14
42
|
return s;
|
|
15
|
-
},
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
43
|
+
}, p = (t, n, o, s, a, c) => {
|
|
44
|
+
let e, r = n;
|
|
45
|
+
for (; (e = t.exec(n)) !== null; ) {
|
|
46
|
+
const i = e[2], m = e[1], y = ((u, f = 2) => a.formatNumber(s ? u / 100 : u, {
|
|
47
|
+
maximumFractionDigits: f,
|
|
48
|
+
...o,
|
|
49
|
+
signDisplay: m && m.startsWith("+") ? "never" : "auto"
|
|
50
|
+
})).apply(void 0, i.split(","));
|
|
51
|
+
r = r.replaceAll(e[0], y);
|
|
52
|
+
}
|
|
53
|
+
return r;
|
|
54
|
+
}, z = (t, n, o) => {
|
|
55
|
+
const s = { ...n, ...n.meta }, a = {};
|
|
56
|
+
Object.keys(s).forEach((r) => {
|
|
57
|
+
a[r] = s[r], a[r.replace(/\s+/g, "_")] = s[r];
|
|
58
|
+
});
|
|
59
|
+
const c = t.replace(/\{([^}]+)\}/g, (r, i) => `{${i.replace(/\s+/g, "_")}}`);
|
|
60
|
+
let e = g(c, a).replace(/(?:\r\n|\r|\n)/g, "<br>");
|
|
61
|
+
return e = p(b, e, { style: "percent" }, !0, o), e = p(h, e, { style: "decimal" }, !1, o), e = p(x, e, { notation: "compact" }, !1, o), e = E(S, e), e;
|
|
62
|
+
}, Z = ({ tooltip: t, data: n, intl: o }) => {
|
|
63
|
+
if (n) {
|
|
64
|
+
const s = z(t, n, o);
|
|
65
|
+
return /* @__PURE__ */ d("div", { dangerouslySetInnerHTML: { __html: s } });
|
|
22
66
|
} else
|
|
23
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ d("div", {});
|
|
24
68
|
};
|
|
25
69
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
70
|
+
Z as default,
|
|
71
|
+
z as formatContent
|
|
28
72
|
};
|
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import * as l from "d3";
|
|
2
|
+
const u = "_Color_", i = ["value", "count", "type", "children", "label", "measure"], d = (e) => {
|
|
3
|
+
const n = {};
|
|
4
|
+
return e && (Object.keys(e).forEach((r) => {
|
|
5
|
+
i.includes(r) || (n[r] = e[r]);
|
|
6
|
+
}), e.type && e.value !== void 0 && (n[e.type] = e.value)), n;
|
|
7
|
+
}, f = (e) => {
|
|
8
|
+
let n = d(e);
|
|
9
|
+
return e && e.children && Array.isArray(e.children) && e.children.forEach((r) => {
|
|
10
|
+
n = { ...n, ...f(r) };
|
|
11
|
+
}), n;
|
|
12
|
+
}, v = (e, n) => !e || !n ? null : e[(u + n).trim()] || null, t = {}, o = {}, p = 3 * 60 * 1e3, s = (e) => JSON.parse(JSON.stringify(e)), h = (e) => {
|
|
13
|
+
const n = Date.now(), r = e;
|
|
14
|
+
if (t[r])
|
|
15
|
+
return t[r].then(s);
|
|
16
|
+
if (o[r] && n - o[r].timestamp < p)
|
|
17
|
+
return Promise.resolve(s(o[r].data));
|
|
18
|
+
const a = l.json(e).then((c) => (o[r] = { data: c, timestamp: Date.now() }, c)).finally(() => {
|
|
19
|
+
delete t[r];
|
|
10
20
|
});
|
|
11
|
-
return
|
|
12
|
-
},
|
|
21
|
+
return t[r] = a, a.then(s);
|
|
22
|
+
}, y = (e) => h(e);
|
|
13
23
|
export {
|
|
14
|
-
|
|
24
|
+
u as COLOR_VARIABLE,
|
|
25
|
+
d as extractVariables,
|
|
26
|
+
f as extractVariablesDeep,
|
|
27
|
+
y as loadJSON,
|
|
28
|
+
v as resolveOverrideColor
|
|
15
29
|
};
|