@astrato-io/visualizations 0.9.0 → 0.10.1

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 (144) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +7 -3
  3. package/THIRD_PARTY_NOTICES.md +163 -14
  4. package/VISUALIZATION_DEFINITIONS.md +376 -36
  5. package/chunks/{Button-5CxPEACP.js → Button-Dn3rJrYf.js} +4 -4
  6. package/chunks/{CircularProgress-DFS-LQb7.js → CircularProgress-BFeu06Yb.js} +39 -39
  7. package/chunks/FieldTypeIcon-DrMoGpHJ.js +22 -0
  8. package/chunks/{LinearProgress-CjIQfkNA.js → LinearProgress-ClO6GUjN.js} +9 -9
  9. package/chunks/{MenuOption-Cb7B7x6z.js → MenuOption-Czc34u4q.js} +143 -142
  10. package/chunks/{Title-CtFw1bVg.js → Title-BgYnaVTR.js} +22 -22
  11. package/chunks/_createAggregator-BMu9uRax.js +50 -0
  12. package/chunks/{app-filter-bar.compiler-B9775gLJ.js → app-filter-bar.compiler-CVir0wkl.js} +10 -10
  13. package/chunks/bar-layout-C_UgRlVl.js +9 -0
  14. package/chunks/{bar.compiler-B7wlH_Ro.js → bar.compiler-DYuFdi9J.js} +100 -82
  15. package/chunks/{builder-Dxo7D7c6.js → builder-C-TKA-My.js} +70 -37
  16. package/chunks/color-rules-DYJL4fIW.js +15 -0
  17. package/chunks/color-settings-DJFoFTip.js +5 -0
  18. package/chunks/{coloring-B-Wa8D5P.js → coloring-BtnPiQ_o.js} +37 -37
  19. package/chunks/createSimplePaletteValueFilter--zrZxRV9.js +2005 -0
  20. package/chunks/defaults-Dtk7fg3C.js +3 -0
  21. package/chunks/{definitions-DNpzD9tY.js → definitions-CT304NDn.js} +655 -417
  22. package/chunks/{escobar-C4Nm3eJ7.js → escobar-CvEV2ES1.js} +7441 -7127
  23. package/chunks/{extend-preset-BVKFtoe-.js → extend-preset-D9-JP92b.js} +998 -933
  24. package/chunks/{filter.compiler-BlS3zoy_.js → filter.compiler-CXeZznks.js} +7 -7
  25. package/chunks/{filtering-CGuLpg7u.js → filtering-8_bFv-jb.js} +333 -377
  26. package/chunks/handlers-C6CZ0XJA.js +15399 -0
  27. package/chunks/{icon-picker-styles-DYQgVEKG.js → icon-picker-styles-BXiJ1SZS.js} +11 -11
  28. package/chunks/isEqual-D8Ay63xR.js +16 -0
  29. package/chunks/{isFocusVisible-B1_z03UT.js → isFocusVisible-Bu8gGZu5.js} +1 -1
  30. package/chunks/label-format-type-C46pzgx7.js +17 -0
  31. package/chunks/{line.compiler-Bo9i9qag.js → line.compiler-DmHpmQCC.js} +9 -9
  32. package/chunks/{logger-3lng-wOw.js → logger-DdZpR7xZ.js} +79 -72
  33. package/chunks/map.compiler-Q_Y1Pvat.js +343 -0
  34. package/chunks/{metadata-Fmx1swpK.js → metadata-BQm_TXI1.js} +1 -1
  35. package/chunks/{number.compiler-CdLd5aGW.js → number.compiler-DQdg6zTy.js} +7 -7
  36. package/chunks/operations-DKQWuLL7.js +31315 -0
  37. package/chunks/{range-CzO4isKK.js → range-BdhzvYQ_.js} +2 -2
  38. package/chunks/{react-dom-BwZT0N3F.js → react-dom-BGP4tbXV.js} +70 -70
  39. package/chunks/{render-wrappers-CAuvgMxi.js → render-wrappers-BZpyDnJy.js} +1 -1
  40. package/chunks/{requirements-CYpVh65U.js → requirements-e8Fe96ag.js} +60 -58
  41. package/chunks/shared-C_2F90xq.js +1337 -0
  42. package/chunks/standalone-4MsKiqs0.js +355 -0
  43. package/chunks/standalone-B794g9pE.js +1012 -0
  44. package/chunks/{standalone-C6XDHYAM.js → standalone-B8ZSqauS.js} +110 -110
  45. package/chunks/{standalone-5DnapeHH.js → standalone-BA2YXyJS.js} +126 -124
  46. package/chunks/{standalone-CXniic5x.js → standalone-BDrXVxlP.js} +6 -5
  47. package/chunks/{standalone-B6s_xG2u.js → standalone-BE_ONgiG.js} +116 -116
  48. package/chunks/{standalone-CPUiiWNP.js → standalone-BTY3w_JA.js} +37 -37
  49. package/chunks/standalone-BgumbdaJ2.js +357 -0
  50. package/chunks/{standalone-DWPfdP0A.js → standalone-BkbiH-o8.js} +482 -482
  51. package/chunks/standalone-Blh4qejk.js +689 -0
  52. package/chunks/standalone-CXY4FpF7.js +773 -0
  53. package/chunks/{standalone-BvWdpUL3.js → standalone-CY_kjarf.js} +34 -31
  54. package/chunks/{standalone-DuwTOBXH.js → standalone-CaTxAydz.js} +587 -587
  55. package/chunks/{standalone-BDrQMxLi.js → standalone-Cc98Pdr6.js} +1799 -1015
  56. package/chunks/{standalone-DMCwtebn.js → standalone-Cl0TSfqC.js} +125 -125
  57. package/chunks/{standalone-CoQxJ6ov.js → standalone-CsoMmE9T.js} +778 -778
  58. package/chunks/standalone-DH0xTEes.js +2 -0
  59. package/chunks/{standalone-LFVgLhia.js → standalone-DHRalbVO.js} +311 -303
  60. package/chunks/standalone-DNh9NcMa.js +580 -0
  61. package/chunks/standalone-DcnHjNnC.js +2 -0
  62. package/chunks/{standalone-r4ObFvys.js → standalone-DflyWtuR.js} +217 -215
  63. package/chunks/standalone-DrHdGkY7.js +762 -0
  64. package/chunks/standalone-c_rROMtx.js +287 -0
  65. package/chunks/standalone-drcFLeN6.js +6 -0
  66. package/chunks/{standalone-CNkHsynO.js → standalone-wOWRCpdn.js} +54 -56
  67. package/chunks/{standalone-Cu73fzSr.js → standalone-z0o52o5t.js} +5128 -4908
  68. package/chunks/{table.compiler-C1qjqXaT.js → table.compiler-COaHE9VD.js} +18 -18
  69. package/chunks/{useFieldName-mWrD_uk_.js → useFieldName-CdnCWzhd.js} +1 -1
  70. package/chunks/{utils-DYYD4Zzf.js → utils-DganVptf.js} +4758 -4747
  71. package/chunks/{view-7fH6mGmY.js → view-Bzlros43.js} +2021 -1665
  72. package/chunks/{visualization-filters-mVnsnvLP.js → visualization-filters-D7i6oh1Z.js} +3177 -2425
  73. package/chunks/{with-html-element-B0Clt4jY.js → with-html-element-CiIhFEa5.js} +3740 -3547
  74. package/definitions.js +2 -2
  75. package/docs/operations/astrato-app-filter-bar.md +1 -1
  76. package/docs/operations/bar.md +303 -2
  77. package/docs/operations/combo.md +262 -1
  78. package/docs/operations/date-picker.md +1 -1
  79. package/docs/operations/distribution-gauge.md +1 -1
  80. package/docs/operations/dot.md +148 -1
  81. package/docs/operations/filter.md +1 -1
  82. package/docs/operations/gauge.md +1 -1
  83. package/docs/operations/heatMap.md +1 -1
  84. package/docs/operations/histogram.md +262 -1
  85. package/docs/operations/iframe.md +1 -1
  86. package/docs/operations/image.md +1 -1
  87. package/docs/operations/index.md +7 -7
  88. package/docs/operations/line.md +280 -1
  89. package/docs/operations/number.md +1 -1
  90. package/docs/operations/pie.md +1 -1
  91. package/docs/operations/radar.md +1 -1
  92. package/docs/operations/sankey.md +1 -1
  93. package/docs/operations/scatter.md +148 -1
  94. package/docs/operations/shape.md +1 -1
  95. package/docs/operations/simpleTextObject.md +1 -1
  96. package/docs/operations/slider.md +1 -1
  97. package/docs/operations/table.md +374 -157
  98. package/docs/operations/tree.md +1 -1
  99. package/docs/operations/treemap.md +1 -1
  100. package/docs/operations/waterfall.md +1 -1
  101. package/docs/operations/word-cloud.md +1 -1
  102. package/getters.js +2 -2
  103. package/index.js +482 -434
  104. package/metadata.js +2 -2
  105. package/operations.js +5 -5
  106. package/package.json +72 -67
  107. package/src/definitions/index.d.ts +7 -1
  108. package/src/definitions/model/definitions/available-fields.d.ts +2 -2
  109. package/src/definitions/model/definitions/compilers/compile.d.ts +1 -0
  110. package/src/definitions/model/definitions/data-item-resolution.d.ts +3 -3
  111. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +219 -7
  112. package/src/definitions/model/definitions/index.d.ts +2 -1
  113. package/src/definitions/model/definitions/schema-registry.d.ts +305 -0
  114. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +2 -0
  115. package/src/definitions/model/definitions/schemas/common.schema.d.ts +4 -3
  116. package/src/definitions/model/definitions/schemas/index.d.ts +1 -0
  117. package/src/definitions/model/definitions/schemas/map.schema.d.ts +590 -0
  118. package/src/definitions/model/definitions/types/compilation.types.d.ts +9 -1
  119. package/src/definitions/model/definitions/types/definition.types.d.ts +2 -2
  120. package/src/definitions/model/definitions/types/index.d.ts +1 -1
  121. package/src/index.d.ts +1 -1
  122. package/src/operations/index.d.ts +1 -1
  123. package/src/types.d.ts +17 -13
  124. package/chunks/FieldTypeIcon-pSVQFemC.js +0 -22
  125. package/chunks/ToggleButton-Br9HCPCv.js +0 -150
  126. package/chunks/color-rules-CN7TcGrC.js +0 -6
  127. package/chunks/color-settings-3VRlf_Vw.js +0 -6
  128. package/chunks/handlers-CMbyj5y1.js +0 -12930
  129. package/chunks/isEqual-DBg_b35N.js +0 -12
  130. package/chunks/label-format-type-weq1XfcX.js +0 -8
  131. package/chunks/operations-HSqnCRvv.js +0 -26324
  132. package/chunks/shared-DFoJxjVN.js +0 -1218
  133. package/chunks/standalone-530a5lvf.js +0 -1003
  134. package/chunks/standalone-B4jrf4KE.js +0 -354
  135. package/chunks/standalone-BMoJXGYe.js +0 -2
  136. package/chunks/standalone-BfvGggeM2.js +0 -355
  137. package/chunks/standalone-CMJJIi9v.js +0 -2
  138. package/chunks/standalone-C_Jd4gkj.js +0 -6
  139. package/chunks/standalone-CiaaibTa.js +0 -518
  140. package/chunks/standalone-DBeXQrwH.js +0 -468
  141. package/chunks/standalone-DpSRmAWx.js +0 -287
  142. package/chunks/standalone-kzAhwH19.js +0 -689
  143. package/chunks/standalone-mb7LwEiq.js +0 -3874
  144. /package/chunks/{src-BOS6SqkZ2.js → src-BOS6SqkZ.js} +0 -0
