@astrato-io/visualizations 0.10.0 → 0.10.1

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 (114) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +3 -3
  3. package/VISUALIZATION_DEFINITIONS.md +65 -12
  4. package/chunks/{Button-CCF851ea.js → Button-Dn3rJrYf.js} +2 -2
  5. package/chunks/{CircularProgress-yupH6YWs.js → CircularProgress-BFeu06Yb.js} +4 -4
  6. package/chunks/{FieldTypeIcon-D_MzsdfY.js → FieldTypeIcon-DrMoGpHJ.js} +2 -2
  7. package/chunks/{LinearProgress-CyFjN4px.js → LinearProgress-ClO6GUjN.js} +2 -2
  8. package/chunks/{MenuOption-CQpT79AP.js → MenuOption-Czc34u4q.js} +7 -7
  9. package/chunks/{Title-C-p4ZarD.js → Title-BgYnaVTR.js} +3 -3
  10. package/chunks/{_createAggregator-BF4qG9XK.js → _createAggregator-BMu9uRax.js} +8 -8
  11. package/chunks/{app-filter-bar.compiler-8fxCo2q7.js → app-filter-bar.compiler-CVir0wkl.js} +3 -3
  12. package/chunks/{bar-layout-DStC-GNV.js → bar-layout-C_UgRlVl.js} +2 -2
  13. package/chunks/{bar.compiler-CQAu8KL8.js → bar.compiler-DYuFdi9J.js} +8 -8
  14. package/chunks/{builder-CScg1TOS.js → builder-C-TKA-My.js} +11 -11
  15. package/chunks/{coloring-9jU3s_-p.js → coloring-BtnPiQ_o.js} +16 -16
  16. package/chunks/{createSimplePaletteValueFilter-C4hZpCdn.js → createSimplePaletteValueFilter--zrZxRV9.js} +1 -1
  17. package/chunks/defaults-Dtk7fg3C.js +3 -0
  18. package/chunks/{definitions-C4grxhye.js → definitions-CT304NDn.js} +77 -51
  19. package/chunks/{escobar-CjirINHP.js → escobar-CvEV2ES1.js} +6126 -6059
  20. package/chunks/{extend-preset-D-l9u_we.js → extend-preset-D9-JP92b.js} +396 -396
  21. package/chunks/{filter.compiler-lji2Acgn.js → filter.compiler-CXeZznks.js} +7 -7
  22. package/chunks/{filtering-C1zakrrX.js → filtering-8_bFv-jb.js} +84 -84
  23. package/chunks/{handlers-ZviIUC-j.js → handlers-C6CZ0XJA.js} +5620 -5608
  24. package/chunks/{icon-picker-styles-Bj80ZUBK.js → icon-picker-styles-BXiJ1SZS.js} +2 -2
  25. package/chunks/{isEqual-Ch9OEye3.js → isEqual-D8Ay63xR.js} +1 -1
  26. package/chunks/{isFocusVisible-CgMP0qkR.js → isFocusVisible-Bu8gGZu5.js} +1 -1
  27. package/chunks/{line.compiler-De5fiKuR.js → line.compiler-DmHpmQCC.js} +4 -4
  28. package/chunks/{logger-CKRjhSHQ.js → logger-DdZpR7xZ.js} +65 -65
  29. package/chunks/{map.compiler-CKzorLgK.js → map.compiler-Q_Y1Pvat.js} +12 -14
  30. package/chunks/{metadata-Bb9pTXrq.js → metadata-BQm_TXI1.js} +1 -1
  31. package/chunks/{number.compiler-CaTmJkmi.js → number.compiler-DQdg6zTy.js} +4 -4
  32. package/chunks/{operations-DZoY50VX.js → operations-DKQWuLL7.js} +9469 -9451
  33. package/chunks/{range-D1BTmFMp.js → range-BdhzvYQ_.js} +2 -2
  34. package/chunks/{react-dom-Dgv2azN2.js → react-dom-BGP4tbXV.js} +1 -1
  35. package/chunks/{render-wrappers-_P3xwu5A.js → render-wrappers-BZpyDnJy.js} +1 -1
  36. package/chunks/{requirements-NHNrR8Ie.js → requirements-e8Fe96ag.js} +29 -29
  37. package/chunks/{shared-UitWpq1J.js → shared-C_2F90xq.js} +478 -472
  38. package/chunks/{standalone-wgFAVnnm.js → standalone-4MsKiqs0.js} +130 -130
  39. package/chunks/standalone-B794g9pE.js +1012 -0
  40. package/chunks/{standalone-BBu90BhK.js → standalone-B8ZSqauS.js} +59 -59
  41. package/chunks/standalone-BA2YXyJS.js +422 -0
  42. package/chunks/{standalone-DtBk_iUz.js → standalone-BDrXVxlP.js} +4 -4
  43. package/chunks/{standalone-U0WJwFlG.js → standalone-BE_ONgiG.js} +64 -64
  44. package/chunks/{standalone-BOzHA_d4.js → standalone-BTY3w_JA.js} +24 -24
  45. package/chunks/{standalone-BEekPuA12.js → standalone-BgumbdaJ2.js} +101 -101
  46. package/chunks/{standalone-Bnnr87pc.js → standalone-BkbiH-o8.js} +174 -174
  47. package/chunks/{standalone-xGV0dqPV.js → standalone-Blh4qejk.js} +197 -197
  48. package/chunks/{standalone-DxBAyqAu.js → standalone-CXY4FpF7.js} +278 -277
  49. package/chunks/{standalone-CVknVdUC.js → standalone-CY_kjarf.js} +18 -18
  50. package/chunks/{standalone-BapqaniK.js → standalone-CaTxAydz.js} +54 -54
  51. package/chunks/{standalone-CRdDZYeM.js → standalone-Cc98Pdr6.js} +829 -829
  52. package/chunks/standalone-Cl0TSfqC.js +396 -0
  53. package/chunks/{standalone-B0U6c3su.js → standalone-CsoMmE9T.js} +80 -80
  54. package/chunks/standalone-DH0xTEes.js +2 -0
  55. package/chunks/{standalone-ByKKqT5L.js → standalone-DHRalbVO.js} +268 -268
  56. package/chunks/{standalone-CbPk8bKn.js → standalone-DNh9NcMa.js} +109 -109
  57. package/chunks/standalone-DcnHjNnC.js +2 -0
  58. package/chunks/{standalone-Ck63MZzj.js → standalone-DflyWtuR.js} +107 -107
  59. package/chunks/standalone-DrHdGkY7.js +762 -0
  60. package/chunks/standalone-c_rROMtx.js +287 -0
  61. package/chunks/{standalone-DibjA73M.js → standalone-drcFLeN6.js} +2 -2
  62. package/chunks/{standalone-swGs70tD.js → standalone-wOWRCpdn.js} +26 -26
  63. package/chunks/{standalone-DCFY1MAV.js → standalone-z0o52o5t.js} +4191 -4191
  64. package/chunks/{table.compiler-OWSx5MOq.js → table.compiler-COaHE9VD.js} +18 -18
  65. package/chunks/{useFieldName-B8iCYyw1.js → useFieldName-CdnCWzhd.js} +1 -1
  66. package/chunks/{utils-3Igg6xmO.js → utils-DganVptf.js} +491 -483
  67. package/chunks/{view-DdMLZySj.js → view-Bzlros43.js} +158 -158
  68. package/chunks/{visualization-filters-CzvFHE6M.js → visualization-filters-D7i6oh1Z.js} +23 -12
  69. package/chunks/{with-html-element-DOfkR3C1.js → with-html-element-CiIhFEa5.js} +2497 -2497
  70. package/definitions.js +2 -2
  71. package/docs/operations/astrato-app-filter-bar.md +1 -1
  72. package/docs/operations/bar.md +1 -1
  73. package/docs/operations/combo.md +1 -1
  74. package/docs/operations/date-picker.md +1 -1
  75. package/docs/operations/distribution-gauge.md +1 -1
  76. package/docs/operations/dot.md +1 -1
  77. package/docs/operations/filter.md +1 -1
  78. package/docs/operations/gauge.md +1 -1
  79. package/docs/operations/heatMap.md +1 -1
  80. package/docs/operations/histogram.md +1 -1
  81. package/docs/operations/iframe.md +1 -1
  82. package/docs/operations/image.md +1 -1
  83. package/docs/operations/index.md +2 -2
  84. package/docs/operations/line.md +19 -1
  85. package/docs/operations/number.md +1 -1
  86. package/docs/operations/pie.md +1 -1
  87. package/docs/operations/radar.md +1 -1
  88. package/docs/operations/sankey.md +1 -1
  89. package/docs/operations/scatter.md +1 -1
  90. package/docs/operations/shape.md +1 -1
  91. package/docs/operations/simpleTextObject.md +1 -1
  92. package/docs/operations/slider.md +1 -1
  93. package/docs/operations/table.md +1 -1
  94. package/docs/operations/tree.md +1 -1
  95. package/docs/operations/treemap.md +1 -1
  96. package/docs/operations/waterfall.md +1 -1
  97. package/docs/operations/word-cloud.md +1 -1
  98. package/getters.js +2 -2
  99. package/index.js +54 -54
  100. package/metadata.js +2 -2
  101. package/operations.js +5 -5
  102. package/package.json +67 -67
  103. package/src/definitions/index.d.ts +7 -1
  104. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +31 -5
  105. package/src/definitions/model/definitions/types/compilation.types.d.ts +4 -1
  106. package/src/types.d.ts +28 -28
  107. package/chunks/defaults-cyNhn37t.js +0 -3
  108. package/chunks/standalone-BR2JuRIC.js +0 -422
  109. package/chunks/standalone-BwJqDj2Z.js +0 -396
  110. package/chunks/standalone-CRfDOO1x.js +0 -287
  111. package/chunks/standalone-DZDGX3aa.js +0 -518
  112. package/chunks/standalone-DhfgeJIk.js +0 -1012
  113. package/chunks/standalone-KMQPsNsq.js +0 -2
  114. package/chunks/standalone-MBLSvsrY.js +0 -2
