@astrato-io/visualizations 0.6.4 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/THIRD_PARTY_NOTICES.md +94 -4
  3. package/chunks/ClickAwayListener-BbeNMAvj.js +52 -0
  4. package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-B1FeWaen.js} +54 -54
  5. package/chunks/app-filter-bar.compiler-BGJ7HAbr.js +64 -0
  6. package/chunks/bar.compiler-CT0ZbQKc.js +374 -0
  7. package/chunks/{src-Cum_2NLV.js → builder-B6dWSIdD.js} +5779 -5635
  8. package/chunks/{coloring-C16AUZEi.js → coloring-B1XAfg6b.js} +234 -233
  9. package/chunks/{src-BC7cGcJ-.js → definitions-D3OVqmXl.js} +438 -360
  10. package/chunks/{escobar-BGqT1EsE.js → escobar-eDjtGpkC.js} +4645 -4619
  11. package/chunks/filter.compiler-DBsyRBJt.js +70 -0
  12. package/chunks/{filtering-Yq4DEa0t.js → filtering-tqjAyJH5.js} +432 -313
  13. package/chunks/{grouping-type-BX_9Ix5q.js → grouping-type-On4s9Thj.js} +1 -1
  14. package/chunks/handlers-VTBfIZYZ.js +13072 -0
  15. package/chunks/isEqual-BDxAhUo8.js +7514 -0
  16. package/chunks/line.compiler-CzdM5Ld0.js +198 -0
  17. package/chunks/{metadata-CPXdYoln.js → metadata-BGElBy5Z.js} +1 -1
  18. package/chunks/number.compiler-G-R7y16P.js +53 -0
  19. package/chunks/{src-C0LgoUWY.js → operations-CTNUX6Sy.js} +9576 -9432
  20. package/chunks/{range-DrzdfBX4.js → range-CiwTbMig.js} +2 -2
  21. package/chunks/{registry-CExpGJ1N.js → registry-CsQQzukD.js} +153 -153
  22. package/chunks/{requirements-DNhuShLS.js → requirements-DYjZCFyf.js} +1 -1
  23. package/chunks/{shared-CKDL4hx9.js → shared-CBvcC5YV.js} +460 -413
  24. package/chunks/{standalone-D5vnf-9y.js → standalone-0M4HlmDW2.js} +823 -822
  25. package/chunks/standalone-0ashe9w1.js +411 -0
  26. package/chunks/{standalone-C85u7U6I.js → standalone-B7jax8wa.js} +93 -94
  27. package/chunks/standalone-BK0VYU-l.js +463 -0
  28. package/chunks/{standalone-BDCwI6Hn.js → standalone-BMIbT1b2.js} +815 -815
  29. package/chunks/standalone-BZV5vOwA.js +6 -0
  30. package/chunks/standalone-BhDrWj4p.js +1980 -0
  31. package/chunks/{standalone-CNyNHKVx.js → standalone-BtSHCp2U2.js} +97 -98
  32. package/chunks/{standalone-CDQnr6qT.js → standalone-BvaKdky9.js} +95 -96
  33. package/chunks/standalone-BwtM31-f.js +2 -0
  34. package/chunks/{standalone-CY57qwZ-.js → standalone-C3gg736V.js} +153 -153
  35. package/chunks/{standalone-DFPva_ku.js → standalone-CC1VUjO32.js} +60 -60
  36. package/chunks/{standalone-CCNtaJ7s.js → standalone-C_rYnZ0N.js} +41 -41
  37. package/chunks/{standalone-CZynjFG7.js → standalone-CoLrAxRV.js} +3701 -3482
  38. package/chunks/{standalone-jiz0L2Dg.js → standalone-DC-aUgXC.js} +104 -104
  39. package/chunks/standalone-DCtRoTWg.js +675 -0
  40. package/chunks/standalone-DUDFTBqL.js +833 -0
  41. package/chunks/standalone-DhZkX9Td.js +2 -0
  42. package/chunks/{standalone-Dx3MLlrO.js → standalone-DtLElfuM.js} +141 -141
  43. package/chunks/{standalone-BmfMt74U.js → standalone-G9Q4Uczu.js} +192 -192
  44. package/chunks/{standalone-BH5NqDwp.js → standalone-JuLF-OoH.js} +390 -391
  45. package/chunks/standalone-_DeX21JJ.js +383 -0
  46. package/chunks/{standalone-lBm9hQ-q.js → standalone-gFhKZh8m.js} +34 -34
  47. package/chunks/standalone-tDNy-SFH.js +281 -0
  48. package/chunks/{standalone-rJ45Zfl1.js → standalone-v1oxfU20.js} +10 -10
  49. package/chunks/{standalone-BYm1UjLr.js → standalone-vzBY6q0I2.js} +18 -18
  50. package/chunks/table.compiler-tb914oj3.js +222 -0
  51. package/chunks/{ui-D1HQNIBy.js → ui-DQWtv2iM.js} +13485 -3973
  52. package/chunks/{useFieldName-oqQ3bvnO.js → useFieldName-BvdcoJRl.js} +1 -1
  53. package/chunks/{utils-Ba9T0TqC.js → utils-Bg7K-t6K.js} +7306 -6024
  54. package/chunks/{src-DvX5LU9T.js → view-Bn83C8d9.js} +2555 -4831
  55. package/definitions.js +3 -3
  56. package/docs/operations/astrato-app-filter-bar.md +17 -17
  57. package/docs/operations/bar.md +989 -1071
  58. package/docs/operations/combo.md +717 -738
  59. package/docs/operations/date-picker.md +25 -25
  60. package/docs/operations/distribution-gauge.md +471 -607
  61. package/docs/operations/dot.md +787 -879
  62. package/docs/operations/filter.md +139 -163
  63. package/docs/operations/gauge.md +491 -627
  64. package/docs/operations/heatMap.md +834 -916
  65. package/docs/operations/histogram.md +166 -180
  66. package/docs/operations/iframe.md +5 -5
  67. package/docs/operations/image.md +16 -16
  68. package/docs/operations/index.md +12 -12
  69. package/docs/operations/line.md +811 -888
  70. package/docs/operations/number.md +470 -536
  71. package/docs/operations/pie.md +825 -958
  72. package/docs/operations/radar.md +599 -679
  73. package/docs/operations/sankey.md +462 -584
  74. package/docs/operations/scatter.md +823 -929
  75. package/docs/operations/shape.md +34 -34
  76. package/docs/operations/simpleTextObject.md +18 -25
  77. package/docs/operations/slider.md +33 -43
  78. package/docs/operations/table.md +1160 -1150
  79. package/docs/operations/tree.md +354 -361
  80. package/docs/operations/treemap.md +545 -637
  81. package/docs/operations/waterfall.md +369 -379
  82. package/docs/operations/word-cloud.md +512 -583
  83. package/getters.js +3 -3
  84. package/index.js +51 -51
  85. package/metadata.js +3 -3
  86. package/operations.js +7 -7
  87. package/package.json +80 -86
  88. package/src/definitions/index.d.ts +2 -2
  89. package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
  90. package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
  91. package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
  92. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1341 -0
  93. package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
  94. package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
  95. package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
  96. package/src/definitions/model/definitions/index.d.ts +23 -0
  97. package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
  98. package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
  99. package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
  100. package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
  101. package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
  102. package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
  103. package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +6 -6
  104. package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
  105. package/src/definitions/model/definitions/types/index.d.ts +3 -0
  106. package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
  107. package/chunks/Radio-Ciu-F4CU.js +0 -957
  108. package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
  109. package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
  110. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
  111. package/chunks/bar.compiler-oqaPzIut.js +0 -370
  112. package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
  113. package/chunks/event-bus-KiSiCJrC.js +0 -2683
  114. package/chunks/filter.compiler-CuLtc_02.js +0 -60
  115. package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
  116. package/chunks/interfaces-VUY4_yVO.js +0 -8742
  117. package/chunks/line-settings-DfYTUyPz.js +0 -4
  118. package/chunks/line.compiler-BpA_6Tc7.js +0 -188
  119. package/chunks/number.compiler-DbkWcG4S.js +0 -44
  120. package/chunks/pie-uv42Eqal.js +0 -10
  121. package/chunks/src-Dun_jXtz.js +0 -10295
  122. package/chunks/standalone-87YV_m9n.js +0 -687
  123. package/chunks/standalone-BLVAWLNJ.js +0 -385
  124. package/chunks/standalone-BPomtAVs.js +0 -2
  125. package/chunks/standalone-BXyBcUOQ.js +0 -2
  126. package/chunks/standalone-BllF4rDp.js +0 -383
  127. package/chunks/standalone-BqWyrnZI.js +0 -281
  128. package/chunks/standalone-DQxxNwF8.js +0 -675
  129. package/chunks/standalone-DS9T0FZ-.js +0 -830
  130. package/chunks/standalone-DzixzZAL.js +0 -411
  131. package/chunks/standalone-QJ1kKMnO.js +0 -6
  132. package/chunks/table.compiler-BrXkm4Fz.js +0 -213
  133. package/chunks/toInteger-DVZr-D1j.js +0 -11
  134. package/chunks/treemap-x_zmJoG7.js +0 -23
  135. package/chunks/types-dVVCsDWD.js +0 -4
  136. package/chunks/view-CLqWMV7Z.js +0 -156
  137. package/src/definitions/shared/index.d.ts +0 -5
  138. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
  139. package/src/definitions/shared/lib/registry/index.d.ts +0 -3
  140. package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
  141. package/src/definitions/shared/lib/types/index.d.ts +0 -3
  142. package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
  143. package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
  144. package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
  145. package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
  146. package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
  147. package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
  148. /package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +0 -0
  149. /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
