@devgateway/dvz-ui-react 1.9.5 → 1.9.7
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/common/MapTooltip.js +1 -1
- package/dist/cjs/embeddable/map/MapDataFrame.js +1 -1
- package/dist/cjs/embeddable/map/index.js +2 -2
- package/dist/cjs/embeddable/map/legend.js +1 -1
- package/dist/cjs/embeddable/map/map.js +4 -4
- package/dist/cjs/embeddable/map/mapHelpers.js +1 -0
- package/dist/esm/embeddable/common/MapTooltip.js +26 -22
- package/dist/esm/embeddable/map/MapDataFrame.js +152 -18
- package/dist/esm/embeddable/map/index.js +209 -198
- package/dist/esm/embeddable/map/legend.js +31 -35
- package/dist/esm/embeddable/map/map.js +602 -918
- package/dist/esm/embeddable/map/mapHelpers.js +243 -0
- package/dist/types/embeddable/map/map.d.ts +2 -1
- package/dist/types/embeddable/map/mapHelpers.d.ts +55 -0
- package/package.json +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "react";
|
|
3
|
-
import { connect as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as He, useEffect as Ke } from "react";
|
|
3
|
+
import { connect as qe, useDispatch as Ye, useSelector as $e } from "react-redux";
|
|
4
|
+
import Qe from "../data/DataProvider.js";
|
|
5
|
+
import Xe from "../data/DataConsumer.js";
|
|
6
|
+
import { getCategories as _e } from "../reducers/data.js";
|
|
7
|
+
import ea from "./map.js";
|
|
8
|
+
import aa from "./MapDataFrame.js";
|
|
9
|
+
import ta from "./MapCSVDataFrame.js";
|
|
10
|
+
const oa = [
|
|
10
11
|
{ label: "KENYA", value: "KEN", center: [35.8166634, 0.1], scale: 2e3 },
|
|
11
12
|
{ label: "Nigeria", value: "NGA", center: [7.491302, 9.072264], scale: 2e3 },
|
|
12
13
|
{ label: "South Africa", value: "ZAF", center: [24.676997, -28.48322], scale: 2e3 },
|
|
@@ -16,212 +17,222 @@ const Ja = [
|
|
|
16
17
|
{ label: "Zambia", value: "ZMB", center: [26.459455, -14.668135], scale: 2e3 },
|
|
17
18
|
{ label: "Democratic Republic of the Congo", value: "DRC", center: [23.174338, -5.837475], scale: 1250 },
|
|
18
19
|
{ label: "World", value: "World", center: [0, 20.050043], scale: 150 }
|
|
19
|
-
],
|
|
20
|
-
var
|
|
20
|
+
], la = (n) => /* @__PURE__ */ i(ra, { ...n }), ra = (n) => {
|
|
21
|
+
var E;
|
|
21
22
|
const {
|
|
22
|
-
unique:
|
|
23
|
-
editing:
|
|
24
|
-
"data-filters":
|
|
25
|
-
"data-app":
|
|
23
|
+
unique: u,
|
|
24
|
+
editing: d,
|
|
25
|
+
"data-filters": P = "{}",
|
|
26
|
+
"data-app": o = "csv",
|
|
26
27
|
"data-csv": k = "",
|
|
27
|
-
"data-dimension1":
|
|
28
|
-
"data-dimension2":
|
|
29
|
-
"data-
|
|
30
|
-
"data-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"data-data-source-
|
|
34
|
-
"data-
|
|
35
|
-
"data-
|
|
36
|
-
"data-legend-
|
|
37
|
-
"data-
|
|
38
|
-
"data-
|
|
39
|
-
"data-
|
|
40
|
-
"data-
|
|
41
|
-
"data-
|
|
42
|
-
"data-
|
|
43
|
-
|
|
44
|
-
|
|
28
|
+
"data-dimension1": O = "",
|
|
29
|
+
"data-dimension2": W = "",
|
|
30
|
+
"data-dimension3": p = "",
|
|
31
|
+
"data-measures": f = "[]",
|
|
32
|
+
"data-height": V = 600,
|
|
33
|
+
width: G = 960,
|
|
34
|
+
"data-data-source-text": j = "",
|
|
35
|
+
"data-data-source-label": J = "Source",
|
|
36
|
+
"data-national-average-label": Z = "National Average",
|
|
37
|
+
"data-legend-title": H = "Legend Title",
|
|
38
|
+
"data-legend-breaks": K = "[]",
|
|
39
|
+
"data-zoom-enabled": C = !1,
|
|
40
|
+
"data-show-legend-labels": y = !1,
|
|
41
|
+
"data-map-file": q,
|
|
42
|
+
"data-mapping-field": Y = "zone",
|
|
43
|
+
"data-map-label-field": $ = "admin",
|
|
44
|
+
"data-has-multiple-measures": v = "false",
|
|
45
|
+
topoJSONField: Q = "collection",
|
|
46
|
+
"data-map-center": X = "NGA",
|
|
45
47
|
//country
|
|
46
|
-
"data-map-label-show-value":
|
|
47
|
-
"data-show-tooltip":
|
|
48
|
-
"data-measure-selector-label":
|
|
49
|
-
"data-value-format":
|
|
50
|
-
"data-show-overall-value":
|
|
51
|
-
"data-auto-generate-breaks":
|
|
52
|
-
"data-number-of-breaks":
|
|
53
|
-
"data-scheme":
|
|
54
|
-
"data-show-no-data-label":
|
|
55
|
-
"data-group":
|
|
56
|
-
"data-map-symbols":
|
|
57
|
-
"data-tooltip-theme":
|
|
58
|
-
"data-label-font-size":
|
|
59
|
-
"data-label-font-weight":
|
|
60
|
-
"data-label-font-color":
|
|
61
|
-
"data-legend-font-size":
|
|
62
|
-
"data-legend-font-weight":
|
|
63
|
-
"data-custom-tooltips":
|
|
64
|
-
"data-format-style":
|
|
65
|
-
"data-decimals":
|
|
66
|
-
"data-currency":
|
|
67
|
-
"data-tooltip-font-size":
|
|
68
|
-
"data-show-admin-unit-label":
|
|
69
|
-
"data-map-no-data-color":
|
|
70
|
-
"data-map-boundary-color":
|
|
71
|
-
"data-map-focus-boundary-color":
|
|
72
|
-
"data-highlighted-location":
|
|
73
|
-
"data-tooltip-format":
|
|
48
|
+
"data-map-label-show-value": F = "false",
|
|
49
|
+
"data-show-tooltip": L = "true",
|
|
50
|
+
"data-measure-selector-label": _ = "",
|
|
51
|
+
"data-value-format": ee = "",
|
|
52
|
+
"data-show-overall-value": w = "false",
|
|
53
|
+
"data-auto-generate-breaks": D = "false",
|
|
54
|
+
"data-number-of-breaks": ae = 5,
|
|
55
|
+
"data-scheme": te = "reds",
|
|
56
|
+
"data-show-no-data-label": S = "false",
|
|
57
|
+
"data-group": I = "default",
|
|
58
|
+
"data-map-symbols": oe = "[]",
|
|
59
|
+
"data-tooltip-theme": le = "map-tooltip-dark",
|
|
60
|
+
"data-label-font-size": re = 12,
|
|
61
|
+
"data-label-font-weight": ne = "normal",
|
|
62
|
+
"data-label-font-color": se = "#595959",
|
|
63
|
+
"data-legend-font-size": ie = 12,
|
|
64
|
+
"data-legend-font-weight": de = "normal",
|
|
65
|
+
"data-custom-tooltips": me = "[]",
|
|
66
|
+
"data-format-style": g = "decimal",
|
|
67
|
+
"data-decimals": N = "2",
|
|
68
|
+
"data-currency": ce = "",
|
|
69
|
+
"data-tooltip-font-size": ue = 14,
|
|
70
|
+
"data-show-admin-unit-label": pe = "showAll",
|
|
71
|
+
"data-map-no-data-color": fe = "#f8f8f8",
|
|
72
|
+
"data-map-boundary-color": ge = "#000",
|
|
73
|
+
"data-map-focus-boundary-color": he = "#000",
|
|
74
|
+
"data-highlighted-location": be = "",
|
|
75
|
+
"data-tooltip-format": Ce = `{locationName} %({value},2)
|
|
74
76
|
{label}: %({value},2)`,
|
|
75
|
-
"data-show-no-data-tooltip":
|
|
76
|
-
"data-map-container-bg-color":
|
|
77
|
-
"data-map-position":
|
|
78
|
-
"data-main-layer-id":
|
|
79
|
-
"data-enabled-layers":
|
|
80
|
-
"data-point-label-color":
|
|
81
|
-
"data-point-label-format":
|
|
82
|
-
"data-show-no-data-legend-item":
|
|
83
|
-
"data-highlighted-loc-label-format":
|
|
84
|
-
"data-enable-summary-view":
|
|
85
|
-
"data-map-type":
|
|
86
|
-
"data-default-point-color":
|
|
87
|
-
"data-aggregation-formula":
|
|
88
|
-
"data-zoom-level-to-show-points":
|
|
89
|
-
"data-zoom-on-filter":
|
|
90
|
-
"data-zoom-on-filter-field":
|
|
91
|
-
"data-no-data-text":
|
|
92
|
-
"data-labels-exclusion-list":
|
|
93
|
-
"data-custom-measure-labels":
|
|
94
|
-
"data-show-shading-layer-labels":
|
|
95
|
-
"data-dvz-proxy-dataset-id":
|
|
96
|
-
"data-recently-toggled-layer-id":
|
|
97
|
-
intl:
|
|
98
|
-
settings:
|
|
99
|
-
} = n
|
|
77
|
+
"data-show-no-data-tooltip": z = "false",
|
|
78
|
+
"data-map-container-bg-color": ye = "#fff",
|
|
79
|
+
"data-map-position": ve = "{}",
|
|
80
|
+
"data-main-layer-id": Fe = "",
|
|
81
|
+
"data-enabled-layers": Le,
|
|
82
|
+
"data-point-label-color": we = "#fff",
|
|
83
|
+
"data-point-label-format": De = "{locationName} %({value},2)",
|
|
84
|
+
"data-show-no-data-legend-item": T = !1,
|
|
85
|
+
"data-highlighted-loc-label-format": Se = "{locationName} - Score: #({value},2)",
|
|
86
|
+
"data-enable-summary-view": ia = "false",
|
|
87
|
+
"data-map-type": x = "DEFAULT",
|
|
88
|
+
"data-default-point-color": Ie = "#FFFF00",
|
|
89
|
+
"data-aggregation-formula": Ne = "COUNT",
|
|
90
|
+
"data-zoom-level-to-show-points": ze = 2,
|
|
91
|
+
"data-zoom-on-filter": U = "false",
|
|
92
|
+
"data-zoom-on-filter-field": Te = "",
|
|
93
|
+
"data-no-data-text": xe = "No Data",
|
|
94
|
+
"data-labels-exclusion-list": Ue = "",
|
|
95
|
+
"data-custom-measure-labels": Ae = "{}",
|
|
96
|
+
"data-show-shading-layer-labels": Be = "ifUnitHasData",
|
|
97
|
+
"data-dvz-proxy-dataset-id": r,
|
|
98
|
+
"data-recently-toggled-layer-id": Re = null,
|
|
99
|
+
intl: da,
|
|
100
|
+
settings: ma
|
|
101
|
+
} = n;
|
|
102
|
+
console.log("MapWrapper props", n);
|
|
103
|
+
const Ee = (e) => d ? e : decodeURIComponent(e), l = (e) => {
|
|
100
104
|
try {
|
|
101
|
-
if (
|
|
102
|
-
return JSON.parse(
|
|
105
|
+
if (e)
|
|
106
|
+
return JSON.parse(Ee(e));
|
|
103
107
|
} catch {
|
|
104
|
-
console.error("error parsing value:" +
|
|
108
|
+
console.error("error parsing value:" + e);
|
|
105
109
|
}
|
|
106
110
|
return null;
|
|
107
|
-
},
|
|
108
|
-
let t =
|
|
109
|
-
return t = t.map((
|
|
110
|
-
},
|
|
111
|
-
const t =
|
|
112
|
-
let
|
|
113
|
-
return t && t.forEach ? t.forEach((
|
|
114
|
-
|
|
115
|
-
}) :
|
|
116
|
-
},
|
|
117
|
-
style:
|
|
118
|
-
notation:
|
|
119
|
-
currency:
|
|
120
|
-
minimumFractionDigits: parseInt(
|
|
121
|
-
maximumFractionDigits: parseInt(
|
|
111
|
+
}, Me = (e) => {
|
|
112
|
+
let t = l(e) || [];
|
|
113
|
+
return t = t.map((a) => (a.min && (a.min = parseFloat(a.min)), a.max && (a.max = parseFloat(a.max)), a.color = decodeURIComponent(a.color), a)), t;
|
|
114
|
+
}, Pe = (e) => {
|
|
115
|
+
const t = l(e) || [];
|
|
116
|
+
let a = {};
|
|
117
|
+
return t && t.forEach ? t.forEach((c) => {
|
|
118
|
+
c.value != null && c.value.filter((M) => M != null && M.toString().trim() != "").length > 0 && (a[c.param] = c.value);
|
|
119
|
+
}) : a = t, a;
|
|
120
|
+
}, ke = {
|
|
121
|
+
style: g === "compacted" ? "decimal" : g,
|
|
122
|
+
notation: g === "compacted" ? "compact" : "standard",
|
|
123
|
+
currency: ce,
|
|
124
|
+
minimumFractionDigits: parseInt(N),
|
|
125
|
+
maximumFractionDigits: parseInt(N)
|
|
122
126
|
};
|
|
123
|
-
let
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
let
|
|
127
|
-
const
|
|
128
|
-
unique:
|
|
129
|
-
editing:
|
|
130
|
-
source: `/${
|
|
131
|
-
center:
|
|
132
|
-
scale:
|
|
133
|
-
measures:
|
|
134
|
-
legendTitle:
|
|
135
|
-
height:
|
|
136
|
-
width:
|
|
137
|
-
topoJSONField:
|
|
138
|
-
mappingField:
|
|
139
|
-
dataSourceText:
|
|
140
|
-
dataSourceLabel:
|
|
141
|
-
nationalAverageLabel:
|
|
142
|
-
legendBreaks:
|
|
143
|
-
mapLabelField:
|
|
144
|
-
zoomEnabled:
|
|
145
|
-
showLegendLabels:
|
|
146
|
-
multipleMeasures:
|
|
147
|
-
app:
|
|
148
|
-
mapLabelShowValue:
|
|
149
|
-
showTooltip:
|
|
150
|
-
showOverallValue:
|
|
151
|
-
measureSelectorLabel:
|
|
152
|
-
valueFormat:
|
|
153
|
-
autoGenerateBreaks:
|
|
154
|
-
showNoDataLabel:
|
|
155
|
-
numberOfBreaks:
|
|
156
|
-
colorScheme:
|
|
157
|
-
group:
|
|
158
|
-
symbols:
|
|
159
|
-
tooltipTheme:
|
|
160
|
-
labelFontSize:
|
|
161
|
-
labelFontColor: decodeURIComponent(
|
|
162
|
-
labelFontWeight:
|
|
163
|
-
legendFontSize:
|
|
164
|
-
legendFontWeight:
|
|
165
|
-
customTooltips:
|
|
166
|
-
format:
|
|
167
|
-
tooltipFontSize:
|
|
168
|
-
showAdminUnitLabel:
|
|
169
|
-
mapNoDataColor: decodeURIComponent(
|
|
170
|
-
mapBoundaryColor: decodeURIComponent(
|
|
171
|
-
mapFocusBoundaryColor: decodeURIComponent(
|
|
172
|
-
highlightedLocation:
|
|
173
|
-
tooltipFormat:
|
|
174
|
-
showNoDataTooltip:
|
|
175
|
-
fields:
|
|
176
|
-
mapContainerBgColor: decodeURIComponent(
|
|
177
|
-
mapPosition:
|
|
178
|
-
mainLayerId:
|
|
179
|
-
enabledLayers:
|
|
180
|
-
pointLabelColor: decodeURIComponent(
|
|
181
|
-
pointLabelFormat:
|
|
182
|
-
showNoDataLegendItem:
|
|
183
|
-
highlightedLocLabelFormat:
|
|
184
|
-
mapType:
|
|
185
|
-
defaultPointColor: decodeURIComponent(
|
|
186
|
-
zoomLevelToShowPoints:
|
|
187
|
-
zoomOnFilter:
|
|
188
|
-
zoomOnFilterField:
|
|
189
|
-
noDataText:
|
|
190
|
-
labelsExclusionList:
|
|
191
|
-
showShadingLayerLabels:
|
|
192
|
-
dvzProxyDatasetId:
|
|
193
|
-
recentlyToggledLayerId:
|
|
127
|
+
let h = l(Le) || [];
|
|
128
|
+
h = h.map((e) => (e.bgColor = decodeURIComponent(e.bgColor), e.fontColor = decodeURIComponent(e.fontColor), e));
|
|
129
|
+
const A = oa.find((e) => e.value === X), B = v == !0 || v == "true";
|
|
130
|
+
let s = [O, W].filter((e) => e !== "none" && e !== null).join("/");
|
|
131
|
+
const Oe = p && p !== "none" ? p : null, m = {
|
|
132
|
+
unique: u,
|
|
133
|
+
editing: d,
|
|
134
|
+
source: `/${q}`,
|
|
135
|
+
center: A.center,
|
|
136
|
+
scale: A.scale,
|
|
137
|
+
measures: f,
|
|
138
|
+
legendTitle: H,
|
|
139
|
+
height: V,
|
|
140
|
+
width: G,
|
|
141
|
+
topoJSONField: Q,
|
|
142
|
+
mappingField: Y,
|
|
143
|
+
dataSourceText: j,
|
|
144
|
+
dataSourceLabel: J,
|
|
145
|
+
nationalAverageLabel: Z,
|
|
146
|
+
legendBreaks: Me(K),
|
|
147
|
+
mapLabelField: $,
|
|
148
|
+
zoomEnabled: C == !0 || C == "true",
|
|
149
|
+
showLegendLabels: y == !0 || y == "true",
|
|
150
|
+
multipleMeasures: B,
|
|
151
|
+
app: o,
|
|
152
|
+
mapLabelShowValue: F == !0 || F == "true",
|
|
153
|
+
showTooltip: L == !0 || L == "true",
|
|
154
|
+
showOverallValue: w == !0 || w == "true",
|
|
155
|
+
measureSelectorLabel: _,
|
|
156
|
+
valueFormat: ee,
|
|
157
|
+
autoGenerateBreaks: D == !0 || D == "true",
|
|
158
|
+
showNoDataLabel: S == !0 || S == "true",
|
|
159
|
+
numberOfBreaks: ae,
|
|
160
|
+
colorScheme: te,
|
|
161
|
+
group: I,
|
|
162
|
+
symbols: l(oe) || [],
|
|
163
|
+
tooltipTheme: le,
|
|
164
|
+
labelFontSize: re,
|
|
165
|
+
labelFontColor: decodeURIComponent(se),
|
|
166
|
+
labelFontWeight: ne,
|
|
167
|
+
legendFontSize: ie,
|
|
168
|
+
legendFontWeight: de,
|
|
169
|
+
customTooltips: l(me) || [],
|
|
170
|
+
format: ke,
|
|
171
|
+
tooltipFontSize: ue,
|
|
172
|
+
showAdminUnitLabel: pe,
|
|
173
|
+
mapNoDataColor: decodeURIComponent(fe),
|
|
174
|
+
mapBoundaryColor: decodeURIComponent(ge),
|
|
175
|
+
mapFocusBoundaryColor: decodeURIComponent(he),
|
|
176
|
+
highlightedLocation: be,
|
|
177
|
+
tooltipFormat: Ce,
|
|
178
|
+
showNoDataTooltip: z == !0 || z == "true",
|
|
179
|
+
fields: s.split("/"),
|
|
180
|
+
mapContainerBgColor: decodeURIComponent(ye),
|
|
181
|
+
mapPosition: l(ve),
|
|
182
|
+
mainLayerId: Fe,
|
|
183
|
+
enabledLayers: h,
|
|
184
|
+
pointLabelColor: decodeURIComponent(we),
|
|
185
|
+
pointLabelFormat: De,
|
|
186
|
+
showNoDataLegendItem: T == !0 || T == "true",
|
|
187
|
+
highlightedLocLabelFormat: Se,
|
|
188
|
+
mapType: x,
|
|
189
|
+
defaultPointColor: decodeURIComponent(Ie),
|
|
190
|
+
zoomLevelToShowPoints: ze,
|
|
191
|
+
zoomOnFilter: U == !0 || U == "true",
|
|
192
|
+
zoomOnFilterField: Te,
|
|
193
|
+
noDataText: xe,
|
|
194
|
+
labelsExclusionList: Ue.split(",").map((e) => e.trim()),
|
|
195
|
+
showShadingLayerLabels: Be,
|
|
196
|
+
dvzProxyDatasetId: r,
|
|
197
|
+
recentlyToggledLayerId: Re
|
|
194
198
|
};
|
|
195
|
-
if (
|
|
196
|
-
const
|
|
197
|
-
|
|
199
|
+
if (m.recentlyToggledLayerId) {
|
|
200
|
+
const e = m.enabledLayers.find((t) => String(t.id) === String(m.recentlyToggledLayerId));
|
|
201
|
+
e && (e != null && e.apiField) && (s = (E = e.apiField) == null ? void 0 : E.toLowerCase());
|
|
198
202
|
}
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
|
|
203
|
+
const We = l(Ae) || {}, Ve = o === "csv" ? ta : aa, Ge = d ? (l(f) || []).join(",") : f, R = Pe(P);
|
|
204
|
+
r && (R.dvzProxyDatasetId = r);
|
|
205
|
+
const je = Ye(), Je = ["data", "categories", o, ...r ? [r] : [], "items"], b = $e((e) => e.getIn(Je)), Ze = He(() => b ? b.toJS() : [], [b]);
|
|
206
|
+
return Ke(() => {
|
|
207
|
+
o && o !== "csv" && je(_e({ app: o, dvzProxyDatasetId: r }));
|
|
208
|
+
}, [o, r]), /* @__PURE__ */ i(
|
|
209
|
+
Qe,
|
|
202
210
|
{
|
|
203
|
-
params:
|
|
204
|
-
app:
|
|
211
|
+
params: R,
|
|
212
|
+
app: o,
|
|
205
213
|
csv: decodeURIComponent(k),
|
|
206
|
-
group:
|
|
207
|
-
editing:
|
|
208
|
-
store: [
|
|
209
|
-
source:
|
|
210
|
-
children: /* @__PURE__ */
|
|
211
|
-
|
|
214
|
+
group: I,
|
|
215
|
+
editing: d,
|
|
216
|
+
store: [o, u, ...s.split("/")],
|
|
217
|
+
source: s,
|
|
218
|
+
children: /* @__PURE__ */ i(Xe, { children: /* @__PURE__ */ i(
|
|
219
|
+
Ve,
|
|
212
220
|
{
|
|
213
|
-
measures:
|
|
214
|
-
multipleMeasures:
|
|
215
|
-
mapType:
|
|
216
|
-
aggregationFormula:
|
|
217
|
-
customMeasureLabels:
|
|
218
|
-
source:
|
|
219
|
-
|
|
221
|
+
measures: Ge,
|
|
222
|
+
multipleMeasures: B,
|
|
223
|
+
mapType: x,
|
|
224
|
+
aggregationFormula: Ne,
|
|
225
|
+
customMeasureLabels: We,
|
|
226
|
+
source: s,
|
|
227
|
+
extraDimension: Oe,
|
|
228
|
+
allDimensions: Ze,
|
|
229
|
+
children: /* @__PURE__ */ i(ea, { ...m })
|
|
220
230
|
}
|
|
221
231
|
) })
|
|
222
232
|
}
|
|
223
233
|
);
|
|
224
|
-
},
|
|
234
|
+
}, na = (n, u) => {
|
|
235
|
+
}, sa = {}, Fa = qe(na, sa)(la);
|
|
225
236
|
export {
|
|
226
|
-
|
|
237
|
+
Fa as default
|
|
227
238
|
};
|
|
@@ -1,44 +1,41 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as a, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import u from "react";
|
|
3
3
|
class D extends u.Component {
|
|
4
|
-
constructor(
|
|
5
|
-
super(
|
|
4
|
+
constructor(t) {
|
|
5
|
+
super(t);
|
|
6
6
|
}
|
|
7
|
-
formatNumber(
|
|
8
|
-
const { intl: m, format:
|
|
9
|
-
return m.formatNumber(
|
|
10
|
-
style:
|
|
11
|
-
notation:
|
|
12
|
-
maximumFractionDigits:
|
|
7
|
+
formatNumber(t) {
|
|
8
|
+
const { intl: m, format: l } = this.props;
|
|
9
|
+
return m.formatNumber(l.style === "percent" ? t / 100 : t, {
|
|
10
|
+
style: l.style,
|
|
11
|
+
notation: l.notation,
|
|
12
|
+
maximumFractionDigits: l.maximumFractionDigits,
|
|
13
13
|
minimuFractionDigits: 0,
|
|
14
|
-
currency:
|
|
14
|
+
currency: l.currency
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
18
|
const {
|
|
19
|
-
filteredBreaks:
|
|
19
|
+
filteredBreaks: t,
|
|
20
20
|
formattedLegendTitle: m,
|
|
21
|
-
showLegendLabels:
|
|
22
|
-
symbols:
|
|
21
|
+
showLegendLabels: l,
|
|
22
|
+
symbols: o,
|
|
23
23
|
legendFontSize: d,
|
|
24
24
|
legendFontWeight: h,
|
|
25
25
|
autoGenerateBreaks: i,
|
|
26
26
|
intl: b,
|
|
27
27
|
numberFormat: x,
|
|
28
|
-
mapNoDataColor:
|
|
29
|
-
showNoDataLegendItem:
|
|
30
|
-
noDataText:
|
|
31
|
-
} = this.props,
|
|
28
|
+
mapNoDataColor: g,
|
|
29
|
+
showNoDataLegendItem: c,
|
|
30
|
+
noDataText: p
|
|
31
|
+
} = this.props, s = {
|
|
32
32
|
fontSize: d + "px",
|
|
33
33
|
fontWeight: h
|
|
34
34
|
};
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
] }),
|
|
40
|
-
/* @__PURE__ */ n("div", { className: "legend", children: /* @__PURE__ */ s("ul", { className: "legend-items-container", children: [
|
|
41
|
-
l && l.map((e, r) => /* @__PURE__ */ s("li", { className: "legend-item", children: [
|
|
35
|
+
return /* @__PURE__ */ a("div", { className: "legend-container", children: [
|
|
36
|
+
/* @__PURE__ */ n("div", { className: "legend-title-container", children: /* @__PURE__ */ n("span", { className: "legend-title", children: t && t.length > 0 ? m : "" }) }),
|
|
37
|
+
/* @__PURE__ */ n("div", { className: "legend", children: /* @__PURE__ */ a("ul", { className: "legend-items-container", children: [
|
|
38
|
+
t && t.map((e, r) => /* @__PURE__ */ a("li", { className: "legend-item", children: [
|
|
42
39
|
/* @__PURE__ */ n(
|
|
43
40
|
"span",
|
|
44
41
|
{
|
|
@@ -46,38 +43,37 @@ class D extends u.Component {
|
|
|
46
43
|
style: { backgroundColor: e.color }
|
|
47
44
|
}
|
|
48
45
|
),
|
|
49
|
-
|
|
50
|
-
(!
|
|
46
|
+
l && !i && /* @__PURE__ */ n("span", { className: "legend-label", style: s, children: e.label }),
|
|
47
|
+
(!l || i) && e.min != null && e.max != null && /* @__PURE__ */ a("span", { className: "legend-label", style: s, children: [
|
|
51
48
|
this.formatNumber(e.min),
|
|
52
49
|
" -",
|
|
53
50
|
" ",
|
|
54
51
|
this.formatNumber(e.max)
|
|
55
52
|
] }),
|
|
56
|
-
(!
|
|
53
|
+
(!l || i) && e.min == null && e.max != null && /* @__PURE__ */ a("span", { className: "legend-label", style: s, children: [
|
|
57
54
|
" ",
|
|
58
55
|
"< ",
|
|
59
56
|
this.formatNumber(e.max)
|
|
60
57
|
] }),
|
|
61
|
-
(!
|
|
58
|
+
(!l || i) && e.min != null && e.max == null && /* @__PURE__ */ a("span", { className: "legend-label", style: s, children: [
|
|
62
59
|
" ",
|
|
63
60
|
"> ",
|
|
64
61
|
this.formatNumber(e.min),
|
|
65
62
|
" "
|
|
66
63
|
] })
|
|
67
64
|
] }, "lg" + r)),
|
|
68
|
-
console.log("showNoDataLegendItem",
|
|
69
|
-
|
|
65
|
+
console.log("showNoDataLegendItem", c),
|
|
66
|
+
c && /* @__PURE__ */ a("li", { className: "legend-item", children: [
|
|
70
67
|
/* @__PURE__ */ n(
|
|
71
68
|
"span",
|
|
72
69
|
{
|
|
73
70
|
className: "symbol",
|
|
74
|
-
style: { backgroundColor:
|
|
71
|
+
style: { backgroundColor: g }
|
|
75
72
|
}
|
|
76
73
|
),
|
|
77
|
-
/* @__PURE__ */ n("span", { className: "legend-label", style:
|
|
74
|
+
/* @__PURE__ */ n("span", { className: "legend-label", style: s, children: p })
|
|
78
75
|
] }),
|
|
79
|
-
|
|
80
|
-
/* @__PURE__ */ n("span", { className: "vertical-spacer", children: "|" }),
|
|
76
|
+
o && o.map((e, r) => /* @__PURE__ */ a("li", { className: "legend-item", children: [
|
|
81
77
|
e.image && /* @__PURE__ */ n(
|
|
82
78
|
"img",
|
|
83
79
|
{
|
|
@@ -90,7 +86,7 @@ class D extends u.Component {
|
|
|
90
86
|
src: "/" + e.image
|
|
91
87
|
}
|
|
92
88
|
),
|
|
93
|
-
/* @__PURE__ */ n("span", { className: "legend-label", style:
|
|
89
|
+
/* @__PURE__ */ n("span", { className: "legend-label", style: s, children: e.label ? e.label : "" })
|
|
94
90
|
] }, "k" + r))
|
|
95
91
|
] }) })
|
|
96
92
|
] });
|