@astrato-io/visualizations 0.6.4 → 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 (220) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/README.md +32 -2
  3. package/THIRD_PARTY_NOTICES.md +68 -205
  4. package/VISUALIZATION_DEFINITIONS.md +68 -114
  5. package/chunks/Button-BrGKp9Nm.js +110 -0
  6. package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
  7. package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
  8. package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-VtfFx2vJ.js} +51 -51
  9. package/chunks/MenuOption-ByRqhRdX.js +3934 -0
  10. package/chunks/Title-CO5dP1ma.js +1691 -0
  11. package/chunks/ToggleButton-KOBAimC1.js +112 -0
  12. package/chunks/app-filter-bar.compiler-TwVTeoj5.js +64 -0
  13. package/chunks/bar.compiler-DuQg8EUb.js +374 -0
  14. package/chunks/builder-DEDvNq1k.js +201 -0
  15. package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
  16. package/chunks/color-settings-3VRlf_Vw.js +6 -0
  17. package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
  18. package/chunks/coloring-CncX_JRX.js +278 -0
  19. package/chunks/{src-BC7cGcJ-.js → definitions-BPJQTx16.js} +650 -464
  20. package/chunks/{escobar-BGqT1EsE.js → escobar-DRhRMYRE.js} +6282 -4931
  21. package/chunks/event-bus-CrLB-Y8z.js +3 -0
  22. package/chunks/extend-preset-CUFNpmPe.js +4398 -0
  23. package/chunks/filter.compiler-w27dlv0C.js +70 -0
  24. package/chunks/filtering-cc7WqWpg.js +1153 -0
  25. package/chunks/handlers-TOT-7INo.js +12871 -0
  26. package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
  27. package/chunks/isEqual-B8loyPsC.js +12 -0
  28. package/chunks/label-format-type-weq1XfcX.js +8 -0
  29. package/chunks/line.compiler-Ct1WhN2p.js +198 -0
  30. package/chunks/logger-DpQtYQnX.js +1163 -0
  31. package/chunks/lookup-BWllin0q.js +36 -0
  32. package/chunks/{metadata-CPXdYoln.js → metadata-WABZrt7Y.js} +1 -1
  33. package/chunks/number.compiler-D8TPly-4.js +53 -0
  34. package/chunks/{src-C0LgoUWY.js → operations-Dh4v1Ovt.js} +7716 -7541
  35. package/chunks/{range-DrzdfBX4.js → range-Bi-7zT0k.js} +2 -2
  36. package/chunks/registry-KervaxqJ.js +31 -0
  37. package/chunks/render-wrappers-OEmtaM8g.js +2 -0
  38. package/chunks/{registry-CExpGJ1N.js → requirements-PAoRaJyb.js} +294 -326
  39. package/chunks/responsive.styles-DSiOGD7u.js +82 -0
  40. package/chunks/shared-Bn4N5QcZ.js +1218 -0
  41. package/chunks/src-77e3mC7i.js +391 -0
  42. package/chunks/standalone-B55oyW6c.js +689 -0
  43. package/chunks/{standalone-CY57qwZ-.js → standalone-BDhPQtzQ.js} +386 -352
  44. package/chunks/{standalone-BDCwI6Hn.js → standalone-BGkmozIb.js} +1108 -953
  45. package/chunks/standalone-BMTCb10X.js +179 -0
  46. package/chunks/standalone-BXKRE_Se.js +468 -0
  47. package/chunks/standalone-Bes8srx1.js +354 -0
  48. package/chunks/standalone-BjZp0QMe.js +2 -0
  49. package/chunks/{standalone-BH5NqDwp.js → standalone-BlMIwpEe.js} +687 -573
  50. package/chunks/{standalone-CCNtaJ7s.js → standalone-C8ZAEutO.js} +44 -43
  51. package/chunks/standalone-C8qAelL4.js +2 -0
  52. package/chunks/standalone-CJvIXsQE.js +743 -0
  53. package/chunks/standalone-CLmGb7nn2.js +355 -0
  54. package/chunks/{ui-D1HQNIBy.js → standalone-CM5XcAN5.js} +15946 -17658
  55. package/chunks/standalone-CXNP6-xD.js +420 -0
  56. package/chunks/{standalone-BYm1UjLr.js → standalone-D5Q5ngsD.js} +59 -57
  57. package/chunks/standalone-DLlyRIE6.js +287 -0
  58. package/chunks/standalone-DMcI1afI.js +396 -0
  59. package/chunks/{standalone-jiz0L2Dg.js → standalone-DN4S1MjT.js} +1113 -1094
  60. package/chunks/{standalone-QJ1kKMnO.js → standalone-DT0wKji7.js} +2 -2
  61. package/chunks/{standalone-D5vnf-9y.js → standalone-DVTJwsTY.js} +1110 -1035
  62. package/chunks/standalone-DW6NT205.js +518 -0
  63. package/chunks/standalone-DYQIQH4c.js +2095 -0
  64. package/chunks/standalone-D__XCp-h.js +1003 -0
  65. package/chunks/standalone-XTgSsTAa.js +354 -0
  66. package/chunks/standalone-XuGksArp.js +68 -0
  67. package/chunks/{standalone-CNyNHKVx.js → standalone-we5D5MIn.js} +176 -172
  68. package/chunks/table.compiler-DMeeHxb6.js +222 -0
  69. package/chunks/useFieldName-Cjn9KCVp.js +7 -0
  70. package/chunks/useSlotProps-DLbQp4lc.js +166 -0
  71. package/chunks/{utils-Ba9T0TqC.js → utils-vdmi_2PK.js} +6266 -6517
  72. package/chunks/{src-DvX5LU9T.js → view-BuwQugKb.js} +2893 -5956
  73. package/chunks/visualization-filters-Cc4KU-l-.js +7455 -0
  74. package/chunks/web-components-DqClFkgO.js +1185 -0
  75. package/chunks/with-html-element-D0uY2zjI.js +7328 -0
  76. package/definitions.js +3 -3
  77. package/docs/operations/astrato-app-filter-bar.md +17 -17
  78. package/docs/operations/bar.md +1006 -1071
  79. package/docs/operations/combo.md +717 -738
  80. package/docs/operations/date-picker.md +27 -27
  81. package/docs/operations/distribution-gauge.md +471 -607
  82. package/docs/operations/dot.md +787 -879
  83. package/docs/operations/filter.md +139 -163
  84. package/docs/operations/gauge.md +491 -627
  85. package/docs/operations/heatMap.md +834 -916
  86. package/docs/operations/histogram.md +166 -180
  87. package/docs/operations/iframe.md +5 -5
  88. package/docs/operations/image.md +16 -16
  89. package/docs/operations/index.md +12 -12
  90. package/docs/operations/line.md +811 -888
  91. package/docs/operations/number.md +470 -536
  92. package/docs/operations/pie.md +825 -958
  93. package/docs/operations/radar.md +599 -679
  94. package/docs/operations/sankey.md +462 -584
  95. package/docs/operations/scatter.md +823 -929
  96. package/docs/operations/shape.md +34 -34
  97. package/docs/operations/simpleTextObject.md +18 -25
  98. package/docs/operations/slider.md +33 -43
  99. package/docs/operations/table.md +1177 -1150
  100. package/docs/operations/tree.md +404 -397
  101. package/docs/operations/treemap.md +595 -673
  102. package/docs/operations/waterfall.md +369 -379
  103. package/docs/operations/word-cloud.md +512 -583
  104. package/getters.js +7 -7
  105. package/index.js +3 -1183
  106. package/metadata.js +18 -18
  107. package/operations.js +13 -13
  108. package/package.json +133 -88
  109. package/render.js +10 -0
  110. package/src/charts/bar.d.ts +1 -0
  111. package/src/charts/combo.d.ts +1 -0
  112. package/src/charts/dot.d.ts +1 -0
  113. package/src/charts/gauge-distribution.d.ts +1 -0
  114. package/src/charts/gauge.d.ts +1 -0
  115. package/src/charts/heat-map.d.ts +1 -0
  116. package/src/charts/histogram.d.ts +1 -0
  117. package/src/charts/line.d.ts +1 -0
  118. package/src/charts/pie.d.ts +1 -0
  119. package/src/charts/radar.d.ts +1 -0
  120. package/src/charts/sankey.d.ts +1 -0
  121. package/src/charts/scatter.d.ts +1 -0
  122. package/src/charts/table.d.ts +1 -0
  123. package/src/charts/tree.d.ts +1 -0
  124. package/src/charts/treemap.d.ts +1 -0
  125. package/src/charts/waterfall.d.ts +1 -0
  126. package/src/charts/word-cloud.d.ts +1 -0
  127. package/src/definitions/index.d.ts +2 -2
  128. package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
  129. package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
  130. package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
  131. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1364 -0
  132. package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
  133. package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
  134. package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
  135. package/src/definitions/model/definitions/index.d.ts +23 -0
  136. package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
  137. package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
  138. package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
  139. package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
  140. package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
  141. package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
  142. package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +8 -8
  143. package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +10 -0
  144. package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
  145. package/src/definitions/model/definitions/types/index.d.ts +3 -0
  146. package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
  147. package/src/getters/index.d.ts +3 -3
  148. package/src/index.d.ts +1 -1
  149. package/src/objects/app-filter-bar.d.ts +1 -0
  150. package/src/objects/date-picker.d.ts +1 -0
  151. package/src/objects/filter.d.ts +1 -0
  152. package/src/objects/iframe.d.ts +1 -0
  153. package/src/objects/image.d.ts +1 -0
  154. package/src/objects/number.d.ts +1 -0
  155. package/src/objects/shape.d.ts +1 -0
  156. package/src/objects/slider.d.ts +1 -0
  157. package/src/objects/text.d.ts +1 -0
  158. package/src/operations/index.d.ts +3 -3
  159. package/src/registry/create-visualization-registry.d.ts +5 -0
  160. package/src/render/index.d.ts +34 -0
  161. package/src/runtime/index.d.ts +2 -2
  162. package/src/types.d.ts +9 -4
  163. package/src/web-components/index.d.ts +3 -3
  164. package/chunks/Radio-Ciu-F4CU.js +0 -957
  165. package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
  166. package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
  167. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
  168. package/chunks/bar.compiler-oqaPzIut.js +0 -370
  169. package/chunks/coloring-C16AUZEi.js +0 -663
  170. package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
  171. package/chunks/event-bus-KiSiCJrC.js +0 -2683
  172. package/chunks/events-WZut5Ow6.js +0 -4
  173. package/chunks/filter.compiler-CuLtc_02.js +0 -60
  174. package/chunks/filtering-Yq4DEa0t.js +0 -953
  175. package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
  176. package/chunks/grouping-type-BX_9Ix5q.js +0 -3
  177. package/chunks/interfaces-VUY4_yVO.js +0 -8742
  178. package/chunks/line-settings-DfYTUyPz.js +0 -4
  179. package/chunks/line.compiler-BpA_6Tc7.js +0 -188
  180. package/chunks/number.compiler-DbkWcG4S.js +0 -44
  181. package/chunks/pie-uv42Eqal.js +0 -10
  182. package/chunks/requirements-DNhuShLS.js +0 -6
  183. package/chunks/shared-CKDL4hx9.js +0 -1171
  184. package/chunks/src-Cum_2NLV.js +0 -12145
  185. package/chunks/src-Dun_jXtz.js +0 -10295
  186. package/chunks/standalone-87YV_m9n.js +0 -687
  187. package/chunks/standalone-BLVAWLNJ.js +0 -385
  188. package/chunks/standalone-BPomtAVs.js +0 -2
  189. package/chunks/standalone-BXyBcUOQ.js +0 -2
  190. package/chunks/standalone-BllF4rDp.js +0 -383
  191. package/chunks/standalone-BmfMt74U.js +0 -726
  192. package/chunks/standalone-BqWyrnZI.js +0 -281
  193. package/chunks/standalone-C85u7U6I.js +0 -340
  194. package/chunks/standalone-CDQnr6qT.js +0 -345
  195. package/chunks/standalone-CZynjFG7.js +0 -12979
  196. package/chunks/standalone-DFPva_ku.js +0 -299
  197. package/chunks/standalone-DQxxNwF8.js +0 -675
  198. package/chunks/standalone-DS9T0FZ-.js +0 -830
  199. package/chunks/standalone-Dx3MLlrO.js +0 -512
  200. package/chunks/standalone-DzixzZAL.js +0 -411
  201. package/chunks/standalone-lBm9hQ-q.js +0 -179
  202. package/chunks/standalone-rJ45Zfl1.js +0 -68
  203. package/chunks/table.compiler-BrXkm4Fz.js +0 -213
  204. package/chunks/toInteger-DVZr-D1j.js +0 -11
  205. package/chunks/treemap-x_zmJoG7.js +0 -23
  206. package/chunks/types-dVVCsDWD.js +0 -4
  207. package/chunks/useFieldName-oqQ3bvnO.js +0 -7
  208. package/chunks/view-CLqWMV7Z.js +0 -156
  209. package/src/definitions/shared/index.d.ts +0 -5
  210. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
  211. package/src/definitions/shared/lib/registry/index.d.ts +0 -3
  212. package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
  213. package/src/definitions/shared/lib/types/index.d.ts +0 -3
  214. package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
  215. package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
  216. package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
  217. package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
  218. package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
  219. package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
  220. /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
