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