@astrato-io/visualizations 0.9.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 (145) hide show
  1. package/README.md +8 -4
  2. package/THIRD_PARTY_NOTICES.md +163 -14
  3. package/VISUALIZATION_DEFINITIONS.md +319 -32
  4. package/chunks/{Button-5CxPEACP.js → Button-CCF851ea.js} +4 -4
  5. package/chunks/{CircularProgress-DFS-LQb7.js → CircularProgress-yupH6YWs.js} +39 -39
  6. package/chunks/FieldTypeIcon-D_MzsdfY.js +22 -0
  7. package/chunks/{LinearProgress-CjIQfkNA.js → LinearProgress-CyFjN4px.js} +9 -9
  8. package/chunks/{MenuOption-Cb7B7x6z.js → MenuOption-CQpT79AP.js} +143 -142
  9. package/chunks/{Title-CtFw1bVg.js → Title-C-p4ZarD.js} +22 -22
  10. package/chunks/_createAggregator-BF4qG9XK.js +50 -0
  11. package/chunks/{app-filter-bar.compiler-B9775gLJ.js → app-filter-bar.compiler-8fxCo2q7.js} +10 -10
  12. package/chunks/bar-layout-DStC-GNV.js +9 -0
  13. package/chunks/{bar.compiler-B7wlH_Ro.js → bar.compiler-CQAu8KL8.js} +102 -84
  14. package/chunks/{builder-Dxo7D7c6.js → builder-CScg1TOS.js} +71 -38
  15. package/chunks/color-rules-DYJL4fIW.js +15 -0
  16. package/chunks/color-settings-DJFoFTip.js +5 -0
  17. package/chunks/{coloring-B-Wa8D5P.js → coloring-9jU3s_-p.js} +41 -41
  18. package/chunks/createSimplePaletteValueFilter-C4hZpCdn.js +2005 -0
  19. package/chunks/defaults-cyNhn37t.js +3 -0
  20. package/chunks/{definitions-DNpzD9tY.js → definitions-C4grxhye.js} +613 -401
  21. package/chunks/{escobar-C4Nm3eJ7.js → escobar-CjirINHP.js} +5326 -5079
  22. package/chunks/{extend-preset-BVKFtoe-.js → extend-preset-D-l9u_we.js} +974 -909
  23. package/chunks/{filter.compiler-BlS3zoy_.js → filter.compiler-lji2Acgn.js} +10 -10
  24. package/chunks/{filtering-CGuLpg7u.js → filtering-C1zakrrX.js} +385 -429
  25. package/chunks/handlers-ZviIUC-j.js +15387 -0
  26. package/chunks/{icon-picker-styles-DYQgVEKG.js → icon-picker-styles-Bj80ZUBK.js} +11 -11
  27. package/chunks/isEqual-Ch9OEye3.js +16 -0
  28. package/chunks/{isFocusVisible-B1_z03UT.js → isFocusVisible-CgMP0qkR.js} +1 -1
  29. package/chunks/label-format-type-C46pzgx7.js +17 -0
  30. package/chunks/{line.compiler-Bo9i9qag.js → line.compiler-De5fiKuR.js} +9 -9
  31. package/chunks/{logger-3lng-wOw.js → logger-CKRjhSHQ.js} +71 -64
  32. package/chunks/map.compiler-CKzorLgK.js +345 -0
  33. package/chunks/{metadata-Fmx1swpK.js → metadata-Bb9pTXrq.js} +1 -1
  34. package/chunks/{number.compiler-CdLd5aGW.js → number.compiler-CaTmJkmi.js} +7 -7
  35. package/chunks/operations-DZoY50VX.js +31297 -0
  36. package/chunks/{range-CzO4isKK.js → range-D1BTmFMp.js} +2 -2
  37. package/chunks/{react-dom-BwZT0N3F.js → react-dom-Dgv2azN2.js} +70 -70
  38. package/chunks/{render-wrappers-CAuvgMxi.js → render-wrappers-_P3xwu5A.js} +1 -1
  39. package/chunks/{requirements-CYpVh65U.js → requirements-NHNrR8Ie.js} +59 -57
  40. package/chunks/shared-UitWpq1J.js +1331 -0
  41. package/chunks/{standalone-CoQxJ6ov.js → standalone-B0U6c3su.js} +804 -804
  42. package/chunks/{standalone-C6XDHYAM.js → standalone-BBu90BhK.js} +109 -109
  43. package/chunks/standalone-BEekPuA12.js +357 -0
  44. package/chunks/{standalone-CPUiiWNP.js → standalone-BOzHA_d4.js} +41 -41
  45. package/chunks/standalone-BR2JuRIC.js +422 -0
  46. package/chunks/{standalone-DuwTOBXH.js → standalone-BapqaniK.js} +592 -592
  47. package/chunks/{standalone-DWPfdP0A.js → standalone-Bnnr87pc.js} +523 -523
  48. package/chunks/standalone-BwJqDj2Z.js +396 -0
  49. package/chunks/{standalone-LFVgLhia.js → standalone-ByKKqT5L.js} +266 -258
  50. package/chunks/{standalone-BDrQMxLi.js → standalone-CRdDZYeM.js} +1788 -1004
  51. package/chunks/standalone-CRfDOO1x.js +287 -0
  52. package/chunks/{standalone-BvWdpUL3.js → standalone-CVknVdUC.js} +21 -18
  53. package/chunks/standalone-CbPk8bKn.js +580 -0
  54. package/chunks/{standalone-r4ObFvys.js → standalone-Ck63MZzj.js} +218 -216
  55. package/chunks/{standalone-Cu73fzSr.js → standalone-DCFY1MAV.js} +6040 -5820
  56. package/chunks/{standalone-CiaaibTa.js → standalone-DZDGX3aa.js} +174 -174
  57. package/chunks/standalone-DhfgeJIk.js +1012 -0
  58. package/chunks/standalone-DibjA73M.js +6 -0
  59. package/chunks/{standalone-CXniic5x.js → standalone-DtBk_iUz.js} +6 -5
  60. package/chunks/standalone-DxBAyqAu.js +772 -0
  61. package/chunks/standalone-KMQPsNsq.js +2 -0
  62. package/chunks/standalone-MBLSvsrY.js +2 -0
  63. package/chunks/standalone-U0WJwFlG.js +354 -0
  64. package/chunks/{standalone-CNkHsynO.js → standalone-swGs70tD.js} +54 -56
  65. package/chunks/standalone-wgFAVnnm.js +355 -0
  66. package/chunks/standalone-xGV0dqPV.js +689 -0
  67. package/chunks/{table.compiler-C1qjqXaT.js → table.compiler-OWSx5MOq.js} +4 -4
  68. package/chunks/{useFieldName-mWrD_uk_.js → useFieldName-B8iCYyw1.js} +1 -1
  69. package/chunks/{utils-DYYD4Zzf.js → utils-3Igg6xmO.js} +4740 -4737
  70. package/chunks/{view-7fH6mGmY.js → view-DdMLZySj.js} +1988 -1632
  71. package/chunks/{visualization-filters-mVnsnvLP.js → visualization-filters-CzvFHE6M.js} +3158 -2417
  72. package/chunks/{with-html-element-B0Clt4jY.js → with-html-element-DOfkR3C1.js} +3353 -3160
  73. package/definitions.js +2 -2
  74. package/docs/operations/astrato-app-filter-bar.md +1 -1
  75. package/docs/operations/bar.md +303 -2
  76. package/docs/operations/combo.md +262 -1
  77. package/docs/operations/date-picker.md +1 -1
  78. package/docs/operations/distribution-gauge.md +1 -1
  79. package/docs/operations/dot.md +148 -1
  80. package/docs/operations/filter.md +1 -1
  81. package/docs/operations/gauge.md +1 -1
  82. package/docs/operations/heatMap.md +1 -1
  83. package/docs/operations/histogram.md +262 -1
  84. package/docs/operations/iframe.md +1 -1
  85. package/docs/operations/image.md +1 -1
  86. package/docs/operations/index.md +7 -7
  87. package/docs/operations/line.md +262 -1
  88. package/docs/operations/number.md +1 -1
  89. package/docs/operations/pie.md +1 -1
  90. package/docs/operations/radar.md +1 -1
  91. package/docs/operations/sankey.md +1 -1
  92. package/docs/operations/scatter.md +148 -1
  93. package/docs/operations/shape.md +1 -1
  94. package/docs/operations/simpleTextObject.md +1 -1
  95. package/docs/operations/slider.md +1 -1
  96. package/docs/operations/table.md +374 -157
  97. package/docs/operations/tree.md +1 -1
  98. package/docs/operations/treemap.md +1 -1
  99. package/docs/operations/waterfall.md +1 -1
  100. package/docs/operations/word-cloud.md +1 -1
  101. package/getters.js +2 -2
  102. package/index.js +507 -459
  103. package/metadata.js +2 -2
  104. package/operations.js +5 -5
  105. package/package.json +72 -67
  106. package/src/definitions/index.d.ts +1 -1
  107. package/src/definitions/model/definitions/available-fields.d.ts +2 -2
  108. package/src/definitions/model/definitions/compilers/compile.d.ts +1 -0
  109. package/src/definitions/model/definitions/data-item-resolution.d.ts +3 -3
  110. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +188 -2
  111. package/src/definitions/model/definitions/index.d.ts +2 -1
  112. package/src/definitions/model/definitions/schema-registry.d.ts +305 -0
  113. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +2 -0
  114. package/src/definitions/model/definitions/schemas/common.schema.d.ts +4 -3
  115. package/src/definitions/model/definitions/schemas/index.d.ts +1 -0
  116. package/src/definitions/model/definitions/schemas/map.schema.d.ts +590 -0
  117. package/src/definitions/model/definitions/types/compilation.types.d.ts +7 -2
  118. package/src/definitions/model/definitions/types/definition.types.d.ts +2 -2
  119. package/src/definitions/model/definitions/types/index.d.ts +1 -1
  120. package/src/index.d.ts +1 -1
  121. package/src/operations/index.d.ts +1 -1
  122. package/src/types.d.ts +45 -41
  123. package/chunks/FieldTypeIcon-pSVQFemC.js +0 -22
  124. package/chunks/ToggleButton-Br9HCPCv.js +0 -150
  125. package/chunks/color-rules-CN7TcGrC.js +0 -6
  126. package/chunks/color-settings-3VRlf_Vw.js +0 -6
  127. package/chunks/handlers-CMbyj5y1.js +0 -12930
  128. package/chunks/isEqual-DBg_b35N.js +0 -12
  129. package/chunks/label-format-type-weq1XfcX.js +0 -8
  130. package/chunks/operations-HSqnCRvv.js +0 -26324
  131. package/chunks/shared-DFoJxjVN.js +0 -1218
  132. package/chunks/standalone-530a5lvf.js +0 -1003
  133. package/chunks/standalone-5DnapeHH.js +0 -420
  134. package/chunks/standalone-B4jrf4KE.js +0 -354
  135. package/chunks/standalone-B6s_xG2u.js +0 -354
  136. package/chunks/standalone-BMoJXGYe.js +0 -2
  137. package/chunks/standalone-BfvGggeM2.js +0 -355
  138. package/chunks/standalone-CMJJIi9v.js +0 -2
  139. package/chunks/standalone-C_Jd4gkj.js +0 -6
  140. package/chunks/standalone-DBeXQrwH.js +0 -468
  141. package/chunks/standalone-DMCwtebn.js +0 -396
  142. package/chunks/standalone-DpSRmAWx.js +0 -287
  143. package/chunks/standalone-kzAhwH19.js +0 -689
  144. package/chunks/standalone-mb7LwEiq.js +0 -3874
  145. /package/chunks/{src-BOS6SqkZ2.js → src-BOS6SqkZ.js} +0 -0
