@vitessce/dev 3.3.9 → 3.3.11
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-deb90b62.js → deflate-e0006b6b.js} +1 -1
- package/dist/{hglib-7e92fd06.js → hglib-e10f79aa.js} +1 -1
- package/dist/{index-cfe16a6d.js → index-e7364222.js} +437 -267
- package/dist/index.js +1 -1
- package/dist/{jpeg-add1062f.js → jpeg-c55482b1.js} +1 -1
- package/dist/{lerc-3d56fe20.js → lerc-dc81cb8d.js} +1 -1
- package/dist/{lzw-9cc09870.js → lzw-4efdd6e5.js} +1 -1
- package/dist/{packbits-0d29251a.js → packbits-abe82479.js} +1 -1
- package/dist/{raw-8e975931.js → raw-8d1263ac.js} +1 -1
- package/dist/{webimage-3a8bbc71.js → webimage-a16d5949.js} +1 -1
- package/package.json +5 -5
|
@@ -273,8 +273,11 @@ const CoordinationType$2 = {
|
|
|
273
273
|
PHOTOMETRIC_INTERPRETATION: "photometricInterpretation",
|
|
274
274
|
// For 3D volume rendering
|
|
275
275
|
SPATIAL_RENDERING_MODE: "spatialRenderingMode",
|
|
276
|
+
// For whole spatial view
|
|
276
277
|
VOLUMETRIC_RENDERING_ALGORITHM: "volumetricRenderingAlgorithm",
|
|
278
|
+
// Could be per-image-layer
|
|
277
279
|
SPATIAL_TARGET_RESOLUTION: "spatialTargetResolution",
|
|
280
|
+
// Per-spatial-layer
|
|
278
281
|
// For clipping plane sliders
|
|
279
282
|
SPATIAL_SLICE_X: "spatialSliceX",
|
|
280
283
|
SPATIAL_SLICE_Y: "spatialSliceY",
|
|
@@ -283,10 +286,12 @@ const CoordinationType$2 = {
|
|
|
283
286
|
SPOT_LAYER: "spotLayer",
|
|
284
287
|
POINT_LAYER: "pointLayer",
|
|
285
288
|
SPATIAL_SPOT_RADIUS: "spatialSpotRadius",
|
|
289
|
+
// In micrometers?
|
|
286
290
|
SPATIAL_SPOT_FILLED: "spatialSpotFilled",
|
|
287
291
|
SPATIAL_SPOT_STROKE_WIDTH: "spatialSpotStrokeWidth",
|
|
288
292
|
SPATIAL_LAYER_COLOR: "spatialLayerColor",
|
|
289
293
|
PIXEL_HIGHLIGHT: "pixelHighlight",
|
|
294
|
+
// Per-image-layer
|
|
290
295
|
TOOLTIP_CROSSHAIRS_VISIBLE: "tooltipCrosshairsVisible",
|
|
291
296
|
LEGEND_VISIBLE: "legendVisible",
|
|
292
297
|
SPATIAL_CHANNEL_LABELS_VISIBLE: "spatialChannelLabelsVisible",
|
|
@@ -770,10 +775,10 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
770
775
|
]
|
|
771
776
|
};
|
|
772
777
|
const note = "This file is autogenerated by .changeset/post-changelog.mjs.";
|
|
773
|
-
const version$6 = "3.3.
|
|
774
|
-
const date$5 = "2024-
|
|
778
|
+
const version$6 = "3.3.11";
|
|
779
|
+
const date$5 = "2024-04-01";
|
|
775
780
|
const branch = "changeset-release/main";
|
|
776
|
-
const hash$1 = "
|
|
781
|
+
const hash$1 = "c7e8e8f1";
|
|
777
782
|
const META_VERSION = {
|
|
778
783
|
note,
|
|
779
784
|
version: version$6,
|
|
@@ -1703,6 +1708,7 @@ class VitessceConfigView {
|
|
|
1703
1708
|
component,
|
|
1704
1709
|
coordinationScopes,
|
|
1705
1710
|
coordinationScopesBy: void 0,
|
|
1711
|
+
// TODO: initialize from parameter?
|
|
1706
1712
|
x: x2,
|
|
1707
1713
|
y: y2,
|
|
1708
1714
|
w: w2,
|
|
@@ -9256,7 +9262,7 @@ function getStylesCreator(stylesOrCreator) {
|
|
|
9256
9262
|
}
|
|
9257
9263
|
}
|
|
9258
9264
|
return {
|
|
9259
|
-
create: function
|
|
9265
|
+
create: function create6(theme, name2) {
|
|
9260
9266
|
var styles37;
|
|
9261
9267
|
try {
|
|
9262
9268
|
styles37 = themingEnabled ? stylesOrCreator(theme) : stylesOrCreator;
|
|
@@ -19124,7 +19130,7 @@ var classCallCheck$1 = function(instance, Constructor) {
|
|
|
19124
19130
|
}
|
|
19125
19131
|
};
|
|
19126
19132
|
var createClass$1 = function() {
|
|
19127
|
-
function
|
|
19133
|
+
function defineProperties4(target2, props2) {
|
|
19128
19134
|
for (var i2 = 0; i2 < props2.length; i2++) {
|
|
19129
19135
|
var descriptor2 = props2[i2];
|
|
19130
19136
|
descriptor2.enumerable = descriptor2.enumerable || false;
|
|
@@ -19136,9 +19142,9 @@ var createClass$1 = function() {
|
|
|
19136
19142
|
}
|
|
19137
19143
|
return function(Constructor, protoProps, staticProps) {
|
|
19138
19144
|
if (protoProps)
|
|
19139
|
-
|
|
19145
|
+
defineProperties4(Constructor.prototype, protoProps);
|
|
19140
19146
|
if (staticProps)
|
|
19141
|
-
|
|
19147
|
+
defineProperties4(Constructor, staticProps);
|
|
19142
19148
|
return Constructor;
|
|
19143
19149
|
};
|
|
19144
19150
|
}();
|
|
@@ -35445,8 +35451,11 @@ const globalColors = {
|
|
|
35445
35451
|
grayDark: "#555555",
|
|
35446
35452
|
black: "#000000",
|
|
35447
35453
|
grayDarkL5: "rgb(98, 98, 98)",
|
|
35454
|
+
// lighten(map-get($global-colors, "gray-dark"), 5%);
|
|
35448
35455
|
grayDarkD15: "rgb(47, 47, 47)",
|
|
35456
|
+
// darken(map-get($global-colors, "gray-dark"), 15%);
|
|
35449
35457
|
grayMidL10: "rgb(154, 154, 154)",
|
|
35458
|
+
// lighten(map-get($global-colors, "gray-mid"), 10%);
|
|
35450
35459
|
grayLightL10: "rgb(237, 237, 237)"
|
|
35451
35460
|
// lighten(map-get($global-colors, "gray-light"), 10%);
|
|
35452
35461
|
};
|
|
@@ -35503,8 +35512,11 @@ const lightPalette = {
|
|
|
35503
35512
|
primaryBackgroundLight: "#e0e0e0",
|
|
35504
35513
|
primaryForeground: "#333333",
|
|
35505
35514
|
primaryForegroundL5: "rgb(64, 64, 64)",
|
|
35515
|
+
// lighten(map-get($theme-colors, "primary-foreground"), 5%);
|
|
35506
35516
|
primaryForegroundL10: "rgb(77, 77, 77)",
|
|
35517
|
+
// lighten(map-get($theme-colors, "primary-foreground"), 10%);
|
|
35507
35518
|
primaryForegroundD15: "rgb(13, 13, 13)",
|
|
35519
|
+
// darken(map-get($theme-colors, "primary-foreground"), 15%);
|
|
35508
35520
|
primaryForegroundDim: "#808080",
|
|
35509
35521
|
primaryForegroundActive: "#0074D9",
|
|
35510
35522
|
secondaryBackground: "#F1F1F1",
|
|
@@ -36406,12 +36418,14 @@ function useComplexCoordinationSecondary(parameters, coordinationScopes, coordin
|
|
|
36406
36418
|
if (coordinationScopesBy?.[primaryType]?.[secondaryType]) {
|
|
36407
36419
|
return {
|
|
36408
36420
|
...coordinationScopes,
|
|
36421
|
+
// TODO: this is needed for falling back to view-level coordination scopes, but does it affect performance?
|
|
36409
36422
|
[secondaryType]: Object.values(coordinationScopesBy[primaryType][secondaryType]).flat()
|
|
36410
36423
|
};
|
|
36411
36424
|
}
|
|
36412
36425
|
if (coordinationScopes?.[secondaryType] && Array.isArray(coordinationScopes[secondaryType])) {
|
|
36413
36426
|
return {
|
|
36414
36427
|
...coordinationScopes,
|
|
36428
|
+
// TODO: this is needed for falling back to view-level coordination scopes, but does it affect performance?
|
|
36415
36429
|
[secondaryType]: coordinationScopes[secondaryType]
|
|
36416
36430
|
};
|
|
36417
36431
|
}
|
|
@@ -45116,7 +45130,23 @@ function useSegmentationMultiObsSets(coordinationScopes, coordinationScopesBy, l
|
|
|
45116
45130
|
const [indicesData, indicesDataStatus] = useObsSetsMultiLevel(loaders, dataset, false, matchOnObj, 2);
|
|
45117
45131
|
return [indicesData, indicesDataStatus];
|
|
45118
45132
|
}
|
|
45133
|
+
class LoaderResult {
|
|
45134
|
+
/**
|
|
45135
|
+
* @param {LoaderDataType} data
|
|
45136
|
+
* @param {object[]|string|null} url Single URL or array of { url, name } objects.
|
|
45137
|
+
* @param {object|null} coordinationValues
|
|
45138
|
+
*/
|
|
45139
|
+
constructor(data2, url, coordinationValues = null) {
|
|
45140
|
+
this.data = data2;
|
|
45141
|
+
this.url = url;
|
|
45142
|
+
this.coordinationValues = coordinationValues;
|
|
45143
|
+
}
|
|
45144
|
+
}
|
|
45119
45145
|
class AbstractLoader {
|
|
45146
|
+
/**
|
|
45147
|
+
*
|
|
45148
|
+
* @param {LoaderParams} params
|
|
45149
|
+
*/
|
|
45120
45150
|
constructor({ type: type3, fileType, url, requestInit: requestInit2, options, coordinationValues }) {
|
|
45121
45151
|
this.fileType = fileType;
|
|
45122
45152
|
this.type = type3;
|
|
@@ -45125,29 +45155,26 @@ class AbstractLoader {
|
|
|
45125
45155
|
this.options = options;
|
|
45126
45156
|
this.coordinationValues = coordinationValues;
|
|
45127
45157
|
}
|
|
45158
|
+
/**
|
|
45159
|
+
*
|
|
45160
|
+
* @returns {Promise<LoaderResult<any>>}
|
|
45161
|
+
*/
|
|
45128
45162
|
// eslint-disable-next-line class-methods-use-this
|
|
45129
|
-
load() {
|
|
45130
|
-
return Promise.resolve(true);
|
|
45163
|
+
async load() {
|
|
45164
|
+
return Promise.resolve(new LoaderResult(true, null));
|
|
45131
45165
|
}
|
|
45132
45166
|
}
|
|
45133
45167
|
class AbstractTwoStepLoader extends AbstractLoader {
|
|
45168
|
+
/**
|
|
45169
|
+
*
|
|
45170
|
+
* @param {DataSourceType} dataSource
|
|
45171
|
+
* @param {LoaderParams} params
|
|
45172
|
+
*/
|
|
45134
45173
|
constructor(dataSource, params2) {
|
|
45135
45174
|
super(params2);
|
|
45136
45175
|
this.dataSource = dataSource;
|
|
45137
45176
|
}
|
|
45138
45177
|
}
|
|
45139
|
-
class LoaderResult {
|
|
45140
|
-
/**
|
|
45141
|
-
* @param {*} data
|
|
45142
|
-
* @param {object[]|string|null} url Single URL or array of { url, name } objects.
|
|
45143
|
-
* @param {object} coordinationValues
|
|
45144
|
-
*/
|
|
45145
|
-
constructor(data2, url, coordinationValues = null) {
|
|
45146
|
-
this.data = data2;
|
|
45147
|
-
this.url = url;
|
|
45148
|
-
this.coordinationValues = coordinationValues;
|
|
45149
|
-
}
|
|
45150
|
-
}
|
|
45151
45178
|
const $b5e257d569688ac6$var$defaultContext = {
|
|
45152
45179
|
prefix: String(Math.round(Math.random() * 1e10)),
|
|
45153
45180
|
current: 0
|
|
@@ -54685,10 +54712,10 @@ var _propertyDesc = function(bitmap, value2) {
|
|
|
54685
54712
|
value: value2
|
|
54686
54713
|
};
|
|
54687
54714
|
};
|
|
54688
|
-
var dP$
|
|
54715
|
+
var dP$2 = require_objectDp();
|
|
54689
54716
|
var createDesc$2 = _propertyDesc;
|
|
54690
54717
|
var _hide = require_descriptors() ? function(object2, key2, value2) {
|
|
54691
|
-
return dP$
|
|
54718
|
+
return dP$2.f(object2, key2, createDesc$2(1, value2));
|
|
54692
54719
|
} : function(object2, key2, value2) {
|
|
54693
54720
|
object2[key2] = value2;
|
|
54694
54721
|
return object2;
|
|
@@ -54702,7 +54729,7 @@ var core$3 = _coreExports;
|
|
|
54702
54729
|
var ctx = _ctx;
|
|
54703
54730
|
var hide$2 = _hide;
|
|
54704
54731
|
var has$a = _has$1;
|
|
54705
|
-
var PROTOTYPE$
|
|
54732
|
+
var PROTOTYPE$2 = "prototype";
|
|
54706
54733
|
var $export$6 = function(type3, name2, source2) {
|
|
54707
54734
|
var IS_FORCED = type3 & $export$6.F;
|
|
54708
54735
|
var IS_GLOBAL = type3 & $export$6.G;
|
|
@@ -54711,8 +54738,8 @@ var $export$6 = function(type3, name2, source2) {
|
|
|
54711
54738
|
var IS_BIND = type3 & $export$6.B;
|
|
54712
54739
|
var IS_WRAP = type3 & $export$6.W;
|
|
54713
54740
|
var exports2 = IS_GLOBAL ? core$3 : core$3[name2] || (core$3[name2] = {});
|
|
54714
|
-
var expProto = exports2[PROTOTYPE$
|
|
54715
|
-
var target2 = IS_GLOBAL ? global$5 : IS_STATIC ? global$5[name2] : (global$5[name2] || {})[PROTOTYPE$
|
|
54741
|
+
var expProto = exports2[PROTOTYPE$2];
|
|
54742
|
+
var target2 = IS_GLOBAL ? global$5 : IS_STATIC ? global$5[name2] : (global$5[name2] || {})[PROTOTYPE$2];
|
|
54716
54743
|
var key2, own, out;
|
|
54717
54744
|
if (IS_GLOBAL)
|
|
54718
54745
|
source2 = name2;
|
|
@@ -54736,7 +54763,7 @@ var $export$6 = function(type3, name2, source2) {
|
|
|
54736
54763
|
}
|
|
54737
54764
|
return C3.apply(this, arguments);
|
|
54738
54765
|
};
|
|
54739
|
-
F[PROTOTYPE$
|
|
54766
|
+
F[PROTOTYPE$2] = C3[PROTOTYPE$2];
|
|
54740
54767
|
return F;
|
|
54741
54768
|
}(out) : IS_PROTO && typeof out == "function" ? ctx(Function.call, out) : out;
|
|
54742
54769
|
if (IS_PROTO) {
|
|
@@ -54841,30 +54868,22 @@ var px$1 = Math.random();
|
|
|
54841
54868
|
var _uid = function(key2) {
|
|
54842
54869
|
return "Symbol(".concat(key2 === void 0 ? "" : key2, ")_", (++id$3 + px$1).toString(36));
|
|
54843
54870
|
};
|
|
54844
|
-
var
|
|
54845
|
-
var
|
|
54846
|
-
function
|
|
54847
|
-
|
|
54848
|
-
|
|
54849
|
-
hasRequired_sharedKey = 1;
|
|
54850
|
-
var shared2 = _sharedExports("keys");
|
|
54851
|
-
var uid2 = _uid;
|
|
54852
|
-
_sharedKey = function(key2) {
|
|
54853
|
-
return shared2[key2] || (shared2[key2] = uid2(key2));
|
|
54854
|
-
};
|
|
54855
|
-
return _sharedKey;
|
|
54856
|
-
}
|
|
54871
|
+
var shared$1 = _sharedExports("keys");
|
|
54872
|
+
var uid$3 = _uid;
|
|
54873
|
+
var _sharedKey = function(key2) {
|
|
54874
|
+
return shared$1[key2] || (shared$1[key2] = uid$3(key2));
|
|
54875
|
+
};
|
|
54857
54876
|
var has$9 = _has$1;
|
|
54858
54877
|
var toIObject$4 = _toIobject;
|
|
54859
54878
|
var arrayIndexOf = _arrayIncludes(false);
|
|
54860
|
-
var IE_PROTO$
|
|
54879
|
+
var IE_PROTO$2 = _sharedKey("IE_PROTO");
|
|
54861
54880
|
var _objectKeysInternal = function(object2, names) {
|
|
54862
54881
|
var O = toIObject$4(object2);
|
|
54863
54882
|
var i2 = 0;
|
|
54864
54883
|
var result = [];
|
|
54865
54884
|
var key2;
|
|
54866
54885
|
for (key2 in O)
|
|
54867
|
-
if (key2 != IE_PROTO$
|
|
54886
|
+
if (key2 != IE_PROTO$2)
|
|
54868
54887
|
has$9(O, key2) && result.push(key2);
|
|
54869
54888
|
while (names.length > i2)
|
|
54870
54889
|
if (has$9(O, key2 = names[i2++])) {
|
|
@@ -54874,9 +54893,9 @@ var _objectKeysInternal = function(object2, names) {
|
|
|
54874
54893
|
};
|
|
54875
54894
|
var _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");
|
|
54876
54895
|
var $keys$2 = _objectKeysInternal;
|
|
54877
|
-
var enumBugKeys = _enumBugKeys;
|
|
54896
|
+
var enumBugKeys$1 = _enumBugKeys;
|
|
54878
54897
|
var _objectKeys$1 = Object.keys || function keys(O) {
|
|
54879
|
-
return $keys$2(O, enumBugKeys);
|
|
54898
|
+
return $keys$2(O, enumBugKeys$1);
|
|
54880
54899
|
};
|
|
54881
54900
|
var _objectGops = {};
|
|
54882
54901
|
_objectGops.f = Object.getOwnPropertySymbols;
|
|
@@ -54994,7 +55013,7 @@ function _interopRequireDefault$o(obj) {
|
|
|
54994
55013
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
54995
55014
|
}
|
|
54996
55015
|
var _default$5 = function() {
|
|
54997
|
-
function
|
|
55016
|
+
function defineProperties4(target2, props2) {
|
|
54998
55017
|
for (var i2 = 0; i2 < props2.length; i2++) {
|
|
54999
55018
|
var descriptor2 = props2[i2];
|
|
55000
55019
|
descriptor2.enumerable = descriptor2.enumerable || false;
|
|
@@ -55006,9 +55025,9 @@ var _default$5 = function() {
|
|
|
55006
55025
|
}
|
|
55007
55026
|
return function(Constructor, protoProps, staticProps) {
|
|
55008
55027
|
if (protoProps)
|
|
55009
|
-
|
|
55028
|
+
defineProperties4(Constructor.prototype, protoProps);
|
|
55010
55029
|
if (staticProps)
|
|
55011
|
-
|
|
55030
|
+
defineProperties4(Constructor, staticProps);
|
|
55012
55031
|
return Constructor;
|
|
55013
55032
|
};
|
|
55014
55033
|
}();
|
|
@@ -55029,27 +55048,19 @@ var _stringAt = function(TO_STRING) {
|
|
|
55029
55048
|
};
|
|
55030
55049
|
var _redefine = _hide;
|
|
55031
55050
|
var _iterators = {};
|
|
55032
|
-
var
|
|
55033
|
-
var
|
|
55034
|
-
|
|
55035
|
-
|
|
55036
|
-
|
|
55037
|
-
|
|
55038
|
-
var
|
|
55039
|
-
var
|
|
55040
|
-
var
|
|
55041
|
-
|
|
55042
|
-
|
|
55043
|
-
|
|
55044
|
-
|
|
55045
|
-
var i2 = 0;
|
|
55046
|
-
var P2;
|
|
55047
|
-
while (length2 > i2)
|
|
55048
|
-
dP2.f(O, P2 = keys4[i2++], Properties[P2]);
|
|
55049
|
-
return O;
|
|
55050
|
-
};
|
|
55051
|
-
return _objectDps;
|
|
55052
|
-
}
|
|
55051
|
+
var dP$1 = require_objectDp();
|
|
55052
|
+
var anObject$2 = _anObject;
|
|
55053
|
+
var getKeys$1 = _objectKeys$1;
|
|
55054
|
+
var _objectDps = require_descriptors() ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
55055
|
+
anObject$2(O);
|
|
55056
|
+
var keys4 = getKeys$1(Properties);
|
|
55057
|
+
var length2 = keys4.length;
|
|
55058
|
+
var i2 = 0;
|
|
55059
|
+
var P2;
|
|
55060
|
+
while (length2 > i2)
|
|
55061
|
+
dP$1.f(O, P2 = keys4[i2++], Properties[P2]);
|
|
55062
|
+
return O;
|
|
55063
|
+
};
|
|
55053
55064
|
var _html;
|
|
55054
55065
|
var hasRequired_html;
|
|
55055
55066
|
function require_html() {
|
|
@@ -55060,50 +55071,42 @@ function require_html() {
|
|
|
55060
55071
|
_html = document2 && document2.documentElement;
|
|
55061
55072
|
return _html;
|
|
55062
55073
|
}
|
|
55063
|
-
var
|
|
55064
|
-
var
|
|
55065
|
-
|
|
55066
|
-
|
|
55067
|
-
|
|
55068
|
-
|
|
55069
|
-
|
|
55070
|
-
|
|
55071
|
-
var
|
|
55072
|
-
var
|
|
55073
|
-
var
|
|
55074
|
-
|
|
55075
|
-
var
|
|
55076
|
-
|
|
55077
|
-
|
|
55078
|
-
|
|
55079
|
-
|
|
55080
|
-
|
|
55081
|
-
|
|
55082
|
-
|
|
55083
|
-
|
|
55084
|
-
|
|
55085
|
-
|
|
55086
|
-
|
|
55087
|
-
|
|
55088
|
-
|
|
55089
|
-
|
|
55090
|
-
|
|
55091
|
-
|
|
55092
|
-
|
|
55093
|
-
|
|
55094
|
-
|
|
55095
|
-
|
|
55096
|
-
|
|
55097
|
-
|
|
55098
|
-
|
|
55099
|
-
Empty2[PROTOTYPE2] = null;
|
|
55100
|
-
result[IE_PROTO2] = O;
|
|
55101
|
-
} else
|
|
55102
|
-
result = createDict();
|
|
55103
|
-
return Properties === void 0 ? result : dPs(result, Properties);
|
|
55104
|
-
};
|
|
55105
|
-
return _objectCreate;
|
|
55106
|
-
}
|
|
55074
|
+
var anObject$1 = _anObject;
|
|
55075
|
+
var dPs = _objectDps;
|
|
55076
|
+
var enumBugKeys = _enumBugKeys;
|
|
55077
|
+
var IE_PROTO$1 = _sharedKey("IE_PROTO");
|
|
55078
|
+
var Empty$2 = function() {
|
|
55079
|
+
};
|
|
55080
|
+
var PROTOTYPE$1 = "prototype";
|
|
55081
|
+
var createDict = function() {
|
|
55082
|
+
var iframe = require_domCreate()("iframe");
|
|
55083
|
+
var i2 = enumBugKeys.length;
|
|
55084
|
+
var lt2 = "<";
|
|
55085
|
+
var gt2 = ">";
|
|
55086
|
+
var iframeDocument;
|
|
55087
|
+
iframe.style.display = "none";
|
|
55088
|
+
require_html().appendChild(iframe);
|
|
55089
|
+
iframe.src = "javascript:";
|
|
55090
|
+
iframeDocument = iframe.contentWindow.document;
|
|
55091
|
+
iframeDocument.open();
|
|
55092
|
+
iframeDocument.write(lt2 + "script" + gt2 + "document.F=Object" + lt2 + "/script" + gt2);
|
|
55093
|
+
iframeDocument.close();
|
|
55094
|
+
createDict = iframeDocument.F;
|
|
55095
|
+
while (i2--)
|
|
55096
|
+
delete createDict[PROTOTYPE$1][enumBugKeys[i2]];
|
|
55097
|
+
return createDict();
|
|
55098
|
+
};
|
|
55099
|
+
var _objectCreate = Object.create || function create2(O, Properties) {
|
|
55100
|
+
var result;
|
|
55101
|
+
if (O !== null) {
|
|
55102
|
+
Empty$2[PROTOTYPE$1] = anObject$1(O);
|
|
55103
|
+
result = new Empty$2();
|
|
55104
|
+
Empty$2[PROTOTYPE$1] = null;
|
|
55105
|
+
result[IE_PROTO$1] = O;
|
|
55106
|
+
} else
|
|
55107
|
+
result = createDict();
|
|
55108
|
+
return Properties === void 0 ? result : dPs(result, Properties);
|
|
55109
|
+
};
|
|
55107
55110
|
var _wks = { exports: {} };
|
|
55108
55111
|
var store = _sharedExports("wks");
|
|
55109
55112
|
var uid$2 = _uid;
|
|
@@ -55121,7 +55124,7 @@ var _setToStringTag = function(it, tag2, stat) {
|
|
|
55121
55124
|
if (it && !has$8(it = stat ? it : it.prototype, TAG))
|
|
55122
55125
|
def$1(it, TAG, { configurable: true, value: tag2 });
|
|
55123
55126
|
};
|
|
55124
|
-
var create$b =
|
|
55127
|
+
var create$b = _objectCreate;
|
|
55125
55128
|
var descriptor = _propertyDesc;
|
|
55126
55129
|
var setToStringTag$2 = _setToStringTag;
|
|
55127
55130
|
var IteratorPrototype$2 = {};
|
|
@@ -55134,7 +55137,7 @@ var _iterCreate = function(Constructor, NAME2, next3) {
|
|
|
55134
55137
|
};
|
|
55135
55138
|
var has$7 = _has$1;
|
|
55136
55139
|
var toObject$2 = _toObject;
|
|
55137
|
-
var IE_PROTO =
|
|
55140
|
+
var IE_PROTO = _sharedKey("IE_PROTO");
|
|
55138
55141
|
var ObjectProto$1 = Object.prototype;
|
|
55139
55142
|
var _objectGpo = Object.getPrototypeOf || function(O) {
|
|
55140
55143
|
O = toObject$2(O);
|
|
@@ -55297,23 +55300,23 @@ var setMeta = function(it) {
|
|
|
55297
55300
|
// weak collections IDs
|
|
55298
55301
|
} });
|
|
55299
55302
|
};
|
|
55300
|
-
var fastKey = function(it,
|
|
55303
|
+
var fastKey = function(it, create6) {
|
|
55301
55304
|
if (!isObject$e(it))
|
|
55302
55305
|
return typeof it == "symbol" ? it : (typeof it == "string" ? "S" : "P") + it;
|
|
55303
55306
|
if (!has$6(it, META$1)) {
|
|
55304
55307
|
if (!isExtensible(it))
|
|
55305
55308
|
return "F";
|
|
55306
|
-
if (!
|
|
55309
|
+
if (!create6)
|
|
55307
55310
|
return "E";
|
|
55308
55311
|
setMeta(it);
|
|
55309
55312
|
}
|
|
55310
55313
|
return it[META$1].i;
|
|
55311
55314
|
};
|
|
55312
|
-
var getWeak = function(it,
|
|
55315
|
+
var getWeak = function(it, create6) {
|
|
55313
55316
|
if (!has$6(it, META$1)) {
|
|
55314
55317
|
if (!isExtensible(it))
|
|
55315
55318
|
return true;
|
|
55316
|
-
if (!
|
|
55319
|
+
if (!create6)
|
|
55317
55320
|
return false;
|
|
55318
55321
|
setMeta(it);
|
|
55319
55322
|
}
|
|
@@ -55422,7 +55425,7 @@ var toObject$1 = _toObject;
|
|
|
55422
55425
|
var toIObject = _toIobject;
|
|
55423
55426
|
var toPrimitive = _toPrimitive;
|
|
55424
55427
|
var createDesc = _propertyDesc;
|
|
55425
|
-
var _create$1 =
|
|
55428
|
+
var _create$1 = _objectCreate;
|
|
55426
55429
|
var gOPNExt = _objectGopnExt;
|
|
55427
55430
|
var $GOPD = _objectGopd;
|
|
55428
55431
|
var $GOPS = _objectGops;
|
|
@@ -55489,7 +55492,7 @@ var $defineProperty$1 = function defineProperty2(it, key2, D2) {
|
|
|
55489
55492
|
}
|
|
55490
55493
|
return dP(it, key2, D2);
|
|
55491
55494
|
};
|
|
55492
|
-
var $defineProperties = function
|
|
55495
|
+
var $defineProperties = function defineProperties2(it, P2) {
|
|
55493
55496
|
anObject(it);
|
|
55494
55497
|
var keys4 = enumKeys(P2 = toIObject(P2));
|
|
55495
55498
|
var i2 = 0;
|
|
@@ -55499,7 +55502,7 @@ var $defineProperties = function defineProperties(it, P2) {
|
|
|
55499
55502
|
$defineProperty$1(it, key2 = keys4[i2++], P2[key2]);
|
|
55500
55503
|
return it;
|
|
55501
55504
|
};
|
|
55502
|
-
var $create = function
|
|
55505
|
+
var $create = function create3(it, P2) {
|
|
55503
55506
|
return P2 === void 0 ? _create$1(it) : $defineProperties(_create$1(it), P2);
|
|
55504
55507
|
};
|
|
55505
55508
|
var $propertyIsEnumerable = function propertyIsEnumerable(key2) {
|
|
@@ -55726,9 +55729,9 @@ $export$1($export$1.S, "Object", { setPrototypeOf: require_setProto().set });
|
|
|
55726
55729
|
var setPrototypeOf$2 = _coreExports.Object.setPrototypeOf;
|
|
55727
55730
|
var setPrototypeOf$1 = { "default": setPrototypeOf$2, __esModule: true };
|
|
55728
55731
|
var $export = _export;
|
|
55729
|
-
$export($export.S, "Object", { create:
|
|
55732
|
+
$export($export.S, "Object", { create: _objectCreate });
|
|
55730
55733
|
var $Object$1 = _coreExports.Object;
|
|
55731
|
-
var create$a = function
|
|
55734
|
+
var create$a = function create4(P2, D2) {
|
|
55732
55735
|
return $Object$1.create(P2, D2);
|
|
55733
55736
|
};
|
|
55734
55737
|
var create$9 = { "default": create$a, __esModule: true };
|
|
@@ -61621,7 +61624,9 @@ const useStyles$o = makeStyles((theme) => ({
|
|
|
61621
61624
|
height: "auto",
|
|
61622
61625
|
display: "block",
|
|
61623
61626
|
paddingRight: "17px",
|
|
61627
|
+
/* Increase/decrease this value for cross-browser compatibility */
|
|
61624
61628
|
boxSizing: "content-box",
|
|
61629
|
+
/* So the width will be 100% + 17px */
|
|
61625
61630
|
"@global .rc-tree": {
|
|
61626
61631
|
paddingLeft: "0",
|
|
61627
61632
|
margin: "0",
|
|
@@ -61921,6 +61926,7 @@ const useHelpTooltipStyles = makeStyles((theme) => ({
|
|
|
61921
61926
|
maxWidth: "250px",
|
|
61922
61927
|
visibility: "visible",
|
|
61923
61928
|
paddingTop: "8px",
|
|
61929
|
+
// Assumes placement: 'top'
|
|
61924
61930
|
...helpTooltipCommon,
|
|
61925
61931
|
"@global .rc-tooltip-inner": {
|
|
61926
61932
|
fontSize: "10px",
|
|
@@ -61948,6 +61954,7 @@ const useHelpTooltipStyles = makeStyles((theme) => ({
|
|
|
61948
61954
|
cursor: "auto",
|
|
61949
61955
|
userSelect: "text",
|
|
61950
61956
|
paddingBottom: "10px",
|
|
61957
|
+
// Assumes placement: 'top'
|
|
61951
61958
|
"&.rc-tooltip-placement-top": {
|
|
61952
61959
|
paddingBottom: "10px"
|
|
61953
61960
|
},
|
|
@@ -108168,11 +108175,11 @@ class Tileset2D {
|
|
|
108168
108175
|
this._dirty = false;
|
|
108169
108176
|
}
|
|
108170
108177
|
}
|
|
108171
|
-
_getTile(index2,
|
|
108178
|
+
_getTile(index2, create6) {
|
|
108172
108179
|
const id2 = this.getTileId(index2);
|
|
108173
108180
|
let tile = this._cache.get(id2);
|
|
108174
108181
|
let needsReload = false;
|
|
108175
|
-
if (!tile &&
|
|
108182
|
+
if (!tile && create6) {
|
|
108176
108183
|
tile = new Tile2DHeader(index2);
|
|
108177
108184
|
Object.assign(tile, this.getTileMetadata(tile.index));
|
|
108178
108185
|
Object.assign(tile, {
|
|
@@ -136422,7 +136429,7 @@ var defineProperty$2 = function(object2, name2, value2, predicate) {
|
|
|
136422
136429
|
object2[name2] = value2;
|
|
136423
136430
|
}
|
|
136424
136431
|
};
|
|
136425
|
-
var
|
|
136432
|
+
var defineProperties3 = function(object2, map2) {
|
|
136426
136433
|
var predicates = arguments.length > 2 ? arguments[2] : {};
|
|
136427
136434
|
var props2 = keys$4(map2);
|
|
136428
136435
|
if (hasSymbols2) {
|
|
@@ -136432,8 +136439,8 @@ var defineProperties2 = function(object2, map2) {
|
|
|
136432
136439
|
defineProperty$2(object2, props2[i2], map2[props2[i2]], predicates[props2[i2]]);
|
|
136433
136440
|
}
|
|
136434
136441
|
};
|
|
136435
|
-
|
|
136436
|
-
var defineProperties_1 =
|
|
136442
|
+
defineProperties3.supportsDescriptors = !!supportsDescriptors$2;
|
|
136443
|
+
var defineProperties_1 = defineProperties3;
|
|
136437
136444
|
var numberIsNaN = function(value2) {
|
|
136438
136445
|
return value2 !== value2;
|
|
136439
136446
|
};
|
|
@@ -170660,16 +170667,16 @@ async function getDecoder(fileDirectory) {
|
|
|
170660
170667
|
const Decoder = await importFn();
|
|
170661
170668
|
return new Decoder(fileDirectory);
|
|
170662
170669
|
}
|
|
170663
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
170664
|
-
addDecoder(5, () => import("./lzw-
|
|
170670
|
+
addDecoder([void 0, 1], () => import("./raw-8d1263ac.js").then((m2) => m2.default));
|
|
170671
|
+
addDecoder(5, () => import("./lzw-4efdd6e5.js").then((m2) => m2.default));
|
|
170665
170672
|
addDecoder(6, () => {
|
|
170666
170673
|
throw new Error("old style JPEG compression is not supported.");
|
|
170667
170674
|
});
|
|
170668
|
-
addDecoder(7, () => import("./jpeg-
|
|
170669
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
170670
|
-
addDecoder(32773, () => import("./packbits-
|
|
170671
|
-
addDecoder(34887, () => import("./lerc-
|
|
170672
|
-
addDecoder(50001, () => import("./webimage-
|
|
170675
|
+
addDecoder(7, () => import("./jpeg-c55482b1.js").then((m2) => m2.default));
|
|
170676
|
+
addDecoder([8, 32946], () => import("./deflate-e0006b6b.js").then((m2) => m2.default));
|
|
170677
|
+
addDecoder(32773, () => import("./packbits-abe82479.js").then((m2) => m2.default));
|
|
170678
|
+
addDecoder(34887, () => import("./lerc-dc81cb8d.js").then((m2) => m2.default));
|
|
170679
|
+
addDecoder(50001, () => import("./webimage-a16d5949.js").then((m2) => m2.default));
|
|
170673
170680
|
function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
|
|
170674
170681
|
return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
|
|
170675
170682
|
}
|
|
@@ -186756,18 +186763,18 @@ function selection_lower() {
|
|
|
186756
186763
|
return this.each(lower);
|
|
186757
186764
|
}
|
|
186758
186765
|
function selection_append(name2) {
|
|
186759
|
-
var
|
|
186766
|
+
var create6 = typeof name2 === "function" ? name2 : creator(name2);
|
|
186760
186767
|
return this.select(function() {
|
|
186761
|
-
return this.appendChild(
|
|
186768
|
+
return this.appendChild(create6.apply(this, arguments));
|
|
186762
186769
|
});
|
|
186763
186770
|
}
|
|
186764
186771
|
function constantNull() {
|
|
186765
186772
|
return null;
|
|
186766
186773
|
}
|
|
186767
186774
|
function selection_insert(name2, before) {
|
|
186768
|
-
var
|
|
186775
|
+
var create6 = typeof name2 === "function" ? name2 : creator(name2), select2 = before == null ? constantNull : typeof before === "function" ? before : selector(before);
|
|
186769
186776
|
return this.select(function() {
|
|
186770
|
-
return this.insertBefore(
|
|
186777
|
+
return this.insertBefore(create6.apply(this, arguments), select2.apply(this, arguments) || null);
|
|
186771
186778
|
});
|
|
186772
186779
|
}
|
|
186773
186780
|
function remove$1() {
|
|
@@ -190775,7 +190782,7 @@ var typedFunction$1 = { exports: {} };
|
|
|
190775
190782
|
function undef() {
|
|
190776
190783
|
return void 0;
|
|
190777
190784
|
}
|
|
190778
|
-
function
|
|
190785
|
+
function create6() {
|
|
190779
190786
|
var _types = [
|
|
190780
190787
|
{ name: "number", test: function(x2) {
|
|
190781
190788
|
return typeof x2 === "number";
|
|
@@ -191527,7 +191534,7 @@ var typedFunction$1 = { exports: {} };
|
|
|
191527
191534
|
return createTypedFunction(name2, extractSignatures(fns));
|
|
191528
191535
|
}
|
|
191529
191536
|
});
|
|
191530
|
-
typed2.create =
|
|
191537
|
+
typed2.create = create6;
|
|
191531
191538
|
typed2.types = _types;
|
|
191532
191539
|
typed2.conversions = _conversions;
|
|
191533
191540
|
typed2.ignore = _ignore;
|
|
@@ -191558,7 +191565,7 @@ var typedFunction$1 = { exports: {} };
|
|
|
191558
191565
|
};
|
|
191559
191566
|
return typed2;
|
|
191560
191567
|
}
|
|
191561
|
-
return
|
|
191568
|
+
return create6();
|
|
191562
191569
|
});
|
|
191563
191570
|
})(typedFunction$1);
|
|
191564
191571
|
var typedFunctionExports = typedFunction$1.exports;
|
|
@@ -192270,11 +192277,11 @@ function getArrayDataType(array2, typeOf2) {
|
|
|
192270
192277
|
}
|
|
192271
192278
|
return type3;
|
|
192272
192279
|
}
|
|
192273
|
-
function factory(name2, dependencies2,
|
|
192280
|
+
function factory(name2, dependencies2, create6, meta2) {
|
|
192274
192281
|
function assertAndCreate(scope) {
|
|
192275
192282
|
var deps = pickShallow(scope, dependencies2.map(stripOptionalNotation));
|
|
192276
192283
|
assertDependencies(name2, dependencies2, scope);
|
|
192277
|
-
return
|
|
192284
|
+
return create6(deps);
|
|
192278
192285
|
}
|
|
192279
192286
|
assertAndCreate.isFactory = true;
|
|
192280
192287
|
assertAndCreate.fn = name2;
|
|
@@ -208357,10 +208364,11 @@ class ZipFileStore {
|
|
|
208357
208364
|
const ZipFileStore$1 = ZipFileStore;
|
|
208358
208365
|
function zarrOpenRoot(url, fileType, requestInit2) {
|
|
208359
208366
|
let store2;
|
|
208367
|
+
const opts2 = requestInit2 ? { overrides: requestInit2 } : void 0;
|
|
208360
208368
|
if (fileType && fileType.endsWith(".zip")) {
|
|
208361
|
-
store2 = ZipFileStore$1.fromUrl(url,
|
|
208369
|
+
store2 = ZipFileStore$1.fromUrl(url, opts2);
|
|
208362
208370
|
} else {
|
|
208363
|
-
store2 = new FetchStore$1(url,
|
|
208371
|
+
store2 = new FetchStore$1(url, opts2);
|
|
208364
208372
|
}
|
|
208365
208373
|
return root(store2);
|
|
208366
208374
|
}
|
|
@@ -210067,10 +210075,15 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
210067
210075
|
excludeBackground: true,
|
|
210068
210076
|
onViewportLoad: () => {
|
|
210069
210077
|
},
|
|
210078
|
+
// layerProps.callback, // TODO: figure out callback implementation
|
|
210070
210079
|
colorScaleLo: 0,
|
|
210080
|
+
// TODO: check if these can be removed?
|
|
210071
210081
|
colorScaleHi: 1,
|
|
210082
|
+
// TODO: check if these can be removed?
|
|
210072
210083
|
isExpressionMode: false,
|
|
210084
|
+
// TODO: check if these can be removed?
|
|
210073
210085
|
colormap: null,
|
|
210086
|
+
// TODO: check if these can be removed?
|
|
210074
210087
|
expressionData: this.expression.data,
|
|
210075
210088
|
// There is no onHover here,
|
|
210076
210089
|
// see the onHover method of AbstractSpatialOrScatterplot.
|
|
@@ -210157,6 +210170,7 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
210157
210170
|
zSlice: layerCoordination[CoordinationType$2.SPATIAL_SLICE_Z],
|
|
210158
210171
|
onViewportLoad: () => {
|
|
210159
210172
|
},
|
|
210173
|
+
// layerProps.callback, // TODO: figure out callback implementation
|
|
210160
210174
|
excludeBackground: useTransparentColor,
|
|
210161
210175
|
extensions,
|
|
210162
210176
|
// Picking / onHover on the root DeckGL component
|
|
@@ -210349,7 +210363,9 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
210349
210363
|
}
|
|
210350
210364
|
this.segmentationColors[layerScope][channelScope] = {
|
|
210351
210365
|
setColorIndices: obsColorIndices,
|
|
210366
|
+
// The Map from cell ID to color index.
|
|
210352
210367
|
setColors: obsSetColor,
|
|
210368
|
+
// The array with [{ path, color: [r, g, b] }, ...].
|
|
210353
210369
|
obsIndex: layerIndex
|
|
210354
210370
|
// TODO: how to ensure obsIndex.length matches the number of cells
|
|
210355
210371
|
};
|
|
@@ -216439,7 +216455,9 @@ const useStyles$i = makeStyles((theme) => ({
|
|
|
216439
216455
|
/* background-color only for content */
|
|
216440
216456
|
backgroundClip: "content-box",
|
|
216441
216457
|
border: `2px solid ${theme.palette.grayLight}`,
|
|
216458
|
+
// map-get($global-colors, "gray-light");
|
|
216442
216459
|
backgroundColor: theme.palette.grayLight,
|
|
216460
|
+
// map-get($global-colors, "gray-light");
|
|
216443
216461
|
"&:checked": {
|
|
216444
216462
|
backgroundClip: "unset"
|
|
216445
216463
|
}
|
|
@@ -216696,6 +216714,7 @@ const useChannelSliderStyles = makeStyles((theme) => ({
|
|
|
216696
216714
|
marginTop: "7px",
|
|
216697
216715
|
"& span": {
|
|
216698
216716
|
color: theme.palette.secondaryForeground,
|
|
216717
|
+
// Change color here
|
|
216699
216718
|
backgroundColor: theme.palette.secondaryBackgroundDim
|
|
216700
216719
|
// Change color here
|
|
216701
216720
|
}
|
|
@@ -218671,7 +218690,7 @@ const HIGLASS_BUNDLE_VERSION = "1.11.13";
|
|
|
218671
218690
|
const HIGLASS_CSS_URL = `https://unpkg.com/${HIGLASS_PKG_NAME}@${HIGLASS_BUNDLE_VERSION}/dist/hglib.css`;
|
|
218672
218691
|
register({ dataFetcher: ZarrMultivecDataFetcher_default, config: ZarrMultivecDataFetcher_default.config }, { pluginType: "dataFetcher" });
|
|
218673
218692
|
const LazyHiGlassComponent = React__default.lazy(async () => {
|
|
218674
|
-
const { HiGlassComponent } = await import("./hglib-
|
|
218693
|
+
const { HiGlassComponent } = await import("./hglib-e10f79aa.js").then((n3) => n3.h);
|
|
218675
218694
|
return { default: HiGlassComponent };
|
|
218676
218695
|
});
|
|
218677
218696
|
const HG_SIZE = 800;
|
|
@@ -242081,7 +242100,7 @@ inherits(Projection$1, Transform2, {
|
|
|
242081
242100
|
transform(_, pulse2) {
|
|
242082
242101
|
let proj = this.value;
|
|
242083
242102
|
if (!proj || _.modified("type")) {
|
|
242084
|
-
this.value = proj =
|
|
242103
|
+
this.value = proj = create5(_.type);
|
|
242085
242104
|
projectionProperties.forEach((prop) => {
|
|
242086
242105
|
if (_[prop] != null)
|
|
242087
242106
|
set$3(proj, prop, _[prop]);
|
|
@@ -242103,7 +242122,7 @@ function fit(proj, _) {
|
|
|
242103
242122
|
const data2 = collectGeoJSON(_.fit);
|
|
242104
242123
|
_.extent ? proj.fitExtent(_.extent, data2) : _.size ? proj.fitSize(_.size, data2) : 0;
|
|
242105
242124
|
}
|
|
242106
|
-
function
|
|
242125
|
+
function create5(type3) {
|
|
242107
242126
|
const constructor = projection((type3 || "mercator").toLowerCase());
|
|
242108
242127
|
if (!constructor)
|
|
242109
242128
|
error("Unrecognized projection type: " + type3);
|
|
@@ -250910,8 +250929,8 @@ function bind3(view, el2, binding) {
|
|
|
250910
250929
|
bind4.update = debounce(param2.debounce, bind4.update);
|
|
250911
250930
|
}
|
|
250912
250931
|
}
|
|
250913
|
-
const
|
|
250914
|
-
|
|
250932
|
+
const create6 = param2.input == null && param2.element ? target : generate;
|
|
250933
|
+
create6(bind4, el2, param2, view);
|
|
250915
250934
|
if (!bind4.active) {
|
|
250916
250935
|
view.on(view._signals[param2.signal], null, () => {
|
|
250917
250936
|
bind4.source ? bind4.source = false : bind4.set(view.signal(param2.signal));
|
|
@@ -277585,20 +277604,32 @@ class RasterJsonAsObsSegmentationsLoader extends RasterLoader {
|
|
|
277585
277604
|
}
|
|
277586
277605
|
}
|
|
277587
277606
|
class ZarrDataSource {
|
|
277607
|
+
/**
|
|
277608
|
+
* @param {DataSourceParams} params The parameters object.
|
|
277609
|
+
*/
|
|
277588
277610
|
constructor({ url, requestInit: requestInit2, store: store2, fileType }) {
|
|
277589
277611
|
if (store2) {
|
|
277590
277612
|
this.storeRoot = root(store2);
|
|
277591
|
-
} else {
|
|
277613
|
+
} else if (url) {
|
|
277592
277614
|
this.storeRoot = zarrOpenRoot(url, fileType, requestInit2);
|
|
277615
|
+
} else {
|
|
277616
|
+
throw new Error("Either a store or a URL must be provided to the ZarrDataSource constructor.");
|
|
277593
277617
|
}
|
|
277594
277618
|
}
|
|
277619
|
+
/**
|
|
277620
|
+
*
|
|
277621
|
+
* @param {string} path
|
|
277622
|
+
* @returns {ZarrLocation<Readable>}
|
|
277623
|
+
*/
|
|
277595
277624
|
getStoreRoot(path2) {
|
|
277596
277625
|
return this.storeRoot.resolve(path2);
|
|
277597
277626
|
}
|
|
277598
277627
|
/**
|
|
277599
|
-
*
|
|
277628
|
+
* Method for accessing JSON attributes, relative to the store root.
|
|
277600
277629
|
* @param {string} key A path to the item.
|
|
277601
|
-
* @
|
|
277630
|
+
* @param {ZarrLocation<Readable>|null} storeRootParam An optional location,
|
|
277631
|
+
* which if provided will override the default store root.
|
|
277632
|
+
* @returns {Promise<any>} This async function returns a promise
|
|
277602
277633
|
* that resolves to the parsed JSON if successful.
|
|
277603
277634
|
* @throws This may throw an error.
|
|
277604
277635
|
*/
|
|
@@ -277619,16 +277650,41 @@ function dirname(path2) {
|
|
|
277619
277650
|
}
|
|
277620
277651
|
function basename(path2) {
|
|
277621
277652
|
const arr = path2.split("/");
|
|
277622
|
-
|
|
277653
|
+
const result = arr.at(-1);
|
|
277654
|
+
if (!result) {
|
|
277655
|
+
console.error("basename of path is empty", path2);
|
|
277656
|
+
return "";
|
|
277657
|
+
}
|
|
277658
|
+
return result;
|
|
277623
277659
|
}
|
|
277624
277660
|
class AnnDataSource extends ZarrDataSource {
|
|
277625
|
-
|
|
277626
|
-
|
|
277661
|
+
/**
|
|
277662
|
+
*
|
|
277663
|
+
* @param {DataSourceParams} params
|
|
277664
|
+
*/
|
|
277665
|
+
constructor(params2) {
|
|
277666
|
+
super(params2);
|
|
277627
277667
|
this.promises = /* @__PURE__ */ new Map();
|
|
277628
277668
|
}
|
|
277669
|
+
/**
|
|
277670
|
+
*
|
|
277671
|
+
* @param {string[]} paths Paths to multiple string-valued columns
|
|
277672
|
+
* within the obs dataframe.
|
|
277673
|
+
* @returns {Promise<(undefined | string[] | string[][])[]>} Returns
|
|
277674
|
+
* each column as an array of strings,
|
|
277675
|
+
* ordered the same as the paths.
|
|
277676
|
+
*/
|
|
277629
277677
|
loadObsColumns(paths) {
|
|
277630
277678
|
return this._loadColumns(paths);
|
|
277631
277679
|
}
|
|
277680
|
+
/**
|
|
277681
|
+
*
|
|
277682
|
+
* @param {string[]} paths Paths to multiple string-valued columns
|
|
277683
|
+
* within the var dataframe.
|
|
277684
|
+
* @returns {Promise<(undefined | string[] | string[][])[]>} Returns
|
|
277685
|
+
* each column as an array of strings,
|
|
277686
|
+
* ordered the same as the paths.
|
|
277687
|
+
*/
|
|
277632
277688
|
loadVarColumns(paths) {
|
|
277633
277689
|
return this._loadColumns(paths);
|
|
277634
277690
|
}
|
|
@@ -277636,8 +277692,10 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277636
277692
|
* Class method for loading obs variables.
|
|
277637
277693
|
* Takes the location as an argument because this is shared across objects,
|
|
277638
277694
|
* which have different ways of specifying location.
|
|
277639
|
-
* @param {string[]} paths An array of strings like
|
|
277640
|
-
*
|
|
277695
|
+
* @param {string[] | string[][]} paths An array of strings like
|
|
277696
|
+
* "obs/leiden" or "obs/bulk_labels."
|
|
277697
|
+
* @returns {Promise<(undefined | string[] | string[][])[]>} A promise
|
|
277698
|
+
* for an array of ids with one per cell.
|
|
277641
277699
|
*/
|
|
277642
277700
|
_loadColumns(paths) {
|
|
277643
277701
|
const promises = paths.map((path2) => {
|
|
@@ -277649,7 +277707,10 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277649
277707
|
});
|
|
277650
277708
|
this.promises.set(col, obsPromise);
|
|
277651
277709
|
}
|
|
277652
|
-
return
|
|
277710
|
+
return (
|
|
277711
|
+
/** @type {Promise<string[]>} */
|
|
277712
|
+
this.promises.get(col)
|
|
277713
|
+
);
|
|
277653
277714
|
};
|
|
277654
277715
|
if (!path2) {
|
|
277655
277716
|
return Promise.resolve(void 0);
|
|
@@ -277661,30 +277722,35 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277661
277722
|
});
|
|
277662
277723
|
return Promise.all(promises);
|
|
277663
277724
|
}
|
|
277725
|
+
/**
|
|
277726
|
+
*
|
|
277727
|
+
* @param {string} path
|
|
277728
|
+
* @returns
|
|
277729
|
+
*/
|
|
277664
277730
|
async _loadColumn(path2) {
|
|
277665
277731
|
const { storeRoot } = this;
|
|
277666
277732
|
const prefix2 = dirname(path2);
|
|
277667
277733
|
const { categories, "encoding-type": encodingType } = await this.getJson(`${path2}/.zattrs`);
|
|
277668
277734
|
let categoriesValues;
|
|
277669
|
-
let
|
|
277735
|
+
let codesPath;
|
|
277670
277736
|
if (categories) {
|
|
277671
|
-
const { dtype } = await open(storeRoot.resolve(`/${prefix2}/${categories}`));
|
|
277737
|
+
const { dtype } = await open(storeRoot.resolve(`/${prefix2}/${categories}`), { kind: "array" });
|
|
277672
277738
|
if (dtype === "v2:object") {
|
|
277673
277739
|
categoriesValues = await this.getFlatArrDecompressed(`/${prefix2}/${categories}`);
|
|
277674
277740
|
}
|
|
277675
277741
|
} else if (encodingType === "categorical") {
|
|
277676
|
-
const { dtype } = await open(storeRoot.resolve(`/${path2}/categories`));
|
|
277742
|
+
const { dtype } = await open(storeRoot.resolve(`/${path2}/categories`), { kind: "array" });
|
|
277677
277743
|
if (dtype === "v2:object") {
|
|
277678
277744
|
categoriesValues = await this.getFlatArrDecompressed(`/${path2}/categories`);
|
|
277679
277745
|
}
|
|
277680
|
-
|
|
277746
|
+
codesPath = `/${path2}/codes`;
|
|
277681
277747
|
} else {
|
|
277682
|
-
const { dtype } = await open(storeRoot.resolve(`/${path2}`));
|
|
277748
|
+
const { dtype } = await open(storeRoot.resolve(`/${path2}`), { kind: "array" });
|
|
277683
277749
|
if (dtype === "v2:object") {
|
|
277684
277750
|
return this.getFlatArrDecompressed(path2);
|
|
277685
277751
|
}
|
|
277686
277752
|
}
|
|
277687
|
-
const arr = await open(storeRoot.resolve(
|
|
277753
|
+
const arr = await open(storeRoot.resolve(codesPath || path2), { kind: "array" });
|
|
277688
277754
|
const values3 = await get$6(arr, [null]);
|
|
277689
277755
|
const { data: data2 } = values3;
|
|
277690
277756
|
const mappedValues = Array.from(data2).map((i2) => !categoriesValues ? String(i2) : categoriesValues[i2]);
|
|
@@ -277693,7 +277759,7 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277693
277759
|
/**
|
|
277694
277760
|
* Class method for loading general numeric arrays.
|
|
277695
277761
|
* @param {string} path A string like obsm.X_pca.
|
|
277696
|
-
* @returns {Promise} A promise for a zarr array containing the data.
|
|
277762
|
+
* @returns {Promise<Chunk<any>>} A promise for a zarr array containing the data.
|
|
277697
277763
|
*/
|
|
277698
277764
|
loadNumeric(path2) {
|
|
277699
277765
|
const { storeRoot } = this;
|
|
@@ -277702,14 +277768,20 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277702
277768
|
/**
|
|
277703
277769
|
* Class method for loading specific columns of numeric arrays.
|
|
277704
277770
|
* @param {string} path A string like obsm.X_pca.
|
|
277705
|
-
* @param {number
|
|
277706
|
-
* @returns {Promise
|
|
277771
|
+
* @param {[number, number]} dims The column indices to load.
|
|
277772
|
+
* @returns {Promise<{
|
|
277773
|
+
* data: [ZarrTypedArray<any>, ZarrTypedArray<any>],
|
|
277774
|
+
* shape: [number, number],
|
|
277775
|
+
* }>} A promise for a zarr array containing the data.
|
|
277707
277776
|
*/
|
|
277708
277777
|
loadNumericForDims(path2, dims) {
|
|
277709
277778
|
const { storeRoot } = this;
|
|
277710
277779
|
const arr = open(storeRoot.resolve(path2), { kind: "array" });
|
|
277711
277780
|
return Promise.all(dims.map((dim) => arr.then((loadedArr) => get$6(loadedArr, [null, dim])))).then((cols) => ({
|
|
277712
|
-
data:
|
|
277781
|
+
data: (
|
|
277782
|
+
/** @type {[ZarrTypedArray<any>, ZarrTypedArray<any>]} */
|
|
277783
|
+
cols.map((col) => col.data)
|
|
277784
|
+
),
|
|
277713
277785
|
shape: [dims.length, cols[0].shape[0]]
|
|
277714
277786
|
}));
|
|
277715
277787
|
}
|
|
@@ -277717,7 +277789,7 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277717
277789
|
* A common method for loading flattened data
|
|
277718
277790
|
* i.e that which has shape [n] where n is a natural number.
|
|
277719
277791
|
* @param {string} path A path to a flat array location, like obs/_index
|
|
277720
|
-
* @returns {
|
|
277792
|
+
* @returns {Promise<string[]>} The data from the zarr array.
|
|
277721
277793
|
*/
|
|
277722
277794
|
async getFlatArrDecompressed(path2) {
|
|
277723
277795
|
const { storeRoot } = this;
|
|
@@ -277726,13 +277798,18 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277726
277798
|
if (data2.data?.[Symbol.iterator]) {
|
|
277727
277799
|
return Array.from(data2.data);
|
|
277728
277800
|
}
|
|
277729
|
-
return
|
|
277801
|
+
return (
|
|
277802
|
+
/** @type {string[]} */
|
|
277803
|
+
data2.data
|
|
277804
|
+
);
|
|
277730
277805
|
}
|
|
277731
277806
|
/**
|
|
277732
277807
|
* Class method for loading the obs index.
|
|
277733
|
-
* @
|
|
277808
|
+
* @param {string|undefined} path Used by subclasses.
|
|
277809
|
+
* @returns {Promise<string[]>} An promise for a zarr array
|
|
277810
|
+
* containing the indices.
|
|
277734
277811
|
*/
|
|
277735
|
-
loadObsIndex() {
|
|
277812
|
+
loadObsIndex(path2 = void 0) {
|
|
277736
277813
|
if (this.obsIndex) {
|
|
277737
277814
|
return this.obsIndex;
|
|
277738
277815
|
}
|
|
@@ -277741,9 +277818,10 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277741
277818
|
}
|
|
277742
277819
|
/**
|
|
277743
277820
|
* Class method for loading the var index.
|
|
277744
|
-
* @
|
|
277821
|
+
* @param {string|undefined} path Used by subclasses.
|
|
277822
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the indices.
|
|
277745
277823
|
*/
|
|
277746
|
-
loadVarIndex() {
|
|
277824
|
+
loadVarIndex(path2 = void 0) {
|
|
277747
277825
|
if (this.varIndex) {
|
|
277748
277826
|
return this.varIndex;
|
|
277749
277827
|
}
|
|
@@ -277752,58 +277830,107 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277752
277830
|
}
|
|
277753
277831
|
/**
|
|
277754
277832
|
* Class method for loading the var alias.
|
|
277755
|
-
* @
|
|
277833
|
+
* @param {string} varPath
|
|
277834
|
+
* @param {string|undefined} matrixPath
|
|
277835
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the aliased names.
|
|
277756
277836
|
*/
|
|
277757
|
-
async loadVarAlias(varPath) {
|
|
277837
|
+
async loadVarAlias(varPath, matrixPath = void 0) {
|
|
277758
277838
|
if (this.varAlias) {
|
|
277759
277839
|
return this.varAlias;
|
|
277760
277840
|
}
|
|
277761
277841
|
[this.varAlias] = await this.loadVarColumns([varPath]);
|
|
277762
277842
|
const index2 = await this.loadVarIndex();
|
|
277763
|
-
this.varAlias = this.varAlias.map(
|
|
277843
|
+
this.varAlias = this.varAlias.map(
|
|
277844
|
+
/** @type {(val: string, ind: number) => string} */
|
|
277845
|
+
(val, ind) => val ? val.concat(` (${index2[ind]})`) : index2[ind]
|
|
277846
|
+
);
|
|
277764
277847
|
return this.varAlias;
|
|
277765
277848
|
}
|
|
277849
|
+
/**
|
|
277850
|
+
*
|
|
277851
|
+
* @param {string} path
|
|
277852
|
+
* @returns {Promise<object>}
|
|
277853
|
+
*/
|
|
277766
277854
|
async _loadAttrs(path2) {
|
|
277767
277855
|
return this.getJson(`${path2}/.zattrs`);
|
|
277768
277856
|
}
|
|
277857
|
+
/**
|
|
277858
|
+
*
|
|
277859
|
+
* @param {string} path
|
|
277860
|
+
* @returns {Promise<string>}
|
|
277861
|
+
*/
|
|
277769
277862
|
async _loadString(path2) {
|
|
277770
277863
|
const { storeRoot } = this;
|
|
277771
|
-
const
|
|
277772
|
-
if (
|
|
277773
|
-
const
|
|
277774
|
-
|
|
277775
|
-
|
|
277864
|
+
const zattrs = await this._loadAttrs(path2);
|
|
277865
|
+
if ("encoding-type" in zattrs && "encoding-version" in zattrs) {
|
|
277866
|
+
const { "encoding-type": encodingType, "encoding-version": encodingVersion } = zattrs;
|
|
277867
|
+
if (encodingType === "string" && encodingVersion === "0.2.0") {
|
|
277868
|
+
const arr = await open(storeRoot.resolve(path2), { kind: "array" });
|
|
277869
|
+
const { data: data2 } = (
|
|
277870
|
+
/** @type {{ data: ByteStringArray }} */
|
|
277871
|
+
await arr.getChunk([])
|
|
277872
|
+
);
|
|
277873
|
+
return data2.get(0);
|
|
277874
|
+
}
|
|
277875
|
+
throw new Error(`Unsupported encoding type ${encodingType} and version ${encodingVersion} in AnnDataSource._loadString`);
|
|
277776
277876
|
}
|
|
277777
|
-
throw new Error(
|
|
277877
|
+
throw new Error("Keys for encoding-type or encoding-version not found in AnnDataSource._loadString");
|
|
277778
277878
|
}
|
|
277879
|
+
/**
|
|
277880
|
+
*
|
|
277881
|
+
* @param {string} path
|
|
277882
|
+
* @returns {Promise<string[]>}
|
|
277883
|
+
*/
|
|
277779
277884
|
async _loadStringArray(path2) {
|
|
277780
|
-
const
|
|
277781
|
-
if (
|
|
277782
|
-
|
|
277885
|
+
const zattrs = await this._loadAttrs(path2);
|
|
277886
|
+
if ("encoding-type" in zattrs && "encoding-version" in zattrs) {
|
|
277887
|
+
const { "encoding-type": encodingType, "encoding-version": encodingVersion } = zattrs;
|
|
277888
|
+
if (encodingType === "string-array" && encodingVersion === "0.2.0") {
|
|
277889
|
+
return this.getFlatArrDecompressed(path2);
|
|
277890
|
+
}
|
|
277891
|
+
throw new Error(`Unsupported encoding type ${encodingType} and version ${encodingVersion} in AnnDataSource._loadStringArray`);
|
|
277783
277892
|
}
|
|
277784
|
-
throw new Error(
|
|
277893
|
+
throw new Error("Keys for encoding-type or encoding-version not found in AnnDataSource._loadString");
|
|
277785
277894
|
}
|
|
277895
|
+
/**
|
|
277896
|
+
*
|
|
277897
|
+
* @param {string} path
|
|
277898
|
+
* @returns
|
|
277899
|
+
*/
|
|
277786
277900
|
async _loadElement(path2) {
|
|
277787
|
-
const
|
|
277788
|
-
if (
|
|
277789
|
-
|
|
277790
|
-
|
|
277791
|
-
|
|
277792
|
-
|
|
277901
|
+
const zattrs = await this._loadAttrs(path2);
|
|
277902
|
+
if ("encoding-type" in zattrs) {
|
|
277903
|
+
const { "encoding-type": encodingType } = zattrs;
|
|
277904
|
+
if (encodingType === "string") {
|
|
277905
|
+
return this._loadString(path2);
|
|
277906
|
+
}
|
|
277907
|
+
if (encodingType === "string-array") {
|
|
277908
|
+
return this._loadStringArray(path2);
|
|
277909
|
+
}
|
|
277793
277910
|
}
|
|
277794
277911
|
return null;
|
|
277795
277912
|
}
|
|
277913
|
+
/**
|
|
277914
|
+
*
|
|
277915
|
+
* @param {string} path
|
|
277916
|
+
* @param {string[]} keys
|
|
277917
|
+
* @returns
|
|
277918
|
+
*/
|
|
277796
277919
|
async _loadDict(path2, keys4) {
|
|
277797
|
-
const
|
|
277798
|
-
if (
|
|
277799
|
-
const
|
|
277800
|
-
|
|
277801
|
-
const
|
|
277802
|
-
|
|
277803
|
-
|
|
277804
|
-
|
|
277920
|
+
const zattrs = await this._loadAttrs(path2);
|
|
277921
|
+
if ("encoding-type" in zattrs && "encoding-version" in zattrs) {
|
|
277922
|
+
const { "encoding-type": encodingType, "encoding-version": encodingVersion } = zattrs;
|
|
277923
|
+
if (encodingType === "dict" && encodingVersion === "0.1.0") {
|
|
277924
|
+
const result = {};
|
|
277925
|
+
await Promise.all(keys4.map(async (key2) => {
|
|
277926
|
+
const val = await this._loadElement(`${path2}/${key2}`);
|
|
277927
|
+
result[key2] = val;
|
|
277928
|
+
}));
|
|
277929
|
+
return result;
|
|
277930
|
+
}
|
|
277931
|
+
throw new Error(`Unsupported encoding type ${encodingType} and version ${encodingVersion} in AnnDataSource._loadDict`);
|
|
277805
277932
|
}
|
|
277806
|
-
throw new Error(
|
|
277933
|
+
throw new Error("Keys for encoding-type or encoding-version not found in AnnDataSource._loadString");
|
|
277807
277934
|
}
|
|
277808
277935
|
}
|
|
277809
277936
|
const regex$2 = /^mod\/([^/]*)\/(.*)$/;
|
|
@@ -277888,17 +278015,30 @@ function getVarPath$1(arrPath) {
|
|
|
277888
278015
|
return `${getTablePrefix(arrPath)}var`;
|
|
277889
278016
|
}
|
|
277890
278017
|
class SpatialDataTableSource extends AnnDataSource {
|
|
278018
|
+
/**
|
|
278019
|
+
*
|
|
278020
|
+
* @param {DataSourceParams} params
|
|
278021
|
+
*/
|
|
278022
|
+
constructor(params2) {
|
|
278023
|
+
super(params2);
|
|
278024
|
+
this.obsIndices = {};
|
|
278025
|
+
this.varIndices = {};
|
|
278026
|
+
this.varAliases = {};
|
|
278027
|
+
}
|
|
278028
|
+
/**
|
|
278029
|
+
*
|
|
278030
|
+
* @param {string} tablePath
|
|
278031
|
+
* @returns
|
|
278032
|
+
*/
|
|
277891
278033
|
async loadSpatialDataAttrs(tablePath) {
|
|
277892
278034
|
return this._loadDict(`${tablePath}uns/spatialdata_attrs`, ["instance_key", "region", "region_key"]);
|
|
277893
278035
|
}
|
|
277894
278036
|
/**
|
|
277895
278037
|
* Class method for loading the obs index.
|
|
277896
|
-
* @
|
|
278038
|
+
* @param {string|undefined} path
|
|
278039
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the indices.
|
|
277897
278040
|
*/
|
|
277898
|
-
async loadObsIndex(path2 =
|
|
277899
|
-
if (!this.obsIndex) {
|
|
277900
|
-
this.obsIndex = {};
|
|
277901
|
-
}
|
|
278041
|
+
async loadObsIndex(path2 = void 0) {
|
|
277902
278042
|
const obsPath = getObsPath(path2);
|
|
277903
278043
|
const { _index } = await this.getJson(`${obsPath}/.zattrs`);
|
|
277904
278044
|
let indexPath = `${obsPath}/${_index}`;
|
|
@@ -277909,43 +278049,41 @@ class SpatialDataTableSource extends AnnDataSource {
|
|
|
277909
278049
|
// region,
|
|
277910
278050
|
} = await this.loadSpatialDataAttrs(getTablePrefix(path2));
|
|
277911
278051
|
indexPath = `${obsPath}/${instanceKey}`;
|
|
277912
|
-
if (this.
|
|
277913
|
-
return this.
|
|
278052
|
+
if (indexPath in this.obsIndices) {
|
|
278053
|
+
return this.obsIndices[indexPath];
|
|
277914
278054
|
}
|
|
277915
|
-
this.
|
|
277916
|
-
return this.
|
|
278055
|
+
this.obsIndices[indexPath] = this._loadColumn(indexPath);
|
|
278056
|
+
return this.obsIndices[indexPath];
|
|
277917
278057
|
}
|
|
277918
278058
|
/**
|
|
277919
278059
|
* Class method for loading the var index.
|
|
277920
|
-
* @
|
|
278060
|
+
* @param {string|undefined} path
|
|
278061
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the indices.
|
|
277921
278062
|
*/
|
|
277922
|
-
loadVarIndex(path2 =
|
|
277923
|
-
if (!this.varIndex) {
|
|
277924
|
-
this.varIndex = {};
|
|
277925
|
-
}
|
|
278063
|
+
loadVarIndex(path2 = void 0) {
|
|
277926
278064
|
const varPath = getVarPath$1(path2);
|
|
277927
|
-
if (this.
|
|
277928
|
-
return this.
|
|
278065
|
+
if (varPath in this.varIndices) {
|
|
278066
|
+
return this.varIndices[varPath];
|
|
277929
278067
|
}
|
|
277930
|
-
this.
|
|
277931
|
-
return this.
|
|
278068
|
+
this.varIndices[varPath] = this.getJson(`${varPath}/.zattrs`).then(({ _index }) => this.getFlatArrDecompressed(`${varPath}/${_index}`));
|
|
278069
|
+
return this.varIndices[varPath];
|
|
277932
278070
|
}
|
|
277933
278071
|
/**
|
|
277934
278072
|
* Class method for loading the var alias.
|
|
277935
|
-
* @
|
|
278073
|
+
* @param {string} varPath
|
|
278074
|
+
* @param {string} matrixPath
|
|
278075
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the aliased names.
|
|
277936
278076
|
*/
|
|
277937
278077
|
async loadVarAlias(varPath, matrixPath) {
|
|
277938
|
-
if (
|
|
277939
|
-
this.
|
|
277940
|
-
}
|
|
277941
|
-
if (this.varAlias[varPath]) {
|
|
277942
|
-
return this.varAlias[varPath];
|
|
278078
|
+
if (varPath in this.varAliases) {
|
|
278079
|
+
return this.varAliases[varPath];
|
|
277943
278080
|
}
|
|
277944
278081
|
const [varAliasData] = await this.loadVarColumns([varPath]);
|
|
277945
|
-
this.
|
|
278082
|
+
this.varAliases[varPath] = /** @type {string[]} */
|
|
278083
|
+
varAliasData;
|
|
277946
278084
|
const index2 = await this.loadVarIndex(matrixPath);
|
|
277947
|
-
this.
|
|
277948
|
-
return this.
|
|
278085
|
+
this.varAliases[varPath] = this.varAliases[varPath].map((val, ind) => val ? val.concat(` (${index2[ind]})`) : index2[ind]);
|
|
278086
|
+
return this.varAliases[varPath];
|
|
277949
278087
|
}
|
|
277950
278088
|
}
|
|
277951
278089
|
const regex = /^shapes\/([^/]*)\/(.*)$/;
|
|
@@ -277965,17 +278103,31 @@ function getVarPath(arrPath) {
|
|
|
277965
278103
|
return `${getShapesPrefix(arrPath)}var`;
|
|
277966
278104
|
}
|
|
277967
278105
|
class SpatialDataShapesSource extends AnnDataSource {
|
|
278106
|
+
/**
|
|
278107
|
+
*
|
|
278108
|
+
* @param {DataSourceParams} params
|
|
278109
|
+
*/
|
|
278110
|
+
constructor(params2) {
|
|
278111
|
+
super(params2);
|
|
278112
|
+
this.obsIndices = {};
|
|
278113
|
+
this.varIndices = {};
|
|
278114
|
+
this.varAliases = {};
|
|
278115
|
+
}
|
|
278116
|
+
/**
|
|
278117
|
+
*
|
|
278118
|
+
* @param {string} tablePath
|
|
278119
|
+
* @returns
|
|
278120
|
+
*/
|
|
277968
278121
|
async loadSpatialDataAttrs(tablePath) {
|
|
277969
278122
|
return this._loadDict(`${tablePath}/uns/spatialdata_attrs`, ["instance_key", "region", "region_key"]);
|
|
277970
278123
|
}
|
|
277971
278124
|
/**
|
|
277972
278125
|
* Class method for loading the obs index.
|
|
277973
|
-
* @
|
|
278126
|
+
* @param {string|undefined} path
|
|
278127
|
+
* @param {string|undefined} tablePath
|
|
278128
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the indices.
|
|
277974
278129
|
*/
|
|
277975
|
-
async loadObsIndex(path2 =
|
|
277976
|
-
if (!this.obsIndex) {
|
|
277977
|
-
this.obsIndex = {};
|
|
277978
|
-
}
|
|
278130
|
+
async loadObsIndex(path2 = void 0, tablePath = void 0) {
|
|
277979
278131
|
let indexPath = getIndexPath(path2);
|
|
277980
278132
|
if (tablePath) {
|
|
277981
278133
|
const obsPath = `${tablePath}/obs`;
|
|
@@ -277989,43 +278141,41 @@ class SpatialDataShapesSource extends AnnDataSource {
|
|
|
277989
278141
|
} = await this.loadSpatialDataAttrs(tablePath);
|
|
277990
278142
|
indexPath = `${obsPath}/${instanceKey}`;
|
|
277991
278143
|
}
|
|
277992
|
-
if (this.
|
|
277993
|
-
return this.
|
|
278144
|
+
if (indexPath in this.obsIndices) {
|
|
278145
|
+
return this.obsIndices[indexPath];
|
|
277994
278146
|
}
|
|
277995
|
-
this.
|
|
277996
|
-
return this.
|
|
278147
|
+
this.obsIndices[indexPath] = this._loadColumn(indexPath);
|
|
278148
|
+
return this.obsIndices[indexPath];
|
|
277997
278149
|
}
|
|
277998
278150
|
/**
|
|
277999
278151
|
* Class method for loading the var index.
|
|
278000
|
-
* @
|
|
278152
|
+
* @param {string|undefined} path
|
|
278153
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the indices.
|
|
278001
278154
|
*/
|
|
278002
|
-
loadVarIndex(path2 =
|
|
278003
|
-
if (!this.varIndex) {
|
|
278004
|
-
this.varIndex = {};
|
|
278005
|
-
}
|
|
278155
|
+
loadVarIndex(path2 = void 0) {
|
|
278006
278156
|
const varPath = getVarPath(path2);
|
|
278007
|
-
if (this.
|
|
278008
|
-
return this.
|
|
278157
|
+
if (varPath in this.varIndices) {
|
|
278158
|
+
return this.varIndices[varPath];
|
|
278009
278159
|
}
|
|
278010
|
-
this.
|
|
278011
|
-
return this.
|
|
278160
|
+
this.varIndices[varPath] = this.getJson(`${varPath}/.zattrs`).then(({ _index }) => this.getFlatArrDecompressed(`${varPath}/${_index}`));
|
|
278161
|
+
return this.varIndices[varPath];
|
|
278012
278162
|
}
|
|
278013
278163
|
/**
|
|
278014
278164
|
* Class method for loading the var alias.
|
|
278015
|
-
* @
|
|
278165
|
+
* @param {string} varPath
|
|
278166
|
+
* @param {string} matrixPath
|
|
278167
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the aliased names.
|
|
278016
278168
|
*/
|
|
278017
278169
|
async loadVarAlias(varPath, matrixPath) {
|
|
278018
|
-
if (
|
|
278019
|
-
this.
|
|
278020
|
-
}
|
|
278021
|
-
if (this.varAlias[varPath]) {
|
|
278022
|
-
return this.varAlias[varPath];
|
|
278170
|
+
if (varPath in this.varAliases) {
|
|
278171
|
+
return this.varAliases[varPath];
|
|
278023
278172
|
}
|
|
278024
278173
|
const [varAliasData] = await this.loadVarColumns([varPath]);
|
|
278025
|
-
this.
|
|
278174
|
+
this.varAliases[varPath] = /** @type {string[]} */
|
|
278175
|
+
varAliasData;
|
|
278026
278176
|
const index2 = await this.loadVarIndex(matrixPath);
|
|
278027
|
-
this.
|
|
278028
|
-
return this.
|
|
278177
|
+
this.varAliases[varPath] = this.varAliases[varPath].map((val, ind) => val ? val.concat(` (${index2[ind]})`) : index2[ind]);
|
|
278178
|
+
return this.varAliases[varPath];
|
|
278029
278179
|
}
|
|
278030
278180
|
}
|
|
278031
278181
|
class MatrixZarrAsObsFeatureMatrixLoader extends AbstractTwoStepLoader {
|
|
@@ -278371,20 +278521,29 @@ class ObsFeatureMatrixAnndataLoader extends AbstractTwoStepLoader {
|
|
|
278371
278521
|
class ObsEmbeddingAnndataLoader extends AbstractTwoStepLoader {
|
|
278372
278522
|
/**
|
|
278373
278523
|
* Class method for loading embedding coordinates, such as those from UMAP or t-SNE.
|
|
278374
|
-
* @returns {Promise} A promise for an array of columns.
|
|
278524
|
+
* @returns {Promise<MatrixResult>} A promise for an array of columns.
|
|
278375
278525
|
*/
|
|
278376
|
-
loadEmbedding() {
|
|
278526
|
+
async loadEmbedding() {
|
|
278377
278527
|
const { path: path2, dims = [0, 1] } = this.options;
|
|
278378
278528
|
if (this.embedding) {
|
|
278379
|
-
return
|
|
278529
|
+
return (
|
|
278530
|
+
/** @type {Promise<MatrixResult>} */
|
|
278531
|
+
this.embedding
|
|
278532
|
+
);
|
|
278380
278533
|
}
|
|
278381
278534
|
if (!this.embedding) {
|
|
278382
278535
|
this.embedding = this.dataSource.loadNumericForDims(path2, dims);
|
|
278383
|
-
return
|
|
278536
|
+
return (
|
|
278537
|
+
/** @type {Promise<MatrixResult>} */
|
|
278538
|
+
this.embedding
|
|
278539
|
+
);
|
|
278384
278540
|
}
|
|
278385
|
-
this.embedding = Promise.resolve(null);
|
|
278386
278541
|
return this.embedding;
|
|
278387
278542
|
}
|
|
278543
|
+
/**
|
|
278544
|
+
*
|
|
278545
|
+
* @returns {Promise<LoaderResult<ObsEmbeddingData>>}
|
|
278546
|
+
*/
|
|
278388
278547
|
async load() {
|
|
278389
278548
|
const { path: path2 } = this.options;
|
|
278390
278549
|
const superResult = await super.load().catch((reason) => Promise.resolve(reason));
|
|
@@ -278685,9 +278844,9 @@ class ObsLabelsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
278685
278844
|
class FeatureLabelsAnndataLoader extends AbstractTwoStepLoader {
|
|
278686
278845
|
/**
|
|
278687
278846
|
* Class method for loading feature string labels.
|
|
278688
|
-
* @returns {Promise} A promise for the array.
|
|
278847
|
+
* @returns {Promise<string[]>} A promise for the array.
|
|
278689
278848
|
*/
|
|
278690
|
-
loadLabels() {
|
|
278849
|
+
async loadLabels() {
|
|
278691
278850
|
const { path: path2 } = this.options;
|
|
278692
278851
|
if (this.labels) {
|
|
278693
278852
|
return this.labels;
|
|
@@ -278696,9 +278855,12 @@ class FeatureLabelsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
278696
278855
|
this.labels = this.dataSource._loadColumn(path2);
|
|
278697
278856
|
return this.labels;
|
|
278698
278857
|
}
|
|
278699
|
-
this.labels = Promise.resolve(null);
|
|
278700
278858
|
return this.labels;
|
|
278701
278859
|
}
|
|
278860
|
+
/**
|
|
278861
|
+
*
|
|
278862
|
+
* @returns {Promise<LoaderResult<FeatureLabelsData>>}
|
|
278863
|
+
*/
|
|
278702
278864
|
async load() {
|
|
278703
278865
|
const { path: path2 } = this.options;
|
|
278704
278866
|
const superResult = await super.load().catch((reason) => Promise.resolve(reason));
|
|
@@ -278714,7 +278876,7 @@ class FeatureLabelsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
278714
278876
|
]).then(([featureIndex, featureLabels]) => Promise.resolve(new LoaderResult({
|
|
278715
278877
|
featureIndex,
|
|
278716
278878
|
featureLabels,
|
|
278717
|
-
featureLabelsMap: new Map(featureIndex.map((key2, i2) => [key2, featureLabels[i2]]))
|
|
278879
|
+
featureLabelsMap: new Map(featureIndex.map((key2, i2) => [key2, featureLabels?.[i2]]))
|
|
278718
278880
|
}, null)));
|
|
278719
278881
|
}
|
|
278720
278882
|
}
|
|
@@ -278936,6 +279098,7 @@ class ImageWrapper {
|
|
|
278936
279098
|
name: channel.Name || `Channel ${i2}`,
|
|
278937
279099
|
defaultColor: channel.Color ? channel.Color : void 0,
|
|
278938
279100
|
defaultWindow: void 0,
|
|
279101
|
+
// TODO: does OME-TIFF support this?
|
|
278939
279102
|
autoDefaultColor: VIEWER_PALETTE[i2 % VIEWER_PALETTE.length]
|
|
278940
279103
|
}));
|
|
278941
279104
|
}
|
|
@@ -279173,7 +279336,9 @@ class OmeZarrLoader extends AbstractTwoStepLoader {
|
|
|
279173
279336
|
return Promise.resolve(new LoaderResult({
|
|
279174
279337
|
image: {
|
|
279175
279338
|
loaders: imageLayerLoaders,
|
|
279339
|
+
// TODO: replace with imageWrapper
|
|
279176
279340
|
meta: imageLayerMeta,
|
|
279341
|
+
// TODO: replace with imageWrapper
|
|
279177
279342
|
instance: imageWrapper
|
|
279178
279343
|
// TODO: make this the root value of LoaderResult.image.
|
|
279179
279344
|
},
|
|
@@ -279440,7 +279605,9 @@ class OmeTiffLoader extends AbstractTwoStepLoader {
|
|
|
279440
279605
|
return new LoaderResult({
|
|
279441
279606
|
image: {
|
|
279442
279607
|
loaders: imageLayerLoaders,
|
|
279608
|
+
// TODO: replace with imageWrapper
|
|
279443
279609
|
meta: imageLayerMeta,
|
|
279610
|
+
// TODO: replace with imageWrapper
|
|
279444
279611
|
instance: imageWrapper
|
|
279445
279612
|
// TODO: make this the root value of LoaderResult.image.
|
|
279446
279613
|
},
|
|
@@ -279523,7 +279690,9 @@ class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
|
|
|
279523
279690
|
obsSegmentationsType: "bitmask",
|
|
279524
279691
|
obsSegmentations: {
|
|
279525
279692
|
loaders: imageLayerLoaders,
|
|
279693
|
+
// TODO: replace with imageWrapper
|
|
279526
279694
|
meta: imageLayerMeta,
|
|
279695
|
+
// TODO: replace with imageWrapper
|
|
279527
279696
|
instance: imageWrapper
|
|
279528
279697
|
// TODO: make this the root value of LoaderResult.image.
|
|
279529
279698
|
}
|
|
@@ -280247,6 +280416,7 @@ const baseCoordinationTypes = [
|
|
|
280247
280416
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_LAYER_VISIBLE, true, z.boolean()),
|
|
280248
280417
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_LAYER_OPACITY, 1, z.number()),
|
|
280249
280418
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_LAYER_COLORMAP, null, z.string().nullable()),
|
|
280419
|
+
// TODO: enum to be more strict
|
|
280250
280420
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_LAYER_TRANSPARENT_COLOR, null, z.array(z.number()).length(3).nullable()),
|
|
280251
280421
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_LAYER_MODEL_MATRIX, null, z.array(z.number()).length(16).nullable()),
|
|
280252
280422
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_CHANNEL_VISIBLE, true, z.boolean()),
|