@astrato-io/visualizations 0.0.0-stage → 0.6.4

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 (145) 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 +8387 -0
  5. package/VISUALIZATION_DEFINITIONS.md +2378 -0
  6. package/chunks/LinearProgress-CUZ0D8_t.js +253 -0
  7. package/chunks/Radio-Ciu-F4CU.js +957 -0
  8. package/chunks/ToggleButton-BCJc3Jlc.js +153 -0
  9. package/chunks/_baseFlatten-DPXPOrea.js +7076 -0
  10. package/chunks/accessors-DemrDevR.js +128 -0
  11. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +55 -0
  12. package/chunks/bar.compiler-oqaPzIut.js +370 -0
  13. package/chunks/color-settings-ZIvgNTq1.js +10 -0
  14. package/chunks/coloring-C16AUZEi.js +663 -0
  15. package/chunks/data-item-resolution-1lvYB5ln.js +53 -0
  16. package/chunks/debounce-fn-CUixuz45.js +7 -0
  17. package/chunks/escobar-BGqT1EsE.js +34580 -0
  18. package/chunks/event-bus-KiSiCJrC.js +2683 -0
  19. package/chunks/events-WZut5Ow6.js +4 -0
  20. package/chunks/extend-BKUkc4_i.js +37 -0
  21. package/chunks/filter.compiler-CuLtc_02.js +60 -0
  22. package/chunks/filtering-Yq4DEa0t.js +953 -0
  23. package/chunks/gauge-target-type-BkKXAqkX.js +4 -0
  24. package/chunks/grouping-type-BX_9Ix5q.js +3 -0
  25. package/chunks/interfaces-VUY4_yVO.js +8742 -0
  26. package/chunks/line-settings-DfYTUyPz.js +4 -0
  27. package/chunks/line.compiler-BpA_6Tc7.js +188 -0
  28. package/chunks/metadata-CPXdYoln.js +28 -0
  29. package/chunks/number.compiler-DbkWcG4S.js +44 -0
  30. package/chunks/pie-uv42Eqal.js +10 -0
  31. package/chunks/range-DrzdfBX4.js +22 -0
  32. package/chunks/registry-CExpGJ1N.js +920 -0
  33. package/chunks/requirements-DNhuShLS.js +6 -0
  34. package/chunks/rolldown-runtime-DleVn1XH.js +28 -0
  35. package/chunks/set-coloring-datafield-B3uIS1Pe.js +8 -0
  36. package/chunks/shared-CKDL4hx9.js +1171 -0
  37. package/chunks/src-BC7cGcJ-.js +2024 -0
  38. package/chunks/src-BOS6SqkZ.js +67 -0
  39. package/chunks/src-C0LgoUWY.js +26105 -0
  40. package/chunks/src-Cum_2NLV.js +12145 -0
  41. package/chunks/src-D9XogOrc.js +422 -0
  42. package/chunks/src-Dun_jXtz.js +10295 -0
  43. package/chunks/src-DvX5LU9T.js +14742 -0
  44. package/chunks/standalone-87YV_m9n.js +687 -0
  45. package/chunks/standalone-BDCwI6Hn.js +4619 -0
  46. package/chunks/standalone-BH5NqDwp.js +1763 -0
  47. package/chunks/standalone-BLVAWLNJ.js +385 -0
  48. package/chunks/standalone-BPomtAVs.js +2 -0
  49. package/chunks/standalone-BXyBcUOQ.js +2 -0
  50. package/chunks/standalone-BYm1UjLr.js +140 -0
  51. package/chunks/standalone-BllF4rDp.js +383 -0
  52. package/chunks/standalone-BmfMt74U.js +726 -0
  53. package/chunks/standalone-BqWyrnZI.js +281 -0
  54. package/chunks/standalone-C85u7U6I.js +340 -0
  55. package/chunks/standalone-CCNtaJ7s.js +741 -0
  56. package/chunks/standalone-CDQnr6qT.js +345 -0
  57. package/chunks/standalone-CNyNHKVx.js +674 -0
  58. package/chunks/standalone-CY57qwZ-.js +1129 -0
  59. package/chunks/standalone-CZynjFG7.js +12979 -0
  60. package/chunks/standalone-D5vnf-9y.js +3943 -0
  61. package/chunks/standalone-DFPva_ku.js +299 -0
  62. package/chunks/standalone-DQxxNwF8.js +675 -0
  63. package/chunks/standalone-DS9T0FZ-.js +830 -0
  64. package/chunks/standalone-Dx3MLlrO.js +512 -0
  65. package/chunks/standalone-DzixzZAL.js +411 -0
  66. package/chunks/standalone-QJ1kKMnO.js +6 -0
  67. package/chunks/standalone-jiz0L2Dg.js +3855 -0
  68. package/chunks/standalone-lBm9hQ-q.js +179 -0
  69. package/chunks/standalone-rJ45Zfl1.js +68 -0
  70. package/chunks/stroke-dash-UgMEcCS4.js +6 -0
  71. package/chunks/table.compiler-BrXkm4Fz.js +213 -0
  72. package/chunks/toInteger-DVZr-D1j.js +11 -0
  73. package/chunks/treemap-x_zmJoG7.js +23 -0
  74. package/chunks/typeof-CJDtcySz.js +13 -0
  75. package/chunks/types-dVVCsDWD.js +4 -0
  76. package/chunks/ui-D1HQNIBy.js +54039 -0
  77. package/chunks/url-utils-B17gj_mr.js +5501 -0
  78. package/chunks/useFieldName-oqQ3bvnO.js +7 -0
  79. package/chunks/utils-Ba9T0TqC.js +31097 -0
  80. package/chunks/view-CLqWMV7Z.js +156 -0
  81. package/definitions.js +3 -0
  82. package/docs/operations/astrato-app-filter-bar.md +161 -0
  83. package/docs/operations/bar.md +7050 -0
  84. package/docs/operations/combo.md +5825 -0
  85. package/docs/operations/date-picker.md +644 -0
  86. package/docs/operations/distribution-gauge.md +3218 -0
  87. package/docs/operations/dot.md +5662 -0
  88. package/docs/operations/filter.md +1507 -0
  89. package/docs/operations/gauge.md +3452 -0
  90. package/docs/operations/heatMap.md +6026 -0
  91. package/docs/operations/histogram.md +1870 -0
  92. package/docs/operations/iframe.md +56 -0
  93. package/docs/operations/image.md +177 -0
  94. package/docs/operations/index.md +46 -0
  95. package/docs/operations/line.md +6468 -0
  96. package/docs/operations/number.md +3969 -0
  97. package/docs/operations/pie.md +6089 -0
  98. package/docs/operations/radar.md +4646 -0
  99. package/docs/operations/sankey.md +3210 -0
  100. package/docs/operations/scatter.md +6075 -0
  101. package/docs/operations/shape.md +315 -0
  102. package/docs/operations/simpleTextObject.md +706 -0
  103. package/docs/operations/slider.md +230 -0
  104. package/docs/operations/table.md +8790 -0
  105. package/docs/operations/tree.md +2874 -0
  106. package/docs/operations/treemap.md +3619 -0
  107. package/docs/operations/waterfall.md +2938 -0
  108. package/docs/operations/word-cloud.md +3071 -0
  109. package/getters.js +18 -0
  110. package/index.js +1183 -0
  111. package/metadata.js +20 -0
  112. package/operations.js +64 -0
  113. package/package.json +191 -4
  114. package/src/definitions/index.d.ts +2 -0
  115. package/src/definitions/shared/index.d.ts +5 -0
  116. package/src/definitions/shared/lib/available-fields.d.ts +36 -0
  117. package/src/definitions/shared/lib/compilers/index.d.ts +7 -0
  118. package/src/definitions/shared/lib/registry/compile.d.ts +2 -0
  119. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +587 -0
  120. package/src/definitions/shared/lib/registry/index.d.ts +3 -0
  121. package/src/definitions/shared/lib/registry/validation.d.ts +3 -0
  122. package/src/definitions/shared/lib/schemas/app-filter-bar.schema.d.ts +22 -0
  123. package/src/definitions/shared/lib/schemas/bar.schema.d.ts +73 -0
  124. package/src/definitions/shared/lib/schemas/broad-chart.schema.d.ts +68 -0
  125. package/src/definitions/shared/lib/schemas/common.schema.d.ts +304 -0
  126. package/src/definitions/shared/lib/schemas/filter.schema.d.ts +22 -0
  127. package/src/definitions/shared/lib/schemas/index.d.ts +9 -0
  128. package/src/definitions/shared/lib/schemas/line.schema.d.ts +72 -0
  129. package/src/definitions/shared/lib/schemas/number.schema.d.ts +21 -0
  130. package/src/definitions/shared/lib/schemas/object.schema.d.ts +215 -0
  131. package/src/definitions/shared/lib/schemas/table.schema.d.ts +458 -0
  132. package/src/definitions/shared/lib/types/compilation.types.d.ts +36 -0
  133. package/src/definitions/shared/lib/types/definition.types.d.ts +2 -0
  134. package/src/definitions/shared/lib/types/descriptor.types.d.ts +39 -0
  135. package/src/definitions/shared/lib/types/index.d.ts +3 -0
  136. package/src/getters/index.d.ts +30 -0
  137. package/src/index.d.ts +4 -0
  138. package/src/metadata/index.d.ts +4 -0
  139. package/src/operations/index.d.ts +30 -0
  140. package/src/registry/index.d.ts +6 -0
  141. package/src/runtime/index.d.ts +2 -0
  142. package/src/types.d.ts +307 -0
  143. package/src/visualization-catalog.d.ts +82 -0
  144. package/src/web-components/index.d.ts +12 -0
  145. package/styles.css +2 -0