@@ -1,12 +1,11 @@
1
1
  import { o as e, r as t } from "./rolldown-runtime-DleVn1XH.js";
2
- import { La as n, Oa as r, Po as i, Ta as a, Ti as o, Xa as s, Xs as c, pc as l, qs as u } from "./interfaces-VUY4_yVO.js";
3
- import { Ki as d, P as f, Zt as p, fn as m, pn as h, wi as g } from "./utils-Ba9T0TqC.js";
4
- import { Rn as _ } from "./event-bus-KiSiCJrC.js";
5
- import { t as v } from "./gauge-target-type-BkKXAqkX.js";
6
- import { Ct as y, Ft as b, Jt as x, K as S, M as C, St as w, Tt as T, Wt as E, X as D, gt as ee, i as te, in as ne, j as O, nn as k, on as A, un as j } from "./escobar-BGqT1EsE.js";
7
- import { t as M } from "./coloring-C16AUZEi.js";
2
+ import { Fa as n, Ja as r, Ks as i, No as a, Sa as o, Si as s, Ta as c, Ys as l, fc as u } from "./isEqual-BDxAhUo8.js";
3
+ import { $t as d, Ei as f, P as p, Yi as m, hn as h, mn as g } from "./utils-Bg7K-t6K.js";
4
+ import { Pm as _, zm as v } from "./handlers-VTBfIZYZ.js";
5
+ import { Ct as y, Ft as b, Jt as x, K as S, M as C, St as w, Tt as ee, Wt as T, X as E, an as te, dn as D, gt as ne, i as O, j as k, rn as A, sn as j } from "./escobar-eDjtGpkC.js";
6
+ import { t as M } from "./coloring-B1XAfg6b.js";
8
7
  import { t as re } from "./set-coloring-datafield-B3uIS1Pe.js";
