@vitessce/json 2.0.3 → 3.0.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/{deflate.40c5a64d.mjs → deflate-ba4bbf4e.js} +2 -2
- package/dist/{index.cd98204c.mjs → index-7338c21e.js} +32388 -27793
- package/dist/{index.mjs → index.js} +4 -4
- package/dist/{jpeg.71d7c24e.mjs → jpeg-cf883268.js} +1 -1
- package/dist/{lerc.1bd33f8e.mjs → lerc-eb8b24d4.js} +76 -5
- package/dist/{lzw.55eb0ed4.mjs → lzw-0f433a46.js} +1 -1
- package/dist/{packbits.244c3ff7.mjs → packbits-9f8b76b3.js} +1 -1
- package/dist/{pako.esm.4b234125.mjs → pako.esm-68f84e2a.js} +97 -15
- package/dist/{raw.e260117e.mjs → raw-88c5a59c.js} +1 -1
- package/dist/{webimage.9c635930.mjs → webimage-32a7a116.js} +1 -1
- package/dist-tsc/JsonSource.d.ts +11 -0
- package/dist-tsc/JsonSource.d.ts.map +1 -0
- package/dist-tsc/JsonSource.js +20 -0
- package/dist-tsc/index.d.ts +5 -0
- package/dist-tsc/index.d.ts.map +1 -0
- package/dist-tsc/index.js +5 -4
- package/dist-tsc/json-loaders/JsonLoader.d.ts +8 -0
- package/dist-tsc/json-loaders/JsonLoader.d.ts.map +1 -0
- package/dist-tsc/json-loaders/JsonLoader.js +51 -0
- package/dist-tsc/json-loaders/JsonLoader.test.d.ts +2 -0
- package/dist-tsc/json-loaders/JsonLoader.test.d.ts.map +1 -0
- package/dist-tsc/json-loaders/JsonLoader.test.js +26 -0
- package/dist-tsc/json-loaders/ObsSegmentationsJson.d.ts +21 -0
- package/dist-tsc/json-loaders/ObsSegmentationsJson.d.ts.map +1 -0
- package/dist-tsc/json-loaders/ObsSegmentationsJson.js +26 -0
- package/dist-tsc/json-loaders/ObsSetsJson.d.ts +5 -0
- package/dist-tsc/json-loaders/ObsSetsJson.d.ts.map +1 -0
- package/dist-tsc/json-loaders/ObsSetsJson.js +44 -0
- package/dist-tsc/json-loaders/ObsSetsJson.test-old.d.ts +1 -0
- package/dist-tsc/json-loaders/ObsSetsJson.test-old.d.ts.map +1 -0
- package/dist-tsc/json-loaders/ObsSetsJson.test-old.js +32 -0
- package/dist-tsc/json-loaders/index.d.ts +4 -0
- package/dist-tsc/json-loaders/index.d.ts.map +1 -0
- package/dist-tsc/json-loaders/index.js +3 -0
- package/dist-tsc/legacy-loaders/CellsJsonAsObsEmbedding.d.ts +38 -0
- package/dist-tsc/legacy-loaders/CellsJsonAsObsEmbedding.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/CellsJsonAsObsEmbedding.js +41 -0
- package/dist-tsc/legacy-loaders/CellsJsonAsObsLabels.d.ts +32 -0
- package/dist-tsc/legacy-loaders/CellsJsonAsObsLabels.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/CellsJsonAsObsLabels.js +28 -0
- package/dist-tsc/legacy-loaders/CellsJsonAsObsLocations.d.ts +38 -0
- package/dist-tsc/legacy-loaders/CellsJsonAsObsLocations.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/CellsJsonAsObsLocations.js +39 -0
- package/dist-tsc/legacy-loaders/CellsJsonAsObsSegmentations.d.ts +38 -0
- package/dist-tsc/legacy-loaders/CellsJsonAsObsSegmentations.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/CellsJsonAsObsSegmentations.js +55 -0
- package/dist-tsc/legacy-loaders/CellsJsonLoaders.test.d.ts +2 -0
- package/dist-tsc/legacy-loaders/CellsJsonLoaders.test.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/CellsJsonLoaders.test.js +67 -0
- package/dist-tsc/legacy-loaders/ClustersJsonAsObsFeatureMatrix.d.ts +32 -0
- package/dist-tsc/legacy-loaders/ClustersJsonAsObsFeatureMatrix.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/ClustersJsonAsObsFeatureMatrix.js +48 -0
- package/dist-tsc/legacy-loaders/ClustersJsonLoaders.test.d.ts +2 -0
- package/dist-tsc/legacy-loaders/ClustersJsonLoaders.test.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/ClustersJsonLoaders.test.js +32 -0
- package/dist-tsc/legacy-loaders/GenesJsonAsObsFeatureMatrix.d.ts +29 -0
- package/dist-tsc/legacy-loaders/GenesJsonAsObsFeatureMatrix.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/GenesJsonAsObsFeatureMatrix.js +34 -0
- package/dist-tsc/legacy-loaders/GenesJsonLoaders.test.d.ts +2 -0
- package/dist-tsc/legacy-loaders/GenesJsonLoaders.test.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/GenesJsonLoaders.test.js +32 -0
- package/dist-tsc/legacy-loaders/MoleculesJsonAsObsLabels.d.ts +14 -0
- package/dist-tsc/legacy-loaders/MoleculesJsonAsObsLabels.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/MoleculesJsonAsObsLabels.js +34 -0
- package/dist-tsc/legacy-loaders/MoleculesJsonAsObsLocations.d.ts +20 -0
- package/dist-tsc/legacy-loaders/MoleculesJsonAsObsLocations.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/MoleculesJsonAsObsLocations.js +45 -0
- package/dist-tsc/legacy-loaders/MoleculesJsonLoaders.test.d.ts +2 -0
- package/dist-tsc/legacy-loaders/MoleculesJsonLoaders.test.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/MoleculesJsonLoaders.test.js +45 -0
- package/dist-tsc/legacy-loaders/index.d.ts +9 -0
- package/dist-tsc/legacy-loaders/index.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/index.js +8 -0
- package/dist-tsc/legacy-loaders/schemas/cells.d.ts +21 -0
- package/dist-tsc/legacy-loaders/schemas/cells.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/schemas/cells.js +9 -0
- package/dist-tsc/legacy-loaders/schemas/clusters.d.ts +15 -0
- package/dist-tsc/legacy-loaders/schemas/clusters.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/schemas/clusters.js +6 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/cells.bad.json +8 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/cells.bad.message.json +11 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/cells.good.json +29 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/clusters.bad.json +9 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/clusters.bad.message.json +13 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/clusters.good.json +9 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/genes.bad.json +6 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/genes.bad.message.json +13 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/genes.good.json +4 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/molecules.bad.json +7 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/molecules.bad.message.json +11 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/molecules.good.json +7 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/neighborhoods.bad.json +4 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/neighborhoods.bad.message.json +11 -0
- package/dist-tsc/legacy-loaders/schemas/fixtures/neighborhoods.good.json +4 -0
- package/dist-tsc/legacy-loaders/schemas/genes.d.ts +12 -0
- package/dist-tsc/legacy-loaders/schemas/genes.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/schemas/genes.js +5 -0
- package/dist-tsc/legacy-loaders/schemas/molecules.d.ts +3 -0
- package/dist-tsc/legacy-loaders/schemas/molecules.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/schemas/molecules.js +4 -0
- package/dist-tsc/legacy-loaders/schemas/neighborhoods.d.ts +9 -0
- package/dist-tsc/legacy-loaders/schemas/neighborhoods.d.ts.map +1 -0
- package/dist-tsc/legacy-loaders/schemas/neighborhoods.js +6 -0
- package/dist-tsc/raster-json-loaders/RasterJsonAsImageLoader.d.ts +4 -0
- package/dist-tsc/raster-json-loaders/RasterJsonAsImageLoader.d.ts.map +1 -0
- package/dist-tsc/raster-json-loaders/RasterJsonAsImageLoader.js +36 -0
- package/dist-tsc/raster-json-loaders/RasterJsonAsObsSegmentationsLoader.d.ts +4 -0
- package/dist-tsc/raster-json-loaders/RasterJsonAsObsSegmentationsLoader.d.ts.map +1 -0
- package/dist-tsc/raster-json-loaders/RasterJsonAsObsSegmentationsLoader.js +37 -0
- package/dist-tsc/raster-json-loaders/RasterJsonLoader.d.ts +6 -0
- package/dist-tsc/raster-json-loaders/RasterJsonLoader.d.ts.map +1 -0
- package/dist-tsc/raster-json-loaders/RasterJsonLoader.js +135 -0
- package/dist-tsc/raster-json-loaders/index.d.ts +3 -0
- package/dist-tsc/raster-json-loaders/index.d.ts.map +1 -0
- package/dist-tsc/raster-json-loaders/index.js +2 -0
- package/package.json +22 -15
- package/src/index.js +5 -4
- package/src/json-loaders/JsonLoader.js +7 -9
- package/src/json-loaders/JsonLoader.test.js +3 -2
- package/src/json-loaders/ObsSegmentationsJson.js +2 -8
- package/src/json-loaders/ObsSetsJson.js +4 -3
- package/src/json-loaders/ObsSetsJson.test-old.js +1 -1
- package/src/json-loaders/index.js +3 -3
- package/src/legacy-loaders/CellsJsonAsObsEmbedding.js +2 -2
- package/src/legacy-loaders/CellsJsonAsObsLabels.js +2 -2
- package/src/legacy-loaders/CellsJsonAsObsLocations.js +2 -2
- package/src/legacy-loaders/CellsJsonAsObsSegmentations.js +2 -2
- package/src/legacy-loaders/CellsJsonLoaders.test.js +8 -7
- package/src/legacy-loaders/ClustersJsonAsObsFeatureMatrix.js +3 -3
- package/src/legacy-loaders/ClustersJsonLoaders.test.js +4 -3
- package/src/legacy-loaders/GenesJsonAsObsFeatureMatrix.js +2 -2
- package/src/legacy-loaders/GenesJsonLoaders.test.js +4 -3
- package/src/legacy-loaders/MoleculesJsonAsObsLabels.js +3 -4
- package/src/legacy-loaders/MoleculesJsonAsObsLocations.js +3 -4
- package/src/legacy-loaders/MoleculesJsonLoaders.test.js +6 -5
- package/src/legacy-loaders/index.js +8 -8
- package/src/legacy-loaders/schemas/cells.js +13 -0
- package/src/legacy-loaders/schemas/clusters.js +7 -0
- package/src/legacy-loaders/schemas/genes.js +6 -0
- package/src/legacy-loaders/schemas/molecules.js +8 -0
- package/src/legacy-loaders/schemas/neighborhoods.js +10 -0
- package/src/raster-json-loaders/RasterJsonAsImageLoader.js +1 -1
- package/src/raster-json-loaders/RasterJsonAsObsSegmentationsLoader.js +1 -1
- package/src/raster-json-loaders/RasterJsonLoader.js +52 -4
- package/src/raster-json-loaders/index.js +2 -2
- package/src/legacy-loaders/schemas/cells.schema.json +0 -52
- package/src/legacy-loaders/schemas/clusters.schema.json +0 -30
- package/src/legacy-loaders/schemas/genes.schema.json +0 -27
- package/src/legacy-loaders/schemas/molecules.schema.json +0 -20
- package/src/legacy-loaders/schemas/neighborhoods.schema.json +0 -28
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RasterJsonAsImageLoader.d.ts","sourceRoot":"","sources":["../../src/raster-json-loaders/RasterJsonAsImageLoader.js"],"names":[],"mappings":"AAGA;CAyCC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
|
|
2
|
+
import RasterLoader from './RasterJsonLoader.js';
|
|
3
|
+
export default class RasterJsonAsImageLoader extends RasterLoader {
|
|
4
|
+
async load() {
|
|
5
|
+
const loaderResult = await super.load().catch(reason => Promise.resolve(reason));
|
|
6
|
+
if (loaderResult instanceof AbstractLoaderError) {
|
|
7
|
+
return Promise.reject(loaderResult);
|
|
8
|
+
}
|
|
9
|
+
const { data = {}, url: urls, coordinationValues } = loaderResult;
|
|
10
|
+
const { loaders: allLoaders = [], meta: allMeta = [] } = data;
|
|
11
|
+
const loaders = [];
|
|
12
|
+
const meta = [];
|
|
13
|
+
// Only include non-bitmask items.
|
|
14
|
+
allMeta.forEach((layer, i) => {
|
|
15
|
+
if (!layer?.metadata?.isBitmask) {
|
|
16
|
+
loaders.push(allLoaders[i]);
|
|
17
|
+
meta.push(allMeta[i]);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
if (!coordinationValues?.spatialImageLayer) {
|
|
21
|
+
console.warn('Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsImageLoader. This may be an indicator that the image could not be loaded.');
|
|
22
|
+
}
|
|
23
|
+
return new LoaderResult({
|
|
24
|
+
image: (loaders.length > 0 && meta.length > 0 ? { loaders, meta } : null),
|
|
25
|
+
}, urls, {
|
|
26
|
+
// Filter coordinationValues, keeping only non-bitmask layers.
|
|
27
|
+
spatialImageLayer: coordinationValues?.spatialImageLayer?.filter(l => l.type !== 'bitmask')
|
|
28
|
+
// Re-index since we removed the bitmask layers,
|
|
29
|
+
// so the indices may have gaps.
|
|
30
|
+
.map(layer => ({
|
|
31
|
+
...layer,
|
|
32
|
+
index: meta.findIndex(metaItem => metaItem.name === allMeta[layer.index].name),
|
|
33
|
+
})),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RasterJsonAsObsSegmentationsLoader.d.ts","sourceRoot":"","sources":["../../src/raster-json-loaders/RasterJsonAsObsSegmentationsLoader.js"],"names":[],"mappings":"AAGA;CA0CC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
|
|
2
|
+
import RasterLoader from './RasterJsonLoader.js';
|
|
3
|
+
export default class RasterJsonAsObsSegmentationsLoader extends RasterLoader {
|
|
4
|
+
async load() {
|
|
5
|
+
const loaderResult = await super.load().catch(reason => Promise.resolve(reason));
|
|
6
|
+
if (loaderResult instanceof AbstractLoaderError) {
|
|
7
|
+
return Promise.reject(loaderResult);
|
|
8
|
+
}
|
|
9
|
+
const { data = {}, url: urls, coordinationValues } = loaderResult;
|
|
10
|
+
const { loaders: allLoaders = [], meta: allMeta = [] } = data;
|
|
11
|
+
const loaders = [];
|
|
12
|
+
const meta = [];
|
|
13
|
+
// Only include bitmask items.
|
|
14
|
+
allMeta.forEach((layer, i) => {
|
|
15
|
+
if (layer?.metadata?.isBitmask) {
|
|
16
|
+
loaders.push(allLoaders[i]);
|
|
17
|
+
meta.push(allMeta[i]);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
if (!coordinationValues?.spatialImageLayer) {
|
|
21
|
+
console.warn('Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsObsSegmentationsLoader. This may be an indicator that the image could not be loaded.');
|
|
22
|
+
}
|
|
23
|
+
return new LoaderResult({
|
|
24
|
+
obsSegmentationsType: 'bitmask',
|
|
25
|
+
obsSegmentations: (loaders.length > 0 && meta.length > 0 ? { loaders, meta } : null),
|
|
26
|
+
}, urls, {
|
|
27
|
+
// Filter coordinationValues, keeping only bitmask layers.
|
|
28
|
+
spatialSegmentationLayer: coordinationValues?.spatialImageLayer?.filter(l => l.type === 'bitmask')
|
|
29
|
+
// Re-index since we removed the bitmask layers,
|
|
30
|
+
// so the indices may have gaps.
|
|
31
|
+
.map(layer => ({
|
|
32
|
+
...layer,
|
|
33
|
+
index: meta.findIndex(metaItem => metaItem.name === allMeta[layer.index].name),
|
|
34
|
+
})),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RasterJsonLoader.d.ts","sourceRoot":"","sources":["../../src/raster-json-loaders/RasterJsonLoader.js"],"names":[],"mappings":"AAyHA;IAWE,qBAyCC;IAnBG,oBAIC;CAgBN"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { viv } from '@vitessce/gl';
|
|
2
|
+
import { initializeRasterLayersAndChannels, coordinateTransformationsToMatrix, getNgffAxes, } from '@vitessce/spatial-utils';
|
|
3
|
+
import { openArray } from 'zarr';
|
|
4
|
+
import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
|
|
5
|
+
import { rasterJsonSchema as rasterSchema } from '@vitessce/schemas';
|
|
6
|
+
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
7
|
+
async function initLoader(imageData) {
|
|
8
|
+
const { type, url, metadata, requestInit, } = imageData;
|
|
9
|
+
switch (type) {
|
|
10
|
+
case ('zarr'): {
|
|
11
|
+
const { dimensions, isPyramid, transform, } = metadata || {};
|
|
12
|
+
const labels = dimensions.map(d => d.field);
|
|
13
|
+
let source;
|
|
14
|
+
if (isPyramid) {
|
|
15
|
+
const metadataUrl = `${url}${url.slice(-1) === '/' ? '' : '/'}.zmetadata`;
|
|
16
|
+
const response = await fetch(metadataUrl);
|
|
17
|
+
const { metadata: zarrMetadata } = await response.json();
|
|
18
|
+
const paths = Object.keys(zarrMetadata)
|
|
19
|
+
.filter(metaKey => metaKey.includes('.zarray'))
|
|
20
|
+
.map(arrMetaKeys => arrMetaKeys.slice(0, -7));
|
|
21
|
+
const data = await Promise.all(paths.map(path => openArray({ store: url, path })));
|
|
22
|
+
const [yChunk, xChunk] = data[0].chunks.slice(-2);
|
|
23
|
+
const size = Math.min(yChunk, xChunk);
|
|
24
|
+
// deck.gl requirement for power-of-two tile size.
|
|
25
|
+
const tileSize = 2 ** Math.floor(Math.log2(size));
|
|
26
|
+
source = data.map(d => new viv.ZarrPixelSource(d, labels, tileSize));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const data = await openArray({ store: url });
|
|
30
|
+
source = new viv.ZarrPixelSource(data, labels);
|
|
31
|
+
}
|
|
32
|
+
return { data: source, metadata: { dimensions, transform }, channels: (dimensions.find(d => d.field === 'channel') || dimensions[0]).values };
|
|
33
|
+
}
|
|
34
|
+
case ('ome-tiff'): {
|
|
35
|
+
let loader;
|
|
36
|
+
// Fetch offsets for ome-tiff if needed.
|
|
37
|
+
if (metadata && 'omeTiffOffsetsUrl' in metadata) {
|
|
38
|
+
const { omeTiffOffsetsUrl } = metadata;
|
|
39
|
+
const res = await fetch(omeTiffOffsetsUrl, (requestInit || {}));
|
|
40
|
+
if (res.ok) {
|
|
41
|
+
const offsets = await res.json();
|
|
42
|
+
loader = await viv.loadOmeTiff(url, {
|
|
43
|
+
offsets,
|
|
44
|
+
headers: requestInit?.headers,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
throw new Error(`Offsets not found but provided: ${res.status} from ${res.url}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
loader = await viv.loadOmeTiff(url, { headers: requestInit?.headers });
|
|
53
|
+
}
|
|
54
|
+
const { Pixels: { Channels } } = loader.metadata;
|
|
55
|
+
const channels = Array.isArray(Channels)
|
|
56
|
+
? Channels.map((channel, i) => channel.Name || `Channel ${i}`)
|
|
57
|
+
: [Channels.Name || `Channel ${0}`];
|
|
58
|
+
return { ...loader, channels };
|
|
59
|
+
}
|
|
60
|
+
case ('ome-zarr'): {
|
|
61
|
+
// Reference: https://github.com/vitessce/vitessce-python/issues/242#issuecomment-1517930964
|
|
62
|
+
// Most of the following has been copied from OmeZarrLoader.js.
|
|
63
|
+
// Reference: https://github.com/vitessce/vitessce/blob/fb0e7f/packages/file-types/zarr/src/ome-loaders/OmeZarrLoader.js#L29
|
|
64
|
+
const { coordinateTransformations: coordinateTransformationsFromOptions } = metadata || {};
|
|
65
|
+
const loader = await viv.loadOmeZarr(url, { fetchOptions: requestInit, type: 'multiscales' });
|
|
66
|
+
const { metadata: loaderMetadata } = loader;
|
|
67
|
+
const { omero, multiscales } = loaderMetadata;
|
|
68
|
+
if (!Array.isArray(multiscales) || multiscales.length === 0) {
|
|
69
|
+
console.error('Multiscales array must exist and have at least one element');
|
|
70
|
+
}
|
|
71
|
+
const { coordinateTransformations } = multiscales[0];
|
|
72
|
+
// Axes in v0.4 format.
|
|
73
|
+
const axes = getNgffAxes(multiscales[0].axes);
|
|
74
|
+
const transformMatrixFromOptions = coordinateTransformationsToMatrix(coordinateTransformationsFromOptions, axes);
|
|
75
|
+
const transformMatrixFromFile = coordinateTransformationsToMatrix(coordinateTransformations, axes);
|
|
76
|
+
const transformMatrix = transformMatrixFromFile.multiplyLeft(transformMatrixFromOptions);
|
|
77
|
+
const { channels, name: omeroName } = omero;
|
|
78
|
+
return {
|
|
79
|
+
name: omeroName || 'Image',
|
|
80
|
+
channels: channels.map((c, i) => c.label || `Channel ${i}`),
|
|
81
|
+
...(transformMatrix ? {
|
|
82
|
+
metadata: {
|
|
83
|
+
transform: {
|
|
84
|
+
matrix: transformMatrix,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
} : {}),
|
|
88
|
+
...loader,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
default: {
|
|
92
|
+
throw Error(`Image type (${type}) is not supported`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export default class RasterLoader extends JsonLoader {
|
|
97
|
+
constructor(dataSource, params) {
|
|
98
|
+
const { url, options } = params;
|
|
99
|
+
if (!url && options) {
|
|
100
|
+
// eslint-disable-next-line no-param-reassign
|
|
101
|
+
dataSource.url = URL.createObjectURL(new Blob([JSON.stringify(options)]));
|
|
102
|
+
}
|
|
103
|
+
super(dataSource, params);
|
|
104
|
+
this.schema = rasterSchema;
|
|
105
|
+
}
|
|
106
|
+
async load() {
|
|
107
|
+
const payload = await super.load().catch(reason => Promise.resolve(reason));
|
|
108
|
+
if (payload instanceof AbstractLoaderError) {
|
|
109
|
+
return Promise.reject(payload);
|
|
110
|
+
}
|
|
111
|
+
const { data: raster } = payload;
|
|
112
|
+
const { images, renderLayers, usePhysicalSizeScaling = false } = raster;
|
|
113
|
+
// Get image name and URL tuples.
|
|
114
|
+
const urls = images
|
|
115
|
+
.filter(image => !image.url.includes('zarr'))
|
|
116
|
+
.map(image => ({ url: image.url, name: image.name }));
|
|
117
|
+
// Add a loaderCreator function for each image layer.
|
|
118
|
+
const imagesWithLoaderCreators = images.map(image => ({
|
|
119
|
+
...image,
|
|
120
|
+
loaderCreator: async () => initLoader(image),
|
|
121
|
+
}));
|
|
122
|
+
// TODO: use options for initial selection of channels
|
|
123
|
+
// which omit domain/slider ranges.
|
|
124
|
+
if (!this.autoImageCache) {
|
|
125
|
+
this.autoImageCache = initializeRasterLayersAndChannels(imagesWithLoaderCreators, renderLayers, usePhysicalSizeScaling);
|
|
126
|
+
}
|
|
127
|
+
return this.autoImageCache.then((autoImages) => {
|
|
128
|
+
const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = autoImages;
|
|
129
|
+
const coordinationValues = {
|
|
130
|
+
spatialImageLayer: autoImageLayers,
|
|
131
|
+
};
|
|
132
|
+
return new LoaderResult({ loaders: imageLayerLoaders, meta: imageLayerMeta }, urls, coordinationValues);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/raster-json-loaders/index.js"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/json",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"author": "Gehlenborg Lab",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -8,28 +8,35 @@
|
|
|
8
8
|
"url": "git+https://github.com/vitessce/vitessce.git"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "dist/index.js",
|
|
12
13
|
"files": [
|
|
14
|
+
"src",
|
|
13
15
|
"dist",
|
|
14
|
-
"
|
|
16
|
+
"dist-tsc"
|
|
15
17
|
],
|
|
16
18
|
"dependencies": {
|
|
17
|
-
"ajv": "^6.10.0",
|
|
18
19
|
"d3-array": "^2.4.0",
|
|
19
|
-
"lodash": "^4.17.21",
|
|
20
|
+
"lodash-es": "^4.17.21",
|
|
20
21
|
"zarr": "0.5.1",
|
|
21
|
-
"
|
|
22
|
-
"@vitessce/
|
|
23
|
-
"@vitessce/
|
|
24
|
-
"@vitessce/
|
|
25
|
-
"@vitessce/utils": "
|
|
26
|
-
"@vitessce/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"ajv": "^6.10.0"
|
|
22
|
+
"zod": "^3.21.4",
|
|
23
|
+
"@vitessce/constants-internal": "3.0.1",
|
|
24
|
+
"@vitessce/gl": "3.0.1",
|
|
25
|
+
"@vitessce/schemas": "3.0.1",
|
|
26
|
+
"@vitessce/sets-utils": "3.0.1",
|
|
27
|
+
"@vitessce/spatial-utils": "3.0.1",
|
|
28
|
+
"@vitessce/utils": "3.0.1",
|
|
29
|
+
"@vitessce/vit-s": "3.0.1"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
|
|
33
|
-
"test": "pnpm exec vitest --run
|
|
33
|
+
"test": "pnpm exec vitest --run"
|
|
34
|
+
},
|
|
35
|
+
"module": "dist/index.js",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./dist-tsc/index.d.ts",
|
|
39
|
+
"import": "./dist/index.js"
|
|
40
|
+
}
|
|
34
41
|
}
|
|
35
42
|
}
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
1
|
+
/* eslint-disable react-refresh/only-export-components */
|
|
2
|
+
export { default as JsonSource } from './JsonSource.js';
|
|
3
|
+
export * from './json-loaders/index.js';
|
|
4
|
+
export * from './legacy-loaders/index.js';
|
|
5
|
+
export * from './raster-json-loaders/index.js';
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import Ajv from 'ajv';
|
|
2
1
|
import { FileType } from '@vitessce/constants-internal';
|
|
3
2
|
import {
|
|
4
3
|
AbstractTwoStepLoader,
|
|
5
4
|
LoaderValidationError,
|
|
6
5
|
AbstractLoaderError,
|
|
7
6
|
LoaderResult,
|
|
8
|
-
obsSetsSchema,
|
|
9
|
-
rasterSchema,
|
|
10
7
|
} from '@vitessce/vit-s';
|
|
11
8
|
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
9
|
+
import { obsSetsSchema, rasterJsonSchema as rasterSchema } from '@vitessce/schemas';
|
|
10
|
+
import { cellsSchema } from '../legacy-loaders/schemas/cells.js';
|
|
11
|
+
import { moleculesSchema } from '../legacy-loaders/schemas/molecules.js';
|
|
12
|
+
import { neighborhoodsSchema } from '../legacy-loaders/schemas/neighborhoods.js';
|
|
15
13
|
|
|
16
14
|
const fileTypeToSchema = {
|
|
17
15
|
[FileType.CELLS_JSON]: cellsSchema,
|
|
@@ -55,11 +53,11 @@ export default class JsonLoader extends AbstractTwoStepLoader {
|
|
|
55
53
|
if (!schema) {
|
|
56
54
|
return [true, null];
|
|
57
55
|
}
|
|
58
|
-
const
|
|
59
|
-
const valid =
|
|
56
|
+
const result = schema.safeParse(data);
|
|
57
|
+
const valid = result.success;
|
|
60
58
|
let failureReason;
|
|
61
59
|
if (!valid) {
|
|
62
|
-
failureReason =
|
|
60
|
+
failureReason = result.error.message;
|
|
63
61
|
}
|
|
64
62
|
return [valid, failureReason];
|
|
65
63
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import JsonLoader from './JsonLoader.js';
|
|
2
3
|
import cellsGoodFixture from '../legacy-loaders/schemas/fixtures/cells.good.json';
|
|
3
4
|
import cellsBadFixture from '../legacy-loaders/schemas/fixtures/cells.bad.json';
|
|
4
5
|
|
|
@@ -22,7 +23,7 @@ describe('loaders/JsonLoader', () => {
|
|
|
22
23
|
expect(loader.schema).toBeDefined();
|
|
23
24
|
const [valid, reason] = loader.validate(cellsBadFixture);
|
|
24
25
|
expect(valid).toBeFalsy();
|
|
25
|
-
expect(reason[0].message).toEqual(
|
|
26
|
+
expect(JSON.parse(reason)[0].message).toEqual("Unrecognized key(s) in object: 'tsne'");
|
|
26
27
|
});
|
|
27
28
|
});
|
|
28
29
|
});
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { AbstractLoaderError, LoaderResult
|
|
2
|
-
import JsonLoader from './JsonLoader';
|
|
1
|
+
import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
|
|
2
|
+
import JsonLoader from './JsonLoader.js';
|
|
3
3
|
|
|
4
4
|
export default class ObsSegmentationsJsonLoader extends JsonLoader {
|
|
5
|
-
constructor(dataSource, params) {
|
|
6
|
-
super(dataSource, params);
|
|
7
|
-
|
|
8
|
-
this.optionsSchema = emptySchema;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
5
|
loadFromCache(data) {
|
|
12
6
|
if (this.cachedResult) {
|
|
13
7
|
return this.cachedResult;
|
|
@@ -4,8 +4,9 @@ import {
|
|
|
4
4
|
nodeToSet,
|
|
5
5
|
treeToMembershipMap,
|
|
6
6
|
} from '@vitessce/sets-utils';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
7
|
+
import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
|
|
8
|
+
import { obsSetsSchema } from '@vitessce/schemas';
|
|
9
|
+
import JsonLoader from './JsonLoader.js';
|
|
9
10
|
|
|
10
11
|
export default class ObsSetsJsonLoader extends JsonLoader {
|
|
11
12
|
constructor(dataSource, params) {
|
|
@@ -21,7 +22,7 @@ export default class ObsSetsJsonLoader extends JsonLoader {
|
|
|
21
22
|
}
|
|
22
23
|
const { data: rawData, url } = payload;
|
|
23
24
|
const datatype = this.fileType.endsWith('cell-sets.json') ? 'cell' : 'obs';
|
|
24
|
-
const upgradedData = tryUpgradeTreeToLatestSchema(rawData, datatype);
|
|
25
|
+
const [upgradedData] = tryUpgradeTreeToLatestSchema(rawData, datatype);
|
|
25
26
|
let obsIndex = [];
|
|
26
27
|
const coordinationValues = {
|
|
27
28
|
obsSetSelection: [],
|
|
@@ -18,7 +18,7 @@ describe('loaders/json-loaders/ObsSetsJson', () => {
|
|
|
18
18
|
it('can load obsSets', async () => {
|
|
19
19
|
const loader = createLoader(ObsSetsJsonLoader, {
|
|
20
20
|
fileType: 'obsSets.cells.json',
|
|
21
|
-
}, 'http://localhost:
|
|
21
|
+
}, 'http://localhost:4204/@fixtures/vit-s/obsSets.good.json');
|
|
22
22
|
const result = await loader.load();
|
|
23
23
|
expect(result).toBeInstanceOf(LoaderResult);
|
|
24
24
|
const payload = result.data;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as JsonLoader } from './JsonLoader';
|
|
2
|
-
export { default as ObsSegmentationsJsonLoader } from './ObsSegmentationsJson';
|
|
3
|
-
export { default as ObsSetsJsonLoader } from './ObsSetsJson';
|
|
1
|
+
export { default as JsonLoader } from './JsonLoader.js';
|
|
2
|
+
export { default as ObsSegmentationsJsonLoader } from './ObsSegmentationsJson.js';
|
|
3
|
+
export { default as ObsSetsJsonLoader } from './ObsSetsJson.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
|
|
2
|
-
import cellsSchema from './schemas/cells.
|
|
3
|
-
import JsonLoader from '../json-loaders/JsonLoader';
|
|
2
|
+
import { cellsSchema } from './schemas/cells.js';
|
|
3
|
+
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
4
4
|
|
|
5
5
|
export default class CellsJsonAsObsEmbeddingLoader extends JsonLoader {
|
|
6
6
|
constructor(dataSource, params) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
|
|
2
|
-
import cellsSchema from './schemas/cells.
|
|
3
|
-
import JsonLoader from '../json-loaders/JsonLoader';
|
|
2
|
+
import { cellsSchema } from './schemas/cells.js';
|
|
3
|
+
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
4
4
|
|
|
5
5
|
export default class CellsJsonAsObsLabelsLoader extends JsonLoader {
|
|
6
6
|
constructor(dataSource, params) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
|
|
2
|
-
import cellsSchema from './schemas/cells.
|
|
3
|
-
import JsonLoader from '../json-loaders/JsonLoader';
|
|
2
|
+
import { cellsSchema } from './schemas/cells.js';
|
|
3
|
+
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
4
4
|
|
|
5
5
|
export default class CellsJsonAsObsLocationsLoader extends JsonLoader {
|
|
6
6
|
constructor(dataSource, params) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
|
|
2
2
|
import { DEFAULT_CELLS_LAYER, square } from '@vitessce/spatial-utils';
|
|
3
|
-
import cellsSchema from './schemas/cells.
|
|
4
|
-
import JsonLoader from '../json-loaders/JsonLoader';
|
|
3
|
+
import { cellsSchema } from './schemas/cells.js';
|
|
4
|
+
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
5
5
|
|
|
6
6
|
export default class CellsJsonAsObsSegmentationsLoader extends JsonLoader {
|
|
7
7
|
constructor(dataSource, params) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
1
2
|
import { LoaderResult } from '@vitessce/vit-s';
|
|
2
|
-
import CellsJsonAsObsEmbeddingLoader from './CellsJsonAsObsEmbedding';
|
|
3
|
-
import CellsJsonAsObsLabelsLoader from './CellsJsonAsObsLabels';
|
|
4
|
-
import CellsJsonAsObsSegmentationsLoader from './CellsJsonAsObsSegmentations';
|
|
5
|
-
import JsonSource from '../JsonSource';
|
|
3
|
+
import CellsJsonAsObsEmbeddingLoader from './CellsJsonAsObsEmbedding.js';
|
|
4
|
+
import CellsJsonAsObsLabelsLoader from './CellsJsonAsObsLabels.js';
|
|
5
|
+
import CellsJsonAsObsSegmentationsLoader from './CellsJsonAsObsSegmentations.js';
|
|
6
|
+
import JsonSource from '../JsonSource.js';
|
|
6
7
|
|
|
7
8
|
const createLoader = (ClassDef, config, url) => {
|
|
8
9
|
const configWithUrl = {
|
|
@@ -21,7 +22,7 @@ describe('loaders/cells-json-loaders', () => {
|
|
|
21
22
|
coordinationValues: {
|
|
22
23
|
embeddingType: 'PCA',
|
|
23
24
|
},
|
|
24
|
-
}, 'http://localhost:
|
|
25
|
+
}, 'http://localhost:4204/@fixtures/json-legacy/cells.good.json');
|
|
25
26
|
const result = await loader.load();
|
|
26
27
|
expect(result).toBeInstanceOf(LoaderResult);
|
|
27
28
|
const payload = result.data;
|
|
@@ -38,7 +39,7 @@ describe('loaders/cells-json-loaders', () => {
|
|
|
38
39
|
coordinationValues: {
|
|
39
40
|
obsLabelsType: 'cluster',
|
|
40
41
|
},
|
|
41
|
-
}, 'http://localhost:
|
|
42
|
+
}, 'http://localhost:4204/@fixtures/json-legacy/cells.good.json');
|
|
42
43
|
const result = await loader.load();
|
|
43
44
|
expect(result).toBeInstanceOf(LoaderResult);
|
|
44
45
|
const payload = result.data;
|
|
@@ -51,7 +52,7 @@ describe('loaders/cells-json-loaders', () => {
|
|
|
51
52
|
it('can load obsSegmentations', async () => {
|
|
52
53
|
const loader = createLoader(CellsJsonAsObsSegmentationsLoader, {
|
|
53
54
|
fileType: 'obsSegmentations.cells.json',
|
|
54
|
-
}, 'http://localhost:
|
|
55
|
+
}, 'http://localhost:4204/@fixtures/json-legacy/cells.good.json');
|
|
55
56
|
const result = await loader.load();
|
|
56
57
|
expect(result).toBeInstanceOf(LoaderResult);
|
|
57
58
|
const payload = result.data;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { extent } from 'd3-array';
|
|
2
|
-
import range from 'lodash
|
|
2
|
+
import { range } from 'lodash-es';
|
|
3
3
|
import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
|
|
4
|
-
import clustersSchema from './schemas/clusters.
|
|
5
|
-
import JsonLoader from '../json-loaders/JsonLoader';
|
|
4
|
+
import { clustersSchema } from './schemas/clusters.js';
|
|
5
|
+
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
6
6
|
|
|
7
7
|
export default class ClustersJsonAsObsFeatureMatrixLoader extends JsonLoader {
|
|
8
8
|
constructor(dataSource, params) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
1
2
|
import { LoaderResult } from '@vitessce/vit-s';
|
|
2
|
-
import ClustersJsonAsObsFeatureMatrixLoader from './ClustersJsonAsObsFeatureMatrix';
|
|
3
|
-
import JsonSource from '../JsonSource';
|
|
3
|
+
import ClustersJsonAsObsFeatureMatrixLoader from './ClustersJsonAsObsFeatureMatrix.js';
|
|
4
|
+
import JsonSource from '../JsonSource.js';
|
|
4
5
|
|
|
5
6
|
const createLoader = (ClassDef, config, url) => {
|
|
6
7
|
const configWithUrl = {
|
|
@@ -16,7 +17,7 @@ describe('loaders/clusters-json-loaders', () => {
|
|
|
16
17
|
it('can load obsFeatureMatrix', async () => {
|
|
17
18
|
const loader = createLoader(ClustersJsonAsObsFeatureMatrixLoader, {
|
|
18
19
|
fileType: 'obsFeatureMatrix.clusters.json',
|
|
19
|
-
}, 'http://localhost:
|
|
20
|
+
}, 'http://localhost:4204/@fixtures/json-legacy/clusters.good.json');
|
|
20
21
|
const result = await loader.load();
|
|
21
22
|
expect(result).toBeInstanceOf(LoaderResult);
|
|
22
23
|
const payload = result.data;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
|
|
2
|
-
import genesSchema from './schemas/genes.
|
|
3
|
-
import JsonLoader from '../json-loaders/JsonLoader';
|
|
2
|
+
import { genesSchema } from './schemas/genes.js';
|
|
3
|
+
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
4
4
|
|
|
5
5
|
export default class GenesJsonAsObsFeatureMatrixLoader extends JsonLoader {
|
|
6
6
|
constructor(dataSource, params) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
1
2
|
import { LoaderResult } from '@vitessce/vit-s';
|
|
2
|
-
import GenesJsonAsObsFeatureMatrixLoader from './GenesJsonAsObsFeatureMatrix';
|
|
3
|
-
import JsonSource from '../JsonSource';
|
|
3
|
+
import GenesJsonAsObsFeatureMatrixLoader from './GenesJsonAsObsFeatureMatrix.js';
|
|
4
|
+
import JsonSource from '../JsonSource.js';
|
|
4
5
|
|
|
5
6
|
const createLoader = (ClassDef, config, url) => {
|
|
6
7
|
const configWithUrl = {
|
|
@@ -16,7 +17,7 @@ describe('loaders/genes-json-loaders', () => {
|
|
|
16
17
|
it('can load obsFeatureMatrix', async () => {
|
|
17
18
|
const loader = createLoader(GenesJsonAsObsFeatureMatrixLoader, {
|
|
18
19
|
fileType: 'obsFeatureMatrix.genes.json',
|
|
19
|
-
}, 'http://localhost:
|
|
20
|
+
}, 'http://localhost:4204/@fixtures/json-legacy/genes.good.json');
|
|
20
21
|
const result = await loader.load();
|
|
21
22
|
expect(result).toBeInstanceOf(LoaderResult);
|
|
22
23
|
const payload = result.data;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import range from 'lodash
|
|
2
|
-
import sum from 'lodash/sum';
|
|
1
|
+
import { range, sum } from 'lodash-es';
|
|
3
2
|
import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
|
|
4
|
-
import moleculesSchema from './schemas/molecules.
|
|
5
|
-
import JsonLoader from '../json-loaders/JsonLoader';
|
|
3
|
+
import { moleculesSchema } from './schemas/molecules.js';
|
|
4
|
+
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
6
5
|
|
|
7
6
|
export default class MoleculesJsonAsObsLabelsLoader extends JsonLoader {
|
|
8
7
|
constructor(dataSource, params) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import range from 'lodash
|
|
2
|
-
import sum from 'lodash/sum';
|
|
1
|
+
import { range, sum } from 'lodash-es';
|
|
3
2
|
import { AbstractLoaderError, LoaderResult } from '@vitessce/vit-s';
|
|
4
3
|
import { DEFAULT_MOLECULES_LAYER } from '@vitessce/spatial-utils';
|
|
5
|
-
import moleculesSchema from './schemas/molecules.
|
|
6
|
-
import JsonLoader from '../json-loaders/JsonLoader';
|
|
4
|
+
import { moleculesSchema } from './schemas/molecules.js';
|
|
5
|
+
import JsonLoader from '../json-loaders/JsonLoader.js';
|
|
7
6
|
|
|
8
7
|
export default class MoleculesJsonAsObsLocationsLoader extends JsonLoader {
|
|
9
8
|
constructor(dataSource, params) {
|