@astrato-io/visualizations 0.8.0 → 0.10.0

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 (161) hide show
  1. package/README.md +9 -5
  2. package/THIRD_PARTY_NOTICES.md +403 -325
  3. package/VISUALIZATION_DEFINITIONS.md +319 -32
  4. package/chunks/{Button-BrGKp9Nm.js → Button-CCF851ea.js} +10 -10
  5. package/chunks/CircularProgress-yupH6YWs.js +765 -0
  6. package/chunks/FieldTypeIcon-D_MzsdfY.js +22 -0
  7. package/chunks/LinearProgress-CyFjN4px.js +327 -0
  8. package/chunks/{MenuOption-ByRqhRdX.js → MenuOption-CQpT79AP.js} +1391 -1008
  9. package/chunks/Title-C-p4ZarD.js +1804 -0
  10. package/chunks/_createAggregator-BF4qG9XK.js +50 -0
  11. package/chunks/{app-filter-bar.compiler-TwVTeoj5.js → app-filter-bar.compiler-8fxCo2q7.js} +10 -10
  12. package/chunks/bar-layout-DStC-GNV.js +9 -0
  13. package/chunks/{bar.compiler-DuQg8EUb.js → bar.compiler-CQAu8KL8.js} +102 -84
  14. package/chunks/{builder-DEDvNq1k.js → builder-CScg1TOS.js} +156 -60
  15. package/chunks/color-rules-DYJL4fIW.js +15 -0
  16. package/chunks/color-settings-DJFoFTip.js +5 -0
  17. package/chunks/{coloring-CncX_JRX.js → coloring-9jU3s_-p.js} +41 -41
  18. package/chunks/contains-BK-sRXcB.js +21 -0
  19. package/chunks/createSimplePaletteValueFilter-C4hZpCdn.js +2005 -0
  20. package/chunks/defaults-cyNhn37t.js +3 -0
  21. package/chunks/{definitions-BPJQTx16.js → definitions-C4grxhye.js} +612 -400
  22. package/chunks/{escobar-DRhRMYRE.js → escobar-CjirINHP.js} +5354 -5473
  23. package/chunks/{extend-preset-CUFNpmPe.js → extend-preset-D-l9u_we.js} +974 -909
  24. package/chunks/{filter.compiler-w27dlv0C.js → filter.compiler-lji2Acgn.js} +7 -7
  25. package/chunks/{filtering-cc7WqWpg.js → filtering-C1zakrrX.js} +570 -390
  26. package/chunks/handlers-ZviIUC-j.js +15387 -0
  27. package/chunks/{icon-picker-styles-CoJmwTRi.js → icon-picker-styles-Bj80ZUBK.js} +11 -11
  28. package/chunks/isEqual-Ch9OEye3.js +16 -0
  29. package/chunks/isFocusVisible-CgMP0qkR.js +144 -0
  30. package/chunks/label-format-type-C46pzgx7.js +17 -0
  31. package/chunks/{line.compiler-Ct1WhN2p.js → line.compiler-De5fiKuR.js} +6 -6
  32. package/chunks/{logger-DpQtYQnX.js → logger-CKRjhSHQ.js} +77 -66
  33. package/chunks/map.compiler-CKzorLgK.js +345 -0
  34. package/chunks/{metadata-WABZrt7Y.js → metadata-Bb9pTXrq.js} +1 -1
  35. package/chunks/{number.compiler-D8TPly-4.js → number.compiler-CaTmJkmi.js} +4 -4
  36. package/chunks/operations-DZoY50VX.js +31297 -0
  37. package/chunks/{range-Bi-7zT0k.js → range-D1BTmFMp.js} +2 -2
  38. package/chunks/react-dom-Dgv2azN2.js +368 -0
  39. package/chunks/{render-wrappers-OEmtaM8g.js → render-wrappers-_P3xwu5A.js} +1 -1
  40. package/chunks/{requirements-Dvd8jqYF.js → requirements-NHNrR8Ie.js} +55 -53
  41. package/chunks/responsive.styles-FItb913l.js +93 -0
  42. package/chunks/shared-UitWpq1J.js +1331 -0
  43. package/chunks/standalone-B0U6c3su.js +3638 -0
  44. package/chunks/{standalone-we5D5MIn.js → standalone-BBu90BhK.js} +113 -113
  45. package/chunks/standalone-BEekPuA12.js +357 -0
  46. package/chunks/{standalone-BMTCb10X.js → standalone-BOzHA_d4.js} +41 -41
  47. package/chunks/standalone-BR2JuRIC.js +422 -0
  48. package/chunks/{standalone-BGkmozIb.js → standalone-BapqaniK.js} +619 -619
  49. package/chunks/standalone-Bnnr87pc.js +2009 -0
  50. package/chunks/standalone-BwJqDj2Z.js +396 -0
  51. package/chunks/{standalone-BDhPQtzQ.js → standalone-ByKKqT5L.js} +308 -300
  52. package/chunks/{standalone-vBnBS2YC.js → standalone-CRdDZYeM.js} +1788 -1004
  53. package/chunks/standalone-CRfDOO1x.js +287 -0
  54. package/chunks/{standalone-D5Q5ngsD.js → standalone-CVknVdUC.js} +30 -27
  55. package/chunks/standalone-CbPk8bKn.js +580 -0
  56. package/chunks/{standalone-CJvIXsQE.js → standalone-Ck63MZzj.js} +234 -232
  57. package/chunks/{standalone-CM5XcAN5.js → standalone-DCFY1MAV.js} +8075 -7729
  58. package/chunks/{standalone-DW6NT205.js → standalone-DZDGX3aa.js} +168 -168
  59. package/chunks/standalone-DhfgeJIk.js +1012 -0
  60. package/chunks/{standalone-DT0wKji7.js → standalone-DibjA73M.js} +2 -2
  61. package/chunks/{standalone-XuGksArp.js → standalone-DtBk_iUz.js} +9 -8
  62. package/chunks/standalone-DxBAyqAu.js +772 -0
  63. package/chunks/standalone-KMQPsNsq.js +2 -0
  64. package/chunks/standalone-MBLSvsrY.js +2 -0
  65. package/chunks/standalone-U0WJwFlG.js +354 -0
  66. package/chunks/{standalone-C8ZAEutO.js → standalone-swGs70tD.js} +49 -51
  67. package/chunks/standalone-wgFAVnnm.js +355 -0
  68. package/chunks/standalone-xGV0dqPV.js +689 -0
  69. package/chunks/{table.compiler-DMeeHxb6.js → table.compiler-OWSx5MOq.js} +7 -7
  70. package/chunks/{typeof-CJDtcySz.js → typeof-DCq3QgvY.js} +6 -1
  71. package/chunks/useFieldName-B8iCYyw1.js +7 -0
  72. package/chunks/{utils-vdmi_2PK.js → utils-3Igg6xmO.js} +7668 -12779
  73. package/chunks/{view-BuwQugKb.js → view-DdMLZySj.js} +2430 -2110
  74. package/chunks/{visualization-filters-Cc4KU-l-.js → visualization-filters-CzvFHE6M.js} +5205 -4438
  75. package/chunks/with-html-element-DOfkR3C1.js +16094 -0
  76. package/definitions.js +2 -2
  77. package/docs/operations/astrato-app-filter-bar.md +1 -1
  78. package/docs/operations/bar.md +303 -2
  79. package/docs/operations/combo.md +262 -1
  80. package/docs/operations/date-picker.md +1 -1
  81. package/docs/operations/distribution-gauge.md +1 -1
  82. package/docs/operations/dot.md +148 -1
  83. package/docs/operations/filter.md +1 -1
  84. package/docs/operations/gauge.md +1 -1
  85. package/docs/operations/heatMap.md +1 -1
  86. package/docs/operations/histogram.md +262 -1
  87. package/docs/operations/iframe.md +1 -1
  88. package/docs/operations/image.md +1 -1
  89. package/docs/operations/index.md +8 -8
  90. package/docs/operations/line.md +262 -1
  91. package/docs/operations/number.md +1 -1
  92. package/docs/operations/pie.md +1 -1
  93. package/docs/operations/radar.md +1 -1
  94. package/docs/operations/sankey.md +1 -1
  95. package/docs/operations/scatter.md +148 -1
  96. package/docs/operations/shape.md +1 -1
  97. package/docs/operations/simpleTextObject.md +1 -1
  98. package/docs/operations/slider.md +1 -1
  99. package/docs/operations/table.md +439 -157
  100. package/docs/operations/tree.md +1 -1
  101. package/docs/operations/treemap.md +1 -1
  102. package/docs/operations/waterfall.md +1 -1
  103. package/docs/operations/word-cloud.md +1 -1
  104. package/getters.js +2 -2
  105. package/index.js +523 -469
  106. package/metadata.js +2 -2
  107. package/operations.js +5 -5
  108. package/package.json +74 -68
  109. package/src/definitions/index.d.ts +1 -1
  110. package/src/definitions/model/definitions/available-fields.d.ts +2 -2
  111. package/src/definitions/model/definitions/compilers/compile.d.ts +1 -0
  112. package/src/definitions/model/definitions/data-item-resolution.d.ts +3 -3
  113. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +535 -349
  114. package/src/definitions/model/definitions/index.d.ts +2 -1
  115. package/src/definitions/model/definitions/schema-registry.d.ts +406 -101
  116. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +10 -8
  117. package/src/definitions/model/definitions/schemas/common.schema.d.ts +33 -32
  118. package/src/definitions/model/definitions/schemas/index.d.ts +1 -0
  119. package/src/definitions/model/definitions/schemas/line.schema.d.ts +10 -10
  120. package/src/definitions/model/definitions/schemas/map.schema.d.ts +590 -0
  121. package/src/definitions/model/definitions/schemas/number.schema.d.ts +4 -4
  122. package/src/definitions/model/definitions/schemas/object.schema.d.ts +38 -38
  123. package/src/definitions/model/definitions/schemas/table.schema.d.ts +61 -61
  124. package/src/definitions/model/definitions/types/compilation.types.d.ts +7 -2
  125. package/src/definitions/model/definitions/types/definition.types.d.ts +2 -2
  126. package/src/definitions/model/definitions/types/index.d.ts +1 -1
  127. package/src/index.d.ts +1 -1
  128. package/src/operations/index.d.ts +1 -1
  129. package/src/types.d.ts +45 -41
  130. package/src/visualization-catalog.d.ts +26 -26
  131. package/chunks/DefaultPropsProvider-BsfB7QTn.js +0 -257
  132. package/chunks/FieldTypeIcon-Drs6hSJF.js +0 -22
  133. package/chunks/LinearProgress-VtfFx2vJ.js +0 -253
  134. package/chunks/Title-CO5dP1ma.js +0 -1691
  135. package/chunks/ToggleButton-KOBAimC1.js +0 -112
  136. package/chunks/color-rules-CN7TcGrC.js +0 -6
  137. package/chunks/color-settings-3VRlf_Vw.js +0 -6
  138. package/chunks/colorManipulator-D8Pjy1pf.js +0 -45
  139. package/chunks/handlers-TOT-7INo.js +0 -12871
  140. package/chunks/isEqual-B8loyPsC.js +0 -12
  141. package/chunks/label-format-type-weq1XfcX.js +0 -8
  142. package/chunks/operations-Dh4v1Ovt.js +0 -26280
  143. package/chunks/responsive.styles-DSiOGD7u.js +0 -82
  144. package/chunks/shared-Bn4N5QcZ.js +0 -1218
  145. package/chunks/standalone-B55oyW6c.js +0 -689
  146. package/chunks/standalone-BXKRE_Se.js +0 -468
  147. package/chunks/standalone-Bes8srx1.js +0 -354
  148. package/chunks/standalone-BjZp0QMe.js +0 -2
  149. package/chunks/standalone-BlMIwpEe.js +0 -1877
  150. package/chunks/standalone-C8qAelL4.js +0 -2
  151. package/chunks/standalone-CLmGb7nn2.js +0 -355
  152. package/chunks/standalone-CXNP6-xD.js +0 -420
  153. package/chunks/standalone-DLlyRIE6.js +0 -287
  154. package/chunks/standalone-DMcI1afI.js +0 -396
  155. package/chunks/standalone-DN4S1MjT.js +0 -3874
  156. package/chunks/standalone-DYQIQH4c.js +0 -2095
  157. package/chunks/standalone-D__XCp-h.js +0 -1003
  158. package/chunks/standalone-XTgSsTAa.js +0 -354
  159. package/chunks/useFieldName-Cjn9KCVp.js +0 -7
  160. package/chunks/useSlotProps-DLbQp4lc.js +0 -166
  161. package/chunks/with-html-element-D0uY2zjI.js +0 -7328
