@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,198 @@
1
+ import { a as e } from "./isEqual-BDxAhUo8.js";
2
+ import { C as t, H as n, O as r, S as i, T as a, _ as o, a as s, c, d as l, f as u, g as d, h as f, i as p, k as m, n as h, o as g, r as _, s as v, t as y, u as b, v as x, w as S, x as C, y as w } from "./shared-CBvcC5YV.js";
3
+ import { bd as T, df as E } from "./handlers-VTBfIZYZ.js";
4
+ import { b as D, g as O, v as k, w as A } from "./operations-CTNUX6Sy.js";
5
+ e();
6
+ var j = async (e) => {
7
+ let j = T(e);
8
+ if (j) return {
9
+ issues: [{
10
+ code: "invalid_structure",
11
+ message: j,
12
+ path: []
13
+ }],
14
+ success: !1
15
+ };
16
+ let M = n.safeParse(e.definition);
17
+ if (!M.success) return {
18
+ issues: S(M.error, e.definition),
19
+ success: !1
20
+ };
21
+ let N = E.safeParse(e.baseVSpec);
22
+ if (!N.success) return {
23
+ issues: [l("invalid_structure", ["baseVSpec"], "Base line vSpec is invalid.")],
24
+ success: !1
25
+ };
26
+ let P = N.data;
27
+ if (!x(P, [
28
+ "dimensions",
29
+ "measures",
30
+ "supportingMeasures",
31
+ "sortingMeasures"
32
+ ])) return {
33
+ issues: [l("non_fresh_base_vspec", ["baseVSpec"], "Line definitions require a fresh base vSpec.")],
34
+ success: !1
35
+ };
36
+ let F = M.data, I = [...F.data.dimensions, ...F.data.measures], L = [
37
+ ...r(F.data.dimensions, e.availableFields, ["data", "dimensions"], "dimension"),
38
+ ...r(F.data.measures, e.availableFields, ["data", "measures"], "measure"),
39
+ ...t([{
40
+ items: F.data.dimensions,
41
+ path: ["data", "dimensions"]
42
+ }, {
43
+ items: F.data.measures,
44
+ path: ["data", "measures"]
45
+ }]),
46
+ ...m(F.filterGroup, e.availableFields),
47
+ ...C(F.sorting, I.map((e) => e.ref)),
48
+ ...i(F.presentation?.coloring, F.data.dimensions.map((e) => e.ref), F.data.measures.map((e) => e.ref))
49
+ ];
50
+ if (L.length) return {
51
+ issues: L,
52
+ success: !1
53
+ };
54
+ let R = {
55
+ state: b(e, P),
56
+ success: !0
57
+ };
58
+ for (let [e, t] of F.data.dimensions.entries()) {
59
+ if ("issue" in R) return {
60
+ issues: [R.issue],
61
+ success: !1
62
+ };
63
+ R = await y(R.state, t, "dimension", O.ADD_DIMENSION, { key: t.fieldKey }, [
64
+ "data",
65
+ "dimensions",
66
+ e
67
+ ]);
68
+ }
69
+ for (let [t, n] of F.data.measures.entries()) {
70
+ if ("issue" in R) return {
71
+ issues: [R.issue],
72
+ success: !1
73
+ };
74
+ R = await y(R.state, n, "measure", O.ADD_MEASURE, a(n, e.availableFields), [
75
+ "data",
76
+ "measures",
77
+ t
78
+ ]);
79
+ }
80
+ if ("issue" in R || (R = await _(R.state, F.data.dimensions, O.UPDATE_DIMENSION, ["data", "dimensions"]), "issue" in R) || (R = await v(R.state, F.data.dimensions, "setDimensionTemporalGrouping", ["data", "dimensions"]), "issue" in R) || (R = await s(R.state, F.data.dimensions, {
81
+ formatString: "setDimensionFormatString",
82
+ formatType: "setDimensionFormatType"
83
+ }, ["data", "dimensions"]), "issue" in R) || (R = await s(R.state, F.data.measures, {
84
+ currency: "setMeasureCurrency",
85
+ currencyIsPrefix: "setMeasureCurrencyIsPrefix",
86
+ formatString: "setMeasureFormatString",
87
+ formatType: "setMeasureFormatType",
88
+ negativeType: "setMeasureNegativeType"
89
+ }, ["data", "measures"]), "issue" in R)) return {
90
+ issues: [R.issue],
91
+ success: !1
92
+ };
93
+ let z = R.state, B = F.data.measures.flatMap((e) => e.axis ? [{
94
+ name: O.CHANGE_MEASURE_AXIS,
95
+ payload: {
96
+ ...w(z.resolvedRefs[e.ref]),
97
+ secondaryAxis: e.axis === "secondary"
98
+ }
99
+ }] : []);
100
+ if (R = await f(R.state, B, ["data", "measures"]), "issue" in R) return {
101
+ issues: [R.issue],
102
+ success: !1
103
+ };
104
+ let V = R.state;
105
+ if (R = await f(V, F.data.measures.flatMap((e) => e.dataPointShape === void 0 ? [] : [{
106
+ name: O.SET_MEASURE_SHAPE,
107
+ payload: {
108
+ ...w(V.resolvedRefs[e.ref]),
109
+ shape: e.dataPointShape
110
+ }
111
+ }]), ["data", "measures"]), "issue" in R || (R = await p(R.state, F.filterGroup), "issue" in R) || (R = await g(R.state, F.sorting, O.CHANGE_SORT_ORDER_AND_DIRECTION, O.TOGGLE_SORTING_ITEM), "issue" in R)) return {
112
+ issues: [R.issue],
113
+ success: !1
114
+ };
115
+ let H = [];
116
+ F.limiting?.queryLimit !== void 0 && H.push({
117
+ name: O.SET_QUERY_LIMIT,
118
+ payload: F.limiting.queryLimit
119
+ });
120
+ let U = F.presentation, W = o(U?.axes);
121
+ if (W) return {
122
+ issues: [W],
123
+ success: !1
124
+ };
125
+ if (U?.orientation !== void 0 && H.push({
126
+ name: O.SET_ORIENTATION,
127
+ payload: U.orientation
128
+ }), U?.legend && H.push(...u(R.state.vSpec, U.legend)), U?.dataLabels) {
129
+ let e = U.dataLabels, t = R.state;
130
+ F.data.measures.forEach((n) => {
131
+ let r = w(t.resolvedRefs[n.ref]);
132
+ H.push({
133
+ name: A.SET_MEASURE_DATA_LABELS_SHOW,
134
+ payload: {
135
+ ...r,
136
+ show: e.visible
137
+ }
138
+ }), e.density && H.push({
139
+ name: A.SET_MEASURE_DATA_LABEL_DENSITY,
140
+ payload: {
141
+ ...r,
142
+ density: e.density
143
+ }
144
+ });
145
+ });
146
+ }
147
+ Object.entries(U?.axes ?? {}).forEach(([e, t]) => {
148
+ t.titleVisible !== void 0 && H.push({
149
+ name: O.SET_SHOW_AXIS_TITLE,
150
+ payload: {
151
+ axisName: e,
152
+ showAxisName: t.titleVisible
153
+ }
154
+ }), t.title !== void 0 && H.push({
155
+ name: O.SET_AXIS_TITLE,
156
+ payload: {
157
+ axisName: e,
158
+ axisTitle: t.title
159
+ }
160
+ }), t.labelsVisible !== void 0 && H.push({
161
+ name: O.SET_SHOW_AXIS_LABELS,
162
+ payload: {
163
+ axisName: e,
164
+ showLabels: t.labelsVisible
165
+ }
166
+ }), t.ticksVisible !== void 0 && H.push({
167
+ name: O.SET_SHOW_AXIS_TICKS,
168
+ payload: {
169
+ axisName: e,
170
+ showAxisTicks: t.ticksVisible
171
+ }
172
+ }), t.lineVisible !== void 0 && H.push({
173
+ name: O.SET_SHOW_AXIS_LINE,
174
+ payload: {
175
+ axisName: e,
176
+ showAxisLine: t.lineVisible
177
+ }
178
+ }), H.push(...c(e, t)), "scale" in t && t.scale !== void 0 && H.push({
179
+ name: k.SET_AXIS_SCALE,
180
+ payload: {
181
+ axisName: e,
182
+ scale: t.scale
183
+ }
184
+ });
185
+ });
186
+ let G = U?.axes?.primaryMeasure?.bands;
187
+ return G && H.push({
188
+ name: D.SET_MEASURE_AXIS_BANDS,
189
+ payload: { bands: G }
190
+ }), R = await f(R.state, H, ["presentation"]), "issue" in R ? {
191
+ issues: [R.issue],
192
+ success: !1
193
+ } : (R = await h(R.state, F.presentation?.coloring), "issue" in R ? {
194
+ issues: [R.issue],
195
+ success: !1
196
+ } : d(R.state, E));
197
+ };
198
+ export { j as compileLineVisualizationDefinition };
@@ -0,0 +1,28 @@
1
+ import { a as e, i as t, o as n } from "./operations-CTNUX6Sy.js";
2
+ var r = { measureFiltersEnabled: !0 }, i = () => ({
3
+ count: 0,
4
+ names: [],
5
+ items: []
6
+ }), a = (e) => typeof e == "object" && !!e && !Array.isArray(e), o = (e, t) => {
7
+ let n = e[t];
8
+ return typeof n == "string" ? n : void 0;
9
+ }, s = (e) => {
10
+ if (!e) return i();
11
+ let t = e.flatMap((e) => !a(e) || typeof e.name != "string" ? [] : [{
12
+ name: e.name,
13
+ friendlyName: o(e, "friendlyName"),
14
+ description: o(e, "description"),
15
+ ...e.payloadSchema === void 0 ? {} : { payloadSchema: e.payloadSchema },
16
+ ...e.resultSchema === void 0 ? {} : { resultSchema: e.resultSchema }
17
+ }]);
18
+ return {
19
+ count: t.length,
20
+ names: t.map(({ name: e }) => e),
21
+ items: t
22
+ };
23
+ }, c = (e) => {
24
+ let n = t(e);
25
+ if (!n) throw Error(`No vSpec schema found for standalone visualization type: ${e}`);
26
+ return { vSpec: n };
27
+ }, l = (t) => s(e(t, r)), u = (e) => s(n(e));
28
+ export { l as n, c as r, u as t };
@@ -0,0 +1,53 @@
1
+ import "./isEqual-BDxAhUo8.js";
2
+ import { D as e, T as t, V as n, a as r, d as i, g as a, i as o, k as s, t as c, u as l, v as u, w as d } from "./shared-CBvcC5YV.js";
3
+ import { bd as f, lf as p } from "./handlers-VTBfIZYZ.js";
4
+ import { h as m } from "./operations-CTNUX6Sy.js";
5
+ var h = async (h) => {
6
+ let g = f(h);
7
+ if (g) return {
8
+ issues: [{
9
+ code: "invalid_structure",
10
+ message: g,
11
+ path: []
12
+ }],
13
+ success: !1
14
+ };
15
+ let _ = n.safeParse(h.definition);
16
+ if (!_.success) return {
17
+ issues: d(_.error, h.definition),
18
+ success: !1
19
+ };
20
+ let v = p.safeParse(h.baseVSpec);
21
+ if (!v.success) return {
22
+ issues: [i("invalid_structure", ["baseVSpec"], "Base number vSpec is invalid.")],
23
+ success: !1
24
+ };
25
+ let y = v.data;
26
+ if (!u(y, ["measures", "supportingMeasures"])) return {
27
+ issues: [i("non_fresh_base_vspec", ["baseVSpec"], "Number definitions require a fresh base vSpec.")],
28
+ success: !1
29
+ };
30
+ let b = _.data, x = [...e(b.data.measure, h.availableFields, ["data", "measure"], "measure"), ...s(b.filterGroup, h.availableFields)];
31
+ if (x.length) return {
32
+ issues: x,
33
+ success: !1
34
+ };
35
+ let S = await c(l(h, y), b.data.measure, "measure", m.ADD_MEASURE, t(b.data.measure, h.availableFields, { role: "number-measure" }), ["data", "measure"]);
36
+ return "issue" in S || (S = await r(S.state, [{
37
+ ...b.data.measure,
38
+ path: ["data", "measure"]
39
+ }], {
40
+ currency: "setMeasureCurrency",
41
+ currencyIsPrefix: "setMeasureCurrencyIsPrefix",
42
+ formatString: "setMeasureFormatString",
43
+ formatType: "setMeasureFormatType",
44
+ negativeType: "setMeasureNegativeType"
45
+ }, ["data", "measure"]), "issue" in S) ? {
46
+ issues: [S.issue],
47
+ success: !1
48
+ } : (S = await o(S.state, b.filterGroup), "issue" in S ? {
49
+ issues: [S.issue],
50
+ success: !1
51
+ } : a(S.state, p));
52
+ };
53
+ export { h as compileNumberVisualizationDefinition };