@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,156 @@
1
+ import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { Oa as t, Wc as n, Wn as r, ds as i, hc as a, yn as o } from "./interfaces-VUY4_yVO.js";
3
+ import { G as s, Ki as c, Ui as l, Zt as u, c as d, d as f, hn as p, l as m, s as h, v as g, wi as _, xn as v } from "./utils-Ba9T0TqC.js";
4
+ import { f as y, h as b, m as x, p as S } from "./src-Cum_2NLV.js";
5
+ import { u as C } from "./src-DvX5LU9T.js";
6
+ import { t as w } from "./LinearProgress-CUZ0D8_t.js";
7
+ var T = /* @__PURE__ */ e(c()), E = i(), D = (e) => {
8
+ let t = m(), n = g(), r = e.dimensions[0];
9
+ if (!r) return null;
10
+ let { dateLevel: i, datePart: a } = r, { fieldKey: o } = n(r.dataItem), s = (e) => e.dateLevel === i && e.datePart === a && e.fieldKey === o && (e.operator === E.FilterOperator.Between || e.operator === E.FilterOperator.NotBetween || e.operator === E.FilterOperator.Equals && e.dynamicDateRange), c = {
11
+ dateLevel: i,
12
+ datePart: a,
13
+ fieldKey: o,
14
+ operator: E.FilterOperator.Between,
15
+ values: []
16
+ }, l = t.applied.find(s), u = t.pending.find(s);
17
+ return {
18
+ applied: {
19
+ ...c,
20
+ ...l
21
+ },
22
+ pending: {
23
+ ...c,
24
+ ...l,
25
+ ...u
26
+ }
27
+ };
28
+ }, O = /* @__PURE__ */ e(o()), k = 864e5, A = (e) => e - e % k, j = (e, t, n) => {
29
+ let r = v(), [i, a] = (0, T.useState)([]);
30
+ (0, T.useEffect)(() => {
31
+ let i = !0;
32
+ return (async () => {
33
+ if (!e) {
34
+ a([]);
35
+ return;
36
+ }
37
+ let o = [{
38
+ columnIdx: 0,
39
+ direction: "desc"
40
+ }], s = {
41
+ dimensions: [{
42
+ fieldKey: e,
43
+ dateLevel: E.DateLevel.Day
44
+ }],
45
+ ...M(n, r.engine),
46
+ limit: t,
47
+ measures: [],
48
+ orders: o
49
+ }, { data: c } = await r.engine.getData(s);
50
+ i && a(Object.values(c));
51
+ })(), () => {
52
+ i = !1, a([]);
53
+ };
54
+ }, [
55
+ e,
56
+ t,
57
+ JSON.stringify(n?.staticFilters?.filterGroup),
58
+ JSON.stringify(n?.staticFilters?.filters)
59
+ ]);
60
+ let { min: o, max: s, valuesDict: c } = i.reduce((e, t) => {
61
+ e.valuesDict[A(t[0])] = !0;
62
+ let n = t[0];
63
+ return n !== null && (e.min = Math.min(n, e.min ?? n), e.max = Math.max(n, e.max ?? n)), e;
64
+ }, {
65
+ valuesDict: {},
66
+ min: void 0,
67
+ max: void 0
68
+ });
69
+ return {
70
+ min: o,
71
+ max: s,
72
+ isDateAvailable: (e) => {
73
+ let t = A(e.valueOf());
74
+ return c[t] && t >= o && t <= s;
75
+ }
76
+ };
77
+ }, M = (e, t) => {
78
+ if (!e) return { filters: [] };
79
+ let n = l(e, t), r = e.staticFilters.filterGroup;
80
+ if (r) {
81
+ let i = S(r, n, e.referencedData), a = i && x(i, e, t);
82
+ return a ? {
83
+ filters: [],
84
+ filterGroup: a
85
+ } : { filters: [] };
86
+ }
87
+ return { filters: b(y(e.staticFilters.filters, n, e.referencedData), e, t) };
88
+ }, N = _(), P = s({ loader: {
89
+ minWidth: 100,
90
+ background: t.grey3,
91
+ height: 2,
92
+ "& .MuiLinearProgress-bar": { background: t.mainDarkNavy }
93
+ } }), F = ({ data: e, options: t, vSpec: r, settings: i, responsive: a }) => {
94
+ let o = P(), s = g(), c = e?.applied?.operator === E.FilterOperator.NotBetween || e?.pending?.operator === E.FilterOperator.NotBetween, { field: l, fieldKey: u } = s(e?.applied), f = c ? E.FilterOperator.NotBetween : E.FilterOperator.Between, p = e?.applied?.operator, m = e?.pending?.operator;
95
+ (p === E.FilterOperator.Equals && m === E.FilterOperator.Equals || m === E.FilterOperator.Equals) && (f = E.FilterOperator.Equals);
96
+ let [_] = h(l ? [{
97
+ dataItem: {
98
+ ...l,
99
+ dataType: i?.type ?? E.FieldType.STRING,
100
+ internalKey: "",
101
+ type: n.Dimension,
102
+ uniqueSignature: ""
103
+ },
104
+ dateLevel: e?.applied.dateLevel,
105
+ datePart: e?.applied.datePart,
106
+ operator: f
107
+ }] : [], {
108
+ disabled: !i?.type,
109
+ state: i?.quickSelect ? E.SelectionState.APPLIED : E.SelectionState.PENDING,
110
+ commitHistory: i?.quickSelect
111
+ }), v = _ ?? d, y = v.state.pending?.[0] ?? v.state.applied?.[0] ?? null, b = v.state.pending?.[1] ?? v.state.applied?.[1] ?? null, { min: x, max: S, isDateAvailable: T } = j(u, i?.queryLimit, r);
112
+ if (x === void 0 && S === void 0 && l) return /* @__PURE__ */ (0, N.jsx)(w, {
113
+ className: o.loader,
114
+ variant: "indeterminate"
115
+ });
116
+ let D = "Add a Date field";
117
+ return l && (D = l.name), (0, O.default)(t.startDateLabel) || (D = t.startDateLabel), /* @__PURE__ */ (0, N.jsx)(C, {
118
+ options: {
119
+ ...t,
120
+ placeholder: D
121
+ },
122
+ settings: {
123
+ minDate: x || Date.now(),
124
+ maxDate: S || Date.now(),
125
+ isDateAvailable: T,
126
+ endDate: b,
127
+ startDate: y,
128
+ selection: v
129
+ },
130
+ responsive: a
131
+ });
132
+ }, I = u(({ vSpec: e }) => {
133
+ let t = f();
134
+ if ((0, T.useEffect)(() => {
135
+ e?.dimensions && t();
136
+ }, [e]), e?.dimensions === void 0) return null;
137
+ let n = e.dimensions[0], i = D(e), o = n?.formatter?.format?.timezone ?? void 0, s = e.datePickerSettings?.queryLimit ?? r(e);
138
+ return /* @__PURE__ */ (0, N.jsx)(F, {
139
+ data: i,
140
+ options: {
141
+ ...e?.datePickerSettings,
142
+ format: (e) => String(p(n?.formatter?.format, e)),
143
+ timezone: o,
144
+ startDateLabel: e.datePickerSettings?.startDateLabel,
145
+ endDateLabel: e.datePickerSettings?.endDateLabel
146
+ },
147
+ responsive: e?.datePickerSettings?.responsive,
148
+ vSpec: e,
149
+ settings: {
150
+ type: a(n?.dataItem),
151
+ queryLimit: s,
152
+ quickSelect: e?.datePickerSettings?.quickSelect
153
+ }
154
+ });
155
+ });
156
+ export { F as n, I as t };
package/definitions.js ADDED
@@ -0,0 +1,3 @@
1
+ import { T as e } from "./chunks/shared-CKDL4hx9.js";
2
+ import { i as t, n, r, t as i } from "./chunks/src-BC7cGcJ-.js";
3
+ export { i as compileVisualizationDefinition, e as createVisualizationAvailableFields, r as getVisualizationDefinitionDescriptor, t as listVisualizationDefinitionDescriptors, n as validateVisualizationDefinition };
@@ -0,0 +1,161 @@
1
+ <!-- Generated from operation manifests. Do not edit this file manually. -->
2
+
3
+ # `astrato-app-filter-bar` operations
4
+
5
+ Reference for `@astrato-io/visualizations@0.6.4`.
6
+
7
+ [All visualization types](./index.md)
8
+
9
+ Use each schema below for the request’s `payload`, not for the whole operation request. Names and payloads are specific to this visualization type. An operation can still require particular fields or chart state; see its description.
10
+
11
+ ## Available operations
12
+
13
+ - [`setAppFilterBarAddingFiltersEnabled`](#setappfilterbaraddingfiltersenabled)
14
+ - [`setAppFilterBarAssociativeFilterEnabled`](#setappfilterbarassociativefilterenabled)
15
+ - [`setAppFilterBarChartBreakdownEnabled`](#setappfilterbarchartbreakdownenabled)
16
+ - [`setAppFilterBarClearAllEnabled`](#setappfilterbarclearallenabled)
17
+ - [`setAppFilterBarOrientation`](#setappfilterbarorientation)
18
+ - [`setAppFilterBarOverflow`](#setappfilterbaroverflow)
19
+ - [`setAppFilterBarSelectableFieldKeys`](#setappfilterbarselectablefieldkeys)
20
+ - [`setAppFilterBarSelectionMode`](#setappfilterbarselectionmode)
21
+
22
+ ## `setAppFilterBarAddingFiltersEnabled`
23
+
24
+ App filter bar add filters
25
+
26
+ Allow or prevent adding new filters from the app filter bar.
27
+
28
+ **Payload schema**
29
+
30
+ ```json
31
+ {
32
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
33
+ "title": "App filter bar add filters enabled",
34
+ "type": "boolean"
35
+ }
36
+ ```
37
+
38
+ ## `setAppFilterBarAssociativeFilterEnabled`
39
+
40
+ App filter bar associative filtering
41
+
42
+ Allow or prevent associative filtering from the app filter bar.
43
+
44
+ **Payload schema**
45
+
46
+ ```json
47
+ {
48
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
49
+ "title": "App filter bar associative filtering enabled",
50
+ "type": "boolean"
51
+ }
52
+ ```
53
+
54
+ ## `setAppFilterBarChartBreakdownEnabled`
55
+
56
+ App filter bar chart breakdown
57
+
58
+ Opt in to chart breakdown switching for apps that use dimension groups. Hidden by default; requires a group with multiple available fields.
59
+
60
+ **Payload schema**
61
+
62
+ ```json
63
+ {
64
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
65
+ "title": "App filter bar chart breakdown enabled",
66
+ "type": "boolean"
67
+ }
68
+ ```
69
+
70
+ ## `setAppFilterBarClearAllEnabled`
71
+
72
+ App filter bar clear all
73
+
74
+ Show or hide the control that clears selections for the whole group.
75
+
76
+ **Payload schema**
77
+
78
+ ```json
79
+ {
80
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
81
+ "title": "App filter bar clear all",
82
+ "type": "boolean"
83
+ }
84
+ ```
85
+
86
+ ## `setAppFilterBarOrientation`
87
+
88
+ App filter bar orientation
89
+
90
+ Switch between a horizontal filter bar and stacked vertical sidebar filters.
91
+
92
+ **Payload schema**
93
+
94
+ ```json
95
+ {
96
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
97
+ "title": "App filter bar orientation",
98
+ "type": "string",
99
+ "enum": ["horizontal", "vertical"]
100
+ }
101
+ ```
102
+
103
+ ## `setAppFilterBarOverflow`
104
+
105
+ App filter bar overflow
106
+
107
+ Choose wrapping chips in an auto-height section (default), a single row with hidden filters accessible through +N, or a Filters (N) button that opens the complete bar in a modal. Responsive collapse-button and wrap-collapse-button switch at the bar width breakpoints. Collapse applies to horizontal bars; button applies in both orientations.
108
+
109
+ **Payload schema**
110
+
111
+ ```json
112
+ {
113
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
114
+ "title": "App filter bar overflow",
115
+ "type": "string",
116
+ "enum": ["wrap", "collapse", "button", "collapse-button", "wrap-collapse-button"]
117
+ }
118
+ ```
119
+
120
+ ## `setAppFilterBarSelectableFieldKeys`
121
+
122
+ App filter bar selectable fields
123
+
124
+ Restrict newly created filters to these engine field keys; pass null or an empty list to allow all fields.
125
+
126
+ **Payload schema**
127
+
128
+ ```json
129
+ {
130
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
131
+ "title": "App filter bar selectable field keys or null to clear the restriction",
132
+ "anyOf": [
133
+ {
134
+ "type": "array",
135
+ "items": {
136
+ "type": "string"
137
+ }
138
+ },
139
+ {
140
+ "type": "null"
141
+ }
142
+ ]
143
+ }
144
+ ```
145
+
146
+ ## `setAppFilterBarSelectionMode`
147
+
148
+ App filter bar selection mode
149
+
150
+ Set selection behavior to inherit from the host, apply immediately, or stage for manual apply.
151
+
152
+ **Payload schema**
153
+
154
+ ```json
155
+ {
156
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
157
+ "title": "App filter bar selection mode",
158
+ "type": "string",
159
+ "enum": ["inherit", "auto", "manual"]
160
+ }
161
+ ```