@@ -0,0 +1,345 @@
1
+ import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { Mt as t, Pc as n, Tn as r, Ui as i, vs as a } from "./visualization-filters-CzvFHE6M.js";
3
+ import { A as o, C as s, E as c, T as l, U as u, b as d, d as f, h as p, k as m, u as h } from "./shared-UitWpq1J.js";
4
+ import { Ap as g, ch as _ } from "./handlers-ZviIUC-j.js";
5
+ import { E as v } from "./operations-DZoY50VX.js";
6
+ import { t as y } from "./isEqual-Ch9OEye3.js";
7
+ var b = /* @__PURE__ */ e(y(), 1), x = {
8
+ mapType: [v.SET_LAYER_MAP_TYPE, "mapType"],
9
+ layerType: [v.SET_LAYER_TILE_TYPE, "layerType"],
10
+ layerStyle: [v.SET_LAYER_TILE_STYLE, "layerStyle"],
11
+ apiKey: [v.SET_LAYER_API_KEY, "apiKey"],
12
+ mapLanguage: [v.SET_LAYER_MAP_LANGUAGE, "mapLanguage"],
13
+ politicalView: [v.SET_LAYER_POLITICAL_VIEW, "politicalView"],
14
+ opacity: [v.SET_LAYER_OPACITY, "opacity"],
15
+ color: [v.SET_LAYER_COLORING_COLOR, "color"],
16
+ shape: [v.SET_LAYER_POINT_SHAPE, "shape"],
17
+ labelsVisible: [v.SET_LAYER_LABEL_ENABLED, "enabled"],
18
+ strokeEnabled: [v.SET_LAYER_STROKE_ENABLED, "strokeEnabled"],
19
+ strokeColor: [v.SET_LAYER_STROKE_COLOR, "strokeColor"],
20
+ strokeWidth: [v.SET_LAYER_STROKE_WIDTH, "strokeWidth"],
21
+ useGeodesicLines: [v.SET_LAYER_USE_GEODESIC_LINES, "useGeodesicLines"],
22
+ lineStyle: [v.SET_LAYER_LINE_STYLE, "lineStyle"]
23
+ }, S = {
24
+ sizeType: [v.SET_LAYER_SIZE_TYPE, "sizeType"],
25
+ size: [v.SET_LAYER_SIZE, "size"],
26
+ sizeRange: [v.SET_LAYER_SIZE_RANGE, "sizeRange"],
27
+ minSize: [v.SET_LAYER_MIN_SIZE, "minSize"],
28
+ maxSize: [v.SET_LAYER_MAX_SIZE, "maxSize"]
29
+ }, C = {
30
+ radius: [v.SET_LAYER_HEAT_RADIUS, "radius"],
31
+ maxZoom: [v.SET_LAYER_HEAT_MAX_ZOOM, "maxZoom"],
32
+ blur: [v.SET_LAYER_HEAT_BLUR, "blur"],
33
+ changeHeatWhenZooming: [v.SET_LAYER_HEAT_CHANGE_WHEN_ZOOMING, "changeHeatWhenZooming"]
34
+ }, w = {
35
+ type: [v.SET_LAYER_HEAT_VALUE_TYPE, "type"],
36
+ value: [v.SET_LAYER_HEAT_VALUE, "value"],
37
+ range: [v.SET_LAYER_HEAT_VALUE_RANGE, "range"],
38
+ minValue: [v.SET_LAYER_HEAT_MIN_VALUE, "minValue"],
39
+ maxValue: [v.SET_LAYER_HEAT_MAX_VALUE, "maxValue"]
40
+ }, T = {
41
+ show: [v.SET_LAYER_ARROW_SHOW, "show"],
42
+ position: [v.SET_LAYER_ARROW_POSITION, "position"],
43
+ size: [v.SET_LAYER_ARROW_SIZE, "size"]
44
+ }, E = {
45
+ topLeftLatitude: [v.SET_LAYER_IMAGE_TOP_LEFT_LATITUDE, "topLeftLatitude"],
46
+ topLeftLongitude: [v.SET_LAYER_IMAGE_TOP_LEFT_LONGITUDE, "topLeftLongitude"],
47
+ bottomRightLatitude: [v.SET_LAYER_IMAGE_BOTTOM_RIGHT_LATITUDE, "bottomRightLatitude"],
48
+ bottomRightLongitude: [v.SET_LAYER_IMAGE_BOTTOM_RIGHT_LONGITUDE, "bottomRightLongitude"]
49
+ }, D = (e, t, n) => Object.entries(e ?? {}).flatMap(([e, r]) => {
50
+ let i = t[e];
51
+ return i && r !== void 0 ? [{
52
+ name: i[0],
53
+ payload: {
54
+ layer: n,
55
+ [i[1]]: r
56
+ }
57
+ }] : [];
58
+ }), O = (e, t) => {
59
+ let n = [];
60
+ if (e.visible !== void 0 && n.push({
61
+ name: v.SET_LAYER_VISIBLE,
62
+ payload: {
63
+ layer: t,
64
+ visible: e.visible
65
+ }
66
+ }), e.type === "image") return n.push({
67
+ name: v.SET_LAYER_IMAGE,
68
+ payload: {
69
+ layer: t,
70
+ image: e.image
71
+ }
72
+ }), n.push(...D(e.position, E, t)), n.push(...D({ opacity: e.opacity }, x, t)), n;
73
+ let r = e.presentation;
74
+ return n.push(...D(r, x, t)), r && "sizing" in r && n.push(...D(r.sizing, S, t)), r && "heat" in r && n.push(...D(r.heat, C, t)), r && "value" in r && n.push(...D(r.value, w, t)), r && "arrow" in r && n.push(...D(r.arrow, T, t)), n;
75
+ }, k = (e, t, n) => {
76
+ let r = [
77
+ ...m(e.data.dimensions, t.availableFields, [
78
+ ...n,
79
+ "data",
80
+ "dimensions"
81
+ ], "dimension"),
82
+ ...m(e.data.measures, t.availableFields, [
83
+ ...n,
84
+ "data",
85
+ "measures"
86
+ ], "measure"),
87
+ ...m(e.data.supportingMeasures ?? [], t.availableFields, [
88
+ ...n,
89
+ "data",
90
+ "supportingMeasures"
91
+ ], "measure"),
92
+ ...o(e.filterGroup, t.availableFields).map((e) => ({
93
+ ...e,
94
+ path: [...n, ...e.path]
95
+ }))
96
+ ], i = ["geo"];
97
+ "locationType" in e && e.locationType === "latLng" && i.push("secondGeo"), e.type === "pointConnection" && (i.push("thirdGeo"), e.secondLocationType === "latLng" && i.push("fourthGeo"));
98
+ let a = [...i];
99
+ (e.type === "point" || e.type === "pointConnection") && a.push("size"), e.type === "heatMap" && a.push("measure");
100
+ let s = /* @__PURE__ */ new Set();
101
+ e.data.measures.forEach((e, t) => {
102
+ (!a.includes(e.role) || s.has(e.role)) && r.push(f("invalid_field_role", [
103
+ ...n,
104
+ "data",
105
+ "measures",
106
+ t,
107
+ "role"
108
+ ], `Role "${e.role}" must be supported by this layer and assigned only once.`, { allowedValues: a })), s.add(e.role);
109
+ });
110
+ for (let e of i) s.has(e) || r.push(f("requirements_not_met", [
111
+ ...n,
112
+ "data",
113
+ "measures"
114
+ ], `Location format requires a measure with role "${e}".`));
115
+ return r;
116
+ }, A = (e, t) => [...s([{
117
+ items: e.layers,
118
+ path: ["layers"]
119
+ }, ...e.layers.flatMap((e, t) => "data" in e ? [
120
+ {
121
+ items: e.data.dimensions,
122
+ path: [
123
+ "layers",
124
+ t,
125
+ "data",
126
+ "dimensions"
127
+ ]
128
+ },
129
+ {
130
+ items: e.data.measures,
131
+ path: [
132
+ "layers",
133
+ t,
134
+ "data",
135
+ "measures"
136
+ ]
137
+ },
138
+ {
139
+ items: e.data.supportingMeasures ?? [],
140
+ path: [
141
+ "layers",
142
+ t,
143
+ "data",
144
+ "supportingMeasures"
145
+ ]
146
+ }
147
+ ] : [])]), ...e.layers.flatMap((e, n) => "data" in e ? k(e, t, ["layers", n]) : [])], j = async (e) => {
148
+ let o = g(e);
149
+ if (o) return {
150
+ success: !1,
151
+ issues: [f("invalid_structure", [], o)]
152
+ };
153
+ let s = u.safeParse(e.definition);
154
+ if (!s.success) return {
155
+ success: !1,
156
+ issues: l(s.error, e.definition)
157
+ };
158
+ let m = _.safeParse(e.baseVSpec);
159
+ if (!m.success) return {
160
+ success: !1,
161
+ issues: l(m.error, e.baseVSpec, ["baseVSpec"])
162
+ };
163
+ let y = e.baseVSpec;
164
+ if (Object.keys(y.referencedData).length > 0 || y.layers.length > 0 && !(0, b.default)(y.layers, r().layers)) return {
165
+ success: !1,
166
+ issues: [f("non_fresh_base_vspec", ["baseVSpec"], "Compile against an empty map vSpec or the unconfigured default map. Use operations to edit an existing map.")]
167
+ };
168
+ let x = s.data, S = A(x, e);
169
+ if (S.length) return {
170
+ success: !1,
171
+ issues: S
172
+ };
173
+ let C = h(e, a(y)), w = /* @__PURE__ */ new Map(), T = async (e, t) => {
174
+ let n = await p(C, e, t);
175
+ if (!n.success) return n.issue;
176
+ C = n.state;
177
+ }, E = (e) => ({
178
+ success: !1,
179
+ issues: [e]
180
+ }), D = await T(y.layers.map(({ id: e }) => ({
181
+ name: v.REMOVE_LAYER,
182
+ payload: { layer: e }
183
+ })), ["layers"]);
184
+ if (D) return E(D);
185
+ for (let e = x.layers.length - 1; e >= 0; e--) {
186
+ let t = x.layers[e];
187
+ if (D = await T([{
188
+ name: v.ADD_LAYER,
189
+ payload: {
190
+ type: t.type,
191
+ name: t.name ?? t.ref
192
+ }
193
+ }], ["layers", e]), D) return E(D);
194
+ w.set(t.ref, {
195
+ kind: "layer",
196
+ id: C.vSpec.layers[0].id
197
+ });
198
+ }
199
+ for (let [r, i] of x.layers.entries()) {
200
+ let a = w.get(i.ref);
201
+ if (!a) return E(f("operation_failed", [
202
+ "layers",
203
+ r,
204
+ "ref"
205
+ ], "Map operation did not create the requested layer reference."));
206
+ let o = a.id, s = ["layers", r];
207
+ if ("data" in i) {
208
+ if (D = await T([{
209
+ name: v.SET_LAYER_LOCATION_TYPE,
210
+ payload: {
211
+ layer: o,
212
+ locationType: i.type === "shape" ? "geoJson" : i.locationType
213
+ }
214
+ }, ...i.type === "pointConnection" ? [{
215
+ name: v.SET_LAYER_SECOND_LOCATION_TYPE,
216
+ payload: {
217
+ layer: o,
218
+ locationType: i.secondLocationType
219
+ }
220
+ }] : []], s), D) return E(D);
221
+ for (let [e, t] of i.data.dimensions.entries()) {
222
+ if (D = await T([{
223
+ name: v.SET_LAYER_DIMENSION,
224
+ payload: {
225
+ layer: o,
226
+ key: t.fieldKey,
227
+ index: e
228
+ }
229
+ }], [
230
+ ...s,
231
+ "data",
232
+ "dimensions",
233
+ e
234
+ ]), D) return E(D);
235
+ let { dataItem: n } = C.vSpec.layers.find((e) => e.id === o).dimensions[e];
236
+ C.resolvedRefs = {
237
+ ...C.resolvedRefs,
238
+ [t.ref]: {
239
+ kind: "dimension",
240
+ dataItemInternalKey: n.internalKey,
241
+ dataItemUniqueSignature: n.uniqueSignature
242
+ }
243
+ };
244
+ }
245
+ for (let [t, r] of i.data.measures.entries()) {
246
+ if (D = await T([{
247
+ name: v.SET_LAYER_MEASURE,
248
+ payload: c(r, e.availableFields, {
249
+ layer: o,
250
+ role: r.role
251
+ })
252
+ }], [
253
+ ...s,
254
+ "data",
255
+ "measures",
256
+ t
257
+ ]), D) return E(D);
258
+ let i = C.vSpec.layers.find((e) => e.id === o), a = i.measures.find(({ dataItem: e }) => n(e) === i.dataRoles[r.role]);
259
+ if (!a) return E(f("operation_failed", [
260
+ ...s,
261
+ "data",
262
+ "measures",
263
+ t
264
+ ], "Map operation did not create the requested measure binding."));
265
+ C.resolvedRefs = {
266
+ ...C.resolvedRefs,
267
+ [r.ref]: {
268
+ kind: "measure",
269
+ dataItemInternalKey: a.dataItem.internalKey,
270
+ dataItemUniqueSignature: a.dataItem.uniqueSignature
271
+ }
272
+ };
273
+ }
274
+ for (let [t, n] of (i.data.supportingMeasures ?? []).entries()) {
275
+ if (D = await T([{
276
+ name: v.ADD_LAYER_SUPPORTING_MEASURE,
277
+ payload: c(n, e.availableFields, { layer: o })
278
+ }], [
279
+ ...s,
280
+ "data",
281
+ "supportingMeasures",
282
+ t
283
+ ]), D) return E(D);
284
+ let r = C.vSpec.layers.find((e) => e.id === o).supportingMeasures?.at(-1);
285
+ if (!r) return E(f("operation_failed", [
286
+ ...s,
287
+ "data",
288
+ "supportingMeasures",
289
+ t
290
+ ], "Map operation did not create the supporting measure."));
291
+ C.resolvedRefs = {
292
+ ...C.resolvedRefs,
293
+ [n.ref]: {
294
+ kind: "measure",
295
+ dataItemInternalKey: r.dataItem.internalKey,
296
+ dataItemUniqueSignature: r.dataItem.uniqueSignature
297
+ }
298
+ };
299
+ }
300
+ if (i.filterGroup && (D = await T([{
301
+ name: v.SET_LAYER_STATIC_FILTER_GROUP,
302
+ payload: {
303
+ layer: o,
304
+ filterGroup: d(i.filterGroup)
305
+ }
306
+ }], [...s, "filterGroup"]), D)) return E(D);
307
+ }
308
+ if (D = await T(O(i, o), [...s, "presentation"]), D) return E(D);
309
+ let l = C.vSpec.layers.find((e) => e.id === o), u = l && t(l);
310
+ if (u) return E(f("requirements_not_met", s, u));
311
+ }
312
+ let k = x.view;
313
+ if (k) {
314
+ let e = C.vSpec.settings, t = k.minZoom ?? e.minZoom ?? i.settings.minZoom, n = k.maxZoom ?? e.maxZoom ?? i.settings.maxZoom;
315
+ if (t > n) return E(f("invalid_structure", ["view"], "Minimum zoom cannot exceed maximum zoom."));
316
+ let r = [{
317
+ name: v.SET_MIN_ZOOM,
318
+ payload: t
319
+ }, {
320
+ name: v.SET_MAX_ZOOM,
321
+ payload: n
322
+ }];
323
+ if (t > (e.maxZoom ?? i.settings.maxZoom) && r.reverse(), D = await T(r, ["view"]), D) return E(D);
324
+ let a = {
325
+ latitude: [v.SET_LATITUDE, "latitude"],
326
+ longitude: [v.SET_LONGITUDE, "longitude"],
327
+ zoom: [v.SET_ZOOM, "zoom"],
328
+ zoomMode: [v.SET_ZOOM_MODE, "zoomMode"]
329
+ };
330
+ if (D = await T(Object.entries(k).flatMap(([e, t]) => a[e] && t !== void 0 ? [{
331
+ name: a[e][0],
332
+ payload: t
333
+ }] : []), ["view"]), D) return E(D);
334
+ }
335
+ let j = _.safeParse(C.vSpec);
336
+ return j.success ? {
337
+ success: !0,
338
+ vSpec: C.vSpec,
339
+ resolvedRefs: {
340
+ ...Object.fromEntries(w),
341
+ ...C.resolvedRefs
342
+ }
343
+ } : E(f("invalid_compiled_vspec", [], "Compiled map vSpec failed validation.", { details: { issues: j.error.issues } }));
344
+ };
345
+ export { j as compileMapVisualizationDefinition };
@@ -1,4 +1,4 @@
1
- import { a as e, i as t, o as n } from "./operations-Dh4v1Ovt.js";
1
+ import { a as e, i as t, o as n } from "./operations-DZoY50VX.js";
2
2
  var r = { measureFiltersEnabled: !0 }, i = () => ({
3
3
  count: 0,
4
4
  names: [],
@@ -1,7 +1,7 @@
1
- import "./visualization-filters-Cc4KU-l-.js";
2
- import { A as e, E as t, H as n, O as r, T as i, a, d as o, g as s, i as c, t as l, u, v as d } from "./shared-Bn4N5QcZ.js";
3
- import { gd as f, if as p } from "./handlers-TOT-7INo.js";
4
- import { h as m } from "./operations-Dh4v1Ovt.js";
1
+ import "./visualization-filters-CzvFHE6M.js";
2
+ import { A as e, E as t, H as n, O as r, T as i, a, d as o, g as s, i as c, t as l, u, v as d } from "./shared-UitWpq1J.js";
3
+ import { Ap as f, vm as p } from "./handlers-ZviIUC-j.js";
4
+ import { h as m } from "./operations-DZoY50VX.js";
5
5
  var h = async (h) => {
6
6
  let g = f(h);
7
7
  if (g) return {