@vitessce/dev 3.3.8 → 3.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{deflate-b02ff1d4.js → deflate-632f7db0.js} +1 -1
- package/dist/{hglib-00c8df12.js → hglib-fecfe463.js} +1 -1
- package/dist/{index-740a95af.js → index-0a4e4af9.js} +348 -161
- package/dist/index.js +1 -1
- package/dist/{jpeg-986fe1c3.js → jpeg-8148bfbc.js} +1 -1
- package/dist/{lerc-ca2cec1b.js → lerc-42581c23.js} +1 -1
- package/dist/{lzw-5305eb8a.js → lzw-585ded9f.js} +1 -1
- package/dist/{packbits-fd7c693c.js → packbits-629a9c3a.js} +1 -1
- package/dist/{raw-9d2155cb.js → raw-7452dc66.js} +1 -1
- package/dist/{webimage-221468f4.js → webimage-f847a2ad.js} +1 -1
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default from "react";
|
|
2
2
|
import ReactDOM__default from "react-dom";
|
|
3
|
-
import { c as commonjsGlobal, o as objectAssign, g as getDefaultExportFromCjs, e as earcut, b as getAugmentedNamespace } from "./index-
|
|
3
|
+
import { c as commonjsGlobal, o as objectAssign, g as getDefaultExportFromCjs, e as earcut, b as getAugmentedNamespace } from "./index-0a4e4af9.js";
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
5
5
|
for (var i = 0; i < m.length; i++) {
|
|
6
6
|
const e = m[i];
|
|
@@ -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.10";
|
|
779
|
+
const date$5 = "2024-04-01";
|
|
775
780
|
const branch = "changeset-release/main";
|
|
776
|
-
const hash$1 = "
|
|
781
|
+
const hash$1 = "bed2e0da";
|
|
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,
|
|
@@ -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
|
|
@@ -54865,10 +54892,10 @@ var _objectKeysInternal = function(object2, names) {
|
|
|
54865
54892
|
return result;
|
|
54866
54893
|
};
|
|
54867
54894
|
var _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");
|
|
54868
|
-
var $keys$
|
|
54895
|
+
var $keys$2 = _objectKeysInternal;
|
|
54869
54896
|
var enumBugKeys$1 = _enumBugKeys;
|
|
54870
54897
|
var _objectKeys$1 = Object.keys || function keys(O) {
|
|
54871
|
-
return $keys$
|
|
54898
|
+
return $keys$2(O, enumBugKeys$1);
|
|
54872
54899
|
};
|
|
54873
54900
|
var _objectGops = {};
|
|
54874
54901
|
_objectGops.f = Object.getOwnPropertySymbols;
|
|
@@ -55339,20 +55366,13 @@ var _isArray = Array.isArray || function isArray(arg) {
|
|
|
55339
55366
|
};
|
|
55340
55367
|
var _objectGopnExt = {};
|
|
55341
55368
|
var _objectGopn = {};
|
|
55342
|
-
var
|
|
55343
|
-
|
|
55344
|
-
|
|
55345
|
-
|
|
55346
|
-
|
|
55347
|
-
var $keys2 = _objectKeysInternal;
|
|
55348
|
-
var hiddenKeys = _enumBugKeys.concat("length", "prototype");
|
|
55349
|
-
_objectGopn.f = Object.getOwnPropertyNames || function getOwnPropertyNames4(O) {
|
|
55350
|
-
return $keys2(O, hiddenKeys);
|
|
55351
|
-
};
|
|
55352
|
-
return _objectGopn;
|
|
55353
|
-
}
|
|
55369
|
+
var $keys$1 = _objectKeysInternal;
|
|
55370
|
+
var hiddenKeys = _enumBugKeys.concat("length", "prototype");
|
|
55371
|
+
_objectGopn.f = Object.getOwnPropertyNames || function getOwnPropertyNames2(O) {
|
|
55372
|
+
return $keys$1(O, hiddenKeys);
|
|
55373
|
+
};
|
|
55354
55374
|
var toIObject$2 = _toIobject;
|
|
55355
|
-
var gOPN$1 =
|
|
55375
|
+
var gOPN$1 = _objectGopn.f;
|
|
55356
55376
|
var toString$3 = {}.toString;
|
|
55357
55377
|
var windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
|
|
55358
55378
|
var getWindowNames = function(it) {
|
|
@@ -55362,7 +55382,7 @@ var getWindowNames = function(it) {
|
|
|
55362
55382
|
return windowNames.slice();
|
|
55363
55383
|
}
|
|
55364
55384
|
};
|
|
55365
|
-
_objectGopnExt.f = function
|
|
55385
|
+
_objectGopnExt.f = function getOwnPropertyNames3(it) {
|
|
55366
55386
|
return windowNames && toString$3.call(it) == "[object Window]" ? getWindowNames(it) : gOPN$1(toIObject$2(it));
|
|
55367
55387
|
};
|
|
55368
55388
|
var _objectGopd = {};
|
|
@@ -55501,7 +55521,7 @@ var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor3(it, key2) {
|
|
|
55501
55521
|
D2.enumerable = true;
|
|
55502
55522
|
return D2;
|
|
55503
55523
|
};
|
|
55504
|
-
var $getOwnPropertyNames = function
|
|
55524
|
+
var $getOwnPropertyNames = function getOwnPropertyNames4(it) {
|
|
55505
55525
|
var names = gOPN(toIObject(it));
|
|
55506
55526
|
var result = [];
|
|
55507
55527
|
var i2 = 0;
|
|
@@ -55545,7 +55565,7 @@ if (!USE_NATIVE) {
|
|
|
55545
55565
|
});
|
|
55546
55566
|
$GOPD.f = $getOwnPropertyDescriptor;
|
|
55547
55567
|
$DP.f = $defineProperty$1;
|
|
55548
|
-
|
|
55568
|
+
_objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
|
|
55549
55569
|
require_objectPie().f = $propertyIsEnumerable;
|
|
55550
55570
|
$GOPS.f = $getOwnPropertySymbols;
|
|
55551
55571
|
if (DESCRIPTORS && !_library) {
|
|
@@ -61604,7 +61624,9 @@ const useStyles$o = makeStyles((theme) => ({
|
|
|
61604
61624
|
height: "auto",
|
|
61605
61625
|
display: "block",
|
|
61606
61626
|
paddingRight: "17px",
|
|
61627
|
+
/* Increase/decrease this value for cross-browser compatibility */
|
|
61607
61628
|
boxSizing: "content-box",
|
|
61629
|
+
/* So the width will be 100% + 17px */
|
|
61608
61630
|
"@global .rc-tree": {
|
|
61609
61631
|
paddingLeft: "0",
|
|
61610
61632
|
margin: "0",
|
|
@@ -61904,6 +61926,7 @@ const useHelpTooltipStyles = makeStyles((theme) => ({
|
|
|
61904
61926
|
maxWidth: "250px",
|
|
61905
61927
|
visibility: "visible",
|
|
61906
61928
|
paddingTop: "8px",
|
|
61929
|
+
// Assumes placement: 'top'
|
|
61907
61930
|
...helpTooltipCommon,
|
|
61908
61931
|
"@global .rc-tooltip-inner": {
|
|
61909
61932
|
fontSize: "10px",
|
|
@@ -61931,6 +61954,7 @@ const useHelpTooltipStyles = makeStyles((theme) => ({
|
|
|
61931
61954
|
cursor: "auto",
|
|
61932
61955
|
userSelect: "text",
|
|
61933
61956
|
paddingBottom: "10px",
|
|
61957
|
+
// Assumes placement: 'top'
|
|
61934
61958
|
"&.rc-tooltip-placement-top": {
|
|
61935
61959
|
paddingBottom: "10px"
|
|
61936
61960
|
},
|
|
@@ -170643,16 +170667,16 @@ async function getDecoder(fileDirectory) {
|
|
|
170643
170667
|
const Decoder = await importFn();
|
|
170644
170668
|
return new Decoder(fileDirectory);
|
|
170645
170669
|
}
|
|
170646
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
170647
|
-
addDecoder(5, () => import("./lzw-
|
|
170670
|
+
addDecoder([void 0, 1], () => import("./raw-7452dc66.js").then((m2) => m2.default));
|
|
170671
|
+
addDecoder(5, () => import("./lzw-585ded9f.js").then((m2) => m2.default));
|
|
170648
170672
|
addDecoder(6, () => {
|
|
170649
170673
|
throw new Error("old style JPEG compression is not supported.");
|
|
170650
170674
|
});
|
|
170651
|
-
addDecoder(7, () => import("./jpeg-
|
|
170652
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
170653
|
-
addDecoder(32773, () => import("./packbits-
|
|
170654
|
-
addDecoder(34887, () => import("./lerc-
|
|
170655
|
-
addDecoder(50001, () => import("./webimage-
|
|
170675
|
+
addDecoder(7, () => import("./jpeg-8148bfbc.js").then((m2) => m2.default));
|
|
170676
|
+
addDecoder([8, 32946], () => import("./deflate-632f7db0.js").then((m2) => m2.default));
|
|
170677
|
+
addDecoder(32773, () => import("./packbits-629a9c3a.js").then((m2) => m2.default));
|
|
170678
|
+
addDecoder(34887, () => import("./lerc-42581c23.js").then((m2) => m2.default));
|
|
170679
|
+
addDecoder(50001, () => import("./webimage-f847a2ad.js").then((m2) => m2.default));
|
|
170656
170680
|
function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
|
|
170657
170681
|
return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
|
|
170658
170682
|
}
|
|
@@ -208340,10 +208364,11 @@ class ZipFileStore {
|
|
|
208340
208364
|
const ZipFileStore$1 = ZipFileStore;
|
|
208341
208365
|
function zarrOpenRoot(url, fileType, requestInit2) {
|
|
208342
208366
|
let store2;
|
|
208367
|
+
const opts2 = requestInit2 ? { overrides: requestInit2 } : void 0;
|
|
208343
208368
|
if (fileType && fileType.endsWith(".zip")) {
|
|
208344
|
-
store2 = ZipFileStore$1.fromUrl(url,
|
|
208369
|
+
store2 = ZipFileStore$1.fromUrl(url, opts2);
|
|
208345
208370
|
} else {
|
|
208346
|
-
store2 = new FetchStore$1(url,
|
|
208371
|
+
store2 = new FetchStore$1(url, opts2);
|
|
208347
208372
|
}
|
|
208348
208373
|
return root(store2);
|
|
208349
208374
|
}
|
|
@@ -210050,10 +210075,15 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
210050
210075
|
excludeBackground: true,
|
|
210051
210076
|
onViewportLoad: () => {
|
|
210052
210077
|
},
|
|
210078
|
+
// layerProps.callback, // TODO: figure out callback implementation
|
|
210053
210079
|
colorScaleLo: 0,
|
|
210080
|
+
// TODO: check if these can be removed?
|
|
210054
210081
|
colorScaleHi: 1,
|
|
210082
|
+
// TODO: check if these can be removed?
|
|
210055
210083
|
isExpressionMode: false,
|
|
210084
|
+
// TODO: check if these can be removed?
|
|
210056
210085
|
colormap: null,
|
|
210086
|
+
// TODO: check if these can be removed?
|
|
210057
210087
|
expressionData: this.expression.data,
|
|
210058
210088
|
// There is no onHover here,
|
|
210059
210089
|
// see the onHover method of AbstractSpatialOrScatterplot.
|
|
@@ -210140,6 +210170,7 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
210140
210170
|
zSlice: layerCoordination[CoordinationType$2.SPATIAL_SLICE_Z],
|
|
210141
210171
|
onViewportLoad: () => {
|
|
210142
210172
|
},
|
|
210173
|
+
// layerProps.callback, // TODO: figure out callback implementation
|
|
210143
210174
|
excludeBackground: useTransparentColor,
|
|
210144
210175
|
extensions,
|
|
210145
210176
|
// Picking / onHover on the root DeckGL component
|
|
@@ -210332,7 +210363,9 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
210332
210363
|
}
|
|
210333
210364
|
this.segmentationColors[layerScope][channelScope] = {
|
|
210334
210365
|
setColorIndices: obsColorIndices,
|
|
210366
|
+
// The Map from cell ID to color index.
|
|
210335
210367
|
setColors: obsSetColor,
|
|
210368
|
+
// The array with [{ path, color: [r, g, b] }, ...].
|
|
210336
210369
|
obsIndex: layerIndex
|
|
210337
210370
|
// TODO: how to ensure obsIndex.length matches the number of cells
|
|
210338
210371
|
};
|
|
@@ -216422,7 +216455,9 @@ const useStyles$i = makeStyles((theme) => ({
|
|
|
216422
216455
|
/* background-color only for content */
|
|
216423
216456
|
backgroundClip: "content-box",
|
|
216424
216457
|
border: `2px solid ${theme.palette.grayLight}`,
|
|
216458
|
+
// map-get($global-colors, "gray-light");
|
|
216425
216459
|
backgroundColor: theme.palette.grayLight,
|
|
216460
|
+
// map-get($global-colors, "gray-light");
|
|
216426
216461
|
"&:checked": {
|
|
216427
216462
|
backgroundClip: "unset"
|
|
216428
216463
|
}
|
|
@@ -216679,6 +216714,7 @@ const useChannelSliderStyles = makeStyles((theme) => ({
|
|
|
216679
216714
|
marginTop: "7px",
|
|
216680
216715
|
"& span": {
|
|
216681
216716
|
color: theme.palette.secondaryForeground,
|
|
216717
|
+
// Change color here
|
|
216682
216718
|
backgroundColor: theme.palette.secondaryBackgroundDim
|
|
216683
216719
|
// Change color here
|
|
216684
216720
|
}
|
|
@@ -218654,7 +218690,7 @@ const HIGLASS_BUNDLE_VERSION = "1.11.13";
|
|
|
218654
218690
|
const HIGLASS_CSS_URL = `https://unpkg.com/${HIGLASS_PKG_NAME}@${HIGLASS_BUNDLE_VERSION}/dist/hglib.css`;
|
|
218655
218691
|
register({ dataFetcher: ZarrMultivecDataFetcher_default, config: ZarrMultivecDataFetcher_default.config }, { pluginType: "dataFetcher" });
|
|
218656
218692
|
const LazyHiGlassComponent = React__default.lazy(async () => {
|
|
218657
|
-
const { HiGlassComponent } = await import("./hglib-
|
|
218693
|
+
const { HiGlassComponent } = await import("./hglib-fecfe463.js").then((n3) => n3.h);
|
|
218658
218694
|
return { default: HiGlassComponent };
|
|
218659
218695
|
});
|
|
218660
218696
|
const HG_SIZE = 800;
|
|
@@ -277568,20 +277604,32 @@ class RasterJsonAsObsSegmentationsLoader extends RasterLoader {
|
|
|
277568
277604
|
}
|
|
277569
277605
|
}
|
|
277570
277606
|
class ZarrDataSource {
|
|
277607
|
+
/**
|
|
277608
|
+
* @param {DataSourceParams} params The parameters object.
|
|
277609
|
+
*/
|
|
277571
277610
|
constructor({ url, requestInit: requestInit2, store: store2, fileType }) {
|
|
277572
277611
|
if (store2) {
|
|
277573
277612
|
this.storeRoot = root(store2);
|
|
277574
|
-
} else {
|
|
277613
|
+
} else if (url) {
|
|
277575
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.");
|
|
277576
277617
|
}
|
|
277577
277618
|
}
|
|
277619
|
+
/**
|
|
277620
|
+
*
|
|
277621
|
+
* @param {string} path
|
|
277622
|
+
* @returns {ZarrLocation<Readable>}
|
|
277623
|
+
*/
|
|
277578
277624
|
getStoreRoot(path2) {
|
|
277579
277625
|
return this.storeRoot.resolve(path2);
|
|
277580
277626
|
}
|
|
277581
277627
|
/**
|
|
277582
|
-
*
|
|
277628
|
+
* Method for accessing JSON attributes, relative to the store root.
|
|
277583
277629
|
* @param {string} key A path to the item.
|
|
277584
|
-
* @
|
|
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
|
|
277585
277633
|
* that resolves to the parsed JSON if successful.
|
|
277586
277634
|
* @throws This may throw an error.
|
|
277587
277635
|
*/
|
|
@@ -277602,16 +277650,41 @@ function dirname(path2) {
|
|
|
277602
277650
|
}
|
|
277603
277651
|
function basename(path2) {
|
|
277604
277652
|
const arr = path2.split("/");
|
|
277605
|
-
|
|
277653
|
+
const result = arr.at(-1);
|
|
277654
|
+
if (!result) {
|
|
277655
|
+
console.error("basename of path is empty", path2);
|
|
277656
|
+
return "";
|
|
277657
|
+
}
|
|
277658
|
+
return result;
|
|
277606
277659
|
}
|
|
277607
277660
|
class AnnDataSource extends ZarrDataSource {
|
|
277608
|
-
|
|
277609
|
-
|
|
277661
|
+
/**
|
|
277662
|
+
*
|
|
277663
|
+
* @param {DataSourceParams} params
|
|
277664
|
+
*/
|
|
277665
|
+
constructor(params2) {
|
|
277666
|
+
super(params2);
|
|
277610
277667
|
this.promises = /* @__PURE__ */ new Map();
|
|
277611
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
|
+
*/
|
|
277612
277677
|
loadObsColumns(paths) {
|
|
277613
277678
|
return this._loadColumns(paths);
|
|
277614
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
|
+
*/
|
|
277615
277688
|
loadVarColumns(paths) {
|
|
277616
277689
|
return this._loadColumns(paths);
|
|
277617
277690
|
}
|
|
@@ -277619,8 +277692,10 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277619
277692
|
* Class method for loading obs variables.
|
|
277620
277693
|
* Takes the location as an argument because this is shared across objects,
|
|
277621
277694
|
* which have different ways of specifying location.
|
|
277622
|
-
* @param {string[]} paths An array of strings like
|
|
277623
|
-
*
|
|
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.
|
|
277624
277699
|
*/
|
|
277625
277700
|
_loadColumns(paths) {
|
|
277626
277701
|
const promises = paths.map((path2) => {
|
|
@@ -277632,7 +277707,10 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277632
277707
|
});
|
|
277633
277708
|
this.promises.set(col, obsPromise);
|
|
277634
277709
|
}
|
|
277635
|
-
return
|
|
277710
|
+
return (
|
|
277711
|
+
/** @type {Promise<string[]>} */
|
|
277712
|
+
this.promises.get(col)
|
|
277713
|
+
);
|
|
277636
277714
|
};
|
|
277637
277715
|
if (!path2) {
|
|
277638
277716
|
return Promise.resolve(void 0);
|
|
@@ -277644,30 +277722,35 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277644
277722
|
});
|
|
277645
277723
|
return Promise.all(promises);
|
|
277646
277724
|
}
|
|
277725
|
+
/**
|
|
277726
|
+
*
|
|
277727
|
+
* @param {string} path
|
|
277728
|
+
* @returns
|
|
277729
|
+
*/
|
|
277647
277730
|
async _loadColumn(path2) {
|
|
277648
277731
|
const { storeRoot } = this;
|
|
277649
277732
|
const prefix2 = dirname(path2);
|
|
277650
277733
|
const { categories, "encoding-type": encodingType } = await this.getJson(`${path2}/.zattrs`);
|
|
277651
277734
|
let categoriesValues;
|
|
277652
|
-
let
|
|
277735
|
+
let codesPath;
|
|
277653
277736
|
if (categories) {
|
|
277654
|
-
const { dtype } = await open(storeRoot.resolve(`/${prefix2}/${categories}`));
|
|
277737
|
+
const { dtype } = await open(storeRoot.resolve(`/${prefix2}/${categories}`), { kind: "array" });
|
|
277655
277738
|
if (dtype === "v2:object") {
|
|
277656
277739
|
categoriesValues = await this.getFlatArrDecompressed(`/${prefix2}/${categories}`);
|
|
277657
277740
|
}
|
|
277658
277741
|
} else if (encodingType === "categorical") {
|
|
277659
|
-
const { dtype } = await open(storeRoot.resolve(`/${path2}/categories`));
|
|
277742
|
+
const { dtype } = await open(storeRoot.resolve(`/${path2}/categories`), { kind: "array" });
|
|
277660
277743
|
if (dtype === "v2:object") {
|
|
277661
277744
|
categoriesValues = await this.getFlatArrDecompressed(`/${path2}/categories`);
|
|
277662
277745
|
}
|
|
277663
|
-
|
|
277746
|
+
codesPath = `/${path2}/codes`;
|
|
277664
277747
|
} else {
|
|
277665
|
-
const { dtype } = await open(storeRoot.resolve(`/${path2}`));
|
|
277748
|
+
const { dtype } = await open(storeRoot.resolve(`/${path2}`), { kind: "array" });
|
|
277666
277749
|
if (dtype === "v2:object") {
|
|
277667
277750
|
return this.getFlatArrDecompressed(path2);
|
|
277668
277751
|
}
|
|
277669
277752
|
}
|
|
277670
|
-
const arr = await open(storeRoot.resolve(
|
|
277753
|
+
const arr = await open(storeRoot.resolve(codesPath || path2), { kind: "array" });
|
|
277671
277754
|
const values3 = await get$6(arr, [null]);
|
|
277672
277755
|
const { data: data2 } = values3;
|
|
277673
277756
|
const mappedValues = Array.from(data2).map((i2) => !categoriesValues ? String(i2) : categoriesValues[i2]);
|
|
@@ -277676,7 +277759,7 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277676
277759
|
/**
|
|
277677
277760
|
* Class method for loading general numeric arrays.
|
|
277678
277761
|
* @param {string} path A string like obsm.X_pca.
|
|
277679
|
-
* @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.
|
|
277680
277763
|
*/
|
|
277681
277764
|
loadNumeric(path2) {
|
|
277682
277765
|
const { storeRoot } = this;
|
|
@@ -277685,14 +277768,20 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277685
277768
|
/**
|
|
277686
277769
|
* Class method for loading specific columns of numeric arrays.
|
|
277687
277770
|
* @param {string} path A string like obsm.X_pca.
|
|
277688
|
-
* @param {number
|
|
277689
|
-
* @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.
|
|
277690
277776
|
*/
|
|
277691
277777
|
loadNumericForDims(path2, dims) {
|
|
277692
277778
|
const { storeRoot } = this;
|
|
277693
277779
|
const arr = open(storeRoot.resolve(path2), { kind: "array" });
|
|
277694
277780
|
return Promise.all(dims.map((dim) => arr.then((loadedArr) => get$6(loadedArr, [null, dim])))).then((cols) => ({
|
|
277695
|
-
data:
|
|
277781
|
+
data: (
|
|
277782
|
+
/** @type {[ZarrTypedArray<any>, ZarrTypedArray<any>]} */
|
|
277783
|
+
cols.map((col) => col.data)
|
|
277784
|
+
),
|
|
277696
277785
|
shape: [dims.length, cols[0].shape[0]]
|
|
277697
277786
|
}));
|
|
277698
277787
|
}
|
|
@@ -277700,7 +277789,7 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277700
277789
|
* A common method for loading flattened data
|
|
277701
277790
|
* i.e that which has shape [n] where n is a natural number.
|
|
277702
277791
|
* @param {string} path A path to a flat array location, like obs/_index
|
|
277703
|
-
* @returns {
|
|
277792
|
+
* @returns {Promise<string[]>} The data from the zarr array.
|
|
277704
277793
|
*/
|
|
277705
277794
|
async getFlatArrDecompressed(path2) {
|
|
277706
277795
|
const { storeRoot } = this;
|
|
@@ -277709,13 +277798,18 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277709
277798
|
if (data2.data?.[Symbol.iterator]) {
|
|
277710
277799
|
return Array.from(data2.data);
|
|
277711
277800
|
}
|
|
277712
|
-
return
|
|
277801
|
+
return (
|
|
277802
|
+
/** @type {string[]} */
|
|
277803
|
+
data2.data
|
|
277804
|
+
);
|
|
277713
277805
|
}
|
|
277714
277806
|
/**
|
|
277715
277807
|
* Class method for loading the obs index.
|
|
277716
|
-
* @
|
|
277808
|
+
* @param {string|undefined} path Used by subclasses.
|
|
277809
|
+
* @returns {Promise<string[]>} An promise for a zarr array
|
|
277810
|
+
* containing the indices.
|
|
277717
277811
|
*/
|
|
277718
|
-
loadObsIndex() {
|
|
277812
|
+
loadObsIndex(path2 = void 0) {
|
|
277719
277813
|
if (this.obsIndex) {
|
|
277720
277814
|
return this.obsIndex;
|
|
277721
277815
|
}
|
|
@@ -277724,9 +277818,10 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277724
277818
|
}
|
|
277725
277819
|
/**
|
|
277726
277820
|
* Class method for loading the var index.
|
|
277727
|
-
* @
|
|
277821
|
+
* @param {string|undefined} path Used by subclasses.
|
|
277822
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the indices.
|
|
277728
277823
|
*/
|
|
277729
|
-
loadVarIndex() {
|
|
277824
|
+
loadVarIndex(path2 = void 0) {
|
|
277730
277825
|
if (this.varIndex) {
|
|
277731
277826
|
return this.varIndex;
|
|
277732
277827
|
}
|
|
@@ -277735,58 +277830,107 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
277735
277830
|
}
|
|
277736
277831
|
/**
|
|
277737
277832
|
* Class method for loading the var alias.
|
|
277738
|
-
* @
|
|
277833
|
+
* @param {string} varPath
|
|
277834
|
+
* @param {string|undefined} matrixPath
|
|
277835
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the aliased names.
|
|
277739
277836
|
*/
|
|
277740
|
-
async loadVarAlias(varPath) {
|
|
277837
|
+
async loadVarAlias(varPath, matrixPath = void 0) {
|
|
277741
277838
|
if (this.varAlias) {
|
|
277742
277839
|
return this.varAlias;
|
|
277743
277840
|
}
|
|
277744
277841
|
[this.varAlias] = await this.loadVarColumns([varPath]);
|
|
277745
277842
|
const index2 = await this.loadVarIndex();
|
|
277746
|
-
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
|
+
);
|
|
277747
277847
|
return this.varAlias;
|
|
277748
277848
|
}
|
|
277849
|
+
/**
|
|
277850
|
+
*
|
|
277851
|
+
* @param {string} path
|
|
277852
|
+
* @returns {Promise<object>}
|
|
277853
|
+
*/
|
|
277749
277854
|
async _loadAttrs(path2) {
|
|
277750
277855
|
return this.getJson(`${path2}/.zattrs`);
|
|
277751
277856
|
}
|
|
277857
|
+
/**
|
|
277858
|
+
*
|
|
277859
|
+
* @param {string} path
|
|
277860
|
+
* @returns {Promise<string>}
|
|
277861
|
+
*/
|
|
277752
277862
|
async _loadString(path2) {
|
|
277753
277863
|
const { storeRoot } = this;
|
|
277754
|
-
const
|
|
277755
|
-
if (
|
|
277756
|
-
const
|
|
277757
|
-
|
|
277758
|
-
|
|
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`);
|
|
277759
277876
|
}
|
|
277760
|
-
throw new Error(
|
|
277877
|
+
throw new Error("Keys for encoding-type or encoding-version not found in AnnDataSource._loadString");
|
|
277761
277878
|
}
|
|
277879
|
+
/**
|
|
277880
|
+
*
|
|
277881
|
+
* @param {string} path
|
|
277882
|
+
* @returns {Promise<string[]>}
|
|
277883
|
+
*/
|
|
277762
277884
|
async _loadStringArray(path2) {
|
|
277763
|
-
const
|
|
277764
|
-
if (
|
|
277765
|
-
|
|
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`);
|
|
277766
277892
|
}
|
|
277767
|
-
throw new Error(
|
|
277893
|
+
throw new Error("Keys for encoding-type or encoding-version not found in AnnDataSource._loadString");
|
|
277768
277894
|
}
|
|
277895
|
+
/**
|
|
277896
|
+
*
|
|
277897
|
+
* @param {string} path
|
|
277898
|
+
* @returns
|
|
277899
|
+
*/
|
|
277769
277900
|
async _loadElement(path2) {
|
|
277770
|
-
const
|
|
277771
|
-
if (
|
|
277772
|
-
|
|
277773
|
-
|
|
277774
|
-
|
|
277775
|
-
|
|
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
|
+
}
|
|
277776
277910
|
}
|
|
277777
277911
|
return null;
|
|
277778
277912
|
}
|
|
277913
|
+
/**
|
|
277914
|
+
*
|
|
277915
|
+
* @param {string} path
|
|
277916
|
+
* @param {string[]} keys
|
|
277917
|
+
* @returns
|
|
277918
|
+
*/
|
|
277779
277919
|
async _loadDict(path2, keys4) {
|
|
277780
|
-
const
|
|
277781
|
-
if (
|
|
277782
|
-
const
|
|
277783
|
-
|
|
277784
|
-
const
|
|
277785
|
-
|
|
277786
|
-
|
|
277787
|
-
|
|
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`);
|
|
277788
277932
|
}
|
|
277789
|
-
throw new Error(
|
|
277933
|
+
throw new Error("Keys for encoding-type or encoding-version not found in AnnDataSource._loadString");
|
|
277790
277934
|
}
|
|
277791
277935
|
}
|
|
277792
277936
|
const regex$2 = /^mod\/([^/]*)\/(.*)$/;
|
|
@@ -277871,17 +278015,30 @@ function getVarPath$1(arrPath) {
|
|
|
277871
278015
|
return `${getTablePrefix(arrPath)}var`;
|
|
277872
278016
|
}
|
|
277873
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
|
+
*/
|
|
277874
278033
|
async loadSpatialDataAttrs(tablePath) {
|
|
277875
278034
|
return this._loadDict(`${tablePath}uns/spatialdata_attrs`, ["instance_key", "region", "region_key"]);
|
|
277876
278035
|
}
|
|
277877
278036
|
/**
|
|
277878
278037
|
* Class method for loading the obs index.
|
|
277879
|
-
* @
|
|
278038
|
+
* @param {string|undefined} path
|
|
278039
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the indices.
|
|
277880
278040
|
*/
|
|
277881
|
-
async loadObsIndex(path2 =
|
|
277882
|
-
if (!this.obsIndex) {
|
|
277883
|
-
this.obsIndex = {};
|
|
277884
|
-
}
|
|
278041
|
+
async loadObsIndex(path2 = void 0) {
|
|
277885
278042
|
const obsPath = getObsPath(path2);
|
|
277886
278043
|
const { _index } = await this.getJson(`${obsPath}/.zattrs`);
|
|
277887
278044
|
let indexPath = `${obsPath}/${_index}`;
|
|
@@ -277892,43 +278049,41 @@ class SpatialDataTableSource extends AnnDataSource {
|
|
|
277892
278049
|
// region,
|
|
277893
278050
|
} = await this.loadSpatialDataAttrs(getTablePrefix(path2));
|
|
277894
278051
|
indexPath = `${obsPath}/${instanceKey}`;
|
|
277895
|
-
if (this.
|
|
277896
|
-
return this.
|
|
278052
|
+
if (indexPath in this.obsIndices) {
|
|
278053
|
+
return this.obsIndices[indexPath];
|
|
277897
278054
|
}
|
|
277898
|
-
this.
|
|
277899
|
-
return this.
|
|
278055
|
+
this.obsIndices[indexPath] = this._loadColumn(indexPath);
|
|
278056
|
+
return this.obsIndices[indexPath];
|
|
277900
278057
|
}
|
|
277901
278058
|
/**
|
|
277902
278059
|
* Class method for loading the var index.
|
|
277903
|
-
* @
|
|
278060
|
+
* @param {string|undefined} path
|
|
278061
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the indices.
|
|
277904
278062
|
*/
|
|
277905
|
-
loadVarIndex(path2 =
|
|
277906
|
-
if (!this.varIndex) {
|
|
277907
|
-
this.varIndex = {};
|
|
277908
|
-
}
|
|
278063
|
+
loadVarIndex(path2 = void 0) {
|
|
277909
278064
|
const varPath = getVarPath$1(path2);
|
|
277910
|
-
if (this.
|
|
277911
|
-
return this.
|
|
278065
|
+
if (varPath in this.varIndices) {
|
|
278066
|
+
return this.varIndices[varPath];
|
|
277912
278067
|
}
|
|
277913
|
-
this.
|
|
277914
|
-
return this.
|
|
278068
|
+
this.varIndices[varPath] = this.getJson(`${varPath}/.zattrs`).then(({ _index }) => this.getFlatArrDecompressed(`${varPath}/${_index}`));
|
|
278069
|
+
return this.varIndices[varPath];
|
|
277915
278070
|
}
|
|
277916
278071
|
/**
|
|
277917
278072
|
* Class method for loading the var alias.
|
|
277918
|
-
* @
|
|
278073
|
+
* @param {string} varPath
|
|
278074
|
+
* @param {string} matrixPath
|
|
278075
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the aliased names.
|
|
277919
278076
|
*/
|
|
277920
278077
|
async loadVarAlias(varPath, matrixPath) {
|
|
277921
|
-
if (
|
|
277922
|
-
this.
|
|
277923
|
-
}
|
|
277924
|
-
if (this.varAlias[varPath]) {
|
|
277925
|
-
return this.varAlias[varPath];
|
|
278078
|
+
if (varPath in this.varAliases) {
|
|
278079
|
+
return this.varAliases[varPath];
|
|
277926
278080
|
}
|
|
277927
278081
|
const [varAliasData] = await this.loadVarColumns([varPath]);
|
|
277928
|
-
this.
|
|
278082
|
+
this.varAliases[varPath] = /** @type {string[]} */
|
|
278083
|
+
varAliasData;
|
|
277929
278084
|
const index2 = await this.loadVarIndex(matrixPath);
|
|
277930
|
-
this.
|
|
277931
|
-
return this.
|
|
278085
|
+
this.varAliases[varPath] = this.varAliases[varPath].map((val, ind) => val ? val.concat(` (${index2[ind]})`) : index2[ind]);
|
|
278086
|
+
return this.varAliases[varPath];
|
|
277932
278087
|
}
|
|
277933
278088
|
}
|
|
277934
278089
|
const regex = /^shapes\/([^/]*)\/(.*)$/;
|
|
@@ -277948,17 +278103,31 @@ function getVarPath(arrPath) {
|
|
|
277948
278103
|
return `${getShapesPrefix(arrPath)}var`;
|
|
277949
278104
|
}
|
|
277950
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
|
+
*/
|
|
277951
278121
|
async loadSpatialDataAttrs(tablePath) {
|
|
277952
278122
|
return this._loadDict(`${tablePath}/uns/spatialdata_attrs`, ["instance_key", "region", "region_key"]);
|
|
277953
278123
|
}
|
|
277954
278124
|
/**
|
|
277955
278125
|
* Class method for loading the obs index.
|
|
277956
|
-
* @
|
|
278126
|
+
* @param {string|undefined} path
|
|
278127
|
+
* @param {string|undefined} tablePath
|
|
278128
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the indices.
|
|
277957
278129
|
*/
|
|
277958
|
-
async loadObsIndex(path2 =
|
|
277959
|
-
if (!this.obsIndex) {
|
|
277960
|
-
this.obsIndex = {};
|
|
277961
|
-
}
|
|
278130
|
+
async loadObsIndex(path2 = void 0, tablePath = void 0) {
|
|
277962
278131
|
let indexPath = getIndexPath(path2);
|
|
277963
278132
|
if (tablePath) {
|
|
277964
278133
|
const obsPath = `${tablePath}/obs`;
|
|
@@ -277972,43 +278141,41 @@ class SpatialDataShapesSource extends AnnDataSource {
|
|
|
277972
278141
|
} = await this.loadSpatialDataAttrs(tablePath);
|
|
277973
278142
|
indexPath = `${obsPath}/${instanceKey}`;
|
|
277974
278143
|
}
|
|
277975
|
-
if (this.
|
|
277976
|
-
return this.
|
|
278144
|
+
if (indexPath in this.obsIndices) {
|
|
278145
|
+
return this.obsIndices[indexPath];
|
|
277977
278146
|
}
|
|
277978
|
-
this.
|
|
277979
|
-
return this.
|
|
278147
|
+
this.obsIndices[indexPath] = this._loadColumn(indexPath);
|
|
278148
|
+
return this.obsIndices[indexPath];
|
|
277980
278149
|
}
|
|
277981
278150
|
/**
|
|
277982
278151
|
* Class method for loading the var index.
|
|
277983
|
-
* @
|
|
278152
|
+
* @param {string|undefined} path
|
|
278153
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the indices.
|
|
277984
278154
|
*/
|
|
277985
|
-
loadVarIndex(path2 =
|
|
277986
|
-
if (!this.varIndex) {
|
|
277987
|
-
this.varIndex = {};
|
|
277988
|
-
}
|
|
278155
|
+
loadVarIndex(path2 = void 0) {
|
|
277989
278156
|
const varPath = getVarPath(path2);
|
|
277990
|
-
if (this.
|
|
277991
|
-
return this.
|
|
278157
|
+
if (varPath in this.varIndices) {
|
|
278158
|
+
return this.varIndices[varPath];
|
|
277992
278159
|
}
|
|
277993
|
-
this.
|
|
277994
|
-
return this.
|
|
278160
|
+
this.varIndices[varPath] = this.getJson(`${varPath}/.zattrs`).then(({ _index }) => this.getFlatArrDecompressed(`${varPath}/${_index}`));
|
|
278161
|
+
return this.varIndices[varPath];
|
|
277995
278162
|
}
|
|
277996
278163
|
/**
|
|
277997
278164
|
* Class method for loading the var alias.
|
|
277998
|
-
* @
|
|
278165
|
+
* @param {string} varPath
|
|
278166
|
+
* @param {string} matrixPath
|
|
278167
|
+
* @returns {Promise<string[]>} An promise for a zarr array containing the aliased names.
|
|
277999
278168
|
*/
|
|
278000
278169
|
async loadVarAlias(varPath, matrixPath) {
|
|
278001
|
-
if (
|
|
278002
|
-
this.
|
|
278003
|
-
}
|
|
278004
|
-
if (this.varAlias[varPath]) {
|
|
278005
|
-
return this.varAlias[varPath];
|
|
278170
|
+
if (varPath in this.varAliases) {
|
|
278171
|
+
return this.varAliases[varPath];
|
|
278006
278172
|
}
|
|
278007
278173
|
const [varAliasData] = await this.loadVarColumns([varPath]);
|
|
278008
|
-
this.
|
|
278174
|
+
this.varAliases[varPath] = /** @type {string[]} */
|
|
278175
|
+
varAliasData;
|
|
278009
278176
|
const index2 = await this.loadVarIndex(matrixPath);
|
|
278010
|
-
this.
|
|
278011
|
-
return this.
|
|
278177
|
+
this.varAliases[varPath] = this.varAliases[varPath].map((val, ind) => val ? val.concat(` (${index2[ind]})`) : index2[ind]);
|
|
278178
|
+
return this.varAliases[varPath];
|
|
278012
278179
|
}
|
|
278013
278180
|
}
|
|
278014
278181
|
class MatrixZarrAsObsFeatureMatrixLoader extends AbstractTwoStepLoader {
|
|
@@ -278354,20 +278521,29 @@ class ObsFeatureMatrixAnndataLoader extends AbstractTwoStepLoader {
|
|
|
278354
278521
|
class ObsEmbeddingAnndataLoader extends AbstractTwoStepLoader {
|
|
278355
278522
|
/**
|
|
278356
278523
|
* Class method for loading embedding coordinates, such as those from UMAP or t-SNE.
|
|
278357
|
-
* @returns {Promise} A promise for an array of columns.
|
|
278524
|
+
* @returns {Promise<MatrixResult>} A promise for an array of columns.
|
|
278358
278525
|
*/
|
|
278359
|
-
loadEmbedding() {
|
|
278526
|
+
async loadEmbedding() {
|
|
278360
278527
|
const { path: path2, dims = [0, 1] } = this.options;
|
|
278361
278528
|
if (this.embedding) {
|
|
278362
|
-
return
|
|
278529
|
+
return (
|
|
278530
|
+
/** @type {Promise<MatrixResult>} */
|
|
278531
|
+
this.embedding
|
|
278532
|
+
);
|
|
278363
278533
|
}
|
|
278364
278534
|
if (!this.embedding) {
|
|
278365
278535
|
this.embedding = this.dataSource.loadNumericForDims(path2, dims);
|
|
278366
|
-
return
|
|
278536
|
+
return (
|
|
278537
|
+
/** @type {Promise<MatrixResult>} */
|
|
278538
|
+
this.embedding
|
|
278539
|
+
);
|
|
278367
278540
|
}
|
|
278368
|
-
this.embedding = Promise.resolve(null);
|
|
278369
278541
|
return this.embedding;
|
|
278370
278542
|
}
|
|
278543
|
+
/**
|
|
278544
|
+
*
|
|
278545
|
+
* @returns {Promise<LoaderResult<ObsEmbeddingData>>}
|
|
278546
|
+
*/
|
|
278371
278547
|
async load() {
|
|
278372
278548
|
const { path: path2 } = this.options;
|
|
278373
278549
|
const superResult = await super.load().catch((reason) => Promise.resolve(reason));
|
|
@@ -278668,9 +278844,9 @@ class ObsLabelsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
278668
278844
|
class FeatureLabelsAnndataLoader extends AbstractTwoStepLoader {
|
|
278669
278845
|
/**
|
|
278670
278846
|
* Class method for loading feature string labels.
|
|
278671
|
-
* @returns {Promise} A promise for the array.
|
|
278847
|
+
* @returns {Promise<string[]>} A promise for the array.
|
|
278672
278848
|
*/
|
|
278673
|
-
loadLabels() {
|
|
278849
|
+
async loadLabels() {
|
|
278674
278850
|
const { path: path2 } = this.options;
|
|
278675
278851
|
if (this.labels) {
|
|
278676
278852
|
return this.labels;
|
|
@@ -278679,9 +278855,12 @@ class FeatureLabelsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
278679
278855
|
this.labels = this.dataSource._loadColumn(path2);
|
|
278680
278856
|
return this.labels;
|
|
278681
278857
|
}
|
|
278682
|
-
this.labels = Promise.resolve(null);
|
|
278683
278858
|
return this.labels;
|
|
278684
278859
|
}
|
|
278860
|
+
/**
|
|
278861
|
+
*
|
|
278862
|
+
* @returns {Promise<LoaderResult<FeatureLabelsData>>}
|
|
278863
|
+
*/
|
|
278685
278864
|
async load() {
|
|
278686
278865
|
const { path: path2 } = this.options;
|
|
278687
278866
|
const superResult = await super.load().catch((reason) => Promise.resolve(reason));
|
|
@@ -278697,7 +278876,7 @@ class FeatureLabelsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
278697
278876
|
]).then(([featureIndex, featureLabels]) => Promise.resolve(new LoaderResult({
|
|
278698
278877
|
featureIndex,
|
|
278699
278878
|
featureLabels,
|
|
278700
|
-
featureLabelsMap: new Map(featureIndex.map((key2, i2) => [key2, featureLabels[i2]]))
|
|
278879
|
+
featureLabelsMap: new Map(featureIndex.map((key2, i2) => [key2, featureLabels?.[i2]]))
|
|
278701
278880
|
}, null)));
|
|
278702
278881
|
}
|
|
278703
278882
|
}
|
|
@@ -278919,6 +279098,7 @@ class ImageWrapper {
|
|
|
278919
279098
|
name: channel.Name || `Channel ${i2}`,
|
|
278920
279099
|
defaultColor: channel.Color ? channel.Color : void 0,
|
|
278921
279100
|
defaultWindow: void 0,
|
|
279101
|
+
// TODO: does OME-TIFF support this?
|
|
278922
279102
|
autoDefaultColor: VIEWER_PALETTE[i2 % VIEWER_PALETTE.length]
|
|
278923
279103
|
}));
|
|
278924
279104
|
}
|
|
@@ -279156,7 +279336,9 @@ class OmeZarrLoader extends AbstractTwoStepLoader {
|
|
|
279156
279336
|
return Promise.resolve(new LoaderResult({
|
|
279157
279337
|
image: {
|
|
279158
279338
|
loaders: imageLayerLoaders,
|
|
279339
|
+
// TODO: replace with imageWrapper
|
|
279159
279340
|
meta: imageLayerMeta,
|
|
279341
|
+
// TODO: replace with imageWrapper
|
|
279160
279342
|
instance: imageWrapper
|
|
279161
279343
|
// TODO: make this the root value of LoaderResult.image.
|
|
279162
279344
|
},
|
|
@@ -279423,7 +279605,9 @@ class OmeTiffLoader extends AbstractTwoStepLoader {
|
|
|
279423
279605
|
return new LoaderResult({
|
|
279424
279606
|
image: {
|
|
279425
279607
|
loaders: imageLayerLoaders,
|
|
279608
|
+
// TODO: replace with imageWrapper
|
|
279426
279609
|
meta: imageLayerMeta,
|
|
279610
|
+
// TODO: replace with imageWrapper
|
|
279427
279611
|
instance: imageWrapper
|
|
279428
279612
|
// TODO: make this the root value of LoaderResult.image.
|
|
279429
279613
|
},
|
|
@@ -279506,7 +279690,9 @@ class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
|
|
|
279506
279690
|
obsSegmentationsType: "bitmask",
|
|
279507
279691
|
obsSegmentations: {
|
|
279508
279692
|
loaders: imageLayerLoaders,
|
|
279693
|
+
// TODO: replace with imageWrapper
|
|
279509
279694
|
meta: imageLayerMeta,
|
|
279695
|
+
// TODO: replace with imageWrapper
|
|
279510
279696
|
instance: imageWrapper
|
|
279511
279697
|
// TODO: make this the root value of LoaderResult.image.
|
|
279512
279698
|
}
|
|
@@ -280230,6 +280416,7 @@ const baseCoordinationTypes = [
|
|
|
280230
280416
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_LAYER_VISIBLE, true, z.boolean()),
|
|
280231
280417
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_LAYER_OPACITY, 1, z.number()),
|
|
280232
280418
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_LAYER_COLORMAP, null, z.string().nullable()),
|
|
280419
|
+
// TODO: enum to be more strict
|
|
280233
280420
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_LAYER_TRANSPARENT_COLOR, null, z.array(z.number()).length(3).nullable()),
|
|
280234
280421
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_LAYER_MODEL_MATRIX, null, z.array(z.number()).length(16).nullable()),
|
|
280235
280422
|
new PluginCoordinationType(CoordinationType$2.SPATIAL_CHANNEL_VISIBLE, true, z.boolean()),
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k, C, D, F, H, p, h, u, P, w, t, V, s, i, f, d, m, l, n, r, q, j, x, v, z } from "./index-
|
|
1
|
+
import { k, C, D, F, H, p, h, u, P, w, t, V, s, i, f, d, m, l, n, r, q, j, x, v, z } from "./index-0a4e4af9.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
|
|
2
|
-
import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-
|
|
2
|
+
import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-0a4e4af9.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
var LercDecode = { exports: {} };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/dev",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.10",
|
|
4
4
|
"author": "Gehlenborg Lab",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"dist-tsc"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@vitessce/all": "3.3.
|
|
20
|
-
"@vitessce/config": "3.3.
|
|
21
|
-
"@vitessce/constants": "3.3.
|
|
22
|
-
"@vitessce/export-utils": "3.3.
|
|
19
|
+
"@vitessce/all": "3.3.10",
|
|
20
|
+
"@vitessce/config": "3.3.10",
|
|
21
|
+
"@vitessce/constants": "3.3.10",
|
|
22
|
+
"@vitessce/export-utils": "3.3.10"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@vitejs/plugin-react": "^4.0.0",
|