@genome-spy/app 1.1.0 → 1.1.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 (30) hide show
  1. package/dist/{agentApi-BgZUOeB-.js → agentApi-sPuuT0KS.js} +3297 -3244
  2. package/dist/agentApi.es.js +1438 -1384
  3. package/dist/agentShared.es.js +2 -2
  4. package/dist/{canvas2d-t_N10CeW.js → canvas2d-MXaFeZnP.js} +4 -4
  5. package/dist/{canvas2d-DiPQvNtZ.js → canvas2d-iDK4BC5j.js} +4 -4
  6. package/dist/{debug-CVAlrcZt.js → debug-BlqDxTw3.js} +2 -2
  7. package/dist/{debug-DP4WzTNo.js → debug-DbigmdrK.js} +2 -2
  8. package/dist/index.es.js +2893 -2891
  9. package/dist/index.js +342 -342
  10. package/dist/{order-R043xTpC.js → order-B4uR9Q04.js} +1 -1
  11. package/dist/{order-BkYCnwD7.js → order-BSPy5DI8.js} +1 -1
  12. package/dist/{rasterExport-C_FcNBkC.js → rasterExport-B62RmAK1.js} +3 -3
  13. package/dist/{rasterExport-Z7gs5346.js → rasterExport-DQH3hVg_.js} +3 -3
  14. package/dist/{rasterization-_-9JmSas.js → rasterization-B05bDo5e.js} +15 -18
  15. package/dist/rasterization-CFogVB3B.js +50 -0
  16. package/dist/{renderCanvas2D-IM-A9DYG.js → renderCanvas2D-Bdv-B4wj.js} +15 -15
  17. package/dist/{renderCanvas2D-DK1c9TFK.js → renderCanvas2D-ChdoHGrU.js} +15 -15
  18. package/dist/scalePosition-ByvlXaML.js +11 -0
  19. package/dist/{svg-PabUdcDi.js → svg-DHsq1RpV.js} +13 -13
  20. package/dist/{svg-DW3tfUmm.js → svg-N3tj05-e.js} +13 -13
  21. package/dist/{svgRasterizer-BEVDyyS3.js → svgRasterizer-CYVDlt5z.js} +2 -2
  22. package/dist/{svgRasterizer-B6YtWLJs.js → svgRasterizer-CvCBlxLj.js} +2 -2
  23. package/dist/{viewIdentityRegistry-BW415b3o.js → viewIdentityRegistry-BDKkEjXl.js} +1 -1
  24. package/dist/{viewIdentityRegistry-_F0E7nkA.js → viewIdentityRegistry-BIYd4TE0.js} +1 -1
  25. package/dist/{viewSelectors-KtD-QSN0.js → viewSelectors-DDLW-byr.js} +80 -50
  26. package/dist/{viewSelectors-DYz-PhTO.js → viewSelectors-j-F9XwsE.js} +80 -50
  27. package/dist/{viewUtils-BZGPseMx.js → viewUtils-JX6CMEYH.js} +1212 -1211
  28. package/dist/{webgl-BKSGqHaz.js → webgl-DdmOwEH0.js} +107 -86
  29. package/dist/{webgl-tdKf9SlZ.js → webgl-Dw8xqZpX.js} +107 -86
  30. package/package.json +4 -4
