@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,422 +0,0 @@
|
|
|
1
|
-
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import { Ao as t, Et as n, Fc as r, Io as i, Qa as a, Qr as o, Xs as s, Za as c, gc as l, ko as u, rr as d, sa as f, yc as p, za as m } from "./visualization-filters-D7i6oh1Z.js";
|
|
3
|
-
import { F as h, Ht as g, L as _, N as v, U as y, Zt as b, ci as x, jt as S, zr as C } from "./utils-DganVptf.js";
|
|
4
|
-
import { __ as w, g_ as T } from "./handlers-C6CZ0XJA.js";
|
|
5
|
-
import "./logger-DdZpR7xZ.js";
|
|
6
|
-
import { Bt as E, Ct as D, Ft as O, Jt as k, L as A, Lt as ee, Qt as te, St as ne, Wt as re, _ as j, an as M, bn as N, fn as P, i as ie, kt as ae, mn as F, on as oe, qt as I, sn as se, t as ce, un as L, v as le, yn as R, zt as z } from "./escobar-CvEV2ES1.js";
|
|
7
|
-
import { t as B } from "./coloring-BtnPiQ_o.js";
|
|
8
|
-
import { t as V } from "./debounce-fn-CUixuz45.js";
|
|
9
|
-
import { t as H } from "./set-coloring-datafield-B3uIS1Pe.js";
|
|
10
|
-
import { t as U } from "./builder-C-TKA-My.js";
|
|
11
|
-
var W = 100, G = (e, t, n) => {
|
|
12
|
-
let r = e.element.getBoundingClientRect(), i = {
|
|
13
|
-
x: t.clientX - r.left,
|
|
14
|
-
y: t.clientY - r.top
|
|
15
|
-
};
|
|
16
|
-
return e.chart?.shapesAt(i, {
|
|
17
|
-
components: [{
|
|
18
|
-
key: n,
|
|
19
|
-
opts: { propagation: "stop" }
|
|
20
|
-
}],
|
|
21
|
-
propagation: "stop"
|
|
22
|
-
})?.[0];
|
|
23
|
-
}, ue = (e, t) => {
|
|
24
|
-
let n = null, r = V((r, i) => {
|
|
25
|
-
let a = G(r, i, e);
|
|
26
|
-
!a && n && (t(e, "mouseleave", n.key, i, n), n = null), a?.data?._ID && n?.data?._ID && a.data._ID !== n.data._ID && (t(e, "mouseleave", n.key, i, n), n = null), a && (t(e, "mousemove", a.key, i, a), n = a);
|
|
27
|
-
}, W), i = V((r) => {
|
|
28
|
-
n &&= (t(e, "mouseleave", n.key, r, n), null);
|
|
29
|
-
}, W);
|
|
30
|
-
return {
|
|
31
|
-
type: "native",
|
|
32
|
-
key: "action-events-interaction",
|
|
33
|
-
events: {
|
|
34
|
-
click(n) {
|
|
35
|
-
let r = G(this, n, e);
|
|
36
|
-
r && t(e, "click", r.key, n, r);
|
|
37
|
-
},
|
|
38
|
-
mousemove(e) {
|
|
39
|
-
r(this, e);
|
|
40
|
-
},
|
|
41
|
-
mouseleave(e) {
|
|
42
|
-
i(e);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}, K = /* @__PURE__ */ e(x()), de = t.Rectangle, q = (e) => ({
|
|
47
|
-
shape: e?.heatMapSettings?.shape ?? de,
|
|
48
|
-
minSize: e?.heatMapSettings?.minSize ?? .1,
|
|
49
|
-
maxSize: e?.heatMapSettings?.maxSize ?? 1
|
|
50
|
-
}), fe = (e, t, n, r, i, a, o, s) => {
|
|
51
|
-
let c = [], { shape: l } = q(e), u = `${N.Point}-${l}`;
|
|
52
|
-
if ((e?.enableEmitEvents ?? !1) && s) {
|
|
53
|
-
let e = ue(u, s);
|
|
54
|
-
c.push(e);
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
...n,
|
|
58
|
-
interactions: n.interactions ? [...n.interactions, ...c] : [...c]
|
|
59
|
-
};
|
|
60
|
-
}, pe = (e, t, n) => {
|
|
61
|
-
let r = e.dimensions.filter(o), i = r.filter((e) => e.role === c.HEAT_MAP_HORIZONTAL), a = r.filter((e) => e.role === c.HEAT_MAP_VERTICAL), s = i[0], l = a[0], [u, d] = E([{
|
|
62
|
-
showAxisTooltip: e?.axes?.dimension?.showAxisTooltip,
|
|
63
|
-
formatter: s?.formatter,
|
|
64
|
-
scale: se(e),
|
|
65
|
-
key: O.Dimension,
|
|
66
|
-
settings: { direction: ee(e) }
|
|
67
|
-
}, {
|
|
68
|
-
showAxisTooltip: e?.axes?.secondaryDimension?.showAxisTooltip,
|
|
69
|
-
formatter: l?.formatter,
|
|
70
|
-
scale: L.YAxisScale,
|
|
71
|
-
key: O.DimensionSec,
|
|
72
|
-
settings: {
|
|
73
|
-
direction: z(e),
|
|
74
|
-
isVerticalDimension: !0
|
|
75
|
-
}
|
|
76
|
-
}]);
|
|
77
|
-
return {
|
|
78
|
-
...n,
|
|
79
|
-
components: [...n.components ?? [], ...u],
|
|
80
|
-
interactions: [...n.interactions ?? [], ...d]
|
|
81
|
-
};
|
|
82
|
-
}, me = (e, t, n, r, a, s, l, u) => {
|
|
83
|
-
let f = [], p = [], h = [];
|
|
84
|
-
if (u) {
|
|
85
|
-
let e = re(N.Text, u);
|
|
86
|
-
h.push(e);
|
|
87
|
-
}
|
|
88
|
-
let g = e.dimensions.filter((e) => e.role === c.HEAT_MAP_HORIZONTAL), _ = g.filter(o), v = e.dimensions.filter((e) => e.role === c.HEAT_MAP_VERTICAL), y = v.filter(o), b = {
|
|
89
|
-
...t.axis.dimension,
|
|
90
|
-
...t.fonts
|
|
91
|
-
}, x = {
|
|
92
|
-
...t.axis.measure,
|
|
93
|
-
...t.fonts
|
|
94
|
-
}, S = _[0], C = y[0], w = e.measures.filter((e) => e.role === m.HEAT_MAP_COLOR), T = w.filter(o), E = {};
|
|
95
|
-
if (S) {
|
|
96
|
-
let t = e.axes?.dimension || E, n = t.secondaryAxis ? i.Top : i.Bottom;
|
|
97
|
-
if (f.push(I(L.XAxisScale, t, b, n, S.formatter, s)), t.showAxisName) {
|
|
98
|
-
let r = d(g, e.enableAlternate, s?.isPrintMode);
|
|
99
|
-
p.push(k(_, r, n, b, t.colors?.title, t.axisTitle ? t.axisTitle : M(S, l), t.titleFontSize));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
if (C) {
|
|
103
|
-
let t = e.axes?.secondaryDimension || E, n = t.secondaryAxis ? i.Right : i.Left;
|
|
104
|
-
if (f.push(I(L.YAxisScale, t, b, n, C.formatter, s)), t.showAxisName) {
|
|
105
|
-
let r = d(v, e.enableAlternate, s?.isPrintMode);
|
|
106
|
-
p.push(k(y, r, n, b, t.colors?.title, t.axisTitle ? t.axisTitle : M(C, l), t.titleFontSize));
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
if (w.length > 1) {
|
|
110
|
-
let t = e.axes?.primaryMeasure || {}, n = d(w, e.enableAlternate, s?.isPrintMode);
|
|
111
|
-
p.push(k(T, n, i.Right, x, t.colors?.title, t.axisTitle, t.titleFontSize));
|
|
112
|
-
}
|
|
113
|
-
return {
|
|
114
|
-
...n,
|
|
115
|
-
components: [
|
|
116
|
-
...n.components,
|
|
117
|
-
...f,
|
|
118
|
-
...p
|
|
119
|
-
],
|
|
120
|
-
interactions: [...n.interactions ?? [], ...h]
|
|
121
|
-
};
|
|
122
|
-
}, he = /* @__PURE__ */ e(n()), ge = (e) => (t, n) => t.value === e ? -1 : +(n.value === e), _e = (e) => (t, n) => t.value === e ? 1 : n.value === e ? -1 : 0, J = (e, t = 0) => (n, r) => {
|
|
123
|
-
let i = e ? n[e] : n, a = e ? r[e] : r;
|
|
124
|
-
return i.value !== a.value && i.value === null ? -t : i.value !== a.value && a.value === null ? t : i.value === a.value ? 0 : i.value < a.value ? -t : t;
|
|
125
|
-
}, ve = (e) => (t, n) => {
|
|
126
|
-
let r = 0;
|
|
127
|
-
for (let i = 0; i < e.length; i++) if (r = e[i](t, n), r !== 0) return r;
|
|
128
|
-
return r;
|
|
129
|
-
}, ye = (e) => {
|
|
130
|
-
let t = e.aggregation?.funcName;
|
|
131
|
-
return t && [
|
|
132
|
-
"SUM",
|
|
133
|
-
"MIN",
|
|
134
|
-
"MAX",
|
|
135
|
-
"AVG"
|
|
136
|
-
].includes(t) ? t.toLowerCase() : t === "COUNT" ? "sum" : "avg";
|
|
137
|
-
}, Y = (e, t, n) => {
|
|
138
|
-
let i = n?.sortingOrder ?? [], a = i.findIndex((t) => r(t.dataItem) === r(e));
|
|
139
|
-
if (a < 0) return;
|
|
140
|
-
let s = i[a], c = o(s), l = (c ? i.slice(0, a) : i).filter((e) => e.fieldType === "measure" && o(e));
|
|
141
|
-
if (s) {
|
|
142
|
-
let e, i = [];
|
|
143
|
-
n?.topN?.enabled && n.topN.showOthers && ((0, he.default)(n.topN.dimensionIdx) || n.topN.dimensionIdx === t) && (e = n.topN.othersPosition === w.First ? ge(n.topN.othersLabel?.stringLabel ?? "Others") : n.topN.othersPosition === w.Last ? _e(n.topN.othersLabel?.stringLabel ?? "Others") : void 0, e && i.push(e));
|
|
144
|
-
let a = {};
|
|
145
|
-
return l.forEach((e, t) => {
|
|
146
|
-
let n = `m${t}`;
|
|
147
|
-
i.push(J(n, e.sortDirection === u.Asc ? 1 : -1)), a[n] = {
|
|
148
|
-
field: r(e.dataItem),
|
|
149
|
-
reduce: ye(e.dataItem)
|
|
150
|
-
};
|
|
151
|
-
}), c && i.push(J("", s.sortDirection === u.Asc ? 1 : -1)), {
|
|
152
|
-
props: a,
|
|
153
|
-
sort: ve(i)
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
}, be = (e, t, n) => {
|
|
157
|
-
let i = e.dimensions.filter(o), a = e.measures.filter(o), s = i.filter((e) => e.role === c.HEAT_MAP_HORIZONTAL), l = i.filter((e) => e.role === c.HEAT_MAP_VERTICAL), u = a.filter((e) => e.role === m.HEAT_MAP_COLOR), d = a.filter((e) => e.role === m.HEAT_MAP_SIZE), f = s[0], h = l[0], g = u[0], _ = d[0], { coloring: v } = e || {}, y = v?.fieldId;
|
|
158
|
-
e.coloring?.type === p.Gradient && (y ||= r(g.dataItem)), y && ne(n, 0, { color: { field: y } });
|
|
159
|
-
let b = ae(H(e, y ?? null), t, {});
|
|
160
|
-
if (f) {
|
|
161
|
-
let t = Y(f.dataItem, 0, e.querySettings);
|
|
162
|
-
b[L.XAxisScale] = {
|
|
163
|
-
data: {
|
|
164
|
-
extract: {
|
|
165
|
-
field: r(f.dataItem),
|
|
166
|
-
trackBy: (e) => e,
|
|
167
|
-
reduce: "first",
|
|
168
|
-
props: t?.props
|
|
169
|
-
},
|
|
170
|
-
sort: t?.sort
|
|
171
|
-
},
|
|
172
|
-
type: F.Band
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
if (h) {
|
|
176
|
-
let t = Y(h.dataItem, 1, e.querySettings);
|
|
177
|
-
b[L.YAxisScale] = {
|
|
178
|
-
data: {
|
|
179
|
-
extract: {
|
|
180
|
-
field: r(h.dataItem),
|
|
181
|
-
trackBy: (e) => e,
|
|
182
|
-
reduce: "first",
|
|
183
|
-
props: t?.props
|
|
184
|
-
},
|
|
185
|
-
sort: t?.sort
|
|
186
|
-
},
|
|
187
|
-
type: F.Band
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
let x = r(g.dataItem);
|
|
191
|
-
if (b[x] = { data: { field: x } }, _) {
|
|
192
|
-
let e = r(_.dataItem);
|
|
193
|
-
b[e] = {
|
|
194
|
-
type: F.Linear,
|
|
195
|
-
data: { extract: { field: e } }
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
return {
|
|
199
|
-
...n,
|
|
200
|
-
scales: b
|
|
201
|
-
};
|
|
202
|
-
}, X = {
|
|
203
|
-
measure: "measure",
|
|
204
|
-
group: "group",
|
|
205
|
-
size: "size"
|
|
206
|
-
}, xe = (e, t, n) => {
|
|
207
|
-
let i = e.dimensions.filter(o), a = e.measures.filter(o), s = le((e.supportingMeasures ?? []).filter(o)), l = i.filter((e) => e.role === c.HEAT_MAP_HORIZONTAL), u = i.filter((e) => e.role === c.HEAT_MAP_VERTICAL), d = a.filter((e) => e.role === m.HEAT_MAP_COLOR), f = a.filter((e) => e.role === m.HEAT_MAP_SIZE);
|
|
208
|
-
if (!i.length) return n;
|
|
209
|
-
let p = l[0], h = u[0], g = d[0], _ = f[0], v = r(g?.dataItem), y = r(_?.dataItem), b = r(p?.dataItem), x = r(h?.dataItem), S = {
|
|
210
|
-
[X.measure]: { field: v },
|
|
211
|
-
[X.group]: { field: x },
|
|
212
|
-
[X.size]: _ ? { field: y } : void 0,
|
|
213
|
-
secondColorOverwrite: { field: x },
|
|
214
|
-
...s
|
|
215
|
-
};
|
|
216
|
-
v && (S[v] = { field: v }), y && (S[y] = { field: y });
|
|
217
|
-
let C = [{
|
|
218
|
-
key: L.Collection,
|
|
219
|
-
data: { extract: [{
|
|
220
|
-
field: b,
|
|
221
|
-
props: S
|
|
222
|
-
}] }
|
|
223
|
-
}];
|
|
224
|
-
return {
|
|
225
|
-
...n,
|
|
226
|
-
collections: C
|
|
227
|
-
};
|
|
228
|
-
}, Se = (e, t, n, i, a, s) => {
|
|
229
|
-
let c = e.measures.filter(o), l = c.filter((e) => e.role === m.HEAT_MAP_COLOR), u = c.filter((e) => e.role === m.HEAT_MAP_SIZE), d = l[0], f = u[0], { shape: h, minSize: g, maxSize: _ } = q(e), v = _;
|
|
230
|
-
f && (v = (e) => e.resources.scale(r(f.dataItem))(e.datum.size.value) * (_ - g) + g);
|
|
231
|
-
let y = new B(e, t, a?.[0]?.itemsNotAffectedByFiltering), b = {
|
|
232
|
-
type: N.Point,
|
|
233
|
-
key: `${N.Point}-${h}`,
|
|
234
|
-
data: { collection: L.Collection },
|
|
235
|
-
settings: {
|
|
236
|
-
x: { scale: L.XAxisScale },
|
|
237
|
-
y: {
|
|
238
|
-
scale: L.YAxisScale,
|
|
239
|
-
ref: X.group
|
|
240
|
-
},
|
|
241
|
-
fill: y.getColorDefinition({
|
|
242
|
-
ref: "color",
|
|
243
|
-
overwriteSources: [
|
|
244
|
-
y.MAIN_FIELD,
|
|
245
|
-
"secondColorOverwrite",
|
|
246
|
-
"color"
|
|
247
|
-
],
|
|
248
|
-
dataItemId: e.coloring?.type === p.Single ? r(d?.dataItem) : null
|
|
249
|
-
}),
|
|
250
|
-
shape: h,
|
|
251
|
-
size: v
|
|
252
|
-
},
|
|
253
|
-
animations: {
|
|
254
|
-
enabled: !0,
|
|
255
|
-
presetId: "simple-opacity"
|
|
256
|
-
},
|
|
257
|
-
brush: te(["", X.group], s, void 0, R.AndSubset)
|
|
258
|
-
};
|
|
259
|
-
return {
|
|
260
|
-
...n,
|
|
261
|
-
components: [...n.components, b]
|
|
262
|
-
};
|
|
263
|
-
}, Z = {
|
|
264
|
-
top: 0,
|
|
265
|
-
bottom: 0,
|
|
266
|
-
left: 2,
|
|
267
|
-
right: 2
|
|
268
|
-
}, Ce = (e, t, n, i) => {
|
|
269
|
-
let a;
|
|
270
|
-
return r(e.dataItem) === r(n.dataItem) ? a = i?.measure : r(t.dataItem) === r(n.dataItem) && (a = i?.size), a ? a.value === null ? "-" : a.label ?? "" : "";
|
|
271
|
-
}, we = (e, t, n, i) => {
|
|
272
|
-
if (r(e.dataItem) === r(n.dataItem)) return i.measure?.value;
|
|
273
|
-
if (r(t.dataItem) === r(n.dataItem)) return i.size?.value;
|
|
274
|
-
}, Q = (e, n, r) => {
|
|
275
|
-
let i, s = e.measures.filter(o), c = s.filter((e) => e.role === m.HEAT_MAP_COLOR), l = s.filter((e) => e.role === m.HEAT_MAP_SIZE), u = c[0], d = l[0], { shape: f } = q(e), p;
|
|
276
|
-
switch (f) {
|
|
277
|
-
case t.Circle:
|
|
278
|
-
p = P.Circle;
|
|
279
|
-
break;
|
|
280
|
-
case t.Square:
|
|
281
|
-
case t.Rectangle:
|
|
282
|
-
case t.Bar:
|
|
283
|
-
p = P.Rect;
|
|
284
|
-
break;
|
|
285
|
-
default: p = P.Path;
|
|
286
|
-
}
|
|
287
|
-
if (u?.dataLabels?.show) i = u;
|
|
288
|
-
else if (d?.dataLabels?.show) i = d;
|
|
289
|
-
else return r;
|
|
290
|
-
let h = {
|
|
291
|
-
type: N.Labels,
|
|
292
|
-
key: "heat-map-label",
|
|
293
|
-
settings: { sources: [{
|
|
294
|
-
component: `${N.Point}-${f}`,
|
|
295
|
-
selector: p,
|
|
296
|
-
strategy: {
|
|
297
|
-
type: "bar",
|
|
298
|
-
settings: {
|
|
299
|
-
direction: "right",
|
|
300
|
-
fontFamily: n.fonts.general.fontFamily,
|
|
301
|
-
fontSize: oe(i.dataLabels?.size),
|
|
302
|
-
labels: [{
|
|
303
|
-
label({ data: e, formatter: t }) {
|
|
304
|
-
if (!e) return "";
|
|
305
|
-
let n = Ce(u, d, i, e);
|
|
306
|
-
if (a(i.formatter)) {
|
|
307
|
-
let t = we(u, d, i, e);
|
|
308
|
-
return t === null ? "-" : t === void 0 ? "" : g(i.formatter.format, i.formatter)(t, void 0, e);
|
|
309
|
-
}
|
|
310
|
-
return i.formatter && typeof t == "function" && n && n !== "-" ? t(i.formatter)(n) : n;
|
|
311
|
-
},
|
|
312
|
-
placements: [{
|
|
313
|
-
position: T.Inside,
|
|
314
|
-
fill: "#fff",
|
|
315
|
-
align: .5,
|
|
316
|
-
justify: .5,
|
|
317
|
-
padding: Z
|
|
318
|
-
}, {
|
|
319
|
-
position: T.Inside,
|
|
320
|
-
fill: "#000",
|
|
321
|
-
align: .5,
|
|
322
|
-
justify: .5,
|
|
323
|
-
padding: Z
|
|
324
|
-
}]
|
|
325
|
-
}]
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
}] },
|
|
329
|
-
animations: {
|
|
330
|
-
enabled: !0,
|
|
331
|
-
presetId: "chart-labels"
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
return {
|
|
335
|
-
...r,
|
|
336
|
-
components: [...r?.components ?? [], h]
|
|
337
|
-
};
|
|
338
|
-
}, Te = (e, t, n) => {
|
|
339
|
-
let { shape: r } = q(e), i = `${N.Point}-${r}`;
|
|
340
|
-
return A(e, t, n, {
|
|
341
|
-
filter: (e) => e.filter((e) => e.key === i),
|
|
342
|
-
placement: {
|
|
343
|
-
type: "pointer",
|
|
344
|
-
area: "target"
|
|
345
|
-
}
|
|
346
|
-
});
|
|
347
|
-
}, Ee = class extends j {
|
|
348
|
-
constructor() {
|
|
349
|
-
super([
|
|
350
|
-
xe,
|
|
351
|
-
be,
|
|
352
|
-
me,
|
|
353
|
-
Se,
|
|
354
|
-
D,
|
|
355
|
-
Te,
|
|
356
|
-
Q,
|
|
357
|
-
pe,
|
|
358
|
-
fe
|
|
359
|
-
]);
|
|
360
|
-
}
|
|
361
|
-
preCompile(e) {
|
|
362
|
-
let t = e.dimensions.filter(o), n = e.measures.filter(o), r = t.filter((e) => e.role === c.HEAT_MAP_HORIZONTAL), i = t.filter((e) => e.role === c.HEAT_MAP_VERTICAL), a = n.filter((e) => e.role === m.HEAT_MAP_COLOR), s = r[0], l = i[0], u = a[0];
|
|
363
|
-
if (!s || !l || !u) throw Error("Charts w/o horizontal or vertical dimension or color measure are not supported ATM.");
|
|
364
|
-
}
|
|
365
|
-
}, De = ({ id: e, clientX: t, clientY: n, vBackendAPI: r, ...i }) => {
|
|
366
|
-
let { top: a, left: o } = r.daedalus.convertCoordinatesToContainerPosition(t, n);
|
|
367
|
-
U({
|
|
368
|
-
id: e,
|
|
369
|
-
top: a,
|
|
370
|
-
left: o,
|
|
371
|
-
...i
|
|
372
|
-
}, { vBackendAPI: r });
|
|
373
|
-
}, $ = (e, t, n, i, a) => {
|
|
374
|
-
let o, s, [c, l, u, d] = i, f = c.name, p = l.name, m = u.name, h = n.data.value, g = n.data.group.value, _ = n.data.measure.value;
|
|
375
|
-
if (d) {
|
|
376
|
-
let e = r(d);
|
|
377
|
-
o = n.data[e].value, s = d.name;
|
|
378
|
-
}
|
|
379
|
-
De({
|
|
380
|
-
id: e,
|
|
381
|
-
clientX: t.clientX,
|
|
382
|
-
clientY: t.clientY,
|
|
383
|
-
xAxisValue: h,
|
|
384
|
-
yAxisValue: g,
|
|
385
|
-
measureColorValue: _,
|
|
386
|
-
measureSizeValue: o,
|
|
387
|
-
xAxisName: f,
|
|
388
|
-
yAxisName: p,
|
|
389
|
-
measureColorName: m,
|
|
390
|
-
measureSizeName: s,
|
|
391
|
-
vBackendAPI: a
|
|
392
|
-
});
|
|
393
|
-
}, Oe = (e) => U({ id: "onCellLeave" }, { vBackendAPI: e }), ke = () => {
|
|
394
|
-
let e = b(), t = _(), n = y();
|
|
395
|
-
return (0, K.useCallback)((r, i, a, o, s) => {
|
|
396
|
-
let c;
|
|
397
|
-
switch (i) {
|
|
398
|
-
case "click":
|
|
399
|
-
r === N.Text ? c = ce(r, n, o, a) : s?.key && o && $("onCellClick", o, s, t, e);
|
|
400
|
-
break;
|
|
401
|
-
case "mousemove":
|
|
402
|
-
if (!o || !s) break;
|
|
403
|
-
$("onCellHover", o, s, t, e);
|
|
404
|
-
break;
|
|
405
|
-
case "mouseleave":
|
|
406
|
-
Oe(e);
|
|
407
|
-
break;
|
|
408
|
-
}
|
|
409
|
-
c && e.emitEvent(c.action, c.payload);
|
|
410
|
-
}, [e, t]);
|
|
411
|
-
}, Ae = C(), je = S(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
|
|
412
|
-
let a = v(), [o] = (0, K.useState)(() => new Ee()), c = h(), u = ke();
|
|
413
|
-
if (!e || !s(e) || !r) return null;
|
|
414
|
-
let d = t || f, p = o.compile(e, d, n, r, i, l.HeatMap, a, c, u);
|
|
415
|
-
return p ? /* @__PURE__ */ (0, Ae.jsx)(ie, {
|
|
416
|
-
config: i,
|
|
417
|
-
definition: p,
|
|
418
|
-
size: r,
|
|
419
|
-
vSpec: e
|
|
420
|
-
}) : null;
|
|
421
|
-
});
|
|
422
|
-
export { je as HeatMapChart };
|