@@ -1,11 +1,11 @@
1
1
  import { o as e, r as t } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Da as n, Gs as r, Io as i, Js as a, Pc as o, Qr as s, Ra as c, Za as l, oa as u, vc as d } from "./visualization-filters-CzvFHE6M.js";
3
- import { Ht as f, N as p, Ut as m, ci as h, jt as g, zr as _ } from "./utils-3Igg6xmO.js";
4
- import { h_ as v } from "./handlers-ZviIUC-j.js";
2
+ import { Fc as n, Ks as r, Lo as i, Oa as a, Qa as o, Qr as s, Ys as c, sa as l, yc as u, za as d } from "./visualization-filters-D7i6oh1Z.js";
3
+ import { Ht as f, N as p, Ut as m, ci as h, jt as g, zr as _ } from "./utils-DganVptf.js";
4
+ import { g_ as v } from "./handlers-C6CZ0XJA.js";
5
5
  import { n as y } from "./label-format-type-C46pzgx7.js";
6
- import "./logger-CKRjhSHQ.js";
7
- import { At as b, Dt as x, I as S, L as C, Ot as ee, Vt as te, Xt as w, Z as T, fn as E, i as ne, in as re, mn as D, tt as ie, un as O, vn as k, xt as A } from "./escobar-CjirINHP.js";
8
- import { t as j } from "./coloring-9jU3s_-p.js";
6
+ import "./logger-DdZpR7xZ.js";
7
+ import { At as b, Ct as x, L as S, Mt as C, N as ee, Qt as w, Ut as T, _ as E, bn as D, fn as te, gn as O, i as ne, kt as re, mn as k, on as ie, v as A } from "./escobar-CvEV2ES1.js";
8
+ import { t as j } from "./coloring-BtnPiQ_o.js";
9
9
  import { t as M } from "./set-coloring-datafield-B3uIS1Pe.js";