@@ -0,0 +1,411 @@
1
+ import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { Do as t, Eo as n, La as r, No as i, Ta as a, Ti as o, Xa as s, Xs as c, Ya as l, pc as u, qs as d, ti as f, yn as p } from "./interfaces-VUY4_yVO.js";
3
+ import { I as m, Ki as h, P as g, R as _, W as v, Zt as y, fn as b, wi as x, xn as S } from "./utils-Ba9T0TqC.js";
4
+ import { Rn as C, zn as w } from "./event-bus-KiSiCJrC.js";
5
+ import { a as T } from "./src-Cum_2NLV.js";
6
+ import { At as E, Bt as D, It as ee, Jt as te, M as ne, Mt as re, Nt as ie, Ot as O, Qt as k, St as ae, Wt as A, X as j, Yt as M, gt as N, ht as P, i as oe, in as F, j as se, nn as I, qt as L, t as ce, un as R, zt as z } from "./escobar-BGqT1EsE.js";
7
+ import { t as B } from "./coloring-C16AUZEi.js";
8
+ import { t as V } from "./debounce-fn-CUixuz45.js";
9
+ import { t as H } from "./set-coloring-datafield-B3uIS1Pe.js";
10
+ var U = 100, W = (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
+ }, G = (e, t) => {
23
+ let n = null, r = V((r, i) => {
24
+ let a = W(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
+ }, U), i = V((r) => {
27
+ n &&= (t(e, "mouseleave", n.key, r, n), null);
28
+ }, U);
29
+ return {
30
+ type: "native",
31
+ key: "action-events-interaction",
32
+ events: {
33
+ click(n) {
34
+ let r = W(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(h()), le = t.Rectangle, q = (e) => ({
46
+ shape: e?.heatMapSettings?.shape ?? le,
47
+ minSize: e?.heatMapSettings?.minSize ?? .1,
48
+ maxSize: e?.heatMapSettings?.maxSize ?? 1
49
+ }), ue = (e, t, n, r, i, a, o, s) => {
50
+ let c = [], { shape: l } = q(e), u = `${R.Point}-${l}`;
51
+ if ((e?.enableEmitEvents ?? !1) && s) {
52
+ let e = G(u, s);
53
+ c.push(e);
54
+ }
55
+ return {
56
+ ...n,
57
+ interactions: n.interactions ? [...n.interactions, ...c] : [...c]
58
+ };
59
+ }, de = (e, t, n) => {
60
+ let r = e.dimensions.filter(o), i = r.filter((e) => e.role === l.HEAT_MAP_HORIZONTAL), a = r.filter((e) => e.role === l.HEAT_MAP_VERTICAL), s = i[0], c = a[0], [u, d] = ie([{
61
+ showAxisTooltip: e?.axes?.dimension?.showAxisTooltip,
62
+ formatter: s?.formatter,
63
+ scale: M(e),
64
+ key: O.Dimension,
65
+ settings: { direction: E(e) }
66
+ }, {
67
+ showAxisTooltip: e?.axes?.secondaryDimension?.showAxisTooltip,
68
+ formatter: c?.formatter,
69
+ scale: k.YAxisScale,
70
+ key: O.DimensionSec,
71
+ settings: {
72
+ direction: re(e),
73
+ isVerticalDimension: !0
74
+ }
75
+ }]);
76
+ return {
77
+ ...n,
78
+ components: [...n.components ?? [], ...u],
79
+ interactions: [...n.interactions ?? [], ...d]
80
+ };
81
+ }, fe = (e, t, n, a, s, c, u, d) => {
82
+ let p = [], m = [], h = [];
83
+ if (d) {
84
+ let e = ee(R.Text, d);
85
+ h.push(e);
86
+ }
87
+ let g = e.dimensions.filter((e) => e.role === l.HEAT_MAP_HORIZONTAL), _ = g.filter(o), v = e.dimensions.filter((e) => e.role === l.HEAT_MAP_VERTICAL), y = v.filter(o), 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 === r.HEAT_MAP_COLOR), T = w.filter(o), E = {};
94
+ if (S) {
95
+ let t = e.axes?.dimension || E, n = t.secondaryAxis ? i.Top : i.Bottom;
96
+ if (p.push(z(k.XAxisScale, t, b, n, S.formatter, c)), t.showAxisName) {
97
+ let r = f(g, e.enableAlternate, c?.isPrintMode);
98
+ m.push(D(_, r, n, b, t.colors?.title, t.axisTitle ? t.axisTitle : L(S, u), t.titleFontSize));
99
+ }
100
+ }
101
+ if (C) {
102
+ let t = e.axes?.secondaryDimension || E, n = t.secondaryAxis ? i.Right : i.Left;
103
+ if (p.push(z(k.YAxisScale, t, b, n, C.formatter, c)), t.showAxisName) {
104
+ let r = f(v, e.enableAlternate, c?.isPrintMode);
105
+ m.push(D(y, r, n, b, t.colors?.title, t.axisTitle ? t.axisTitle : L(C, u), t.titleFontSize));
106
+ }
107
+ }
108
+ if (w.length > 1) {
109
+ let t = e.axes?.primaryMeasure || {}, n = f(w, e.enableAlternate, c?.isPrintMode);
110
+ m.push(D(T, n, i.Right, x, t.colors?.title, t.axisTitle, t.titleFontSize));
111
+ }
112
+ return {
113
+ ...n,
114
+ components: [
115
+ ...n.components,
116
+ ...p,
117
+ ...m
118
+ ],
119
+ interactions: n.interactions ? [...n.collections, ...h] : [...h]
120
+ };
121
+ }, pe = /* @__PURE__ */ e(p()), me = (e) => (t, n) => t.value === e ? -1 : +(n.value === e), he = (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
+ }, ge = (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
+ }, _e = (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, r) => {
134
+ let i = r?.sortingOrder.findIndex((t) => u(t.dataItem) === u(e));
135
+ if (i < 0) return;
136
+ let a = r?.sortingOrder[i], o = r?.sortingOrder.slice(0, i).filter((e) => e.fieldType === "measure");
137
+ if (a) {
138
+ let e, i = [];
139
+ r?.topN?.enabled && r.topN.showOthers && ((0, pe.default)(r.topN.dimensionIdx) || r.topN.dimensionIdx === t) && (e = r.topN.othersPosition === w.First ? me(r.topN.othersLabel?.stringLabel ?? "Others") : r.topN.othersPosition === w.Last ? he(r.topN.othersLabel?.stringLabel ?? "Others") : void 0, e && i.push(e));
140
+ let s = {};
141
+ return o.forEach((e, t) => {
142
+ let r = `m${t}`;
143
+ i.push(J(r, e.sortDirection === n.Asc ? 1 : -1)), s[r] = {
144
+ field: u(e.dataItem),
145
+ reduce: _e(e.dataItem)
146
+ };
147
+ }), i.push(J("", a.sortDirection === n.Asc ? 1 : -1)), {
148
+ props: s,
149
+ sort: ge(i)
150
+ };
151
+ }
152
+ }, ve = (e, t, n) => {
153
+ let i = e.dimensions.filter(o), a = e.measures.filter(o), s = i.filter((e) => e.role === l.HEAT_MAP_HORIZONTAL), d = i.filter((e) => e.role === l.HEAT_MAP_VERTICAL), f = a.filter((e) => e.role === r.HEAT_MAP_COLOR), p = a.filter((e) => e.role === r.HEAT_MAP_SIZE), m = s[0], h = d[0], g = f[0], _ = p[0], { coloring: v } = e || {}, y = v?.fieldId;
154
+ e.coloring?.type === c.Gradient && (y ||= u(g.dataItem)), y && P(n, 0, { color: { field: y } });
155
+ let b = ae(H(e, y), t, {});
156
+ if (m) {
157
+ let t = Y(m.dataItem, 0, e.querySettings);
158
+ b[k.XAxisScale] = {
159
+ data: {
160
+ extract: {
161
+ field: u(m.dataItem),
162
+ trackBy: (e) => e,
163
+ reduce: "first",
164
+ props: t?.props
165
+ },
166
+ sort: t?.sort
167
+ },
168
+ type: F.Band
169
+ };
170
+ }
171
+ if (h) {
172
+ let t = Y(h.dataItem, 1, e.querySettings);
173
+ b[k.YAxisScale] = {
174
+ data: {
175
+ extract: {
176
+ field: u(h.dataItem),
177
+ trackBy: (e) => e,
178
+ reduce: "first",
179
+ props: t?.props
180
+ },
181
+ sort: t?.sort
182
+ },
183
+ type: F.Band
184
+ };
185
+ }
186
+ let x = u(g.dataItem);
187
+ if (b[x] = { data: { field: x } }, _) {
188
+ let e = u(_.dataItem);
189
+ b[e] = {
190
+ type: F.Linear,
191
+ data: { extract: { field: e } }
192
+ };
193
+ }
194
+ return {
195
+ ...n,
196
+ scales: b
197
+ };
198
+ }, X = /* @__PURE__ */ function(e) {
199
+ return e.measure = "measure", e.group = "group", e.size = "size", e;
200
+ }({}), ye = (e, t, n) => {
201
+ let i = e.dimensions.filter(o), a = e.measures.filter(o), s = ne((e.supportingMeasures ?? []).filter(o)), c = i.filter((e) => e.role === l.HEAT_MAP_HORIZONTAL), d = i.filter((e) => e.role === l.HEAT_MAP_VERTICAL), f = a.filter((e) => e.role === r.HEAT_MAP_COLOR), p = a.filter((e) => e.role === r.HEAT_MAP_SIZE);
202
+ if (!i.length) return n;
203
+ let m = c[0], h = d[0], g = f[0], _ = p[0], v = u(g?.dataItem), y = u(_?.dataItem), b = u(m?.dataItem), x = u(h?.dataItem), S = [{
204
+ key: k.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
+ ...s
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
+ ...n,
218
+ collections: S
219
+ };
220
+ }, Z = (e, t, n, i, a, s) => {
221
+ let l = e.measures.filter(o), d = l.filter((e) => e.role === r.HEAT_MAP_COLOR), f = l.filter((e) => e.role === r.HEAT_MAP_SIZE), p = d[0], m = f[0], { shape: h, minSize: g, maxSize: _ } = q(e), v = _;
222
+ m && (v = (e) => e.resources.scale(u(m.dataItem))(e.datum.size.value) * (_ - g) + g);
223
+ let y = new B(e, t, a?.[0]?.itemsNotAffectedByFiltering), b = {
224
+ type: R.Point,
225
+ key: `${R.Point}-${h}`,
226
+ data: { collection: k.Collection },
227
+ settings: {
228
+ x: { scale: k.XAxisScale },
229
+ y: {
230
+ scale: k.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 === c.Single ? u(p?.dataItem) : null
241
+ }),
242
+ shape: h,
243
+ size: v
244
+ },
245
+ animations: {
246
+ enabled: !0,
247
+ presetId: "simple-opacity"
248
+ },
249
+ brush: A(["", X.group], s)
250
+ };
251
+ return {
252
+ ...n,
253
+ components: [...n.components, b]
254
+ };
255
+ }, Q = {
256
+ top: 0,
257
+ bottom: 0,
258
+ left: 2,
259
+ right: 2
260
+ }, be = (e, t, n, r) => {
261
+ let i;
262
+ return u(e.dataItem) === u(n.dataItem) ? i = r?.measure : u(t.dataItem) === u(n.dataItem) && (i = r?.size), i ? i.value === null ? "-" : i.label ?? "" : "";
263
+ }, xe = (e, t, n, r) => {
264
+ if (u(e.dataItem) === u(n.dataItem)) return r.measure?.value;
265
+ if (u(t.dataItem) === u(n.dataItem)) return r.size?.value;
266
+ }, Se = (e, n, i) => {
267
+ let a, c = e.measures.filter(o), l = c.filter((e) => e.role === r.HEAT_MAP_COLOR), u = c.filter((e) => e.role === r.HEAT_MAP_SIZE), d = l[0], f = u[0], { shape: p } = q(e), m;
268
+ switch (p) {
269
+ case t.Circle:
270
+ m = I.Circle;
271
+ break;
272
+ case t.Square:
273
+ case t.Rectangle:
274
+ case t.Bar:
275
+ m = I.Rect;
276
+ break;
277
+ default: m = I.Path;
278
+ }
279
+ if (d?.dataLabels?.show) a = d;
280
+ else if (f?.dataLabels?.show) a = f;
281
+ else return i;
282
+ let h = {
283
+ type: R.Labels,
284
+ key: "heat-map-label",
285
+ settings: { sources: [{
286
+ component: `${R.Point}-${p}`,
287
+ selector: m,
288
+ strategy: {
289
+ type: "bar",
290
+ settings: {
291
+ direction: "right",
292
+ fontFamily: n.fonts.general.fontFamily,
293
+ fontSize: te(a.dataLabels?.size),
294
+ labels: [{
295
+ label({ data: e, formatter: t }) {
296
+ if (!e) return "";
297
+ let n = be(d, f, a, e);
298
+ if (s(a.formatter)) {
299
+ let t = xe(d, f, a, e);
300
+ return t === null ? "-" : t === void 0 ? "" : b(a.formatter.format, a.formatter)(t, void 0, e);
301
+ }
302
+ return a.formatter && t && n && n !== "-" ? t(a.formatter)(n) : n;
303
+ },
304
+ placements: [{
305
+ position: C.Inside,
306
+ fill: "#fff",
307
+ align: .5,
308
+ justify: .5,
309
+ padding: Q
310
+ }, {
311
+ position: C.Inside,
312
+ fill: "#000",
313
+ align: .5,
314
+ justify: .5,
315
+ padding: Q
316
+ }]
317
+ }]
318
+ }
319
+ }
320
+ }] },
321
+ animations: {
322
+ enabled: !0,
323
+ presetId: "chart-labels"
324
+ }
325
+ };
326
+ return {
327
+ ...i,
328
+ components: [...i?.components ?? [], h]
329
+ };
330
+ }, Ce = (e, t, n) => {
331
+ let { shape: r } = q(e), i = `${R.Point}-${r}`;
332
+ return j(e, t, n, {
333
+ filter: (e) => e.filter((e) => e.key === i),
334
+ placement: {
335
+ type: "pointer",
336
+ area: "target"
337
+ }
338
+ });
339
+ }, we = class extends se {
340
+ constructor() {
341
+ super([
342
+ ye,
343
+ ve,
344
+ fe,
345
+ Z,
346
+ N,
347
+ Ce,
348
+ Se,
349
+ de,
350
+ ue
351
+ ]);
352
+ }
353
+ preCompile(e) {
354
+ let t = e.dimensions.filter(o), n = e.measures.filter(o), i = t.filter((e) => e.role === l.HEAT_MAP_HORIZONTAL), a = t.filter((e) => e.role === l.HEAT_MAP_VERTICAL), s = n.filter((e) => e.role === r.HEAT_MAP_COLOR), c = i[0], u = a[0], d = s[0];
355
+ if (!c || !u || !d) throw Error("Charts w/o horizontal or vertical dimension or color measure are not supported ATM.");
356
+ }
357
+ }, Te = ({ 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, d] = 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 (d) {
368
+ let e = u(d);
369
+ a = n.data[e].value, o = d.name;
370
+ }
371
+ Te({
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
+ }, Ee = (e) => T({ id: "onCellLeave" }, { vBackendAPI: e }), De = () => {
386
+ let e = S(), t = _(), n = v();
387
+ return (0, K.useCallback)((r, i, a, o, s) => {
388
+ let c;
389
+ switch (i) {
390
+ case "click":
391
+ r === R.Text ? c = ce(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
+ Ee(e);
398
+ break;
399
+ }
400
+ c && e.emitEvent(c.action, c.payload);
401
+ }, [e, t]);
402
+ }, Oe = x(), ke = y(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
403
+ let o = g(), [s] = (0, K.useState)(() => new we()), c = m(), l = De(), u = t || a, f = s.compile(e, u, n, r, i, d.HeatMap, o, c, l);
404
+ return f ? /* @__PURE__ */ (0, Oe.jsx)(oe, {
405
+ config: i,
406
+ definition: f,
407
+ size: r,
408
+ vSpec: e
409
+ }) : null;
410
+ });
411
+ export { ke as HeatMapChart };
@@ -0,0 +1,6 @@
1
+ import "./rolldown-runtime-DleVn1XH.js";
2
+ import { Ki as e, Zt as t, wi as n } from "./utils-Ba9T0TqC.js";
3
+ import { n as r } from "./standalone-DS9T0FZ-.js";
4
+ e();
5
+ var i = n(), a = t((e) => /* @__PURE__ */ (0, i.jsx)(r, { ...e }));
6
+ export { a as HistogramChart };