9
- var ie = /* @__PURE__ */ e(d()), N = {
8
+ var ie = /* @__PURE__ */ e(m()), N = {
10
9
  outerRadius: .95,
11
10
  cornerRadius: 10,
12
11
  additionalTextAnchorHeight: 50,
@@ -21,45 +20,45 @@ var ie = /* @__PURE__ */ e(d()), N = {
21
20
  gaugeCollectionKey: "Gauge-Collection"
22
21
  }, P = (e) => e.gaugeSettings?.barMode ?? !1, F = (e) => e.gaugeSettings?.comparisonMode ?? !1, ae = (e) => {
23
22
  let { coloring: t } = e || {};
24
- return t?.type === c.Categorical || t?.type === c.Single ? y(e, []) : T(e);
23
+ return t?.type === l.Categorical || t?.type === l.Single ? y(e, []) : ee(e);
25
24
  }, I = (e, t, r) => {
26
- let a = { ...w(re(e, ae(e)), t, {}) }, s = e.gaugeSettings?.barPadding ?? A.scale.padding;
27
- a = S(e, a, s);
28
- let c = e.dimensions.filter(o), u = e.measures.filter(o).filter((e) => e.role === n.GAUGE_VALUE);
29
- return !c.length && P(e) ? a.onlyMeasures = {
30
- data: F(e) ? { extract: { field: u.length > 0 ? l(u[0].dataItem) : void 0 } } : u.map((e) => l(e.dataItem)),
31
- type: ne.Band,
32
- padding: s
33
- } : F(e) || (a.onlyMeasures = {
34
- data: { fields: u.map((e) => l(e.dataItem)) },
25
+ let i = { ...w(re(e, ae(e)), t, {}) }, o = e.gaugeSettings?.barPadding ?? j.scale.padding;
26
+ i = S(e, i, o);
27
+ let c = e.dimensions.filter(s), l = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE);
28
+ return !c.length && P(e) ? i.onlyMeasures = {
29
+ data: F(e) ? { extract: { field: l.length > 0 ? u(l[0].dataItem) : void 0 } } : l.map((e) => u(e.dataItem)),
30
+ type: te.Band,
31
+ padding: o
32
+ } : F(e) || (i.onlyMeasures = {
33
+ data: { fields: l.map((e) => u(e.dataItem)) },
35
34
  include: [0],
36
35
  expand: .05
37
- }), P(e) && (a.barScale = {
36
+ }), P(e) && (i.barScale = {
38
37
  min: N.minScaleValue - N.scalePadding,
39
38
  max: N.maxScaleValue + N.scalePadding,
40
- invert: e.gaugeSettings?.orientation === i.Vertical
39
+ invert: e.gaugeSettings?.orientation === a.Vertical
41
40
  }), {
42
41
  ...r,
43
- scales: a
42
+ scales: i
44
43
  };
45
44
  }, L = (e, t, r, i, a) => {
46
45
  if (!a) return r;
47
- let s = e.dimensions.filter(o), c = e.measures.filter(o), u = C((e.supportingMeasures ?? []).filter(o)), d = c.filter((e) => e.role === n.GAUGE_VALUE), f = s[0], p = d[0], { targetType: m } = e.gaugeSettings, h = P(e), g = f?.dataItem ?? p.dataItem, _ = [], y = N.minScaleValue;
48
- if (F(e) ? _.push(...z(e, g, a, u)) : f ? _.push(...R(e, g, a, u)) : _.push(...B(e, a, u)), h) {
49
- let t = l(p.dataItem), n = {
50
- field: l(g),
46
+ let o = e.dimensions.filter(s), c = e.measures.filter(s), l = C((e.supportingMeasures ?? []).filter(s)), d = c.filter((e) => e.role === n.GAUGE_VALUE), f = o[0], p = d[0], { targetType: m } = e.gaugeSettings, h = P(e), g = f?.dataItem ?? p.dataItem, _ = [], y = N.minScaleValue;
47
+ if (F(e) ? _.push(...z(e, g, a, l)) : f ? _.push(...R(e, g, a, l)) : _.push(...B(e, a, l)), h) {
48
+ let t = u(p.dataItem), n = {
49
+ field: u(g),
51
50
  props: {
52
51
  actual: { field: t },
53
52
  color: t,
54
53
  start: y,
55
54
  end: N.maxScaleValue,
56
55
  background: !0,
57
- ...u
56
+ ...l
58
57
  }
59
58
  };
60
59
  (m === v.Data || m === v.Manual) && (n.props.target = U(e, a)), c.forEach((e) => {
61
- let t = `measure-${l(e.dataItem)}`;
62
- n.props[t] = { field: l(e.dataItem) };
60
+ let t = `measure-${u(e.dataItem)}`;
61
+ n.props[t] = { field: u(e.dataItem) };
63
62
  }), _.push(n);
64
63
  }
65
64
  let b = [{
@@ -71,9 +70,9 @@ var ie = /* @__PURE__ */ e(d()), N = {
71
70
  collections: b
72
71
  };
73
72
  }, R = (e, t, r, i) => {
74
- let a = e.measures.filter(o), s = a.filter((e) => e.role === n.GAUGE_VALUE), c = a.filter((e) => e.role === n.GAUGE_TARGET), u = s[0], d = c[0], { targetType: f } = e.gaugeSettings, p = P(e), m = [], h = l(u.dataItem);
73
+ let a = e.measures.filter(s), o = a.filter((e) => e.role === n.GAUGE_VALUE), c = a.filter((e) => e.role === n.GAUGE_TARGET), l = o[0], d = c[0], { targetType: f } = e.gaugeSettings, p = P(e), m = [], h = u(l.dataItem);
75
74
  return p || m.push({
76
- field: l(t),
75
+ field: u(t),
77
76
  props: {
78
77
  actual: { field: h },
79
78
  [h]: { field: h },
@@ -81,7 +80,7 @@ var ie = /* @__PURE__ */ e(d()), N = {
81
80
  ...i
82
81
  }
83
82
  }), m.push({
84
- field: l(t),
83
+ field: u(t),
85
84
  props: {
86
85
  actual: { field: h },
87
86
  start: p ? N.minScaleValue : void 0,
@@ -91,17 +90,17 @@ var ie = /* @__PURE__ */ e(d()), N = {
91
90
  ...i
92
91
  }
93
92
  }), (f === v.Data || f === v.Manual) && m.forEach((t) => {
94
- t.props.target = U(e, r), d && f === v.Data && (t.props[l(d.dataItem)] = { field: l(d.dataItem) });
93
+ t.props.target = U(e, r), d && f === v.Data && (t.props[u(d.dataItem)] = { field: u(d.dataItem) });
95
94
  }), m;
96
95
  }, z = (e, t, r, i) => {
97
- let a = P(e), s = e.measures.filter(o).filter((e) => e.role === n.GAUGE_VALUE), c = s.reduce((e, t) => {
98
- let n = l(t.dataItem);
96
+ let a = P(e), o = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE), c = o.reduce((e, t) => {
97
+ let n = u(t.dataItem);
99
98
  return e[n] = { field: n }, e;
100
99
  }, {});
101
- return s.map((n, o) => {
102
- let s = l(n.dataItem);
100
+ return o.map((n, o) => {
101
+ let s = u(n.dataItem);
103
102
  return {
104
- field: l(t),
103
+ field: u(t),
105
104
  props: {
106
105
  measure: { field: s },
107
106
  color: s,
@@ -114,9 +113,9 @@ var ie = /* @__PURE__ */ e(d()), N = {
114
113
  });
115
114
  }, B = (e, t, r) => {
116
115
  let i = P(e), a = [];
117
- return e.measures.filter(o).filter((e) => e.role === n.GAUGE_VALUE).forEach((n) => {
118
- let o = l(n.dataItem), s = t[0].items[0][o], c = U(e, t, n), u = [];
119
- u.push({
116
+ return e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE).forEach((n) => {
117
+ let o = u(n.dataItem), s = t[0].items[0][o], c = U(e, t, n), l = [];
118
+ l.push({
120
119
  field: o,
121
120
  props: {
122
121
  measureValue: o,
@@ -128,7 +127,7 @@ var ie = /* @__PURE__ */ e(d()), N = {
128
127
  [o]: { field: o },
129
128
  ...r
130
129
  }
131
- }), u.push({
130
+ }), l.push({
132
131
  field: o,
133
132
  props: {
134
133
  measureValue: o,
@@ -141,21 +140,21 @@ var ie = /* @__PURE__ */ e(d()), N = {
141
140
  [o]: { field: o },
142
141
  ...r
143
142
  }
144
- }), (e.gaugeSettings?.targetType ?? v.Auto) !== v.Auto && u.forEach((e) => {
143
+ }), (e.gaugeSettings?.targetType ?? v.Auto) !== v.Auto && l.forEach((e) => {
145
144
  e.props.target = c;
146
- }), a.push(...u);
145
+ }), a.push(...l);
147
146
  }), a;
148
147
  }, V = (e, t, r) => {
149
- let i = e.measures.filter(o), a = i.filter((e) => e.role === n.GAUGE_VALUE), s = i.filter((e) => e.role === n.GAUGE_TARGET), c = a[0], u = s[0];
148
+ let i = e.measures.filter(s), a = i.filter((e) => e.role === n.GAUGE_VALUE), o = i.filter((e) => e.role === n.GAUGE_TARGET), c = a[0], l = o[0];
150
149
  return (n, i, o) => {
151
- let s = a.find((e, t) => t === r), d = s && o[l(s.dataItem)];
150
+ let s = a.find((e, t) => t === r), d = s && o[u(s.dataItem)];
152
151
  if (typeof d == "number" && d < 0) return N.minScaleValue;
153
- let f = o[l(c.dataItem)], p;
154
- if (p = e.gaugeSettings?.targetType === v.Data ? o[l(u?.dataItem)] : U(e, t), !o || typeof f != "number" || typeof p != "number") return N.minScaleValue;
152
+ let f = o[u(c.dataItem)], p;
153
+ if (p = e.gaugeSettings?.targetType === v.Data ? o[u(l?.dataItem)] : U(e, t), !o || typeof f != "number" || typeof p != "number") return N.minScaleValue;
155
154
  if (!F(e) || r === void 0) return H(f, p);
156
155
  let m = 0, h = 0;
157
156
  return a.forEach((e, t) => {
158
- let n = Math.max(0, o[l(e.dataItem)]);
157
+ let n = Math.max(0, o[u(e.dataItem)]);
159
158
  m += n, t <= r && (h += n);
160
159
  }), h / m * N.maxScaleValue;
161
160
  };
@@ -163,18 +162,18 @@ var ie = /* @__PURE__ */ e(d()), N = {
163
162
  let n = t ? Math.max(0, e) / t : 1;
164
163
  return Math.min(n, 1) * N.maxScaleValue;
165
164
  }, U = (e, t, r) => {
166
- let { targetType: i, targetValue: a } = e.gaugeSettings, s = e.measures.filter(o), c = s.filter((e) => e.role === n.GAUGE_TARGET)[0];
167
- return i === v.Auto ? t[0].items.map((e) => s.map((t) => e[l(t.dataItem)])).reduce((e, t) => Math.max(...t, e), 0) * (1 + A.scale.padding) : c && i === v.Data ? { field: l(c.dataItem) } : r && i === v.PerMeasure ? r.targetValue ?? 0 : i === v.Manual ? a ?? 0 : 0;
165
+ let { targetType: i, targetValue: a } = e.gaugeSettings, o = e.measures.filter(s), c = o.filter((e) => e.role === n.GAUGE_TARGET)[0];
166
+ return i === v.Auto ? t[0].items.map((e) => o.map((t) => e[u(t.dataItem)])).reduce((e, t) => Math.max(...t, e), 0) * (1 + j.scale.padding) : c && i === v.Data ? { field: u(c.dataItem) } : r && i === v.PerMeasure ? r.targetValue ?? 0 : i === v.Manual ? a ?? 0 : 0;
168
167
  }, W = /* @__PURE__ */ function(e) {
169
168
  return e.Foreground = "foreground", e.Background = "background", e;
170
169
  }({}), G = (e, t, n = 0) => `${e}-${t}-${n}`, K = (e) => Math.min(N.maxBarWidthOfRadius, N.outerRadius / e), q = (e, t, r) => {
171
- let i = e.measures.filter(o).filter((e) => e.role === n.GAUGE_VALUE);
172
- return (e) => r !== void 0 && e.measure?.source?.field !== l(i[r]?.dataItem) ? !1 : e.background?.value ? t === W.Background : t === W.Foreground;
173
- }, J = (e, t) => !t || e.coloring?.type === c.Single ? !1 : !F(e) || e.coloring?.type === c.Categorical, Y = (e, t, r, i, a, s, c, u) => {
174
- let d = r.dimensions.filter(o)[0], f = new M(r, i, t?.[0]?.itemsNotAffectedByFiltering), p = f.getColorDefinition(J(r, d) ? { ref: f.MAIN_FIELD } : {}), m = (e, t) => !F(r) && t === 1 || s && F(r) ? "transparent" : typeof p == "function" ? p(e) : p, h = K(c), g = Number(r.gaugeSettings?.size), _ = Number(r.gaugeSettings?.startAngle), y = isNaN(g) ? 360 : g ?? 360, b = isNaN(_) ? 0 : _ ?? 0, x = b + y, S = b / 180 * Math.PI, C = x / 180 * Math.PI;
170
+ let i = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE);
171
+ return (e) => r !== void 0 && e.measure?.source?.field !== u(i[r]?.dataItem) ? !1 : e.background?.value ? t === W.Background : t === W.Foreground;
172
+ }, J = (e, t) => !t || e.coloring?.type === l.Single ? !1 : !F(e) || e.coloring?.type === l.Categorical, Y = (e, t, r, i, a, o, c, l) => {
173
+ let d = r.dimensions.filter(s)[0], f = new M(r, i, t?.[0]?.itemsNotAffectedByFiltering), p = f.getColorDefinition(J(r, d) ? { ref: f.MAIN_FIELD } : {}), m = (e, t) => !F(r) && t === 1 || o && F(r) ? "transparent" : typeof p == "function" ? p(e) : p, h = K(c), g = Number(r.gaugeSettings?.size), _ = Number(r.gaugeSettings?.startAngle), y = isNaN(g) ? 360 : g ?? 360, b = isNaN(_) ? 0 : _ ?? 0, x = b + y, S = b / 180 * Math.PI, C = x / 180 * Math.PI;
175
174
  return {
176
- key: G(j.Pie, s ? W.Background : W.Foreground, a),
177
- type: j.Pie,
175
+ key: G(D.Pie, o ? W.Background : W.Foreground, a),
176
+ type: D.Pie,
178
177
  animations: {
179
178
  enabled: !0,
180
179
  presetId: "pie-chart"
@@ -183,10 +182,10 @@ var ie = /* @__PURE__ */ e(d()), N = {
183
182
  collection: N.gaugeCollectionKey,
184
183
  filter: (t) => {
185
184
  if (!d) {
186
- let e = r.measures.filter(o).filter((e) => e.role === n.GAUGE_VALUE);
187
- return F(r) || e[a] && t.measure?.source?.field === l(e[a].dataItem);
185
+ let e = r.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE);
186
+ return F(r) || e[a] && t.measure?.source?.field === u(e[a].dataItem);
188
187
  }
189
- return `${t.value}` == `${e[l(d.dataItem)]}`;
188
+ return `${t.value}` == `${e[u(d.dataItem)]}`;
190
189
  }
191
190
  },
192
191
  settings: {
@@ -198,9 +197,9 @@ var ie = /* @__PURE__ */ e(d()), N = {
198
197
  innerRadius: N.outerRadius - (a + (1 - N.barWidthRadiusPadding)) * h,
199
198
  fill: m,
200
199
  strokeWidth: .1,
201
- opacity: s ? N.backgroundBarOpacity : 1,
200
+ opacity: o ? N.backgroundBarOpacity : 1,
202
201
  arc: (e, t) => {
203
- if (s) return +(t === 0);
202
+ if (o) return +(t === 0);
204
203
  if (F(r)) return e.datum.measure.value;
205
204
  if ((r.gaugeSettings.targetType ?? v.Auto) !== v.Auto) return t === 0 ? e.datum.actual.value : Number(e.datum.target.value) - Number(e.datum.actual.value);
206
205
  {
@@ -210,21 +209,21 @@ var ie = /* @__PURE__ */ e(d()), N = {
210
209
  }
211
210
  }
212
211
  },
213
- brush: E([""], u, { overwriteOpacity: s ? N.backgroundBarOpacity : null })
212
+ brush: T([""], l, { overwriteOpacity: o ? N.backgroundBarOpacity : null })
214
213
  };
215
- }, X = (e, t, n, a, s, c) => {
216
- let u = e.dimensions.filter(o)[0], d = new M(e, t, n?.[0]?.itemsNotAffectedByFiltering), f;
217
- f = a === W.Background && e.gaugeSettings?.backgroundBarColor ? e.gaugeSettings?.backgroundBarColor : d.getColorDefinition(J(e, u) ? { ref: d.MAIN_FIELD } : {}, !e.gaugeSettings?.backgroundBarColor && a === W.Background ? N.backgroundBarOpacity : null);
218
- let p = u ? l(u.dataItem) : "onlyMeasures", m = !u && !F(e) ? "measureValue" : void 0, h = {
219
- key: G(j.Box, a, s),
220
- type: j.Box,
214
+ }, X = (e, t, n, r, i, o) => {
215
+ let l = e.dimensions.filter(s)[0], d = new M(e, t, n?.[0]?.itemsNotAffectedByFiltering), f;
216
+ f = r === W.Background && e.gaugeSettings?.backgroundBarColor ? e.gaugeSettings?.backgroundBarColor : d.getColorDefinition(J(e, l) ? { ref: d.MAIN_FIELD } : {}, !e.gaugeSettings?.backgroundBarColor && r === W.Background ? N.backgroundBarOpacity : null);
217
+ let p = l ? u(l.dataItem) : "onlyMeasures", m = !l && !F(e) ? "measureValue" : void 0, h = {
218
+ key: G(D.Box, r, i),
219
+ type: D.Box,
221
220
  animations: { enabled: !0 },
222
221
  data: {
223
222
  collection: N.gaugeCollectionKey,
224
- filter: q(e, a, s)
223
+ filter: q(e, r, i)
225
224
  },
226
225
  settings: {
227
- orientation: e.gaugeSettings.orientation ?? i.Horizontal,
226
+ orientation: e.gaugeSettings.orientation ?? a.Horizontal,
228
227
  major: {
229
228
  scale: p,
230
229
  ref: m
@@ -236,9 +235,9 @@ var ie = /* @__PURE__ */ e(d()), N = {
236
235
  rx: e.gaugeSettings?.barRadius ?? 0
237
236
  }
238
237
  },
239
- brush: E([""], c, { disable: { triggers: a === W.Foreground } })
238
+ brush: T([""], o, { disable: { triggers: r === W.Foreground } })
240
239
  };
241
- return e.gaugeSettings?.strokeEnabled ? (h.settings.box.stroke = e.gaugeSettings?.strokeColor || t.colors.brandColors[0], h.settings.box.strokeWidth = e.gaugeSettings?.strokeWidth) : h.settings.box.stroke = r.transparent, h;
240
+ return e.gaugeSettings?.strokeEnabled ? (h.settings.box.stroke = e.gaugeSettings?.strokeColor || t.colors.brandColors[0], h.settings.box.strokeWidth = e.gaugeSettings?.strokeWidth) : h.settings.box.stroke = c.transparent, h;
242
241
  }, oe = (e, t, n, r, i, a) => {
243
242
  if (!i) return n;
244
243
  let o = [];
@@ -247,29 +246,29 @@ var ie = /* @__PURE__ */ e(d()), N = {
247
246
  components: [...n.components, ...o]
248
247
  };
249
248
  }, se = (e, t, r, i, a) => {
250
- let s = e.dimensions.filter(o), c = e.measures.filter(o).filter((e) => e.role === n.GAUGE_VALUE);
251
- return !s[0] && !F(e) ? c.map((n, r) => [Y(i[0].items[0], i, e, t, r, !0, c.length), Y(i[0].items[0], i, e, t, r, !1, c.length)]).reduce((e, t) => e.concat(t), []) : i[0].items.map((n, r) => [Y(n, i, e, t, r, !0, i[0].items.length, a), Y(n, i, e, t, r, !1, i[0].items.length, a)]).reduce((e, t) => e.concat(t), []);
249
+ let o = e.dimensions.filter(s), c = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE);
250
+ return !o[0] && !F(e) ? c.map((n, r) => [Y(i[0].items[0], i, e, t, r, !0, c.length), Y(i[0].items[0], i, e, t, r, !1, c.length)]).reduce((e, t) => e.concat(t), []) : i[0].items.map((n, r) => [Y(n, i, e, t, r, !0, i[0].items.length, a), Y(n, i, e, t, r, !1, i[0].items.length, a)]).reduce((e, t) => e.concat(t), []);
252
251
  }, ce = (e, t, r, i, a) => {
253
- let s = e.dimensions.filter(o), c = e.measures.filter(o).filter((e) => e.role === n.GAUGE_VALUE), l = s[0], u = [];
252
+ let o = e.dimensions.filter(s), c = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE), l = o[0], u = [];
254
253
  if (F(e)) for (let n = c.length - 1; n >= 0; n--) u.push(X(e, t, i, W.Foreground, n, a));
255
254
  else if (l) u = [X(e, t, i, W.Background, void 0, a), X(e, t, i, W.Foreground, void 0, a)];
256
255
  else for (let n = c.length - 1; n >= 0; n--) u.push(X(e, t, i, W.Background, n)), u.push(X(e, t, i, W.Foreground, n));
257
256
  return u;
258
257
  }, le = (e, t, r) => {
259
- let i = e.dimensions.filter(o), a = e.measures.filter(o).filter((e) => e.role === n.GAUGE_VALUE);
258
+ let i = e.dimensions.filter(s), a = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE);
260
259
  if (!e.gaugeSettings?.barMode || !i.length && e.gaugeSettings?.comparisonMode) return r;
261
- let s = [];
262
- return i.length ? (e.gaugeSettings?.showDimensionLabels !== !1 && i[0] && s.push(Z(!1, t, i[0].formatter, "dimension", void 0, e.gaugeSettings)), !e.gaugeSettings?.comparisonMode && e.gaugeSettings?.showValueLabels !== !1 && a[0] && s.push(Z(!0, t, a[0].formatter, "value", void 0, e.gaugeSettings))) : e.gaugeSettings?.showValueLabels !== !1 && a.forEach((n, r) => {
263
- s.push(Z(!0, t, n.formatter, String(r), r, e.gaugeSettings));
260
+ let o = [];
261
+ return i.length ? (e.gaugeSettings?.showDimensionLabels !== !1 && i[0] && o.push(Z(!1, t, i[0].formatter, "dimension", void 0, e.gaugeSettings)), !e.gaugeSettings?.comparisonMode && e.gaugeSettings?.showValueLabels !== !1 && a[0] && o.push(Z(!0, t, a[0].formatter, "value", void 0, e.gaugeSettings))) : e.gaugeSettings?.showValueLabels !== !1 && a.forEach((n, r) => {
262
+ o.push(Z(!0, t, n.formatter, String(r), r, e.gaugeSettings));
264
263
  }), {
265
264
  ...r,
266
- components: [...r.components, ...s]
265
+ components: [...r.components, ...o]
267
266
  };
268
- }, Z = (e, t, n, r, a, o) => {
267
+ }, Z = (e, t, n, r, i, o) => {
269
268
  let s = +!!e, c = {
270
269
  type: "bar",
271
270
  settings: {
272
- direction: o?.orientation === i.Vertical ? "up" : "right",
271
+ direction: o?.orientation === a.Vertical ? "up" : "right",
273
272
  fontSize: x(o?.labelFontSize),
274
273
  fontFamily: t.fonts.general.fontFamily,
275
274
  labels: [{
@@ -291,12 +290,12 @@ var ie = /* @__PURE__ */ e(d()), N = {
291
290
  }
292
291
  };
293
292
  return {
294
- type: j.Labels,
293
+ type: D.Labels,
295
294
  key: `gauge-bar-labels-${r}`,
296
295
  layout: { displayOrder: b.Labels },
297
296
  settings: { sources: [{
298
- component: G(j.Box, W.Foreground, a),
299
- selector: k.Rect,
297
+ component: G(D.Box, W.Foreground, i),
298
+ selector: A.Rect,
300
299
  strategy: c
301
300
  }] },
302
301
  animations: {
@@ -304,17 +303,17 @@ var ie = /* @__PURE__ */ e(d()), N = {
304
303
  presetId: "chart-labels"
305
304
  }
306
305
  };
307
- }, ue = (e, t, n) => e === null ? "-" : typeof t != "string" && s(t) ? m(t.format, t)(e, void 0, n.data) : `${h(t, e)}`, Q = (e, t, n, r) => ee(e, t, n, r), de = (e, t, r, i, a) => {
306
+ }, ue = (e, t, n) => e === null ? "-" : typeof t != "string" && r(t) ? g(t.format, t)(e, void 0, n.data) : `${h(t, e)}`, Q = (e, t, n, r) => ne(e, t, n, r), de = (e, t, r, i, a) => {
308
307
  if (!a) return r;
309
- let s = e.dimensions.filter(o), c = e.measures.filter(o).filter((e) => e.role === n.GAUGE_VALUE), l = s[0], u = P(e), d = F(e), f = u ? j.Box : j.Pie, p = u && !d ? W.Background : W.Foreground, m = ((u || !l ? c : a[0]?.items) || []).map((e, t) => G(f, p, t));
310
- return D(e, t, r, {
308
+ let o = e.dimensions.filter(s), c = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE), l = o[0], u = P(e), d = F(e), f = u ? D.Box : D.Pie, p = u && !d ? W.Background : W.Foreground, m = ((u || !l ? c : a[0]?.items) || []).map((e, t) => G(f, p, t));
309
+ return E(e, t, r, {
311
310
  filter: (e) => e.filter((e) => m.findIndex((t) => t === e.key) !== -1),
312
311
  placement: {
313
312
  type: u ? "bounds" : "slice",
314
313
  area: "target"
315
314
  }
316
315
  });
317
- }, fe = class extends O {
316
+ }, fe = class extends k {
318
317
  constructor() {
319
318
  super([
320
319
  L,
@@ -326,13 +325,13 @@ var ie = /* @__PURE__ */ e(d()), N = {
326
325
  ]);
327
326
  }
328
327
  preCompile(e) {
329
- if (!e.measures.filter(o).filter((e) => e.role === n.GAUGE_VALUE).length) throw Error("Charts w/o measures are not supported ATM.");
328
+ if (!e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE).length) throw Error("Charts w/o measures are not supported ATM.");
330
329
  }
331
- }, pe = g(), $ = p(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
332
- let o = f(), [s] = (0, ie.useState)(() => new fe()), c = t || a, l = s.compile(e, c, n, r, i, u.Gauge, o);
333
- return l ? /* @__PURE__ */ (0, pe.jsx)(te, {
334
- config: i,
335
- definition: l,
330
+ }, pe = f(), $ = d(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: a }) => {
331
+ let s = p(), [c] = (0, ie.useState)(() => new fe()), l = t || o, u = c.compile(e, l, n, r, a, i.Gauge, s);
332
+ return u ? /* @__PURE__ */ (0, pe.jsx)(O, {
333
+ config: a,
334
+ definition: u,
336
335
  size: r,
337
336
  vSpec: e
338
337
  }) : null;