@genome-spy/app 0.86.0 → 0.87.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.
- package/dist/{agentApi-DgopQbMV.js → agentApi-BZ1JCo1N.js} +6994 -6499
- package/dist/agentApi.es.js +3057 -3225
- package/dist/agentShared.es.js +7 -7
- package/dist/{canvas2d-8uxuN_vx.js → canvas2d-B_PnIof-.js} +108 -107
- package/dist/{canvas2d-BtQC7Xr8.js → canvas2d-Cafq5v-N.js} +128 -127
- package/dist/{clipOptions-taFzEljc.js → clipOptions-D6eh9T-_.js} +1508 -1166
- package/dist/{clipOptions-BQfNhxgP.js → clipOptions-H68pJyEZ.js} +1496 -1114
- package/dist/{debug-D_VtWQ6l.js → debug-BGzgZmyk.js} +2 -2
- package/dist/{debug-Bzc3SoRg.js → debug-UYKZLNh4.js} +2 -2
- package/dist/index.es.js +96 -106
- package/dist/index.js +399 -392
- package/dist/{indexer-qy_dq5l5.js → indexer-Di57GyxX.js} +1 -1
- package/dist/{indexer-qiFctgR3.js → indexer-o6Hpg4nN.js} +1 -1
- package/dist/nativeText-D9SoxpaD.js +934 -0
- package/dist/nativeText-DAjvkrzc.js +934 -0
- package/dist/{rasterExport-B8pVoOsj.js → rasterExport-DzldLv6E.js} +1 -1
- package/dist/{rasterExport-C4r4xjQT.js → rasterExport-IAbJwi8F.js} +1 -1
- package/dist/{renderCanvas2D-BQrRWp2Z.js → renderCanvas2D-BJ93Ptqj.js} +102 -96
- package/dist/{renderCanvas2D-CHVNfIUz.js → renderCanvas2D-yJ1IrDcX.js} +103 -97
- package/dist/schema.json +10169 -2852
- package/dist/{svg-C-Sw6E6G.js → svg-BRpl2Xub.js} +338 -384
- package/dist/{svg-CKHwwKRt.js → svg-DJuqHIyc.js} +353 -399
- package/dist/{svgRasterizer-BgD72AmG.js → svgRasterizer-CGZQ5njV.js} +1 -1
- package/dist/{svgRasterizer-BgSNqI3L.js → svgRasterizer-PAoqLn1j.js} +1 -1
- package/dist/{vega-scale-D46-iCaL.js → vega-scale-BGC53c22.js} +887 -1184
- package/dist/{vega-scale-CK0_al6O.js → vega-scale-DdW2NzQ3.js} +898 -1195
- package/dist/{viewIdentityRegistry-CDtVktJD.js → viewIdentityRegistry-D4p067HU.js} +1 -1
- package/dist/{viewIdentityRegistry-B-VGlez1.js → viewIdentityRegistry-Dc2hXYsO.js} +1 -1
- package/dist/{viewSelectors-CKfxF_LM.js → viewSelectors-DNXnGwEW.js} +519 -321
- package/dist/{viewSelectors-D_imtq5Z.js → viewSelectors-DYYlOt91.js} +584 -386
- package/dist/{viewUtils-nCJ7AoaI.js → viewUtils-EdhZTPrJ.js} +2930 -2264
- package/dist/{webgl-BaA3jSa2.js → webgl-C53DwzVT.js} +427 -428
- package/dist/{webgl-FP-4EsBL.js → webgl-CdgNFlJk.js} +639 -640
- package/package.json +5 -5
- package/dist/nativeText-DFV5XIx8.js +0 -860
- package/dist/nativeText-vT3AWE14.js +0 -860
package/dist/agentShared.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-DF993M8W.js";
|
|
2
|
-
import {
|
|
3
|
-
import { C as h, i as g, m as _, o as v, t as y } from "./viewSelectors-
|
|
4
|
-
import { y as b } from "./vega-scale-
|
|
2
|
+
import { $ as t, F as n, H as r, I as i, L as a, N as o, P as s, Q as c, R as l, V as u, et as d, o as f, r as p, z as m } from "./viewUtils-EdhZTPrJ.js";
|
|
3
|
+
import { C as h, i as g, m as _, o as v, t as y } from "./viewSelectors-DNXnGwEW.js";
|
|
4
|
+
import { y as b } from "./vega-scale-DdW2NzQ3.js";
|
|
5
5
|
import { n as x, t as S } from "./componentStyles-FsNmIb22.js";
|
|
6
6
|
//#region src/viewScopeUtils.js
|
|
7
7
|
function C(e, t) {
|
|
@@ -193,7 +193,7 @@ function ce({ viewSelector: e, field: t, selectionSelector: n, aggregation: r, f
|
|
|
193
193
|
}
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
var le =
|
|
196
|
+
var le = d({
|
|
197
197
|
name: "paramProvenance",
|
|
198
198
|
initialState: { entries: {} },
|
|
199
199
|
reducers: {
|
|
@@ -4734,10 +4734,10 @@ function qn(e) {
|
|
|
4734
4734
|
//#endregion
|
|
4735
4735
|
//#region src/agentShared/index.js
|
|
4736
4736
|
function Jn(e) {
|
|
4737
|
-
if (e.startsWith("sampleView/")) return
|
|
4737
|
+
if (e.startsWith("sampleView/")) return u.actions[e.slice(11)];
|
|
4738
4738
|
if (e.startsWith("paramProvenance/")) return le.actions[e.slice(16)];
|
|
4739
|
-
if (e.startsWith("viewSettings/")) return
|
|
4739
|
+
if (e.startsWith("viewSettings/")) return t.actions[e.slice(13)];
|
|
4740
4740
|
throw Error("Unsupported app actionType " + e + ".");
|
|
4741
4741
|
}
|
|
4742
4742
|
//#endregion
|
|
4743
|
-
export {
|
|
4743
|
+
export { o as addValueColors, n as buildCategoricalCountsSummary, i as buildCategoricalFieldSummary, a as buildQuantitativeFieldSummary, ce as buildSelectionAggregationAttributeIdentifier, l as buildTopCategorySummary, se as createSelectionAggregationCandidateId, S as faStyles, x as formStyles, r as formatAggregationExpression, C as formatScopedParamName, Jn as getActionCreator, s as getConcreteColorScale, P as getContextMenuFieldInfos, D as isBaselineAction, c as makeViewSelectorKey, Kn as safeMarkdown, T as serializeBookmarkableParamValue, m as templateResultToString };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { _ as e, at as t, o as n, s as r, u as i } from "./clipOptions-
|
|
2
|
-
import { v as a } from "./vega-scale-
|
|
1
|
+
import { _ as e, at as t, o as n, s as r, u as i } from "./clipOptions-D6eh9T-_.js";
|
|
2
|
+
import { v as a } from "./vega-scale-DdW2NzQ3.js";
|
|
3
3
|
import { t as o } from "./rectangle-DKnrAmKs.js";
|
|
4
4
|
import { t as s } from "./warning-CpIIpk8e.js";
|
|
5
5
|
import { n as c, t as l } from "./layoutResult-D50MSHXR.js";
|
|
6
6
|
import { n as u, r as d, t as f } from "./performanceProfiler-CPLEjApa.js";
|
|
7
|
-
import {
|
|
8
|
-
import { n as
|
|
9
|
-
import { t as
|
|
10
|
-
import { exportCanvas as
|
|
11
|
-
import { createCanvas2DSvgRasterizer as
|
|
7
|
+
import { D as p, M as m, O as h, S as g, T as _, _ as v, a as y, c as b, d as x, f as S, g as C, i as w, j as T, k as E, l as D, m as O, o as ee, p as te, s as ne, v as re, x as ie, y as k } from "./nativeText-D9SoxpaD.js";
|
|
8
|
+
import { n as A, t as j } from "./renderCanvas2D-yJ1IrDcX.js";
|
|
9
|
+
import { t as M } from "./canvasSizeHelper-7h_8rOcx.js";
|
|
10
|
+
import { exportCanvas as N, exportRaster as P } from "./rasterExport-DzldLv6E.js";
|
|
11
|
+
import { createCanvas2DSvgRasterizer as F } from "./svgRasterizer-CGZQ5njV.js";
|
|
12
12
|
//#region ../core/src/rendering/canvas2d/picking/softwarePickingRasterizer.js
|
|
13
|
-
var
|
|
13
|
+
var I = 12, L = .5, R = class {
|
|
14
14
|
#e = [];
|
|
15
15
|
#t = [];
|
|
16
16
|
#n = [
|
|
@@ -50,7 +50,7 @@ var P = 12, F = .5, I = class {
|
|
|
50
50
|
}
|
|
51
51
|
setClip(e, t, n, r) {
|
|
52
52
|
if (!Number.isFinite(e) || !Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r)) throw RangeError("Software picking clip must be finite.");
|
|
53
|
-
this.#r =
|
|
53
|
+
this.#r = H(Math.floor(Math.min(e, n)), 0, this.buffer.width), this.#i = H(Math.floor(Math.min(t, r)), 0, this.buffer.height), this.#a = H(Math.ceil(Math.max(e, n)), this.#r, this.buffer.width), this.#o = H(Math.ceil(Math.max(t, r)), this.#i, this.buffer.height);
|
|
54
54
|
}
|
|
55
55
|
fillRect(e, t, n, r, i) {
|
|
56
56
|
this.#s++, this.#p(e, t, n, r, i);
|
|
@@ -91,33 +91,33 @@ var P = 12, F = .5, I = class {
|
|
|
91
91
|
let s = t.length - 2;
|
|
92
92
|
for (let n = 0; n < t.length; n += 2) this.strokeSegment(e, t[s], t[s + 1], t[n], t[n + 1], 1), s = n;
|
|
93
93
|
}
|
|
94
|
-
strokeSegment(e, t, n, r, i, a) {
|
|
94
|
+
strokeSegment(e, t, n, r, i, a, o) {
|
|
95
95
|
if (!(a > 0) || !Number.isFinite(a)) return;
|
|
96
96
|
this.#u++;
|
|
97
|
-
let
|
|
98
|
-
if (!
|
|
99
|
-
let
|
|
100
|
-
if (
|
|
101
|
-
this.#h(e,
|
|
97
|
+
let s = a / 2, c = this.#n;
|
|
98
|
+
if (!z(t, n, r, i, this.#r - s, this.#i - s, this.#a + s, this.#o + s, c)) return;
|
|
99
|
+
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
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
for (let t = 0; t <=
|
|
105
|
-
let n = t /
|
|
106
|
-
this.#h(e,
|
|
104
|
+
for (let t = 0; t <= d; t++) {
|
|
105
|
+
let n = t / d;
|
|
106
|
+
this.#h(e, c[0] + l * n, c[1] + u * n, s, o);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
strokeCubic(e, t, n, r, i, a, o, s, c, l, u =
|
|
109
|
+
strokeCubic(e, t, n, r, i, a, o, s, c, l, u = L, d) {
|
|
110
110
|
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
111
|
this.#d++;
|
|
112
|
-
let
|
|
113
|
-
for (
|
|
114
|
-
let t =
|
|
115
|
-
if (t >=
|
|
116
|
-
this.strokeSegment(e,
|
|
112
|
+
let f = this.#e;
|
|
113
|
+
for (f.length = 0, f.push(t, n, r, i, a, o, s, c, 0); f.length;) {
|
|
114
|
+
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 >= I || B(p, c, s, o, a, i, r, n, u)) {
|
|
116
|
+
this.strokeSegment(e, p, c, r, n, l, d);
|
|
117
117
|
continue;
|
|
118
118
|
}
|
|
119
|
-
let
|
|
120
|
-
|
|
119
|
+
let m = (p + s) / 2, h = (c + o) / 2, g = (s + a) / 2, _ = (o + i) / 2, v = (a + r) / 2, y = (i + n) / 2, b = (m + g) / 2, x = (h + _) / 2, S = (g + v) / 2, C = (_ + y) / 2, w = (b + S) / 2, T = (x + C) / 2, E = t + 1;
|
|
120
|
+
f.push(w, T, S, C, v, y, r, n, E, p, c, m, h, b, x, w, T, E);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
#m(e, t, n, r) {
|
|
@@ -125,19 +125,20 @@ var P = 12, F = .5, I = class {
|
|
|
125
125
|
let i = t * this.buffer.width;
|
|
126
126
|
this.buffer.ids.fill(e >>> 0, i + n, i + r);
|
|
127
127
|
}
|
|
128
|
-
#h(e, t, n, r) {
|
|
129
|
-
let
|
|
130
|
-
if (
|
|
131
|
-
let
|
|
132
|
-
for (let e =
|
|
128
|
+
#h(e, t, n, r, i) {
|
|
129
|
+
let a = Math.max(this.#r, Math.floor(t - r)), o = Math.max(this.#i, Math.floor(n - r)), s = Math.min(this.#a, Math.ceil(t + r)), c = Math.min(this.#o, Math.ceil(n + r));
|
|
130
|
+
if (a >= s || o >= c) return;
|
|
131
|
+
let l = e >>> 0, u = this.buffer.ids, d = this.buffer.width, f = s - a;
|
|
132
|
+
for (let e = o; e < c; e++) {
|
|
133
133
|
this.#f++;
|
|
134
|
-
let t = e *
|
|
135
|
-
if (
|
|
136
|
-
else
|
|
134
|
+
let t = e * d + a, n = t + f;
|
|
135
|
+
if (i) for (let t = a; t < s; t++) i(t + .5, e + .5) && (u[e * d + t] = l);
|
|
136
|
+
else if (f > 16) u.fill(l, t, n);
|
|
137
|
+
else for (let e = t; e < n; e++) u[e] = l;
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
140
|
};
|
|
140
|
-
function
|
|
141
|
+
function z(e, t, n, r, i, a, o, s, c) {
|
|
141
142
|
if (!Number.isFinite(e) || !Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r)) return !1;
|
|
142
143
|
let l = n - e, u = r - t, d = 0, f = 1;
|
|
143
144
|
if (l == 0) {
|
|
@@ -154,81 +155,81 @@ function L(e, t, n, r, i, a, o, s, c) {
|
|
|
154
155
|
}
|
|
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);
|
|
156
157
|
}
|
|
157
|
-
function
|
|
158
|
+
function B(e, t, n, r, i, a, o, s, c) {
|
|
158
159
|
let l = o - e, u = s - t, d = l * l + u * u, f = c * c;
|
|
159
160
|
if (d == 0) {
|
|
160
|
-
let o =
|
|
161
|
+
let o = V(e, t, n, r), s = V(e, t, i, a);
|
|
161
162
|
return Math.max(o, s) <= f;
|
|
162
163
|
}
|
|
163
164
|
let p = u * (n - e) - l * (r - t), m = u * (i - e) - l * (a - t);
|
|
164
165
|
return Math.max(p * p, m * m) <= f * d;
|
|
165
166
|
}
|
|
166
|
-
function
|
|
167
|
+
function V(e, t, n, r) {
|
|
167
168
|
let i = n - e, a = r - t;
|
|
168
169
|
return i * i + a * a;
|
|
169
170
|
}
|
|
170
|
-
function
|
|
171
|
+
function H(e, t, n) {
|
|
171
172
|
return Math.max(t, Math.min(n, e));
|
|
172
173
|
}
|
|
173
174
|
//#endregion
|
|
174
175
|
//#region ../core/src/rendering/canvas2d/picking/renderers/index.js
|
|
175
|
-
var
|
|
176
|
-
function
|
|
176
|
+
var U = 1;
|
|
177
|
+
function W(e, t) {
|
|
177
178
|
let n = e.getType();
|
|
178
|
-
return n == "arrow" ?
|
|
179
|
+
return n == "arrow" ? K(e, t) : n == "rect" ? q(e, t) : n == "point" ? J(e, t) : n == "rule" || n == "tick" ? ae(e, t) : n == "link" ? oe(e, t) : n == "text" ? se(e, t) : 0;
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
+
function G(e) {
|
|
181
182
|
let t = e.getType();
|
|
182
183
|
return t == "rect" || t == "arrow" || t == "point" || t == "rule" || t == "tick" || t == "link" || t == "text";
|
|
183
184
|
}
|
|
184
|
-
function
|
|
185
|
-
let n = e, r =
|
|
186
|
-
return
|
|
185
|
+
function K(e, t) {
|
|
186
|
+
let n = e, r = re(n), i = Array(8).fill(0);
|
|
187
|
+
return ie(n, r, t, (e) => {
|
|
187
188
|
let a = Y(n, e.datum), o = e.strokeWidth / 2;
|
|
188
|
-
r.stem && t.rasterizer.strokeSegment(a, e.tail.x, e.tail.y, e.tip.x, e.tip.y, e.stemHalfWidth * 2 + e.strokeWidth),
|
|
189
|
+
r.stem && t.rasterizer.strokeSegment(a, e.tail.x, e.tail.y, e.tip.x, e.tip.y, e.stemHalfWidth * 2 + e.strokeWidth), k(e, (n, r) => {
|
|
189
190
|
let s = e.headHalfWidth + o, c = n + e.tangent.x * o, l = r + e.tangent.y * o, u = e.headRepeatFootprint + o, d = n - e.tangent.x * u, f = r - e.tangent.y * u;
|
|
190
|
-
|
|
191
|
+
ce(i, c, l, d, f, e.normal.x, e.normal.y, s), t.rasterizer.fillConvexPolygon(a, i);
|
|
191
192
|
});
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
+
function q(e, t) {
|
|
195
196
|
let n = e;
|
|
196
|
-
return
|
|
197
|
+
return D(n, b(n), t, (e) => t.rasterizer.fillRect(Y(n, e.datum), e.x, e.y, e.width, e.height));
|
|
197
198
|
}
|
|
198
|
-
function
|
|
199
|
-
let n = e, r =
|
|
200
|
-
return
|
|
199
|
+
function J(e, t) {
|
|
200
|
+
let n = e, r = _(n, n.properties.minPickingSize);
|
|
201
|
+
return S(n, x(n), t, (e) => t.rasterizer.fillSquare(Y(n, e.datum), e.x, e.y, Math.max(e.boundsRadius, r / 2)));
|
|
201
202
|
}
|
|
202
|
-
function
|
|
203
|
+
function ae(e, t) {
|
|
203
204
|
let n = e;
|
|
204
|
-
return
|
|
205
|
+
return ne(n, ee(n), t, (e) => t.rasterizer.strokeSegment(Y(n, e.datum), e.x1, e.y1, e.x2, e.y2, Math.max(e.strokeWidth, U)));
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
-
let n = e, r =
|
|
208
|
-
return
|
|
209
|
-
let [i,
|
|
210
|
-
t.rasterizer.strokeCubic(Y(n, e.datum), i[0], i[1],
|
|
207
|
+
function oe(e, t) {
|
|
208
|
+
let n = e, r = _(n, n.properties.minPickingSize), i = te(n), a = C(n, i.shape);
|
|
209
|
+
return O(n, i, t, (e) => {
|
|
210
|
+
let [i, o, s, c] = e.points, l = a(e.datum), u = l && v(i, c, l);
|
|
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, u ? (e, t) => Math.abs(u.normalX * e + u.normalY * t - u.offset) < u.end : void 0);
|
|
211
212
|
});
|
|
212
213
|
}
|
|
213
|
-
function
|
|
214
|
+
function se(e, t) {
|
|
214
215
|
let n = e;
|
|
215
|
-
return
|
|
216
|
+
return y(n, w(n), t, (e) => t.rasterizer.fillConvexPolygon(Y(n, e.datum), e.boundsQuad));
|
|
216
217
|
}
|
|
217
|
-
function
|
|
218
|
+
function ce(e, t, n, r, i, a, o, s) {
|
|
218
219
|
let c = a * s, l = o * s;
|
|
219
220
|
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;
|
|
220
221
|
}
|
|
221
222
|
function Y(e, t) {
|
|
222
223
|
let n = e.encoders;
|
|
223
|
-
return
|
|
224
|
+
return g(n.uniqueId, t);
|
|
224
225
|
}
|
|
225
226
|
//#endregion
|
|
226
227
|
//#region ../core/src/rendering/canvas2d/picking/softwarePickingViewRenderingContext.js
|
|
227
|
-
var
|
|
228
|
+
var le = class extends c {
|
|
228
229
|
#e = [];
|
|
229
230
|
#t = /* @__PURE__ */ new Set();
|
|
230
231
|
#n;
|
|
231
|
-
#r = new
|
|
232
|
+
#r = new T();
|
|
232
233
|
#i;
|
|
233
234
|
#a = [0, 0];
|
|
234
235
|
constructor(e) {
|
|
@@ -247,23 +248,23 @@ var se = class extends c {
|
|
|
247
248
|
if (this.#e.pop()?.view !== e) throw Error("Unbalanced software picking view rendering context stack.");
|
|
248
249
|
}
|
|
249
250
|
renderMark(e, t) {
|
|
250
|
-
if (!e.isPickingParticipant() || !
|
|
251
|
+
if (!e.isPickingParticipant() || !G(e)) return;
|
|
251
252
|
let i = t.sampleFacetRenderingOptions;
|
|
252
|
-
if (i && !e.encoders.facetIndex && (this.#n?.addCount("canvasSampleFacetOccurrences"), !
|
|
253
|
+
if (i && !e.encoders.facetIndex && (this.#n?.addCount("canvasSampleFacetOccurrences"), !A(i))) {
|
|
253
254
|
this.#n?.addCount("canvasCulledSampleFacetOccurrences");
|
|
254
255
|
return;
|
|
255
256
|
}
|
|
256
257
|
let a = e.unitView.getEffectiveOpacity();
|
|
257
258
|
if (a <= 0) return;
|
|
258
|
-
let o = this.currentCoords, c = n(t), l = r(c, e.properties.clip, o), u =
|
|
259
|
-
if (!
|
|
260
|
-
let d =
|
|
261
|
-
|
|
259
|
+
let o = this.currentCoords, c = n(t), l = r(c, e.properties.clip, o), u = h(this.width, this.height, l);
|
|
260
|
+
if (!E(u)) return;
|
|
261
|
+
let d = p(o, c, e.properties.cullByVisibleRange), f = this.#i?.prepare(e) ?? !1;
|
|
262
|
+
m(e, t, o, this.#r, (t, n) => {
|
|
262
263
|
if (n.length == 0) return;
|
|
263
264
|
let r = 0, i = n.length;
|
|
264
265
|
if (f && this.#i.query(n, this.#a) && (r = this.#a[0], i = this.#a[1], r === i)) return;
|
|
265
266
|
let o = this.getRasterizer();
|
|
266
|
-
o.setClip(u.x1, u.y1, u.x2, u.y2),
|
|
267
|
+
o.setClip(u.x1, u.y1, u.x2, u.y2), W(e, {
|
|
267
268
|
rasterizer: o,
|
|
268
269
|
coords: t,
|
|
269
270
|
data: n,
|
|
@@ -280,11 +281,11 @@ var se = class extends c {
|
|
|
280
281
|
if (!e) throw Error("No current view in software picking rendering context.");
|
|
281
282
|
return e.coords;
|
|
282
283
|
}
|
|
283
|
-
}, X = 2 ** 31 - 1,
|
|
284
|
-
function
|
|
284
|
+
}, X = 2 ** 31 - 1, ue = -(2 ** 31);
|
|
285
|
+
function de(e, n, r, i = r) {
|
|
285
286
|
let a = Array(e);
|
|
286
287
|
a.fill(X);
|
|
287
|
-
let o =
|
|
288
|
+
let o = ue, s = -Infinity, c = !1, l = Array(e);
|
|
288
289
|
l.fill(0);
|
|
289
290
|
let u = n[0], d = (n[1] - n[0]) / e, f = (n, r) => {
|
|
290
291
|
let i = (n - u) / d, a = Math.floor(i);
|
|
@@ -342,12 +343,12 @@ function le(e, n, r, i = r) {
|
|
|
342
343
|
}
|
|
343
344
|
//#endregion
|
|
344
345
|
//#region ../core/src/rendering/xIndex/markXIndex.js
|
|
345
|
-
function
|
|
346
|
+
function fe(e, t, n = 0) {
|
|
346
347
|
if (!t.length) return;
|
|
347
|
-
let r =
|
|
348
|
+
let r = de(Math.min(256, Math.ceil(Math.sqrt(t.length))), e.indexDomain, e.xAccessor, e.x2Accessor);
|
|
348
349
|
return t.forEach((e, t) => r(e, n + t, n + t + 1)), r.getIndex();
|
|
349
350
|
}
|
|
350
|
-
function
|
|
351
|
+
function pe(t) {
|
|
351
352
|
let n = t.encoders?.x, r = t.encoders?.x2;
|
|
352
353
|
if (!n?.channelDef || !("buildIndex" in n.channelDef) || !n.channelDef.buildIndex || !n.scale || !a(n.scale.type) && !["index", "locus"].includes(n.scale.type) || n.branches.length !== 1) return;
|
|
353
354
|
let i = t.getType();
|
|
@@ -365,7 +366,7 @@ function de(t) {
|
|
|
365
366
|
domainStartOffset: ["index", "locus"].includes(n.scale.type) ? -1 : 0
|
|
366
367
|
};
|
|
367
368
|
}
|
|
368
|
-
function
|
|
369
|
+
function me(e, t) {
|
|
369
370
|
let n = e.scaleResolution.getScale().domain();
|
|
370
371
|
if (n.length !== 2 || !Number.isFinite(n[0]) || !Number.isFinite(n[1]) || n[1] <= n[0]) return !1;
|
|
371
372
|
let r = n[1] - n[0];
|
|
@@ -373,7 +374,7 @@ function fe(e, t) {
|
|
|
373
374
|
}
|
|
374
375
|
//#endregion
|
|
375
376
|
//#region ../core/src/rendering/canvas2d/canvasXIndexManager.js
|
|
376
|
-
var
|
|
377
|
+
var he = class {
|
|
377
378
|
#e = /* @__PURE__ */ new WeakMap();
|
|
378
379
|
#t = [0, 0];
|
|
379
380
|
#n;
|
|
@@ -381,7 +382,7 @@ var pe = class {
|
|
|
381
382
|
if (this.#n = void 0, e.encoders.facetIndex) return this.#r();
|
|
382
383
|
let t = e.unitView.getCollector(), n = e.unitView.getScaleResolution("x"), r = n?.zoomExtent, i = this.#e.get(e);
|
|
383
384
|
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]) {
|
|
384
|
-
let a =
|
|
385
|
+
let a = pe(e);
|
|
385
386
|
i = {
|
|
386
387
|
collector: t,
|
|
387
388
|
dataRevision: t.dataRevision,
|
|
@@ -395,21 +396,21 @@ var pe = class {
|
|
|
395
396
|
}, this.#e.set(e, i);
|
|
396
397
|
}
|
|
397
398
|
let a = i.spec;
|
|
398
|
-
return !a || !
|
|
399
|
+
return !a || !me(a, this.#t) ? this.#r() : (this.#n = i, !0);
|
|
399
400
|
}
|
|
400
401
|
query(e, t) {
|
|
401
402
|
let n = this.#n;
|
|
402
403
|
if (!n?.spec) throw Error("Canvas x-index query was not prepared.");
|
|
403
404
|
f("canvasXIndexNativeItems", e.length);
|
|
404
405
|
let r = n.batches.get(e);
|
|
405
|
-
return r === void 0 && (r =
|
|
406
|
+
return r === void 0 && (r = fe(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();
|
|
406
407
|
}
|
|
407
408
|
#r() {
|
|
408
409
|
return f("canvasXIndexFallbackQueries"), !1;
|
|
409
410
|
}
|
|
410
|
-
},
|
|
411
|
+
}, Z = class {
|
|
411
412
|
constructor(e) {
|
|
412
|
-
this.viewRoot = e.viewRoot, this.context = e.context, this.surface = e.surface, 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
|
|
413
|
+
this.viewRoot = e.viewRoot, this.context = e.context, this.surface = e.surface, 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 he(), this.opacityLayers = [];
|
|
413
414
|
}
|
|
414
415
|
computeLayout() {
|
|
415
416
|
this.broadcast("layout"), this.surface.invalidateSize();
|
|
@@ -432,7 +433,7 @@ var pe = class {
|
|
|
432
433
|
let n = u();
|
|
433
434
|
n?.beginFrame("canvas");
|
|
434
435
|
try {
|
|
435
|
-
d("render", () =>
|
|
436
|
+
d("render", () => j({
|
|
436
437
|
layoutResult: e,
|
|
437
438
|
context: this.context,
|
|
438
439
|
width: t.width,
|
|
@@ -453,16 +454,16 @@ var pe = class {
|
|
|
453
454
|
let t = this.surface.getLogicalCanvasSize();
|
|
454
455
|
if (isNaN(t.width) || isNaN(t.height)) return;
|
|
455
456
|
this.surface.clearPickingBuffer();
|
|
456
|
-
let n = this.pickingRasterizer, r = !1, i = new
|
|
457
|
+
let n = this.pickingRasterizer, r = !1, i = new le({
|
|
457
458
|
width: t.width,
|
|
458
459
|
height: t.height,
|
|
459
460
|
devicePixelRatio: this.surface.getDevicePixelRatio(),
|
|
460
|
-
getRasterizer: () => (n || (n = new
|
|
461
|
+
getRasterizer: () => (n || (n = new R(this.surface.getPickingBuffer()), this.pickingRasterizer = n), r ||= (n.resetClip(), n.resetStatistics(), !0), n),
|
|
461
462
|
xIndexManager: this.xIndexManager
|
|
462
463
|
}), a = u();
|
|
463
464
|
a?.beginFrame("canvas", "picking");
|
|
464
465
|
try {
|
|
465
|
-
d("picking", () => e.collectRenderCommands(i)), this.dirtyPickingBuffer = !1, r &&
|
|
466
|
+
d("picking", () => e.collectRenderCommands(i)), this.dirtyPickingBuffer = !1, r && ge(n, a);
|
|
466
467
|
} finally {
|
|
467
468
|
a?.endFrame();
|
|
468
469
|
}
|
|
@@ -478,15 +479,15 @@ var pe = class {
|
|
|
478
479
|
});
|
|
479
480
|
}
|
|
480
481
|
};
|
|
481
|
-
function
|
|
482
|
+
function ge(e, t) {
|
|
482
483
|
if (!t) return;
|
|
483
484
|
let n = e.getStatistics();
|
|
484
485
|
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);
|
|
485
486
|
}
|
|
486
487
|
//#endregion
|
|
487
488
|
//#region ../core/src/rendering/canvas2d/picking/softwarePickingBuffer.js
|
|
488
|
-
var
|
|
489
|
-
#e =
|
|
489
|
+
var Q = /* @__PURE__ */ new Uint32Array(), _e = class {
|
|
490
|
+
#e = Q;
|
|
490
491
|
width = 0;
|
|
491
492
|
height = 0;
|
|
492
493
|
constructor(e = 0, t = 0) {
|
|
@@ -496,11 +497,11 @@ var Z = /* @__PURE__ */ new Uint32Array(), ge = class {
|
|
|
496
497
|
return this.#e;
|
|
497
498
|
}
|
|
498
499
|
resize(e, t) {
|
|
499
|
-
let n =
|
|
500
|
+
let n = $(e, "width"), r = $(t, "height");
|
|
500
501
|
if (n == this.width && r == this.height) return !1;
|
|
501
502
|
let i = n * r;
|
|
502
503
|
if (!Number.isSafeInteger(i)) throw RangeError("Software picking buffer is too large.");
|
|
503
|
-
return this.width = n, this.height = r, this.#e = i ? new Uint32Array(i) :
|
|
504
|
+
return this.width = n, this.height = r, this.#e = i ? new Uint32Array(i) : Q, !0;
|
|
504
505
|
}
|
|
505
506
|
clear() {
|
|
506
507
|
this.#e.fill(0);
|
|
@@ -511,16 +512,16 @@ var Z = /* @__PURE__ */ new Uint32Array(), ge = class {
|
|
|
511
512
|
return n < 0 || r < 0 || n >= this.width || r >= this.height ? 0 : this.#e[r * this.width + n];
|
|
512
513
|
}
|
|
513
514
|
dispose() {
|
|
514
|
-
this.width = 0, this.height = 0, this.#e =
|
|
515
|
+
this.width = 0, this.height = 0, this.#e = Q;
|
|
515
516
|
}
|
|
516
517
|
};
|
|
517
|
-
function
|
|
518
|
+
function $(e, t) {
|
|
518
519
|
if (!Number.isFinite(e) || e < 0) throw RangeError(`Software picking buffer ${t} must be a finite nonnegative number.`);
|
|
519
520
|
return Math.floor(e);
|
|
520
521
|
}
|
|
521
522
|
//#endregion
|
|
522
523
|
//#region ../core/src/rendering/canvas2d/canvas2DSurface.js
|
|
523
|
-
var
|
|
524
|
+
var ve = class {
|
|
524
525
|
#e;
|
|
525
526
|
#t;
|
|
526
527
|
#n;
|
|
@@ -530,7 +531,7 @@ var $ = class {
|
|
|
530
531
|
if (!n) throw Error("Unable to initialize a Canvas2D rendering context.");
|
|
531
532
|
this.canvas = t, this.context = n, e.container.appendChild(t);
|
|
532
533
|
try {
|
|
533
|
-
this.#e = new
|
|
534
|
+
this.#e = new M(e.container, t, e.sizeSource, () => {
|
|
534
535
|
this.#i() && e.onCanvasResize();
|
|
535
536
|
}), this.#i();
|
|
536
537
|
} catch (e) {
|
|
@@ -558,7 +559,7 @@ var $ = class {
|
|
|
558
559
|
getPickingBuffer() {
|
|
559
560
|
if (this.#r) throw Error("Canvas2D surface has been finalized.");
|
|
560
561
|
let e = this.getLogicalCanvasSize();
|
|
561
|
-
return this.#n ??= new
|
|
562
|
+
return this.#n ??= new _e(e.width, e.height), this.#n;
|
|
562
563
|
}
|
|
563
564
|
clearPickingBuffer() {
|
|
564
565
|
this.#n?.clear();
|
|
@@ -592,28 +593,28 @@ var $ = class {
|
|
|
592
593
|
};
|
|
593
594
|
//#endregion
|
|
594
595
|
//#region ../core/src/rendering/canvas2d/index.js
|
|
595
|
-
function
|
|
596
|
-
let t = new
|
|
596
|
+
function ye(e) {
|
|
597
|
+
let t = new ve(e);
|
|
597
598
|
return {
|
|
598
599
|
surface: t,
|
|
599
|
-
createRenderCoordinator: (e) => new
|
|
600
|
+
createRenderCoordinator: (e) => new Z({
|
|
600
601
|
...e,
|
|
601
602
|
surface: t,
|
|
602
603
|
context: t.context
|
|
603
604
|
}),
|
|
604
|
-
exportCanvas: (e) =>
|
|
605
|
+
exportCanvas: (e) => N({
|
|
605
606
|
...e,
|
|
606
607
|
liveSize: t.getLogicalCanvasSize(),
|
|
607
608
|
liveDevicePixelRatio: t.getDevicePixelRatio()
|
|
608
609
|
}),
|
|
609
|
-
exportRaster: (e) =>
|
|
610
|
+
exportRaster: (e) => P({
|
|
610
611
|
...e,
|
|
611
612
|
liveSize: t.getLogicalCanvasSize(),
|
|
612
613
|
liveDevicePixelRatio: t.getDevicePixelRatio()
|
|
613
614
|
}),
|
|
614
|
-
rasterizeSvgRuns: (e) =>
|
|
615
|
+
rasterizeSvgRuns: (e) => F()(e),
|
|
615
616
|
readPickingId: (e, n) => t.readPickingId(e, n)
|
|
616
617
|
};
|
|
617
618
|
}
|
|
618
619
|
//#endregion
|
|
619
|
-
export {
|
|
620
|
+
export { ye as createCanvas2DRenderingBackend };
|