@genome-spy/core 0.76.0 → 0.78.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 (87) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bundle/browser-KWU9rWZT.js +123 -0
  3. package/dist/bundle/esm-CT3ygiMq.js +1084 -0
  4. package/dist/bundle/{esm-D_euN86T.js → esm-DAnOffpD.js} +2 -2
  5. package/dist/bundle/{esm-BimDEpBb.js → esm-DNtC3H80.js} +2 -2
  6. package/dist/bundle/{esm-CngqBe45.js → esm-DVOHLB1e.js} +2 -2
  7. package/dist/bundle/esm-NIYEaYkc.js +1221 -0
  8. package/dist/bundle/index.es.js +3007 -2787
  9. package/dist/bundle/index.js +110 -99
  10. package/dist/schema.json +825 -112
  11. package/dist/src/data/sources/lazy/bigWigSource.d.ts.map +1 -1
  12. package/dist/src/data/sources/lazy/bigWigSource.js +31 -11
  13. package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts +19 -3
  14. package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts.map +1 -1
  15. package/dist/src/data/sources/lazy/singleAxisWindowedSource.js +34 -13
  16. package/dist/src/data/transforms/filterScoredLabels.d.ts.map +1 -1
  17. package/dist/src/data/transforms/filterScoredLabels.js +3 -2
  18. package/dist/src/embedFactory.d.ts.map +1 -1
  19. package/dist/src/embedFactory.js +2 -0
  20. package/dist/src/genomeSpy/headlessBootstrap.d.ts.map +1 -1
  21. package/dist/src/genomeSpy/headlessBootstrap.js +2 -0
  22. package/dist/src/genomeSpy/interactionController.d.ts +4 -1
  23. package/dist/src/genomeSpy/interactionController.d.ts.map +1 -1
  24. package/dist/src/genomeSpy/interactionController.js +57 -13
  25. package/dist/src/genomeSpy/viewContextFactory.d.ts.map +1 -1
  26. package/dist/src/genomeSpy/viewContextFactory.js +1 -0
  27. package/dist/src/genomeSpyBase.d.ts +6 -0
  28. package/dist/src/genomeSpyBase.d.ts.map +1 -1
  29. package/dist/src/genomeSpyBase.js +16 -1
  30. package/dist/src/index.d.ts +1 -0
  31. package/dist/src/index.d.ts.map +1 -1
  32. package/dist/src/index.js +1 -0
  33. package/dist/src/marks/__snapshots__/shaderSnapshot.test.js.snap +2 -2
  34. package/dist/src/marks/mark.d.ts.map +1 -1
  35. package/dist/src/marks/mark.js +0 -6
  36. package/dist/src/marks/rect.vertex.glsl.js +1 -1
  37. package/dist/src/minimal.d.ts +1 -0
  38. package/dist/src/minimal.d.ts.map +1 -1
  39. package/dist/src/minimal.js +1 -0
  40. package/dist/src/paramRuntime/embedParamApi.d.ts +26 -0
  41. package/dist/src/paramRuntime/embedParamApi.d.ts.map +1 -0
  42. package/dist/src/paramRuntime/embedParamApi.js +133 -0
  43. package/dist/src/scales/domainExpressions.d.ts +21 -0
  44. package/dist/src/scales/domainExpressions.d.ts.map +1 -0
  45. package/dist/src/scales/domainExpressions.js +43 -0
  46. package/dist/src/scales/domainPlanner.d.ts +12 -1
  47. package/dist/src/scales/domainPlanner.d.ts.map +1 -1
  48. package/dist/src/scales/domainPlanner.js +55 -36
  49. package/dist/src/scales/scaleInstanceManager.d.ts +1 -0
  50. package/dist/src/scales/scaleInstanceManager.d.ts.map +1 -1
  51. package/dist/src/scales/scaleInstanceManager.js +5 -0
  52. package/dist/src/scales/scaleInteractionController.d.ts +8 -4
  53. package/dist/src/scales/scaleInteractionController.d.ts.map +1 -1
  54. package/dist/src/scales/scaleInteractionController.js +55 -7
  55. package/dist/src/scales/scalePropsResolver.d.ts +6 -1
  56. package/dist/src/scales/scalePropsResolver.d.ts.map +1 -1
  57. package/dist/src/scales/scalePropsResolver.js +35 -10
  58. package/dist/src/scales/scaleResolution.d.ts +19 -3
  59. package/dist/src/scales/scaleResolution.d.ts.map +1 -1
  60. package/dist/src/scales/scaleResolution.js +141 -20
  61. package/dist/src/scales/scaleRules.d.ts +10 -0
  62. package/dist/src/scales/scaleRules.d.ts.map +1 -1
  63. package/dist/src/scales/scaleRules.js +38 -1
  64. package/dist/src/scales/viewLevelScaleConfig.d.ts +45 -0
  65. package/dist/src/scales/viewLevelScaleConfig.d.ts.map +1 -0
  66. package/dist/src/scales/viewLevelScaleConfig.js +138 -0
  67. package/dist/src/selection/index.d.ts +8 -0
  68. package/dist/src/selection/index.d.ts.map +1 -0
  69. package/dist/src/selection/index.js +12 -0
  70. package/dist/src/spec/scale.d.ts +19 -6
  71. package/dist/src/spec/view.d.ts +11 -0
  72. package/dist/src/styles/genome-spy.css +12 -1
  73. package/dist/src/styles/genome-spy.css.d.ts +1 -1
  74. package/dist/src/styles/genome-spy.css.d.ts.map +1 -1
  75. package/dist/src/styles/genome-spy.css.js +12 -1
  76. package/dist/src/types/embedApi.d.ts +54 -0
  77. package/dist/src/types/scaleResolutionApi.d.ts +28 -1
  78. package/dist/src/types/viewContext.d.ts +11 -0
  79. package/dist/src/utils/ui/tooltip.d.ts +4 -0
  80. package/dist/src/utils/ui/tooltip.d.ts.map +1 -1
  81. package/dist/src/utils/ui/tooltip.js +57 -10
  82. package/dist/src/view/containerMutationHelper.d.ts.map +1 -1
  83. package/dist/src/view/containerMutationHelper.js +11 -3
  84. package/package.json +3 -3
  85. package/dist/bundle/browser-BTgw5ieH.js +0 -126
  86. package/dist/bundle/esm-Bvlm1uVk.js +0 -1015
  87. package/dist/bundle/esm-C49STiCR.js +0 -1248
