@astrato-io/visualizations 0.0.0-stage → 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 (139) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +93 -0
  3. package/README.md +843 -2
  4. package/THIRD_PARTY_NOTICES.md +8477 -0
  5. package/VISUALIZATION_DEFINITIONS.md +2378 -0
  6. package/chunks/ClickAwayListener-BbeNMAvj.js +52 -0
  7. package/chunks/LinearProgress-B1FeWaen.js +253 -0
  8. package/chunks/accessors-DemrDevR.js +128 -0
  9. package/chunks/app-filter-bar.compiler-BGJ7HAbr.js +64 -0
  10. package/chunks/bar.compiler-CT0ZbQKc.js +374 -0
  11. package/chunks/builder-B6dWSIdD.js +12289 -0
  12. package/chunks/color-settings-ZIvgNTq1.js +10 -0
  13. package/chunks/coloring-B1XAfg6b.js +664 -0
  14. package/chunks/debounce-fn-CUixuz45.js +7 -0
  15. package/chunks/definitions-D3OVqmXl.js +2102 -0
  16. package/chunks/escobar-eDjtGpkC.js +34606 -0
  17. package/chunks/events-WZut5Ow6.js +4 -0
  18. package/chunks/extend-BKUkc4_i.js +37 -0
  19. package/chunks/filter.compiler-DBsyRBJt.js +70 -0
  20. package/chunks/filtering-tqjAyJH5.js +1072 -0
  21. package/chunks/grouping-type-On4s9Thj.js +3 -0
  22. package/chunks/handlers-VTBfIZYZ.js +13072 -0
  23. package/chunks/isEqual-BDxAhUo8.js +7514 -0
  24. package/chunks/line.compiler-CzdM5Ld0.js +198 -0
  25. package/chunks/metadata-BGElBy5Z.js +28 -0
  26. package/chunks/number.compiler-G-R7y16P.js +53 -0
  27. package/chunks/operations-CTNUX6Sy.js +26249 -0
  28. package/chunks/range-CiwTbMig.js +22 -0
  29. package/chunks/registry-CsQQzukD.js +920 -0
  30. package/chunks/requirements-DYjZCFyf.js +6 -0
  31. package/chunks/rolldown-runtime-DleVn1XH.js +28 -0
  32. package/chunks/set-coloring-datafield-B3uIS1Pe.js +8 -0
  33. package/chunks/shared-CBvcC5YV.js +1218 -0
  34. package/chunks/src-BOS6SqkZ.js +67 -0
  35. package/chunks/src-D9XogOrc.js +422 -0
  36. package/chunks/standalone-0M4HlmDW2.js +3944 -0
  37. package/chunks/standalone-0ashe9w1.js +411 -0
  38. package/chunks/standalone-B7jax8wa.js +339 -0
  39. package/chunks/standalone-BK0VYU-l.js +463 -0
  40. package/chunks/standalone-BMIbT1b2.js +4619 -0
  41. package/chunks/standalone-BZV5vOwA.js +6 -0
  42. package/chunks/standalone-BhDrWj4p.js +1980 -0
  43. package/chunks/standalone-BtSHCp2U2.js +673 -0
  44. package/chunks/standalone-BvaKdky9.js +344 -0
  45. package/chunks/standalone-BwtM31-f.js +2 -0
  46. package/chunks/standalone-C3gg736V.js +1129 -0
  47. package/chunks/standalone-CC1VUjO32.js +299 -0
  48. package/chunks/standalone-C_rYnZ0N.js +741 -0
  49. package/chunks/standalone-CoLrAxRV.js +13198 -0
  50. package/chunks/standalone-DC-aUgXC.js +3855 -0
  51. package/chunks/standalone-DCtRoTWg.js +675 -0
  52. package/chunks/standalone-DUDFTBqL.js +833 -0
  53. package/chunks/standalone-DhZkX9Td.js +2 -0
  54. package/chunks/standalone-DtLElfuM.js +512 -0
  55. package/chunks/standalone-G9Q4Uczu.js +726 -0
  56. package/chunks/standalone-JuLF-OoH.js +1762 -0
  57. package/chunks/standalone-_DeX21JJ.js +383 -0
  58. package/chunks/standalone-gFhKZh8m.js +179 -0
  59. package/chunks/standalone-tDNy-SFH.js +281 -0
  60. package/chunks/standalone-v1oxfU20.js +68 -0
  61. package/chunks/standalone-vzBY6q0I2.js +140 -0
  62. package/chunks/stroke-dash-UgMEcCS4.js +6 -0
  63. package/chunks/table.compiler-tb914oj3.js +222 -0
  64. package/chunks/typeof-CJDtcySz.js +13 -0
  65. package/chunks/ui-DQWtv2iM.js +63551 -0
  66. package/chunks/url-utils-B17gj_mr.js +5501 -0
  67. package/chunks/useFieldName-BvdcoJRl.js +7 -0
  68. package/chunks/utils-Bg7K-t6K.js +32379 -0
  69. package/chunks/view-Bn83C8d9.js +12466 -0
  70. package/definitions.js +3 -0
  71. package/docs/operations/astrato-app-filter-bar.md +161 -0
  72. package/docs/operations/bar.md +6968 -0
  73. package/docs/operations/combo.md +5804 -0
  74. package/docs/operations/date-picker.md +644 -0
  75. package/docs/operations/distribution-gauge.md +3082 -0
  76. package/docs/operations/dot.md +5570 -0
  77. package/docs/operations/filter.md +1483 -0
  78. package/docs/operations/gauge.md +3316 -0
  79. package/docs/operations/heatMap.md +5944 -0
  80. package/docs/operations/histogram.md +1856 -0
  81. package/docs/operations/iframe.md +56 -0
  82. package/docs/operations/image.md +177 -0
  83. package/docs/operations/index.md +46 -0
  84. package/docs/operations/line.md +6391 -0
  85. package/docs/operations/number.md +3903 -0
  86. package/docs/operations/pie.md +5956 -0
  87. package/docs/operations/radar.md +4566 -0
  88. package/docs/operations/sankey.md +3088 -0
  89. package/docs/operations/scatter.md +5969 -0
  90. package/docs/operations/shape.md +315 -0
  91. package/docs/operations/simpleTextObject.md +699 -0
  92. package/docs/operations/slider.md +220 -0
  93. package/docs/operations/table.md +8800 -0
  94. package/docs/operations/tree.md +2867 -0
  95. package/docs/operations/treemap.md +3527 -0
  96. package/docs/operations/waterfall.md +2928 -0
  97. package/docs/operations/word-cloud.md +3000 -0
  98. package/getters.js +18 -0
  99. package/index.js +1183 -0
  100. package/metadata.js +20 -0
  101. package/operations.js +64 -0
  102. package/package.json +185 -4
  103. package/src/definitions/index.d.ts +2 -0
  104. package/src/definitions/model/definitions/available-fields.d.ts +35 -0
  105. package/src/definitions/model/definitions/compilers/compile.d.ts +7 -0
  106. package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
  107. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1341 -0
  108. package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
  109. package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
  110. package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
  111. package/src/definitions/model/definitions/index.d.ts +23 -0
  112. package/src/definitions/model/definitions/registry/compile.d.ts +2 -0
  113. package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
  114. package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
  115. package/src/definitions/model/definitions/schemas/app-filter-bar.schema.d.ts +22 -0
  116. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +73 -0
  117. package/src/definitions/model/definitions/schemas/broad-chart.schema.d.ts +68 -0
  118. package/src/definitions/model/definitions/schemas/common.schema.d.ts +303 -0
  119. package/src/definitions/model/definitions/schemas/filter.schema.d.ts +22 -0
  120. package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
  121. package/src/definitions/model/definitions/schemas/line.schema.d.ts +72 -0
  122. package/src/definitions/model/definitions/schemas/number.schema.d.ts +21 -0
  123. package/src/definitions/model/definitions/schemas/object.schema.d.ts +215 -0
  124. package/src/definitions/model/definitions/schemas/table.schema.d.ts +458 -0
  125. package/src/definitions/model/definitions/types/compilation.types.d.ts +36 -0
  126. package/src/definitions/model/definitions/types/definition.types.d.ts +2 -0
  127. package/src/definitions/model/definitions/types/descriptor.types.d.ts +39 -0
  128. package/src/definitions/model/definitions/types/index.d.ts +3 -0
  129. package/src/definitions/model/definitions/validation.d.ts +3 -0
  130. package/src/getters/index.d.ts +30 -0
  131. package/src/index.d.ts +4 -0
  132. package/src/metadata/index.d.ts +4 -0
  133. package/src/operations/index.d.ts +30 -0
  134. package/src/registry/index.d.ts +6 -0
  135. package/src/runtime/index.d.ts +2 -0
  136. package/src/types.d.ts +307 -0
  137. package/src/visualization-catalog.d.ts +82 -0
  138. package/src/web-components/index.d.ts +12 -0
  139. package/styles.css +2 -0
@@ -0,0 +1,383 @@
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 };
@@ -0,0 +1,179 @@
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 };