@genome-spy/app 1.2.0 → 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.
- package/dist/{SharedReadCache-Ey5QIiPM.js → SharedReadCache-9sT2aIxW.js} +6 -12
- package/dist/__vite-browser-external-Dgu_Ldik.js +7 -0
- package/dist/{agentApi-8hMSlqAQ.js → agentApi-BclFF9zB.js} +7130 -7509
- package/dist/agentApi.es.js +4344 -4015
- package/dist/agentShared.es.js +431 -458
- package/dist/arrayUtils-Bm7QnzhN.js +1306 -0
- package/dist/{blosc-JROzDOnd.js → blosc-C-W97QwH.js} +3 -3
- package/dist/{canvas2d-Bd8H8MMo.js → canvas2d-8MSf70d4.js} +78 -86
- package/dist/{canvas2d-D6VYooRf.js → canvas2d-BwGNI_Rx.js} +83 -91
- package/dist/clipOptions-SrrxeAEU.js +4316 -0
- package/dist/clipOptions-clBEbkjv.js +4326 -0
- package/dist/{layoutResult-D50MSHXR.js → color-jETn8xK_.js} +29 -10
- package/dist/color-uTRRsy8i.js +116 -0
- package/dist/{componentStyles-DGtQXvwc.js → componentStyles-C7FbjS-a.js} +1 -1
- package/dist/{containerView-aEVmYmkA.js → containerView-BItRtKqu.js} +5 -1
- package/dist/{containerView-CRJSc4bM.js → containerView-CWa6ZIJW.js} +5 -1
- package/dist/{debug-CQ0agCrd.js → debug-23s-jja_.js} +3 -2
- package/dist/{debug-DkIMiGdW.js → debug-CWRxvAss.js} +2 -3
- package/dist/dialog.es.js +1 -1
- package/dist/dist-CmY6iewb.js +1501 -0
- package/dist/dist-D6xbz5Ks.js +1501 -0
- package/dist/{esm-CjkeZi__.js → esm-BFwBAnbO.js} +25 -25
- package/dist/esm-BUkWqSr2.js +299 -0
- package/dist/{esm-C-6g-SkZ.js → esm-C0xXMLsR.js} +37 -41
- package/dist/{esm-CJeszW-t.js → esm-C2xhhXs0.js} +7 -7
- package/dist/esm-C6erfjPM.js +252 -0
- package/dist/{esm-DFHFX1sH.js → esm-CVjC7qA4.js} +34 -38
- package/dist/esm-CqY5ezGz.js +1249 -0
- package/dist/esm-DfMIJ_N2.js +1522 -0
- package/dist/esm-Dls41IbZ.js +787 -0
- package/dist/{esm-Bv7Frz7C.js → esm-DzQDfrsZ.js} +7 -10
- package/dist/esm-aGLCvYRP.js +238 -0
- package/dist/{esm-VFJeyk9i.js → esm-nzwgJFGz.js} +40 -36
- package/dist/figWigMetadataSourceAdapter-8Kf_vZRf.js +36 -0
- package/dist/figWigMetadataSourceAdapter-DdDMZpYO.js +36 -0
- package/dist/flowNode-BSjy0Wz3.js +1306 -0
- package/dist/flowOutput-D5qpxWe0.js +183 -0
- package/dist/index.es.js +4756 -5528
- package/dist/index.js +707 -547
- package/dist/inflate-BdC5KvHn.js +886 -0
- package/dist/{lz4-CUYSbVey.js → lz4-BLPgBOlE.js} +1 -1
- package/dist/{markUtils-CvLDz744.js → markUtils-RaatLEa-.js} +9 -6
- package/dist/metadataUtils-DxEPe0vj.js +879 -0
- package/dist/{order-BVvkjDRT.js → order-BnKzKjt4.js} +383 -347
- package/dist/{order-DmMoZsi1.js → order-BpJnq_nV.js} +375 -339
- package/dist/{parquetRead-0hFIa3Cc.js → parquetRead-D-yY8njE.js} +3 -11
- package/dist/{rasterExport-jeRVq6kY.js → rasterExport-B-WrX1pa.js} +5 -5
- package/dist/{rasterExport-DxvowWjH.js → rasterExport-C_vx4Jwd.js} +3 -3
- package/dist/{rasterization-DFj3Cvx4.js → rasterization-QktH8Sn2.js} +1 -1
- package/dist/{rectangle-Dl4Dy0hS.js → rectangle-BAdoDPXu.js} +34 -31
- package/dist/{renderCanvas2D-Bfm1NHFu.js → renderCanvas2D-CsRO78Pq.js} +88 -87
- package/dist/{renderCanvas2D-DVjhp834.js → renderCanvas2D-Y7pkRzbC.js} +93 -92
- package/dist/{rolldown-runtime-DF993M8W.js → rolldown-runtime-DeIk2rA4.js} +1 -1
- package/dist/{indexer-DOYMJ-Md.js → scaleNull-CVzag4z8.js} +2 -12
- package/dist/{indexer-DDC0YRGn.js → scaleNull-Pbz7QGnl.js} +2 -12
- package/dist/{scalePosition-0aeqp_kz.js → scalePosition-CRXa0rCC.js} +1 -1
- package/dist/schema.json +3801 -816
- package/dist/{svg-Bm2zxBPu.js → svg-BBMtLgtM.js} +369 -285
- package/dist/{svg-CkfuhONt.js → svg-JjWL6U-T.js} +371 -287
- package/dist/{svgRasterizer-DoRQEqFA.js → svgRasterizer-6OcftuoI.js} +2 -2
- package/dist/{svgRasterizer-raDDhBF-.js → svgRasterizer-DkNRaCPs.js} +4 -4
- package/dist/tableMetadataSourceAdapter-CUNwLsdi.js +291 -0
- package/dist/tableMetadataSourceAdapter-DQrEXCo6.js +1283 -0
- package/dist/url-DeOdSRrv.js +183 -0
- package/dist/{viewError-BkJeVYXA.js → viewError-B0TMfOpB.js} +1 -1
- package/dist/{viewError-IYqyluc7.js → viewError-D9aO90cI.js} +1 -1
- package/dist/{viewSelectors-7LyasQN-.js → viewSelectors-DkFvo33d.js} +832 -734
- package/dist/{viewSelectors-CbmkSQRT.js → viewSelectors-lM93fHAq.js} +900 -802
- package/dist/{viewUtils-DuddMNNw.js → viewUtils-0SJOewM6.js} +1861 -2459
- package/dist/webgl-CXIO3OQz.js +5782 -0
- package/dist/webgl-Pdvfhio5.js +5783 -0
- package/package.json +7 -5
- package/src/agentApi/index.d.ts +3 -2
- package/src/agentShared/index.d.ts +2 -0
- package/src/appTypes.d.ts +1 -6
- package/src/embedTypes.d.ts +36 -1
- package/src/index.d.ts +6 -0
- package/src/spec/sampleView.d.ts +68 -13
- package/src/state/paramProvenanceTypes.d.ts +25 -2
- package/src/state.d.ts +14 -52
- package/dist/clipOptions-DElJ8dTZ.js +0 -3097
- package/dist/clipOptions-D_wBNhzs.js +0 -3087
- package/dist/esm-Dndm-NaA.js +0 -1193
- package/dist/vega-scale-BoGHANI7.js +0 -2446
- package/dist/vega-scale-o9TRyzYH.js +0 -2443
- package/dist/webgl-CQfvgnxo.js +0 -5633
- package/dist/webgl-DVYkXtiZ.js +0 -5632
|
@@ -394,11 +394,7 @@ function _e(e, t) {
|
|
|
394
394
|
}
|
|
395
395
|
for (let t = 1; t < e.length; t++) {
|
|
396
396
|
let { logical_type: r, name: i, num_children: a, type: o } = e[t];
|
|
397
|
-
|
|
398
|
-
t += a;
|
|
399
|
-
continue;
|
|
400
|
-
}
|
|
401
|
-
o === "BYTE_ARRAY" && !r && (e[t].logical_type = n.get(i));
|
|
397
|
+
a ? t += a : o === "BYTE_ARRAY" && !r && (e[t].logical_type = n.get(i));
|
|
402
398
|
}
|
|
403
399
|
}
|
|
404
400
|
//#endregion
|
|
@@ -1188,9 +1184,7 @@ function K(e, t, n, r = 0) {
|
|
|
1188
1184
|
let l = s.path.join("."), u = e.get(l);
|
|
1189
1185
|
if (!u) throw Error("parquet list column missing values");
|
|
1190
1186
|
a && q(u, r), e.set(i, u), e.delete(l);
|
|
1191
|
-
|
|
1192
|
-
}
|
|
1193
|
-
if (re(t)) {
|
|
1187
|
+
} else if (re(t)) {
|
|
1194
1188
|
let s = t.children[0].element.name;
|
|
1195
1189
|
K(e, t.children[0].children[0], n, o + 1), K(e, t.children[0].children[1], n, o + 1);
|
|
1196
1190
|
let c = e.get(`${i}.${s}.key`), l = e.get(`${i}.${s}.value`);
|
|
@@ -1199,9 +1193,7 @@ function K(e, t, n, r = 0) {
|
|
|
1199
1193
|
if (c.length !== l.length) throw Error("parquet map column key/value length mismatch");
|
|
1200
1194
|
let u = st(c, l, o);
|
|
1201
1195
|
a && q(u, r), e.delete(`${i}.${s}.key`), e.delete(`${i}.${s}.value`), e.set(i, u);
|
|
1202
|
-
|
|
1203
|
-
}
|
|
1204
|
-
if (t.children.length) {
|
|
1196
|
+
} else if (t.children.length) {
|
|
1205
1197
|
let o = t.element.repetition_type === "REQUIRED" ? r : r + 1, s = {};
|
|
1206
1198
|
for (let r of t.children) {
|
|
1207
1199
|
K(e, r, n, o);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as e } from "./rasterization-
|
|
2
|
-
import { t } from "./rectangle-
|
|
3
|
-
import {
|
|
4
|
-
import { r } from "./order-
|
|
5
|
-
import { t as i } from "./renderCanvas2D-
|
|
1
|
+
import { t as e } from "./rasterization-QktH8Sn2.js";
|
|
2
|
+
import { t } from "./rectangle-BAdoDPXu.js";
|
|
3
|
+
import { n } from "./color-uTRRsy8i.js";
|
|
4
|
+
import { r } from "./order-BpJnq_nV.js";
|
|
5
|
+
import { t as i } from "./renderCanvas2D-CsRO78Pq.js";
|
|
6
6
|
//#region ../core/src/rendering/canvas2d/rasterExport.js
|
|
7
7
|
async function a(e) {
|
|
8
8
|
let t = e.mimeType ?? "image/png";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./rasterization-CFogVB3B.js";
|
|
2
2
|
import { t } from "./rectangle-DZTR6NFQ.js";
|
|
3
|
-
import {
|
|
4
|
-
import { r } from "./order-
|
|
5
|
-
import { t as i } from "./renderCanvas2D-
|
|
3
|
+
import { n } from "./color-jETn8xK_.js";
|
|
4
|
+
import { r } from "./order-BnKzKjt4.js";
|
|
5
|
+
import { t as i } from "./renderCanvas2D-Y7pkRzbC.js";
|
|
6
6
|
//#region ../core/src/rendering/canvas2d/rasterExport.js
|
|
7
7
|
async function a(e) {
|
|
8
8
|
let t = e.mimeType ?? "image/png";
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _t as e, c as t, jt as n, u as r, ut as i, vt as a } from "./clipOptions-clBEbkjv.js";
|
|
2
2
|
//#region ../core/src/marks/markUtils.js
|
|
3
3
|
var o = Symbol("half-open interval peer");
|
|
4
4
|
function s(e) {
|
|
5
5
|
return e?.[o];
|
|
6
6
|
}
|
|
7
|
-
function c(
|
|
8
|
-
let
|
|
9
|
-
s && c && ["index", "locus"].includes(s.type) && (
|
|
10
|
-
...
|
|
11
|
-
[o]:
|
|
12
|
-
}),
|
|
13
|
-
...
|
|
14
|
-
[o]:
|
|
7
|
+
function c(t, n) {
|
|
8
|
+
let a = e(n), s = i(t[n]), c = i(t[a]);
|
|
9
|
+
s && c && ["index", "locus"].includes(s.type) && (t[n] = r(t[n], {
|
|
10
|
+
...t[n],
|
|
11
|
+
[o]: a
|
|
12
|
+
}), t[a] = r(t[a], {
|
|
13
|
+
...t[a],
|
|
14
|
+
[o]: n
|
|
15
15
|
}));
|
|
16
16
|
}
|
|
17
17
|
function l(t) {
|
|
18
18
|
for (let r of ["x", "y"]) {
|
|
19
|
-
let a =
|
|
20
|
-
if (o && s &&
|
|
19
|
+
let a = e(r), o = t[r], s = t[a];
|
|
20
|
+
if (o && s && n(o) && !i(o) && i(s)) throw Error(`Cannot combine encoding.${r}.value with scale-backed encoding.${a}. Use encoding.${r}.datum for a constant data-domain endpoint, or use encoding.${a}.value for a visual-domain endpoint.`);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
function u(t, i, o = !1) {
|
|
24
|
-
let s =
|
|
24
|
+
let s = e(i);
|
|
25
25
|
c(t, i);
|
|
26
|
-
let l = t[i] &&
|
|
27
|
-
if (!(
|
|
26
|
+
let l = t[i] && r(t[i], { ...t[i] }), u = t[s] && r(t[s], { ...t[s] });
|
|
27
|
+
if (!(n(l) || n(u))) {
|
|
28
28
|
if (l) {
|
|
29
|
-
if (!
|
|
29
|
+
if (!a(t[i])) return;
|
|
30
30
|
if (!u) {
|
|
31
31
|
if (l.type == "quantitative") u = {
|
|
32
32
|
datum: 0,
|
|
33
33
|
domainInert: !0
|
|
34
34
|
};
|
|
35
35
|
else {
|
|
36
|
-
u =
|
|
36
|
+
u = r(l, { ...l });
|
|
37
37
|
let e = (1 - (l.band ?? 1)) / 2;
|
|
38
38
|
l.band = 0 + e, u.band = o ? l.band : 1 - e;
|
|
39
39
|
}
|
|
@@ -47,13 +47,13 @@ function u(t, i, o = !1) {
|
|
|
47
47
|
}
|
|
48
48
|
function d(t, i) {
|
|
49
49
|
c(t, i);
|
|
50
|
-
let o =
|
|
51
|
-
if (!s || !l ||
|
|
50
|
+
let o = e(i), s = t[i], l = t[o];
|
|
51
|
+
if (!s || !l || n(s) || n(l) || !a(s) || !a(l) || !["index", "locus"].includes(s.type)) return;
|
|
52
52
|
let u = s.band, d = l.band, f = u ?? d ?? 0;
|
|
53
|
-
t[i] =
|
|
53
|
+
t[i] = r(s, {
|
|
54
54
|
...s,
|
|
55
55
|
band: f
|
|
56
|
-
}), t[o] =
|
|
56
|
+
}), t[o] = r(l, {
|
|
57
57
|
...l,
|
|
58
58
|
band: d ?? f
|
|
59
59
|
});
|
|
@@ -62,23 +62,26 @@ function f(e, t) {
|
|
|
62
62
|
let n = i(e);
|
|
63
63
|
n && (n.resolutionChannel = t);
|
|
64
64
|
}
|
|
65
|
-
function p(
|
|
66
|
-
n
|
|
65
|
+
function p(e, n) {
|
|
66
|
+
e[n] = t(e.color), f(e[n], "color");
|
|
67
67
|
}
|
|
68
|
-
function m(
|
|
69
|
-
e
|
|
68
|
+
function m(e, r) {
|
|
69
|
+
e.stroke || (r ? e.stroke = { value: null } : p(e, "stroke")), n(e.stroke) && e.stroke.value === null && (e.strokeWidth = { value: 0 }), e.strokeOpacity || (e.strokeOpacity = t(e.opacity), f(e.strokeOpacity, "opacity"));
|
|
70
70
|
}
|
|
71
|
-
function h(e,
|
|
71
|
+
function h(e, r) {
|
|
72
|
+
n(e.fill) && e.fill.value === null ? e.fillOpacity = { value: 0 } : e.fill || (p(e, "fill"), !r && !e.fillOpacity && (e.fillOpacity = { value: 0 })), e.fillOpacity || (r ? (e.fillOpacity = t(e.opacity), f(e.fillOpacity, "opacity")) : e.fillOpacity = { value: 0 });
|
|
73
|
+
}
|
|
74
|
+
function g(e, t) {
|
|
72
75
|
return e.properties.clamp === !0 || e.properties.clamp === t;
|
|
73
76
|
}
|
|
74
77
|
//#endregion
|
|
75
78
|
//#region ../core/src/view/layout/rectangle.js
|
|
76
|
-
function
|
|
79
|
+
function _(e) {
|
|
77
80
|
return () => e;
|
|
78
81
|
}
|
|
79
|
-
var
|
|
82
|
+
var v = class e {
|
|
80
83
|
static create(t, n, r, i) {
|
|
81
|
-
return new e(
|
|
84
|
+
return new e(_(t), _(n), _(r), _(i));
|
|
82
85
|
}
|
|
83
86
|
static unionAll(t) {
|
|
84
87
|
if (!t.length) return;
|
|
@@ -130,7 +133,7 @@ var _ = class e {
|
|
|
130
133
|
if (!Object.keys(t).length) return this;
|
|
131
134
|
let n = (e) => {
|
|
132
135
|
let n = t[e];
|
|
133
|
-
return typeof n == "number" ?
|
|
136
|
+
return typeof n == "number" ? _(n) : typeof n == "function" ? n : this._passThrough(e);
|
|
134
137
|
};
|
|
135
138
|
return new e(n("x"), n("y"), n("width"), n("height"));
|
|
136
139
|
}
|
|
@@ -162,7 +165,7 @@ var _ = class e {
|
|
|
162
165
|
return this.width >= 0 && this.height >= 0;
|
|
163
166
|
}
|
|
164
167
|
flatten() {
|
|
165
|
-
return new e(
|
|
168
|
+
return new e(_(this.x), _(this.y), _(this.width), _(this.height));
|
|
166
169
|
}
|
|
167
170
|
containsPoint(e, t) {
|
|
168
171
|
return e >= this.x && e < this.x2 && t >= this.y && t < this.y2;
|
|
@@ -188,4 +191,4 @@ var _ = class e {
|
|
|
188
191
|
}
|
|
189
192
|
};
|
|
190
193
|
//#endregion
|
|
191
|
-
export {
|
|
194
|
+
export { u as a, m as c, l as d, p as i, s as l, o as n, h as o, c as r, d as s, v as t, g as u };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Sn as e, a as t, o as n, s as r } from "./clipOptions-clBEbkjv.js";
|
|
2
|
+
import { s as i } from "./flowNode-BSjy0Wz3.js";
|
|
2
3
|
import { t as a } from "./warning-CpIIpk8e.js";
|
|
3
4
|
import { n as o } from "./performanceProfiler-CPLEjApa.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
5
|
+
import { r as s } from "./color-uTRRsy8i.js";
|
|
6
|
+
import { C as c, D as l, F as u, L as d, M as f, N as p, O as m, P as h, R as g, S as _, T as v, _ as y, a as b, b as x, c as S, d as ee, g as C, h as w, i as T, j as E, k as D, l as O, m as k, p as A, s as j, t as M, u as N, v as P, x as F, y as I } from "./order-BpJnq_nV.js";
|
|
6
7
|
//#region ../core/src/rendering/canvas2d/renderers/arrow.js
|
|
7
|
-
function
|
|
8
|
-
let n = e, r = t.context, i = n.encoders, a =
|
|
8
|
+
function L(e, t) {
|
|
9
|
+
let n = e, r = t.context, i = n.encoders, a = c(n);
|
|
9
10
|
r.lineJoin = "miter";
|
|
10
|
-
let o =
|
|
11
|
+
let o = m(i.fill, t), s = m(i.stroke, t), u, d;
|
|
11
12
|
return v(n, a, t, (e) => {
|
|
12
13
|
e.headShapeFallback && t.warn(`Canvas2D rendered unsupported arrow headShape "${a.headShape}" as a triangle.`), r.beginPath();
|
|
13
14
|
for (let t of e.boundaryLoops) {
|
|
@@ -16,32 +17,32 @@ function I(e, t) {
|
|
|
16
17
|
for (let e = 1; e < t.length; e++) r.lineTo(t[e].x, t[e].y);
|
|
17
18
|
r.closePath();
|
|
18
19
|
}
|
|
19
|
-
let n = o ??
|
|
20
|
-
n != "none" &&
|
|
21
|
-
let
|
|
22
|
-
|
|
20
|
+
let n = o ?? f(i.fill(e.datum)), c = l(i.fillOpacity, e.datum) * t.viewOpacity;
|
|
21
|
+
n != "none" && c > 0 && (u != n && (r.fillStyle = n, u = n), r.globalAlpha = c, r.fill());
|
|
22
|
+
let p = s ?? f(i.stroke(e.datum)), m = l(i.strokeOpacity, e.datum) * t.viewOpacity;
|
|
23
|
+
p != "none" && m > 0 && e.strokeWidth > 0 && (d != p && (r.strokeStyle = p, d = p), r.globalAlpha = m, r.lineWidth = e.strokeWidth, r.stroke());
|
|
23
24
|
}, s);
|
|
24
25
|
}
|
|
25
26
|
//#endregion
|
|
26
27
|
//#region ../core/src/rendering/canvas2d/renderers/link.js
|
|
27
|
-
function
|
|
28
|
-
let r = t, i = n.context, a = 1 / n.devicePixelRatio, o = r.encoders, s =
|
|
28
|
+
function R(t, n) {
|
|
29
|
+
let r = t, i = n.context, a = 1 / n.devicePixelRatio, o = r.encoders, s = P(r), c = _(r, s.shape, n.secondOrderPass);
|
|
29
30
|
i.lineCap = "butt", i.lineJoin = "miter", i.miterLimit = 2;
|
|
30
|
-
let
|
|
31
|
-
return
|
|
32
|
-
let r =
|
|
31
|
+
let u = m(o.color, n), d;
|
|
32
|
+
return I(r, s, n, (t) => {
|
|
33
|
+
let r = u ?? f(o.color(t.datum)), s = l(o.opacity, t.datum) * n.viewOpacity;
|
|
33
34
|
if (r == "none" || s <= 0 || t.strokeWidth <= 0) return;
|
|
34
|
-
let
|
|
35
|
-
if (
|
|
36
|
-
let { normalX: t, normalY: n, offset: a, start: o, end: s } =
|
|
37
|
-
for (let e of
|
|
35
|
+
let p = c && t.geometry.type == "cubic" && F(t.geometry.points[0], t.geometry.points[3], c);
|
|
36
|
+
if (p) {
|
|
37
|
+
let { normalX: t, normalY: n, offset: a, start: o, end: s } = p, c = i.createLinearGradient(t * (a - s), n * (a - s), t * (a + s), n * (a + s)), l = e(r), u = l.opacity;
|
|
38
|
+
for (let e of x(o, s)) l.opacity = u * e.opacity, c.addColorStop(e.offset, l.formatRgb());
|
|
38
39
|
i.strokeStyle = c, d = void 0;
|
|
39
40
|
} else d != r && (i.strokeStyle = r, d = r);
|
|
40
41
|
i.globalAlpha = s * Math.min(t.strokeWidth / a, 1), i.lineWidth = Math.max(t.strokeWidth, a);
|
|
41
|
-
let { geometry:
|
|
42
|
-
if (i.beginPath(), i.moveTo(
|
|
42
|
+
let { geometry: m } = t, h = m.points[0];
|
|
43
|
+
if (i.beginPath(), i.moveTo(h[0], h[1]), m.type == "orthogonal") for (let e of m.points.slice(1)) i.lineTo(e[0], e[1]);
|
|
43
44
|
else {
|
|
44
|
-
let [, e, t, n] =
|
|
45
|
+
let [, e, t, n] = m.points;
|
|
45
46
|
i.bezierCurveTo(e[0], e[1], t[0], t[1], n[0], n[1]);
|
|
46
47
|
}
|
|
47
48
|
i.stroke();
|
|
@@ -49,50 +50,50 @@ function L(t, n) {
|
|
|
49
50
|
}
|
|
50
51
|
//#endregion
|
|
51
52
|
//#region ../core/src/rendering/canvas2d/renderers/point.js
|
|
52
|
-
function
|
|
53
|
+
function z(e, t) {
|
|
53
54
|
let n = e;
|
|
54
|
-
|
|
55
|
-
let r = C(n), i = t.context, a = n.encoders, o =
|
|
55
|
+
E(n, n.properties.fillGradientStrength) && t.warn("Canvas2D ignored unsupported point property fillGradientStrength."), n.properties.geometricZoomBound && t.warn("Canvas2D ignored unsupported point property geometricZoomBound.");
|
|
56
|
+
let r = C(n), i = t.context, a = n.encoders, o = D(a.fill), s = D(a.stroke), c = m(a.fill, t), u = m(a.stroke, t), d, p;
|
|
56
57
|
return y(n, r, t, (e) => {
|
|
57
|
-
let n = e.datum, r = e.lineShape,
|
|
58
|
-
r &&
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
let g = h ? 0 : e.x, _ = h ? 0 : e.y, v = !0;
|
|
62
|
-
if (e.shape == "circle") i.arc(g, _, e.geometryRadius, 0, Math.PI * 2);
|
|
63
|
-
else if (e.shape == "square") {
|
|
64
|
-
let t = e.geometryRadius * 2;
|
|
65
|
-
i.rect(g - e.geometryRadius, _ - e.geometryRadius, t, t);
|
|
66
|
-
} else v = w(e.shape, g, _, e.geometryRadius, i);
|
|
67
|
-
h && i.restore(), v || (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" && f > 0 && (l != c && (i.fillStyle = c, l = c), z(i, f), i.fill()), p != "none" && m > 0 && e.strokeWidth > 0 && (r && i.lineCap != "butt" && (i.lineCap = "butt"), d != p && (i.strokeStyle = p, d = p), z(i, m), B(i, e.strokeWidth), i.stroke());
|
|
58
|
+
let n = e.datum, r = e.lineShape, m = c ?? f(a.fill(n)), h = l(a.fillOpacity, n) * t.viewOpacity, g = u ?? f(a.stroke(n)), _ = l(a.strokeOpacity, n) * t.viewOpacity, v = e.strokeWidth > 0 && _ > 0 ? _ * s(g) : 0;
|
|
59
|
+
r && v <= 0 && (g = m, _ = h, v = h * o(m));
|
|
60
|
+
let y = !r && h * o(m) > 0, b = v < 1 ? e.radius : e.geometryRadius;
|
|
61
|
+
B(i, e, y ? b : e.geometryRadius, t.warn), y && (d != m && (i.fillStyle = m, d = m), V(i, h), i.fill()), v > 0 && e.strokeWidth > 0 && (y && b != e.geometryRadius && B(i, e, e.geometryRadius, t.warn), r && i.lineCap != "butt" && (i.lineCap = "butt"), p != g && (i.strokeStyle = g, p = g), V(i, _), H(i, e.strokeWidth), i.stroke());
|
|
68
62
|
});
|
|
69
63
|
}
|
|
70
|
-
function
|
|
64
|
+
function B(e, t, n, r) {
|
|
65
|
+
e.beginPath();
|
|
66
|
+
let i = t.angle != 0 && t.shape != "circle";
|
|
67
|
+
i && (e.save(), e.translate(t.x, t.y), e.rotate(t.angle * Math.PI / 180));
|
|
68
|
+
let a = i ? 0 : t.x, o = i ? 0 : t.y, s = !0;
|
|
69
|
+
t.shape == "circle" ? e.arc(a, o, n, 0, Math.PI * 2) : t.shape == "square" ? e.rect(a - n, o - n, n * 2, n * 2) : s = w(t.shape, a, o, n, e), i && e.restore(), s || (r(`Canvas2D rendered unsupported point shape "${t.shape}" as a circle.`), e.arc(t.x, t.y, n, 0, Math.PI * 2));
|
|
70
|
+
}
|
|
71
|
+
function V(e, t) {
|
|
71
72
|
e.globalAlpha != t && (e.globalAlpha = t);
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function H(e, t) {
|
|
74
75
|
e.lineWidth != t && (e.lineWidth = t);
|
|
75
76
|
}
|
|
76
77
|
//#endregion
|
|
77
78
|
//#region ../core/src/rendering/canvas2d/renderers/rect.js
|
|
78
|
-
function
|
|
79
|
-
let n = e, r =
|
|
79
|
+
function U(e, t) {
|
|
80
|
+
let n = e, r = A(n);
|
|
80
81
|
r.hatch != "none" && t.warn("Canvas2D ignored unsupported rect hatch.");
|
|
81
82
|
let i = t.start ?? 0;
|
|
82
83
|
if (i === (t.end ?? t.data.length)) return 0;
|
|
83
|
-
let a = t.context, o = n.encoders, s, c,
|
|
84
|
+
let a = t.context, o = n.encoders, s, c, u = [
|
|
84
85
|
0,
|
|
85
86
|
0,
|
|
86
87
|
0,
|
|
87
88
|
0
|
|
88
|
-
], d = o.strokeOpacity.constant,
|
|
89
|
-
return
|
|
90
|
-
r.shadow.opacity > 0 &&
|
|
91
|
-
let n = e.opacityFactor, i = e.fill != "none" && e.fillOpacity > 0,
|
|
92
|
-
|
|
89
|
+
], d = o.strokeOpacity.constant, p = m(o.stroke, t), h = p == "none", g = !h && d ? l(o.strokeOpacity, t.data[i]) : 0;
|
|
90
|
+
return k(n, r, t, (e) => {
|
|
91
|
+
r.shadow.opacity > 0 && W(e, r.shadow, t, u);
|
|
92
|
+
let n = e.opacityFactor, i = e.fill != "none" && e.fillOpacity > 0, m = p ?? f(o.stroke(e.datum)), _ = (d ? g : l(o.strokeOpacity, e.datum)) * t.viewOpacity * n, v = !h && m != "none" && _ > 0 && e.strokeWidth > 0, y = r.hasCornerRadii && (e.radii.topLeft != 0 || e.radii.topRight != 0 || e.radii.bottomRight != 0 || e.radii.bottomLeft != 0);
|
|
93
|
+
y && (i || v) && (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), G(a, e.fillOpacity * n), y ? a.fill() : a.fillRect(e.x, e.y, e.width, e.height)), v && (c != m && (a.strokeStyle = m, c = m), G(a, _), K(a, e.strokeWidth), y ? a.stroke() : a.strokeRect(e.x, e.y, e.width, e.height));
|
|
93
94
|
});
|
|
94
95
|
}
|
|
95
|
-
function
|
|
96
|
+
function W(e, t, n, r) {
|
|
96
97
|
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;
|
|
97
98
|
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();
|
|
98
99
|
try {
|
|
@@ -101,58 +102,58 @@ function H(e, t, n, r) {
|
|
|
101
102
|
i.restore();
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
|
-
function
|
|
105
|
+
function G(e, t) {
|
|
105
106
|
e.globalAlpha != t && (e.globalAlpha = t);
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
+
function K(e, t) {
|
|
108
109
|
e.lineWidth != t && (e.lineWidth = t);
|
|
109
110
|
}
|
|
110
111
|
//#endregion
|
|
111
112
|
//#region ../core/src/rendering/canvas2d/renderers/rule.js
|
|
112
|
-
function
|
|
113
|
+
function q(e, t) {
|
|
113
114
|
let n = e, r = t.context, i = n.encoders;
|
|
114
|
-
r.lineCap =
|
|
115
|
-
let a =
|
|
116
|
-
return
|
|
117
|
-
let n =
|
|
118
|
-
|
|
115
|
+
r.lineCap = E(n, n.properties.strokeCap), r.setLineDash(E(n, n.properties.strokeDash) ?? []), r.lineDashOffset = E(n, n.properties.strokeDashOffset);
|
|
116
|
+
let a = n.getType() === "rule", o = m(i.fill, t), s;
|
|
117
|
+
return ee(n, N(n), t, (e) => {
|
|
118
|
+
let n = o ?? f(i.fill(e.datum)), c = l(i.opacity, e.datum) * t.viewOpacity;
|
|
119
|
+
c <= 0 || (r.beginPath(), r.moveTo(e.x1, e.y1), r.lineTo(e.x2, e.y2), e.strokeWidth > 0 && (r.strokeStyle = e.stroke, s = e.stroke, r.globalAlpha = c * e.strokeOpacity, r.lineWidth = e.size + 2 * e.strokeWidth, r.stroke()), n !== "none" && (s !== n && (r.strokeStyle = n, s = n), r.globalAlpha = c * (a ? l(i.fillOpacity, e.datum) : 1), r.lineWidth = e.size, r.stroke()));
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
122
|
//#endregion
|
|
122
123
|
//#region ../core/src/rendering/canvas2d/renderers/text.js
|
|
123
|
-
function
|
|
124
|
-
let n = e, r = n.properties, i = t.textMetrics ?? n.unitView.context.textMetrics, a = i.requestFont(r), o = T(i, r), s =
|
|
124
|
+
function J(e, t) {
|
|
125
|
+
let n = e, r = n.properties, i = t.textMetrics ?? n.unitView.context.textMetrics, a = i.requestFont(r), o = T(i, r), s = S(n), c = t.context, u = n.encoders, d = b(r.font), p = `${r.fontStyle ?? "normal"} ${j(r.fontWeight ?? "normal")} `, h = s.baseline == "baseline" ? "alphabetic" : s.baseline;
|
|
125
126
|
[
|
|
126
127
|
r.viewportEdgeFadeWidthTop,
|
|
127
128
|
r.viewportEdgeFadeWidthRight,
|
|
128
129
|
r.viewportEdgeFadeWidthBottom,
|
|
129
130
|
r.viewportEdgeFadeWidthLeft
|
|
130
|
-
].some((e) =>
|
|
131
|
-
let g =
|
|
132
|
-
return s.logoLetters || (
|
|
131
|
+
].some((e) => E(n, e) > 0) && t.warn("Canvas2D ignored unsupported text viewport edge fading.");
|
|
132
|
+
let g = m(u.color, t), _, v;
|
|
133
|
+
return s.logoLetters || (c.textAlign = s.align, c.textBaseline = h), O(n, s, {
|
|
133
134
|
...t,
|
|
134
135
|
fontMeasurement: a,
|
|
135
136
|
measureLogoInkBounds: o
|
|
136
137
|
}, (e) => {
|
|
137
138
|
e.multiCharacterLogo && t.warn("Canvas2D stretches multi-character logo text as a single glyph cell.");
|
|
138
|
-
let n = g ??
|
|
139
|
-
n == "none" || r <= 0 || (_ != n && (
|
|
139
|
+
let n = g ?? f(u.color(e.datum)), r = l(u.opacity, e.datum) * t.viewOpacity * e.fadeOpacity;
|
|
140
|
+
n == "none" || r <= 0 || (_ != n && (c.fillStyle = n, _ = n), c.globalAlpha = r, v != e.size && (c.font = `${p}${e.size}px ${d}`, v = e.size), e.logoTransform ? (c.save(), c.translate(e.x, e.y), c.rotate(e.angle * Math.PI / 180), c.translate(e.dx, e.dy), c.scale(e.logoTransform.scaleX, e.logoTransform.scaleY), c.translate(-e.logoTransform.originX, -e.logoTransform.originY), c.textAlign = "left", c.textBaseline = "alphabetic", c.fillText(e.text, 0, 0), c.restore()) : e.angle || e.scale != 1 ? (c.save(), c.translate(e.x, e.y), c.rotate(e.angle * Math.PI / 180), c.translate(e.dx, e.dy), c.scale(e.scale, e.scale), c.fillText(e.text, 0, 0), c.restore()) : c.fillText(e.text, e.x + e.dx, e.y + e.dy));
|
|
140
141
|
});
|
|
141
142
|
}
|
|
142
143
|
//#endregion
|
|
143
144
|
//#region ../core/src/rendering/canvas2d/renderers/index.js
|
|
144
|
-
function
|
|
145
|
-
return (t.start ?? 0) === (t.end ?? t.data.length) ? 0 : e.getType() == "arrow" ?
|
|
145
|
+
function Y(e, t) {
|
|
146
|
+
return (t.start ?? 0) === (t.end ?? t.data.length) ? 0 : e.getType() == "arrow" ? L(e, t) : e.getType() == "link" ? R(e, t) : e.getType() == "rect" ? U(e, t) : e.getType() == "point" ? z(e, t) : e.getType() == "rule" || e.getType() == "tick" ? q(e, t) : e.getType() == "text" ? J(e, t) : (t.warn(`Canvas2D rendering is not implemented for mark type "${e.getType()}".`), 0);
|
|
146
147
|
}
|
|
147
148
|
//#endregion
|
|
148
149
|
//#region ../core/src/rendering/sampleFacet.js
|
|
149
|
-
function
|
|
150
|
+
function X(e) {
|
|
150
151
|
let t = e.pixelToUnit, n = e.locSize.location * t, r = e.locSize.size * t;
|
|
151
152
|
return !(n > 1 || n + r < 0);
|
|
152
153
|
}
|
|
153
154
|
//#endregion
|
|
154
155
|
//#region ../core/src/rendering/canvas2d/canvas2DViewRenderingContext.js
|
|
155
|
-
var
|
|
156
|
+
var Z = 8, Q = 16777216, te = class extends s {
|
|
156
157
|
#e = [];
|
|
157
158
|
#t = /* @__PURE__ */ new WeakSet();
|
|
158
159
|
#n = /* @__PURE__ */ new WeakMap();
|
|
@@ -182,7 +183,7 @@ var Y = 8, X = 16777216, Z = class extends s {
|
|
|
182
183
|
this.paint && !this.#t.has(e) && (e.onBeforeRender(), this.#t.add(e));
|
|
183
184
|
let r = e.getOpacity();
|
|
184
185
|
if (this.paint && r > 0 && r !== 1) {
|
|
185
|
-
let r = t(e), i =
|
|
186
|
+
let r = t(e), i = ne(n, this.devicePixelRatio, this.#c, r), a = re(this.#l, this.#u.length, i.width, i.height);
|
|
186
187
|
a.setTransform(this.devicePixelRatio, 0, 0, this.devicePixelRatio, -i.x, -i.y), this.#u.push({
|
|
187
188
|
context: this.context,
|
|
188
189
|
bounds: this.#c
|
|
@@ -211,27 +212,27 @@ var Y = 8, X = 16777216, Z = class extends s {
|
|
|
211
212
|
}
|
|
212
213
|
renderMark(e, t) {
|
|
213
214
|
if (!this.paint || !this.#r(e)) return;
|
|
214
|
-
let
|
|
215
|
-
if (
|
|
215
|
+
let i = this.#n.get(e.unitView);
|
|
216
|
+
if (i === void 0 && (i = e.unitView.getEffectiveOpacity(), this.#n.set(e.unitView, i)), i <= 0) return;
|
|
216
217
|
e.initializeRenderingRevisions(Object.keys(e.properties));
|
|
217
218
|
let o = t.sampleFacetRenderingOptions;
|
|
218
|
-
if (o && !e.encoders.facetIndex && (this.#i?.addCount("canvasSampleFacetOccurrences"), !
|
|
219
|
+
if (o && !e.encoders.facetIndex && (this.#i?.addCount("canvasSampleFacetOccurrences"), !X(o))) {
|
|
219
220
|
this.#i?.addCount("canvasCulledSampleFacetOccurrences");
|
|
220
221
|
return;
|
|
221
222
|
}
|
|
222
|
-
let s = this.currentCoords, c =
|
|
223
|
-
if (!
|
|
224
|
-
let
|
|
223
|
+
let s = this.currentCoords, c = n(t), l = r(c, e.properties.clip, s), d = h(this.width, this.height, l);
|
|
224
|
+
if (!u(d)) return;
|
|
225
|
+
let f = p(s, c, e.properties.cullByVisibleRange), m = this.#o?.prepare(e) ?? !1, _ = this.context;
|
|
225
226
|
if (_.save(), l) {
|
|
226
227
|
let e = l.rect.flatten(), t = l.clipX ? e.x : 0, n = l.clipY ? e.y : 0, r = l.clipX ? e.width : this.width, i = l.clipY ? e.height : this.height;
|
|
227
228
|
_.beginPath(), _.rect(t, n, r, i), _.clip();
|
|
228
229
|
}
|
|
229
230
|
try {
|
|
230
231
|
let n = e.getOrder?.(), r = n && n.isActive();
|
|
231
|
-
|
|
232
|
+
g(e, t, s, this.#a, (t, i) => {
|
|
232
233
|
let o = 0, s = i.length;
|
|
233
|
-
|
|
234
|
-
let c = (n, r, i, o = !1) =>
|
|
234
|
+
m && this.#o.query(i, this.#s) && (o = this.#s[0], s = this.#s[1]);
|
|
235
|
+
let c = (n, r, i, o = !1) => Y(e, {
|
|
235
236
|
context: _,
|
|
236
237
|
devicePixelRatio: this.devicePixelRatio,
|
|
237
238
|
coords: t,
|
|
@@ -239,15 +240,15 @@ var Y = 8, X = 16777216, Z = class extends s {
|
|
|
239
240
|
secondOrderPass: o,
|
|
240
241
|
start: r,
|
|
241
242
|
end: i,
|
|
242
|
-
visibleBounds:
|
|
243
|
-
anchorCullBounds:
|
|
243
|
+
visibleBounds: d,
|
|
244
|
+
anchorCullBounds: f,
|
|
244
245
|
viewOpacity: 1,
|
|
245
246
|
textMetrics: this.textMetrics,
|
|
246
247
|
warn: (t) => a(`${t} View: ${e.unitView.getPathString()}`)
|
|
247
248
|
});
|
|
248
249
|
if (!r) return c(i, o, s);
|
|
249
|
-
let l = 0,
|
|
250
|
-
for (let [e, t] of
|
|
250
|
+
let l = 0, u = M(i, o, s, n.predicate, n.passes);
|
|
251
|
+
for (let [e, t] of u.entries()) t.length > 0 && (l += c(t, 0, t.length, e === 1));
|
|
251
252
|
return l;
|
|
252
253
|
}, (t) => a(`Canvas2D could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`));
|
|
253
254
|
} finally {
|
|
@@ -255,12 +256,12 @@ var Y = 8, X = 16777216, Z = class extends s {
|
|
|
255
256
|
}
|
|
256
257
|
}
|
|
257
258
|
get currentCoords() {
|
|
258
|
-
let e =
|
|
259
|
+
let e = i(this.#e);
|
|
259
260
|
if (!e) throw Error("No current view in Canvas2D rendering context.");
|
|
260
261
|
return e.coords;
|
|
261
262
|
}
|
|
262
263
|
};
|
|
263
|
-
function
|
|
264
|
+
function ne(e, t, n, r) {
|
|
264
265
|
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;
|
|
265
266
|
return {
|
|
266
267
|
x: o,
|
|
@@ -269,8 +270,8 @@ function Q(e, t, n, r) {
|
|
|
269
270
|
height: l - s
|
|
270
271
|
};
|
|
271
272
|
}
|
|
272
|
-
function
|
|
273
|
-
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 <
|
|
273
|
+
function re(e, t, n, r) {
|
|
274
|
+
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 < Z && o + i <= Q;
|
|
274
275
|
if (!a || !s) {
|
|
275
276
|
if (a = document.createElement("canvas").getContext("2d"), !a) throw Error("Unable to create a Canvas2D view group.");
|
|
276
277
|
s && (e[t] = a);
|
|
@@ -282,9 +283,9 @@ function $(e, t, n) {
|
|
|
282
283
|
}
|
|
283
284
|
//#endregion
|
|
284
285
|
//#region ../core/src/rendering/canvas2d/renderCanvas2D.js
|
|
285
|
-
function
|
|
286
|
-
let t = new
|
|
286
|
+
function ie(e) {
|
|
287
|
+
let t = new te({ picking: !1 }, e);
|
|
287
288
|
e.layoutResult.collectRenderCommands(t);
|
|
288
289
|
}
|
|
289
290
|
//#endregion
|
|
290
|
-
export {
|
|
291
|
+
export { X as n, ie as t };
|