@genome-spy/app 0.89.0 → 0.90.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-BUcXm-JC.js → agentApi-Z65dw-sD.js} +2808 -2638
- package/dist/agentApi.es.js +1607 -1570
- package/dist/agentShared.es.js +737 -678
- package/dist/{canvas2d-CGuVGvQk.js → canvas2d-DiPQvNtZ.js} +11 -9
- package/dist/{canvas2d-DgF0kstG.js → canvas2d-t_N10CeW.js} +24 -22
- package/dist/{clipOptions-DBJX_W31.js → clipOptions-B5PibDq3.js} +890 -900
- package/dist/{clipOptions-8BPf0WMZ.js → clipOptions-Cba4I0AO.js} +544 -554
- package/dist/{componentStyles-FsNmIb22.js → componentStyles-DGtQXvwc.js} +17 -15
- package/dist/{debug-BEWbYuZD.js → debug-CVAlrcZt.js} +2 -2
- package/dist/{debug-DQj_7mFm.js → debug-DP4WzTNo.js} +2 -2
- package/dist/dialog.es.js +4 -3
- package/dist/esm-BiqrFjMh.js +443 -0
- package/dist/{esm-lwYrRdbg.js → esm-Bv7Frz7C.js} +142 -79
- package/dist/{esm-VvpZ9hsq.js → esm-C3A-AuRi.js} +1 -1
- package/dist/esm-CvpR1OcU.js +322 -0
- package/dist/esm-DFHFX1sH.js +1526 -0
- package/dist/esm-Dndm-NaA.js +1193 -0
- package/dist/{esm-CcDLRSvC.js → esm-DtNElqRr.js} +64 -63
- package/dist/esm-L53qjcYH.js +1155 -0
- package/dist/esm-VFJeyk9i.js +249 -0
- package/dist/{esm-BdLYkz-m.js → esm-_xCtpDwm.js} +1 -1
- package/dist/index.es.js +4203 -3910
- package/dist/index.js +900 -455
- package/dist/{indexer-D8Bgkkb8.js → indexer-DbFTKGlm.js} +1 -1
- package/dist/{indexer-Cdt_U05k.js → indexer-En7gpvLN.js} +1 -1
- package/dist/{lit-ByuJ0FJ4.js → lit-CoXp9NFX.js} +12 -10
- package/dist/{order-DIxlclRN.js → order-BkYCnwD7.js} +36 -30
- package/dist/{order-BPOzLe80.js → order-R043xTpC.js} +47 -41
- package/dist/{parquetRead-Cs2xRrvz.js → parquetRead-0hFIa3Cc.js} +532 -350
- package/dist/{rasterExport-Bl6w9t3J.js → rasterExport-C_FcNBkC.js} +8 -7
- package/dist/{rasterExport-DRvNAH-r.js → rasterExport-Z7gs5346.js} +8 -7
- package/dist/{rasterization-D0tOoKu_.js → rasterization-_-9JmSas.js} +3 -2
- package/dist/{renderCanvas2D-LdEYFnRo.js → renderCanvas2D-DK1c9TFK.js} +10 -10
- package/dist/{renderCanvas2D-Ct95auF3.js → renderCanvas2D-IM-A9DYG.js} +16 -16
- package/dist/schema.json +11 -0
- package/dist/{src-DjOlFqSn.js → src-DJtvThVC.js} +3 -5
- package/dist/style.css +1 -1
- package/dist/{svg-pkTPD4bv.js → svg-DW3tfUmm.js} +233 -232
- package/dist/{svg-Ag36-h_I.js → svg-PabUdcDi.js} +233 -232
- package/dist/{svgRasterizer-DrtJ9nLk.js → svgRasterizer-B6YtWLJs.js} +2 -2
- package/dist/{svgRasterizer-CksK4QTB.js → svgRasterizer-BEVDyyS3.js} +2 -2
- package/dist/{vega-scale-BWBFykuI.js → vega-scale-Byaw1K8O.js} +837 -726
- package/dist/{vega-scale-BJaDSHBJ.js → vega-scale-Ctz_wa3z.js} +942 -834
- package/dist/{viewIdentityRegistry-BvCJajXG.js → viewIdentityRegistry-BW415b3o.js} +1 -1
- package/dist/{viewIdentityRegistry-B-snqI3y.js → viewIdentityRegistry-_F0E7nkA.js} +1 -1
- package/dist/{viewSelectors-BlvzvG-z.js → viewSelectors-DYz-PhTO.js} +245 -243
- package/dist/{viewSelectors-C5q3qBiR.js → viewSelectors-KtD-QSN0.js} +106 -104
- package/dist/{viewUtils-C3vBtSvE.js → viewUtils-BZGPseMx.js} +1833 -1677
- package/dist/{webgl-CZX2pe5v.js → webgl-BKSGqHaz.js} +964 -951
- package/dist/{webgl-CexXSw_I.js → webgl-tdKf9SlZ.js} +239 -226
- package/package.json +5 -5
- package/dist/esm-80V4xF_D.js +0 -1098
- package/dist/esm-BA6yMcc-.js +0 -1222
- package/dist/esm-BdT7qUL-.js +0 -157
- package/dist/esm-CfYZhLHN.js +0 -1367
- package/dist/esm-D-iG_TIX.js +0 -441
- package/dist/esm-JAiZmFIS.js +0 -128
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as e, E as t, H as n,
|
|
2
|
-
import { T as ue, b as w, g as de, v as T, x as fe, y as pe } from "./vega-scale-
|
|
3
|
-
import { i as me, n as he, p as ge, r as _e, t as ve } from "./indexer-
|
|
1
|
+
import { A as e, E as t, H as n, Jt as r, Kt as i, L as a, Nt as o, Qt as s, Tt as c, Wt as l, _t as u, b as d, cn as f, ct as p, d as m, dn as h, et as g, gt as _, ht as v, it as ee, jt as te, ln as y, n as b, nn as x, o as ne, ot as S, pn as C, pt as re, s as ie, un as ae, ut as oe, vt as se, yt as ce, z as le } from "./clipOptions-B5PibDq3.js";
|
|
2
|
+
import { T as ue, b as w, g as de, v as T, x as fe, y as pe } from "./vega-scale-Ctz_wa3z.js";
|
|
3
|
+
import { i as me, n as he, p as ge, r as _e, t as ve } from "./indexer-En7gpvLN.js";
|
|
4
4
|
import { n as ye, t as be } from "./viewError-BiR9VCgL.js";
|
|
5
5
|
import { t as xe } from "./rectangle-DE98gIxF.js";
|
|
6
6
|
import { n as Se, r as Ce } from "./performanceProfiler-CPLEjApa.js";
|
|
@@ -143,8 +143,8 @@ var Ot = [
|
|
|
143
143
|
"a_position"
|
|
144
144
|
];
|
|
145
145
|
function kt(e, t) {
|
|
146
|
-
let n, r;
|
|
147
|
-
for (
|
|
146
|
+
let n, r = 0;
|
|
147
|
+
for (; r < Ot.length && (n = Ot[r], !(n in t || (n = pt.attribPrefix + n, n in t))); ++r);
|
|
148
148
|
r === Ot.length && (n = Object.keys(t)[0]);
|
|
149
149
|
let i = t[n];
|
|
150
150
|
if (!i.buffer) return 1;
|
|
@@ -672,7 +672,7 @@ function Mr(e) {
|
|
|
672
672
|
};
|
|
673
673
|
}
|
|
674
674
|
function Nr(e) {
|
|
675
|
-
return (e & e - 1)
|
|
675
|
+
return !(e & e - 1);
|
|
676
676
|
}
|
|
677
677
|
function Pr(e, t, n, r) {
|
|
678
678
|
if (!jt(e)) return Nr(t) && Nr(n);
|
|
@@ -848,7 +848,8 @@ function Yr(e) {
|
|
|
848
848
|
if (typeof document < "u") {
|
|
849
849
|
let t = document.createElement("a");
|
|
850
850
|
return t.href = e, t.hostname === location.hostname && t.port === location.port && t.protocol === location.protocol;
|
|
851
|
-
}
|
|
851
|
+
}
|
|
852
|
+
{
|
|
852
853
|
let t = new URL(location.href).origin;
|
|
853
854
|
return new URL(e, location.href).origin === t;
|
|
854
855
|
}
|
|
@@ -870,7 +871,8 @@ function Zr(e, t, n) {
|
|
|
870
871
|
n(null, r), i();
|
|
871
872
|
};
|
|
872
873
|
return r.addEventListener("error", a), r.addEventListener("load", o), r.src = e, r;
|
|
873
|
-
}
|
|
874
|
+
}
|
|
875
|
+
if (typeof ImageBitmap < "u") {
|
|
874
876
|
let i, a, o = function() {
|
|
875
877
|
n(i, a);
|
|
876
878
|
}, s = {};
|
|
@@ -965,12 +967,13 @@ function ii(e, t, n, r) {
|
|
|
965
967
|
let p = jr(l, f), m = n.byteLength / p;
|
|
966
968
|
if (m % 1) throw "length wrong size for format: " + Mt(e, d);
|
|
967
969
|
let h;
|
|
968
|
-
if (i === M || i === N)
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
970
|
+
if (i === M || i === N) {
|
|
971
|
+
if (!a && !o && !s) {
|
|
972
|
+
let e = Math.cbrt(m);
|
|
973
|
+
if (e % 1 != 0) throw "can't guess cube size of array of numElements: " + m;
|
|
974
|
+
a = e, o = e, s = e;
|
|
975
|
+
} else a && (!o || !s) ? (h = Lr(e, i, o, s, m / a), o = h.width, s = h.height) : o && (!a || !s) ? (h = Lr(e, i, a, s, m / o), a = h.width, s = h.height) : (h = Lr(e, i, a, o, m / s), a = h.width, o = h.height);
|
|
976
|
+
} else h = Lr(e, i, a, o, m), a = h.width, o = h.height;
|
|
974
977
|
if (zr(e), e.pixelStorei(an, r.unpackAlignment || 1), Rr(e, r), i === j) {
|
|
975
978
|
let t = p / n.BYTES_PER_ELEMENT, i = m / 6 * t;
|
|
976
979
|
Kr(e, r).forEach((t) => {
|
|
@@ -997,12 +1000,13 @@ function oi(e, t, n) {
|
|
|
997
1000
|
let r = e.createTexture(), i = t.target || A, a = t.width || 1, o = t.height || 1, s = t.internalFormat || k;
|
|
998
1001
|
e.bindTexture(i, r), i === j && (e.texParameteri(i, Zt, Bt), e.texParameteri(i, Qt, Bt));
|
|
999
1002
|
let c = t.src;
|
|
1000
|
-
if (c)
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1003
|
+
if (c) {
|
|
1004
|
+
if (typeof c == "function" && (c = c(e, t)), typeof c == "string") ti(e, r, t, n);
|
|
1005
|
+
else if (Nt(c) || Array.isArray(c) && (typeof c[0] == "number" || Array.isArray(c[0]) || Nt(c[0]))) {
|
|
1006
|
+
let n = ii(e, r, c, t);
|
|
1007
|
+
a = n.width, o = n.height;
|
|
1008
|
+
} else Array.isArray(c) && (typeof c[0] == "string" || Qr(c[0])) ? i === j ? ni(e, r, t, n) : ri(e, r, t, n) : (qr(e, r, c, t), a = c.width, o = c.height);
|
|
1009
|
+
} else ai(e, r, t);
|
|
1006
1010
|
return Wr(t) && Ur(e, r, t, a, o, s), Vr(e, r, t), r;
|
|
1007
1011
|
}
|
|
1008
1012
|
function si(e, t, n, r, i, a) {
|
|
@@ -1408,16 +1412,18 @@ function La(e, t) {
|
|
|
1408
1412
|
}
|
|
1409
1413
|
function K(e, t) {
|
|
1410
1414
|
return function(n) {
|
|
1411
|
-
if (n.value)
|
|
1412
|
-
|
|
1413
|
-
|
|
1415
|
+
if (n.value) {
|
|
1416
|
+
if (e.disableVertexAttribArray(t), n.value.length === 4) e.vertexAttrib4iv(t, n.value);
|
|
1417
|
+
else throw Error("The length of an integer constant value must be 4!");
|
|
1418
|
+
} else e.bindBuffer(di, n.buffer), e.enableVertexAttribArray(t), e.vertexAttribIPointer(t, n.numComponents || n.size, n.type || Ei, n.stride || 0, n.offset || 0), n.divisor !== void 0 && e.vertexAttribDivisor(t, n.divisor);
|
|
1414
1419
|
};
|
|
1415
1420
|
}
|
|
1416
1421
|
function Ra(e, t) {
|
|
1417
1422
|
return function(n) {
|
|
1418
|
-
if (n.value)
|
|
1419
|
-
|
|
1420
|
-
|
|
1423
|
+
if (n.value) {
|
|
1424
|
+
if (e.disableVertexAttribArray(t), n.value.length === 4) e.vertexAttrib4uiv(t, n.value);
|
|
1425
|
+
else throw Error("The length of an unsigned integer constant value must be 4!");
|
|
1426
|
+
} else e.bindBuffer(di, n.buffer), e.enableVertexAttribArray(t), e.vertexAttribIPointer(t, n.numComponents || n.size, n.type || Xi, n.stride || 0, n.offset || 0), n.divisor !== void 0 && e.vertexAttribDivisor(t, n.divisor);
|
|
1421
1427
|
};
|
|
1422
1428
|
}
|
|
1423
1429
|
function za(e, t, n) {
|
|
@@ -1504,7 +1510,8 @@ function Ua(e, t, n, r) {
|
|
|
1504
1510
|
if (s && (o += i[a++]), a === i.length) {
|
|
1505
1511
|
n[c] = t;
|
|
1506
1512
|
break;
|
|
1507
|
-
}
|
|
1513
|
+
}
|
|
1514
|
+
{
|
|
1508
1515
|
let e = i[a++], t = e === "[", s = n[c] || (t ? [] : {});
|
|
1509
1516
|
n[c] = s, n = s, r[o] = r[o] || function(e) {
|
|
1510
1517
|
return function(t) {
|
|
@@ -1598,7 +1605,8 @@ function Ya(e, t, n, r) {
|
|
|
1598
1605
|
i += 4 - r;
|
|
1599
1606
|
}
|
|
1600
1607
|
};
|
|
1601
|
-
}
|
|
1608
|
+
}
|
|
1609
|
+
return function(t) {
|
|
1602
1610
|
t.length ? e.set(t) : e[0] = t;
|
|
1603
1611
|
};
|
|
1604
1612
|
}
|
|
@@ -1736,10 +1744,12 @@ function Fo(e, t, n, r) {
|
|
|
1736
1744
|
};
|
|
1737
1745
|
return t.forEach(function(t, a) {
|
|
1738
1746
|
let c = t.attachment, l = t.samples, u = t.format, d = t.attachmentPoint || Mo(u, t.internalFormat);
|
|
1739
|
-
if (d ||= To + a, Po(d) && o.push(d), !c)
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1747
|
+
if (d ||= To + a, Po(d) && o.push(d), !c) {
|
|
1748
|
+
if (l !== void 0 || No(u)) c = e.createRenderbuffer(), e.bindRenderbuffer(X, c), l > 1 ? e.renderbufferStorageMultisample(X, l, u, n, r) : e.renderbufferStorage(X, u, n, r);
|
|
1749
|
+
else {
|
|
1750
|
+
let i = Object.assign({}, t);
|
|
1751
|
+
i.width = n, i.height = r, i.auto === void 0 && (i.auto = !1, i.min = i.min || i.minMag || Ao, i.mag = i.mag || i.minMag || Ao, i.wrapS = i.wrapS || i.wrap || ko, i.wrapT = i.wrapT || i.wrap || ko), c = oi(e, i);
|
|
1752
|
+
}
|
|
1743
1753
|
}
|
|
1744
1754
|
if (et(e, c)) e.framebufferRenderbuffer(i, d, X, c);
|
|
1745
1755
|
else if (tt(e, c)) t.layer === void 0 ? e.framebufferTexture2D(i, d, t.target || lo, c, t.level || 0) : e.framebufferTextureLayer(i, d, c, t.level || 0, t.layer);
|
|
@@ -1831,10 +1841,10 @@ function Wo(e, t) {
|
|
|
1831
1841
|
//#endregion
|
|
1832
1842
|
//#region ../core/src/rendering/webgl/gl/colorUtils.js
|
|
1833
1843
|
function Go(e, t, n, r, i = !1) {
|
|
1834
|
-
let a =
|
|
1835
|
-
if (n === void 0 && !
|
|
1844
|
+
let a = C(e) ? e : e.name, o = !C(e) && e.extent || [0, 1];
|
|
1845
|
+
if (n === void 0 && !C(e) && (n = e.count), a) {
|
|
1836
1846
|
let e = ue(a);
|
|
1837
|
-
if (
|
|
1847
|
+
if (ae(e)) {
|
|
1838
1848
|
let a = Yo(e, {
|
|
1839
1849
|
extent: o,
|
|
1840
1850
|
count: n,
|
|
@@ -1846,12 +1856,13 @@ function Go(e, t, n, r, i = !1) {
|
|
|
1846
1856
|
height: 1,
|
|
1847
1857
|
wrap: t.CLAMP_TO_EDGE
|
|
1848
1858
|
}, a, r);
|
|
1849
|
-
}
|
|
1850
|
-
|
|
1859
|
+
}
|
|
1860
|
+
if (f(e)) return Jo(i ? Array.from(e).reverse() : e, t, n, r);
|
|
1861
|
+
throw Error("Unknown scheme: " + a);
|
|
1851
1862
|
}
|
|
1852
1863
|
}
|
|
1853
1864
|
function Ko(e, t = "rgb", n, r) {
|
|
1854
|
-
let i = Yo(de(e,
|
|
1865
|
+
let i = Yo(de(e, C(t) ? t : t.type, C(t) ? void 0 : t.gamma));
|
|
1855
1866
|
return Gs(n, {
|
|
1856
1867
|
minMag: n.LINEAR,
|
|
1857
1868
|
format: n.RGB,
|
|
@@ -1878,13 +1889,13 @@ function Jo(e, t, n, r) {
|
|
|
1878
1889
|
}, i, r);
|
|
1879
1890
|
}
|
|
1880
1891
|
function Yo(e, { extent: t = [0, 1], reverse: n = !1, count: r = 256 } = {}) {
|
|
1881
|
-
let
|
|
1882
|
-
return n &&
|
|
1892
|
+
let a = t[0], o = i(t) - a, c = s(r).map((e) => e / (r - 1)).map((e) => a + e / o).map(e);
|
|
1893
|
+
return n && c.reverse(), Xo(c);
|
|
1883
1894
|
}
|
|
1884
1895
|
function Xo(e, t) {
|
|
1885
1896
|
let n = Math.max(e.length, t || 0), r = new Uint8Array(n * 3);
|
|
1886
1897
|
for (let t = 0; t < n; t++) {
|
|
1887
|
-
let n = e[t % e.length], i =
|
|
1898
|
+
let n = e[t % e.length], i = m(n);
|
|
1888
1899
|
if (!i) throw Error(`Invalid color "${n}" in the scheme ${JSON.stringify(e)}!`);
|
|
1889
1900
|
let a = i.rgb();
|
|
1890
1901
|
r[t * 3 + 0] = a.r, r[t * 3 + 1] = a.g, r[t * 3 + 2] = a.b;
|
|
@@ -1892,7 +1903,7 @@ function Xo(e, t) {
|
|
|
1892
1903
|
return r;
|
|
1893
1904
|
}
|
|
1894
1905
|
function Zo(e) {
|
|
1895
|
-
let t =
|
|
1906
|
+
let t = m(e).rgb();
|
|
1896
1907
|
return [
|
|
1897
1908
|
t.r,
|
|
1898
1909
|
t.g,
|
|
@@ -1921,17 +1932,19 @@ function ds(e, t) {
|
|
|
1921
1932
|
}
|
|
1922
1933
|
function fs(e, t, n) {
|
|
1923
1934
|
let r;
|
|
1924
|
-
if (
|
|
1925
|
-
else if (
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
else if (n
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
+
if (u(e)) r = bs(S(e)(n));
|
|
1936
|
+
else if (C(n)) {
|
|
1937
|
+
if (v(e)) r = Cs(n);
|
|
1938
|
+
else throw Error(`String values are not supported on the "${e}" channel: ${n}`);
|
|
1939
|
+
} else if (y(n)) r = bs(+!!n);
|
|
1940
|
+
else if (n === null) {
|
|
1941
|
+
if (v(e)) r = bs([
|
|
1942
|
+
0,
|
|
1943
|
+
0,
|
|
1944
|
+
0
|
|
1945
|
+
]);
|
|
1946
|
+
else throw Error(`null value is not supported on the "${e}" chanel.`);
|
|
1947
|
+
} else r = bs(n);
|
|
1935
1948
|
let i = ds(e, t);
|
|
1936
1949
|
return {
|
|
1937
1950
|
channel: e,
|
|
@@ -1945,7 +1958,7 @@ ${r.type} ${i}() {
|
|
|
1945
1958
|
}
|
|
1946
1959
|
function ps(e, t) {
|
|
1947
1960
|
let n = "float", r = (e) => e;
|
|
1948
|
-
|
|
1961
|
+
v(e) ? (n = "vec3", r = (e) => Zo(e)) : u(e) && (r = S(e));
|
|
1949
1962
|
let i = `u${Ms(e)}_${t}`, a = ` // Dynamic value\n uniform ${n} ${i};`, o = ds(e, t);
|
|
1950
1963
|
return {
|
|
1951
1964
|
channel: e,
|
|
@@ -1988,39 +2001,39 @@ ${r} ${o}() {
|
|
|
1988
2001
|
}
|
|
1989
2002
|
function gs(e, t, n) {
|
|
1990
2003
|
t ??= he();
|
|
1991
|
-
let r =
|
|
1992
|
-
|
|
1993
|
-
let { transform: f } = cs(t.type),
|
|
2004
|
+
let r = oe(e), i = $o + r, a = es + r, { hp: o, attributeType: s } = $(t, e), c = t.domain ? w(t.type) ? ls(t).length : t.domain().length : void 0, l, u = [];
|
|
2005
|
+
u.push(""), u.push("/".repeat(70)), u.push(`// Channel: ${e}`), u.push("");
|
|
2006
|
+
let { transform: f } = cs(t.type), p = (e, ...t) => Ts.apply(null, [
|
|
1994
2007
|
e,
|
|
1995
2008
|
"value",
|
|
1996
2009
|
...t
|
|
1997
|
-
]),
|
|
2010
|
+
]), m;
|
|
1998
2011
|
switch (f) {
|
|
1999
2012
|
case "linear":
|
|
2000
|
-
|
|
2013
|
+
m = p("scaleLinear", "domain", a);
|
|
2001
2014
|
break;
|
|
2002
2015
|
case "log":
|
|
2003
|
-
|
|
2016
|
+
m = p("scaleLog", "domain", a, t.base());
|
|
2004
2017
|
break;
|
|
2005
2018
|
case "symlog":
|
|
2006
|
-
|
|
2019
|
+
m = p("scaleSymlog", "domain", a, t.constant());
|
|
2007
2020
|
break;
|
|
2008
2021
|
case "pow":
|
|
2009
2022
|
case "sqrt":
|
|
2010
|
-
|
|
2023
|
+
m = p("scalePow", "domain", a, t.exponent());
|
|
2011
2024
|
break;
|
|
2012
2025
|
case "index":
|
|
2013
2026
|
case "locus":
|
|
2014
|
-
|
|
2027
|
+
m = p("scaleBandHp", "domain", a, t.paddingInner(), t.paddingOuter(), t.align(), n.band ?? .5);
|
|
2015
2028
|
break;
|
|
2016
2029
|
case "point":
|
|
2017
2030
|
case "band":
|
|
2018
|
-
|
|
2031
|
+
m = p("scaleBand", "domain", a, t.paddingInner(), t.paddingOuter(), t.align(), n.band ?? .5);
|
|
2019
2032
|
break;
|
|
2020
2033
|
case "ordinal":
|
|
2021
2034
|
case "null":
|
|
2022
2035
|
case "identity":
|
|
2023
|
-
|
|
2036
|
+
m = p("scaleIdentity");
|
|
2024
2037
|
break;
|
|
2025
2038
|
case "threshold":
|
|
2026
2039
|
case "quantize": break;
|
|
@@ -2029,48 +2042,48 @@ function gs(e, t, n) {
|
|
|
2029
2042
|
let g = Ns(t, e), _;
|
|
2030
2043
|
if (g && e == r) {
|
|
2031
2044
|
let e = t.props.range ?? [];
|
|
2032
|
-
if (
|
|
2045
|
+
if (d(e) || e.some(d)) {
|
|
2033
2046
|
if (g.length < 1 || g.length > 4) throw Error(`A range with ExprRefs must have 1-4 elements, not ${g.length}! Range: ${JSON.stringify(g)}`);
|
|
2034
|
-
_ = ` uniform ${xs(g.length)} ${
|
|
2035
|
-
} else if (g.length && g.every(
|
|
2047
|
+
_ = ` uniform ${xs(g.length)} ${a};`;
|
|
2048
|
+
} else if (g.length && g.every(h)) {
|
|
2036
2049
|
let e = ws(g);
|
|
2037
|
-
|
|
2050
|
+
u.push(`const ${e.type} ${a} = ${e};`);
|
|
2038
2051
|
}
|
|
2039
2052
|
}
|
|
2040
|
-
let
|
|
2041
|
-
if (
|
|
2053
|
+
let ee = Ss(e), te;
|
|
2054
|
+
if (v(e)) {
|
|
2042
2055
|
let n = is + r;
|
|
2043
|
-
if (e == r &&
|
|
2044
|
-
else if (pe(t.type) || w(t.type))
|
|
2056
|
+
if (e == r && u.push(`uniform sampler2D ${n};`), T(t.type)) te = `getInterpolatedColor(${n}, transformed)`;
|
|
2057
|
+
else if (pe(t.type) || w(t.type)) te = `getDiscreteColor(${n}, int(transformed))`;
|
|
2045
2058
|
else throw Error("Problem with color scale!");
|
|
2046
2059
|
} else if (t.type === "ordinal" || w(t.type)) {
|
|
2047
2060
|
let t = is + r;
|
|
2048
|
-
e == r &&
|
|
2061
|
+
e == r && u.push(`uniform sampler2D ${t};`), te = `getDiscreteColor(${t}, int(transformed)).r`;
|
|
2049
2062
|
}
|
|
2050
|
-
let
|
|
2051
|
-
if (
|
|
2063
|
+
let y = [], b = T(t.type) && c > 2, x = w(t.type) || b;
|
|
2064
|
+
if (y.push("int slot = 0;"), x) {
|
|
2052
2065
|
let e = i;
|
|
2053
|
-
|
|
2066
|
+
y.push(b ? `while (slot < ${e}.length() - 2 && value >= ${e}[slot + 1]) { slot++; }` : `while (slot < ${e}.length() && value >= ${e}[slot]) { slot++; }`);
|
|
2054
2067
|
}
|
|
2055
|
-
let
|
|
2056
|
-
if (
|
|
2068
|
+
let ne = T(t.type) || w(t.type) || ["band", "point"].includes(t.type);
|
|
2069
|
+
if (m) {
|
|
2057
2070
|
let e = i;
|
|
2058
|
-
|
|
2059
|
-
} else
|
|
2060
|
-
"clamp" in t && t.clamp() &&
|
|
2061
|
-
${
|
|
2062
|
-
${
|
|
2071
|
+
ne && (o ? y.push(`vec3 domain = ${e};`) : y.push(`vec2 domain = vec2(${e}[slot], ${e}[slot + 1]);`)), y.push(`float transformed = ${m};`), b && y.push(`transformed = (float(slot) + transformed) / (float(${e}.length() - 1));`);
|
|
2072
|
+
} else y.push("float transformed = float(slot);");
|
|
2073
|
+
"clamp" in t && t.clamp() && y.push(`transformed = clampToRange(transformed, ${ws(g)});`), y.push(`return ${te ?? "transformed"};`), u.push(`
|
|
2074
|
+
${ee} ${ns}${e}(${s} value) {
|
|
2075
|
+
${y.map((e) => ` ${e}\n`).join("")}
|
|
2063
2076
|
}`);
|
|
2064
|
-
let
|
|
2065
|
-
if (
|
|
2066
|
-
let e = T(t.type) || w(t.type) ?
|
|
2067
|
-
|
|
2077
|
+
let S = u.join("\n");
|
|
2078
|
+
if (ne && e == r) {
|
|
2079
|
+
let e = T(t.type) || w(t.type) ? c : 2;
|
|
2080
|
+
l = o ? ` highp vec3 ${i};` : ` mediump float ${i}[${e}];`;
|
|
2068
2081
|
}
|
|
2069
2082
|
return {
|
|
2070
|
-
glsl:
|
|
2083
|
+
glsl: S,
|
|
2071
2084
|
domainUniformName: i,
|
|
2072
|
-
domainUniform:
|
|
2073
|
-
rangeUniformName:
|
|
2085
|
+
domainUniform: l,
|
|
2086
|
+
rangeUniformName: a,
|
|
2074
2087
|
rangeUniform: _
|
|
2075
2088
|
};
|
|
2076
2089
|
}
|
|
@@ -2090,7 +2103,7 @@ function vs(e, t) {
|
|
|
2090
2103
|
return "all" in e ? `(${e.all.map((e) => vs(e, t)).join(" && ")})` : "any" in e ? `(${e.any.map((e) => vs(e, t)).join(" || ")})` : "not" in e ? `(!${vs(e.not, t)})` : "selectionActive" in e ? `(!${ss}${e.selectionActive.param}())` : t?.(e) ?? `isSelectionMember_${e.param}() || (${e.empty} && isSelectionEmpty_${e.param}())`;
|
|
2091
2104
|
}
|
|
2092
2105
|
function ys(e) {
|
|
2093
|
-
if (!
|
|
2106
|
+
if (!h(e)) throw Error(`Not a number: ${e}`);
|
|
2094
2107
|
if (e == Infinity) return "3.402823466e+38";
|
|
2095
2108
|
if (e == -Infinity) return "-3.402823466e+38";
|
|
2096
2109
|
{
|
|
@@ -2118,17 +2131,17 @@ function xs(e) {
|
|
|
2118
2131
|
}
|
|
2119
2132
|
}
|
|
2120
2133
|
function Ss(e) {
|
|
2121
|
-
return
|
|
2134
|
+
return v(e) ? "vec3" : e == "uniqueId" ? "uint" : "float";
|
|
2122
2135
|
}
|
|
2123
2136
|
function Cs(e) {
|
|
2124
2137
|
return bs(Zo(e));
|
|
2125
2138
|
}
|
|
2126
2139
|
function ws(e) {
|
|
2127
|
-
return bs([e[0],
|
|
2140
|
+
return bs([e[0], i(e)]);
|
|
2128
2141
|
}
|
|
2129
2142
|
function Ts(e, ...t) {
|
|
2130
2143
|
let n = [];
|
|
2131
|
-
for (let e of t)
|
|
2144
|
+
for (let e of t) h(e) ? n.push(ys(e)) : f(e) ? n.push(bs(e)) : n.push(e);
|
|
2132
2145
|
return `${e}(${n.join(", ")})`;
|
|
2133
2146
|
}
|
|
2134
2147
|
function $(e, t) {
|
|
@@ -2155,8 +2168,7 @@ function $(e, t) {
|
|
|
2155
2168
|
largeHp: i
|
|
2156
2169
|
});
|
|
2157
2170
|
}
|
|
2158
|
-
var Es =
|
|
2159
|
-
Es - 1;
|
|
2171
|
+
var Es = 4096;
|
|
2160
2172
|
function Ds(e, t = []) {
|
|
2161
2173
|
let n = e % Es;
|
|
2162
2174
|
return t[0] = (e - n) / Es, t[1] = n, t;
|
|
@@ -2169,7 +2181,7 @@ function ks(e) {
|
|
|
2169
2181
|
return [...Os(e[0]), e[1] - e[0]];
|
|
2170
2182
|
}
|
|
2171
2183
|
function As(e) {
|
|
2172
|
-
let t = new
|
|
2184
|
+
let t = new x([], JSON.stringify);
|
|
2173
2185
|
for (let [n, r] of Object.entries(e)) {
|
|
2174
2186
|
let e = r.channelDef;
|
|
2175
2187
|
if (ce(e)) {
|
|
@@ -2180,12 +2192,12 @@ function As(e) {
|
|
|
2180
2192
|
return t;
|
|
2181
2193
|
}
|
|
2182
2194
|
function js(e) {
|
|
2183
|
-
return Qo +
|
|
2195
|
+
return Qo + l(e).toSorted().join("_");
|
|
2184
2196
|
}
|
|
2185
2197
|
function Ms(e) {
|
|
2186
2198
|
return e[0].toUpperCase() + e.slice(1);
|
|
2187
2199
|
}
|
|
2188
|
-
var Ns = (e, t) => fe(e.type) || T(e.type) &&
|
|
2200
|
+
var Ns = (e, t) => fe(e.type) || T(e.type) && v(t) ? [0, 1] : e.range ? e.range() : void 0;
|
|
2189
2201
|
function Ps(e, t) {
|
|
2190
2202
|
if (e.length != t.length) throw Error("Unequal array lengths");
|
|
2191
2203
|
let n = e.length;
|
|
@@ -2320,7 +2332,7 @@ var Hs = class {
|
|
|
2320
2332
|
return this._canvasSizeHelper.invalidate(), this.adjustGl();
|
|
2321
2333
|
}
|
|
2322
2334
|
compileShader(e, t) {
|
|
2323
|
-
|
|
2335
|
+
f(t) && (t = t.join("\n\n"));
|
|
2324
2336
|
let n = this.gl, r = t.replaceAll(/ {2,}|^\s*\/\/.*$/gm, ""), i = this._shaderCache.get(r);
|
|
2325
2337
|
if (!i) {
|
|
2326
2338
|
let a = [
|
|
@@ -2373,19 +2385,20 @@ var Hs = class {
|
|
|
2373
2385
|
return pe(t.type) ? t.domain().length : t.type == "threshold" || t.type == "quantize" ? us(t) : t.type == "quantile" ? e ?? 4 : e;
|
|
2374
2386
|
}
|
|
2375
2387
|
let i = e.channel;
|
|
2376
|
-
if (
|
|
2388
|
+
if (v(i)) {
|
|
2377
2389
|
let t = e.getScale(), i = t.props, a = t.range(), o;
|
|
2378
|
-
if (i.scheme)
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2390
|
+
if (i.scheme) {
|
|
2391
|
+
if (pe(t.type) || w(t.type)) o = Jo(a, this.gl, us(t), n);
|
|
2392
|
+
else {
|
|
2393
|
+
let e = C(i.scheme) ? void 0 : i.scheme.count;
|
|
2394
|
+
e = r(e, t), o = Go(i.scheme, this.gl, e, n, !!i.reverse);
|
|
2395
|
+
}
|
|
2396
|
+
} else o = fe(t.type) || T(t.type) && a.length > 1 ? Ko(a, i.interpolate, this.gl, n) : Jo(a, this.gl, w(t.type) ? us(t) : t.domain().length, n);
|
|
2384
2397
|
this.rangeTextures.set(t, o), this._ownedTextures.add(o);
|
|
2385
2398
|
} else {
|
|
2386
2399
|
let t = e.getScale();
|
|
2387
2400
|
if (t.type === "ordinal" || w(t.type)) {
|
|
2388
|
-
let e =
|
|
2401
|
+
let e = u(i) ? S(i) : (e) => e, r = qo(t.range().map(e), this.gl, w(t.type) ? us(t) : t.domain().length, n);
|
|
2389
2402
|
this.rangeTextures.set(t, r), this._ownedTextures.add(r);
|
|
2390
2403
|
}
|
|
2391
2404
|
}
|
|
@@ -2471,7 +2484,7 @@ var qs = class extends we {
|
|
|
2471
2484
|
#f;
|
|
2472
2485
|
constructor(e, t) {
|
|
2473
2486
|
if (super(e), this.#i = t.webGLHelper, this.#a = t.markAdapter, this.#r = t.framebufferInfo, this.#u = t.devicePixelRatio, this.#d = t.canvasSize, this.#c = t.markPredicate ?? (() => !0), this.#f = t.pixelOffset, t.clearColor) {
|
|
2474
|
-
let e =
|
|
2487
|
+
let e = m(t.clearColor).rgb();
|
|
2475
2488
|
this.#e = [
|
|
2476
2489
|
e.r / 255,
|
|
2477
2490
|
e.g / 255,
|
|
@@ -2488,7 +2501,7 @@ var qs = class extends we {
|
|
|
2488
2501
|
}
|
|
2489
2502
|
renderMark(e, t) {
|
|
2490
2503
|
if (!this.#c(e) || this.globalOptions.picking && !e.isPickingParticipant()) return;
|
|
2491
|
-
let n =
|
|
2504
|
+
let n = ne(t);
|
|
2492
2505
|
this.#n.push({
|
|
2493
2506
|
mark: e,
|
|
2494
2507
|
options: t,
|
|
@@ -2548,7 +2561,7 @@ var qs = class extends we {
|
|
|
2548
2561
|
let m, h, g;
|
|
2549
2562
|
for (let e of u) {
|
|
2550
2563
|
let a = e.coords;
|
|
2551
|
-
(!a.equals(m) || !
|
|
2564
|
+
(!a.equals(m) || !b(e.clip, h) || !b(e.cullClip, g)) && this.#t.push(r(() => {
|
|
2552
2565
|
t = c.setViewport(this.#d, this.#u, a, e.clip, e.cullClip, this.#f);
|
|
2553
2566
|
}));
|
|
2554
2567
|
let { callback: o, orderCallbacks: s } = e, l = s ? () => {
|
|
@@ -2788,16 +2801,16 @@ var oc = "flat out lowp vec4 vFillColor;\nflat out lowp vec4 vStrokeColor;\nflat
|
|
|
2788
2801
|
this.dataUpdaters.push((t.arrayReference, (e) => n(r(e))));
|
|
2789
2802
|
}
|
|
2790
2803
|
createUpdater(e, t, n = Float32Array, r = void 0) {
|
|
2791
|
-
if (!
|
|
2792
|
-
let i,
|
|
2804
|
+
if (!h(this.size)) throw Error("The number of vertices must be defined!");
|
|
2805
|
+
let i, a, o = 0, s = new n(this.size * t);
|
|
2793
2806
|
if (this.arrays[e] = {
|
|
2794
|
-
data:
|
|
2807
|
+
data: s,
|
|
2795
2808
|
numComponents: t
|
|
2796
2809
|
}, t == 1) {
|
|
2797
2810
|
let e = 0;
|
|
2798
2811
|
i = () => {
|
|
2799
|
-
|
|
2800
|
-
},
|
|
2812
|
+
s[o++] = e;
|
|
2813
|
+
}, a = (t) => {
|
|
2801
2814
|
e = +t;
|
|
2802
2815
|
};
|
|
2803
2816
|
} else {
|
|
@@ -2808,23 +2821,23 @@ var oc = "flat out lowp vec4 vFillColor;\nflat out lowp vec4 vStrokeColor;\nflat
|
|
|
2808
2821
|
case 1: break;
|
|
2809
2822
|
case 2:
|
|
2810
2823
|
i = () => {
|
|
2811
|
-
|
|
2812
|
-
},
|
|
2824
|
+
s[o++] = e[0], s[o++] = e[1];
|
|
2825
|
+
}, a = n;
|
|
2813
2826
|
break;
|
|
2814
2827
|
case 3:
|
|
2815
2828
|
i = () => {
|
|
2816
|
-
|
|
2817
|
-
},
|
|
2829
|
+
s[o++] = e[0], s[o++] = e[1], s[o++] = e[2];
|
|
2830
|
+
}, a = n;
|
|
2818
2831
|
break;
|
|
2819
2832
|
case 4:
|
|
2820
2833
|
i = () => {
|
|
2821
|
-
|
|
2822
|
-
},
|
|
2834
|
+
s[o++] = e[0], s[o++] = e[1], s[o++] = e[2], s[o++] = e[3];
|
|
2835
|
+
}, a = n;
|
|
2823
2836
|
break;
|
|
2824
2837
|
default: throw Error("Invalid numComponents: " + t);
|
|
2825
2838
|
}
|
|
2826
2839
|
}
|
|
2827
|
-
return this.pushers.push(i),
|
|
2840
|
+
return this.pushers.push(i), a;
|
|
2828
2841
|
}
|
|
2829
2842
|
pushAll() {
|
|
2830
2843
|
throw Error("Call configure() first!");
|
|
@@ -2904,7 +2917,7 @@ function hc(e, t, n, r = n, i = 0, a = i) {
|
|
|
2904
2917
|
c.fill(0);
|
|
2905
2918
|
let l = t[0], u = (t[1] - t[0]) / e, d = (t, n) => {
|
|
2906
2919
|
let r = (t - l) / u, i = Math.floor(r);
|
|
2907
|
-
return
|
|
2920
|
+
return g(n && i == r ? i - 1 : i, 0, e - 1);
|
|
2908
2921
|
}, f = mc, p = -Infinity, m = !1, h = (e, t, n = [0, 0]) => {
|
|
2909
2922
|
let r = d(e, !1), i = d(t, !0), a = s[r], o = Math.max(c[i], a);
|
|
2910
2923
|
return n[0] = a, n[1] = o, n;
|
|
@@ -2927,8 +2940,8 @@ function hc(e, t, n, r = n, i = 0, a = i) {
|
|
|
2927
2940
|
}
|
|
2928
2941
|
if (m) return;
|
|
2929
2942
|
for (let e = 1; e < c.length; e++) c[e] < c[e - 1] && (c[e] = c[e - 1]);
|
|
2930
|
-
let
|
|
2931
|
-
for (let e = s.length - 1; e > 0; e--)
|
|
2943
|
+
let _ = !0;
|
|
2944
|
+
for (let e = s.length - 1; e > 0; e--) _ && s[e] == pc ? (s[e] = c[e], _ = !1) : s[e - 1] > s[e] && (s[e - 1] = s[e]);
|
|
2932
2945
|
return h;
|
|
2933
2946
|
}
|
|
2934
2947
|
//#endregion
|
|
@@ -2939,33 +2952,35 @@ var gc = class {
|
|
|
2939
2952
|
let r = [...As(e).entries()].filter(([e, t]) => e[1] && t.length > 1).map(([e, t]) => t);
|
|
2940
2953
|
this.allocatedVertices = t, this.variableBuilder = new uc(t), this.attributeNames = {};
|
|
2941
2954
|
for (let [e, t] of Object.entries(this.variableEncoders)) {
|
|
2942
|
-
let n =
|
|
2955
|
+
let n = p(t);
|
|
2943
2956
|
if (!n) continue;
|
|
2944
2957
|
let i = r.find((t) => t.find((t) => t == e)), a = n.asNumberAccessor(), o = t.scale, { largeHp: s, arrayConstructor: c, discrete: l, numComponents: u } = $(o, e), d = [0, 0], f;
|
|
2945
|
-
if (o && l)
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2958
|
+
if (o && l) {
|
|
2959
|
+
if ("props" in o && o.props.domainIndexer) f = o.props.domainIndexer;
|
|
2960
|
+
else if ("domain" in o) f = ve(), f.addAll(o.domain());
|
|
2961
|
+
else throw Error("Missing domain indexer for discrete scale.");
|
|
2962
|
+
}
|
|
2963
|
+
let m = f ? (e) => f(n(e)) : s ? (e) => Ds(a(e), d) : a, h = js(i ?? e);
|
|
2949
2964
|
for (let t of i ?? [e]) this.attributeNames[t] = h;
|
|
2950
2965
|
i && e != i[0] || this.variableBuilder.addConverter(h, {
|
|
2951
|
-
f:
|
|
2966
|
+
f: m,
|
|
2952
2967
|
numComponents: u,
|
|
2953
2968
|
arrayReference: s ? d : void 0,
|
|
2954
2969
|
targetArrayType: c
|
|
2955
2970
|
});
|
|
2956
2971
|
}
|
|
2957
|
-
let i = this.variableEncoders.x, a = this.variableEncoders.x2,
|
|
2958
|
-
if (
|
|
2972
|
+
let i = this.variableEncoders.x, a = this.variableEncoders.x2, o = this.encoders.x?.channelDef, s = i?.scale;
|
|
2973
|
+
if (o?.buildIndex && i && s && T(s.type)) {
|
|
2959
2974
|
let e = this.attributeNames.x;
|
|
2960
2975
|
if (!e) throw Error("Missing x attribute for x indexing.");
|
|
2961
2976
|
let t = a?.scale && T(a.scale.type) ? this.attributeNames.x2 ?? e : e;
|
|
2962
2977
|
this.xIndexConfig = {
|
|
2963
|
-
domain: [
|
|
2978
|
+
domain: [s.domain()[0], s.domain()[1]],
|
|
2964
2979
|
xAttributeName: e,
|
|
2965
2980
|
x2AttributeName: t
|
|
2966
2981
|
};
|
|
2967
2982
|
} else this.xIndexConfig = void 0;
|
|
2968
|
-
this.lastOffset = 0, this.rangeMap = new
|
|
2983
|
+
this.lastOffset = 0, this.rangeMap = new x([], JSON.stringify);
|
|
2969
2984
|
}
|
|
2970
2985
|
registerBatch(e) {
|
|
2971
2986
|
let t = this.lastOffset, n = this.variableBuilder.vertexCount, r = n - t;
|
|
@@ -3079,14 +3094,14 @@ var gc = class {
|
|
|
3079
3094
|
return super.toArrays();
|
|
3080
3095
|
}
|
|
3081
3096
|
}, xc = class extends gc {
|
|
3082
|
-
constructor({ encoders: e, attributes: t, fontMetrics: n, properties:
|
|
3097
|
+
constructor({ encoders: e, attributes: t, fontMetrics: n, properties: i, numCharacters: a = void 0 }) {
|
|
3083
3098
|
super({
|
|
3084
3099
|
encoders: e,
|
|
3085
3100
|
attributes: t,
|
|
3086
|
-
numVertices:
|
|
3087
|
-
}), this.metadata = n, this.metrics = n, this.properties =
|
|
3088
|
-
let
|
|
3089
|
-
this.numberFormat = !
|
|
3101
|
+
numVertices: a * 6
|
|
3102
|
+
}), this.metadata = n, this.metrics = n, this.properties = i;
|
|
3103
|
+
let o = e.text.channelDef;
|
|
3104
|
+
this.numberFormat = !c(o) && "format" in o && o.format ? r(o.format) : (e) => e, this.updateVertexCoord = this.variableBuilder.createUpdater("vertexCoord", 2), this.updateTextureCoord = this.variableBuilder.createUpdater("textureCoord", 2), this.updateWidth = this.variableBuilder.createUpdater("width", 1), this.variableBuilder.configure();
|
|
3090
3105
|
}
|
|
3091
3106
|
addBatch(e, t, n = 0, r = t.length) {
|
|
3092
3107
|
let i = this.properties.align || "left", a = this.properties.logoLetters ?? !1, o = this.metadata.common.base, s = this.metadata.common.scaleH, c = -5;
|
|
@@ -3097,17 +3112,14 @@ var gc = class {
|
|
|
3097
3112
|
case "middle":
|
|
3098
3113
|
c += this.metrics.capHeight / 2;
|
|
3099
3114
|
break;
|
|
3100
|
-
case "bottom":
|
|
3101
|
-
c -= this.metrics.descent;
|
|
3102
|
-
break;
|
|
3103
|
-
default:
|
|
3115
|
+
case "bottom": c -= this.metrics.descent;
|
|
3104
3116
|
}
|
|
3105
3117
|
let l = this.encoders.text, u = [0, 0];
|
|
3106
3118
|
this.updateVertexCoord(u);
|
|
3107
3119
|
let d = [0, 0];
|
|
3108
3120
|
this.updateTextureCoord(d);
|
|
3109
3121
|
for (let e = n; e < r; e++) {
|
|
3110
|
-
let n = t[e], r = this.numberFormat(l(n)), f =
|
|
3122
|
+
let n = t[e], r = this.numberFormat(l(n)), f = C(r) ? r : r === null ? "" : "" + r;
|
|
3111
3123
|
if (f.length == 0) continue;
|
|
3112
3124
|
this.variableBuilder.updateFromDatum(n);
|
|
3113
3125
|
let p = a ? f.length : this.metrics.measureWidth(f);
|
|
@@ -3117,16 +3129,16 @@ var gc = class {
|
|
|
3117
3129
|
let e = this.metrics.getCharByCode(f.charCodeAt(0));
|
|
3118
3130
|
m -= (e.width - e.xadvance) / o / 2;
|
|
3119
3131
|
}
|
|
3120
|
-
let h,
|
|
3132
|
+
let h, g, _;
|
|
3121
3133
|
for (let e = 0; e < f.length; e++) {
|
|
3122
3134
|
let t = this.metrics.getCharByCode(f.charCodeAt(e)), n = a ? 1 : t.xadvance / o;
|
|
3123
3135
|
if (t.id == 32) {
|
|
3124
3136
|
m += n;
|
|
3125
3137
|
continue;
|
|
3126
3138
|
}
|
|
3127
|
-
a ? (
|
|
3139
|
+
a ? (_ = (t.width + 10) / t.width, m = -_ / 2, g = (t.height + 10) / t.height, h = -.5 - 5 / t.height) : (g = t.height / o, h = -(t.height + t.yoffset + c) / o, _ = t.width / o);
|
|
3128
3140
|
let r = t.x, i = t.y;
|
|
3129
|
-
u[0] = m, u[1] = h +
|
|
3141
|
+
u[0] = m, u[1] = h + g, d[0] = r / s, d[1] = i / s, this.variableBuilder.pushAll(), u[0] = m + _, u[1] = h + g, d[0] = (r + t.width) / s, d[1] = i / s, this.variableBuilder.pushAll(), u[0] = m, u[1] = h, d[0] = r / s, d[1] = (i + t.height) / s, this.variableBuilder.pushAll(), u[0] = m + _, u[1] = h + g, d[0] = (r + t.width) / s, d[1] = i / s, this.variableBuilder.pushAll(), u[0] = m, u[1] = h, d[0] = r / s, d[1] = (i + t.height) / s, this.variableBuilder.pushAll(), u[0] = m + _, u[1] = h, d[0] = (r + t.width) / s, d[1] = (i + t.height) / s, this.variableBuilder.pushAll(), m += n;
|
|
3130
3142
|
}
|
|
3131
3143
|
}
|
|
3132
3144
|
this.registerBatch(e);
|
|
@@ -3188,48 +3200,48 @@ var Pc = class {
|
|
|
3188
3200
|
if (this.encoders.facetIndex) return Ac;
|
|
3189
3201
|
if (this.unitView.usesSampleFacetRendering()) return kc;
|
|
3190
3202
|
}
|
|
3191
|
-
createAndLinkShaders(
|
|
3192
|
-
let l = this.getAttributes(), u = this.encoders,
|
|
3193
|
-
|
|
3194
|
-
let h = "// view: " + this.unitView.getPathString(), g = [],
|
|
3203
|
+
createAndLinkShaders(r, i, s = []) {
|
|
3204
|
+
let l = this.getAttributes(), u = this.encoders, f = this.mark.getOrder(), p = this.getSampleFacetMode(), m = !!this.properties.cullByVisibleRange;
|
|
3205
|
+
p && s.push(`#define ${p}`), m && s.push("#define VISIBLE_RANGE_CULLING");
|
|
3206
|
+
let h = "// view: " + this.unitView.getPathString(), g = [], v = /* @__PURE__ */ new Set(), y = As(u), b = (e) => {
|
|
3195
3207
|
for (let [t, n] of y.entries()) if (t[1] && n.includes(e)) return js(n);
|
|
3196
3208
|
return js(e);
|
|
3197
|
-
},
|
|
3198
|
-
for (let e of
|
|
3199
|
-
Array.from(
|
|
3209
|
+
}, x = [], ne = e(u), S = new Set(ne.flatMap(o));
|
|
3210
|
+
for (let e of f?.params ?? []) S.add(e);
|
|
3211
|
+
Array.from(S).some((e) => {
|
|
3200
3212
|
let t = this.unitView.paramRuntime.findValue(e);
|
|
3201
|
-
return
|
|
3202
|
-
}) && (g.push("bool selectionLeq(uvec2 a, uvec2 b) { return a.x < b.x || (a.x == b.x && a.y <= b.y); }"), g.push("bool selectionLt(uvec2 a, uvec2 b) { return a.x < b.x || (a.x == b.x && a.y < b.y); }")),
|
|
3203
|
-
for (let e of
|
|
3204
|
-
let
|
|
3205
|
-
if (!
|
|
3213
|
+
return a(t) && Object.keys(t.intervals).some((e) => $(this.unitView.getScaleResolution(e).getScale(), e).largeHp);
|
|
3214
|
+
}) && (g.push("bool selectionLeq(uvec2 a, uvec2 b) { return a.x < b.x || (a.x == b.x && a.y <= b.y); }"), g.push("bool selectionLt(uvec2 a, uvec2 b) { return a.x < b.x || (a.x == b.x && a.y < b.y); }")), f && (s.push("#define CONDITIONAL_ORDER"), x.push(" // Conditional order pass"), x.push(" uniform int uOrderMode;"));
|
|
3215
|
+
for (let e of S) {
|
|
3216
|
+
let r = this.unitView.paramRuntime, i = r.findValue(e);
|
|
3217
|
+
if (!i) throw Error(`Cannot infer selection type as the parameter "${e}" has no value. Please ensure that the parameter is properly defined!`);
|
|
3206
3218
|
let o = js("uniqueId");
|
|
3207
|
-
if (n(
|
|
3219
|
+
if (n(i)) {
|
|
3208
3220
|
let n = as + t(e);
|
|
3209
|
-
|
|
3221
|
+
x.push(" // Selection parameter"), x.push(` uniform highp uint ${n};`), this.#e.push(() => {
|
|
3210
3222
|
this.registerMarkUniformValue(n, { expr: e }, (e) => e.uniqueId ?? 0);
|
|
3211
3223
|
}), g.push(`bool ${os}${e}() {\n return ${as}${e} != 0u && ${as}${e} == ${o};\n}`), g.push(`bool ${ss}${e}() {\n return ${as}${e} == 0u;\n}`);
|
|
3212
|
-
} else if (le(
|
|
3224
|
+
} else if (le(i)) {
|
|
3213
3225
|
let n = jc + t(e);
|
|
3214
3226
|
g.push(`// Selection texture\nuniform highp usampler2D ${n};`);
|
|
3215
|
-
let
|
|
3227
|
+
let a = this.glHelper, s = a.selectionTextures;
|
|
3216
3228
|
this.selectionTextureOps.push(() => {
|
|
3217
|
-
let t =
|
|
3218
|
-
if (!
|
|
3219
|
-
J(this.programInfo, { [n]:
|
|
3229
|
+
let t = r.getValue(e), i = s.get(t);
|
|
3230
|
+
if (!i) throw Error(`Bug: no selection texture found for "${e}"!`);
|
|
3231
|
+
J(this.programInfo, { [n]: i });
|
|
3220
3232
|
});
|
|
3221
3233
|
let c = jc + e;
|
|
3222
|
-
g.push(`bool ${os}${e}() {\n return hashContainsTexture(${c}, ${o});\n}`), g.push(`bool ${ss}${e}() {\n return isEmptyHashTexture(${c});\n}`),
|
|
3223
|
-
let t =
|
|
3224
|
-
|
|
3234
|
+
g.push(`bool ${os}${e}() {\n return hashContainsTexture(${c}, ${o});\n}`), g.push(`bool ${ss}${e}() {\n return isEmptyHashTexture(${c});\n}`), a.createSelectionTexture(i), r.watchExpression(e, () => {
|
|
3235
|
+
let t = r.getValue(e);
|
|
3236
|
+
a.createSelectionTexture(t), this.unitView.context.animator.requestRender();
|
|
3225
3237
|
});
|
|
3226
|
-
} else if (
|
|
3227
|
-
let n = Object.keys(
|
|
3238
|
+
} else if (a(i)) {
|
|
3239
|
+
let n = Object.keys(i.intervals).filter((e) => ["x", "y"].includes(e));
|
|
3228
3240
|
if (n.length == 0) throw new be(`Interval selection "${e}" has no supported x or y targets.`, this.unitView);
|
|
3229
3241
|
let r = [];
|
|
3230
3242
|
for (let i of n) {
|
|
3231
3243
|
let n = as + t(e) + `_${i}`, { attributeType: a, largeHp: o } = $(this.unitView.getScaleResolution(i).getScale(), i);
|
|
3232
|
-
|
|
3244
|
+
x.push(" // Selection parameter"), x.push(` uniform highp ${a}[2] ${n};`), this.#e.push(() => {
|
|
3233
3245
|
this.registerMarkUniformValue(n, { expr: e }, (e) => {
|
|
3234
3246
|
let t = e.intervals[i] ?? [1, 0];
|
|
3235
3247
|
return o ? t.flatMap((e) => Ds(e)) : t;
|
|
@@ -3239,9 +3251,9 @@ var Pc = class {
|
|
|
3239
3251
|
r.push(o ? `!selectionLeq(${s}, ${c})` : `${s} > ${c}`);
|
|
3240
3252
|
}
|
|
3241
3253
|
g.push(`bool ${ss}${e}() {\n return ${r.join(" || ")};\n}`);
|
|
3242
|
-
} else throw new be(`Unsupported selection type "${
|
|
3254
|
+
} else throw new be(`Unsupported selection type "${i.type}" for WebGL conditional encoding.`, this.unitView);
|
|
3243
3255
|
}
|
|
3244
|
-
let
|
|
3256
|
+
let C = (e) => {
|
|
3245
3257
|
let { param: t, empty: n } = e;
|
|
3246
3258
|
if (e.type !== "interval") return `(${os}${t}() || (${n} && ${ss}${t}()))`;
|
|
3247
3259
|
let r = e.projections.map((e) => {
|
|
@@ -3251,25 +3263,26 @@ var Pc = class {
|
|
|
3251
3263
|
return `((${i} && ${r.join(" && ")}) || (${n} && !${i}))`;
|
|
3252
3264
|
}, ie = (e, t, n, r) => {
|
|
3253
3265
|
let i = t.channelDef;
|
|
3254
|
-
if (
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3266
|
+
if (c(i)) {
|
|
3267
|
+
if (d(i.value)) {
|
|
3268
|
+
let { uniformName: t, uniformGlsl: r, accessorGlsl: a, adjuster: o } = ps(e, n);
|
|
3269
|
+
g.push(a), x.push(r), this.#e.push(() => {
|
|
3270
|
+
this.registerMarkUniformValue(t, i.value, o);
|
|
3271
|
+
});
|
|
3272
|
+
} else g.push(fs(e, n, i.value).accessorGlsl);
|
|
3273
|
+
} else if (_(i)) {
|
|
3261
3274
|
let { uniformName: t, uniformGlsl: a, accessorGlsl: o } = hs(e, r, n);
|
|
3262
|
-
|
|
3275
|
+
x.push(a), g.push(o);
|
|
3263
3276
|
let { largeHp: s, discrete: c } = $(r, e), l = c && "domain" in r ? (e) => r.domain().indexOf(e) : s ? Ds : (e) => +e;
|
|
3264
3277
|
this.#e.push(() => {
|
|
3265
3278
|
this.registerMarkUniformValue(t, i.datum, l);
|
|
3266
3279
|
});
|
|
3267
3280
|
} else if (ce(i)) {
|
|
3268
3281
|
let t = y.get([i.field, !0]), { attributeGlsl: a, accessorGlsl: o } = ms(e, r, n, t?.includes(e) ? t : void 0);
|
|
3269
|
-
|
|
3270
|
-
} else if (
|
|
3282
|
+
v.add(a), g.push(o);
|
|
3283
|
+
} else if (se(i)) {
|
|
3271
3284
|
let { attributeGlsl: t, accessorGlsl: i } = ms(e, r, n);
|
|
3272
|
-
|
|
3285
|
+
v.add(t), g.push(i);
|
|
3273
3286
|
} else throw new be(`Unsupported channel definition: ${JSON.stringify(i)}`, this.unitView);
|
|
3274
3287
|
};
|
|
3275
3288
|
for (let [e, t] of Object.entries(u)) {
|
|
@@ -3277,8 +3290,8 @@ var Pc = class {
|
|
|
3277
3290
|
let { branches: n, channelDef: r, scale: i } = t;
|
|
3278
3291
|
for (let t = 0; t < n.length; t++) ie(e, n[t].accessor, t, i);
|
|
3279
3292
|
if (i) {
|
|
3280
|
-
let t =
|
|
3281
|
-
g.push(o),
|
|
3293
|
+
let t = ee(r), n = t && t.resolutionChannel || e, a = re(n) ? this.unitView.getScaleResolution(n) : null, { glsl: o, domainUniform: s, domainUniformName: c, rangeUniform: l, rangeUniformName: u } = gs(e, i, r);
|
|
3294
|
+
g.push(o), x.push(s), x.push(l), l && this.#e.push(() => {
|
|
3282
3295
|
let t = this.createMarkUniformSetter(u), n = () => t(Ns(i, e));
|
|
3283
3296
|
this.registerScaleResolutionListener(a, "range", n), n();
|
|
3284
3297
|
}), s && this.#e.push(() => {
|
|
@@ -3289,34 +3302,34 @@ var Pc = class {
|
|
|
3289
3302
|
this.registerScaleResolutionListener(a, "domain", t), t();
|
|
3290
3303
|
});
|
|
3291
3304
|
}
|
|
3292
|
-
g.push(_s(e, n,
|
|
3305
|
+
g.push(_s(e, n, C));
|
|
3293
3306
|
}
|
|
3294
|
-
let ae =
|
|
3295
|
-
if (g.push("bool isDatumSelected() {\n" + (this.encoders.uniqueId && ae.length > 0 ? ` return ${ae.join(" || ")};` : " return false;") + "\n}"),
|
|
3296
|
-
let e = vs(
|
|
3307
|
+
let ae = ne.map((e) => vs(te(e), C));
|
|
3308
|
+
if (g.push("bool isDatumSelected() {\n" + (this.encoders.uniqueId && ae.length > 0 ? ` return ${ae.join(" || ")};` : " return false;") + "\n}"), f) {
|
|
3309
|
+
let e = vs(f.predicate.selection, C);
|
|
3297
3310
|
g.push(`bool isOrderMatch() {
|
|
3298
3311
|
return ${e};\n}`);
|
|
3299
3312
|
}
|
|
3300
|
-
let
|
|
3301
|
-
|
|
3313
|
+
let oe = "precision highp float;\nprecision highp int;", ue = (e) => e.replace("#pragma markUniforms", x.join("\n"));
|
|
3314
|
+
s = s.map(ue), r = ue(r), i = ue(i), r = ((e) => Nc(e, f ? " if (uOrderMode != 0 &&\n (((uOrderMode & 3) == 1) != isOrderMatch())) {\n gl_Position = vec4(100.0, 0.0, 0.0, 0.0);\n return;\n }" : ""))(r);
|
|
3302
3315
|
let de = [
|
|
3303
|
-
|
|
3316
|
+
oe,
|
|
3304
3317
|
h,
|
|
3305
|
-
...
|
|
3318
|
+
...s,
|
|
3306
3319
|
Sc,
|
|
3307
3320
|
Cc,
|
|
3308
|
-
[...
|
|
3321
|
+
[...v].join("\n"),
|
|
3309
3322
|
...g,
|
|
3310
3323
|
wc,
|
|
3311
3324
|
Tc,
|
|
3312
|
-
|
|
3325
|
+
r
|
|
3313
3326
|
], T = [
|
|
3314
|
-
|
|
3327
|
+
oe,
|
|
3315
3328
|
h,
|
|
3316
|
-
...
|
|
3329
|
+
...s,
|
|
3317
3330
|
Sc,
|
|
3318
3331
|
Ec,
|
|
3319
|
-
|
|
3332
|
+
i
|
|
3320
3333
|
], fe = this.gl;
|
|
3321
3334
|
this.programStatus = Ws(fe, this.glHelper.compileShader(fe.VERTEX_SHADER, de), this.glHelper.compileShader(fe.FRAGMENT_SHADER, T));
|
|
3322
3335
|
}
|
|
@@ -3345,10 +3358,10 @@ var Pc = class {
|
|
|
3345
3358
|
}
|
|
3346
3359
|
registerMarkUniformValue(e, t, n = (e) => e) {
|
|
3347
3360
|
let r = this.createMarkUniformSetter(e), i = (n) => {
|
|
3348
|
-
if (n == null) throw Error(`Trying to set null/undefined value for uniform: ${e}${
|
|
3361
|
+
if (n == null) throw Error(`Trying to set null/undefined value for uniform: ${e}${d(t) ? `Expr: ${t.expr}` : ""}`);
|
|
3349
3362
|
r(n);
|
|
3350
3363
|
};
|
|
3351
|
-
if (
|
|
3364
|
+
if (d(t)) {
|
|
3352
3365
|
let e, r = () => i(n(e(null)));
|
|
3353
3366
|
e = this.unitView.paramRuntime.watchExpression(t.expr, r), r();
|
|
3354
3367
|
} else i(n(t));
|
|
@@ -3486,7 +3499,7 @@ var Pc = class {
|
|
|
3486
3499
|
uDevicePixelRatio: t
|
|
3487
3500
|
}), $a(this.gl, this.programInfo, this.viewUniformInfo), !0;
|
|
3488
3501
|
}
|
|
3489
|
-
}, Fc = class extends
|
|
3502
|
+
}, Fc = class extends x {
|
|
3490
3503
|
constructor() {
|
|
3491
3504
|
super([], JSON.stringify);
|
|
3492
3505
|
}
|
|
@@ -3730,7 +3743,7 @@ var Jc = "flat out vec4 vColor;\n\n/** Stroke width */\nflat out float vSize;\n\
|
|
|
3730
3743
|
"ringsLarge"
|
|
3731
3744
|
], cl = class extends Pc {
|
|
3732
3745
|
get opaque() {
|
|
3733
|
-
return ye(this, "opaque", () => !this.#e() && !this.#t() && !this.properties.shadowOpacity &&
|
|
3746
|
+
return ye(this, "opaque", () => !this.#e() && !this.#t() && !this.properties.shadowOpacity && c(this.encoding.fillOpacity) && this.encoding.fillOpacity.value == 1 && this.properties.minOpacity == 1) && this.unitView.getEffectiveOpacity() == 1;
|
|
3734
3747
|
}
|
|
3735
3748
|
getAttributes() {
|
|
3736
3749
|
return [
|
|
@@ -3757,7 +3770,7 @@ var Jc = "flat out vec4 vColor;\n\n/** Stroke width */\nflat out float vSize;\n\
|
|
|
3757
3770
|
}
|
|
3758
3771
|
#t() {
|
|
3759
3772
|
let e = this.encoding.strokeWidth;
|
|
3760
|
-
return !(
|
|
3773
|
+
return !(c(e) && !e.value) || "condition" in e;
|
|
3761
3774
|
}
|
|
3762
3775
|
initializeGraphics() {
|
|
3763
3776
|
super.initializeGraphics();
|
|
@@ -3925,29 +3938,29 @@ var ml = "in mediump vec2 vertexCoord;\nin lowp vec2 textureCoord;\n\n// Width o
|
|
|
3925
3938
|
}
|
|
3926
3939
|
registerMarkUniformVector(e, t) {
|
|
3927
3940
|
let n = this.createMarkUniformSetter(e), r = [], i = () => n(r.map((e) => e()));
|
|
3928
|
-
for (let e of t) r.push(
|
|
3941
|
+
for (let e of t) r.push(d(e) ? this.unitView.paramRuntime.watchExpression(e.expr, i) : () => e);
|
|
3929
3942
|
i();
|
|
3930
3943
|
}
|
|
3931
3944
|
updateGraphicsData(e) {
|
|
3932
|
-
let t = e.getData(), n = this.encoding,
|
|
3945
|
+
let t = e.getData(), n = this.encoding, i = this.properties, a = d(i.logoLetters) ? this.unitView.paramRuntime.evaluateAndGet(i.logoLetters.expr) : i.logoLetters, o = this.encoders.text, s = 0, c = "format" in n.text ? r(n.text.format) : (e) => e;
|
|
3933
3946
|
for (let e of t) {
|
|
3934
|
-
let t =
|
|
3935
|
-
|
|
3947
|
+
let t = c(o(e)), n = C(t) ? t : t === null ? "" : "" + t;
|
|
3948
|
+
s += n && n.length || 0;
|
|
3936
3949
|
}
|
|
3937
|
-
let
|
|
3950
|
+
let l = new xc({
|
|
3938
3951
|
encoders: this.encoders,
|
|
3939
3952
|
attributes: this.getAttributes(),
|
|
3940
3953
|
properties: {
|
|
3941
|
-
align:
|
|
3942
|
-
baseline:
|
|
3943
|
-
logoLetters:
|
|
3954
|
+
align: i.align,
|
|
3955
|
+
baseline: i.baseline,
|
|
3956
|
+
logoLetters: a
|
|
3944
3957
|
},
|
|
3945
3958
|
fontMetrics: this.font.metrics,
|
|
3946
|
-
numCharacters: Math.max(
|
|
3959
|
+
numCharacters: Math.max(s, _l)
|
|
3947
3960
|
});
|
|
3948
|
-
|
|
3949
|
-
let
|
|
3950
|
-
this.rangeMap.migrateEntries(
|
|
3961
|
+
l.addBatches(e.facetBatches);
|
|
3962
|
+
let u = l.toArrays();
|
|
3963
|
+
this.rangeMap.migrateEntries(u.rangeMap), this.updateBufferInfo(u);
|
|
3951
3964
|
}
|
|
3952
3965
|
prepareRender(e) {
|
|
3953
3966
|
let t = super.prepareRender(e);
|
|
@@ -4101,7 +4114,7 @@ var Sl = class {
|
|
|
4101
4114
|
#l(e) {
|
|
4102
4115
|
for (let [t, n] of Object.entries(e.mark.encoders)) {
|
|
4103
4116
|
if (!n.scale) continue;
|
|
4104
|
-
let r =
|
|
4117
|
+
let r = ee(n.channelDef)?.resolutionChannel ?? t;
|
|
4105
4118
|
if (!re(r)) continue;
|
|
4106
4119
|
let i = e.mark.unitView.getScaleResolution(r);
|
|
4107
4120
|
if (!i || e.scaleResolutions.has(i)) continue;
|
|
@@ -4154,11 +4167,11 @@ function Cl({ runs: e, viewRoot: t, layoutResult: n, webGLHelper: r, markAdapter
|
|
|
4154
4167
|
pixelOffset: 0
|
|
4155
4168
|
});
|
|
4156
4169
|
d.collectRenderCommands(e), e.finish(), e.render();
|
|
4157
|
-
let n = Oe(t.bounds, s, l, u)
|
|
4158
|
-
De(t, n, s, Zs(c, f, "image/png", {
|
|
4170
|
+
let n = Oe(t.bounds, s, l, u), p = Zs(c, f, "image/png", {
|
|
4159
4171
|
...n,
|
|
4160
4172
|
unpremultiplyAlpha: !0
|
|
4161
|
-
})
|
|
4173
|
+
});
|
|
4174
|
+
De(t, n, s, p);
|
|
4162
4175
|
}
|
|
4163
4176
|
} finally {
|
|
4164
4177
|
c.bindFramebuffer(c.FRAMEBUFFER, null), c.deleteTexture(f.attachments[0]), c.deleteFramebuffer(f.framebuffer);
|
|
@@ -5357,7 +5370,7 @@ var Tl = {
|
|
|
5357
5370
|
weight: 400
|
|
5358
5371
|
}, Ol = class {
|
|
5359
5372
|
constructor(e, t) {
|
|
5360
|
-
this._prepareBitmap = e, this.fontRepository = "https://raw.githubusercontent.com/etiennepinchon/aframe-fonts/master/fonts/", this._fonts = new
|
|
5373
|
+
this._prepareBitmap = e, this.fontRepository = "https://raw.githubusercontent.com/etiennepinchon/aframe-fonts/master/fonts/", this._fonts = new x([], JSON.stringify), this._metadataPromises = /* @__PURE__ */ new Map(), this._fontPromises = /* @__PURE__ */ new Map(), this._promises = [];
|
|
5361
5374
|
let n = t && e?.(t);
|
|
5362
5375
|
this._defaultFontEntry = {
|
|
5363
5376
|
metrics: fc(Tl),
|
|
@@ -5431,7 +5444,7 @@ function kl(e, t, n) {
|
|
|
5431
5444
|
};
|
|
5432
5445
|
}
|
|
5433
5446
|
function Al(e) {
|
|
5434
|
-
if (
|
|
5447
|
+
if (C(e)) {
|
|
5435
5448
|
let t = El[e.toLowerCase()];
|
|
5436
5449
|
if (!t) throw Error("Unknown font weight: " + e);
|
|
5437
5450
|
return t;
|