@astrato-io/visualizations 0.6.4 → 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 (149) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/THIRD_PARTY_NOTICES.md +94 -4
  3. package/chunks/ClickAwayListener-BbeNMAvj.js +52 -0
  4. package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-B1FeWaen.js} +54 -54
  5. package/chunks/app-filter-bar.compiler-BGJ7HAbr.js +64 -0
  6. package/chunks/bar.compiler-CT0ZbQKc.js +374 -0
  7. package/chunks/{src-Cum_2NLV.js → builder-B6dWSIdD.js} +5779 -5635
  8. package/chunks/{coloring-C16AUZEi.js → coloring-B1XAfg6b.js} +234 -233
  9. package/chunks/{src-BC7cGcJ-.js → definitions-D3OVqmXl.js} +438 -360
  10. package/chunks/{escobar-BGqT1EsE.js → escobar-eDjtGpkC.js} +4645 -4619
  11. package/chunks/filter.compiler-DBsyRBJt.js +70 -0
  12. package/chunks/{filtering-Yq4DEa0t.js → filtering-tqjAyJH5.js} +432 -313
  13. package/chunks/{grouping-type-BX_9Ix5q.js → grouping-type-On4s9Thj.js} +1 -1
  14. package/chunks/handlers-VTBfIZYZ.js +13072 -0
  15. package/chunks/isEqual-BDxAhUo8.js +7514 -0
  16. package/chunks/line.compiler-CzdM5Ld0.js +198 -0
  17. package/chunks/{metadata-CPXdYoln.js → metadata-BGElBy5Z.js} +1 -1
  18. package/chunks/number.compiler-G-R7y16P.js +53 -0
  19. package/chunks/{src-C0LgoUWY.js → operations-CTNUX6Sy.js} +9576 -9432
  20. package/chunks/{range-DrzdfBX4.js → range-CiwTbMig.js} +2 -2
  21. package/chunks/{registry-CExpGJ1N.js → registry-CsQQzukD.js} +153 -153
  22. package/chunks/{requirements-DNhuShLS.js → requirements-DYjZCFyf.js} +1 -1
  23. package/chunks/{shared-CKDL4hx9.js → shared-CBvcC5YV.js} +460 -413
  24. package/chunks/{standalone-D5vnf-9y.js → standalone-0M4HlmDW2.js} +823 -822
  25. package/chunks/standalone-0ashe9w1.js +411 -0
  26. package/chunks/{standalone-C85u7U6I.js → standalone-B7jax8wa.js} +93 -94
  27. package/chunks/standalone-BK0VYU-l.js +463 -0
  28. package/chunks/{standalone-BDCwI6Hn.js → standalone-BMIbT1b2.js} +815 -815
  29. package/chunks/standalone-BZV5vOwA.js +6 -0
  30. package/chunks/standalone-BhDrWj4p.js +1980 -0
  31. package/chunks/{standalone-CNyNHKVx.js → standalone-BtSHCp2U2.js} +97 -98
  32. package/chunks/{standalone-CDQnr6qT.js → standalone-BvaKdky9.js} +95 -96
  33. package/chunks/standalone-BwtM31-f.js +2 -0
  34. package/chunks/{standalone-CY57qwZ-.js → standalone-C3gg736V.js} +153 -153
  35. package/chunks/{standalone-DFPva_ku.js → standalone-CC1VUjO32.js} +60 -60
  36. package/chunks/{standalone-CCNtaJ7s.js → standalone-C_rYnZ0N.js} +41 -41
  37. package/chunks/{standalone-CZynjFG7.js → standalone-CoLrAxRV.js} +3701 -3482
  38. package/chunks/{standalone-jiz0L2Dg.js → standalone-DC-aUgXC.js} +104 -104
  39. package/chunks/standalone-DCtRoTWg.js +675 -0
  40. package/chunks/standalone-DUDFTBqL.js +833 -0
  41. package/chunks/standalone-DhZkX9Td.js +2 -0
  42. package/chunks/{standalone-Dx3MLlrO.js → standalone-DtLElfuM.js} +141 -141
  43. package/chunks/{standalone-BmfMt74U.js → standalone-G9Q4Uczu.js} +192 -192
  44. package/chunks/{standalone-BH5NqDwp.js → standalone-JuLF-OoH.js} +390 -391
  45. package/chunks/standalone-_DeX21JJ.js +383 -0
  46. package/chunks/{standalone-lBm9hQ-q.js → standalone-gFhKZh8m.js} +34 -34
  47. package/chunks/standalone-tDNy-SFH.js +281 -0
  48. package/chunks/{standalone-rJ45Zfl1.js → standalone-v1oxfU20.js} +10 -10
  49. package/chunks/{standalone-BYm1UjLr.js → standalone-vzBY6q0I2.js} +18 -18
  50. package/chunks/table.compiler-tb914oj3.js +222 -0
  51. package/chunks/{ui-D1HQNIBy.js → ui-DQWtv2iM.js} +13485 -3973
  52. package/chunks/{useFieldName-oqQ3bvnO.js → useFieldName-BvdcoJRl.js} +1 -1
  53. package/chunks/{utils-Ba9T0TqC.js → utils-Bg7K-t6K.js} +7306 -6024
  54. package/chunks/{src-DvX5LU9T.js → view-Bn83C8d9.js} +2555 -4831
  55. package/definitions.js +3 -3
  56. package/docs/operations/astrato-app-filter-bar.md +17 -17
  57. package/docs/operations/bar.md +989 -1071
  58. package/docs/operations/combo.md +717 -738
  59. package/docs/operations/date-picker.md +25 -25
  60. package/docs/operations/distribution-gauge.md +471 -607
  61. package/docs/operations/dot.md +787 -879
  62. package/docs/operations/filter.md +139 -163
  63. package/docs/operations/gauge.md +491 -627
  64. package/docs/operations/heatMap.md +834 -916
  65. package/docs/operations/histogram.md +166 -180
  66. package/docs/operations/iframe.md +5 -5
  67. package/docs/operations/image.md +16 -16
  68. package/docs/operations/index.md +12 -12
  69. package/docs/operations/line.md +811 -888
  70. package/docs/operations/number.md +470 -536
  71. package/docs/operations/pie.md +825 -958
  72. package/docs/operations/radar.md +599 -679
  73. package/docs/operations/sankey.md +462 -584
  74. package/docs/operations/scatter.md +823 -929
  75. package/docs/operations/shape.md +34 -34
  76. package/docs/operations/simpleTextObject.md +18 -25
  77. package/docs/operations/slider.md +33 -43
  78. package/docs/operations/table.md +1160 -1150
  79. package/docs/operations/tree.md +354 -361
  80. package/docs/operations/treemap.md +545 -637
  81. package/docs/operations/waterfall.md +369 -379
  82. package/docs/operations/word-cloud.md +512 -583
  83. package/getters.js +3 -3
  84. package/index.js +51 -51
  85. package/metadata.js +3 -3
  86. package/operations.js +7 -7
  87. package/package.json +80 -86
  88. package/src/definitions/index.d.ts +2 -2
  89. package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
  90. package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
  91. package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
  92. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1341 -0
  93. package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
  94. package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
  95. package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
  96. package/src/definitions/model/definitions/index.d.ts +23 -0
  97. package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
  98. package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
  99. package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
  100. package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
  101. package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
  102. package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
  103. package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +6 -6
  104. package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
  105. package/src/definitions/model/definitions/types/index.d.ts +3 -0
  106. package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
  107. package/chunks/Radio-Ciu-F4CU.js +0 -957
  108. package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
  109. package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
  110. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
  111. package/chunks/bar.compiler-oqaPzIut.js +0 -370
  112. package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
  113. package/chunks/event-bus-KiSiCJrC.js +0 -2683
  114. package/chunks/filter.compiler-CuLtc_02.js +0 -60
  115. package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
  116. package/chunks/interfaces-VUY4_yVO.js +0 -8742
  117. package/chunks/line-settings-DfYTUyPz.js +0 -4
  118. package/chunks/line.compiler-BpA_6Tc7.js +0 -188
  119. package/chunks/number.compiler-DbkWcG4S.js +0 -44
  120. package/chunks/pie-uv42Eqal.js +0 -10
  121. package/chunks/src-Dun_jXtz.js +0 -10295
  122. package/chunks/standalone-87YV_m9n.js +0 -687
  123. package/chunks/standalone-BLVAWLNJ.js +0 -385
  124. package/chunks/standalone-BPomtAVs.js +0 -2
  125. package/chunks/standalone-BXyBcUOQ.js +0 -2
  126. package/chunks/standalone-BllF4rDp.js +0 -383
  127. package/chunks/standalone-BqWyrnZI.js +0 -281
  128. package/chunks/standalone-DQxxNwF8.js +0 -675
  129. package/chunks/standalone-DS9T0FZ-.js +0 -830
  130. package/chunks/standalone-DzixzZAL.js +0 -411
  131. package/chunks/standalone-QJ1kKMnO.js +0 -6
  132. package/chunks/table.compiler-BrXkm4Fz.js +0 -213
  133. package/chunks/toInteger-DVZr-D1j.js +0 -11
  134. package/chunks/treemap-x_zmJoG7.js +0 -23
  135. package/chunks/types-dVVCsDWD.js +0 -4
  136. package/chunks/view-CLqWMV7Z.js +0 -156
  137. package/src/definitions/shared/index.d.ts +0 -5
  138. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
  139. package/src/definitions/shared/lib/registry/index.d.ts +0 -3
  140. package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
  141. package/src/definitions/shared/lib/types/index.d.ts +0 -3
  142. package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
  143. package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
  144. package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
  145. package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
  146. package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
  147. package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
  148. /package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +0 -0
  149. /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
