@astrato-io/visualizations 0.0.0-stage → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +93 -0
  3. package/README.md +843 -2
  4. package/THIRD_PARTY_NOTICES.md +8387 -0
  5. package/VISUALIZATION_DEFINITIONS.md +2378 -0
  6. package/chunks/LinearProgress-CUZ0D8_t.js +253 -0
  7. package/chunks/Radio-Ciu-F4CU.js +957 -0
  8. package/chunks/ToggleButton-BCJc3Jlc.js +153 -0
  9. package/chunks/_baseFlatten-DPXPOrea.js +7076 -0
  10. package/chunks/accessors-DemrDevR.js +128 -0
  11. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +55 -0
  12. package/chunks/bar.compiler-oqaPzIut.js +370 -0
  13. package/chunks/color-settings-ZIvgNTq1.js +10 -0
  14. package/chunks/coloring-C16AUZEi.js +663 -0
  15. package/chunks/data-item-resolution-1lvYB5ln.js +53 -0
  16. package/chunks/debounce-fn-CUixuz45.js +7 -0
  17. package/chunks/escobar-BGqT1EsE.js +34580 -0
  18. package/chunks/event-bus-KiSiCJrC.js +2683 -0
  19. package/chunks/events-WZut5Ow6.js +4 -0
  20. package/chunks/extend-BKUkc4_i.js +37 -0
  21. package/chunks/filter.compiler-CuLtc_02.js +60 -0
  22. package/chunks/filtering-Yq4DEa0t.js +953 -0
  23. package/chunks/gauge-target-type-BkKXAqkX.js +4 -0
  24. package/chunks/grouping-type-BX_9Ix5q.js +3 -0
  25. package/chunks/interfaces-VUY4_yVO.js +8742 -0
  26. package/chunks/line-settings-DfYTUyPz.js +4 -0
  27. package/chunks/line.compiler-BpA_6Tc7.js +188 -0
  28. package/chunks/metadata-CPXdYoln.js +28 -0
  29. package/chunks/number.compiler-DbkWcG4S.js +44 -0
  30. package/chunks/pie-uv42Eqal.js +10 -0
  31. package/chunks/range-DrzdfBX4.js +22 -0
  32. package/chunks/registry-CExpGJ1N.js +920 -0
  33. package/chunks/requirements-DNhuShLS.js +6 -0
  34. package/chunks/rolldown-runtime-DleVn1XH.js +28 -0
  35. package/chunks/set-coloring-datafield-B3uIS1Pe.js +8 -0
  36. package/chunks/shared-CKDL4hx9.js +1171 -0
  37. package/chunks/src-BC7cGcJ-.js +2024 -0
  38. package/chunks/src-BOS6SqkZ.js +67 -0
  39. package/chunks/src-C0LgoUWY.js +26105 -0
  40. package/chunks/src-Cum_2NLV.js +12145 -0
  41. package/chunks/src-D9XogOrc.js +422 -0
  42. package/chunks/src-Dun_jXtz.js +10295 -0
  43. package/chunks/src-DvX5LU9T.js +14742 -0
  44. package/chunks/standalone-87YV_m9n.js +687 -0
  45. package/chunks/standalone-BDCwI6Hn.js +4619 -0
  46. package/chunks/standalone-BH5NqDwp.js +1763 -0
  47. package/chunks/standalone-BLVAWLNJ.js +385 -0
  48. package/chunks/standalone-BPomtAVs.js +2 -0
  49. package/chunks/standalone-BXyBcUOQ.js +2 -0
  50. package/chunks/standalone-BYm1UjLr.js +140 -0
  51. package/chunks/standalone-BllF4rDp.js +383 -0
  52. package/chunks/standalone-BmfMt74U.js +726 -0
  53. package/chunks/standalone-BqWyrnZI.js +281 -0
  54. package/chunks/standalone-C85u7U6I.js +340 -0
  55. package/chunks/standalone-CCNtaJ7s.js +741 -0
  56. package/chunks/standalone-CDQnr6qT.js +345 -0
  57. package/chunks/standalone-CNyNHKVx.js +674 -0
  58. package/chunks/standalone-CY57qwZ-.js +1129 -0
  59. package/chunks/standalone-CZynjFG7.js +12979 -0
  60. package/chunks/standalone-D5vnf-9y.js +3943 -0
  61. package/chunks/standalone-DFPva_ku.js +299 -0
  62. package/chunks/standalone-DQxxNwF8.js +675 -0
  63. package/chunks/standalone-DS9T0FZ-.js +830 -0
  64. package/chunks/standalone-Dx3MLlrO.js +512 -0
  65. package/chunks/standalone-DzixzZAL.js +411 -0
  66. package/chunks/standalone-QJ1kKMnO.js +6 -0
  67. package/chunks/standalone-jiz0L2Dg.js +3855 -0
  68. package/chunks/standalone-lBm9hQ-q.js +179 -0
  69. package/chunks/standalone-rJ45Zfl1.js +68 -0
  70. package/chunks/stroke-dash-UgMEcCS4.js +6 -0
  71. package/chunks/table.compiler-BrXkm4Fz.js +213 -0
  72. package/chunks/toInteger-DVZr-D1j.js +11 -0
  73. package/chunks/treemap-x_zmJoG7.js +23 -0
  74. package/chunks/typeof-CJDtcySz.js +13 -0
  75. package/chunks/types-dVVCsDWD.js +4 -0
  76. package/chunks/ui-D1HQNIBy.js +54039 -0
  77. package/chunks/url-utils-B17gj_mr.js +5501 -0
  78. package/chunks/useFieldName-oqQ3bvnO.js +7 -0
  79. package/chunks/utils-Ba9T0TqC.js +31097 -0
  80. package/chunks/view-CLqWMV7Z.js +156 -0
  81. package/definitions.js +3 -0
  82. package/docs/operations/astrato-app-filter-bar.md +161 -0
  83. package/docs/operations/bar.md +7050 -0
  84. package/docs/operations/combo.md +5825 -0
  85. package/docs/operations/date-picker.md +644 -0
  86. package/docs/operations/distribution-gauge.md +3218 -0
  87. package/docs/operations/dot.md +5662 -0
  88. package/docs/operations/filter.md +1507 -0
  89. package/docs/operations/gauge.md +3452 -0
  90. package/docs/operations/heatMap.md +6026 -0
  91. package/docs/operations/histogram.md +1870 -0
  92. package/docs/operations/iframe.md +56 -0
  93. package/docs/operations/image.md +177 -0
  94. package/docs/operations/index.md +46 -0
  95. package/docs/operations/line.md +6468 -0
  96. package/docs/operations/number.md +3969 -0
  97. package/docs/operations/pie.md +6089 -0
  98. package/docs/operations/radar.md +4646 -0
  99. package/docs/operations/sankey.md +3210 -0
  100. package/docs/operations/scatter.md +6075 -0
  101. package/docs/operations/shape.md +315 -0
  102. package/docs/operations/simpleTextObject.md +706 -0
  103. package/docs/operations/slider.md +230 -0
  104. package/docs/operations/table.md +8790 -0
  105. package/docs/operations/tree.md +2874 -0
  106. package/docs/operations/treemap.md +3619 -0
  107. package/docs/operations/waterfall.md +2938 -0
  108. package/docs/operations/word-cloud.md +3071 -0
  109. package/getters.js +18 -0
  110. package/index.js +1183 -0
  111. package/metadata.js +20 -0
  112. package/operations.js +64 -0
  113. package/package.json +191 -4
  114. package/src/definitions/index.d.ts +2 -0
  115. package/src/definitions/shared/index.d.ts +5 -0
  116. package/src/definitions/shared/lib/available-fields.d.ts +36 -0
  117. package/src/definitions/shared/lib/compilers/index.d.ts +7 -0
  118. package/src/definitions/shared/lib/registry/compile.d.ts +2 -0
  119. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +587 -0
  120. package/src/definitions/shared/lib/registry/index.d.ts +3 -0
  121. package/src/definitions/shared/lib/registry/validation.d.ts +3 -0
  122. package/src/definitions/shared/lib/schemas/app-filter-bar.schema.d.ts +22 -0
  123. package/src/definitions/shared/lib/schemas/bar.schema.d.ts +73 -0
  124. package/src/definitions/shared/lib/schemas/broad-chart.schema.d.ts +68 -0
  125. package/src/definitions/shared/lib/schemas/common.schema.d.ts +304 -0
  126. package/src/definitions/shared/lib/schemas/filter.schema.d.ts +22 -0
  127. package/src/definitions/shared/lib/schemas/index.d.ts +9 -0
  128. package/src/definitions/shared/lib/schemas/line.schema.d.ts +72 -0
  129. package/src/definitions/shared/lib/schemas/number.schema.d.ts +21 -0
  130. package/src/definitions/shared/lib/schemas/object.schema.d.ts +215 -0
  131. package/src/definitions/shared/lib/schemas/table.schema.d.ts +458 -0
  132. package/src/definitions/shared/lib/types/compilation.types.d.ts +36 -0
  133. package/src/definitions/shared/lib/types/definition.types.d.ts +2 -0
  134. package/src/definitions/shared/lib/types/descriptor.types.d.ts +39 -0
  135. package/src/definitions/shared/lib/types/index.d.ts +3 -0
  136. package/src/getters/index.d.ts +30 -0
  137. package/src/index.d.ts +4 -0
  138. package/src/metadata/index.d.ts +4 -0
  139. package/src/operations/index.d.ts +30 -0
  140. package/src/registry/index.d.ts +6 -0
  141. package/src/runtime/index.d.ts +2 -0
  142. package/src/types.d.ts +307 -0
  143. package/src/visualization-catalog.d.ts +82 -0
  144. package/src/web-components/index.d.ts +12 -0
  145. package/styles.css +2 -0
