@vitessce/zarr 3.4.8 → 3.4.10
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-d6012e10.js → deflate-f092f055.js} +1 -1
- package/dist/{index-8ab15ee8.js → index-010ccee4.js} +625 -258
- package/dist/index.js +1 -1
- package/dist/{jpeg-1999a469.js → jpeg-96acb184.js} +1 -1
- package/dist/{lerc-577eef4d.js → lerc-41914740.js} +1 -1
- package/dist/{lzw-930f9b96.js → lzw-ed481c3b.js} +1 -1
- package/dist/{packbits-17aa5fe6.js → packbits-14e4265c.js} +1 -1
- package/dist/{raw-b9069edc.js → raw-1e87ff8b.js} +1 -1
- package/dist/{webimage-478acf52.js → webimage-df74a5df.js} +1 -1
- package/dist-tsc/AnnDataSource.d.ts +6 -0
- package/dist-tsc/AnnDataSource.d.ts.map +1 -1
- package/dist-tsc/AnnDataSource.js +4 -4
- package/dist-tsc/ZarrDataSource.d.ts +4 -2
- package/dist-tsc/ZarrDataSource.d.ts.map +1 -1
- package/dist-tsc/ZarrDataSource.js +3 -3
- package/dist-tsc/anndata-loaders/ObsEmbeddingAnndataLoader.d.ts +2 -2
- package/dist-tsc/anndata-loaders/ObsEmbeddingAnndataLoader.d.ts.map +1 -1
- package/dist-tsc/anndata-loaders/ObsEmbeddingAnndataLoader.js +3 -3
- package/dist-tsc/anndata-loaders/ObsFeatureColumnsAnndataLoader.js +1 -1
- package/dist-tsc/anndata-loaders/ObsLabelsAnndataLoader.d.ts.map +1 -1
- package/dist-tsc/anndata-loaders/ObsLabelsAnndataLoader.js +2 -2
- package/dist-tsc/anndata-loaders/ObsLocationsAnndataLoader.d.ts.map +1 -1
- package/dist-tsc/anndata-loaders/ObsLocationsAnndataLoader.js +2 -2
- package/dist-tsc/anndata-loaders/ObsPointsAnndataLoader.d.ts.map +1 -1
- package/dist-tsc/anndata-loaders/ObsPointsAnndataLoader.js +2 -2
- package/dist-tsc/anndata-loaders/ObsSetsAnndataLoader.d.ts.map +1 -1
- package/dist-tsc/anndata-loaders/ObsSetsAnndataLoader.js +5 -4
- package/dist-tsc/anndata-loaders/ObsSpotsAnndataLoader.d.ts.map +1 -1
- package/dist-tsc/anndata-loaders/ObsSpotsAnndataLoader.js +2 -2
- package/dist-tsc/spatialdata-loaders/SpatialDataObsSpotsLoader.d.ts +1 -1
- package/dist-tsc/spatialdata-loaders/SpatialDataObsSpotsLoader.d.ts.map +1 -1
- package/dist-tsc/spatialdata-loaders/SpatialDataObsSpotsLoader.js +4 -4
- package/package.json +15 -15
- package/src/AnnDataSource.js +4 -4
- package/src/ZarrDataSource.js +3 -4
- package/src/anndata-loaders/ObsEmbeddingAnndataLoader.js +3 -3
- package/src/anndata-loaders/ObsFeatureColumnsAnndataLoader.js +1 -1
- package/src/anndata-loaders/ObsLabelsAnndataLoader.js +2 -2
- package/src/anndata-loaders/ObsLocationsAnndataLoader.js +2 -2
- package/src/anndata-loaders/ObsPointsAnndataLoader.js +2 -2
- package/src/anndata-loaders/ObsSetsAnndataLoader.js +5 -4
- package/src/anndata-loaders/ObsSpotsAnndataLoader.js +2 -2
- package/src/spatialdata-loaders/SpatialDataObsSpotsLoader.js +4 -4
|
@@ -26,7 +26,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
26
26
|
__accessCheck(obj, member, "access private method");
|
|
27
27
|
return method;
|
|
28
28
|
};
|
|
29
|
-
var _bytes, _encoder, _data,
|
|
29
|
+
var _bytes, _encoder, _data, _strides, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _encoder_config, _decoder_config, _shape2, _strides2, _metadata, _metadata2, _a2, _b, _overrides, _use_suffix_request, _merge_init, merge_init_fn, _overrides2, _refs, _opts, _overrides3;
|
|
30
30
|
import { AbstractTwoStepLoader, LoaderResult, AbstractLoaderError } from "@vitessce/vit-s";
|
|
31
31
|
import "react";
|
|
32
32
|
function _mergeNamespaces(n3, m) {
|
|
@@ -169,7 +169,6 @@ const _UnicodeStringArray = class {
|
|
|
169
169
|
constructor(chars, x2, byteOffset, length2) {
|
|
170
170
|
__privateAdd(this, _data, void 0);
|
|
171
171
|
__publicField(this, "chars");
|
|
172
|
-
__privateAdd(this, _encode_buffer, void 0);
|
|
173
172
|
this.chars = chars;
|
|
174
173
|
if (typeof x2 === "number") {
|
|
175
174
|
__privateSet(this, _data, new Int32Array(x2 * chars));
|
|
@@ -187,7 +186,6 @@ const _UnicodeStringArray = class {
|
|
|
187
186
|
}
|
|
188
187
|
}()));
|
|
189
188
|
}
|
|
190
|
-
__privateSet(this, _encode_buffer, new Int32Array(chars));
|
|
191
189
|
}
|
|
192
190
|
get BYTES_PER_ELEMENT() {
|
|
193
191
|
return __privateGet(this, _data).BYTES_PER_ELEMENT * this.chars;
|
|
@@ -237,7 +235,6 @@ const _UnicodeStringArray = class {
|
|
|
237
235
|
};
|
|
238
236
|
let UnicodeStringArray = _UnicodeStringArray;
|
|
239
237
|
_data = new WeakMap();
|
|
240
|
-
_encode_buffer = new WeakMap();
|
|
241
238
|
function json_decode_object(bytes) {
|
|
242
239
|
const str = new TextDecoder().decode(bytes);
|
|
243
240
|
return JSON.parse(str);
|
|
@@ -306,10 +303,12 @@ function col_major_stride(shape) {
|
|
|
306
303
|
}
|
|
307
304
|
function create_chunk_key_encoder({ name: name2, configuration }) {
|
|
308
305
|
if (name2 === "default") {
|
|
309
|
-
|
|
306
|
+
const separator = (configuration == null ? void 0 : configuration.separator) ?? "/";
|
|
307
|
+
return (chunk_coords) => ["c", ...chunk_coords].join(separator);
|
|
310
308
|
}
|
|
311
309
|
if (name2 === "v2") {
|
|
312
|
-
|
|
310
|
+
const separator = (configuration == null ? void 0 : configuration.separator) ?? ".";
|
|
311
|
+
return (chunk_coords) => chunk_coords.join(separator) || "0";
|
|
313
312
|
}
|
|
314
313
|
throw new Error(`Unknown chunk key encoding: ${name2}`);
|
|
315
314
|
}
|
|
@@ -329,17 +328,17 @@ function coerce_dtype(dtype) {
|
|
|
329
328
|
}
|
|
330
329
|
let [, endian, rest] = match;
|
|
331
330
|
let data_type = {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
331
|
+
b1: "bool",
|
|
332
|
+
i1: "int8",
|
|
333
|
+
u1: "uint8",
|
|
334
|
+
i2: "int16",
|
|
335
|
+
u2: "uint16",
|
|
336
|
+
i4: "int32",
|
|
337
|
+
u4: "uint32",
|
|
338
|
+
i8: "int64",
|
|
339
|
+
u8: "uint64",
|
|
340
|
+
f4: "float32",
|
|
341
|
+
f8: "float64"
|
|
343
342
|
}[rest] ?? (rest.startsWith("S") || rest.startsWith("U") ? `v2:${rest}` : void 0);
|
|
344
343
|
if (!data_type) {
|
|
345
344
|
throw new Error(`Unsupported or unknown dtype: ${dtype}`);
|
|
@@ -416,93 +415,11 @@ function is_sharding_codec(codec) {
|
|
|
416
415
|
return (codec == null ? void 0 : codec.name) === "sharding_indexed";
|
|
417
416
|
}
|
|
418
417
|
function ensure_correct_scalar(metadata) {
|
|
419
|
-
if ((metadata.data_type === "uint64" || metadata.data_type === "int64") && metadata.fill_value !=
|
|
418
|
+
if ((metadata.data_type === "uint64" || metadata.data_type === "int64") && metadata.fill_value != null) {
|
|
420
419
|
return BigInt(metadata.fill_value);
|
|
421
420
|
}
|
|
422
421
|
return metadata.fill_value;
|
|
423
422
|
}
|
|
424
|
-
function proxy(arr) {
|
|
425
|
-
if (arr instanceof BoolArray || arr instanceof ByteStringArray || arr instanceof UnicodeStringArray) {
|
|
426
|
-
return new Proxy(arr, {
|
|
427
|
-
get(target, prop) {
|
|
428
|
-
return target.get(Number(prop));
|
|
429
|
-
},
|
|
430
|
-
set(target, prop, value) {
|
|
431
|
-
target.set(Number(prop), value);
|
|
432
|
-
return true;
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
return arr;
|
|
437
|
-
}
|
|
438
|
-
function empty_like(chunk, order) {
|
|
439
|
-
let data;
|
|
440
|
-
if (chunk.data instanceof ByteStringArray || chunk.data instanceof UnicodeStringArray) {
|
|
441
|
-
data = new chunk.constructor(
|
|
442
|
-
// @ts-expect-error
|
|
443
|
-
chunk.data.length,
|
|
444
|
-
chunk.data.chars
|
|
445
|
-
);
|
|
446
|
-
} else {
|
|
447
|
-
data = new chunk.constructor(chunk.data.length);
|
|
448
|
-
}
|
|
449
|
-
return {
|
|
450
|
-
data,
|
|
451
|
-
shape: chunk.shape,
|
|
452
|
-
stride: get_strides(chunk.shape, order)
|
|
453
|
-
};
|
|
454
|
-
}
|
|
455
|
-
function convert_array_order(src, target) {
|
|
456
|
-
let out = empty_like(src, target);
|
|
457
|
-
let n_dims = src.shape.length;
|
|
458
|
-
let size2 = src.data.length;
|
|
459
|
-
let index2 = Array(n_dims).fill(0);
|
|
460
|
-
let src_data = proxy(src.data);
|
|
461
|
-
let out_data = proxy(out.data);
|
|
462
|
-
for (let src_idx = 0; src_idx < size2; src_idx++) {
|
|
463
|
-
let out_idx = 0;
|
|
464
|
-
for (let dim = 0; dim < n_dims; dim++) {
|
|
465
|
-
out_idx += index2[dim] * out.stride[dim];
|
|
466
|
-
}
|
|
467
|
-
out_data[out_idx] = src_data[src_idx];
|
|
468
|
-
index2[0] += 1;
|
|
469
|
-
for (let dim = 0; dim < n_dims; dim++) {
|
|
470
|
-
if (index2[dim] === src.shape[dim]) {
|
|
471
|
-
if (dim + 1 === n_dims) {
|
|
472
|
-
break;
|
|
473
|
-
}
|
|
474
|
-
index2[dim] = 0;
|
|
475
|
-
index2[dim + 1] += 1;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
return out;
|
|
480
|
-
}
|
|
481
|
-
function get_order(arr) {
|
|
482
|
-
if (!arr.stride)
|
|
483
|
-
return "C";
|
|
484
|
-
let row_major_strides = get_strides(arr.shape, "C");
|
|
485
|
-
return arr.stride.every((s2, i2) => s2 === row_major_strides[i2]) ? "C" : "F";
|
|
486
|
-
}
|
|
487
|
-
class TransposeCodec {
|
|
488
|
-
constructor(configuration) {
|
|
489
|
-
__publicField(this, "configuration");
|
|
490
|
-
__publicField(this, "kind", "array_to_array");
|
|
491
|
-
this.configuration = configuration;
|
|
492
|
-
}
|
|
493
|
-
static fromConfig(configuration) {
|
|
494
|
-
return new TransposeCodec(configuration);
|
|
495
|
-
}
|
|
496
|
-
encode(arr) {
|
|
497
|
-
if (get_order(arr) === this.configuration.order) {
|
|
498
|
-
return arr;
|
|
499
|
-
}
|
|
500
|
-
return convert_array_order(arr, this.configuration.order);
|
|
501
|
-
}
|
|
502
|
-
decode(arr) {
|
|
503
|
-
return arr;
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
423
|
const LITTLE_ENDIAN_OS = system_is_little_endian();
|
|
507
424
|
function system_is_little_endian() {
|
|
508
425
|
const a2 = new Uint32Array([305419896]);
|
|
@@ -523,7 +440,7 @@ const _BytesCodec = class {
|
|
|
523
440
|
__privateAdd(this, _BYTES_PER_ELEMENT, void 0);
|
|
524
441
|
__privateAdd(this, _shape, void 0);
|
|
525
442
|
__privateAdd(this, _endian, void 0);
|
|
526
|
-
__privateSet(this, _endian, configuration.endian);
|
|
443
|
+
__privateSet(this, _endian, configuration == null ? void 0 : configuration.endian);
|
|
527
444
|
__privateSet(this, _TypedArray, get_ctr(meta2.data_type));
|
|
528
445
|
__privateSet(this, _shape, meta2.shape);
|
|
529
446
|
__privateSet(this, _strides, get_strides(meta2.shape, get_array_order(meta2.codecs)));
|
|
@@ -571,57 +488,26 @@ class Crc32cCodec {
|
|
|
571
488
|
return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength - 4);
|
|
572
489
|
}
|
|
573
490
|
}
|
|
574
|
-
const _VLenUTF8 = class {
|
|
575
|
-
constructor(shape) {
|
|
576
|
-
__publicField(this, "kind", "array_to_bytes");
|
|
577
|
-
__privateAdd(this, _shape2, void 0);
|
|
578
|
-
__privateAdd(this, _strides2, void 0);
|
|
579
|
-
__privateSet(this, _shape2, shape);
|
|
580
|
-
__privateSet(this, _strides2, get_strides(shape, "C"));
|
|
581
|
-
}
|
|
582
|
-
static fromConfig(_, meta2) {
|
|
583
|
-
return new _VLenUTF8(meta2.shape);
|
|
584
|
-
}
|
|
585
|
-
encode(_chunk) {
|
|
586
|
-
throw new Error("Method not implemented.");
|
|
587
|
-
}
|
|
588
|
-
decode(bytes) {
|
|
589
|
-
let decoder = new TextDecoder();
|
|
590
|
-
let view = new DataView(bytes.buffer);
|
|
591
|
-
let data = Array(view.getUint32(0, true));
|
|
592
|
-
let pos = 4;
|
|
593
|
-
for (let i2 = 0; i2 < data.length; i2++) {
|
|
594
|
-
let item_length = view.getUint32(pos, true);
|
|
595
|
-
pos += 4;
|
|
596
|
-
data[i2] = decoder.decode(bytes.buffer.slice(pos, pos + item_length));
|
|
597
|
-
pos += item_length;
|
|
598
|
-
}
|
|
599
|
-
return { data, shape: __privateGet(this, _shape2), stride: __privateGet(this, _strides2) };
|
|
600
|
-
}
|
|
601
|
-
};
|
|
602
|
-
let VLenUTF8 = _VLenUTF8;
|
|
603
|
-
_shape2 = new WeakMap();
|
|
604
|
-
_strides2 = new WeakMap();
|
|
605
491
|
function throw_on_nan_replacer(_key, value) {
|
|
606
|
-
if (value
|
|
492
|
+
if (Number.isNaN(value)) {
|
|
607
493
|
throw new Error("JsonCodec allow_nan is false but NaN was encountered during encoding.");
|
|
608
494
|
}
|
|
609
|
-
if (value ===
|
|
495
|
+
if (value === Number.POSITIVE_INFINITY) {
|
|
610
496
|
throw new Error("JsonCodec allow_nan is false but Infinity was encountered during encoding.");
|
|
611
497
|
}
|
|
612
|
-
if (value ===
|
|
498
|
+
if (value === Number.NEGATIVE_INFINITY) {
|
|
613
499
|
throw new Error("JsonCodec allow_nan is false but -Infinity was encountered during encoding.");
|
|
614
500
|
}
|
|
615
501
|
return value;
|
|
616
502
|
}
|
|
617
503
|
function sort_keys_replacer(_key, value) {
|
|
618
|
-
return value instanceof Object && !(value
|
|
504
|
+
return value instanceof Object && !Array.isArray(value) ? Object.keys(value).sort().reduce((sorted, key) => {
|
|
619
505
|
sorted[key] = value[key];
|
|
620
506
|
return sorted;
|
|
621
507
|
}, {}) : value;
|
|
622
508
|
}
|
|
623
509
|
const _JsonCodec = class {
|
|
624
|
-
constructor(configuration) {
|
|
510
|
+
constructor(configuration = {}) {
|
|
625
511
|
__publicField(this, "configuration");
|
|
626
512
|
__publicField(this, "kind", "array_to_bytes");
|
|
627
513
|
__privateAdd(this, _encoder_config, void 0);
|
|
@@ -671,20 +557,20 @@ const _JsonCodec = class {
|
|
|
671
557
|
items.push(buf.shape);
|
|
672
558
|
let replacer = void 0;
|
|
673
559
|
if (replacer_functions.length) {
|
|
674
|
-
replacer =
|
|
560
|
+
replacer = (key, value) => {
|
|
675
561
|
let new_value = value;
|
|
676
|
-
|
|
562
|
+
for (let sub_replacer of replacer_functions) {
|
|
677
563
|
new_value = sub_replacer(key, new_value);
|
|
678
|
-
}
|
|
564
|
+
}
|
|
679
565
|
return new_value;
|
|
680
566
|
};
|
|
681
567
|
}
|
|
682
568
|
let json_str = JSON.stringify(items, replacer, indent);
|
|
683
569
|
if (ensure_ascii) {
|
|
684
|
-
json_str = json_str.replace(/[\u007F-\uFFFF]/g,
|
|
685
|
-
const full_str =
|
|
570
|
+
json_str = json_str.replace(/[\u007F-\uFFFF]/g, (chr) => {
|
|
571
|
+
const full_str = `0000${chr.charCodeAt(0).toString(16)}`;
|
|
686
572
|
const sub_str = full_str.substring(full_str.length - 4);
|
|
687
|
-
return
|
|
573
|
+
return `\\u${sub_str}`;
|
|
688
574
|
});
|
|
689
575
|
}
|
|
690
576
|
return new TextEncoder().encode(json_str);
|
|
@@ -699,16 +585,130 @@ const _JsonCodec = class {
|
|
|
699
585
|
items.pop();
|
|
700
586
|
if (!shape) {
|
|
701
587
|
throw new Error("0D not implemented for JsonCodec.");
|
|
702
|
-
} else {
|
|
703
|
-
const stride = get_strides(shape, "C");
|
|
704
|
-
const data = items;
|
|
705
|
-
return { data, shape, stride };
|
|
706
588
|
}
|
|
589
|
+
const stride = get_strides(shape, "C");
|
|
590
|
+
const data = items;
|
|
591
|
+
return { data, shape, stride };
|
|
707
592
|
}
|
|
708
593
|
};
|
|
709
594
|
let JsonCodec = _JsonCodec;
|
|
710
595
|
_encoder_config = new WeakMap();
|
|
711
596
|
_decoder_config = new WeakMap();
|
|
597
|
+
function proxy(arr) {
|
|
598
|
+
if (arr instanceof BoolArray || arr instanceof ByteStringArray || arr instanceof UnicodeStringArray) {
|
|
599
|
+
const arrp = new Proxy(arr, {
|
|
600
|
+
get(target, prop) {
|
|
601
|
+
return target.get(Number(prop));
|
|
602
|
+
},
|
|
603
|
+
set(target, prop, value) {
|
|
604
|
+
target.set(Number(prop), value);
|
|
605
|
+
return true;
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
return arrp;
|
|
609
|
+
}
|
|
610
|
+
return arr;
|
|
611
|
+
}
|
|
612
|
+
function empty_like(chunk, order) {
|
|
613
|
+
let data;
|
|
614
|
+
if (chunk.data instanceof ByteStringArray || chunk.data instanceof UnicodeStringArray) {
|
|
615
|
+
data = new chunk.constructor(
|
|
616
|
+
// @ts-expect-error
|
|
617
|
+
chunk.data.length,
|
|
618
|
+
chunk.data.chars
|
|
619
|
+
);
|
|
620
|
+
} else {
|
|
621
|
+
data = new chunk.constructor(chunk.data.length);
|
|
622
|
+
}
|
|
623
|
+
return {
|
|
624
|
+
data,
|
|
625
|
+
shape: chunk.shape,
|
|
626
|
+
stride: get_strides(chunk.shape, order)
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
function convert_array_order(src, target) {
|
|
630
|
+
let out = empty_like(src, target);
|
|
631
|
+
let n_dims = src.shape.length;
|
|
632
|
+
let size2 = src.data.length;
|
|
633
|
+
let index2 = Array(n_dims).fill(0);
|
|
634
|
+
let src_data = proxy(src.data);
|
|
635
|
+
let out_data = proxy(out.data);
|
|
636
|
+
for (let src_idx = 0; src_idx < size2; src_idx++) {
|
|
637
|
+
let out_idx = 0;
|
|
638
|
+
for (let dim = 0; dim < n_dims; dim++) {
|
|
639
|
+
out_idx += index2[dim] * out.stride[dim];
|
|
640
|
+
}
|
|
641
|
+
out_data[out_idx] = src_data[src_idx];
|
|
642
|
+
index2[0] += 1;
|
|
643
|
+
for (let dim = 0; dim < n_dims; dim++) {
|
|
644
|
+
if (index2[dim] === src.shape[dim]) {
|
|
645
|
+
if (dim + 1 === n_dims) {
|
|
646
|
+
break;
|
|
647
|
+
}
|
|
648
|
+
index2[dim] = 0;
|
|
649
|
+
index2[dim + 1] += 1;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
return out;
|
|
654
|
+
}
|
|
655
|
+
function get_order(arr) {
|
|
656
|
+
if (!arr.stride)
|
|
657
|
+
return "C";
|
|
658
|
+
let row_major_strides = get_strides(arr.shape, "C");
|
|
659
|
+
return arr.stride.every((s2, i2) => s2 === row_major_strides[i2]) ? "C" : "F";
|
|
660
|
+
}
|
|
661
|
+
class TransposeCodec {
|
|
662
|
+
constructor(configuration) {
|
|
663
|
+
__publicField(this, "configuration");
|
|
664
|
+
__publicField(this, "kind", "array_to_array");
|
|
665
|
+
this.configuration = configuration;
|
|
666
|
+
}
|
|
667
|
+
static fromConfig(configuration) {
|
|
668
|
+
return new TransposeCodec(configuration);
|
|
669
|
+
}
|
|
670
|
+
encode(arr) {
|
|
671
|
+
var _a3, _b2;
|
|
672
|
+
if (get_order(arr) === ((_a3 = this.configuration) == null ? void 0 : _a3.order)) {
|
|
673
|
+
return arr;
|
|
674
|
+
}
|
|
675
|
+
return convert_array_order(arr, ((_b2 = this.configuration) == null ? void 0 : _b2.order) ?? "C");
|
|
676
|
+
}
|
|
677
|
+
decode(arr) {
|
|
678
|
+
return arr;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
const _VLenUTF8 = class {
|
|
682
|
+
constructor(shape) {
|
|
683
|
+
__publicField(this, "kind", "array_to_bytes");
|
|
684
|
+
__privateAdd(this, _shape2, void 0);
|
|
685
|
+
__privateAdd(this, _strides2, void 0);
|
|
686
|
+
__privateSet(this, _shape2, shape);
|
|
687
|
+
__privateSet(this, _strides2, get_strides(shape, "C"));
|
|
688
|
+
}
|
|
689
|
+
static fromConfig(_, meta2) {
|
|
690
|
+
return new _VLenUTF8(meta2.shape);
|
|
691
|
+
}
|
|
692
|
+
encode(_chunk) {
|
|
693
|
+
throw new Error("Method not implemented.");
|
|
694
|
+
}
|
|
695
|
+
decode(bytes) {
|
|
696
|
+
let decoder = new TextDecoder();
|
|
697
|
+
let view = new DataView(bytes.buffer);
|
|
698
|
+
let data = Array(view.getUint32(0, true));
|
|
699
|
+
let pos = 4;
|
|
700
|
+
for (let i2 = 0; i2 < data.length; i2++) {
|
|
701
|
+
let item_length = view.getUint32(pos, true);
|
|
702
|
+
pos += 4;
|
|
703
|
+
data[i2] = decoder.decode(bytes.buffer.slice(pos, pos + item_length));
|
|
704
|
+
pos += item_length;
|
|
705
|
+
}
|
|
706
|
+
return { data, shape: __privateGet(this, _shape2), stride: __privateGet(this, _strides2) };
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
let VLenUTF8 = _VLenUTF8;
|
|
710
|
+
_shape2 = new WeakMap();
|
|
711
|
+
_strides2 = new WeakMap();
|
|
712
712
|
function create_default_registry() {
|
|
713
713
|
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-537fd004.js").then((m) => m.default)).set("gzip", () => import("./gzip-6a24f0fe.js").then((m) => m.default)).set("lz4", () => import("./lz4-bbd18009.js").then((m) => m.default)).set("zlib", () => import("./zlib-175cd38d.js").then((m) => m.default)).set("zstd", () => import("./zstd-ec5a40b8.js").then((m) => m.default)).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec);
|
|
714
714
|
}
|
|
@@ -1026,8 +1026,8 @@ async function _open_v3(location) {
|
|
|
1026
1026
|
});
|
|
1027
1027
|
}
|
|
1028
1028
|
let meta_doc = json_decode_object(meta2);
|
|
1029
|
-
if (meta_doc.node_type === "array"
|
|
1030
|
-
meta_doc.fill_value =
|
|
1029
|
+
if (meta_doc.node_type === "array") {
|
|
1030
|
+
meta_doc.fill_value = ensure_correct_scalar(meta_doc);
|
|
1031
1031
|
}
|
|
1032
1032
|
return meta_doc.node_type === "array" ? new Array$1(store, location.path, meta_doc) : new Group(store, location.path, meta_doc);
|
|
1033
1033
|
}
|
|
@@ -1058,7 +1058,7 @@ async function open(location, options = {}) {
|
|
|
1058
1058
|
}
|
|
1059
1059
|
open.v2 = open_v2;
|
|
1060
1060
|
open.v3 = open_v3;
|
|
1061
|
-
function* range$
|
|
1061
|
+
function* range$8(start, stop, step = 1) {
|
|
1062
1062
|
if (stop === void 0) {
|
|
1063
1063
|
stop = start;
|
|
1064
1064
|
start = 0;
|
|
@@ -1067,7 +1067,7 @@ function* range$7(start, stop, step = 1) {
|
|
|
1067
1067
|
yield i2;
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
|
-
function* product$
|
|
1070
|
+
function* product$2(...iterables) {
|
|
1071
1071
|
if (iterables.length === 0) {
|
|
1072
1072
|
return;
|
|
1073
1073
|
}
|
|
@@ -1213,7 +1213,7 @@ class SliceDimIndexer {
|
|
|
1213
1213
|
*[Symbol.iterator]() {
|
|
1214
1214
|
const dim_chunk_ix_from = Math.floor(this.start / this.dim_chunk_len);
|
|
1215
1215
|
const dim_chunk_ix_to = Math.ceil(this.stop / this.dim_chunk_len);
|
|
1216
|
-
for (const dim_chunk_ix of range$
|
|
1216
|
+
for (const dim_chunk_ix of range$8(dim_chunk_ix_from, dim_chunk_ix_to)) {
|
|
1217
1217
|
const dim_offset = dim_chunk_ix * this.dim_chunk_len;
|
|
1218
1218
|
const dim_limit = Math.min(this.dim_len, (dim_chunk_ix + 1) * this.dim_chunk_len);
|
|
1219
1219
|
const dim_chunk_len = dim_limit - dim_offset;
|
|
@@ -1268,7 +1268,7 @@ class BasicIndexer {
|
|
|
1268
1268
|
this.shape = this.dim_indexers.filter((ixr) => ixr instanceof SliceDimIndexer).map((sixr) => sixr.nitems);
|
|
1269
1269
|
}
|
|
1270
1270
|
*[Symbol.iterator]() {
|
|
1271
|
-
for (const dim_projections of product$
|
|
1271
|
+
for (const dim_projections of product$2(...this.dim_indexers)) {
|
|
1272
1272
|
const chunk_coords = dim_projections.map((p) => p.dim_chunk_ix);
|
|
1273
1273
|
const mapping = dim_projections.map((p) => {
|
|
1274
1274
|
if ("dim_out_sel" in p) {
|
|
@@ -1321,7 +1321,7 @@ function object_array_view(arr, offset = 0, size2) {
|
|
|
1321
1321
|
};
|
|
1322
1322
|
}
|
|
1323
1323
|
function compat_chunk(arr) {
|
|
1324
|
-
if (arr.data
|
|
1324
|
+
if (globalThis.Array.isArray(arr.data)) {
|
|
1325
1325
|
return {
|
|
1326
1326
|
// @ts-expect-error
|
|
1327
1327
|
data: object_array_view(arr.data),
|
|
@@ -1342,7 +1342,7 @@ function get_typed_array_constructor(arr) {
|
|
|
1342
1342
|
return arr.constructor;
|
|
1343
1343
|
}
|
|
1344
1344
|
function compat_scalar(arr, value) {
|
|
1345
|
-
if (arr.data
|
|
1345
|
+
if (globalThis.Array.isArray(arr.data)) {
|
|
1346
1346
|
return object_array_view([value]);
|
|
1347
1347
|
}
|
|
1348
1348
|
let TypedArray2 = get_typed_array_constructor(arr.data);
|
|
@@ -1454,6 +1454,19 @@ function set_from_chunk_binary(dest, src, bytes_per_element2, projections) {
|
|
|
1454
1454
|
function strip_prefix(path) {
|
|
1455
1455
|
return path.slice(1);
|
|
1456
1456
|
}
|
|
1457
|
+
function uri2href(url) {
|
|
1458
|
+
let [protocol, rest] = (typeof url === "string" ? url : url.href).split("://");
|
|
1459
|
+
if (protocol === "https" || protocol === "http") {
|
|
1460
|
+
return url;
|
|
1461
|
+
}
|
|
1462
|
+
if (protocol === "gc") {
|
|
1463
|
+
return `https://storage.googleapis.com/${rest}`;
|
|
1464
|
+
}
|
|
1465
|
+
if (protocol === "s3") {
|
|
1466
|
+
return `https://s3.amazonaws.com/${rest}`;
|
|
1467
|
+
}
|
|
1468
|
+
throw Error(`Protocol not supported, got: ${JSON.stringify(protocol)}`);
|
|
1469
|
+
}
|
|
1457
1470
|
function fetch_range(url, offset, length2, opts2 = {}) {
|
|
1458
1471
|
if (offset !== void 0 && length2 !== void 0) {
|
|
1459
1472
|
opts2 = {
|
|
@@ -1489,7 +1502,7 @@ async function handle_response(response) {
|
|
|
1489
1502
|
if (response.status === 404 || response.status === 403) {
|
|
1490
1503
|
return void 0;
|
|
1491
1504
|
}
|
|
1492
|
-
if (response.status
|
|
1505
|
+
if (response.status === 200 || response.status === 206) {
|
|
1493
1506
|
return new Uint8Array(await response.arrayBuffer());
|
|
1494
1507
|
}
|
|
1495
1508
|
throw new Error(`Unexpected response status ${response.status} ${response.statusText}`);
|
|
@@ -1582,11 +1595,6 @@ function createZarrArrayAdapter(arr) {
|
|
|
1582
1595
|
}
|
|
1583
1596
|
});
|
|
1584
1597
|
}
|
|
1585
|
-
const fs$q = {};
|
|
1586
|
-
const node = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1587
|
-
__proto__: null,
|
|
1588
|
-
default: fs$q
|
|
1589
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1590
1598
|
function readBlobAsArrayBuffer(blob) {
|
|
1591
1599
|
if (blob.arrayBuffer) {
|
|
1592
1600
|
return blob.arrayBuffer();
|
|
@@ -2429,7 +2437,7 @@ class HTTPRangeReader {
|
|
|
2429
2437
|
if (!req.ok) {
|
|
2430
2438
|
throw new Error(`failed http request ${this.url}, status: ${req.status}: ${req.statusText}`);
|
|
2431
2439
|
}
|
|
2432
|
-
this.length =
|
|
2440
|
+
this.length = Number(req.headers.get("content-length"));
|
|
2433
2441
|
if (Number.isNaN(this.length)) {
|
|
2434
2442
|
throw Error("could not get length");
|
|
2435
2443
|
}
|
|
@@ -2470,25 +2478,303 @@ class ZipFileStore {
|
|
|
2470
2478
|
}
|
|
2471
2479
|
}
|
|
2472
2480
|
const ZipFileStore$1 = ZipFileStore;
|
|
2473
|
-
function
|
|
2481
|
+
function parse$c(template, re2 = /{{(.*?)}}/) {
|
|
2482
|
+
let result = re2.exec(template);
|
|
2483
|
+
const parts = [];
|
|
2484
|
+
let pos;
|
|
2485
|
+
while (result) {
|
|
2486
|
+
pos = result.index;
|
|
2487
|
+
if (pos !== 0) {
|
|
2488
|
+
parts.push({ match: false, str: template.substring(0, pos) });
|
|
2489
|
+
template = template.slice(pos);
|
|
2490
|
+
}
|
|
2491
|
+
parts.push({ match: true, str: result[0] });
|
|
2492
|
+
template = template.slice(result[0].length);
|
|
2493
|
+
result = re2.exec(template);
|
|
2494
|
+
}
|
|
2495
|
+
if (template) {
|
|
2496
|
+
parts.push({ match: false, str: template });
|
|
2497
|
+
}
|
|
2498
|
+
return parts;
|
|
2499
|
+
}
|
|
2500
|
+
function matchFn(str) {
|
|
2501
|
+
const match = str.match(/(?<fname>[A-Z_][A-Z_1-9]*)\((?<args>[^)]+)\)/i);
|
|
2502
|
+
if (!(match == null ? void 0 : match.groups))
|
|
2503
|
+
return;
|
|
2504
|
+
const { fname, args } = match.groups;
|
|
2505
|
+
const ctx = Object.fromEntries(
|
|
2506
|
+
args.split(",").map((kwarg) => {
|
|
2507
|
+
var _a3;
|
|
2508
|
+
const { key, num, str: str2 } = ((_a3 = kwarg.match(
|
|
2509
|
+
/(?<key>[a-z_0-9]*)\s*=\s*((?<num>[0-9.]+)|('|")(?<str>.*)('|"))/i
|
|
2510
|
+
)) == null ? void 0 : _a3.groups) ?? {};
|
|
2511
|
+
if (!key || !(num || str2)) {
|
|
2512
|
+
throw Error(`Failed to match fn kwarg: ${kwarg}`);
|
|
2513
|
+
}
|
|
2514
|
+
return [key, num ? Number(num) : str2];
|
|
2515
|
+
})
|
|
2516
|
+
);
|
|
2517
|
+
return { fname, ctx };
|
|
2518
|
+
}
|
|
2519
|
+
const alphabet = "abcdefghijklmnopqrstuvwxyz";
|
|
2520
|
+
const numbers = "01234569789";
|
|
2521
|
+
const expr = "()*/+-";
|
|
2522
|
+
const space = " ";
|
|
2523
|
+
const valid$3 = new Set(
|
|
2524
|
+
alphabet + alphabet.toUpperCase() + numbers + expr + space
|
|
2525
|
+
);
|
|
2526
|
+
function matchMathEval(str) {
|
|
2527
|
+
for (let i2 = 0; i2 < str.length; i2++) {
|
|
2528
|
+
if (!valid$3.has(str.charAt(i2)))
|
|
2529
|
+
return;
|
|
2530
|
+
}
|
|
2531
|
+
return parse$c(str, /[A-Za-z_][A-Za-z0-9_]*/gi);
|
|
2532
|
+
}
|
|
2533
|
+
function render(template, context) {
|
|
2534
|
+
const grps = parse$c(template);
|
|
2535
|
+
return grps.map((grp) => {
|
|
2536
|
+
if (!grp.match) {
|
|
2537
|
+
return grp.str;
|
|
2538
|
+
}
|
|
2539
|
+
let inner = grp.str.split(/{{|}}/).filter(Boolean)[0].trim();
|
|
2540
|
+
if (inner in context) {
|
|
2541
|
+
return context[inner];
|
|
2542
|
+
}
|
|
2543
|
+
const fnMatch = matchFn(inner);
|
|
2544
|
+
if (fnMatch) {
|
|
2545
|
+
const { fname, ctx } = fnMatch;
|
|
2546
|
+
const fn = context[fname];
|
|
2547
|
+
if (typeof fn === "function") {
|
|
2548
|
+
return fn(ctx);
|
|
2549
|
+
}
|
|
2550
|
+
throw Error(
|
|
2551
|
+
`Cannot find function named ${fname} in rendering context.`
|
|
2552
|
+
);
|
|
2553
|
+
}
|
|
2554
|
+
const matches2 = matchMathEval(inner);
|
|
2555
|
+
if (matches2) {
|
|
2556
|
+
const exprParts = matches2.map((match) => {
|
|
2557
|
+
if (!match.match)
|
|
2558
|
+
return match.str;
|
|
2559
|
+
const value = context[match.str];
|
|
2560
|
+
if (value == null) {
|
|
2561
|
+
throw Error(
|
|
2562
|
+
`Cannot find number named ${match.str} in rendering context.`
|
|
2563
|
+
);
|
|
2564
|
+
}
|
|
2565
|
+
if (typeof value !== "number") {
|
|
2566
|
+
throw Error(
|
|
2567
|
+
`The provided value for ${match.str} must be a number.`
|
|
2568
|
+
);
|
|
2569
|
+
}
|
|
2570
|
+
return value;
|
|
2571
|
+
});
|
|
2572
|
+
return Function('"use strict";return (' + exprParts.join("") + ")")();
|
|
2573
|
+
}
|
|
2574
|
+
throw new Error(`Unable to match ${grp.str}`);
|
|
2575
|
+
}).join("");
|
|
2576
|
+
}
|
|
2577
|
+
function parse$b(spec, renderString = render) {
|
|
2578
|
+
return "version" in spec ? parseV1(spec, renderString) : parseV0(spec);
|
|
2579
|
+
}
|
|
2580
|
+
function parseV0(spec) {
|
|
2581
|
+
return new Map(Object.entries(spec));
|
|
2582
|
+
}
|
|
2583
|
+
function parseV1(spec, renderString) {
|
|
2584
|
+
var _a3;
|
|
2585
|
+
const context = {};
|
|
2586
|
+
for (const [key, template] of Object.entries(spec.templates ?? {})) {
|
|
2587
|
+
if (template.includes("{{")) {
|
|
2588
|
+
context[key] = (ctx) => renderString(template, ctx);
|
|
2589
|
+
} else {
|
|
2590
|
+
context[key] = template;
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
const render2 = (t2, o2) => {
|
|
2594
|
+
return renderString(t2, { ...context, ...o2 });
|
|
2595
|
+
};
|
|
2596
|
+
const refs = /* @__PURE__ */ new Map();
|
|
2597
|
+
for (const [key, ref2] of Object.entries(spec.refs ?? {})) {
|
|
2598
|
+
if (typeof ref2 === "string") {
|
|
2599
|
+
refs.set(key, ref2);
|
|
2600
|
+
} else {
|
|
2601
|
+
const url = ((_a3 = ref2[0]) == null ? void 0 : _a3.includes("{{")) ? render2(ref2[0]) : ref2[0];
|
|
2602
|
+
refs.set(key, ref2.length === 1 ? [url] : [url, ref2[1], ref2[2]]);
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
for (const g2 of spec.gen ?? []) {
|
|
2606
|
+
for (const dims of iterDims(g2.dimensions)) {
|
|
2607
|
+
const key = render2(g2.key, dims);
|
|
2608
|
+
const url = render2(g2.url, dims);
|
|
2609
|
+
if ("offset" in g2 && "length" in g2) {
|
|
2610
|
+
const offset = render2(g2.offset, dims);
|
|
2611
|
+
const length2 = render2(g2.length, dims);
|
|
2612
|
+
refs.set(key, [url, parseInt(offset), parseInt(length2)]);
|
|
2613
|
+
} else {
|
|
2614
|
+
refs.set(key, [url]);
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
return refs;
|
|
2619
|
+
}
|
|
2620
|
+
function* iterDims(dimensions) {
|
|
2621
|
+
const keys3 = Object.keys(dimensions);
|
|
2622
|
+
const iterables = Object.values(dimensions).map(
|
|
2623
|
+
(i2) => Array.isArray(i2) ? i2 : [...range$7(i2)]
|
|
2624
|
+
);
|
|
2625
|
+
for (const values of product$1(...iterables)) {
|
|
2626
|
+
yield Object.fromEntries(keys3.map((key, i2) => [key, values[i2]]));
|
|
2627
|
+
}
|
|
2628
|
+
}
|
|
2629
|
+
function* product$1(...iterables) {
|
|
2630
|
+
if (iterables.length === 0) {
|
|
2631
|
+
return;
|
|
2632
|
+
}
|
|
2633
|
+
const iterators = iterables.map((it) => it[Symbol.iterator]());
|
|
2634
|
+
const results = iterators.map((it) => it.next());
|
|
2635
|
+
if (results.some((r2) => r2.done)) {
|
|
2636
|
+
throw new Error("Input contains an empty iterator.");
|
|
2637
|
+
}
|
|
2638
|
+
for (let i2 = 0; ; ) {
|
|
2639
|
+
if (results[i2].done) {
|
|
2640
|
+
iterators[i2] = iterables[i2][Symbol.iterator]();
|
|
2641
|
+
results[i2] = iterators[i2].next();
|
|
2642
|
+
if (++i2 >= iterators.length) {
|
|
2643
|
+
return;
|
|
2644
|
+
}
|
|
2645
|
+
} else {
|
|
2646
|
+
yield results.map(({ value }) => value);
|
|
2647
|
+
i2 = 0;
|
|
2648
|
+
}
|
|
2649
|
+
results[i2] = iterators[i2].next();
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
function* range$7({ stop, start = 0, step = 1 }) {
|
|
2653
|
+
for (let i2 = start; i2 < stop; i2 += step) {
|
|
2654
|
+
yield i2;
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
(() => {
|
|
2658
|
+
var table2 = new Uint8Array(128);
|
|
2659
|
+
for (var i2 = 0; i2 < 64; i2++) {
|
|
2660
|
+
table2[i2 < 26 ? i2 + 65 : i2 < 52 ? i2 + 71 : i2 < 62 ? i2 - 4 : i2 * 4 - 205] = i2;
|
|
2661
|
+
}
|
|
2662
|
+
return (base64) => {
|
|
2663
|
+
var n3 = base64.length;
|
|
2664
|
+
var bytes = new Uint8Array(
|
|
2665
|
+
// @ts-expect-error
|
|
2666
|
+
(n3 - (base64[n3 - 1] == "=") - (base64[n3 - 2] == "=")) * 3 / 4 | 0
|
|
2667
|
+
);
|
|
2668
|
+
for (var i22 = 0, j = 0; i22 < n3; ) {
|
|
2669
|
+
var c0 = table2[base64.charCodeAt(i22++)], c1 = table2[base64.charCodeAt(i22++)];
|
|
2670
|
+
var c2 = table2[base64.charCodeAt(i22++)], c3 = table2[base64.charCodeAt(i22++)];
|
|
2671
|
+
bytes[j++] = c0 << 2 | c1 >> 4;
|
|
2672
|
+
bytes[j++] = c1 << 4 | c2 >> 2;
|
|
2673
|
+
bytes[j++] = c2 << 6 | c3;
|
|
2674
|
+
}
|
|
2675
|
+
return bytes;
|
|
2676
|
+
};
|
|
2677
|
+
})();
|
|
2678
|
+
new TextEncoder();
|
|
2679
|
+
let table = new Uint8Array(128);
|
|
2680
|
+
for (let i2 = 0; i2 < 64; i2++) {
|
|
2681
|
+
table[i2 < 26 ? i2 + 65 : i2 < 52 ? i2 + 71 : i2 < 62 ? i2 - 4 : i2 * 4 - 205] = i2;
|
|
2682
|
+
}
|
|
2683
|
+
function to_binary(base64) {
|
|
2684
|
+
const n3 = base64.length;
|
|
2685
|
+
const bytes = new Uint8Array(
|
|
2686
|
+
// @ts-ignore
|
|
2687
|
+
(n3 - (base64[n3 - 1] === "=") - (base64[n3 - 2] === "=")) * 3 / 4 | 0
|
|
2688
|
+
);
|
|
2689
|
+
for (let i2 = 0, j = 0; i2 < n3; ) {
|
|
2690
|
+
const c0 = table[base64.charCodeAt(i2++)];
|
|
2691
|
+
const c1 = table[base64.charCodeAt(i2++)];
|
|
2692
|
+
const c2 = table[base64.charCodeAt(i2++)];
|
|
2693
|
+
const c3 = table[base64.charCodeAt(i2++)];
|
|
2694
|
+
bytes[j++] = c0 << 2 | c1 >> 4;
|
|
2695
|
+
bytes[j++] = c1 << 4 | c2 >> 2;
|
|
2696
|
+
bytes[j++] = c2 << 6 | c3;
|
|
2697
|
+
}
|
|
2698
|
+
return bytes;
|
|
2699
|
+
}
|
|
2700
|
+
const _ReferenceStore = class {
|
|
2701
|
+
constructor(refs, opts2 = {}) {
|
|
2702
|
+
__privateAdd(this, _refs, void 0);
|
|
2703
|
+
__privateAdd(this, _opts, void 0);
|
|
2704
|
+
__privateAdd(this, _overrides3, void 0);
|
|
2705
|
+
__privateSet(this, _refs, Promise.resolve(refs));
|
|
2706
|
+
__privateSet(this, _opts, opts2);
|
|
2707
|
+
__privateSet(this, _overrides3, opts2.overrides || {});
|
|
2708
|
+
}
|
|
2709
|
+
async get(key, opts2 = {}) {
|
|
2710
|
+
let ref2 = (await __privateGet(this, _refs)).get(strip_prefix(key));
|
|
2711
|
+
if (!ref2)
|
|
2712
|
+
return;
|
|
2713
|
+
if (typeof ref2 === "string") {
|
|
2714
|
+
if (ref2.startsWith("base64:")) {
|
|
2715
|
+
return to_binary(ref2.slice("base64:".length));
|
|
2716
|
+
}
|
|
2717
|
+
return new TextEncoder().encode(ref2);
|
|
2718
|
+
}
|
|
2719
|
+
let [urlOrNull, offset, size2] = ref2;
|
|
2720
|
+
let url = urlOrNull ?? __privateGet(this, _opts).target;
|
|
2721
|
+
if (!url) {
|
|
2722
|
+
throw Error(`No url for key ${key}, and no target url provided.`);
|
|
2723
|
+
}
|
|
2724
|
+
let res = await fetch_range(uri2href(url), offset, size2, merge_init(__privateGet(this, _overrides3), opts2));
|
|
2725
|
+
if (res.status === 200 || res.status === 206) {
|
|
2726
|
+
return new Uint8Array(await res.arrayBuffer());
|
|
2727
|
+
}
|
|
2728
|
+
throw new Error(`Request unsuccessful for key ${key}. Response status: ${res.status}.`);
|
|
2729
|
+
}
|
|
2730
|
+
static fromSpec(spec, opts2) {
|
|
2731
|
+
let refs = Promise.resolve(spec).then((spec2) => parse$b(spec2));
|
|
2732
|
+
return new _ReferenceStore(refs, opts2);
|
|
2733
|
+
}
|
|
2734
|
+
static fromUrl(url, opts2) {
|
|
2735
|
+
let spec = fetch(url, opts2 == null ? void 0 : opts2.overrides).then((res) => res.json());
|
|
2736
|
+
return _ReferenceStore.fromSpec(spec, opts2);
|
|
2737
|
+
}
|
|
2738
|
+
};
|
|
2739
|
+
let ReferenceStore = _ReferenceStore;
|
|
2740
|
+
_refs = new WeakMap();
|
|
2741
|
+
_opts = new WeakMap();
|
|
2742
|
+
_overrides3 = new WeakMap();
|
|
2743
|
+
const ReferenceStore$1 = ReferenceStore;
|
|
2744
|
+
function zarrOpenRoot(url, fileType, opts2) {
|
|
2474
2745
|
let store;
|
|
2475
|
-
const opts2 = requestInit2 ? { overrides: requestInit2 } : void 0;
|
|
2476
2746
|
if (fileType && fileType.endsWith(".zip")) {
|
|
2477
|
-
store = ZipFileStore$1.fromUrl(url, opts2);
|
|
2747
|
+
store = ZipFileStore$1.fromUrl(url, { overrides: opts2 == null ? void 0 : opts2.requestInit });
|
|
2748
|
+
} else if (fileType && fileType.endsWith(".h5ad")) {
|
|
2749
|
+
if (!(opts2 == null ? void 0 : opts2.refSpecUrl)) {
|
|
2750
|
+
throw new Error("refSpecUrl is required for H5AD files");
|
|
2751
|
+
}
|
|
2752
|
+
const referenceSpecPromise = fetch(opts2.refSpecUrl).then((res) => res.json()).then((referenceSpec) => Object.fromEntries(
|
|
2753
|
+
// We want ReferenceStore.fromSpec to use our `target` URL option regardless
|
|
2754
|
+
// of what target URL(s) are specified in the reference spec JSON.
|
|
2755
|
+
// Reference: https://github.com/manzt/zarrita.js/pull/155
|
|
2756
|
+
Object.entries(referenceSpec).map(([key, entry]) => {
|
|
2757
|
+
if (Array.isArray(entry) && entry.length >= 1) {
|
|
2758
|
+
entry[0] = null;
|
|
2759
|
+
}
|
|
2760
|
+
return [key, entry];
|
|
2761
|
+
})
|
|
2762
|
+
));
|
|
2763
|
+
store = ReferenceStore$1.fromSpec(referenceSpecPromise, { target: url, overrides: opts2 == null ? void 0 : opts2.requestInit });
|
|
2478
2764
|
} else {
|
|
2479
|
-
store = new FetchStore$1(url, opts2);
|
|
2765
|
+
store = new FetchStore$1(url, { overrides: opts2 == null ? void 0 : opts2.requestInit });
|
|
2480
2766
|
}
|
|
2481
2767
|
return root$3(store);
|
|
2482
2768
|
}
|
|
2483
2769
|
class ZarrDataSource {
|
|
2484
2770
|
/**
|
|
2485
|
-
* @param {DataSourceParams} params The parameters object.
|
|
2771
|
+
* @param {DataSourceParams & { refSpecUrl?: string }} params The parameters object.
|
|
2486
2772
|
*/
|
|
2487
|
-
constructor({ url, requestInit: requestInit2, store, fileType }) {
|
|
2773
|
+
constructor({ url, requestInit: requestInit2, refSpecUrl, store, fileType }) {
|
|
2488
2774
|
if (store) {
|
|
2489
2775
|
this.storeRoot = root$3(store);
|
|
2490
2776
|
} else if (url) {
|
|
2491
|
-
this.storeRoot = zarrOpenRoot(url, fileType, requestInit2);
|
|
2777
|
+
this.storeRoot = zarrOpenRoot(url, fileType, { requestInit: requestInit2, refSpecUrl });
|
|
2492
2778
|
} else {
|
|
2493
2779
|
throw new Error("Either a store or a URL must be provided to the ZarrDataSource constructor.");
|
|
2494
2780
|
}
|
|
@@ -2647,7 +2933,10 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
2647
2933
|
const values = await get$1(arr, [null]);
|
|
2648
2934
|
const { data } = values;
|
|
2649
2935
|
const mappedValues = Array.from(data).map(
|
|
2650
|
-
(i2) => !categoriesValues ? String(i2) : categoriesValues[
|
|
2936
|
+
(i2) => !categoriesValues ? String(i2) : categoriesValues[
|
|
2937
|
+
/** @type {number} */
|
|
2938
|
+
i2
|
|
2939
|
+
]
|
|
2651
2940
|
);
|
|
2652
2941
|
return mappedValues;
|
|
2653
2942
|
}
|
|
@@ -2656,7 +2945,7 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
2656
2945
|
* @param {string} path A string like obsm.X_pca.
|
|
2657
2946
|
* @returns {Promise<Chunk<any>>} A promise for a zarr array containing the data.
|
|
2658
2947
|
*/
|
|
2659
|
-
loadNumeric(path) {
|
|
2948
|
+
async loadNumeric(path) {
|
|
2660
2949
|
const { storeRoot } = this;
|
|
2661
2950
|
return open(storeRoot.resolve(path), { kind: "array" }).then((arr) => get$1(arr));
|
|
2662
2951
|
}
|
|
@@ -2669,7 +2958,7 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
2669
2958
|
* shape: [number, number],
|
|
2670
2959
|
* }>} A promise for a zarr array containing the data.
|
|
2671
2960
|
*/
|
|
2672
|
-
loadNumericForDims(path, dims) {
|
|
2961
|
+
async loadNumericForDims(path, dims) {
|
|
2673
2962
|
const { storeRoot } = this;
|
|
2674
2963
|
const arr = open(storeRoot.resolve(path), { kind: "array" });
|
|
2675
2964
|
return Promise.all(
|
|
@@ -2696,7 +2985,10 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
2696
2985
|
const arr = await open(storeRoot.resolve(path), { kind: "array" });
|
|
2697
2986
|
const data = await get$1(arr);
|
|
2698
2987
|
if ((_a3 = data.data) == null ? void 0 : _a3[Symbol.iterator]) {
|
|
2699
|
-
return
|
|
2988
|
+
return (
|
|
2989
|
+
/** @type {string[]} */
|
|
2990
|
+
Array.from(data.data)
|
|
2991
|
+
);
|
|
2700
2992
|
}
|
|
2701
2993
|
return (
|
|
2702
2994
|
/** @type {string[]} */
|
|
@@ -3501,14 +3793,14 @@ class ObsEmbeddingAnndataLoader extends AbstractTwoStepLoader {
|
|
|
3501
3793
|
const { path, dims = [0, 1] } = this.options;
|
|
3502
3794
|
if (this.embedding) {
|
|
3503
3795
|
return (
|
|
3504
|
-
/** @type {
|
|
3796
|
+
/** @type {MatrixResult} */
|
|
3505
3797
|
this.embedding
|
|
3506
3798
|
);
|
|
3507
3799
|
}
|
|
3508
3800
|
if (!this.embedding) {
|
|
3509
|
-
this.embedding = this.dataSource.loadNumericForDims(path, dims);
|
|
3801
|
+
this.embedding = await this.dataSource.loadNumericForDims(path, dims);
|
|
3510
3802
|
return (
|
|
3511
|
-
/** @type {
|
|
3803
|
+
/** @type {MatrixResult} */
|
|
3512
3804
|
this.embedding
|
|
3513
3805
|
);
|
|
3514
3806
|
}
|
|
@@ -3575,6 +3867,7 @@ const FileType$1 = {
|
|
|
3575
3867
|
// Joint file types
|
|
3576
3868
|
ANNDATA_ZARR: "anndata.zarr",
|
|
3577
3869
|
ANNDATA_ZARR_ZIP: "anndata.zarr.zip",
|
|
3870
|
+
ANNDATA_H5AD: "anndata.h5ad",
|
|
3578
3871
|
SPATIALDATA_ZARR: "spatialdata.zarr",
|
|
3579
3872
|
// Atomic file types
|
|
3580
3873
|
OBS_EMBEDDING_CSV: "obsEmbedding.csv",
|
|
@@ -3615,6 +3908,18 @@ const FileType$1 = {
|
|
|
3615
3908
|
OBS_LABELS_ANNDATA_ZARR_ZIP: "obsLabels.anndata.zarr.zip",
|
|
3616
3909
|
FEATURE_LABELS_ANNDATA_ZARR_ZIP: "featureLabels.anndata.zarr.zip",
|
|
3617
3910
|
SAMPLE_EDGES_ANNDATA_ZARR_ZIP: "sampleEdges.anndata.zarr.zip",
|
|
3911
|
+
// AnnData - h5ad via reference spec
|
|
3912
|
+
OBS_FEATURE_MATRIX_ANNDATA_H5AD: "obsFeatureMatrix.anndata.h5ad",
|
|
3913
|
+
OBS_FEATURE_COLUMNS_ANNDATA_H5AD: "obsFeatureColumns.anndata.h5ad",
|
|
3914
|
+
OBS_SETS_ANNDATA_H5AD: "obsSets.anndata.h5ad",
|
|
3915
|
+
OBS_EMBEDDING_ANNDATA_H5AD: "obsEmbedding.anndata.h5ad",
|
|
3916
|
+
OBS_SPOTS_ANNDATA_H5AD: "obsSpots.anndata.h5ad",
|
|
3917
|
+
OBS_POINTS_ANNDATA_H5AD: "obsPoints.anndata.h5ad",
|
|
3918
|
+
OBS_LOCATIONS_ANNDATA_H5AD: "obsLocations.anndata.h5ad",
|
|
3919
|
+
OBS_SEGMENTATIONS_ANNDATA_H5AD: "obsSegmentations.anndata.h5ad",
|
|
3920
|
+
OBS_LABELS_ANNDATA_H5AD: "obsLabels.anndata.h5ad",
|
|
3921
|
+
FEATURE_LABELS_ANNDATA_H5AD: "featureLabels.anndata.h5ad",
|
|
3922
|
+
SAMPLE_EDGES_ANNDATA_H5AD: "sampleEdges.anndata.h5ad",
|
|
3618
3923
|
// SpatialData
|
|
3619
3924
|
IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
|
|
3620
3925
|
LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
|
|
@@ -4265,13 +4570,13 @@ class ObsSpotsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
4265
4570
|
* Class method for loading embedding coordinates, such as those from UMAP or t-SNE.
|
|
4266
4571
|
* @returns {Promise} A promise for an array of columns.
|
|
4267
4572
|
*/
|
|
4268
|
-
loadSpots() {
|
|
4573
|
+
async loadSpots() {
|
|
4269
4574
|
const { path, dims = [0, 1] } = this.options;
|
|
4270
4575
|
if (this.locations) {
|
|
4271
4576
|
return this.locations;
|
|
4272
4577
|
}
|
|
4273
4578
|
if (!this.locations) {
|
|
4274
|
-
this.locations = this.dataSource.loadNumericForDims(path, dims);
|
|
4579
|
+
this.locations = await this.dataSource.loadNumericForDims(path, dims);
|
|
4275
4580
|
return this.locations;
|
|
4276
4581
|
}
|
|
4277
4582
|
this.locations = Promise.resolve(null);
|
|
@@ -4316,13 +4621,13 @@ class ObsPointsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
4316
4621
|
* Class method for loading embedding coordinates, such as those from UMAP or t-SNE.
|
|
4317
4622
|
* @returns {Promise} A promise for an array of columns.
|
|
4318
4623
|
*/
|
|
4319
|
-
loadPoints() {
|
|
4624
|
+
async loadPoints() {
|
|
4320
4625
|
const { path, dims = [0, 1] } = this.options;
|
|
4321
4626
|
if (this.locations) {
|
|
4322
4627
|
return this.locations;
|
|
4323
4628
|
}
|
|
4324
4629
|
if (!this.locations) {
|
|
4325
|
-
this.locations = this.dataSource.loadNumericForDims(path, dims);
|
|
4630
|
+
this.locations = await this.dataSource.loadNumericForDims(path, dims);
|
|
4326
4631
|
return this.locations;
|
|
4327
4632
|
}
|
|
4328
4633
|
this.locations = Promise.resolve(null);
|
|
@@ -4365,13 +4670,13 @@ class ObsLocationsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
4365
4670
|
* Class method for loading embedding coordinates, such as those from UMAP or t-SNE.
|
|
4366
4671
|
* @returns {Promise} A promise for an array of columns.
|
|
4367
4672
|
*/
|
|
4368
|
-
loadLocations() {
|
|
4673
|
+
async loadLocations() {
|
|
4369
4674
|
const { path, dims = [0, 1] } = this.options;
|
|
4370
4675
|
if (this.locations) {
|
|
4371
4676
|
return this.locations;
|
|
4372
4677
|
}
|
|
4373
4678
|
if (!this.locations) {
|
|
4374
|
-
this.locations = this.dataSource.loadNumericForDims(path, dims);
|
|
4679
|
+
this.locations = await this.dataSource.loadNumericForDims(path, dims);
|
|
4375
4680
|
return this.locations;
|
|
4376
4681
|
}
|
|
4377
4682
|
this.locations = Promise.resolve(null);
|
|
@@ -23965,6 +24270,11 @@ var createDivide = /* @__PURE__ */ factory(name$7, dependencies, (_ref) => {
|
|
|
23965
24270
|
}
|
|
23966
24271
|
}, divideScalar2.signatures));
|
|
23967
24272
|
});
|
|
24273
|
+
const fs$q = {};
|
|
24274
|
+
const node = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
24275
|
+
__proto__: null,
|
|
24276
|
+
default: fs$q
|
|
24277
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
23968
24278
|
const require$$0$6 = /* @__PURE__ */ getAugmentedNamespace(node);
|
|
23969
24279
|
var Complex = /* @__PURE__ */ createComplexClass({});
|
|
23970
24280
|
var BigNumber = /* @__PURE__ */ createBigNumberClass({
|
|
@@ -25075,16 +25385,16 @@ class Stats {
|
|
|
25075
25385
|
}
|
|
25076
25386
|
}
|
|
25077
25387
|
getTable() {
|
|
25078
|
-
const
|
|
25388
|
+
const table2 = {};
|
|
25079
25389
|
this.forEach((stat) => {
|
|
25080
|
-
|
|
25390
|
+
table2[stat.name] = {
|
|
25081
25391
|
time: stat.time || 0,
|
|
25082
25392
|
count: stat.count || 0,
|
|
25083
25393
|
average: stat.getAverageTime() || 0,
|
|
25084
25394
|
hz: stat.getHz() || 0
|
|
25085
25395
|
};
|
|
25086
25396
|
});
|
|
25087
|
-
return
|
|
25397
|
+
return table2;
|
|
25088
25398
|
}
|
|
25089
25399
|
_initializeStats() {
|
|
25090
25400
|
let stats = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
@@ -25743,10 +26053,10 @@ class Log {
|
|
|
25743
26053
|
}
|
|
25744
26054
|
return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
|
|
25745
26055
|
}
|
|
25746
|
-
table(logLevel,
|
|
25747
|
-
if (
|
|
25748
|
-
return this._getLogFunction(logLevel,
|
|
25749
|
-
tag: getTableHeader(
|
|
26056
|
+
table(logLevel, table2, columns) {
|
|
26057
|
+
if (table2) {
|
|
26058
|
+
return this._getLogFunction(logLevel, table2, console.table || noop$4, columns && [columns], {
|
|
26059
|
+
tag: getTableHeader(table2)
|
|
25750
26060
|
});
|
|
25751
26061
|
}
|
|
25752
26062
|
return noop$4;
|
|
@@ -25946,9 +26256,9 @@ function logImageInBrowser(_ref3) {
|
|
|
25946
26256
|
}
|
|
25947
26257
|
return noop$4;
|
|
25948
26258
|
}
|
|
25949
|
-
function getTableHeader(
|
|
25950
|
-
for (const key in
|
|
25951
|
-
for (const title in
|
|
26259
|
+
function getTableHeader(table2) {
|
|
26260
|
+
for (const key in table2) {
|
|
26261
|
+
for (const title in table2[key]) {
|
|
25952
26262
|
return title || "untitled";
|
|
25953
26263
|
}
|
|
25954
26264
|
}
|
|
@@ -33391,13 +33701,13 @@ function getDebugTableForUniforms(_ref) {
|
|
|
33391
33701
|
const SHADER_MODULE_UNIFORM_REGEXP = ".*_.*";
|
|
33392
33702
|
const PROJECT_MODULE_UNIFORM_REGEXP = ".*Matrix";
|
|
33393
33703
|
const uniformLocations = program._uniformSetters;
|
|
33394
|
-
const
|
|
33704
|
+
const table2 = {};
|
|
33395
33705
|
const uniformNames = Object.keys(uniformLocations).sort();
|
|
33396
33706
|
let count2 = 0;
|
|
33397
33707
|
for (const uniformName of uniformNames) {
|
|
33398
33708
|
if (!uniformName.match(SHADER_MODULE_UNIFORM_REGEXP) && !uniformName.match(PROJECT_MODULE_UNIFORM_REGEXP)) {
|
|
33399
33709
|
if (addUniformToTable({
|
|
33400
|
-
table,
|
|
33710
|
+
table: table2,
|
|
33401
33711
|
header,
|
|
33402
33712
|
uniforms,
|
|
33403
33713
|
uniformName,
|
|
@@ -33410,7 +33720,7 @@ function getDebugTableForUniforms(_ref) {
|
|
|
33410
33720
|
for (const uniformName of uniformNames) {
|
|
33411
33721
|
if (uniformName.match(PROJECT_MODULE_UNIFORM_REGEXP)) {
|
|
33412
33722
|
if (addUniformToTable({
|
|
33413
|
-
table,
|
|
33723
|
+
table: table2,
|
|
33414
33724
|
header,
|
|
33415
33725
|
uniforms,
|
|
33416
33726
|
uniformName,
|
|
@@ -33421,9 +33731,9 @@ function getDebugTableForUniforms(_ref) {
|
|
|
33421
33731
|
}
|
|
33422
33732
|
}
|
|
33423
33733
|
for (const uniformName of uniformNames) {
|
|
33424
|
-
if (!
|
|
33734
|
+
if (!table2[uniformName]) {
|
|
33425
33735
|
if (addUniformToTable({
|
|
33426
|
-
table,
|
|
33736
|
+
table: table2,
|
|
33427
33737
|
header,
|
|
33428
33738
|
uniforms,
|
|
33429
33739
|
uniformName,
|
|
@@ -33438,7 +33748,7 @@ function getDebugTableForUniforms(_ref) {
|
|
|
33438
33748
|
if (!undefinedOnly) {
|
|
33439
33749
|
for (const uniformName in uniforms) {
|
|
33440
33750
|
const uniform = uniforms[uniformName];
|
|
33441
|
-
if (!
|
|
33751
|
+
if (!table2[uniformName]) {
|
|
33442
33752
|
unusedCount++;
|
|
33443
33753
|
unusedTable[uniformName] = {
|
|
33444
33754
|
Type: "NOT USED: ".concat(uniform),
|
|
@@ -33448,7 +33758,7 @@ function getDebugTableForUniforms(_ref) {
|
|
|
33448
33758
|
}
|
|
33449
33759
|
}
|
|
33450
33760
|
return {
|
|
33451
|
-
table,
|
|
33761
|
+
table: table2,
|
|
33452
33762
|
count: count2,
|
|
33453
33763
|
unusedTable,
|
|
33454
33764
|
unusedCount
|
|
@@ -33456,7 +33766,7 @@ function getDebugTableForUniforms(_ref) {
|
|
|
33456
33766
|
}
|
|
33457
33767
|
function addUniformToTable(_ref2) {
|
|
33458
33768
|
let {
|
|
33459
|
-
table,
|
|
33769
|
+
table: table2,
|
|
33460
33770
|
header,
|
|
33461
33771
|
uniforms,
|
|
33462
33772
|
uniformName,
|
|
@@ -33465,7 +33775,7 @@ function addUniformToTable(_ref2) {
|
|
|
33465
33775
|
const value = uniforms[uniformName];
|
|
33466
33776
|
const isDefined = isUniformDefined(value);
|
|
33467
33777
|
if (!undefinedOnly || !isDefined) {
|
|
33468
|
-
|
|
33778
|
+
table2[uniformName] = {
|
|
33469
33779
|
[header]: isDefined ? formatValue(value) : "N/A",
|
|
33470
33780
|
"Uniform Type": isDefined ? value : "NOT PROVIDED"
|
|
33471
33781
|
};
|
|
@@ -33484,9 +33794,9 @@ function getDebugTableForVertexArray(_ref) {
|
|
|
33484
33794
|
if (!vertexArray.configuration) {
|
|
33485
33795
|
return {};
|
|
33486
33796
|
}
|
|
33487
|
-
const
|
|
33797
|
+
const table2 = {};
|
|
33488
33798
|
if (vertexArray.elements) {
|
|
33489
|
-
|
|
33799
|
+
table2.ELEMENT_ARRAY_BUFFER = getDebugTableRow(vertexArray, vertexArray.elements, null, header);
|
|
33490
33800
|
}
|
|
33491
33801
|
const attributes = vertexArray.values;
|
|
33492
33802
|
for (const attributeLocation in attributes) {
|
|
@@ -33497,10 +33807,10 @@ function getDebugTableForVertexArray(_ref) {
|
|
|
33497
33807
|
if (accessor) {
|
|
33498
33808
|
rowHeader = "".concat(attributeLocation, ": ").concat(getGLSLDeclaration$1(info.name, accessor));
|
|
33499
33809
|
}
|
|
33500
|
-
|
|
33810
|
+
table2[rowHeader] = getDebugTableRow(vertexArray, attributes[attributeLocation], accessor, header);
|
|
33501
33811
|
}
|
|
33502
33812
|
}
|
|
33503
|
-
return
|
|
33813
|
+
return table2;
|
|
33504
33814
|
}
|
|
33505
33815
|
function getDebugTableRow(vertexArray, attribute, accessor, header) {
|
|
33506
33816
|
const {
|
|
@@ -33572,12 +33882,12 @@ function getGLSLDeclaration$1(name2, accessor) {
|
|
|
33572
33882
|
return typeAndName ? "".concat(name2, " (").concat(typeAndName.name, ")") : name2;
|
|
33573
33883
|
}
|
|
33574
33884
|
function getDebugTableForProgramConfiguration(config3) {
|
|
33575
|
-
const
|
|
33885
|
+
const table2 = {};
|
|
33576
33886
|
const header = "Accessors for ".concat(config3.id);
|
|
33577
33887
|
for (const attributeInfo of config3.attributeInfos) {
|
|
33578
33888
|
if (attributeInfo) {
|
|
33579
33889
|
const glslDeclaration = getGLSLDeclaration(attributeInfo);
|
|
33580
|
-
|
|
33890
|
+
table2["in ".concat(glslDeclaration)] = {
|
|
33581
33891
|
[header]: JSON.stringify(attributeInfo.accessor)
|
|
33582
33892
|
};
|
|
33583
33893
|
}
|
|
@@ -33585,12 +33895,12 @@ function getDebugTableForProgramConfiguration(config3) {
|
|
|
33585
33895
|
for (const varyingInfo of config3.varyingInfos) {
|
|
33586
33896
|
if (varyingInfo) {
|
|
33587
33897
|
const glslDeclaration = getGLSLDeclaration(varyingInfo);
|
|
33588
|
-
|
|
33898
|
+
table2["out ".concat(glslDeclaration)] = {
|
|
33589
33899
|
[header]: JSON.stringify(varyingInfo.accessor)
|
|
33590
33900
|
};
|
|
33591
33901
|
}
|
|
33592
33902
|
}
|
|
33593
|
-
return
|
|
33903
|
+
return table2;
|
|
33594
33904
|
}
|
|
33595
33905
|
function getGLSLDeclaration(attributeInfo) {
|
|
33596
33906
|
const {
|
|
@@ -85163,11 +85473,11 @@ function parseMVT(arrayBuffer2, options) {
|
|
|
85163
85473
|
data: parseToBinary(arrayBuffer2, mvtOptions)
|
|
85164
85474
|
};
|
|
85165
85475
|
case "geojson-row-table": {
|
|
85166
|
-
const
|
|
85476
|
+
const table2 = {
|
|
85167
85477
|
shape: "geojson-row-table",
|
|
85168
85478
|
data: parseToGeojson(arrayBuffer2, mvtOptions)
|
|
85169
85479
|
};
|
|
85170
|
-
return
|
|
85480
|
+
return table2;
|
|
85171
85481
|
}
|
|
85172
85482
|
case "geojson":
|
|
85173
85483
|
return parseToGeojson(arrayBuffer2, mvtOptions);
|
|
@@ -105594,7 +105904,7 @@ js$n.default = distance;
|
|
|
105594
105904
|
}
|
|
105595
105905
|
}, {
|
|
105596
105906
|
key: "render",
|
|
105597
|
-
value: function
|
|
105907
|
+
value: function render2() {
|
|
105598
105908
|
var _this = this;
|
|
105599
105909
|
var data = [];
|
|
105600
105910
|
var dataPick = [];
|
|
@@ -106686,7 +106996,7 @@ const require$$1$4 = /* @__PURE__ */ getAugmentedNamespace(esmBrowser);
|
|
|
106686
106996
|
}
|
|
106687
106997
|
_createClass2(NebulaLayer2, [{
|
|
106688
106998
|
key: "render",
|
|
106689
|
-
value: function
|
|
106999
|
+
value: function render2(config3) {
|
|
106690
107000
|
return null;
|
|
106691
107001
|
}
|
|
106692
107002
|
}]);
|
|
@@ -121078,7 +121388,7 @@ var deckCache = {};
|
|
|
121078
121388
|
}
|
|
121079
121389
|
_createClass2(JunctionsLayer2, [{
|
|
121080
121390
|
key: "render",
|
|
121081
|
-
value: function
|
|
121391
|
+
value: function render2(_ref) {
|
|
121082
121392
|
_ref.nebula;
|
|
121083
121393
|
var defaultColor = [0, 0, 0, 255];
|
|
121084
121394
|
var _this$deckCache = this.deckCache, objects = _this$deckCache.objects, updateTrigger = _this$deckCache.updateTrigger;
|
|
@@ -121250,7 +121560,7 @@ var textsLayer = {};
|
|
|
121250
121560
|
}
|
|
121251
121561
|
_createClass2(TextsLayer2, [{
|
|
121252
121562
|
key: "render",
|
|
121253
|
-
value: function
|
|
121563
|
+
value: function render2(_ref) {
|
|
121254
121564
|
var nebula2 = _ref.nebula;
|
|
121255
121565
|
var defaultColor = [0, 0, 0, 255];
|
|
121256
121566
|
var _this$deckCache = this.deckCache, objects = _this$deckCache.objects, updateTrigger = _this$deckCache.updateTrigger;
|
|
@@ -121477,7 +121787,7 @@ var segmentsLayer = {};
|
|
|
121477
121787
|
}
|
|
121478
121788
|
}, {
|
|
121479
121789
|
key: "render",
|
|
121480
|
-
value: function
|
|
121790
|
+
value: function render2(_ref2) {
|
|
121481
121791
|
var nebula2 = _ref2.nebula;
|
|
121482
121792
|
var defaultColor = [0, 0, 0, 255];
|
|
121483
121793
|
var _this$deckCache = this.deckCache, objects = _this$deckCache.objects, updateTrigger = _this$deckCache.updateTrigger;
|
|
@@ -123475,16 +123785,16 @@ function addDecoder(cases, importFn) {
|
|
|
123475
123785
|
}
|
|
123476
123786
|
cases.forEach((c) => registry$1.set(c, importFn));
|
|
123477
123787
|
}
|
|
123478
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
123479
|
-
addDecoder(5, () => import("./lzw-
|
|
123788
|
+
addDecoder([void 0, 1], () => import("./raw-1e87ff8b.js").then((m) => m.default));
|
|
123789
|
+
addDecoder(5, () => import("./lzw-ed481c3b.js").then((m) => m.default));
|
|
123480
123790
|
addDecoder(6, () => {
|
|
123481
123791
|
throw new Error("old style JPEG compression is not supported.");
|
|
123482
123792
|
});
|
|
123483
|
-
addDecoder(7, () => import("./jpeg-
|
|
123484
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
123485
|
-
addDecoder(32773, () => import("./packbits-
|
|
123486
|
-
addDecoder(34887, () => import("./lerc-
|
|
123487
|
-
addDecoder(50001, () => import("./webimage-
|
|
123793
|
+
addDecoder(7, () => import("./jpeg-96acb184.js").then((m) => m.default));
|
|
123794
|
+
addDecoder([8, 32946], () => import("./deflate-f092f055.js").then((m) => m.default));
|
|
123795
|
+
addDecoder(32773, () => import("./packbits-14e4265c.js").then((m) => m.default));
|
|
123796
|
+
addDecoder(34887, () => import("./lerc-41914740.js").then((m) => m.default));
|
|
123797
|
+
addDecoder(50001, () => import("./webimage-df74a5df.js").then((m) => m.default));
|
|
123488
123798
|
function decodeRowAcc(row, stride) {
|
|
123489
123799
|
let length2 = row.length - stride;
|
|
123490
123800
|
let offset = 0;
|
|
@@ -128345,15 +128655,15 @@ const adler32 = (adler, buf, len2, pos) => {
|
|
|
128345
128655
|
};
|
|
128346
128656
|
var adler32_1 = adler32;
|
|
128347
128657
|
const makeTable = () => {
|
|
128348
|
-
let c,
|
|
128658
|
+
let c, table2 = [];
|
|
128349
128659
|
for (var n3 = 0; n3 < 256; n3++) {
|
|
128350
128660
|
c = n3;
|
|
128351
128661
|
for (var k = 0; k < 8; k++) {
|
|
128352
128662
|
c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
128353
128663
|
}
|
|
128354
|
-
|
|
128664
|
+
table2[n3] = c;
|
|
128355
128665
|
}
|
|
128356
|
-
return
|
|
128666
|
+
return table2;
|
|
128357
128667
|
};
|
|
128358
128668
|
const crcTable = new Uint32Array(makeTable());
|
|
128359
128669
|
const crc32 = (crc2, buf, len2, pos) => {
|
|
@@ -130166,7 +130476,7 @@ const dext = new Uint8Array([
|
|
|
130166
130476
|
64,
|
|
130167
130477
|
64
|
|
130168
130478
|
]);
|
|
130169
|
-
const inflate_table = (type2, lens2, lens_index, codes,
|
|
130479
|
+
const inflate_table = (type2, lens2, lens_index, codes, table2, table_index, work, opts2) => {
|
|
130170
130480
|
const bits = opts2.bits;
|
|
130171
130481
|
let len2 = 0;
|
|
130172
130482
|
let sym = 0;
|
|
@@ -130206,8 +130516,8 @@ const inflate_table = (type2, lens2, lens_index, codes, table, table_index, work
|
|
|
130206
130516
|
root2 = max2;
|
|
130207
130517
|
}
|
|
130208
130518
|
if (max2 === 0) {
|
|
130209
|
-
|
|
130210
|
-
|
|
130519
|
+
table2[table_index++] = 1 << 24 | 64 << 16 | 0;
|
|
130520
|
+
table2[table_index++] = 1 << 24 | 64 << 16 | 0;
|
|
130211
130521
|
opts2.bits = 1;
|
|
130212
130522
|
return 0;
|
|
130213
130523
|
}
|
|
@@ -130282,7 +130592,7 @@ const inflate_table = (type2, lens2, lens_index, codes, table, table_index, work
|
|
|
130282
130592
|
min2 = fill;
|
|
130283
130593
|
do {
|
|
130284
130594
|
fill -= incr;
|
|
130285
|
-
|
|
130595
|
+
table2[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;
|
|
130286
130596
|
} while (fill !== 0);
|
|
130287
130597
|
incr = 1 << len2 - 1;
|
|
130288
130598
|
while (huff & incr) {
|
|
@@ -130321,11 +130631,11 @@ const inflate_table = (type2, lens2, lens_index, codes, table, table_index, work
|
|
|
130321
130631
|
return 1;
|
|
130322
130632
|
}
|
|
130323
130633
|
low = huff & mask;
|
|
130324
|
-
|
|
130634
|
+
table2[low] = root2 << 24 | curr << 16 | next - table_index | 0;
|
|
130325
130635
|
}
|
|
130326
130636
|
}
|
|
130327
130637
|
if (huff !== 0) {
|
|
130328
|
-
|
|
130638
|
+
table2[next + huff] = len2 - drop << 24 | 64 << 16 | 0;
|
|
130329
130639
|
}
|
|
130330
130640
|
opts2.bits = root2;
|
|
130331
130641
|
return 0;
|
|
@@ -131800,15 +132110,15 @@ const Zlib = (_a$1 = class Zlib2 {
|
|
|
131800
132110
|
}, _a$1.codecId = "zlib", _a$1);
|
|
131801
132111
|
const IS_NODE = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
|
|
131802
132112
|
let __toBinary = IS_NODE ? (base64) => new Uint8Array(Buffer.from(base64, "base64")) : /* @__PURE__ */ (() => {
|
|
131803
|
-
var
|
|
132113
|
+
var table2 = new Uint8Array(128);
|
|
131804
132114
|
for (var i2 = 0; i2 < 64; i2++)
|
|
131805
|
-
|
|
132115
|
+
table2[i2 < 26 ? i2 + 65 : i2 < 52 ? i2 + 71 : i2 < 62 ? i2 - 4 : i2 * 4 - 205] = i2;
|
|
131806
132116
|
return (base64) => {
|
|
131807
132117
|
var n3 = base64.length;
|
|
131808
132118
|
var bytes = new Uint8Array((n3 - (base64[n3 - 1] == "=") - (base64[n3 - 2] == "=")) * 3 / 4 | 0);
|
|
131809
132119
|
for (var i3 = 0, j = 0; i3 < n3; ) {
|
|
131810
|
-
var c0 =
|
|
131811
|
-
var c2 =
|
|
132120
|
+
var c0 = table2[base64.charCodeAt(i3++)], c1 = table2[base64.charCodeAt(i3++)];
|
|
132121
|
+
var c2 = table2[base64.charCodeAt(i3++)], c3 = table2[base64.charCodeAt(i3++)];
|
|
131812
132122
|
bytes[j++] = c0 << 2 | c1 >> 4;
|
|
131813
132123
|
bytes[j++] = c1 << 4 | c2 >> 2;
|
|
131814
132124
|
bytes[j++] = c2 << 6 | c3;
|
|
@@ -138287,7 +138597,7 @@ function normalizeCoordinateTransformations(coordinateTransformations, datasets)
|
|
|
138287
138597
|
var _a3;
|
|
138288
138598
|
let result = [];
|
|
138289
138599
|
if (Array.isArray(coordinateTransformations)) {
|
|
138290
|
-
result = coordinateTransformations.
|
|
138600
|
+
result = coordinateTransformations.flatMap((transform2) => {
|
|
138291
138601
|
if (transform2.input && transform2.output) {
|
|
138292
138602
|
const { type: type2 } = transform2;
|
|
138293
138603
|
if (type2 === "translation") {
|
|
@@ -138305,6 +138615,9 @@ function normalizeCoordinateTransformations(coordinateTransformations, datasets)
|
|
|
138305
138615
|
if (type2 === "identity") {
|
|
138306
138616
|
return { type: type2 };
|
|
138307
138617
|
}
|
|
138618
|
+
if (type2 === "sequence") {
|
|
138619
|
+
return normalizeCoordinateTransformations(transform2.transformations, datasets);
|
|
138620
|
+
}
|
|
138308
138621
|
console.warn(`Coordinate transformation type "${type2}" is not supported.`);
|
|
138309
138622
|
}
|
|
138310
138623
|
return transform2;
|
|
@@ -139227,6 +139540,9 @@ const configSchema1_0_16 = configSchema1_0_13.extend({
|
|
|
139227
139540
|
coordinationScopesBy: componentCoordinationScopesBy.optional()
|
|
139228
139541
|
}))
|
|
139229
139542
|
});
|
|
139543
|
+
const configSchema1_0_17 = configSchema1_0_16.extend({
|
|
139544
|
+
version: z.literal("1.0.17")
|
|
139545
|
+
});
|
|
139230
139546
|
configSchema1_0_0.shape.coordinationSpace.unwrap();
|
|
139231
139547
|
configSchema1_0_0.shape.layout.element.shape.coordinationScopes.unwrap();
|
|
139232
139548
|
function upgradeReplaceViewProp(prefix, view, coordinationSpace) {
|
|
@@ -139698,7 +140014,43 @@ function upgradeFrom1_0_15(config3) {
|
|
|
139698
140014
|
version: "1.0.16"
|
|
139699
140015
|
};
|
|
139700
140016
|
}
|
|
139701
|
-
|
|
140017
|
+
function upgradeFrom1_0_16(config3) {
|
|
140018
|
+
const newConfig = cloneDeep(config3);
|
|
140019
|
+
const { datasets } = newConfig;
|
|
140020
|
+
const newDatasets = datasets.map((datasetDef) => {
|
|
140021
|
+
const { files } = datasetDef;
|
|
140022
|
+
const newFiles = files.map((fileDef) => {
|
|
140023
|
+
const { fileType, options } = fileDef;
|
|
140024
|
+
if (fileType === "obsSets.anndata.zarr") {
|
|
140025
|
+
return {
|
|
140026
|
+
...fileDef,
|
|
140027
|
+
options: {
|
|
140028
|
+
obsSets: options
|
|
140029
|
+
}
|
|
140030
|
+
};
|
|
140031
|
+
}
|
|
140032
|
+
if (fileType === "obsFeatureColumns.anndata.zarr") {
|
|
140033
|
+
return {
|
|
140034
|
+
...fileDef,
|
|
140035
|
+
options: {
|
|
140036
|
+
obsFeatureColumns: options
|
|
140037
|
+
}
|
|
140038
|
+
};
|
|
140039
|
+
}
|
|
140040
|
+
return fileDef;
|
|
140041
|
+
});
|
|
140042
|
+
return {
|
|
140043
|
+
...datasetDef,
|
|
140044
|
+
files: newFiles
|
|
140045
|
+
};
|
|
140046
|
+
});
|
|
140047
|
+
return {
|
|
140048
|
+
...newConfig,
|
|
140049
|
+
datasets: newDatasets,
|
|
140050
|
+
version: "1.0.17"
|
|
140051
|
+
};
|
|
140052
|
+
}
|
|
140053
|
+
const latestConfigSchema = configSchema1_0_17;
|
|
139702
140054
|
const SCHEMA_HANDLERS = [
|
|
139703
140055
|
[configSchema0_1_0, upgradeFrom0_1_0],
|
|
139704
140056
|
[configSchema1_0_0, upgradeFrom1_0_0],
|
|
@@ -139716,7 +140068,8 @@ const SCHEMA_HANDLERS = [
|
|
|
139716
140068
|
[configSchema1_0_12, upgradeFrom1_0_12],
|
|
139717
140069
|
[configSchema1_0_13, upgradeFrom1_0_13],
|
|
139718
140070
|
[configSchema1_0_14, upgradeFrom1_0_14],
|
|
139719
|
-
[configSchema1_0_15, upgradeFrom1_0_15]
|
|
140071
|
+
[configSchema1_0_15, upgradeFrom1_0_15],
|
|
140072
|
+
[configSchema1_0_16, upgradeFrom1_0_16]
|
|
139720
140073
|
];
|
|
139721
140074
|
var re$3 = { exports: {} };
|
|
139722
140075
|
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
@@ -141987,10 +142340,11 @@ function makeConstantWithDeprecationMessage(currObj, oldObj) {
|
|
|
141987
142340
|
const handler = {
|
|
141988
142341
|
get(obj, prop) {
|
|
141989
142342
|
const oldKeys = Object.keys(oldObj);
|
|
141990
|
-
|
|
141991
|
-
|
|
141992
|
-
${oldObj[
|
|
141993
|
-
|
|
142343
|
+
const propKey = String(prop);
|
|
142344
|
+
if (oldKeys.includes(propKey)) {
|
|
142345
|
+
console.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
|
|
142346
|
+
${oldObj[propKey][1]}`);
|
|
142347
|
+
return oldObj[propKey];
|
|
141994
142348
|
}
|
|
141995
142349
|
return obj[prop];
|
|
141996
142350
|
}
|
|
@@ -142075,7 +142429,7 @@ const annDataObsFeatureMatrix = z.object({
|
|
|
142075
142429
|
featureFilterPath: z.string().optional().describe("If the feature index should be filtered, put a boolean column here (analogous to the previous geneFilter option). e.g., var/in_obsm_X_small_matrix"),
|
|
142076
142430
|
initialFeatureFilterPath: z.string().optional().describe("If only a subset of the matrix should be loaded initially, put a boolean column along the feature axis here (analogous to the previous matrixGeneFilter option). e.g., var/highly_variable")
|
|
142077
142431
|
});
|
|
142078
|
-
const
|
|
142432
|
+
const annDataObsSetsArr = z.array(z.object({
|
|
142079
142433
|
name: z.string().describe("The display name for the set, like 'Cell Type' or 'Louvain.'"),
|
|
142080
142434
|
path: z.union([
|
|
142081
142435
|
z.string().describe("The location in the AnnData store for the set, like 'obs/louvain' or 'obs/celltype.'"),
|
|
@@ -142083,9 +142437,15 @@ const annDataObsSets = z.array(z.object({
|
|
|
142083
142437
|
]),
|
|
142084
142438
|
scorePath: z.string().optional().describe("The location in the AnnData store for the set confidence scores, like 'obs/celltype_prediction_score.'")
|
|
142085
142439
|
}));
|
|
142086
|
-
z.
|
|
142440
|
+
const annDataObsSets = z.object({
|
|
142441
|
+
obsSets: annDataObsSetsArr
|
|
142442
|
+
});
|
|
142443
|
+
const annDataObsFeatureColumnsArr = z.array(z.object({
|
|
142087
142444
|
path: z.string()
|
|
142088
142445
|
}));
|
|
142446
|
+
z.object({
|
|
142447
|
+
obsFeatureColumns: annDataObsFeatureColumnsArr
|
|
142448
|
+
});
|
|
142089
142449
|
const annDataObsSpots = annDataObsm;
|
|
142090
142450
|
const annDataObsPoints = annDataObsm;
|
|
142091
142451
|
const annDataObsLocations = annDataObsm;
|
|
@@ -142208,7 +142568,7 @@ z.object({
|
|
|
142208
142568
|
scoreColumn: z.string().optional()
|
|
142209
142569
|
}))
|
|
142210
142570
|
});
|
|
142211
|
-
z.object({
|
|
142571
|
+
const anndataZarrSchema = z.object({
|
|
142212
142572
|
obsLabels: z.union([
|
|
142213
142573
|
annDataObsLabels,
|
|
142214
142574
|
z.array(annDataConvenienceObsLabelsItem)
|
|
@@ -142218,7 +142578,7 @@ z.object({
|
|
|
142218
142578
|
z.array(annDataConvenienceFeatureLabelsItem)
|
|
142219
142579
|
]),
|
|
142220
142580
|
obsFeatureMatrix: annDataObsFeatureMatrix,
|
|
142221
|
-
obsSets:
|
|
142581
|
+
obsSets: annDataObsSetsArr,
|
|
142222
142582
|
obsSpots: annDataObsSpots,
|
|
142223
142583
|
obsPoints: annDataObsPoints,
|
|
142224
142584
|
obsLocations: annDataObsLocations,
|
|
@@ -142229,6 +142589,9 @@ z.object({
|
|
|
142229
142589
|
]),
|
|
142230
142590
|
sampleEdges: annDataSampleEdges
|
|
142231
142591
|
}).partial();
|
|
142592
|
+
anndataZarrSchema.extend({
|
|
142593
|
+
refSpecUrl: z.string()
|
|
142594
|
+
});
|
|
142232
142595
|
z.object({
|
|
142233
142596
|
// TODO: should `image` be a special schema
|
|
142234
142597
|
// to allow specifying fileUid (like for embeddingType)?
|
|
@@ -149008,8 +149371,9 @@ interpolateRgbBasis(schemeRdBu);
|
|
|
149008
149371
|
interpolateSequentialMulti(schemePlasma);
|
|
149009
149372
|
class ObsSetsAnndataLoader extends AbstractTwoStepLoader {
|
|
149010
149373
|
loadObsIndices() {
|
|
149374
|
+
var _a3;
|
|
149011
149375
|
const { options } = this;
|
|
149012
|
-
const obsIndexPromises = options.map(({ path }) => path).map((pathOrPaths) => {
|
|
149376
|
+
const obsIndexPromises = (_a3 = options.obsSets) == null ? void 0 : _a3.map(({ path }) => path).map((pathOrPaths) => {
|
|
149013
149377
|
if (Array.isArray(pathOrPaths)) {
|
|
149014
149378
|
if (pathOrPaths.length > 0) {
|
|
149015
149379
|
return this.dataSource.loadObsIndex(pathOrPaths[0]);
|
|
@@ -149021,13 +149385,15 @@ class ObsSetsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
149021
149385
|
return Promise.all(obsIndexPromises);
|
|
149022
149386
|
}
|
|
149023
149387
|
loadCellSetIds() {
|
|
149388
|
+
var _a3;
|
|
149024
149389
|
const { options } = this;
|
|
149025
|
-
const cellSetZarrLocation = options.map(({ path }) => path);
|
|
149390
|
+
const cellSetZarrLocation = (_a3 = options.obsSets) == null ? void 0 : _a3.map(({ path }) => path);
|
|
149026
149391
|
return this.dataSource.loadObsColumns(cellSetZarrLocation);
|
|
149027
149392
|
}
|
|
149028
149393
|
loadCellSetScores() {
|
|
149394
|
+
var _a3;
|
|
149029
149395
|
const { options } = this;
|
|
149030
|
-
const cellSetScoreZarrLocation = options.map((option) => option.scorePath || void 0);
|
|
149396
|
+
const cellSetScoreZarrLocation = (_a3 = options.obsSets) == null ? void 0 : _a3.map((option) => option.scorePath || void 0);
|
|
149031
149397
|
return this.dataSource.loadObsColumns(cellSetScoreZarrLocation);
|
|
149032
149398
|
}
|
|
149033
149399
|
async load() {
|
|
@@ -149042,7 +149408,7 @@ class ObsSetsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
149042
149408
|
this.loadObsIndices(),
|
|
149043
149409
|
this.loadCellSetIds(),
|
|
149044
149410
|
this.loadCellSetScores()
|
|
149045
|
-
]).then((data) => [data[0], dataToCellSetsTree([data[1], data[2], data[3]], options)]);
|
|
149411
|
+
]).then((data) => [data[0], dataToCellSetsTree([data[1], data[2], data[3]], options.obsSets)]);
|
|
149046
149412
|
}
|
|
149047
149413
|
const [obsIndex, obsSets] = await this.cachedResult;
|
|
149048
149414
|
const obsSetsMembership = treeToMembershipMap(obsSets);
|
|
@@ -149066,13 +149432,13 @@ class ObsLabelsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
149066
149432
|
* Class method for loading observation string labels.
|
|
149067
149433
|
* @returns {Promise} A promise for the array.
|
|
149068
149434
|
*/
|
|
149069
|
-
loadLabels() {
|
|
149435
|
+
async loadLabels() {
|
|
149070
149436
|
const { path } = this.options;
|
|
149071
149437
|
if (this.labels) {
|
|
149072
149438
|
return this.labels;
|
|
149073
149439
|
}
|
|
149074
149440
|
if (!this.labels) {
|
|
149075
|
-
this.labels = this.dataSource._loadColumn(path);
|
|
149441
|
+
this.labels = await this.dataSource._loadColumn(path);
|
|
149076
149442
|
return this.labels;
|
|
149077
149443
|
}
|
|
149078
149444
|
this.labels = Promise.resolve(null);
|
|
@@ -149141,12 +149507,13 @@ class ObsFeatureColumnsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
149141
149507
|
* @returns {Promise} A promise for an array of columns.
|
|
149142
149508
|
*/
|
|
149143
149509
|
async loadObsFeatureColumns() {
|
|
149510
|
+
var _a3;
|
|
149144
149511
|
const { options } = this;
|
|
149145
149512
|
if (this.obsFeatureColumns) {
|
|
149146
149513
|
return this.obsFeatureColumns;
|
|
149147
149514
|
}
|
|
149148
149515
|
if (!this.obsFeatureColumns) {
|
|
149149
|
-
const colPaths = options.map(({ path }) => path);
|
|
149516
|
+
const colPaths = (_a3 = options.obsFeatureColumns) == null ? void 0 : _a3.map(({ path }) => path);
|
|
149150
149517
|
const firstPath = colPaths[0];
|
|
149151
149518
|
const obsIndex = await this.dataSource.loadObsIndex(firstPath);
|
|
149152
149519
|
const featureIndex = colPaths.map((colPath) => basename(colPath));
|
|
@@ -149740,25 +150107,25 @@ class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
|
|
|
149740
150107
|
* Class method for loading embedding coordinates, such as those from UMAP or t-SNE.
|
|
149741
150108
|
* @returns {Promise} A promise for an array of columns.
|
|
149742
150109
|
*/
|
|
149743
|
-
loadSpots() {
|
|
150110
|
+
async loadSpots() {
|
|
149744
150111
|
const { path, dims = [0, 1] } = this.options;
|
|
149745
150112
|
if (this.locations) {
|
|
149746
150113
|
return this.locations;
|
|
149747
150114
|
}
|
|
149748
150115
|
if (!this.locations) {
|
|
149749
|
-
this.locations = this.dataSource.loadNumericForDims(getCoordsPath(path), dims);
|
|
150116
|
+
this.locations = await this.dataSource.loadNumericForDims(getCoordsPath(path), dims);
|
|
149750
150117
|
return this.locations;
|
|
149751
150118
|
}
|
|
149752
150119
|
this.locations = Promise.resolve(null);
|
|
149753
150120
|
return this.locations;
|
|
149754
150121
|
}
|
|
149755
|
-
loadRadius() {
|
|
150122
|
+
async loadRadius() {
|
|
149756
150123
|
const { path } = this.options;
|
|
149757
150124
|
if (this.radius) {
|
|
149758
150125
|
return this.radius;
|
|
149759
150126
|
}
|
|
149760
150127
|
if (!this.radius) {
|
|
149761
|
-
this.radius = this.dataSource.loadNumeric(getRadiusPath(path));
|
|
150128
|
+
this.radius = await this.dataSource.loadNumeric(getRadiusPath(path));
|
|
149762
150129
|
return this.radius;
|
|
149763
150130
|
}
|
|
149764
150131
|
this.radius = Promise.resolve(null);
|