@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,355 +0,0 @@
1
- import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { $i as t, Ds as n, Gn as r, Kt as i, Us as a, Xa as o, _c as s, fs as c, ws as l, zi as u, zr as d } from "./visualization-filters-mVnsnvLP.js";
3
- import { N as f, Ot as p, ei as m, jr as h, s as g } from "./utils-DYYD4Zzf.js";
4
- import { Pm as _, _m as v } from "./handlers-CMbyj5y1.js";
5
- import { t as y } from "./label-format-type-weq1XfcX.js";
6
- import "./logger-3lng-wOw.js";
7
- import { Bt as b, Et as x, F as S, I as C, Kt as w, R as T, Yt as E, _n as D, at as O, cn as ee, ct as k, et as A, i as j, it as te, ln as ne, n as re, nt as ie, rn as ae, sn as M, st as oe, tt as se, xt as N, yt as P, z as F } from "./escobar-C4Nm3eJ7.js";
8
- import { _ as I } from "./MenuOption-Cb7B7x6z.js";
9
- import { t as L } from "./coloring-B-Wa8D5P.js";
10
- import { t as R } from "./set-coloring-datafield-B3uIS1Pe.js";
11
- var z = /* @__PURE__ */ e(m()), B = (e, r, i) => {
12
- let { coloring: o } = e || {}, s = o?.fieldId, c = e.dimensions.filter((e) => d(e)), l = e.measures.filter((e) => d(e)), u = l.filter((e) => e.role === t.PIE_CHART_SLICE), f = l.filter((e) => e.role === t.PIE_CHART_LENGTH);
13
- s || (e.coloring?.type === n.Gradient ? s = a(u[0]?.dataItem) : e.coloring?.type === n.Categorical && (s = a(c[0]?.dataItem))), P(i, 0, { color: { field: s } });
14
- let p = x(R(e, s ?? null), r, {});
15
- if (f.length > 0) {
16
- let e = a(f[0]?.dataItem);
17
- p[e] = { data: { field: e } };
18
- }
19
- return {
20
- ...i,
21
- scales: p
22
- };
23
- }, V = /* @__PURE__ */ function(e) {
24
- return e.num = "num", e.rad = "rad", e.group = "group", e;
25
- }({}), H = (e, n, r) => {
26
- if (!e.dimensions[0]) return r;
27
- let i = e.measures.filter((e) => d(e)), o = C((e.supportingMeasures ?? []).filter((e) => d(e))), s = e.dimensions.filter((e) => d(e))?.[0], c = i.filter((e) => e.role === t.PIE_CHART_SLICE)?.[0], l = i.filter((e) => e.role === t.PIE_CHART_LENGTH)?.[0], u = a(c?.dataItem), f = a(l?.dataItem), p = a(s?.dataItem), m = {
28
- num: c?.dataItem?.name ? { field: u } : void 0,
29
- rad: l?.dataItem?.name ? { field: f } : void 0,
30
- ...o
31
- };
32
- u && (m[u] = { field: u }), f && (m[f] = { field: f });
33
- let h = [{
34
- key: M.Collection,
35
- data: { extract: [{
36
- field: p,
37
- props: m
38
- }] }
39
- }];
40
- return {
41
- ...r,
42
- collections: h
43
- };
44
- }, U = "pie-alternates-switcher", W = "pie-alternates-switcher", G = (e) => i(e) || e.label || e.dataItem?.name || "Field", K = (e, t, n, r) => {
45
- let i = n ? a(n.dataItem) : void 0;
46
- return {
47
- type: "native",
48
- key: `${W}-interaction`,
49
- events: { click(a) {
50
- let o = this.element.getBoundingClientRect(), c = {
51
- x: a.clientX - o.left,
52
- y: a.clientY - o.top
53
- }, l = this.chart.shapesAt(c, {
54
- components: [{
55
- key: W,
56
- propagation: "stop"
57
- }],
58
- propagation: "stop"
59
- }).find((e) => e.data?.target === "measure" || e.data?.target === "dimension");
60
- if (l?.data?.target === "measure" && n && i) {
61
- r(D.Text, "click", `text-${i}`, a, l, {
62
- dataItemType: s.Measure,
63
- dataItemRole: n.role
64
- });
65
- return;
66
- }
67
- l?.data?.target === "dimension" && e && r(D.Text, "click", `text-${e}`, a, l, {
68
- dataItemType: s.Dimension,
69
- dataItemRole: t
70
- });
71
- } }
72
- };
73
- }, ce = (e, n, i, c, l, u, f, p) => {
74
- let m = r(e.dimensions, e.enableAlternate, u?.isPrintMode), h = e.dimensions.filter((e) => d(e)), g = h[0], _ = g ? a(g.dataItem) : void 0, v = e.measures.filter((e) => e.role === t.PIE_CHART_SLICE), y = r(v, e.enableAlternate, u?.isPrintMode), b = v.filter((e) => d(e))[0], x = m && h.length ? h.map((e) => G(e)).join(", ") : void 0, S = y && b ? G(b) : void 0;
75
- if (!x && !S) return i;
76
- let C = {
77
- type: U,
78
- key: W,
79
- dimensionDataItemType: _ ? s.Dimension : void 0,
80
- dimensionDataItemRole: g?.role,
81
- measureDataItemType: b ? s.Measure : void 0,
82
- measureDataItemRole: b?.role,
83
- layout: {
84
- dock: o.Bottom,
85
- displayOrder: 0
86
- },
87
- settings: {
88
- dimensionLabel: x ? w(x) : void 0,
89
- measureLabel: S ? w(S) : void 0,
90
- fontFamily: n.fonts.general.fontFamily ?? void 0,
91
- fontSize: `${ee.fieldTitle.fontSize}px`,
92
- color: n.fonts.general.color,
93
- paddingLeft: 5,
94
- paddingRight: 5,
95
- paddingVertical: 5,
96
- labelGap: 12
97
- }
98
- }, T = p ? [K(_, g?.role, b, p)] : [];
99
- return {
100
- ...i,
101
- components: [...i.components, C],
102
- interactions: i.interactions ? [...i.interactions, ...T] : T
103
- };
104
- }, q = {
105
- outerRadius: .8,
106
- outerRadiusWithoutLabels: .95,
107
- cornerRadius: v.pie,
108
- strokeWidth: 0,
109
- strokeEnabled: !1,
110
- strokeColor: "#C6C6C6",
111
- multiMeasureMinRadius: .3,
112
- donut: {
113
- innerRadius: .55,
114
- cornerRadius: v.donut,
115
- multiMeasureMinRadius: .6
116
- }
117
- };
118
- function J(e) {
119
- return e.pieSettings?.donut ?? !1;
120
- }
121
- var le = (e, n, r, i, o, s) => {
122
- let c = e.measures.filter((e) => d(e)), l = c.filter((e) => e.role === t.PIE_CHART_SLICE), u = c.filter((e) => e.role === t.PIE_CHART_LENGTH), f = l[0], p = u[0], m = new L(e, n, o?.[0]?.itemsNotAffectedByFiltering), h = J(e) ? q.donut.innerRadius : 0, g = f?.dataLabels?.show === !1 ? q.outerRadiusWithoutLabels : q.outerRadius, _ = e.pieSettings?.cornerRadius ?? (J(e) ? q.donut.cornerRadius : q.cornerRadius), v = e.pieSettings?.strokeEnabled ?? q.strokeEnabled, y = e.pieSettings?.strokeWidth ?? q.strokeWidth, b = e.pieSettings?.strokeColor ?? q.strokeColor;
123
- if (p) {
124
- let t = g, n = J(e) ? q.donut.multiMeasureMinRadius : q.multiMeasureMinRadius;
125
- g = (e) => e.resources.scale(a(p.dataItem))(e.datum.rad.value) * (t - n) + n;
126
- }
127
- let x = {
128
- type: D.Pie,
129
- key: `${D.Pie}`,
130
- data: { collection: M.Collection },
131
- animations: {
132
- enabled: !0,
133
- presetId: "pie-chart"
134
- },
135
- settings: { slice: {
136
- arc: { ref: "num" },
137
- stroke: b,
138
- strokeWidth: v ? y : 0,
139
- cornerRadius: _,
140
- innerRadius: h,
141
- outerRadius: g,
142
- fill: m.getColorDefinition({ ref: "color" })
143
- } },
144
- brush: E([""], s, { valuePickerMode: s?.valuePickerMode })
145
- };
146
- return {
147
- ...r,
148
- components: [...r.components, x]
149
- };
150
- }, ue = (e, t, n) => ({ data: r, formatter: i }) => {
151
- let a = e.dimensions.filter((e) => d(e))[0], o = r.value, s = r[V.num].value, c = a.formatter && o && i ? i(a.formatter)(o) : `${o}`, l = t.formatter && s && i ? i(t.formatter)(s, void 0, r) : `${s}`, u = s != null && n && i ? i(k)(s / n) : null, f = () => t.dataLabels?.measureLabelFormat === _.Percentage ? u === null ? [] : [u] : t.dataLabels?.measureLabelFormat === _.ValueAndPercentage ? u === null ? [l] : [l, u] : [l];
152
- switch (t.dataLabels?.labelFormat) {
153
- case y.Measure: {
154
- let e = f();
155
- return e.length <= 1 ? e[0] ?? null : e;
156
- }
157
- case y.DimensionAndMeasure: return [c, ...f()];
158
- default: return c;
159
- }
160
- }, de = (e, n, r, i, a, o) => {
161
- let s = e.dimensions.filter((e) => d(e)), c = e.measures.filter((e) => d(e)), l = s[0], u = c.find((e) => e.role === t.PIE_CHART_SLICE) ?? c[0];
162
- if (!l || !u || !u.dataLabels?.show) return r;
163
- let f = new I(n.fonts.general.color), p = u.dataLabels.showBackdrop ? T(u.dataLabels.backdropColor ? { fill: u.dataLabels.backdropColor } : void 0) : void 0, m = p ? F(f) : u.dataLabels.textColor || "#000", { strokeEnabled: h, strokeWidth: g = q.strokeWidth } = e.pieSettings, _ = h ? g / 2 : 0, v = {
164
- type: D.Labels,
165
- key: "pie-labels",
166
- animations: {
167
- enabled: !0,
168
- presetId: "chart-labels"
169
- },
170
- layout: { displayOrder: b.Labels },
171
- settings: { sources: [{
172
- component: `${D.Pie}`,
173
- selector: ne.Path,
174
- strategy: {
175
- type: "slice",
176
- settings: {
177
- fontSize: ae(u.dataLabels.size),
178
- fontFamily: n.fonts.general.fontFamily,
179
- labels: [{
180
- label: ue(e, u, a?.[0]?.sum),
181
- placements: [{
182
- position: "outside",
183
- fill: m,
184
- backdrop: p
185
- }],
186
- strokeDelta: _,
187
- linkData: ({ data: e }) => e
188
- }]
189
- }
190
- }
191
- }] },
192
- brush: E([""], o, { valuePickerMode: o?.valuePickerMode })
193
- };
194
- return {
195
- ...r,
196
- components: [...r.components, v]
197
- };
198
- }, Y = (e, t, n, r, a) => {
199
- let o = n.data[t]?.value, s = i(e) || e.label || e.dataItem.name || "", c = o;
200
- return !a && e.formatter ? c = r.formatter(e.formatter)(o, void 0, n.data) : a && (c = r.formatter(oe(e.formatter))(o, void 0, n.data)), {
201
- label: s,
202
- value: c
203
- };
204
- }, fe = (e, n, r, i, a) => {
205
- let o = !!e.measures.filter(d).filter((e) => e.role === t.PIE_CHART_LENGTH)?.[0], s = {
206
- filter: (e) => e.filter((e) => e.key === D.Pie),
207
- placement: {
208
- type: "slice",
209
- area: "target"
210
- }
211
- };
212
- if (o) return A(e, n, r, s, "tooltip", a);
213
- let c = O(e, a), l = se(e, n, pe, ie, a?.[0]?.sum, c);
214
- return A(e, n, r, {
215
- ...s,
216
- extract: l
217
- }, "tooltip", a);
218
- }, pe = (e, t, n, r, i, o, s, c) => {
219
- let l = [], u = e.filter(d), f = te(n), p = u.filter((e) => !f.has(a(e.dataItem)))?.[0] ?? u?.[0], m = Object.keys(t.data).find((e) => t.data[e]?.source?.field === a(p?.dataItem));
220
- if (!m || !p ? l.push({
221
- label: "",
222
- value: ""
223
- }) : l.push(Y(p, m, t, n, c)), u.filter((e) => f.has(a(e.dataItem))).forEach((e) => {
224
- let r = a(e.dataItem), i = Object.keys(t.data).find((e) => t.data[e]?.source?.field === r);
225
- i && l.push(Y(e, i, t, n, c));
226
- }), s) return l;
227
- let h = Object.values(o ?? {}).reduce((e, t) => e + Number(t), 0);
228
- return l.push({
229
- label: "Total",
230
- value: p?.formatter ? n.formatter(p.formatter)(h) : h
231
- }), l;
232
- }, me = class extends S {
233
- constructor() {
234
- super([
235
- H,
236
- B,
237
- le,
238
- ce,
239
- de,
240
- N,
241
- fe
242
- ]);
243
- }
244
- preCompile(e) {
245
- let t = e.dimensions.filter((e) => d(e))?.[0], n = e.measures.filter((e) => d(e))?.[0];
246
- if (!t || !n) throw Error("Charts w/o dimensions or measures are not supported ATM.");
247
- }
248
- }, X = " ▼", Z = "...", Q = (e, t, n, r) => e.measureText({
249
- text: t,
250
- fontFamily: n,
251
- fontSize: r
252
- }).width, he = (e, t, n, r, i) => {
253
- if (t <= 0 || Q(n, e, r, i) <= t) return e;
254
- let a = e.endsWith(X), o = a ? X : "", s = a ? e.slice(0, -2) : e;
255
- if (Q(n, `${Z}${o}`, r, i) > t) return Z;
256
- let c = 0, l = s.length;
257
- for (; c < l;) {
258
- let e = Math.ceil((c + l) / 2);
259
- Q(n, `${s.slice(0, e)}${Z}${o}`, r, i) <= t ? c = e : l = e - 1;
260
- }
261
- return `${s.slice(0, c)}${Z}${o}`;
262
- }, ge = {
263
- require: ["renderer"],
264
- defaultSettings: { settings: {
265
- dimensionLabel: "",
266
- measureLabel: "",
267
- fontSize: "12px",
268
- color: "#000",
269
- paddingLeft: 5,
270
- paddingRight: 5,
271
- paddingVertical: 5,
272
- labelGap: 12
273
- } },
274
- preferredSize() {
275
- if (!this.renderer) return 0;
276
- let { fontFamily: e = "Arial", fontSize: t, paddingVertical: n } = this.settings.settings;
277
- return this.renderer.measureText({
278
- fontFamily: e,
279
- fontSize: t
280
- }).height + n * 2;
281
- },
282
- render() {
283
- let { renderer: e } = this;
284
- if (!e) return [];
285
- let { dimensionLabel: t, measureLabel: n, fontFamily: r = "Arial", fontSize: i, color: a, paddingLeft: o, paddingRight: s, labelGap: c } = this.settings.settings, l = n ? Q(e, n, r, i) : 0, u = this.rect.width - s, d = u - l, f = Math.max(Math.min(n ? d - c - o : this.rect.width - o - s, this.rect.width / 2), 0), p = t ? he(t, f, e, r, i) : "", m = p ? Q(e, p, r, i) : 0, h = [];
286
- return n && h.push({
287
- type: "rect",
288
- x: Math.max(d, 0),
289
- y: 0,
290
- width: Math.min(l, this.rect.width),
291
- height: this.rect.height,
292
- fill: "rgba(0, 0, 0, 0)",
293
- strokeWidth: 0,
294
- data: { target: "measure" }
295
- }), t && (h.push({
296
- type: "rect",
297
- x: o,
298
- y: 0,
299
- width: m,
300
- height: this.rect.height,
301
- fill: "rgba(0, 0, 0, 0)",
302
- strokeWidth: 0,
303
- data: { target: "dimension" }
304
- }), h.push({
305
- type: "text",
306
- text: p,
307
- x: o,
308
- y: this.rect.height / 2,
309
- anchor: "start",
310
- baseline: "central",
311
- fontFamily: r,
312
- fontSize: i,
313
- fill: a,
314
- maxWidth: f,
315
- data: { target: "dimension" }
316
- })), n && h.push({
317
- type: "text",
318
- text: n,
319
- x: u,
320
- y: this.rect.height / 2,
321
- anchor: "end",
322
- baseline: "central",
323
- fontFamily: r,
324
- fontSize: i,
325
- fill: a,
326
- data: { target: "measure" }
327
- }), h;
328
- }
329
- };
330
- function $(e) {
331
- e.component(U, ge);
332
- }
333
- var _e = (e, n) => {
334
- let r = e.find((e) => e.role === t.PIE_CHART_SLICE && d(e));
335
- if (!r) return;
336
- let i = a(r.dataItem);
337
- return n.reduce((e, t) => e + t[i], 0);
338
- }, ve = h(), ye = p(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
339
- let a = f(), [o] = (0, z.useState)(() => new me()), { activeKey: s } = g(), d = re();
340
- if (!e || !c(e) || !n || !r) return null;
341
- let p = {
342
- ...i,
343
- valuePickerMode: !!s
344
- }, m = t || u;
345
- n[0] && (n[0].sum = _e(e.measures, n[0].items));
346
- let h = o.compile(e, m, n, r, p, l.Pie, a, void 0, d);
347
- return h ? /* @__PURE__ */ (0, ve.jsx)(j, {
348
- config: p,
349
- definition: h,
350
- size: r,
351
- vSpec: e,
352
- escobarPlugins: [$]
353
- }) : null;
354
- });
355
- export { ye as PieChart };
@@ -1,2 +0,0 @@
1
- import { t as e } from "./view-7fH6mGmY.js";
2
- export { e as DatePicker };
@@ -1,6 +0,0 @@
1
- import "./rolldown-runtime-DleVn1XH.js";
2
- import { Ot as e, ei as t, jr as n } from "./utils-DYYD4Zzf.js";
3
- import { n as r } from "./standalone-530a5lvf.js";
4
- t();
5
- var i = n(), a = e((e) => /* @__PURE__ */ (0, i.jsx)(r, { ...e }));
6
- export { a as HistogramChart };