@@ -101,8 +101,9 @@ var fe = class {
101
101
  #m = new x();
102
102
  #h = /* @__PURE__ */ new Set();
103
103
  #g;
104
+ #_;
104
105
  constructor(e = {}) {
105
- this.#g = se(e.lifecycleRegistry);
106
+ this.#g = se(e.lifecycleRegistry), this.#_ = e.onError;
106
107
  }
107
108
  createWritable(e, t, n, r, i = {}) {
108
109
  let a = "n" + this.#e++, o = i.notify ?? !0, s = {
@@ -120,20 +121,20 @@ var fe = class {
120
121
  }
121
122
  }, c = (e) => {
122
123
  if (s.disposed) throw Error("Cannot set disposed parameter \"" + t + "\" (" + a + ").");
123
- e !== s.value && (s.value = e, o && this.#v(s.listeners));
124
+ e !== s.value && (s.value = e, o && this.#y(s.listeners));
124
125
  }, l = () => {
125
126
  s.disposed = !0, s.listeners.clear(), u();
126
127
  }, u = this.#g(e, l);
127
128
  return Object.assign(ce(s, c, o), { dispose: l });
128
129
  }
129
130
  computed(e, t, n, r, i = {}) {
130
- return this.#_(e, t, n, r, i);
131
+ return this.#v(e, t, n, r, i);
131
132
  }
132
133
  operation(e, t, n, r, i, a = {}) {
133
- return this.#_(e, t, n, r, a, i);
134
+ return this.#v(e, t, n, r, a, i);
134
135
  }
135
- #_(e, t, n, r, i, a) {
136
- let o = this.#b(() => s.dependencies), s = {
136
+ #v(e, t, n, r, i, a) {
137
+ let o = this.#S(() => s.dependencies), s = {
137
138
  id: "n" + this.#e++,
138
139
  name: t,
139
140
  kind: "derived",
@@ -155,7 +156,7 @@ var fe = class {
155
156
  };
156
157
  a?.(s.value);
157
158
  let c = () => s.dependencies.map((e) => e.subscribe(() => {
158
- s.disposed || (this.#x(s), e.propagation === "sync" && this.flushNow());
159
+ s.disposed || (this.#C(s), e.propagation === "sync" && this.flushNow());
159
160
  })), l = c(), u = () => {
160
161
  s.disposed || (s.disposed = !0, d(), l.forEach((e) => e()), s.listeners.clear(), this.#d.delete(s));
161
162
  }, d = this.#g(e, u);
@@ -171,15 +172,15 @@ var fe = class {
171
172
  for (let e of n?.dependencies ?? []) i(e);
172
173
  }
173
174
  };
174
- e.forEach(i), l.forEach((e) => e()), s.dependencies = e, s.fn = n, this.#n++, l = c(), this.#x(s), this.#p.clear();
175
- for (let e of this.#d) this.#p.push(e, this.#C(e.rank));
175
+ e.forEach(i), l.forEach((e) => e()), s.dependencies = e, s.fn = n, this.#n++, l = c(), this.#C(s), this.#p.clear();
176
+ for (let e of this.#d) this.#p.push(e, this.#T(e.rank));
176
177
  this.#m.clear();
177
- for (let e of this.#f) this.#m.push(e, this.#C(e.rank));
178
+ for (let e of this.#f) this.#m.push(e, this.#T(e.rank));
178
179
  }
179
180
  });
180
181
  }
181
182
  effect(e, t, n) {
182
- let r = this.#b(() => t), i = {
183
+ let r = this.#S(() => t), i = {
183
184
  id: "n" + this.#e++,
184
185
  get rank() {
185
186
  return r();
@@ -187,7 +188,7 @@ var fe = class {
187
188
  disposed: !1,
188
189
  fn: n
189
190
  }, a = t.map((e) => e.subscribe(() => {
190
- i.disposed || (this.#S(i), e.propagation === "sync" && this.flushNow());
191
+ i.disposed || (this.#w(i), e.propagation === "sync" && this.flushNow());
191
192
  })), o = () => {
192
193
  i.disposed || (i.disposed = !0, s(), a.forEach((e) => e()), this.#f.delete(i));
193
194
  }, s = this.#g(e, o);
@@ -195,10 +196,12 @@ var fe = class {
195
196
  }
196
197
  runInTransaction(e) {
197
198
  this.#r += 1;
199
+ let t = !1;
198
200
  try {
199
- return e();
201
+ let n = e();
202
+ return t = !0, n;
200
203
  } finally {
201
- --this.#r, this.#r === 0 && (this.#i ? (this.#i = !1, this.flushNow()) : this.#w());
204
+ --this.#r, this.#r === 0 && (t ? this.#i ? (this.#i = !1, this.flushNow()) : this.#E() : this.#i = !1);
202
205
  }
203
206
  }
204
207
  flushNow({ afterTransaction: e = !1 } = {}) {
@@ -214,14 +217,14 @@ var fe = class {
214
217
  for (; this.#p.length;) {
215
218
  let e = this.#p.pop();
216
219
  if (this.#d.delete(e), e.disposed) continue;
217
- this.#y(e, e.name);
220
+ this.#x(e, e.name);
218
221
  let t, n;
219
222
  try {
220
223
  t = e.fn(), n = !e.equals(t, e.value), n && e.apply?.(t);
221
224
  } catch (t) {
222
- throw this.#x(e), t;
225
+ throw this.#C(e), t;
223
226
  }
224
- n && (e.value = t, this.#v(e.listeners));
227
+ n && (e.value = t, this.#y(e.listeners));
225
228
  }
226
229
  if (this.#l.size) {
227
230
  let e = Infinity, n;
@@ -238,20 +241,16 @@ var fe = class {
238
241
  if (!e) break;
239
242
  n = e;
240
243
  }
241
- t = this.#l.get(n).onError, this.#l.delete(n), this.#y(n, "streaming update"), n(), t = void 0;
244
+ t = this.#l.get(n).onError, this.#l.delete(n), this.#x(n, "streaming update"), n(), t = void 0;
242
245
  } else if (this.#m.length) {
243
246
  let e = this.#m.pop();
244
- this.#f.delete(e), e.disposed || (this.#y(e, "effect " + e.id), e.fn());
247
+ this.#f.delete(e), e.disposed || (this.#x(e, "effect " + e.id), e.fn());
245
248
  }
246
249
  }
247
250
  } catch (e) {
248
- let n = Array.from(this.#l.values());
249
- this.#l.clear(), t?.(e);
250
- for (let t of n) t.onError?.(e);
251
- for (let t of this.#h) t.reject(e);
252
- throw this.#h.clear(), e;
251
+ throw this.#b(e, t), e;
253
252
  } finally {
254
- this.#u.clear(), this.#o = !1, this.#E();
253
+ this.#u.clear(), this.#o = !1, this.#O();
255
254
  }
256
255
  }
257
256
  requestUpdate(e, t = 0, n, r) {
@@ -259,26 +258,41 @@ var fe = class {
259
258
  rank: t,
260
259
  onError: n,
261
260
  prerequisites: r
262
- }), this.#w();
261
+ }), this.#E();
263
262
  }
264
263
  cancelUpdate(e) {
265
264
  this.#l.delete(e);
266
265
  }
267
- #v(e) {
266
+ #y(e) {
268
267
  this.#s++;
269
268
  try {
270
269
  de(e);
270
+ } catch (e) {
271
+ throw this.#c = !1, !this.#o && this.#s === 1 && this.#b(e), e;
271
272
  } finally {
272
273
  this.#s--, !this.#s && this.#c && (this.#c = !1, this.flushNow());
273
274
  }
274
275
  }
275
- #y(e, t) {
276
+ #b(e, t) {
277
+ this.#a = !1;
278
+ let n = Array.from(this.#l.values());
279
+ this.#l.clear(), t?.(e);
280
+ for (let t of n) t.onError?.(e);
281
+ for (let t of this.#h) t.reject(e);
282
+ this.#h.clear();
283
+ try {
284
+ this.#_?.(e);
285
+ } catch (e) {
286
+ console.error(e);
287
+ }
288
+ }
289
+ #x(e, t) {
276
290
  let n = (this.#u.get(e) ?? 0) + 1;
277
291
  if (n > 100) throw Error("Reactive propagation did not settle: " + t);
278
292
  this.#u.set(e, n);
279
293
  }
280
294
  whenPropagated(e = {}) {
281
- if (this.#T()) return Promise.resolve();
295
+ if (this.#D()) return Promise.resolve();
282
296
  let { signal: t, timeoutMs: n } = e;
283
297
  return t?.aborted ? Promise.reject(/* @__PURE__ */ Error("whenPropagated aborted")) : new Promise((e, r) => {
284
298
  let i, a = () => {
@@ -294,38 +308,38 @@ var fe = class {
294
308
  t?.addEventListener("abort", s, { once: !0 }), n != null && (i = setTimeout(() => o.reject(/* @__PURE__ */ Error("whenPropagated timeout after " + n + " ms")), n)), this.#h.add(o);
295
309
  });
296
310
  }
297
- #b(e) {
311
+ #S(e) {
298
312
  let t = -1, n = 0;
299
313
  return () => (t !== this.#n && (n = 1 + e().reduce((e, t) => Math.max(e, ue(t)), 0), t = this.#n), n);
300
314
  }
301
- #x(e) {
315
+ #C(e) {
302
316
  if (this.#d.has(e)) {
303
- this.#w();
317
+ this.#E();
304
318
  return;
305
319
  }
306
- this.#d.add(e), this.#p.push(e, this.#C(e.rank)), this.#w();
320
+ this.#d.add(e), this.#p.push(e, this.#T(e.rank)), this.#E();
307
321
  }
308
- #S(e) {
322
+ #w(e) {
309
323
  if (this.#f.has(e)) {
310
- this.#w();
324
+ this.#E();
311
325
  return;
312
326
  }
313
- this.#f.add(e), this.#m.push(e, this.#C(e.rank)), this.#w();
327
+ this.#f.add(e), this.#m.push(e, this.#T(e.rank)), this.#E();
314
328
  }
315
- #C(e) {
329
+ #T(e) {
316
330
  let t = this.#t % oe;
317
331
  return this.#t += 1, e * oe + t;
318
332
  }
319
- #w() {
333
+ #E() {
320
334
  this.#r > 0 || this.#a || this.#o || (this.#a = !0, queueMicrotask(() => {
321
335
  this.#a && this.flushNow();
322
336
  }));
323
337
  }
324
- #T() {
338
+ #D() {
325
339
  return this.#r === 0 && !this.#a && !this.#o && this.#p.length === 0 && this.#m.length === 0 && this.#d.size === 0 && this.#f.size === 0 && this.#l.size === 0;
326
340
  }
327
- #E() {
328
- if (this.#T()) {
341
+ #O() {
342
+ if (this.#D()) {
329
343
  for (let e of this.#h) e.resolve();
330
344
  this.#h.clear();
331
345
  }
@@ -474,8 +488,14 @@ function ge(e, t, n = {}) {
474
488
  //#region ../core/src/paramRuntime/paramRuntime.js
475
489
  var _e = class {
476
490
  #e = new pe();
477
- #t = new fe({ lifecycleRegistry: this.#e });
491
+ #t;
478
492
  #n = new me();
493
+ constructor(e = {}) {
494
+ this.#t = new fe({
495
+ lifecycleRegistry: this.#e,
496
+ onError: e.onError
497
+ });
498
+ }
479
499
  createScope(e) {
480
500
  let t = this.#e.createOwner("scope", e ?? "root");
481
501
  return e ? this.#n.createChildScope(t, e) : this.#n.createRootScope(t);
@@ -559,8 +579,8 @@ function be(e) {
559
579
  //#endregion
560
580
  //#region ../core/src/utils/animator.js
561
581
  var xe = class {
562
- constructor(e) {
563
- this._renderCallback = e, this._renderRequested = !1, this._finalized = !1, this._warn = !1, this._animationFrameRequest = void 0, this.transitions = [], this.transitionsEnabled = !0;
582
+ constructor(e, t) {
583
+ this._renderCallback = e, this._onError = t, this._renderRequested = !1, this._finalized = !1, this._warn = !1, this._animationFrameRequest = void 0, this.transitions = [], this.transitionsEnabled = !0;
564
584
  }
565
585
  requestTransition(e) {
566
586
  this._finalized || (this.cancelTransition(e), this.transitions.push(e), this.requestRender());
@@ -575,9 +595,14 @@ var xe = class {
575
595
  this._renderRequested = !1;
576
596
  let t = this.transitions;
577
597
  this.transitions = [];
578
- let n;
579
- for (; n = t.shift();) n(e);
580
- this._finalized || this._renderCallback(e);
598
+ try {
599
+ let n;
600
+ for (; n = t.shift();) n(e);
601
+ this._finalized || this._renderCallback(e);
602
+ } catch (e) {
603
+ if (!this._onError) throw e;
604
+ this._onError(e);
605
+ }
581
606
  })));
582
607
  }
583
608
  finalize() {
@@ -643,7 +668,7 @@ var C = class {
643
668
  constructor(e, t, n, r = {}) {
644
669
  this.#d = e ?? (() => void 0), this.#f = t ?? (() => void 0), this.#p = n, this.#m = r.settleTemporalUpdatesImmediately ?? !1;
645
670
  let i = this.#d();
646
- i ? (this.#e = i.#e, this.#t = this.#e.createScope(i.#t)) : (this.#e = new _e(), this.#t = this.#e.createScope());
671
+ i ? (this.#e = i.#e, this.#t = this.#e.createScope(i.#t)) : (this.#e = new _e({ onError: r.onError }), this.#t = this.#e.createScope());
647
672
  }
648
673
  setSelectionSource(e) {
649
674
  this.#s = e;
@@ -1422,7 +1447,10 @@ var Qe = class {
1422
1447
  }, this.flowHandle = void 0, this.needsAxes = {
1423
1448
  x: !1,
1424
1449
  y: !1
1425
- }, this.paramRuntime = new C(() => this.dataParent?.paramRuntime, (e) => this.getScaleResolution(e), t.animator, { settleTemporalUpdatesImmediately: !0 }), this.paramRuntime.setSelectionSource(this), "mark" in e && this.paramRuntime.registerLazyExpression("zoomLevel", "zoomLevel()", () => ae("The automatic zoomLevel parameter is deprecated. Use zoomLevel() or an explicit channel such as zoomLevel(\"x\") instead."));
1450
+ }, this.paramRuntime = new C(() => this.dataParent?.paramRuntime, (e) => this.getScaleResolution(e), t.animator, {
1451
+ settleTemporalUpdatesImmediately: !0,
1452
+ onError: t.reportError
1453
+ }), this.paramRuntime.setSelectionSource(this), "mark" in e && this.paramRuntime.registerLazyExpression("zoomLevel", "zoomLevel()", () => ae("The automatic zoomLevel parameter is deprecated. Use zoomLevel() or an explicit channel such as zoomLevel(\"x\") instead."));
1426
1454
  let l = [...e.params ?? [], ...Ze(e) ?? []];
1427
1455
  for (let e of l) {
1428
1456
  if ("expr" in e) {
@@ -1695,7 +1723,9 @@ var Qe = class {
1695
1723
  this.#f.push(e);
1696
1724
  }
1697
1725
  disposeSubtree() {
1698
- let e = () => void 0;
1726
+ let e = (e) => {
1727
+ for (let t of Object.values(e.resolutions.scale)) t.dispose();
1728
+ };
1699
1729
  e.postOrder = (e) => {
1700
1730
  e.dispose();
1701
1731
  }, this.visit(e);
@@ -378,8 +378,9 @@ var Oe = class {
378
378
  #m = new N();
379
379
  #h = /* @__PURE__ */ new Set();
380
380
  #g;
381
+ #_;
381
382
  constructor(e = {}) {
382
- this.#g = we(e.lifecycleRegistry);
383
+ this.#g = we(e.lifecycleRegistry), this.#_ = e.onError;
383
384
  }
384
385
  createWritable(e, t, n, r, i = {}) {
385
386
  let a = "n" + this.#e++, o = i.notify ?? !0, s = {
@@ -397,20 +398,20 @@ var Oe = class {
397
398
  }
398
399
  }, c = (e) => {
399
400
  if (s.disposed) throw Error("Cannot set disposed parameter \"" + t + "\" (" + a + ").");
400
- e !== s.value && (s.value = e, o && this.#v(s.listeners));
401
+ e !== s.value && (s.value = e, o && this.#y(s.listeners));
401
402
  }, l = () => {
402
403
  s.disposed = !0, s.listeners.clear(), u();
403
404
  }, u = this.#g(e, l);
404
405
  return Object.assign(I(s, c, o), { dispose: l });
405
406
  }
406
407
  computed(e, t, n, r, i = {}) {
407
- return this.#_(e, t, n, r, i);
408
+ return this.#v(e, t, n, r, i);
408
409
  }
409
410
  operation(e, t, n, r, i, a = {}) {
410
- return this.#_(e, t, n, r, a, i);
411
+ return this.#v(e, t, n, r, a, i);
411
412
  }
412
- #_(e, t, n, r, i, a) {
413
- let o = this.#b(() => s.dependencies), s = {
413
+ #v(e, t, n, r, i, a) {
414
+ let o = this.#S(() => s.dependencies), s = {
414
415
  id: "n" + this.#e++,
415
416
  name: t,
416
417
  kind: "derived",
@@ -432,7 +433,7 @@ var Oe = class {
432
433
  };
433
434
  a?.(s.value);
434
435
  let c = () => s.dependencies.map((e) => e.subscribe(() => {
435
- s.disposed || (this.#x(s), e.propagation === "sync" && this.flushNow());
436
+ s.disposed || (this.#C(s), e.propagation === "sync" && this.flushNow());
436
437
  })), l = c(), u = () => {
437
438
  s.disposed || (s.disposed = !0, d(), l.forEach((e) => e()), s.listeners.clear(), this.#d.delete(s));
438
439
  }, d = this.#g(e, u);
@@ -448,15 +449,15 @@ var Oe = class {
448
449
  for (let e of n?.dependencies ?? []) i(e);
449
450
  }
450
451
  };
451
- e.forEach(i), l.forEach((e) => e()), s.dependencies = e, s.fn = n, this.#n++, l = c(), this.#x(s), this.#p.clear();
452
- for (let e of this.#d) this.#p.push(e, this.#C(e.rank));
452
+ e.forEach(i), l.forEach((e) => e()), s.dependencies = e, s.fn = n, this.#n++, l = c(), this.#C(s), this.#p.clear();
453
+ for (let e of this.#d) this.#p.push(e, this.#T(e.rank));
453
454
  this.#m.clear();
454
- for (let e of this.#f) this.#m.push(e, this.#C(e.rank));
455
+ for (let e of this.#f) this.#m.push(e, this.#T(e.rank));
455
456
  }
456
457
  });
457
458
  }
458
459
  effect(e, t, n) {
459
- let r = this.#b(() => t), i = {
460
+ let r = this.#S(() => t), i = {
460
461
  id: "n" + this.#e++,
461
462
  get rank() {
462
463
  return r();
@@ -464,7 +465,7 @@ var Oe = class {
464
465
  disposed: !1,
465
466
  fn: n
466
467
  }, a = t.map((e) => e.subscribe(() => {
467
- i.disposed || (this.#S(i), e.propagation === "sync" && this.flushNow());
468
+ i.disposed || (this.#w(i), e.propagation === "sync" && this.flushNow());
468
469
  })), o = () => {
469
470
  i.disposed || (i.disposed = !0, s(), a.forEach((e) => e()), this.#f.delete(i));
470
471
  }, s = this.#g(e, o);
@@ -472,10 +473,12 @@ var Oe = class {
472
473
  }
473
474
  runInTransaction(e) {
474
475
  this.#r += 1;
476
+ let t = !1;
475
477
  try {
476
- return e();
478
+ let n = e();
479
+ return t = !0, n;
477
480
  } finally {
478
- --this.#r, this.#r === 0 && (this.#i ? (this.#i = !1, this.flushNow()) : this.#w());
481
+ --this.#r, this.#r === 0 && (t ? this.#i ? (this.#i = !1, this.flushNow()) : this.#E() : this.#i = !1);
479
482
  }
480
483
  }
481
484
  flushNow({ afterTransaction: e = !1 } = {}) {
@@ -491,14 +494,14 @@ var Oe = class {
491
494
  for (; this.#p.length;) {
492
495
  let e = this.#p.pop();
493
496
  if (this.#d.delete(e), e.disposed) continue;
494
- this.#y(e, e.name);
497
+ this.#x(e, e.name);
495
498
  let t, n;
496
499
  try {
497
500
  t = e.fn(), n = !e.equals(t, e.value), n && e.apply?.(t);
498
501
  } catch (t) {
499
- throw this.#x(e), t;
502
+ throw this.#C(e), t;
500
503
  }
501
- n && (e.value = t, this.#v(e.listeners));
504
+ n && (e.value = t, this.#y(e.listeners));
502
505
  }
503
506
  if (this.#l.size) {
504
507
  let e = Infinity, n;
@@ -515,20 +518,16 @@ var Oe = class {
515
518
  if (!e) break;
516
519
  n = e;
517
520
  }
518
- t = this.#l.get(n).onError, this.#l.delete(n), this.#y(n, "streaming update"), n(), t = void 0;
521
+ t = this.#l.get(n).onError, this.#l.delete(n), this.#x(n, "streaming update"), n(), t = void 0;
519
522
  } else if (this.#m.length) {
520
523
  let e = this.#m.pop();
521
- this.#f.delete(e), e.disposed || (this.#y(e, "effect " + e.id), e.fn());
524
+ this.#f.delete(e), e.disposed || (this.#x(e, "effect " + e.id), e.fn());
522
525
  }
523
526
  }
524
527
  } catch (e) {
525
- let n = Array.from(this.#l.values());
526
- this.#l.clear(), t?.(e);
527
- for (let t of n) t.onError?.(e);
528
- for (let t of this.#h) t.reject(e);
529
- throw this.#h.clear(), e;
528
+ throw this.#b(e, t), e;
530
529
  } finally {
531
- this.#u.clear(), this.#o = !1, this.#E();
530
+ this.#u.clear(), this.#o = !1, this.#O();
532
531
  }
533
532
  }
534
533
  requestUpdate(e, t = 0, n, r) {
@@ -536,26 +535,41 @@ var Oe = class {
536
535
  rank: t,
537
536
  onError: n,
538
537
  prerequisites: r
539
- }), this.#w();
538
+ }), this.#E();
540
539
  }
541
540
  cancelUpdate(e) {
542
541
  this.#l.delete(e);
543
542
  }
544
- #v(e) {
543
+ #y(e) {
545
544
  this.#s++;
546
545
  try {
547
546
  De(e);
547
+ } catch (e) {
548
+ throw this.#c = !1, !this.#o && this.#s === 1 && this.#b(e), e;
548
549
  } finally {
549
550
  this.#s--, !this.#s && this.#c && (this.#c = !1, this.flushNow());
550
551
  }
551
552
  }
552
- #y(e, t) {
553
+ #b(e, t) {
554
+ this.#a = !1;
555
+ let n = Array.from(this.#l.values());
556
+ this.#l.clear(), t?.(e);
557
+ for (let t of n) t.onError?.(e);
558
+ for (let t of this.#h) t.reject(e);
559
+ this.#h.clear();
560
+ try {
561
+ this.#_?.(e);
562
+ } catch (e) {
563
+ console.error(e);
564
+ }
565
+ }
566
+ #x(e, t) {
553
567
  let n = (this.#u.get(e) ?? 0) + 1;
554
568
  if (n > 100) throw Error("Reactive propagation did not settle: " + t);
555
569
  this.#u.set(e, n);
556
570
  }
557
571
  whenPropagated(e = {}) {
558
- if (this.#T()) return Promise.resolve();
572
+ if (this.#D()) return Promise.resolve();
559
573
  let { signal: t, timeoutMs: n } = e;
560
574
  return t?.aborted ? Promise.reject(/* @__PURE__ */ Error("whenPropagated aborted")) : new Promise((e, r) => {
561
575
  let i, a = () => {
@@ -571,38 +585,38 @@ var Oe = class {
571
585
  t?.addEventListener("abort", s, { once: !0 }), n != null && (i = setTimeout(() => o.reject(/* @__PURE__ */ Error("whenPropagated timeout after " + n + " ms")), n)), this.#h.add(o);
572
586
  });
573
587
  }
574
- #b(e) {
588
+ #S(e) {
575
589
  let t = -1, n = 0;
576
590
  return () => (t !== this.#n && (n = 1 + e().reduce((e, t) => Math.max(e, Ee(t)), 0), t = this.#n), n);
577
591
  }
578
- #x(e) {
592
+ #C(e) {
579
593
  if (this.#d.has(e)) {
580
- this.#w();
594
+ this.#E();
581
595
  return;
582
596
  }
583
- this.#d.add(e), this.#p.push(e, this.#C(e.rank)), this.#w();
597
+ this.#d.add(e), this.#p.push(e, this.#T(e.rank)), this.#E();
584
598
  }
585
- #S(e) {
599
+ #w(e) {
586
600
  if (this.#f.has(e)) {
587
- this.#w();
601
+ this.#E();
588
602
  return;
589
603
  }
590
- this.#f.add(e), this.#m.push(e, this.#C(e.rank)), this.#w();
604
+ this.#f.add(e), this.#m.push(e, this.#T(e.rank)), this.#E();
591
605
  }
592
- #C(e) {
606
+ #T(e) {
593
607
  let t = this.#t % F;
594
608
  return this.#t += 1, e * F + t;
595
609
  }
596
- #w() {
610
+ #E() {
597
611
  this.#r > 0 || this.#a || this.#o || (this.#a = !0, queueMicrotask(() => {
598
612
  this.#a && this.flushNow();
599
613
  }));
600
614
  }
601
- #T() {
615
+ #D() {
602
616
  return this.#r === 0 && !this.#a && !this.#o && this.#p.length === 0 && this.#m.length === 0 && this.#d.size === 0 && this.#f.size === 0 && this.#l.size === 0;
603
617
  }
604
- #E() {
605
- if (this.#T()) {
618
+ #O() {
619
+ if (this.#D()) {
606
620
  for (let e of this.#h) e.resolve();
607
621
  this.#h.clear();
608
622
  }
@@ -751,8 +765,14 @@ function Me(e, t, n = {}) {
751
765
  //#region ../core/src/paramRuntime/paramRuntime.js
752
766
  var Ne = class {
753
767
  #e = new ke();
754
- #t = new Oe({ lifecycleRegistry: this.#e });
768
+ #t;
755
769
  #n = new Ae();
770
+ constructor(e = {}) {
771
+ this.#t = new Oe({
772
+ lifecycleRegistry: this.#e,
773
+ onError: e.onError
774
+ });
775
+ }
756
776
  createScope(e) {
757
777
  let t = this.#e.createOwner("scope", e ?? "root");
758
778
  return e ? this.#n.createChildScope(t, e) : this.#n.createRootScope(t);
@@ -836,8 +856,8 @@ function Ie(e) {
836
856
  //#endregion
837
857
  //#region ../core/src/utils/animator.js
838
858
  var Le = class {
839
- constructor(e) {
840
- this._renderCallback = e, this._renderRequested = !1, this._finalized = !1, this._warn = !1, this._animationFrameRequest = void 0, this.transitions = [], this.transitionsEnabled = !0;
859
+ constructor(e, t) {
860
+ this._renderCallback = e, this._onError = t, this._renderRequested = !1, this._finalized = !1, this._warn = !1, this._animationFrameRequest = void 0, this.transitions = [], this.transitionsEnabled = !0;
841
861
  }
842
862
  requestTransition(e) {
843
863
  this._finalized || (this.cancelTransition(e), this.transitions.push(e), this.requestRender());
@@ -852,9 +872,14 @@ var Le = class {
852
872
  this._renderRequested = !1;
853
873
  let t = this.transitions;
854
874
  this.transitions = [];
855
- let n;
856
- for (; n = t.shift();) n(e);
857
- this._finalized || this._renderCallback(e);
875
+ try {
876
+ let n;
877
+ for (; n = t.shift();) n(e);
878
+ this._finalized || this._renderCallback(e);
879
+ } catch (e) {
880
+ if (!this._onError) throw e;
881
+ this._onError(e);
882
+ }
858
883
  })));
859
884
  }
860
885
  finalize() {
@@ -920,7 +945,7 @@ var Be = class {
920
945
  constructor(e, t, n, r = {}) {
921
946
  this.#d = e ?? (() => void 0), this.#f = t ?? (() => void 0), this.#p = n, this.#m = r.settleTemporalUpdatesImmediately ?? !1;
922
947
  let i = this.#d();
923
- i ? (this.#e = i.#e, this.#t = this.#e.createScope(i.#t)) : (this.#e = new Ne(), this.#t = this.#e.createScope());
948
+ i ? (this.#e = i.#e, this.#t = this.#e.createScope(i.#t)) : (this.#e = new Ne({ onError: r.onError }), this.#t = this.#e.createScope());
924
949
  }
925
950
  setSelectionSource(e) {
926
951
  this.#s = e;
@@ -1422,7 +1447,10 @@ var Ze = class {
1422
1447
  }, this.flowHandle = void 0, this.needsAxes = {
1423
1448
  x: !1,
1424
1449
  y: !1
1425
- }, this.paramRuntime = new Be(() => this.dataParent?.paramRuntime, (e) => this.getScaleResolution(e), t.animator, { settleTemporalUpdatesImmediately: !0 }), this.paramRuntime.setSelectionSource(this), "mark" in e && this.paramRuntime.registerLazyExpression("zoomLevel", "zoomLevel()", () => se("The automatic zoomLevel parameter is deprecated. Use zoomLevel() or an explicit channel such as zoomLevel(\"x\") instead."));
1450
+ }, this.paramRuntime = new Be(() => this.dataParent?.paramRuntime, (e) => this.getScaleResolution(e), t.animator, {
1451
+ settleTemporalUpdatesImmediately: !0,
1452
+ onError: t.reportError
1453
+ }), this.paramRuntime.setSelectionSource(this), "mark" in e && this.paramRuntime.registerLazyExpression("zoomLevel", "zoomLevel()", () => se("The automatic zoomLevel parameter is deprecated. Use zoomLevel() or an explicit channel such as zoomLevel(\"x\") instead."));
1426
1454
  let l = [...e.params ?? [], ...Xe(e) ?? []];
1427
1455
  for (let e of l) {
1428
1456
  if ("expr" in e) {
@@ -1695,7 +1723,9 @@ var Ze = class {
1695
1723
  this.#f.push(e);
1696
1724
  }
1697
1725
  disposeSubtree() {
1698
- let e = () => void 0;
1726
+ let e = (e) => {
1727
+ for (let t of Object.values(e.resolutions.scale)) t.dispose();
1728
+ };
1699
1729
  e.postOrder = (e) => {
1700
1730
  e.dispose();
1701
1731
  }, this.visit(e);