@astrato-io/visualizations 0.6.5 → 0.7.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 (174) hide show
  1. package/README.md +32 -2
  2. package/THIRD_PARTY_NOTICES.md +2 -229
  3. package/VISUALIZATION_DEFINITIONS.md +68 -114
  4. package/chunks/Button-BrGKp9Nm.js +110 -0
  5. package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
  6. package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
  7. package/chunks/{LinearProgress-B1FeWaen.js → LinearProgress-VtfFx2vJ.js} +55 -55
  8. package/chunks/MenuOption-ByRqhRdX.js +3934 -0
  9. package/chunks/Title-CO5dP1ma.js +1691 -0
  10. package/chunks/ToggleButton-KOBAimC1.js +112 -0
  11. package/chunks/{app-filter-bar.compiler-BGJ7HAbr.js → app-filter-bar.compiler-TwVTeoj5.js} +10 -10
  12. package/chunks/{bar.compiler-CT0ZbQKc.js → bar.compiler-DuQg8EUb.js} +84 -84
  13. package/chunks/builder-DEDvNq1k.js +201 -0
  14. package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
  15. package/chunks/color-settings-3VRlf_Vw.js +6 -0
  16. package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
  17. package/chunks/coloring-CncX_JRX.js +278 -0
  18. package/chunks/{definitions-D3OVqmXl.js → definitions-BPJQTx16.js} +490 -382
  19. package/chunks/{escobar-eDjtGpkC.js → escobar-DRhRMYRE.js} +6067 -4742
  20. package/chunks/event-bus-CrLB-Y8z.js +3 -0
  21. package/chunks/extend-preset-CUFNpmPe.js +4398 -0
  22. package/chunks/{filter.compiler-DBsyRBJt.js → filter.compiler-w27dlv0C.js} +12 -12
  23. package/chunks/{filtering-tqjAyJH5.js → filtering-cc7WqWpg.js} +391 -310
  24. package/chunks/{handlers-VTBfIZYZ.js → handlers-TOT-7INo.js} +3241 -3442
  25. package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
  26. package/chunks/isEqual-B8loyPsC.js +12 -0
  27. package/chunks/label-format-type-weq1XfcX.js +8 -0
  28. package/chunks/{line.compiler-CzdM5Ld0.js → line.compiler-Ct1WhN2p.js} +27 -27
  29. package/chunks/logger-DpQtYQnX.js +1163 -0
  30. package/chunks/lookup-BWllin0q.js +36 -0
  31. package/chunks/{metadata-BGElBy5Z.js → metadata-WABZrt7Y.js} +1 -1
  32. package/chunks/{number.compiler-G-R7y16P.js → number.compiler-D8TPly-4.js} +13 -13
  33. package/chunks/{operations-CTNUX6Sy.js → operations-Dh4v1Ovt.js} +9314 -9283
  34. package/chunks/{range-CiwTbMig.js → range-Bi-7zT0k.js} +2 -2
  35. package/chunks/registry-KervaxqJ.js +31 -0
  36. package/chunks/render-wrappers-OEmtaM8g.js +2 -0
  37. package/chunks/{registry-CsQQzukD.js → requirements-PAoRaJyb.js} +304 -336
  38. package/chunks/responsive.styles-DSiOGD7u.js +82 -0
  39. package/chunks/{shared-CBvcC5YV.js → shared-Bn4N5QcZ.js} +424 -424
  40. package/chunks/src-77e3mC7i.js +391 -0
  41. package/chunks/standalone-B55oyW6c.js +689 -0
  42. package/chunks/{standalone-C3gg736V.js → standalone-BDhPQtzQ.js} +375 -341
  43. package/chunks/{standalone-BMIbT1b2.js → standalone-BGkmozIb.js} +992 -837
  44. package/chunks/standalone-BMTCb10X.js +179 -0
  45. package/chunks/standalone-BXKRE_Se.js +468 -0
  46. package/chunks/standalone-Bes8srx1.js +354 -0
  47. package/chunks/standalone-BjZp0QMe.js +2 -0
  48. package/chunks/{standalone-JuLF-OoH.js → standalone-BlMIwpEe.js} +634 -519
  49. package/chunks/{standalone-C_rYnZ0N.js → standalone-C8ZAEutO.js} +43 -42
  50. package/chunks/standalone-C8qAelL4.js +2 -0
  51. package/chunks/standalone-CJvIXsQE.js +743 -0
  52. package/chunks/standalone-CLmGb7nn2.js +355 -0
  53. package/chunks/standalone-CM5XcAN5.js +52327 -0
  54. package/chunks/standalone-CXNP6-xD.js +420 -0
  55. package/chunks/{standalone-vzBY6q0I2.js → standalone-D5Q5ngsD.js} +57 -55
  56. package/chunks/standalone-DLlyRIE6.js +287 -0
  57. package/chunks/standalone-DMcI1afI.js +396 -0
  58. package/chunks/{standalone-DC-aUgXC.js → standalone-DN4S1MjT.js} +1111 -1092
  59. package/chunks/standalone-DT0wKji7.js +6 -0
  60. package/chunks/{standalone-0M4HlmDW2.js → standalone-DVTJwsTY.js} +1109 -1035
  61. package/chunks/standalone-DW6NT205.js +518 -0
  62. package/chunks/standalone-DYQIQH4c.js +2095 -0
  63. package/chunks/standalone-D__XCp-h.js +1003 -0
  64. package/chunks/standalone-XTgSsTAa.js +354 -0
  65. package/chunks/{standalone-v1oxfU20.js → standalone-XuGksArp.js} +20 -20
  66. package/chunks/{standalone-BtSHCp2U2.js → standalone-we5D5MIn.js} +173 -168
  67. package/chunks/{table.compiler-tb914oj3.js → table.compiler-DMeeHxb6.js} +29 -29
  68. package/chunks/useFieldName-Cjn9KCVp.js +7 -0
  69. package/chunks/useSlotProps-DLbQp4lc.js +166 -0
  70. package/chunks/{utils-Bg7K-t6K.js → utils-vdmi_2PK.js} +6271 -7804
  71. package/chunks/{view-Bn83C8d9.js → view-BuwQugKb.js} +2717 -3504
  72. package/chunks/{isEqual-BDxAhUo8.js → visualization-filters-Cc4KU-l-.js} +1887 -1946
  73. package/chunks/web-components-DqClFkgO.js +1185 -0
  74. package/chunks/with-html-element-D0uY2zjI.js +7328 -0
  75. package/definitions.js +2 -2
  76. package/docs/operations/astrato-app-filter-bar.md +1 -1
  77. package/docs/operations/bar.md +31 -14
  78. package/docs/operations/combo.md +1 -1
  79. package/docs/operations/date-picker.md +3 -3
  80. package/docs/operations/distribution-gauge.md +13 -13
  81. package/docs/operations/dot.md +13 -13
  82. package/docs/operations/filter.md +1 -1
  83. package/docs/operations/gauge.md +13 -13
  84. package/docs/operations/heatMap.md +13 -13
  85. package/docs/operations/histogram.md +1 -1
  86. package/docs/operations/iframe.md +1 -1
  87. package/docs/operations/image.md +1 -1
  88. package/docs/operations/index.md +3 -3
  89. package/docs/operations/line.md +7 -7
  90. package/docs/operations/number.md +1 -1
  91. package/docs/operations/pie.md +13 -13
  92. package/docs/operations/radar.md +7 -7
  93. package/docs/operations/sankey.md +13 -13
  94. package/docs/operations/scatter.md +13 -13
  95. package/docs/operations/shape.md +1 -1
  96. package/docs/operations/simpleTextObject.md +1 -1
  97. package/docs/operations/slider.md +1 -1
  98. package/docs/operations/table.md +18 -1
  99. package/docs/operations/tree.md +51 -37
  100. package/docs/operations/treemap.md +63 -49
  101. package/docs/operations/waterfall.md +1 -1
  102. package/docs/operations/word-cloud.md +13 -13
  103. package/getters.js +7 -7
  104. package/index.js +3 -1183
  105. package/metadata.js +18 -18
  106. package/operations.js +13 -13
  107. package/package.json +106 -55
  108. package/render.js +10 -0
  109. package/src/charts/bar.d.ts +1 -0
  110. package/src/charts/combo.d.ts +1 -0
  111. package/src/charts/dot.d.ts +1 -0
  112. package/src/charts/gauge-distribution.d.ts +1 -0
  113. package/src/charts/gauge.d.ts +1 -0
  114. package/src/charts/heat-map.d.ts +1 -0
  115. package/src/charts/histogram.d.ts +1 -0
  116. package/src/charts/line.d.ts +1 -0
  117. package/src/charts/pie.d.ts +1 -0
  118. package/src/charts/radar.d.ts +1 -0
  119. package/src/charts/sankey.d.ts +1 -0
  120. package/src/charts/scatter.d.ts +1 -0
  121. package/src/charts/table.d.ts +1 -0
  122. package/src/charts/tree.d.ts +1 -0
  123. package/src/charts/treemap.d.ts +1 -0
  124. package/src/charts/waterfall.d.ts +1 -0
  125. package/src/charts/word-cloud.d.ts +1 -0
  126. package/src/definitions/index.d.ts +1 -1
  127. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +53 -30
  128. package/src/definitions/model/definitions/index.d.ts +1 -1
  129. package/src/definitions/model/definitions/schema-registry.d.ts +2 -2
  130. package/src/definitions/model/definitions/schemas/object.schema.d.ts +2 -2
  131. package/src/definitions/model/definitions/types/compilation.types.d.ts +10 -0
  132. package/src/definitions/model/definitions/types/index.d.ts +1 -1
  133. package/src/getters/index.d.ts +3 -3
  134. package/src/index.d.ts +1 -1
  135. package/src/objects/app-filter-bar.d.ts +1 -0
  136. package/src/objects/date-picker.d.ts +1 -0
  137. package/src/objects/filter.d.ts +1 -0
  138. package/src/objects/iframe.d.ts +1 -0
  139. package/src/objects/image.d.ts +1 -0
  140. package/src/objects/number.d.ts +1 -0
  141. package/src/objects/shape.d.ts +1 -0
  142. package/src/objects/slider.d.ts +1 -0
  143. package/src/objects/text.d.ts +1 -0
  144. package/src/operations/index.d.ts +3 -3
  145. package/src/registry/create-visualization-registry.d.ts +5 -0
  146. package/src/render/index.d.ts +34 -0
  147. package/src/runtime/index.d.ts +2 -2
  148. package/src/types.d.ts +9 -4
  149. package/src/web-components/index.d.ts +3 -3
  150. package/chunks/ClickAwayListener-BbeNMAvj.js +0 -52
  151. package/chunks/builder-B6dWSIdD.js +0 -12289
  152. package/chunks/coloring-B1XAfg6b.js +0 -664
  153. package/chunks/events-WZut5Ow6.js +0 -4
  154. package/chunks/grouping-type-On4s9Thj.js +0 -3
  155. package/chunks/requirements-DYjZCFyf.js +0 -6
  156. package/chunks/standalone-0ashe9w1.js +0 -411
  157. package/chunks/standalone-B7jax8wa.js +0 -339
  158. package/chunks/standalone-BK0VYU-l.js +0 -463
  159. package/chunks/standalone-BZV5vOwA.js +0 -6
  160. package/chunks/standalone-BhDrWj4p.js +0 -1980
  161. package/chunks/standalone-BvaKdky9.js +0 -344
  162. package/chunks/standalone-BwtM31-f.js +0 -2
  163. package/chunks/standalone-CC1VUjO32.js +0 -299
  164. package/chunks/standalone-CoLrAxRV.js +0 -13198
  165. package/chunks/standalone-DCtRoTWg.js +0 -675
  166. package/chunks/standalone-DUDFTBqL.js +0 -833
  167. package/chunks/standalone-DhZkX9Td.js +0 -2
  168. package/chunks/standalone-DtLElfuM.js +0 -512
  169. package/chunks/standalone-G9Q4Uczu.js +0 -726
  170. package/chunks/standalone-_DeX21JJ.js +0 -383
  171. package/chunks/standalone-gFhKZh8m.js +0 -179
  172. package/chunks/standalone-tDNy-SFH.js +0 -281
  173. package/chunks/ui-DQWtv2iM.js +0 -63551
  174. package/chunks/useFieldName-BvdcoJRl.js +0 -7
