@genome-spy/app 1.1.1 → 1.3.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 (96) hide show
  1. package/dist/{SharedReadCache-Ey5QIiPM.js → SharedReadCache-9sT2aIxW.js} +6 -12
  2. package/dist/__vite-browser-external-Dgu_Ldik.js +7 -0
  3. package/dist/{agentApi-sPuuT0KS.js → agentApi-BclFF9zB.js} +9981 -8914
  4. package/dist/agentApi.es.js +6783 -5135
  5. package/dist/agentShared.es.js +433 -460
  6. package/dist/arrayUtils-Bm7QnzhN.js +1306 -0
  7. package/dist/{blosc-JROzDOnd.js → blosc-C-W97QwH.js} +3 -3
  8. package/dist/{canvas2d-iDK4BC5j.js → canvas2d-8MSf70d4.js} +141 -134
  9. package/dist/{canvas2d-MXaFeZnP.js → canvas2d-BwGNI_Rx.js} +147 -141
  10. package/dist/clipOptions-SrrxeAEU.js +4316 -0
  11. package/dist/clipOptions-clBEbkjv.js +4326 -0
  12. package/dist/{layoutResult-D50MSHXR.js → color-jETn8xK_.js} +29 -10
  13. package/dist/color-uTRRsy8i.js +116 -0
  14. package/dist/{componentStyles-DGtQXvwc.js → componentStyles-C7FbjS-a.js} +1 -1
  15. package/dist/{viewIdentityRegistry-BIYd4TE0.js → containerView-BItRtKqu.js} +28 -31
  16. package/dist/{viewIdentityRegistry-BDKkEjXl.js → containerView-CWa6ZIJW.js} +28 -31
  17. package/dist/{debug-DbigmdrK.js → debug-23s-jja_.js} +10 -9
  18. package/dist/{debug-BlqDxTw3.js → debug-CWRxvAss.js} +9 -10
  19. package/dist/dialog.es.js +1 -1
  20. package/dist/dist-CmY6iewb.js +1501 -0
  21. package/dist/dist-D6xbz5Ks.js +1501 -0
  22. package/dist/{esm-CjkeZi__.js → esm-BFwBAnbO.js} +25 -25
  23. package/dist/esm-BUkWqSr2.js +299 -0
  24. package/dist/{esm-C-6g-SkZ.js → esm-C0xXMLsR.js} +37 -41
  25. package/dist/{esm-CJeszW-t.js → esm-C2xhhXs0.js} +7 -7
  26. package/dist/esm-C6erfjPM.js +252 -0
  27. package/dist/{esm-DFHFX1sH.js → esm-CVjC7qA4.js} +34 -38
  28. package/dist/esm-CqY5ezGz.js +1249 -0
  29. package/dist/esm-DfMIJ_N2.js +1522 -0
  30. package/dist/esm-Dls41IbZ.js +787 -0
  31. package/dist/{esm-Bv7Frz7C.js → esm-DzQDfrsZ.js} +7 -10
  32. package/dist/esm-aGLCvYRP.js +238 -0
  33. package/dist/{esm-VFJeyk9i.js → esm-nzwgJFGz.js} +40 -36
  34. package/dist/figWigMetadataSourceAdapter-8Kf_vZRf.js +36 -0
  35. package/dist/figWigMetadataSourceAdapter-DdDMZpYO.js +36 -0
  36. package/dist/flowNode-BSjy0Wz3.js +1306 -0
  37. package/dist/flowOutput-D5qpxWe0.js +183 -0
  38. package/dist/index.es.js +4766 -5522
  39. package/dist/index.js +1089 -685
  40. package/dist/inflate-BdC5KvHn.js +886 -0
  41. package/dist/{lz4-CUYSbVey.js → lz4-BLPgBOlE.js} +1 -1
  42. package/dist/markUtils-RaatLEa-.js +78 -0
  43. package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
  44. package/dist/metadataUtils-DxEPe0vj.js +879 -0
  45. package/dist/order-BnKzKjt4.js +1151 -0
  46. package/dist/order-BpJnq_nV.js +1150 -0
  47. package/dist/{parquetRead-0hFIa3Cc.js → parquetRead-D-yY8njE.js} +3 -11
  48. package/dist/{rasterExport-B62RmAK1.js → rasterExport-B-WrX1pa.js} +5 -5
  49. package/dist/{rasterExport-DQH3hVg_.js → rasterExport-C_vx4Jwd.js} +4 -4
  50. package/dist/{rasterization-B05bDo5e.js → rasterization-QktH8Sn2.js} +26 -19
  51. package/dist/rectangle-BAdoDPXu.js +194 -0
  52. package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
  53. package/dist/renderCanvas2D-CsRO78Pq.js +291 -0
  54. package/dist/{renderCanvas2D-Bdv-B4wj.js → renderCanvas2D-Y7pkRzbC.js} +98 -92
  55. package/dist/{rolldown-runtime-DF993M8W.js → rolldown-runtime-DeIk2rA4.js} +1 -1
  56. package/dist/{indexer-DbFTKGlm.js → scaleNull-CVzag4z8.js} +2 -12
  57. package/dist/{indexer-En7gpvLN.js → scaleNull-Pbz7QGnl.js} +2 -12
  58. package/dist/{scalePosition-ByvlXaML.js → scalePosition-CRXa0rCC.js} +8 -1
  59. package/dist/schema.json +33403 -16929
  60. package/dist/style.css +1 -1
  61. package/dist/{svg-N3tj05-e.js → svg-BBMtLgtM.js} +445 -362
  62. package/dist/{svg-DHsq1RpV.js → svg-JjWL6U-T.js} +464 -381
  63. package/dist/{svgRasterizer-CYVDlt5z.js → svgRasterizer-6OcftuoI.js} +3 -3
  64. package/dist/{svgRasterizer-CvCBlxLj.js → svgRasterizer-DkNRaCPs.js} +4 -4
  65. package/dist/tableMetadataSourceAdapter-CUNwLsdi.js +291 -0
  66. package/dist/tableMetadataSourceAdapter-DQrEXCo6.js +1283 -0
  67. package/dist/url-DeOdSRrv.js +183 -0
  68. package/dist/viewError-B0TMfOpB.js +33 -0
  69. package/dist/viewError-D9aO90cI.js +33 -0
  70. package/dist/{viewSelectors-DDLW-byr.js → viewSelectors-DkFvo33d.js} +914 -752
  71. package/dist/{viewSelectors-j-F9XwsE.js → viewSelectors-lM93fHAq.js} +942 -780
  72. package/dist/viewUtils-0SJOewM6.js +6195 -0
  73. package/dist/webgl-CXIO3OQz.js +5782 -0
  74. package/dist/webgl-Pdvfhio5.js +5783 -0
  75. package/package.json +7 -5
  76. package/src/agentApi/index.d.ts +3 -2
  77. package/src/agentShared/index.d.ts +2 -0
  78. package/src/appTypes.d.ts +1 -6
  79. package/src/embedTypes.d.ts +36 -1
  80. package/src/index.d.ts +6 -0
  81. package/src/spec/sampleView.d.ts +68 -13
  82. package/src/spec/view.d.ts +44 -5
  83. package/src/state/paramProvenanceTypes.d.ts +25 -2
  84. package/src/state.d.ts +14 -52
  85. package/dist/clipOptions-B5PibDq3.js +0 -2923
  86. package/dist/clipOptions-Cba4I0AO.js +0 -2903
  87. package/dist/esm-Dndm-NaA.js +0 -1193
  88. package/dist/order-B4uR9Q04.js +0 -1062
  89. package/dist/order-BSPy5DI8.js +0 -1062
  90. package/dist/renderCanvas2D-ChdoHGrU.js +0 -285
  91. package/dist/vega-scale-Byaw1K8O.js +0 -2446
  92. package/dist/vega-scale-Ctz_wa3z.js +0 -2443
  93. package/dist/viewError-BiR9VCgL.js +0 -29
  94. package/dist/viewUtils-JX6CMEYH.js +0 -6664
  95. package/dist/webgl-DdmOwEH0.js +0 -5544
  96. package/dist/webgl-Dw8xqZpX.js +0 -5544
