@vitessce/config 4.2.0 → 4.2.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/index.js +348 -0
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -4646,6 +4646,354 @@ class ZipFileStore {
|
|
|
4646
4646
|
return new ZipFileStore(new BlobReader2(blob), opts);
|
|
4647
4647
|
}
|
|
4648
4648
|
}
|
|
4649
|
+
const alphabet = "abcdefghijklmnopqrstuvwxyz";
|
|
4650
|
+
const numbers = "01234569789";
|
|
4651
|
+
const expr = "()*/+-";
|
|
4652
|
+
const space = " ";
|
|
4653
|
+
new Set(
|
|
4654
|
+
alphabet + alphabet.toUpperCase() + numbers + expr + space
|
|
4655
|
+
);
|
|
4656
|
+
(() => {
|
|
4657
|
+
var table2 = new Uint8Array(128);
|
|
4658
|
+
for (var i = 0; i < 64; i++) {
|
|
4659
|
+
table2[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i * 4 - 205] = i;
|
|
4660
|
+
}
|
|
4661
|
+
return (base64) => {
|
|
4662
|
+
var n = base64.length;
|
|
4663
|
+
var bytes = new Uint8Array(
|
|
4664
|
+
// @ts-expect-error
|
|
4665
|
+
(n - (base64[n - 1] == "=") - (base64[n - 2] == "=")) * 3 / 4 | 0
|
|
4666
|
+
);
|
|
4667
|
+
for (var i2 = 0, j = 0; i2 < n; ) {
|
|
4668
|
+
var c0 = table2[base64.charCodeAt(i2++)], c1 = table2[base64.charCodeAt(i2++)];
|
|
4669
|
+
var c2 = table2[base64.charCodeAt(i2++)], c3 = table2[base64.charCodeAt(i2++)];
|
|
4670
|
+
bytes[j++] = c0 << 2 | c1 >> 4;
|
|
4671
|
+
bytes[j++] = c1 << 4 | c2 >> 2;
|
|
4672
|
+
bytes[j++] = c2 << 6 | c3;
|
|
4673
|
+
}
|
|
4674
|
+
return bytes;
|
|
4675
|
+
};
|
|
4676
|
+
})();
|
|
4677
|
+
new TextEncoder();
|
|
4678
|
+
function _structure_size(structure) {
|
|
4679
|
+
const fmt = "<" + Array.from(structure.values()).join("");
|
|
4680
|
+
return struct.calcsize(fmt);
|
|
4681
|
+
}
|
|
4682
|
+
function isBigEndian() {
|
|
4683
|
+
const array = new Uint8Array(4);
|
|
4684
|
+
const view = new Uint32Array(array.buffer);
|
|
4685
|
+
return !((view[0] = 1) & array[0]);
|
|
4686
|
+
}
|
|
4687
|
+
function decodeFloat16(low, high) {
|
|
4688
|
+
const sign = (high & 128) >> 7;
|
|
4689
|
+
const exponent = (high & 124) >> 2;
|
|
4690
|
+
const fraction = ((high & 3) << 8) + low;
|
|
4691
|
+
let magnitude;
|
|
4692
|
+
if (exponent === 31) {
|
|
4693
|
+
magnitude = fraction === 0 ? Infinity : NaN;
|
|
4694
|
+
} else if (exponent === 0) {
|
|
4695
|
+
magnitude = 2 ** -14 * (fraction / 1024);
|
|
4696
|
+
} else {
|
|
4697
|
+
magnitude = 2 ** (exponent - 15) * (1 + fraction / 1024);
|
|
4698
|
+
}
|
|
4699
|
+
return sign ? -magnitude : magnitude;
|
|
4700
|
+
}
|
|
4701
|
+
class DataView64 extends DataView {
|
|
4702
|
+
getFloat16(byteOffset, littleEndian) {
|
|
4703
|
+
const bytes = [this.getUint8(byteOffset), this.getUint8(byteOffset + 1)];
|
|
4704
|
+
if (!littleEndian)
|
|
4705
|
+
bytes.reverse();
|
|
4706
|
+
return decodeFloat16(bytes[0], bytes[1]);
|
|
4707
|
+
}
|
|
4708
|
+
getUint64(byteOffset, littleEndian) {
|
|
4709
|
+
const left = BigInt(this.getUint32(byteOffset, littleEndian));
|
|
4710
|
+
const right = BigInt(this.getUint32(byteOffset + 4, littleEndian));
|
|
4711
|
+
const combined = littleEndian ? left + (right << 32n) : (left << 32n) + right;
|
|
4712
|
+
return Number(combined);
|
|
4713
|
+
}
|
|
4714
|
+
getInt64(byteOffset, littleEndian) {
|
|
4715
|
+
let low, high;
|
|
4716
|
+
if (littleEndian) {
|
|
4717
|
+
low = this.getUint32(byteOffset, true);
|
|
4718
|
+
high = this.getInt32(byteOffset + 4, true);
|
|
4719
|
+
} else {
|
|
4720
|
+
high = this.getInt32(byteOffset, false);
|
|
4721
|
+
low = this.getUint32(byteOffset + 4, false);
|
|
4722
|
+
}
|
|
4723
|
+
const combined = BigInt(low) + (BigInt(high) << 32n);
|
|
4724
|
+
return Number(combined);
|
|
4725
|
+
}
|
|
4726
|
+
getString(byteOffset, _littleEndian, length) {
|
|
4727
|
+
const str_buffer = this.buffer.slice(byteOffset, byteOffset + length);
|
|
4728
|
+
return new TextDecoder().decode(str_buffer);
|
|
4729
|
+
}
|
|
4730
|
+
getVLENStruct(byteOffset, littleEndian, _length) {
|
|
4731
|
+
const item_size = this.getUint32(byteOffset, littleEndian);
|
|
4732
|
+
const collection_address = this.getUint64(byteOffset + 4, littleEndian);
|
|
4733
|
+
const object_index = this.getUint32(byteOffset + 12, littleEndian);
|
|
4734
|
+
return [item_size, collection_address, object_index];
|
|
4735
|
+
}
|
|
4736
|
+
}
|
|
4737
|
+
class Struct {
|
|
4738
|
+
big_endian;
|
|
4739
|
+
getters;
|
|
4740
|
+
byte_lengths;
|
|
4741
|
+
fmt_size_regex;
|
|
4742
|
+
constructor() {
|
|
4743
|
+
this.big_endian = isBigEndian();
|
|
4744
|
+
this.getters = {
|
|
4745
|
+
s: "getUint8",
|
|
4746
|
+
b: "getInt8",
|
|
4747
|
+
B: "getUint8",
|
|
4748
|
+
h: "getInt16",
|
|
4749
|
+
H: "getUint16",
|
|
4750
|
+
i: "getInt32",
|
|
4751
|
+
I: "getUint32",
|
|
4752
|
+
l: "getInt32",
|
|
4753
|
+
L: "getUint32",
|
|
4754
|
+
q: "getInt64",
|
|
4755
|
+
Q: "getUint64",
|
|
4756
|
+
e: "getFloat16",
|
|
4757
|
+
f: "getFloat32",
|
|
4758
|
+
d: "getFloat64"
|
|
4759
|
+
};
|
|
4760
|
+
this.byte_lengths = {
|
|
4761
|
+
s: 1,
|
|
4762
|
+
b: 1,
|
|
4763
|
+
B: 1,
|
|
4764
|
+
h: 2,
|
|
4765
|
+
H: 2,
|
|
4766
|
+
i: 4,
|
|
4767
|
+
I: 4,
|
|
4768
|
+
l: 4,
|
|
4769
|
+
L: 4,
|
|
4770
|
+
q: 8,
|
|
4771
|
+
Q: 8,
|
|
4772
|
+
e: 2,
|
|
4773
|
+
f: 4,
|
|
4774
|
+
d: 8
|
|
4775
|
+
};
|
|
4776
|
+
const all_formats = Object.keys(this.byte_lengths).join("");
|
|
4777
|
+
this.fmt_size_regex = "(\\d*)([" + all_formats + "])";
|
|
4778
|
+
}
|
|
4779
|
+
calcsize(fmt) {
|
|
4780
|
+
let size = 0;
|
|
4781
|
+
const regex = new RegExp(this.fmt_size_regex, "g");
|
|
4782
|
+
let match;
|
|
4783
|
+
while ((match = regex.exec(fmt)) !== null) {
|
|
4784
|
+
const n = parseInt(match[1] || "1", 10);
|
|
4785
|
+
const f = match[2];
|
|
4786
|
+
size += n * this.byte_lengths[f];
|
|
4787
|
+
}
|
|
4788
|
+
return size;
|
|
4789
|
+
}
|
|
4790
|
+
_is_big_endian(fmt) {
|
|
4791
|
+
if (/^</.test(fmt))
|
|
4792
|
+
return false;
|
|
4793
|
+
if (/^(!|>)/.test(fmt))
|
|
4794
|
+
return true;
|
|
4795
|
+
return this.big_endian;
|
|
4796
|
+
}
|
|
4797
|
+
unpack_from(fmt, buffer, offset) {
|
|
4798
|
+
offset = Number(offset || 0);
|
|
4799
|
+
const view = new DataView64(buffer, 0);
|
|
4800
|
+
const output = [];
|
|
4801
|
+
const big_endian = this._is_big_endian(fmt);
|
|
4802
|
+
const regex = new RegExp(this.fmt_size_regex, "g");
|
|
4803
|
+
let match;
|
|
4804
|
+
while ((match = regex.exec(fmt)) !== null) {
|
|
4805
|
+
const n = parseInt(match[1] || "1", 10);
|
|
4806
|
+
const f = match[2];
|
|
4807
|
+
const getter = this.getters[f];
|
|
4808
|
+
const size = this.byte_lengths[f];
|
|
4809
|
+
if (f === "s") {
|
|
4810
|
+
output.push(new TextDecoder().decode(buffer.slice(offset, offset + n)));
|
|
4811
|
+
offset += n;
|
|
4812
|
+
} else {
|
|
4813
|
+
for (let i = 0; i < n; i++) {
|
|
4814
|
+
output.push(view[getter](offset, !big_endian));
|
|
4815
|
+
offset += size;
|
|
4816
|
+
}
|
|
4817
|
+
}
|
|
4818
|
+
}
|
|
4819
|
+
return output;
|
|
4820
|
+
}
|
|
4821
|
+
}
|
|
4822
|
+
const struct = new Struct();
|
|
4823
|
+
const DATATYPE_MSG = /* @__PURE__ */ new Map([
|
|
4824
|
+
["class_and_version", "B"],
|
|
4825
|
+
["class_bit_field_0", "B"],
|
|
4826
|
+
["class_bit_field_1", "B"],
|
|
4827
|
+
["class_bit_field_2", "B"],
|
|
4828
|
+
["size", "I"]
|
|
4829
|
+
]);
|
|
4830
|
+
_structure_size(DATATYPE_MSG);
|
|
4831
|
+
const B_LINK_NODE_V1 = /* @__PURE__ */ new Map([
|
|
4832
|
+
["signature", "4s"],
|
|
4833
|
+
["node_type", "B"],
|
|
4834
|
+
["node_level", "B"],
|
|
4835
|
+
["entries_used", "H"],
|
|
4836
|
+
["left_sibling", "Q"],
|
|
4837
|
+
["right_sibling", "Q"]
|
|
4838
|
+
]);
|
|
4839
|
+
_structure_size(B_LINK_NODE_V1);
|
|
4840
|
+
const B_LINK_NODE_V2 = /* @__PURE__ */ new Map([
|
|
4841
|
+
["signature", "4s"],
|
|
4842
|
+
["version", "B"],
|
|
4843
|
+
["node_type", "B"]
|
|
4844
|
+
]);
|
|
4845
|
+
_structure_size(B_LINK_NODE_V2);
|
|
4846
|
+
struct.unpack_from("8s", new Uint8Array([137, 72, 68, 70, 13, 10, 26, 10]).buffer)[0];
|
|
4847
|
+
struct.unpack_from("<Q", new Uint8Array([255, 255, 255, 255, 255, 255, 255, 255]).buffer)[0];
|
|
4848
|
+
const SUPERBLOCK_V0 = /* @__PURE__ */ new Map([
|
|
4849
|
+
["format_signature", "8s"],
|
|
4850
|
+
["superblock_version", "B"],
|
|
4851
|
+
["free_storage_version", "B"],
|
|
4852
|
+
["root_group_version", "B"],
|
|
4853
|
+
["reserved_0", "B"],
|
|
4854
|
+
["shared_header_version", "B"],
|
|
4855
|
+
["offset_size", "B"],
|
|
4856
|
+
["length_size", "B"],
|
|
4857
|
+
["reserved_1", "B"],
|
|
4858
|
+
["group_leaf_node_k", "H"],
|
|
4859
|
+
["group_internal_node_k", "H"],
|
|
4860
|
+
["file_consistency_flags", "L"],
|
|
4861
|
+
["base_address_lower", "Q"],
|
|
4862
|
+
["free_space_address", "Q"],
|
|
4863
|
+
["end_of_file_address", "Q"],
|
|
4864
|
+
["driver_information_address", "Q"]
|
|
4865
|
+
]);
|
|
4866
|
+
_structure_size(SUPERBLOCK_V0);
|
|
4867
|
+
const SUPERBLOCK_V2_V3 = /* @__PURE__ */ new Map([
|
|
4868
|
+
["format_signature", "8s"],
|
|
4869
|
+
["superblock_version", "B"],
|
|
4870
|
+
["offset_size", "B"],
|
|
4871
|
+
["length_size", "B"],
|
|
4872
|
+
["file_consistency_flags", "B"],
|
|
4873
|
+
["base_address", "Q"],
|
|
4874
|
+
["superblock_extension_address", "Q"],
|
|
4875
|
+
["end_of_file_address", "Q"],
|
|
4876
|
+
["root_group_address", "Q"],
|
|
4877
|
+
["superblock_checksum", "I"]
|
|
4878
|
+
]);
|
|
4879
|
+
_structure_size(SUPERBLOCK_V2_V3);
|
|
4880
|
+
const SYMBOL_TABLE_ENTRY = /* @__PURE__ */ new Map([
|
|
4881
|
+
["link_name_offset", "Q"],
|
|
4882
|
+
["object_header_address", "Q"],
|
|
4883
|
+
["cache_type", "I"],
|
|
4884
|
+
["reserved", "I"],
|
|
4885
|
+
["scratch", "16s"]
|
|
4886
|
+
]);
|
|
4887
|
+
_structure_size(SYMBOL_TABLE_ENTRY);
|
|
4888
|
+
const SYMBOL_TABLE_NODE = /* @__PURE__ */ new Map([
|
|
4889
|
+
["signature", "4s"],
|
|
4890
|
+
["version", "B"],
|
|
4891
|
+
["reserved_0", "B"],
|
|
4892
|
+
["symbols", "H"]
|
|
4893
|
+
]);
|
|
4894
|
+
_structure_size(SYMBOL_TABLE_NODE);
|
|
4895
|
+
const GLOBAL_HEAP_HEADER = /* @__PURE__ */ new Map([
|
|
4896
|
+
["signature", "4s"],
|
|
4897
|
+
["version", "B"],
|
|
4898
|
+
["reserved", "3s"],
|
|
4899
|
+
["collection_size", "Q"]
|
|
4900
|
+
]);
|
|
4901
|
+
_structure_size(GLOBAL_HEAP_HEADER);
|
|
4902
|
+
const GLOBAL_HEAP_OBJECT = /* @__PURE__ */ new Map([
|
|
4903
|
+
["object_index", "H"],
|
|
4904
|
+
["reference_count", "H"],
|
|
4905
|
+
["reserved", "I"],
|
|
4906
|
+
["object_size", "Q"]
|
|
4907
|
+
]);
|
|
4908
|
+
_structure_size(GLOBAL_HEAP_OBJECT);
|
|
4909
|
+
const OBJECT_HEADER_V1 = /* @__PURE__ */ new Map([
|
|
4910
|
+
["version", "B"],
|
|
4911
|
+
["reserved", "B"],
|
|
4912
|
+
["total_header_messages", "H"],
|
|
4913
|
+
["object_reference_count", "I"],
|
|
4914
|
+
["object_header_size", "I"],
|
|
4915
|
+
["padding", "I"]
|
|
4916
|
+
]);
|
|
4917
|
+
_structure_size(OBJECT_HEADER_V1);
|
|
4918
|
+
const OBJECT_HEADER_V2 = /* @__PURE__ */ new Map([
|
|
4919
|
+
["signature", "4s"],
|
|
4920
|
+
["version", "B"],
|
|
4921
|
+
["flags", "B"]
|
|
4922
|
+
]);
|
|
4923
|
+
_structure_size(OBJECT_HEADER_V2);
|
|
4924
|
+
const HEADER_MSG_INFO_V1 = /* @__PURE__ */ new Map([
|
|
4925
|
+
["type", "H"],
|
|
4926
|
+
["size", "H"],
|
|
4927
|
+
["flags", "B"],
|
|
4928
|
+
["reserved", "3s"]
|
|
4929
|
+
]);
|
|
4930
|
+
_structure_size(HEADER_MSG_INFO_V1);
|
|
4931
|
+
const HEADER_MSG_INFO_V2 = /* @__PURE__ */ new Map([
|
|
4932
|
+
["type", "B"],
|
|
4933
|
+
["size", "H"],
|
|
4934
|
+
["flags", "B"]
|
|
4935
|
+
]);
|
|
4936
|
+
_structure_size(HEADER_MSG_INFO_V2);
|
|
4937
|
+
const ATTR_MSG_HEADER_V1 = /* @__PURE__ */ new Map([
|
|
4938
|
+
["version", "B"],
|
|
4939
|
+
["reserved", "B"],
|
|
4940
|
+
["name_size", "H"],
|
|
4941
|
+
["datatype_size", "H"],
|
|
4942
|
+
["dataspace_size", "H"]
|
|
4943
|
+
]);
|
|
4944
|
+
_structure_size(ATTR_MSG_HEADER_V1);
|
|
4945
|
+
const ATTR_MSG_HEADER_V3 = /* @__PURE__ */ new Map([
|
|
4946
|
+
["version", "B"],
|
|
4947
|
+
["flags", "B"],
|
|
4948
|
+
["name_size", "H"],
|
|
4949
|
+
["datatype_size", "H"],
|
|
4950
|
+
["dataspace_size", "H"],
|
|
4951
|
+
["character_set_encoding", "B"]
|
|
4952
|
+
]);
|
|
4953
|
+
_structure_size(ATTR_MSG_HEADER_V3);
|
|
4954
|
+
const DATASPACE_MSG_HEADER_V1 = /* @__PURE__ */ new Map([
|
|
4955
|
+
["version", "B"],
|
|
4956
|
+
["dimensionality", "B"],
|
|
4957
|
+
["flags", "B"],
|
|
4958
|
+
["reserved_0", "B"],
|
|
4959
|
+
["reserved_1", "I"]
|
|
4960
|
+
]);
|
|
4961
|
+
_structure_size(DATASPACE_MSG_HEADER_V1);
|
|
4962
|
+
const DATASPACE_MSG_HEADER_V2 = /* @__PURE__ */ new Map([
|
|
4963
|
+
["version", "B"],
|
|
4964
|
+
["dimensionality", "B"],
|
|
4965
|
+
["flags", "B"],
|
|
4966
|
+
["type", "B"]
|
|
4967
|
+
]);
|
|
4968
|
+
_structure_size(DATASPACE_MSG_HEADER_V2);
|
|
4969
|
+
const FILLVAL_MSG_V1V2 = /* @__PURE__ */ new Map([
|
|
4970
|
+
["version", "B"],
|
|
4971
|
+
["space_allocation_time", "B"],
|
|
4972
|
+
["fillvalue_write_time", "B"],
|
|
4973
|
+
["fillvalue_defined", "B"]
|
|
4974
|
+
]);
|
|
4975
|
+
_structure_size(FILLVAL_MSG_V1V2);
|
|
4976
|
+
const FILLVAL_MSG_V3 = /* @__PURE__ */ new Map([
|
|
4977
|
+
["version", "B"],
|
|
4978
|
+
["flags", "B"]
|
|
4979
|
+
]);
|
|
4980
|
+
_structure_size(FILLVAL_MSG_V3);
|
|
4981
|
+
const FILTER_PIPELINE_DESCR_V1 = /* @__PURE__ */ new Map([
|
|
4982
|
+
["filter_id", "H"],
|
|
4983
|
+
["name_length", "H"],
|
|
4984
|
+
["flags", "H"],
|
|
4985
|
+
["client_data_values", "H"]
|
|
4986
|
+
]);
|
|
4987
|
+
_structure_size(FILTER_PIPELINE_DESCR_V1);
|
|
4988
|
+
const GLOBAL_HEAP_ID = /* @__PURE__ */ new Map([
|
|
4989
|
+
["collection_address", "Q"],
|
|
4990
|
+
["object_index", "I"]
|
|
4991
|
+
]);
|
|
4992
|
+
_structure_size(GLOBAL_HEAP_ID);
|
|
4993
|
+
let table = new Uint8Array(128);
|
|
4994
|
+
for (let i = 0; i < 64; i++) {
|
|
4995
|
+
table[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i * 4 - 205] = i;
|
|
4996
|
+
}
|
|
4649
4997
|
async function relaxedFetch(...args) {
|
|
4650
4998
|
const response = await fetch(...args);
|
|
4651
4999
|
if (response.status === 403) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/config",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"zarrita": "0.7.5",
|
|
20
20
|
"@zarrita/storage": "0.2.0",
|
|
21
21
|
"fetch-jsonp": "^1.4.0",
|
|
22
|
-
"@vitessce/
|
|
23
|
-
"@vitessce/
|
|
24
|
-
"@vitessce/
|
|
25
|
-
"@vitessce/
|
|
22
|
+
"@vitessce/constants-internal": "4.2.1",
|
|
23
|
+
"@vitessce/utils": "4.2.1",
|
|
24
|
+
"@vitessce/globals": "4.2.1",
|
|
25
|
+
"@vitessce/zarr-utils": "4.2.1"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"bundle": "pnpm exec vite build -c ../../scripts/vite.config.mjs",
|