@@ -1,411 +0,0 @@
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 };
@@ -1,6 +0,0 @@
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 };
@@ -1,213 +0,0 @@
1
- import { Js as e, rs as t, tc as n } from "./interfaces-VUY4_yVO.js";
2
- import { qu as r } from "./src-Dun_jXtz.js";
3
- import { p as i } from "./src-C0LgoUWY.js";
4
- import { A as a, C as o, d as s, g as c, h as l, i as u, o as d, p as f, s as p, t as m, u as h, v as g, w as _, x as v, y } from "./shared-CKDL4hx9.js";
5
- import { a as b, r as x, t as S } from "./data-item-resolution-1lvYB5ln.js";
6
- var C = {
7
- all: t.ShowAll,
8
- auto: t.Auto,
9
- horizontal: t.ShowHorizontal,
10
- none: t.NoBorders,
11
- vertical: t.ShowVertical
12
- }, w = (e) => e.flatMap(([e, t]) => t === void 0 ? [] : [{
13
- name: e,
14
- payload: t
15
- }]), T = (e) => e ? w([
16
- [i.SET_TABLE_COLUMN_WIDTH_BEHAVIOR, e.columnWidthBehavior],
17
- [i.SET_TABLE_FIXED_ROW_HEIGHT_ENABLED, e.rowHeight !== void 0 || void 0],
18
- [i.SET_TABLE_FIXED_ROW_HEIGHT_VALUE, e.rowHeight]
19
- ]) : [], E = (e) => e ? w([
20
- [i.SET_TABLE_BACKGROUND_TYPE, e.type],
21
- [i.SET_TABLE_BACKGROUND_COLOR, e.color],
22
- [i.SET_TABLE_ODD_BACKGROUND_COLOR, e.oddColor],
23
- [i.SET_TABLE_EVEN_BACKGROUND_COLOR, e.evenColor]
24
- ]) : [], D = (e) => e ? w([
25
- [i.SET_TABLE_BODY_FONT_FAMILY, e.fontFamily],
26
- [i.SET_TABLE_BODY_FONT_SIZE, e.fontSize],
27
- [i.SET_TABLE_ALL_COLUMNS_FONT_COLOR, e.fontColor],
28
- [i.SET_TABLE_ALL_COLUMNS_FONT_STYLE, e.fontStyle],
29
- [i.SET_TABLE_ALL_COLUMNS_HORIZONTAL_ALIGN, e.horizontalAlign],
30
- [i.SET_TABLE_ALL_COLUMNS_VERTICAL_ALIGN, e.verticalAlign]
31
- ]) : [], O = (e) => e ? w([
32
- [i.SET_TABLE_HEADER_BACKGROUND_COLOR, e.backgroundColor],
33
- [i.SET_TABLE_HEADER_BORDER_COLOR, e.borderColor],
34
- [i.SET_TABLE_HEADER_FONT_COLOR, e.fontColor],
35
- [i.SET_TABLE_HEADER_FONT_FAMILY, e.fontFamily],
36
- [i.SET_TABLE_HEADER_FONT_SIZE, e.fontSize],
37
- [i.SET_TABLE_HEADER_FONT_STYLE, e.fontStyle],
38
- [i.SET_TABLE_HEADER_RESPONSIVE_HEIGHT, e.responsiveHeight]
39
- ]) : [], k = (e) => e ? w([
40
- [i.SET_TABLE_BORDER_ENABLED, e.enabled],
41
- [i.SET_TABLE_BORDER_COLOR, e.color],
42
- [i.SET_TABLE_BORDER_LINE_STYLE, e.lineStyle],
43
- [i.SET_TABLE_BORDER_RADIUS, e.radius],
44
- [i.SET_TABLE_BORDER_STROKE_WIDTH, e.strokeWidth],
45
- [i.SET_TABLE_COLUMN_BORDERS, e.dividers === void 0 ? void 0 : C[e.dividers]],
46
- [i.SET_TABLE_COLUMN_BORDER_COLOR, e.dividerColor]
47
- ]) : [], A = (e) => e ? w([
48
- [i.SET_TABLE_HIGHLIGHT_MODE, e.mode],
49
- [i.SET_TABLE_HIGHLIGHT_BACKGROUND_COLOR, e.backgroundColor],
50
- [i.SET_TABLE_HIGHLIGHT_TEXT_COLOR, e.textColor]
51
- ]) : [], j = (e) => e ? [
52
- ...T(e.layout),
53
- ...E(e.background),
54
- ...D(e.body),
55
- ...O(e.header),
56
- ...k(e.borders),
57
- ...A(e.highlight)
58
- ] : [], M = (e) => e ? w([
59
- [i.SET_TABLE_TOTALS_ENABLED, e.enabled],
60
- [i.SET_TABLE_TOTALS_SHOW_RECORDS_COUNT, e.showRecordsCount],
61
- [i.SET_TABLE_TOTALS_APPLY_TO, e.applyTo],
62
- [i.SET_TABLE_TOTALS_BACKGROUND_COLOR, e.style?.backgroundColor],
63
- [i.SET_TABLE_TOTALS_FONT_COLOR, e.style?.fontColor],
64
- [i.SET_TABLE_TOTALS_FONT_STYLE, e.style?.fontStyle],
65
- [i.SET_TABLE_TOTALS_POSITION, e.style?.position],
66
- [i.SET_TABLE_TOTALS_RESPONSIVE_HEIGHT, e.style?.responsiveHeight]
67
- ]) : [], N = (e, t) => l(e, t.flatMap((t) => t.role !== "dimension" || t.showNullValues === void 0 ? [] : [{
68
- name: i.SET_COLUMN_SHOW_NULL_VALUES,
69
- payload: {
70
- ...y(e.resolvedRefs[t.ref]),
71
- showNullValues: t.showNullValues
72
- }
73
- }]), ["data"]), P = (e, t, n, r = !1) => ({
74
- ...e,
75
- path: n,
76
- role: t,
77
- topDimension: r
78
- }), F = (e) => "columns" in e ? [{
79
- items: e.columns.map((e, t) => P(e, e.role, [
80
- "data",
81
- "columns",
82
- t
83
- ])),
84
- path: ["data", "columns"]
85
- }] : e.structure === "expandable" ? [{
86
- items: e.dimensions.map((e, t) => P(e, "dimension", [
87
- "data",
88
- "dimensions",
89
- t
90
- ])),
91
- path: ["data", "dimensions"]
92
- }, {
93
- items: e.measures.map((e, t) => P(e, "measure", [
94
- "data",
95
- "measures",
96
- t
97
- ])),
98
- path: ["data", "measures"]
99
- }] : [
100
- {
101
- items: e.rowDimensions.map((e, t) => P(e, "dimension", [
102
- "data",
103
- "rowDimensions",
104
- t
105
- ])),
106
- path: ["data", "rowDimensions"]
107
- },
108
- {
109
- items: e.columnDimensions.map((e, t) => P(e, "dimension", [
110
- "data",
111
- "columnDimensions",
112
- t
113
- ], !0)),
114
- path: ["data", "columnDimensions"]
115
- },
116
- {
117
- items: e.measures.map((e, t) => P(e, "measure", [
118
- "data",
119
- "measures",
120
- t
121
- ])),
122
- path: ["data", "measures"]
123
- }
124
- ], I = (t) => {
125
- if (!(!("structure" in t) || t.structure === void 0)) switch (t.structure) {
126
- case "normal": return e.Normal;
127
- case "expandable": return e.Hierarchical;
128
- case "pivot": return e.Pivot;
129
- }
130
- }, L = (e, t, r) => {
131
- let i = [
132
- "formatType",
133
- "formatString",
134
- "currency",
135
- "currencyIsPrefix",
136
- "negativeType"
137
- ];
138
- return l(e, t.flatMap((t) => {
139
- let a = e.availableFields.find((e) => e.key === t.fieldKey), o = a ? n(a) : t.fieldKey;
140
- return i.flatMap((e) => {
141
- let n = t.format?.[e], i = r[e];
142
- return n !== void 0 && i ? [f(i, o, t.ref, t.path, e, n, t.role)] : [];
143
- });
144
- }), ["data"]);
145
- }, R = async (e) => {
146
- let t = a.safeParse(e.definition);
147
- if (!t.success) return {
148
- issues: _(t.error, e.definition),
149
- success: !1
150
- };
151
- let n = r.safeParse(e.baseVSpec);
152
- if (!n.success) return {
153
- issues: [s("invalid_structure", ["baseVSpec"], "Base table vSpec is invalid.", { details: { issues: n.error.issues } })],
154
- success: !1
155
- };
156
- let f = n.data;
157
- if (!g(f, [
158
- "columns",
159
- "dimensions",
160
- "measures",
161
- "supportingMeasures",
162
- "sortingMeasures"
163
- ])) return {
164
- issues: [s("non_fresh_base_vspec", ["baseVSpec"], "Table definitions require a fresh base vSpec.")],
165
- success: !1
166
- };
167
- let y = t.data, C = F(y.data), w = C.flatMap((e) => e.items), T = [
168
- ...w.flatMap((t) => x(t, e.availableFields, t.path, t.role)),
169
- ...o(C),
170
- ...b(y.filterGroup, e.availableFields),
171
- ...v(y.sorting, w.map((e) => e.ref))
172
- ];
173
- if (T.length) return {
174
- issues: T,
175
- success: !1
176
- };
177
- let E = {
178
- state: h(e, f),
179
- success: !0
180
- }, D = I(y.data);
181
- D !== void 0 && (E = await l(E.state, [{
182
- name: i.SET_TABLE_DATA_STRUCTURE,
183
- payload: D
184
- }], ["data", "structure"]));
185
- for (let t of w) {
186
- if ("issue" in E) return {
187
- issues: [E.issue],
188
- success: !1
189
- };
190
- E = await m(E.state, t, t.role, i.ADD_COLUMN, t.role === "measure" ? S(t, e.availableFields, { columnType: t.role }) : {
191
- columnType: t.role,
192
- key: t.fieldKey,
193
- topDimension: t.topDimension
194
- }, t.path);
195
- }
196
- return "issue" in E || (E = await N(E.state, w), "issue" in E) || (E = await p(E.state, w.filter((e) => e.role === "dimension"), i.SET_COLUMN_TEMPORAL_GROUPING, ["data"]), "issue" in E) || (E = await L(E.state, w, {
197
- currency: i.SET_COLUMN_CURRENCY,
198
- currencyIsPrefix: i.SET_COLUMN_CURRENCY_IS_PREFIX,
199
- formatString: i.SET_COLUMN_FORMAT_STRING,
200
- formatType: i.SET_COLUMN_FORMAT_TYPE,
201
- negativeType: i.SET_COLUMN_NEGATIVE_TYPE
202
- }), "issue" in E) || (E = await l(E.state, j(y.presentation), ["presentation"]), "issue" in E) || (E = await u(E.state, y.filterGroup), "issue" in E) || (E = await d(E.state, y.sorting, i.CHANGE_SORT_ORDER_AND_DIRECTION, i.TOGGLE_SORTING_ITEM), "issue" in E) || (E = await l(E.state, y.limiting?.queryLimit === void 0 ? [] : [{
203
- name: i.SET_QUERY_LIMIT,
204
- payload: y.limiting.queryLimit
205
- }], ["limiting"]), "issue" in E) ? {
206
- issues: [E.issue],
207
- success: !1
208
- } : (E = await l(E.state, M(y.totals), ["totals"]), "issue" in E ? {
209
- issues: [E.issue],
210
- success: !1
211
- } : c(E.state, r));
212
- };
213
- export { R as compileTableVisualizationDefinition };
@@ -1,11 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { i as t } from "./coloring-C16AUZEi.js";
3
- var n = /* @__PURE__ */ e(((e, n) => {
4
- var r = t();
5
- function i(e) {
6
- var t = r(e), n = t % 1;
7
- return t === t ? n ? t - n : t : 0;
8
- }
9
- n.exports = i;
10
- }));
11
- export { n as t };
@@ -1,23 +0,0 @@
1
- var e = "rgba(150, 150, 150, 0.3)", t = {
2
- cellPaddingMin: 0,
3
- cellPaddingMax: 16,
4
- cellRadiusMin: 0,
5
- cellRadiusMax: 16,
6
- headerNumLevelsMin: 0,
7
- headerNumLevelsMax: 5,
8
- labelFontSizeMin: 6,
9
- labelFontSizeMax: 50
10
- }, n = { labeling: {
11
- header: {
12
- show: !0,
13
- numLevels: 1,
14
- showDimensionValue: !0,
15
- showMeasureValue: !1
16
- },
17
- leaf: {
18
- show: !0,
19
- showDimensionValue: !0,
20
- showMeasureValue: !0
21
- }
22
- } };
23
- export { t as n, n as r, e as t };
@@ -1,4 +0,0 @@
1
- var e = /* @__PURE__ */ function(e) {
2
- return e.Stacked = "stacked", e.Groups = "groups", e.Offset = "offset", e.Bars = "bars", e;
3
- }({});
4
- export { e as t };