@astrato-io/visualizations 0.0.0-stage → 0.6.5
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 +23 -0
- package/LICENSE +93 -0
- package/README.md +843 -2
- package/THIRD_PARTY_NOTICES.md +8477 -0
- package/VISUALIZATION_DEFINITIONS.md +2378 -0
- package/chunks/ClickAwayListener-BbeNMAvj.js +52 -0
- package/chunks/LinearProgress-B1FeWaen.js +253 -0
- package/chunks/accessors-DemrDevR.js +128 -0
- package/chunks/app-filter-bar.compiler-BGJ7HAbr.js +64 -0
- package/chunks/bar.compiler-CT0ZbQKc.js +374 -0
- package/chunks/builder-B6dWSIdD.js +12289 -0
- package/chunks/color-settings-ZIvgNTq1.js +10 -0
- package/chunks/coloring-B1XAfg6b.js +664 -0
- package/chunks/debounce-fn-CUixuz45.js +7 -0
- package/chunks/definitions-D3OVqmXl.js +2102 -0
- package/chunks/escobar-eDjtGpkC.js +34606 -0
- package/chunks/events-WZut5Ow6.js +4 -0
- package/chunks/extend-BKUkc4_i.js +37 -0
- package/chunks/filter.compiler-DBsyRBJt.js +70 -0
- package/chunks/filtering-tqjAyJH5.js +1072 -0
- package/chunks/grouping-type-On4s9Thj.js +3 -0
- package/chunks/handlers-VTBfIZYZ.js +13072 -0
- package/chunks/isEqual-BDxAhUo8.js +7514 -0
- package/chunks/line.compiler-CzdM5Ld0.js +198 -0
- package/chunks/metadata-BGElBy5Z.js +28 -0
- package/chunks/number.compiler-G-R7y16P.js +53 -0
- package/chunks/operations-CTNUX6Sy.js +26249 -0
- package/chunks/range-CiwTbMig.js +22 -0
- package/chunks/registry-CsQQzukD.js +920 -0
- package/chunks/requirements-DYjZCFyf.js +6 -0
- package/chunks/rolldown-runtime-DleVn1XH.js +28 -0
- package/chunks/set-coloring-datafield-B3uIS1Pe.js +8 -0
- package/chunks/shared-CBvcC5YV.js +1218 -0
- package/chunks/src-BOS6SqkZ.js +67 -0
- package/chunks/src-D9XogOrc.js +422 -0
- package/chunks/standalone-0M4HlmDW2.js +3944 -0
- package/chunks/standalone-0ashe9w1.js +411 -0
- package/chunks/standalone-B7jax8wa.js +339 -0
- package/chunks/standalone-BK0VYU-l.js +463 -0
- package/chunks/standalone-BMIbT1b2.js +4619 -0
- package/chunks/standalone-BZV5vOwA.js +6 -0
- package/chunks/standalone-BhDrWj4p.js +1980 -0
- package/chunks/standalone-BtSHCp2U2.js +673 -0
- package/chunks/standalone-BvaKdky9.js +344 -0
- package/chunks/standalone-BwtM31-f.js +2 -0
- package/chunks/standalone-C3gg736V.js +1129 -0
- package/chunks/standalone-CC1VUjO32.js +299 -0
- package/chunks/standalone-C_rYnZ0N.js +741 -0
- package/chunks/standalone-CoLrAxRV.js +13198 -0
- package/chunks/standalone-DC-aUgXC.js +3855 -0
- package/chunks/standalone-DCtRoTWg.js +675 -0
- package/chunks/standalone-DUDFTBqL.js +833 -0
- package/chunks/standalone-DhZkX9Td.js +2 -0
- package/chunks/standalone-DtLElfuM.js +512 -0
- package/chunks/standalone-G9Q4Uczu.js +726 -0
- package/chunks/standalone-JuLF-OoH.js +1762 -0
- package/chunks/standalone-_DeX21JJ.js +383 -0
- package/chunks/standalone-gFhKZh8m.js +179 -0
- package/chunks/standalone-tDNy-SFH.js +281 -0
- package/chunks/standalone-v1oxfU20.js +68 -0
- package/chunks/standalone-vzBY6q0I2.js +140 -0
- package/chunks/stroke-dash-UgMEcCS4.js +6 -0
- package/chunks/table.compiler-tb914oj3.js +222 -0
- package/chunks/typeof-CJDtcySz.js +13 -0
- package/chunks/ui-DQWtv2iM.js +63551 -0
- package/chunks/url-utils-B17gj_mr.js +5501 -0
- package/chunks/useFieldName-BvdcoJRl.js +7 -0
- package/chunks/utils-Bg7K-t6K.js +32379 -0
- package/chunks/view-Bn83C8d9.js +12466 -0
- package/definitions.js +3 -0
- package/docs/operations/astrato-app-filter-bar.md +161 -0
- package/docs/operations/bar.md +6968 -0
- package/docs/operations/combo.md +5804 -0
- package/docs/operations/date-picker.md +644 -0
- package/docs/operations/distribution-gauge.md +3082 -0
- package/docs/operations/dot.md +5570 -0
- package/docs/operations/filter.md +1483 -0
- package/docs/operations/gauge.md +3316 -0
- package/docs/operations/heatMap.md +5944 -0
- package/docs/operations/histogram.md +1856 -0
- package/docs/operations/iframe.md +56 -0
- package/docs/operations/image.md +177 -0
- package/docs/operations/index.md +46 -0
- package/docs/operations/line.md +6391 -0
- package/docs/operations/number.md +3903 -0
- package/docs/operations/pie.md +5956 -0
- package/docs/operations/radar.md +4566 -0
- package/docs/operations/sankey.md +3088 -0
- package/docs/operations/scatter.md +5969 -0
- package/docs/operations/shape.md +315 -0
- package/docs/operations/simpleTextObject.md +699 -0
- package/docs/operations/slider.md +220 -0
- package/docs/operations/table.md +8800 -0
- package/docs/operations/tree.md +2867 -0
- package/docs/operations/treemap.md +3527 -0
- package/docs/operations/waterfall.md +2928 -0
- package/docs/operations/word-cloud.md +3000 -0
- package/getters.js +18 -0
- package/index.js +1183 -0
- package/metadata.js +20 -0
- package/operations.js +64 -0
- package/package.json +185 -4
- package/src/definitions/index.d.ts +2 -0
- package/src/definitions/model/definitions/available-fields.d.ts +35 -0
- package/src/definitions/model/definitions/compilers/compile.d.ts +7 -0
- package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1341 -0
- package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
- package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
- package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
- package/src/definitions/model/definitions/index.d.ts +23 -0
- package/src/definitions/model/definitions/registry/compile.d.ts +2 -0
- package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
- package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
- package/src/definitions/model/definitions/schemas/app-filter-bar.schema.d.ts +22 -0
- package/src/definitions/model/definitions/schemas/bar.schema.d.ts +73 -0
- package/src/definitions/model/definitions/schemas/broad-chart.schema.d.ts +68 -0
- package/src/definitions/model/definitions/schemas/common.schema.d.ts +303 -0
- package/src/definitions/model/definitions/schemas/filter.schema.d.ts +22 -0
- package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
- package/src/definitions/model/definitions/schemas/line.schema.d.ts +72 -0
- package/src/definitions/model/definitions/schemas/number.schema.d.ts +21 -0
- package/src/definitions/model/definitions/schemas/object.schema.d.ts +215 -0
- package/src/definitions/model/definitions/schemas/table.schema.d.ts +458 -0
- package/src/definitions/model/definitions/types/compilation.types.d.ts +36 -0
- package/src/definitions/model/definitions/types/definition.types.d.ts +2 -0
- package/src/definitions/model/definitions/types/descriptor.types.d.ts +39 -0
- package/src/definitions/model/definitions/types/index.d.ts +3 -0
- package/src/definitions/model/definitions/validation.d.ts +3 -0
- package/src/getters/index.d.ts +30 -0
- package/src/index.d.ts +4 -0
- package/src/metadata/index.d.ts +4 -0
- package/src/operations/index.d.ts +30 -0
- package/src/registry/index.d.ts +6 -0
- package/src/runtime/index.d.ts +2 -0
- package/src/types.d.ts +307 -0
- package/src/visualization-catalog.d.ts +82 -0
- package/src/web-components/index.d.ts +12 -0
- package/styles.css +2 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var e = /* @__PURE__ */ function(e) {
|
|
2
|
+
return e.Equals = "equals", e.InList = "inList", e.NotInList = "notInList", e.Greater = "greater", e.Less = "less", e.GreaterEquals = "greater-equals", e.LessEquals = "less-equals", e.Between = "between", e.NotEquals = "not-equals", e;
|
|
3
|
+
}({}), t = /* @__PURE__ */ function(e) {
|
|
4
|
+
return e.Custom = "custom", e.Gradient = "gradient", e;
|
|
5
|
+
}({}), n = /* @__PURE__ */ function(e) {
|
|
6
|
+
return e.ASC = "alpha-asc", e.DATA = "data", e;
|
|
7
|
+
}({}), r = /* @__PURE__ */ function(e) {
|
|
8
|
+
return e.SUPPORTING_MEASURE = "supporting-measure", e;
|
|
9
|
+
}({}), i = (e) => !!e && typeof e == "object" && "type" in e && e.type === "supporting-measure";
|
|
10
|
+
export { t as a, e as i, n, i as r, r as t };
|
|
@@ -0,0 +1,664 @@
|
|
|
1
|
+
import { n as e, o as t, t as n } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
+
import { Ta as r, Ys as i, cs as a, mn as o, oi as s, sc as c } from "./isEqual-BDxAhUo8.js";
|
|
3
|
+
import { Jn as ee } from "./utils-Bg7K-t6K.js";
|
|
4
|
+
import { i as l, r as u } from "./color-settings-ZIvgNTq1.js";
|
|
5
|
+
var te = (e, t, n) => e?.type === i.Single ? d(t, e.color ?? void 0) : e?.type === i.Categorical ? {
|
|
6
|
+
ref: n || void 0,
|
|
7
|
+
scale: i.Categorical
|
|
8
|
+
} : e?.type === i.Gradient ? {
|
|
9
|
+
ref: n || void 0,
|
|
10
|
+
scale: i.Gradient
|
|
11
|
+
} : d(t), d = (e, t) => t ?? e.colors.brandColors[0], ne = (e, t, n, r, a, o = !1) => {
|
|
12
|
+
let s = e?.coloring?.type;
|
|
13
|
+
if ((s === i.Single || s === i.PerEachMeasure) && t.scales[s]?.range) {
|
|
14
|
+
if (o) return {
|
|
15
|
+
scale: s,
|
|
16
|
+
ref: a || "color"
|
|
17
|
+
};
|
|
18
|
+
let n = e.measures.findIndex((e) => r?.dataItem === e.dataItem), i = t.scales[s].range?.[n];
|
|
19
|
+
if (typeof i == "string") return i;
|
|
20
|
+
}
|
|
21
|
+
return e?.coloring?.type === i.Single ? r?.graphColor ?? e?.coloring?.color ?? n.colors.brandColors[0] : te(e.coloring, n, a);
|
|
22
|
+
}, re = (e, t) => {
|
|
23
|
+
let n = null;
|
|
24
|
+
if (t?.pattern) {
|
|
25
|
+
let i = e.datum, a = Object.keys(i).reduce((e, t) => {
|
|
26
|
+
let n = i[t];
|
|
27
|
+
return n?.source?.field && n.source.key !== void 0 && (e[n.source.field] = n), e;
|
|
28
|
+
}, {}), o = t.pattern.reduce((e, t) => a[t] ? `${e}-${a[t].value}` : `${e}-${i.value}`, `${i.source?.key ?? ""}`);
|
|
29
|
+
t.itemsMap?.[o] || (n = r.grey3);
|
|
30
|
+
}
|
|
31
|
+
return n;
|
|
32
|
+
}, ie = /* @__PURE__ */ n(((e, t) => {
|
|
33
|
+
var n = Math.max, r = Math.min;
|
|
34
|
+
function i(e, t, i) {
|
|
35
|
+
return e >= r(t, i) && e < n(t, i);
|
|
36
|
+
}
|
|
37
|
+
t.exports = i;
|
|
38
|
+
})), ae = /* @__PURE__ */ n(((e, t) => {
|
|
39
|
+
var n = ee(), r = Infinity, i = 17976931348623157e292;
|
|
40
|
+
function a(e) {
|
|
41
|
+
return e ? (e = n(e), e === r || e === -r ? (e < 0 ? -1 : 1) * i : e === e ? e : 0) : e === 0 ? e : 0;
|
|
42
|
+
}
|
|
43
|
+
t.exports = a;
|
|
44
|
+
})), oe = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t) => {
|
|
45
|
+
var n = ie(), r = ae(), i = ee();
|
|
46
|
+
function a(e, t, a) {
|
|
47
|
+
return t = r(t), a === void 0 ? (a = t, t = 0) : a = r(a), e = i(e), n(e, t, a);
|
|
48
|
+
}
|
|
49
|
+
t.exports = a;
|
|
50
|
+
})))()), f = /* @__PURE__ */ t(o()), p = (e) => typeof e == "string" ? e : `${e}`, se = [
|
|
51
|
+
"equals",
|
|
52
|
+
"contains",
|
|
53
|
+
"startsWith",
|
|
54
|
+
"endsWith"
|
|
55
|
+
], ce = [
|
|
56
|
+
"greater",
|
|
57
|
+
"less",
|
|
58
|
+
"greater-equals",
|
|
59
|
+
"less-equals",
|
|
60
|
+
"between",
|
|
61
|
+
"not-equals"
|
|
62
|
+
], le = ["inList", "notInList"], ue = (e) => a(e) || typeof e != "string" || e.length === 0 ? "," : e, m = (e, t) => {
|
|
63
|
+
if (a(e.value)) return !1;
|
|
64
|
+
let n = e.operator || "equals";
|
|
65
|
+
return se.includes(n) ? fe(e, t) : ce.includes(n) ? pe(e, t) : le.includes(n) ? de(e, t) : !1;
|
|
66
|
+
};
|
|
67
|
+
function de(e, t) {
|
|
68
|
+
let n = e.operator;
|
|
69
|
+
if (t == null || e?.value === null || e?.value === void 0) return !1;
|
|
70
|
+
let r = p(t), i = p(e.value), a = ue(e.delimiter), o = new Set(i.split(a).map((e) => e.trim()).filter((e) => e.length > 0));
|
|
71
|
+
if (o.size === 0) return !1;
|
|
72
|
+
let s = o.has(r);
|
|
73
|
+
return n === "notInList" ? !s : s;
|
|
74
|
+
}
|
|
75
|
+
function fe(e, t) {
|
|
76
|
+
let n = p(t), r = e?.value, i = e.operator || "equals";
|
|
77
|
+
if (i === "equals") return r === n;
|
|
78
|
+
if (t == null || r == null || r === "") return !1;
|
|
79
|
+
let a = p(r);
|
|
80
|
+
switch (i) {
|
|
81
|
+
case "contains": return n.includes(a);
|
|
82
|
+
case "startsWith": return n.startsWith(a);
|
|
83
|
+
case "endsWith": return n.endsWith(a);
|
|
84
|
+
default: return !1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function pe(e, t) {
|
|
88
|
+
let n = Number(t), r = Number(e?.value), i = e.operator || "equals";
|
|
89
|
+
if (i === "equals") return r === n;
|
|
90
|
+
if ((0, f.default)(t) || (0, f.default)(r) || Number.isNaN(n) || Number.isNaN(r)) return !1;
|
|
91
|
+
switch (i) {
|
|
92
|
+
case "greater": return n > r;
|
|
93
|
+
case "less": return n < r;
|
|
94
|
+
case "greater-equals": return n >= r;
|
|
95
|
+
case "less-equals": return n <= r;
|
|
96
|
+
case "between": {
|
|
97
|
+
let t = Number(e.secondValue);
|
|
98
|
+
return (0, f.default)(t) || Number.isNaN(t) ? !1 : (0, oe.default)(n, r, t);
|
|
99
|
+
}
|
|
100
|
+
case "not-equals": return n !== r;
|
|
101
|
+
default: return !1;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function h(e, t, n) {
|
|
105
|
+
e.prototype = t.prototype = n, n.constructor = e;
|
|
106
|
+
}
|
|
107
|
+
function g(e, t) {
|
|
108
|
+
var n = Object.create(e.prototype);
|
|
109
|
+
for (var r in t) n[r] = t[r];
|
|
110
|
+
return n;
|
|
111
|
+
}
|
|
112
|
+
var me = e((() => {}));
|
|
113
|
+
function _() {}
|
|
114
|
+
function he() {
|
|
115
|
+
return this.rgb().formatHex();
|
|
116
|
+
}
|
|
117
|
+
function ge() {
|
|
118
|
+
return this.rgb().formatHex8();
|
|
119
|
+
}
|
|
120
|
+
function _e() {
|
|
121
|
+
return we(this).formatHsl();
|
|
122
|
+
}
|
|
123
|
+
function ve() {
|
|
124
|
+
return this.rgb().formatRgb();
|
|
125
|
+
}
|
|
126
|
+
function v(e) {
|
|
127
|
+
var t, n;
|
|
128
|
+
return e = (e + "").trim().toLowerCase(), (t = Oe.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? ye(t) : n === 3 ? new S(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? y(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? y(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = ke.exec(e)) ? new S(t[1], t[2], t[3], 1) : (t = Ae.exec(e)) ? new S(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = je.exec(e)) ? y(t[1], t[2], t[3], t[4]) : (t = Me.exec(e)) ? y(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = Ne.exec(e)) ? Ce(t[1], t[2] / 100, t[3] / 100, 1) : (t = Pe.exec(e)) ? Ce(t[1], t[2] / 100, t[3] / 100, t[4]) : Fe.hasOwnProperty(e) ? ye(Fe[e]) : e === "transparent" ? new S(NaN, NaN, NaN, 0) : null;
|
|
129
|
+
}
|
|
130
|
+
function ye(e) {
|
|
131
|
+
return new S(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
|
|
132
|
+
}
|
|
133
|
+
function y(e, t, n, r) {
|
|
134
|
+
return r <= 0 && (e = t = n = NaN), new S(e, t, n, r);
|
|
135
|
+
}
|
|
136
|
+
function b(e) {
|
|
137
|
+
return e instanceof _ || (e = v(e)), e ? (e = e.rgb(), new S(e.r, e.g, e.b, e.opacity)) : new S();
|
|
138
|
+
}
|
|
139
|
+
function x(e, t, n, r) {
|
|
140
|
+
return arguments.length === 1 ? b(e) : new S(e, t, n, r ?? 1);
|
|
141
|
+
}
|
|
142
|
+
function S(e, t, n, r) {
|
|
143
|
+
this.r = +e, this.g = +t, this.b = +n, this.opacity = +r;
|
|
144
|
+
}
|
|
145
|
+
function be() {
|
|
146
|
+
return `#${T(this.r)}${T(this.g)}${T(this.b)}`;
|
|
147
|
+
}
|
|
148
|
+
function xe() {
|
|
149
|
+
return `#${T(this.r)}${T(this.g)}${T(this.b)}${T((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
150
|
+
}
|
|
151
|
+
function Se() {
|
|
152
|
+
let e = C(this.opacity);
|
|
153
|
+
return `${e === 1 ? "rgb(" : "rgba("}${w(this.r)}, ${w(this.g)}, ${w(this.b)}${e === 1 ? ")" : `, ${e})`}`;
|
|
154
|
+
}
|
|
155
|
+
function C(e) {
|
|
156
|
+
return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
|
|
157
|
+
}
|
|
158
|
+
function w(e) {
|
|
159
|
+
return Math.max(0, Math.min(255, Math.round(e) || 0));
|
|
160
|
+
}
|
|
161
|
+
function T(e) {
|
|
162
|
+
return e = w(e), (e < 16 ? "0" : "") + e.toString(16);
|
|
163
|
+
}
|
|
164
|
+
function Ce(e, t, n, r) {
|
|
165
|
+
return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new E(e, t, n, r);
|
|
166
|
+
}
|
|
167
|
+
function we(e) {
|
|
168
|
+
if (e instanceof E) return new E(e.h, e.s, e.l, e.opacity);
|
|
169
|
+
if (e instanceof _ || (e = v(e)), !e) return new E();
|
|
170
|
+
if (e instanceof E) return e;
|
|
171
|
+
e = e.rgb();
|
|
172
|
+
var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.min(t, n, r), a = Math.max(t, n, r), o = NaN, s = a - i, c = (a + i) / 2;
|
|
173
|
+
return s ? (o = t === a ? (n - r) / s + (n < r) * 6 : n === a ? (r - t) / s + 2 : (t - n) / s + 4, s /= c < .5 ? a + i : 2 - a - i, o *= 60) : s = c > 0 && c < 1 ? 0 : o, new E(o, s, c, e.opacity);
|
|
174
|
+
}
|
|
175
|
+
function Te(e, t, n, r) {
|
|
176
|
+
return arguments.length === 1 ? we(e) : new E(e, t, n, r ?? 1);
|
|
177
|
+
}
|
|
178
|
+
function E(e, t, n, r) {
|
|
179
|
+
this.h = +e, this.s = +t, this.l = +n, this.opacity = +r;
|
|
180
|
+
}
|
|
181
|
+
function Ee(e) {
|
|
182
|
+
return e = (e || 0) % 360, e < 0 ? e + 360 : e;
|
|
183
|
+
}
|
|
184
|
+
function D(e) {
|
|
185
|
+
return Math.max(0, Math.min(1, e || 0));
|
|
186
|
+
}
|
|
187
|
+
function De(e, t, n) {
|
|
188
|
+
return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255;
|
|
189
|
+
}
|
|
190
|
+
var O, k, A, j, M, Oe, ke, Ae, je, Me, Ne, Pe, Fe, N = e((() => {
|
|
191
|
+
me(), O = .7, k = 1 / O, A = "\\s*([+-]?\\d+)\\s*", j = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", M = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Oe = /^#([0-9a-f]{3,8})$/, ke = RegExp(`^rgb\\(${A},${A},${A}\\)$`), Ae = RegExp(`^rgb\\(${M},${M},${M}\\)$`), je = RegExp(`^rgba\\(${A},${A},${A},${j}\\)$`), Me = RegExp(`^rgba\\(${M},${M},${M},${j}\\)$`), Ne = RegExp(`^hsl\\(${j},${M},${M}\\)$`), Pe = RegExp(`^hsla\\(${j},${M},${M},${j}\\)$`), Fe = {
|
|
192
|
+
aliceblue: 15792383,
|
|
193
|
+
antiquewhite: 16444375,
|
|
194
|
+
aqua: 65535,
|
|
195
|
+
aquamarine: 8388564,
|
|
196
|
+
azure: 15794175,
|
|
197
|
+
beige: 16119260,
|
|
198
|
+
bisque: 16770244,
|
|
199
|
+
black: 0,
|
|
200
|
+
blanchedalmond: 16772045,
|
|
201
|
+
blue: 255,
|
|
202
|
+
blueviolet: 9055202,
|
|
203
|
+
brown: 10824234,
|
|
204
|
+
burlywood: 14596231,
|
|
205
|
+
cadetblue: 6266528,
|
|
206
|
+
chartreuse: 8388352,
|
|
207
|
+
chocolate: 13789470,
|
|
208
|
+
coral: 16744272,
|
|
209
|
+
cornflowerblue: 6591981,
|
|
210
|
+
cornsilk: 16775388,
|
|
211
|
+
crimson: 14423100,
|
|
212
|
+
cyan: 65535,
|
|
213
|
+
darkblue: 139,
|
|
214
|
+
darkcyan: 35723,
|
|
215
|
+
darkgoldenrod: 12092939,
|
|
216
|
+
darkgray: 11119017,
|
|
217
|
+
darkgreen: 25600,
|
|
218
|
+
darkgrey: 11119017,
|
|
219
|
+
darkkhaki: 12433259,
|
|
220
|
+
darkmagenta: 9109643,
|
|
221
|
+
darkolivegreen: 5597999,
|
|
222
|
+
darkorange: 16747520,
|
|
223
|
+
darkorchid: 10040012,
|
|
224
|
+
darkred: 9109504,
|
|
225
|
+
darksalmon: 15308410,
|
|
226
|
+
darkseagreen: 9419919,
|
|
227
|
+
darkslateblue: 4734347,
|
|
228
|
+
darkslategray: 3100495,
|
|
229
|
+
darkslategrey: 3100495,
|
|
230
|
+
darkturquoise: 52945,
|
|
231
|
+
darkviolet: 9699539,
|
|
232
|
+
deeppink: 16716947,
|
|
233
|
+
deepskyblue: 49151,
|
|
234
|
+
dimgray: 6908265,
|
|
235
|
+
dimgrey: 6908265,
|
|
236
|
+
dodgerblue: 2003199,
|
|
237
|
+
firebrick: 11674146,
|
|
238
|
+
floralwhite: 16775920,
|
|
239
|
+
forestgreen: 2263842,
|
|
240
|
+
fuchsia: 16711935,
|
|
241
|
+
gainsboro: 14474460,
|
|
242
|
+
ghostwhite: 16316671,
|
|
243
|
+
gold: 16766720,
|
|
244
|
+
goldenrod: 14329120,
|
|
245
|
+
gray: 8421504,
|
|
246
|
+
green: 32768,
|
|
247
|
+
greenyellow: 11403055,
|
|
248
|
+
grey: 8421504,
|
|
249
|
+
honeydew: 15794160,
|
|
250
|
+
hotpink: 16738740,
|
|
251
|
+
indianred: 13458524,
|
|
252
|
+
indigo: 4915330,
|
|
253
|
+
ivory: 16777200,
|
|
254
|
+
khaki: 15787660,
|
|
255
|
+
lavender: 15132410,
|
|
256
|
+
lavenderblush: 16773365,
|
|
257
|
+
lawngreen: 8190976,
|
|
258
|
+
lemonchiffon: 16775885,
|
|
259
|
+
lightblue: 11393254,
|
|
260
|
+
lightcoral: 15761536,
|
|
261
|
+
lightcyan: 14745599,
|
|
262
|
+
lightgoldenrodyellow: 16448210,
|
|
263
|
+
lightgray: 13882323,
|
|
264
|
+
lightgreen: 9498256,
|
|
265
|
+
lightgrey: 13882323,
|
|
266
|
+
lightpink: 16758465,
|
|
267
|
+
lightsalmon: 16752762,
|
|
268
|
+
lightseagreen: 2142890,
|
|
269
|
+
lightskyblue: 8900346,
|
|
270
|
+
lightslategray: 7833753,
|
|
271
|
+
lightslategrey: 7833753,
|
|
272
|
+
lightsteelblue: 11584734,
|
|
273
|
+
lightyellow: 16777184,
|
|
274
|
+
lime: 65280,
|
|
275
|
+
limegreen: 3329330,
|
|
276
|
+
linen: 16445670,
|
|
277
|
+
magenta: 16711935,
|
|
278
|
+
maroon: 8388608,
|
|
279
|
+
mediumaquamarine: 6737322,
|
|
280
|
+
mediumblue: 205,
|
|
281
|
+
mediumorchid: 12211667,
|
|
282
|
+
mediumpurple: 9662683,
|
|
283
|
+
mediumseagreen: 3978097,
|
|
284
|
+
mediumslateblue: 8087790,
|
|
285
|
+
mediumspringgreen: 64154,
|
|
286
|
+
mediumturquoise: 4772300,
|
|
287
|
+
mediumvioletred: 13047173,
|
|
288
|
+
midnightblue: 1644912,
|
|
289
|
+
mintcream: 16121850,
|
|
290
|
+
mistyrose: 16770273,
|
|
291
|
+
moccasin: 16770229,
|
|
292
|
+
navajowhite: 16768685,
|
|
293
|
+
navy: 128,
|
|
294
|
+
oldlace: 16643558,
|
|
295
|
+
olive: 8421376,
|
|
296
|
+
olivedrab: 7048739,
|
|
297
|
+
orange: 16753920,
|
|
298
|
+
orangered: 16729344,
|
|
299
|
+
orchid: 14315734,
|
|
300
|
+
palegoldenrod: 15657130,
|
|
301
|
+
palegreen: 10025880,
|
|
302
|
+
paleturquoise: 11529966,
|
|
303
|
+
palevioletred: 14381203,
|
|
304
|
+
papayawhip: 16773077,
|
|
305
|
+
peachpuff: 16767673,
|
|
306
|
+
peru: 13468991,
|
|
307
|
+
pink: 16761035,
|
|
308
|
+
plum: 14524637,
|
|
309
|
+
powderblue: 11591910,
|
|
310
|
+
purple: 8388736,
|
|
311
|
+
rebeccapurple: 6697881,
|
|
312
|
+
red: 16711680,
|
|
313
|
+
rosybrown: 12357519,
|
|
314
|
+
royalblue: 4286945,
|
|
315
|
+
saddlebrown: 9127187,
|
|
316
|
+
salmon: 16416882,
|
|
317
|
+
sandybrown: 16032864,
|
|
318
|
+
seagreen: 3050327,
|
|
319
|
+
seashell: 16774638,
|
|
320
|
+
sienna: 10506797,
|
|
321
|
+
silver: 12632256,
|
|
322
|
+
skyblue: 8900331,
|
|
323
|
+
slateblue: 6970061,
|
|
324
|
+
slategray: 7372944,
|
|
325
|
+
slategrey: 7372944,
|
|
326
|
+
snow: 16775930,
|
|
327
|
+
springgreen: 65407,
|
|
328
|
+
steelblue: 4620980,
|
|
329
|
+
tan: 13808780,
|
|
330
|
+
teal: 32896,
|
|
331
|
+
thistle: 14204888,
|
|
332
|
+
tomato: 16737095,
|
|
333
|
+
turquoise: 4251856,
|
|
334
|
+
violet: 15631086,
|
|
335
|
+
wheat: 16113331,
|
|
336
|
+
white: 16777215,
|
|
337
|
+
whitesmoke: 16119285,
|
|
338
|
+
yellow: 16776960,
|
|
339
|
+
yellowgreen: 10145074
|
|
340
|
+
}, h(_, v, {
|
|
341
|
+
copy(e) {
|
|
342
|
+
return Object.assign(new this.constructor(), this, e);
|
|
343
|
+
},
|
|
344
|
+
displayable() {
|
|
345
|
+
return this.rgb().displayable();
|
|
346
|
+
},
|
|
347
|
+
hex: he,
|
|
348
|
+
formatHex: he,
|
|
349
|
+
formatHex8: ge,
|
|
350
|
+
formatHsl: _e,
|
|
351
|
+
formatRgb: ve,
|
|
352
|
+
toString: ve
|
|
353
|
+
}), h(S, x, g(_, {
|
|
354
|
+
brighter(e) {
|
|
355
|
+
return e = e == null ? k : k ** +e, new S(this.r * e, this.g * e, this.b * e, this.opacity);
|
|
356
|
+
},
|
|
357
|
+
darker(e) {
|
|
358
|
+
return e = e == null ? O : O ** +e, new S(this.r * e, this.g * e, this.b * e, this.opacity);
|
|
359
|
+
},
|
|
360
|
+
rgb() {
|
|
361
|
+
return this;
|
|
362
|
+
},
|
|
363
|
+
clamp() {
|
|
364
|
+
return new S(w(this.r), w(this.g), w(this.b), C(this.opacity));
|
|
365
|
+
},
|
|
366
|
+
displayable() {
|
|
367
|
+
return -.5 <= this.r && this.r < 255.5 && -.5 <= this.g && this.g < 255.5 && -.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
|
|
368
|
+
},
|
|
369
|
+
hex: be,
|
|
370
|
+
formatHex: be,
|
|
371
|
+
formatHex8: xe,
|
|
372
|
+
formatRgb: Se,
|
|
373
|
+
toString: Se
|
|
374
|
+
})), h(E, Te, g(_, {
|
|
375
|
+
brighter(e) {
|
|
376
|
+
return e = e == null ? k : k ** +e, new E(this.h, this.s, this.l * e, this.opacity);
|
|
377
|
+
},
|
|
378
|
+
darker(e) {
|
|
379
|
+
return e = e == null ? O : O ** +e, new E(this.h, this.s, this.l * e, this.opacity);
|
|
380
|
+
},
|
|
381
|
+
rgb() {
|
|
382
|
+
var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < .5 ? n : 1 - n) * t, i = 2 * n - r;
|
|
383
|
+
return new S(De(e >= 240 ? e - 240 : e + 120, i, r), De(e, i, r), De(e < 120 ? e + 240 : e - 120, i, r), this.opacity);
|
|
384
|
+
},
|
|
385
|
+
clamp() {
|
|
386
|
+
return new E(Ee(this.h), D(this.s), D(this.l), C(this.opacity));
|
|
387
|
+
},
|
|
388
|
+
displayable() {
|
|
389
|
+
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
|
|
390
|
+
},
|
|
391
|
+
formatHsl() {
|
|
392
|
+
let e = C(this.opacity);
|
|
393
|
+
return `${e === 1 ? "hsl(" : "hsla("}${Ee(this.h)}, ${D(this.s) * 100}%, ${D(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
|
|
394
|
+
}
|
|
395
|
+
}));
|
|
396
|
+
})), Ie, P, Le = e((() => {
|
|
397
|
+
Ie = Math.PI / 180, P = 180 / Math.PI;
|
|
398
|
+
}));
|
|
399
|
+
function Re(e) {
|
|
400
|
+
if (e instanceof F) return new F(e.l, e.a, e.b, e.opacity);
|
|
401
|
+
if (e instanceof B) return He(e);
|
|
402
|
+
e instanceof S || (e = b(e));
|
|
403
|
+
var t = z(e.r), n = z(e.g), r = z(e.b), i = I((.2225045 * t + .7168786 * n + .0606169 * r) / U), a, o;
|
|
404
|
+
return t === n && n === r ? a = o = i : (a = I((.4360747 * t + .3850649 * n + .1430804 * r) / H), o = I((.0139322 * t + .0971045 * n + .7141733 * r) / W)), new F(116 * i - 16, 500 * (a - i), 200 * (i - o), e.opacity);
|
|
405
|
+
}
|
|
406
|
+
function ze(e, t, n, r) {
|
|
407
|
+
return arguments.length === 1 ? Re(e) : new F(e, t, n, r ?? 1);
|
|
408
|
+
}
|
|
409
|
+
function F(e, t, n, r) {
|
|
410
|
+
this.l = +e, this.a = +t, this.b = +n, this.opacity = +r;
|
|
411
|
+
}
|
|
412
|
+
function I(e) {
|
|
413
|
+
return e > Ue ? e ** (1 / 3) : e / q + G;
|
|
414
|
+
}
|
|
415
|
+
function L(e) {
|
|
416
|
+
return e > K ? e * e * e : q * (e - G);
|
|
417
|
+
}
|
|
418
|
+
function R(e) {
|
|
419
|
+
return 255 * (e <= .0031308 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - .055);
|
|
420
|
+
}
|
|
421
|
+
function z(e) {
|
|
422
|
+
return (e /= 255) <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
423
|
+
}
|
|
424
|
+
function Be(e) {
|
|
425
|
+
if (e instanceof B) return new B(e.h, e.c, e.l, e.opacity);
|
|
426
|
+
if (e instanceof F || (e = Re(e)), e.a === 0 && e.b === 0) return new B(NaN, 0 < e.l && e.l < 100 ? 0 : NaN, e.l, e.opacity);
|
|
427
|
+
var t = Math.atan2(e.b, e.a) * P;
|
|
428
|
+
return new B(t < 0 ? t + 360 : t, Math.sqrt(e.a * e.a + e.b * e.b), e.l, e.opacity);
|
|
429
|
+
}
|
|
430
|
+
function Ve(e, t, n, r) {
|
|
431
|
+
return arguments.length === 1 ? Be(e) : new B(e, t, n, r ?? 1);
|
|
432
|
+
}
|
|
433
|
+
function B(e, t, n, r) {
|
|
434
|
+
this.h = +e, this.c = +t, this.l = +n, this.opacity = +r;
|
|
435
|
+
}
|
|
436
|
+
function He(e) {
|
|
437
|
+
if (isNaN(e.h)) return new F(e.l, 0, 0, e.opacity);
|
|
438
|
+
var t = e.h * Ie;
|
|
439
|
+
return new F(e.l, Math.cos(t) * e.c, Math.sin(t) * e.c, e.opacity);
|
|
440
|
+
}
|
|
441
|
+
var V, H, U, W, G, K, q, Ue, We = e((() => {
|
|
442
|
+
me(), N(), Le(), V = 18, H = .96422, U = 1, W = .82521, G = 4 / 29, K = 6 / 29, q = 3 * K * K, Ue = K * K * K, h(F, ze, g(_, {
|
|
443
|
+
brighter(e) {
|
|
444
|
+
return new F(this.l + V * (e ?? 1), this.a, this.b, this.opacity);
|
|
445
|
+
},
|
|
446
|
+
darker(e) {
|
|
447
|
+
return new F(this.l - V * (e ?? 1), this.a, this.b, this.opacity);
|
|
448
|
+
},
|
|
449
|
+
rgb() {
|
|
450
|
+
var e = (this.l + 16) / 116, t = isNaN(this.a) ? e : e + this.a / 500, n = isNaN(this.b) ? e : e - this.b / 200;
|
|
451
|
+
return t = H * L(t), e = U * L(e), n = W * L(n), new S(R(3.1338561 * t - 1.6168667 * e - .4906146 * n), R(-.9787684 * t + 1.9161415 * e + .033454 * n), R(.0719453 * t - .2289914 * e + 1.4052427 * n), this.opacity);
|
|
452
|
+
}
|
|
453
|
+
})), h(B, Ve, g(_, {
|
|
454
|
+
brighter(e) {
|
|
455
|
+
return new B(this.h, this.c, this.l + V * (e ?? 1), this.opacity);
|
|
456
|
+
},
|
|
457
|
+
darker(e) {
|
|
458
|
+
return new B(this.h, this.c, this.l - V * (e ?? 1), this.opacity);
|
|
459
|
+
},
|
|
460
|
+
rgb() {
|
|
461
|
+
return He(this).rgb();
|
|
462
|
+
}
|
|
463
|
+
}));
|
|
464
|
+
}));
|
|
465
|
+
function Ge(e) {
|
|
466
|
+
if (e instanceof J) return new J(e.h, e.s, e.l, e.opacity);
|
|
467
|
+
e instanceof S || (e = b(e));
|
|
468
|
+
var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = (Xe * r + Je * t - Ye * n) / (Xe + Je - Ye), a = r - i, o = (Q * (n - i) - X * a) / Z, s = Math.sqrt(o * o + a * a) / (Q * i * (1 - i)), c = s ? Math.atan2(o, a) * P - 120 : NaN;
|
|
469
|
+
return new J(c < 0 ? c + 360 : c, s, i, e.opacity);
|
|
470
|
+
}
|
|
471
|
+
function Ke(e, t, n, r) {
|
|
472
|
+
return arguments.length === 1 ? Ge(e) : new J(e, t, n, r ?? 1);
|
|
473
|
+
}
|
|
474
|
+
function J(e, t, n, r) {
|
|
475
|
+
this.h = +e, this.s = +t, this.l = +n, this.opacity = +r;
|
|
476
|
+
}
|
|
477
|
+
var qe, Y, X, Z, Q, Je, Ye, Xe, Ze = e((() => {
|
|
478
|
+
me(), N(), Le(), qe = -.14861, Y = 1.78277, X = -.29227, Z = -.90649, Q = 1.97294, Je = Q * Z, Ye = Q * Y, Xe = Y * X - Z * qe, h(J, Ke, g(_, {
|
|
479
|
+
brighter(e) {
|
|
480
|
+
return e = e == null ? k : k ** +e, new J(this.h, this.s, this.l * e, this.opacity);
|
|
481
|
+
},
|
|
482
|
+
darker(e) {
|
|
483
|
+
return e = e == null ? O : O ** +e, new J(this.h, this.s, this.l * e, this.opacity);
|
|
484
|
+
},
|
|
485
|
+
rgb() {
|
|
486
|
+
var e = isNaN(this.h) ? 0 : (this.h + 120) * Ie, t = +this.l, n = isNaN(this.s) ? 0 : this.s * t * (1 - t), r = Math.cos(e), i = Math.sin(e);
|
|
487
|
+
return new S(255 * (t + n * (qe * r + Y * i)), 255 * (t + n * (X * r + Z * i)), 255 * (t + Q * r * n), this.opacity);
|
|
488
|
+
}
|
|
489
|
+
}));
|
|
490
|
+
})), Qe = e((() => {
|
|
491
|
+
N(), We(), Ze();
|
|
492
|
+
}));
|
|
493
|
+
Qe();
|
|
494
|
+
var $e = s("color-manager", "#3f6212"), $ = (e, t) => {
|
|
495
|
+
if (t === "null") return null;
|
|
496
|
+
switch (typeof e) {
|
|
497
|
+
case "boolean": return typeof t == "boolean" ? t : String(t).toLowerCase() === "true";
|
|
498
|
+
case "string": return String(t);
|
|
499
|
+
case "number": return typeof t == "string" ? parseFloat(t) : Number(t);
|
|
500
|
+
default: return t;
|
|
501
|
+
}
|
|
502
|
+
}, et = (e) => a(e) || typeof e != "string" || e.length === 0 ? "," : e, tt = (e) => {
|
|
503
|
+
if (typeof e.value != "string" && typeof e.value != "number") return [];
|
|
504
|
+
let t = et(typeof e.delimiter == "string" ? e.delimiter : void 0);
|
|
505
|
+
return String(e.value).split(t).map((e) => e.trim()).filter((e) => e.length > 0);
|
|
506
|
+
}, nt = (e, t) => {
|
|
507
|
+
let n = String(e);
|
|
508
|
+
if (t[n]) return t[n];
|
|
509
|
+
let r = n.split("").reverse().reduce((e, t, n) => e + t.charCodeAt(0) * (1 + n), 0);
|
|
510
|
+
return t[n] = r, r;
|
|
511
|
+
}, rt = (e, t) => {
|
|
512
|
+
if ((0, f.default)(e.value)) return !1;
|
|
513
|
+
if (a(e.value) || u(e.value)) return $e.warn("Color rule not preprocessed correctly - ignoring", e), !1;
|
|
514
|
+
let n = $(t, e.value);
|
|
515
|
+
if ([l.InList, l.NotInList].includes(e.operator)) {
|
|
516
|
+
let n = tt(e);
|
|
517
|
+
if (n.length === 0) return !1;
|
|
518
|
+
let r = new Set(n.map((e) => $(t, e))).has(t);
|
|
519
|
+
return e.operator === l.NotInList ? !r : r;
|
|
520
|
+
}
|
|
521
|
+
if (typeof t != "number") switch (e.operator) {
|
|
522
|
+
case l.Equals: return t === n;
|
|
523
|
+
case l.NotEquals: return t !== n;
|
|
524
|
+
default: return !1;
|
|
525
|
+
}
|
|
526
|
+
switch (e.operator) {
|
|
527
|
+
case l.Equals: return t === n;
|
|
528
|
+
case l.Greater: return t > n;
|
|
529
|
+
case l.Less: return t < n;
|
|
530
|
+
case l.GreaterEquals: return t >= n;
|
|
531
|
+
case l.LessEquals: return t <= n;
|
|
532
|
+
case l.Between: {
|
|
533
|
+
if ((0, f.default)(e.secondValue)) return !1;
|
|
534
|
+
if (a(e.secondValue) || u(e.secondValue)) return $e.warn("Color rule not preprocessed correctly - ignoring", e), !1;
|
|
535
|
+
let r = $(t, e.secondValue);
|
|
536
|
+
return n <= t && t <= r;
|
|
537
|
+
}
|
|
538
|
+
case l.NotEquals: return t !== n;
|
|
539
|
+
default: return !1;
|
|
540
|
+
}
|
|
541
|
+
}, it = (e) => typeof e == "string" ? parseFloat(e) : e, at = {}, ot = class {
|
|
542
|
+
vSpec;
|
|
543
|
+
vTheme;
|
|
544
|
+
notAffectedItems;
|
|
545
|
+
MAIN_FIELD = "__main_field__";
|
|
546
|
+
constructor(e, t, n) {
|
|
547
|
+
this.vSpec = e, this.vTheme = t, this.notAffectedItems = n;
|
|
548
|
+
}
|
|
549
|
+
isColorOverwriteActive() {
|
|
550
|
+
return !!this.vSpec.coloring?.overwrites?.length;
|
|
551
|
+
}
|
|
552
|
+
isColorRulesActive() {
|
|
553
|
+
return !!this.vSpec.coloring?.rules?.length;
|
|
554
|
+
}
|
|
555
|
+
getSimpleColor() {
|
|
556
|
+
return this.vSpec.coloring?.color || this.vTheme.colors.brandColors[0];
|
|
557
|
+
}
|
|
558
|
+
getColorFromOverwriteSources(e, t, n) {
|
|
559
|
+
for (let r = 0; r < e.length; r++) {
|
|
560
|
+
let i = e[r], a = this.resolveColorOverwriteValues(i, n);
|
|
561
|
+
if (!this.hasUnresolvedSupportingMeasureValue(i, n)) for (let e = 0; e < t.length; e++) {
|
|
562
|
+
let r = t[e];
|
|
563
|
+
if (m(a, this.getValueFromProp(n, r))) return a?.color;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
return null;
|
|
567
|
+
}
|
|
568
|
+
getColorByOverwrite(e, t = {}) {
|
|
569
|
+
let { ref: n, overwriteSources: r } = t, i = this.vSpec.coloring?.overwrites ?? [], a = r ?? [];
|
|
570
|
+
if (a.length > 0) {
|
|
571
|
+
let t = this.getColorFromOverwriteSources(i, a, e);
|
|
572
|
+
if (t) return t;
|
|
573
|
+
}
|
|
574
|
+
for (let t = 0; t < i.length; t++) {
|
|
575
|
+
let r = i[t], a = this.resolveColorOverwriteValues(r, e);
|
|
576
|
+
if (this.hasUnresolvedSupportingMeasureValue(r, e)) continue;
|
|
577
|
+
let o = this.getValueFromProp(e, n || this.MAIN_FIELD);
|
|
578
|
+
if ((a.operator || "equals") === "equals" && (a?.value === o || a?.value === p(o)) || m(a, o)) return a?.color;
|
|
579
|
+
}
|
|
580
|
+
return null;
|
|
581
|
+
}
|
|
582
|
+
getColorByColorRules(e) {
|
|
583
|
+
return this.vSpec.coloring?.rules?.find((t) => {
|
|
584
|
+
if (e.datum.series && !e.datum.series.source && e.datum.series.value !== t.dataItemId) return !1;
|
|
585
|
+
let n = e.datum[t.dataItemId]?.value;
|
|
586
|
+
return n !== void 0 && rt(this.resolveColorRuleValues(t, e), it(n));
|
|
587
|
+
})?.color || null;
|
|
588
|
+
}
|
|
589
|
+
getHash(e) {
|
|
590
|
+
return nt(e, at);
|
|
591
|
+
}
|
|
592
|
+
getValueFromProp(e, t, n) {
|
|
593
|
+
return t === this.MAIN_FIELD ? e.datum?.value : e.datum[t || n || ""]?.value;
|
|
594
|
+
}
|
|
595
|
+
resolveColoringConditionValue(e, t) {
|
|
596
|
+
return u(e) ? t.datum[e.dataItemId]?.value : e;
|
|
597
|
+
}
|
|
598
|
+
resolveColorRuleValues(e, t) {
|
|
599
|
+
return {
|
|
600
|
+
...e,
|
|
601
|
+
value: this.resolveColoringConditionValue(e.value, t),
|
|
602
|
+
secondValue: this.resolveColoringConditionValue(e.secondValue, t)
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
resolveColorOverwriteValues(e, t) {
|
|
606
|
+
return {
|
|
607
|
+
...e,
|
|
608
|
+
value: this.resolveColoringConditionValue(e.value, t),
|
|
609
|
+
secondValue: this.resolveColoringConditionValue(e.secondValue, t)
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
hasUnresolvedSupportingMeasureValue(e, t) {
|
|
613
|
+
return [e.value, e.secondValue].some((e) => u(e) && this.resolveColoringConditionValue(e, t) === void 0);
|
|
614
|
+
}
|
|
615
|
+
getColorByScale(e, t = {}) {
|
|
616
|
+
let { ref: n, dataItemId: r } = t;
|
|
617
|
+
switch (this.vSpec.coloring?.type) {
|
|
618
|
+
case i.Categorical: {
|
|
619
|
+
let t = e.resources.scale(i.Categorical), a = r || this.getValueFromProp(e, n, "color");
|
|
620
|
+
if (this.vSpec.coloring.persistentColors === !1) return t(a);
|
|
621
|
+
let o = t.range();
|
|
622
|
+
return o[this.getHash(a) % o.length];
|
|
623
|
+
}
|
|
624
|
+
case i.Gradient: {
|
|
625
|
+
let t = e.resources.scale(i.Gradient)(r || this.getValueFromProp(e, n, "end"));
|
|
626
|
+
return Number.isNaN(t) ? "#000000" : t;
|
|
627
|
+
}
|
|
628
|
+
case i.PerEachMeasure: return e.resources.scale(i.PerEachMeasure)(r || this.getValueFromProp(e, n, "color"));
|
|
629
|
+
case i.Single: return e.resources.scale(i.Single)(r || this.getValueFromProp(e, n, "color"));
|
|
630
|
+
default: return this.getSimpleColor();
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
overrideColorOpacity(e, t) {
|
|
634
|
+
return !e || !t ? e : x(e).copy({ opacity: t }).toString();
|
|
635
|
+
}
|
|
636
|
+
getFilteredColor(e, t) {
|
|
637
|
+
return re(e, t);
|
|
638
|
+
}
|
|
639
|
+
getColorDefinition(e, t) {
|
|
640
|
+
return (n) => {
|
|
641
|
+
if (this.notAffectedItems?.pattern?.length && this.vSpec.staticFilters.ignoreGlobalFilters && this.vSpec.staticFilters.showGlobalFiltersEffect) {
|
|
642
|
+
let e = this.getFilteredColor(n, this.notAffectedItems);
|
|
643
|
+
if (e) return e;
|
|
644
|
+
}
|
|
645
|
+
if (this.isColorOverwriteActive()) {
|
|
646
|
+
let r = this.getColorByOverwrite(n, e);
|
|
647
|
+
if (r) return this.overrideColorOpacity(r, t);
|
|
648
|
+
}
|
|
649
|
+
if (this.isColorRulesActive()) {
|
|
650
|
+
let e = this.getColorByColorRules(n);
|
|
651
|
+
if (e) return this.overrideColorOpacity(e, t);
|
|
652
|
+
}
|
|
653
|
+
return this.overrideColorOpacity(this.getColorByScale(n, e), t);
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
getMeasureColor(e, t) {
|
|
657
|
+
let n = this.vSpec?.coloring?.type, r = this.vSpec.measures.findIndex((e) => c(t?.dataItem, e.dataItem)), i = n ? e.scales[n]?.range?.[r] : void 0;
|
|
658
|
+
return typeof i == "string" ? i : t?.graphColor ?? this.vSpec?.coloring?.color ?? this.vTheme.colors.brandColors[0];
|
|
659
|
+
}
|
|
660
|
+
static getColorWithCallback(e, t) {
|
|
661
|
+
return (n) => t(typeof e == "function" ? e(n) : e, n);
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
export { d as _, Ze as a, ze as c, N as d, x as f, ne as g, re as h, Ke as i, v as l, ae as m, rt as n, Ve as o, m as p, Qe as r, We as s, ot as t, Te as u };
|