@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,222 @@
1
+ import { a as e, ec as t, ns as n, qs as r } from "./isEqual-BDxAhUo8.js";
2
+ import { C as i, D as a, N as o, T as s, d as c, g as l, h as u, i as d, k as f, o as p, p as m, s as h, t as g, u as _, v, w as y, x as b, y as x } from "./shared-CBvcC5YV.js";
3
+ import { Hd as S, bd as C } from "./handlers-VTBfIZYZ.js";
4
+ import { p as w } from "./operations-CTNUX6Sy.js";
5
+ e();
6
+ var T = {
7
+ all: n.ShowAll,
8
+ auto: n.Auto,
9
+ horizontal: n.ShowHorizontal,
10
+ none: n.NoBorders,
11
+ vertical: n.ShowVertical
12
+ }, E = (e) => e.flatMap(([e, t]) => t === void 0 ? [] : [{
13
+ name: e,
14
+ payload: t
15
+ }]), D = (e) => e ? E([
16
+ [w.SET_TABLE_COLUMN_WIDTH_BEHAVIOR, e.columnWidthBehavior],
17
+ [w.SET_TABLE_FIXED_ROW_HEIGHT_ENABLED, e.rowHeight !== void 0 || void 0],
18
+ [w.SET_TABLE_FIXED_ROW_HEIGHT_VALUE, e.rowHeight]
19
+ ]) : [], O = (e) => e ? E([
20
+ [w.SET_TABLE_BACKGROUND_TYPE, e.type],
21
+ [w.SET_TABLE_BACKGROUND_COLOR, e.color],
22
+ [w.SET_TABLE_ODD_BACKGROUND_COLOR, e.oddColor],
23
+ [w.SET_TABLE_EVEN_BACKGROUND_COLOR, e.evenColor]
24
+ ]) : [], k = (e) => e ? E([
25
+ [w.SET_TABLE_BODY_FONT_FAMILY, e.fontFamily],
26
+ [w.SET_TABLE_BODY_FONT_SIZE, e.fontSize],
27
+ [w.SET_TABLE_ALL_COLUMNS_FONT_COLOR, e.fontColor],
28
+ [w.SET_TABLE_ALL_COLUMNS_FONT_STYLE, e.fontStyle],
29
+ [w.SET_TABLE_ALL_COLUMNS_HORIZONTAL_ALIGN, e.horizontalAlign],
30
+ [w.SET_TABLE_ALL_COLUMNS_VERTICAL_ALIGN, e.verticalAlign]
31
+ ]) : [], A = (e) => e ? E([
32
+ [w.SET_TABLE_HEADER_BACKGROUND_COLOR, e.backgroundColor],
33
+ [w.SET_TABLE_HEADER_BORDER_COLOR, e.borderColor],
34
+ [w.SET_TABLE_HEADER_FONT_COLOR, e.fontColor],
35
+ [w.SET_TABLE_HEADER_FONT_FAMILY, e.fontFamily],
36
+ [w.SET_TABLE_HEADER_FONT_SIZE, e.fontSize],
37
+ [w.SET_TABLE_HEADER_FONT_STYLE, e.fontStyle],
38
+ [w.SET_TABLE_HEADER_RESPONSIVE_HEIGHT, e.responsiveHeight]
39
+ ]) : [], j = (e) => e ? E([
40
+ [w.SET_TABLE_BORDER_ENABLED, e.enabled],
41
+ [w.SET_TABLE_BORDER_COLOR, e.color],
42
+ [w.SET_TABLE_BORDER_LINE_STYLE, e.lineStyle],
43
+ [w.SET_TABLE_BORDER_RADIUS, e.radius],
44
+ [w.SET_TABLE_BORDER_STROKE_WIDTH, e.strokeWidth],
45
+ [w.SET_TABLE_COLUMN_BORDERS, e.dividers === void 0 ? void 0 : T[e.dividers]],
46
+ [w.SET_TABLE_COLUMN_BORDER_COLOR, e.dividerColor]
47
+ ]) : [], M = (e) => e ? E([
48
+ [w.SET_TABLE_HIGHLIGHT_MODE, e.mode],
49
+ [w.SET_TABLE_HIGHLIGHT_BACKGROUND_COLOR, e.backgroundColor],
50
+ [w.SET_TABLE_HIGHLIGHT_TEXT_COLOR, e.textColor]
51
+ ]) : [], N = (e) => e ? [
52
+ ...D(e.layout),
53
+ ...O(e.background),
54
+ ...k(e.body),
55
+ ...A(e.header),
56
+ ...j(e.borders),
57
+ ...M(e.highlight)
58
+ ] : [], P = (e) => e ? E([
59
+ [w.SET_TABLE_TOTALS_ENABLED, e.enabled],
60
+ [w.SET_TABLE_TOTALS_SHOW_RECORDS_COUNT, e.showRecordsCount],
61
+ [w.SET_TABLE_TOTALS_APPLY_TO, e.applyTo],
62
+ [w.SET_TABLE_TOTALS_BACKGROUND_COLOR, e.style?.backgroundColor],
63
+ [w.SET_TABLE_TOTALS_FONT_COLOR, e.style?.fontColor],
64
+ [w.SET_TABLE_TOTALS_FONT_STYLE, e.style?.fontStyle],
65
+ [w.SET_TABLE_TOTALS_POSITION, e.style?.position],
66
+ [w.SET_TABLE_TOTALS_RESPONSIVE_HEIGHT, e.style?.responsiveHeight]
67
+ ]) : [], F = (e, t, n, r = !1) => ({
68
+ ...e,
69
+ path: n,
70
+ role: t,
71
+ topDimension: r
72
+ }), I = (e) => "columns" in e ? [{
73
+ items: e.columns.map((e, t) => F(e, e.role, [
74
+ "data",
75
+ "columns",
76
+ t
77
+ ])),
78
+ path: ["data", "columns"]
79
+ }] : e.structure === "expandable" ? [{
80
+ items: e.dimensions.map((e, t) => F(e, "dimension", [
81
+ "data",
82
+ "dimensions",
83
+ t
84
+ ])),
85
+ path: ["data", "dimensions"]
86
+ }, {
87
+ items: e.measures.map((e, t) => F(e, "measure", [
88
+ "data",
89
+ "measures",
90
+ t
91
+ ])),
92
+ path: ["data", "measures"]
93
+ }] : [
94
+ {
95
+ items: e.rowDimensions.map((e, t) => F(e, "dimension", [
96
+ "data",
97
+ "rowDimensions",
98
+ t
99
+ ])),
100
+ path: ["data", "rowDimensions"]
101
+ },
102
+ {
103
+ items: e.columnDimensions.map((e, t) => F(e, "dimension", [
104
+ "data",
105
+ "columnDimensions",
106
+ t
107
+ ], !0)),
108
+ path: ["data", "columnDimensions"]
109
+ },
110
+ {
111
+ items: e.measures.map((e, t) => F(e, "measure", [
112
+ "data",
113
+ "measures",
114
+ t
115
+ ])),
116
+ path: ["data", "measures"]
117
+ }
118
+ ], L = (e) => {
119
+ if (!(!("structure" in e) || e.structure === void 0)) switch (e.structure) {
120
+ case "normal": return r.Normal;
121
+ case "expandable": return r.Hierarchical;
122
+ case "pivot": return r.Pivot;
123
+ }
124
+ }, R = (e, t) => u(e, t.flatMap((t) => t.role !== "dimension" || t.showNullValues === void 0 ? [] : [{
125
+ name: w.SET_COLUMN_SHOW_NULL_VALUES,
126
+ payload: {
127
+ ...x(e.resolvedRefs[t.ref]),
128
+ showNullValues: t.showNullValues
129
+ }
130
+ }]), ["data"]), z = (e, n, r) => {
131
+ let i = [
132
+ "formatType",
133
+ "formatString",
134
+ "currency",
135
+ "currencyIsPrefix",
136
+ "negativeType"
137
+ ];
138
+ return u(e, n.flatMap((n) => {
139
+ let a = e.availableFields.find((e) => e.key === n.fieldKey), o = a ? t(a) : n.fieldKey;
140
+ return i.flatMap((e) => {
141
+ let t = n.format?.[e], i = r[e];
142
+ return t !== void 0 && i ? [m(i, o, n.ref, n.path, e, t, n.role)] : [];
143
+ });
144
+ }), ["data"]);
145
+ }, B = async (e) => {
146
+ let t = C(e);
147
+ if (t) return {
148
+ issues: [{
149
+ code: "invalid_structure",
150
+ message: t,
151
+ path: []
152
+ }],
153
+ success: !1
154
+ };
155
+ let n = o.safeParse(e.definition);
156
+ if (!n.success) return {
157
+ issues: y(n.error, e.definition),
158
+ success: !1
159
+ };
160
+ let r = S.safeParse(e.baseVSpec);
161
+ if (!r.success) return {
162
+ issues: [c("invalid_structure", ["baseVSpec"], "Base table vSpec is invalid.", { details: { issues: r.error.issues } })],
163
+ success: !1
164
+ };
165
+ let m = r.data;
166
+ if (!v(m, [
167
+ "columns",
168
+ "dimensions",
169
+ "measures",
170
+ "supportingMeasures",
171
+ "sortingMeasures"
172
+ ])) return {
173
+ issues: [c("non_fresh_base_vspec", ["baseVSpec"], "Table definitions require a fresh base vSpec.")],
174
+ success: !1
175
+ };
176
+ let x = n.data, T = I(x.data), E = T.flatMap((e) => e.items), D = [
177
+ ...E.flatMap((t) => a(t, e.availableFields, t.path, t.role)),
178
+ ...i(T),
179
+ ...f(x.filterGroup, e.availableFields),
180
+ ...b(x.sorting, E.map((e) => e.ref))
181
+ ];
182
+ if (D.length) return {
183
+ issues: D,
184
+ success: !1
185
+ };
186
+ let O = {
187
+ state: _(e, m),
188
+ success: !0
189
+ }, k = L(x.data);
190
+ k !== void 0 && (O = await u(O.state, [{
191
+ name: w.SET_TABLE_DATA_STRUCTURE,
192
+ payload: k
193
+ }], ["data", "structure"]));
194
+ for (let t of E) {
195
+ if ("issue" in O) return {
196
+ issues: [O.issue],
197
+ success: !1
198
+ };
199
+ O = await g(O.state, t, t.role, w.ADD_COLUMN, t.role === "measure" ? s(t, e.availableFields, { columnType: t.role }) : {
200
+ columnType: t.role,
201
+ key: t.fieldKey,
202
+ topDimension: t.topDimension
203
+ }, t.path);
204
+ }
205
+ return "issue" in O || (O = await R(O.state, E), "issue" in O) || (O = await h(O.state, E.filter((e) => e.role === "dimension"), w.SET_COLUMN_TEMPORAL_GROUPING, ["data"]), "issue" in O) || (O = await z(O.state, E, {
206
+ currency: w.SET_COLUMN_CURRENCY,
207
+ currencyIsPrefix: w.SET_COLUMN_CURRENCY_IS_PREFIX,
208
+ formatString: w.SET_COLUMN_FORMAT_STRING,
209
+ formatType: w.SET_COLUMN_FORMAT_TYPE,
210
+ negativeType: w.SET_COLUMN_NEGATIVE_TYPE
211
+ }), "issue" in O) || (O = await u(O.state, N(x.presentation), ["presentation"]), "issue" in O) || (O = await d(O.state, x.filterGroup), "issue" in O) || (O = await p(O.state, x.sorting, w.CHANGE_SORT_ORDER_AND_DIRECTION, w.TOGGLE_SORTING_ITEM), "issue" in O) || (O = await u(O.state, x.limiting?.queryLimit === void 0 ? [] : [{
212
+ name: w.SET_QUERY_LIMIT,
213
+ payload: x.limiting.queryLimit
214
+ }], ["limiting"]), "issue" in O) ? {
215
+ issues: [O.issue],
216
+ success: !1
217
+ } : (O = await u(O.state, P(x.totals), ["totals"]), "issue" in O ? {
218
+ issues: [O.issue],
219
+ success: !1
220
+ } : l(O.state, S));
221
+ };
222
+ export { B as compileTableVisualizationDefinition };
@@ -0,0 +1,13 @@
1
+ import { t as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ var t = /* @__PURE__ */ e(((e, t) => {
3
+ function n(e) {
4
+ "@babel/helpers - typeof";
5
+ return t.exports = n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
6
+ return typeof e;
7
+ } : function(e) {
8
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
9
+ }, t.exports.__esModule = !0, t.exports.default = t.exports, n(e);
10
+ }
11
+ t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
12
+ }));
13
+ export { t };