@genome-spy/app 0.85.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/README.md +28 -0
- package/dist/{agentApi-Cz0hCnVp.js → agentApi-BZ1JCo1N.js} +7174 -8484
- package/dist/agentApi.es.js +3312 -3575
- package/dist/agentShared.es.js +14 -13
- package/dist/canvas2d-B_PnIof-.js +620 -0
- package/dist/canvas2d-Cafq5v-N.js +620 -0
- package/dist/{arrayUtils-LJpQOu-U.js → clipOptions-D6eh9T-_.js} +1060 -634
- package/dist/{paramUtils-BYI4rwyL.js → clipOptions-H68pJyEZ.js} +940 -514
- package/dist/{debug-CgDtmspT.js → debug-BGzgZmyk.js} +8 -8
- package/dist/{debug-BvCZWumf.js → debug-UYKZLNh4.js} +8 -8
- package/dist/index.es.js +2983 -2916
- package/dist/index.js +2006 -1997
- package/dist/indexer-Di57GyxX.js +72 -0
- package/dist/indexer-o6Hpg4nN.js +72 -0
- package/dist/layoutResult-D50MSHXR.js +97 -0
- package/dist/nativeText-D9SoxpaD.js +934 -0
- package/dist/nativeText-DAjvkrzc.js +934 -0
- package/dist/performanceProfiler-CPLEjApa.js +20 -0
- package/dist/rasterExport-DzldLv6E.js +44 -0
- package/dist/rasterExport-IAbJwi8F.js +44 -0
- package/dist/rasterImage-B4rPLaW9.js +18 -0
- package/dist/rasterization-CFogVB3B.js +50 -0
- package/dist/rectangle-DKnrAmKs.js +142 -0
- package/dist/renderCanvas2D-BJ93Ptqj.js +277 -0
- package/dist/renderCanvas2D-yJ1IrDcX.js +277 -0
- package/dist/schema.json +11685 -4428
- package/dist/{svg-yFj875aX.js → svg-BRpl2Xub.js} +412 -449
- package/dist/{svg-CCu8kYy2.js → svg-DJuqHIyc.js} +399 -436
- package/dist/svgRasterizer-CGZQ5njV.js +40 -0
- package/dist/svgRasterizer-PAoqLn1j.js +40 -0
- package/dist/vega-scale-BGC53c22.js +2403 -0
- package/dist/vega-scale-DdW2NzQ3.js +2403 -0
- package/dist/viewError-BiR9VCgL.js +29 -0
- package/dist/{viewIdentityRegistry-BUdkK9zT.js → viewIdentityRegistry-D4p067HU.js} +1 -1
- package/dist/{viewIdentityRegistry-D3oPbN4O.js → viewIdentityRegistry-Dc2hXYsO.js} +1 -1
- package/dist/viewSelectors-DNXnGwEW.js +2015 -0
- package/dist/viewSelectors-DYYlOt91.js +2015 -0
- package/dist/viewUtils-EdhZTPrJ.js +6448 -0
- package/dist/webgl-C53DwzVT.js +4127 -0
- package/dist/webgl-CdgNFlJk.js +4127 -0
- package/package.json +7 -6
- package/dist/bmFontMetrics-CuNB-kNN.js +0 -31
- package/dist/canvas2d-DoAXEiF9.js +0 -309
- package/dist/canvas2d-f5jl4A5D.js +0 -310
- package/dist/clipOptions-gqdb3fvW.js +0 -43
- package/dist/color-W5zffv-z.js +0 -335
- package/dist/framebufferReadback-CCLOjStu.js +0 -148
- package/dist/framebufferReadback-THWwFqs8.js +0 -1994
- package/dist/nativeText-DMO8gLt7.js +0 -806
- package/dist/nativeText-m5AUINMq.js +0 -806
- package/dist/twgl-full.module-DB2UdP1k.js +0 -1849
- package/dist/viewRenderingContext-HtpqwS_x.js +0 -120
- package/dist/viewSelectors-DGCspRN3.js +0 -4198
- package/dist/viewSelectors-U5oLCLHV.js +0 -4195
- package/dist/viewUtils-Dg4RA40Q.js +0 -7503
- package/dist/warning-DRGdb6BF.js +0 -59
- package/dist/webgl-Ci6ZhCCf.js +0 -54
- package/dist/webgl-Dpz8a3TI.js +0 -53
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { Kt as e, a as t, o as n, s as r, u as i } from "./clipOptions-D6eh9T-_.js";
|
|
2
|
+
import { t as a } from "./warning-CpIIpk8e.js";
|
|
3
|
+
import { n as o } from "./layoutResult-D50MSHXR.js";
|
|
4
|
+
import { n as s } from "./performanceProfiler-CPLEjApa.js";
|
|
5
|
+
import { D as c, E as l, M as u, O as d, S as f, T as p, _ as m, a as h, b as g, c as _, d as v, f as y, g as b, h as x, i as S, j as C, k as w, l as T, m as E, n as D, o as O, p as k, r as A, s as j, t as M, u as N, v as P } from "./nativeText-D9SoxpaD.js";
|
|
6
|
+
//#region ../core/src/rendering/canvas2d/renderers/arrow.js
|
|
7
|
+
function F(e, t) {
|
|
8
|
+
let n = e, r = t.context, i = n.encoders, a = P(n);
|
|
9
|
+
r.lineJoin = "miter";
|
|
10
|
+
let o, s;
|
|
11
|
+
return g(n, a, t, (e) => {
|
|
12
|
+
e.headShapeFallback && t.warn(`Canvas2D rendered unsupported arrow headShape "${a.headShape}" as a triangle.`), r.beginPath();
|
|
13
|
+
for (let t of e.boundaryLoops) {
|
|
14
|
+
let e = t[0];
|
|
15
|
+
r.moveTo(e.x, e.y);
|
|
16
|
+
for (let e = 1; e < t.length; e++) r.lineTo(t[e].x, t[e].y);
|
|
17
|
+
r.closePath();
|
|
18
|
+
}
|
|
19
|
+
let n = l(i.fill(e.datum)), c = f(i.fillOpacity, e.datum) * t.viewOpacity;
|
|
20
|
+
n != "none" && c > 0 && (o != n && (r.fillStyle = n, o = n), r.globalAlpha = c, r.fill());
|
|
21
|
+
let u = l(i.stroke(e.datum)), d = f(i.strokeOpacity, e.datum) * t.viewOpacity;
|
|
22
|
+
u != "none" && d > 0 && e.strokeWidth > 0 && (s != u && (r.strokeStyle = u, s = u), r.globalAlpha = d, r.lineWidth = e.strokeWidth, r.stroke());
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region ../core/src/rendering/canvas2d/renderers/link.js
|
|
27
|
+
function I(t, n) {
|
|
28
|
+
let r = t, i = n.context, a = r.encoders, o = k(r), s = b(r, o.shape);
|
|
29
|
+
i.lineCap = "butt";
|
|
30
|
+
let c;
|
|
31
|
+
return E(r, o, n, (t) => {
|
|
32
|
+
let r = l(a.color(t.datum)), o = f(a.opacity, t.datum) * n.viewOpacity;
|
|
33
|
+
if (r == "none" || o <= 0 || t.strokeWidth <= 0) return;
|
|
34
|
+
let u = s(t.datum), d = u && m(t.points[0], t.points[3], u);
|
|
35
|
+
if (d) {
|
|
36
|
+
let { normalX: t, normalY: n, offset: a, start: o, end: s } = d, l = i.createLinearGradient(t * (a - s), n * (a - s), t * (a + s), n * (a + s)), u = e(r), f = u.opacity;
|
|
37
|
+
for (let e of x(o, s)) u.opacity = f * e.opacity, l.addColorStop(e.offset, u.formatRgb());
|
|
38
|
+
i.strokeStyle = l, c = void 0;
|
|
39
|
+
} else c != r && (i.strokeStyle = r, c = r);
|
|
40
|
+
i.globalAlpha = o, i.lineWidth = t.strokeWidth;
|
|
41
|
+
let [p, h, g, _] = t.points;
|
|
42
|
+
i.beginPath(), i.moveTo(p[0], p[1]), i.bezierCurveTo(h[0], h[1], g[0], g[1], _[0], _[1]), i.stroke();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region ../core/src/rendering/canvas2d/renderers/point.js
|
|
47
|
+
function L(e, t) {
|
|
48
|
+
let n = e;
|
|
49
|
+
p(n, n.properties.fillGradientStrength) && t.warn("Canvas2D ignored unsupported point property fillGradientStrength."), n.properties.geometricZoomBound && t.warn("Canvas2D ignored unsupported point property geometricZoomBound.");
|
|
50
|
+
let r = v(n), i = t.context, a = n.encoders, o, s;
|
|
51
|
+
return y(n, r, t, (e) => {
|
|
52
|
+
let n = e.datum, r = e.lineShape, c = l(a.fill(n)), u = f(a.fillOpacity, n) * t.viewOpacity, d = l(a.stroke(n)), p = f(a.strokeOpacity, n) * t.viewOpacity;
|
|
53
|
+
r && (d == "none" || p <= 0) && (d = c, p = u), i.beginPath();
|
|
54
|
+
let m = e.angle != 0 && e.shape != "circle";
|
|
55
|
+
m && (i.save(), i.translate(e.x, e.y), i.rotate(e.angle * Math.PI / 180));
|
|
56
|
+
let h = m ? 0 : e.x, g = m ? 0 : e.y, _ = !0;
|
|
57
|
+
if (e.shape == "circle") i.arc(h, g, e.geometryRadius, 0, Math.PI * 2);
|
|
58
|
+
else if (e.shape == "square") {
|
|
59
|
+
let t = e.geometryRadius * 2;
|
|
60
|
+
i.rect(h - e.geometryRadius, g - e.geometryRadius, t, t);
|
|
61
|
+
} else _ = N(e.shape, h, g, e.geometryRadius, i);
|
|
62
|
+
m && i.restore(), _ || (t.warn(`Canvas2D rendered unsupported point shape "${e.shape}" as a circle.`), i.arc(e.x, e.y, e.geometryRadius, 0, Math.PI * 2)), !r && c != "none" && u > 0 && (o != c && (i.fillStyle = c, o = c), R(i, u), i.fill()), d != "none" && p > 0 && e.strokeWidth > 0 && (r && i.lineCap != "butt" && (i.lineCap = "butt"), s != d && (i.strokeStyle = d, s = d), R(i, p), z(i, e.strokeWidth), i.stroke());
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function R(e, t) {
|
|
66
|
+
e.globalAlpha != t && (e.globalAlpha = t);
|
|
67
|
+
}
|
|
68
|
+
function z(e, t) {
|
|
69
|
+
e.lineWidth != t && (e.lineWidth = t);
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region ../core/src/rendering/canvas2d/renderers/rect.js
|
|
73
|
+
function B(e, t) {
|
|
74
|
+
let n = e, r = _(n);
|
|
75
|
+
r.hatch != "none" && t.warn("Canvas2D ignored unsupported rect hatch.");
|
|
76
|
+
let i = t.start ?? 0;
|
|
77
|
+
if (i === (t.end ?? t.data.length)) return 0;
|
|
78
|
+
let a = t.context, o = n.encoders, s, c, u = [
|
|
79
|
+
0,
|
|
80
|
+
0,
|
|
81
|
+
0,
|
|
82
|
+
0
|
|
83
|
+
], d = o.stroke.constant, p = o.strokeOpacity.constant, m = d ? l(o.stroke(t.data[i])) : "none", h = d && m == "none", g = !h && p ? f(o.strokeOpacity, t.data[i]) : 0;
|
|
84
|
+
return T(n, r, t, (e) => {
|
|
85
|
+
r.shadow.opacity > 0 && V(e, r.shadow, t, u);
|
|
86
|
+
let n = e.opacityFactor, i = e.fill != "none" && e.fillOpacity > 0, _ = d ? m : l(o.stroke(e.datum)), v = (p ? g : f(o.strokeOpacity, e.datum)) * t.viewOpacity * n, y = !h && _ != "none" && v > 0 && e.strokeWidth > 0, b = r.hasCornerRadii && (e.radii.topLeft != 0 || e.radii.topRight != 0 || e.radii.bottomRight != 0 || e.radii.bottomLeft != 0);
|
|
87
|
+
b && (i || y) && (u[0] = e.radii.topLeft, u[1] = e.radii.topRight, u[2] = e.radii.bottomRight, u[3] = e.radii.bottomLeft, a.beginPath(), a.roundRect(e.x, e.y, e.width, e.height, u)), i && (s != e.fill && (a.fillStyle = e.fill, s = e.fill), H(a, e.fillOpacity * n), b ? a.fill() : a.fillRect(e.x, e.y, e.width, e.height)), y && (c != _ && (a.strokeStyle = _, c = _), H(a, v), U(a, e.strokeWidth), b ? a.stroke() : a.strokeRect(e.x, e.y, e.width, e.height));
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function V(e, t, n, r) {
|
|
91
|
+
let { context: i, devicePixelRatio: a, visibleBounds: o } = n, s = e.strokeWidth / 2, c = e.x - s, l = e.y - s, u = e.width + s * 2, d = e.height + s * 2;
|
|
92
|
+
r[0] = e.radii.topLeft + s, r[1] = e.radii.topRight + s, r[2] = e.radii.bottomRight + s, r[3] = e.radii.bottomLeft + s, i.save();
|
|
93
|
+
try {
|
|
94
|
+
i.beginPath(), i.rect(o.x1, o.y1, o.x2 - o.x1, o.y2 - o.y1), i.roundRect(c, l, u, d, r), i.clip("evenodd"), i.shadowBlur = Math.max(t.blur / 2.5, .25) * 2 * a, i.shadowOffsetX = t.offsetX * a, i.shadowOffsetY = t.offsetY * a, i.shadowColor = t.color, i.globalAlpha = t.opacity * n.viewOpacity, i.fillStyle = "black", i.beginPath(), i.roundRect(c, l, u, d, r), i.fill();
|
|
95
|
+
} finally {
|
|
96
|
+
i.restore();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function H(e, t) {
|
|
100
|
+
e.globalAlpha != t && (e.globalAlpha = t);
|
|
101
|
+
}
|
|
102
|
+
function U(e, t) {
|
|
103
|
+
e.lineWidth != t && (e.lineWidth = t);
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region ../core/src/rendering/canvas2d/renderers/rule.js
|
|
107
|
+
function W(e, t) {
|
|
108
|
+
let n = e, r = t.context, i = n.encoders;
|
|
109
|
+
r.lineCap = p(n, n.properties.strokeCap), r.setLineDash(p(n, n.properties.strokeDash) ?? []), r.lineDashOffset = p(n, n.properties.strokeDashOffset);
|
|
110
|
+
let a;
|
|
111
|
+
return j(n, O(n), t, (e) => {
|
|
112
|
+
let n = l(i.color(e.datum)), o = f(i.opacity, e.datum) * t.viewOpacity;
|
|
113
|
+
n == "none" || o <= 0 || e.strokeWidth <= 0 || (a != n && (r.strokeStyle = n, a = n), r.globalAlpha = o, r.lineWidth = e.strokeWidth, r.beginPath(), r.moveTo(e.x1, e.y1), r.lineTo(e.x2, e.y2), r.stroke());
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region ../core/src/rendering/canvas2d/renderers/text.js
|
|
118
|
+
function G(e, t) {
|
|
119
|
+
let n = e, r = n.properties, i = S(n), a = t.context, o = n.encoders, s = M(r.font), c = `${r.fontStyle ?? "normal"} ${A(r.fontWeight ?? "normal")} `, u = i.baseline == "baseline" ? "alphabetic" : i.baseline;
|
|
120
|
+
[
|
|
121
|
+
r.viewportEdgeFadeWidthTop,
|
|
122
|
+
r.viewportEdgeFadeWidthRight,
|
|
123
|
+
r.viewportEdgeFadeWidthBottom,
|
|
124
|
+
r.viewportEdgeFadeWidthLeft
|
|
125
|
+
].some((e) => p(n, e) > 0) && t.warn("Canvas2D ignored unsupported text viewport edge fading.");
|
|
126
|
+
let d, m;
|
|
127
|
+
return i.logoLetters || (a.textAlign = i.align, a.textBaseline = u), h(n, i, t, (e) => {
|
|
128
|
+
e.multiCharacterLogo && t.warn("Canvas2D stretches multi-character logo text as a single glyph cell.");
|
|
129
|
+
let n = l(o.color(e.datum)), r = f(o.opacity, e.datum) * t.viewOpacity * e.fadeOpacity;
|
|
130
|
+
if (!(n == "none" || r <= 0)) if (d != n && (a.fillStyle = n, d = n), a.globalAlpha = r, m != e.size && (a.font = `${c}${e.size}px ${s}`, m = e.size), e.logoScale) {
|
|
131
|
+
a.save(), a.translate(e.x, e.y), a.rotate(e.angle * Math.PI / 180), a.translate(e.dx, e.dy);
|
|
132
|
+
let t = a.measureText(e.text).width;
|
|
133
|
+
a.scale(e.logoScale.width / t, e.logoScale.heightScale), a.textAlign = "center", a.textBaseline = "alphabetic", a.fillText(e.text, 0, D("middle", 1)), a.restore();
|
|
134
|
+
} else e.angle ? (a.save(), a.translate(e.x, e.y), a.rotate(e.angle * Math.PI / 180), a.fillText(e.text, e.dx, e.dy, e.width), a.restore()) : a.fillText(e.text, e.x + e.dx, e.y + e.dy, e.width);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region ../core/src/rendering/canvas2d/renderers/index.js
|
|
139
|
+
function K(e, t) {
|
|
140
|
+
return e.getType() == "arrow" ? F(e, t) : e.getType() == "link" ? I(e, t) : e.getType() == "rect" ? B(e, t) : e.getType() == "point" ? L(e, t) : e.getType() == "rule" || e.getType() == "tick" ? W(e, t) : e.getType() == "text" ? G(e, t) : (t.warn(`Canvas2D rendering is not implemented for mark type "${e.getType()}".`), 0);
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region ../core/src/rendering/sampleFacet.js
|
|
144
|
+
function q(e) {
|
|
145
|
+
let t = e.pixelToUnit, n = e.locSize.location * t, r = e.locSize.size * t;
|
|
146
|
+
return !(n > 1 || n + r < 0);
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region ../core/src/rendering/canvas2d/canvas2DViewRenderingContext.js
|
|
150
|
+
var J = 8, Y = 16777216, X = class extends o {
|
|
151
|
+
#e = [];
|
|
152
|
+
#t = /* @__PURE__ */ new WeakSet();
|
|
153
|
+
#n = /* @__PURE__ */ new WeakMap();
|
|
154
|
+
#r;
|
|
155
|
+
#i;
|
|
156
|
+
#a = new C();
|
|
157
|
+
#o;
|
|
158
|
+
#s = [0, 0];
|
|
159
|
+
#c;
|
|
160
|
+
#l;
|
|
161
|
+
#u = [];
|
|
162
|
+
constructor(e, t) {
|
|
163
|
+
if (super(e), this.context = t.context, this.width = t.width, this.height = t.height, this.devicePixelRatio = t.devicePixelRatio, this.paint = t.paint, this.#r = t.markPredicate ?? (() => !0), this.#i = s(), this.#o = t.xIndexManager, this.#l = t.opacityLayers ?? [], this.#c = {
|
|
164
|
+
x: 0,
|
|
165
|
+
y: 0,
|
|
166
|
+
width: this.context.canvas.width,
|
|
167
|
+
height: this.context.canvas.height
|
|
168
|
+
}, this.paint) {
|
|
169
|
+
let e = this.context;
|
|
170
|
+
e.resetTransform(), e.clearRect(0, 0, e.canvas.width, e.canvas.height), e.setTransform(this.devicePixelRatio, 0, 0, this.devicePixelRatio, 0, 0), e.globalAlpha = 1, e.globalCompositeOperation = "source-over", t.background != null && (e.fillStyle = t.background, e.fillRect(0, 0, this.width, this.height));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
getDevicePixelRatio() {
|
|
174
|
+
return this.devicePixelRatio;
|
|
175
|
+
}
|
|
176
|
+
pushView(e, n) {
|
|
177
|
+
this.paint && !this.#t.has(e) && (e.onBeforeRender(), this.#t.add(e));
|
|
178
|
+
let r = e.getOpacity();
|
|
179
|
+
if (this.paint && r > 0 && r !== 1) {
|
|
180
|
+
let r = t(e), i = Z(n, this.devicePixelRatio, this.#c, r), a = Q(this.#l, this.#u.length, i.width, i.height);
|
|
181
|
+
a.setTransform(this.devicePixelRatio, 0, 0, this.devicePixelRatio, -i.x, -i.y), this.#u.push({
|
|
182
|
+
context: this.context,
|
|
183
|
+
bounds: this.#c
|
|
184
|
+
}), this.context = a, this.#c = i;
|
|
185
|
+
}
|
|
186
|
+
this.#e.push({
|
|
187
|
+
view: e,
|
|
188
|
+
coords: n,
|
|
189
|
+
opacity: r
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
popView(e) {
|
|
193
|
+
let t = this.#e.pop();
|
|
194
|
+
if (t?.view !== e) throw Error("Unbalanced Canvas2D view rendering context stack.");
|
|
195
|
+
if (this.paint && t.opacity > 0 && t.opacity !== 1) {
|
|
196
|
+
let e = this.#u.pop();
|
|
197
|
+
if (!e) throw Error("Missing Canvas2D opacity parent target.");
|
|
198
|
+
let n = this.context.canvas, r = this.#c;
|
|
199
|
+
this.context = e.context, this.#c = e.bounds, this.context.save();
|
|
200
|
+
try {
|
|
201
|
+
this.context.globalAlpha = t.opacity, r.width && r.height && this.context.drawImage(n, r.x / this.devicePixelRatio, r.y / this.devicePixelRatio, r.width / this.devicePixelRatio, r.height / this.devicePixelRatio);
|
|
202
|
+
} finally {
|
|
203
|
+
this.context.restore();
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
renderMark(e, t) {
|
|
208
|
+
if (!this.paint || !this.#r(e)) return;
|
|
209
|
+
let i = this.#n.get(e.unitView);
|
|
210
|
+
if (i === void 0 && (i = e.unitView.getEffectiveOpacity(), this.#n.set(e.unitView, i)), i <= 0) return;
|
|
211
|
+
e.initializeRenderingRevisions(Object.keys(e.properties));
|
|
212
|
+
let o = t.sampleFacetRenderingOptions;
|
|
213
|
+
if (o && !e.encoders.facetIndex && (this.#i?.addCount("canvasSampleFacetOccurrences"), !q(o))) {
|
|
214
|
+
this.#i?.addCount("canvasCulledSampleFacetOccurrences");
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
let s = this.currentCoords, l = n(t), f = r(l, e.properties.clip, s), p = d(this.width, this.height, f);
|
|
218
|
+
if (!w(p)) return;
|
|
219
|
+
let m = c(s, l, e.properties.cullByVisibleRange), h = this.#o?.prepare(e) ?? !1, g = this.context;
|
|
220
|
+
if (g.save(), f) {
|
|
221
|
+
let e = f.rect.flatten(), t = f.clipX ? e.x : 0, n = f.clipY ? e.y : 0, r = f.clipX ? e.width : this.width, i = f.clipY ? e.height : this.height;
|
|
222
|
+
g.beginPath(), g.rect(t, n, r, i), g.clip();
|
|
223
|
+
}
|
|
224
|
+
try {
|
|
225
|
+
u(e, t, s, this.#a, (t, n) => {
|
|
226
|
+
let r = 0, i = n.length;
|
|
227
|
+
return h && this.#o.query(n, this.#s) && (r = this.#s[0], i = this.#s[1]), K(e, {
|
|
228
|
+
context: g,
|
|
229
|
+
devicePixelRatio: this.devicePixelRatio,
|
|
230
|
+
coords: t,
|
|
231
|
+
data: n,
|
|
232
|
+
start: r,
|
|
233
|
+
end: i,
|
|
234
|
+
visibleBounds: p,
|
|
235
|
+
anchorCullBounds: m,
|
|
236
|
+
viewOpacity: 1,
|
|
237
|
+
warn: (t) => a(`${t} View: ${e.unitView.getPathString()}`)
|
|
238
|
+
});
|
|
239
|
+
}, (t) => a(`Canvas2D could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`));
|
|
240
|
+
} finally {
|
|
241
|
+
g.restore();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
get currentCoords() {
|
|
245
|
+
let e = i(this.#e);
|
|
246
|
+
if (!e) throw Error("No current view in Canvas2D rendering context.");
|
|
247
|
+
return e.coords;
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
function Z(e, t, n, r) {
|
|
251
|
+
let i = n.x + n.width, a = n.y + n.height, o = r.clipX ? $(Math.floor(e.x * t), n.x, i) : n.x, s = r.clipY ? $(Math.floor(e.y * t), n.y, a) : n.y, c = r.clipX ? $(Math.ceil((e.x + e.width) * t), o, i) : i, l = r.clipY ? $(Math.ceil((e.y + e.height) * t), s, a) : a;
|
|
252
|
+
return {
|
|
253
|
+
x: o,
|
|
254
|
+
y: s,
|
|
255
|
+
width: c - o,
|
|
256
|
+
height: l - s
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
function Q(e, t, n, r) {
|
|
260
|
+
let i = n * r, a = e[t], o = e.reduce((e, n, r) => r === t ? e : e + n.canvas.width * n.canvas.height, 0), s = t < J && o + i <= Y;
|
|
261
|
+
if (!a || !s) {
|
|
262
|
+
if (a = document.createElement("canvas").getContext("2d"), !a) throw Error("Unable to create a Canvas2D view group.");
|
|
263
|
+
s && (e[t] = a);
|
|
264
|
+
}
|
|
265
|
+
return a.canvas.width != n || a.canvas.height != r ? (a.canvas.width = n, a.canvas.height = r) : (a.resetTransform(), a.clearRect(0, 0, n, r)), a.globalAlpha = 1, a.globalCompositeOperation = "source-over", a;
|
|
266
|
+
}
|
|
267
|
+
function $(e, t, n) {
|
|
268
|
+
return Math.min(n, Math.max(t, e));
|
|
269
|
+
}
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region ../core/src/rendering/canvas2d/renderCanvas2D.js
|
|
272
|
+
function ee(e) {
|
|
273
|
+
let t = new X({ picking: !1 }, e);
|
|
274
|
+
e.layoutResult.collectRenderCommands(t);
|
|
275
|
+
}
|
|
276
|
+
//#endregion
|
|
277
|
+
export { q as n, ee as t };
|