@astrato-io/visualizations 0.8.0 → 0.10.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.
Files changed (161) hide show
  1. package/README.md +9 -5
  2. package/THIRD_PARTY_NOTICES.md +403 -325
  3. package/VISUALIZATION_DEFINITIONS.md +319 -32
  4. package/chunks/{Button-BrGKp9Nm.js → Button-CCF851ea.js} +10 -10
  5. package/chunks/CircularProgress-yupH6YWs.js +765 -0
  6. package/chunks/FieldTypeIcon-D_MzsdfY.js +22 -0
  7. package/chunks/LinearProgress-CyFjN4px.js +327 -0
  8. package/chunks/{MenuOption-ByRqhRdX.js → MenuOption-CQpT79AP.js} +1391 -1008
  9. package/chunks/Title-C-p4ZarD.js +1804 -0
  10. package/chunks/_createAggregator-BF4qG9XK.js +50 -0
  11. package/chunks/{app-filter-bar.compiler-TwVTeoj5.js → app-filter-bar.compiler-8fxCo2q7.js} +10 -10
  12. package/chunks/bar-layout-DStC-GNV.js +9 -0
  13. package/chunks/{bar.compiler-DuQg8EUb.js → bar.compiler-CQAu8KL8.js} +102 -84
  14. package/chunks/{builder-DEDvNq1k.js → builder-CScg1TOS.js} +156 -60
  15. package/chunks/color-rules-DYJL4fIW.js +15 -0
  16. package/chunks/color-settings-DJFoFTip.js +5 -0
  17. package/chunks/{coloring-CncX_JRX.js → coloring-9jU3s_-p.js} +41 -41
  18. package/chunks/contains-BK-sRXcB.js +21 -0
  19. package/chunks/createSimplePaletteValueFilter-C4hZpCdn.js +2005 -0
  20. package/chunks/defaults-cyNhn37t.js +3 -0
  21. package/chunks/{definitions-BPJQTx16.js → definitions-C4grxhye.js} +612 -400
  22. package/chunks/{escobar-DRhRMYRE.js → escobar-CjirINHP.js} +5354 -5473
  23. package/chunks/{extend-preset-CUFNpmPe.js → extend-preset-D-l9u_we.js} +974 -909
  24. package/chunks/{filter.compiler-w27dlv0C.js → filter.compiler-lji2Acgn.js} +7 -7
  25. package/chunks/{filtering-cc7WqWpg.js → filtering-C1zakrrX.js} +570 -390
  26. package/chunks/handlers-ZviIUC-j.js +15387 -0
  27. package/chunks/{icon-picker-styles-CoJmwTRi.js → icon-picker-styles-Bj80ZUBK.js} +11 -11
  28. package/chunks/isEqual-Ch9OEye3.js +16 -0
  29. package/chunks/isFocusVisible-CgMP0qkR.js +144 -0
  30. package/chunks/label-format-type-C46pzgx7.js +17 -0
  31. package/chunks/{line.compiler-Ct1WhN2p.js → line.compiler-De5fiKuR.js} +6 -6
  32. package/chunks/{logger-DpQtYQnX.js → logger-CKRjhSHQ.js} +77 -66
  33. package/chunks/map.compiler-CKzorLgK.js +345 -0
  34. package/chunks/{metadata-WABZrt7Y.js → metadata-Bb9pTXrq.js} +1 -1
  35. package/chunks/{number.compiler-D8TPly-4.js → number.compiler-CaTmJkmi.js} +4 -4
  36. package/chunks/operations-DZoY50VX.js +31297 -0
  37. package/chunks/{range-Bi-7zT0k.js → range-D1BTmFMp.js} +2 -2
  38. package/chunks/react-dom-Dgv2azN2.js +368 -0
  39. package/chunks/{render-wrappers-OEmtaM8g.js → render-wrappers-_P3xwu5A.js} +1 -1
  40. package/chunks/{requirements-Dvd8jqYF.js → requirements-NHNrR8Ie.js} +55 -53
  41. package/chunks/responsive.styles-FItb913l.js +93 -0
  42. package/chunks/shared-UitWpq1J.js +1331 -0
  43. package/chunks/standalone-B0U6c3su.js +3638 -0
  44. package/chunks/{standalone-we5D5MIn.js → standalone-BBu90BhK.js} +113 -113
  45. package/chunks/standalone-BEekPuA12.js +357 -0
  46. package/chunks/{standalone-BMTCb10X.js → standalone-BOzHA_d4.js} +41 -41
  47. package/chunks/standalone-BR2JuRIC.js +422 -0
  48. package/chunks/{standalone-BGkmozIb.js → standalone-BapqaniK.js} +619 -619
  49. package/chunks/standalone-Bnnr87pc.js +2009 -0
  50. package/chunks/standalone-BwJqDj2Z.js +396 -0
  51. package/chunks/{standalone-BDhPQtzQ.js → standalone-ByKKqT5L.js} +308 -300
  52. package/chunks/{standalone-vBnBS2YC.js → standalone-CRdDZYeM.js} +1788 -1004
  53. package/chunks/standalone-CRfDOO1x.js +287 -0
  54. package/chunks/{standalone-D5Q5ngsD.js → standalone-CVknVdUC.js} +30 -27
  55. package/chunks/standalone-CbPk8bKn.js +580 -0
  56. package/chunks/{standalone-CJvIXsQE.js → standalone-Ck63MZzj.js} +234 -232
  57. package/chunks/{standalone-CM5XcAN5.js → standalone-DCFY1MAV.js} +8075 -7729
  58. package/chunks/{standalone-DW6NT205.js → standalone-DZDGX3aa.js} +168 -168
  59. package/chunks/standalone-DhfgeJIk.js +1012 -0
  60. package/chunks/{standalone-DT0wKji7.js → standalone-DibjA73M.js} +2 -2
  61. package/chunks/{standalone-XuGksArp.js → standalone-DtBk_iUz.js} +9 -8
  62. package/chunks/standalone-DxBAyqAu.js +772 -0
  63. package/chunks/standalone-KMQPsNsq.js +2 -0
  64. package/chunks/standalone-MBLSvsrY.js +2 -0
  65. package/chunks/standalone-U0WJwFlG.js +354 -0
  66. package/chunks/{standalone-C8ZAEutO.js → standalone-swGs70tD.js} +49 -51
  67. package/chunks/standalone-wgFAVnnm.js +355 -0
  68. package/chunks/standalone-xGV0dqPV.js +689 -0
  69. package/chunks/{table.compiler-DMeeHxb6.js → table.compiler-OWSx5MOq.js} +7 -7
  70. package/chunks/{typeof-CJDtcySz.js → typeof-DCq3QgvY.js} +6 -1
  71. package/chunks/useFieldName-B8iCYyw1.js +7 -0
  72. package/chunks/{utils-vdmi_2PK.js → utils-3Igg6xmO.js} +7668 -12779
  73. package/chunks/{view-BuwQugKb.js → view-DdMLZySj.js} +2430 -2110
  74. package/chunks/{visualization-filters-Cc4KU-l-.js → visualization-filters-CzvFHE6M.js} +5205 -4438
  75. package/chunks/with-html-element-DOfkR3C1.js +16094 -0
  76. package/definitions.js +2 -2
  77. package/docs/operations/astrato-app-filter-bar.md +1 -1
  78. package/docs/operations/bar.md +303 -2
  79. package/docs/operations/combo.md +262 -1
  80. package/docs/operations/date-picker.md +1 -1
  81. package/docs/operations/distribution-gauge.md +1 -1
  82. package/docs/operations/dot.md +148 -1
  83. package/docs/operations/filter.md +1 -1
  84. package/docs/operations/gauge.md +1 -1
  85. package/docs/operations/heatMap.md +1 -1
  86. package/docs/operations/histogram.md +262 -1
  87. package/docs/operations/iframe.md +1 -1
  88. package/docs/operations/image.md +1 -1
  89. package/docs/operations/index.md +8 -8
  90. package/docs/operations/line.md +262 -1
  91. package/docs/operations/number.md +1 -1
  92. package/docs/operations/pie.md +1 -1
  93. package/docs/operations/radar.md +1 -1
  94. package/docs/operations/sankey.md +1 -1
  95. package/docs/operations/scatter.md +148 -1
  96. package/docs/operations/shape.md +1 -1
  97. package/docs/operations/simpleTextObject.md +1 -1
  98. package/docs/operations/slider.md +1 -1
  99. package/docs/operations/table.md +439 -157
  100. package/docs/operations/tree.md +1 -1
  101. package/docs/operations/treemap.md +1 -1
  102. package/docs/operations/waterfall.md +1 -1
  103. package/docs/operations/word-cloud.md +1 -1
  104. package/getters.js +2 -2
  105. package/index.js +523 -469
  106. package/metadata.js +2 -2
  107. package/operations.js +5 -5
  108. package/package.json +74 -68
  109. package/src/definitions/index.d.ts +1 -1
  110. package/src/definitions/model/definitions/available-fields.d.ts +2 -2
  111. package/src/definitions/model/definitions/compilers/compile.d.ts +1 -0
  112. package/src/definitions/model/definitions/data-item-resolution.d.ts +3 -3
  113. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +535 -349
  114. package/src/definitions/model/definitions/index.d.ts +2 -1
  115. package/src/definitions/model/definitions/schema-registry.d.ts +406 -101
  116. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +10 -8
  117. package/src/definitions/model/definitions/schemas/common.schema.d.ts +33 -32
  118. package/src/definitions/model/definitions/schemas/index.d.ts +1 -0
  119. package/src/definitions/model/definitions/schemas/line.schema.d.ts +10 -10
  120. package/src/definitions/model/definitions/schemas/map.schema.d.ts +590 -0
  121. package/src/definitions/model/definitions/schemas/number.schema.d.ts +4 -4
  122. package/src/definitions/model/definitions/schemas/object.schema.d.ts +38 -38
  123. package/src/definitions/model/definitions/schemas/table.schema.d.ts +61 -61
  124. package/src/definitions/model/definitions/types/compilation.types.d.ts +7 -2
  125. package/src/definitions/model/definitions/types/definition.types.d.ts +2 -2
  126. package/src/definitions/model/definitions/types/index.d.ts +1 -1
  127. package/src/index.d.ts +1 -1
  128. package/src/operations/index.d.ts +1 -1
  129. package/src/types.d.ts +45 -41
  130. package/src/visualization-catalog.d.ts +26 -26
  131. package/chunks/DefaultPropsProvider-BsfB7QTn.js +0 -257
  132. package/chunks/FieldTypeIcon-Drs6hSJF.js +0 -22
  133. package/chunks/LinearProgress-VtfFx2vJ.js +0 -253
  134. package/chunks/Title-CO5dP1ma.js +0 -1691
  135. package/chunks/ToggleButton-KOBAimC1.js +0 -112
  136. package/chunks/color-rules-CN7TcGrC.js +0 -6
  137. package/chunks/color-settings-3VRlf_Vw.js +0 -6
  138. package/chunks/colorManipulator-D8Pjy1pf.js +0 -45
  139. package/chunks/handlers-TOT-7INo.js +0 -12871
  140. package/chunks/isEqual-B8loyPsC.js +0 -12
  141. package/chunks/label-format-type-weq1XfcX.js +0 -8
  142. package/chunks/operations-Dh4v1Ovt.js +0 -26280
  143. package/chunks/responsive.styles-DSiOGD7u.js +0 -82
  144. package/chunks/shared-Bn4N5QcZ.js +0 -1218
  145. package/chunks/standalone-B55oyW6c.js +0 -689
  146. package/chunks/standalone-BXKRE_Se.js +0 -468
  147. package/chunks/standalone-Bes8srx1.js +0 -354
  148. package/chunks/standalone-BjZp0QMe.js +0 -2
  149. package/chunks/standalone-BlMIwpEe.js +0 -1877
  150. package/chunks/standalone-C8qAelL4.js +0 -2
  151. package/chunks/standalone-CLmGb7nn2.js +0 -355
  152. package/chunks/standalone-CXNP6-xD.js +0 -420
  153. package/chunks/standalone-DLlyRIE6.js +0 -287
  154. package/chunks/standalone-DMcI1afI.js +0 -396
  155. package/chunks/standalone-DN4S1MjT.js +0 -3874
  156. package/chunks/standalone-DYQIQH4c.js +0 -2095
  157. package/chunks/standalone-D__XCp-h.js +0 -1003
  158. package/chunks/standalone-XTgSsTAa.js +0 -354
  159. package/chunks/useFieldName-Cjn9KCVp.js +0 -7
  160. package/chunks/useSlotProps-DLbQp4lc.js +0 -166
  161. package/chunks/with-html-element-D0uY2zjI.js +0 -7328