@@ -0,0 +1,2024 @@
1
+ import { La as e, Xs as t, Ya as n, ds as r } from "./interfaces-VUY4_yVO.js";
2
+ import { hn as i } from "./event-bus-KiSiCJrC.js";
3
+ import { t as a } from "./gauge-target-type-BkKXAqkX.js";
4
+ import { Au as o, Dd as s, Kd as c, Lu as l, Mu as u, Od as d, Pd as ee, Pu as te, Sd as ne, _d as re, ad as ie, bd as ae, cd as oe, dd as se, fd as ce, jd as f, kd as le, nd as ue, td as de, ud as fe, yd as pe } from "./src-Dun_jXtz.js";
5
+ import { C as me, S as p, _ as m, b as he, f as ge, v as _e, x as ve } from "./src-C0LgoUWY.js";
6
+ import { $ as ye, A as be, B as xe, C as Se, F as Ce, G as we, H as Te, I as Ee, J as De, K as Oe, L as h, M as ke, N as Ae, P as je, Q as Me, R as Ne, S as Pe, U as g, V as Fe, W as Ie, X as Le, Y as Re, Z as ze, _ as Be, a as Ve, c as He, d as _, et as Ue, f as We, g as v, h as y, i as Ge, j as b, k as Ke, n as qe, nt as Je, o as Ye, q as Xe, r as Ze, rt as Qe, s as $e, t as x, tt as et, u as S, v as C, w, x as tt, y as T, z as E } from "./shared-CKDL4hx9.js";
7
+ import { a as nt, i as D, o as O, r as rt, t as it } from "./data-item-resolution-1lvYB5ln.js";
8
+ import { z as k } from "zod";
9
+ var at = async (e) => (await import("./app-filter-bar.compiler-j_CVoWTa.js")).compileAppFilterBarVisualizationDefinition(e), ot = async (e) => (await import("./bar.compiler-oqaPzIut.js")).compileBarVisualizationDefinition(e), st = async (e) => (await import("./filter.compiler-CuLtc_02.js")).compileFilterVisualizationDefinition(e), ct = async (e) => (await import("./line.compiler-BpA_6Tc7.js")).compileLineVisualizationDefinition(e), lt = async (e) => (await import("./number.compiler-DbkWcG4S.js")).compileNumberVisualizationDefinition(e), ut = async (e) => (await import("./table.compiler-BrXkm4Fz.js")).compileTableVisualizationDefinition(e), dt = (e, ...t) => e, A = {
10
+ horsepower: "[Cars].[Horsepower]",
11
+ latestLaunch: "[Cars].[Latest Launch]",
12
+ manufacturer: "[Cars].[Manufacturer]",
13
+ model: "[Cars].[Model]",
14
+ sales: "[Cars].[Sales In Thousands]"
15
+ }, j = (e, t) => ({
16
+ fieldKey: t,
17
+ format: { formatType: "none" },
18
+ ref: e
19
+ }), M = (e, t) => ({
20
+ fieldKey: t,
21
+ ref: e
22
+ }), N = (e, t = A.sales, n = "SUM") => ({
23
+ aggregation: n,
24
+ fieldKey: t,
25
+ format: {
26
+ formatType: "number2Decimal",
27
+ negativeType: "parenthesis"
28
+ },
29
+ ref: e
30
+ }), P = {
31
+ filters: [{
32
+ fieldKey: A.manufacturer,
33
+ operator: "inList",
34
+ values: [
35
+ "Acura",
36
+ "Audi",
37
+ "BMW"
38
+ ]
39
+ }],
40
+ operator: "and"
41
+ }, F = {
42
+ position: "right",
43
+ title: "Cars comparison",
44
+ visible: !0
45
+ }, I = {
46
+ dimension: {
47
+ labelsVisible: !0,
48
+ title: "Manufacturer",
49
+ titleVisible: !0
50
+ },
51
+ primaryMeasure: {
52
+ labelsVisible: !0,
53
+ title: "Sales",
54
+ titleVisible: !0
55
+ },
56
+ secondaryMeasure: {
57
+ labelsVisible: !0,
58
+ title: "Horsepower",
59
+ titleVisible: !0
60
+ }
61
+ }, ft = {
62
+ dimension: {
63
+ labelsVisible: !0,
64
+ title: "Manufacturer",
65
+ titleVisible: !0
66
+ },
67
+ primaryMeasure: {
68
+ labelsVisible: !0,
69
+ title: "Sales",
70
+ titleVisible: !0
71
+ },
72
+ secondaryDimension: {
73
+ labelsVisible: !0,
74
+ title: "Model",
75
+ titleVisible: !0
76
+ }
77
+ }, pt = {
78
+ dimension: {
79
+ labelsVisible: !0,
80
+ title: "Manufacturer",
81
+ titleVisible: !0
82
+ },
83
+ primaryMeasure: {
84
+ labelsVisible: !0,
85
+ title: "Sales",
86
+ titleVisible: !0
87
+ }
88
+ }, mt = {
89
+ dimension: {
90
+ labelsVisible: !0,
91
+ title: "Horsepower",
92
+ titleVisible: !0
93
+ },
94
+ primaryMeasure: {
95
+ labelsVisible: !0,
96
+ title: "Count",
97
+ titleVisible: !0
98
+ }
99
+ }, ht = {
100
+ primaryMeasure: {
101
+ labelsVisible: !0,
102
+ title: "Sales",
103
+ titleVisible: !0
104
+ },
105
+ secondaryMeasure: {
106
+ labelsVisible: !0,
107
+ title: "Horsepower",
108
+ titleVisible: !0
109
+ }
110
+ }, gt = {
111
+ dimension: {
112
+ labelsVisible: !0,
113
+ title: "Measure",
114
+ titleVisible: !0
115
+ },
116
+ primaryMeasure: {
117
+ labelsVisible: !0,
118
+ title: "Value",
119
+ titleVisible: !0
120
+ }
121
+ }, L = "presentation.axes.primaryMeasure.bands shades the plot between two primary measure axis values; start and end are measure values, and the bands replace any on the base vSpec.", R = [
122
+ "dimensions",
123
+ "filters",
124
+ "measures",
125
+ "value-formatting"
126
+ ], _t = dt([
127
+ {
128
+ additionalExamples: [{
129
+ definition: {
130
+ data: {
131
+ dimensions: [j("manufacturer", A.manufacturer)],
132
+ measures: [N("sales")]
133
+ },
134
+ presentation: { coloring: {
135
+ overwrites: [{
136
+ color: "#0F766E",
137
+ value: "Audi"
138
+ }, {
139
+ color: "#D97706",
140
+ operator: "inList",
141
+ values: ["BMW", "Buick"]
142
+ }],
143
+ rules: [{
144
+ color: "#DC2626",
145
+ measure: "sales",
146
+ operator: "less",
147
+ value: 20
148
+ }]
149
+ } },
150
+ type: "bar",
151
+ version: 1
152
+ },
153
+ title: "Colors bound to dimension values and a measure threshold"
154
+ }],
155
+ documentation: {
156
+ constraints: [
157
+ "Sorting and Top N refer to definition-local refs, not generated data-item IDs.",
158
+ "Every dimension and measure must resolve to an available field with a compatible role.",
159
+ "Set axis per measure to plot it against the primary or the secondary measure axis.",
160
+ L,
161
+ "Set range on a measure axis to fix its min, max, or both, for example to give several charts one shared scale; leave both unset and set startsAtZero to keep an auto-fitted axis anchored at zero. Set inverted on a measure axis to reverse its values, for example to put rank 1 at the top.",
162
+ "Set scale to log on a measure axis to draw it logarithmically, with gridlines at powers of ten. Zero and negative values are drawn at the floor of a log axis."
163
+ ],
164
+ dataRequirements: ["At least one dimension.", "At least one measure."],
165
+ summary: "Categorical comparison chart with sorting, limiting, per-measure axes, labels, and orientation controls.",
166
+ title: "Bar chart"
167
+ },
168
+ example: {
169
+ data: {
170
+ dimensions: [{
171
+ ...j("manufacturer", A.manufacturer),
172
+ showNullValues: !1
173
+ }],
174
+ measures: [{
175
+ ...N("sales"),
176
+ dataLabels: {
177
+ placements: ["outside", "inside"],
178
+ visible: !0
179
+ }
180
+ }]
181
+ },
182
+ filterGroup: P,
183
+ limiting: {
184
+ queryLimit: 100,
185
+ topN: {
186
+ by: "sales",
187
+ count: 10,
188
+ direction: "desc",
189
+ showOthers: !1
190
+ }
191
+ },
192
+ presentation: {
193
+ axes: {
194
+ ...I,
195
+ primaryMeasure: {
196
+ ...I.primaryMeasure,
197
+ bands: [{
198
+ color: "#E6E6E6",
199
+ end: 15e4,
200
+ label: "Target range",
201
+ start: 1e5
202
+ }]
203
+ }
204
+ },
205
+ legend: F,
206
+ orientation: "vertical"
207
+ },
208
+ sorting: [{
209
+ by: "sales",
210
+ direction: "desc"
211
+ }],
212
+ type: "bar",
213
+ version: 1
214
+ },
215
+ supportedFeatures: [
216
+ "axes",
217
+ "axis-bands",
218
+ "axis-range",
219
+ "axis-scale",
220
+ "conditional-coloring",
221
+ "data-labels",
222
+ "dimensions",
223
+ "filters",
224
+ "legend",
225
+ "measure-axis",
226
+ "measures",
227
+ "orientation",
228
+ "query-limit",
229
+ "sorting",
230
+ "top-n",
231
+ "value-formatting"
232
+ ],
233
+ type: "bar"
234
+ },
235
+ {
236
+ documentation: {
237
+ constraints: [
238
+ "The single dimension is assigned the combo category role.",
239
+ "Set seriesType per measure to create bar, line, or point series; omission keeps the existing line default.",
240
+ "Data labels apply only to bar series.",
241
+ "Sorting refers to definition-local refs, not generated data-item IDs.",
242
+ "Set axis per measure to plot it against the primary or the secondary measure axis. Bar series share one axis: state it on any bar measure, and every bar measure that states one must state the same axis.",
243
+ L,
244
+ "Set range on a measure axis to fix its min, max, or both, for example to give several charts one shared scale; leave both unset and set startsAtZero to keep an auto-fitted axis anchored at zero. Set inverted on a measure axis to reverse its values, for example to put rank 1 at the top.",
245
+ "Set scale to log on a measure axis to draw it logarithmically, with gridlines at powers of ten. Zero and negative values are drawn at the floor of a log axis."
246
+ ],
247
+ dataRequirements: ["Exactly one dimension.", "Between one and ten measures."],
248
+ summary: "Combined categorical chart supporting multiple measures, per-measure axes, sorting, limiting, labels, legend, and orientation.",
249
+ title: "Combo chart"
250
+ },
251
+ example: {
252
+ data: {
253
+ dimensions: [j("manufacturer", A.manufacturer)],
254
+ measures: [{
255
+ ...N("sales"),
256
+ dataLabels: { visible: !0 },
257
+ seriesType: "bar"
258
+ }, {
259
+ ...N("horsepower", A.horsepower, "AVG"),
260
+ axis: "secondary",
261
+ seriesType: "line"
262
+ }]
263
+ },
264
+ filterGroup: P,
265
+ limiting: { queryLimit: 100 },
266
+ presentation: {
267
+ axes: pt,
268
+ dataLabels: { visible: !0 },
269
+ legend: F,
270
+ orientation: "vertical"
271
+ },
272
+ sorting: [{
273
+ by: "sales",
274
+ direction: "desc"
275
+ }],
276
+ type: "combo",
277
+ version: 1
278
+ },
279
+ supportedFeatures: [
280
+ ...R,
281
+ "axes",
282
+ "axis-bands",
283
+ "axis-range",
284
+ "axis-scale",
285
+ "data-labels",
286
+ "legend",
287
+ "measure-axis",
288
+ "orientation",
289
+ "query-limit",
290
+ "series-type",
291
+ "sorting"
292
+ ],
293
+ type: "combo"
294
+ },
295
+ {
296
+ documentation: {
297
+ constraints: ["All measures are assigned the gauge-value role.", "Distribution definitions enable the established gauge comparison mode."],
298
+ dataRequirements: ["Zero or one dimension.", "Between one and twenty measures."],
299
+ summary: "Gauge distribution across one or more values, optionally grouped by a dimension.",
300
+ title: "Distribution gauge"
301
+ },
302
+ example: {
303
+ data: {
304
+ dimensions: [j("manufacturer", A.manufacturer)],
305
+ measures: [N("sales"), N("averageSales", A.sales, "AVG")]
306
+ },
307
+ filterGroup: P,
308
+ presentation: {
309
+ displayMode: "bar",
310
+ legend: F
311
+ },
312
+ type: "distribution-gauge",
313
+ version: 1
314
+ },
315
+ supportedFeatures: [
316
+ ...R,
317
+ "conditional-coloring",
318
+ "display-mode",
319
+ "legend"
320
+ ],
321
+ type: "distribution-gauge"
322
+ },
323
+ {
324
+ documentation: {
325
+ constraints: ["Dimension order is significant and maps to the two dot-chart dimension roles.", "Set range on the primary measure axis to fix its min, max, or both, for example to give several charts one shared scale; leave both unset and set startsAtZero to keep an auto-fitted axis anchored at zero. Set inverted on the primary measure axis to reverse its values."],
326
+ dataRequirements: ["Exactly two dimensions.", "Exactly one measure."],
327
+ summary: "Dot comparison using two categorical dimensions and one measure.",
328
+ title: "Dot chart"
329
+ },
330
+ example: {
331
+ data: {
332
+ dimensions: [j("manufacturer", A.manufacturer), j("model", A.model)],
333
+ measures: [N("sales")]
334
+ },
335
+ filterGroup: P,
336
+ presentation: {
337
+ axes: pt,
338
+ legend: F,
339
+ orientation: "horizontal"
340
+ },
341
+ type: "dot",
342
+ version: 1
343
+ },
344
+ supportedFeatures: [
345
+ ...R,
346
+ "conditional-coloring",
347
+ "axes",
348
+ "axis-range",
349
+ "legend",
350
+ "orientation"
351
+ ],
352
+ type: "dot"
353
+ },
354
+ {
355
+ documentation: {
356
+ constraints: [
357
+ "With a dimension, the first measure is the gauge value and the optional second measure is the target.",
358
+ "Without a dimension, supplied measures are gauge values.",
359
+ "When a target measure is supplied, the compiler enables the established data-target mode."
360
+ ],
361
+ dataRequirements: ["Zero or one dimension.", "Between one and twenty measures; with one dimension, at most two measures."],
362
+ summary: "Gauge values with an optional grouping dimension and optional data target.",
363
+ title: "Gauge chart"
364
+ },
365
+ example: {
366
+ data: {
367
+ dimensions: [j("manufacturer", A.manufacturer)],
368
+ measures: [N("sales"), N("targetSales", A.sales, "AVG")]
369
+ },
370
+ filterGroup: P,
371
+ presentation: {
372
+ displayMode: "radial",
373
+ legend: F
374
+ },
375
+ type: "gauge",
376
+ version: 1
377
+ },
378
+ supportedFeatures: [
379
+ ...R,
380
+ "conditional-coloring",
381
+ "display-mode",
382
+ "legend"
383
+ ],
384
+ type: "gauge"
385
+ },
386
+ {
387
+ documentation: {
388
+ constraints: ["Dimension order maps to horizontal then vertical roles.", "Measure order maps to color then optional size roles."],
389
+ dataRequirements: ["Exactly two dimensions.", "One or two measures."],
390
+ summary: "Two-dimensional matrix colored and optionally sized by measures.",
391
+ title: "Heat map"
392
+ },
393
+ example: {
394
+ data: {
395
+ dimensions: [j("manufacturer", A.manufacturer), j("model", A.model)],
396
+ measures: [N("sales"), N("horsepower", A.horsepower, "AVG")]
397
+ },
398
+ filterGroup: P,
399
+ limiting: { queryLimit: 100 },
400
+ presentation: {
401
+ axes: ft,
402
+ legend: F
403
+ },
404
+ sorting: [{
405
+ by: "sales",
406
+ direction: "desc"
407
+ }],
408
+ type: "heatMap",
409
+ version: 1
410
+ },
411
+ supportedFeatures: [
412
+ ...R,
413
+ "conditional-coloring",
414
+ "axes",
415
+ "legend",
416
+ "query-limit",
417
+ "sorting"
418
+ ],
419
+ type: "heatMap"
420
+ },
421
+ {
422
+ documentation: {
423
+ constraints: [
424
+ "The compiler creates the canonical generated count measure; callers do not provide measures.",
425
+ L,
426
+ "Set range on the primary measure axis to fix its min, max, or both, for example to give several charts one shared scale; leave both unset and set startsAtZero to keep an auto-fitted axis anchored at zero. Set inverted on the primary measure axis to reverse its values."
427
+ ],
428
+ dataRequirements: ["Exactly one numeric dimension.", "No caller-supplied measures."],
429
+ summary: "Distribution of a numeric field into generated bins and counts.",
430
+ title: "Histogram"
431
+ },
432
+ example: {
433
+ data: { dimensions: [j("horsepower", A.horsepower)] },
434
+ filterGroup: P,
435
+ presentation: {
436
+ axes: mt,
437
+ legend: F,
438
+ orientation: "vertical"
439
+ },
440
+ type: "histogram",
441
+ version: 1
442
+ },
443
+ supportedFeatures: [
444
+ "axes",
445
+ "axis-bands",
446
+ "axis-range",
447
+ "dimensions",
448
+ "filters",
449
+ "legend",
450
+ "orientation",
451
+ "value-formatting"
452
+ ],
453
+ type: "histogram"
454
+ },
455
+ {
456
+ additionalExamples: [{
457
+ definition: {
458
+ data: {
459
+ dimensions: [j("manufacturer", A.manufacturer)],
460
+ measures: [{
461
+ ...N("sales"),
462
+ dataPointShape: "circle"
463
+ }]
464
+ },
465
+ presentation: { axes: { primaryMeasure: {
466
+ inverted: !0,
467
+ range: {
468
+ max: 100,
469
+ min: 1
470
+ },
471
+ title: "Rank"
472
+ } } },
473
+ type: "line",
474
+ version: 1
475
+ },
476
+ title: "Fixed, inverted measure axis"
477
+ }, {
478
+ definition: {
479
+ data: {
480
+ dimensions: [j("manufacturer", A.manufacturer), j("model", A.model)],
481
+ measures: [{
482
+ ...N("sales"),
483
+ dataPointShape: "circle"
484
+ }]
485
+ },
486
+ presentation: { coloring: { overwrites: [{
487
+ color: "#7C3AED",
488
+ operator: "startsWith",
489
+ value: "A"
490
+ }] } },
491
+ type: "line",
492
+ version: 1
493
+ },
494
+ title: "Series colored by dimension value"
495
+ }],
496
+ documentation: {
497
+ constraints: [
498
+ "Each measure may select the primary or secondary axis using its axis property.",
499
+ "Visible data labels require dataPointShape on every measure.",
500
+ L,
501
+ "Set range on a measure axis to fix its min, max, or both, for example to give several charts one shared scale; leave both unset and set startsAtZero to keep an auto-fitted axis anchored at zero. Set inverted on a measure axis to reverse its values, for example to put rank 1 at the top.",
502
+ "Set scale to log on a measure axis to draw it logarithmically, with gridlines at powers of ten. Zero and negative values are drawn at the floor of a log axis.",
503
+ "Value colors in presentation.coloring require at least two dimensions; measure color rules are not supported."
504
+ ],
505
+ dataRequirements: ["At least one dimension.", "At least one measure."],
506
+ summary: "Trend chart with sorting, query limiting, dual measure axes, labels, legend, and orientation.",
507
+ title: "Line chart"
508
+ },
509
+ example: {
510
+ data: {
511
+ dimensions: [j("manufacturer", A.manufacturer)],
512
+ measures: [{
513
+ ...N("sales"),
514
+ axis: "primary",
515
+ dataPointShape: "circle"
516
+ }, {
517
+ ...N("horsepower", A.horsepower, "AVG"),
518
+ axis: "secondary",
519
+ dataPointShape: "square"
520
+ }]
521
+ },
522
+ filterGroup: P,
523
+ limiting: { queryLimit: 100 },
524
+ presentation: {
525
+ axes: I,
526
+ dataLabels: {
527
+ density: "medium",
528
+ visible: !0
529
+ },
530
+ legend: F,
531
+ orientation: "vertical"
532
+ },
533
+ sorting: [{
534
+ by: "sales",
535
+ direction: "desc"
536
+ }],
537
+ type: "line",
538
+ version: 1
539
+ },
540
+ supportedFeatures: [
541
+ "axes",
542
+ "axis-bands",
543
+ "axis-range",
544
+ "axis-scale",
545
+ "conditional-coloring",
546
+ "data-labels",
547
+ "data-points",
548
+ "dimensions",
549
+ "filters",
550
+ "legend",
551
+ "measure-axis",
552
+ "measures",
553
+ "orientation",
554
+ "query-limit",
555
+ "sorting",
556
+ "value-formatting"
557
+ ],
558
+ type: "line"
559
+ },
560
+ {
561
+ documentation: {
562
+ constraints: [
563
+ "Without dimensions, at least two measures are required.",
564
+ "With dimensions, exactly one measure is supported.",
565
+ "Value colors in presentation.coloring require two dimensions; measure color rules are not supported."
566
+ ],
567
+ dataRequirements: ["Zero to two dimensions.", "Two to five measures without dimensions, or one with dimensions."],
568
+ summary: "Radial comparison chart for one or more measures with optional categorical dimensions.",
569
+ title: "Radar chart"
570
+ },
571
+ example: {
572
+ data: {
573
+ dimensions: [j("manufacturer", A.manufacturer)],
574
+ measures: [N("sales")]
575
+ },
576
+ filterGroup: P,
577
+ presentation: { legend: F },
578
+ type: "radar",
579
+ version: 1
580
+ },
581
+ supportedFeatures: [
582
+ ...R,
583
+ "conditional-coloring",
584
+ "legend"
585
+ ],
586
+ type: "radar"
587
+ },
588
+ {
589
+ additionalExamples: [{
590
+ definition: {
591
+ data: {
592
+ dimensions: [j("manufacturer", A.manufacturer)],
593
+ measures: [N("sales")]
594
+ },
595
+ presentation: { coloring: { overwrites: [
596
+ {
597
+ color: "#134E4A",
598
+ value: "Audi"
599
+ },
600
+ {
601
+ color: "#2DD4BF",
602
+ value: "BMW"
603
+ },
604
+ {
605
+ color: "#CCFBF1",
606
+ value: "Buick"
607
+ }
608
+ ] } },
609
+ type: "pie",
610
+ version: 1
611
+ },
612
+ title: "Ordered bands colored along a ramp"
613
+ }],
614
+ documentation: {
615
+ constraints: ["The first measure is the slice value; the optional second measure receives the length role."],
616
+ dataRequirements: ["Exactly one dimension.", "One or two measures."],
617
+ summary: "Part-to-whole chart with optional secondary radial measure.",
618
+ title: "Pie chart"
619
+ },
620
+ example: {
621
+ data: {
622
+ dimensions: [j("manufacturer", A.manufacturer)],
623
+ measures: [N("sales")]
624
+ },
625
+ filterGroup: P,
626
+ limiting: { queryLimit: 100 },
627
+ presentation: { legend: F },
628
+ sorting: [{
629
+ by: "sales",
630
+ direction: "desc"
631
+ }],
632
+ type: "pie",
633
+ version: 1
634
+ },
635
+ supportedFeatures: [
636
+ ...R,
637
+ "conditional-coloring",
638
+ "legend",
639
+ "query-limit",
640
+ "sorting"
641
+ ],
642
+ type: "pie"
643
+ },
644
+ {
645
+ documentation: {
646
+ constraints: ["At least one dimension or measure must be supplied.", "Trees with dimensions support at most one measure; measure-only trees may contain multiple measures."],
647
+ dataRequirements: ["Zero to ten dimensions.", "Zero to one hundred measures, or at most one with dimensions."],
648
+ summary: "Hierarchical tree built from dimensions, measures, or both.",
649
+ title: "Tree chart"
650
+ },
651
+ example: {
652
+ data: {
653
+ dimensions: [j("manufacturer", A.manufacturer), j("model", A.model)],
654
+ measures: [N("sales")]
655
+ },
656
+ filterGroup: P,
657
+ limiting: { queryLimit: 100 },
658
+ presentation: { layout: {
659
+ compact: !0,
660
+ direction: "top",
661
+ forceAutoFit: !1,
662
+ initialExpandedLevels: 1
663
+ } },
664
+ sorting: [{
665
+ by: "sales",
666
+ direction: "desc"
667
+ }],
668
+ type: "tree",
669
+ version: 1
670
+ },
671
+ supportedFeatures: [
672
+ ...R,
673
+ "layout",
674
+ "query-limit",
675
+ "sorting"
676
+ ],
677
+ type: "tree"
678
+ },
679
+ {
680
+ documentation: {
681
+ constraints: ["Dimension order defines hierarchy depth."],
682
+ dataRequirements: ["Between one and ten dimensions.", "Exactly one measure."],
683
+ summary: "Hierarchical area chart using ordered dimensions and one size measure.",
684
+ title: "Treemap"
685
+ },
686
+ example: {
687
+ data: {
688
+ dimensions: [j("manufacturer", A.manufacturer), j("model", A.model)],
689
+ measures: [N("sales")]
690
+ },
691
+ filterGroup: P,
692
+ presentation: { legend: F },
693
+ type: "treemap",
694
+ version: 1
695
+ },
696
+ supportedFeatures: [
697
+ ...R,
698
+ "conditional-coloring",
699
+ "legend"
700
+ ],
701
+ type: "treemap"
702
+ },
703
+ {
704
+ additionalExamples: [{
705
+ definition: {
706
+ data: {
707
+ dimensions: [j("manufacturer", A.manufacturer), j("model", A.model)],
708
+ measures: [N("sales")]
709
+ },
710
+ presentation: { coloring: { overwrites: [{
711
+ color: "#CA8A04",
712
+ dimension: "manufacturer",
713
+ value: "Audi"
714
+ }] } },
715
+ type: "sankey",
716
+ version: 1
717
+ },
718
+ title: "A color bound to a value of one flow stage"
719
+ }],
720
+ documentation: {
721
+ constraints: ["Dimension order defines the source-to-target flow stages.", "Every value color in presentation.coloring must name the dimension it applies to."],
722
+ dataRequirements: ["Between two and fifteen dimensions.", "Exactly one measure."],
723
+ summary: "Flow chart across an ordered sequence of categorical dimensions.",
724
+ title: "Sankey chart"
725
+ },
726
+ example: {
727
+ data: {
728
+ dimensions: [j("manufacturer", A.manufacturer), j("model", A.model)],
729
+ measures: [N("sales")]
730
+ },
731
+ filterGroup: P,
732
+ type: "sankey",
733
+ version: 1
734
+ },
735
+ supportedFeatures: [...R, "conditional-coloring"],
736
+ type: "sankey"
737
+ },
738
+ {
739
+ documentation: {
740
+ constraints: [
741
+ "Measure order maps to horizontal, vertical, and optional size roles.",
742
+ "The optional second dimension receives the image role.",
743
+ "Roles come from item order only; a ref is a label and does not select a role.",
744
+ "With a size measure, points scale between the setPointSize and setMaxPointSize operation values.",
745
+ "Set range on a measure axis to fix its min, max, or both, for example to give several charts one shared scale; leave both unset and set startsAtZero to keep an auto-fitted axis anchored at zero. Set inverted on a measure axis to reverse its values, for example to put rank 1 at the top."
746
+ ],
747
+ dataRequirements: ["One or two dimensions.", "Two or three measures."],
748
+ summary: "Relationship chart using horizontal and vertical measures with optional size and image roles.",
749
+ title: "Scatter chart"
750
+ },
751
+ example: {
752
+ data: {
753
+ dimensions: [j("manufacturer", A.manufacturer)],
754
+ measures: [
755
+ N("sales"),
756
+ N("horsepower", A.horsepower, "AVG"),
757
+ N("size", A.sales, "AVG")
758
+ ]
759
+ },
760
+ filterGroup: P,
761
+ presentation: {
762
+ axes: ht,
763
+ legend: F
764
+ },
765
+ type: "scatter",
766
+ version: 1
767
+ },
768
+ supportedFeatures: [
769
+ ...R,
770
+ "conditional-coloring",
771
+ "axes",
772
+ "axis-range",
773
+ "legend",
774
+ "query-limit",
775
+ "sorting"
776
+ ],
777
+ type: "scatter"
778
+ },
779
+ {
780
+ additionalExamples: [{
781
+ definition: {
782
+ data: {
783
+ dimensions: [j("manufacturer", A.manufacturer), j("model", A.model)],
784
+ measures: [N("sales")],
785
+ structure: "expandable"
786
+ },
787
+ filterGroup: P,
788
+ limiting: { queryLimit: 100 },
789
+ sorting: [{
790
+ by: "sales",
791
+ direction: "desc"
792
+ }],
793
+ type: "table",
794
+ version: 1
795
+ },
796
+ title: "Expandable table"
797
+ }, {
798
+ definition: {
799
+ data: {
800
+ columnDimensions: [j("model", A.model)],
801
+ measures: [N("sales")],
802
+ rowDimensions: [j("manufacturer", A.manufacturer)],
803
+ structure: "pivot"
804
+ },
805
+ filterGroup: P,
806
+ limiting: { queryLimit: 100 },
807
+ sorting: [{
808
+ by: "sales",
809
+ direction: "desc"
810
+ }],
811
+ type: "table",
812
+ version: 1
813
+ },
814
+ title: "Pivot table"
815
+ }],
816
+ documentation: {
817
+ constraints: [
818
+ "Normal table column order is preserved, and each column declares whether it is a dimension or measure.",
819
+ "Expandable table dimension order defines the expansion hierarchy.",
820
+ "Pivot tables explicitly separate row dimensions, column dimensions, and measures.",
821
+ "Measure definitions require valid aggregation for raw fields.",
822
+ "Presentation settings initialize table appearance and layout; later runtime operations preserve them.",
823
+ "Totals settings are optional; omitted totals properties preserve their values from the fresh default or preset vSpec."
824
+ ],
825
+ dataRequirements: [
826
+ "Normal tables require at least one ordered dimension or measure column.",
827
+ "Expandable tables require at least one dimension and one measure.",
828
+ "Pivot tables require at least one row dimension, one column dimension, and one measure."
829
+ ],
830
+ summary: "Normal, expandable, or pivot tabular output with formatting, filtering, sorting, query limiting, and totals.",
831
+ title: "Table"
832
+ },
833
+ example: {
834
+ data: {
835
+ columns: [
836
+ {
837
+ ...j("manufacturer", A.manufacturer),
838
+ role: "dimension"
839
+ },
840
+ {
841
+ ...j("model", A.model),
842
+ role: "dimension"
843
+ },
844
+ {
845
+ ...N("sales"),
846
+ role: "measure"
847
+ }
848
+ ],
849
+ structure: "normal"
850
+ },
851
+ filterGroup: P,
852
+ limiting: { queryLimit: 100 },
853
+ presentation: {
854
+ background: {
855
+ color: "#ffffff",
856
+ type: "single"
857
+ },
858
+ body: {
859
+ fontColor: "#1f1c3b",
860
+ fontFamily: "Roboto",
861
+ fontSize: 13,
862
+ horizontalAlign: "center",
863
+ verticalAlign: "middle"
864
+ },
865
+ borders: {
866
+ color: "#e0e0e0",
867
+ dividerColor: "#e0e0e0",
868
+ dividers: "all",
869
+ enabled: !0,
870
+ lineStyle: "line",
871
+ radius: 4,
872
+ strokeWidth: 1
873
+ },
874
+ header: {
875
+ backgroundColor: "#ffffff",
876
+ borderColor: "#e0e0e0",
877
+ fontColor: "#1f1c3b",
878
+ fontFamily: "Roboto",
879
+ fontSize: 13
880
+ },
881
+ highlight: {
882
+ backgroundColor: "#f2f2f2",
883
+ mode: "row"
884
+ },
885
+ layout: {
886
+ columnWidthBehavior: "responsive",
887
+ rowHeight: 41
888
+ }
889
+ },
890
+ sorting: [{
891
+ by: "sales",
892
+ direction: "desc"
893
+ }],
894
+ totals: {
895
+ applyTo: "both",
896
+ enabled: !0,
897
+ showRecordsCount: !0,
898
+ style: {
899
+ backgroundColor: "#f3f4f6",
900
+ fontColor: "#111827",
901
+ fontStyle: { bold: !0 },
902
+ position: "bottom",
903
+ responsiveHeight: !0
904
+ }
905
+ },
906
+ type: "table",
907
+ version: 1
908
+ },
909
+ supportedFeatures: [
910
+ "dimensions",
911
+ "filters",
912
+ "layout",
913
+ "measures",
914
+ "query-limit",
915
+ "sorting",
916
+ "table-structure",
917
+ "totals",
918
+ "value-formatting"
919
+ ],
920
+ type: "table"
921
+ },
922
+ {
923
+ documentation: {
924
+ constraints: [
925
+ "Dimensions are not supported. Measure order defines the waterfall sequence.",
926
+ "Set range on the primary measure axis to fix its min, max, or both, for example to give several charts one shared scale; leave both unset and set startsAtZero to keep an auto-fitted axis anchored at zero. Set inverted on the primary measure axis to reverse its values.",
927
+ L
928
+ ],
929
+ dataRequirements: ["Between one and one hundred measures."],
930
+ summary: "Sequential contribution chart composed from one or more measures.",
931
+ title: "Waterfall chart"
932
+ },
933
+ example: {
934
+ data: { measures: [{
935
+ ...N("sales"),
936
+ dataLabels: { visible: !0 }
937
+ }, {
938
+ ...N("horsepower", A.horsepower, "AVG"),
939
+ dataLabels: { visible: !0 }
940
+ }] },
941
+ filterGroup: P,
942
+ presentation: {
943
+ axes: gt,
944
+ dataLabels: { visible: !0 },
945
+ orientation: "vertical"
946
+ },
947
+ type: "waterfall",
948
+ version: 1
949
+ },
950
+ supportedFeatures: [
951
+ "axes",
952
+ "axis-bands",
953
+ "axis-range",
954
+ "data-labels",
955
+ "filters",
956
+ "measures",
957
+ "orientation",
958
+ "value-formatting"
959
+ ],
960
+ type: "waterfall"
961
+ },
962
+ {
963
+ documentation: {
964
+ constraints: ["The dimension supplies words and the measure supplies their weight."],
965
+ dataRequirements: ["Exactly one dimension.", "Exactly one measure."],
966
+ summary: "Weighted word display using one label dimension and one measure.",
967
+ title: "Word cloud"
968
+ },
969
+ example: {
970
+ data: {
971
+ dimensions: [j("manufacturer", A.manufacturer)],
972
+ measures: [N("sales")]
973
+ },
974
+ filterGroup: P,
975
+ type: "word-cloud",
976
+ version: 1
977
+ },
978
+ supportedFeatures: [...R, "conditional-coloring"],
979
+ type: "word-cloud"
980
+ },
981
+ {
982
+ documentation: {
983
+ constraints: ["The selected field must be date- or timestamp-compatible."],
984
+ dataRequirements: ["Exactly one field."],
985
+ summary: "Date selection control with single/range modes, labels, quick select, and responsive settings.",
986
+ title: "Date picker"
987
+ },
988
+ example: {
989
+ data: { field: M("latestLaunch", A.latestLaunch) },
990
+ settings: {
991
+ endDateLabel: "To",
992
+ pickerState: "expanded",
993
+ pickerType: "range",
994
+ quickSelect: !0,
995
+ responsive: !0,
996
+ startDateLabel: "From",
997
+ timePickerVisibility: "never",
998
+ weekStart: "1"
999
+ },
1000
+ type: "date-picker",
1001
+ version: 1
1002
+ },
1003
+ supportedFeatures: ["dimensions", "filter-settings"],
1004
+ type: "date-picker"
1005
+ },
1006
+ {
1007
+ documentation: {
1008
+ constraints: ["The selected field is used as a filter dimension."],
1009
+ dataRequirements: ["Exactly one field."],
1010
+ summary: "Interactive field filter with list/dropdown presentation and search/quick-select controls.",
1011
+ title: "Filter"
1012
+ },
1013
+ example: {
1014
+ data: { field: M("manufacturer", A.manufacturer) },
1015
+ presentation: {
1016
+ mode: "listbox",
1017
+ quickSelect: !0,
1018
+ responsive: !0,
1019
+ searchable: !0,
1020
+ showProgressBar: !1
1021
+ },
1022
+ type: "filter",
1023
+ version: 1
1024
+ },
1025
+ supportedFeatures: ["dimensions", "filter-settings"],
1026
+ type: "filter"
1027
+ },
1028
+ {
1029
+ documentation: {
1030
+ constraints: ["The URL must be absolute and valid; null clears the source."],
1031
+ dataRequirements: ["No query data."],
1032
+ summary: "Embedded external web content.",
1033
+ title: "Iframe"
1034
+ },
1035
+ example: {
1036
+ settings: { url: "https://example.com" },
1037
+ type: "iframe",
1038
+ version: 1
1039
+ },
1040
+ supportedFeatures: ["content"],
1041
+ type: "iframe"
1042
+ },
1043
+ {
1044
+ documentation: {
1045
+ constraints: ["The source must use one of the supported image source variants."],
1046
+ dataRequirements: ["No query data."],
1047
+ summary: "Image content with fit, opacity, blur, saturation, and shadow controls.",
1048
+ title: "Image"
1049
+ },
1050
+ example: {
1051
+ settings: {
1052
+ blur: 0,
1053
+ fit: "contain",
1054
+ opacity: .95,
1055
+ saturation: .9,
1056
+ shadow: !0,
1057
+ source: {
1058
+ imageUrl: "https://example.com/image.png",
1059
+ sourceKind: "url"
1060
+ }
1061
+ },
1062
+ type: "image",
1063
+ version: 1
1064
+ },
1065
+ supportedFeatures: ["content", "object-settings"],
1066
+ type: "image"
1067
+ },
1068
+ {
1069
+ documentation: {
1070
+ constraints: ["A raw field measure requires aggregation; semantic measures and calculations omit it."],
1071
+ dataRequirements: ["Exactly one measure."],
1072
+ summary: "Single aggregated or semantic value with value formatting and static filters.",
1073
+ title: "Number"
1074
+ },
1075
+ example: {
1076
+ data: { measure: N("sales") },
1077
+ filterGroup: P,
1078
+ type: "number",
1079
+ version: 1
1080
+ },
1081
+ supportedFeatures: [
1082
+ "filters",
1083
+ "measures",
1084
+ "value-formatting"
1085
+ ],
1086
+ type: "number"
1087
+ },
1088
+ {
1089
+ documentation: {
1090
+ constraints: ["Image-specific settings apply only when the selected shape/background mode supports them."],
1091
+ dataRequirements: ["No query data."],
1092
+ summary: "Decorative shape with fill, stroke, sizing, rotation, and border controls.",
1093
+ title: "Shape"
1094
+ },
1095
+ example: {
1096
+ settings: {
1097
+ backgroundColor: { code: "#2e6e9e" },
1098
+ backgroundType: "color",
1099
+ borderEnabled: !0,
1100
+ borderRadius: 8,
1101
+ heightBasedSize: !1,
1102
+ lineThickness: 4,
1103
+ preserveAspectRatio: !0,
1104
+ rotate: 12,
1105
+ scale: .7,
1106
+ shape: "hexagon",
1107
+ strokeColor: { code: "#18212b" }
1108
+ },
1109
+ type: "shape",
1110
+ version: 1
1111
+ },
1112
+ supportedFeatures: ["object-settings"],
1113
+ type: "shape"
1114
+ },
1115
+ {
1116
+ documentation: {
1117
+ constraints: ["Content interpretation follows the selected representation."],
1118
+ dataRequirements: ["No query data."],
1119
+ summary: "Text or Markdown content with typography, alignment, wrapping, and responsive controls.",
1120
+ title: "Text object"
1121
+ },
1122
+ example: {
1123
+ settings: {
1124
+ align: "center",
1125
+ content: "## Revenue overview",
1126
+ fontFamily: "Arial",
1127
+ fontSize: 30,
1128
+ position: "middle",
1129
+ representation: "markdown",
1130
+ responsive: !0,
1131
+ textColor: "#18212b",
1132
+ wordWrap: !0
1133
+ },
1134
+ type: "simpleTextObject",
1135
+ version: 1
1136
+ },
1137
+ supportedFeatures: ["content", "object-settings"],
1138
+ type: "simpleTextObject"
1139
+ },
1140
+ {
1141
+ documentation: {
1142
+ constraints: ["The referenced variable must exist in the host variable service when variable behavior is used."],
1143
+ dataRequirements: ["No query data; variable-backed input."],
1144
+ summary: "Variable input control with input type, label, placeholder, and responsive settings.",
1145
+ title: "Atomic input"
1146
+ },
1147
+ example: {
1148
+ settings: {
1149
+ customLabel: {
1150
+ enabled: !0,
1151
+ text: "Target"
1152
+ },
1153
+ inputType: "text",
1154
+ placeholder: "Enter target",
1155
+ responsive: !0,
1156
+ variableId: "target-variable"
1157
+ },
1158
+ type: "atomic-input",
1159
+ version: 1
1160
+ },
1161
+ supportedFeatures: ["input-settings"],
1162
+ type: "atomic-input"
1163
+ },
1164
+ {
1165
+ documentation: {
1166
+ constraints: [
1167
+ "Orientation defaults to horizontal. Use vertical for stacked sidebar filters; editors open beside the sidebar when space permits.",
1168
+ "The bar displays active selections from its selection group, regardless of the fields allowed for creating new filters.",
1169
+ "An empty selectableFieldKeys list allows users to create filters on any selectable field.",
1170
+ "Selection mode overrides apply only to selections created by this bar; apply, cancel, and clear affect the shared selection group.",
1171
+ "Chart breakdown switching is hidden by default. Enable showChartBreakdown only when the app uses dimension groups; a group must have multiple available fields for the control to appear."
1172
+ ],
1173
+ dataRequirements: ["No query data; uses field metadata and selections supplied by the host."],
1174
+ summary: "App filter bar settings for selection behavior, filter creation, associative filtering, and selectable fields.",
1175
+ title: "Astrato App Filter Bar"
1176
+ },
1177
+ example: {
1178
+ settings: {
1179
+ enableAddingNewFilters: !0,
1180
+ enableAssociativeFilter: !0,
1181
+ selectableFieldKeys: ["[Cars].[Manufacturer]", "[Cars].[Model]"],
1182
+ selectionMode: "inherit",
1183
+ showChartBreakdown: !1,
1184
+ showClearAll: !0
1185
+ },
1186
+ type: "astrato-app-filter-bar",
1187
+ version: 1
1188
+ },
1189
+ supportedFeatures: ["selection-settings"],
1190
+ type: "astrato-app-filter-bar"
1191
+ },
1192
+ {
1193
+ documentation: {
1194
+ constraints: ["The field must be numeric or date-compatible with the configured range and step.", "Providing range enables manual bounds; omitting it keeps data-derived bounds."],
1195
+ dataRequirements: ["Exactly one field."],
1196
+ summary: "Numeric or date range control with single/multi layout, step, and quick select.",
1197
+ title: "Slider"
1198
+ },
1199
+ example: {
1200
+ data: { field: M("horsepower", A.horsepower) },
1201
+ settings: {
1202
+ layout: "multi",
1203
+ quickSelect: !0,
1204
+ range: {
1205
+ max: 500,
1206
+ min: 0
1207
+ },
1208
+ step: 10
1209
+ },
1210
+ type: "slider",
1211
+ version: 1
1212
+ },
1213
+ supportedFeatures: ["dimensions", "filter-settings"],
1214
+ type: "slider"
1215
+ }
1216
+ ]), z = (e) => {
1217
+ let t = _t.find((t) => t.type === e);
1218
+ if (!t) throw Error(`Missing visualization definition documentation for ${e}`);
1219
+ return t;
1220
+ }, B = (e, t) => k.toJSONSchema(e.meta({ title: t }), {
1221
+ reused: "inline",
1222
+ target: "draft-2020-12"
1223
+ }), V = z("bar"), vt = {
1224
+ compile: ot,
1225
+ documentation: V.documentation,
1226
+ examples: [V.example, ...(V.additionalExamples ?? []).map(({ definition: e }) => e)],
1227
+ jsonSchema: B(Je, `${V.documentation.title} definition`),
1228
+ schema: Je,
1229
+ supportedFeatures: V.supportedFeatures,
1230
+ type: "bar",
1231
+ version: 1
1232
+ }, H = z("astrato-app-filter-bar"), yt = {
1233
+ compile: at,
1234
+ documentation: H.documentation,
1235
+ examples: [H.example],
1236
+ jsonSchema: B(xe, `${H.documentation.title} definition`),
1237
+ schema: xe,
1238
+ supportedFeatures: H.supportedFeatures,
1239
+ type: "astrato-app-filter-bar",
1240
+ version: 1
1241
+ }, U = r(), bt = {
1242
+ combo: {
1243
+ coloringType: t.PerEachMeasure,
1244
+ queryLimit: !0,
1245
+ schema: Te,
1246
+ sorting: !0,
1247
+ type: "combo",
1248
+ vSpecSchema: ee
1249
+ },
1250
+ "distribution-gauge": {
1251
+ coloringType: t.PerEachMeasure,
1252
+ measureRole: () => e.GAUGE_VALUE,
1253
+ schema: g,
1254
+ type: "distribution-gauge",
1255
+ vSpecSchema: d
1256
+ },
1257
+ dot: {
1258
+ coloringType: t.Categorical,
1259
+ schema: Ie,
1260
+ type: "dot",
1261
+ vSpecSchema: s
1262
+ },
1263
+ gauge: {
1264
+ coloringType: (e) => (e.data.dimensions?.length ?? 0) > 0 ? t.Categorical : t.PerEachMeasure,
1265
+ measureRole: (t, n) => (n.data.dimensions?.length ?? 0) > 0 && t === 1 ? e.GAUGE_TARGET : e.GAUGE_VALUE,
1266
+ schema: we,
1267
+ type: "gauge",
1268
+ vSpecSchema: le
1269
+ },
1270
+ heatMap: {
1271
+ coloringType: t.Gradient,
1272
+ dimensionRole: (e) => e === 0 ? n.HEAT_MAP_HORIZONTAL : n.HEAT_MAP_VERTICAL,
1273
+ measureRole: (t) => t === 0 ? e.HEAT_MAP_COLOR : e.HEAT_MAP_SIZE,
1274
+ queryLimit: !0,
1275
+ schema: Oe,
1276
+ sorting: !0,
1277
+ type: "heatMap",
1278
+ vSpecSchema: ne
1279
+ },
1280
+ histogram: {
1281
+ coloringType: t.Single,
1282
+ schema: Xe,
1283
+ type: "histogram",
1284
+ vSpecSchema: ae
1285
+ },
1286
+ pie: {
1287
+ coloringType: t.Categorical,
1288
+ measureRole: (t) => t === 0 ? e.PIE_CHART_SLICE : e.PIE_CHART_LENGTH,
1289
+ queryLimit: !0,
1290
+ schema: De,
1291
+ sorting: !0,
1292
+ type: "pie",
1293
+ vSpecSchema: ce
1294
+ },
1295
+ radar: {
1296
+ conditionalColoringFallbackType: t.Single,
1297
+ schema: Re,
1298
+ type: "radar",
1299
+ vSpecSchema: se
1300
+ },
1301
+ sankey: {
1302
+ schema: Le,
1303
+ type: "sankey",
1304
+ vSpecSchema: fe
1305
+ },
1306
+ scatter: {
1307
+ coloringType: t.Categorical,
1308
+ dimensionRole: (e) => e === 0 ? n.SCATTER_DIMENSION : n.SCATTER_IMAGE,
1309
+ measureRole: (t) => [
1310
+ e.SCATTER_HORIZONTAL,
1311
+ e.SCATTER_VERTICAL,
1312
+ e.SCATTER_SIZE
1313
+ ][t],
1314
+ queryLimit: !0,
1315
+ schema: ze,
1316
+ sorting: !0,
1317
+ type: "scatter",
1318
+ vSpecSchema: oe
1319
+ },
1320
+ tree: {
1321
+ queryLimit: !0,
1322
+ schema: Me,
1323
+ sorting: !0,
1324
+ type: "tree",
1325
+ vSpecSchema: l
1326
+ },
1327
+ treemap: {
1328
+ schema: ye,
1329
+ type: "treemap",
1330
+ vSpecSchema: te
1331
+ },
1332
+ waterfall: {
1333
+ schema: Ue,
1334
+ type: "waterfall",
1335
+ vSpecSchema: u
1336
+ },
1337
+ "word-cloud": {
1338
+ conditionalColoringFallbackType: t.Single,
1339
+ schema: et,
1340
+ type: "word-cloud",
1341
+ vSpecSchema: o
1342
+ }
1343
+ }, xt = (e, t) => {
1344
+ let n = [], r = t.presentation, i = Be(r?.axes);
1345
+ if (i) return Promise.resolve({
1346
+ issue: i,
1347
+ success: !1
1348
+ });
1349
+ r?.orientation !== void 0 && n.push({
1350
+ name: "setOrientation",
1351
+ payload: r.orientation
1352
+ }), r?.legend && n.push(...We(e.vSpec, r.legend)), Object.entries(r?.axes ?? {}).forEach(([e, t]) => {
1353
+ t.titleVisible !== void 0 && n.push({
1354
+ name: "setShowAxisTitle",
1355
+ payload: {
1356
+ axisName: e,
1357
+ showAxisName: t.titleVisible
1358
+ }
1359
+ }), t.title !== void 0 && n.push({
1360
+ name: "setAxisTitle",
1361
+ payload: {
1362
+ axisName: e,
1363
+ axisTitle: t.title
1364
+ }
1365
+ }), t.labelsVisible !== void 0 && n.push({
1366
+ name: "setShowAxisLabels",
1367
+ payload: {
1368
+ axisName: e,
1369
+ showLabels: t.labelsVisible
1370
+ }
1371
+ }), t.ticksVisible !== void 0 && n.push({
1372
+ name: "setShowAxisTicks",
1373
+ payload: {
1374
+ axisName: e,
1375
+ showAxisTicks: t.ticksVisible
1376
+ }
1377
+ }), t.lineVisible !== void 0 && n.push({
1378
+ name: "setShowAxisLine",
1379
+ payload: {
1380
+ axisName: e,
1381
+ showAxisLine: t.lineVisible
1382
+ }
1383
+ }), n.push(...He(e, t)), "scale" in t && t.scale !== void 0 && n.push({
1384
+ name: _e.SET_AXIS_SCALE,
1385
+ payload: {
1386
+ axisName: e,
1387
+ scale: t.scale
1388
+ }
1389
+ });
1390
+ });
1391
+ let a = r?.axes?.primaryMeasure?.bands;
1392
+ return a && n.push({
1393
+ name: he.SET_MEASURE_AXIS_BANDS,
1394
+ payload: { bands: a }
1395
+ }), (t.data.measures ?? []).forEach((i) => {
1396
+ let a = i.dataLabels ?? (t.type !== "combo" || i.seriesType === "bar" ? r?.dataLabels : void 0);
1397
+ a && n.push({
1398
+ name: "setMeasureDataLabelsShow",
1399
+ payload: {
1400
+ ...T(e.resolvedRefs[i.ref]),
1401
+ show: a.visible
1402
+ }
1403
+ });
1404
+ }), y(e, n, ["presentation"]);
1405
+ }, St = (e, t) => {
1406
+ let n = [];
1407
+ if (t.type === "combo") {
1408
+ (t.data.measures ?? []).forEach((t) => {
1409
+ t.seriesType && n.push({
1410
+ name: ge.SET_MEASURE_GRAPH_TYPE,
1411
+ payload: {
1412
+ ...T(e.resolvedRefs[t.ref]),
1413
+ graphType: t.seriesType
1414
+ }
1415
+ });
1416
+ });
1417
+ let r = t.data.measures ?? [], i = r.find((e) => e.seriesType === "bar"), a = r.find((e) => e.seriesType === "bar" && e.axis)?.axis;
1418
+ r.forEach((t) => {
1419
+ t.seriesType !== "bar" && t.axis && n.push({
1420
+ name: m.CHANGE_MEASURE_AXIS,
1421
+ payload: {
1422
+ ...T(e.resolvedRefs[t.ref]),
1423
+ secondaryAxis: t.axis === "secondary"
1424
+ }
1425
+ });
1426
+ }), i && a && n.push({
1427
+ name: m.CHANGE_MEASURE_AXIS,
1428
+ payload: {
1429
+ ...T(e.resolvedRefs[i.ref]),
1430
+ secondaryAxis: a === "secondary"
1431
+ }
1432
+ });
1433
+ }
1434
+ if (t.type === "gauge" || t.type === "distribution-gauge") {
1435
+ let e = t.type === "distribution-gauge";
1436
+ e && n.push({
1437
+ name: ve.SET_GAUGE_COMPARISON_MODE,
1438
+ payload: !0
1439
+ }), t.presentation?.displayMode && n.push({
1440
+ name: e ? ve.SET_GAUGE_BAR_MODE : me.SET_GAUGE_BAR_MODE,
1441
+ payload: t.presentation.displayMode === "bar"
1442
+ }), !e && (t.data.dimensions?.length ?? 0) > 0 && (t.data.measures?.length ?? 0) > 1 && n.push({
1443
+ name: me.SET_GAUGE_TARGET_TYPE,
1444
+ payload: a.Data
1445
+ });
1446
+ }
1447
+ if (t.type === "tree" && t.presentation?.layout) {
1448
+ let e = t.presentation.layout;
1449
+ e.compact !== void 0 && n.push({
1450
+ name: p.SET_TREE_COMPACT,
1451
+ payload: e.compact
1452
+ }), e.forceAutoFit !== void 0 && n.push({
1453
+ name: p.SET_TREE_FORCE_AUTO_FIT,
1454
+ payload: e.forceAutoFit
1455
+ }), e.direction !== void 0 && n.push({
1456
+ name: p.SET_TREE_DIRECTION_ORIGIN,
1457
+ payload: e.direction
1458
+ }), e.initialExpandedLevels !== void 0 && n.push({
1459
+ name: p.SET_TREE_INITIAL_EXPANDED_LEVELS,
1460
+ payload: e.initialExpandedLevels
1461
+ });
1462
+ }
1463
+ return y(e, n, ["presentation"]);
1464
+ }, Ct = (e, t, n) => {
1465
+ let r = "coloring" in e.vSpec && e.vSpec.coloring !== void 0, i = t.presentation?.legend, a = !!i && Object.keys(i).length > 0 && i.visible !== !1, o = t.presentation?.coloring !== void 0, s = n.coloringType ?? (o ? n.conditionalColoringFallbackType : void 0);
1466
+ return !s || r || !a && !o ? Promise.resolve({
1467
+ state: e,
1468
+ success: !0
1469
+ }) : y(e, [{
1470
+ name: "setColoringType",
1471
+ payload: typeof s == "function" ? s(t) : s
1472
+ }], a ? ["presentation", "legend"] : ["presentation", "coloring"]);
1473
+ }, wt = async (e, t) => {
1474
+ let n = bt[t], r = n.schema.safeParse(e.definition);
1475
+ if (!r.success) return {
1476
+ issues: w(r.error, e.definition),
1477
+ success: !1
1478
+ };
1479
+ let i = n.vSpecSchema.safeParse(e.baseVSpec);
1480
+ if (!i.success) return {
1481
+ issues: [_("invalid_structure", ["baseVSpec"], `Base ${t} vSpec is invalid.`, { details: { issues: i.error.issues } })],
1482
+ success: !1
1483
+ };
1484
+ let a = i.data;
1485
+ if (!C(a, [
1486
+ "dimensions",
1487
+ "measures",
1488
+ "supportingMeasures",
1489
+ "sortingMeasures"
1490
+ ])) return {
1491
+ issues: [_("non_fresh_base_vspec", ["baseVSpec"], `${t} definitions require a fresh base vSpec.`)],
1492
+ success: !1
1493
+ };
1494
+ let o = r.data, s = o.data.dimensions ?? [], c = o.data.measures ?? [], l = [...s, ...c].map((e) => e.ref), u = [
1495
+ ...D(s, e.availableFields, ["data", "dimensions"], "dimension"),
1496
+ ...D(c, e.availableFields, ["data", "measures"], "measure"),
1497
+ ...Se([{
1498
+ items: s,
1499
+ path: ["data", "dimensions"]
1500
+ }, {
1501
+ items: c,
1502
+ path: ["data", "measures"]
1503
+ }]),
1504
+ ...nt(o.filterGroup, e.availableFields),
1505
+ ...tt(o.sorting, l),
1506
+ ...Pe(o.presentation?.coloring, s.map((e) => e.ref), c.map((e) => e.ref)),
1507
+ ...t === "histogram" && s[0] ? O(s[0], e.availableFields, [
1508
+ "data",
1509
+ "dimensions",
1510
+ 0
1511
+ ], [
1512
+ U.FieldType.DECIMAL,
1513
+ U.FieldType.FLOAT,
1514
+ U.FieldType.INT,
1515
+ U.FieldType.REAL
1516
+ ], "a histogram dimension") : []
1517
+ ];
1518
+ if (u.length > 0) return {
1519
+ issues: u,
1520
+ success: !1
1521
+ };
1522
+ let d = {
1523
+ state: S(e, a),
1524
+ success: !0
1525
+ };
1526
+ for (let [e, t] of s.entries()) {
1527
+ if ("issue" in d) return {
1528
+ issues: [d.issue],
1529
+ success: !1
1530
+ };
1531
+ let r = n.dimensionRole?.(e, o);
1532
+ d = await x(d.state, t, "dimension", "addDimension", {
1533
+ key: t.fieldKey,
1534
+ ...r ? { role: r } : {}
1535
+ }, [
1536
+ "data",
1537
+ "dimensions",
1538
+ e
1539
+ ]);
1540
+ }
1541
+ for (let [t, r] of c.entries()) {
1542
+ if ("issue" in d) return {
1543
+ issues: [d.issue],
1544
+ success: !1
1545
+ };
1546
+ let i = n.measureRole?.(t, o);
1547
+ d = await x(d.state, r, "measure", "addMeasure", it(r, e.availableFields, i ? { role: i } : {}), [
1548
+ "data",
1549
+ "measures",
1550
+ t
1551
+ ]);
1552
+ }
1553
+ return "issue" in d || (d = await Ze(d.state, s, "updateDimension", ["data", "dimensions"]), "issue" in d) || (d = await St(d.state, o), "issue" in d) || (d = await Ct(d.state, o, n), "issue" in d) || (d = await $e(d.state, s, "setDimensionTemporalGrouping", ["data", "dimensions"]), "issue" in d) || (d = await Ve(d.state, s, {
1554
+ formatString: "setDimensionFormatString",
1555
+ formatType: "setDimensionFormatType"
1556
+ }, ["data", "dimensions"]), "issue" in d) || (d = await Ve(d.state, c, {
1557
+ currency: "setMeasureCurrency",
1558
+ currencyIsPrefix: "setMeasureCurrencyIsPrefix",
1559
+ formatString: "setMeasureFormatString",
1560
+ formatType: "setMeasureFormatType",
1561
+ negativeType: "setMeasureNegativeType"
1562
+ }, ["data", "measures"]), "issue" in d) || (d = await Ge(d.state, o.filterGroup), "issue" in d) || n.sorting && (d = await Ye(d.state, o.sorting, "changeSortOrderAndDirection", "toggleSortingItem"), "issue" in d) || n.queryLimit && o.limiting?.queryLimit !== void 0 && (d = await y(d.state, [{
1563
+ name: "setQueryLimit",
1564
+ payload: o.limiting.queryLimit
1565
+ }], ["limiting"]), "issue" in d) || (d = await xt(d.state, o), "issue" in d) ? {
1566
+ issues: [d.issue],
1567
+ success: !1
1568
+ } : (d = await qe(d.state, o.presentation?.coloring), "issue" in d ? {
1569
+ issues: [d.issue],
1570
+ success: !1
1571
+ } : v(d.state, n.vSpecSchema));
1572
+ }, W = (e) => {
1573
+ let t = z(e.type);
1574
+ return {
1575
+ compile: (t) => wt(t, e.type),
1576
+ documentation: t.documentation,
1577
+ examples: [t.example, ...(t.additionalExamples ?? []).map(({ definition: e }) => e)],
1578
+ jsonSchema: B(e.schema, `${t.documentation.title} definition`),
1579
+ schema: e.schema,
1580
+ supportedFeatures: t.supportedFeatures,
1581
+ type: e.type,
1582
+ version: 1
1583
+ };
1584
+ }, Tt = [
1585
+ W({
1586
+ schema: Te,
1587
+ type: "combo"
1588
+ }),
1589
+ W({
1590
+ schema: Ie,
1591
+ type: "dot"
1592
+ }),
1593
+ W({
1594
+ schema: ze,
1595
+ type: "scatter"
1596
+ }),
1597
+ W({
1598
+ schema: Xe,
1599
+ type: "histogram"
1600
+ }),
1601
+ W({
1602
+ schema: Oe,
1603
+ type: "heatMap"
1604
+ }),
1605
+ W({
1606
+ schema: Re,
1607
+ type: "radar"
1608
+ }),
1609
+ W({
1610
+ schema: we,
1611
+ type: "gauge"
1612
+ }),
1613
+ W({
1614
+ schema: g,
1615
+ type: "distribution-gauge"
1616
+ }),
1617
+ W({
1618
+ schema: De,
1619
+ type: "pie"
1620
+ }),
1621
+ W({
1622
+ schema: Me,
1623
+ type: "tree"
1624
+ }),
1625
+ W({
1626
+ schema: ye,
1627
+ type: "treemap"
1628
+ }),
1629
+ W({
1630
+ schema: Le,
1631
+ type: "sankey"
1632
+ }),
1633
+ W({
1634
+ schema: Ue,
1635
+ type: "waterfall"
1636
+ }),
1637
+ W({
1638
+ schema: et,
1639
+ type: "word-cloud"
1640
+ })
1641
+ ], G = z("filter"), Et = {
1642
+ compile: st,
1643
+ documentation: G.documentation,
1644
+ examples: [G.example],
1645
+ jsonSchema: B(Fe, `${G.documentation.title} definition`),
1646
+ schema: Fe,
1647
+ supportedFeatures: G.supportedFeatures,
1648
+ type: "filter",
1649
+ version: 1
1650
+ }, K = z("line"), Dt = {
1651
+ compile: ct,
1652
+ documentation: K.documentation,
1653
+ examples: [K.example, ...(K.additionalExamples ?? []).map(({ definition: e }) => e)],
1654
+ jsonSchema: B(E, `${K.documentation.title} definition`),
1655
+ schema: E,
1656
+ supportedFeatures: K.supportedFeatures,
1657
+ type: "line",
1658
+ version: 1
1659
+ }, q = z("number"), Ot = {
1660
+ compile: lt,
1661
+ documentation: q.documentation,
1662
+ examples: [q.example],
1663
+ jsonSchema: B(Ne, `${q.documentation.title} definition`),
1664
+ schema: Ne,
1665
+ supportedFeatures: q.supportedFeatures,
1666
+ type: "number",
1667
+ version: 1
1668
+ }, J = (e, t) => Object.entries(e).flatMap(([e, n]) => n === void 0 || !t[e] ? [] : [{
1669
+ name: t[e],
1670
+ payload: n
1671
+ }]), kt = {
1672
+ "atomic-input": {
1673
+ createRequests: (e) => {
1674
+ let t = e.customLabel;
1675
+ return [...J(e, {
1676
+ hideLabel: "setAtomicInputHideLabel",
1677
+ inputType: "setAtomicInputType",
1678
+ placeholder: "setAtomicInputPlaceholder",
1679
+ responsive: "setAtomicInputResponsive",
1680
+ variableId: "setAtomicInputVariableId"
1681
+ }), ...t ? [{
1682
+ name: "setAtomicInputCustomLabelEnabled",
1683
+ payload: t.enabled
1684
+ }, ...t.text === void 0 ? [] : [{
1685
+ name: "setAtomicInputCustomLabelText",
1686
+ payload: t.text
1687
+ }]] : []];
1688
+ },
1689
+ schema: b,
1690
+ type: "atomic-input",
1691
+ vSpecSchema: c
1692
+ },
1693
+ iframe: {
1694
+ createRequests: (e) => [{
1695
+ name: "setIframeUrl",
1696
+ payload: e.url
1697
+ }],
1698
+ schema: Ae,
1699
+ type: "iframe",
1700
+ vSpecSchema: pe
1701
+ },
1702
+ image: {
1703
+ createRequests: (e) => J(e, {
1704
+ blur: "setImageBlur",
1705
+ fit: "setImageFit",
1706
+ opacity: "setImageOpacity",
1707
+ saturation: "setImageSaturation",
1708
+ shadow: "setImageShadow",
1709
+ source: "setImageSource"
1710
+ }),
1711
+ schema: je,
1712
+ type: "image",
1713
+ vSpecSchema: re
1714
+ },
1715
+ shape: {
1716
+ createRequests: (e) => J(e, {
1717
+ backgroundColor: "setShapeBackgroundColor",
1718
+ backgroundType: "setShapeBackgroundType",
1719
+ borderEnabled: "setShapeBorderEnabled",
1720
+ borderRadius: "setShapeBorderRadius",
1721
+ heightBasedSize: "setShapeHeightBasedSize",
1722
+ imageFit: "setShapeImageFit",
1723
+ imageURL: "setShapeImageURL",
1724
+ lineThickness: "setShapeBorderWidth",
1725
+ preserveAspectRatio: "setShapePreserveAspectRatio",
1726
+ rotate: "setShapeRotation",
1727
+ scale: "setShapeScale",
1728
+ shape: "setShapeType",
1729
+ strokeColor: "setShapeBorderColor"
1730
+ }),
1731
+ schema: Ce,
1732
+ type: "shape",
1733
+ vSpecSchema: ie
1734
+ },
1735
+ simpleTextObject: {
1736
+ createRequests: (e) => [...e.content === void 0 ? [] : [{
1737
+ name: "setTextContent",
1738
+ payload: {
1739
+ textContent: e.content,
1740
+ representation: e.representation
1741
+ }
1742
+ }], ...J(e, {
1743
+ align: "setTextHorizontalAlign",
1744
+ fontFamily: "setTextFontFamily",
1745
+ fontSize: "setTextFontSize",
1746
+ position: "setTextVerticalAlign",
1747
+ representation: "setTextRepresentation",
1748
+ responsive: "setTextResponsiveEnabled",
1749
+ textColor: "setTextColor",
1750
+ wordWrap: "setTextWordWrap"
1751
+ })],
1752
+ schema: h,
1753
+ type: "simpleTextObject",
1754
+ vSpecSchema: ue
1755
+ }
1756
+ }, Y = async (e, t) => {
1757
+ let n = kt[t], r = n.schema.safeParse(e.definition);
1758
+ if (!r.success) return {
1759
+ issues: w(r.error, e.definition),
1760
+ success: !1
1761
+ };
1762
+ let i = n.vSpecSchema.safeParse(e.baseVSpec);
1763
+ if (!i.success) return {
1764
+ issues: [_("invalid_structure", ["baseVSpec"], `Base ${t} vSpec is invalid.`, { details: { issues: i.error.issues } })],
1765
+ success: !1
1766
+ };
1767
+ let a = S(e, i.data), o = r.data.settings, s = await y(a, n.createRequests(o), ["settings"]);
1768
+ return "issue" in s ? {
1769
+ issues: [s.issue],
1770
+ success: !1
1771
+ } : v(s.state, n.vSpecSchema);
1772
+ }, At = async (e) => {
1773
+ let t = ke.safeParse(e.definition);
1774
+ if (!t.success) return {
1775
+ issues: w(t.error, e.definition),
1776
+ success: !1
1777
+ };
1778
+ let n = f.safeParse(e.baseVSpec);
1779
+ if (!n.success) return {
1780
+ issues: [_("invalid_structure", ["baseVSpec"], "Base date-picker vSpec is invalid.", { details: { issues: n.error.issues } })],
1781
+ success: !1
1782
+ };
1783
+ let r = n.data;
1784
+ if (!C(r, ["dimensions", "measures"])) return {
1785
+ issues: [_("non_fresh_base_vspec", ["baseVSpec"], "Date-picker definitions require a fresh vSpec.")],
1786
+ success: !1
1787
+ };
1788
+ let i = t.data, a = [...rt(i.data.field, e.availableFields, ["data", "field"], "dimension"), ...O(i.data.field, e.availableFields, ["data", "field"], [
1789
+ U.FieldType.DATE,
1790
+ U.FieldType.TIMESTAMP,
1791
+ U.FieldType.TIMESTAMP_TZ
1792
+ ], "a date-picker field")];
1793
+ if (a.length > 0) return {
1794
+ issues: a,
1795
+ success: !1
1796
+ };
1797
+ let o = await x(S(e, r), i.data.field, "dimension", "addDatePickerDimension", { key: i.data.field.fieldKey }, ["data", "field"]);
1798
+ return "issue" in o ? {
1799
+ issues: [o.issue],
1800
+ success: !1
1801
+ } : (o = await y(o.state, J(i.settings ?? {}, {
1802
+ endDateLabel: "setDatePickerEndDateLabel",
1803
+ pickerState: "setDatePickerState",
1804
+ pickerType: "setDatePickerType",
1805
+ quickSelect: "setDatePickerQuickSelect",
1806
+ responsive: "setDatePickerResponsive",
1807
+ startDateLabel: "setDatePickerStartDateLabel",
1808
+ timePickerVisibility: "setDatePickerTimePickerVisibility",
1809
+ weekStart: "setDatePickerWeekStart"
1810
+ }), ["settings"]), "issue" in o ? {
1811
+ issues: [o.issue],
1812
+ success: !1
1813
+ } : v(o.state, f));
1814
+ }, jt = async (e) => {
1815
+ let t = Ee.safeParse(e.definition);
1816
+ if (!t.success) return {
1817
+ issues: w(t.error, e.definition),
1818
+ success: !1
1819
+ };
1820
+ let n = de.safeParse(e.baseVSpec);
1821
+ if (!n.success) return {
1822
+ issues: [_("invalid_structure", ["baseVSpec"], "Base slider vSpec is invalid.", { details: { issues: n.error.issues } })],
1823
+ success: !1
1824
+ };
1825
+ let r = n.data;
1826
+ if (!C(r, ["dimensions", "measures"])) return {
1827
+ issues: [_("non_fresh_base_vspec", ["baseVSpec"], "Slider definitions require a fresh vSpec.")],
1828
+ success: !1
1829
+ };
1830
+ let i = t.data, a = [...rt(i.data.field, e.availableFields, ["data", "field"], "dimension"), ...O(i.data.field, e.availableFields, ["data", "field"], [
1831
+ U.FieldType.DATE,
1832
+ U.FieldType.DECIMAL,
1833
+ U.FieldType.FLOAT,
1834
+ U.FieldType.INT,
1835
+ U.FieldType.REAL,
1836
+ U.FieldType.TIMESTAMP,
1837
+ U.FieldType.TIMESTAMP_TZ
1838
+ ], "a slider field")];
1839
+ if (a.length > 0) return {
1840
+ issues: a,
1841
+ success: !1
1842
+ };
1843
+ let o = await x(S(e, r), i.data.field, "dimension", "addSliderDimension", { key: i.data.field.fieldKey }, ["data", "field"]);
1844
+ if ("issue" in o) return {
1845
+ issues: [o.issue],
1846
+ success: !1
1847
+ };
1848
+ let s = i.settings ?? {};
1849
+ return o = await y(o.state, [...s.range === void 0 ? [] : [{
1850
+ name: "setSliderManualRangeEnabled",
1851
+ payload: !0
1852
+ }], ...J(s, {
1853
+ layout: "setSliderLayout",
1854
+ quickSelect: "setSliderQuickSelect",
1855
+ range: "setSliderRange",
1856
+ step: "setSliderStep"
1857
+ })], ["settings"]), "issue" in o ? {
1858
+ issues: [o.issue],
1859
+ success: !1
1860
+ } : v(o.state, de);
1861
+ }, X = (e) => {
1862
+ let t = z(e.type);
1863
+ return {
1864
+ compile: e.compile,
1865
+ documentation: t.documentation,
1866
+ examples: [t.example],
1867
+ jsonSchema: B(e.schema, `${t.documentation.title} definition`),
1868
+ schema: e.schema,
1869
+ supportedFeatures: t.supportedFeatures,
1870
+ type: e.type,
1871
+ version: 1
1872
+ };
1873
+ }, Mt = [
1874
+ X({
1875
+ compile: At,
1876
+ schema: ke,
1877
+ type: "date-picker"
1878
+ }),
1879
+ X({
1880
+ compile: (e) => Y(e, "iframe"),
1881
+ schema: Ae,
1882
+ type: "iframe"
1883
+ }),
1884
+ X({
1885
+ compile: (e) => Y(e, "image"),
1886
+ schema: je,
1887
+ type: "image"
1888
+ }),
1889
+ X({
1890
+ compile: (e) => Y(e, "shape"),
1891
+ schema: Ce,
1892
+ type: "shape"
1893
+ }),
1894
+ X({
1895
+ compile: (e) => Y(e, "simpleTextObject"),
1896
+ schema: h,
1897
+ type: "simpleTextObject"
1898
+ }),
1899
+ X({
1900
+ compile: (e) => Y(e, "atomic-input"),
1901
+ schema: b,
1902
+ type: "atomic-input"
1903
+ }),
1904
+ X({
1905
+ compile: jt,
1906
+ schema: Ee,
1907
+ type: "slider"
1908
+ })
1909
+ ], Z = z("table"), Nt = {
1910
+ compile: ut,
1911
+ documentation: Z.documentation,
1912
+ examples: [Z.example, ...(Z.additionalExamples ?? []).map(({ definition: e }) => e)],
1913
+ jsonSchema: B(be, `${Z.documentation.title} definition`),
1914
+ schema: be,
1915
+ supportedFeatures: Z.supportedFeatures,
1916
+ type: "table",
1917
+ version: 1
1918
+ }, Pt = (e, t) => `${t}:${e}`, Ft = [
1919
+ yt,
1920
+ vt,
1921
+ ...Tt,
1922
+ ...Mt,
1923
+ Dt,
1924
+ Nt,
1925
+ Ot,
1926
+ Et
1927
+ ], It = new Map(Ft.map((e) => [Pt(e.type, e.version), e])), Q = (e, t = 1) => It.get(Pt(e, t)), Lt = () => [...It.values()].map(({ documentation: e, examples: t, jsonSchema: n, supportedFeatures: r, type: i, version: a }) => ({
1928
+ documentation: e,
1929
+ examples: t,
1930
+ jsonSchema: n,
1931
+ supportedFeatures: r,
1932
+ type: i,
1933
+ version: a
1934
+ })), $ = () => Ft.map((e) => e.type), Rt = (e) => {
1935
+ if (typeof e != "object" || !e || Array.isArray(e)) return {
1936
+ code: "invalid_structure",
1937
+ message: "Visualization definition must be an object.",
1938
+ path: []
1939
+ };
1940
+ let t = "version" in e ? e.version : void 0;
1941
+ if (t !== 1) return {
1942
+ allowedValues: [1],
1943
+ code: "unsupported_version",
1944
+ message: `Visualization definition version "${String(t)}" is not supported.`,
1945
+ path: ["version"]
1946
+ };
1947
+ let n = "type" in e ? e.type : void 0;
1948
+ if (!(typeof n == "string" && Q(n, t))) return {
1949
+ allowedValues: $(),
1950
+ code: "unsupported_visualization",
1951
+ message: `Visualization type "${String(n)}" is not supported.`,
1952
+ path: ["type"]
1953
+ };
1954
+ }, zt = (e) => {
1955
+ let t = Rt(e);
1956
+ if (t) return {
1957
+ issues: [t],
1958
+ success: !1
1959
+ };
1960
+ let n = Q(e.type, e.version);
1961
+ if (!n) return {
1962
+ issues: [{
1963
+ allowedValues: $(),
1964
+ code: "unsupported_visualization",
1965
+ message: "Visualization definition descriptor is not available.",
1966
+ path: ["type"]
1967
+ }],
1968
+ success: !1
1969
+ };
1970
+ let r = n.schema.safeParse(e);
1971
+ return r.success ? {
1972
+ definition: r.data,
1973
+ issues: [],
1974
+ success: !0
1975
+ } : {
1976
+ issues: w(r.error, e),
1977
+ success: !1
1978
+ };
1979
+ }, Bt = async (e) => {
1980
+ let t = Rt(e.definition);
1981
+ if (t) return {
1982
+ issues: [t],
1983
+ success: !1
1984
+ };
1985
+ let n = e.definition, r = Q(n.type, n.version), a = k.array(Qe).safeParse(e.availableFields);
1986
+ if (!a.success) return {
1987
+ issues: w(a.error, e.availableFields, ["availableFields"]),
1988
+ success: !1
1989
+ };
1990
+ let o = /* @__PURE__ */ new Map(), s = a.data.flatMap((e, t) => {
1991
+ let n = o.get(e.fieldKey);
1992
+ return o.set(e.fieldKey, t), n === void 0 ? [] : [{
1993
+ code: "invalid_structure",
1994
+ details: { duplicateIndex: n },
1995
+ message: `Available field key "${e.fieldKey}" is duplicated.`,
1996
+ path: [
1997
+ "availableFields",
1998
+ t,
1999
+ "fieldKey"
2000
+ ]
2001
+ }];
2002
+ });
2003
+ if (s.length > 0) return {
2004
+ issues: s,
2005
+ success: !1
2006
+ };
2007
+ let c = Ke(a.data), l = k.array(i).safeParse(c);
2008
+ return l.success ? r ? r.compile({
2009
+ ...e,
2010
+ availableFields: a.data
2011
+ }) : {
2012
+ issues: [{
2013
+ allowedValues: $(),
2014
+ code: "unsupported_visualization",
2015
+ message: "Visualization definition descriptor is not available.",
2016
+ path: ["type"]
2017
+ }],
2018
+ success: !1
2019
+ } : {
2020
+ issues: w(l.error, c, ["availableFields"]),
2021
+ success: !1
2022
+ };
2023
+ };
2024
+ export { Lt as i, zt as n, Q as r, Bt as t };