@@ -0,0 +1,343 @@
1
+ import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { Fc as t, Mt as n, Tn as r, Wi as i, ys as a } from "./visualization-filters-D7i6oh1Z.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-C_2F90xq.js";
4
+ import { jp as g, lh as _ } from "./handlers-C6CZ0XJA.js";
5
+ import { E as v } from "./operations-DKQWuLL7.js";
6
+ import { t as y } from "./isEqual-D8Ay63xR.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 [n, 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
+ n
257
+ ]), D) return E(D);
258
+ let i = C.vSpec.layers.find((e) => e.id === o), a = i.measures.find(({ dataItem: e }) => t(e) === i.dataRoles[r.role]);
259
+ if (!a) return E(f("operation_failed", [
260
+ ...s,
261
+ "data",
262
+ "measures",
263
+ n
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 && n(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
+ resolvedLayerRefs: Object.fromEntries(w),
340
+ resolvedRefs: C.resolvedRefs
341
+ } : E(f("invalid_compiled_vspec", [], "Compiled map vSpec failed validation.", { details: { issues: j.error.issues } }));
342
+ };
343
+ export { j as compileMapVisualizationDefinition };
@@ -1,4 +1,4 @@
1
- import { a as e, i as t, o as n } from "./operations-HSqnCRvv.js";
1
+ import { a as e, i as t, o as n } from "./operations-DKQWuLL7.js";
2
2
  var r = { measureFiltersEnabled: !0 }, i = () => ({
3
3
  count: 0,
4
4
  names: [],
@@ -1,9 +1,9 @@
1
- import "./visualization-filters-mVnsnvLP.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-DFoJxjVN.js";
3
- import { of as f, vd as p } from "./handlers-CMbyj5y1.js";
4
- import { h as m } from "./operations-HSqnCRvv.js";
1
+ import "./visualization-filters-D7i6oh1Z.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-C_2F90xq.js";
3
+ import { jp as f, ym as p } from "./handlers-C6CZ0XJA.js";
4
+ import { h as m } from "./operations-DKQWuLL7.js";
5
5
  var h = async (h) => {
6
- let g = p(h);
6
+ let g = f(h);
7
7
  if (g) return {
8
8
  issues: [{
9
9
  code: "invalid_structure",
@@ -17,7 +17,7 @@ var h = async (h) => {
17
17
  issues: i(_.error, h.definition),
18
18
  success: !1
19
19
  };
20
- let v = f.safeParse(h.baseVSpec);
20
+ let v = p.safeParse(h.baseVSpec);
21
21
  if (!v.success) return {
22
22
  issues: [o("invalid_structure", ["baseVSpec"], "Base number vSpec is invalid.")],
23
23
  success: !1
@@ -48,6 +48,6 @@ var h = async (h) => {
48
48
  } : (S = await c(S.state, b.filterGroup), "issue" in S ? {
49
49
  issues: [S.issue],
50
50
  success: !1
51
- } : s(S.state, f));
51
+ } : s(S.state, p));
52
52
  };
53
53
  export { h as compileNumberVisualizationDefinition };