@@ -1,383 +0,0 @@
1
- import { o as e, t } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Do as n, Lt as r, Oa as i, Po as a, Rt as o, Ta as s, Ti as c, U as l, Wt as u, Xs as d, ln as f, pc as p, qs as m, tn as h } from "./interfaces-VUY4_yVO.js";
3
- import { I as g, Ki as _, Kn as v, P as ee, Zt as te, o as ne, wi as re } from "./utils-Ba9T0TqC.js";
4
- import { At as ie, Ct as y, Et as b, Ft as x, H as S, M as ae, Mt as oe, Nt as se, Ot as C, Qt as ce, Rt as le, St as ue, Tt as w, U as T, Ut as E, Wt as D, X as O, Xt as k, Yt as A, Z as j, Zt as M, an as N, gt as P, ht as F, i as I, in as L, j as R, jt as z, ln as B, n as V, nn as H, ot as U, rt as W, st as de, un as G, ut as fe, vt as pe, xt as me } from "./escobar-BGqT1EsE.js";
5
- import { t as he } from "./coloring-C16AUZEi.js";
6
- import { t as ge } from "./toInteger-DVZr-D1j.js";
7
- import { t as K } from "./set-coloring-datafield-B3uIS1Pe.js";
8
- import { t as _e } from "./range-DrzdfBX4.js";
9
- _();
10
- var q = (e, t, n, r, i, a, o) => {
11
- let s = e.dimensions.filter((e) => c(e)), l = e.measures.filter((e) => c(e)), u = ve(e, t, n, o);
12
- return s[0] && (n.collections.push({
13
- key: b.DimensionDomain,
14
- data: { extract: [{ field: p(s[0].dataItem) }] }
15
- }), u[A(e)] = {
16
- data: { collection: b.DimensionDomain },
17
- type: L.Band
18
- }), l[0] && (u[k(e, l[0])] = {
19
- data: { field: p(l[0].dataItem) },
20
- expand: .02,
21
- invert: T(!1, e.axes?.primaryMeasure),
22
- ...S(e.axes?.primaryMeasure?.axisRange, !0)
23
- }), {
24
- ...n,
25
- scales: u
26
- };
27
- };
28
- function ve(e, t, n, r) {
29
- let i = e.dimensions.filter((e) => c(e)), a = e.measures.filter((e) => c(e));
30
- switch (e.coloring?.type) {
31
- case d.Categorical: {
32
- let a = y(e, r, i[1]);
33
- return F(n, 1, { color: { field: a } }), { categorical: me(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 d.Gradient: {
40
- let r = w(e);
41
- return F(n, 1, { color: { field: r } }), ue(K(e, r), t, {});
42
- }
43
- case d.Single: {
44
- let r = p(a[0]?.dataItem);
45
- r && F(n, 1, { color: { field: r } });
46
- let i = e?.coloring?.color ?? t.colors.brandColors[0];
47
- return { [d.Single]: {
48
- data: [],
49
- unknown: i,
50
- type: L.CategoricalColor,
51
- range: [i]
52
- } };
53
- }
54
- default: return {};
55
- }
56
- }
57
- var ye = (e, t, n) => {
58
- let r = e.dimensions.filter((e) => c(e)), i = e.measures.filter((e) => c(e)), a = (e.supportingMeasures ?? []).filter((e) => c(e)), [o, s] = r, l = p(o?.dataItem), u = p(s?.dataItem), d = p(i[0]?.dataItem), f = ae(a), m = {
59
- key: b.DotBarCollection,
60
- data: { extract: [{
61
- field: l,
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: b.DotPointsCollection,
81
- data: { extract: [{
82
- field: u,
83
- props: {
84
- x: { field: d },
85
- group: { field: l },
86
- [d]: { field: d },
87
- ...f
88
- }
89
- }] }
90
- };
91
- return {
92
- ...n,
93
- collections: [m, h]
94
- };
95
- }, be = /* @__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
- })), J = /* @__PURE__ */ t(((e, t) => {
102
- var n = be();
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
- })), xe = /* @__PURE__ */ t(((e, t) => {
113
- var n = l(), r = J();
114
- function i(e) {
115
- return r(n(e));
116
- }
117
- t.exports = i;
118
- })), Se = /* @__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
- })), Ce = /* @__PURE__ */ t(((e, t) => {
127
- var n = Se(), r = u();
128
- function i(e) {
129
- return e == null ? [] : n(e, r(e));
130
- }
131
- t.exports = i;
132
- })), we = /* @__PURE__ */ t(((e, t) => {
133
- var n = J(), r = Ce();
134
- function i(e) {
135
- return n(r(e));
136
- }
137
- t.exports = i;
138
- })), Te = /* @__PURE__ */ t(((e, t) => {
139
- var n = xe(), r = we(), i = h();
140
- function a(e) {
141
- return (i(e) ? n : r)(e);
142
- }
143
- t.exports = a;
144
- })), Ee = /* @__PURE__ */ e(_e()), De = /* @__PURE__ */ e(Te()), Y = (e) => 1 - (e.barSettings.barPadding ?? 0);
145
- function Oe(e, t, n) {
146
- let r = new he(e, t, n?.[0]?.itemsNotAffectedByFiltering);
147
- return r.getColorDefinition({
148
- overwriteSources: [r.MAIN_FIELD],
149
- ref: "color"
150
- });
151
- }
152
- function ke(e) {
153
- let t = D([""], 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 === H.Line ? 1 : n(e)), t;
155
- }
156
- function X(e) {
157
- return E({
158
- triggerData: [""],
159
- consumeData: ["", "group"],
160
- consumerMode: B.Or
161
- }, e, { valuePickerMode: e?.valuePickerMode });
162
- }
163
- var Z = 100, Q = .1, $ = .9, Ae = (0, De.default)((0, Ee.default)(Q, $, ($ - Q) / Z));
164
- function je(e, t) {
165
- return ({ datum: n, resources: { scale: r } }, i) => {
166
- let a = r(A(t)), o = t.jitterPoints ? Ae[i % Z] : .5;
167
- return a(n.group.value) + .5 * (1 - e) * a.bandwidth() + e * a.bandwidth() * o;
168
- };
169
- }
170
- var Me = (e, t, n, r, i, a) => {
171
- let o = Ne(e, t, a), s = Pe(e, Oe(e, t, i), a);
172
- return {
173
- ...n,
174
- components: [
175
- ...n.components,
176
- o,
177
- s
178
- ]
179
- };
180
- };
181
- function Ne(e, t, n) {
182
- let r = {
183
- orientation: e.orientation,
184
- major: { scale: A(e) },
185
- minor: { scale: k(e, e.measures.filter((e) => c(e))[0]) },
186
- box: {
187
- width: Y(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: i.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 = i.transparent, {
198
- type: G.Box,
199
- layout: { displayOrder: x.VisualizationElement },
200
- key: "min-max-box",
201
- data: { collection: b.DotBarCollection },
202
- settings: r,
203
- animations: {
204
- enabled: !0,
205
- presetId: "bar-chart"
206
- },
207
- brush: ke(n)
208
- };
209
- }
210
- function Pe(e, t, r) {
211
- let i = je(Y(e) * .9, e);
212
- return {
213
- type: G.Point,
214
- key: "dot-point",
215
- layout: { displayOrder: x.VisualizationElement },
216
- data: { collection: b.DotPointsCollection },
217
- settings: {
218
- x: { scale: k(e, e.measures.filter((e) => c(e))[0]) },
219
- y: {
220
- scale: A(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: X(r)
232
- };
233
- }
234
- function Fe(e, t, n) {
235
- if (!e.refLines?.x) return n;
236
- let r = e.refLines.x.map((e) => U(e, ce.XAxisScale, t)), i = {
237
- type: G.RefLine,
238
- layout: { displayOrder: x.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 = f(), i = ge(), a = v(), o = r(), 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(i(n), 292), n && s(e)) {
252
- var r = (o(e) + "e").split("e");
253
- return r = (o(t(r[0] + "e" + (+r[1] + n))) + "e").split("e"), +(r[0] + "e" + (+r[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) => c(e))[0];
264
- return O(e, t, n, {
265
- filter: ze,
266
- placement: {
267
- type: "bounds",
268
- area: "target"
269
- },
270
- extract: j(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(W(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(W(e))(t), i = r.formatter(W(e))(i), a = r.formatter(W(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) => c(e))[1]?.label ?? "";
311
- }
312
- var He = (e, t, n) => {
313
- let r = e.dimensions.filter((e) => c(e)), i = e.measures.filter((e) => c(e)), o = {
314
- showAxisTooltip: e?.axes?.dimension?.showAxisTooltip,
315
- formatter: r[0]?.formatter || {
316
- type: "string",
317
- format: ""
318
- },
319
- scale: A(e),
320
- key: `${C.Dimension}-${e.orientation ?? a.Vertical}`,
321
- settings: { direction: ie(e) }
322
- }, s = i[0], [l, u] = se([o, {
323
- showAxisTooltip: e?.axes?.primaryMeasure?.showAxisTooltip,
324
- formatter: s?.formatter,
325
- scale: k(e, s),
326
- key: `${C.Measure}-${e.orientation ?? a.Vertical}`,
327
- settings: {
328
- direction: oe(e),
329
- labelDock: z(M(e), s?.secondaryAxis)
330
- }
331
- }]);
332
- return {
333
- ...n,
334
- components: [...n.components ?? [], ...l],
335
- interactions: [...n.interactions ?? [], ...u]
336
- };
337
- };
338
- function Ue(e, t, n, r, i, a) {
339
- let { components: o, interactions: s } = P(e, t, n, r, i, a);
340
- if (!e.coloring || e.coloring.type === d.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 === N.CategoricalLegend || e.type === N.SequentialLegend) && c ? {
346
- ...e,
347
- brush: X(a)
348
- } : e);
349
- return {
350
- ...n,
351
- components: l,
352
- interactions: s
353
- };
354
- }
355
- var We = class extends R {
356
- constructor() {
357
- super([
358
- ye,
359
- q,
360
- le,
361
- pe,
362
- Ue,
363
- de,
364
- Me,
365
- Fe,
366
- Re,
367
- He,
368
- fe
369
- ]);
370
- }
371
- }, Ge = re(), Ke = new We(), qe = te(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
372
- let a = ee(), { activeKey: o } = ne(), c = g(), l = {
373
- ...i,
374
- valuePickerMode: !!o
375
- }, u = t || s, d = Ke.compile(e, u, n, r, l, m.Dot, a, c, V());
376
- return d ? /* @__PURE__ */ (0, Ge.jsx)(I, {
377
- config: l,
378
- definition: d,
379
- size: r,
380
- vSpec: e
381
- }) : null;
382
- });
383
- export { qe as DotChart };