@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.
Files changed (114) hide show
  1. package/dist/bundle/browser-KWU9rWZT.js +123 -0
  2. package/dist/bundle/{esm-CgfVIRJ-.js → esm-0dYHNV_D.js} +2 -2
  3. package/dist/bundle/{esm-sIoQYZ21.js → esm-CRMf_I9V.js} +18 -18
  4. package/dist/bundle/esm-CT3ygiMq.js +1084 -0
  5. package/dist/bundle/{esm-DQiq2Zhd.js → esm-CscjKVDc.js} +44 -44
  6. package/dist/bundle/index.es.js +3408 -3185
  7. package/dist/bundle/index.js +106 -97
  8. package/dist/schema.json +352 -0
  9. package/dist/src/config/defaults/markDefaults.d.ts.map +1 -1
  10. package/dist/src/config/defaults/markDefaults.js +1 -12
  11. package/dist/src/config/defaults/scaleDefaults.d.ts.map +1 -1
  12. package/dist/src/config/defaults/scaleDefaults.js +1 -0
  13. package/dist/src/config/markConfig.d.ts.map +1 -1
  14. package/dist/src/config/markConfig.js +16 -8
  15. package/dist/src/config/themes.d.ts.map +1 -1
  16. package/dist/src/config/themes.js +15 -2
  17. package/dist/src/data/sources/lazy/bigWigSource.d.ts.map +1 -1
  18. package/dist/src/data/sources/lazy/bigWigSource.js +31 -11
  19. package/dist/src/data/sources/lazy/registerBuiltInLazySources.js +2 -2
  20. package/dist/src/data/sources/lazy/registerCoreLazySources.d.ts +2 -0
  21. package/dist/src/data/sources/lazy/registerCoreLazySources.d.ts.map +1 -0
  22. package/dist/src/data/sources/lazy/registerCoreLazySources.js +2 -0
  23. package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts +19 -3
  24. package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts.map +1 -1
  25. package/dist/src/data/sources/lazy/singleAxisWindowedSource.js +34 -13
  26. package/dist/src/data/sources/lazy/tabixSource.d.ts +7 -0
  27. package/dist/src/data/sources/lazy/tabixSource.d.ts.map +1 -1
  28. package/dist/src/data/sources/lazy/tabixSource.js +18 -0
  29. package/dist/src/data/sources/lazy/tabixTsvSource.d.ts +37 -0
  30. package/dist/src/data/sources/lazy/tabixTsvSource.d.ts.map +1 -0
  31. package/dist/src/data/sources/lazy/tabixTsvSource.js +163 -0
  32. package/dist/src/data/transforms/filterScoredLabels.d.ts.map +1 -1
  33. package/dist/src/data/transforms/filterScoredLabels.js +3 -2
  34. package/dist/src/embedFactory.d.ts.map +1 -1
  35. package/dist/src/embedFactory.js +2 -0
  36. package/dist/src/genomeSpy/viewContextFactory.d.ts.map +1 -1
  37. package/dist/src/genomeSpy/viewContextFactory.js +1 -0
  38. package/dist/src/genomeSpyBase.d.ts +6 -0
  39. package/dist/src/genomeSpyBase.d.ts.map +1 -1
  40. package/dist/src/genomeSpyBase.js +15 -1
  41. package/dist/src/gl/webGLHelper.d.ts +5 -2
  42. package/dist/src/gl/webGLHelper.d.ts.map +1 -1
  43. package/dist/src/gl/webGLHelper.js +20 -3
  44. package/dist/src/index.d.ts +1 -0
  45. package/dist/src/index.d.ts.map +1 -1
  46. package/dist/src/index.js +1 -0
  47. package/dist/src/marks/__snapshots__/shaderSnapshot.test.js.snap +1084 -2
  48. package/dist/src/marks/link.vertex.glsl.js +1 -1
  49. package/dist/src/marks/mark.d.ts.map +1 -1
  50. package/dist/src/marks/mark.js +0 -6
  51. package/dist/src/marks/rect.vertex.glsl.js +1 -1
  52. package/dist/src/minimal.d.ts +1 -0
  53. package/dist/src/minimal.d.ts.map +1 -1
  54. package/dist/src/minimal.js +6 -4
  55. package/dist/src/paramRuntime/embedParamApi.d.ts +26 -0
  56. package/dist/src/paramRuntime/embedParamApi.d.ts.map +1 -0
  57. package/dist/src/paramRuntime/embedParamApi.js +133 -0
  58. package/dist/src/scale/scale.js +10 -2
  59. package/dist/src/scales/domainPlanner.js +1 -1
  60. package/dist/src/scales/scaleInteractionController.d.ts +8 -4
  61. package/dist/src/scales/scaleInteractionController.d.ts.map +1 -1
  62. package/dist/src/scales/scaleInteractionController.js +55 -7
  63. package/dist/src/scales/scaleResolution.d.ts +3 -3
  64. package/dist/src/scales/scaleResolution.d.ts.map +1 -1
  65. package/dist/src/scales/scaleResolution.js +14 -7
  66. package/dist/src/scales/selectionDomainUtils.d.ts +10 -0
  67. package/dist/src/scales/selectionDomainUtils.d.ts.map +1 -1
  68. package/dist/src/scales/selectionDomainUtils.js +32 -3
  69. package/dist/src/selection/index.d.ts +8 -0
  70. package/dist/src/selection/index.d.ts.map +1 -0
  71. package/dist/src/selection/index.js +12 -0
  72. package/dist/src/spec/channel.d.ts +30 -0
  73. package/dist/src/spec/data.d.ts +40 -0
  74. package/dist/src/spec/parameter.d.ts +6 -0
  75. package/dist/src/spec/transform.d.ts +6 -0
  76. package/dist/src/styles/genome-spy.css +8 -0
  77. package/dist/src/styles/genome-spy.css.d.ts +1 -1
  78. package/dist/src/styles/genome-spy.css.d.ts.map +1 -1
  79. package/dist/src/styles/genome-spy.css.js +8 -0
  80. package/dist/src/types/embedApi.d.ts +54 -0
  81. package/dist/src/types/scaleResolutionApi.d.ts +28 -1
  82. package/dist/src/types/viewContext.d.ts +11 -0
  83. package/dist/src/utils/ui/tooltip.d.ts.map +1 -1
  84. package/dist/src/utils/ui/tooltip.js +22 -0
  85. package/dist/src/view/axisGridView.d.ts.map +1 -1
  86. package/dist/src/view/axisGridView.js +2 -1
  87. package/dist/src/view/axisView.d.ts.map +1 -1
  88. package/dist/src/view/axisView.js +2 -1
  89. package/dist/src/view/facetView.d.ts.map +1 -1
  90. package/dist/src/view/facetView.js +2 -1
  91. package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
  92. package/dist/src/view/gridView/gridChild.js +9 -1
  93. package/dist/src/view/gridView/gridView.d.ts.map +1 -1
  94. package/dist/src/view/gridView/gridView.js +198 -32
  95. package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
  96. package/dist/src/view/gridView/scrollbar.js +5 -1
  97. package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
  98. package/dist/src/view/gridView/selectionRect.js +5 -1
  99. package/dist/src/view/gridView/separatorView.d.ts.map +1 -1
  100. package/dist/src/view/gridView/separatorView.js +5 -1
  101. package/dist/src/view/testUtils.d.ts +30 -3
  102. package/dist/src/view/testUtils.d.ts.map +1 -1
  103. package/dist/src/view/testUtils.js +51 -2
  104. package/dist/src/view/viewSelectors.d.ts +38 -10
  105. package/dist/src/view/viewSelectors.d.ts.map +1 -1
  106. package/dist/src/view/viewSelectors.js +67 -2
  107. package/dist/src/view/viewUtilTypes.d.ts +15 -0
  108. package/dist/src/view/viewUtils.d.ts.map +1 -1
  109. package/dist/src/view/viewUtils.js +10 -0
  110. package/package.json +3 -3
  111. package/dist/bundle/browser-BTgw5ieH.js +0 -126
  112. package/dist/bundle/esm-DtE8VqAv.js +0 -1015
  113. /package/dist/bundle/{esm-BDFRLEuD.js → esm-C49STiCR.js} +0 -0
  114. /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-BDFRLEuD.js";
2
- import { t } from "./browser-BTgw5ieH.js";
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 { t as e } from "./esm-CGX-qz1d.js";
2
- import { n as t, r as n } from "./esm-BDFRLEuD.js";
3
- import { r, t as i } from "./browser-BTgw5ieH.js";
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(e = {}) {
136
- let n = await t(await this.filehandle.readFile(e)), r = new DataView(n.buffer), i;
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(e = {}) {
230
- let n = await t(await this.filehandle.readFile(e)), r = new DataView(n.buffer);
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: t, filehandle: n, 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 e({ maxSize: 1e3 });
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 (n) this.filehandle = n;
312
- else if (t) this.filehandle = new i(t);
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 (t) this.index = new w({
332
- filehandle: new i(`${t}.tbi`),
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 e({ maxSize: Math.floor(m / 65536) }),
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(e = {}) {
390
- let { firstDataLine: n, metaChar: r, maxBlockSize: i } = await this.getMetadata(e), a = (n?.blockPosition || 0) + i, o = await t(await this.filehandle.read(a, 0, e));
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, t = {}) {
457
- return n(await this.filehandle.read(e.fetchedSize(), e.minv.blockPosition, t), e, this.cache);
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