@@ -0,0 +1,50 @@
1
+ import { t as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { M as t, Tr as n, _a as r, fa as i, fr as a } from "./visualization-filters-CzvFHE6M.js";
3
+ var o = /* @__PURE__ */ e(((e, r) => {
4
+ var i = t(), a = n();
5
+ function o(e, t) {
6
+ return e && i(e, t, a);
7
+ }
8
+ r.exports = o;
9
+ })), s = /* @__PURE__ */ e(((e, t) => {
10
+ var n = r();
11
+ function i(e, t) {
12
+ return function(r, i) {
13
+ if (r == null) return r;
14
+ if (!n(r)) return e(r, i);
15
+ for (var a = r.length, o = t ? a : -1, s = Object(r); (t ? o-- : ++o < a) && i(s[o], o, s) !== !1;);
16
+ return r;
17
+ };
18
+ }
19
+ t.exports = i;
20
+ })), c = /* @__PURE__ */ e(((e, t) => {
21
+ var n = o();
22
+ t.exports = s()(n);
23
+ })), l = /* @__PURE__ */ e(((e, t) => {
24
+ function n(e, t, n, r) {
25
+ for (var i = -1, a = e == null ? 0 : e.length; ++i < a;) {
26
+ var o = e[i];
27
+ t(r, o, n(o), e);
28
+ }
29
+ return r;
30
+ }
31
+ t.exports = n;
32
+ })), u = /* @__PURE__ */ e(((e, t) => {
33
+ var n = c();
34
+ function r(e, t, r, i) {
35
+ return n(e, function(e, n, a) {
36
+ t(i, e, r(e), a);
37
+ }), i;
38
+ }
39
+ t.exports = r;
40
+ })), d = /* @__PURE__ */ e(((e, t) => {
41
+ var n = l(), r = u(), o = a(), s = i();
42
+ function c(e, t) {
43
+ return function(i, a) {
44
+ var c = s(i) ? n : r, l = t ? t() : {};
45
+ return c(i, e, o(a, 2), l);
46
+ };
47
+ }
48
+ t.exports = c;
49
+ }));
50
+ export { d as t };
@@ -1,8 +1,8 @@
1
- import { T as e, d as t, g as n, h as r, st as i, u as a, v as o } from "./shared-Bn4N5QcZ.js";
2
- import { Bf as s, gd as c } from "./handlers-TOT-7INo.js";
3
- import { m as l } from "./operations-Dh4v1Ovt.js";
1
+ import { T as e, ct as t, d as n, g as r, h as i, u as a, v as o } from "./shared-UitWpq1J.js";
2
+ import { Ap as s, eh as c } from "./handlers-ZviIUC-j.js";
3
+ import { m as l } from "./operations-DZoY50VX.js";
4
4
  var u = async (u) => {
5
- let d = c(u);
5
+ let d = s(u);
6
6
  if (d) return {
7
7
  issues: [{
8
8
  code: "invalid_structure",
@@ -11,19 +11,19 @@ var u = async (u) => {
11
11
  }],
12
12
  success: !1
13
13
  };
14
- let f = i.safeParse(u.definition);
14
+ let f = t.safeParse(u.definition);
15
15
  if (!f.success) return {
16
16
  issues: e(f.error, u.definition),
17
17
  success: !1
18
18
  };
19
- let p = s.safeParse(u.baseVSpec);
19
+ let p = c.safeParse(u.baseVSpec);
20
20
  if (!p.success) return {
21
- issues: [t("invalid_structure", ["baseVSpec"], "Base app filter bar vSpec is invalid.")],
21
+ issues: [n("invalid_structure", ["baseVSpec"], "Base app filter bar vSpec is invalid.")],
22
22
  success: !1
23
23
  };
24
24
  let m = p.data;
25
25
  if (!o(m, [])) return {
26
- issues: [t("non_fresh_base_vspec", ["baseVSpec"], "App filter bar definitions require a fresh base vSpec.")],
26
+ issues: [n("non_fresh_base_vspec", ["baseVSpec"], "App filter bar definitions require a fresh base vSpec.")],
27
27
  success: !1
28
28
  };
29
29
  let h = f.data.settings ?? {}, g = [
@@ -55,10 +55,10 @@ var u = async (u) => {
55
55
  name: l.SET_SELECTABLE_FIELD_KEYS,
56
56
  payload: h.selectableFieldKeys
57
57
  }]
58
- ], _ = await r(a(u, m), g, ["settings"]);
58
+ ], _ = await i(a(u, m), g, ["settings"]);
59
59
  return "issue" in _ ? {
60
60
  issues: [_.issue],
61
61
  success: !1
62
- } : n(_.state, s);
62
+ } : r(_.state, c);
63
63
  };