@@ -187,7 +187,7 @@ var t = (typeof document < "u" && document.currentScript && document.currentScri
187
187
  return t === -1 ? e : e.substr(0, t);
188
188
  }, we = (e, t, n) => {
189
189
  switch (t) {
190
- case 1: return n ? (e) => d[e >> 0] : (e) => f[e >> 0];
190
+ case 1: return n ? (e) => d[e | 0] : (e) => f[e | 0];
191
191
  case 2: return n ? (e) => p[e >> 1] : (e) => m[e >> 1];
192
192
  case 4: return n ? (e) => h[e >> 2] : (e) => g[e >> 2];
193
193
  default: throw TypeError(`invalid integer width (${t}): ${e}`);
@@ -579,8 +579,8 @@ var t = (typeof document < "u" && document.currentScript && document.currentScri
579
579
  var n = 0;
580
580
  return Fe().forEach((r, i) => {
581
581
  var a = t + n;
582
- for (i = g[e + 4 * i >> 2] = a, a = 0; a < r.length; ++a) d[i++ >> 0] = r.charCodeAt(a);
583
- d[i >> 0] = 0, n += r.length + 1;
582
+ for (i = g[e + 4 * i >> 2] = a, a = 0; a < r.length; ++a) d[i++ | 0] = r.charCodeAt(a);
583
+ d[i | 0] = 0, n += r.length + 1;
584
584
  }), 0;
585
585
  },
586
586
  u: (e, t) => {
@@ -1,16 +1,17 @@
1
- import { ht as e, o as t, s as n, u as r, v as i } from "./clipOptions-Cba4I0AO.js";
2
- import { v as a } from "./vega-scale-Byaw1K8O.js";
1
+ import { Et as e, _ as t, o as n, s as r, un as i } from "./clipOptions-SrrxeAEU.js";
2
+ import { r as a } from "./arrayUtils-Bm7QnzhN.js";
3
3
  import { t as o } from "./warning-CpIIpk8e.js";
4
- import { t as s } from "./rectangle-DE98gIxF.js";
5
- import { n as c, t as l } from "./layoutResult-D50MSHXR.js";
6
- import { n as u, r as d, t as f } from "./performanceProfiler-CPLEjApa.js";
7
- import { C as p, E as m, F as h, I as g, M as _, N as v, S as y, T as b, _ as x, b as S, c as C, d as w, f as T, g as E, h as ee, i as D, j as O, k, l as te, n as ne, p as re, u as ie, v as ae, x as A } from "./order-B4uR9Q04.js";
8
- import { n as j, t as M } from "./renderCanvas2D-Bdv-B4wj.js";
9
- import { t as N } from "./canvasSizeHelper-foL2YvGL.js";
10
- import { exportCanvas as P, exportRaster as F } from "./rasterExport-DQH3hVg_.js";
11
- import { createCanvas2DSvgRasterizer as I } from "./svgRasterizer-CYVDlt5z.js";
4
+ import { l as s } from "./markUtils-RaatLEa-.js";
5
+ import { t as c } from "./rectangle-DZTR6NFQ.js";
6
+ import { n as l, r as u } from "./color-jETn8xK_.js";
7
+ import { n as d, r as f, t as p } from "./performanceProfiler-CPLEjApa.js";
8
+ import { C as m, D as h, E as g, F as _, L as v, N as y, P as b, R as x, S, _ as C, c as w, d as T, f as E, g as D, i as O, j as k, l as ee, m as te, n as ne, p as re, u as ie, v as ae, w as A, x as j, y as M } from "./order-BnKzKjt4.js";
9
+ import { n as N, t as P } from "./renderCanvas2D-Y7pkRzbC.js";
10
+ import { t as F } from "./canvasSizeHelper-foL2YvGL.js";
11
+ import { exportCanvas as I, exportRaster as L } from "./rasterExport-C_vx4Jwd.js";
12
+ import { createCanvas2DSvgRasterizer as R } from "./svgRasterizer-6OcftuoI.js";
12
13
  //#region ../core/src/rendering/canvas2d/picking/softwarePickingRasterizer.js
13
- var L = 12, R = .5, z = class {
14
+ var z = 12, B = .5, V = class {
14
15
  #e = [];
15
16
  #t = [];
16
17
  #n = [
@@ -50,7 +51,7 @@ var L = 12, R = .5, z = class {
50
51
  }
51
52
  setClip(e, t, n, r) {
52
53
  if (!Number.isFinite(e) || !Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r)) throw RangeError("Software picking clip must be finite.");
53
- this.#r = U(Math.floor(Math.min(e, n)), 0, this.buffer.width), this.#i = U(Math.floor(Math.min(t, r)), 0, this.buffer.height), this.#a = U(Math.ceil(Math.max(e, n)), this.#r, this.buffer.width), this.#o = U(Math.ceil(Math.max(t, r)), this.#i, this.buffer.height);
54
+ this.#r = W(Math.floor(Math.min(e, n)), 0, this.buffer.width), this.#i = W(Math.floor(Math.min(t, r)), 0, this.buffer.height), this.#a = W(Math.ceil(Math.max(e, n)), this.#r, this.buffer.width), this.#o = W(Math.ceil(Math.max(t, r)), this.#i, this.buffer.height);
54
55
  }
55
56
  fillRect(e, t, n, r, i) {
56
57
  this.#s++, this.#p(e, t, n, r, i);
@@ -95,24 +96,21 @@ var L = 12, R = .5, z = class {
95
96
  if (!(a > 0) || !Number.isFinite(a)) return;
96
97
  this.#u++;
97
98
  let s = a / 2, c = this.#n;
98
- if (!B(t, n, r, i, this.#r - s, this.#i - s, this.#a + s, this.#o + s, c)) return;
99
+ if (!E(t, n, r, i, this.#r - s, this.#i - s, this.#a + s, this.#o + s, c)) return;
99
100
  let l = c[2] - c[0], u = c[3] - c[1], d = Math.ceil(Math.max(Math.abs(l), Math.abs(u)));
100
- if (d == 0) {
101
- this.#h(e, c[0], c[1], s, o);
102
- return;
103
- }
104
- for (let t = 0; t <= d; t++) {
101
+ if (d == 0) this.#h(e, c[0], c[1], s, o);
102
+ else for (let t = 0; t <= d; t++) {
105
103
  let n = t / d;
106
104
  this.#h(e, c[0] + l * n, c[1] + u * n, s, o);
107
105
  }
108
106
  }
109
- strokeCubic(e, t, n, r, i, a, o, s, c, l, u = R, d) {
107
+ strokeCubic(e, t, n, r, i, a, o, s, c, l, u = B, d) {
110
108
  if (!(l > 0) || !Number.isFinite(l) || !(u > 0) || !Number.isFinite(u) || !Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(s) || !Number.isFinite(c)) return;
111
109
  this.#d++;
112
110
  let f = this.#e;
113
111
  for (f.length = 0, f.push(t, n, r, i, a, o, s, c, 0); f.length;) {
114
112
  let t = f.pop(), n = f.pop(), r = f.pop(), i = f.pop(), a = f.pop(), o = f.pop(), s = f.pop(), c = f.pop(), p = f.pop();
115
- if (t >= L || V(p, c, s, o, a, i, r, n, u)) {
113
+ if (t >= z || H(p, c, s, o, a, i, r, n, u)) {
116
114
  this.strokeSegment(e, p, c, r, n, l, d);
117
115
  continue;
118
116
  }
@@ -138,106 +136,108 @@ var L = 12, R = .5, z = class {
138
136
  }
139
137
  }
140
138
  };
141
- function B(e, t, n, r, i, a, o, s, c) {
142
- if (!Number.isFinite(e) || !Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r)) return !1;
143
- let l = n - e, u = r - t, d = 0, f = 1;
144
- if (l == 0) {
145
- if (e < i || e > o) return !1;
146
- } else {
147
- let t = (i - e) / l, n = (o - e) / l;
148
- d = Math.max(d, Math.min(t, n)), f = Math.min(f, Math.max(t, n));
149
- }
150
- if (u == 0) {
151
- if (t < a || t > s) return !1;
152
- } else {
153
- let e = (a - t) / u, n = (s - t) / u;
154
- d = Math.max(d, Math.min(e, n)), f = Math.min(f, Math.max(e, n));
155
- }
156
- return d > f ? !1 : (c[0] = e + d * l, c[1] = t + d * u, c[2] = e + f * l, c[3] = t + f * u, !0);
157
- }
158
- function V(e, t, n, r, i, a, o, s, c) {
139
+ function H(e, t, n, r, i, a, o, s, c) {
159
140
  let l = o - e, u = s - t, d = l * l + u * u, f = c * c;
160
141
  if (d == 0) {
161
- let o = H(e, t, n, r), s = H(e, t, i, a);
142
+ let o = U(e, t, n, r), s = U(e, t, i, a);
162
143
  return Math.max(o, s) <= f;
163
144
  }
164
145
  let p = u * (n - e) - l * (r - t), m = u * (i - e) - l * (a - t);
165
146
  return Math.max(p * p, m * m) <= f * d;
166
147
  }
167
- function H(e, t, n, r) {
148
+ function U(e, t, n, r) {
168
149
  let i = n - e, a = r - t;
169
150
  return i * i + a * a;
170
151
  }
171
- function U(e, t, n) {
152
+ function W(e, t, n) {
172
153
  return Math.max(t, Math.min(n, e));
173
154
  }
174
155
  //#endregion
175
156
  //#region ../core/src/rendering/canvas2d/picking/renderers/index.js
176
- var W = 1;
177
- function G(e, t) {
157
+ var G = 1;
158
+ function K(e, t) {
178
159
  let n = e.getType();
179
- return n == "arrow" ? q(e, t) : n == "rect" ? J(e, t) : n == "point" ? oe(e, t) : n == "rule" || n == "tick" ? se(e, t) : n == "link" ? ce(e, t) : n == "text" ? le(e, t) : 0;
160
+ return n == "arrow" ? J(e, t) : n == "rect" ? oe(e, t) : n == "point" ? se(e, t) : n == "rule" || n == "tick" ? ce(e, t) : n == "link" ? le(e, t) : n == "text" ? ue(e, t) : 0;
180
161
  }
181
- function K(e) {
162
+ function q(e) {
182
163
  let t = e.getType();
183
164
  return t == "rect" || t == "arrow" || t == "point" || t == "rule" || t == "tick" || t == "link" || t == "text";
184
165
  }
185
- function q(e, t) {
186
- let n = e, r = y(n), i = Array(8).fill(0);
187
- return b(n, r, t, (e) => {
166
+ function J(e, t) {
167
+ let n = e, r = m(n), i = Array(8).fill(0);
168
+ return g(n, r, t, (e) => {
188
169
  let a = Y(n, e.datum), o = e.strokeWidth / 2;
189
- r.stem && t.rasterizer.strokeSegment(a, e.tail.x, e.tail.y, e.tip.x, e.tip.y, e.stemHalfWidth * 2 + e.strokeWidth), p(e, (n, r, s, c) => {
170
+ r.stem && t.rasterizer.strokeSegment(a, e.tail.x, e.tail.y, e.tip.x, e.tip.y, e.stemHalfWidth * 2 + e.strokeWidth), A(e, (n, r, s, c) => {
190
171
  let l = e.headHalfWidth + o, u = n + s.x * o, d = r + s.y * o, f = e.headRepeatFootprint + o, p = n - s.x * f, m = r - s.y * f;
191
- ue(i, u, d, p, m, c.x, c.y, l), t.rasterizer.fillConvexPolygon(a, i);
172
+ de(i, u, d, p, m, c.x, c.y, l), t.rasterizer.fillConvexPolygon(a, i);
192
173
  });
193
174
  });
194
175
  }
195
- function J(e, t) {
196
- let n = e;
197
- return re(n, T(n), t, (e) => t.rasterizer.fillRect(Y(n, e.datum), e.x, e.y, e.width, e.height));
198
- }
199
176
  function oe(e, t) {
200
- let n = e, r = k(n, n.properties.minPickingSize);
201
- return E(n, ee(n), t, (e) => t.rasterizer.fillSquare(Y(n, e.datum), e.x, e.y, Math.max(e.boundsRadius, r / 2)));
177
+ let n = e;
178
+ return te(n, re(n), t, (e) => t.rasterizer.fillRect(Y(n, e.datum), e.x, e.y, e.width, e.height));
202
179
  }
203
180
  function se(e, t) {
204
- let n = e;
205
- return w(n, ie(n), t, (e) => t.rasterizer.strokeSegment(Y(n, e.datum), e.x1, e.y1, e.x2, e.y2, Math.max(e.strokeWidth, W)));
181
+ let n = e, r = k(n, n.properties.minPickingSize);
182
+ return C(n, D(n), t, (e) => t.rasterizer.fillSquare(Y(n, e.datum), e.x, e.y, Math.max(e.boundsRadius, r / 2)));
206
183
  }
207
184
  function ce(e, t) {
208
- let n = e, r = k(n, n.properties.minPickingSize), i = x(n), a = A(n, i.shape);
209
- return ae(n, i, t, (e) => {
210
- let [i, o, s, c] = e.points, l = a && S(i, c, a);
211
- t.rasterizer.strokeCubic(Y(n, e.datum), i[0], i[1], o[0], o[1], s[0], s[1], c[0], c[1], Math.max(e.strokeWidth, r), void 0, l ? (e, t) => Math.abs(l.normalX * e + l.normalY * t - l.offset) < l.end : void 0);
185
+ let n = e, r = ie(n);
186
+ return T(n, r, t, (e) => {
187
+ let i = e.x2 - e.x1, a = e.y2 - e.y1, o = r.strokeCap === "square" && e.strokeWidth > 0 ? (e.size / 2 + e.strokeWidth) / Math.hypot(i, a) : 0;
188
+ t.rasterizer.strokeSegment(Y(n, e.datum), e.x1 - i * o, e.y1 - a * o, e.x2 + i * o, e.y2 + a * o, Math.max(e.size + 2 * e.strokeWidth, G));
212
189
  });
213
190
  }
214
191
  function le(e, t) {
215
- let n = e, r = t.textMetrics ?? n.unitView.context.textMetrics, i = r.requestFont(n.properties), a = D(r, n.properties);
216
- return te(n, C(n), {
192
+ let n = e, r = k(n, n.properties.minPickingSize), i = ae(n), a = S(n, i.shape);
193
+ return M(n, i, {
194
+ ...t,
195
+ minPickingSize: r
196
+ }, (e) => {
197
+ let { geometry: i } = e;
198
+ if (i.type == "orthogonal") {
199
+ let [a, o, s] = i.points, c = Y(n, e.datum), l = Math.max(e.strokeWidth, r) / 2;
200
+ for (let e = 0; e < 2; e++) {
201
+ let n = i.points[e], r = i.points[e + 1], a = Math.abs(r[0] - n[0]), o = Math.abs(r[1] - n[1]);
202
+ (a != 0 || o != 0) && t.rasterizer.fillRect(c, Math.min(n[0], r[0]) - (a == 0 ? l : 0), Math.min(n[1], r[1]) - (o == 0 ? l : 0), a + (a == 0 ? 2 * l : 0), o + (o == 0 ? 2 * l : 0));
203
+ }
204
+ if ((a[0] != o[0] || a[1] != o[1]) && (s[0] != o[0] || s[1] != o[1])) {
205
+ let e = o[0] + l * (Math.sign(o[0] - a[0]) - Math.sign(s[0] - o[0])), n = o[1] + l * (Math.sign(o[1] - a[1]) - Math.sign(s[1] - o[1]));
206
+ t.rasterizer.fillRect(c, Math.min(o[0], e), Math.min(o[1], n), l, l);
207
+ }
208
+ return;
209
+ }
210
+ let [o, s, c, l] = i.points, u = a && j(o, l, a);
211
+ t.rasterizer.strokeCubic(Y(n, e.datum), o[0], o[1], s[0], s[1], c[0], c[1], l[0], l[1], Math.max(e.strokeWidth, r), void 0, u ? (e, t) => Math.abs(u.normalX * e + u.normalY * t - u.offset) < u.end : void 0);
212
+ });
213
+ }
214
+ function ue(e, t) {
215
+ let n = e, r = t.textMetrics ?? n.unitView.context.textMetrics, i = r.requestFont(n.properties), a = O(r, n.properties);
216
+ return ee(n, w(n), {
217
217
  ...t,
218
218
  fontMeasurement: i,
219
219
  measureLogoInkBounds: a
220
220
  }, (e) => t.rasterizer.fillConvexPolygon(Y(n, e.datum), e.boundsQuad));
221
221
  }
222
- function ue(e, t, n, r, i, a, o, s) {
222
+ function de(e, t, n, r, i, a, o, s) {
223
223
  let c = a * s, l = o * s;
224
224
  e[0] = t + c, e[1] = n + l, e[2] = r + c, e[3] = i + l, e[4] = r - c, e[5] = i - l, e[6] = t - c, e[7] = n - l;
225
225
  }
226
226
  function Y(e, t) {
227
227
  let n = e.encoders;
228
- return m(n.uniqueId, t);
228
+ return h(n.uniqueId, t);
229
229
  }
230
230
  //#endregion
231
231
  //#region ../core/src/rendering/canvas2d/picking/softwarePickingViewRenderingContext.js
232
- var de = class extends c {
232
+ var fe = class extends u {
233
233
  #e = [];
234
234
  #t = /* @__PURE__ */ new Set();
235
235
  #n;
236
- #r = new h();
236
+ #r = new v();
237
237
  #i;
238
238
  #a = [0, 0];
239
239
  constructor(e) {
240
- super({ picking: !0 }), this.width = e.width, this.height = e.height, this.devicePixelRatio = e.devicePixelRatio, this.getRasterizer = e.getRasterizer, this.textMetrics = e.textMetrics, this.#n = u(), this.#i = e.xIndexManager;
240
+ super({ picking: !0 }), this.width = e.width, this.height = e.height, this.devicePixelRatio = e.devicePixelRatio, this.getRasterizer = e.getRasterizer, this.textMetrics = e.textMetrics, this.#n = d(), this.#i = e.xIndexManager;
241
241
  }
242
242
  getDevicePixelRatio() {
243
243
  return this.devicePixelRatio;
@@ -251,24 +251,24 @@ var de = class extends c {
251
251
  popView(e) {
252
252
  if (this.#e.pop()?.view !== e) throw Error("Unbalanced software picking view rendering context stack.");
253
253
  }
254
- renderMark(e, r) {
255
- if (!e.isPickingParticipant() || !K(e)) return;
256
- let i = r.sampleFacetRenderingOptions;
257
- if (i && !e.encoders.facetIndex && (this.#n?.addCount("canvasSampleFacetOccurrences"), !j(i))) {
254
+ renderMark(e, t) {
255
+ if (!e.isPickingParticipant() || !q(e)) return;
256
+ let i = t.sampleFacetRenderingOptions;
257
+ if (i && !e.encoders.facetIndex && (this.#n?.addCount("canvasSampleFacetOccurrences"), !N(i))) {
258
258
  this.#n?.addCount("canvasCulledSampleFacetOccurrences");
259
259
  return;
260
260
  }
261
261
  let a = e.unitView.getEffectiveOpacity();
262
262
  if (a <= 0) return;
263
- let s = this.currentCoords, c = t(r), l = n(c, e.properties.clip, s), u = _(this.width, this.height, l);
264
- if (!v(u)) return;
265
- let d = O(s, c, e.properties.cullByVisibleRange), f = this.#i?.prepare(e) ?? !1;
266
- g(e, r, s, this.#r, (t, n) => {
263
+ let s = this.currentCoords, c = n(t), l = r(c, e.properties.clip, s), u = b(this.width, this.height, l);
264
+ if (!_(u)) return;
265
+ let d = y(s, c, e.properties.cullByVisibleRange), f = this.#i?.prepare(e) ?? !1;
266
+ x(e, t, s, this.#r, (t, n) => {
267
267
  if (n.length == 0) return;
268
268
  let r = 0, i = n.length;
269
269
  if (f && this.#i.query(n, this.#a) && (r = this.#a[0], i = this.#a[1], r === i)) return;
270
270
  let o = this.getRasterizer();
271
- o.setClip(u.x1, u.y1, u.x2, u.y2), G(e, {
271
+ o.setClip(u.x1, u.y1, u.x2, u.y2), K(e, {
272
272
  rasterizer: o,
273
273
  coords: t,
274
274
  data: n,
@@ -282,15 +282,15 @@ var de = class extends c {
282
282
  }, (t) => o(`Canvas2D picking could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`));
283
283
  }
284
284
  get currentCoords() {
285
- let e = r(this.#e);
285
+ let e = a(this.#e);
286
286
  if (!e) throw Error("No current view in software picking rendering context.");
287
287
  return e.coords;
288
288
  }
289
- }, X = 2 ** 31 - 1, fe = -(2 ** 31);
290
- function pe(t, n, r, i = r) {
289
+ }, X = 2 ** 31 - 1, pe = -(2 ** 31);
290
+ function me(t, n, r, i = r) {
291
291
  let a = Array(t);
292
292
  a.fill(X);
293
- let o = fe, s = -Infinity, c = !1, l = Array(t);
293
+ let o = pe, s = -Infinity, c = !1, l = Array(t);
294
294
  l.fill(0);
295
295
  let u = n[0], d = (n[1] - n[0]) / t, f = (n, r) => {
296
296
  let i = (n - u) / d, a = Math.floor(i);
@@ -320,15 +320,7 @@ function pe(t, n, r, i = r) {
320
320
  return;
321
321
  }
322
322
  let u = r(e), d = i(e);
323
- if (!Number.isFinite(u) || !Number.isFinite(d)) {
324
- c = !0;
325
- return;
326
- }
327
- if (u < s) {
328
- c = !0;
329
- return;
330
- }
331
- if (d < u) {
323
+ if (!Number.isFinite(u) || !Number.isFinite(d) || u < s || d < u) {
332
324
  c = !0;
333
325
  return;
334
326
  }
@@ -349,28 +341,43 @@ function pe(t, n, r, i = r) {
349
341
  return p.getIndex = g, m.getIndex = g, r == i ? p : m;
350
342
  }
351
343
  //#endregion
344
+ //#region ../core/src/utils/forEachInBatch.js
345
+ var he = 0;
346
+ function ge(e, t) {
347
+ if (e.length > 1e4) Function("data", "visit", `
348
+ // batch loop ${he++}
349
+ for (let i = 0; i < data.length; i++) {
350
+ visit(data[i], i);
351
+ }
352
+ `)(e, t);
353
+ else for (let n = 0; n < e.length; n++) t(e[n], n);
354
+ }
355
+ //#endregion
352
356
  //#region ../core/src/rendering/xIndex/markXIndex.js
353
- function me(e, t, n = 0) {
357
+ function _e(e, t, n = 0) {
354
358
  if (!t.length) return;
355
- let r = pe(Math.min(256, Math.ceil(Math.sqrt(t.length))), e.indexDomain, e.xAccessor, e.x2Accessor);
356
- return t.forEach((e, t) => r(e, n + t, n + t + 1)), r.getIndex();
359
+ let r = me(Math.min(256, Math.ceil(Math.sqrt(t.length))), e.indexDomain, e.xAccessor, e.x2Accessor);
360
+ return ge(t, (e, t) => {
361
+ let i = n + t;
362
+ r(e, i, i + 1);
363
+ }), r.getIndex();
357
364
  }
358
- function he(e) {
359
- let t = e.encoders?.x, n = e.encoders?.x2;
360
- if (!t?.channelDef || !("buildIndex" in t.channelDef) || !t.channelDef.buildIndex || !t.scale || !a(t.scale.type) && !["index", "locus"].includes(t.scale.type) || t.branches.length !== 1) return;
361
- let r = e.getType();
362
- if (r !== "point" && r !== "rect") return;
363
- let o = i(t)?.asNumberAccessor();
365
+ function ve(e) {
366
+ let n = e.encoders?.x, r = e.encoders?.x2;
367
+ if (!n?.channelDef || !("buildIndex" in n.channelDef) || !n.channelDef.buildIndex || !n.scale || !i(n.scale.type) && !["index", "locus"].includes(n.scale.type) || n.branches.length !== 1) return;
368
+ let a = e.getType();
369
+ if (a === "point" && s(e, "x") || a !== "point" && a !== "rect") return;
370
+ let o = t(n)?.asNumberAccessor();
364
371
  if (!o) return;
365
- let s;
366
- if (n && (n.scale !== t.scale || n.branches.length !== 1 || (s = i(n)?.asNumberAccessor(), !s))) return;
367
- let c = e.unitView.getScaleResolution("x"), l = c?.zoomExtent;
368
- if (!(!c || !l || !Number.isFinite(l[0]) || !Number.isFinite(l[1]) || l[1] <= l[0])) return {
372
+ let c;
373
+ if (r && (r.scale !== n.scale || r.branches.length !== 1 || (c = t(r)?.asNumberAccessor(), !c))) return;
374
+ let l = e.unitView.getScaleResolution("x"), u = l?.zoomExtent;
375
+ if (!(!l || !u || !Number.isFinite(u[0]) || !Number.isFinite(u[1]) || u[1] <= u[0])) return {
369
376
  xAccessor: o,
370
- x2Accessor: s,
371
- scaleResolution: c,
372
- indexDomain: [l[0], l[1]],
373
- domainStartOffset: ["index", "locus"].includes(t.scale.type) ? -1 : 0
377
+ x2Accessor: c,
378
+ scaleResolution: l,
379
+ indexDomain: [u[0], u[1]],
380
+ domainStartOffset: ["index", "locus"].includes(n.scale.type) ? -1 : 0
374
381
  };
375
382
  }
376
383
  function Z(e, t) {
@@ -381,7 +388,7 @@ function Z(e, t) {
381
388
  }
382
389
  //#endregion
383
390
  //#region ../core/src/rendering/canvas2d/canvasXIndexManager.js
384
- var ge = class {
391
+ var ye = class {
385
392
  #e = /* @__PURE__ */ new WeakMap();
386
393
  #t = [0, 0];
387
394
  #n;
@@ -389,7 +396,7 @@ var ge = class {
389
396
  if (this.#n = void 0, e.encoders.facetIndex) return this.#r();
390
397
  let t = e.unitView.getCollector(), n = e.unitView.getScaleResolution("x"), r = n?.zoomExtent, i = this.#e.get(e);
391
398
  if (!i || i.collector !== t || i.dataRevision !== t.dataRevision || i.xEncoder !== e.encoders.x || i.x2Encoder !== e.encoders.x2 || i.xScaleResolution !== n || i.xIndexDomainStart !== r?.[0] || i.xIndexDomainEnd !== r?.[1]) {
392
- let a = he(e);
399
+ let a = ve(e);
393
400
  i = {
394
401
  collector: t,
395
402
  dataRevision: t.dataRevision,
@@ -408,16 +415,16 @@ var ge = class {
408
415
  query(e, t) {
409
416
  let n = this.#n;
410
417
  if (!n?.spec) throw Error("Canvas x-index query was not prepared.");
411
- f("canvasXIndexNativeItems", e.length);
418
+ p("canvasXIndexNativeItems", e.length);
412
419
  let r = n.batches.get(e);
413
- return r === void 0 && (r = me(n.spec, e) ?? null, n.batches.set(e, r), f("canvasXIndexBuilds"), r || f("canvasXIndexRejectedBuilds")), r ? (r(this.#t[0], this.#t[1], t), f("canvasXIndexQueries"), f("canvasXIndexCandidateItems", t[1] - t[0]), t[0] === t[1] && f("canvasXIndexEmptyRanges"), !0) : this.#r();
420
+ return r === void 0 && (r = _e(n.spec, e) ?? null, n.batches.set(e, r), p("canvasXIndexBuilds"), r || p("canvasXIndexRejectedBuilds")), r ? (r(this.#t[0], this.#t[1], t), p("canvasXIndexQueries"), p("canvasXIndexCandidateItems", t[1] - t[0]), t[0] === t[1] && p("canvasXIndexEmptyRanges"), !0) : this.#r();
414
421
  }
415
422
  #r() {
416
- return f("canvasXIndexFallbackQueries"), !1;
423
+ return p("canvasXIndexFallbackQueries"), !1;
417
424
  }
418
- }, _e = class {
425
+ }, be = class {
419
426
  constructor(e) {
420
- this.viewRoot = e.viewRoot, this.context = e.context, this.surface = e.surface, this.textMetrics = e.textMetrics, this.getBackground = e.getBackground, this.broadcast = e.broadcast, this.onLayoutComputed = e.onLayoutComputed, this.layoutResult = void 0, this.pickingRasterizer = void 0, this.dirtyPickingBuffer = !0, this.xIndexManager = new ge(), this.opacityLayers = [];
427
+ this.viewRoot = e.viewRoot, this.context = e.context, this.surface = e.surface, this.textMetrics = e.textMetrics, this.getBackground = e.getBackground, this.broadcast = e.broadcast, this.onLayoutComputed = e.onLayoutComputed, this.layoutResult = void 0, this.pickingRasterizer = void 0, this.dirtyPickingBuffer = !0, this.xIndexManager = new ye(), this.opacityLayers = [];
421
428
  }
422
429
  computeLayout() {
423
430
  this.broadcast("layout"), this.surface.invalidateSize();
@@ -437,10 +444,10 @@ var ge = class {
437
444
  if (!e) return;
438
445
  let t = this.surface.getLogicalCanvasSize();
439
446
  if (isNaN(t.width) || isNaN(t.height)) return;
440
- let n = u();
447
+ let n = d();
441
448
  n?.beginFrame("canvas");
442
449
  try {
443
- d("render", () => M({
450
+ f("render", () => P({
444
451
  layoutResult: e,
445
452
  context: this.context,
446
453
  width: t.width,
@@ -462,17 +469,17 @@ var ge = class {
462
469
  let t = this.surface.getLogicalCanvasSize();
463
470
  if (isNaN(t.width) || isNaN(t.height)) return;
464
471
  this.surface.clearPickingBuffer();
465
- let n = this.pickingRasterizer, r = !1, i = new de({
472
+ let n = this.pickingRasterizer, r = !1, i = new fe({
466
473
  width: t.width,
467
474
  height: t.height,
468
475
  devicePixelRatio: this.surface.getDevicePixelRatio(),
469
476
  textMetrics: this.textMetrics,
470
- getRasterizer: () => (n || (n = new z(this.surface.getPickingBuffer()), this.pickingRasterizer = n), r ||= (n.resetClip(), n.resetStatistics(), !0), n),
477
+ getRasterizer: () => (n || (n = new V(this.surface.getPickingBuffer()), this.pickingRasterizer = n), r ||= (n.resetClip(), n.resetStatistics(), !0), n),
471
478
  xIndexManager: this.xIndexManager
472
- }), a = u();
479
+ }), a = d();
473
480
  a?.beginFrame("canvas", "picking");
474
481
  try {
475
- d("picking", () => e.collectRenderCommands(i)), this.dirtyPickingBuffer = !1, r && ve(n, a);
482
+ f("picking", () => e.collectRenderCommands(i)), this.dirtyPickingBuffer = !1, r && xe(n, a);
476
483
  } finally {
477
484
  a?.endFrame();
478
485
  }
@@ -482,20 +489,20 @@ var ge = class {
482
489
  }
483
490
  #e() {
484
491
  let e = this.surface.getLogicalCanvasSize();
485
- if (!(isNaN(e.width) || isNaN(e.height))) return l(this.viewRoot, s.create(0, 0, e.width, e.height), {
492
+ if (!(isNaN(e.width) || isNaN(e.height))) return l(this.viewRoot, c.create(0, 0, e.width, e.height), {
486
493
  devicePixelRatio: this.surface.getDevicePixelRatio(),
487
494
  renderingOptions: { firstFacet: !0 }
488
495
  });
489
496
  }
490
497
  };
491
- function ve(e, t) {
498
+ function xe(e, t) {
492
499
  if (!t) return;
493
500
  let n = e.getStatistics();
494
501
  t.addCount("pickingRectangles", n.rectangles), t.addCount("pickingSquares", n.squares), t.addCount("pickingPolygons", n.polygons), t.addCount("pickingSegments", n.segments), t.addCount("pickingCubics", n.cubics), t.addCount("pickingSpans", n.spans);
495
502
  }
496
503
  //#endregion
497
504
  //#region ../core/src/rendering/canvas2d/picking/softwarePickingBuffer.js
498
- var Q = /* @__PURE__ */ new Uint32Array(), ye = class {
505
+ var Q = /* @__PURE__ */ new Uint32Array(), Se = class {
499
506
  #e = Q;
500
507
  width = 0;
501
508
  height = 0;
@@ -530,7 +537,7 @@ function $(e, t) {
530
537
  }
531
538
  //#endregion
532
539
  //#region ../core/src/rendering/canvas2d/canvas2DSurface.js
533
- var be = class {
540
+ var Ce = class {
534
541
  #e;
535
542
  #t;
536
543
  #n;
@@ -540,7 +547,7 @@ var be = class {
540
547
  if (!n) throw Error("Unable to initialize a Canvas2D rendering context.");
541
548
  this.canvas = t, this.context = n, e.container.appendChild(t);
542
549
  try {
543
- this.#e = new N(e.container, t, e.sizeSource, () => {
550
+ this.#e = new F(e.container, t, e.sizeSource, () => {
544
551
  this.#i() && e.onCanvasResize();
545
552
  }), this.#i();
546
553
  } catch (e) {
@@ -568,7 +575,7 @@ var be = class {
568
575
  getPickingBuffer() {
569
576
  if (this.#r) throw Error("Canvas2D surface has been finalized.");
570
577
  let e = this.getLogicalCanvasSize();
571
- return this.#n ??= new ye(e.width, e.height), this.#n;
578
+ return this.#n ??= new Se(e.width, e.height), this.#n;
572
579
  }
573
580
  clearPickingBuffer() {
574
581
  this.#n?.clear();
@@ -602,32 +609,32 @@ var be = class {
602
609
  };
603
610
  //#endregion
604
611
  //#region ../core/src/rendering/canvas2d/index.js
605
- function xe(e) {
606
- let t = new be(e), n = ne(e.container.ownerDocument);
612
+ function we(e) {
613
+ let t = new Ce(e), n = ne(e.container.ownerDocument);
607
614
  return {
608
615
  surface: t,
609
616
  textMetrics: n,
610
- createRenderCoordinator: (e) => new _e({
617
+ createRenderCoordinator: (e) => new be({
611
618
  ...e,
612
619
  surface: t,
613
620
  context: t.context,
614
621
  textMetrics: n
615
622
  }),
616
- exportCanvas: (e) => P({
623
+ exportCanvas: (e) => I({
617
624
  ...e,
618
625
  liveSize: t.getLogicalCanvasSize(),
619
626
  liveDevicePixelRatio: t.getDevicePixelRatio(),
620
627
  textMetrics: n
621
628
  }),
622
- exportRaster: (e) => F({
629
+ exportRaster: (e) => L({
623
630
  ...e,
624
631
  liveSize: t.getLogicalCanvasSize(),
625
632
  liveDevicePixelRatio: t.getDevicePixelRatio(),
626
633
  textMetrics: n
627
634
  }),
628
- rasterizeSvgRuns: (e) => I()(e),
635
+ rasterizeSvgRuns: (e) => R()(e),
629
636
  readPickingId: (e, n) => t.readPickingId(e, n)
630
637
  };
631
638
  }
632
639
  //#endregion
633
- export { xe as createCanvas2DRenderingBackend };
640
+ export { we as createCanvas2DRenderingBackend };