@@ -4,6 +4,10 @@ import {
4
4
  } from "../data/flowInit.js";
5
5
  import { configureViewOpacity } from "../genomeSpy/viewHierarchyConfig.js";
6
6
  import { ensureAssembliesForView } from "../genome/assemblyPreflight.js";
7
+ import {
8
+ attachViewLevelScaleConfigs,
9
+ clearViewLevelScaleConfigs,
10
+ } from "../scales/viewLevelScaleConfig.js";
7
11
  import { finalizeSubtreeGraphics } from "./viewUtils.js";
8
12
 
9
13
  /**
@@ -68,6 +72,11 @@ export default class ContainerMutationHelper {
68
72
  this.options.createViewOptions
69
73
  );
70
74
 
75
+ insertAt(insertIndex, childSpec);
76
+ const insertionResult = this.options.insertView(childView, insertIndex);
77
+
78
+ attachViewLevelScaleConfigs(this.container);
79
+
71
80
  // Reminder: ensure assemblies from the real child hierarchy before any
72
81
  // downstream work that may initialize scales (axis prep / encoders).
73
82
  await ensureAssembliesForView(
@@ -75,9 +84,6 @@ export default class ContainerMutationHelper {
75
84
  this.container.context.genomeStore
76
85
  );
77
86
 
78
- insertAt(insertIndex, childSpec);
79
- const insertionResult = this.options.insertView(childView, insertIndex);
80
-
81
87
  if (this.options.prepareView) {
82
88
  await this.options.prepareView(
83
89
  childView,
@@ -114,12 +120,14 @@ export default class ContainerMutationHelper {
114
120
  */
