@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.
Files changed (139) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +93 -0
  3. package/README.md +843 -2
  4. package/THIRD_PARTY_NOTICES.md +8477 -0
  5. package/VISUALIZATION_DEFINITIONS.md +2378 -0
  6. package/chunks/ClickAwayListener-BbeNMAvj.js +52 -0
  7. package/chunks/LinearProgress-B1FeWaen.js +253 -0
  8. package/chunks/accessors-DemrDevR.js +128 -0
  9. package/chunks/app-filter-bar.compiler-BGJ7HAbr.js +64 -0
  10. package/chunks/bar.compiler-CT0ZbQKc.js +374 -0
  11. package/chunks/builder-B6dWSIdD.js +12289 -0
  12. package/chunks/color-settings-ZIvgNTq1.js +10 -0
  13. package/chunks/coloring-B1XAfg6b.js +664 -0
  14. package/chunks/debounce-fn-CUixuz45.js +7 -0
  15. package/chunks/definitions-D3OVqmXl.js +2102 -0
  16. package/chunks/escobar-eDjtGpkC.js +34606 -0
  17. package/chunks/events-WZut5Ow6.js +4 -0
  18. package/chunks/extend-BKUkc4_i.js +37 -0
  19. package/chunks/filter.compiler-DBsyRBJt.js +70 -0
  20. package/chunks/filtering-tqjAyJH5.js +1072 -0
  21. package/chunks/grouping-type-On4s9Thj.js +3 -0
  22. package/chunks/handlers-VTBfIZYZ.js +13072 -0
  23. package/chunks/isEqual-BDxAhUo8.js +7514 -0
  24. package/chunks/line.compiler-CzdM5Ld0.js +198 -0
  25. package/chunks/metadata-BGElBy5Z.js +28 -0
  26. package/chunks/number.compiler-G-R7y16P.js +53 -0
  27. package/chunks/operations-CTNUX6Sy.js +26249 -0
  28. package/chunks/range-CiwTbMig.js +22 -0
  29. package/chunks/registry-CsQQzukD.js +920 -0
  30. package/chunks/requirements-DYjZCFyf.js +6 -0
  31. package/chunks/rolldown-runtime-DleVn1XH.js +28 -0
  32. package/chunks/set-coloring-datafield-B3uIS1Pe.js +8 -0
  33. package/chunks/shared-CBvcC5YV.js +1218 -0
  34. package/chunks/src-BOS6SqkZ.js +67 -0
  35. package/chunks/src-D9XogOrc.js +422 -0
  36. package/chunks/standalone-0M4HlmDW2.js +3944 -0
  37. package/chunks/standalone-0ashe9w1.js +411 -0
  38. package/chunks/standalone-B7jax8wa.js +339 -0
  39. package/chunks/standalone-BK0VYU-l.js +463 -0
  40. package/chunks/standalone-BMIbT1b2.js +4619 -0
  41. package/chunks/standalone-BZV5vOwA.js +6 -0
  42. package/chunks/standalone-BhDrWj4p.js +1980 -0
  43. package/chunks/standalone-BtSHCp2U2.js +673 -0
  44. package/chunks/standalone-BvaKdky9.js +344 -0
  45. package/chunks/standalone-BwtM31-f.js +2 -0
  46. package/chunks/standalone-C3gg736V.js +1129 -0
  47. package/chunks/standalone-CC1VUjO32.js +299 -0
  48. package/chunks/standalone-C_rYnZ0N.js +741 -0
  49. package/chunks/standalone-CoLrAxRV.js +13198 -0
  50. package/chunks/standalone-DC-aUgXC.js +3855 -0
  51. package/chunks/standalone-DCtRoTWg.js +675 -0
  52. package/chunks/standalone-DUDFTBqL.js +833 -0
  53. package/chunks/standalone-DhZkX9Td.js +2 -0
  54. package/chunks/standalone-DtLElfuM.js +512 -0
  55. package/chunks/standalone-G9Q4Uczu.js +726 -0
  56. package/chunks/standalone-JuLF-OoH.js +1762 -0
  57. package/chunks/standalone-_DeX21JJ.js +383 -0
  58. package/chunks/standalone-gFhKZh8m.js +179 -0
  59. package/chunks/standalone-tDNy-SFH.js +281 -0
  60. package/chunks/standalone-v1oxfU20.js +68 -0
  61. package/chunks/standalone-vzBY6q0I2.js +140 -0
  62. package/chunks/stroke-dash-UgMEcCS4.js +6 -0
  63. package/chunks/table.compiler-tb914oj3.js +222 -0
  64. package/chunks/typeof-CJDtcySz.js +13 -0
  65. package/chunks/ui-DQWtv2iM.js +63551 -0
  66. package/chunks/url-utils-B17gj_mr.js +5501 -0
  67. package/chunks/useFieldName-BvdcoJRl.js +7 -0
  68. package/chunks/utils-Bg7K-t6K.js +32379 -0
  69. package/chunks/view-Bn83C8d9.js +12466 -0
  70. package/definitions.js +3 -0
  71. package/docs/operations/astrato-app-filter-bar.md +161 -0
  72. package/docs/operations/bar.md +6968 -0
  73. package/docs/operations/combo.md +5804 -0
  74. package/docs/operations/date-picker.md +644 -0
  75. package/docs/operations/distribution-gauge.md +3082 -0
  76. package/docs/operations/dot.md +5570 -0
  77. package/docs/operations/filter.md +1483 -0
  78. package/docs/operations/gauge.md +3316 -0
  79. package/docs/operations/heatMap.md +5944 -0
  80. package/docs/operations/histogram.md +1856 -0
  81. package/docs/operations/iframe.md +56 -0
  82. package/docs/operations/image.md +177 -0
  83. package/docs/operations/index.md +46 -0
  84. package/docs/operations/line.md +6391 -0
  85. package/docs/operations/number.md +3903 -0
  86. package/docs/operations/pie.md +5956 -0
  87. package/docs/operations/radar.md +4566 -0
  88. package/docs/operations/sankey.md +3088 -0
  89. package/docs/operations/scatter.md +5969 -0
  90. package/docs/operations/shape.md +315 -0
  91. package/docs/operations/simpleTextObject.md +699 -0
  92. package/docs/operations/slider.md +220 -0
  93. package/docs/operations/table.md +8800 -0
  94. package/docs/operations/tree.md +2867 -0
  95. package/docs/operations/treemap.md +3527 -0
  96. package/docs/operations/waterfall.md +2928 -0
  97. package/docs/operations/word-cloud.md +3000 -0
  98. package/getters.js +18 -0
  99. package/index.js +1183 -0
  100. package/metadata.js +20 -0
  101. package/operations.js +64 -0
  102. package/package.json +185 -4
  103. package/src/definitions/index.d.ts +2 -0
  104. package/src/definitions/model/definitions/available-fields.d.ts +35 -0
  105. package/src/definitions/model/definitions/compilers/compile.d.ts +7 -0
  106. package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
  107. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1341 -0
  108. package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
  109. package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
  110. package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
  111. package/src/definitions/model/definitions/index.d.ts +23 -0
  112. package/src/definitions/model/definitions/registry/compile.d.ts +2 -0
  113. package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
  114. package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
  115. package/src/definitions/model/definitions/schemas/app-filter-bar.schema.d.ts +22 -0
  116. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +73 -0
  117. package/src/definitions/model/definitions/schemas/broad-chart.schema.d.ts +68 -0
  118. package/src/definitions/model/definitions/schemas/common.schema.d.ts +303 -0
  119. package/src/definitions/model/definitions/schemas/filter.schema.d.ts +22 -0
  120. package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
  121. package/src/definitions/model/definitions/schemas/line.schema.d.ts +72 -0
  122. package/src/definitions/model/definitions/schemas/number.schema.d.ts +21 -0
  123. package/src/definitions/model/definitions/schemas/object.schema.d.ts +215 -0
  124. package/src/definitions/model/definitions/schemas/table.schema.d.ts +458 -0
  125. package/src/definitions/model/definitions/types/compilation.types.d.ts +36 -0
  126. package/src/definitions/model/definitions/types/definition.types.d.ts +2 -0
  127. package/src/definitions/model/definitions/types/descriptor.types.d.ts +39 -0
  128. package/src/definitions/model/definitions/types/index.d.ts +3 -0
  129. package/src/definitions/model/definitions/validation.d.ts +3 -0
  130. package/src/getters/index.d.ts +30 -0
  131. package/src/index.d.ts +4 -0
  132. package/src/metadata/index.d.ts +4 -0
  133. package/src/operations/index.d.ts +30 -0
  134. package/src/registry/index.d.ts +6 -0
  135. package/src/runtime/index.d.ts +2 -0
  136. package/src/types.d.ts +307 -0
  137. package/src/visualization-catalog.d.ts +82 -0
  138. package/src/web-components/index.d.ts +12 -0
  139. package/styles.css +2 -0
