@vitessce/json 3.6.7 → 3.6.9
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/{deflate-BYKpSTT6.js → deflate-DstPPSeQ.js} +1 -1
- package/dist/{index-B7T2DtqE.js → index-D2yFM0Ax.js} +552 -471
- package/dist/index.js +1 -1
- package/dist/{jpeg-HiHjx4CG.js → jpeg-DLyTBIoB.js} +1 -1
- package/dist/{lerc-BMjU_3GZ.js → lerc-C3NYZ4w9.js} +1 -1
- package/dist/{lzw-U6CSxLDR.js → lzw-CscKL06f.js} +1 -1
- package/dist/{packbits-DoX7PkwR.js → packbits-D3LeL8FE.js} +1 -1
- package/dist/{raw-Cy08b44Z.js → raw-uN_cumDY.js} +1 -1
- package/dist/{webimage-Pvwg1VPe.js → webimage-CsEP6b6I.js} +1 -1
- package/dist-tsc/JsonSource.d.ts +2 -2
- package/dist-tsc/JsonSource.d.ts.map +1 -1
- package/dist-tsc/JsonSource.js +7 -9
- package/dist-tsc/json-loaders/JsonLoader.d.ts +1 -1
- package/dist-tsc/json-loaders/JsonLoader.d.ts.map +1 -1
- package/dist-tsc/json-loaders/JsonLoader.js +10 -15
- package/dist-tsc/json-loaders/ObsSegmentationsJson.d.ts.map +1 -1
- package/dist-tsc/json-loaders/ObsSegmentationsJson.js +3 -6
- package/dist-tsc/json-loaders/ObsSetsJson.d.ts.map +1 -1
- package/dist-tsc/json-loaders/ObsSetsJson.js +2 -5
- package/dist-tsc/legacy-loaders/CellsJsonAsObsEmbedding.d.ts.map +1 -1
- package/dist-tsc/legacy-loaders/CellsJsonAsObsEmbedding.js +3 -6
- package/dist-tsc/legacy-loaders/CellsJsonAsObsLabels.d.ts.map +1 -1
- package/dist-tsc/legacy-loaders/CellsJsonAsObsLabels.js +3 -6
- package/dist-tsc/legacy-loaders/CellsJsonAsObsLocations.d.ts.map +1 -1
- package/dist-tsc/legacy-loaders/CellsJsonAsObsLocations.js +3 -6
- package/dist-tsc/legacy-loaders/CellsJsonAsObsSegmentations.d.ts.map +1 -1
- package/dist-tsc/legacy-loaders/CellsJsonAsObsSegmentations.js +4 -7
- package/dist-tsc/legacy-loaders/ClustersJsonAsObsFeatureMatrix.d.ts.map +1 -1
- package/dist-tsc/legacy-loaders/ClustersJsonAsObsFeatureMatrix.js +3 -6
- package/dist-tsc/legacy-loaders/GenesJsonAsObsFeatureMatrix.d.ts.map +1 -1
- package/dist-tsc/legacy-loaders/GenesJsonAsObsFeatureMatrix.js +3 -6
- package/dist-tsc/legacy-loaders/MoleculesJsonAsObsLabels.d.ts.map +1 -1
- package/dist-tsc/legacy-loaders/MoleculesJsonAsObsLabels.js +3 -6
- package/dist-tsc/legacy-loaders/MoleculesJsonAsObsLocations.d.ts.map +1 -1
- package/dist-tsc/legacy-loaders/MoleculesJsonAsObsLocations.js +3 -6
- package/dist-tsc/raster-json-loaders/RasterJsonAsImageLoader.d.ts.map +1 -1
- package/dist-tsc/raster-json-loaders/RasterJsonAsImageLoader.js +2 -5
- package/dist-tsc/raster-json-loaders/RasterJsonAsObsSegmentationsLoader.d.ts.map +1 -1
- package/dist-tsc/raster-json-loaders/RasterJsonAsObsSegmentationsLoader.js +2 -5
- package/dist-tsc/raster-json-loaders/RasterJsonLoader.d.ts +0 -1
- package/dist-tsc/raster-json-loaders/RasterJsonLoader.d.ts.map +1 -1
- package/dist-tsc/raster-json-loaders/RasterJsonLoader.js +6 -6
- package/package.json +12 -11
- package/src/JsonSource.js +7 -9
- package/src/json-loaders/JsonLoader.js +11 -18
- package/src/json-loaders/ObsSegmentationsJson.js +4 -7
- package/src/json-loaders/ObsSetsJson.js +2 -5
- package/src/legacy-loaders/CellsJsonAsObsEmbedding.js +4 -7
- package/src/legacy-loaders/CellsJsonAsObsLabels.js +3 -6
- package/src/legacy-loaders/CellsJsonAsObsLocations.js +4 -7
- package/src/legacy-loaders/CellsJsonAsObsSegmentations.js +4 -7
- package/src/legacy-loaders/ClustersJsonAsObsFeatureMatrix.js +4 -7
- package/src/legacy-loaders/GenesJsonAsObsFeatureMatrix.js +4 -7
- package/src/legacy-loaders/MoleculesJsonAsObsLabels.js +3 -6
- package/src/legacy-loaders/MoleculesJsonAsObsLocations.js +3 -6
- package/src/raster-json-loaders/RasterJsonAsImageLoader.js +2 -5
- package/src/raster-json-loaders/RasterJsonAsObsSegmentationsLoader.js +2 -5
- package/src/raster-json-loaders/RasterJsonLoader.js +6 -6
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as inflate_1 } from "./pako.esm-SxljTded.js";
|
|
2
|
-
import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-
|
|
2
|
+
import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-D2yFM0Ax.js";
|
|
3
3
|
var LercDecode = { exports: {} };
|
|
4
4
|
var hasRequiredLercDecode;
|
|
5
5
|
function requireLercDecode() {
|
package/dist-tsc/JsonSource.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonSource.d.ts","sourceRoot":"","sources":["../src/JsonSource.js"],"names":[],"mappings":"AAGA;IACE;;;OAGC;IAFC,SAAc;IACd,iBAA8B;IAGhC,
|
|
1
|
+
{"version":3,"file":"JsonSource.d.ts","sourceRoot":"","sources":["../src/JsonSource.js"],"names":[],"mappings":"AAGA;IACE;;;OAGC;IAFC,SAAc;IACd,iBAA8B;IAGhC,yBAQC;IAFC,WAAkC;CAGrC"}
|
package/dist-tsc/JsonSource.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
/* eslint-disable no-underscore-dangle */
|
|
2
|
-
import {
|
|
2
|
+
import { DataFetchError } from '@vitessce/error';
|
|
3
3
|
export default class JsonSource {
|
|
4
4
|
constructor({ url, requestInit }) {
|
|
5
5
|
this.url = url;
|
|
6
6
|
this.requestInit = requestInit;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
async loadJson() {
|
|
9
9
|
if (this._data)
|
|
10
10
|
return this._data;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// eslint-disable-next-line no-console
|
|
17
|
-
}).catch(() => Promise.reject(new DataSourceFetchError('JsonSource', this.url, {})));
|
|
11
|
+
const response = await fetch(this.url, this.requestInit);
|
|
12
|
+
if (!response.ok) {
|
|
13
|
+
throw new DataFetchError(`loadJson failed for ${this.url}`);
|
|
14
|
+
}
|
|
15
|
+
this._data = await response.json();
|
|
18
16
|
return this._data;
|
|
19
17
|
}
|
|
20
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonLoader.d.ts","sourceRoot":"","sources":["../../src/json-loaders/JsonLoader.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"JsonLoader.d.ts","sourceRoot":"","sources":["../../src/json-loaders/JsonLoader.js"],"names":[],"mappings":"AAsBA;IACE,0CAKC;IADC,YAAwC;IAG1C,qBAWC;IANC,UAA4C;IAQ9C,2BAYC;CACF;sCAjDM,oBAAoB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FileType } from '@vitessce/constants-internal';
|
|
2
|
-
import {
|
|
2
|
+
import { JsonLoaderValidationError, } from '@vitessce/error';
|
|
3
|
+
import { AbstractTwoStepLoader, LoaderResult, } from '@vitessce/abstract';
|
|
3
4
|
import { obsSetsSchema, rasterJsonSchema as rasterSchema } from '@vitessce/schemas';
|
|
4
5
|
import { cellsSchema } from '../legacy-loaders/schemas/cells.js';
|
|
5
6
|
import { moleculesSchema } from '../legacy-loaders/schemas/molecules.js';
|
|
@@ -17,23 +18,17 @@ export default class JsonLoader extends AbstractTwoStepLoader {
|
|
|
17
18
|
const { fileType } = params;
|
|
18
19
|
this.schema = fileTypeToSchema[fileType];
|
|
19
20
|
}
|
|
20
|
-
load() {
|
|
21
|
-
const { url
|
|
21
|
+
async load() {
|
|
22
|
+
const { url } = this;
|
|
22
23
|
if (this.data) {
|
|
23
24
|
return this.data;
|
|
24
25
|
}
|
|
25
|
-
this.data = this.dataSource.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (valid) {
|
|
32
|
-
return Promise.resolve(new LoaderResult(data, url));
|
|
33
|
-
}
|
|
34
|
-
return Promise.reject(new LoaderValidationError(type, fileType, url, reason));
|
|
35
|
-
});
|
|
36
|
-
return this.data;
|
|
26
|
+
this.data = await this.dataSource.loadJson();
|
|
27
|
+
const [valid, reason] = this.validate(this.data);
|
|
28
|
+
if (valid) {
|
|
29
|
+
return new LoaderResult(this.data, url);
|
|
30
|
+
}
|
|
31
|
+
throw new JsonLoaderValidationError(reason);
|
|
37
32
|
}
|
|
38
33
|
validate(data) {
|
|
39
34
|
const { schema } = this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObsSegmentationsJson.d.ts","sourceRoot":"","sources":["../../src/json-loaders/ObsSegmentationsJson.js"],"names":[],"mappings":"AAIA;IACE;;;;;;;MAYC;IAFC;;;;;;;kBAAmF;IAIrF;;;;;;;
|
|
1
|
+
{"version":3,"file":"ObsSegmentationsJson.d.ts","sourceRoot":"","sources":["../../src/json-loaders/ObsSegmentationsJson.js"],"names":[],"mappings":"AAIA;IACE;;;;;;;MAYC;IAFC;;;;;;;kBAAmF;IAIrF;;;;;;;QAqCC;CACF;uBAvDsB,iBAAiB;6BAFX,oBAAoB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoaderResult } from '@vitessce/abstract';
|
|
2
2
|
import { CoordinationLevel as CL } from '@vitessce/config';
|
|
3
3
|
import JsonLoader from './JsonLoader.js';
|
|
4
4
|
export default class ObsSegmentationsJsonLoader extends JsonLoader {
|
|
@@ -16,10 +16,7 @@ export default class ObsSegmentationsJsonLoader extends JsonLoader {
|
|
|
16
16
|
return this.cachedResult;
|
|
17
17
|
}
|
|
18
18
|
async load() {
|
|
19
|
-
const payload = await super.load()
|
|
20
|
-
if (payload instanceof AbstractLoaderError) {
|
|
21
|
-
return Promise.reject(payload);
|
|
22
|
-
}
|
|
19
|
+
const payload = await super.load();
|
|
23
20
|
const channelCoordination = [{
|
|
24
21
|
// obsType: null,
|
|
25
22
|
spatialChannelColor: [255, 255, 255],
|
|
@@ -47,6 +44,6 @@ export default class ObsSegmentationsJsonLoader extends JsonLoader {
|
|
|
47
44
|
};
|
|
48
45
|
const { data, url } = payload;
|
|
49
46
|
const result = this.loadFromCache(data);
|
|
50
|
-
return
|
|
47
|
+
return new LoaderResult(result, url, coordinationValues);
|
|
51
48
|
}
|
|
52
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObsSetsJson.d.ts","sourceRoot":"","sources":["../../src/json-loaders/ObsSetsJson.js"],"names":[],"mappings":"AAUA;IAOE;;;;
|
|
1
|
+
{"version":3,"file":"ObsSetsJson.d.ts","sourceRoot":"","sources":["../../src/json-loaders/ObsSetsJson.js"],"names":[],"mappings":"AAUA;IAOE;;;;QAgCC;CACF;uBA1CsB,iBAAiB;6BAFX,oBAAoB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tryUpgradeTreeToLatestSchema, initializeCellSetColor, nodeToSet, treeToMembershipMap, } from '@vitessce/sets-utils';
|
|
2
|
-
import {
|
|
2
|
+
import { LoaderResult } from '@vitessce/abstract';
|
|
3
3
|
import { obsSetsSchema } from '@vitessce/schemas';
|
|
4
4
|
import JsonLoader from './JsonLoader.js';
|
|
5
5
|
export default class ObsSetsJsonLoader extends JsonLoader {
|
|
@@ -8,10 +8,7 @@ export default class ObsSetsJsonLoader extends JsonLoader {
|
|
|
8
8
|
this.schema = obsSetsSchema;
|
|
9
9
|
}
|
|
10
10
|
async load() {
|
|
11
|
-
const payload = await super.load()
|
|
12
|
-
if (payload instanceof AbstractLoaderError) {
|
|
13
|
-
return Promise.reject(payload);
|
|
14
|
-
}
|
|
11
|
+
const payload = await super.load();
|
|
15
12
|
const { data: rawData, url } = payload;
|
|
16
13
|
const datatype = this.fileType.endsWith('cell-sets.json') ? 'cell' : 'obs';
|
|
17
14
|
const [upgradedData] = tryUpgradeTreeToLatestSchema(rawData, datatype);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellsJsonAsObsEmbedding.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/CellsJsonAsObsEmbedding.js"],"names":[],"mappings":"AAIA;IAII;;;;;;;;;;;;;;;;;;QAAyB;IAG3B;;;;;;aA2BC;IAhBG;;;;;;yBAAwB;IAkB5B;;;;;;
|
|
1
|
+
{"version":3,"file":"CellsJsonAsObsEmbedding.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/CellsJsonAsObsEmbedding.js"],"names":[],"mappings":"AAIA;IAII;;;;;;;;;;;;;;;;;;QAAyB;IAG3B;;;;;;aA2BC;IAhBG;;;;;;yBAAwB;IAkB5B;;;;;;eAQC;CACF;uBA/CsB,+BAA+B;6BAFzB,oBAAoB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoaderResult } from '@vitessce/abstract';
|
|
2
2
|
import { cellsSchema } from './schemas/cells.js';
|
|
3
3
|
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
4
4
|
export default class CellsJsonAsObsEmbeddingLoader extends JsonLoader {
|
|
@@ -30,12 +30,9 @@ export default class CellsJsonAsObsEmbeddingLoader extends JsonLoader {
|
|
|
30
30
|
return this.cachedResult;
|
|
31
31
|
}
|
|
32
32
|
async load() {
|
|
33
|
-
const payload = await super.load()
|
|
34
|
-
if (payload instanceof AbstractLoaderError) {
|
|
35
|
-
return Promise.reject(payload);
|
|
36
|
-
}
|
|
33
|
+
const payload = await super.load();
|
|
37
34
|
const { data, url } = payload;
|
|
38
35
|
const result = this.loadFromCache(data);
|
|
39
|
-
return
|
|
36
|
+
return new LoaderResult(result, url);
|
|
40
37
|
}
|
|
41
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellsJsonAsObsLabels.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/CellsJsonAsObsLabels.js"],"names":[],"mappings":"AAIA;IAII;;;;;;;;;;;;;;;;;;QAAyB;IAG3B;;;MASC;IAFC;;;kBAA2C;IAI7C;;;
|
|
1
|
+
{"version":3,"file":"CellsJsonAsObsLabels.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/CellsJsonAsObsLabels.js"],"names":[],"mappings":"AAIA;IAII;;;;;;;;;;;;;;;;;;QAAyB;IAG3B;;;MASC;IAFC;;;kBAA2C;IAI7C;;;QAKC;CACF;uBA1BsB,+BAA+B;6BAFzB,oBAAoB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoaderResult } from '@vitessce/abstract';
|
|
2
2
|
import { cellsSchema } from './schemas/cells.js';
|
|
3
3
|
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
4
4
|
export default class CellsJsonAsObsLabelsLoader extends JsonLoader {
|
|
@@ -17,12 +17,9 @@ export default class CellsJsonAsObsLabelsLoader extends JsonLoader {
|
|
|
17
17
|
return this.cachedResult;
|
|
18
18
|
}
|
|
19
19
|
async load() {
|
|
20
|
-
const payload = await super.load()
|
|
21
|
-
if (payload instanceof AbstractLoaderError) {
|
|
22
|
-
return Promise.reject(payload);
|
|
23
|
-
}
|
|
20
|
+
const payload = await super.load();
|
|
24
21
|
const { data, url } = payload;
|
|
25
22
|
const result = this.loadFromCache(data);
|
|
26
|
-
return
|
|
23
|
+
return new LoaderResult(result, url);
|
|
27
24
|
}
|
|
28
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellsJsonAsObsLocations.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/CellsJsonAsObsLocations.js"],"names":[],"mappings":"AAIA;IAII;;;;;;;;;;;;;;;;;;QAAyB;IAG3B;;;;;;aAmBC;IAZG;;;;;;yBAAwB;IAc5B;;;;;;
|
|
1
|
+
{"version":3,"file":"CellsJsonAsObsLocations.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/CellsJsonAsObsLocations.js"],"names":[],"mappings":"AAIA;IAII;;;;;;;;;;;;;;;;;;QAAyB;IAG3B;;;;;;aAmBC;IAZG;;;;;;yBAAwB;IAc5B;;;;;;eAQC;CACF;uBAvCsB,+BAA+B;6BAFzB,oBAAoB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoaderResult } from '@vitessce/abstract';
|
|
2
2
|
import { cellsSchema } from './schemas/cells.js';
|
|
3
3
|
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
4
4
|
export default class CellsJsonAsObsLocationsLoader extends JsonLoader {
|
|
@@ -28,12 +28,9 @@ export default class CellsJsonAsObsLocationsLoader extends JsonLoader {
|
|
|
28
28
|
return this.cachedResult;
|
|
29
29
|
}
|
|
30
30
|
async load() {
|
|
31
|
-
const payload = await super.load()
|
|
32
|
-
if (payload instanceof AbstractLoaderError) {
|
|
33
|
-
return Promise.reject(payload);
|
|
34
|
-
}
|
|
31
|
+
const payload = await super.load();
|
|
35
32
|
const { data, url } = payload;
|
|
36
33
|
const result = this.loadFromCache(data);
|
|
37
|
-
return
|
|
34
|
+
return new LoaderResult(result, url);
|
|
38
35
|
}
|
|
39
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellsJsonAsObsSegmentations.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/CellsJsonAsObsSegmentations.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,0BALW,MAAM,KACN,MAAM,KACN,MAAM,cAKhB;AAED;IAII;;;;;;;;;;;;;;;;;;QAAyB;IAG3B;;;;;;aA2BC;IAnBG;;;;;;yBAAwB;IAqB5B;;;;;;;
|
|
1
|
+
{"version":3,"file":"CellsJsonAsObsSegmentations.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/CellsJsonAsObsSegmentations.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,0BALW,MAAM,KACN,MAAM,KACN,MAAM,cAKhB;AAED;IAII;;;;;;;;;;;;;;;;;;QAAyB;IAG3B;;;;;;aA2BC;IAnBG;;;;;;yBAAwB;IAqB5B;;;;;;;QAWC;CACF;uBA7DsB,+BAA+B;6BAHzB,oBAAoB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoaderResult } from '@vitessce/abstract';
|
|
2
2
|
import { DEFAULT_CELLS_LAYER } from '@vitessce/constants-internal';
|
|
3
3
|
import { cellsSchema } from './schemas/cells.js';
|
|
4
4
|
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
@@ -48,18 +48,15 @@ export default class CellsJsonAsObsSegmentationsLoader extends JsonLoader {
|
|
|
48
48
|
return this.cachedResult;
|
|
49
49
|
}
|
|
50
50
|
async load() {
|
|
51
|
-
const payload = await super.load()
|
|
52
|
-
if (payload instanceof AbstractLoaderError) {
|
|
53
|
-
return Promise.reject(payload);
|
|
54
|
-
}
|
|
51
|
+
const payload = await super.load();
|
|
55
52
|
const { data, url } = payload;
|
|
56
53
|
const result = this.loadFromCache(data);
|
|
57
54
|
const coordinationValues = {
|
|
58
55
|
spatialSegmentationLayer: DEFAULT_CELLS_LAYER,
|
|
59
56
|
};
|
|
60
|
-
return
|
|
57
|
+
return new LoaderResult({
|
|
61
58
|
...result,
|
|
62
59
|
obsSegmentationsType: 'polygon',
|
|
63
|
-
}, url, coordinationValues)
|
|
60
|
+
}, url, coordinationValues);
|
|
64
61
|
}
|
|
65
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClustersJsonAsObsFeatureMatrix.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/ClustersJsonAsObsFeatureMatrix.js"],"names":[],"mappings":"AAMA;IAII;;;;;;;;;;;;OAA4B;IAG9B;;;;;;MA2BC;IAFC;;;;;;kBAAgE;IAIlE;;;;;;
|
|
1
|
+
{"version":3,"file":"ClustersJsonAsObsFeatureMatrix.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/ClustersJsonAsObsFeatureMatrix.js"],"names":[],"mappings":"AAMA;IAII;;;;;;;;;;;;OAA4B;IAG9B;;;;;;MA2BC;IAFC;;;;;;kBAAgE;IAIlE;;;;;;QAQC;CACF;uBA/CsB,+BAA+B;6BAFzB,oBAAoB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { extent } from 'd3-array';
|
|
2
2
|
import { range } from 'lodash-es';
|
|
3
|
-
import {
|
|
3
|
+
import { LoaderResult } from '@vitessce/abstract';
|
|
4
4
|
import { clustersSchema } from './schemas/clusters.js';
|
|
5
5
|
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
6
6
|
export default class ClustersJsonAsObsFeatureMatrixLoader extends JsonLoader {
|
|
@@ -37,12 +37,9 @@ export default class ClustersJsonAsObsFeatureMatrixLoader extends JsonLoader {
|
|
|
37
37
|
return this.cachedResult;
|
|
38
38
|
}
|
|
39
39
|
async load() {
|
|
40
|
-
const payload = await super.load()
|
|
41
|
-
if (payload instanceof AbstractLoaderError) {
|
|
42
|
-
return Promise.reject(payload);
|
|
43
|
-
}
|
|
40
|
+
const payload = await super.load();
|
|
44
41
|
const { data, url } = payload;
|
|
45
42
|
const result = this.loadFromCache(data);
|
|
46
|
-
return
|
|
43
|
+
return new LoaderResult(result, url);
|
|
47
44
|
}
|
|
48
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenesJsonAsObsFeatureMatrix.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/GenesJsonAsObsFeatureMatrix.js"],"names":[],"mappings":"AAIA;IAII;;;;;;;;;QAAyB;IAG3B;;;;;;MAkBC;IAFC;;;;;;kBAAgE;IAIlE;;;;;;
|
|
1
|
+
{"version":3,"file":"GenesJsonAsObsFeatureMatrix.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/GenesJsonAsObsFeatureMatrix.js"],"names":[],"mappings":"AAIA;IAII;;;;;;;;;QAAyB;IAG3B;;;;;;MAkBC;IAFC;;;;;;kBAAgE;IAIlE;;;;;;QAQC;CACF;uBAtCsB,+BAA+B;6BAFzB,oBAAoB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoaderResult } from '@vitessce/abstract';
|
|
2
2
|
import { genesSchema } from './schemas/genes.js';
|
|
3
3
|
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
4
4
|
export default class GenesJsonAsObsFeatureMatrixLoader extends JsonLoader {
|
|
@@ -23,12 +23,9 @@ export default class GenesJsonAsObsFeatureMatrixLoader extends JsonLoader {
|
|
|
23
23
|
return this.cachedResult;
|
|
24
24
|
}
|
|
25
25
|
async load() {
|
|
26
|
-
const payload = await super.load()
|
|
27
|
-
if (payload instanceof AbstractLoaderError) {
|
|
28
|
-
return Promise.reject(payload);
|
|
29
|
-
}
|
|
26
|
+
const payload = await super.load();
|
|
30
27
|
const { data, url } = payload;
|
|
31
28
|
const result = this.loadFromCache(data);
|
|
32
|
-
return
|
|
29
|
+
return new LoaderResult(result, url);
|
|
33
30
|
}
|
|
34
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoleculesJsonAsObsLabels.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/MoleculesJsonAsObsLabels.js"],"names":[],"mappings":"AAKA;IAII,kJAA6B;IAG/B;;;MAcC;IAFC;;;kBAA2C;IAI7C;;;
|
|
1
|
+
{"version":3,"file":"MoleculesJsonAsObsLabels.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/MoleculesJsonAsObsLabels.js"],"names":[],"mappings":"AAKA;IAII,kJAA6B;IAG/B;;;MAcC;IAFC;;;kBAA2C;IAI7C;;;QAKC;CACF;uBA/BsB,+BAA+B;6BAFzB,oBAAoB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { range, sum } from 'lodash-es';
|
|
2
|
-
import {
|
|
2
|
+
import { LoaderResult } from '@vitessce/abstract';
|
|
3
3
|
import { moleculesSchema } from './schemas/molecules.js';
|
|
4
4
|
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
5
5
|
export default class MoleculesJsonAsObsLabelsLoader extends JsonLoader {
|
|
@@ -23,12 +23,9 @@ export default class MoleculesJsonAsObsLabelsLoader extends JsonLoader {
|
|
|
23
23
|
return this.cachedResult;
|
|
24
24
|
}
|
|
25
25
|
async load() {
|
|
26
|
-
const payload = await super.load()
|
|
27
|
-
if (payload instanceof AbstractLoaderError) {
|
|
28
|
-
return Promise.reject(payload);
|
|
29
|
-
}
|
|
26
|
+
const payload = await super.load();
|
|
30
27
|
const { data, url } = payload;
|
|
31
28
|
const result = this.loadFromCache(data);
|
|
32
|
-
return
|
|
29
|
+
return new LoaderResult(result, url);
|
|
33
30
|
}
|
|
34
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoleculesJsonAsObsLocations.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/MoleculesJsonAsObsLocations.js"],"names":[],"mappings":"AAMA;IAII,kJAA6B;IAG/B;;;;;;MAoBC;IAFC;;;;;;kBAA8C;IAIhD;;;;;;
|
|
1
|
+
{"version":3,"file":"MoleculesJsonAsObsLocations.d.ts","sourceRoot":"","sources":["../../src/legacy-loaders/MoleculesJsonAsObsLocations.js"],"names":[],"mappings":"AAMA;IAII,kJAA6B;IAG/B;;;;;;MAoBC;IAFC;;;;;;kBAA8C;IAIhD;;;;;;QASC;CACF;uBAzCsB,+BAA+B;6BAHzB,oBAAoB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { range, sum } from 'lodash-es';
|
|
2
|
-
import {
|
|
2
|
+
import { LoaderResult } from '@vitessce/abstract';
|
|
3
3
|
import { DEFAULT_MOLECULES_LAYER } from '@vitessce/spatial-utils';
|
|
4
4
|
import { moleculesSchema } from './schemas/molecules.js';
|
|
5
5
|
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
@@ -30,16 +30,13 @@ export default class MoleculesJsonAsObsLocationsLoader extends JsonLoader {
|
|
|
30
30
|
return this.cachedResult;
|
|
31
31
|
}
|
|
32
32
|
async load() {
|
|
33
|
-
const payload = await super.load()
|
|
34
|
-
if (payload instanceof AbstractLoaderError) {
|
|
35
|
-
return Promise.reject(payload);
|
|
36
|
-
}
|
|
33
|
+
const payload = await super.load();
|
|
37
34
|
const { data, url } = payload;
|
|
38
35
|
const result = this.loadFromCache(data);
|
|
39
36
|
const coordinationValues = {
|
|
40
37
|
// TODO: do this for anndata segmentation loader
|
|
41
38
|
spatialPointLayer: DEFAULT_MOLECULES_LAYER,
|
|
42
39
|
};
|
|
43
|
-
return
|
|
40
|
+
return new LoaderResult(result, url, coordinationValues);
|
|
44
41
|
}
|
|
45
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RasterJsonAsImageLoader.d.ts","sourceRoot":"","sources":["../../src/raster-json-loaders/RasterJsonAsImageLoader.js"],"names":[],"mappings":"AAKA;IACE;;;;;
|
|
1
|
+
{"version":3,"file":"RasterJsonAsImageLoader.d.ts","sourceRoot":"","sources":["../../src/raster-json-loaders/RasterJsonAsImageLoader.js"],"names":[],"mappings":"AAKA;IACE;;;;;QAoCC;CACF;yBAxCwB,uBAAuB;6BAHnB,oBAAoB"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoaderResult } from '@vitessce/abstract';
|
|
2
2
|
import { log } from '@vitessce/globals';
|
|
3
3
|
import RasterLoader from './RasterJsonLoader.js';
|
|
4
4
|
export default class RasterJsonAsImageLoader extends RasterLoader {
|
|
5
5
|
async load() {
|
|
6
|
-
const loaderResult = await super.load()
|
|
7
|
-
if (loaderResult instanceof AbstractLoaderError) {
|
|
8
|
-
return Promise.reject(loaderResult);
|
|
9
|
-
}
|
|
6
|
+
const loaderResult = await super.load();
|
|
10
7
|
const { data = {}, url: urls, coordinationValues } = loaderResult;
|
|
11
8
|
const { loaders: allLoaders = [], meta: allMeta = [] } = data;
|
|
12
9
|
const loaders = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RasterJsonAsObsSegmentationsLoader.d.ts","sourceRoot":"","sources":["../../src/raster-json-loaders/RasterJsonAsObsSegmentationsLoader.js"],"names":[],"mappings":"AAIA;IACE;;;;;;
|
|
1
|
+
{"version":3,"file":"RasterJsonAsObsSegmentationsLoader.d.ts","sourceRoot":"","sources":["../../src/raster-json-loaders/RasterJsonAsObsSegmentationsLoader.js"],"names":[],"mappings":"AAIA;IACE;;;;;;eAqCC;CACF;yBAzCwB,uBAAuB;6BAFnB,oBAAoB"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoaderResult } from '@vitessce/abstract';
|
|
2
2
|
import { log } from '@vitessce/globals';
|
|
3
3
|
import RasterLoader from './RasterJsonLoader.js';
|
|
4
4
|
export default class RasterJsonAsObsSegmentationsLoader extends RasterLoader {
|
|
5
5
|
async load() {
|
|
6
|
-
const loaderResult = await super.load()
|
|
7
|
-
if (loaderResult instanceof AbstractLoaderError) {
|
|
8
|
-
return Promise.reject(loaderResult);
|
|
9
|
-
}
|
|
6
|
+
const loaderResult = await super.load();
|
|
10
7
|
const { data = {}, url: urls, coordinationValues } = loaderResult;
|
|
11
8
|
const { loaders: allLoaders = [], meta: allMeta = [] } = data;
|
|
12
9
|
const loaders = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RasterJsonLoader.d.ts","sourceRoot":"","sources":["../../src/raster-json-loaders/RasterJsonLoader.js"],"names":[],"mappings":"AAsIA;
|
|
1
|
+
{"version":3,"file":"RasterJsonLoader.d.ts","sourceRoot":"","sources":["../../src/raster-json-loaders/RasterJsonLoader.js"],"names":[],"mappings":"AAsIA;IA8BM,oBAIC;CAmBN;uBA7KsB,+BAA+B"}
|
|
@@ -3,7 +3,7 @@ import { log } from '@vitessce/globals';
|
|
|
3
3
|
import { initializeRasterLayersAndChannels, coordinateTransformationsToMatrix, getNgffAxes, loadOmeZarr, guessTileSize, ZarritaPixelSource, } from '@vitessce/spatial-utils';
|
|
4
4
|
import { open as zarrOpen } from 'zarrita';
|
|
5
5
|
import { zarrOpenRoot, createZarrArrayAdapter } from '@vitessce/zarr-utils';
|
|
6
|
-
import {
|
|
6
|
+
import { LoaderResult } from '@vitessce/abstract';
|
|
7
7
|
import { rasterJsonSchema as rasterSchema } from '@vitessce/schemas';
|
|
8
8
|
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
9
9
|
async function initLoader(imageData) {
|
|
@@ -117,10 +117,7 @@ export default class RasterLoader extends JsonLoader {
|
|
|
117
117
|
this.schema = rasterSchema;
|
|
118
118
|
}
|
|
119
119
|
async load() {
|
|
120
|
-
const payload = await super.load()
|
|
121
|
-
if (payload instanceof AbstractLoaderError) {
|
|
122
|
-
return Promise.reject(payload);
|
|
123
|
-
}
|
|
120
|
+
const payload = await super.load();
|
|
124
121
|
const { data: raster } = payload;
|
|
125
122
|
const { images, renderLayers, usePhysicalSizeScaling = false } = raster;
|
|
126
123
|
// Get image name and URL tuples.
|
|
@@ -142,7 +139,10 @@ export default class RasterLoader extends JsonLoader {
|
|
|
142
139
|
const coordinationValues = {
|
|
143
140
|
spatialImageLayer: autoImageLayers,
|
|
144
141
|
};
|
|
145
|
-
return new LoaderResult({
|
|
142
|
+
return new LoaderResult({
|
|
143
|
+
loaders: imageLayerLoaders,
|
|
144
|
+
meta: imageLayerMeta,
|
|
145
|
+
}, urls, coordinationValues);
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/json",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.9",
|
|
4
4
|
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -20,16 +20,17 @@
|
|
|
20
20
|
"lodash-es": "^4.17.21",
|
|
21
21
|
"zarrita": "0.5.2",
|
|
22
22
|
"zod": "^3.21.4",
|
|
23
|
-
"@vitessce/constants-internal": "3.6.
|
|
24
|
-
"@vitessce/gl": "3.6.
|
|
25
|
-
"@vitessce/globals": "3.6.
|
|
26
|
-
"@vitessce/schemas": "3.6.
|
|
27
|
-
"@vitessce/sets-utils": "3.6.
|
|
28
|
-
"@vitessce/spatial-utils": "3.6.
|
|
29
|
-
"@vitessce/utils": "3.6.
|
|
30
|
-
"@vitessce/abstract": "3.6.
|
|
31
|
-
"@vitessce/
|
|
32
|
-
"@vitessce/
|
|
23
|
+
"@vitessce/constants-internal": "3.6.9",
|
|
24
|
+
"@vitessce/gl": "3.6.9",
|
|
25
|
+
"@vitessce/globals": "3.6.9",
|
|
26
|
+
"@vitessce/schemas": "3.6.9",
|
|
27
|
+
"@vitessce/sets-utils": "3.6.9",
|
|
28
|
+
"@vitessce/spatial-utils": "3.6.9",
|
|
29
|
+
"@vitessce/utils": "3.6.9",
|
|
30
|
+
"@vitessce/abstract": "3.6.9",
|
|
31
|
+
"@vitessce/error": "3.6.9",
|
|
32
|
+
"@vitessce/zarr-utils": "3.6.9",
|
|
33
|
+
"@vitessce/config": "3.6.9"
|
|
33
34
|
},
|
|
34
35
|
"scripts": {
|
|
35
36
|
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
|
package/src/JsonSource.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-underscore-dangle */
|
|
2
|
-
import {
|
|
2
|
+
import { DataFetchError } from '@vitessce/error';
|
|
3
3
|
|
|
4
4
|
export default class JsonSource {
|
|
5
5
|
constructor({ url, requestInit }) {
|
|
@@ -7,15 +7,13 @@ export default class JsonSource {
|
|
|
7
7
|
this.requestInit = requestInit;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
async loadJson() {
|
|
11
11
|
if (this._data) return this._data;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line no-console
|
|
18
|
-
}).catch(() => Promise.reject(new DataSourceFetchError('JsonSource', this.url, {})));
|
|
12
|
+
const response = await fetch(this.url, this.requestInit);
|
|
13
|
+
if (!response.ok) {
|
|
14
|
+
throw new DataFetchError(`loadJson failed for ${this.url}`);
|
|
15
|
+
}
|
|
16
|
+
this._data = await response.json();
|
|
19
17
|
return this._data;
|
|
20
18
|
}
|
|
21
19
|
}
|