115
121
  async removeChildAt(index) {
116
122
  const { removeAt } = this.options.getChildSpecs();
123
+ clearViewLevelScaleConfigs(this.container);
117
124
  this.options.removeView(index);
118
125
  removeAt(index);
119
126
 
120
127
  if (this.options.afterRemove) {
121
128
  await this.options.afterRemove(index);
122
129
  }
130
+ attachViewLevelScaleConfigs(this.container);
123
131
 
124
132
  if (this.options.requestLayout !== false) {
125
133
  this.container.invalidateSizeCache();
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "contributors": [],
9
9
  "license": "MIT",
10
- "version": "0.76.0",
10
+ "version": "0.78.0",
11
11
  "jsdelivr": "dist/bundle/index.js",
12
12
  "unpkg": "dist/bundle/index.js",
13
13
  "browser": "dist/bundle/index.js",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@gmod/bam": "^7.1.19",
49
- "@gmod/bbi": "^9.0.0",
49
+ "@gmod/bbi": "^9.2.0",
50
50
  "@gmod/bed": "^2.1.10",
51
51
  "@gmod/indexedfasta": "^5.0.2",
52
52
  "@gmod/tabix": "^3.2.2",
@@ -78,5 +78,5 @@
78
78
  "devDependencies": {
79
79
  "@types/long": "^4.0.1"
80
80
  },
81
- "gitHead": "34d821cf5e864972afaa65a3290719e2fdb209c2"
81
+ "gitHead": "54041db3a590ae8df78fa43aa755b9e07fe3503c"
82
82
  }
@@ -1,126 +0,0 @@
1
- import { t as e } from "./chunk-DmhlhrBa.js";
2
- //#region ../../node_modules/generic-filehandle2/esm/blobFile.js
3
- var t = class {
4
- constructor(e) {
5
- this.blob = e;
6
- }
7
- async read(e, t = 0) {
8
- if (!e) return new Uint8Array();
9
- let n = t, r = n + e, i = this.blob.slice(n, r);
10
- return i.bytes ? i.bytes() : new Uint8Array(await i.arrayBuffer());
11
- }
12
- async readFile(e) {
13
- let t = typeof e == "string" ? e : e?.encoding;
14
- if (t === "utf8") return this.blob.text();
15
- if (t) throw Error(`unsupported encoding: ${t}`);
16
- return this.blob.bytes ? this.blob.bytes() : new Uint8Array(await this.blob.arrayBuffer());
17
- }
18
- async stat() {
19
- return { size: this.blob.size };
20
- }
21
- async close() {}
22
- };
23
- //#endregion
24
- //#region ../../node_modules/generic-filehandle2/esm/remoteFile.js
25
- function n(e) {
26
- return (typeof e == "object" && e && "message" in e ? e.message : `${e}`).replace(/\.$/, "");
27
- }
28
- var r = class {
29
- constructor(e, t = {}) {
30
- this.baseOverrides = {}, this.url = e;
31
- let n = t.fetch || globalThis.fetch.bind(globalThis);
32
- t.overrides && (this.baseOverrides = t.overrides), this.fetchImplementation = n;
33
- }
34
- async fetch(e, t) {
35
- let r = (t) => Error(`${n(t)} fetching ${e}`, { cause: t }), i;
36
- try {
37
- i = await this.fetchImplementation(e, t);
38
- } catch (n) {
39
- if (`${n}`.includes("Failed to fetch")) {
40
- console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);
41
- try {
42
- i = await this.fetchImplementation(e, {
43
- ...t,
44
- cache: "reload"
45
- });
46
- } catch (e) {
47
- throw r(e);
48
- }
49
- } else throw r(n);
50
- }
51
- return i;
52
- }
53
- async read(e, t, n = {}) {
54
- if (e === 0) return new Uint8Array();
55
- let { headers: r = {}, signal: i, overrides: a = {} } = n;
56
- e < Infinity ? r.range = `bytes=${t}-${t + e - 1}` : e === Infinity && t !== 0 && (r.range = `bytes=${t}-`);
57
- let o = await this.fetch(this.url, {
58
- ...this.baseOverrides,
59
- ...a,
60
- headers: {
61
- ...this.baseOverrides.headers,
62
- ...a.headers,
63
- ...r
64
- },
65
- method: "GET",
66
- redirect: "follow",
67
- mode: "cors",
68
- signal: i
69
- });
70
- if (!o.ok) throw Error(`HTTP ${o.status} fetching ${this.url}`);
71
- if (o.status === 200 && t === 0 || o.status === 206) {
72
- let t = o.headers.get("content-range"), n = /\/(\d+)$/.exec(t || "");
73
- n?.[1] && (this._stat = { size: parseInt(n[1], 10) });
74
- let r = o.bytes ? await o.bytes() : new Uint8Array(await o.arrayBuffer());
75
- return r.byteLength <= e ? r : r.subarray(0, e);
76
- }
77
- throw Error(o.status === 200 ? `${this.url} fetch returned status 200, expected 206` : `HTTP ${o.status} fetching ${this.url}`);
78
- }
79
- async readFile(e = {}) {
80
- let t, n;
81
- if (typeof e == "string") t = e, n = {};
82
- else {
83
- t = e.encoding;
84
- let { encoding: r, ...i } = e;
85
- n = i;
86
- }
87
- let { headers: r = {}, signal: i, overrides: a = {} } = n, o = await this.fetch(this.url, {
88
- ...this.baseOverrides,
89
- ...a,
90
- headers: {
91
- ...this.baseOverrides.headers,
92
- ...a.headers,
93
- ...r
94
- },
95
- method: "GET",
96
- redirect: "follow",
97
- mode: "cors",
98
- signal: i
99
- });
100
- if (!o.ok) throw Error(`HTTP ${o.status} fetching ${this.url}`);
101
- if (t === "utf8") return o.text();
102
- if (t) throw Error(`unsupported encoding: ${t}`);
103
- return o.bytes ? o.bytes() : new Uint8Array(await o.arrayBuffer());
104
- }
105
- async stat() {
106
- if (!this._stat && (await this.read(10, 0), !this._stat)) throw Error(`unable to determine size of file at ${this.url}`);
107
- return this._stat;
108
- }
109
- async close() {}
110
- }, i = /* @__PURE__ */ e({
111
- BlobFile: () => t,
112
- LocalFile: () => a,
113
- RemoteFile: () => r
114
- }), a = class {
115
- readFile() {
116
- throw Error("unimplemented");
117
- }
118
- read() {
119
- throw Error("unimplemented");
120
- }
121
- close() {
122
- throw Error("unimplemented");
123
- }
124
- };
125
- //#endregion
126
- export { i as n, r, a as t };