@devgateway/dvz-ui-react 1.9.6 → 1.9.8
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/chart/colors/ManualColors.js +1 -1
- package/dist/cjs/embeddable/chart/data/Line.js +1 -1
- package/dist/cjs/embeddable/common/MapTooltip.js +1 -1
- package/dist/cjs/embeddable/common/colors/ManualColors.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/map.js +4 -4
- package/dist/cjs/embeddable/map/mapHelpers.js +1 -0
- package/dist/esm/embeddable/chart/colors/ManualColors.js +73 -41
- package/dist/esm/embeddable/chart/data/Line.js +132 -128
- package/dist/esm/embeddable/common/MapTooltip.js +26 -22
- package/dist/esm/embeddable/common/colors/ManualColors.js +66 -35
- package/dist/esm/embeddable/map/MapDataFrame.js +152 -18
- package/dist/esm/embeddable/map/index.js +209 -198
- package/dist/esm/embeddable/map/map.js +602 -918
- package/dist/esm/embeddable/map/mapHelpers.js +243 -0
- package/dist/types/embeddable/chart/colors/ManualColors.d.ts +2 -0
- package/dist/types/embeddable/common/colors/ManualColors.d.ts +2 -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,165 +1,169 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { measuresMap as
|
|
4
|
-
const
|
|
5
|
-
const { data: e, measures:
|
|
6
|
-
let
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
const
|
|
1
|
+
import { jsx as T, Fragment as X } from "react/jsx-runtime";
|
|
2
|
+
import J from "react";
|
|
3
|
+
import { measuresMap as z, typesMap as Q, alphaSort as V, numericSort as Y, dateSort as q, getTranslatedValue as G } from "./Utils.js";
|
|
4
|
+
const U = (t) => {
|
|
5
|
+
const { data: e, measures: s, swap: y, dimensions: f, locale: v, customLabels: c } = t;
|
|
6
|
+
let l = {};
|
|
7
|
+
const S = f.filter((h) => h != ""), L = /* @__PURE__ */ new Set();
|
|
8
|
+
if (S.length == 0 && e) {
|
|
9
|
+
const h = z(e), D = /* @__PURE__ */ new Set(), B = /* @__PURE__ */ new Set();
|
|
10
10
|
let E = [], j;
|
|
11
11
|
if (e.metadata && e.metadata.measures) {
|
|
12
|
-
const
|
|
12
|
+
const N = e.metadata.measures.filter((n) => s.includes(n.value)).sort((n, r) => n.position != null && r.position != null && n.position != r.position ? n.position - r.position : 0);
|
|
13
13
|
E = [], j = "measure", D.add("measure");
|
|
14
|
-
const
|
|
15
|
-
Object.keys(e).forEach((
|
|
16
|
-
|
|
17
|
-
}),
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
}),
|
|
14
|
+
const o = {};
|
|
15
|
+
Object.keys(e).forEach((n) => {
|
|
16
|
+
o[n] = e[n];
|
|
17
|
+
}), N.forEach((n) => {
|
|
18
|
+
const r = {}, O = c[n.value] || G(h[n.value], v);
|
|
19
|
+
r.type = "measure", r.measureFieldName = n.value, r.measure = O, r[O] = e[n.value], r.variables = o, E.push(r), B.add(O), L.add(h[n.value]);
|
|
20
|
+
}), l = {
|
|
21
21
|
categories: D,
|
|
22
22
|
indexBy: j,
|
|
23
|
-
keys: Array.from(
|
|
24
|
-
measuresMetadata:
|
|
23
|
+
keys: Array.from(B),
|
|
24
|
+
measuresMetadata: L,
|
|
25
25
|
data: E
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
return
|
|
30
|
-
},
|
|
31
|
-
const { data: e, measures:
|
|
32
|
-
if (
|
|
33
|
-
if (!(e.children.filter((
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
["children", "metadata", "type", "value"].includes(
|
|
37
|
-
}), e.children = [
|
|
29
|
+
return l;
|
|
30
|
+
}, W = (t) => {
|
|
31
|
+
const { data: e, measures: s, dimensions: y, overallLabel: f } = t;
|
|
32
|
+
if (y.length == 1 && e.children) {
|
|
33
|
+
if (!(e.children.filter((c) => c.value == f).length > 0)) {
|
|
34
|
+
const c = {};
|
|
35
|
+
c.type = y[0], c.value = f, c.label = f, Object.keys(e).forEach((l) => {
|
|
36
|
+
["children", "metadata", "type", "value"].includes(l) || (c[l] = e[l]);
|
|
37
|
+
}), e.children = [c, ...e.children];
|
|
38
38
|
}
|
|
39
|
-
} else
|
|
40
|
-
if (!(v.children.filter((
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
["children", "metadata", "type", "value"].includes(
|
|
44
|
-
}), v.children = [
|
|
39
|
+
} else y.length == 2 && e.children && e.children.forEach((v) => {
|
|
40
|
+
if (!(v.children.filter((l) => l.value == f).length > 0)) {
|
|
41
|
+
const l = {};
|
|
42
|
+
l.type = y[1], l.value = f, l.label = f, Object.keys(v).forEach((S) => {
|
|
43
|
+
["children", "metadata", "type", "value"].includes(S) || (l[S] = v[S]);
|
|
44
|
+
}), v.children = [l, ...v.children];
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
return e;
|
|
48
|
-
},
|
|
49
|
-
var
|
|
48
|
+
}, Z = (t) => {
|
|
49
|
+
var E, j, N;
|
|
50
50
|
let e = {};
|
|
51
51
|
const {
|
|
52
|
-
data:
|
|
53
|
-
measures:
|
|
54
|
-
swap:
|
|
52
|
+
data: s,
|
|
53
|
+
measures: y,
|
|
54
|
+
swap: f,
|
|
55
55
|
dimensions: v,
|
|
56
|
-
includeOverall:
|
|
57
|
-
locale:
|
|
58
|
-
customLabels:
|
|
59
|
-
colorBy:
|
|
60
|
-
hiddenBars:
|
|
61
|
-
} = t, D = v.filter((
|
|
62
|
-
if (
|
|
63
|
-
e =
|
|
64
|
-
else if (
|
|
65
|
-
const
|
|
66
|
-
t.sort == "alphabetically" ?
|
|
67
|
-
(
|
|
68
|
-
) : t.sort == "values" ?
|
|
69
|
-
(
|
|
70
|
-
) : t.sort == "date" &&
|
|
71
|
-
(
|
|
72
|
-
),
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
Object.keys(
|
|
81
|
-
|
|
82
|
-
}),
|
|
56
|
+
includeOverall: c,
|
|
57
|
+
locale: l,
|
|
58
|
+
customLabels: S,
|
|
59
|
+
colorBy: L,
|
|
60
|
+
hiddenBars: h
|
|
61
|
+
} = t, D = v.filter((o) => o != ""), B = s.metadata.measures.filter((o) => y.includes(o.value)).sort((o, n) => o.position != null && n.position != null && o.position != n.position ? o.position - n.position : 0);
|
|
62
|
+
if (c && y.length == 1 && W(t), D.length == 0 && s)
|
|
63
|
+
e = U(t);
|
|
64
|
+
else if (s && s.children && s.children.length > 0 && D.length > 0) {
|
|
65
|
+
const o = z(s), n = Q(s), r = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ new Set(), w = [], A = s.children[0].type, p = ((N = (j = (E = s == null ? void 0 : s.metadata) == null ? void 0 : E.types) == null ? void 0 : j.find((d) => d.dimension == D[0])) == null ? void 0 : N.items) || [];
|
|
66
|
+
t.sort == "alphabetically" ? p.sort(
|
|
67
|
+
(d, u) => V(t.sortReverse, l, d.value, u.value)
|
|
68
|
+
) : t.sort == "values" ? p.sort(
|
|
69
|
+
(d, u) => Y(t.sortReverse, d.value, u.value)
|
|
70
|
+
) : t.sort == "date" && p.sort(
|
|
71
|
+
(d, u) => q(t.sortReverse, d.value, u.value)
|
|
72
|
+
), B.forEach((d) => {
|
|
73
|
+
const u = d.value, R = { variables: {} }, a = S[u] || G(o[u], l);
|
|
74
|
+
R.id = a, R.label = a, R.measure = u, R.measureFieldName = u, C.add(o[u]), F.add(a);
|
|
75
|
+
const i = [];
|
|
76
|
+
p.forEach((x) => {
|
|
77
|
+
const g = s.children.find((M) => M.value === x.value);
|
|
78
|
+
if (g) {
|
|
79
|
+
const M = {};
|
|
80
|
+
Object.keys(g).forEach((m) => {
|
|
81
|
+
M[m] = g[m];
|
|
82
|
+
}), M.value = g[u], M[g.type] = g.value.toString(), O.add(n[g.type]), i.push({ x: g.value, y: g[u], variables: M }), R.data = i;
|
|
83
83
|
}
|
|
84
|
-
}),
|
|
84
|
+
}), w.push(R);
|
|
85
85
|
});
|
|
86
|
-
const
|
|
87
|
-
let
|
|
86
|
+
const I = Array.from(F);
|
|
87
|
+
let K = (h == null ? void 0 : h.length) > 0 && (w == null ? void 0 : w.length) > 0 ? w.filter((d) => h.indexOf(d[A]) == -1) : w;
|
|
88
88
|
e = {
|
|
89
|
-
metadata:
|
|
90
|
-
indexBy:
|
|
91
|
-
categories:
|
|
92
|
-
dimensionsMetadata:
|
|
93
|
-
measuresMetadata:
|
|
94
|
-
keys:
|
|
95
|
-
data:
|
|
89
|
+
metadata: s.metadata,
|
|
90
|
+
indexBy: A,
|
|
91
|
+
categories: r,
|
|
92
|
+
dimensionsMetadata: O,
|
|
93
|
+
measuresMetadata: C,
|
|
94
|
+
keys: I,
|
|
95
|
+
data: K
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
return
|
|
98
|
+
return J.Children.map(
|
|
99
99
|
t.children,
|
|
100
|
-
(
|
|
100
|
+
(o) => J.cloneElement(o, { options: e })
|
|
101
101
|
);
|
|
102
|
-
},
|
|
103
|
-
var
|
|
102
|
+
}, _ = (t) => {
|
|
103
|
+
var D, B, E, j, N, o, n;
|
|
104
104
|
const {
|
|
105
105
|
data: e,
|
|
106
|
-
measures:
|
|
107
|
-
includeOverall:
|
|
108
|
-
dimensions:
|
|
106
|
+
measures: s,
|
|
107
|
+
includeOverall: y,
|
|
108
|
+
dimensions: f,
|
|
109
109
|
hiddenBars: v,
|
|
110
|
-
colorBy:
|
|
111
|
-
locale:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
110
|
+
colorBy: c,
|
|
111
|
+
locale: l,
|
|
112
|
+
customLabels: S = {}
|
|
113
|
+
} = t, L = f.filter((r) => r != "");
|
|
114
|
+
let h = {};
|
|
115
|
+
if (y && W(t), L.length == 0 && e)
|
|
116
|
+
h = U(t);
|
|
117
|
+
else if (e && e.children && e.children.length > 0 && L.length > 0) {
|
|
118
|
+
const r = z(e), O = Q(e), C = s[0], F = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Set(), A = [], p = [], I = (D = e.children[0]) == null ? void 0 : D.type, K = ((j = (E = (B = e == null ? void 0 : e.metadata) == null ? void 0 : B.types) == null ? void 0 : E.find((a) => a.dimension == L[0])) == null ? void 0 : j.items) || [], d = ((n = (o = (N = e == null ? void 0 : e.metadata) == null ? void 0 : N.types) == null ? void 0 : o.find((a) => a.dimension == L[1])) == null ? void 0 : n.items) || [];
|
|
119
|
+
t.sortSecondDimension == "alphabetically" ? d.sort(
|
|
120
|
+
(a, i) => V(t.sortReverseSecondDimension, l, a.value, i.value)
|
|
121
|
+
) : t.sortSecondDimension == "date" && d.sort(
|
|
122
|
+
(a, i) => q(t.sortReverseSecondDimension, a.value, i.value)
|
|
123
|
+
), w.add(r[C]), d.forEach((a) => {
|
|
124
|
+
const i = { variables: {} }, x = S && S[a.value] || G(a, l) || a.value;
|
|
125
|
+
i.id = x, i.label = x, i.code = a.code || a.value, i.value = a.value, A.push(x);
|
|
126
|
+
const g = [];
|
|
127
|
+
K.forEach((M) => {
|
|
128
|
+
var H;
|
|
129
|
+
const m = e.children.find((b) => b.value === M.value);
|
|
130
|
+
if (m) {
|
|
131
|
+
F.add(O[m == null ? void 0 : m.type]);
|
|
132
|
+
const b = (H = m == null ? void 0 : m.children) == null ? void 0 : H.find((k) => k.value === a.value);
|
|
133
|
+
if (b) {
|
|
134
|
+
F.add(O[b == null ? void 0 : b.type]);
|
|
135
|
+
const k = {};
|
|
136
|
+
Object.keys(b).forEach((P) => {
|
|
137
|
+
k[P] = b[P];
|
|
138
|
+
}), k.value = b[s[0]], k[m.type] = m.value.toString(), k[b.type] = b.value.toString(), g.push({ x: m.value, y: b[s[0]], variables: k }), A.indexOf(m.value) == -1 && A.push(m.value);
|
|
139
|
+
}
|
|
136
140
|
}
|
|
137
|
-
}),
|
|
138
|
-
}),
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
}), i.data = g, p.push(i);
|
|
142
|
+
}), p.forEach((a) => {
|
|
143
|
+
A.forEach((i) => {
|
|
144
|
+
a.data.find((x) => x.x == i) || a.data.push({ x: i, y: null, variables: {} });
|
|
141
145
|
});
|
|
142
|
-
}),
|
|
143
|
-
|
|
146
|
+
}), p.forEach((a) => {
|
|
147
|
+
a.data.sort((i, x) => t.sort == "alphabetically" ? V(t.sortReverse, l, i.x, x.x) : t.sort == "date" ? q(t.sortReverse, i.x, x.x) : 0);
|
|
144
148
|
});
|
|
145
|
-
const
|
|
146
|
-
|
|
149
|
+
const u = c == "id" ? p : p.filter((a) => v.indexOf(a[I]) == -1), R = [...A];
|
|
150
|
+
h = {
|
|
147
151
|
metadata: e.metadata,
|
|
148
|
-
dimensionsMetadata:
|
|
149
|
-
measuresMetadata:
|
|
150
|
-
indexBy:
|
|
151
|
-
keys:
|
|
152
|
-
data:
|
|
152
|
+
dimensionsMetadata: F,
|
|
153
|
+
measuresMetadata: w,
|
|
154
|
+
indexBy: I,
|
|
155
|
+
keys: c == "index" ? R : R.filter((a) => v.indexOf(a) == -1),
|
|
156
|
+
data: u
|
|
153
157
|
};
|
|
154
158
|
}
|
|
155
|
-
return /* @__PURE__ */
|
|
159
|
+
return /* @__PURE__ */ T(X, { children: J.Children.map(
|
|
156
160
|
t.children,
|
|
157
|
-
(
|
|
161
|
+
(r) => J.cloneElement(r, { options: h })
|
|
158
162
|
) });
|
|
159
|
-
},
|
|
160
|
-
const { data: e, measures:
|
|
161
|
-
return
|
|
163
|
+
}, ae = (t) => {
|
|
164
|
+
const { data: e, measures: s, dimensions: y } = t, f = JSON.parse(JSON.stringify(e));
|
|
165
|
+
return y.length === 1 ? /* @__PURE__ */ T(Z, { ...t, data: f }) : /* @__PURE__ */ T(_, { ...t, data: f });
|
|
162
166
|
};
|
|
163
167
|
export {
|
|
164
|
-
|
|
168
|
+
ae as default
|
|
165
169
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import
|
|
4
|
-
const f = /(\%)[\(]([A-z0-9,.]+)\)/gi,
|
|
3
|
+
import g from "string-template";
|
|
4
|
+
const f = /(\%)[\(]([A-z0-9,.]+)\)/gi, b = /(\#)[\(]([A-z0-9,.]+)\)/gi, h = /(\#C)[\(]([A-z0-9,.]+)\)/gi, x = /(\$)[\(]([A-z0-9,.]+)\)/gi, A = [
|
|
5
5
|
{
|
|
6
6
|
name: "USD Dollar",
|
|
7
7
|
code: "USD",
|
|
@@ -32,28 +32,32 @@ const f = /(\%)[\(]([A-z0-9,.]+)\)/gi, g = /(\#)[\(]([A-z0-9,.]+)\)/gi, h = /(\#
|
|
|
32
32
|
code: "KES",
|
|
33
33
|
symbol: "KSh"
|
|
34
34
|
}
|
|
35
|
-
],
|
|
36
|
-
let
|
|
37
|
-
for (; (
|
|
38
|
-
const
|
|
39
|
-
maximumFractionDigits:
|
|
40
|
-
...
|
|
41
|
-
}),
|
|
42
|
-
|
|
35
|
+
], m = (t, n, r, c, l) => {
|
|
36
|
+
let e, o = n;
|
|
37
|
+
for (; (e = t.exec(n)) !== null; ) {
|
|
38
|
+
const a = e[2], p = (u, y = 2) => l.formatNumber(c ? u / 100 : u, {
|
|
39
|
+
maximumFractionDigits: y,
|
|
40
|
+
...r
|
|
41
|
+
}), i = a.split(","), d = i.length > 0 && i[0] ? p.apply(void 0, i) : "No Data";
|
|
42
|
+
o = o.replaceAll(e[0], d);
|
|
43
43
|
}
|
|
44
|
-
return
|
|
45
|
-
},
|
|
46
|
-
let
|
|
47
|
-
for (; (
|
|
48
|
-
if (
|
|
49
|
-
const
|
|
50
|
-
|
|
44
|
+
return o;
|
|
45
|
+
}, E = (t, n) => {
|
|
46
|
+
let r, c = n;
|
|
47
|
+
for (; (r = t.exec(n)) !== null; )
|
|
48
|
+
if (r.length > 2) {
|
|
49
|
+
const l = r[0], e = r[2], o = A.find((a) => s(a.code) == s(e) || s(a.name) == s(e) || s(a.symbol) == s(e));
|
|
50
|
+
o && (c = c.replaceAll(l, o.symbol));
|
|
51
51
|
}
|
|
52
|
-
return
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
return c;
|
|
53
|
+
}, s = (t) => t && t.trim().toLowerCase(), N = (t, n, r) => {
|
|
54
|
+
const c = {};
|
|
55
|
+
Object.keys(n).forEach((o) => {
|
|
56
|
+
c[o] = n[o], c[o.replace(/\s+/g, "_")] = n[o];
|
|
57
|
+
});
|
|
58
|
+
let l = t.replace(/\{([^}]+)\}/g, (o, a) => `{${a.replace(/\s+/g, "_")}}`), e = g(l, c).replace(/(?:\r\n|\r|\n)/g, "<br>");
|
|
59
|
+
return e = m(f, e, { style: "percent" }, !0, r), e = m(b, e, { style: "decimal" }, !1, r), e = m(h, e, { notation: "compact" }, !1, r), e = E(x, e), e;
|
|
56
60
|
};
|
|
57
61
|
export {
|
|
58
|
-
|
|
62
|
+
N as formatContent
|
|
59
63
|
};
|
|
@@ -1,50 +1,81 @@
|
|
|
1
|
-
import
|
|
2
|
-
class
|
|
3
|
-
constructor(
|
|
4
|
-
if (super(
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import D from "./Colors.js";
|
|
2
|
+
class A extends D {
|
|
3
|
+
constructor(n, l, h, g, j, f, d, E, b, o, C, p, t) {
|
|
4
|
+
if (super(h, g, j, E, b), this.type = l, this._manualColor = {}, p && (this._manualColor[p] = o ? o.Overall : null), n != "csv") {
|
|
5
|
+
const m = (u) => {
|
|
6
|
+
const _ = (f ? [...f] : [])[u];
|
|
7
|
+
let s = [];
|
|
8
|
+
_ && (s = _.items || []), o != null && o != null && Object.keys(o).forEach((e) => {
|
|
9
|
+
const c = s.filter((i) => i.code === e || i.value === e || i.id === e || i.label === e), r = o[e];
|
|
10
|
+
if (this._manualColor[e] = r, c.length > 0) {
|
|
11
|
+
const i = c[0];
|
|
12
|
+
i.value !== void 0 && (this._manualColor[i.value] = r), i.label !== void 0 && (this._manualColor[i.label] = r), i.code !== void 0 && (this._manualColor[i.code] = r), i.id !== void 0 && (this._manualColor[i.id] = r);
|
|
13
|
+
const B = t && (t[e] || i.value && t[i.value] || i.code && t[i.code]);
|
|
14
|
+
if (B && (this._manualColor[B] = r), i.labels) {
|
|
15
|
+
let y;
|
|
16
|
+
C && (y = i.labels[C.toUpperCase()]), y && (this._manualColor[y] = r), Object.values(i.labels).forEach((O) => {
|
|
17
|
+
O && (this._manualColor[O] = r);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
12
20
|
}
|
|
13
21
|
});
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
}, x = () => {
|
|
23
|
+
const u = d ? [...d] : [];
|
|
24
|
+
o != null && o != null && Object.keys(o).forEach((a) => {
|
|
25
|
+
const _ = u.filter((e) => e.value === a || e.code === a || e.id === a || e.label === a), s = o[a];
|
|
26
|
+
if (this._manualColor[a] = s, _.length > 0) {
|
|
27
|
+
const e = _[0];
|
|
28
|
+
e.value !== void 0 && (this._manualColor[e.value] = s), e.label !== void 0 && (this._manualColor[e.label] = s), e.code !== void 0 && (this._manualColor[e.code] = s), e.id !== void 0 && (this._manualColor[e.id] = s);
|
|
29
|
+
const c = t && (t[a] || e.value && t[e.value] || e.code && t[e.code]);
|
|
30
|
+
if (c && (this._manualColor[c] = s), e.labels) {
|
|
31
|
+
let r;
|
|
32
|
+
C && (r = e.labels[C.toUpperCase()]), r && (this._manualColor[r] = s), Object.values(e.labels).forEach((i) => {
|
|
33
|
+
i && (this._manualColor[i] = s);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
22
36
|
}
|
|
23
37
|
});
|
|
24
|
-
},
|
|
25
|
-
Object.keys(
|
|
26
|
-
this._manualColor[
|
|
38
|
+
}, z = () => {
|
|
39
|
+
Object.keys(o).forEach((u) => {
|
|
40
|
+
this._manualColor[u] = o[u];
|
|
27
41
|
});
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const m = _ == "line" ? 1 : r === "index" ? 0 : 1;
|
|
31
|
-
!h && !u ? B() : h ? h.size == 1 && m == 1 ? a == "measure" ? y(0) : b() : y(m) : b();
|
|
42
|
+
}, v = l == "line" ? 1 : h === "index" ? 0 : 1;
|
|
43
|
+
!f && !d ? z() : !f || f.size === 0 ? x() : f.size == 1 && v == 1 ? b == "measure" ? m(0) : x() : f.size == 1 && v == 0 ? m(0) : m(v);
|
|
32
44
|
} else
|
|
33
|
-
this._manualColor =
|
|
45
|
+
this._manualColor = o && o[h] ? o[h] : {};
|
|
34
46
|
}
|
|
35
|
-
getColor(
|
|
47
|
+
getColor(n, l) {
|
|
48
|
+
if (this._manualColor[n])
|
|
49
|
+
return this._manualColor[n];
|
|
50
|
+
if (l) {
|
|
51
|
+
if (this.indexBy && l[this.indexBy] && this._manualColor[l[this.indexBy]])
|
|
52
|
+
return this._manualColor[l[this.indexBy]];
|
|
53
|
+
if (l.id && this._manualColor[l.id])
|
|
54
|
+
return this._manualColor[l.id];
|
|
55
|
+
if (l.label && this._manualColor[l.label])
|
|
56
|
+
return this._manualColor[l.label];
|
|
57
|
+
if (l.value && this._manualColor[l.value])
|
|
58
|
+
return this._manualColor[l.value];
|
|
59
|
+
if (l.code && this._manualColor[l.code])
|
|
60
|
+
return this._manualColor[l.code];
|
|
61
|
+
if (l.measure && this._manualColor[l.measure])
|
|
62
|
+
return this._manualColor[l.measure];
|
|
63
|
+
if (l.measureFieldName && this._manualColor[l.measureFieldName])
|
|
64
|
+
return this._manualColor[l.measureFieldName];
|
|
65
|
+
}
|
|
36
66
|
if (this.colorBy === "index") {
|
|
37
|
-
const
|
|
38
|
-
return
|
|
67
|
+
const h = this._manualColor[n] || l && this.indexBy && this._manualColor[l[this.indexBy]];
|
|
68
|
+
return h || "#5555";
|
|
39
69
|
}
|
|
40
|
-
return this.colorBy === "id" && this._manualColor[
|
|
70
|
+
return this.colorBy === "id" && this._manualColor[n] ? this._manualColor[n] : "#5555";
|
|
41
71
|
}
|
|
42
|
-
getColorByIndex(
|
|
72
|
+
getColorByIndex(n) {
|
|
73
|
+
return this._manualColor[n] ? this._manualColor[n] : "#5555";
|
|
43
74
|
}
|
|
44
|
-
getColorByKey(
|
|
45
|
-
return this._manualColor[
|
|
75
|
+
getColorByKey(n) {
|
|
76
|
+
return this._manualColor[n] ? this._manualColor[n] : "#5555";
|
|
46
77
|
}
|
|
47
78
|
}
|
|
48
79
|
export {
|
|
49
|
-
|
|
80
|
+
A as default
|
|
50
81
|
};
|