64
64
  export { u as compileAppFilterBarVisualizationDefinition };
@@ -0,0 +1,9 @@
1
+ import { _s as e } from "./visualization-filters-CzvFHE6M.js";
2
+ import "./shared-UitWpq1J.js";
3
+ var t = (e) => e.presentation?.layout !== void 0 && e.data.dimensions.length === 1 && e.data.measures.length === 1, n = (e) => {
4
+ let { grouped: t, offset: n, pyramid: r, stacked: i } = e.barSettings ?? {};
5
+ return !!(t || i || r || n?.enabled);
6
+ }, r = (r, i) => {
7
+ if (!t(r)) return r.presentation?.layout === void 0 ? r.data.dimensions.length === 1 && r.data.measures.length > 1 && !n(i) ? e.Groups : void 0 : r.presentation.layout;
8
+ };
9
+ export { t as n, r as t };
@@ -1,9 +1,10 @@
1
- import { Ua as e, r as t } from "./visualization-filters-Cc4KU-l-.js";
2
- import { A as n, D as r, E as i, N as a, S as o, T as s, _ as c, at as l, b as u, c as d, d as f, f as p, h as m, k as h, l as g, m as _, n as v } from "./shared-Bn4N5QcZ.js";
3
- import { Ef as y, gd as b } from "./handlers-TOT-7INo.js";
4
- import { _ as x, b as S, t as C, u as w, v as T, w as E } from "./operations-Dh4v1Ovt.js";
1
+ import { Oo as e, r as t } from "./visualization-filters-CzvFHE6M.js";
2
+ import { A as n, D as r, E as i, N as a, S as o, T as s, _ as c, b as l, c as u, d, f, h as p, k as m, l as h, m as g, n as _, ot as v } from "./shared-UitWpq1J.js";
3
+ import { Ap as y, Bm as b } from "./handlers-ZviIUC-j.js";
4
+ import { _ as x, b as S, t as C, u as w, v as T, w as E } from "./operations-DZoY50VX.js";
5
+ import { t as D } from "./bar-layout-DStC-GNV.js";
5
6
  t();
