@urban-toolkit/autk-grammar 4.0.0 → 4.1.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.
@@ -1,87 +1,87 @@
1
- import { AutkDb as Q, DEFAULT_WORKSPACE_COORDINATE_FORMAT as F } from "@urban-toolkit/autk-db";
2
- import { AutkMap as $, MapEvent as P } from "@urban-toolkit/autk-map";
3
- import { AutkPlot as Y, PlotEvent as A } from "@urban-toolkit/autk-plot";
4
- import { ColorMapDomainStrategy as w } from "@urban-toolkit/autk-core";
5
- import { AutkComputeEngine as H } from "@urban-toolkit/autk-compute";
6
- function V(t) {
1
+ import { AutkDb as $, DEFAULT_WORKSPACE_COORDINATE_FORMAT as O } from "@urban-toolkit/autk-db";
2
+ import { AutkMap as Y, MapEvent as L } from "@urban-toolkit/autk-map";
3
+ import { AutkPlot as H, PlotEvent as w } from "@urban-toolkit/autk-plot";
4
+ import { ColorMapDomainStrategy as S } from "@urban-toolkit/autk-core";
5
+ import { AutkComputeEngine as V } from "@urban-toolkit/autk-compute";
6
+ function k(t) {
7
7
  const { spec: e, adapters: r } = t;
8
- let a;
8
+ let o;
9
9
  async function s() {
10
- let l;
10
+ let u;
11
11
  if (e.data)
12
- for (const n of e.data)
13
- l = await r.db.resolveSource(l, n);
12
+ for (const i of e.data)
13
+ u = await r.db.resolveSource(u, i);
14
14
  if (e.compute)
15
- for (const n of e.compute)
16
- l = await r.compute.resolveCompute(l, n);
15
+ for (const i of e.compute)
16
+ u = await r.compute.resolveCompute(u, i);
17
17
  if (e.map)
18
18
  if (Array.isArray(e.map))
19
- for (let n = 0; n < e.map.length; n++) {
20
- let u = e.map[n];
21
- await r.map.resolveMap(l, u, n);
19
+ for (let i = 0; i < e.map.length; i++) {
20
+ let l = e.map[i];
21
+ await r.map.resolveMap(u, l, i);
22
22
  }
23
23
  else
24
- await r.map.resolveMap(l, e.map);
24
+ await r.map.resolveMap(u, e.map);
25
25
  if (e.plot)
26
26
  if (Array.isArray(e.plot))
27
- for (const n of e.plot)
28
- await r.plot.resolvePlot(l, n);
27
+ for (const i of e.plot)
28
+ await r.plot.resolvePlot(u, i);
29
29
  else
30
- await r.plot.resolvePlot(l, e.plot);
31
- a = l;
30
+ await r.plot.resolvePlot(u, e.plot);
31
+ o = u;
32
32
  }
33
- function o(l) {
34
- return console.log("Spec to update", l), new Promise((n) => {
35
- n();
33
+ function a(u) {
34
+ return console.log("Spec to update", u), new Promise((i) => {
35
+ i();
36
36
  });
37
37
  }
38
- function i() {
38
+ function n() {
39
39
  console.log("Function not implemented yet");
40
40
  }
41
- return { run: s, updatedSpec: o, destroy: i, get context() {
42
- return a;
41
+ return { run: s, updatedSpec: a, destroy: n, get context() {
42
+ return o;
43
43
  } };
44
44
  }
45
- var k = /* @__PURE__ */ ((t) => (t.CAT_ACCENT = "schemeAccent", t.CAT_DARK2 = "schemeDark2", t.CAT_CATEGORY10 = "schemeCategory10", t.CAT_OBSERVABLE10 = "schemeObservable10", t.CAT_PAIRED = "schemePaired", t.CAT_PASTEL1 = "schemePastel1", t.CAT_PASTEL2 = "schemePastel2", t.CAT_SET1 = "schemeSet1", t.CAT_SET2 = "schemeSet2", t.CAT_SET3 = "schemeSet3", t.CAT_TABLEAU10 = "schemeTableau10", t.SEQ_REDS = "interpolateReds", t.SEQ_BLUES = "interpolateBlues", t.SEQ_GREENS = "interpolateGreens", t.SEQ_GREYS = "interpolateGreys", t.SEQ_ORANGES = "interpolateOranges", t.SEQ_PURPLES = "interpolatePurples", t.SEQ_TURBO = "interpolateTurbo", t.SEQ_VIRIDIS = "interpolateViridis", t.SEQ_INFERNO = "interpolateInferno", t.SEQ_MAGMA = "interpolateMagma", t.SEQ_PLASMA = "interpolatePlasma", t.SEQ_CIVIDIS = "interpolateCividis", t.SEQ_WARM = "interpolateWarm", t.SEQ_COOL = "interpolateCool", t.SEQ_CUBEHELIX_DEFAULT = "interpolateCubehelixDefault", t.SEQ_BU_GN = "interpolateBuGn", t.SEQ_BU_PU = "interpolateBuPu", t.SEQ_GN_BU = "interpolateGnBu", t.SEQ_OR_RD = "interpolateOrRd", t.SEQ_PU_BU_GN = "interpolatePuBuGn", t.SEQ_PU_BU = "interpolatePuBu", t.SEQ_PU_RD = "interpolatePuRd", t.SEQ_RD_PU = "interpolateRdPu", t.SEQ_YL_GN_BU = "interpolateYlGnBu", t.SEQ_YL_GN = "interpolateYlGn", t.SEQ_YL_OR_BR = "interpolateYlOrBr", t.SEQ_YL_OR_RD = "interpolateYlOrRd", t.DIV_BR_BG = "interpolateBrBG", t.DIV_PR_GN = "interpolatePRGn", t.DIV_PI_YG = "interpolatePiYG", t.DIV_PU_OR = "interpolatePuOr", t.DIV_RED_BLUE = "interpolateRdBu", t.DIV_RED_GREY = "interpolateRdGy", t.DIV_RED_YELLOW_BLUE = "interpolateRdYlBu", t.DIV_RED_YELLOW_GREEN = "interpolateRdYlGn", t.DIV_SPECTRAL = "interpolateSpectral", t))(k || {}), O = /* @__PURE__ */ ((t) => (t.MIN_MAX = "minMax", t.PERCENTILE = "percentile", t))(O || {});
46
- function W(t) {
45
+ var W = /* @__PURE__ */ ((t) => (t.CAT_ACCENT = "schemeAccent", t.CAT_DARK2 = "schemeDark2", t.CAT_CATEGORY10 = "schemeCategory10", t.CAT_OBSERVABLE10 = "schemeObservable10", t.CAT_PAIRED = "schemePaired", t.CAT_PASTEL1 = "schemePastel1", t.CAT_PASTEL2 = "schemePastel2", t.CAT_SET1 = "schemeSet1", t.CAT_SET2 = "schemeSet2", t.CAT_SET3 = "schemeSet3", t.CAT_TABLEAU10 = "schemeTableau10", t.SEQ_REDS = "interpolateReds", t.SEQ_BLUES = "interpolateBlues", t.SEQ_GREENS = "interpolateGreens", t.SEQ_GREYS = "interpolateGreys", t.SEQ_ORANGES = "interpolateOranges", t.SEQ_PURPLES = "interpolatePurples", t.SEQ_TURBO = "interpolateTurbo", t.SEQ_VIRIDIS = "interpolateViridis", t.SEQ_INFERNO = "interpolateInferno", t.SEQ_MAGMA = "interpolateMagma", t.SEQ_PLASMA = "interpolatePlasma", t.SEQ_CIVIDIS = "interpolateCividis", t.SEQ_WARM = "interpolateWarm", t.SEQ_COOL = "interpolateCool", t.SEQ_CUBEHELIX_DEFAULT = "interpolateCubehelixDefault", t.SEQ_BU_GN = "interpolateBuGn", t.SEQ_BU_PU = "interpolateBuPu", t.SEQ_GN_BU = "interpolateGnBu", t.SEQ_OR_RD = "interpolateOrRd", t.SEQ_PU_BU_GN = "interpolatePuBuGn", t.SEQ_PU_BU = "interpolatePuBu", t.SEQ_PU_RD = "interpolatePuRd", t.SEQ_RD_PU = "interpolateRdPu", t.SEQ_YL_GN_BU = "interpolateYlGnBu", t.SEQ_YL_GN = "interpolateYlGn", t.SEQ_YL_OR_BR = "interpolateYlOrBr", t.SEQ_YL_OR_RD = "interpolateYlOrRd", t.DIV_BR_BG = "interpolateBrBG", t.DIV_PR_GN = "interpolatePRGn", t.DIV_PI_YG = "interpolatePiYG", t.DIV_PU_OR = "interpolatePuOr", t.DIV_RED_BLUE = "interpolateRdBu", t.DIV_RED_GREY = "interpolateRdGy", t.DIV_RED_YELLOW_BLUE = "interpolateRdYlBu", t.DIV_RED_YELLOW_GREEN = "interpolateRdYlGn", t.DIV_SPECTRAL = "interpolateSpectral", t))(W || {}), G = /* @__PURE__ */ ((t) => (t.MIN_MAX = "minMax", t.PERCENTILE = "percentile", t))(G || {});
46
+ function J(t) {
47
47
  const { autoLoadLayers: e, ...r } = t;
48
48
  return { ...r, autoLoadLayers: { layers: e?.layers ?? [] } };
49
49
  }
50
- function J(t, e) {
51
- function r(a, s) {
50
+ function K(t, e) {
51
+ function r(o, s) {
52
52
  if (!s || !s.db)
53
53
  return;
54
- const o = document.getElementById(s.db);
55
- if (o) {
56
- const i = a.getTablesMetadata();
57
- o.innerHTML += "<ul>";
58
- for (const l of i)
59
- o.innerHTML += `<li>${l.name}: (${l.source}, ${l.type}) </li>`;
60
- o.innerHTML += "</ul>", o.innerHTML += `<p>Number of tables: ${i.length}</p>`;
54
+ const a = document.getElementById(s.db);
55
+ if (a) {
56
+ const n = o.getTablesMetadata();
57
+ a.innerHTML += "<ul>";
58
+ for (const u of n)
59
+ a.innerHTML += `<li>${u.name}: (${u.source}, ${u.type}) </li>`;
60
+ a.innerHTML += "</ul>", a.innerHTML += `<p>Number of tables: ${n.length}</p>`;
61
61
  }
62
62
  }
63
63
  return {
64
- async resolveSource(a, s) {
65
- let o = a;
66
- o || (o = new Q(), await o.init());
67
- let { type: i, ...l } = s;
68
- switch (i) {
64
+ async resolveSource(o, s) {
65
+ let a = o;
66
+ a || (a = new $(), await a.init());
67
+ let { type: n, ...u } = s;
68
+ switch (n) {
69
69
  case "osm":
70
- return await o.loadOsm(W(l)), r(o, t), o;
70
+ return await a.loadOsm(J(u)), r(a, t), a;
71
71
  case "csv":
72
- return await o.loadCsv(l), r(o, t), o;
72
+ return await a.loadCsv(u), r(a, t), a;
73
73
  case "json":
74
- return await o.loadJson(l), r(o, t), o;
74
+ return await a.loadJson(u), r(a, t), a;
75
75
  case "geojson": {
76
- const n = l;
77
- let u;
78
- n.geojsonFileUrl ? u = await (await fetch(n.geojsonFileUrl)).json() : u = n.geojsonObject, e && u && e.set(n.outputTableName, u);
79
- const c = u ? (() => {
80
- const f = { ...n, geojsonObject: u };
76
+ const i = u;
77
+ let l;
78
+ i.geojsonFileUrl ? l = await (await fetch(i.geojsonFileUrl)).json() : l = i.geojsonObject, e && l && e.set(i.outputTableName, l);
79
+ const c = l ? (() => {
80
+ const f = { ...i, geojsonObject: l };
81
81
  return delete f.geojsonFileUrl, f;
82
- })() : n;
82
+ })() : i;
83
83
  try {
84
- await o.loadGeojson(c);
84
+ await a.loadGeojson(c);
85
85
  } catch (f) {
86
86
  const p = c.coordinateFormat ? `coordinateFormat is set to "${c.coordinateFormat}"` : "no coordinateFormat was specified — defaulting to EPSG:4326 (WGS84 per RFC 7946)";
87
87
  throw new Error(
@@ -89,38 +89,38 @@ function J(t, e) {
89
89
  );
90
90
  }
91
91
  try {
92
- const f = await o.getBoundingBoxFromLayer(c.outputTableName), p = 25e6;
92
+ const f = await a.getBoundingBoxFromLayer(c.outputTableName), p = 25e6;
93
93
  if (!isFinite(f.minLon) || !isFinite(f.minLat) || !isFinite(f.maxLon) || !isFinite(f.maxLat) || Math.abs(f.minLon) > p || Math.abs(f.maxLon) > p || Math.abs(f.minLat) > p || Math.abs(f.maxLat) > p)
94
94
  throw new Error(
95
- `Geometry bounding box after transform is invalid for layer "${c.outputTableName}" (bbox: [${f.minLon}, ${f.minLat}, ${f.maxLon}, ${f.maxLat}]). Verify that coordinateFormat matches the actual CRS of the input data. The workspace uses ${F}; input is expected in EPSG:4326 by default.`
95
+ `Geometry bounding box after transform is invalid for layer "${c.outputTableName}" (bbox: [${f.minLon}, ${f.minLat}, ${f.maxLon}, ${f.maxLat}]). Verify that coordinateFormat matches the actual CRS of the input data. The workspace uses ${O}; input is expected in EPSG:4326 by default.`
96
96
  );
97
97
  } catch (f) {
98
98
  if (f instanceof Error && f.message.includes("bounding box after transform")) throw f;
99
99
  }
100
- return r(o, t), o;
100
+ return r(a, t), a;
101
101
  }
102
102
  case "heatmap": {
103
- const n = l;
104
- return await o.buildHeatmap({
105
- tableJoinName: n.tableJoinName,
106
- near: { distance: n.near.distance },
107
- outputTableName: n.outputTableName,
108
- grid: n.grid,
109
- ...n.groupBy && { groupBy: n.groupBy }
110
- }), r(o, t), o;
103
+ const i = u;
104
+ return await a.buildHeatmap({
105
+ tableJoinName: i.tableJoinName,
106
+ near: { distance: i.near.distance },
107
+ outputTableName: i.outputTableName,
108
+ grid: i.grid,
109
+ ...i.groupBy && { groupBy: i.groupBy }
110
+ }), r(a, t), a;
111
111
  }
112
112
  case "join": {
113
- const n = l;
114
- if (await o.spatialQuery({
115
- tableRootName: n.tableRootName,
116
- tableJoinName: n.tableJoinName,
117
- ...n.near && { near: n.near },
118
- ...n.groupBy && { groupBy: n.groupBy }
113
+ const i = u;
114
+ if (await a.spatialQuery({
115
+ tableRootName: i.tableRootName,
116
+ tableJoinName: i.tableJoinName,
117
+ ...i.near && { near: i.near },
118
+ ...i.groupBy && { groupBy: i.groupBy }
119
119
  }), e) {
120
- const u = await o.getLayer(n.tableRootName);
121
- e.set(n.tableRootName, u);
120
+ const l = await a.getLayer(i.tableRootName);
121
+ e.set(i.tableRootName, l);
122
122
  }
123
- return r(o, t), o;
123
+ return r(a, t), a;
124
124
  }
125
125
  default:
126
126
  return;
@@ -128,85 +128,85 @@ function J(t, e) {
128
128
  }
129
129
  };
130
130
  }
131
- function K(t, e) {
132
- return e && e.length > 0 ? { type: w.USER, params: e } : t?.mode === O.PERCENTILE ? t.lowerPercentile !== void 0 || t.upperPercentile !== void 0 ? {
133
- type: w.PERCENTILE,
131
+ function X(t, e) {
132
+ return e && e.length > 0 ? { type: S.USER, params: e } : t?.mode === G.PERCENTILE ? t.lowerPercentile !== void 0 || t.upperPercentile !== void 0 ? {
133
+ type: S.PERCENTILE,
134
134
  params: [t.lowerPercentile ?? 0, t.upperPercentile ?? 100]
135
- } : { type: w.PERCENTILE } : { type: w.MIN_MAX };
135
+ } : { type: S.PERCENTILE } : { type: S.MIN_MAX };
136
136
  }
137
- function X(t, e) {
138
- return e.split(".").reduce((r, a) => {
137
+ function q(t, e) {
138
+ return e.split(".").reduce((r, o) => {
139
139
  if (!(r == null || typeof r != "object"))
140
- return r[a];
140
+ return r[o];
141
141
  }, t);
142
142
  }
143
- function q(t, e, r) {
144
- const a = e.split("."), s = { ...t };
145
- let o = s;
146
- for (let i = 0; i < a.length - 1; i++)
147
- o[a[i]] = { ...o[a[i]] ?? {} }, o = o[a[i]];
148
- return o[a[a.length - 1]] = r, s;
149
- }
150
- function z(t, e) {
151
- const a = t.features?.[0]?.properties?.bands ?? [];
152
- return a.find((o) => o.id === e || o.label === e?.replace(/\./g, "_"))?.id ?? a[0]?.id ?? e ?? "";
153
- }
154
- function Z(t, e, r) {
155
- async function a(s, o, i) {
156
- let l = {};
157
- for (const n of o.getTablesMetadata())
158
- n.type !== void 0 && (l[n.name] = n.type);
159
- for (const n of i.layerRefs) {
160
- const u = n.dataRef, c = l[u], f = n.getFnv, p = r?.get(u) ?? await o.getLayer(u), m = c === "raster" ? p : {
161
- ...p,
162
- features: (p.features ?? []).filter((h) => h.geometry != null)
143
+ function z(t, e, r) {
144
+ const o = e.split("."), s = { ...t };
145
+ let a = s;
146
+ for (let n = 0; n < o.length - 1; n++)
147
+ a[o[n]] = { ...a[o[n]] ?? {} }, a = a[o[n]];
148
+ return a[o[o.length - 1]] = r, s;
149
+ }
150
+ function Z(t, e) {
151
+ const o = t.features?.[0]?.properties?.bands ?? [];
152
+ return o.find((a) => a.id === e || a.label === e?.replace(/\./g, "_"))?.id ?? o[0]?.id ?? e ?? "";
153
+ }
154
+ function tt(t, e, r, o) {
155
+ async function s(a, n, u) {
156
+ let i = {};
157
+ for (const l of n.getTablesMetadata())
158
+ l.type !== void 0 && (i[l.name] = l.type);
159
+ for (const l of u.layerRefs) {
160
+ const c = l.dataRef, f = i[c], p = l.getFnv, m = r?.get(c) ?? await n.getLayer(c), d = f === "raster" ? m : {
161
+ ...m,
162
+ features: (m.features ?? []).filter((_) => _.geometry != null)
163
163
  };
164
- c === "raster" ? s.loadCollection(u, { collection: m, type: "raster", property: z(m, f) }) : s.loadCollection(u, { collection: m, type: c }), n.opacity != null && s.updateRenderInfo(u, { opacity: n.opacity }), (n.isColorMap ?? (f != null && c !== "raster")) && s.updateRenderInfo(u, { isColorMap: !0 }), n.isPick && s.updateRenderInfo(u, { isPick: !0 }), n.isSkip && s.updateRenderInfo(u, { isSkip: !0 });
165
- const { catchAllCategory: d, colorMapDomain: y } = n;
166
- let E = m, R = y;
167
- if (f && d && y?.length) {
168
- const h = new Set(y);
169
- E = {
170
- ...m,
171
- features: m.features.map((C) => {
172
- const L = C.properties, M = X(L, f);
173
- return M == null || !h.has(String(M)) ? { ...C, properties: q(L, f, d) } : C;
164
+ f === "raster" ? a.loadCollection(c, { collection: d, type: "raster", property: Z(d, p) }) : a.loadCollection(c, { collection: d, type: f }), l.opacity != null && a.updateRenderInfo(c, { opacity: l.opacity }), (l.isColorMap ?? (p != null && f !== "raster")) && a.updateRenderInfo(c, { isColorMap: !0 }), l.isPick && a.updateRenderInfo(c, { isPick: !0 }), l.isSkip && a.updateRenderInfo(c, { isSkip: !0 });
165
+ const { catchAllCategory: h, colorMapDomain: g } = l;
166
+ let R = d, b = g;
167
+ if (p && h && g?.length) {
168
+ const _ = new Set(g);
169
+ R = {
170
+ ...d,
171
+ features: d.features.map((M) => {
172
+ const v = M.properties, P = q(v, p);
173
+ return P == null || !_.has(String(P)) ? { ...M, properties: z(v, p, h) } : M;
174
174
  })
175
- }, R = h.has(d) ? y : [...y, d];
175
+ }, b = _.has(h) ? g : [...g, h];
176
176
  }
177
- if (n.colorMapInterpolator) {
178
- const h = {
177
+ if (l.colorMapInterpolator) {
178
+ const _ = {
179
179
  // urban-grammar ColorMapInterpolator values are string-compatible
180
180
  // with autk-core ColorMapInterpolator at runtime
181
- interpolator: n.colorMapInterpolator,
182
- domainSpec: K(n.normalization, R)
181
+ interpolator: l.colorMapInterpolator,
182
+ domainSpec: X(l.normalization, b)
183
183
  };
184
- s.updateRenderInfo(u, { colormap: { config: h }, isColorMap: !0 });
184
+ a.updateRenderInfo(c, { colormap: { config: _ }, isColorMap: !0 });
185
185
  }
186
- if (f && c !== "raster") {
187
- const h = f.startsWith("properties.") ? f : `properties.${f}`;
188
- s.updateThematic(u, { collection: E, property: h });
186
+ if (p && f !== "raster") {
187
+ const _ = p.startsWith("properties.") ? p : `properties.${p}`;
188
+ a.updateThematic(c, { collection: R, property: _ });
189
189
  }
190
190
  }
191
191
  }
192
192
  return {
193
- async resolveMap(s, o, i = 0) {
194
- if (t && t.map && s) {
195
- let l;
196
- if (Array.isArray(t.map) ? l = document.getElementById(t.map[i]) : l = document.getElementById(t.map), !l)
193
+ async resolveMap(a, n, u = 0) {
194
+ if (t && t.map && a) {
195
+ let i;
196
+ if (Array.isArray(t.map) ? i = document.getElementById(t.map[u]) : i = document.getElementById(t.map), !i)
197
197
  throw new Error("Could not find rendering target for map: " + t.map);
198
- if (!(l instanceof HTMLCanvasElement))
198
+ if (!(i instanceof HTMLCanvasElement))
199
199
  throw new Error("Target for map is not a canvas: " + t.map);
200
- const n = new $(l);
201
- if (o.style && n.style.setPredefinedStyle(o.style), await n.init(), await a(n, s, o), e)
202
- for (const u of o.layerRefs)
203
- e.set(u.dataRef, n);
204
- n.draw();
200
+ const l = new Y(i);
201
+ if (n.style && l.style.setPredefinedStyle(n.style), await l.init(), await s(l, a, n), e)
202
+ for (const c of n.layerRefs)
203
+ e.set(c.dataRef, l);
204
+ o && (o[u] = l), l.draw();
205
205
  }
206
206
  }
207
207
  };
208
208
  }
209
- function tt(t) {
209
+ function et(t) {
210
210
  return {
211
211
  scatter: "scatterplot",
212
212
  bar: "barchart",
@@ -217,241 +217,241 @@ function tt(t) {
217
217
  heatmatrix: "heatmatrix"
218
218
  }[t];
219
219
  }
220
- function et(t, e, r, a, s) {
220
+ function rt(t, e, r, o, s) {
221
221
  return {
222
- async resolvePlot(o, i) {
222
+ async resolvePlot(a, n) {
223
223
  if (!t || !t.plot) return;
224
- const l = document.getElementById(t.plot);
225
- if (!l) throw new Error(`Could not find plot target: ${t.plot}`);
226
- const n = o;
227
- if (!n) throw new Error("No data context available for plot.");
228
- const u = s?.get(i.dataRef) ?? await n.getLayer(i.dataRef), c = i.events ?? [], f = new Y(l, {
229
- type: tt(i.mark),
230
- collection: u,
231
- attributes: { axis: i.axis, ...i.color && { color: i.color } },
232
- labels: { axis: i.axis, title: i.title },
224
+ const u = document.getElementById(t.plot);
225
+ if (!u) throw new Error(`Could not find plot target: ${t.plot}`);
226
+ const i = a;
227
+ if (!i) throw new Error("No data context available for plot.");
228
+ const l = s?.get(n.dataRef) ?? await i.getLayer(n.dataRef), c = n.events ?? [], f = new H(u, {
229
+ type: et(n.mark),
230
+ collection: l,
231
+ attributes: { axis: n.axis, ...n.color && { color: n.color } },
232
+ labels: { axis: n.axis, title: n.title },
233
233
  events: c,
234
- ...i.width && { width: i.width },
235
- ...i.height && { height: i.height },
236
- ...i.margins && { margins: i.margins },
237
- ...i.transform && { transform: i.transform }
234
+ ...n.width && { width: n.width },
235
+ ...n.height && { height: n.height },
236
+ ...n.margins && { margins: n.margins },
237
+ ...n.transform && { transform: n.transform }
238
238
  });
239
- if (r?.set(i.dataRef, f), i.mapRef && a?.set(i.dataRef, i.mapRef), i.mapRef && e) {
240
- const p = e.get(i.mapRef);
239
+ if (r?.set(n.dataRef, f), n.mapRef && o?.set(n.dataRef, n.mapRef), n.mapRef && e) {
240
+ const p = e.get(n.mapRef);
241
241
  if (p) {
242
- p.updateRenderInfo(i.mapRef, { isPick: !0 }), p.events.on(P.PICKING, ({ selection: m }) => {
242
+ p.updateRenderInfo(n.mapRef, { isPick: !0 }), p.events.on(L.PICKING, ({ selection: m }) => {
243
243
  f.setSelection(m);
244
244
  });
245
245
  for (const m of c)
246
- f.events.on(m, ({ selection: g }) => {
247
- p.setHighlightedIds(i.mapRef, g);
246
+ f.events.on(m, ({ selection: d }) => {
247
+ p.setHighlightedIds(n.mapRef, d);
248
248
  });
249
249
  }
250
250
  }
251
251
  }
252
252
  };
253
253
  }
254
- const G = 134217728, rt = 4, ot = 32;
255
- function at(t) {
254
+ const D = 134217728, at = 4, ot = 32;
255
+ function nt(t) {
256
256
  return Array.isArray(t) ? t.join(`
257
257
  `) : t;
258
258
  }
259
- function _(t) {
259
+ function E(t) {
260
260
  return !!t && typeof t == "object" && !Array.isArray(t) && typeof t.fromFeature == "object" && t.fromFeature !== null;
261
261
  }
262
- function b(t, e) {
262
+ function A(t, e) {
263
263
  return t instanceof Map ? t.get(e) : t[e];
264
264
  }
265
- function S(t, e) {
266
- return e.split(".").reduce((r, a) => {
265
+ function C(t, e) {
266
+ return e.split(".").reduce((r, o) => {
267
267
  if (!(r == null || typeof r != "object"))
268
- return r[a];
268
+ return r[o];
269
269
  }, t);
270
270
  }
271
- function D(t) {
271
+ function j(t) {
272
272
  const e = [];
273
273
  for (const r of [t.uniforms, t.uniformMatrices])
274
- for (const a of Object.values(r ?? {}))
275
- _(a) && e.push(a);
274
+ for (const o of Object.values(r ?? {}))
275
+ E(o) && e.push(o);
276
276
  return e;
277
277
  }
278
- function nt(t) {
279
- return [.../* @__PURE__ */ new Set([t.dataRef, ...D(t).map((e) => e.fromFeature.layer)])];
278
+ function it(t) {
279
+ return [.../* @__PURE__ */ new Set([t.dataRef, ...j(t).map((e) => e.fromFeature.layer)])];
280
280
  }
281
- function j(t) {
282
- for (const e of D(t)) {
283
- const { iterate: r, layer: a } = e.fromFeature;
284
- if (r === "all" || r === "batched") return { mode: r, layer: a };
281
+ function x(t) {
282
+ for (const e of j(t)) {
283
+ const { iterate: r, layer: o } = e.fromFeature;
284
+ if (r === "all" || r === "batched") return { mode: r, layer: o };
285
285
  }
286
286
  return null;
287
287
  }
288
- function x(t, e, r) {
289
- const a = t.fromFeature, s = r !== void 0 && a.iterate === "all" ? r : a.index ?? 0, o = b(e, a.layer)?.features?.[s];
290
- return o ? S(o, a.path) : void 0;
288
+ function U(t, e, r) {
289
+ const o = t.fromFeature, s = r !== void 0 && o.iterate === "all" ? r : o.index ?? 0, a = A(e, o.layer)?.features?.[s];
290
+ return a ? C(a, o.path) : void 0;
291
291
  }
292
- function v(t, e, r) {
292
+ function N(t, e, r) {
293
293
  if (!t) return;
294
- const a = {};
295
- for (const [s, o] of Object.entries(t)) {
296
- if (!_(o)) {
297
- a[s] = o;
294
+ const o = {};
295
+ for (const [s, a] of Object.entries(t)) {
296
+ if (!E(a)) {
297
+ o[s] = a;
298
298
  continue;
299
299
  }
300
- const i = Number(x(o, e, r) ?? NaN);
301
- Number.isFinite(i) ? a[s] = i : typeof o.default == "number" && (a[s] = o.default);
300
+ const n = Number(U(a, e, r) ?? NaN);
301
+ Number.isFinite(n) ? o[s] = n : typeof a.default == "number" && (o[s] = a.default);
302
302
  }
303
- return a;
303
+ return o;
304
304
  }
305
- function N(t, e, r) {
305
+ function I(t, e, r) {
306
306
  if (!t) return;
307
- const a = {};
308
- for (const [s, o] of Object.entries(t)) {
309
- if (!_(o)) {
310
- a[s] = o;
307
+ const o = {};
308
+ for (const [s, a] of Object.entries(t)) {
309
+ if (!E(a)) {
310
+ o[s] = a;
311
311
  continue;
312
312
  }
313
- const i = x(o, e, r), l = Array.isArray(i) ? i : Array.isArray(o.default) ? o.default : void 0;
314
- if (!l) continue;
315
- const n = o.cols ?? (Array.isArray(l[0]) ? l[0].length : 0);
316
- n > 0 ? a[s] = { data: l, cols: n } : console.warn(`[autk-grammar] uniform matrix "${s}" has no column count; entry dropped`);
313
+ const n = U(a, e, r), u = Array.isArray(n) ? n : Array.isArray(a.default) ? a.default : void 0;
314
+ if (!u) continue;
315
+ const i = a.cols ?? (Array.isArray(u[0]) ? u[0].length : 0);
316
+ i > 0 ? o[s] = { data: u, cols: i } : console.warn(`[autk-grammar] uniform matrix "${s}" has no column count; entry dropped`);
317
317
  }
318
- return a;
318
+ return o;
319
319
  }
320
- function it(t) {
320
+ function st(t) {
321
321
  return t != null && !(typeof t == "number" && !Number.isFinite(t));
322
322
  }
323
- function I(t) {
324
- return _(t) && t.fromFeature.iterate === "batched";
323
+ function B(t) {
324
+ return E(t) && t.fromFeature.iterate === "batched";
325
325
  }
326
- function U(t, e) {
327
- return Object.values(e ?? {}).some(I) ? ot : Object.values(t ?? {}).some(I) ? rt : 0;
326
+ function Q(t, e) {
327
+ return Object.values(e ?? {}).some(B) ? ot : Object.values(t ?? {}).some(B) ? at : 0;
328
328
  }
329
- function st(t, e, r = G) {
330
- const a = U(t, e);
331
- return a > 0 ? Math.floor(r / a) : Number.POSITIVE_INFINITY;
329
+ function lt(t, e, r = D) {
330
+ const o = Q(t, e);
331
+ return o > 0 ? Math.floor(r / o) : Number.POSITIVE_INFINITY;
332
332
  }
333
- function lt(t, e, r, a = G) {
334
- const s = {}, o = {}, i = [];
335
- for (const n of [t, e])
336
- for (const u of Object.values(n ?? {}))
337
- _(u) && u.fromFeature.iterate === "batched" && u.fromFeature.required && i.push(u.fromFeature.path);
338
- if (i.length > 0) {
339
- const n = r.length;
340
- r = r.filter((u) => i.every((c) => it(S(u, c)))), r.length < n && console.info(`[autk-grammar] batched compute dropped ${n - r.length} feature(s) missing ${i.join(", ")}`);
333
+ function ut(t, e, r, o = D) {
334
+ const s = {}, a = {}, n = [];
335
+ for (const i of [t, e])
336
+ for (const l of Object.values(i ?? {}))
337
+ E(l) && l.fromFeature.iterate === "batched" && l.fromFeature.required && n.push(l.fromFeature.path);
338
+ if (n.length > 0) {
339
+ const i = r.length;
340
+ r = r.filter((l) => n.every((c) => st(C(l, c)))), r.length < i && console.info(`[autk-grammar] batched compute dropped ${i - r.length} feature(s) missing ${n.join(", ")}`);
341
341
  }
342
- const l = st(t, e, a);
343
- r.length > l && (console.warn(
344
- `[autk-grammar] batched compute capped at ${l} features (got ${r.length}): its largest packed array takes ${U(t, e)} B per feature, and a storage buffer binding holds ${a} B`
345
- ), r = r.slice(0, l));
346
- for (const [n, u] of Object.entries(t ?? {}))
347
- if (_(u) && u.fromFeature.iterate === "batched") {
348
- const c = typeof u.default == "number" ? u.default : void 0;
349
- o[n] = r.map((f) => {
350
- const p = Number(S(f, u.fromFeature.path) ?? c);
342
+ const u = lt(t, e, o);
343
+ r.length > u && (console.warn(
344
+ `[autk-grammar] batched compute capped at ${u} features (got ${r.length}): its largest packed array takes ${Q(t, e)} B per feature, and a storage buffer binding holds ${o} B`
345
+ ), r = r.slice(0, u));
346
+ for (const [i, l] of Object.entries(t ?? {}))
347
+ if (E(l) && l.fromFeature.iterate === "batched") {
348
+ const c = typeof l.default == "number" ? l.default : void 0;
349
+ a[i] = r.map((f) => {
350
+ const p = Number(C(f, l.fromFeature.path) ?? c);
351
351
  return Number.isFinite(p) ? p : 0;
352
352
  });
353
- } else typeof u == "number" && (s[n] = u);
354
- for (const [n, u] of Object.entries(e ?? {})) {
355
- if (!_(u) || u.fromFeature.iterate !== "batched") continue;
353
+ } else typeof l == "number" && (s[i] = l);
354
+ for (const [i, l] of Object.entries(e ?? {})) {
355
+ if (!E(l) || l.fromFeature.iterate !== "batched") continue;
356
356
  const c = [];
357
357
  for (const f of r) {
358
- const p = S(f, u.fromFeature.path);
359
- let m = 1 / 0, g = 1 / 0, d = -1 / 0, y = -1 / 0;
358
+ const p = C(f, l.fromFeature.path);
359
+ let m = 1 / 0, d = 1 / 0, y = -1 / 0, h = -1 / 0;
360
360
  if (Array.isArray(p))
361
- for (const E of p) {
362
- if (!Array.isArray(E) || E.length < 2) continue;
363
- const R = Number(E[0]), h = Number(E[1]);
364
- !Number.isFinite(R) || !Number.isFinite(h) || (m = Math.min(m, R), g = Math.min(g, h), d = Math.max(d, R), y = Math.max(y, h));
361
+ for (const g of p) {
362
+ if (!Array.isArray(g) || g.length < 2) continue;
363
+ const R = Number(g[0]), b = Number(g[1]);
364
+ !Number.isFinite(R) || !Number.isFinite(b) || (m = Math.min(m, R), d = Math.min(d, b), y = Math.max(y, R), h = Math.max(h, b));
365
365
  }
366
- Number.isFinite(m) || (m = 0, g = 0, d = 0, y = 0), c.push(m, g, d, g, d, y, m, y);
366
+ Number.isFinite(m) || (m = 0, d = 0, y = 0, h = 0), c.push(m, d, y, d, y, h, m, h);
367
367
  }
368
- o[n] = c;
368
+ a[i] = c;
369
369
  }
370
- return s.num_features = r.length, { uniforms: s, uniformArrays: o };
370
+ return s.num_features = r.length, { uniforms: s, uniformArrays: a };
371
371
  }
372
- function B(t, e, r) {
373
- const a = b(e, t.dataRef);
374
- if (!a) throw new Error(`compute: table "${t.dataRef}" is not loaded`);
372
+ function T(t, e, r) {
373
+ const o = A(e, t.dataRef);
374
+ if (!o) throw new Error(`compute: table "${t.dataRef}" is not loaded`);
375
375
  const s = {
376
- collection: a,
376
+ collection: o,
377
377
  variableMapping: t.attributes,
378
- wgslBody: at(t.wglsFunction)
378
+ wgslBody: nt(t.wglsFunction)
379
379
  };
380
380
  t.attributeArrays && (s.attributeArrays = t.attributeArrays), t.attributeMatrices && (s.attributeMatrices = t.attributeMatrices), t.uniformArrays && (s.uniformArrays = t.uniformArrays), t.outputColumnName && (s.resultField = t.outputColumnName), t.outputColumns && (s.outputColumns = t.outputColumns);
381
- const o = j(t);
382
- if (o?.mode === "batched") {
383
- const u = b(e, o.layer)?.features ?? [], c = lt(t.uniforms, t.uniformMatrices, u), f = v(T(t.uniforms), e) ?? {}, p = N(T(t.uniformMatrices), e);
381
+ const a = x(t);
382
+ if (a?.mode === "batched") {
383
+ const l = A(e, a.layer)?.features ?? [], c = ut(t.uniforms, t.uniformMatrices, l), f = N(F(t.uniforms), e) ?? {}, p = I(F(t.uniformMatrices), e);
384
384
  return s.uniforms = { ...f, ...c.uniforms }, s.uniformArrays = { ...s.uniformArrays ?? {}, ...c.uniformArrays }, p && Object.keys(p).length > 0 && (s.uniformMatrices = p), s;
385
385
  }
386
- const i = o?.mode === "all" ? r : void 0, l = v(t.uniforms, e, i), n = N(t.uniformMatrices, e, i);
387
- return l && (s.uniforms = l), n && (s.uniformMatrices = n), s;
386
+ const n = a?.mode === "all" ? r : void 0, u = N(t.uniforms, e, n), i = I(t.uniformMatrices, e, n);
387
+ return u && (s.uniforms = u), i && (s.uniformMatrices = i), s;
388
388
  }
389
- function T(t) {
389
+ function F(t) {
390
390
  if (t)
391
- return Object.fromEntries(Object.entries(t).filter(([, e]) => !(_(e) && e.fromFeature.iterate === "batched")));
391
+ return Object.fromEntries(Object.entries(t).filter(([, e]) => !(E(e) && e.fromFeature.iterate === "batched")));
392
392
  }
393
- function ut(t) {
393
+ function ft(t) {
394
394
  return t.outputColumns ?? (t.outputColumnName ? [t.outputColumnName] : []);
395
395
  }
396
- async function ft(t, e, r) {
397
- const a = j(t);
398
- if (a?.mode !== "all") return r(B(t, e));
399
- const s = b(e, t.dataRef);
396
+ async function ct(t, e, r) {
397
+ const o = x(t);
398
+ if (o?.mode !== "all") return r(T(t, e));
399
+ const s = A(e, t.dataRef);
400
400
  if (!s) throw new Error(`compute: table "${t.dataRef}" is not loaded`);
401
- const o = ut(t), i = structuredClone(s);
402
- for (const n of i.features) {
403
- const u = n.properties ??= {}, c = u.compute ??= {};
404
- for (const f of o) c[f] = 0;
401
+ const a = ft(t), n = structuredClone(s);
402
+ for (const i of n.features) {
403
+ const l = i.properties ??= {}, c = l.compute ??= {};
404
+ for (const f of a) c[f] = 0;
405
405
  }
406
- const l = b(e, a.layer)?.features?.length ?? 0;
407
- for (let n = 0; n < l; n++) {
408
- const u = await r({ ...B(t, e, n), collection: i });
409
- i.features.forEach((c, f) => {
410
- const p = c.properties?.compute, m = u.features[f]?.properties?.compute;
406
+ const u = A(e, o.layer)?.features?.length ?? 0;
407
+ for (let i = 0; i < u; i++) {
408
+ const l = await r({ ...T(t, e, i), collection: n });
409
+ n.features.forEach((c, f) => {
410
+ const p = c.properties?.compute, m = l.features[f]?.properties?.compute;
411
411
  if (!(!p || !m))
412
- for (const g of o) {
413
- const d = Number(m[g]);
414
- Number.isFinite(d) && (p[g] += d);
412
+ for (const d of a) {
413
+ const y = Number(m[d]);
414
+ Number.isFinite(y) && (p[d] += y);
415
415
  }
416
416
  });
417
417
  }
418
- return i;
418
+ return n;
419
419
  }
420
- function ct(t) {
420
+ function pt(t) {
421
421
  return {
422
422
  async resolveCompute(e, r) {
423
423
  if (e) {
424
- const a = {};
425
- for (const i of nt(r)) {
426
- const l = t?.get(i);
427
- if (l) a[i] = l;
428
- else if (i === r.dataRef) a[i] = await e.getLayer(i);
424
+ const o = {};
425
+ for (const n of it(r)) {
426
+ const u = t?.get(n);
427
+ if (u) o[n] = u;
428
+ else if (n === r.dataRef) o[n] = await e.getLayer(n);
429
429
  else
430
430
  try {
431
- a[i] = await e.getLayer(i);
431
+ o[n] = await e.getLayer(n);
432
432
  } catch {
433
- a[i] = void 0;
433
+ o[n] = void 0;
434
434
  }
435
435
  }
436
- const s = new H(), o = await ft(r, a, (i) => s.gpgpuPipeline(i));
437
- return t && t.set(r.dataRef, o), e;
436
+ const s = new V(), a = await ct(r, o, (n) => s.gpgpuPipeline(n));
437
+ return t && t.set(r.dataRef, a), e;
438
438
  }
439
439
  }
440
440
  };
441
441
  }
442
- class pt {
442
+ class mt {
443
443
  _listeners = /* @__PURE__ */ new Map();
444
444
  on(e, r) {
445
445
  this._listeners.has(e) || this._listeners.set(e, /* @__PURE__ */ new Set());
446
- const a = this._listeners.get(e);
447
- return a.add(r), () => a.delete(r);
446
+ const o = this._listeners.get(e);
447
+ return o.add(r), () => o.delete(r);
448
448
  }
449
449
  /** @internal */
450
450
  emit(e, r) {
451
- this._listeners.get(e)?.forEach((a) => a(r));
451
+ this._listeners.get(e)?.forEach((o) => o(r));
452
452
  }
453
453
  }
454
- class _t {
454
+ class Et {
455
455
  dataAdapter;
456
456
  mapAdapter;
457
457
  plotAdapter;
@@ -460,13 +460,14 @@ class _t {
460
460
  _computeCache = /* @__PURE__ */ new Map();
461
461
  _data = {};
462
462
  _mapRegistry = /* @__PURE__ */ new Map();
463
+ _maps = [];
463
464
  _plotRegistry = /* @__PURE__ */ new Map();
464
465
  _fwdCleanups = [];
465
466
  _plotMapLinks = /* @__PURE__ */ new Map();
466
- interactions = new pt();
467
+ interactions = new mt();
467
468
  constructor(e) {
468
469
  const r = /* @__PURE__ */ new Map();
469
- this.dataAdapter = J(e, r), this.mapAdapter = Z(e, this._mapRegistry, this._computeCache), this.plotAdapter = et(e, this._mapRegistry, this._plotRegistry, this._plotMapLinks, r), this.computeAdapter = ct(this._computeCache);
470
+ this.dataAdapter = K(e, r), this.mapAdapter = tt(e, this._mapRegistry, this._computeCache, this._maps), this.plotAdapter = rt(e, this._mapRegistry, this._plotRegistry, this._plotMapLinks, r), this.computeAdapter = pt(this._computeCache);
470
471
  }
471
472
  /**
472
473
  * The coordinate reference system used internally by the autk workspace.
@@ -477,11 +478,22 @@ class _t {
477
478
  * instead of hard-coding a CRS string.
478
479
  */
479
480
  get workspaceCrs() {
480
- return F;
481
+ return O;
481
482
  }
482
483
  get data() {
483
484
  return this._data;
484
485
  }
486
+ /**
487
+ * The maps the last {@link run} drew, one per `map` entry of the spec, in order.
488
+ *
489
+ * Each map draws on demand: one frame once its layers are loaded, then one each
490
+ * time it changes. Between frames a map canvas can read back empty, so to read a
491
+ * map's pixels (for example with `canvas.toDataURL()`), call its `requestRender()`
492
+ * and read in a `requestAnimationFrame` callback registered after that call.
493
+ */
494
+ get maps() {
495
+ return this._maps;
496
+ }
485
497
  async run(e) {
486
498
  if (!this.dataAdapter)
487
499
  throw new Error("Database adapter not initialized. Please call the constructor first.");
@@ -491,7 +503,7 @@ class _t {
491
503
  throw new Error("Plot adapter not initialized. Please call the constructor first.");
492
504
  if (!this.computeAdapter)
493
505
  throw new Error("Compute adapter not initialized. Please call the constructor first.");
494
- this._mapRegistry.clear(), this._plotRegistry.clear(), this._plotMapLinks.clear(), this._computeCache.clear(), this.grammarEngine = V({
506
+ this._mapRegistry.clear(), this._maps.length = 0, this._plotRegistry.clear(), this._plotMapLinks.clear(), this._computeCache.clear(), this.grammarEngine = k({
495
507
  spec: e,
496
508
  adapters: {
497
509
  db: this.dataAdapter,
@@ -505,17 +517,17 @@ class _t {
505
517
  console.warn("Grammar engine produced no data context."), this._data = {};
506
518
  return;
507
519
  }
508
- const a = {};
520
+ const o = {};
509
521
  for (const s of r.getLayersMetadata())
510
- Object.defineProperty(a, s.name, {
522
+ Object.defineProperty(o, s.name, {
511
523
  get: () => {
512
- const o = this._computeCache.get(s.name);
513
- return o ? Promise.resolve(o) : r.getLayer(s.name);
524
+ const a = this._computeCache.get(s.name);
525
+ return a ? Promise.resolve(a) : r.getLayer(s.name);
514
526
  },
515
527
  enumerable: !0,
516
528
  configurable: !0
517
529
  });
518
- this._data = a;
530
+ this._data = o;
519
531
  }
520
532
  /**
521
533
  * Highlights features on the map layer identified by `layerId`.
@@ -523,8 +535,8 @@ class _t {
523
535
  */
524
536
  highlightOnMap(e, r) {
525
537
  this._mapRegistry.get(e)?.setHighlightedIds(e, r);
526
- for (const [a, s] of this._plotMapLinks)
527
- s === e && this._plotRegistry.get(a)?.setSelection(r);
538
+ for (const [o, s] of this._plotMapLinks)
539
+ s === e && this._plotRegistry.get(o)?.setSelection(r);
528
540
  }
529
541
  /**
530
542
  * Clears highlighted features on the map layer identified by `layerId`.
@@ -532,8 +544,8 @@ class _t {
532
544
  */
533
545
  clearHighlightOnMap(e) {
534
546
  this._mapRegistry.get(e)?.clearHighlightedIds(e);
535
- for (const [r, a] of this._plotMapLinks)
536
- a === e && this._plotRegistry.get(r)?.setSelection([]);
547
+ for (const [r, o] of this._plotMapLinks)
548
+ o === e && this._plotRegistry.get(r)?.setSelection([]);
537
549
  }
538
550
  /**
539
551
  * Clears the selection on the plot identified by `plotId` (its dataRef).
@@ -550,50 +562,50 @@ class _t {
550
562
  */
551
563
  setPlotSelection(e, r) {
552
564
  this._plotRegistry.get(e)?.setSelection(r);
553
- const a = this._plotMapLinks.get(e);
554
- a && this._mapRegistry.get(a)?.setHighlightedIds(a, r);
565
+ const o = this._plotMapLinks.get(e);
566
+ o && this._mapRegistry.get(o)?.setHighlightedIds(o, r);
555
567
  }
556
568
  _rewireInteractions() {
557
569
  for (const r of this._fwdCleanups) r();
558
570
  this._fwdCleanups = [];
559
571
  const e = /* @__PURE__ */ new Set();
560
- for (const [r, a] of this._mapRegistry) {
561
- if (e.has(a)) continue;
562
- e.add(a);
563
- const s = ({ selection: o }) => {
564
- this.interactions.emit("map:picking", { layerId: r, selection: o });
572
+ for (const [r, o] of this._mapRegistry) {
573
+ if (e.has(o)) continue;
574
+ e.add(o);
575
+ const s = ({ selection: a }) => {
576
+ this.interactions.emit("map:picking", { layerId: r, selection: a });
565
577
  };
566
- a.events.on(P.PICKING, s), this._fwdCleanups.push(() => a.events.off(P.PICKING, s));
578
+ o.events.on(L.PICKING, s), this._fwdCleanups.push(() => o.events.off(L.PICKING, s));
567
579
  }
568
- for (const [r, a] of this._plotRegistry)
569
- for (const s of [A.CLICK, A.BRUSH, A.BRUSH_X, A.BRUSH_Y]) {
570
- const o = ({ selection: i }) => {
580
+ for (const [r, o] of this._plotRegistry)
581
+ for (const s of [w.CLICK, w.BRUSH, w.BRUSH_X, w.BRUSH_Y]) {
582
+ const a = ({ selection: n }) => {
571
583
  this.interactions.emit("plot:selection", {
572
584
  plotId: r,
573
585
  event: s,
574
- selection: i
586
+ selection: n
575
587
  });
576
588
  };
577
- a.events.on(s, o), this._fwdCleanups.push(() => a.events.off(s, o));
589
+ o.events.on(s, a), this._fwdCleanups.push(() => o.events.off(s, a));
578
590
  }
579
591
  }
580
592
  }
581
593
  export {
582
- _t as AutkGrammar,
583
- k as ColorMapInterpolator,
584
- pt as GrammarEventEmitter,
585
- O as NormalizationMode,
586
- G as STORAGE_BUFFER_BINDING_SIZE,
587
- lt as buildBatchedUniforms,
588
- nt as computeLayerNames,
589
- V as createEngine,
590
- j as findIterateSource,
591
- _ as isFromFeature,
592
- at as joinWgsl,
593
- st as maxBatchedFeatures,
594
- B as resolveComputeParams,
595
- N as resolveUniformMatrices,
596
- v as resolveUniforms,
597
- ft as runCompute
594
+ Et as AutkGrammar,
595
+ W as ColorMapInterpolator,
596
+ mt as GrammarEventEmitter,
597
+ G as NormalizationMode,
598
+ D as STORAGE_BUFFER_BINDING_SIZE,
599
+ ut as buildBatchedUniforms,
600
+ it as computeLayerNames,
601
+ k as createEngine,
602
+ x as findIterateSource,
603
+ E as isFromFeature,
604
+ nt as joinWgsl,
605
+ lt as maxBatchedFeatures,
606
+ T as resolveComputeParams,
607
+ I as resolveUniformMatrices,
608
+ N as resolveUniforms,
609
+ ct as runCompute
598
610
  };
599
611
  //# sourceMappingURL=autk-grammar.js.map