@astrato-io/visualizations 0.10.1 → 0.12.0
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/CHANGELOG.md +30 -1
- package/README.md +148 -5
- package/THIRD_PARTY_NOTICES.md +494 -0
- package/VISUALIZATION_DEFINITIONS.md +9 -146
- package/chunks/{Button-Dn3rJrYf.js → Button-CQdoKSXX.js} +3 -3
- package/chunks/{CircularProgress-BFeu06Yb.js → CircularProgress-DpT1lwWw.js} +20 -20
- package/chunks/FieldTypeIcon-Cg4F9Q5D.js +22 -0
- package/chunks/{LinearProgress-ClO6GUjN.js → LinearProgress-B7S0Q26A.js} +14 -14
- package/chunks/{MenuOption-Czc34u4q.js → MenuOption-DpKFJxmo.js} +167 -167
- package/chunks/{Title-BgYnaVTR.js → Title-m5damhc0.js} +37 -37
- package/chunks/{_createAggregator-BMu9uRax.js → _createAggregator-BA8_iU9q.js} +17 -17
- package/chunks/{app-filter-bar.compiler-CVir0wkl.js → app-filter-bar.compiler--T4Qz3Wu.js} +8 -8
- package/chunks/{bar-layout-C_UgRlVl.js → bar-layout-OFhxn2Go.js} +2 -2
- package/chunks/{bar.compiler-DYuFdi9J.js → bar.compiler-hWZBYYvV.js} +71 -69
- package/chunks/{builder-C-TKA-My.js → builder-7w_bgV_h.js} +106 -55
- package/chunks/{coloring-BtnPiQ_o.js → coloring-Cd6p0GQJ.js} +93 -88
- package/chunks/{createSimplePaletteValueFilter--zrZxRV9.js → createSimplePaletteValueFilter-CiJT8s1s.js} +169 -169
- package/chunks/defaults-CMFqXvaJ.js +3 -0
- package/chunks/{definitions-CT304NDn.js → definitions-DTauTjIX.js} +399 -398
- package/chunks/{escobar-CvEV2ES1.js → escobar-CMvphKSK.js} +4949 -4879
- package/chunks/{extend-preset-D9-JP92b.js → extend-preset-BpXttHFk.js} +449 -450
- package/chunks/{filter.compiler-CXeZznks.js → filter.compiler-DOGFweJz.js} +10 -10
- package/chunks/{filtering-8_bFv-jb.js → filtering-NOnDcGbo.js} +241 -241
- package/chunks/handlers-CyYFSfhM.js +15393 -0
- package/chunks/{icon-picker-styles-BXiJ1SZS.js → icon-picker-styles-DuSERhBU.js} +8 -8
- package/chunks/{isEqual-D8Ay63xR.js → isEqual-4f8yUUtC.js} +1 -1
- package/chunks/{isFocusVisible-Bu8gGZu5.js → isFocusVisible-Czm70MGc.js} +9 -9
- package/chunks/line.compiler-B-4H55_T.js +203 -0
- package/chunks/linear-Bq_r9l5S.js +264 -0
- package/chunks/{logger-DdZpR7xZ.js → logger-Cioob-QV.js} +74 -73
- package/chunks/{lookup-BWllin0q.js → lookup-B3tWH2hX.js} +1 -0
- package/chunks/{map.compiler-Q_Y1Pvat.js → map.compiler-Cv5V6EhF.js} +40 -40
- package/chunks/measure-axis-label-format-COy8U_dd.js +27 -0
- package/chunks/measure-format-default-B_kuGSzi.js +26 -0
- package/chunks/{metadata-BQm_TXI1.js → metadata-dGSe5UWy.js} +5 -5
- package/chunks/number.compiler-D7nMcEMv.js +57 -0
- package/chunks/{operations-DKQWuLL7.js → operations-CgfehCad.js} +11397 -11114
- package/chunks/{range-BdhzvYQ_.js → range-Dmwp9kVB.js} +2 -2
- package/chunks/{react-dom-BGP4tbXV.js → react-dom-CfuL-m78.js} +82 -82
- package/chunks/{render-wrappers-BZpyDnJy.js → render-wrappers--g-zPFBW.js} +1 -1
- package/chunks/{requirements-e8Fe96ag.js → requirements-DHayNJ2C.js} +245 -221
- package/chunks/{shared-C_2F90xq.js → shared-DoEN9nNM.js} +505 -494
- package/chunks/standalone-B3hRGgYi.js +773 -0
- package/chunks/{standalone-BkbiH-o8.js → standalone-BPNXgFft.js} +498 -759
- package/chunks/standalone-BPTT8XEu.js +424 -0
- package/chunks/standalone-BgAeHROc.js +2 -0
- package/chunks/{standalone-BE_ONgiG.js → standalone-BkQxag7M.js} +102 -102
- package/chunks/{standalone-Cc98Pdr6.js → standalone-Bxa3x6dg.js} +872 -872
- package/chunks/standalone-C0If-V6O.js +773 -0
- package/chunks/standalone-C1TOyflX.js +287 -0
- package/chunks/{standalone-CY_kjarf.js → standalone-CE5PwJN0.js} +18 -18
- package/chunks/{standalone-B8ZSqauS.js → standalone-CG7IFN6n.js} +120 -120
- package/chunks/{standalone-wOWRCpdn.js → standalone-CKlgGu80.js} +49 -49
- package/chunks/standalone-CNf-oA2U.js +355 -0
- package/chunks/{standalone-BDrXVxlP.js → standalone-CXPdWFlw.js} +14 -14
- package/chunks/{standalone-z0o52o5t.js → standalone-Cf0_5tbu.js} +5567 -5568
- package/chunks/{standalone-Cl0TSfqC.js → standalone-DMi4-Vp3.js} +122 -122
- package/chunks/{standalone-DNh9NcMa.js → standalone-DTEX67C8.js} +154 -154
- package/chunks/{standalone-DHRalbVO.js → standalone-DU46-kYv.js} +279 -279
- package/chunks/standalone-Dbn3jSH6.js +690 -0
- package/chunks/{standalone-CsoMmE9T.js → standalone-DdcAL_k_.js} +839 -843
- package/chunks/standalone-DwCIA0UG.js +1057 -0
- package/chunks/standalone-Dz13tl3P.js +357 -0
- package/chunks/standalone-H9GFzFk_.js +8377 -0
- package/chunks/{standalone-CaTxAydz.js → standalone-MduR0qre.js} +2227 -1000
- package/chunks/standalone-ejTz66P3.js +2 -0
- package/chunks/{standalone-DflyWtuR.js → standalone-keB-0wK3.js} +216 -216
- package/chunks/{standalone-BTY3w_JA.js → standalone-nnkuQd0K.js} +28 -28
- package/chunks/standalone-vGGR6Vcn.js +6 -0
- package/chunks/{table.compiler-COaHE9VD.js → table.compiler-mS4UvhLT.js} +31 -31
- package/chunks/theme-MYp6Rj1J.js +232 -0
- package/chunks/{useFieldName-CdnCWzhd.js → useFieldName-AdSak4Ch.js} +1 -1
- package/chunks/{utils-DganVptf.js → utils-CUKgR7it.js} +4216 -4070
- package/chunks/{view-Bzlros43.js → view-BeYwpcVD.js} +1561 -1561
- package/chunks/{visualization-filters-D7i6oh1Z.js → visualization-filters-B9qik5_K.js} +2683 -2342
- package/chunks/{with-html-element-CiIhFEa5.js → with-html-element-1GSeLT59.js} +3712 -3682
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +144 -32
- package/docs/operations/combo.md +79 -17
- package/docs/operations/date-picker.md +4 -4
- package/docs/operations/distribution-gauge.md +18 -16
- package/docs/operations/dot.md +107 -24
- package/docs/operations/filter.md +10 -8
- package/docs/operations/gauge.md +20 -18
- package/docs/operations/heatMap.md +73 -21
- package/docs/operations/histogram.md +45 -12
- package/docs/operations/iframe.md +1 -1
- package/docs/operations/image.md +1 -1
- package/docs/operations/index.md +12 -11
- package/docs/operations/line.md +86 -24
- package/docs/operations/map.md +5274 -0
- package/docs/operations/number.md +10 -9
- package/docs/operations/pie.md +23 -21
- package/docs/operations/radar.md +13 -11
- package/docs/operations/sankey.md +19 -17
- package/docs/operations/scatter.md +111 -28
- package/docs/operations/shape.md +5 -5
- package/docs/operations/simpleTextObject.md +4 -4
- package/docs/operations/slider.md +1 -1
- package/docs/operations/table.md +27 -25
- package/docs/operations/tree.md +5 -3
- package/docs/operations/treemap.md +70 -18
- package/docs/operations/waterfall.md +40 -7
- package/docs/operations/word-cloud.md +69 -17
- package/getters.js +3 -3
- package/index.js +585 -612
- package/metadata.js +2 -2
- package/operations.js +25 -18
- package/package.json +74 -70
- package/src/definitions/index.d.ts +1 -7
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +3 -48
- package/src/definitions/model/definitions/schema-registry.d.ts +15 -14
- package/src/definitions/model/definitions/schemas/bar.schema.d.ts +3 -3
- package/src/definitions/model/definitions/schemas/broad-chart.schema.d.ts +2 -2
- package/src/definitions/model/definitions/schemas/common.schema.d.ts +19 -6
- package/src/definitions/model/definitions/schemas/index.d.ts +1 -1
- package/src/definitions/model/definitions/schemas/line.schema.d.ts +4 -3
- package/src/definitions/model/definitions/schemas/number.schema.d.ts +1 -1
- package/src/definitions/model/definitions/schemas/table.schema.d.ts +14 -14
- package/src/index.d.ts +1 -1
- package/src/operations/index.d.ts +11 -1
- package/src/types.d.ts +166 -1
- package/src/visualization-catalog.d.ts +3 -0
- package/styles.css +1 -1
- package/chunks/FieldTypeIcon-DrMoGpHJ.js +0 -22
- package/chunks/color-rules-DYJL4fIW.js +0 -15
- package/chunks/color-settings-DJFoFTip.js +0 -5
- package/chunks/defaults-Dtk7fg3C.js +0 -3
- package/chunks/handlers-C6CZ0XJA.js +0 -15399
- package/chunks/line.compiler-DmHpmQCC.js +0 -198
- package/chunks/number.compiler-DQdg6zTy.js +0 -53
- package/chunks/standalone-4MsKiqs0.js +0 -355
- package/chunks/standalone-B794g9pE.js +0 -1012
- package/chunks/standalone-BA2YXyJS.js +0 -422
- package/chunks/standalone-BgumbdaJ2.js +0 -357
- package/chunks/standalone-Blh4qejk.js +0 -689
- package/chunks/standalone-CXY4FpF7.js +0 -773
- package/chunks/standalone-DH0xTEes.js +0 -2
- package/chunks/standalone-DcnHjNnC.js +0 -2
- package/chunks/standalone-DrHdGkY7.js +0 -762
- package/chunks/standalone-c_rROMtx.js +0 -287
- package/chunks/standalone-drcFLeN6.js +0 -6
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
import { o as e, t } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
scale: o,
|
|
19
|
-
ref: i || "color"
|
|
2
|
+
import { $c as n, Do as r, Pt as i, Ua as a, Us as o, Xs as s, Yr as c, u as l, ul as u } from "./visualization-filters-B9qik5_K.js";
|
|
3
|
+
import { Dn as d } from "./utils-CUKgR7it.js";
|
|
4
|
+
import "./logger-Cioob-QV.js";
|
|
5
|
+
import { t as f, u as p } from "./src-77e3mC7i.js";
|
|
6
|
+
var m = (e, t, r) => e?.type === n.Single ? h(t, e.color ?? void 0) : e?.type === n.Categorical ? {
|
|
7
|
+
ref: r || void 0,
|
|
8
|
+
scale: n.Categorical
|
|
9
|
+
} : e?.type === n.Gradient ? {
|
|
10
|
+
ref: r || void 0,
|
|
11
|
+
scale: n.Gradient
|
|
12
|
+
} : h(t), h = (e, t) => t ?? e.colors.brandColors[0], g = (e, t, r, i, a, o = !1) => {
|
|
13
|
+
let s = e?.coloring?.type;
|
|
14
|
+
if ((s === n.Single || s === n.PerEachMeasure) && t.scales[s]?.range) {
|
|
15
|
+
if (o) return {
|
|
16
|
+
scale: s,
|
|
17
|
+
ref: a || "color"
|
|
20
18
|
};
|
|
21
|
-
let n = e.measures.findIndex((e) =>
|
|
22
|
-
if (typeof
|
|
19
|
+
let n = e.measures.findIndex((e) => i?.dataItem === e.dataItem), r = t.scales[s].range?.[n];
|
|
20
|
+
if (typeof r == "string") return r;
|
|
23
21
|
}
|
|
24
|
-
return e?.coloring?.type ===
|
|
25
|
-
},
|
|
22
|
+
return e?.coloring?.type === n.Single ? i?.graphColor ?? e?.coloring?.color ?? r.colors.brandColors[0] : m(e.coloring, r, a);
|
|
23
|
+
}, _ = (e, t) => {
|
|
26
24
|
let n = null;
|
|
27
25
|
if (t?.pattern) {
|
|
28
26
|
let r = e.datum, i = Object.keys(r).reduce((e, t) => {
|
|
@@ -32,54 +30,54 @@ var p = (e, t, n) => e?.type === s.Single ? m(t, e.color ?? void 0) : e?.type ==
|
|
|
32
30
|
t.itemsMap?.[o] || (n = a.grey3);
|
|
33
31
|
}
|
|
34
32
|
return n;
|
|
35
|
-
},
|
|
33
|
+
}, v = /* @__PURE__ */ t(((e, t) => {
|
|
36
34
|
var n = Math.max, r = Math.min;
|
|
37
35
|
function i(e, t, i) {
|
|
38
36
|
return e >= r(t, i) && e < n(t, i);
|
|
39
37
|
}
|
|
40
38
|
t.exports = i;
|
|
41
|
-
})),
|
|
42
|
-
var n =
|
|
39
|
+
})), y = /* @__PURE__ */ t(((e, t) => {
|
|
40
|
+
var n = d(), r = Infinity, i = 17976931348623157e292;
|
|
43
41
|
function a(e) {
|
|
44
42
|
return e ? (e = n(e), e === r || e === -r ? (e < 0 ? -1 : 1) * i : e === e ? e : 0) : e === 0 ? e : 0;
|
|
45
43
|
}
|
|
46
44
|
t.exports = a;
|
|
47
|
-
})),
|
|
48
|
-
var n =
|
|
45
|
+
})), b = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
46
|
+
var n = v(), r = y(), i = d();
|
|
49
47
|
function a(e, t, a) {
|
|
50
48
|
return t = r(t), a === void 0 ? (a = t, t = 0) : a = r(a), e = i(e), n(e, t, a);
|
|
51
49
|
}
|
|
52
50
|
t.exports = a;
|
|
53
|
-
})))()),
|
|
51
|
+
})))()), x = /* @__PURE__ */ e(i()), S = (e) => typeof e == "string" ? e : `${e}`, C = [
|
|
54
52
|
"equals",
|
|
55
53
|
"contains",
|
|
56
54
|
"startsWith",
|
|
57
55
|
"endsWith"
|
|
58
|
-
],
|
|
56
|
+
], w = [
|
|
59
57
|
"greater",
|
|
60
58
|
"less",
|
|
61
59
|
"greater-equals",
|
|
62
60
|
"less-equals",
|
|
63
61
|
"between",
|
|
64
62
|
"not-equals"
|
|
65
|
-
],
|
|
66
|
-
if (
|
|
63
|
+
], T = ["inList", "notInList"], E = (e) => s(e) || typeof e != "string" || e.length === 0 ? "," : e, D = (e, t) => {
|
|
64
|
+
if (s(e.value)) return !1;
|
|
67
65
|
let n = e.operator || "equals";
|
|
68
|
-
return
|
|
66
|
+
return C.includes(n) ? k(e, t) : w.includes(n) ? A(e, t) : T.includes(n) ? O(e, t) : !1;
|
|
69
67
|
};
|
|
70
|
-
function
|
|
68
|
+
function O(e, t) {
|
|
71
69
|
let n = e.operator;
|
|
72
70
|
if (t == null || e?.value === null || e?.value === void 0) return !1;
|
|
73
|
-
let r =
|
|
71
|
+
let r = S(t), i = S(e.value), a = E(e.delimiter), o = new Set(i.split(a).map((e) => e.trim()).filter((e) => e.length > 0));
|
|
74
72
|
if (o.size === 0) return !1;
|
|
75
73
|
let s = o.has(r);
|
|
76
74
|
return n === "notInList" ? !s : s;
|
|
77
75
|
}
|
|
78
|
-
function
|
|
79
|
-
let n =
|
|
76
|
+
function k(e, t) {
|
|
77
|
+
let n = S(t), r = e?.value, i = e.operator || "equals";
|
|
80
78
|
if (i === "equals") return r === n;
|
|
81
79
|
if (t == null || r == null || r === "") return !1;
|
|
82
|
-
let a =
|
|
80
|
+
let a = S(r);
|
|
83
81
|
switch (i) {
|
|
84
82
|
case "contains": return n.includes(a);
|
|
85
83
|
case "startsWith": return n.startsWith(a);
|
|
@@ -87,10 +85,10 @@ function O(e, t) {
|
|
|
87
85
|
default: return !1;
|
|
88
86
|
}
|
|
89
87
|
}
|
|
90
|
-
function
|
|
88
|
+
function A(e, t) {
|
|
91
89
|
let n = Number(t), r = Number(e?.value), i = e.operator || "equals";
|
|
92
90
|
if (i === "equals") return r === n;
|
|
93
|
-
if ((0,
|
|
91
|
+
if ((0, x.default)(t) || (0, x.default)(r) || Number.isNaN(n) || Number.isNaN(r)) return !1;
|
|
94
92
|
switch (i) {
|
|
95
93
|
case "greater": return n > r;
|
|
96
94
|
case "less": return n < r;
|
|
@@ -98,14 +96,14 @@ function k(e, t) {
|
|
|
98
96
|
case "less-equals": return n <= r;
|
|
99
97
|
case "between": {
|
|
100
98
|
let t = Number(e.secondValue);
|
|
101
|
-
return (0,
|
|
99
|
+
return (0, x.default)(t) || Number.isNaN(t) ? !1 : (0, b.default)(n, r, t);
|
|
102
100
|
}
|
|
103
101
|
case "not-equals": return n !== r;
|
|
104
102
|
default: return !1;
|
|
105
103
|
}
|
|
106
104
|
}
|
|
107
|
-
|
|
108
|
-
var
|
|
105
|
+
f();
|
|
106
|
+
var j = c("color-manager", "#3f6212"), M = (e, t) => {
|
|
109
107
|
if (t === "null") return null;
|
|
110
108
|
switch (typeof e) {
|
|
111
109
|
case "boolean": return typeof t == "boolean" ? t : String(t).toLowerCase() === "true";
|
|
@@ -113,46 +111,46 @@ var A = i("color-manager", "#3f6212"), j = (e, t) => {
|
|
|
113
111
|
case "number": return typeof t == "string" ? parseFloat(t) : Number(t);
|
|
114
112
|
default: return t;
|
|
115
113
|
}
|
|
116
|
-
},
|
|
114
|
+
}, N = (e) => s(e) || typeof e != "string" || e.length === 0 ? "," : e, P = (e) => {
|
|
117
115
|
if (typeof e.value != "string" && typeof e.value != "number") return [];
|
|
118
|
-
let t =
|
|
116
|
+
let t = N(typeof e.delimiter == "string" ? e.delimiter : void 0);
|
|
119
117
|
return String(e.value).split(t).map((e) => e.trim()).filter((e) => e.length > 0);
|
|
120
|
-
},
|
|
118
|
+
}, F = (e, t) => {
|
|
121
119
|
let n = String(e);
|
|
122
120
|
if (t[n]) return t[n];
|
|
123
121
|
let r = n.split("").reverse().reduce((e, t, n) => e + t.charCodeAt(0) * (1 + n), 0);
|
|
124
122
|
return t[n] = r, r;
|
|
125
|
-
},
|
|
126
|
-
if ((0,
|
|
127
|
-
if (
|
|
128
|
-
let n =
|
|
129
|
-
if ([
|
|
130
|
-
let n =
|
|
123
|
+
}, I = (e, t) => {
|
|
124
|
+
if ((0, x.default)(e.value)) return !1;
|
|
125
|
+
if (s(e.value) || r(e.value)) return j.warn("Color rule not preprocessed correctly - ignoring", e), !1;
|
|
126
|
+
let n = M(t, e.value);
|
|
127
|
+
if ([o.InList, o.NotInList].includes(e.operator)) {
|
|
128
|
+
let n = P(e);
|
|
131
129
|
if (n.length === 0) return !1;
|
|
132
|
-
let r = new Set(n.map((e) =>
|
|
133
|
-
return e.operator ===
|
|
130
|
+
let r = new Set(n.map((e) => M(t, e))).has(t);
|
|
131
|
+
return e.operator === o.NotInList ? !r : r;
|
|
134
132
|
}
|
|
135
133
|
if (typeof t != "number") switch (e.operator) {
|
|
136
|
-
case
|
|
137
|
-
case
|
|
134
|
+
case o.Equals: return t === n;
|
|
135
|
+
case o.NotEquals: return t !== n;
|
|
138
136
|
default: return !1;
|
|
139
137
|
}
|
|
140
138
|
switch (e.operator) {
|
|
141
|
-
case
|
|
142
|
-
case
|
|
143
|
-
case
|
|
144
|
-
case
|
|
145
|
-
case
|
|
146
|
-
case
|
|
147
|
-
if ((0,
|
|
148
|
-
if (
|
|
149
|
-
let
|
|
150
|
-
return n <= t && t <=
|
|
139
|
+
case o.Equals: return t === n;
|
|
140
|
+
case o.Greater: return t > n;
|
|
141
|
+
case o.Less: return t < n;
|
|
142
|
+
case o.GreaterEquals: return t >= n;
|
|
143
|
+
case o.LessEquals: return t <= n;
|
|
144
|
+
case o.Between: {
|
|
145
|
+
if ((0, x.default)(e.secondValue)) return !1;
|
|
146
|
+
if (s(e.secondValue) || r(e.secondValue)) return j.warn("Color rule not preprocessed correctly - ignoring", e), !1;
|
|
147
|
+
let i = M(t, e.secondValue);
|
|
148
|
+
return n <= t && t <= i;
|
|
151
149
|
}
|
|
152
|
-
case
|
|
150
|
+
case o.NotEquals: return t !== n;
|
|
153
151
|
default: return !1;
|
|
154
152
|
}
|
|
155
|
-
},
|
|
153
|
+
}, L = (e) => typeof e == "string" ? parseFloat(e) : e, R = {}, z = class {
|
|
156
154
|
vSpec;
|
|
157
155
|
vTheme;
|
|
158
156
|
notAffectedItems;
|
|
@@ -174,7 +172,7 @@ var A = i("color-manager", "#3f6212"), j = (e, t) => {
|
|
|
174
172
|
let i = e[r], a = this.resolveColorOverwriteValues(i, n);
|
|
175
173
|
if (!this.hasUnresolvedSupportingMeasureValue(i, n)) for (let e = 0; e < t.length; e++) {
|
|
176
174
|
let r = t[e];
|
|
177
|
-
if (
|
|
175
|
+
if (D(a, this.getValueFromProp(n, r))) return a?.color;
|
|
178
176
|
}
|
|
179
177
|
}
|
|
180
178
|
return null;
|
|
@@ -189,7 +187,7 @@ var A = i("color-manager", "#3f6212"), j = (e, t) => {
|
|
|
189
187
|
let r = i[t], a = this.resolveColorOverwriteValues(r, e);
|
|
190
188
|
if (this.hasUnresolvedSupportingMeasureValue(r, e)) continue;
|
|
191
189
|
let o = this.getValueFromProp(e, n || this.MAIN_FIELD);
|
|
192
|
-
if ((a.operator || "equals") === "equals" && (a?.value === o || a?.value ===
|
|
190
|
+
if ((a.operator || "equals") === "equals" && (a?.value === o || a?.value === S(o)) || D(a, o)) return a?.color;
|
|
193
191
|
}
|
|
194
192
|
return null;
|
|
195
193
|
}
|
|
@@ -197,17 +195,17 @@ var A = i("color-manager", "#3f6212"), j = (e, t) => {
|
|
|
197
195
|
return this.vSpec.coloring?.rules?.find((t) => {
|
|
198
196
|
if (e.datum.series && !e.datum.series.source && e.datum.series.value !== t.dataItemId) return !1;
|
|
199
197
|
let n = e.datum[t.dataItemId]?.value;
|
|
200
|
-
return n !== void 0 &&
|
|
198
|
+
return n !== void 0 && I(this.resolveColorRuleValues(t, e), L(n));
|
|
201
199
|
})?.color || null;
|
|
202
200
|
}
|
|
203
201
|
getHash(e) {
|
|
204
|
-
return
|
|
202
|
+
return F(e, R);
|
|
205
203
|
}
|
|
206
204
|
getValueFromProp(e, t, n) {
|
|
207
205
|
return t === this.MAIN_FIELD ? e.datum?.value : e.datum[t || n || ""]?.value;
|
|
208
206
|
}
|
|
209
207
|
resolveColoringConditionValue(e, t) {
|
|
210
|
-
return
|
|
208
|
+
return r(e) ? t.datum[e.dataItemId]?.value : e;
|
|
211
209
|
}
|
|
212
210
|
resolveColorRuleValues(e, t) {
|
|
213
211
|
return {
|
|
@@ -224,31 +222,38 @@ var A = i("color-manager", "#3f6212"), j = (e, t) => {
|
|
|
224
222
|
};
|
|
225
223
|
}
|
|
226
224
|
hasUnresolvedSupportingMeasureValue(e, t) {
|
|
227
|
-
return [e.value, e.secondValue].some((e) =>
|
|
225
|
+
return [e.value, e.secondValue].some((e) => r(e) && this.resolveColoringConditionValue(e, t) === void 0);
|
|
226
|
+
}
|
|
227
|
+
getThemeCategoryColor(e) {
|
|
228
|
+
let t = l(this.vTheme);
|
|
229
|
+
if (t.null && e == null) return t.null;
|
|
230
|
+
let n = this.vSpec.querySettings?.topN;
|
|
231
|
+
if (t.others && n?.enabled && n.showOthers && e === (n.othersLabel?.stringLabel ?? "Others")) return t.others;
|
|
228
232
|
}
|
|
229
233
|
getColorByScale(e, t = {}) {
|
|
230
|
-
let { ref:
|
|
234
|
+
let { ref: r, dataItemId: i } = t;
|
|
231
235
|
switch (this.vSpec.coloring?.type) {
|
|
232
|
-
case
|
|
233
|
-
let t = e.resources.scale(
|
|
234
|
-
if (
|
|
235
|
-
|
|
236
|
-
|
|
236
|
+
case n.Categorical: {
|
|
237
|
+
let t = e.resources.scale(n.Categorical), a = i || this.getValueFromProp(e, r, "color"), o = this.getThemeCategoryColor(a);
|
|
238
|
+
if (o) return o;
|
|
239
|
+
if (this.vSpec.coloring.persistentColors === !1) return t(a);
|
|
240
|
+
let s = t.range();
|
|
241
|
+
return s[this.getHash(a) % s.length];
|
|
237
242
|
}
|
|
238
|
-
case
|
|
239
|
-
let t = e.resources.scale(
|
|
243
|
+
case n.Gradient: {
|
|
244
|
+
let t = e.resources.scale(n.Gradient)(i || this.getValueFromProp(e, r, "end"));
|
|
240
245
|
return Number.isNaN(t) ? "#000000" : t;
|
|
241
246
|
}
|
|
242
|
-
case
|
|
243
|
-
case
|
|
247
|
+
case n.PerEachMeasure: return e.resources.scale(n.PerEachMeasure)(i || this.getValueFromProp(e, r, "color"));
|
|
248
|
+
case n.Single: return e.resources.scale(n.Single)(i || this.getValueFromProp(e, r, "color"));
|
|
244
249
|
default: return this.getSimpleColor();
|
|
245
250
|
}
|
|
246
251
|
}
|
|
247
252
|
overrideColorOpacity(e, t) {
|
|
248
|
-
return !e || !t ? e :
|
|
253
|
+
return !e || !t ? e : p(e).copy({ opacity: t }).toString();
|
|
249
254
|
}
|
|
250
255
|
getFilteredColor(e, t) {
|
|
251
|
-
return
|
|
256
|
+
return _(e, t);
|
|
252
257
|
}
|
|
253
258
|
getColorDefinition(e, t) {
|
|
254
259
|
return (n) => {
|
|
@@ -268,11 +273,11 @@ var A = i("color-manager", "#3f6212"), j = (e, t) => {
|
|
|
268
273
|
};
|
|
269
274
|
}
|
|
270
275
|
getMeasureColor(e, t) {
|
|
271
|
-
let
|
|
272
|
-
return typeof
|
|
276
|
+
let n = this.vSpec?.coloring?.type, r = this.vSpec.measures.findIndex((e) => u(t?.dataItem, e.dataItem)), i = n ? e.scales[n]?.range?.[r] : void 0;
|
|
277
|
+
return typeof i == "string" ? i : t?.graphColor ?? this.vSpec?.coloring?.color ?? this.vTheme.colors.brandColors[0];
|
|
273
278
|
}
|
|
274
279
|
static getColorWithCallback(e, t) {
|
|
275
280
|
return (n) => t(typeof e == "function" ? e(n) : e, n);
|
|
276
281
|
}
|
|
277
282
|
};
|
|
278
|
-
export {
|
|
283
|
+
export { y as a, h as c, D as i, F as n, _ as o, I as r, g as s, z as t };
|