@@ -0,0 +1,411 @@
1
+ import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { Eo as t, Fa as n, Ja as r, Ks as i, Mo as a, Sa as o, Si as s, To as c, Ys as l, Zr as u, fc as d, mn as f, qa as p } from "./isEqual-BDxAhUo8.js";
3
+ import { $t as m, Cn as h, Ei as g, I as _, P as v, R as y, W as b, Yi as x, mn as S } from "./utils-Bg7K-t6K.js";
4
+ import { Fm as C, Pm as w } from "./handlers-VTBfIZYZ.js";
5
+ import { g as T } from "./builder-B6dWSIdD.js";
6
+ import { At as E, Bt as D, It as ee, Jt as O, M as te, Mt as ne, Nt as re, Ot as k, Qt as A, St as j, Wt as M, X as N, Yt as ie, an as P, dn as F, gt as ae, ht as oe, i as se, j as ce, qt as I, rn as L, t as R, un as z, zt as B } from "./escobar-eDjtGpkC.js";
7
+ import { t as V } from "./coloring-B1XAfg6b.js";
8
+ import { t as H } from "./debounce-fn-CUixuz45.js";
9
+ import { t as U } from "./set-coloring-datafield-B3uIS1Pe.js";
10
+ var W = 100, G = (e, t, n) => {
11
+ let r = e.element.getBoundingClientRect(), i = {
12
+ x: t.clientX - r.left,
13
+ y: t.clientY - r.top
14
+ };
15
+ return e.chart?.shapesAt(i, {
16
+ components: [{
17
+ key: n,
18
+ opts: { propagation: "stop" }
19
+ }],
20
+ propagation: "stop"
21
+ })?.[0];
22
+ }, le = (e, t) => {
23
+ let n = null, r = H((r, i) => {
24
+ let a = G(r, i, e);
25
+ !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);
26
+ }, W), i = H((r) => {
27
+ n &&= (t(e, "mouseleave", n.key, r, n), null);
28
+ }, W);
29
+ return {
30
+ type: "native",
31
+ key: "action-events-interaction",
32
+ events: {
33
+ click(n) {
34
+ let r = G(this, n, e);
35
+ r && t(e, "click", r.key, n, r);
36
+ },
37
+ mousemove(e) {
38
+ r(this, e);
39
+ },
40
+ mouseleave(e) {
41
+ i(e);
42
+ }
43
+ }
44
+ };
45
+ }, K = /* @__PURE__ */ e(x()), ue = t.Rectangle, q = (e) => ({
46
+ shape: e?.heatMapSettings?.shape ?? ue,
47
+ minSize: e?.heatMapSettings?.minSize ?? .1,
48
+ maxSize: e?.heatMapSettings?.maxSize ?? 1
49
+ }), de = (e, t, n, r, i, a, o, s) => {
50
+ let c = [], { shape: l } = q(e), u = `${F.Point}-${l}`;
51
+ if ((e?.enableEmitEvents ?? !1) && s) {
52
+ let e = le(u, s);
53
+ c.push(e);
54
+ }
55
+ return {
56
+ ...n,
57
+ interactions: n.interactions ? [...n.interactions, ...c] : [...c]
58
+ };
59
+ }, fe = (e, t, n) => {
60
+ let r = e.dimensions.filter(s), i = r.filter((e) => e.role === p.HEAT_MAP_HORIZONTAL), a = r.filter((e) => e.role === p.HEAT_MAP_VERTICAL), o = i[0], c = a[0], [l, u] = re([{
61
+ showAxisTooltip: e?.axes?.dimension?.showAxisTooltip,
62
+ formatter: o?.formatter,
63
+ scale: ie(e),
64
+ key: k.Dimension,
65
+ settings: { direction: E(e) }
66
+ }, {
67
+ showAxisTooltip: e?.axes?.secondaryDimension?.showAxisTooltip,
68
+ formatter: c?.formatter,
69
+ scale: A.YAxisScale,
70
+ key: k.DimensionSec,
71
+ settings: {
72
+ direction: ne(e),
73
+ isVerticalDimension: !0
74
+ }
75
+ }]);
76
+ return {
77
+ ...n,
78
+ components: [...n.components ?? [], ...l],
79
+ interactions: [...n.interactions ?? [], ...u]
80
+ };
81
+ }, pe = (e, t, r, i, o, c, l, d) => {
82
+ let f = [], m = [], h = [];
83
+ if (d) {
84
+ let e = ee(F.Text, d);
85
+ h.push(e);
86
+ }
87
+ let g = e.dimensions.filter((e) => e.role === p.HEAT_MAP_HORIZONTAL), _ = g.filter(s), v = e.dimensions.filter((e) => e.role === p.HEAT_MAP_VERTICAL), y = v.filter(s), b = {
88
+ ...t.axis.dimension,
89
+ ...t.fonts
90
+ }, x = {
91
+ ...t.axis.measure,
92
+ ...t.fonts
93
+ }, S = _[0], C = y[0], w = e.measures.filter((e) => e.role === n.HEAT_MAP_COLOR), T = w.filter(s), E = {};
94
+ if (S) {
95
+ let t = e.axes?.dimension || E, n = t.secondaryAxis ? a.Top : a.Bottom;
96
+ if (f.push(B(A.XAxisScale, t, b, n, S.formatter, c)), t.showAxisName) {
97
+ let r = u(g, e.enableAlternate, c?.isPrintMode);
98
+ m.push(D(_, r, n, b, t.colors?.title, t.axisTitle ? t.axisTitle : I(S, l), t.titleFontSize));
99
+ }
100
+ }
101
+ if (C) {
102
+ let t = e.axes?.secondaryDimension || E, n = t.secondaryAxis ? a.Right : a.Left;
103
+ if (f.push(B(A.YAxisScale, t, b, n, C.formatter, c)), t.showAxisName) {
104
+ let r = u(v, e.enableAlternate, c?.isPrintMode);
105
+ m.push(D(y, r, n, b, t.colors?.title, t.axisTitle ? t.axisTitle : I(C, l), t.titleFontSize));
106
+ }
107
+ }
108
+ if (w.length > 1) {
109
+ let t = e.axes?.primaryMeasure || {}, n = u(w, e.enableAlternate, c?.isPrintMode);
110
+ m.push(D(T, n, a.Right, x, t.colors?.title, t.axisTitle, t.titleFontSize));
111
+ }
112
+ return {
113
+ ...r,
114
+ components: [
115
+ ...r.components,
116
+ ...f,
117
+ ...m
118
+ ],
119
+ interactions: r.interactions ? [...r.collections, ...h] : [...h]
120
+ };
121
+ }, me = /* @__PURE__ */ e(f()), he = (e) => (t, n) => t.value === e ? -1 : +(n.value === e), ge = (e) => (t, n) => t.value === e ? 1 : n.value === e ? -1 : 0, J = (e, t = 0) => (n, r) => {
122
+ let i = e ? n[e] : n, a = e ? r[e] : r;
123
+ 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;
124
+ }, _e = (e) => (t, n) => {
125
+ let r = 0;
126
+ for (let i = 0; i < e.length; i++) if (r = e[i](t, n), r !== 0) return r;
127
+ return r;
128
+ }, ve = (e) => [
129
+ "SUM",
130
+ "MIN",
131
+ "MAX",
132
+ "AVG"
133
+ ].includes(e.aggregation?.funcName) ? e.aggregation?.funcName.toLowerCase() : e.aggregation?.funcName === "COUNT" ? "sum" : "avg", Y = (e, t, n) => {
134
+ let r = n?.sortingOrder.findIndex((t) => d(t.dataItem) === d(e));
135
+ if (r < 0) return;
136
+ let i = n?.sortingOrder[r], a = n?.sortingOrder.slice(0, r).filter((e) => e.fieldType === "measure");
137
+ if (i) {
138
+ let e, r = [];
139
+ n?.topN?.enabled && n.topN.showOthers && ((0, me.default)(n.topN.dimensionIdx) || n.topN.dimensionIdx === t) && (e = n.topN.othersPosition === C.First ? he(n.topN.othersLabel?.stringLabel ?? "Others") : n.topN.othersPosition === C.Last ? ge(n.topN.othersLabel?.stringLabel ?? "Others") : void 0, e && r.push(e));
140
+ let o = {};
141
+ return a.forEach((e, t) => {
142
+ let n = `m${t}`;
143
+ r.push(J(n, e.sortDirection === c.Asc ? 1 : -1)), o[n] = {
144
+ field: d(e.dataItem),
145
+ reduce: ve(e.dataItem)
146
+ };
147
+ }), r.push(J("", i.sortDirection === c.Asc ? 1 : -1)), {
148
+ props: o,
149
+ sort: _e(r)
150
+ };
151
+ }
152
+ }, ye = (e, t, r) => {
153
+ let i = e.dimensions.filter(s), a = e.measures.filter(s), o = i.filter((e) => e.role === p.HEAT_MAP_HORIZONTAL), c = i.filter((e) => e.role === p.HEAT_MAP_VERTICAL), u = a.filter((e) => e.role === n.HEAT_MAP_COLOR), f = a.filter((e) => e.role === n.HEAT_MAP_SIZE), m = o[0], h = c[0], g = u[0], _ = f[0], { coloring: v } = e || {}, y = v?.fieldId;
154
+ e.coloring?.type === l.Gradient && (y ||= d(g.dataItem)), y && oe(r, 0, { color: { field: y } });
155
+ let b = j(U(e, y), t, {});
156
+ if (m) {
157
+ let t = Y(m.dataItem, 0, e.querySettings);
158
+ b[A.XAxisScale] = {
159
+ data: {
160
+ extract: {
161
+ field: d(m.dataItem),
162
+ trackBy: (e) => e,
163
+ reduce: "first",
164
+ props: t?.props
165
+ },
166
+ sort: t?.sort
167
+ },
168
+ type: P.Band
169
+ };
170
+ }
171
+ if (h) {
172
+ let t = Y(h.dataItem, 1, e.querySettings);
173
+ b[A.YAxisScale] = {
174
+ data: {
175
+ extract: {
176
+ field: d(h.dataItem),
177
+ trackBy: (e) => e,
178
+ reduce: "first",
179
+ props: t?.props
180
+ },
181
+ sort: t?.sort
182
+ },
183
+ type: P.Band
184
+ };
185
+ }
186
+ let x = d(g.dataItem);
187
+ if (b[x] = { data: { field: x } }, _) {
188
+ let e = d(_.dataItem);
189
+ b[e] = {
190
+ type: P.Linear,
191
+ data: { extract: { field: e } }
192
+ };
193
+ }
194
+ return {
195
+ ...r,
196
+ scales: b
197
+ };
198
+ }, X = /* @__PURE__ */ function(e) {
199
+ return e.measure = "measure", e.group = "group", e.size = "size", e;
200
+ }({}), be = (e, t, r) => {
201
+ let i = e.dimensions.filter(s), a = e.measures.filter(s), o = te((e.supportingMeasures ?? []).filter(s)), c = i.filter((e) => e.role === p.HEAT_MAP_HORIZONTAL), l = i.filter((e) => e.role === p.HEAT_MAP_VERTICAL), u = a.filter((e) => e.role === n.HEAT_MAP_COLOR), f = a.filter((e) => e.role === n.HEAT_MAP_SIZE);
202
+ if (!i.length) return r;
203
+ let m = c[0], h = l[0], g = u[0], _ = f[0], v = d(g?.dataItem), y = d(_?.dataItem), b = d(m?.dataItem), x = d(h?.dataItem), S = [{
204
+ key: A.Collection,
205
+ data: { extract: [{
206
+ field: b,
207
+ props: {
208
+ measure: { field: v },
209
+ group: { field: x },
210
+ size: _ ? { field: y } : void 0,
211
+ secondColorOverwrite: { field: x },
212
+ ...o
213
+ }
214
+ }] }
215
+ }];
216
+ return v && (S[0].data.extract[0].props[v] = { field: v }), y && (S[0].data.extract[0].props[y] = { field: y }), {
217
+ ...r,
218
+ collections: S
219
+ };
220
+ }, xe = (e, t, r, i, a, o) => {
221
+ let c = e.measures.filter(s), u = c.filter((e) => e.role === n.HEAT_MAP_COLOR), f = c.filter((e) => e.role === n.HEAT_MAP_SIZE), p = u[0], m = f[0], { shape: h, minSize: g, maxSize: _ } = q(e), v = _;
222
+ m && (v = (e) => e.resources.scale(d(m.dataItem))(e.datum.size.value) * (_ - g) + g);
223
+ let y = new V(e, t, a?.[0]?.itemsNotAffectedByFiltering), b = {
224
+ type: F.Point,
225
+ key: `${F.Point}-${h}`,
226
+ data: { collection: A.Collection },
227
+ settings: {
228
+ x: { scale: A.XAxisScale },
229
+ y: {
230
+ scale: A.YAxisScale,
231
+ ref: X.group
232
+ },
233
+ fill: y.getColorDefinition({
234
+ ref: "color",
235
+ overwriteSources: [
236
+ y.MAIN_FIELD,
237
+ "secondColorOverwrite",
238
+ "color"
239
+ ],
240
+ dataItemId: e.coloring?.type === l.Single ? d(p?.dataItem) : null
241
+ }),
242
+ shape: h,
243
+ size: v
244
+ },
245
+ animations: {
246
+ enabled: !0,
247
+ presetId: "simple-opacity"
248
+ },
249
+ brush: M(["", X.group], o, void 0, z.AndSubset)
250
+ };
251
+ return {
252
+ ...r,
253
+ components: [...r.components, b]
254
+ };
255
+ }, Z = {
256
+ top: 0,
257
+ bottom: 0,
258
+ left: 2,
259
+ right: 2
260
+ }, Se = (e, t, n, r) => {
261
+ let i;
262
+ return d(e.dataItem) === d(n.dataItem) ? i = r?.measure : d(t.dataItem) === d(n.dataItem) && (i = r?.size), i ? i.value === null ? "-" : i.label ?? "" : "";
263
+ }, Ce = (e, t, n, r) => {
264
+ if (d(e.dataItem) === d(n.dataItem)) return r.measure?.value;
265
+ if (d(t.dataItem) === d(n.dataItem)) return r.size?.value;
266
+ }, we = (e, i, a) => {
267
+ let o, c = e.measures.filter(s), l = c.filter((e) => e.role === n.HEAT_MAP_COLOR), u = c.filter((e) => e.role === n.HEAT_MAP_SIZE), d = l[0], f = u[0], { shape: p } = q(e), m;
268
+ switch (p) {
269
+ case t.Circle:
270
+ m = L.Circle;
271
+ break;
272
+ case t.Square:
273
+ case t.Rectangle:
274
+ case t.Bar:
275
+ m = L.Rect;
276
+ break;
277
+ default: m = L.Path;
278
+ }
279
+ if (d?.dataLabels?.show) o = d;
280
+ else if (f?.dataLabels?.show) o = f;
281
+ else return a;
282
+ let h = {
283
+ type: F.Labels,
284
+ key: "heat-map-label",
285
+ settings: { sources: [{
286
+ component: `${F.Point}-${p}`,
287
+ selector: m,
288
+ strategy: {
289
+ type: "bar",
290
+ settings: {
291
+ direction: "right",
292
+ fontFamily: i.fonts.general.fontFamily,
293
+ fontSize: O(o.dataLabels?.size),
294
+ labels: [{
295
+ label({ data: e, formatter: t }) {
296
+ if (!e) return "";
297
+ let n = Se(d, f, o, e);
298
+ if (r(o.formatter)) {
299
+ let t = Ce(d, f, o, e);
300
+ return t === null ? "-" : t === void 0 ? "" : S(o.formatter.format, o.formatter)(t, void 0, e);
301
+ }
302
+ return o.formatter && t && n && n !== "-" ? t(o.formatter)(n) : n;
303
+ },
304
+ placements: [{
305
+ position: w.Inside,
306
+ fill: "#fff",
307
+ align: .5,
308
+ justify: .5,
309
+ padding: Z
310
+ }, {
311
+ position: w.Inside,
312
+ fill: "#000",
313
+ align: .5,
314
+ justify: .5,
315
+ padding: Z
316
+ }]
317
+ }]
318
+ }
319
+ }
320
+ }] },
321
+ animations: {
322
+ enabled: !0,
323
+ presetId: "chart-labels"
324
+ }
325
+ };
326
+ return {
327
+ ...a,
328
+ components: [...a?.components ?? [], h]
329
+ };
330
+ }, Q = (e, t, n) => {
331
+ let { shape: r } = q(e), i = `${F.Point}-${r}`;
332
+ return N(e, t, n, {
333
+ filter: (e) => e.filter((e) => e.key === i),
334
+ placement: {
335
+ type: "pointer",
336
+ area: "target"
337
+ }
338
+ });
339
+ }, Te = class extends ce {
340
+ constructor() {
341
+ super([
342
+ be,
343
+ ye,
344
+ pe,
345
+ xe,
346
+ ae,
347
+ Q,
348
+ we,
349
+ fe,
350
+ de
351
+ ]);
352
+ }
353
+ preCompile(e) {
354
+ let t = e.dimensions.filter(s), r = e.measures.filter(s), i = t.filter((e) => e.role === p.HEAT_MAP_HORIZONTAL), a = t.filter((e) => e.role === p.HEAT_MAP_VERTICAL), o = r.filter((e) => e.role === n.HEAT_MAP_COLOR), c = i[0], l = a[0], u = o[0];
355
+ if (!c || !l || !u) throw Error("Charts w/o horizontal or vertical dimension or color measure are not supported ATM.");
356
+ }
357
+ }, Ee = ({ id: e, clientX: t, clientY: n, vBackendAPI: r, ...i }) => {
358
+ let { top: a, left: o } = r.daedalus.convertCoordinatesToContainerPosition(t, n);
359
+ T({
360
+ id: e,
361
+ top: a,
362
+ left: o,
363
+ ...i
364
+ }, { vBackendAPI: r });
365
+ }, $ = (e, t, n, r, i) => {
366
+ let a, o, [s, c, l, u] = r, f = s.name, p = c.name, m = l.name, h = n.data.value, g = n.data.group.value, _ = n.data.measure.value;
367
+ if (u) {
368
+ let e = d(u);
369
+ a = n.data[e].value, o = u.name;
370
+ }
371
+ Ee({
372
+ id: e,
373
+ clientX: t.clientX,
374
+ clientY: t.clientY,
375
+ xAxisValue: h,
376
+ yAxisValue: g,
377
+ measureColorValue: _,
378
+ measureSizeValue: a,
379
+ xAxisName: f,
380
+ yAxisName: p,
381
+ measureColorName: m,
382
+ measureSizeName: o,
383
+ vBackendAPI: i
384
+ });
385
+ }, De = (e) => T({ id: "onCellLeave" }, { vBackendAPI: e }), Oe = () => {
386
+ let e = h(), t = y(), n = b();
387
+ return (0, K.useCallback)((r, i, a, o, s) => {
388
+ let c;
389
+ switch (i) {
390
+ case "click":
391
+ r === F.Text ? c = R(r, n, o, a) : s.key && $("onCellClick", o, s, t, e);
392
+ break;
393
+ case "mousemove":
394
+ $("onCellHover", o, s, t, e);
395
+ break;
396
+ case "mouseleave":
397
+ De(e);
398
+ break;
399
+ }
400
+ c && e.emitEvent(c.action, c.payload);
401
+ }, [e, t]);
402
+ }, ke = g(), Ae = m(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: a }) => {
403
+ let s = v(), [c] = (0, K.useState)(() => new Te()), l = _(), u = Oe(), d = t || o, f = c.compile(e, d, n, r, a, i.HeatMap, s, l, u);
404
+ return f ? /* @__PURE__ */ (0, ke.jsx)(se, {
405
+ config: a,
406
+ definition: f,
407
+ size: r,
408
+ vSpec: e
409
+ }) : null;
410
+ });
411
+ export { Ae as HeatMapChart };