@@ -1,8 +1,8 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { $ as t, G as n, Z as r, ei as i, it as a, jr as o, nt as s } from "./utils-DYYD4Zzf.js";
3
- import { _ as c, c as l, d as u, i as d, l as f, m as p, o as m, r as h, s as g, t as _, u as v, v as y } from "./react-dom-BwZT0N3F.js";
4
- import { a as b, c as x, d as S, l as C, n as w, o as T, r as E, t as D, u as O } from "./isFocusVisible-B1_z03UT.js";
5
- var k = /* @__PURE__ */ e(i(), 1), A = o(), j = S;
2
+ import { $ as t, G as n, Z as r, ci as i, it as a, nt as o, zr as s } from "./utils-3Igg6xmO.js";
3
+ import { _ as c, c as l, d as u, i as d, l as f, m as p, o as m, r as h, s as g, t as _, u as v, v as y } from "./react-dom-Dgv2azN2.js";
4
+ import { a as b, c as x, d as S, l as C, n as w, o as T, r as E, t as D, u as O } from "./isFocusVisible-CgMP0qkR.js";
5
+ var k = /* @__PURE__ */ e(i(), 1), A = s(), j = S;
6
6
  function M(e, t) {
7
7
  typeof e == "function" ? e(t) : e && (e.current = t);
8
8
  }
