@genome-spy/core 0.69.0 → 0.70.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/bundle/{AbortablePromiseCache-CcuMrnn7.js → AbortablePromiseCache-Dj0vzLnp.js} +4 -4
- package/dist/bundle/{browser-BRemItdO.js → browser-0iNU5Wit.js} +33 -33
- package/dist/bundle/index-BYsZN7b0.js +1597 -0
- package/dist/bundle/{index-Cq3QFUxX.js → index-C3kClAEN.js} +583 -593
- package/dist/bundle/{index-D-w7Mmt9.js → index-C7wOh6y1.js} +138 -140
- package/dist/bundle/index-CRaQAuki.js +326 -0
- package/dist/bundle/{index-D74H8TTz.js → index-D9v1PCj9.js} +1 -2
- package/dist/bundle/{index-BatuyGAI.js → index-GDOuv_D5.js} +75 -80
- package/dist/bundle/{index-DbJ0oeYM.js → index-Gt44EOIH.js} +160 -163
- package/dist/bundle/index.es.js +8802 -9058
- package/dist/bundle/index.js +123 -165
- package/dist/bundle/{unzip-NywezaRR.js → unzip-Bac01w6X.js} +1 -1
- package/dist/src/gl/colorUtils.d.ts +2 -1
- package/dist/src/gl/colorUtils.d.ts.map +1 -1
- package/dist/src/gl/colorUtils.js +15 -3
- package/dist/src/gl/colorUtils.test.d.ts +2 -0
- package/dist/src/gl/colorUtils.test.d.ts.map +1 -0
- package/dist/src/gl/webGLHelper.d.ts.map +1 -1
- package/dist/src/gl/webGLHelper.js +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -5
- package/dist/src/marks/mark.d.ts +0 -2
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +0 -8
- package/dist/src/marks/rect.d.ts.map +1 -1
- package/dist/src/marks/rect.js +0 -8
- package/dist/src/utils/deepEqual.d.ts +14 -0
- package/dist/src/utils/deepEqual.d.ts.map +1 -0
- package/dist/src/utils/deepEqual.js +63 -0
- package/dist/src/utils/deepEqual.test.d.ts +2 -0
- package/dist/src/utils/deepEqual.test.d.ts.map +1 -0
- package/dist/src/utils/fetchUtils.d.ts +27 -0
- package/dist/src/utils/fetchUtils.d.ts.map +1 -0
- package/dist/src/utils/fetchUtils.js +47 -0
- package/dist/src/utils/fetchUtils.test.d.ts +2 -0
- package/dist/src/utils/fetchUtils.test.d.ts.map +1 -0
- package/dist/src/utils/url.d.ts +12 -0
- package/dist/src/utils/url.d.ts.map +1 -1
- package/dist/src/utils/url.js +45 -0
- package/dist/src/view/view.d.ts.map +1 -1
- package/dist/src/view/view.js +24 -6
- package/dist/src/view/viewUtils.d.ts.map +1 -1
- package/dist/src/view/viewUtils.js +4 -5
- package/package.json +2 -2
- package/dist/bundle/index-ByuE8dvu.js +0 -332
- package/dist/bundle/index-D28m8tSW.js +0 -1607
|
@@ -41,7 +41,7 @@ class b {
|
|
|
41
41
|
e(t);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
class
|
|
44
|
+
class l {
|
|
45
45
|
constructor({ fill: t, cache: e }) {
|
|
46
46
|
if (typeof t != "function")
|
|
47
47
|
throw new TypeError("must pass a fill function");
|
|
@@ -90,7 +90,7 @@ class c {
|
|
|
90
90
|
}
|
|
91
91
|
static checkSinglePromise(t, e) {
|
|
92
92
|
function r() {
|
|
93
|
-
if (e
|
|
93
|
+
if (e?.aborted)
|
|
94
94
|
throw Object.assign(new Error("aborted"), { code: "ERR_ABORTED" });
|
|
95
95
|
}
|
|
96
96
|
return t.then((s) => (r(), s), (s) => {
|
|
@@ -116,7 +116,7 @@ class c {
|
|
|
116
116
|
if (!r && e instanceof AbortSignal)
|
|
117
117
|
throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");
|
|
118
118
|
const o = this.cache.get(t);
|
|
119
|
-
return o ? o.aborted && !o.settled ? (this.evict(t, o), this.get(t, e, r, s)) : o.settled ? o.promise : (o.aborter.addSignal(r), o.statusReporter.addCallback(s),
|
|
119
|
+
return o ? o.aborted && !o.settled ? (this.evict(t, o), this.get(t, e, r, s)) : o.settled ? o.promise : (o.aborter.addSignal(r), o.statusReporter.addCallback(s), l.checkSinglePromise(o.promise, r)) : (this.fill(t, e, r, s), l.checkSinglePromise(
|
|
120
120
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
121
121
|
this.cache.get(t).promise,
|
|
122
122
|
r
|
|
@@ -145,5 +145,5 @@ class c {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
export {
|
|
148
|
-
|
|
148
|
+
l as A
|
|
149
149
|
};
|
|
@@ -2,18 +2,18 @@ class f {
|
|
|
2
2
|
constructor(e) {
|
|
3
3
|
this.blob = e;
|
|
4
4
|
}
|
|
5
|
-
async read(e,
|
|
5
|
+
async read(e, t = 0) {
|
|
6
6
|
if (!e)
|
|
7
7
|
return new Uint8Array(0);
|
|
8
|
-
const s =
|
|
8
|
+
const s = t, n = s + e, a = this.blob.slice(s, n);
|
|
9
9
|
return a.bytes ? a.bytes() : new Uint8Array(await a.arrayBuffer());
|
|
10
10
|
}
|
|
11
11
|
async readFile(e) {
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
12
|
+
const t = typeof e == "string" ? e : e?.encoding;
|
|
13
|
+
if (t === "utf8")
|
|
14
14
|
return this.blob.text();
|
|
15
|
-
if (
|
|
16
|
-
throw new Error(`unsupported encoding: ${
|
|
15
|
+
if (t)
|
|
16
|
+
throw new Error(`unsupported encoding: ${t}`);
|
|
17
17
|
return this.blob.bytes ? this.blob.bytes() : new Uint8Array(await this.blob.arrayBuffer());
|
|
18
18
|
}
|
|
19
19
|
async stat() {
|
|
@@ -26,22 +26,22 @@ function d(i) {
|
|
|
26
26
|
return (typeof i == "object" && i !== null && "message" in i ? i.message : `${i}`).replace(/\.$/, "");
|
|
27
27
|
}
|
|
28
28
|
class u {
|
|
29
|
-
constructor(e,
|
|
29
|
+
constructor(e, t = {}) {
|
|
30
30
|
this.baseOverrides = {}, this.url = e;
|
|
31
|
-
const s =
|
|
32
|
-
|
|
31
|
+
const s = t.fetch || globalThis.fetch.bind(globalThis);
|
|
32
|
+
t.overrides && (this.baseOverrides = t.overrides), this.fetchImplementation = s;
|
|
33
33
|
}
|
|
34
|
-
async fetch(e,
|
|
34
|
+
async fetch(e, t) {
|
|
35
35
|
const s = (a) => new Error(`${d(a)} fetching ${e}`, { cause: a });
|
|
36
36
|
let n;
|
|
37
37
|
try {
|
|
38
|
-
n = await this.fetchImplementation(e,
|
|
38
|
+
n = await this.fetchImplementation(e, t);
|
|
39
39
|
} catch (a) {
|
|
40
40
|
if (`${a}`.includes("Failed to fetch")) {
|
|
41
41
|
console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);
|
|
42
42
|
try {
|
|
43
43
|
n = await this.fetchImplementation(e, {
|
|
44
|
-
...
|
|
44
|
+
...t,
|
|
45
45
|
cache: "reload"
|
|
46
46
|
});
|
|
47
47
|
} catch (c) {
|
|
@@ -52,12 +52,12 @@ class u {
|
|
|
52
52
|
}
|
|
53
53
|
return n;
|
|
54
54
|
}
|
|
55
|
-
async read(e,
|
|
55
|
+
async read(e, t, s = {}) {
|
|
56
56
|
if (e === 0)
|
|
57
57
|
return new Uint8Array(0);
|
|
58
58
|
const { headers: n = {}, signal: a, overrides: c = {} } = s;
|
|
59
|
-
e < 1 / 0 ? n.range = `bytes=${
|
|
60
|
-
const
|
|
59
|
+
e < 1 / 0 ? n.range = `bytes=${t}-${t + e - 1}` : e === 1 / 0 && t !== 0 && (n.range = `bytes=${t}-`);
|
|
60
|
+
const r = await this.fetch(this.url, {
|
|
61
61
|
...this.baseOverrides,
|
|
62
62
|
...c,
|
|
63
63
|
headers: {
|
|
@@ -70,28 +70,28 @@ class u {
|
|
|
70
70
|
mode: "cors",
|
|
71
71
|
signal: a
|
|
72
72
|
});
|
|
73
|
-
if (!
|
|
74
|
-
throw new Error(`HTTP ${
|
|
75
|
-
if (
|
|
76
|
-
const l =
|
|
77
|
-
o
|
|
73
|
+
if (!r.ok)
|
|
74
|
+
throw new Error(`HTTP ${r.status} fetching ${this.url}`);
|
|
75
|
+
if (r.status === 200 && t === 0 || r.status === 206) {
|
|
76
|
+
const l = r.headers.get("content-range"), o = /\/(\d+)$/.exec(l || "");
|
|
77
|
+
o?.[1] && (this._stat = {
|
|
78
78
|
size: parseInt(o[1], 10)
|
|
79
79
|
});
|
|
80
|
-
const h =
|
|
80
|
+
const h = r.bytes ? await r.bytes() : new Uint8Array(await r.arrayBuffer());
|
|
81
81
|
return h.byteLength <= e ? h : h.subarray(0, e);
|
|
82
82
|
}
|
|
83
|
-
throw new Error(
|
|
83
|
+
throw new Error(r.status === 200 ? `${this.url} fetch returned status 200, expected 206` : `HTTP ${r.status} fetching ${this.url}`);
|
|
84
84
|
}
|
|
85
85
|
async readFile(e = {}) {
|
|
86
|
-
let
|
|
86
|
+
let t, s;
|
|
87
87
|
if (typeof e == "string")
|
|
88
|
-
|
|
88
|
+
t = e, s = {};
|
|
89
89
|
else {
|
|
90
|
-
|
|
90
|
+
t = e.encoding;
|
|
91
91
|
const { encoding: l, ...o } = e;
|
|
92
92
|
s = o;
|
|
93
93
|
}
|
|
94
|
-
const { headers: n = {}, signal: a, overrides: c = {} } = s,
|
|
94
|
+
const { headers: n = {}, signal: a, overrides: c = {} } = s, r = await this.fetch(this.url, {
|
|
95
95
|
...this.baseOverrides,
|
|
96
96
|
...c,
|
|
97
97
|
headers: {
|
|
@@ -104,13 +104,13 @@ class u {
|
|
|
104
104
|
mode: "cors",
|
|
105
105
|
signal: a
|
|
106
106
|
});
|
|
107
|
-
if (!
|
|
108
|
-
throw new Error(`HTTP ${
|
|
109
|
-
if (
|
|
110
|
-
return
|
|
111
|
-
if (
|
|
112
|
-
throw new Error(`unsupported encoding: ${
|
|
113
|
-
return
|
|
107
|
+
if (!r.ok)
|
|
108
|
+
throw new Error(`HTTP ${r.status} fetching ${this.url}`);
|
|
109
|
+
if (t === "utf8")
|
|
110
|
+
return r.text();
|
|
111
|
+
if (t)
|
|
112
|
+
throw new Error(`unsupported encoding: ${t}`);
|
|
113
|
+
return r.bytes ? r.bytes() : new Uint8Array(await r.arrayBuffer());
|
|
114
114
|
}
|
|
115
115
|
async stat() {
|
|
116
116
|
if (!this._stat && (await this.read(10, 0), !this._stat))
|