@vitessce/zarr 3.9.2 → 3.9.3
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/index.js +62 -5
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -576,6 +576,9 @@ function get_ctr(data_type) {
|
|
|
576
576
|
let [, kind, chars] = match;
|
|
577
577
|
return (kind === "U" ? UnicodeStringArray : ByteStringArray).bind(null, Number(chars));
|
|
578
578
|
}
|
|
579
|
+
if (data_type === "string") {
|
|
580
|
+
return globalThis.Array;
|
|
581
|
+
}
|
|
579
582
|
let ctr = {
|
|
580
583
|
int8: Int8Array,
|
|
581
584
|
int16: Int16Array,
|
|
@@ -697,7 +700,7 @@ function is_dtype(dtype, query) {
|
|
|
697
700
|
let is_boolean = dtype === "bool";
|
|
698
701
|
if (query === "boolean")
|
|
699
702
|
return is_boolean;
|
|
700
|
-
let is_string = dtype.startsWith("v2:U") || dtype.startsWith("v2:S");
|
|
703
|
+
let is_string = dtype.startsWith("v2:U") || dtype.startsWith("v2:S") || dtype === "string";
|
|
701
704
|
if (query === "string")
|
|
702
705
|
return is_string;
|
|
703
706
|
let is_bigint = dtype === "int64" || dtype === "uint64";
|
|
@@ -1147,7 +1150,7 @@ async function load_codecs(chunk_meta) {
|
|
|
1147
1150
|
return { array_to_array, array_to_bytes, bytes_to_bytes };
|
|
1148
1151
|
}
|
|
1149
1152
|
function is_typed_array_like_meta(meta) {
|
|
1150
|
-
return meta.data_type !== "v2:object";
|
|
1153
|
+
return meta.data_type !== "v2:object" && meta.data_type !== "string";
|
|
1151
1154
|
}
|
|
1152
1155
|
class NodeNotFoundError extends Error {
|
|
1153
1156
|
constructor(context, options = {}) {
|
|
@@ -1172,7 +1175,7 @@ function create_sharded_chunk_getter(location, shard_shape, encode_shard_key, sh
|
|
|
1172
1175
|
codecs: sharding_config.index_codecs
|
|
1173
1176
|
});
|
|
1174
1177
|
let cache = {};
|
|
1175
|
-
return async (chunk_coord) => {
|
|
1178
|
+
return async (chunk_coord, options) => {
|
|
1176
1179
|
let shard_coord = chunk_coord.map((d, i) => Math.floor(d / index_shape[i]));
|
|
1177
1180
|
let shard_path = location.resolve(encode_shard_key(shard_coord)).path;
|
|
1178
1181
|
let index;
|
|
@@ -1183,7 +1186,7 @@ function create_sharded_chunk_getter(location, shard_shape, encode_shard_key, sh
|
|
|
1183
1186
|
let index_size = 16 * index_shape.reduce((a, b) => a * b, 1);
|
|
1184
1187
|
let bytes = await get_range(shard_path, {
|
|
1185
1188
|
suffixLength: index_size + checksum_size
|
|
1186
|
-
});
|
|
1189
|
+
}, options);
|
|
1187
1190
|
index = cache[shard_path] = bytes ? await index_codec.decode(bytes) : null;
|
|
1188
1191
|
}
|
|
1189
1192
|
if (index === null) {
|
|
@@ -1199,7 +1202,7 @@ function create_sharded_chunk_getter(location, shard_shape, encode_shard_key, sh
|
|
|
1199
1202
|
return get_range(shard_path, {
|
|
1200
1203
|
offset: Number(offset),
|
|
1201
1204
|
length: Number(length)
|
|
1202
|
-
});
|
|
1205
|
+
}, options);
|
|
1203
1206
|
};
|
|
1204
1207
|
}
|
|
1205
1208
|
var _a;
|
|
@@ -2644,6 +2647,13 @@ async function unzip(source) {
|
|
|
2644
2647
|
entries: Object.fromEntries(entries.map((v) => [v.name, v]))
|
|
2645
2648
|
};
|
|
2646
2649
|
}
|
|
2650
|
+
function isZipEntryInternal(entry) {
|
|
2651
|
+
if (!("compressionMethod" in entry) || !("_rawEntry" in entry)) {
|
|
2652
|
+
return false;
|
|
2653
|
+
}
|
|
2654
|
+
const rawEntry = entry._rawEntry;
|
|
2655
|
+
return typeof entry.compressionMethod === "number" && typeof rawEntry === "object" && rawEntry !== null && "relativeOffsetOfLocalHeader" in rawEntry && typeof rawEntry.relativeOffsetOfLocalHeader === "number";
|
|
2656
|
+
}
|
|
2647
2657
|
class BlobReader2 {
|
|
2648
2658
|
constructor(blob) {
|
|
2649
2659
|
this.blob = blob;
|
|
@@ -2687,6 +2697,7 @@ class HTTPRangeReader {
|
|
|
2687
2697
|
}
|
|
2688
2698
|
class ZipFileStore {
|
|
2689
2699
|
constructor(reader, opts = {}) {
|
|
2700
|
+
this.reader = reader;
|
|
2690
2701
|
this.info = unzip(reader).then((info) => {
|
|
2691
2702
|
if (opts.transformEntries) {
|
|
2692
2703
|
info.entries = opts.transformEntries(info.entries);
|
|
@@ -2694,12 +2705,46 @@ class ZipFileStore {
|
|
|
2694
2705
|
return info;
|
|
2695
2706
|
});
|
|
2696
2707
|
}
|
|
2708
|
+
/**
|
|
2709
|
+
* Compute the byte offset where entry data begins in the zip file.
|
|
2710
|
+
* This requires reading the local file header to get filename and extra field lengths.
|
|
2711
|
+
*/
|
|
2712
|
+
async getEntryDataOffset(entry) {
|
|
2713
|
+
const localHeaderOffset = entry._rawEntry.relativeOffsetOfLocalHeader;
|
|
2714
|
+
const header = await this.reader.read(localHeaderOffset, 30);
|
|
2715
|
+
const fileNameLength = header[26] + header[27] * 256;
|
|
2716
|
+
const extraFieldLength = header[28] + header[29] * 256;
|
|
2717
|
+
return localHeaderOffset + 30 + fileNameLength + extraFieldLength;
|
|
2718
|
+
}
|
|
2697
2719
|
async get(key) {
|
|
2698
2720
|
let entry = (await this.info).entries[strip_prefix(key)];
|
|
2699
2721
|
if (!entry)
|
|
2700
2722
|
return;
|
|
2701
2723
|
return new Uint8Array(await entry.arrayBuffer());
|
|
2702
2724
|
}
|
|
2725
|
+
async getRange(key, range2) {
|
|
2726
|
+
const entry = (await this.info).entries[strip_prefix(key)];
|
|
2727
|
+
if (!entry)
|
|
2728
|
+
return void 0;
|
|
2729
|
+
if (!isZipEntryInternal(entry)) {
|
|
2730
|
+
throw new Error("ZipFileStore.getRange requires internal unzipit properties that are not available. This may indicate an incompatible version of unzipit.");
|
|
2731
|
+
}
|
|
2732
|
+
if (entry.compressionMethod !== 0) {
|
|
2733
|
+
const bytes = await this.get(key);
|
|
2734
|
+
if (!bytes)
|
|
2735
|
+
return void 0;
|
|
2736
|
+
if ("suffixLength" in range2) {
|
|
2737
|
+
return bytes.slice(-range2.suffixLength);
|
|
2738
|
+
}
|
|
2739
|
+
return bytes.slice(range2.offset, range2.offset + range2.length);
|
|
2740
|
+
}
|
|
2741
|
+
const dataOffset = await this.getEntryDataOffset(entry);
|
|
2742
|
+
if ("suffixLength" in range2) {
|
|
2743
|
+
const start = dataOffset + entry.size - range2.suffixLength;
|
|
2744
|
+
return this.reader.read(start, range2.suffixLength);
|
|
2745
|
+
}
|
|
2746
|
+
return this.reader.read(dataOffset + range2.offset, range2.length);
|
|
2747
|
+
}
|
|
2703
2748
|
async has(key) {
|
|
2704
2749
|
return strip_prefix(key) in (await this.info).entries;
|
|
2705
2750
|
}
|
|
@@ -4022,6 +4067,7 @@ const ViewType$1 = {
|
|
|
4022
4067
|
OBS_SET_COMPOSITION_BAR_PLOT: "obsSetCompositionBarPlot",
|
|
4023
4068
|
FEATURE_SET_ENRICHMENT_BAR_PLOT: "featureSetEnrichmentBarPlot",
|
|
4024
4069
|
BIOMARKER_SELECT: "biomarkerSelect",
|
|
4070
|
+
BIOMARKER_SELECT_ALT: "biomarkerSelectAlt",
|
|
4025
4071
|
COMPARATIVE_HEADING: "comparativeHeading",
|
|
4026
4072
|
LINK_CONTROLLER: "linkController",
|
|
4027
4073
|
NEUROGLANCER: "neuroglancer",
|
|
@@ -5216,6 +5262,17 @@ const CoordinationType$1 = {
|
|
|
5216
5262
|
CoordinationType$1.OBS_SET_FILTER
|
|
5217
5263
|
// TODO: create coordination types for internal state of the biomarker selection view?
|
|
5218
5264
|
],
|
|
5265
|
+
[ViewType$1.BIOMARKER_SELECT_ALT]: [
|
|
5266
|
+
CoordinationType$1.DATASET,
|
|
5267
|
+
CoordinationType$1.OBS_TYPE,
|
|
5268
|
+
CoordinationType$1.SAMPLE_TYPE,
|
|
5269
|
+
CoordinationType$1.FEATURE_SELECTION,
|
|
5270
|
+
CoordinationType$1.SAMPLE_SET_SELECTION,
|
|
5271
|
+
CoordinationType$1.SAMPLE_SET_FILTER,
|
|
5272
|
+
CoordinationType$1.OBS_SET_SELECTION,
|
|
5273
|
+
CoordinationType$1.OBS_SET_FILTER
|
|
5274
|
+
// TODO: create coordination types for internal state of the biomarker selection view?
|
|
5275
|
+
],
|
|
5219
5276
|
[ViewType$1.COMPARATIVE_HEADING]: [
|
|
5220
5277
|
CoordinationType$1.DATASET,
|
|
5221
5278
|
CoordinationType$1.OBS_TYPE,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/zarr",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.3",
|
|
4
4
|
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -18,22 +18,22 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"d3-array": "^2.4.0",
|
|
20
20
|
"lodash-es": "^4.17.21",
|
|
21
|
-
"zarrita": "0.
|
|
21
|
+
"zarrita": "0.6.1",
|
|
22
22
|
"apache-arrow": "^17.0.0",
|
|
23
23
|
"parquet-wasm": "^0.6.1",
|
|
24
24
|
"ol": "^10.2.1",
|
|
25
|
-
"@vitessce/abstract": "3.9.
|
|
26
|
-
"@vitessce/error": "3.9.
|
|
27
|
-
"@vitessce/
|
|
28
|
-
"@vitessce/
|
|
29
|
-
"@vitessce/utils": "3.9.
|
|
30
|
-
"@vitessce/
|
|
31
|
-
"@vitessce/
|
|
32
|
-
"@vitessce/
|
|
33
|
-
"@vitessce/
|
|
25
|
+
"@vitessce/abstract": "3.9.3",
|
|
26
|
+
"@vitessce/error": "3.9.3",
|
|
27
|
+
"@vitessce/image-utils": "3.9.3",
|
|
28
|
+
"@vitessce/constants-internal": "3.9.3",
|
|
29
|
+
"@vitessce/sets-utils": "3.9.3",
|
|
30
|
+
"@vitessce/zarr-utils": "3.9.3",
|
|
31
|
+
"@vitessce/utils": "3.9.3",
|
|
32
|
+
"@vitessce/config": "3.9.3",
|
|
33
|
+
"@vitessce/globals": "3.9.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@vitessce/types": "3.9.
|
|
36
|
+
"@vitessce/types": "3.9.3"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.mjs",
|