@genome-spy/core 0.75.0 → 0.77.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/browser-KWU9rWZT.js +123 -0
- package/dist/bundle/{esm-CgfVIRJ-.js → esm-0dYHNV_D.js} +2 -2
- package/dist/bundle/{esm-sIoQYZ21.js → esm-CRMf_I9V.js} +18 -18
- package/dist/bundle/esm-CT3ygiMq.js +1084 -0
- package/dist/bundle/{esm-DQiq2Zhd.js → esm-CscjKVDc.js} +44 -44
- package/dist/bundle/index.es.js +3408 -3185
- package/dist/bundle/index.js +106 -97
- package/dist/schema.json +352 -0
- package/dist/src/config/defaults/markDefaults.d.ts.map +1 -1
- package/dist/src/config/defaults/markDefaults.js +1 -12
- package/dist/src/config/defaults/scaleDefaults.d.ts.map +1 -1
- package/dist/src/config/defaults/scaleDefaults.js +1 -0
- package/dist/src/config/markConfig.d.ts.map +1 -1
- package/dist/src/config/markConfig.js +16 -8
- package/dist/src/config/themes.d.ts.map +1 -1
- package/dist/src/config/themes.js +15 -2
- package/dist/src/data/sources/lazy/bigWigSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bigWigSource.js +31 -11
- package/dist/src/data/sources/lazy/registerBuiltInLazySources.js +2 -2
- package/dist/src/data/sources/lazy/registerCoreLazySources.d.ts +2 -0
- package/dist/src/data/sources/lazy/registerCoreLazySources.d.ts.map +1 -0
- package/dist/src/data/sources/lazy/registerCoreLazySources.js +2 -0
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts +19 -3
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.js +34 -13
- package/dist/src/data/sources/lazy/tabixSource.d.ts +7 -0
- package/dist/src/data/sources/lazy/tabixSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/tabixSource.js +18 -0
- package/dist/src/data/sources/lazy/tabixTsvSource.d.ts +37 -0
- package/dist/src/data/sources/lazy/tabixTsvSource.d.ts.map +1 -0
- package/dist/src/data/sources/lazy/tabixTsvSource.js +163 -0
- package/dist/src/data/transforms/filterScoredLabels.d.ts.map +1 -1
- package/dist/src/data/transforms/filterScoredLabels.js +3 -2
- package/dist/src/embedFactory.d.ts.map +1 -1
- package/dist/src/embedFactory.js +2 -0
- package/dist/src/genomeSpy/viewContextFactory.d.ts.map +1 -1
- package/dist/src/genomeSpy/viewContextFactory.js +1 -0
- package/dist/src/genomeSpyBase.d.ts +6 -0
- package/dist/src/genomeSpyBase.d.ts.map +1 -1
- package/dist/src/genomeSpyBase.js +15 -1
- package/dist/src/gl/webGLHelper.d.ts +5 -2
- package/dist/src/gl/webGLHelper.d.ts.map +1 -1
- package/dist/src/gl/webGLHelper.js +20 -3
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/marks/__snapshots__/shaderSnapshot.test.js.snap +1084 -2
- package/dist/src/marks/link.vertex.glsl.js +1 -1
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +0 -6
- package/dist/src/marks/rect.vertex.glsl.js +1 -1
- package/dist/src/minimal.d.ts +1 -0
- package/dist/src/minimal.d.ts.map +1 -1
- package/dist/src/minimal.js +6 -4
- package/dist/src/paramRuntime/embedParamApi.d.ts +26 -0
- package/dist/src/paramRuntime/embedParamApi.d.ts.map +1 -0
- package/dist/src/paramRuntime/embedParamApi.js +133 -0
- package/dist/src/scale/scale.js +10 -2
- package/dist/src/scales/domainPlanner.js +1 -1
- package/dist/src/scales/scaleInteractionController.d.ts +8 -4
- package/dist/src/scales/scaleInteractionController.d.ts.map +1 -1
- package/dist/src/scales/scaleInteractionController.js +55 -7
- package/dist/src/scales/scaleResolution.d.ts +3 -3
- package/dist/src/scales/scaleResolution.d.ts.map +1 -1
- package/dist/src/scales/scaleResolution.js +14 -7
- package/dist/src/scales/selectionDomainUtils.d.ts +10 -0
- package/dist/src/scales/selectionDomainUtils.d.ts.map +1 -1
- package/dist/src/scales/selectionDomainUtils.js +32 -3
- package/dist/src/selection/index.d.ts +8 -0
- package/dist/src/selection/index.d.ts.map +1 -0
- package/dist/src/selection/index.js +12 -0
- package/dist/src/spec/channel.d.ts +30 -0
- package/dist/src/spec/data.d.ts +40 -0
- package/dist/src/spec/parameter.d.ts +6 -0
- package/dist/src/spec/transform.d.ts +6 -0
- package/dist/src/styles/genome-spy.css +8 -0
- package/dist/src/styles/genome-spy.css.d.ts +1 -1
- package/dist/src/styles/genome-spy.css.d.ts.map +1 -1
- package/dist/src/styles/genome-spy.css.js +8 -0
- package/dist/src/types/embedApi.d.ts +54 -0
- package/dist/src/types/scaleResolutionApi.d.ts +28 -1
- package/dist/src/types/viewContext.d.ts +11 -0
- package/dist/src/utils/ui/tooltip.d.ts.map +1 -1
- package/dist/src/utils/ui/tooltip.js +22 -0
- package/dist/src/view/axisGridView.d.ts.map +1 -1
- package/dist/src/view/axisGridView.js +2 -1
- package/dist/src/view/axisView.d.ts.map +1 -1
- package/dist/src/view/axisView.js +2 -1
- package/dist/src/view/facetView.d.ts.map +1 -1
- package/dist/src/view/facetView.js +2 -1
- package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
- package/dist/src/view/gridView/gridChild.js +9 -1
- package/dist/src/view/gridView/gridView.d.ts.map +1 -1
- package/dist/src/view/gridView/gridView.js +198 -32
- package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
- package/dist/src/view/gridView/scrollbar.js +5 -1
- package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
- package/dist/src/view/gridView/selectionRect.js +5 -1
- package/dist/src/view/gridView/separatorView.d.ts.map +1 -1
- package/dist/src/view/gridView/separatorView.js +5 -1
- package/dist/src/view/testUtils.d.ts +30 -3
- package/dist/src/view/testUtils.d.ts.map +1 -1
- package/dist/src/view/testUtils.js +51 -2
- package/dist/src/view/viewSelectors.d.ts +38 -10
- package/dist/src/view/viewSelectors.d.ts.map +1 -1
- package/dist/src/view/viewSelectors.js +67 -2
- package/dist/src/view/viewUtilTypes.d.ts +15 -0
- package/dist/src/view/viewUtils.d.ts.map +1 -1
- package/dist/src/view/viewUtils.js +10 -0
- package/package.json +3 -3
- package/dist/bundle/browser-BTgw5ieH.js +0 -126
- package/dist/bundle/esm-DtE8VqAv.js +0 -1015
- /package/dist/bundle/{esm-BDFRLEuD.js → esm-C49STiCR.js} +0 -0
- /package/dist/bundle/{esm-CGX-qz1d.js → esm-CuVa5T98.js} +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
+
//#region ../../node_modules/generic-filehandle2/esm/util.js
|
|
3
|
+
async function t(e) {
|
|
4
|
+
return e.bytes ? e.bytes() : new Uint8Array(await e.arrayBuffer());
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region ../../node_modules/generic-filehandle2/esm/blobFile.js
|
|
8
|
+
var n = class {
|
|
9
|
+
blob;
|
|
10
|
+
constructor(e) {
|
|
11
|
+
this.blob = e;
|
|
12
|
+
}
|
|
13
|
+
async read(e, n = 0) {
|
|
14
|
+
return e === 0 ? new Uint8Array() : t(this.blob.slice(n, n + e));
|
|
15
|
+
}
|
|
16
|
+
async readFile(e) {
|
|
17
|
+
let n = typeof e == "string" ? e : e?.encoding;
|
|
18
|
+
if (n === "utf8") return this.blob.text();
|
|
19
|
+
if (n) throw Error(`unsupported encoding: ${n}`);
|
|
20
|
+
return t(this.blob);
|
|
21
|
+
}
|
|
22
|
+
stat() {
|
|
23
|
+
return Promise.resolve({ size: this.blob.size });
|
|
24
|
+
}
|
|
25
|
+
close() {
|
|
26
|
+
return Promise.resolve();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region ../../node_modules/generic-filehandle2/esm/remoteFile.js
|
|
31
|
+
function r(e) {
|
|
32
|
+
return (typeof e == "object" && e && "message" in e && typeof e.message == "string" ? e.message : `${e}`).replace(/\.$/, "");
|
|
33
|
+
}
|
|
34
|
+
var i = class {
|
|
35
|
+
url;
|
|
36
|
+
_stat;
|
|
37
|
+
fetchImplementation;
|
|
38
|
+
baseHeaders;
|
|
39
|
+
baseOverrides;
|
|
40
|
+
constructor(e, t = {}) {
|
|
41
|
+
this.url = e, this.baseHeaders = t.headers ?? {}, this.baseOverrides = t.overrides ?? {}, this.fetchImplementation = t.fetch ?? globalThis.fetch.bind(globalThis);
|
|
42
|
+
}
|
|
43
|
+
buildRequest(e, t) {
|
|
44
|
+
return {
|
|
45
|
+
...this.baseOverrides,
|
|
46
|
+
...e.overrides,
|
|
47
|
+
headers: {
|
|
48
|
+
...this.baseHeaders,
|
|
49
|
+
...e.headers,
|
|
50
|
+
...t
|
|
51
|
+
},
|
|
52
|
+
method: "GET",
|
|
53
|
+
redirect: "follow",
|
|
54
|
+
mode: "cors",
|
|
55
|
+
signal: e.signal
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
async fetch(e, t) {
|
|
59
|
+
let n = (t) => Error(`${r(t)} fetching ${e}`, { cause: t }), i;
|
|
60
|
+
try {
|
|
61
|
+
i = await this.fetchImplementation(e, t);
|
|
62
|
+
} catch (r) {
|
|
63
|
+
if (`${r}`.includes("Failed to fetch")) {
|
|
64
|
+
console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);
|
|
65
|
+
try {
|
|
66
|
+
i = await this.fetchImplementation(e, {
|
|
67
|
+
...t,
|
|
68
|
+
cache: "reload"
|
|
69
|
+
});
|
|
70
|
+
} catch (e) {
|
|
71
|
+
throw n(e);
|
|
72
|
+
}
|
|
73
|
+
} else throw n(r);
|
|
74
|
+
}
|
|
75
|
+
return i;
|
|
76
|
+
}
|
|
77
|
+
async read(e, n, r = {}) {
|
|
78
|
+
if (e === 0) return new Uint8Array();
|
|
79
|
+
if (Number.isNaN(e) || Number.isNaN(n)) throw TypeError(`read() called with NaN length or position (length=${e}, position=${n}). The index file may be corrupt.`);
|
|
80
|
+
let i = await this.fetch(this.url, this.buildRequest(r, { range: `bytes=${n}-${n + e - 1}` }));
|
|
81
|
+
if (i.status === 416) return new Uint8Array();
|
|
82
|
+
if (!i.ok) throw Error(`HTTP ${i.status} fetching ${this.url}`);
|
|
83
|
+
if (i.status === 200 && n === 0 || i.status === 206) {
|
|
84
|
+
let n = i.headers.get("content-range"), r = /\/(\d+)$/.exec(n ?? "");
|
|
85
|
+
r?.[1] && (this._stat = { size: parseInt(r[1], 10) });
|
|
86
|
+
let a = await t(i);
|
|
87
|
+
return !this._stat && i.status === 200 && (this._stat = { size: a.byteLength }), a.byteLength <= e ? a : a.subarray(0, e);
|
|
88
|
+
}
|
|
89
|
+
throw Error(i.status === 200 ? `${this.url} fetch returned status 200, expected 206` : `HTTP ${i.status} fetching ${this.url}`);
|
|
90
|
+
}
|
|
91
|
+
async readFile(e = {}) {
|
|
92
|
+
let n = typeof e == "string" ? e : e.encoding, r = typeof e == "string" ? {} : e, i = await this.fetch(this.url, this.buildRequest(r));
|
|
93
|
+
if (!i.ok) throw Error(`HTTP ${i.status} fetching ${this.url}`);
|
|
94
|
+
if (n === "utf8") return i.text();
|
|
95
|
+
if (n) throw Error(`unsupported encoding: ${n}`);
|
|
96
|
+
return t(i);
|
|
97
|
+
}
|
|
98
|
+
async stat() {
|
|
99
|
+
return this._stat || await this.read(10, 0), this._stat ?? { size: 0 };
|
|
100
|
+
}
|
|
101
|
+
close() {
|
|
102
|
+
return Promise.resolve();
|
|
103
|
+
}
|
|
104
|
+
}, a = /* @__PURE__ */ e({
|
|
105
|
+
BlobFile: () => n,
|
|
106
|
+
LocalFile: () => o,
|
|
107
|
+
RemoteFile: () => i
|
|
108
|
+
}), o = class {
|
|
109
|
+
readFile() {
|
|
110
|
+
return Promise.reject(/* @__PURE__ */ Error("unimplemented"));
|
|
111
|
+
}
|
|
112
|
+
read() {
|
|
113
|
+
return Promise.reject(/* @__PURE__ */ Error("unimplemented"));
|
|
114
|
+
}
|
|
115
|
+
stat() {
|
|
116
|
+
return Promise.reject(/* @__PURE__ */ Error("unimplemented"));
|
|
117
|
+
}
|
|
118
|
+
close() {
|
|
119
|
+
return Promise.reject(/* @__PURE__ */ Error("unimplemented"));
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
//#endregion
|
|
123
|
+
export { a as n, i as r, o as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./esm-
|
|
2
|
-
import { t } from "./browser-
|
|
1
|
+
import { t as e } from "./esm-C49STiCR.js";
|
|
2
|
+
import { t } from "./browser-KWU9rWZT.js";
|
|
3
3
|
//#region node_modules/@gmod/indexedfasta/esm/indexedFasta.js
|
|
4
4
|
function n(e, t, n, r) {
|
|
5
5
|
return e + t * Math.floor(r / n) + r % n;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { r, t as i } from "./browser-
|
|
1
|
+
import { n as e, r as t } from "./esm-C49STiCR.js";
|
|
2
|
+
import { t as n } from "./esm-CuVa5T98.js";
|
|
3
|
+
import { r, t as i } from "./browser-KWU9rWZT.js";
|
|
4
4
|
import { t as a } from "./AbortablePromiseCache-3gHJdF3E.js";
|
|
5
5
|
//#region ../../node_modules/@gmod/tabix/esm/chunk.js
|
|
6
6
|
var o = class {
|
|
@@ -132,8 +132,8 @@ var b = class extends s {
|
|
|
132
132
|
coordinateType: i
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
async _parse(
|
|
136
|
-
let n = await
|
|
135
|
+
async _parse(t = {}) {
|
|
136
|
+
let n = await e(await this.filehandle.readFile(t)), r = new DataView(n.buffer), i;
|
|
137
137
|
if (r.getUint32(0, !0) === h) i = 1;
|
|
138
138
|
else if (r.getUint32(0, !0) === g) i = 2;
|
|
139
139
|
else throw Error("Not a CSI file");
|
|
@@ -226,8 +226,8 @@ var w = class extends s {
|
|
|
226
226
|
let n = await this.parse(t), r = n.refNameToId[e];
|
|
227
227
|
return r === void 0 || !n.indices[r] ? -1 : n.indices[r].stats?.lineCount ?? -1;
|
|
228
228
|
}
|
|
229
|
-
async _parse(
|
|
230
|
-
let n = await
|
|
229
|
+
async _parse(t = {}) {
|
|
230
|
+
let n = await e(await this.filehandle.readFile(t)), r = new DataView(n.buffer);
|
|
231
231
|
if (r.getUint32(0, !0) !== x) throw Error("Not a TBI file");
|
|
232
232
|
let i = r.getUint32(4, !0), a = r.getUint32(8, !0), s = a & 65536 ? "zero-based-half-open" : "1-based-closed", c = {
|
|
233
233
|
0: "generic",
|
|
@@ -305,11 +305,11 @@ var w = class extends s {
|
|
|
305
305
|
return f(l, d);
|
|
306
306
|
}
|
|
307
307
|
}, T = class {
|
|
308
|
-
constructor({ path:
|
|
309
|
-
this.cache = new
|
|
308
|
+
constructor({ path: e, filehandle: t, url: o, tbiPath: s, tbiUrl: c, tbiFilehandle: l, csiPath: u, csiUrl: d, csiFilehandle: f, renameRefSeqs: p, chunkCacheSize: m = 5 * 2 ** 20 }) {
|
|
309
|
+
this.cache = new n({ maxSize: 1e3 });
|
|
310
310
|
let h = p ?? ((e) => e);
|
|
311
|
-
if (
|
|
312
|
-
else if (
|
|
311
|
+
if (t) this.filehandle = t;
|
|
312
|
+
else if (e) this.filehandle = new i(e);
|
|
313
313
|
else if (o) this.filehandle = new r(o);
|
|
314
314
|
else throw TypeError("must provide either filehandle or path");
|
|
315
315
|
if (l) this.index = new w({
|
|
@@ -328,8 +328,8 @@ var w = class extends s {
|
|
|
328
328
|
filehandle: new i(u),
|
|
329
329
|
renameRefSeqs: h
|
|
330
330
|
});
|
|
331
|
-
else if (
|
|
332
|
-
filehandle: new i(`${
|
|
331
|
+
else if (e) this.index = new w({
|
|
332
|
+
filehandle: new i(`${e}.tbi`),
|
|
333
333
|
renameRefSeqs: h
|
|
334
334
|
});
|
|
335
335
|
else if (d) this.index = new b({ filehandle: new r(d) });
|
|
@@ -337,7 +337,7 @@ var w = class extends s {
|
|
|
337
337
|
else if (o) this.index = new w({ filehandle: new r(`${o}.tbi`) });
|
|
338
338
|
else throw TypeError("must provide one of tbiFilehandle, tbiPath, csiFilehandle, csiPath, tbiUrl, csiUrl");
|
|
339
339
|
this.renameRefSeq = h, this.hasCustomRenameRefSeq = p !== void 0, this.chunkCache = new a({
|
|
340
|
-
cache: new
|
|
340
|
+
cache: new n({ maxSize: Math.floor(m / 65536) }),
|
|
341
341
|
fill: (e, t) => this.readChunk(e, { signal: t })
|
|
342
342
|
});
|
|
343
343
|
}
|
|
@@ -386,8 +386,8 @@ var w = class extends s {
|
|
|
386
386
|
async getMetadata(e = {}) {
|
|
387
387
|
return this.index.getMetadata(e);
|
|
388
388
|
}
|
|
389
|
-
async getHeaderBuffer(
|
|
390
|
-
let { firstDataLine: n, metaChar: r, maxBlockSize: i } = await this.getMetadata(
|
|
389
|
+
async getHeaderBuffer(t = {}) {
|
|
390
|
+
let { firstDataLine: n, metaChar: r, maxBlockSize: i } = await this.getMetadata(t), a = (n?.blockPosition || 0) + i, o = await e(await this.filehandle.read(a, 0, t));
|
|
391
391
|
if (r) {
|
|
392
392
|
let e = -1, t = r.charCodeAt(0);
|
|
393
393
|
for (let n = 0, r = o.length; n < r; n++) {
|
|
@@ -453,8 +453,8 @@ var w = class extends s {
|
|
|
453
453
|
async lineCount(e, t = {}) {
|
|
454
454
|
return this.index.lineCount(e, t);
|
|
455
455
|
}
|
|
456
|
-
async readChunk(e,
|
|
457
|
-
return
|
|
456
|
+
async readChunk(e, n = {}) {
|
|
457
|
+
return t(await this.filehandle.read(e.fetchedSize(), e.minv.blockPosition, n), e, this.cache);
|
|
458
458
|
}
|
|
459
459
|
};
|
|
460
460
|
//#endregion
|