@@ -1,383 +0,0 @@
1
- import { o as e, t } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Eo as n, Ks as r, Mt as i, No as a, Nt as o, R as s, Sa as c, Si as l, Ta as u, Xt as d, Ys as f, fc as p, in as m, zt as h } from "./isEqual-BDxAhUo8.js";
3
- import { $t as ee, Ei as te, I as ne, Jn as g, P as _, Yi as v, o as y } from "./utils-Bg7K-t6K.js";
4
- import { b } from "./ui-DQWtv2iM.js";
5
- import { At as x, Ct as re, Et as S, Ft as C, H as ie, M as ae, Mt as oe, Nt as se, Ot as w, Qt as ce, Rt as le, St as T, Tt as E, U as D, Ut as O, Wt as k, X as A, Xt as j, Yt as M, Z as N, Zt as P, an as F, dn as I, gt as L, ht as R, i as z, j as B, jt as V, n as H, on as U, ot as W, rn as ue, rt as G, st as de, un as fe, ut as pe, vt as me, xt as he } from "./escobar-eDjtGpkC.js";
6
- import { t as ge } from "./coloring-B1XAfg6b.js";
7
- import { t as K } from "./set-coloring-datafield-B3uIS1Pe.js";
8
- import { t as _e } from "./range-CiwTbMig.js";
9
- v();
10
- var ve = (e, t, n, r, i, a, o) => {
11
- let s = e.dimensions.filter((e) => l(e)), c = e.measures.filter((e) => l(e)), u = ye(e, t, n, o);
12
- return s[0] && (n.collections.push({
13
- key: S.DimensionDomain,
14
- data: { extract: [{ field: p(s[0].dataItem) }] }
15
- }), u[M(e)] = {
16
- data: { collection: S.DimensionDomain },
17
- type: F.Band
18
- }), c[0] && (u[j(e, c[0])] = {
19
- data: { field: p(c[0].dataItem) },
20
- expand: .02,
21
- invert: D(!1, e.axes?.primaryMeasure),
22
- ...ie(e.axes?.primaryMeasure?.axisRange, !0)
23
- }), {
24
- ...n,
25
- scales: u
26
- };
27
- };
28
- function ye(e, t, n, r) {
29
- let i = e.dimensions.filter((e) => l(e)), a = e.measures.filter((e) => l(e));
30
- switch (e.coloring?.type) {
31
- case f.Categorical: {
32
- let a = re(e, r, i[1]);
33
- return R(n, 1, { color: { field: a } }), { categorical: he(K(e, a), t, a, {
34
- customPalette: e.coloring.customPalette,
35
- palette: e.coloring.palette,
36
- sortOrder: e.coloring.sortOrder
37
- }, n.collections) };
38
- }
39
- case f.Gradient: {
40
- let r = E(e);
41
- return R(n, 1, { color: { field: r } }), T(K(e, r), t, {});
42
- }
43
- case f.Single: {
44
- let r = p(a[0]?.dataItem);
45
- r && R(n, 1, { color: { field: r } });
46
- let i = e?.coloring?.color ?? t.colors.brandColors[0];
47
- return { [f.Single]: {
48
- data: [],
49
- unknown: i,
50
- type: F.CategoricalColor,
51
- range: [i]
52
- } };
53
- }
54
- default: return {};
55
- }
56
- }
57
- var be = (e, t, n) => {
58
- let r = e.dimensions.filter((e) => l(e)), i = e.measures.filter((e) => l(e)), a = (e.supportingMeasures ?? []).filter((e) => l(e)), [o, s] = r, c = p(o?.dataItem), u = p(s?.dataItem), d = p(i[0]?.dataItem), f = ae(a), m = {
59
- key: S.DotBarCollection,
60
- data: { extract: [{
61
- field: c,
62
- trackBy: (e) => e,
63
- reduce: "first",
64
- props: {
65
- start: {
66
- field: d,
67
- reduce: "min"
68
- },
69
- med: {
70
- field: d,
71
- reduce: "avg"
72
- },
73
- end: {
74
- field: d,
75
- reduce: "max"
76
- }
77
- }
78
- }] }
79
- }, h = {
80
- key: S.DotPointsCollection,
81
- data: { extract: [{
82
- field: u,
83
- props: {
84
- x: { field: d },
85
- group: { field: c },
86
- [d]: { field: d },
87
- ...f
88
- }
89
- }] }
90
- };
91
- return {
92
- ...n,
93
- collections: [m, h]
94
- };
95
- }, xe = /* @__PURE__ */ t(((e, t) => {
96
- var n = Math.floor, r = Math.random;
97
- function i(e, t) {
98
- return e + n(r() * (t - e + 1));
99
- }
100
- t.exports = i;
101
- })), q = /* @__PURE__ */ t(((e, t) => {
102
- var n = xe();
103
- function r(e, t) {
104
- var r = -1, i = e.length, a = i - 1;
105
- for (t = t === void 0 ? i : t; ++r < t;) {
106
- var o = n(r, a), s = e[o];
107
- e[o] = e[r], e[r] = s;
108
- }
109
- return e.length = t, e;
110
- }
111
- t.exports = r;
112
- })), Se = /* @__PURE__ */ t(((e, t) => {
113
- var n = s(), r = q();
114
- function i(e) {
115
- return r(n(e));
116
- }
117
- t.exports = i;
118
- })), Ce = /* @__PURE__ */ t(((e, t) => {
119
- var n = o();
120
- function r(e, t) {
121
- return n(t, function(t) {
122
- return e[t];
123
- });
124
- }
125
- t.exports = r;
126
- })), we = /* @__PURE__ */ t(((e, t) => {
127
- var n = Ce(), r = h();
128
- function i(e) {
129
- return e == null ? [] : n(e, r(e));
130
- }
131
- t.exports = i;
132
- })), Te = /* @__PURE__ */ t(((e, t) => {
133
- var n = q(), r = we();
134
- function i(e) {
135
- return n(r(e));
136
- }
137
- t.exports = i;
138
- })), Ee = /* @__PURE__ */ t(((e, t) => {
139
- var n = Se(), r = Te(), i = d();
140
- function a(e) {
141
- return (i(e) ? n : r)(e);
142
- }
143
- t.exports = a;
144
- })), De = /* @__PURE__ */ e(_e()), Oe = /* @__PURE__ */ e(Ee()), J = (e) => 1 - (e.barSettings.barPadding ?? 0);
145
- function ke(e, t, n) {
146
- let r = new ge(e, t, n?.[0]?.itemsNotAffectedByFiltering);
147
- return r.getColorDefinition({
148
- overwriteSources: [r.MAIN_FIELD],
149
- ref: "color"
150
- });
151
- }
152
- function Ae(e) {
153
- let t = k([""], e, { valuePickerMode: e?.valuePickerMode }), n = t?.consume?.[1]?.style?.active?.strokeWidth;
154
- return typeof n == "function" && (t.consume[1].style.active.strokeWidth = (e) => e.type === ue.Line ? 1 : n(e)), t;
155
- }
156
- function Y(e) {
157
- return O({
158
- triggerData: [""],
159
- consumeData: ["", "group"],
160
- consumerMode: fe.Or
161
- }, e, { valuePickerMode: e?.valuePickerMode });
162
- }
163
- var X = 100, Z = .1, Q = .9, je = (0, Oe.default)((0, De.default)(Z, Q, (Q - Z) / X));
164
- function Me(e, t) {
165
- return ({ datum: n, resources: { scale: r } }, i) => {
166
- let a = r(M(t)), o = t.jitterPoints ? je[i % X] : .5;
167
- return a(n.group.value) + .5 * (1 - e) * a.bandwidth() + e * a.bandwidth() * o;
168
- };
169
- }
170
- var Ne = (e, t, n, r, i, a) => {
171
- let o = Pe(e, t, a), s = $(e, ke(e, t, i), a);
172
- return {
173
- ...n,
174
- components: [
175
- ...n.components,
176
- o,
177
- s
178
- ]
179
- };
180
- };
181
- function Pe(e, t, n) {
182
- let r = {
183
- orientation: e.orientation,
184
- major: { scale: M(e) },
185
- minor: { scale: j(e, e.measures.filter((e) => l(e))[0]) },
186
- box: {
187
- width: J(e),
188
- fill: e.barColor ?? "rgba(100, 100, 100, 0.2)",
189
- rx: e.barSettings?.barRadius ?? 0,
190
- roundAllEdges: !0
191
- },
192
- median: {
193
- stroke: u.mainDarkNavy,
194
- strokeWidth: 2
195
- }
196
- };
197
- return e.barSettings?.strokeEnabled ? (r.box.stroke = e.barSettings?.strokeColor || t.colors.brandColors[0], r.box.strokeWidth = e.barSettings?.strokeWidth) : r.box.stroke = u.transparent, {
198
- type: I.Box,
199
- layout: { displayOrder: C.VisualizationElement },
200
- key: "min-max-box",
201
- data: { collection: S.DotBarCollection },
202
- settings: r,
203
- animations: {
204
- enabled: !0,
205
- presetId: "bar-chart"
206
- },
207
- brush: Ae(n)
208
- };
209
- }
210
- function $(e, t, r) {
211
- let i = Me(J(e) * .9, e);
212
- return {
213
- type: I.Point,
214
- key: "dot-point",
215
- layout: { displayOrder: C.VisualizationElement },
216
- data: { collection: S.DotPointsCollection },
217
- settings: {
218
- x: { scale: j(e, e.measures.filter((e) => l(e))[0]) },
219
- y: {
220
- scale: M(e),
221
- fn: i
222
- },
223
- shape: n.Circle,
224
- size: e.pointSize,
225
- strokeWidth: 2,
226
- opacity: .8,
227
- fill: t,
228
- id: ({ datum: e }) => `${e.group.value}::${e.value}`
229
- },
230
- animations: { enabled: !0 },
231
- brush: Y(r)
232
- };
233
- }
234
- function Fe(e, t, n) {
235
- if (!e.refLines?.x) return n;
236
- let r = e.refLines.x.map((e) => W(e, ce.XAxisScale, t)), i = {
237
- type: I.RefLine,
238
- layout: { displayOrder: C.RefLine },
239
- lines: { x: r }
240
- };
241
- return {
242
- ...n,
243
- components: [...n.components, i]
244
- };
245
- }
246
- var Ie = /* @__PURE__ */ t(((e, t) => {
247
- var n = m(), r = b(), a = g(), o = i(), s = n.isFinite, c = Math.min;
248
- function l(e) {
249
- var t = Math[e];
250
- return function(e, n) {
251
- if (e = a(e), n = n == null ? 0 : c(r(n), 292), n && s(e)) {
252
- var i = (o(e) + "e").split("e");
253
- return i = (o(t(i[0] + "e" + (+i[1] + n))) + "e").split("e"), +(i[0] + "e" + (+i[1] - n));
254
- }
255
- return t(e);
256
- };
257
- }
258
- t.exports = l;
259
- })), Le = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
260
- t.exports = Ie()("round");
261
- })))());
262
- function Re(e, t, n) {
263
- let r = e.measures.filter((e) => l(e))[0];
264
- return A(e, t, n, {
265
- filter: ze,
266
- placement: {
267
- type: "bounds",
268
- area: "target"
269
- },
270
- extract: N(e, t, Be(r?.formatter), Ve)
271
- }, "tooltip", void 0, {
272
- componentKeys: ["dot-point"],
273
- yieldToComponentKeys: ["min-max-box"]
274
- });
275
- }
276
- function ze(e) {
277
- if (e.length === 0) return [];
278
- let t = e[0];
279
- return ["dot-point", "min-max-box"].includes(t.key) ? [t] : [];
280
- }
281
- function Be(e) {
282
- return (t, n, r, i, a, o, s, c) => {
283
- if (n.key === "dot-point") {
284
- let t = n.data.x.value;
285
- return !c && e ? t = r.formatter(e)(t, void 0, n.data) : c && (t = r.formatter(G(e))(n.data.x.value, void 0, n.data)), [{
286
- label: n.data.label,
287
- value: t
288
- }];
289
- } else if (n.key === "min-max-box") {
290
- let t = n.data.start.value, i = (0, Le.default)(n.data.med.value, 2), a = n.data.end.value;
291
- return !c && e ? (t = r.formatter(e)(t), i = r.formatter(e)(i), a = r.formatter(e)(a)) : c && (t = r.formatter(G(e))(t), i = r.formatter(G(e))(i), a = r.formatter(G(e))(a)), [
292
- {
293
- label: "Min",
294
- value: t
295
- },
296
- {
297
- label: "Avg",
298
- value: i
299
- },
300
- {
301
- label: "Max",
302
- value: a
303
- }
304
- ];
305
- }
306
- return [];
307
- };
308
- }
309
- function Ve(e) {
310
- return e.filter((e) => l(e))[1]?.label ?? "";
311
- }
312
- var He = (e, t, n) => {
313
- let r = e.dimensions.filter((e) => l(e)), i = e.measures.filter((e) => l(e)), o = {
314
- showAxisTooltip: e?.axes?.dimension?.showAxisTooltip,
315
- formatter: r[0]?.formatter || {
316
- type: "string",
317
- format: ""
318
- },
319
- scale: M(e),
320
- key: `${w.Dimension}-${e.orientation ?? a.Vertical}`,
321
- settings: { direction: x(e) }
322
- }, s = i[0], [c, u] = se([o, {
323
- showAxisTooltip: e?.axes?.primaryMeasure?.showAxisTooltip,
324
- formatter: s?.formatter,
325
- scale: j(e, s),
326
- key: `${w.Measure}-${e.orientation ?? a.Vertical}`,
327
- settings: {
328
- direction: oe(e),
329
- labelDock: V(P(e), s?.secondaryAxis)
330
- }
331
- }]);
332
- return {
333
- ...n,
334
- components: [...n.components ?? [], ...c],
335
- interactions: [...n.interactions ?? [], ...u]
336
- };
337
- };
338
- function Ue(e, t, n, r, i, a) {
339
- let { components: o, interactions: s } = L(e, t, n, r, i, a);
340
- if (!e.coloring || e.coloring.type === f.Single) return {
341
- ...n,
342
- components: o,
343
- interactions: s
344
- };
345
- let c = e.dimensions?.find((t) => e.coloring.fieldId === t.dataItem.internalKey), l = o.map((e) => (e.type === U.CategoricalLegend || e.type === U.SequentialLegend) && c ? {
346
- ...e,
347
- brush: Y(a)
348
- } : e);
349
- return {
350
- ...n,
351
- components: l,
352
- interactions: s
353
- };
354
- }
355
- var We = class extends B {
356
- constructor() {
357
- super([
358
- be,
359
- ve,
360
- le,
361
- me,
362
- Ue,
363
- de,
364
- Ne,
365
- Fe,
366
- Re,
367
- He,
368
- pe
369
- ]);
370
- }
371
- }, Ge = te(), Ke = new We(), qe = ee(({ vSpec: e, vTheme: t, data: n, elementSize: i, vizProperties: a }) => {
372
- let o = _(), { activeKey: s } = y(), l = ne(), u = {
373
- ...a,
374
- valuePickerMode: !!s
375
- }, d = t || c, f = Ke.compile(e, d, n, i, u, r.Dot, o, l, H());
376
- return f ? /* @__PURE__ */ (0, Ge.jsx)(z, {
377
- config: u,
378
- definition: f,
379
- size: i,
380
- vSpec: e
381
- }) : null;
382
- });
383
- export { qe as DotChart };
@@ -1,179 +0,0 @@
1
- import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Ko as t, Sa as n, eo as r, to as i } from "./isEqual-BDxAhUo8.js";
3
- import { $t as a, Ei as o, G as s, W as c, Yi as l, d as u } from "./utils-Bg7K-t6K.js";
4
- import { t as d } from "./stroke-dash-UgMEcCS4.js";
5
- import { _ as f } from "./coloring-B1XAfg6b.js";
6
- var p = /* @__PURE__ */ e(l()), m = (e) => e === i.Line || e === i.Elbow, h = {
7
- shape: i.Square,
8
- backgroundColor: { code: "#c4c4c4" },
9
- backgroundType: "color",
10
- lineThickness: 2,
11
- borderEnabled: !1,
12
- borderRadiusX: 0,
13
- borderRadiusY: 0,
14
- preserveAspectRatio: !0,
15
- strokeColor: { code: "#8d8d8d" },
16
- imageFit: r.Fill,
17
- strokeDash: null,
18
- imageURL: null,
19
- scale: 1,
20
- rotate: 0,
21
- heightBasedSize: !1
22
- }, g = (e, n) => {
23
- let r = { ...e?.shapeSettings }, a = 0, o = 0, s = r?.borderEnabled ?? h.borderEnabled;
24
- (r?.shape === i.Square || r?.shape === i.Rectangle) && r?.borderRadius && (a = r?.borderRadius, o = a, r?.preserveAspectRatio || (n?.width > n?.height ? o = (n?.width || 1) / (n?.height || 1) * o : a = (n?.height || 1) / (n?.width || 1) * a)), m(r?.shape) && (r.backgroundColor = { code: "none" }, s = !0);
25
- let c = r?.rotate ?? h.rotate;
26
- r?.shape === i.Line && r?.heightBasedSize && (c += 90);
27
- let l = r?.borderStyle === t.Line ? void 0 : r?.strokeDash ?? h.strokeDash;
28
- return {
29
- backgroundType: r?.backgroundType ?? "color",
30
- shape: r?.shape ?? h.shape,
31
- backgroundColor: r?.backgroundColor?.code ? r?.backgroundColor : h.backgroundColor,
32
- imageURL: r?.imageURL ?? h.imageURL,
33
- imageFit: r?.imageFit ?? h.imageFit,
34
- strokeDash: l,
35
- lineThickness: r?.lineThickness ?? h.lineThickness,
36
- borderEnabled: s,
37
- strokeColor: r?.strokeColor?.code ? r?.strokeColor : h.strokeColor,
38
- preserveAspectRatio: r?.preserveAspectRatio ?? h.preserveAspectRatio,
39
- scale: r?.scale ?? h.scale,
40
- rotate: c,
41
- heightBasedSize: r?.heightBasedSize ?? h.heightBasedSize,
42
- borderRadiusX: a,
43
- borderRadiusY: o
44
- };
45
- }, _ = o(), v = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("path", {
46
- d: "M0,50 L70,40 L70,20 L100,50 L70,80 L70,60 Z",
47
- vectorEffect: "non-scaling-stroke",
48
- ...e
49
- }), y = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("circle", {
50
- cx: "50",
51
- cy: "50",
52
- r: "49.5",
53
- strokeWidth: "{0.02em}",
54
- vectorEffect: "non-scaling-stroke",
55
- ...e
56
- }), b = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("path", {
57
- d: "M0,0L100, 0L100, 100",
58
- vectorEffect: "non-scaling-stroke",
59
- ...e
60
- }), x = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("path", {
61
- d: "M50,7.2857421875 l38.7369140625,21.4685546875 v42.4912109375 L50,92.7142578125 L11.2630859375,71.245703125 V28.754296875 L50,7.2857421875 M50,0z",
62
- vectorEffect: "non-scaling-stroke",
63
- ...e
64
- }), S = ({ heightBasedSize: e, ...t }) => e ? /* @__PURE__ */ (0, _.jsx)("path", {
65
- d: "M50,0L50, 100",
66
- vectorEffect: "non-scaling-stroke",
67
- ...t
68
- }) : /* @__PURE__ */ (0, _.jsx)("path", {
69
- d: "M0,50L100, 50",
70
- vectorEffect: "non-scaling-stroke",
71
- ...t
72
- }), C = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("rect", {
73
- x: "0",
74
- y: "0",
75
- width: "100",
76
- height: "100",
77
- strokeWidth: "{0.02em}",
78
- vectorEffect: "non-scaling-stroke",
79
- ...e
80
- }), w = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("polygon", {
81
- points: "50,0 93.3,75 6.7,75",
82
- vectorEffect: "non-scaling-stroke",
83
- ...e
84
- }), T = (e) => {
85
- switch (e) {
86
- case i.Circle: return y;
87
- case i.Rectangle:
88
- case i.Square: return C;
89
- case i.Triangle: return w;
90
- case i.Hexagon: return x;
91
- case i.Line: return S;
92
- case i.Arrow: return v;
93
- case i.Elbow: return b;
94
- default: return C;
95
- }
96
- }, E = s({
97
- mainContainer: {
98
- width: "100%",
99
- height: "100%",
100
- display: "flex",
101
- lineHeight: 1,
102
- overflow: "hidden"
103
- },
104
- svg: {
105
- width: "100%",
106
- height: "100%",
107
- transition: "ease-in-out 300ms"
108
- },
109
- shapeGroup: {
110
- width: "100%",
111
- height: "100%",
112
- transition: "ease-in-out 300ms"
113
- }
114
- }), D = ({ patternId: e, imgUrl: t, onLoadCallback: n, imageFit: i = r.Fill }) => /* @__PURE__ */ (0, _.jsx)("defs", { children: /* @__PURE__ */ (0, _.jsx)("pattern", {
115
- id: e,
116
- viewBox: "0 0 1 1",
117
- patternUnits: "objectBoundingBox",
118
- width: "100%",
119
- height: "100%",
120
- preserveAspectRatio: i,
121
- children: /* @__PURE__ */ (0, _.jsx)("image", {
122
- xlinkHref: t,
123
- x: "0",
124
- y: "0",
125
- width: "1",
126
- height: "1",
127
- preserveAspectRatio: i,
128
- onLoad: n,
129
- onError: n
130
- })
131
- }) }), O = a(({ vSpec: e, vTheme: t, elementSize: r }) => {
132
- let a = t || n, o = g(e, r), s = E(), l = u(), h = T(o.shape), v = `${c()}-background-image-fill`, y = `${c()}-insideStroke`, b = f(a, o.backgroundColor?.code), x = f(a, o.strokeColor?.code), S = d(o.strokeDash), C = o.shape === i.Line ? o.lineThickness / 2 : o.lineThickness;
133
- return (0, p.useEffect)(() => {
134
- (!o.imageURL || o.backgroundType === "color") && l();
135
- }, []), /* @__PURE__ */ (0, _.jsx)("div", {
136
- className: s.mainContainer,
137
- "data-testid": "shape-container",
138
- children: /* @__PURE__ */ (0, _.jsxs)("svg", {
139
- viewBox: "0 0 100 100",
140
- className: s.svg,
141
- style: { transform: `rotate(${o.rotate ?? 0}deg) scale(${o.scale ?? 1})` },
142
- preserveAspectRatio: o.preserveAspectRatio ? "" : "none",
143
- children: [
144
- o.backgroundType === "image" ? /* @__PURE__ */ (0, _.jsx)(D, {
145
- patternId: v,
146
- imgUrl: o.imageURL,
147
- imageFit: o.imageFit,
148
- onLoadCallback: () => l()
149
- }) : null,
150
- /* @__PURE__ */ (0, _.jsx)("defs", { children: /* @__PURE__ */ (0, _.jsx)("clipPath", {
151
- id: y,
152
- className: s.shapeGroup,
153
- style: { opacity: o.opacity === void 0 ? 1 : o.opacity },
154
- children: /* @__PURE__ */ (0, _.jsx)(h, {
155
- rx: `${o.borderRadiusX ?? 0}px`,
156
- ry: `${o.borderRadiusY ?? 0}px`
157
- })
158
- }) }),
159
- /* @__PURE__ */ (0, _.jsx)("g", {
160
- className: s.shapeGroup,
161
- style: { opacity: o.opacity === void 0 ? 1 : o.opacity },
162
- fill: o.imageURL && o.backgroundType === "image" ? `url(#${v})` : b,
163
- stroke: x,
164
- strokeWidth: `${o.borderEnabled ? C : 0}px`,
165
- strokeDasharray: S,
166
- children: /* @__PURE__ */ (0, _.jsx)("g", {
167
- clipPath: m(o.shape) ? void 0 : `url(#${y})`,
168
- children: /* @__PURE__ */ (0, _.jsx)(h, {
169
- rx: `${o.borderRadiusX ?? 0}px`,
170
- ry: `${o.borderRadiusY ?? 0}px`,
171
- ...o.shape === i.Line ? { heightBasedSize: o.heightBasedSize } : {}
172
- })
173
- })
174
- })
175
- ]
176
- })
177
- });
178
- });
179
- export { O as Shape };