6
- var D = (e) => {
7
+ var O = (e) => {
7
8
  let t = [...e.data.dimensions.map((e, t) => ({
8
9
  item: e,
9
10
  path: [
@@ -22,40 +23,44 @@ var D = (e) => {
22
23
  ]
23
24
  }))], n = t.map(({ item: e }) => e.ref), r = new Set(n), i = /* @__PURE__ */ new Set(), a = [];
24
25
  t.forEach(({ item: e, path: t }) => {
25
- i.has(e.ref) && a.push(f("duplicate_alias", t, `Reference "${e.ref}" is duplicated.`)), i.add(e.ref);
26
+ i.has(e.ref) && a.push(d("duplicate_alias", t, `Reference "${e.ref}" is duplicated.`)), i.add(e.ref);
26
27
  }), e.sorting?.forEach((e, t) => {
27
- r.has(e.by) || a.push(f("unknown_alias", [
28
+ r.has(e.by) || a.push(d("unknown_alias", [
28
29
  "sorting",
29
30
  t,
30
31
  "by"
31
32
  ], `Reference "${e.by}" does not exist.`, { allowedValues: n }));
32
33
  }), a.push(...o(e.presentation?.coloring, e.data.dimensions.map((e) => e.ref), e.data.measures.map((e) => e.ref)));
33
34
  let s = e.limiting?.topN?.by;
34
- return s && !e.data.measures.some((e) => e.ref === s) && a.push(f("unknown_alias", [
35
+ return s && !e.data.measures.some((e) => e.ref === s) && a.push(d("unknown_alias", [
35
36
  "limiting",
36
37
  "topN",
37
38
  "by"
38
39
  ], `Measure reference "${s}" does not exist.`, { allowedValues: e.data.measures.map((e) => e.ref) })), a;
39
- }, O = (e) => {
40
- if (e.type !== "bar") return f("unsupported_visualization", ["baseVSpec", "type"], `Definition type "bar" cannot compile against base vSpec type "${e.type}".`);
40
+ }, k = (e) => {
41
+ if (e.type !== "bar") return d("unsupported_visualization", ["baseVSpec", "type"], `Definition type "bar" cannot compile against base vSpec type "${e.type}".`);
41
42
  let t = e;
42
- return t.dimensions.length > 0 || t.measures.length > 0 || (t.supportingMeasures?.length ?? 0) > 0 || Object.keys(t.referencedData).length > 0 ? f("non_fresh_base_vspec", ["baseVSpec"], "Bar visualization definitions can only compile against a fresh base vSpec.") : void 0;
43
- }, k = {
43
+ return t.dimensions.length > 0 || t.measures.length > 0 || (t.supportingMeasures?.length ?? 0) > 0 || Object.keys(t.referencedData).length > 0 ? d("non_fresh_base_vspec", ["baseVSpec"], "Bar visualization definitions can only compile against a fresh base vSpec.") : void 0;
44
+ }, A = {
44
45
  formatString: "setDimensionFormatString",
45
46
  formatType: "setDimensionFormatType"
46
- }, A = {
47
+ }, j = {
47
48
  currency: "setMeasureCurrency",
48
49
  currencyIsPrefix: "setMeasureCurrencyIsPrefix",
49
50
  formatString: "setMeasureFormatString",
50
51
  formatType: "setMeasureFormatType",
51
52
  negativeType: "setMeasureNegativeType"
52
- }, j = (e) => {
53
+ }, M = {
54
+ inside: 1,
55
+ opposite: 0,
56
+ outside: 0
57
+ }, N = (e) => {
53
58
  let t = Object.entries(e).find(([, e]) => e.success === !1);
54
59
  return t ? {
55
60
  id: t[0],
56
61
  result: t[1]
57
62
  } : void 0;
58
- }, M = (e, t) => {
63
+ }, P = (e, t) => {
59
64
  if (!e || typeof e.data != "object" || e.data === null || !("dataItem" in e.data)) return;
60
65
  let n = e.data.dataItem;
61
66
  if (!(typeof n != "object" || !n || !("internalKey" in n) || typeof n.internalKey != "string" || !("uniqueSignature" in n) || typeof n.uniqueSignature != "string")) return {
@@ -63,16 +68,16 @@ var D = (e) => {
63
68
  dataItemUniqueSignature: n.uniqueSignature,
64
69
  kind: t
65
70
  };
66
- }, N = async (e, t) => {
71
+ }, F = async (e, t) => {
67
72
  let n = e;
68
73
  for (let [e, r] of t.data.dimensions.entries()) {
69
74
  let t = `dimension:${r.ref}`, i = await C(n.vSpec, n.availableFields, [{
70
75
  id: t,
71
76
  name: w.ADD_DIMENSION,
72
77
  payload: { key: r.fieldKey }
73
- }], n.input.variables ?? [], [], n.input.theme), a = j(i.results), o = M(i.results[t], "dimension");
78
+ }], n.input.variables ?? [], [], n.input.theme), a = N(i.results), o = P(i.results[t], "dimension");
74
79
  if (a || !o) return {
75
- issue: f("operation_failed", [
80
+ issue: d("operation_failed", [
76
81
  "data",
77
82
  "dimensions",
78
83
  e
@@ -93,9 +98,9 @@ var D = (e) => {
93
98
  id: s,
94
99
  name: w.ADD_MEASURE,
95
100
  payload: i(o, e.input.availableFields)
96
- }], n.input.variables ?? [], [], n.input.theme), l = j(c.results), u = M(c.results[s], "measure");
101
+ }], n.input.variables ?? [], [], n.input.theme), l = N(c.results), u = P(c.results[s], "measure");
97
102
  if (l || !u) return {
98
- issue: f("operation_failed", [
103
+ issue: d("operation_failed", [
99
104
  "data",
100
105
  "measures",
101
106
  a
@@ -119,28 +124,28 @@ var D = (e) => {
119
124
  state: n,
120
125
  success: !0
121
126
  };
122
- }, P = (e) => ({
127
+ }, I = (e) => ({
123
128
  dataItemInternalKey: e.dataItemInternalKey,
124
129
  dataItemUniqueSignature: e.dataItemUniqueSignature
125
- }), F = async (e, t) => {
130
+ }), L = async (e, t) => {
126
131
  let n = [];
127
132
  return t.data.dimensions.forEach((t, r) => {
128
133
  let i = e.resolvedRefs[t.ref];
129
134
  t.showNullValues !== void 0 && n.push({
130
135
  name: w.UPDATE_DIMENSION,
131
136
  payload: {
132
- ...P(i),
137
+ ...I(i),
133
138
  changes: { showNullValues: t.showNullValues }
134
139
  }
135
- }), t.temporalGrouping && n.push(_("setDimensionTemporalGrouping", i, t.ref, [
140
+ }), t.temporalGrouping && n.push(g("setDimensionTemporalGrouping", i, t.ref, [
136
141
  "data",
137
142
  "dimensions",
138
143
  r
139
- ], t.temporalGrouping)), t.format?.formatType !== void 0 && n.push(g(k.formatType, i, t.ref, [
144
+ ], t.temporalGrouping)), t.format?.formatType !== void 0 && n.push(h(A.formatType, i, t.ref, [
140
145
  "data",
141
146
  "dimensions",
142
147
  r
143
- ], "formatType", t.format.formatType)), t.format?.formatString !== void 0 && n.push(g(k.formatString, i, t.ref, [
148
+ ], "formatType", t.format.formatType)), t.format?.formatString !== void 0 && n.push(h(A.formatString, i, t.ref, [
144
149
  "data",
145
150
  "dimensions",
146
151
  r
@@ -155,7 +160,7 @@ var D = (e) => {
155
160
  "negativeType"
156
161
  ].forEach((e) => {
157
162
  let a = t.format?.[e];
158
- a !== void 0 && n.push(g(A[e], i, t.ref, [
163
+ a !== void 0 && n.push(h(j[e], i, t.ref, [
159
164
  "data",
160
165
  "measures",
161
166
  r
@@ -163,28 +168,37 @@ var D = (e) => {
163
168
  }), t.dataLabels && n.push({
164
169
  name: E.SET_MEASURE_DATA_LABELS_SHOW,
165
170
  payload: {
166
- ...P(i),
171
+ ...I(i),
167
172
  show: t.dataLabels.visible
168
173
  }
169
174
  }), t.dataLabels?.placements && n.push({
170
175
  name: E.SET_MEASURE_DATA_LABEL_BAR_PLACEMENTS,
171
176
  payload: {
172
- ...P(i),
173
- placements: t.dataLabels.placements.map((e) => ({ position: e }))
177
+ ...I(i),
178
+ placements: t.dataLabels.placements.map((e) => ({
179
+ position: e,
180
+ justify: M[e]
181
+ }))
182
+ }
183
+ }), t.dataLabels?.textColor && n.push({
184
+ name: E.SET_MEASURE_DATA_LABEL_TEXT_COLOR,
185
+ payload: {
186
+ ...I(i),
187
+ textColor: t.dataLabels.textColor
174
188
  }
175
189
  }), t.axis && n.push({
176
190
  name: x.CHANGE_MEASURE_AXIS,
177
191
  payload: {
178
- ...P(i),
192
+ ...I(i),
179
193
  secondaryAxis: t.axis === "secondary"
180
194
  }
181
195
  });
182
- }), m(e, n, ["data"]);
183
- }, I = (e, t) => m(e, t.filterGroup ? [{
196
+ }), p(e, n, ["data"]);
197
+ }, R = (e, t) => p(e, t.filterGroup ? [{
184
198
  id: "filterGroup",
185
199
  name: "setStaticFilterGroup",
186
- payload: u(t.filterGroup)
187
- }] : [], ["filterGroup"]), L = async (t, n) => {
200
+ payload: l(t.filterGroup)
201
+ }] : [], ["filterGroup"]), z = async (t, n) => {
188
202
  if (!n.sorting?.length) return {
189
203
  state: t,
190
204
  success: !0
@@ -196,11 +210,11 @@ var D = (e) => {
196
210
  }))].map((t, n) => {
197
211
  let r = a.get(`${t.dataItemInternalKey}:${t.dataItemUniqueSignature}`), s = o.find((e) => e.dataItem.internalKey === t.dataItemInternalKey && e.dataItem.uniqueSignature === t.dataItemUniqueSignature);
198
212
  return {
199
- ...P(t),
213
+ ...I(t),
200
214
  newIndex: n,
201
215
  sortDirection: (r ? i.get(r)?.direction : void 0) ?? s?.sortDirection ?? e.Asc
202
216
  };
203
- }), u = await m(t, [{
217
+ }), u = await p(t, [{
204
218
  name: w.CHANGE_SORT_ORDER_AND_DIRECTION,
205
219
  payload: { changeRequests: l }
206
220
  }], ["sorting"]);
@@ -208,12 +222,12 @@ var D = (e) => {
208
222
  let d = n.sorting.map((e) => ({
209
223
  name: w.TOGGLE_SORTING_ITEM,
210
224
  payload: {
211
- ...P(t.resolvedRefs[e.by]),
225
+ ...I(t.resolvedRefs[e.by]),
212
226
  enabled: e.enabled ?? !0
213
227
  }
214
228
  }));
215
- return u = await m(u.state, d, ["sorting"]), u;
216
- }, R = (e, t) => {
229
+ return u = await p(u.state, d, ["sorting"]), u;
230
+ }, B = (e, t) => {
217
231
  let n = [], { limiting: r } = t;
218
232
  if (r?.queryLimit !== void 0 && n.push({
219
233
  name: w.SET_QUERY_LIMIT,
@@ -235,25 +249,29 @@ var D = (e) => {
235
249
  }, {
236
250
  name: w.SET_TOP_N_RANK_MEASURE,
237
251
  payload: {
238
- ...P(t),
252
+ ...I(t),
239
253
  ...e.measureAggregations[r.topN.by] ? { aggregation: e.measureAggregations[r.topN.by] } : {}
240
254
  }
241
255
  });
242
256
  }
243
- return m(e, n, ["limiting"]);
244
- }, z = (e, t) => {
257
+ return p(e, n, ["limiting"]);
258
+ }, V = (e, t) => {
245
259
  let n = [], { presentation: r } = t, i = c(r?.axes);
246
260
  if (i) return Promise.resolve({
247
261
  issue: i,
248
262
  success: !1
249
263
  });
250
- r?.orientation !== void 0 && n.push({
264
+ let a = D(t, e.input.baseVSpec);
265
+ a !== void 0 && n.push({
266
+ name: w.SET_BAR_CHART_LAYOUT,
267
+ payload: a
268
+ }), r?.orientation !== void 0 && n.push({
251
269
  name: w.SET_BAR_CHART_ORIENTATION,
252
270
  payload: r.orientation
253
271
  });
254
- let a = r?.legend;
255
- a && n.push(...p(e.vSpec, a)), Object.entries(r?.axes ?? {}).forEach(([e, t]) => {
256
- t.titleVisible !== void 0 && n.push({
272
+ let o = r?.legend;
273
+ o && n.push(...f(e.vSpec, o)), Object.entries(r?.axes ?? {}).forEach(([e, t]) => {
274
+ t && (t.titleVisible !== void 0 && n.push({
257
275
  name: w.SET_SHOW_AXIS_TITLE,
258
276
  payload: {
259
277
  axisName: e,
@@ -283,21 +301,21 @@ var D = (e) => {
283
301
  axisName: e,
284
302
  showAxisLine: t.lineVisible
285
303
  }
286
- }), n.push(...d(e, t)), "scale" in t && t.scale !== void 0 && n.push({
304
+ }), n.push(...u(e, t)), "scale" in t && t.scale !== void 0 && n.push({
287
305
  name: T.SET_AXIS_SCALE,
288
306
  payload: {
289
307
  axisName: e,
290
308
  scale: t.scale
291
309
  }
292
- });
310
+ }));
293
311
  });
294
- let o = r?.axes?.primaryMeasure?.bands;
295
- return o && n.push({
312
+ let s = r?.axes?.primaryMeasure?.bands;
313
+ return s && n.push({
296
314
  name: S.SET_MEASURE_AXIS_BANDS,
297
- payload: { bands: o }
298
- }), m(e, n, ["presentation"]);
299
- }, B = async (e) => {
300
- let t = b(e);
315
+ payload: { bands: s }
316
+ }), p(e, n, ["presentation"]);
317
+ }, H = async (e) => {
318
+ let t = y(e);
301
319
  if (t) return {
302
320
  issues: [{
303
321
  code: "invalid_structure",
@@ -306,69 +324,69 @@ var D = (e) => {
306
324
  }],
307
325
  success: !1
308
326
  };
309
- let r = l.safeParse(e.definition);
327
+ let r = v.safeParse(e.definition);
310
328
  if (!r.success) return {
311
329
  issues: s(r.error, e.definition),
312
330
  success: !1
313
331
  };
314
- let i = y.safeParse(e.baseVSpec);
332
+ let i = b.safeParse(e.baseVSpec);
315
333
  if (!i.success) return {
316
- issues: [f("invalid_structure", ["baseVSpec"], "Base bar vSpec is invalid.", { details: { issues: i.error.issues } })],
334
+ issues: [d("invalid_structure", ["baseVSpec"], "Base bar vSpec is invalid.", { details: { issues: i.error.issues } })],
317
335
  success: !1
318
336
  };
319
- let o = i.data, c = O(o);
337
+ let o = i.data, c = k(o);
320
338
  if (c) return {
321
339
  issues: [c],
322
340
  success: !1
323
341
  };
324
- let u = r.data.data.measures.find((e) => e.ref === r.data.limiting?.topN?.by), d = (u ? e.availableFields.find((e) => e.fieldKey === u.fieldKey) : void 0)?.kind === "measure" ? [f("unsupported_feature", [
342
+ let l = r.data.data.measures.find((e) => e.ref === r.data.limiting?.topN?.by), u = (l ? e.availableFields.find((e) => e.fieldKey === l.fieldKey) : void 0)?.kind === "measure" ? [d("unsupported_feature", [
325
343
  "limiting",
326
344
  "topN",
327
345
  "by"
328
- ], "Top N ranking by a predefined measure is not supported by the current query builder. Use a raw field or calculation.")] : [], p = [
329
- ...D(r.data),
330
- ...h(r.data.data.dimensions, e.availableFields, ["data", "dimensions"], "dimension"),
331
- ...h(r.data.data.measures, e.availableFields, ["data", "measures"], "measure"),
346
+ ], "Top N ranking by a predefined measure is not supported by the current query builder. Use a raw field or calculation.")] : [], f = [
347
+ ...O(r.data),
348
+ ...m(r.data.data.dimensions, e.availableFields, ["data", "dimensions"], "dimension"),
349
+ ...m(r.data.data.measures, e.availableFields, ["data", "measures"], "measure"),
332
350
  ...n(r.data.filterGroup, e.availableFields),
333
- ...d
351
+ ...u
334
352
  ];
335
- if (p.length > 0) return {
336
- issues: p,
353
+ if (f.length > 0) return {
354
+ issues: f,
337
355
  success: !1
338
356
  };
339
- let m = await N({
357
+ let p = await F({
340
358
  availableFields: a(e.availableFields),
341
359
  input: e,
342
360
  measureAggregations: {},
343
361
  resolvedRefs: {},
344
362
  vSpec: o
345
- }, r.data), g = [
346
- F,
347
- I,
363
+ }, r.data), h = [
348
364
  L,
349
365
  R,
350
366
  z,
351
- (e, t) => v(e, t.presentation?.coloring)
367
+ B,
368
+ V,
369
+ (e, t) => _(e, t.presentation?.coloring)
352
370
  ];
353
- for (let e of g) {
354
- if ("issue" in m) return {
355
- issues: [m.issue],
371
+ for (let e of h) {
372
+ if ("issue" in p) return {
373
+ issues: [p.issue],
356
374
  success: !1
357
375
  };
358
- m = await e(m.state, r.data);
376
+ p = await e(p.state, r.data);
359
377
  }
360
- if ("issue" in m) return {
361
- issues: [m.issue],
378
+ if ("issue" in p) return {
379
+ issues: [p.issue],
362
380
  success: !1
363
381
  };
364
- let _ = y.safeParse(m.state.vSpec);
365
- return _.success ? {
366
- resolvedRefs: m.state.resolvedRefs,
382
+ let g = b.safeParse(p.state.vSpec);
383
+ return g.success ? {
384
+ resolvedRefs: p.state.resolvedRefs,
367
385
  success: !0,
368
- vSpec: _.data
386
+ vSpec: g.data
369
387
  } : {
370
- issues: [f("invalid_compiled_vspec", [], "Compiled bar vSpec failed final validation.", { details: { issues: _.error.issues } })],
388
+ issues: [d("invalid_compiled_vspec", [], "Compiled bar vSpec failed final validation.", { details: { issues: g.error.issues } })],
371
389
  success: !1
372
390
  };
373
391
  };
374
- export { B as compileBarVisualizationDefinition };
392
+ export { H as compileBarVisualizationDefinition };