@@ -13,7 +13,7 @@ function L(e, t) {
13
13
  }
14
14
  function ee(e) {
15
15
  let t = L(() => R(e)).current;
16
- return t.next = e, s(t.effect), t;
16
+ return t.next = e, o(t.effect), t;
17
17
  }
18
18
  function R(e) {
19
19
  let t = {
@@ -50,7 +50,7 @@ function re(e) {
50
50
  return e.currentStatus === "entering" ? e.isAppearing ? t.appear ?? t.enter ?? null : t.enter ?? null : t.exit ?? null;
51
51
  }
52
52
  function z(e) {
53
- let { in: t = !1, appear: n = !1, enter: r = !0, exit: i = !0, mountOnEnter: a = !1, unmountOnExit: o = !1, timeout: c, addEndListener: l, reduceMotion: u = !1, getAutoTimeout: d, nodeRef: f, onEnter: p, onEntering: m, onEntered: h, onExit: _, onExiting: v, onExited: y, children: b, ...x } = e, S = k.useContext(te), C = S && !S.isMounting ? r : n, [w, T] = k.useState(() => t ? C ? "exited" : "entered" : a || o ? "unmounted" : "exited"), E = k.useRef(w);
53
+ let { in: t = !1, appear: n = !1, enter: r = !0, exit: i = !0, mountOnEnter: a = !1, unmountOnExit: s = !1, timeout: c, addEndListener: l, reduceMotion: u = !1, getAutoTimeout: d, nodeRef: f, onEnter: p, onEntering: m, onEntered: h, onExit: _, onExiting: v, onExited: y, children: b, ...x } = e, S = k.useContext(te), C = S && !S.isMounting ? r : n, [w, T] = k.useState(() => t ? C ? "exited" : "entered" : a || s ? "unmounted" : "exited"), E = k.useRef(w);
54
54
  E.current = w, t && w === "unmounted" && (E.current = "exited", T("exited"));
55
55
  let D = k.useRef(t && C), O = k.useRef(!1), j = k.useRef(null), M = k.useRef(w), N = k.useRef(!1), P = k.useRef(u), F = ee({
56
56
  timeout: c,
@@ -66,7 +66,7 @@ function z(e) {
66
66
  enter: r,
67
67
  exit: i,
68
68
  mountOnEnter: a,
69
- unmountOnExit: o,
69
+ unmountOnExit: s,
70
70
  nodeRef: f,
71
71
  parentGroup: S
72
72
  }), I = k.useCallback(() => {
@@ -133,18 +133,18 @@ function z(e) {
133
133
  z,
134
134
  F
135
135
  ]);
136
- return s(() => (O.current = !0, D.current && (D.current = !1, B(!0, "entering")), () => {
136
+ return o(() => (O.current = !0, D.current && (D.current = !1, B(!0, "entering")), () => {
137
137
  O.current = !1, I();
138
- }), [I, B]), s(() => {
138
+ }), [I, B]), o(() => {
139
139
  if (!O.current) return;
140
140
  let e = E.current;
141
- t ? e !== "entering" && e !== "entered" && B(!1, "entering") : e === "entering" || e === "entered" ? B(!1, "exiting") : e === "exited" && o && (E.current = "unmounted", T("unmounted"));
141
+ t ? e !== "entering" && e !== "entered" && B(!1, "entering") : e === "entering" || e === "entered" ? B(!1, "exiting") : e === "exited" && s && (E.current = "unmounted", T("unmounted"));
142
142
  }, [
143
143
  t,
144
144
  w,
145
- o,
145
+ s,
146
146
  B
147
- ]), s(() => {
147
+ ]), o(() => {
148
148
  if (w === "unmounted" || M.current === "unmounted") {
149
149
  M.current = w;
150
150
  return;
@@ -168,7 +168,7 @@ function ue(e) {
168
168
  enabled: e,
169
169
  matches: e ? null : !1
170
170
  })), r = t.matches;
171
- return t.enabled !== e && (r = null, e || (r = !1)), s(() => {
171
+ return t.enabled !== e && (r = null, e || (r = !1)), o(() => {
172
172
  let r = (t) => {
173
173
  n((n) => n.enabled === e && n.matches === t ? n : {
174
174
  enabled: e,
@@ -1122,10 +1122,10 @@ function an(e) {
1122
1122
  return typeof e == "function" ? e() : e;
1123
1123
  }
1124
1124
  var on = /*#__PURE__*/ k.forwardRef(function(e, t) {
1125
- let { children: n, container: r, disablePortal: i = !1 } = e, [a, o] = k.useState(null), c = S(/*#__PURE__*/ k.isValidElement(n) ? nn(n) : null, t);
1126
- if (s(() => {
1127
- i || o(an(r) || document.body);
1128
- }, [r, i]), s(() => {
1125
+ let { children: n, container: r, disablePortal: i = !1 } = e, [a, s] = k.useState(null), c = S(/*#__PURE__*/ k.isValidElement(n) ? nn(n) : null, t);
1126
+ if (o(() => {
1127
+ i || s(an(r) || document.body);
1128
+ }, [r, i]), o(() => {
1129
1129
  if (a && !i) return M(t, a), () => {
1130
1130
  M(t, null);
1131
1131
  };
@@ -1166,14 +1166,14 @@ var dn = (e) => {
1166
1166
  let { classes: t } = e;
1167
1167
  return p({ root: ["root"] }, sn, t);
1168
1168
  }, fn = {}, pn = /*#__PURE__*/ k.forwardRef(function(e, t) {
1169
- let { anchorEl: n, children: r, direction: i, disablePortal: a, modifiers: o, open: c, placement: l, popperOptions: u, popperRef: d, slotProps: f = {}, slots: p = {}, TransitionProps: m, ownerState: h, ...g } = e, _ = k.useRef(null), v = S(_, t), y = k.useRef(null), b = S(y, d), x = k.useRef(b);
1170
- s(() => {
1169
+ let { anchorEl: n, children: r, direction: i, disablePortal: a, modifiers: s, open: c, placement: l, popperOptions: u, popperRef: d, slotProps: f = {}, slots: p = {}, TransitionProps: m, ownerState: h, ...g } = e, _ = k.useRef(null), v = S(_, t), y = k.useRef(null), b = S(y, d), x = k.useRef(b);
1170
+ o(() => {
1171
1171
  x.current = b;
1172
1172
  }, [b]), k.useImperativeHandle(d, () => y.current, []);
1173
1173
  let C = cn(l, i), [w, T] = k.useState(C), E = k.useMemo(() => ln(n), [n]);
1174
1174
  k.useEffect(() => {
1175
1175
  y.current && y.current.forceUpdate();
1176
- }), s(() => {
1176
+ }), o(() => {
1177
1177
  if (!E || !c) return;
1178
1178
  let e = (e) => {
1179
1179
  T(e.placement);
@@ -1195,7 +1195,7 @@ var dn = (e) => {
1195
1195
  }
1196
1196
  }
1197
1197
  ];
1198
- o != null && (t = t.concat(o)), u && u.modifiers != null && (t = t.concat(u.modifiers));
1198
+ s != null && (t = t.concat(s)), u && u.modifiers != null && (t = t.concat(u.modifiers));
1199
1199
  let n = en(E, _.current, {
1200
1200
  placement: C,
1201
1201
  ...u,
@@ -1213,7 +1213,7 @@ var dn = (e) => {
1213
1213
  }, [
1214
1214
  E,
1215
1215
  a,
1216
- o,
1216
+ s,
1217
1217
  c,
1218
1218
  u,
1219
1219
  C
@@ -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-DFoJxjVN.js";
2
- import { Hf as s, vd as c } from "./handlers-CMbyj5y1.js";
3
- import { m as l } from "./operations-HSqnCRvv.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-mVnsnvLP.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-DFoJxjVN.js";
3
- import { Of as y, vd as b } from "./handlers-CMbyj5y1.js";
4
- import { _ as x, b as S, t as C, u as w, v as T, w as E } from "./operations-HSqnCRvv.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 };