@vitessce/spatial-utils 3.3.1 → 3.3.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/{deflate-d62c010f.js → deflate-f0db96f7.js} +1 -1
- package/dist/{index-27c044ac.js → index-20c94d37.js} +155 -182
- package/dist/index.js +1 -1
- package/dist/{jpeg-780f2a29.js → jpeg-a983c5fa.js} +1 -1
- package/dist/{lerc-11712e42.js → lerc-302d4191.js} +1 -1
- package/dist/{lzw-a22317ac.js → lzw-e7880394.js} +1 -1
- package/dist/{packbits-757ef203.js → packbits-17057e1d.js} +1 -1
- package/dist/{raw-7e5381d5.js → raw-e5bd3ae5.js} +1 -1
- package/dist/{webimage-ec283d98.js → webimage-c3b216cf.js} +1 -1
- package/dist-tsc/load-ome-zarr.d.ts +1 -1
- package/dist-tsc/load-ome-zarr.d.ts.map +1 -1
- package/dist-tsc/load-ome-zarr.js +2 -3
- package/package.json +4 -4
- package/src/load-ome-zarr.js +2 -3
|
@@ -22,11 +22,7 @@ var __privateSet = (obj, member, value, setter2) => {
|
|
|
22
22
|
setter2 ? setter2.call(obj, value) : member.set(obj, value);
|
|
23
23
|
return value;
|
|
24
24
|
};
|
|
25
|
-
var
|
|
26
|
-
__accessCheck(obj, member, "access private method");
|
|
27
|
-
return method;
|
|
28
|
-
};
|
|
29
|
-
var _bytes, _encoder, _encode_buffer, _strides, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _shape2, _strides2, _metadata, _metadata2, _a2, _b, _overrides, _use_suffix_request, _merge_init, merge_init_fn;
|
|
25
|
+
var _bytes, _encoder, _encode_buffer, _strides, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _shape2, _strides2, _metadata, _metadata2, _a2, _b;
|
|
30
26
|
import "react";
|
|
31
27
|
function _mergeNamespaces(n3, m) {
|
|
32
28
|
for (var i2 = 0; i2 < m.length; i2++) {
|
|
@@ -50,9 +46,9 @@ function _mergeNamespaces(n3, m) {
|
|
|
50
46
|
var freeGlobal$1 = typeof global == "object" && global && global.Object === Object && global;
|
|
51
47
|
const freeGlobal$2 = freeGlobal$1;
|
|
52
48
|
var freeSelf$1 = typeof self == "object" && self && self.Object === Object && self;
|
|
53
|
-
var root$
|
|
54
|
-
const root$
|
|
55
|
-
var Symbol$1 = root$
|
|
49
|
+
var root$1 = freeGlobal$2 || freeSelf$1 || Function("return this")();
|
|
50
|
+
const root$2 = root$1;
|
|
51
|
+
var Symbol$1 = root$2.Symbol;
|
|
56
52
|
const Symbol$2 = Symbol$1;
|
|
57
53
|
var objectProto$f = Object.prototype;
|
|
58
54
|
var hasOwnProperty$e = objectProto$f.hasOwnProperty;
|
|
@@ -155,7 +151,7 @@ function isFunction$3(value) {
|
|
|
155
151
|
var tag2 = baseGetTag(value);
|
|
156
152
|
return tag2 == funcTag$2 || tag2 == genTag$1 || tag2 == asyncTag || tag2 == proxyTag;
|
|
157
153
|
}
|
|
158
|
-
var coreJsData = root$
|
|
154
|
+
var coreJsData = root$2["__core-js_shared__"];
|
|
159
155
|
const coreJsData$1 = coreJsData;
|
|
160
156
|
var maskSrcKey = function() {
|
|
161
157
|
var uid2 = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
|
|
@@ -201,7 +197,7 @@ function getNative(object2, key) {
|
|
|
201
197
|
var value = getValue$1(object2, key);
|
|
202
198
|
return baseIsNative(value) ? value : void 0;
|
|
203
199
|
}
|
|
204
|
-
var WeakMap$1 = getNative(root$
|
|
200
|
+
var WeakMap$1 = getNative(root$2, "WeakMap");
|
|
205
201
|
const WeakMap$2 = WeakMap$1;
|
|
206
202
|
var objectCreate = Object.create;
|
|
207
203
|
var baseCreate = function() {
|
|
@@ -343,7 +339,7 @@ function stubFalse() {
|
|
|
343
339
|
var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
344
340
|
var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
|
|
345
341
|
var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
|
|
346
|
-
var Buffer$3 = moduleExports$2 ? root$
|
|
342
|
+
var Buffer$3 = moduleExports$2 ? root$2.Buffer : void 0;
|
|
347
343
|
var nativeIsBuffer = Buffer$3 ? Buffer$3.isBuffer : void 0;
|
|
348
344
|
var isBuffer$3 = nativeIsBuffer || stubFalse;
|
|
349
345
|
const isBuffer$4 = isBuffer$3;
|
|
@@ -550,7 +546,7 @@ ListCache.prototype["delete"] = listCacheDelete;
|
|
|
550
546
|
ListCache.prototype.get = listCacheGet;
|
|
551
547
|
ListCache.prototype.has = listCacheHas;
|
|
552
548
|
ListCache.prototype.set = listCacheSet;
|
|
553
|
-
var Map$1 = getNative(root$
|
|
549
|
+
var Map$1 = getNative(root$2, "Map");
|
|
554
550
|
const Map$2 = Map$1;
|
|
555
551
|
function mapCacheClear() {
|
|
556
552
|
this.size = 0;
|
|
@@ -656,7 +652,7 @@ function baseAssignIn(object2, source) {
|
|
|
656
652
|
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
657
653
|
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
658
654
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
659
|
-
var Buffer$2 = moduleExports ? root$
|
|
655
|
+
var Buffer$2 = moduleExports ? root$2.Buffer : void 0, allocUnsafe = Buffer$2 ? Buffer$2.allocUnsafe : void 0;
|
|
660
656
|
function cloneBuffer(buffer2, isDeep) {
|
|
661
657
|
if (isDeep) {
|
|
662
658
|
return buffer2.slice();
|
|
@@ -717,11 +713,11 @@ function getAllKeys(object2) {
|
|
|
717
713
|
function getAllKeysIn(object2) {
|
|
718
714
|
return baseGetAllKeys(object2, keysIn, getSymbolsIn$1);
|
|
719
715
|
}
|
|
720
|
-
var DataView$1 = getNative(root$
|
|
716
|
+
var DataView$1 = getNative(root$2, "DataView");
|
|
721
717
|
const DataView$2 = DataView$1;
|
|
722
|
-
var Promise$1 = getNative(root$
|
|
718
|
+
var Promise$1 = getNative(root$2, "Promise");
|
|
723
719
|
const Promise$2 = Promise$1;
|
|
724
|
-
var Set$1 = getNative(root$
|
|
720
|
+
var Set$1 = getNative(root$2, "Set");
|
|
725
721
|
const Set$2 = Set$1;
|
|
726
722
|
var mapTag$4 = "[object Map]", objectTag$2 = "[object Object]", promiseTag = "[object Promise]", setTag$4 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
|
|
727
723
|
var dataViewTag$3 = "[object DataView]";
|
|
@@ -758,7 +754,7 @@ function initCloneArray(array) {
|
|
|
758
754
|
}
|
|
759
755
|
return result;
|
|
760
756
|
}
|
|
761
|
-
var Uint8Array$1 = root$
|
|
757
|
+
var Uint8Array$1 = root$2.Uint8Array;
|
|
762
758
|
const Uint8Array$2 = Uint8Array$1;
|
|
763
759
|
function cloneArrayBuffer(arrayBuffer2) {
|
|
764
760
|
var result = new arrayBuffer2.constructor(arrayBuffer2.byteLength);
|
|
@@ -9254,7 +9250,7 @@ function clone$6(obj) {
|
|
|
9254
9250
|
Decimal2.log = log$5;
|
|
9255
9251
|
Decimal2.log10 = log10;
|
|
9256
9252
|
Decimal2.log2 = log2$1;
|
|
9257
|
-
Decimal2.max = max;
|
|
9253
|
+
Decimal2.max = max$1;
|
|
9258
9254
|
Decimal2.min = min;
|
|
9259
9255
|
Decimal2.mod = mod$2;
|
|
9260
9256
|
Decimal2.mul = mul;
|
|
@@ -9325,7 +9321,7 @@ function log2$1(x2) {
|
|
|
9325
9321
|
function log10(x2) {
|
|
9326
9322
|
return new this(x2).log(10);
|
|
9327
9323
|
}
|
|
9328
|
-
function max() {
|
|
9324
|
+
function max$1() {
|
|
9329
9325
|
return maxOrMin(this, arguments, "lt");
|
|
9330
9326
|
}
|
|
9331
9327
|
function min() {
|
|
@@ -28572,7 +28568,9 @@ const FileType$1 = {
|
|
|
28572
28568
|
OBS_SEGMENTATIONS_JSON: "obsSegmentations.json",
|
|
28573
28569
|
OBS_SETS_CSV: "obsSets.csv",
|
|
28574
28570
|
OBS_SETS_JSON: "obsSets.json",
|
|
28571
|
+
// OME-Zarr
|
|
28575
28572
|
IMAGE_OME_ZARR: "image.ome-zarr",
|
|
28573
|
+
OBS_SEGMENTATIONS_OME_ZARR: "obsSegmentations.ome-zarr",
|
|
28576
28574
|
// AnnData
|
|
28577
28575
|
OBS_FEATURE_MATRIX_ANNDATA_ZARR: "obsFeatureMatrix.anndata.zarr",
|
|
28578
28576
|
OBS_SETS_ANNDATA_ZARR: "obsSets.anndata.zarr",
|
|
@@ -29025,30 +29023,39 @@ const omeCoordinateTransformations = z.array(z.union([
|
|
|
29025
29023
|
scale: z.array(z.number())
|
|
29026
29024
|
})
|
|
29027
29025
|
]));
|
|
29028
|
-
z.object({
|
|
29026
|
+
const imageOmeTiffSchema = z.object({
|
|
29029
29027
|
offsetsUrl: z.string().optional(),
|
|
29030
29028
|
coordinateTransformations: omeCoordinateTransformations.optional()
|
|
29031
29029
|
});
|
|
29030
|
+
imageOmeTiffSchema.extend({
|
|
29031
|
+
obsTypesFromChannelNames: z.boolean().optional()
|
|
29032
|
+
});
|
|
29032
29033
|
const imageOmeZarrSchema = z.object({
|
|
29033
29034
|
coordinateTransformations: omeCoordinateTransformations.optional()
|
|
29034
29035
|
});
|
|
29035
29036
|
imageOmeZarrSchema.extend({
|
|
29037
|
+
obsTypesFromChannelNames: z.boolean().optional()
|
|
29038
|
+
});
|
|
29039
|
+
const imageSpatialdataSchema = imageOmeZarrSchema.extend({
|
|
29036
29040
|
path: z.string()
|
|
29037
29041
|
});
|
|
29038
|
-
z.object({
|
|
29042
|
+
const obsSegmentationsSpatialdataSchema = z.object({
|
|
29043
|
+
// TODO: should this also extend the imageOmeZarrSchema?
|
|
29044
|
+
// TODO: should this be renamed labelsSpatialdataSchema?
|
|
29045
|
+
// TODO: support obsTypesFromChannelNames?
|
|
29039
29046
|
path: z.string()
|
|
29040
29047
|
});
|
|
29041
29048
|
z.object({
|
|
29042
29049
|
path: z.string()
|
|
29043
29050
|
});
|
|
29044
|
-
z.object({
|
|
29051
|
+
const obsSpotsSpatialdataSchema = z.object({
|
|
29045
29052
|
path: z.string(),
|
|
29046
29053
|
tablePath: z.string().optional().describe("The path to a table which annotates the spots. If available but not specified, the spot identifiers may not be aligned with associated tabular data as expected.")
|
|
29047
29054
|
});
|
|
29048
|
-
annDataObsFeatureMatrix.extend({
|
|
29055
|
+
const obsFeatureMatrixSpatialdataSchema = annDataObsFeatureMatrix.extend({
|
|
29049
29056
|
region: z.string().describe("The name of a region to use to filter instances (i.e., rows) in the table").optional()
|
|
29050
29057
|
});
|
|
29051
|
-
z.object({
|
|
29058
|
+
const obsSetsSpatialdataSchema = z.object({
|
|
29052
29059
|
region: z.string().describe("The name of a region to use to filter instances (i.e., rows) in the table").optional(),
|
|
29053
29060
|
tablePath: z.string().optional().describe("The path to a table which contains the index for the set values."),
|
|
29054
29061
|
obsSets: annDataObsSets
|
|
@@ -29111,6 +29118,19 @@ z.object({
|
|
|
29111
29118
|
z.array(annDataConvenienceObsEmbeddingItem)
|
|
29112
29119
|
])
|
|
29113
29120
|
}).partial();
|
|
29121
|
+
z.object({
|
|
29122
|
+
// TODO: should `image` be a special schema
|
|
29123
|
+
// to allow specifying fileUid (like for embeddingType)?
|
|
29124
|
+
image: imageSpatialdataSchema,
|
|
29125
|
+
// TODO: should this be a special schema
|
|
29126
|
+
// to allow specifying fileUid (like for embeddingType)?
|
|
29127
|
+
labels: obsSegmentationsSpatialdataSchema,
|
|
29128
|
+
obsFeatureMatrix: obsFeatureMatrixSpatialdataSchema,
|
|
29129
|
+
obsSpots: obsSpotsSpatialdataSchema,
|
|
29130
|
+
// TODO: obsPoints
|
|
29131
|
+
// TODO: obsLocations
|
|
29132
|
+
obsSets: obsSetsSpatialdataSchema
|
|
29133
|
+
}).partial();
|
|
29114
29134
|
z.object({
|
|
29115
29135
|
obsLabelsTypes: z.array(z.string()).optional(),
|
|
29116
29136
|
embeddingTypes: z.array(z.string()).optional()
|
|
@@ -35464,10 +35484,10 @@ var json2csv_umd = { exports: {} };
|
|
|
35464
35484
|
value: function promise() {
|
|
35465
35485
|
var _this = this;
|
|
35466
35486
|
var returnCSV = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
35467
|
-
return new Promise(function(
|
|
35487
|
+
return new Promise(function(resolve, reject) {
|
|
35468
35488
|
if (!returnCSV) {
|
|
35469
35489
|
_this.processor.on("finish", function() {
|
|
35470
|
-
return
|
|
35490
|
+
return resolve();
|
|
35471
35491
|
}).on("error", function(err2) {
|
|
35472
35492
|
return reject(err2);
|
|
35473
35493
|
});
|
|
@@ -35477,7 +35497,7 @@ var json2csv_umd = { exports: {} };
|
|
|
35477
35497
|
_this.processor.on("data", function(chunk) {
|
|
35478
35498
|
return csvBuffer.push(chunk.toString());
|
|
35479
35499
|
}).on("finish", function() {
|
|
35480
|
-
return
|
|
35500
|
+
return resolve(fastJoin$3(csvBuffer, ""));
|
|
35481
35501
|
}).on("error", function(err2) {
|
|
35482
35502
|
return reject(err2);
|
|
35483
35503
|
});
|
|
@@ -35726,8 +35746,8 @@ class WorkerJob {
|
|
|
35726
35746
|
});
|
|
35727
35747
|
this.name = jobName;
|
|
35728
35748
|
this.workerThread = workerThread;
|
|
35729
|
-
this.result = new Promise((
|
|
35730
|
-
this._resolve =
|
|
35749
|
+
this.result = new Promise((resolve, reject) => {
|
|
35750
|
+
this._resolve = resolve;
|
|
35731
35751
|
this._reject = reject;
|
|
35732
35752
|
});
|
|
35733
35753
|
}
|
|
@@ -36624,8 +36644,8 @@ class RequestScheduler {
|
|
|
36624
36644
|
priority: 0,
|
|
36625
36645
|
getPriority
|
|
36626
36646
|
};
|
|
36627
|
-
const promise = new Promise((
|
|
36628
|
-
request.resolve =
|
|
36647
|
+
const promise = new Promise((resolve) => {
|
|
36648
|
+
request.resolve = resolve;
|
|
36629
36649
|
return request;
|
|
36630
36650
|
});
|
|
36631
36651
|
this.requestQueue.push(request);
|
|
@@ -36636,7 +36656,7 @@ class RequestScheduler {
|
|
|
36636
36656
|
_issueRequest(request) {
|
|
36637
36657
|
const {
|
|
36638
36658
|
handle,
|
|
36639
|
-
resolve
|
|
36659
|
+
resolve
|
|
36640
36660
|
} = request;
|
|
36641
36661
|
let isDone = false;
|
|
36642
36662
|
const done = () => {
|
|
@@ -36648,7 +36668,7 @@ class RequestScheduler {
|
|
|
36648
36668
|
}
|
|
36649
36669
|
};
|
|
36650
36670
|
this.activeRequestCount++;
|
|
36651
|
-
return
|
|
36671
|
+
return resolve ? resolve({
|
|
36652
36672
|
done
|
|
36653
36673
|
}) : Promise.resolve({
|
|
36654
36674
|
done
|
|
@@ -36850,11 +36870,11 @@ async function getInitialDataUrl(resource) {
|
|
|
36850
36870
|
}
|
|
36851
36871
|
if (resource instanceof Blob) {
|
|
36852
36872
|
const blobSlice = resource.slice(0, 5);
|
|
36853
|
-
return await new Promise((
|
|
36873
|
+
return await new Promise((resolve) => {
|
|
36854
36874
|
const reader = new FileReader();
|
|
36855
36875
|
reader.onload = (event) => {
|
|
36856
36876
|
var _event$target;
|
|
36857
|
-
return
|
|
36877
|
+
return resolve(event === null || event === void 0 ? void 0 : (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.result);
|
|
36858
36878
|
};
|
|
36859
36879
|
reader.readAsDataURL(blobSlice);
|
|
36860
36880
|
});
|
|
@@ -38221,9 +38241,9 @@ async function loadToImage(url, options) {
|
|
|
38221
38241
|
await image2.decode();
|
|
38222
38242
|
return image2;
|
|
38223
38243
|
}
|
|
38224
|
-
return await new Promise((
|
|
38244
|
+
return await new Promise((resolve, reject) => {
|
|
38225
38245
|
try {
|
|
38226
|
-
image2.onload = () =>
|
|
38246
|
+
image2.onload = () => resolve(image2);
|
|
38227
38247
|
image2.onerror = (err2) => reject(new Error("Could not load image ".concat(url, ": ").concat(err2)));
|
|
38228
38248
|
} catch (error2) {
|
|
38229
38249
|
reject(error2);
|
|
@@ -41526,10 +41546,10 @@ let pathPrefix = "";
|
|
|
41526
41546
|
function loadImage$1(url, opts2) {
|
|
41527
41547
|
assert$7(typeof url === "string");
|
|
41528
41548
|
url = pathPrefix + url;
|
|
41529
|
-
return new Promise((
|
|
41549
|
+
return new Promise((resolve, reject) => {
|
|
41530
41550
|
try {
|
|
41531
41551
|
const image2 = new Image();
|
|
41532
|
-
image2.onload = () =>
|
|
41552
|
+
image2.onload = () => resolve(image2);
|
|
41533
41553
|
image2.onerror = () => reject(new Error("Could not load image ".concat(url, ".")));
|
|
41534
41554
|
image2.crossOrigin = opts2 && opts2.crossOrigin || "anonymous";
|
|
41535
41555
|
image2.src = url;
|
|
@@ -44037,10 +44057,10 @@ class Query extends Resource$1 {
|
|
|
44037
44057
|
return this._pollingPromise;
|
|
44038
44058
|
}
|
|
44039
44059
|
let counter2 = 0;
|
|
44040
|
-
this._pollingPromise = new Promise((
|
|
44060
|
+
this._pollingPromise = new Promise((resolve, reject) => {
|
|
44041
44061
|
const poll = () => {
|
|
44042
44062
|
if (this.isResultAvailable()) {
|
|
44043
|
-
|
|
44063
|
+
resolve(this.getResult());
|
|
44044
44064
|
this._pollingPromise = null;
|
|
44045
44065
|
} else if (counter2++ > limit) {
|
|
44046
44066
|
reject("Timed out");
|
|
@@ -45234,8 +45254,8 @@ class AnimationLoop {
|
|
|
45234
45254
|
waitForRender() {
|
|
45235
45255
|
this.setNeedsRedraw("waitForRender");
|
|
45236
45256
|
if (!this._nextFramePromise) {
|
|
45237
|
-
this._nextFramePromise = new Promise((
|
|
45238
|
-
this._resolveNextFrame =
|
|
45257
|
+
this._nextFramePromise = new Promise((resolve) => {
|
|
45258
|
+
this._resolveNextFrame = resolve;
|
|
45239
45259
|
});
|
|
45240
45260
|
}
|
|
45241
45261
|
return this._nextFramePromise;
|
|
@@ -45282,13 +45302,13 @@ class AnimationLoop {
|
|
|
45282
45302
|
}
|
|
45283
45303
|
_getPageLoadPromise() {
|
|
45284
45304
|
if (!this._pageLoadPromise) {
|
|
45285
|
-
this._pageLoadPromise = isPage ? new Promise((
|
|
45305
|
+
this._pageLoadPromise = isPage ? new Promise((resolve, reject) => {
|
|
45286
45306
|
if (isPage && document.readyState === "complete") {
|
|
45287
|
-
|
|
45307
|
+
resolve(document);
|
|
45288
45308
|
return;
|
|
45289
45309
|
}
|
|
45290
45310
|
window.addEventListener("load", () => {
|
|
45291
|
-
|
|
45311
|
+
resolve(document);
|
|
45292
45312
|
});
|
|
45293
45313
|
}) : Promise.resolve({});
|
|
45294
45314
|
}
|
|
@@ -85681,14 +85701,14 @@ function initializeBasisTrascoderModule(BasisModule, wasmBinary) {
|
|
|
85681
85701
|
if (wasmBinary) {
|
|
85682
85702
|
options.wasmBinary = wasmBinary;
|
|
85683
85703
|
}
|
|
85684
|
-
return new Promise((
|
|
85704
|
+
return new Promise((resolve) => {
|
|
85685
85705
|
BasisModule(options).then((module2) => {
|
|
85686
85706
|
const {
|
|
85687
85707
|
BasisFile,
|
|
85688
85708
|
initializeBasis
|
|
85689
85709
|
} = module2;
|
|
85690
85710
|
initializeBasis();
|
|
85691
|
-
|
|
85711
|
+
resolve({
|
|
85692
85712
|
BasisFile
|
|
85693
85713
|
});
|
|
85694
85714
|
});
|
|
@@ -85715,7 +85735,7 @@ function initializeBasisEncoderModule(BasisEncoderModule, wasmBinary) {
|
|
|
85715
85735
|
if (wasmBinary) {
|
|
85716
85736
|
options.wasmBinary = wasmBinary;
|
|
85717
85737
|
}
|
|
85718
|
-
return new Promise((
|
|
85738
|
+
return new Promise((resolve) => {
|
|
85719
85739
|
BasisEncoderModule(options).then((module2) => {
|
|
85720
85740
|
const {
|
|
85721
85741
|
BasisFile,
|
|
@@ -85724,7 +85744,7 @@ function initializeBasisEncoderModule(BasisEncoderModule, wasmBinary) {
|
|
|
85724
85744
|
BasisEncoder
|
|
85725
85745
|
} = module2;
|
|
85726
85746
|
initializeBasis();
|
|
85727
|
-
|
|
85747
|
+
resolve({
|
|
85728
85748
|
BasisFile,
|
|
85729
85749
|
KTX2File,
|
|
85730
85750
|
BasisEncoder
|
|
@@ -87578,10 +87598,10 @@ function initializeDracoDecoder(DracoDecoderModule, wasmBinary) {
|
|
|
87578
87598
|
if (wasmBinary) {
|
|
87579
87599
|
options.wasmBinary = wasmBinary;
|
|
87580
87600
|
}
|
|
87581
|
-
return new Promise((
|
|
87601
|
+
return new Promise((resolve) => {
|
|
87582
87602
|
DracoDecoderModule({
|
|
87583
87603
|
...options,
|
|
87584
|
-
onModuleLoaded: (draco) =>
|
|
87604
|
+
onModuleLoaded: (draco) => resolve({
|
|
87585
87605
|
draco
|
|
87586
87606
|
})
|
|
87587
87607
|
});
|
|
@@ -88795,7 +88815,7 @@ async function waitForGLTFAssets(gltfObjects) {
|
|
|
88795
88815
|
}
|
|
88796
88816
|
async function waitWhileCondition(condition) {
|
|
88797
88817
|
while (condition()) {
|
|
88798
|
-
await new Promise((
|
|
88818
|
+
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
88799
88819
|
}
|
|
88800
88820
|
}
|
|
88801
88821
|
const vs$6 = "#version 300 es\n\n// Instance attributes\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\n\n// Uniforms\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\n\n// Attributes\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\n\n// Varying\nout vec4 vColor;\n\n// MODULE_PBR contains all the varying definitions needed\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\n\n// Main\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n vec3 normal = vec3(0.0, 0.0, 1.0);\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n normal = instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz;\n #endif\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n // using instancePositions as world coordinates\n // when using globe mode, this branch does not re-orient the model to align with the surface of the earth\n // call project_normal before setting position to avoid rotation\n geometry.normal = project_normal(normal);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n geometry.normal = project_normal(normal);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n // set PBR data\n pbr_vPosition = geometry.position.xyz;\n #ifdef HAS_NORMALS\n pbr_vNormal = geometry.normal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n";
|
|
@@ -91220,12 +91240,12 @@ class Tileset3D {
|
|
|
91220
91240
|
this.lastUpdatedVieports = viewports;
|
|
91221
91241
|
}
|
|
91222
91242
|
if (!this.updatePromise) {
|
|
91223
|
-
this.updatePromise = new Promise((
|
|
91243
|
+
this.updatePromise = new Promise((resolve) => {
|
|
91224
91244
|
setTimeout(() => {
|
|
91225
91245
|
if (this.lastUpdatedVieports) {
|
|
91226
91246
|
this.doUpdate(this.lastUpdatedVieports);
|
|
91227
91247
|
}
|
|
91228
|
-
|
|
91248
|
+
resolve(this._frameNumber);
|
|
91229
91249
|
this.updatePromise = null;
|
|
91230
91250
|
}, this.options.debounceTime);
|
|
91231
91251
|
});
|
|
@@ -116237,7 +116257,7 @@ function unwrapListeners(arr) {
|
|
|
116237
116257
|
return ret;
|
|
116238
116258
|
}
|
|
116239
116259
|
function once2(emitter, name2) {
|
|
116240
|
-
return new Promise(function(
|
|
116260
|
+
return new Promise(function(resolve, reject) {
|
|
116241
116261
|
function errorListener(err2) {
|
|
116242
116262
|
emitter.removeListener(name2, resolver);
|
|
116243
116263
|
reject(err2);
|
|
@@ -116246,7 +116266,7 @@ function once2(emitter, name2) {
|
|
|
116246
116266
|
if (typeof emitter.removeListener === "function") {
|
|
116247
116267
|
emitter.removeListener("error", errorListener);
|
|
116248
116268
|
}
|
|
116249
|
-
|
|
116269
|
+
resolve([].slice.call(arguments));
|
|
116250
116270
|
}
|
|
116251
116271
|
eventTargetAgnosticAddListener(emitter, name2, resolver, { once: true });
|
|
116252
116272
|
if (name2 !== "error") {
|
|
@@ -124849,12 +124869,12 @@ var reIsOctal = /^0o[0-7]+$/i;
|
|
|
124849
124869
|
var freeParseInt = parseInt;
|
|
124850
124870
|
var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
124851
124871
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
124852
|
-
var root
|
|
124872
|
+
var root = freeGlobal || freeSelf || Function("return this")();
|
|
124853
124873
|
var objectProto = Object.prototype;
|
|
124854
124874
|
var objectToString = objectProto.toString;
|
|
124855
124875
|
var nativeMax = Math.max, nativeMin = Math.min;
|
|
124856
124876
|
var now = function() {
|
|
124857
|
-
return root
|
|
124877
|
+
return root.Date.now();
|
|
124858
124878
|
};
|
|
124859
124879
|
function debounce(func, wait, options) {
|
|
124860
124880
|
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
@@ -133567,16 +133587,16 @@ function addDecoder(cases, importFn) {
|
|
|
133567
133587
|
}
|
|
133568
133588
|
cases.forEach((c) => registry$2.set(c, importFn));
|
|
133569
133589
|
}
|
|
133570
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
133571
|
-
addDecoder(5, () => import("./lzw-
|
|
133590
|
+
addDecoder([void 0, 1], () => import("./raw-e5bd3ae5.js").then((m) => m.default));
|
|
133591
|
+
addDecoder(5, () => import("./lzw-e7880394.js").then((m) => m.default));
|
|
133572
133592
|
addDecoder(6, () => {
|
|
133573
133593
|
throw new Error("old style JPEG compression is not supported.");
|
|
133574
133594
|
});
|
|
133575
|
-
addDecoder(7, () => import("./jpeg-
|
|
133576
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
133577
|
-
addDecoder(32773, () => import("./packbits-
|
|
133578
|
-
addDecoder(34887, () => import("./lerc-
|
|
133579
|
-
addDecoder(50001, () => import("./webimage-
|
|
133595
|
+
addDecoder(7, () => import("./jpeg-a983c5fa.js").then((m) => m.default));
|
|
133596
|
+
addDecoder([8, 32946], () => import("./deflate-f0db96f7.js").then((m) => m.default));
|
|
133597
|
+
addDecoder(32773, () => import("./packbits-17057e1d.js").then((m) => m.default));
|
|
133598
|
+
addDecoder(34887, () => import("./lerc-302d4191.js").then((m) => m.default));
|
|
133599
|
+
addDecoder(50001, () => import("./webimage-c3b216cf.js").then((m) => m.default));
|
|
133580
133600
|
function decodeRowAcc(row, stride) {
|
|
133581
133601
|
let length2 = row.length - stride;
|
|
133582
133602
|
let offset = 0;
|
|
@@ -135263,11 +135283,11 @@ var pFinally = (promise, onFinally) => {
|
|
|
135263
135283
|
onFinally = onFinally || (() => {
|
|
135264
135284
|
});
|
|
135265
135285
|
return promise.then(
|
|
135266
|
-
(val) => new Promise((
|
|
135267
|
-
|
|
135286
|
+
(val) => new Promise((resolve) => {
|
|
135287
|
+
resolve(onFinally());
|
|
135268
135288
|
}).then(() => val),
|
|
135269
|
-
(err2) => new Promise((
|
|
135270
|
-
|
|
135289
|
+
(err2) => new Promise((resolve) => {
|
|
135290
|
+
resolve(onFinally());
|
|
135271
135291
|
}).then(() => {
|
|
135272
135292
|
throw err2;
|
|
135273
135293
|
})
|
|
@@ -135279,18 +135299,18 @@ class TimeoutError extends Error {
|
|
|
135279
135299
|
this.name = "TimeoutError";
|
|
135280
135300
|
}
|
|
135281
135301
|
}
|
|
135282
|
-
const pTimeout = (promise, milliseconds, fallback) => new Promise((
|
|
135302
|
+
const pTimeout = (promise, milliseconds, fallback) => new Promise((resolve, reject) => {
|
|
135283
135303
|
if (typeof milliseconds !== "number" || milliseconds < 0) {
|
|
135284
135304
|
throw new TypeError("Expected `milliseconds` to be a positive number");
|
|
135285
135305
|
}
|
|
135286
135306
|
if (milliseconds === Infinity) {
|
|
135287
|
-
|
|
135307
|
+
resolve(promise);
|
|
135288
135308
|
return;
|
|
135289
135309
|
}
|
|
135290
135310
|
const timer = setTimeout(() => {
|
|
135291
135311
|
if (typeof fallback === "function") {
|
|
135292
135312
|
try {
|
|
135293
|
-
|
|
135313
|
+
resolve(fallback());
|
|
135294
135314
|
} catch (error2) {
|
|
135295
135315
|
reject(error2);
|
|
135296
135316
|
}
|
|
@@ -135305,7 +135325,7 @@ const pTimeout = (promise, milliseconds, fallback) => new Promise((resolve2, rej
|
|
|
135305
135325
|
}, milliseconds);
|
|
135306
135326
|
pFinally(
|
|
135307
135327
|
// eslint-disable-next-line promise/prefer-await-to-then
|
|
135308
|
-
promise.then(
|
|
135328
|
+
promise.then(resolve, reject),
|
|
135309
135329
|
() => {
|
|
135310
135330
|
clearTimeout(timer);
|
|
135311
135331
|
}
|
|
@@ -144882,22 +144902,40 @@ function extent(values, valueof) {
|
|
|
144882
144902
|
}
|
|
144883
144903
|
return [min2, max2];
|
|
144884
144904
|
}
|
|
144905
|
+
function max(values, valueof) {
|
|
144906
|
+
let max2;
|
|
144907
|
+
if (valueof === void 0) {
|
|
144908
|
+
for (const value of values) {
|
|
144909
|
+
if (value != null && (max2 < value || max2 === void 0 && value >= value)) {
|
|
144910
|
+
max2 = value;
|
|
144911
|
+
}
|
|
144912
|
+
}
|
|
144913
|
+
} else {
|
|
144914
|
+
let index2 = -1;
|
|
144915
|
+
for (let value of values) {
|
|
144916
|
+
if ((value = valueof(value, ++index2, values)) != null && (max2 < value || max2 === void 0 && value >= value)) {
|
|
144917
|
+
max2 = value;
|
|
144918
|
+
}
|
|
144919
|
+
}
|
|
144920
|
+
}
|
|
144921
|
+
return max2;
|
|
144922
|
+
}
|
|
144885
144923
|
function normalize(arr) {
|
|
144886
144924
|
const [min2, max2] = extent(arr);
|
|
144887
144925
|
const ratio = 255 / (max2 - min2);
|
|
144888
144926
|
const data = new Uint8Array(arr.map((i2) => Math.floor((i2 - min2) * ratio)));
|
|
144889
144927
|
return data;
|
|
144890
144928
|
}
|
|
144891
|
-
function multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSetColorMode, texSize) {
|
|
144929
|
+
function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode, texSize) {
|
|
144892
144930
|
let totalValuesLength = 0;
|
|
144893
144931
|
let totalColorsLength = 0;
|
|
144894
144932
|
channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
|
|
144895
|
-
var _a3, _b2, _c, _d
|
|
144933
|
+
var _a3, _b2, _c, _d;
|
|
144896
144934
|
if (isSetColorMode) {
|
|
144897
|
-
|
|
144898
|
-
|
|
144935
|
+
totalColorsLength += (((_b2 = (_a3 = setColorValues[channelIndex]) == null ? void 0 : _a3.setColors) == null ? void 0 : _b2.length) || 0) * 3;
|
|
144936
|
+
totalValuesLength += ((_c = setColorValues[channelIndex]) == null ? void 0 : _c.obsIndex) ? max(setColorValues[channelIndex].obsIndex.map((d) => parseInt(d))) : 0;
|
|
144899
144937
|
} else {
|
|
144900
|
-
totalValuesLength += ((
|
|
144938
|
+
totalValuesLength += multiMatrixObsIndex[channelIndex] ? max(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : ((_d = multiFeatureValues[channelIndex]) == null ? void 0 : _d.length) || 0;
|
|
144901
144939
|
}
|
|
144902
144940
|
});
|
|
144903
144941
|
const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
|
|
@@ -144915,12 +144953,20 @@ function multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSet
|
|
|
144915
144953
|
let indexOffset = 0;
|
|
144916
144954
|
let colorOffset = 0;
|
|
144917
144955
|
channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
|
|
144956
|
+
const matrixObsIndex = multiMatrixObsIndex[channelIndex];
|
|
144957
|
+
const bitmaskValueIsIndex = matrixObsIndex === null;
|
|
144918
144958
|
if (isSetColorMode) {
|
|
144919
144959
|
const { setColorIndices, setColors, obsIndex } = setColorValues[channelIndex] || {};
|
|
144920
144960
|
if (setColorIndices && setColors && obsIndex) {
|
|
144921
144961
|
for (let i2 = 0; i2 < obsIndex.length; i2++) {
|
|
144922
|
-
|
|
144923
|
-
|
|
144962
|
+
let obsId = String(i2 + 1);
|
|
144963
|
+
let obsI = i2;
|
|
144964
|
+
if (!bitmaskValueIsIndex) {
|
|
144965
|
+
obsId = obsIndex[i2];
|
|
144966
|
+
obsI = parseInt(obsId) - 1;
|
|
144967
|
+
}
|
|
144968
|
+
const colorIndex = setColorIndices.get(obsId);
|
|
144969
|
+
totalData[indexOffset + obsI] = colorIndex === void 0 ? 0 : colorIndex + 1;
|
|
144924
144970
|
}
|
|
144925
144971
|
for (let i2 = 0; i2 < setColors.length; i2++) {
|
|
144926
144972
|
const { color: [r2, g2, b] } = setColors[i2];
|
|
@@ -144935,7 +144981,16 @@ function multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSet
|
|
|
144935
144981
|
colorOffset += (setColors == null ? void 0 : setColors.length) || 0;
|
|
144936
144982
|
} else {
|
|
144937
144983
|
const featureArr = multiFeatureValues[channelIndex];
|
|
144938
|
-
|
|
144984
|
+
const normalizedFeatureArr = normalize(featureArr);
|
|
144985
|
+
if (!bitmaskValueIsIndex && matrixObsIndex) {
|
|
144986
|
+
for (let i2 = 0; i2 < matrixObsIndex.length; i2++) {
|
|
144987
|
+
const obsId = matrixObsIndex[i2];
|
|
144988
|
+
const obsI = parseInt(obsId) - 1;
|
|
144989
|
+
totalData[indexOffset + obsI] = normalizedFeatureArr[i2];
|
|
144990
|
+
}
|
|
144991
|
+
} else {
|
|
144992
|
+
totalData.set(normalizedFeatureArr, indexOffset);
|
|
144993
|
+
}
|
|
144939
144994
|
indicesOffsets.push(indexOffset);
|
|
144940
144995
|
indexOffset += featureArr.length;
|
|
144941
144996
|
colorsOffsets.push(colorOffset);
|
|
@@ -144962,6 +145017,17 @@ function padWithDefault(arr, defaultValue2, padWidth) {
|
|
|
144962
145017
|
function getColor(arr) {
|
|
144963
145018
|
return arr ? arr.map((v) => v / 255) : [0, 0, 0];
|
|
144964
145019
|
}
|
|
145020
|
+
function isEqualShallow(prevArr, nextArr) {
|
|
145021
|
+
if (prevArr === nextArr) {
|
|
145022
|
+
return true;
|
|
145023
|
+
}
|
|
145024
|
+
if (Array.isArray(prevArr) && Array.isArray(nextArr)) {
|
|
145025
|
+
if (prevArr.length === nextArr.length) {
|
|
145026
|
+
return !prevArr.some((v, i2) => v !== nextArr[i2] && (!Array.isArray(v) && !Array.isArray(nextArr[i2]) || (v.length > 0 || nextArr[i2].length > 0)));
|
|
145027
|
+
}
|
|
145028
|
+
}
|
|
145029
|
+
return prevArr === nextArr;
|
|
145030
|
+
}
|
|
144965
145031
|
const defaultProps = {
|
|
144966
145032
|
channelStrokeWidths: { type: "array", value: null, compare: true },
|
|
144967
145033
|
channelsFilled: { type: "array", value: null, compare: true },
|
|
@@ -144971,6 +145037,7 @@ const defaultProps = {
|
|
|
144971
145037
|
colormap: { type: "string", value: GLSL_COLORMAP_DEFAULT, compare: true },
|
|
144972
145038
|
expressionData: { type: "object", value: null, compare: true },
|
|
144973
145039
|
multiFeatureValues: { type: "array", value: null, compare: true },
|
|
145040
|
+
multiMatrixObsIndex: { type: "array", value: null, compare: true },
|
|
144974
145041
|
setColorValues: { type: "array", value: null, compare: true },
|
|
144975
145042
|
channelFeatureValueColormaps: { type: "array", value: null, compare: true },
|
|
144976
145043
|
channelFeatureValueColormapRanges: { type: "array", value: null, compare: true },
|
|
@@ -145017,9 +145084,9 @@ class BitmaskLayer2 extends XRLayer {
|
|
|
145017
145084
|
}
|
|
145018
145085
|
updateState({ props: props2, oldProps, changeFlags }) {
|
|
145019
145086
|
super.updateState({ props: props2, oldProps, changeFlags });
|
|
145020
|
-
if (props2.multiFeatureValues
|
|
145021
|
-
const { multiFeatureValues, setColorValues, channelIsSetColorMode } = this.props;
|
|
145022
|
-
const [valueTex, colorTex, valueTexOffsets, colorTexOffsets, valueTexHeight, colorTexHeight] = this.multiSetsToTexture(multiFeatureValues, setColorValues, channelIsSetColorMode);
|
|
145087
|
+
if (!isEqualShallow(props2.multiFeatureValues, oldProps.multiFeatureValues) || !isEqualShallow(props2.multiMatrixObsIndex, oldProps.multiMatrixObsIndex) || !isEqualShallow(props2.setColorValues, oldProps.setColorValues) || !isEqualShallow(props2.channelIsSetColorMode, oldProps.channelIsSetColorMode)) {
|
|
145088
|
+
const { multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode } = this.props;
|
|
145089
|
+
const [valueTex, colorTex, valueTexOffsets, colorTexOffsets, valueTexHeight, colorTexHeight] = this.multiSetsToTexture(multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode);
|
|
145023
145090
|
this.setState({
|
|
145024
145091
|
valueTex,
|
|
145025
145092
|
colorTex,
|
|
@@ -145171,9 +145238,9 @@ class BitmaskLayer2 extends XRLayer {
|
|
|
145171
145238
|
type: GL$1.FLOAT
|
|
145172
145239
|
});
|
|
145173
145240
|
}
|
|
145174
|
-
multiSetsToTexture(multiFeatureValues, setColorValues, channelIsSetColorMode) {
|
|
145241
|
+
multiSetsToTexture(multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode) {
|
|
145175
145242
|
const isWebGL2On = isWebGL2$1(this.context.gl);
|
|
145176
|
-
const [totalData, valueTexHeight, indicesOffsets, totalColors, colorTexHeight, colorsOffsets] = multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSetColorMode, MULTI_FEATURE_TEX_SIZE);
|
|
145243
|
+
const [totalData, valueTexHeight, indicesOffsets, totalColors, colorTexHeight, colorsOffsets] = multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode, MULTI_FEATURE_TEX_SIZE);
|
|
145177
145244
|
return [
|
|
145178
145245
|
// Color indices texture
|
|
145179
145246
|
new Texture2D(this.context.gl, {
|
|
@@ -146396,9 +146463,6 @@ class Location {
|
|
|
146396
146463
|
return new Location(this.store, new URL(path, root2).pathname);
|
|
146397
146464
|
}
|
|
146398
146465
|
}
|
|
146399
|
-
function root(store) {
|
|
146400
|
-
return new Location(store ?? /* @__PURE__ */ new Map());
|
|
146401
|
-
}
|
|
146402
146466
|
class Group extends Location {
|
|
146403
146467
|
constructor(store, path, metadata) {
|
|
146404
146468
|
super(store, path);
|
|
@@ -147016,92 +147080,6 @@ function set_from_chunk_binary(dest, src2, bytes_per_element2, projections) {
|
|
|
147016
147080
|
}, bytes_per_element2, projs);
|
|
147017
147081
|
}
|
|
147018
147082
|
}
|
|
147019
|
-
function fetch_range(url, offset, length2, opts2 = {}) {
|
|
147020
|
-
if (offset !== void 0 && length2 !== void 0) {
|
|
147021
|
-
opts2 = {
|
|
147022
|
-
...opts2,
|
|
147023
|
-
headers: {
|
|
147024
|
-
...opts2.headers,
|
|
147025
|
-
Range: `bytes=${offset}-${offset + length2 - 1}`
|
|
147026
|
-
}
|
|
147027
|
-
};
|
|
147028
|
-
}
|
|
147029
|
-
return fetch(url, opts2);
|
|
147030
|
-
}
|
|
147031
|
-
function resolve(root2, path) {
|
|
147032
|
-
const base = typeof root2 === "string" ? new URL(root2) : root2;
|
|
147033
|
-
if (!base.pathname.endsWith("/")) {
|
|
147034
|
-
base.pathname += "/";
|
|
147035
|
-
}
|
|
147036
|
-
const resolved = new URL(path.slice(1), base);
|
|
147037
|
-
resolved.search = base.search;
|
|
147038
|
-
return resolved;
|
|
147039
|
-
}
|
|
147040
|
-
async function handle_response(response) {
|
|
147041
|
-
if (response.status === 404 || response.status === 403) {
|
|
147042
|
-
return void 0;
|
|
147043
|
-
}
|
|
147044
|
-
if (response.status == 200 || response.status == 206) {
|
|
147045
|
-
return new Uint8Array(await response.arrayBuffer());
|
|
147046
|
-
}
|
|
147047
|
-
throw new Error(`Unexpected response status ${response.status} ${response.statusText}`);
|
|
147048
|
-
}
|
|
147049
|
-
async function fetch_suffix(url, suffix_length, init, use_suffix_request) {
|
|
147050
|
-
if (use_suffix_request) {
|
|
147051
|
-
return fetch(url, {
|
|
147052
|
-
...init,
|
|
147053
|
-
headers: { ...init.headers, Range: `bytes=-${suffix_length}` }
|
|
147054
|
-
});
|
|
147055
|
-
}
|
|
147056
|
-
let response = await fetch(url, { ...init, method: "HEAD" });
|
|
147057
|
-
if (!response.ok) {
|
|
147058
|
-
return response;
|
|
147059
|
-
}
|
|
147060
|
-
let content_length = response.headers.get("Content-Length");
|
|
147061
|
-
let length2 = Number(content_length);
|
|
147062
|
-
return fetch_range(url, length2 - suffix_length, length2, init);
|
|
147063
|
-
}
|
|
147064
|
-
class FetchStore {
|
|
147065
|
-
constructor(url, options = {}) {
|
|
147066
|
-
__privateAdd(this, _merge_init);
|
|
147067
|
-
__publicField(this, "url");
|
|
147068
|
-
__privateAdd(this, _overrides, void 0);
|
|
147069
|
-
__privateAdd(this, _use_suffix_request, void 0);
|
|
147070
|
-
this.url = url;
|
|
147071
|
-
__privateSet(this, _overrides, options.overrides ?? {});
|
|
147072
|
-
__privateSet(this, _use_suffix_request, options.useSuffixRequest ?? false);
|
|
147073
|
-
}
|
|
147074
|
-
async get(key, options = {}) {
|
|
147075
|
-
let href = resolve(this.url, key).href;
|
|
147076
|
-
let response = await fetch(href, __privateMethod(this, _merge_init, merge_init_fn).call(this, options));
|
|
147077
|
-
return handle_response(response);
|
|
147078
|
-
}
|
|
147079
|
-
async getRange(key, range2, options = {}) {
|
|
147080
|
-
let url = resolve(this.url, key);
|
|
147081
|
-
let init = __privateMethod(this, _merge_init, merge_init_fn).call(this, options);
|
|
147082
|
-
let response;
|
|
147083
|
-
if ("suffixLength" in range2) {
|
|
147084
|
-
response = await fetch_suffix(url, range2.suffixLength, init, __privateGet(this, _use_suffix_request));
|
|
147085
|
-
} else {
|
|
147086
|
-
response = await fetch_range(url, range2.offset, range2.length, init);
|
|
147087
|
-
}
|
|
147088
|
-
return handle_response(response);
|
|
147089
|
-
}
|
|
147090
|
-
}
|
|
147091
|
-
_overrides = new WeakMap();
|
|
147092
|
-
_use_suffix_request = new WeakMap();
|
|
147093
|
-
_merge_init = new WeakSet();
|
|
147094
|
-
merge_init_fn = function(overrides) {
|
|
147095
|
-
return {
|
|
147096
|
-
...__privateGet(this, _overrides),
|
|
147097
|
-
...overrides,
|
|
147098
|
-
headers: {
|
|
147099
|
-
...__privateGet(this, _overrides).headers,
|
|
147100
|
-
...overrides.headers
|
|
147101
|
-
}
|
|
147102
|
-
};
|
|
147103
|
-
};
|
|
147104
|
-
const FetchStore$1 = FetchStore;
|
|
147105
147083
|
function getV2DataType(dtype) {
|
|
147106
147084
|
const mapping = {
|
|
147107
147085
|
int8: "|i1",
|
|
@@ -147141,10 +147119,6 @@ function createZarrArrayAdapter(arr) {
|
|
|
147141
147119
|
}
|
|
147142
147120
|
});
|
|
147143
147121
|
}
|
|
147144
|
-
function zarrOpenRoot(url, requestInit2) {
|
|
147145
|
-
const store = new FetchStore$1(url, { overrides: requestInit2 });
|
|
147146
|
-
return root(store);
|
|
147147
|
-
}
|
|
147148
147122
|
function prevPowerOf2(x2) {
|
|
147149
147123
|
return 2 ** Math.floor(Math.log2(x2));
|
|
147150
147124
|
}
|
|
@@ -147189,8 +147163,7 @@ class ZarritaPixelSource extends ZarrPixelSource {
|
|
|
147189
147163
|
this._readChunks = false;
|
|
147190
147164
|
}
|
|
147191
147165
|
}
|
|
147192
|
-
async function loadOmeZarr(
|
|
147193
|
-
const root2 = await zarrOpenRoot(url, requestInit2);
|
|
147166
|
+
async function loadOmeZarr(root2) {
|
|
147194
147167
|
const { data, rootAttrs, labels } = await loadMultiscales(root2);
|
|
147195
147168
|
const tileSize = guessTileSize(data[0]);
|
|
147196
147169
|
const pyramid = data.map((arr) => new ZarritaPixelSource(
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D, e, a, b, c, d, F, G, Z, C, r, n, E, A, y, l, m, z, x, h, q, v, o, i, f, j, k, u, t, p, s, w } from "./index-
|
|
1
|
+
import { D, e, a, b, c, d, F, G, Z, C, r, n, E, A, y, l, m, z, x, h, q, v, o, i, f, j, k, u, t, p, s, w } from "./index-20c94d37.js";
|
|
2
2
|
import "react";
|
|
3
3
|
export {
|
|
4
4
|
D as DEFAULT_CELLS_LAYER,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
|
|
2
|
-
import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-
|
|
2
|
+
import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-20c94d37.js";
|
|
3
3
|
import "react";
|
|
4
4
|
const LercParameters = {
|
|
5
5
|
Version: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-ome-zarr.d.ts","sourceRoot":"","sources":["../src/load-ome-zarr.js"],"names":[],"mappings":"AAkBA,gDAMC;AAiDD;;;
|
|
1
|
+
{"version":3,"file":"load-ome-zarr.d.ts","sourceRoot":"","sources":["../src/load-ome-zarr.js"],"names":[],"mappings":"AAkBA,gDAMC;AAiDD;;;GAaC;AA7BD;IACE,kDASC;IADC,qBAAwB;CAE3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { viv } from '@vitessce/gl';
|
|
2
2
|
import { open as zarrOpen } from 'zarrita';
|
|
3
|
-
import {
|
|
3
|
+
import { createZarrArrayAdapter } from '@vitessce/zarr-utils';
|
|
4
4
|
function prevPowerOf2(x) {
|
|
5
5
|
return 2 ** Math.floor(Math.log2(x));
|
|
6
6
|
}
|
|
@@ -62,8 +62,7 @@ export class ZarritaPixelSource extends viv.ZarrPixelSource {
|
|
|
62
62
|
}
|
|
63
63
|
// We use our own loadOmeZarr function (instead of viv.loadOmeZarr)
|
|
64
64
|
// to bypass usage of zarr.js which is used in Viv's version.
|
|
65
|
-
export async function loadOmeZarr(
|
|
66
|
-
const root = await zarrOpenRoot(url, requestInit);
|
|
65
|
+
export async function loadOmeZarr(root) {
|
|
67
66
|
const { data, rootAttrs, labels } = await loadMultiscales(root);
|
|
68
67
|
const tileSize = guessTileSize(data[0]);
|
|
69
68
|
const pyramid = data
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/spatial-utils",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3",
|
|
4
4
|
"author": "Gehlenborg Lab",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"zarrita": "0.4.0-next.4",
|
|
21
21
|
"math.gl": "^3.5.6",
|
|
22
22
|
"mathjs": "^9.2.0",
|
|
23
|
-
"@vitessce/gl": "3.3.
|
|
24
|
-
"@vitessce/
|
|
25
|
-
"@vitessce/utils": "3.3.
|
|
23
|
+
"@vitessce/gl": "3.3.3",
|
|
24
|
+
"@vitessce/utils": "3.3.3",
|
|
25
|
+
"@vitessce/zarr-utils": "3.3.3"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
|
package/src/load-ome-zarr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { viv } from '@vitessce/gl';
|
|
2
2
|
import { open as zarrOpen } from 'zarrita';
|
|
3
|
-
import {
|
|
3
|
+
import { createZarrArrayAdapter } from '@vitessce/zarr-utils';
|
|
4
4
|
|
|
5
5
|
function prevPowerOf2(x) {
|
|
6
6
|
return 2 ** Math.floor(Math.log2(x));
|
|
@@ -71,8 +71,7 @@ export class ZarritaPixelSource extends viv.ZarrPixelSource {
|
|
|
71
71
|
|
|
72
72
|
// We use our own loadOmeZarr function (instead of viv.loadOmeZarr)
|
|
73
73
|
// to bypass usage of zarr.js which is used in Viv's version.
|
|
74
|
-
export async function loadOmeZarr(
|
|
75
|
-
const root = await zarrOpenRoot(url, requestInit);
|
|
74
|
+
export async function loadOmeZarr(root) {
|
|
76
75
|
const { data, rootAttrs, labels } = await loadMultiscales(root);
|
|
77
76
|
const tileSize = guessTileSize(data[0]);
|
|
78
77
|
const pyramid = data
|