@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,374 @@
1
+ import { To as e, a as t } from "./isEqual-BDxAhUo8.js";
2
+ import { E as n, M as r, O as i, S as a, T as o, _ as s, b as c, c as l, d as u, f as d, h as f, it as p, k as m, l as h, m as g, n as _, w as v } from "./shared-CBvcC5YV.js";
3
+ import { bd as y, jf as b } from "./handlers-VTBfIZYZ.js";
4
+ import { _ as x, b as S, t as C, u as w, v as T, w as E } from "./operations-CTNUX6Sy.js";
5
+ t();
6
+ var D = (e) => {
7
+ let t = [...e.data.dimensions.map((e, t) => ({
8
+ item: e,
9
+ path: [
10
+ "data",
11
+ "dimensions",
12
+ t,
13
+ "ref"
14
+ ]
15
+ })), ...e.data.measures.map((e, t) => ({
16
+ item: e,
17
+ path: [
18
+ "data",
19
+ "measures",
20
+ t,
21
+ "ref"
22
+ ]
23
+ }))], n = t.map(({ item: e }) => e.ref), r = new Set(n), i = /* @__PURE__ */ new Set(), o = [];
24
+ t.forEach(({ item: e, path: t }) => {
25
+ i.has(e.ref) && o.push(u("duplicate_alias", t, `Reference "${e.ref}" is duplicated.`)), i.add(e.ref);
26
+ }), e.sorting?.forEach((e, t) => {
27
+ r.has(e.by) || o.push(u("unknown_alias", [
28
+ "sorting",
29
+ t,
30
+ "by"
31
+ ], `Reference "${e.by}" does not exist.`, { allowedValues: n }));
32
+ }), o.push(...a(e.presentation?.coloring, e.data.dimensions.map((e) => e.ref), e.data.measures.map((e) => e.ref)));
33
+ let s = e.limiting?.topN?.by;
34
+ return s && !e.data.measures.some((e) => e.ref === s) && o.push(u("unknown_alias", [
35
+ "limiting",
36
+ "topN",
37
+ "by"
38
+ ], `Measure reference "${s}" does not exist.`, { allowedValues: e.data.measures.map((e) => e.ref) })), o;
39
+ }, O = (e) => {
40
+ if (e.type !== "bar") return u("unsupported_visualization", ["baseVSpec", "type"], `Definition type "bar" cannot compile against base vSpec type "${e.type}".`);
41
+ let t = e;
42
+ return t.dimensions.length > 0 || t.measures.length > 0 || (t.supportingMeasures?.length ?? 0) > 0 || Object.keys(t.referencedData).length > 0 ? u("non_fresh_base_vspec", ["baseVSpec"], "Bar visualization definitions can only compile against a fresh base vSpec.") : void 0;
43
+ }, k = {
44
+ formatString: "setDimensionFormatString",
45
+ formatType: "setDimensionFormatType"
46
+ }, A = {
47
+ currency: "setMeasureCurrency",
48
+ currencyIsPrefix: "setMeasureCurrencyIsPrefix",
49
+ formatString: "setMeasureFormatString",
50
+ formatType: "setMeasureFormatType",
51
+ negativeType: "setMeasureNegativeType"
52
+ }, j = (e) => {
53
+ let t = Object.entries(e).find(([, e]) => e.success === !1);
54
+ return t ? {
55
+ id: t[0],
56
+ result: t[1]
57
+ } : void 0;
58
+ }, M = (e, t) => {
59
+ if (!e || typeof e.data != "object" || e.data === null || !("dataItem" in e.data)) return;
60
+ let n = e.data.dataItem;
61
+ if (!(typeof n != "object" || !n || !("internalKey" in n) || typeof n.internalKey != "string" || !("uniqueSignature" in n) || typeof n.uniqueSignature != "string")) return {
62
+ dataItemInternalKey: n.internalKey,
63
+ dataItemUniqueSignature: n.uniqueSignature,
64
+ kind: t
65
+ };
66
+ }, N = async (e, t) => {
67
+ let r = e;
68
+ for (let [e, n] of t.data.dimensions.entries()) {
69
+ let t = `dimension:${n.ref}`, i = await C(r.vSpec, r.availableFields, [{
70
+ id: t,
71
+ name: w.ADD_DIMENSION,
72
+ payload: { key: n.fieldKey }
73
+ }], r.input.variables ?? [], [], r.input.theme), a = j(i.results), o = M(i.results[t], "dimension");
74
+ if (a || !o) return {
75
+ issue: u("operation_failed", [
76
+ "data",
77
+ "dimensions",
78
+ e
79
+ ], a?.result.error ?? "Dimension operation did not return the created data-item identity."),
80
+ success: !1
81
+ };
82
+ r = {
83
+ ...r,
84
+ resolvedRefs: {
85
+ ...r.resolvedRefs,
86
+ [n.ref]: o
87
+ },
88
+ vSpec: i.vSpec
89
+ };
90
+ }
91
+ for (let [i, a] of t.data.measures.entries()) {
92
+ let t = n(a, e.input.availableFields), s = `measure:${a.ref}`, c = await C(r.vSpec, r.availableFields, [{
93
+ id: s,
94
+ name: w.ADD_MEASURE,
95
+ payload: o(a, e.input.availableFields)
96
+ }], r.input.variables ?? [], [], r.input.theme), l = j(c.results), d = M(c.results[s], "measure");
97
+ if (l || !d) return {
98
+ issue: u("operation_failed", [
99
+ "data",
100
+ "measures",
101
+ i
102
+ ], l?.result.error ?? "Measure operation did not return the created data-item identity."),
103
+ success: !1
104
+ };
105
+ r = {
106
+ ...r,
107
+ measureAggregations: {
108
+ ...r.measureAggregations,
109
+ [a.ref]: t
110
+ },
111
+ resolvedRefs: {
112
+ ...r.resolvedRefs,
113
+ [a.ref]: d
114
+ },
115
+ vSpec: c.vSpec
116
+ };
117
+ }
118
+ return {
119
+ state: r,
120
+ success: !0
121
+ };
122
+ }, P = (e) => ({
123
+ dataItemInternalKey: e.dataItemInternalKey,
124
+ dataItemUniqueSignature: e.dataItemUniqueSignature
125
+ }), F = async (e, t) => {
126
+ let n = [];
127
+ return t.data.dimensions.forEach((t, r) => {
128
+ let i = e.resolvedRefs[t.ref];
129
+ t.showNullValues !== void 0 && n.push({
130
+ name: w.UPDATE_DIMENSION,
131
+ payload: {
132
+ ...P(i),
133
+ changes: { showNullValues: t.showNullValues }
134
+ }
135
+ }), t.temporalGrouping && n.push(g("setDimensionTemporalGrouping", i, t.ref, [
136
+ "data",
137
+ "dimensions",
138
+ r
139
+ ], t.temporalGrouping)), t.format?.formatType !== void 0 && n.push(h(k.formatType, i, t.ref, [
140
+ "data",
141
+ "dimensions",
142
+ r
143
+ ], "formatType", t.format.formatType)), t.format?.formatString !== void 0 && n.push(h(k.formatString, i, t.ref, [
144
+ "data",
145
+ "dimensions",
146
+ r
147
+ ], "formatString", t.format.formatString));
148
+ }), t.data.measures.forEach((t, r) => {
149
+ let i = e.resolvedRefs[t.ref];
150
+ [
151
+ "formatType",
152
+ "formatString",
153
+ "currency",
154
+ "currencyIsPrefix",
155
+ "negativeType"
156
+ ].forEach((e) => {
157
+ let a = t.format?.[e];
158
+ a !== void 0 && n.push(h(A[e], i, t.ref, [
159
+ "data",
160
+ "measures",
161
+ r
162
+ ], e, a));
163
+ }), t.dataLabels && n.push({
164
+ name: E.SET_MEASURE_DATA_LABELS_SHOW,
165
+ payload: {
166
+ ...P(i),
167
+ show: t.dataLabels.visible
168
+ }
169
+ }), t.dataLabels?.placements && n.push({
170
+ name: E.SET_MEASURE_DATA_LABEL_BAR_PLACEMENTS,
171
+ payload: {
172
+ ...P(i),
173
+ placements: t.dataLabels.placements.map((e) => ({ position: e }))
174
+ }
175
+ }), t.axis && n.push({
176
+ name: x.CHANGE_MEASURE_AXIS,
177
+ payload: {
178
+ ...P(i),
179
+ secondaryAxis: t.axis === "secondary"
180
+ }
181
+ });
182
+ }), f(e, n, ["data"]);
183
+ }, I = (e, t) => f(e, t.filterGroup ? [{
184
+ id: "filterGroup",
185
+ name: "setStaticFilterGroup",
186
+ payload: c(t.filterGroup)
187
+ }] : [], ["filterGroup"]), L = async (t, n) => {
188
+ if (!n.sorting?.length) return {
189
+ state: t,
190
+ success: !0
191
+ };
192
+ let r = t.vSpec, i = new Map(n.sorting.map((e) => [e.by, e])), a = new Map(Object.entries(t.resolvedRefs).map(([e, t]) => [`${t.dataItemInternalKey}:${t.dataItemUniqueSignature}`, e])), o = r.querySettings?.sortingOrder ?? [], s = n.sorting.map((e) => t.resolvedRefs[e.by]), c = new Set(s.map((e) => `${e.dataItemInternalKey}:${e.dataItemUniqueSignature}`)), l = [...s, ...o.filter((e) => !c.has(`${e.dataItem.internalKey}:${e.dataItem.uniqueSignature}`)).map((e) => ({
193
+ dataItemInternalKey: e.dataItem.internalKey,
194
+ dataItemUniqueSignature: e.dataItem.uniqueSignature,
195
+ kind: e.fieldType === "dimension" ? "dimension" : "measure"
196
+ }))].map((t, n) => {
197
+ let r = a.get(`${t.dataItemInternalKey}:${t.dataItemUniqueSignature}`), s = o.find((e) => e.dataItem.internalKey === t.dataItemInternalKey && e.dataItem.uniqueSignature === t.dataItemUniqueSignature);
198
+ return {
199
+ ...P(t),
200
+ newIndex: n,
201
+ sortDirection: (r ? i.get(r)?.direction : void 0) ?? s?.sortDirection ?? e.Asc
202
+ };
203
+ }), u = await f(t, [{
204
+ name: w.CHANGE_SORT_ORDER_AND_DIRECTION,
205
+ payload: { changeRequests: l }
206
+ }], ["sorting"]);
207
+ if (!u.success) return u;
208
+ let d = n.sorting.map((e) => ({
209
+ name: w.TOGGLE_SORTING_ITEM,
210
+ payload: {
211
+ ...P(t.resolvedRefs[e.by]),
212
+ enabled: e.enabled ?? !0
213
+ }
214
+ }));
215
+ return u = await f(u.state, d, ["sorting"]), u;
216
+ }, R = (e, t) => {
217
+ let n = [], { limiting: r } = t;
218
+ if (r?.queryLimit !== void 0 && n.push({
219
+ name: w.SET_QUERY_LIMIT,
220
+ payload: r.queryLimit
221
+ }), r?.topN) {
222
+ let t = e.resolvedRefs[r.topN.by];
223
+ n.push({
224
+ name: w.ENABLE_TOP_N,
225
+ payload: !0
226
+ }, {
227
+ name: w.SET_TOP_N_NUMBER_OF_VALUES,
228
+ payload: r.topN.count
229
+ }, {
230
+ name: w.SET_TOP_N_SORT_ORDER,
231
+ payload: r.topN.direction
232
+ }, {
233
+ name: w.SET_TOP_N_SHOW_OTHERS,
234
+ payload: r.topN.showOthers ?? !1
235
+ }, {
236
+ name: w.SET_TOP_N_RANK_MEASURE,
237
+ payload: {
238
+ ...P(t),
239
+ ...e.measureAggregations[r.topN.by] ? { aggregation: e.measureAggregations[r.topN.by] } : {}
240
+ }
241
+ });
242
+ }
243
+ return f(e, n, ["limiting"]);
244
+ }, z = (e, t) => {
245
+ let n = [], { presentation: r } = t, i = s(r?.axes);
246
+ if (i) return Promise.resolve({
247
+ issue: i,
248
+ success: !1
249
+ });
250
+ r?.orientation !== void 0 && n.push({
251
+ name: w.SET_BAR_CHART_ORIENTATION,
252
+ payload: r.orientation
253
+ });
254
+ let a = r?.legend;
255
+ a && n.push(...d(e.vSpec, a)), Object.entries(r?.axes ?? {}).forEach(([e, t]) => {
256
+ t.titleVisible !== void 0 && n.push({
257
+ name: w.SET_SHOW_AXIS_TITLE,
258
+ payload: {
259
+ axisName: e,
260
+ showAxisName: t.titleVisible
261
+ }
262
+ }), t.title !== void 0 && n.push({
263
+ name: w.SET_AXIS_TITLE,
264
+ payload: {
265
+ axisName: e,
266
+ axisTitle: t.title
267
+ }
268
+ }), t.labelsVisible !== void 0 && n.push({
269
+ name: w.SET_SHOW_AXIS_LABELS,
270
+ payload: {
271
+ axisName: e,
272
+ showLabels: t.labelsVisible
273
+ }
274
+ }), t.ticksVisible !== void 0 && n.push({
275
+ name: w.SET_SHOW_AXIS_TICKS,
276
+ payload: {
277
+ axisName: e,
278
+ showAxisTicks: t.ticksVisible
279
+ }
280
+ }), t.lineVisible !== void 0 && n.push({
281
+ name: w.SET_SHOW_AXIS_LINE,
282
+ payload: {
283
+ axisName: e,
284
+ showAxisLine: t.lineVisible
285
+ }
286
+ }), n.push(...l(e, t)), "scale" in t && t.scale !== void 0 && n.push({
287
+ name: T.SET_AXIS_SCALE,
288
+ payload: {
289
+ axisName: e,
290
+ scale: t.scale
291
+ }
292
+ });
293
+ });
294
+ let o = r?.axes?.primaryMeasure?.bands;
295
+ return o && n.push({
296
+ name: S.SET_MEASURE_AXIS_BANDS,
297
+ payload: { bands: o }
298
+ }), f(e, n, ["presentation"]);
299
+ }, B = async (e) => {
300
+ let t = y(e);
301
+ if (t) return {
302
+ issues: [{
303
+ code: "invalid_structure",
304
+ message: t,
305
+ path: []
306
+ }],
307
+ success: !1
308
+ };
309
+ let n = p.safeParse(e.definition);
310
+ if (!n.success) return {
311
+ issues: v(n.error, e.definition),
312
+ success: !1
313
+ };
314
+ let a = b.safeParse(e.baseVSpec);
315
+ if (!a.success) return {
316
+ issues: [u("invalid_structure", ["baseVSpec"], "Base bar vSpec is invalid.", { details: { issues: a.error.issues } })],
317
+ success: !1
318
+ };
319
+ let o = a.data, s = O(o);
320
+ if (s) return {
321
+ issues: [s],
322
+ success: !1
323
+ };
324
+ let c = n.data.data.measures.find((e) => e.ref === n.data.limiting?.topN?.by), l = (c ? e.availableFields.find((e) => e.fieldKey === c.fieldKey) : void 0)?.kind === "measure" ? [u("unsupported_feature", [
325
+ "limiting",
326
+ "topN",
327
+ "by"
328
+ ], "Top N ranking by a predefined measure is not supported by the current query builder. Use a raw field or calculation.")] : [], d = [
329
+ ...D(n.data),
330
+ ...i(n.data.data.dimensions, e.availableFields, ["data", "dimensions"], "dimension"),
331
+ ...i(n.data.data.measures, e.availableFields, ["data", "measures"], "measure"),
332
+ ...m(n.data.filterGroup, e.availableFields),
333
+ ...l
334
+ ];
335
+ if (d.length > 0) return {
336
+ issues: d,
337
+ success: !1
338
+ };
339
+ let f = await N({
340
+ availableFields: r(e.availableFields),
341
+ input: e,
342
+ measureAggregations: {},
343
+ resolvedRefs: {},
344
+ vSpec: o
345
+ }, n.data), h = [
346
+ F,
347
+ I,
348
+ L,
349
+ R,
350
+ z,
351
+ (e, t) => _(e, t.presentation?.coloring)
352
+ ];
353
+ for (let e of h) {
354
+ if ("issue" in f) return {
355
+ issues: [f.issue],
356
+ success: !1
357
+ };
358
+ f = await e(f.state, n.data);
359
+ }
360
+ if ("issue" in f) return {
361
+ issues: [f.issue],
362
+ success: !1
363
+ };
364
+ let g = b.safeParse(f.state.vSpec);
365
+ return g.success ? {
366
+ resolvedRefs: f.state.resolvedRefs,
367
+ success: !0,
368
+ vSpec: g.data
369
+ } : {
370
+ issues: [u("invalid_compiled_vspec", [], "Compiled bar vSpec failed final validation.", { details: { issues: g.error.issues } })],
371
+ success: !1
372
+ };
373
+ };
374
+ export { B as compileBarVisualizationDefinition };