10
10
  var N = /* @__PURE__ */ e(h()), P = {
11
11
  outerRadius: .95,
@@ -22,104 +22,104 @@ var N = /* @__PURE__ */ e(h()), P = {
22
22
  gaugeCollectionKey: "Gauge-Collection"
23
23
  }, F = (e) => e.gaugeSettings?.barMode ?? !1, I = (e) => e.gaugeSettings?.comparisonMode ?? !1, ae = (e) => {
24
24
  let { coloring: t } = e || {};
25
- return t?.type === d.Categorical || t?.type === d.Single ? ee(e, []) ?? "" : b(e) ?? "";
26
- }, L = (e, t, n) => {
27
- let r = { ...x(M(e, ae(e) ?? ""), t, {}) }, a = e.gaugeSettings?.barPadding ?? D.scale.padding;
28
- r = T(e, r, a);
29
- let l = e.dimensions.filter(s), u = e.measures.filter(s).filter((e) => e.role === c.GAUGE_VALUE);
30
- return !l.length && F(e) ? r.onlyMeasures = {
31
- data: I(e) ? { extract: { field: u[0] ? o(u[0].dataItem) : "" } } : u.map((e) => o(e.dataItem)),
32
- type: E.Band,
33
- padding: a
34
- } : I(e) || (r.onlyMeasures = {
35
- data: { fields: u.map((e) => o(e.dataItem)) },
25
+ return t?.type === u.Categorical || t?.type === u.Single ? b(e, []) ?? "" : C(e) ?? "";
26
+ }, L = (e, t, r) => {
27
+ let a = { ...re(M(e, ae(e) ?? ""), t, {}) }, o = e.gaugeSettings?.barPadding ?? O.scale.padding;
28
+ a = ee(e, a, o);
29
+ let c = e.dimensions.filter(s), l = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
30
+ return !c.length && F(e) ? a.onlyMeasures = {
31
+ data: I(e) ? { extract: { field: l[0] ? n(l[0].dataItem) : "" } } : l.map((e) => n(e.dataItem)),
32
+ type: k.Band,
33
+ padding: o
34
+ } : I(e) || (a.onlyMeasures = {
35
+ data: { fields: l.map((e) => n(e.dataItem)) },
36
36
  include: [0],
37
37
  expand: .05
38
- }), F(e) && (r.barScale = {
38
+ }), F(e) && (a.barScale = {
39
39
  min: P.minScaleValue - P.scalePadding,
40
40
  max: P.maxScaleValue + P.scalePadding,
41
41
  invert: e.gaugeSettings?.orientation === i.Vertical
42
42
  }), {
43
- ...n,
44
- scales: r
43
+ ...r,
44
+ scales: a
45
45
  };
46
- }, R = (e, t, n, r, i) => {
47
- if (!i) return n;
48
- let a = e.dimensions.filter(s), l = e.measures.filter(s), u = C((e.supportingMeasures ?? []).filter(s)), d = l.filter((e) => e.role === c.GAUGE_VALUE), f = a[0], p = d[0], { targetType: m } = e.gaugeSettings ?? {}, h = F(e), g = f?.dataItem ?? p?.dataItem;
49
- if (!g) return n;
46
+ }, R = (e, t, r, i, a) => {
47
+ if (!a) return r;
48
+ let o = e.dimensions.filter(s), c = e.measures.filter(s), l = A((e.supportingMeasures ?? []).filter(s)), u = c.filter((e) => e.role === d.GAUGE_VALUE), f = o[0], p = u[0], { targetType: m } = e.gaugeSettings ?? {}, h = F(e), g = f?.dataItem ?? p?.dataItem;
49
+ if (!g) return r;
50
50
  let _ = [], v = P.minScaleValue;
51
- if (I(e) ? _.push(...B(e, g, i, u)) : f ? _.push(...z(e, g, i, u)) : _.push(...V(e, i, u)), h) {
52
- let t = o(p.dataItem), n = {
53
- field: o(g),
51
+ if (I(e) ? _.push(...B(e, g, a, l)) : f ? _.push(...z(e, g, a, l)) : _.push(...V(e, a, l)), h) {
52
+ let t = n(p.dataItem), r = {
53
+ field: n(g),
54
54
  props: {
55
55
  actual: { field: t },
56
56
  color: t,
57
57
  start: v,
58
58
  end: P.maxScaleValue,
59
59
  background: !0,
60
- ...u
60
+ ...l
61
61
  }
62
62
  };
63
- (m === y.Data || m === y.Manual) && (n.props ??= {}, n.props.target = W(e, i)), l.forEach((e) => {
64
- n.props ??= {};
65
- let t = `measure-${o(e.dataItem)}`;
66
- n.props[t] = { field: o(e.dataItem) };
67
- }), _.push(n);
63
+ (m === y.Data || m === y.Manual) && (r.props ??= {}, r.props.target = W(e, a)), c.forEach((e) => {
64
+ r.props ??= {};
65
+ let t = `measure-${n(e.dataItem)}`;
66
+ r.props[t] = { field: n(e.dataItem) };
67
+ }), _.push(r);
68
68
  }
69
69
  let b = [{
70
70
  key: P.gaugeCollectionKey,
71
71
  data: { extract: _ }
72
72
  }];
73
73
  return {
74
- ...n,
74
+ ...r,
75
75
  collections: b
76
76
  };
77
- }, z = (e, t, n, r) => {
78
- let i = e.measures.filter(s), a = i.filter((e) => e.role === c.GAUGE_VALUE), l = i.filter((e) => e.role === c.GAUGE_TARGET), u = a[0], d = l[0], { targetType: f } = e.gaugeSettings, p = F(e), m = [], h = o(u.dataItem);
77
+ }, z = (e, t, r, i) => {
78
+ let a = e.measures.filter(s), o = a.filter((e) => e.role === d.GAUGE_VALUE), c = a.filter((e) => e.role === d.GAUGE_TARGET), l = o[0], u = c[0], { targetType: f } = e.gaugeSettings, p = F(e), m = [], h = n(l.dataItem);
79
79
  return p || m.push({
80
- field: o(t),
80
+ field: n(t),
81
81
  props: {
82
82
  actual: { field: h },
83
83
  [h]: { field: h },
84
84
  color: h,
85
- ...r
85
+ ...i
86
86
  }
87
87
  }), m.push({
88
- field: o(t),
88
+ field: n(t),
89
89
  props: {
90
90
  actual: { field: h },
91
91
  start: p ? P.minScaleValue : void 0,
92
- end: p ? { getValue: H(e, n) } : void 0,
92
+ end: p ? { getValue: H(e, r) } : void 0,
93
93
  [h]: { field: h },
94
94
  color: h,
95
- ...r
95
+ ...i
96
96
  }
97
97
  }), (f === y.Data || f === y.Manual) && m.forEach((t) => {
98
- t.props ??= {}, t.props.target = W(e, n), d && f === y.Data && (t.props[o(d.dataItem)] = { field: o(d.dataItem) });
98
+ t.props ??= {}, t.props.target = W(e, r), u && f === y.Data && (t.props[n(u.dataItem)] = { field: n(u.dataItem) });
99
99
  }), m;
100
- }, B = (e, t, n, r) => {
101
- let i = F(e), a = e.measures.filter(s).filter((e) => e.role === c.GAUGE_VALUE), l = a.reduce((e, t) => {
102
- let n = o(t.dataItem);
103
- return e[n] = { field: n }, e;
100
+ }, B = (e, t, r, i) => {
101
+ let a = F(e), o = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE), c = o.reduce((e, t) => {
102
+ let r = n(t.dataItem);
103
+ return e[r] = { field: r }, e;
104
104
  }, {});
105
- return a.map((a, s) => {
106
- let c = o(a.dataItem);
105
+ return o.map((o, s) => {
106
+ let l = n(o.dataItem);
107
107
  return {
108
- field: o(t),
108
+ field: n(t),
109
109
  props: {
110
- measure: { field: c },
111
- color: c,
112
- start: i ? P.minScaleValue : void 0,
113
- end: i ? { getValue: H(e, n, s) } : void 0,
114
- ...l,
115
- ...r
110
+ measure: { field: l },
111
+ color: l,
112
+ start: a ? P.minScaleValue : void 0,
113
+ end: a ? { getValue: H(e, r, s) } : void 0,
114
+ ...c,
115
+ ...i
116
116
  }
117
117
  };
118
118
  });
119
- }, V = (e, t, n) => {
120
- let r = F(e), i = [];
121
- return e.measures.filter(s).filter((e) => e.role === c.GAUGE_VALUE).forEach((a) => {
122
- let s = o(a.dataItem), c = t[0].items[0][s], l = W(e, t, a), u = [];
119
+ }, V = (e, t, r) => {
120
+ let i = F(e), a = [];
121
+ return e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE).forEach((o) => {
122
+ let s = n(o.dataItem), c = t[0].items[0][s], l = W(e, t, o), u = [];
123
123
  u.push({
124
124
  field: s,
125
125
  props: {
@@ -127,10 +127,10 @@ var N = /* @__PURE__ */ e(h()), P = {
127
127
  measure: { field: s },
128
128
  actual: { field: s },
129
129
  color: s,
130
- start: r ? P.minScaleValue : void 0,
131
- end: r && typeof c == "number" && typeof l == "number" ? U(c, l) : void 0,
130
+ start: i ? P.minScaleValue : void 0,
131
+ end: i && typeof c == "number" && typeof l == "number" ? U(c, l) : void 0,
132
132
  [s]: { field: s },
133
- ...n
133
+ ...r
134
134
  }
135
135
  }), u.push({
136
136
  field: s,
@@ -139,48 +139,48 @@ var N = /* @__PURE__ */ e(h()), P = {
139
139
  measure: { field: s },
140
140
  actual: { field: s },
141
141
  color: s,
142
- start: r ? P.minScaleValue : void 0,
143
- end: r ? P.maxScaleValue : void 0,
142
+ start: i ? P.minScaleValue : void 0,
143
+ end: i ? P.maxScaleValue : void 0,
144
144
  background: !0,
145
145
  [s]: { field: s },
146
- ...n
146
+ ...r
147
147
  }
148
148
  }), (e.gaugeSettings?.targetType ?? y.Auto) !== y.Auto && u.forEach((e) => {
149
149
  e.props ??= {}, e.props.target = l;
150
- }), i.push(...u);
151
- }), i;
152
- }, H = (e, t, n) => {
153
- let r = e.measures.filter(s), i = r.filter((e) => e.role === c.GAUGE_VALUE), a = r.filter((e) => e.role === c.GAUGE_TARGET), l = i[0], u = a[0];
154
- return (r, a, s) => {
150
+ }), a.push(...u);
151
+ }), a;
152
+ }, H = (e, t, r) => {
153
+ let i = e.measures.filter(s), a = i.filter((e) => e.role === d.GAUGE_VALUE), o = i.filter((e) => e.role === d.GAUGE_TARGET), c = a[0], l = o[0];
154
+ return (i, o, s) => {
155
155
  if (!s) return P.minScaleValue;
156
- let c = i.find((e, t) => t === n), d = c && s[o(c.dataItem)];
156
+ let u = a.find((e, t) => t === r), d = u && s[n(u.dataItem)];
157
157
  if (typeof d == "number" && d < 0) return P.minScaleValue;
158
- let f = s[o(l.dataItem)], p;
159
- if (p = e.gaugeSettings?.targetType === y.Data ? s[o(u?.dataItem)] : W(e, t), typeof f != "number" || typeof p != "number") return P.minScaleValue;
160
- if (!I(e) || n === void 0) return U(f, p);
158
+ let f = s[n(c.dataItem)], p;
159
+ if (p = e.gaugeSettings?.targetType === y.Data ? s[n(l?.dataItem)] : W(e, t), typeof f != "number" || typeof p != "number") return P.minScaleValue;
160
+ if (!I(e) || r === void 0) return U(f, p);
161
161
  let m = 0, h = 0;
162
- return i.forEach((e, t) => {
163
- let r = Math.max(0, s[o(e.dataItem)]);
164
- m += r, t <= n && (h += r);
162
+ return a.forEach((e, t) => {
163
+ let i = Math.max(0, s[n(e.dataItem)]);
164
+ m += i, t <= r && (h += i);
165
165
  }), h / m * P.maxScaleValue;
166
166
  };
167
167
  }, U = (e, t) => {
168
168
  let n = t ? Math.max(0, e) / t : 1;
169
169
  return Math.min(n, 1) * P.maxScaleValue;
170
- }, W = (e, t, n) => {
171
- let { targetType: r, targetValue: i } = e.gaugeSettings, a = e.measures.filter(s), l = a.filter((e) => e.role === c.GAUGE_TARGET)[0];
172
- return r === y.Auto ? t[0].items.map((e) => a.map((t) => e[o(t.dataItem)])).reduce((e, t) => Math.max(...t, e), 0) * (1 + D.scale.padding) : l && r === y.Data ? { field: o(l.dataItem) } : n && r === y.PerMeasure ? n.targetValue ?? 0 : r === y.Manual ? i ?? 0 : 0;
170
+ }, W = (e, t, r) => {
171
+ let { targetType: i, targetValue: a } = e.gaugeSettings, o = e.measures.filter(s), c = o.filter((e) => e.role === d.GAUGE_TARGET)[0];
172
+ return i === y.Auto ? t[0].items.map((e) => o.map((t) => e[n(t.dataItem)])).reduce((e, t) => Math.max(...t, e), 0) * (1 + O.scale.padding) : c && i === y.Data ? { field: n(c.dataItem) } : r && i === y.PerMeasure ? r.targetValue ?? 0 : i === y.Manual ? a ?? 0 : 0;
173
173
  }, G = {
174
174
  Foreground: "foreground",
175
175
  Background: "background"
176
- }, K = (e, t, n = 0) => `${e}-${t}-${n}`, q = (e) => Math.min(P.maxBarWidthOfRadius, P.outerRadius / e), oe = (e, t, n) => {
177
- let r = e.measures.filter(s).filter((e) => e.role === c.GAUGE_VALUE);
178
- return (e) => n !== void 0 && e.measure?.source?.field !== o(r[n]?.dataItem) ? !1 : e.background?.value ? t === G.Background : t === G.Foreground;
179
- }, J = (e, t) => !t || e.coloring?.type === d.Single ? !1 : !I(e) || e.coloring?.type === d.Categorical, Y = (e, t, n, r, i, a, l, u) => {
180
- let d = n.dimensions.filter(s)[0], f = new j(n, r, t?.[0]?.itemsNotAffectedByFiltering), p = f.getColorDefinition(J(n, d) ? { ref: f.MAIN_FIELD } : {}), m = (e, t = 0) => !I(n) && t === 1 || a && I(n) ? "transparent" : typeof p == "function" ? p(e) : p, h = q(l), g = Number(n.gaugeSettings?.size), _ = Number(n.gaugeSettings?.startAngle), v = isNaN(g) ? 360 : g ?? 360, b = isNaN(_) ? 0 : _ ?? 0, x = b + v, S = b / 180 * Math.PI, C = x / 180 * Math.PI;
176
+ }, K = (e, t, n = 0) => `${e}-${t}-${n}`, q = (e) => Math.min(P.maxBarWidthOfRadius, P.outerRadius / e), oe = (e, t, r) => {
177
+ let i = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
178
+ return (e) => r !== void 0 && e.measure?.source?.field !== n(i[r]?.dataItem) ? !1 : e.background?.value ? t === G.Background : t === G.Foreground;
179
+ }, J = (e, t) => !t || e.coloring?.type === u.Single ? !1 : !I(e) || e.coloring?.type === u.Categorical, Y = (e, t, r, i, a, o, c, l) => {
180
+ let u = r.dimensions.filter(s)[0], f = new j(r, i, t?.[0]?.itemsNotAffectedByFiltering), p = f.getColorDefinition(J(r, u) ? { ref: f.MAIN_FIELD } : {}), m = (e, t = 0) => !I(r) && t === 1 || o && I(r) ? "transparent" : typeof p == "function" ? p(e) : p, h = q(c), g = Number(r.gaugeSettings?.size), _ = Number(r.gaugeSettings?.startAngle), v = isNaN(g) ? 360 : g ?? 360, b = isNaN(_) ? 0 : _ ?? 0, x = b + v, S = b / 180 * Math.PI, C = x / 180 * Math.PI;
181
181
  return {
182
- key: K(k.Pie, a ? G.Background : G.Foreground, i),
183
- type: k.Pie,
182
+ key: K(D.Pie, o ? G.Background : G.Foreground, a),
183
+ type: D.Pie,
184
184
  animations: {
185
185
  enabled: !0,
186
186
  presetId: "pie-chart"
@@ -188,27 +188,27 @@ var N = /* @__PURE__ */ e(h()), P = {
188
188
  data: {
189
189
  collection: P.gaugeCollectionKey,
190
190
  filter: (t) => {
191
- if (!d) {
192
- let e = n.measures.filter(s).filter((e) => e.role === c.GAUGE_VALUE);
193
- return I(n) || e[i] && t.measure?.source?.field === o(e[i].dataItem);
191
+ if (!u) {
192
+ let e = r.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
193
+ return I(r) || e[a] && t.measure?.source?.field === n(e[a].dataItem);
194
194
  }
195
- return `${t.value}` == `${e[o(d.dataItem)]}`;
195
+ return `${t.value}` == `${e[n(u.dataItem)]}`;
196
196
  }
197
197
  },
198
198
  settings: {
199
199
  startAngle: S,
200
200
  endAngle: C,
201
201
  slice: {
202
- cornerRadius: n.gaugeSettings?.cornerRadius ?? 10,
203
- outerRadius: P.outerRadius - i * h,
204
- innerRadius: P.outerRadius - (i + (1 - P.barWidthRadiusPadding)) * h,
202
+ cornerRadius: r.gaugeSettings?.cornerRadius ?? 10,
203
+ outerRadius: P.outerRadius - a * h,
204
+ innerRadius: P.outerRadius - (a + (1 - P.barWidthRadiusPadding)) * h,
205
205
  fill: m,
206
206
  strokeWidth: .1,
207
- opacity: a ? P.backgroundBarOpacity : 1,
207
+ opacity: o ? P.backgroundBarOpacity : 1,
208
208
  arc: (e, t = 0) => {
209
- if (a) return +(t === 0);
210
- if (I(n)) return e.datum.measure.value;
211
- if ((n.gaugeSettings.targetType ?? y.Auto) !== y.Auto) return t === 0 ? e.datum.actual.value : Number(e.datum.target.value) - Number(e.datum.actual.value);
209
+ if (o) return +(t === 0);
210
+ if (I(r)) return e.datum.measure.value;
211
+ if ((r.gaugeSettings.targetType ?? y.Auto) !== y.Auto) return t === 0 ? e.datum.actual.value : Number(e.datum.target.value) - Number(e.datum.actual.value);
212
212
  {
213
213
  let n = e.resources.scale("onlyMeasures"), r = Number(n(e.datum.actual.value)) || 0;
214
214
  return t === 0 ? r : 1 - r;
@@ -216,18 +216,18 @@ var N = /* @__PURE__ */ e(h()), P = {
216
216
  }
217
217
  }
218
218
  },
219
- brush: w([""], u, { overwriteOpacity: a ? P.backgroundBarOpacity : void 0 })
219
+ brush: w([""], l, { overwriteOpacity: o ? P.backgroundBarOpacity : void 0 })
220
220
  };
221
- }, X = (e, t, r, a, c, l) => {
221
+ }, X = (e, t, r, o, c, l) => {
222
222
  let u = e.dimensions.filter(s)[0], d = new j(e, t, r?.[0]?.itemsNotAffectedByFiltering), f;
223
- f = a === G.Background && e.gaugeSettings?.backgroundBarColor ? e.gaugeSettings?.backgroundBarColor : d.getColorDefinition(J(e, u) ? { ref: d.MAIN_FIELD } : {}, !e.gaugeSettings?.backgroundBarColor && a === G.Background ? P.backgroundBarOpacity : void 0);
224
- let p = u ? o(u.dataItem) : "onlyMeasures", m = !u && !I(e) ? "measureValue" : void 0, h = {
225
- key: K(k.Box, a, c),
226
- type: k.Box,
223
+ f = o === G.Background && e.gaugeSettings?.backgroundBarColor ? e.gaugeSettings?.backgroundBarColor : d.getColorDefinition(J(e, u) ? { ref: d.MAIN_FIELD } : {}, !e.gaugeSettings?.backgroundBarColor && o === G.Background ? P.backgroundBarOpacity : void 0);
224
+ let p = u ? n(u.dataItem) : "onlyMeasures", m = !u && !I(e) ? "measureValue" : void 0, h = {
225
+ key: K(D.Box, o, c),
226
+ type: D.Box,
227
227
  animations: { enabled: !0 },
228
228
  data: {
229
229
  collection: P.gaugeCollectionKey,
230
- filter: oe(e, a, c)
230
+ filter: oe(e, o, c)
231
231
  },
232
232
  settings: {
233
233
  orientation: e.gaugeSettings.orientation ?? i.Horizontal,
@@ -242,14 +242,14 @@ var N = /* @__PURE__ */ e(h()), P = {
242
242
  rx: e.gaugeSettings?.barRadius ?? 0
243
243
  }
244
244
  },
245
- brush: w([""], l, { disable: { triggers: a === G.Foreground } })
245
+ brush: w([""], l, { disable: { triggers: o === G.Foreground } })
246
246
  };
247
247
  if (e.gaugeSettings?.strokeEnabled) {
248
248
  let n = h.settings;
249
249
  n && (n.box.stroke = e.gaugeSettings?.strokeColor || t.colors.brandColors[0], n.box.strokeWidth = e.gaugeSettings?.strokeWidth);
250
250
  } else {
251
251
  let e = h.settings;
252
- e && (e.box.stroke = n.transparent);
252
+ e && (e.box.stroke = a.transparent);
253
253
  }
254
254
  return h;
255
255
  }, se = (e, t, n, r, i, a) => {
@@ -260,16 +260,16 @@ var N = /* @__PURE__ */ e(h()), P = {
260
260
  components: [...n.components, ...o]
261
261
  };
262
262
  }, ce = (e, t, n, r, i) => {
263
- let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role === c.GAUGE_VALUE);
263
+ let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
264
264
  return !a[0] && !I(e) ? o.map((n, i) => [Y(r[0].items[0], r, e, t, i, !0, o.length), Y(r[0].items[0], r, e, t, i, !1, o.length)]).reduce((e, t) => e.concat(t), []) : r[0].items.map((n, a) => [Y(n, r, e, t, a, !0, r[0].items.length, i), Y(n, r, e, t, a, !1, r[0].items.length, i)]).reduce((e, t) => e.concat(t), []);
265
265
  }, Z = (e, t, n, r, i) => {
266
- let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role === c.GAUGE_VALUE), l = a[0], u = [];
267
- if (I(e)) for (let n = o.length - 1; n >= 0; n--) u.push(X(e, t, r, G.Foreground, n, i));
268
- else if (l) u = [X(e, t, r, G.Background, void 0, i), X(e, t, r, G.Foreground, void 0, i)];
269
- else for (let n = o.length - 1; n >= 0; n--) u.push(X(e, t, r, G.Background, n)), u.push(X(e, t, r, G.Foreground, n));
270
- return u;
266
+ let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE), c = a[0], l = [];
267
+ if (I(e)) for (let n = o.length - 1; n >= 0; n--) l.push(X(e, t, r, G.Foreground, n, i));
268
+ else if (c) l = [X(e, t, r, G.Background, void 0, i), X(e, t, r, G.Foreground, void 0, i)];
269
+ else for (let n = o.length - 1; n >= 0; n--) l.push(X(e, t, r, G.Background, n)), l.push(X(e, t, r, G.Foreground, n));
270
+ return l;
271
271
  }, le = (e, t, n) => {
272
- let r = e.dimensions.filter(s), i = e.measures.filter(s).filter((e) => e.role === c.GAUGE_VALUE);
272
+ let r = e.dimensions.filter(s), i = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
273
273
  if (!e.gaugeSettings?.barMode || !r.length && e.gaugeSettings?.comparisonMode) return n;
274
274
  let a = [];
275
275
  return r.length ? (e.gaugeSettings?.showDimensionLabels !== !1 && r[0] && a.push(Q(!1, t, r[0].formatter, "dimension", void 0, e.gaugeSettings)), !e.gaugeSettings?.comparisonMode && e.gaugeSettings?.showValueLabels !== !1 && i[0] && a.push(Q(!0, t, i[0].formatter, "value", void 0, e.gaugeSettings))) : e.gaugeSettings?.showValueLabels !== !1 && i.forEach((n, r) => {
@@ -283,7 +283,7 @@ var N = /* @__PURE__ */ e(h()), P = {
283
283
  type: "bar",
284
284
  settings: {
285
285
  direction: o?.orientation === i.Vertical ? "up" : "right",
286
- fontSize: re(o?.labelFontSize),
286
+ fontSize: ie(o?.labelFontSize),
287
287
  fontFamily: t.fonts.general.fontFamily,
288
288
  labels: [{
289
289
  label: (t) => t.data ? e ? ue(t.data.actual.value, n, t) : `${m(n, t.data?.label)}` : "",
@@ -304,12 +304,12 @@ var N = /* @__PURE__ */ e(h()), P = {
304
304
  }
305
305
  };
306
306
  return {
307
- type: k.Labels,
307
+ type: D.Labels,
308
308
  key: `gauge-bar-labels-${r}`,
309
- layout: { displayOrder: te.Labels },
309
+ layout: { displayOrder: T.Labels },
310
310
  settings: { sources: [{
311
- component: K(k.Box, G.Foreground, a),
312
- selector: O.Rect,
311
+ component: K(D.Box, G.Foreground, a),
312
+ selector: te.Rect,
313
313
  strategy: c
314
314
  }] },
315
315
  animations: {
@@ -317,17 +317,17 @@ var N = /* @__PURE__ */ e(h()), P = {
317
317
  presetId: "chart-labels"
318
318
  }
319
319
  };
320
- }, ue = (e, t, n) => e === null ? "-" : typeof t != "string" && l(t) ? f(t.format, t)(e, void 0, n.data) : `${m(t, e)}`, de = (e, t, n, r) => A(e, t, n, r), fe = (e, t, n, r, i) => {
320
+ }, ue = (e, t, n) => e === null ? "-" : typeof t != "string" && o(t) ? f(t.format, t)(e, void 0, n.data) : `${m(t, e)}`, de = (e, t, n, r) => x(e, t, n, r), fe = (e, t, n, r, i) => {
321
321
  if (!i) return n;
322
- let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role === c.GAUGE_VALUE), l = a[0], u = F(e), d = I(e), f = u ? k.Box : k.Pie, p = u && !d ? G.Background : G.Foreground, m = ((u || !l ? o : i[0]?.items) || []).map((e, t) => K(f, p, t));
323
- return ie(e, t, n, {
322
+ let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE), c = a[0], l = F(e), u = I(e), f = l ? D.Box : D.Pie, p = l && !u ? G.Background : G.Foreground, m = ((l || !c ? o : i[0]?.items) || []).map((e, t) => K(f, p, t));
323
+ return S(e, t, n, {
324
324
  filter: (e) => e.filter((e) => m.findIndex((t) => t === e.key) !== -1),
325
325
  placement: {
326
- type: u ? "bounds" : "slice",
326
+ type: l ? "bounds" : "slice",
327
327
  area: "target"
328
328
  }
329
329
  });
330
- }, pe = class extends S {
330
+ }, pe = class extends E {
331
331
  constructor() {
332
332
  super([
333
333
  R,
@@ -339,14 +339,14 @@ var N = /* @__PURE__ */ e(h()), P = {
339
339
  ]);
340
340
  }
341
341
  preCompile(e) {
342
- if (!(e.measures ?? []).filter(s).filter((e) => e.role === c.GAUGE_VALUE).length) throw Error("Charts w/o measures are not supported ATM.");
342
+ if (!(e.measures ?? []).filter(s).filter((e) => e.role === d.GAUGE_VALUE).length) throw Error("Charts w/o measures are not supported ATM.");
343
343
  }
344
- }, me = _(), $ = g(({ vSpec: e, vTheme: t, data: n, elementSize: i, vizProperties: o }) => {
345
- let s = p(), [c] = (0, N.useState)(() => new pe());
346
- if (!e || !(a(e) || r(e)) || !i) return null;
347
- let l = t || u, d = c.compile(e, l, n, i, o, e.type, s);
344
+ }, me = _(), $ = g(({ vSpec: e, vTheme: t, data: n, elementSize: i, vizProperties: a }) => {
345
+ let o = p(), [s] = (0, N.useState)(() => new pe());
346
+ if (!e || !(c(e) || r(e)) || !i) return null;
347
+ let u = t || l, d = s.compile(e, u, n, i, a, e.type, o);
348
348
  return d ? /* @__PURE__ */ (0, me.jsx)(ne, {
349
- config: o,
349
+ config: a,
350
350
  definition: d,
351
351
  size: i,
352
352
  vSpec: e