@genome-spy/core 0.45.0 → 0.46.1
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/{index-lmJu1tfP.js → index-BtRKzKhM.js} +6 -6
- package/dist/bundle/{index--cKb-dKG.js → index-BwFvhduA.js} +5 -5
- package/dist/bundle/{index-1QVesMzU.js → index-C8lYPtq_.js} +1 -1
- package/dist/bundle/{index-Pv3tKJ1W.js → index-CkI3Kd2P.js} +3 -3
- package/dist/bundle/{index-Y-LdHNIz.js → index-CmBp-spD.js} +1 -1
- package/dist/bundle/{index-z4Cs62EO.js → index-Dixm7K89.js} +4 -4
- package/dist/bundle/{index-noY1e-G6.js → index-Sk-Wtwdn.js} +5 -5
- package/dist/bundle/{index-UyrC0vvF.js → index-Z7JiNsFI.js} +4 -4
- package/dist/bundle/{index-LD6yPc3X.js → index-mihmTLo-.js} +1 -1
- package/dist/bundle/index.es.js +3624 -3516
- package/dist/bundle/index.js +101 -92
- package/dist/bundle/{long-Veu0zKh9.js → long-CYrAUkxh.js} +2 -2
- package/dist/bundle/{remoteFile-Ur-gRKsH.js → remoteFile-1_eCK3VV.js} +1 -1
- package/dist/schema.json +156 -15
- package/dist/src/data/collector.d.ts +1 -0
- package/dist/src/data/collector.d.ts.map +1 -1
- package/dist/src/data/collector.js +19 -3
- package/dist/src/data/flow.test.js +4 -0
- package/dist/src/data/flowNode.d.ts +31 -14
- package/dist/src/data/flowNode.d.ts.map +1 -1
- package/dist/src/data/flowNode.js +53 -20
- package/dist/src/data/flowTestUtils.d.ts +5 -0
- package/dist/src/data/flowTestUtils.d.ts.map +1 -1
- package/dist/src/data/flowTestUtils.js +11 -0
- package/dist/src/data/sources/dataSource.d.ts +17 -0
- package/dist/src/data/sources/dataSource.d.ts.map +1 -1
- package/dist/src/data/sources/dataSource.js +34 -0
- package/dist/src/data/sources/inlineSource.js +1 -1
- package/dist/src/data/sources/lazy/bigBedSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bigBedSource.js +6 -0
- package/dist/src/data/sources/lazy/bigWigSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bigWigSource.js +28 -15
- package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts +0 -8
- package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/singleAxisLazySource.js +1 -13
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.js +3 -3
- package/dist/src/data/sources/namedSource.js +1 -1
- package/dist/src/data/sources/sequenceSource.d.ts.map +1 -1
- package/dist/src/data/sources/sequenceSource.js +2 -1
- package/dist/src/data/sources/urlSource.d.ts.map +1 -1
- package/dist/src/data/sources/urlSource.js +9 -5
- package/dist/src/data/transforms/clone.d.ts +1 -0
- package/dist/src/data/transforms/clone.d.ts.map +1 -1
- package/dist/src/data/transforms/coverage.d.ts +4 -1
- package/dist/src/data/transforms/coverage.d.ts.map +1 -1
- package/dist/src/data/transforms/coverage.js +44 -31
- package/dist/src/data/transforms/filter.d.ts +4 -3
- package/dist/src/data/transforms/filter.d.ts.map +1 -1
- package/dist/src/data/transforms/filter.js +7 -8
- package/dist/src/data/transforms/filter.test.js +4 -2
- package/dist/src/data/transforms/formula.d.ts +4 -3
- package/dist/src/data/transforms/formula.d.ts.map +1 -1
- package/dist/src/data/transforms/formula.js +7 -5
- package/dist/src/data/transforms/formula.test.js +13 -7
- package/dist/src/genomeSpy.d.ts +5 -2
- package/dist/src/genomeSpy.d.ts.map +1 -1
- package/dist/src/genomeSpy.js +24 -8
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +11 -0
- package/dist/src/spec/view.d.ts +52 -9
- 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 +4 -0
- package/dist/src/styles/genome-spy.scss +5 -0
- package/dist/src/types/viewContext.d.ts +9 -2
- package/dist/src/utils/expression.js +1 -1
- package/dist/src/view/paramMediator.d.ts +2 -1
- package/dist/src/view/paramMediator.d.ts.map +1 -1
- package/dist/src/view/paramMediator.js +3 -2
- package/dist/src/view/paramMediator.test.js +13 -0
- package/dist/src/view/viewFactory.d.ts +4 -1
- package/dist/src/view/viewFactory.d.ts.map +1 -1
- package/dist/src/view/viewFactory.js +52 -24
- package/dist/src/view/viewUtils.d.ts +2 -7
- package/dist/src/view/viewUtils.d.ts.map +1 -1
- package/dist/src/view/viewUtils.js +21 -30
- package/package.json +2 -2
- /package/dist/bundle/{__vite-browser-external-ENoMJThg.js → __vite-browser-external-C--ziKoh.js} +0 -0
- /package/dist/bundle/{_commonjsHelpers-QtkX90xp.js → _commonjsHelpers-BIiJCwQW.js} +0 -0
|
@@ -18,7 +18,9 @@ export const BEHAVIOR_MODIFIES = 1 << 1;
|
|
|
18
18
|
*/
|
|
19
19
|
export const BEHAVIOR_COLLECTS = 1 << 2;
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* @typedef {{paramMediator: import("../view/paramMediator.js").default}} ParamMediatorProvider
|
|
23
|
+
*/
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* This is heavily inspired by Vega's and Vega-Lite's data flow system.
|
|
@@ -27,11 +29,24 @@ const ROOT_CONTEXT_OBJECT = {};
|
|
|
27
29
|
* @typedef {Datum[]} Data
|
|
28
30
|
*/
|
|
29
31
|
export default class FlowNode {
|
|
32
|
+
/**
|
|
33
|
+
* An object that provides a paramMediator. (Most likely a View)
|
|
34
|
+
*
|
|
35
|
+
* @type {ParamMediatorProvider}
|
|
36
|
+
* @protected
|
|
37
|
+
*/
|
|
38
|
+
paramMediatorProvider = null;
|
|
39
|
+
|
|
30
40
|
get behavior() {
|
|
31
41
|
return 0;
|
|
32
42
|
}
|
|
33
43
|
|
|
34
|
-
|
|
44
|
+
/**
|
|
45
|
+
* @param {ParamMediatorProvider} [paramMediatorProvider]
|
|
46
|
+
*/
|
|
47
|
+
constructor(paramMediatorProvider) {
|
|
48
|
+
this.paramMediatorProvider = paramMediatorProvider;
|
|
49
|
+
|
|
35
50
|
/** @type {FlowNode[]} */
|
|
36
51
|
this.children = [];
|
|
37
52
|
|
|
@@ -66,7 +81,7 @@ export default class FlowNode {
|
|
|
66
81
|
* Dynamically updates the propagator method to allow the JavaScript engine
|
|
67
82
|
* to employ optimizations such as inlining.
|
|
68
83
|
*/
|
|
69
|
-
|
|
84
|
+
#updatePropagator() {
|
|
70
85
|
this._propagate = Function(
|
|
71
86
|
"children",
|
|
72
87
|
range(this.children.length)
|
|
@@ -96,7 +111,7 @@ export default class FlowNode {
|
|
|
96
111
|
}
|
|
97
112
|
this.children.push(child);
|
|
98
113
|
child.setParent(this);
|
|
99
|
-
this
|
|
114
|
+
this.#updatePropagator();
|
|
100
115
|
return this;
|
|
101
116
|
}
|
|
102
117
|
|
|
@@ -131,7 +146,7 @@ export default class FlowNode {
|
|
|
131
146
|
|
|
132
147
|
newParent.parent = this.parent;
|
|
133
148
|
this.parent.children[this.parent.children.indexOf(this)] = newParent;
|
|
134
|
-
this.parent
|
|
149
|
+
this.parent.#updatePropagator();
|
|
135
150
|
this.parent = undefined;
|
|
136
151
|
newParent.addChild(this);
|
|
137
152
|
}
|
|
@@ -145,7 +160,7 @@ export default class FlowNode {
|
|
|
145
160
|
if (index > -1) {
|
|
146
161
|
this.children.splice(index, 1);
|
|
147
162
|
child.parent = undefined;
|
|
148
|
-
this
|
|
163
|
+
this.#updatePropagator();
|
|
149
164
|
} else {
|
|
150
165
|
throw new Error("Trying to remove an unknown child node!");
|
|
151
166
|
}
|
|
@@ -164,7 +179,7 @@ export default class FlowNode {
|
|
|
164
179
|
const child = this.children[0];
|
|
165
180
|
child.setParent(this.parent);
|
|
166
181
|
this.parent.children[this.parent.children.indexOf(this)] = child;
|
|
167
|
-
this.parent
|
|
182
|
+
this.parent.#updatePropagator();
|
|
168
183
|
this.setParent(undefined);
|
|
169
184
|
this.children.length = 0;
|
|
170
185
|
} else {
|
|
@@ -219,19 +234,6 @@ export default class FlowNode {
|
|
|
219
234
|
} \n${childTree}`;
|
|
220
235
|
}
|
|
221
236
|
|
|
222
|
-
/**
|
|
223
|
-
* The global object for expressions (in formula and filter transforms).
|
|
224
|
-
* Nodes in the hierarchy may extend the object using Object.create to
|
|
225
|
-
* introduce variables that are visible downstream the flow.
|
|
226
|
-
*
|
|
227
|
-
* @returns {Record<string, any>}
|
|
228
|
-
*/
|
|
229
|
-
getGlobalObject() {
|
|
230
|
-
return this.parent
|
|
231
|
-
? this.parent.getGlobalObject()
|
|
232
|
-
: ROOT_CONTEXT_OBJECT;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
237
|
/**
|
|
236
238
|
*
|
|
237
239
|
* @param {Datum} datum
|
|
@@ -260,9 +262,40 @@ export default class FlowNode {
|
|
|
260
262
|
}
|
|
261
263
|
}
|
|
262
264
|
|
|
265
|
+
/**
|
|
266
|
+
* @returns {import("../view/paramMediator.js").default}
|
|
267
|
+
* @protected
|
|
268
|
+
*/
|
|
269
|
+
get paramMediator() {
|
|
270
|
+
if (this.paramMediatorProvider) {
|
|
271
|
+
return this.paramMediatorProvider.paramMediator;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (!this.parent) {
|
|
275
|
+
throw new Error("Cannot find paramMediator!");
|
|
276
|
+
}
|
|
277
|
+
return this.parent.paramMediator;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Repropagates the stored data. If this node has no stored data,
|
|
282
|
+
* find the nearest ancestor that has and repropagate from there.
|
|
283
|
+
* @protected
|
|
284
|
+
*/
|
|
285
|
+
repropagate() {
|
|
286
|
+
if (this.parent) {
|
|
287
|
+
this.parent.repropagate();
|
|
288
|
+
} else {
|
|
289
|
+
throw new Error(
|
|
290
|
+
"Cannot repropagate data, no FlowNode with stored data found!"
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
263
295
|
/**
|
|
264
296
|
*
|
|
265
297
|
* @param {any} datum
|
|
298
|
+
* @protected
|
|
266
299
|
*/
|
|
267
300
|
_propagate(datum) {
|
|
268
301
|
// Implementation is set dynamically in add/removeChild
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowTestUtils.d.ts","sourceRoot":"","sources":["../../../src/data/flowTestUtils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flowTestUtils.d.ts","sourceRoot":"","sources":["../../../src/data/flowTestUtils.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH,6CAFa,OAAO,eAAe,EAAE,qBAAqB,CAMzD;AAED;;;;GAIG;AACH,sCAHW,OAAO,eAAe,EAAE,OAAO,QAC/B,GAAG,EAAE,mCAcf;AAED;;GAEG;AACH;IACI;;;OAGG;IACH,kBAFW,GAAG,EAAE,EAKf;IADG,YAAgB;IAGpB,iBAMC;CACJ;AAED;;GAEG;AACH;IACI;;;OAGG;IACH,eAFW,MAAM,EAWhB;CACJ;qBAvEoB,eAAe"}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
import ParamMediator from "../view/paramMediator.js";
|
|
1
2
|
import Collector from "./collector.js";
|
|
2
3
|
import FlowNode from "./flowNode.js";
|
|
3
4
|
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @returns {import("./flowNode.js").ParamMediatorProvider}
|
|
8
|
+
*/
|
|
9
|
+
export function makeParamMediatorProvider() {
|
|
10
|
+
return {
|
|
11
|
+
paramMediator: new ParamMediator(),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
4
15
|
/**
|
|
5
16
|
*
|
|
6
17
|
* @param {import("./flowNode.js").default} flowNode
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
export default class DataSource extends FlowNode {
|
|
2
|
+
/**
|
|
3
|
+
* @param {import("../../view/view.js").default} view
|
|
4
|
+
*/
|
|
5
|
+
constructor(view: import("../../view/view.js").default);
|
|
6
|
+
/**
|
|
7
|
+
* @type {import("../../view/view.js").default}
|
|
8
|
+
* @protected
|
|
9
|
+
*/
|
|
10
|
+
protected view: import("../../view/view.js").default;
|
|
2
11
|
/**
|
|
3
12
|
* Returns a string that identifies a data source. Data sources with the
|
|
4
13
|
* same identifier can be merged.
|
|
@@ -6,6 +15,14 @@ export default class DataSource extends FlowNode {
|
|
|
6
15
|
* @return {string}
|
|
7
16
|
*/
|
|
8
17
|
get identifier(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Sets the loading status of the data source. The status is shown in the UI.
|
|
20
|
+
*
|
|
21
|
+
* @param {import("../../types/viewContext.js").DataLoadingStatus} status
|
|
22
|
+
* @param {string} [detail] The error message
|
|
23
|
+
* @protected
|
|
24
|
+
*/
|
|
25
|
+
protected setLoadingStatus(status: import("../../types/viewContext.js").DataLoadingStatus, detail?: string): void;
|
|
9
26
|
load(): Promise<void>;
|
|
10
27
|
}
|
|
11
28
|
import FlowNode from "../flowNode.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataSource.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/dataSource.js"],"names":[],"mappings":"AAEA;
|
|
1
|
+
{"version":3,"file":"dataSource.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/dataSource.js"],"names":[],"mappings":"AAEA;IAOI;;OAEG;IACH,kBAFW,OAAO,oBAAoB,EAAE,OAAO,EAM9C;IAbD;;;OAGG;IACH,gBAHU,OAAO,oBAAoB,EAAE,OAAO,CAGzC;IAWL;;;;;OAKG;IACH,yBAEC;IAED;;;;;;OAMG;IACH,mCAJW,OAAO,4BAA4B,EAAE,iBAAiB,WACtD,MAAM,QAKhB;IAcD,sBAEC;CAKJ;qBA1DoB,gBAAgB"}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import FlowNode from "../flowNode.js";
|
|
2
2
|
|
|
3
3
|
export default class DataSource extends FlowNode {
|
|
4
|
+
/**
|
|
5
|
+
* @type {import("../../view/view.js").default}
|
|
6
|
+
* @protected
|
|
7
|
+
*/
|
|
8
|
+
view;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {import("../../view/view.js").default} view
|
|
12
|
+
*/
|
|
13
|
+
constructor(view) {
|
|
14
|
+
super();
|
|
15
|
+
|
|
16
|
+
this.view = view;
|
|
17
|
+
}
|
|
18
|
+
|
|
4
19
|
/**
|
|
5
20
|
* Returns a string that identifies a data source. Data sources with the
|
|
6
21
|
* same identifier can be merged.
|
|
@@ -11,6 +26,21 @@ export default class DataSource extends FlowNode {
|
|
|
11
26
|
return undefined;
|
|
12
27
|
}
|
|
13
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Sets the loading status of the data source. The status is shown in the UI.
|
|
31
|
+
*
|
|
32
|
+
* @param {import("../../types/viewContext.js").DataLoadingStatus} status
|
|
33
|
+
* @param {string} [detail] The error message
|
|
34
|
+
* @protected
|
|
35
|
+
*/
|
|
36
|
+
setLoadingStatus(status, detail) {
|
|
37
|
+
this.view.context.setDataLoadingStatus(this.view, status, detail);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get paramMediator() {
|
|
41
|
+
return this.view.paramMediator;
|
|
42
|
+
}
|
|
43
|
+
|
|
14
44
|
/**
|
|
15
45
|
*
|
|
16
46
|
* @param {import("../flowNode.js").Datum} datum
|
|
@@ -22,4 +52,8 @@ export default class DataSource extends FlowNode {
|
|
|
22
52
|
async load() {
|
|
23
53
|
// override
|
|
24
54
|
}
|
|
55
|
+
|
|
56
|
+
repropagate() {
|
|
57
|
+
this.load();
|
|
58
|
+
}
|
|
25
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bigBedSource.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/bigBedSource.js"],"names":[],"mappings":"AAOA;IAUI;;;OAGG;IACH,oBAHW,OAAO,uBAAuB,EAAE,UAAU,QAC1C,OAAO,uBAAuB,EAAE,OAAO,EAmCjD;IA9CD,0CAA0C;IAC1C,QADW,OAAO,WAAW,EAAE,OAAO,CAC/B;IAEP,yCAAyC;IACzC,KADW,OAAO,WAAW,EAAE,MAAM,CACjC;IAEJ,4GAA4G;IAC5G,mBADmB,MAAM,UAAU;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,MAAM,EAAE,GAAG,CAAC,CAC9F;IA8BN,mDAA6B;;
|
|
1
|
+
{"version":3,"file":"bigBedSource.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/bigBedSource.js"],"names":[],"mappings":"AAOA;IAUI;;;OAGG;IACH,oBAHW,OAAO,uBAAuB,EAAE,UAAU,QAC1C,OAAO,uBAAuB,EAAE,OAAO,EAmCjD;IA9CD,0CAA0C;IAC1C,QADW,OAAO,WAAW,EAAE,OAAO,CAC/B;IAEP,yCAAyC;IACzC,KADW,OAAO,WAAW,EAAE,MAAM,CACjC;IAEJ,4GAA4G;IAC5G,mBADmB,MAAM,UAAU;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,MAAM,EAAE,GAAG,CAAC,CAC9F;IA8BN,mDAA6B;;CAoFpC;qCA5HoC,+BAA+B"}
|
|
@@ -72,6 +72,7 @@ export default class BigBedSource extends SingleAxisWindowedSource {
|
|
|
72
72
|
),
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
+
this.setLoadingStatus("loading");
|
|
75
76
|
this.bbi
|
|
76
77
|
.getHeader()
|
|
77
78
|
.then(async (header) => {
|
|
@@ -88,11 +89,16 @@ export default class BigBedSource extends SingleAxisWindowedSource {
|
|
|
88
89
|
);
|
|
89
90
|
}
|
|
90
91
|
|
|
92
|
+
this.setLoadingStatus("complete");
|
|
91
93
|
resolve();
|
|
92
94
|
})
|
|
93
95
|
.catch((e) => {
|
|
94
96
|
// Load empty data
|
|
95
97
|
this.load();
|
|
98
|
+
this.setLoadingStatus(
|
|
99
|
+
"error",
|
|
100
|
+
`${withoutExprRef(this.params.url)}: ${e.message}`
|
|
101
|
+
);
|
|
96
102
|
reject(e);
|
|
97
103
|
});
|
|
98
104
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bigWigSource.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/bigWigSource.js"],"names":[],"mappings":"AAOA;;GAEG;AACH;IAOI;;;OAGG;IACH,oBAHW,OAAO,uBAAuB,EAAE,UAAU,QAC1C,OAAO,uBAAuB,EAAE,OAAO,EAmCjD;IATG,mDAA6B;
|
|
1
|
+
{"version":3,"file":"bigWigSource.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/bigWigSource.js"],"names":[],"mappings":"AAOA;;GAEG;AACH;IAOI;;;OAGG;IACH,oBAHW,OAAO,uBAAuB,EAAE,UAAU,QAC1C,OAAO,uBAAuB,EAAE,OAAO,EAmCjD;IATG,mDAA6B;IA2DjC;;;;OAIG;IACH,wBAFW,MAAM,EAAE,iBAqBlB;IAED;;;OAGG;IAEH,uBAJW,MAAM,EAAE,kBACR,MAAM,iBA2BhB;;CACJ;qCA3JoC,+BAA+B"}
|
|
@@ -55,7 +55,7 @@ export default class BigWigSource extends SingleAxisWindowedSource {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
#initialize() {
|
|
58
|
-
this.initializedPromise = new Promise((resolve) => {
|
|
58
|
+
this.initializedPromise = new Promise((resolve, reject) => {
|
|
59
59
|
Promise.all([
|
|
60
60
|
import("@gmod/bbi"),
|
|
61
61
|
import("generic-filehandle"),
|
|
@@ -69,20 +69,33 @@ export default class BigWigSource extends SingleAxisWindowedSource {
|
|
|
69
69
|
),
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
this
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
72
|
+
this.setLoadingStatus("loading");
|
|
73
|
+
this.#bbi
|
|
74
|
+
.getHeader()
|
|
75
|
+
.then((header) => {
|
|
76
|
+
this.#reductionLevels =
|
|
77
|
+
/** @type {{reductionLevel: number}[]} */ (
|
|
78
|
+
header.zoomLevels
|
|
79
|
+
)
|
|
80
|
+
.map((z) => z.reductionLevel)
|
|
81
|
+
.reverse();
|
|
82
|
+
|
|
83
|
+
// Add the non-reduced level. Not sure if this is the best way to do it.
|
|
84
|
+
// Afaik, the non-reduced bin size is not available in the header.
|
|
85
|
+
this.#reductionLevels.push(1);
|
|
86
|
+
|
|
87
|
+
this.setLoadingStatus("complete");
|
|
88
|
+
resolve();
|
|
89
|
+
})
|
|
90
|
+
.catch((e) => {
|
|
91
|
+
// Load empty data
|
|
92
|
+
this.load();
|
|
93
|
+
this.setLoadingStatus(
|
|
94
|
+
"error",
|
|
95
|
+
`${withoutExprRef(this.params.url)}: ${e.message}`
|
|
96
|
+
);
|
|
97
|
+
reject(e);
|
|
98
|
+
});
|
|
86
99
|
});
|
|
87
100
|
});
|
|
88
101
|
|
|
@@ -12,7 +12,6 @@ export default class SingleAxisLazySource extends DataSource {
|
|
|
12
12
|
* @protected
|
|
13
13
|
*/
|
|
14
14
|
protected initializedPromise: Promise<void>;
|
|
15
|
-
view: import("../../../view/view.js").default;
|
|
16
15
|
/** @type {import("../../../spec/channel.js").PrimaryPositionalChannel} */
|
|
17
16
|
channel: import("../../../spec/channel.js").PrimaryPositionalChannel;
|
|
18
17
|
scaleResolution: import("../../../view/scaleResolution.js").default;
|
|
@@ -35,13 +34,6 @@ export default class SingleAxisLazySource extends DataSource {
|
|
|
35
34
|
* @abstract
|
|
36
35
|
*/
|
|
37
36
|
onDomainChanged(domain: number[], complexDomain: import("../../../spec/genome.js").ChromosomalLocus[]): void;
|
|
38
|
-
/**
|
|
39
|
-
* Sets the loading status of the data source. The status is shown in the UI.
|
|
40
|
-
*
|
|
41
|
-
* @param {boolean} status true if loading, false otherwise
|
|
42
|
-
* @protected
|
|
43
|
-
*/
|
|
44
|
-
protected setLoadingStatus(status: boolean): void;
|
|
45
37
|
/**
|
|
46
38
|
* TODO: Get rid of this method.
|
|
47
39
|
* Rendering should be requested by the collector.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleAxisLazySource.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/singleAxisLazySource.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAOI;;;OAGG;IACH,kBAHW,OAAO,uBAAuB,EAAE,OAAO,WACvC,OAAO,0BAA0B,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"singleAxisLazySource.d.ts","sourceRoot":"","sources":["../../../../../src/data/sources/lazy/singleAxisLazySource.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAOI;;;OAGG;IACH,kBAHW,OAAO,uBAAuB,EAAE,OAAO,WACvC,OAAO,0BAA0B,EAAE,wBAAwB,EA+CrE;IAvDD;;;OAGG;IACH,4CAAuC;IAmBnC,2EAA2E;IAC3E,SADW,OAAO,0BAA0B,EAAE,wBAAwB,CAChD;IAEtB,oEAA4D;IA+BhE;;;OAGG;IACH,wBAWC;IAED;;;;OAIG;IACH,oEAEC;IAED;;;;;;OAMG;IACH,wBAJW,MAAM,EAAE,iBACR,OAAO,yBAAyB,EAAE,gBAAgB,EAAE,QAK9D;IAED;;;;;OAKG;IACH,gCAGC;IAQD;;;;;OAKG;IACH,8BAHW,OAAO,mBAAmB,EAAE,KAAK,EAAE,EAAE,QAgB/C;CACJ;uBA1IsB,kBAAkB"}
|
|
@@ -17,9 +17,7 @@ export default class SingleAxisLazySource extends DataSource {
|
|
|
17
17
|
* @param {import("../../../spec/channel.js").PrimaryPositionalChannel} channel
|
|
18
18
|
*/
|
|
19
19
|
constructor(view, channel) {
|
|
20
|
-
super();
|
|
21
|
-
|
|
22
|
-
this.view = view;
|
|
20
|
+
super(view);
|
|
23
21
|
|
|
24
22
|
if (!channel) {
|
|
25
23
|
throw new Error(
|
|
@@ -102,16 +100,6 @@ export default class SingleAxisLazySource extends DataSource {
|
|
|
102
100
|
// Override me
|
|
103
101
|
}
|
|
104
102
|
|
|
105
|
-
/**
|
|
106
|
-
* Sets the loading status of the data source. The status is shown in the UI.
|
|
107
|
-
*
|
|
108
|
-
* @param {boolean} status true if loading, false otherwise
|
|
109
|
-
* @protected
|
|
110
|
-
*/
|
|
111
|
-
setLoadingStatus(status) {
|
|
112
|
-
this.view.context.setDataLoadingStatus(this.view, status);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
103
|
/**
|
|
116
104
|
* TODO: Get rid of this method.
|
|
117
105
|
* Rendering should be requested by the collector.
|
|
@@ -111,7 +111,7 @@ export default class SingleAxisWindowedSource extends SingleAxisLazySource {
|
|
|
111
111
|
// Abort previous requests
|
|
112
112
|
this.#abortController.abort();
|
|
113
113
|
|
|
114
|
-
this.setLoadingStatus(
|
|
114
|
+
this.setLoadingStatus("loading");
|
|
115
115
|
|
|
116
116
|
this.#abortController = new AbortController();
|
|
117
117
|
const signal = this.#abortController.signal;
|
|
@@ -129,13 +129,13 @@ export default class SingleAxisWindowedSource extends SingleAxisLazySource {
|
|
|
129
129
|
);
|
|
130
130
|
|
|
131
131
|
if (!signal.aborted) {
|
|
132
|
-
this.setLoadingStatus(
|
|
132
|
+
this.setLoadingStatus("complete");
|
|
133
133
|
return resultByChrom;
|
|
134
134
|
}
|
|
135
135
|
} catch (e) {
|
|
136
136
|
if (!signal.aborted) {
|
|
137
137
|
// TODO: Nice reporting of errors
|
|
138
|
-
this.setLoadingStatus(
|
|
138
|
+
this.setLoadingStatus("error", e.message);
|
|
139
139
|
throw e;
|
|
140
140
|
}
|
|
141
141
|
}
|
|
@@ -22,7 +22,7 @@ export default class NamedSource extends DataSource {
|
|
|
22
22
|
* @param {function(string):any[]} provider Function that retrieves a dataset using a name
|
|
23
23
|
*/
|
|
24
24
|
constructor(params, view, provider) {
|
|
25
|
-
super();
|
|
25
|
+
super(view);
|
|
26
26
|
|
|
27
27
|
this.provider = provider;
|
|
28
28
|
this.params = params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceSource.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/sequenceSource.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,0CAHW,QAAQ,OAAO,oBAAoB,EAAE,IAAI,CAAC,0DAKpD;AAED;IACI;;;;OAIG;IACH,oBAHW,OAAO,oBAAoB,EAAE,iBAAiB,QAC9C,OAAO,oBAAoB,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"sequenceSource.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/sequenceSource.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,0CAHW,QAAQ,OAAO,oBAAoB,EAAE,IAAI,CAAC,0DAKpD;AAED;IACI;;;;OAIG;IACH,oBAHW,OAAO,oBAAoB,EAAE,iBAAiB,QAC9C,OAAO,oBAAoB,EAAE,OAAO,EAiB9C;IAZG,sDAIC;IAUL,0BAcC;CAKJ;uBApDsB,iBAAiB"}
|
|
@@ -19,7 +19,8 @@ export default class SequenceSource extends DataSource {
|
|
|
19
19
|
* @param {import("../../view/view.js").default} view
|
|
20
20
|
*/
|
|
21
21
|
constructor(params, view) {
|
|
22
|
-
super();
|
|
22
|
+
super(view);
|
|
23
|
+
|
|
23
24
|
this.sequence = activateExprRefProps(
|
|
24
25
|
view.paramMediator,
|
|
25
26
|
params.sequence,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlSource.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/urlSource.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH,gCAHW,QAAQ,OAAO,oBAAoB,EAAE,IAAI,CAAC,gDAKpD;AAED;IACI;;;OAGG;IACH,oBAHW,OAAO,oBAAoB,EAAE,OAAO,QACpC,OAAO,oBAAoB,EAAE,OAAO,EAU9C;IALG,6CAEC;IAED,gBAAiC;
|
|
1
|
+
{"version":3,"file":"urlSource.d.ts","sourceRoot":"","sources":["../../../../src/data/sources/urlSource.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH,gCAHW,QAAQ,OAAO,oBAAoB,EAAE,IAAI,CAAC,gDAKpD;AAED;IACI;;;OAGG;IACH,oBAHW,OAAO,oBAAoB,EAAE,OAAO,QACpC,OAAO,oBAAoB,EAAE,OAAO,EAU9C;IALG,6CAEC;IAED,gBAAiC;CA8DxC;uBAxFsB,iBAAiB"}
|
|
@@ -20,7 +20,7 @@ export default class UrlSource extends DataSource {
|
|
|
20
20
|
* @param {import("../../view/view.js").default} view
|
|
21
21
|
*/
|
|
22
22
|
constructor(params, view) {
|
|
23
|
-
super();
|
|
23
|
+
super(view);
|
|
24
24
|
|
|
25
25
|
this.params = activateExprRefProps(view.paramMediator, params, () =>
|
|
26
26
|
this.load()
|
|
@@ -55,9 +55,7 @@ export default class UrlSource extends DataSource {
|
|
|
55
55
|
.load(url)
|
|
56
56
|
.catch((/** @type {Error} */ e) => {
|
|
57
57
|
// TODO: Include baseurl in the error message. Should be normalized, however.
|
|
58
|
-
throw new Error(
|
|
59
|
-
`Cannot fetch: ${this.baseUrl}${url}: ${e.message}`
|
|
60
|
-
);
|
|
58
|
+
throw new Error(`${url}: ${e.message}`);
|
|
61
59
|
})
|
|
62
60
|
);
|
|
63
61
|
|
|
@@ -78,9 +76,15 @@ export default class UrlSource extends DataSource {
|
|
|
78
76
|
}
|
|
79
77
|
};
|
|
80
78
|
|
|
79
|
+
this.setLoadingStatus("loading");
|
|
81
80
|
this.reset();
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
try {
|
|
83
|
+
await Promise.all(urls.map((url) => load(url).then(readAndParse)));
|
|
84
|
+
this.setLoadingStatus("complete");
|
|
85
|
+
} catch (e) {
|
|
86
|
+
this.setLoadingStatus("error", e.message);
|
|
87
|
+
}
|
|
84
88
|
|
|
85
89
|
this.complete();
|
|
86
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/clone.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;
|
|
1
|
+
{"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/clone.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IAKI,cA2BC;IApBO,yBAAyB;IACzB,gBALQ,GAAG,UAK2C;IAO1D;;;;OAIG;IACH,yBAFW,OAAO,0BAA0B,EAAE,SAAS,UAQtD;CAER;qBAtCsD,gBAAgB"}
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
* segments and calculates weighted averages.
|
|
9
9
|
*/
|
|
10
10
|
export default class CoverageTransform extends FlowNode {
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {import("../flowNode.js").Datum} Datum
|
|
13
|
+
*/
|
|
11
14
|
/**
|
|
12
15
|
* @param {import("../../spec/transform.js").CoverageParams} params
|
|
13
16
|
*/
|
|
@@ -25,7 +28,7 @@ export default class CoverageTransform extends FlowNode {
|
|
|
25
28
|
end: string;
|
|
26
29
|
chrom: string;
|
|
27
30
|
};
|
|
28
|
-
createSegment:
|
|
31
|
+
createSegment: (start: number, end: number, coverage: number, chrom?: string) => import("../flowNode.js").Datum;
|
|
29
32
|
/**
|
|
30
33
|
* End pos as priority, weight as value
|
|
31
34
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/coverage.js"],"names":[],"mappings":";AAKA;;;;;;;GAOG;AACH;IAKI;;OAEG;IACH,oBAFW,OAAO,yBAAyB,EAAE,cAAc,EAgD1D;IA5CG,yDAAoB;IAEpB,mDAAwC;IACxC,iDAAoC;IAEpC,mCAAmC;IACnC,sBADoB,GAAG,KAAE,MAAM,CAGT;IACtB,mCAAmC;IACnC,uBADoB,GAAG,KAAE,MAAM,CACsC;IAErE;;;;;MAKC;
|
|
1
|
+
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/coverage.js"],"names":[],"mappings":";AAKA;;;;;;;GAOG;AACH;IAKI;;OAEG;IAEH;;OAEG;IACH,oBAFW,OAAO,yBAAyB,EAAE,cAAc,EAgD1D;IA5CG,yDAAoB;IAEpB,mDAAwC;IACxC,iDAAoC;IAEpC,mCAAmC;IACnC,sBADoB,GAAG,KAAE,MAAM,CAGT;IACtB,mCAAmC;IACnC,uBADoB,GAAG,KAAE,MAAM,CACsC;IAErE;;;;;MAKC;IAED,sEACsE,MAAM,oCAgBvE;IAEL;;;;OAIG;IACH,MAFU,UAAU,MAAM,CAAC,CAEA;CA0IlC;qBA7MyC,gBAAgB;sBAHpC,WAAW"}
|