@vitessce/all 4.1.1 → 4.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{GeometryAndMeshXR-BSJ2rBtK.js → GeometryAndMeshXR-BO4cB8Py.js} +1 -1
- package/dist/{ReactNeuroglancer-Db7O0CnI.js → ReactNeuroglancer-D2Sm_o8g.js} +133 -25
- package/dist/{XREnterButton-D-MyjNiM.js → XREnterButton-DePbBRY6.js} +1 -1
- package/dist/{XRSceneComponents-KvBqtraG.js → XRSceneComponents-CXXeqxgE.js} +1 -1
- package/dist/{XRWrapper-BNdj_qnt.js → XRWrapper-ChEnDQOC.js} +2 -2
- package/dist/{deflate-B9RQRiyy.js → deflate-Dw6ATHuZ.js} +1 -1
- package/dist/{higlass-CJExboBo.js → higlass-B8HiKDgZ.js} +1 -1
- package/dist/{index-Vg2it-xm.js → index-4JZT6bFU.js} +5 -5
- package/dist/{index-uF7T9QQ9.js → index-D7sxxfGG.js} +1652 -905
- package/dist/{index-CZ9S9EsT.js → index-IrX1v-qA.js} +1 -1
- package/dist/index.js +15 -15
- package/dist/{jpeg-D1J1ZLjO.js → jpeg--u-M0g9b.js} +1 -1
- package/dist/{lerc-BYUvdCVc.js → lerc-7EC7_2zX.js} +1 -1
- package/dist/{lzw-BnX_a9ES.js → lzw-BhiKtyvb.js} +1 -1
- package/dist/{packbits-DxNVm_vW.js → packbits-BJuD6cdw.js} +1 -1
- package/dist/{raw-D529ykG0.js → raw-Bi4zouCM.js} +1 -1
- package/dist/{webimage-D6fsjgI6.js → webimage-BEdUDFND.js} +1 -1
- package/dist/{xrStore-2FzrFs3o.js → xrStore-Dt0n9R6Z.js} +1 -1
- package/dist-tsc/base-plugins.d.ts +2 -2
- package/dist-tsc/base-plugins.d.ts.map +1 -1
- package/dist-tsc/base-plugins.js +17 -2
- package/dist-tsc/base-plugins.js.map +1 -1
- package/package.json +34 -34
- package/src/base-plugins.ts +17 -0
|
@@ -7,7 +7,7 @@ var __privateAdd = (obj, member, value2) => member.has(obj) ? __typeError("Canno
|
|
|
7
7
|
var __privateSet = (obj, member, value2, setter2) => (__accessCheck(obj, member, "write to private field"), setter2 ? setter2.call(obj, value2) : member.set(obj, value2), value2);
|
|
8
8
|
var _inner;
|
|
9
9
|
import * as React from "react";
|
|
10
|
-
import React__default, { useContext, forwardRef as forwardRef$1, useRef, useMemo as useMemo$1, createContext as createContext$1, createElement, PureComponent, useEffect, useState, Children, version as version$6, isValidElement, useLayoutEffect as useLayoutEffect$1, useImperativeHandle, Component as Component$1, useCallback, cloneElement, useDeferredValue, Suspense, useReducer } from "react";
|
|
10
|
+
import React__default, { useContext, forwardRef as forwardRef$1, useRef, useMemo as useMemo$1, createContext as createContext$1, createElement, PureComponent, useEffect, useState, Children, version as version$6, isValidElement, useLayoutEffect as useLayoutEffect$1, useImperativeHandle, Component as Component$1, useCallback, cloneElement, useDeferredValue, Suspense, useReducer, useId as useId$2 } from "react";
|
|
11
11
|
import { useLoaders, useCoordinationScopes, useCoordination, useDescription, useImageData, useReady, TitleInfo, useVitessceContainer, useSetWarning, useObsSetsData, useUrls, usePlotOptionsStyles, OptionsContainer, CellColorEncodingOption, OptionSelect, useComponentHover, useComponentViewInfo, useViewMapping, useSetComponentHover, useSetComponentViewInfo, useAnnotationFrameCoordination, useAnnotationEditingForView, useInitialCoordination, useDeckCanvasSize, useAnnotationStoryData, useMultiObsLabels, useObsEmbeddingData, useFeatureSelection, useObsFeatureMatrixIndices, useFeatureLabelsData, useExpandedFeatureLabelsMap, useSampleSetsData, useSampleEdgesData, useGetObsInfo, useUint8FeatureSelection, useExpressionValueGetter, useAuxiliaryCoordination, useHasLoader, useObsLocationsData, useObsLabelsData, useObsSegmentationsData, useNeighborhoodsData, useMergeCoordination, useCoordinationScopesBy, useMultiCoordinationScopesSecondaryNonNull, useMultiCoordinationScopesNonNull, useComplexCoordination, useComplexCoordinationSecondary, useGridItemSize, useMultiObsPoints, usePointMultiObsLabels, usePointMultiObsFeatureMatrixIndices, useMultiObsSpots, useSpotMultiObsSets, useSpotMultiFeatureLabels, useSpotMultiFeatureSelection, useSpotMultiObsFeatureMatrixIndices, useSegmentationMultiObsLocations, useMultiObsSegmentations, useSegmentationMultiObsSets, useSegmentationMultiFeatureSelection, useSegmentationMultiObsFeatureMatrixIndices, useMultiImages, useObsFeatureMatrixData, useUint8ObsFeatureMatrix, useGetObsMembership, PopperMenu, useComponentLayout, useClosestVitessceContainerSize, useWindowDimensions, useRemoveImageChannelInMetaCoordinationScopes, useAddImageChannelInMetaCoordinationScopes, useViewConfigStoreApi, useViewConfig, useSetViewConfig, createLoaders, useAnnotationEditingStoreShallow, useViewConfigStore, getViewCoordinationValuesForFrame, useAnnotationEditingStoreApi, useAnnotationEditingStore, getAnnotationFrameUpdate, useWarning, useGenomicProfilesData, shallowDiff, shallowDiffByChannelWithKeys, shallowDiffByLayer, shallowDiffByChannelCoordinationWithKeys, shallowDiffByChannel, shallowDiffByLayerCoordinationWithKeys, useMemoCustomComparison, useSegmentationMultiObsColors, useMatchingLoader, useColumnNameMapping, useFeatureStatsData, useObsSetStatsData, useAsyncFunction, useFeatureSetStatsData, useMultiCoordinationScopes, useComparisonMetadata, logConfig, VitSContainer } from "@vitessce/vit-s";
|
|
12
12
|
import { jsx as jsx$1, jsxs, Fragment } from "react/jsx-runtime";
|
|
13
13
|
import * as ReactDOM from "react-dom";
|
|
@@ -6714,6 +6714,23 @@ function sum$5(values3, valueof) {
|
|
|
6714
6714
|
}
|
|
6715
6715
|
return sum2;
|
|
6716
6716
|
}
|
|
6717
|
+
const RESERVED_FEATURE_AGGREGATION_STRATEGIES = [
|
|
6718
|
+
"first",
|
|
6719
|
+
"last",
|
|
6720
|
+
"sum",
|
|
6721
|
+
"mean",
|
|
6722
|
+
"difference"
|
|
6723
|
+
];
|
|
6724
|
+
function resolveFeatureAggregationStrategy(strategy, featureSelection) {
|
|
6725
|
+
if (typeof strategy === "string" && !RESERVED_FEATURE_AGGREGATION_STRATEGIES.includes(strategy)) {
|
|
6726
|
+
const featureIndex = featureSelection?.indexOf(strategy) ?? -1;
|
|
6727
|
+
return featureIndex >= 0 ? featureIndex : "first";
|
|
6728
|
+
}
|
|
6729
|
+
if (typeof strategy === "number" && Array.isArray(featureSelection) && (strategy < 0 || strategy >= featureSelection.length)) {
|
|
6730
|
+
return "first";
|
|
6731
|
+
}
|
|
6732
|
+
return strategy ?? null;
|
|
6733
|
+
}
|
|
6717
6734
|
function aggregateFeatureArrays(arrays, strategy) {
|
|
6718
6735
|
if (!arrays || arrays.length === 0)
|
|
6719
6736
|
return null;
|
|
@@ -9469,6 +9486,7 @@ const FileType$1 = {
|
|
|
9469
9486
|
// Precomputed (mesh) format
|
|
9470
9487
|
OBS_SEGMENTATIONS_NG_PRECOMPUTED: "obsSegmentations.ng-precomputed",
|
|
9471
9488
|
OBS_POINTS_NG_ANNOTATIONS: "obsPoints.ng-annotations",
|
|
9489
|
+
OBS_LOCATIONS_NG_ANNOTATIONS: "obsLocations.ng-annotations",
|
|
9472
9490
|
// New file types to support old file types:
|
|
9473
9491
|
// - cells.json
|
|
9474
9492
|
OBS_EMBEDDING_CELLS_JSON: "obsEmbedding.cells.json",
|
|
@@ -9598,6 +9616,8 @@ const CoordinationType$1 = {
|
|
|
9598
9616
|
SPATIAL_SEGMENTATION_FILLED: "spatialSegmentationFilled",
|
|
9599
9617
|
SPATIAL_SEGMENTATION_STROKE_WIDTH: "spatialSegmentationStrokeWidth",
|
|
9600
9618
|
SPATIAL_POINT_STROKE_WIDTH: "spatialPointStrokeWidth",
|
|
9619
|
+
SPATIAL_POINT_RADIUS: "spatialPointRadius",
|
|
9620
|
+
SPATIAL_POINT_PROJECTION_SPACING: "spatialPointProjectionSpacing",
|
|
9601
9621
|
SPATIAL_CHANNEL_COLOR: "spatialChannelColor",
|
|
9602
9622
|
SPATIAL_CHANNEL_VISIBLE: "spatialChannelVisible",
|
|
9603
9623
|
SPATIAL_CHANNEL_OPACITY: "spatialChannelOpacity",
|
|
@@ -9614,6 +9634,12 @@ const CoordinationType$1 = {
|
|
|
9614
9634
|
// Per-image-channel (for spatial-accelerated)
|
|
9615
9635
|
SPATIAL_LOD_FACTOR: "spatialLodFactor",
|
|
9616
9636
|
// LOD factor for 3D volume rendering
|
|
9637
|
+
SPATIAL_AXIS_LINES_VISIBLE: "spatialAxisLinesVisible",
|
|
9638
|
+
// axisLines' visibility in Neuroglancer View
|
|
9639
|
+
SPATIAL_BOUNDS_VISIBLE: "spatialBoundsVisible",
|
|
9640
|
+
// annotationBounds' visibility in Neuroglancer View
|
|
9641
|
+
SPATIAL_SCALE_BAR_VISIBLE: "spatialScaleBarVisible",
|
|
9642
|
+
SPATIAL_BACKGROUND_THEME: "spatialBackgroundTheme",
|
|
9617
9643
|
// For clipping plane sliders
|
|
9618
9644
|
SPATIAL_SLICE_X: "spatialSliceX",
|
|
9619
9645
|
SPATIAL_SLICE_Y: "spatialSliceY",
|
|
@@ -9623,6 +9649,7 @@ const CoordinationType$1 = {
|
|
|
9623
9649
|
POINT_LAYER: "pointLayer",
|
|
9624
9650
|
SPATIAL_SPOT_RADIUS: "spatialSpotRadius",
|
|
9625
9651
|
// In micrometers?
|
|
9652
|
+
SPATIAL_SPOT_SHAPE: "spatialSpotShape",
|
|
9626
9653
|
SPATIAL_SPOT_FILLED: "spatialSpotFilled",
|
|
9627
9654
|
SPATIAL_SPOT_STROKE_WIDTH: "spatialSpotStrokeWidth",
|
|
9628
9655
|
SPATIAL_LAYER_COLOR: "spatialLayerColor",
|
|
@@ -9747,6 +9774,7 @@ const ViewHelpMapping = {
|
|
|
9747
9774
|
[FileType$1.OBS_SEGMENTATIONS_GLB]: DataType$3.OBS_SEGMENTATIONS,
|
|
9748
9775
|
[FileType$1.OBS_SEGMENTATIONS_NG_PRECOMPUTED]: DataType$3.OBS_SEGMENTATIONS,
|
|
9749
9776
|
[FileType$1.OBS_POINTS_NG_ANNOTATIONS]: DataType$3.OBS_POINTS,
|
|
9777
|
+
[FileType$1.OBS_LOCATIONS_NG_ANNOTATIONS]: DataType$3.OBS_LOCATIONS,
|
|
9750
9778
|
[FileType$1.IMAGE_SPATIALDATA_ZARR]: DataType$3.IMAGE,
|
|
9751
9779
|
[FileType$1.LABELS_SPATIALDATA_ZARR]: DataType$3.OBS_SEGMENTATIONS,
|
|
9752
9780
|
[FileType$1.SHAPES_SPATIALDATA_ZARR]: DataType$3.OBS_SEGMENTATIONS,
|
|
@@ -9973,7 +10001,8 @@ const ALT_ZARR_STORE_TYPES = {
|
|
|
9973
10001
|
CoordinationType$1.SPATIAL_ORBIT_AXIS,
|
|
9974
10002
|
CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
|
|
9975
10003
|
// Annotation shapes are specific to a view's coordinate system.
|
|
9976
|
-
CoordinationType$1.ANNOTATION_SHAPES
|
|
10004
|
+
CoordinationType$1.ANNOTATION_SHAPES,
|
|
10005
|
+
CoordinationType$1.SPATIAL_BACKGROUND_THEME
|
|
9977
10006
|
];
|
|
9978
10007
|
const COMPONENT_COORDINATION_TYPES = {
|
|
9979
10008
|
[ViewType$1.NEUROGLANCER]: [
|
|
@@ -10024,7 +10053,13 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
10024
10053
|
CoordinationType$1.SPATIAL_CHANNEL_OPACITY,
|
|
10025
10054
|
CoordinationType$1.SPATIAL_CHANNEL_VISIBLE,
|
|
10026
10055
|
CoordinationType$1.LEGEND_VISIBLE,
|
|
10027
|
-
CoordinationType$1.SPATIAL_POINT_STROKE_WIDTH
|
|
10056
|
+
CoordinationType$1.SPATIAL_POINT_STROKE_WIDTH,
|
|
10057
|
+
CoordinationType$1.SPATIAL_POINT_RADIUS,
|
|
10058
|
+
CoordinationType$1.SPATIAL_AXIS_LINES_VISIBLE,
|
|
10059
|
+
CoordinationType$1.SPATIAL_BOUNDS_VISIBLE,
|
|
10060
|
+
CoordinationType$1.SPATIAL_POINT_PROJECTION_SPACING,
|
|
10061
|
+
CoordinationType$1.SPATIAL_SCALE_BAR_VISIBLE,
|
|
10062
|
+
CoordinationType$1.SPATIAL_BACKGROUND_THEME
|
|
10028
10063
|
],
|
|
10029
10064
|
[ViewType$1.SCATTERPLOT]: [
|
|
10030
10065
|
CoordinationType$1.DATASET,
|
|
@@ -10201,7 +10236,8 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
10201
10236
|
CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
|
|
10202
10237
|
CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
|
|
10203
10238
|
CoordinationType$1.ANNOTATION_EDITABLE,
|
|
10204
|
-
CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
|
|
10239
|
+
CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM,
|
|
10240
|
+
CoordinationType$1.SPATIAL_CHANNELS_SORT_ORDER
|
|
10205
10241
|
],
|
|
10206
10242
|
[ViewType$1.SPATIAL_BETA]: [
|
|
10207
10243
|
CoordinationType$1.META_COORDINATION_SCOPES,
|
|
@@ -10272,6 +10308,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
10272
10308
|
CoordinationType$1.SPOT_LAYER,
|
|
10273
10309
|
CoordinationType$1.POINT_LAYER,
|
|
10274
10310
|
CoordinationType$1.SPATIAL_SPOT_RADIUS,
|
|
10311
|
+
CoordinationType$1.SPATIAL_SPOT_SHAPE,
|
|
10275
10312
|
CoordinationType$1.SPATIAL_SPOT_FILLED,
|
|
10276
10313
|
CoordinationType$1.SPATIAL_SPOT_STROKE_WIDTH,
|
|
10277
10314
|
CoordinationType$1.SPATIAL_LAYER_COLOR,
|
|
@@ -10289,7 +10326,10 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
10289
10326
|
CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
|
|
10290
10327
|
CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
|
|
10291
10328
|
CoordinationType$1.ANNOTATION_EDITABLE,
|
|
10292
|
-
CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
|
|
10329
|
+
CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM,
|
|
10330
|
+
CoordinationType$1.SPATIAL_POINT_RADIUS,
|
|
10331
|
+
CoordinationType$1.SPATIAL_POINT_STROKE_WIDTH,
|
|
10332
|
+
CoordinationType$1.SPATIAL_BACKGROUND_THEME
|
|
10293
10333
|
],
|
|
10294
10334
|
[ViewType$1.ANNOTATION_CONTROLLER]: [
|
|
10295
10335
|
CoordinationType$1.DATASET,
|
|
@@ -10419,7 +10459,8 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
10419
10459
|
CoordinationType$1.SPATIAL_ROTATION_Z,
|
|
10420
10460
|
CoordinationType$1.SPATIAL_ROTATION_ORBIT,
|
|
10421
10461
|
CoordinationType$1.SPATIAL_ORBIT_AXIS,
|
|
10422
|
-
CoordinationType$1.PHOTOMETRIC_INTERPRETATION
|
|
10462
|
+
CoordinationType$1.PHOTOMETRIC_INTERPRETATION,
|
|
10463
|
+
CoordinationType$1.SPATIAL_CHANNELS_SORT_ORDER
|
|
10423
10464
|
],
|
|
10424
10465
|
[ViewType$1.LAYER_CONTROLLER_BETA]: [
|
|
10425
10466
|
CoordinationType$1.META_COORDINATION_SCOPES,
|
|
@@ -10453,6 +10494,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
10453
10494
|
CoordinationType$1.SPATIAL_SEGMENTATION_FILLED,
|
|
10454
10495
|
CoordinationType$1.SPATIAL_SEGMENTATION_STROKE_WIDTH,
|
|
10455
10496
|
CoordinationType$1.SPATIAL_POINT_STROKE_WIDTH,
|
|
10497
|
+
CoordinationType$1.SPATIAL_POINT_RADIUS,
|
|
10456
10498
|
CoordinationType$1.IMAGE_CHANNEL,
|
|
10457
10499
|
CoordinationType$1.IMAGE_LAYER,
|
|
10458
10500
|
CoordinationType$1.SEGMENTATION_CHANNEL,
|
|
@@ -10471,6 +10513,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
10471
10513
|
CoordinationType$1.SPOT_LAYER,
|
|
10472
10514
|
CoordinationType$1.POINT_LAYER,
|
|
10473
10515
|
CoordinationType$1.SPATIAL_SPOT_RADIUS,
|
|
10516
|
+
CoordinationType$1.SPATIAL_SPOT_SHAPE,
|
|
10474
10517
|
CoordinationType$1.SPATIAL_SPOT_FILLED,
|
|
10475
10518
|
CoordinationType$1.SPATIAL_SPOT_STROKE_WIDTH,
|
|
10476
10519
|
CoordinationType$1.SPATIAL_LAYER_COLOR,
|
|
@@ -11200,14 +11243,15 @@ const ngPrecomputedMeshSchema = z.object({
|
|
|
11200
11243
|
subsources: z.record(z.boolean()).describe("Subsources are the individual data components of a source (e.g. meshes, skeletons, etc.). Each entry explicitly enables or disables a subsource.").optional(),
|
|
11201
11244
|
enableDefaultSubsources: z.boolean().describe("When true (default), automatically loads all subsources (defined in mesh metadata), when false loads what is explicitly enabled in `subsources`.").optional()
|
|
11202
11245
|
}).partial().nullable();
|
|
11246
|
+
const ngAnnotationTransformSchema = z.object({
|
|
11247
|
+
matrix: z.array(z.array(z.number())),
|
|
11248
|
+
outputDimensions: z.record(z.tuple([z.number(), z.string()]))
|
|
11249
|
+
}).optional().describe("A coordinate transformation matrix to apply to the annotation layer source to map annotation coordinates to the global coordinate space.");
|
|
11203
11250
|
const ngPointAnnotationSchema = z.object({
|
|
11204
11251
|
projectionAnnotationSpacing: z.number(),
|
|
11205
11252
|
featureIndexProp: z.string().optional().describe("The name of the Neuroglancer AnnotationProperty containing feature IDs. For example, specify 'gene' to use prop_gene() in the Neuroglancer shader code."),
|
|
11206
11253
|
pointIndexProp: z.string().optional().describe("The name of the Neuroglancer AnnotationProperty containing point IDs. For example, specify 'point_id' to use prop_point_id() in the Neuroglancer shader code."),
|
|
11207
|
-
transform:
|
|
11208
|
-
matrix: z.array(z.array(z.number())),
|
|
11209
|
-
outputDimensions: z.record(z.tuple([z.number(), z.string()]))
|
|
11210
|
-
}).optional().describe("A coordinate transformation matrix to apply to the annotation layer source to map annotation coordinates to the global coordinate space."),
|
|
11254
|
+
transform: ngAnnotationTransformSchema,
|
|
11211
11255
|
// Note: See comments in neuroglancer-sorger.js
|
|
11212
11256
|
// We may remove these in the future, pending clarification
|
|
11213
11257
|
// to questions in the tissue-map-tools repo
|
|
@@ -11216,6 +11260,14 @@ const ngPointAnnotationSchema = z.object({
|
|
|
11216
11260
|
quantitativeColorProp: z.string().optional(),
|
|
11217
11261
|
quantitativeColorMax: z.number().optional()
|
|
11218
11262
|
}).partial().nullable();
|
|
11263
|
+
const ngLocationsAnnotationSchema = z.object({
|
|
11264
|
+
projectionAnnotationSpacing: z.number(),
|
|
11265
|
+
transform: ngAnnotationTransformSchema,
|
|
11266
|
+
segmentIdProp: z.string().optional().describe("The name of the Neuroglancer AnnotationProperty holding the mesh segment ID (e.g. 'cell_id'). Defaults to 'id' when the annotation info declares it."),
|
|
11267
|
+
// Used when the corresponding segmentation channel uses obsColorEncoding 'geneSelection'.
|
|
11268
|
+
quantitativeColorProp: z.string().optional(),
|
|
11269
|
+
quantitativeColorMax: z.number().optional()
|
|
11270
|
+
}).partial().nullable();
|
|
11219
11271
|
const obsEmbeddingAnndataSchema = annDataObsEmbedding;
|
|
11220
11272
|
const obsSpotsAnndataSchema = annDataObsLocations;
|
|
11221
11273
|
const obsPointsAnndataSchema = annDataObsLocations;
|
|
@@ -20336,7 +20388,7 @@ const { tss } = createTss({
|
|
|
20336
20388
|
},
|
|
20337
20389
|
"usePlugin": useMuiThemeStyleOverridesPlugin
|
|
20338
20390
|
});
|
|
20339
|
-
const useStyles$
|
|
20391
|
+
const useStyles$z = tss.create({});
|
|
20340
20392
|
function createChainedFunction$1(...funcs) {
|
|
20341
20393
|
return funcs.reduce((acc, func) => {
|
|
20342
20394
|
if (func == null) {
|
|
@@ -79933,7 +79985,7 @@ const Popper = React.forwardRef((props, ref2) => {
|
|
|
79933
79985
|
}, [handlePopperRef]);
|
|
79934
79986
|
React.useImperativeHandle(popperRefProp, () => popperRef.current, []);
|
|
79935
79987
|
const [exited, setExited] = React.useState(true);
|
|
79936
|
-
const { theme } = useStyles$
|
|
79988
|
+
const { theme } = useStyles$z();
|
|
79937
79989
|
const rtlPlacement = flipPlacement(initialPlacement, theme);
|
|
79938
79990
|
const [placement, setPlacement] = React.useState(rtlPlacement);
|
|
79939
79991
|
React.useEffect(() => {
|
|
@@ -80688,7 +80740,7 @@ var VariableSizeList$1 = /* @__PURE__ */ createListComponent({
|
|
|
80688
80740
|
});
|
|
80689
80741
|
const VariableSizeList = VariableSizeList$1;
|
|
80690
80742
|
const LIST_ROW_HEIGHT$1 = 48;
|
|
80691
|
-
const useStyles$
|
|
80743
|
+
const useStyles$y = makeStyles()(() => ({
|
|
80692
80744
|
searchInput: {
|
|
80693
80745
|
lineHeight: "initial",
|
|
80694
80746
|
height: "auto !important"
|
|
@@ -80728,7 +80780,7 @@ const ListboxComponent$1 = React__default.forwardRef((props, ref2) => {
|
|
|
80728
80780
|
});
|
|
80729
80781
|
function SimpleAutocomplete(props) {
|
|
80730
80782
|
const { getMatches, onChange, textInputLabel = "Enter a gene", getItemLabel = (option) => option.label } = props;
|
|
80731
|
-
const { classes: classes2 } = useStyles$
|
|
80783
|
+
const { classes: classes2 } = useStyles$y();
|
|
80732
80784
|
const [potentialItems, setPotentialItems] = useState([]);
|
|
80733
80785
|
const handleInputChange = async (_event, value2) => {
|
|
80734
80786
|
if (!value2) {
|
|
@@ -90278,7 +90330,7 @@ function defaultUrlTransform(value2) {
|
|
|
90278
90330
|
}
|
|
90279
90331
|
return "";
|
|
90280
90332
|
}
|
|
90281
|
-
const useStyles$
|
|
90333
|
+
const useStyles$x = makeStyles()((theme) => ({
|
|
90282
90334
|
description: {
|
|
90283
90335
|
"& p, details, table": {
|
|
90284
90336
|
fontSize: "80%",
|
|
@@ -90315,7 +90367,7 @@ const useStyles$y = makeStyles()((theme) => ({
|
|
|
90315
90367
|
}));
|
|
90316
90368
|
function Description(props) {
|
|
90317
90369
|
const { description: description2, metadata: metadata2, descriptionType } = props;
|
|
90318
|
-
const { classes: classes2 } = useStyles$
|
|
90370
|
+
const { classes: classes2 } = useStyles$x();
|
|
90319
90371
|
return jsxs("div", { className: classes2.description, children: [descriptionType && descriptionType === DescriptionType.MARKDOWN ? jsx$1(Markdown, { children: description2 }) : jsx$1("p", { children: description2 }), metadata2 && Array.from(metadata2.entries()).map(([layerIndex, { name: layerName, metadata: metadataRecord }]) => metadataRecord && Object.entries(metadataRecord).length > 0 ? jsxs("details", { children: [jsx$1("summary", { children: layerName }), jsx$1("div", { className: classes2.metadataContainer, children: jsx$1("table", { children: jsx$1("tbody", { children: Object.entries(metadataRecord).map(([key2, value2]) => jsxs("tr", { children: [jsx$1("th", { title: key2, children: key2 }), jsx$1("td", { title: value2, children: value2 })] }, key2)) }) }) })] }, layerIndex) : null)] });
|
|
90320
90372
|
}
|
|
90321
90373
|
function DescriptionSubscriber(props) {
|
|
@@ -94111,27 +94163,9 @@ function stratifyArrays(sampleEdges, sampleSets, sampleSetSelection, obsIndex, m
|
|
|
94111
94163
|
if (arrKey !== "featureValue") {
|
|
94112
94164
|
return (i2) => arr[i2];
|
|
94113
94165
|
}
|
|
94114
|
-
|
|
94166
|
+
{
|
|
94115
94167
|
return (i2) => arr[0][i2];
|
|
94116
94168
|
}
|
|
94117
|
-
if (featureAggregationStrategy === "last") {
|
|
94118
|
-
return (i2) => arr[arr.length - 1][i2];
|
|
94119
|
-
}
|
|
94120
|
-
if (typeof featureAggregationStrategy === "number") {
|
|
94121
|
-
const j = featureAggregationStrategy;
|
|
94122
|
-
return (i2) => arr[j][i2];
|
|
94123
|
-
}
|
|
94124
|
-
if (featureAggregationStrategy === "sum" || featureAggregationStrategy === "mean") {
|
|
94125
|
-
const divisor = featureAggregationStrategy === "mean" ? arr.length : 1;
|
|
94126
|
-
return (i2) => {
|
|
94127
|
-
let sum2 = 0;
|
|
94128
|
-
for (let h2 = 0; h2 < arr.length; h2 += 1) {
|
|
94129
|
-
sum2 += arr[h2][i2];
|
|
94130
|
-
}
|
|
94131
|
-
return sum2 / divisor;
|
|
94132
|
-
};
|
|
94133
|
-
}
|
|
94134
|
-
return () => void 0;
|
|
94135
94169
|
});
|
|
94136
94170
|
const groupArrays = new Array(numGroups);
|
|
94137
94171
|
for (let g2 = 0; g2 < numGroups; g2 += 1) {
|
|
@@ -100880,7 +100914,7 @@ const Tooltip$2 = /* @__PURE__ */ React.forwardRef((props, ref2) => {
|
|
|
100880
100914
|
}, extraProps), getChildren());
|
|
100881
100915
|
});
|
|
100882
100916
|
const nodeHeight = 32;
|
|
100883
|
-
const useStyles$
|
|
100917
|
+
const useStyles$w = makeStyles()((theme) => ({
|
|
100884
100918
|
setsManager: {
|
|
100885
100919
|
position: "relative",
|
|
100886
100920
|
width: "100%",
|
|
@@ -101047,7 +101081,7 @@ const useStyles$x = makeStyles()((theme) => ({
|
|
|
101047
101081
|
}));
|
|
101048
101082
|
function SetsManagerTreeGlobalStyles(props) {
|
|
101049
101083
|
const { classes: classes2 } = props;
|
|
101050
|
-
const { theme } = useStyles$
|
|
101084
|
+
const { theme } = useStyles$z();
|
|
101051
101085
|
return jsx$1(ScopedGlobalStyles, { parentClassName: classes2.setsManagerTree, styles: {
|
|
101052
101086
|
".rc-tree": {
|
|
101053
101087
|
paddingLeft: "0",
|
|
@@ -101388,7 +101422,7 @@ function HelpTooltipGlobalStyles(props) {
|
|
|
101388
101422
|
}
|
|
101389
101423
|
function PopoverGlobalStyles(props) {
|
|
101390
101424
|
const { classes: classes2 } = props;
|
|
101391
|
-
const { theme } = useStyles$
|
|
101425
|
+
const { theme } = useStyles$z();
|
|
101392
101426
|
return jsx$1(ScopedGlobalStyles, { parentClassName: classes2.popover, styles: {
|
|
101393
101427
|
".rc-tooltip-inner": {
|
|
101394
101428
|
boxSizing: "border-box",
|
|
@@ -106072,7 +106106,7 @@ function NamedSetNodeStatic(props) {
|
|
|
106072
106106
|
const onClick = level === 0 && !expanded ? () => onCheckLevel(nodeKey, nextLevelToCheck) : () => onNodeView(path2);
|
|
106073
106107
|
const tooltipProps = disableTooltip ? { visible: false } : {};
|
|
106074
106108
|
const popoverMenuConfig = makeNodeViewMenuConfig(props);
|
|
106075
|
-
const { classes: classes2 } = useStyles$
|
|
106109
|
+
const { classes: classes2 } = useStyles$w();
|
|
106076
106110
|
return jsxs("span", { children: [jsx$1(HelpTooltip, { title: tooltipText, ...tooltipProps, children: jsx$1("button", { type: "button", onClick, onKeyPress: (e3) => callbackOnKeyPress(e3, "v", () => onNodeView(path2)), className: classes2.titleButton, children: title2 }) }), popoverMenuConfig.length > 0 ? jsx$1(PopoverMenu, { menuConfig: makeNodeViewMenuConfig(props), color: level > 0 && editable ? color2 || getDefaultColor(theme) : null, setColor: (c2) => onNodeSetColor(path2, c2), children: jsx$1("span", { children: jsx$1(SvgMenu, { className: classes2.nodeMenuIcon, "aria-label": "Open Node View Menu" }) }) }) : null, level > 0 && isChecking ? checkbox2 : null, level > 0 && jsx$1("span", { className: classes2.nodeSizeLabel, children: niceSize })] });
|
|
106077
106111
|
}
|
|
106078
106112
|
function NamedSetNodeEditing(props) {
|
|
@@ -106084,7 +106118,7 @@ function NamedSetNodeEditing(props) {
|
|
|
106084
106118
|
onNodeSetName(path2, currentTitle, true);
|
|
106085
106119
|
}
|
|
106086
106120
|
}
|
|
106087
|
-
const { classes: classes2 } = useStyles$
|
|
106121
|
+
const { classes: classes2 } = useStyles$w();
|
|
106088
106122
|
return jsxs("span", { className: classes2.titleButtonWithInput, children: [jsx$1("input", {
|
|
106089
106123
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
106090
106124
|
autoFocus: true,
|
|
@@ -106110,7 +106144,7 @@ function LevelsButtons(props) {
|
|
|
106110
106144
|
onCheckLevel(nodeKey, newLevel);
|
|
106111
106145
|
}
|
|
106112
106146
|
}
|
|
106113
|
-
const { classes: classes2 } = useStyles$
|
|
106147
|
+
const { classes: classes2 } = useStyles$w();
|
|
106114
106148
|
return jsx$1("div", { className: classes2.levelButtonsContainer, children: range$d(1, height2 + 1).map((i2) => {
|
|
106115
106149
|
const isChecked = isEqual$3(path2, checkedLevelPath) && i2 === checkedLevelIndex;
|
|
106116
106150
|
return jsx$1("div", { children: jsx$1(HelpTooltip, { title: getLevelTooltipText(i2), children: jsx$1("input", { className: clsx(classes2.levelRadioButton, { [classes2.levelRadioButtonChecked]: isChecked && !hasColorEncoding }), type: "checkbox", value: i2, checked: isChecked && hasColorEncoding, onChange: onCheck }) }) }, i2);
|
|
@@ -106194,7 +106228,7 @@ let TreeNode$1 = class TreeNode extends TreeNode$2 {
|
|
|
106194
106228
|
};
|
|
106195
106229
|
function PlusButton(props) {
|
|
106196
106230
|
const { datatype, onError, onImportTree, onCreateLevelZeroNode, importable, editable } = props;
|
|
106197
|
-
const { classes: classes2 } = useStyles$
|
|
106231
|
+
const { classes: classes2 } = useStyles$w();
|
|
106198
106232
|
const onImport = useCallback((importHandler, mimeType) => () => {
|
|
106199
106233
|
const uploadInputNode = document.createElement("input");
|
|
106200
106234
|
uploadInputNode.setAttribute("type", "file");
|
|
@@ -106311,7 +106345,7 @@ function SetsManager(props) {
|
|
|
106311
106345
|
}, onNodeCheckNewName, onNodeSetIsEditing: setIsEditingNodeName, onNodeRemove, onExportLevelZeroNodeJSON, onExportLevelZeroNodeTabular, onExportSetJSON, disableTooltip: isDragging, onDragStart: () => setIsDragging(true), onDragEnd: () => setIsDragging(false), children: renderTreeNodes(node2.children, readOnly, newPath) }, pathToKey$1(newPath));
|
|
106312
106346
|
});
|
|
106313
106347
|
}
|
|
106314
|
-
const { classes: classes2 } = useStyles$
|
|
106348
|
+
const { classes: classes2 } = useStyles$w();
|
|
106315
106349
|
return jsxs("div", { className: classes2.setsManager, children: [jsx$1(SetsManagerTreeGlobalStyles, { classes: classes2 }), jsxs("div", { className: classes2.setsManagerTree, children: [jsx$1(Tree$1, { draggable: false, checkable, checkedKeys: setSelectionKeys, expandedKeys: setExpansionKeys, autoExpandParent, onCheck: (checkedKeys, info2) => onCheckNode(info2.node.props.nodeKey, info2.checked), onExpand: (expandedKeys, info2) => onExpandNode(expandedKeys, info2.node.props.nodeKey, info2.expanded), children: renderTreeNodes(processedSets.tree, true, []) }), jsx$1(Tree$1, { draggable: true, checkable, checkedKeys: additionalSetSelectionKeys, expandedKeys: additionalSetExpansionKeys, autoExpandParent, onCheck: (checkedKeys, info2) => onCheckNode(info2.node.props.nodeKey, info2.checked), onExpand: (expandedKeys, info2) => onExpandNode(expandedKeys, info2.node.props.nodeKey, info2.expanded), onDrop: (info2) => {
|
|
106316
106350
|
const { eventKey: dropKey } = info2.node.props;
|
|
106317
106351
|
const { eventKey: dragKey } = info2.dragNode.props;
|
|
@@ -189734,7 +189768,7 @@ function requireBignumber() {
|
|
|
189734
189768
|
(function(globalObject) {
|
|
189735
189769
|
var BigNumber2, isNumeric2 = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil2 = Math.ceil, mathfloor2 = Math.floor, bignumberError2 = "[BigNumber Error] ", tooManyDigits2 = bignumberError2 + "Number primitive has more than 15 significant digits: ", BASE2 = 1e14, LOG_BASE2 = 14, MAX_SAFE_INTEGER2 = 9007199254740991, POWS_TEN2 = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE2 = 1e7, MAX2 = 1e9;
|
|
189736
189770
|
function clone2(configObject) {
|
|
189737
|
-
var div2, convertBase2, parseNumeric, P2 = BigNumber3.prototype = { constructor: BigNumber3, toString: null, valueOf: null }, ONE = new BigNumber3(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21,
|
|
189771
|
+
var div2, convertBase2, parseNumeric, P2 = BigNumber3.prototype = { constructor: BigNumber3, toString: null, valueOf: null }, ONE = new BigNumber3(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP2 = -1e7, MAX_EXP2 = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
189738
189772
|
prefix: "",
|
|
189739
189773
|
groupSize: 3,
|
|
189740
189774
|
secondaryGroupSize: 0,
|
|
@@ -189751,9 +189785,9 @@ function requireBignumber() {
|
|
|
189751
189785
|
if (b2 == null) {
|
|
189752
189786
|
if (v && v._isBigNumber === true) {
|
|
189753
189787
|
x2.s = v.s;
|
|
189754
|
-
if (!v.c || v.e >
|
|
189788
|
+
if (!v.c || v.e > MAX_EXP2) {
|
|
189755
189789
|
x2.c = x2.e = null;
|
|
189756
|
-
} else if (v.e <
|
|
189790
|
+
} else if (v.e < MIN_EXP2) {
|
|
189757
189791
|
x2.c = [x2.e = 0];
|
|
189758
189792
|
} else {
|
|
189759
189793
|
x2.e = v.e;
|
|
@@ -189765,7 +189799,7 @@ function requireBignumber() {
|
|
|
189765
189799
|
x2.s = 1 / v < 0 ? (v = -v, -1) : 1;
|
|
189766
189800
|
if (v === ~~v) {
|
|
189767
189801
|
for (e3 = 0, i2 = v; i2 >= 10; i2 /= 10, e3++) ;
|
|
189768
|
-
if (e3 >
|
|
189802
|
+
if (e3 > MAX_EXP2) {
|
|
189769
189803
|
x2.c = x2.e = null;
|
|
189770
189804
|
} else {
|
|
189771
189805
|
x2.e = e3;
|
|
@@ -189834,9 +189868,9 @@ function requireBignumber() {
|
|
|
189834
189868
|
if (isNum && BigNumber3.DEBUG && len2 > 15 && (v > MAX_SAFE_INTEGER2 || v !== mathfloor2(v))) {
|
|
189835
189869
|
throw Error(tooManyDigits2 + x2.s * v);
|
|
189836
189870
|
}
|
|
189837
|
-
if ((e3 = e3 - i2 - 1) >
|
|
189871
|
+
if ((e3 = e3 - i2 - 1) > MAX_EXP2) {
|
|
189838
189872
|
x2.c = x2.e = null;
|
|
189839
|
-
} else if (e3 <
|
|
189873
|
+
} else if (e3 < MIN_EXP2) {
|
|
189840
189874
|
x2.c = [x2.e = 0];
|
|
189841
189875
|
} else {
|
|
189842
189876
|
x2.e = e3;
|
|
@@ -189901,12 +189935,12 @@ function requireBignumber() {
|
|
|
189901
189935
|
if (v && v.pop) {
|
|
189902
189936
|
intCheck2(v[0], -MAX2, -1, p);
|
|
189903
189937
|
intCheck2(v[1], 1, MAX2, p);
|
|
189904
|
-
|
|
189905
|
-
|
|
189938
|
+
MIN_EXP2 = v[0];
|
|
189939
|
+
MAX_EXP2 = v[1];
|
|
189906
189940
|
} else {
|
|
189907
189941
|
intCheck2(v, -MAX2, MAX2, p);
|
|
189908
189942
|
if (v) {
|
|
189909
|
-
|
|
189943
|
+
MIN_EXP2 = -(MAX_EXP2 = v < 0 ? -v : v);
|
|
189910
189944
|
} else {
|
|
189911
189945
|
throw Error(bignumberError2 + p + " cannot be zero: " + v);
|
|
189912
189946
|
}
|
|
@@ -189961,7 +189995,7 @@ function requireBignumber() {
|
|
|
189961
189995
|
DECIMAL_PLACES,
|
|
189962
189996
|
ROUNDING_MODE,
|
|
189963
189997
|
EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
|
|
189964
|
-
RANGE: [
|
|
189998
|
+
RANGE: [MIN_EXP2, MAX_EXP2],
|
|
189965
189999
|
CRYPTO,
|
|
189966
190000
|
MODULO_MODE,
|
|
189967
190001
|
POW_PRECISION,
|
|
@@ -190338,9 +190372,9 @@ function requireBignumber() {
|
|
|
190338
190372
|
var i2 = 1, j = c2.length;
|
|
190339
190373
|
for (; !c2[--j]; c2.pop()) ;
|
|
190340
190374
|
for (j = c2[0]; j >= 10; j /= 10, i2++) ;
|
|
190341
|
-
if ((e3 = i2 + e3 * LOG_BASE2 - 1) >
|
|
190375
|
+
if ((e3 = i2 + e3 * LOG_BASE2 - 1) > MAX_EXP2) {
|
|
190342
190376
|
n3.c = n3.e = null;
|
|
190343
|
-
} else if (e3 <
|
|
190377
|
+
} else if (e3 < MIN_EXP2) {
|
|
190344
190378
|
n3.c = [n3.e = 0];
|
|
190345
190379
|
} else {
|
|
190346
190380
|
n3.e = e3;
|
|
@@ -190452,9 +190486,9 @@ function requireBignumber() {
|
|
|
190452
190486
|
}
|
|
190453
190487
|
for (i2 = xc.length; xc[--i2] === 0; xc.pop()) ;
|
|
190454
190488
|
}
|
|
190455
|
-
if (x2.e >
|
|
190489
|
+
if (x2.e > MAX_EXP2) {
|
|
190456
190490
|
x2.c = x2.e = null;
|
|
190457
|
-
} else if (x2.e <
|
|
190491
|
+
} else if (x2.e < MIN_EXP2) {
|
|
190458
190492
|
x2.c = [x2.e = 0];
|
|
190459
190493
|
}
|
|
190460
190494
|
}
|
|
@@ -190939,8 +190973,8 @@ function requireBignumber() {
|
|
|
190939
190973
|
e3 = d.e = s2.length - x2.e - 1;
|
|
190940
190974
|
d.c[0] = POWS_TEN2[(exp2 = e3 % LOG_BASE2) < 0 ? LOG_BASE2 + exp2 : exp2];
|
|
190941
190975
|
md2 = !md2 || n3.comparedTo(d) > 0 ? e3 > 0 ? d : n12 : n3;
|
|
190942
|
-
exp2 =
|
|
190943
|
-
|
|
190976
|
+
exp2 = MAX_EXP2;
|
|
190977
|
+
MAX_EXP2 = 1 / 0;
|
|
190944
190978
|
n3 = new BigNumber3(s2);
|
|
190945
190979
|
n0.c[0] = 0;
|
|
190946
190980
|
for (; ; ) {
|
|
@@ -190962,7 +190996,7 @@ function requireBignumber() {
|
|
|
190962
190996
|
r3 = div2(n12, d1, e3, ROUNDING_MODE).minus(x2).abs().comparedTo(
|
|
190963
190997
|
div2(n0, d0, e3, ROUNDING_MODE).minus(x2).abs()
|
|
190964
190998
|
) < 1 ? [n12, d1] : [n0, d0];
|
|
190965
|
-
|
|
190999
|
+
MAX_EXP2 = exp2;
|
|
190966
191000
|
return r3;
|
|
190967
191001
|
};
|
|
190968
191002
|
P2.toNumber = function() {
|
|
@@ -210912,22 +210946,22 @@ async function getDecoder(fileDirectory) {
|
|
|
210912
210946
|
const Decoder = await importFn();
|
|
210913
210947
|
return new Decoder(fileDirectory);
|
|
210914
210948
|
}
|
|
210915
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
210916
|
-
addDecoder(5, () => import("./lzw-
|
|
210949
|
+
addDecoder([void 0, 1], () => import("./raw-Bi4zouCM.js").then((m2) => m2.default));
|
|
210950
|
+
addDecoder(5, () => import("./lzw-BhiKtyvb.js").then((m2) => m2.default));
|
|
210917
210951
|
addDecoder(6, () => {
|
|
210918
210952
|
throw new Error("old style JPEG compression is not supported.");
|
|
210919
210953
|
});
|
|
210920
|
-
addDecoder(7, () => import("./jpeg-
|
|
210921
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
210922
|
-
addDecoder(32773, () => import("./packbits-
|
|
210954
|
+
addDecoder(7, () => import("./jpeg--u-M0g9b.js").then((m2) => m2.default));
|
|
210955
|
+
addDecoder([8, 32946], () => import("./deflate-Dw6ATHuZ.js").then((m2) => m2.default));
|
|
210956
|
+
addDecoder(32773, () => import("./packbits-BJuD6cdw.js").then((m2) => m2.default));
|
|
210923
210957
|
addDecoder(
|
|
210924
210958
|
34887,
|
|
210925
|
-
() => import("./lerc-
|
|
210959
|
+
() => import("./lerc-7EC7_2zX.js").then(async (m2) => {
|
|
210926
210960
|
await m2.zstd.init();
|
|
210927
210961
|
return m2;
|
|
210928
210962
|
}).then((m2) => m2.default)
|
|
210929
210963
|
);
|
|
210930
|
-
addDecoder(50001, () => import("./webimage-
|
|
210964
|
+
addDecoder(50001, () => import("./webimage-BEdUDFND.js").then((m2) => m2.default));
|
|
210931
210965
|
function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
|
|
210932
210966
|
return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
|
|
210933
210967
|
}
|
|
@@ -221354,14 +221388,14 @@ vec4 colormap(float intensity) {
|
|
|
221354
221388
|
}
|
|
221355
221389
|
};
|
|
221356
221390
|
}
|
|
221357
|
-
const defaultProps$4$
|
|
221391
|
+
const defaultProps$4$2 = {
|
|
221358
221392
|
colormap: { type: "string", value: "viridis", compare: true },
|
|
221359
221393
|
opacity: { type: "number", value: 1, compare: true },
|
|
221360
221394
|
useTransparentColor: { type: "boolean", value: false, compare: true }
|
|
221361
221395
|
};
|
|
221362
221396
|
const AdditiveColormapExtension = class extends LayerExtension {
|
|
221363
221397
|
getShaders() {
|
|
221364
|
-
const name2 = this?.props?.colormap || defaultProps$4$
|
|
221398
|
+
const name2 = this?.props?.colormap || defaultProps$4$2.colormap.value;
|
|
221365
221399
|
const apply_cmap = cmaps[name2];
|
|
221366
221400
|
if (!apply_cmap) {
|
|
221367
221401
|
throw Error(`No colormap named ${name2} found in registry`);
|
|
@@ -221380,8 +221414,8 @@ const AdditiveColormapExtension = class extends LayerExtension {
|
|
|
221380
221414
|
}
|
|
221381
221415
|
draw() {
|
|
221382
221416
|
const {
|
|
221383
|
-
useTransparentColor = defaultProps$4$
|
|
221384
|
-
opacity: opacity2 = defaultProps$4$
|
|
221417
|
+
useTransparentColor = defaultProps$4$2.useTransparentColor.value,
|
|
221418
|
+
opacity: opacity2 = defaultProps$4$2.opacity.value
|
|
221385
221419
|
} = this.props;
|
|
221386
221420
|
const uniforms = {
|
|
221387
221421
|
opacity: opacity2,
|
|
@@ -221391,7 +221425,7 @@ const AdditiveColormapExtension = class extends LayerExtension {
|
|
|
221391
221425
|
}
|
|
221392
221426
|
};
|
|
221393
221427
|
AdditiveColormapExtension.extensionName = "AdditiveColormapExtension";
|
|
221394
|
-
AdditiveColormapExtension.defaultProps = defaultProps$4$
|
|
221428
|
+
AdditiveColormapExtension.defaultProps = defaultProps$4$2;
|
|
221395
221429
|
const fs$1$2 = `uniform vec3 transparentColor;
|
|
221396
221430
|
uniform bool useTransparentColor;
|
|
221397
221431
|
uniform float opacity;
|
|
@@ -222691,7 +222725,7 @@ const ImageLayer = class extends CompositeLayer {
|
|
|
222691
222725
|
};
|
|
222692
222726
|
ImageLayer.layerName = "ImageLayer";
|
|
222693
222727
|
ImageLayer.defaultProps = defaultProps$5;
|
|
222694
|
-
const defaultProps$4 = {
|
|
222728
|
+
const defaultProps$4$1 = {
|
|
222695
222729
|
pickable: { type: "boolean", value: true, compare: true },
|
|
222696
222730
|
onHover: { type: "function", value: null, compare: false },
|
|
222697
222731
|
contrastLimits: { type: "array", value: [], compare: true },
|
|
@@ -222803,7 +222837,7 @@ const MultiscaleImageLayer = class extends CompositeLayer {
|
|
|
222803
222837
|
}
|
|
222804
222838
|
};
|
|
222805
222839
|
MultiscaleImageLayer.layerName = "MultiscaleImageLayer";
|
|
222806
|
-
MultiscaleImageLayer.defaultProps = defaultProps$4;
|
|
222840
|
+
MultiscaleImageLayer.defaultProps = defaultProps$4$1;
|
|
222807
222841
|
const defaultProps$3$1 = {
|
|
222808
222842
|
pickable: { type: "boolean", value: true, compare: true },
|
|
222809
222843
|
loader: {
|
|
@@ -223941,7 +223975,7 @@ function padWithDefault$1(arr, defaultValue2, padWidth) {
|
|
|
223941
223975
|
}
|
|
223942
223976
|
return newArr;
|
|
223943
223977
|
}
|
|
223944
|
-
const defaultProps$
|
|
223978
|
+
const defaultProps$4 = {
|
|
223945
223979
|
hoveredCell: { type: "number", value: null, compare: true },
|
|
223946
223980
|
// We do not want to deep-compare cellColorData,
|
|
223947
223981
|
// as it is potentially a TypedArray with millions of elements.
|
|
@@ -224058,7 +224092,7 @@ let BitmaskLayer$1 = class BitmaskLayer extends XRLayer {
|
|
|
224058
224092
|
}
|
|
224059
224093
|
};
|
|
224060
224094
|
BitmaskLayer$1.layerName = "BitmaskLayer";
|
|
224061
|
-
BitmaskLayer$1.defaultProps = defaultProps$
|
|
224095
|
+
BitmaskLayer$1.defaultProps = defaultProps$4;
|
|
224062
224096
|
const vs = `
|
|
224063
224097
|
#define SHADER_NAME bitmask-layer-vertex-shader
|
|
224064
224098
|
|
|
@@ -224400,7 +224434,7 @@ function isEqualShallow(prevArr, nextArr) {
|
|
|
224400
224434
|
}
|
|
224401
224435
|
return prevArr === nextArr;
|
|
224402
224436
|
}
|
|
224403
|
-
const defaultProps$
|
|
224437
|
+
const defaultProps$3 = {
|
|
224404
224438
|
channelStrokeWidths: { type: "array", value: null, compare: true },
|
|
224405
224439
|
channelsFilled: { type: "array", value: null, compare: true },
|
|
224406
224440
|
channelOpacities: { type: "array", value: null, compare: true },
|
|
@@ -224664,10 +224698,10 @@ class BitmaskLayer2 extends XRLayer {
|
|
|
224664
224698
|
}
|
|
224665
224699
|
}
|
|
224666
224700
|
BitmaskLayer2.layerName = "BitmaskLayer";
|
|
224667
|
-
BitmaskLayer2.defaultProps = defaultProps$
|
|
224701
|
+
BitmaskLayer2.defaultProps = defaultProps$3;
|
|
224668
224702
|
var isNumeric$2 = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor$1 = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE$1 = 1e14, LOG_BASE$1 = 14, MAX_SAFE_INTEGER$3 = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX$1 = 1e9;
|
|
224669
224703
|
function clone$3(configObject) {
|
|
224670
|
-
var div2, convertBase2, parseNumeric, P2 = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21,
|
|
224704
|
+
var div2, convertBase2, parseNumeric, P2 = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP2 = -1e7, MAX_EXP2 = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
224671
224705
|
prefix: "",
|
|
224672
224706
|
groupSize: 3,
|
|
224673
224707
|
secondaryGroupSize: 0,
|
|
@@ -224684,9 +224718,9 @@ function clone$3(configObject) {
|
|
|
224684
224718
|
if (b2 == null) {
|
|
224685
224719
|
if (v && v._isBigNumber === true) {
|
|
224686
224720
|
x2.s = v.s;
|
|
224687
|
-
if (!v.c || v.e >
|
|
224721
|
+
if (!v.c || v.e > MAX_EXP2) {
|
|
224688
224722
|
x2.c = x2.e = null;
|
|
224689
|
-
} else if (v.e <
|
|
224723
|
+
} else if (v.e < MIN_EXP2) {
|
|
224690
224724
|
x2.c = [x2.e = 0];
|
|
224691
224725
|
} else {
|
|
224692
224726
|
x2.e = v.e;
|
|
@@ -224698,7 +224732,7 @@ function clone$3(configObject) {
|
|
|
224698
224732
|
x2.s = 1 / v < 0 ? (v = -v, -1) : 1;
|
|
224699
224733
|
if (v === ~~v) {
|
|
224700
224734
|
for (e3 = 0, i2 = v; i2 >= 10; i2 /= 10, e3++) ;
|
|
224701
|
-
if (e3 >
|
|
224735
|
+
if (e3 > MAX_EXP2) {
|
|
224702
224736
|
x2.c = x2.e = null;
|
|
224703
224737
|
} else {
|
|
224704
224738
|
x2.e = e3;
|
|
@@ -224767,9 +224801,9 @@ function clone$3(configObject) {
|
|
|
224767
224801
|
if (isNum && BigNumber2.DEBUG && len2 > 15 && (v > MAX_SAFE_INTEGER$3 || v !== mathfloor$1(v))) {
|
|
224768
224802
|
throw Error(tooManyDigits + x2.s * v);
|
|
224769
224803
|
}
|
|
224770
|
-
if ((e3 = e3 - i2 - 1) >
|
|
224804
|
+
if ((e3 = e3 - i2 - 1) > MAX_EXP2) {
|
|
224771
224805
|
x2.c = x2.e = null;
|
|
224772
|
-
} else if (e3 <
|
|
224806
|
+
} else if (e3 < MIN_EXP2) {
|
|
224773
224807
|
x2.c = [x2.e = 0];
|
|
224774
224808
|
} else {
|
|
224775
224809
|
x2.e = e3;
|
|
@@ -224834,12 +224868,12 @@ function clone$3(configObject) {
|
|
|
224834
224868
|
if (v && v.pop) {
|
|
224835
224869
|
intCheck(v[0], -MAX$1, -1, p);
|
|
224836
224870
|
intCheck(v[1], 1, MAX$1, p);
|
|
224837
|
-
|
|
224838
|
-
|
|
224871
|
+
MIN_EXP2 = v[0];
|
|
224872
|
+
MAX_EXP2 = v[1];
|
|
224839
224873
|
} else {
|
|
224840
224874
|
intCheck(v, -MAX$1, MAX$1, p);
|
|
224841
224875
|
if (v) {
|
|
224842
|
-
|
|
224876
|
+
MIN_EXP2 = -(MAX_EXP2 = v < 0 ? -v : v);
|
|
224843
224877
|
} else {
|
|
224844
224878
|
throw Error(bignumberError + p + " cannot be zero: " + v);
|
|
224845
224879
|
}
|
|
@@ -224894,7 +224928,7 @@ function clone$3(configObject) {
|
|
|
224894
224928
|
DECIMAL_PLACES,
|
|
224895
224929
|
ROUNDING_MODE,
|
|
224896
224930
|
EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
|
|
224897
|
-
RANGE: [
|
|
224931
|
+
RANGE: [MIN_EXP2, MAX_EXP2],
|
|
224898
224932
|
CRYPTO,
|
|
224899
224933
|
MODULO_MODE,
|
|
224900
224934
|
POW_PRECISION,
|
|
@@ -225271,9 +225305,9 @@ function clone$3(configObject) {
|
|
|
225271
225305
|
var i2 = 1, j = c2.length;
|
|
225272
225306
|
for (; !c2[--j]; c2.pop()) ;
|
|
225273
225307
|
for (j = c2[0]; j >= 10; j /= 10, i2++) ;
|
|
225274
|
-
if ((e3 = i2 + e3 * LOG_BASE$1 - 1) >
|
|
225308
|
+
if ((e3 = i2 + e3 * LOG_BASE$1 - 1) > MAX_EXP2) {
|
|
225275
225309
|
n3.c = n3.e = null;
|
|
225276
|
-
} else if (e3 <
|
|
225310
|
+
} else if (e3 < MIN_EXP2) {
|
|
225277
225311
|
n3.c = [n3.e = 0];
|
|
225278
225312
|
} else {
|
|
225279
225313
|
n3.e = e3;
|
|
@@ -225385,9 +225419,9 @@ function clone$3(configObject) {
|
|
|
225385
225419
|
}
|
|
225386
225420
|
for (i2 = xc.length; xc[--i2] === 0; xc.pop()) ;
|
|
225387
225421
|
}
|
|
225388
|
-
if (x2.e >
|
|
225422
|
+
if (x2.e > MAX_EXP2) {
|
|
225389
225423
|
x2.c = x2.e = null;
|
|
225390
|
-
} else if (x2.e <
|
|
225424
|
+
} else if (x2.e < MIN_EXP2) {
|
|
225391
225425
|
x2.c = [x2.e = 0];
|
|
225392
225426
|
}
|
|
225393
225427
|
}
|
|
@@ -225872,8 +225906,8 @@ function clone$3(configObject) {
|
|
|
225872
225906
|
e3 = d.e = s2.length - x2.e - 1;
|
|
225873
225907
|
d.c[0] = POWS_TEN[(exp2 = e3 % LOG_BASE$1) < 0 ? LOG_BASE$1 + exp2 : exp2];
|
|
225874
225908
|
md2 = !md2 || n3.comparedTo(d) > 0 ? e3 > 0 ? d : n12 : n3;
|
|
225875
|
-
exp2 =
|
|
225876
|
-
|
|
225909
|
+
exp2 = MAX_EXP2;
|
|
225910
|
+
MAX_EXP2 = 1 / 0;
|
|
225877
225911
|
n3 = new BigNumber2(s2);
|
|
225878
225912
|
n0.c[0] = 0;
|
|
225879
225913
|
for (; ; ) {
|
|
@@ -225895,7 +225929,7 @@ function clone$3(configObject) {
|
|
|
225895
225929
|
r3 = div2(n12, d1, e3, ROUNDING_MODE).minus(x2).abs().comparedTo(
|
|
225896
225930
|
div2(n0, d0, e3, ROUNDING_MODE).minus(x2).abs()
|
|
225897
225931
|
) < 1 ? [n12, d1] : [n0, d0];
|
|
225898
|
-
|
|
225932
|
+
MAX_EXP2 = exp2;
|
|
225899
225933
|
return r3;
|
|
225900
225934
|
};
|
|
225901
225935
|
P2.toNumber = function() {
|
|
@@ -227620,7 +227654,7 @@ function distance(from2, to, options = {}) {
|
|
|
227620
227654
|
);
|
|
227621
227655
|
}
|
|
227622
227656
|
const DEFAULT_THRESHOLD = 1;
|
|
227623
|
-
const defaultProps$
|
|
227657
|
+
const defaultProps$2 = {
|
|
227624
227658
|
// for text
|
|
227625
227659
|
obsSetPath: { type: "object" },
|
|
227626
227660
|
sampleSetPath: { type: "object" },
|
|
@@ -227794,7 +227828,7 @@ class ContourLayerWithText extends ContourLayer {
|
|
|
227794
227828
|
}
|
|
227795
227829
|
}
|
|
227796
227830
|
ContourLayerWithText.layerName = "ContourLayerWithText";
|
|
227797
|
-
ContourLayerWithText.defaultProps = defaultProps$
|
|
227831
|
+
ContourLayerWithText.defaultProps = defaultProps$2;
|
|
227798
227832
|
const deck = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
227799
227833
|
__proto__: null,
|
|
227800
227834
|
COORDINATE_SYSTEM,
|
|
@@ -228821,7 +228855,7 @@ function createAnnotationLayers(shapes = [], zoom2 = 0, selectedShapeUid = null,
|
|
|
228821
228855
|
});
|
|
228822
228856
|
return [...selectionLayers, ...layers, ...measureLayers];
|
|
228823
228857
|
}
|
|
228824
|
-
const defaultProps = {
|
|
228858
|
+
const defaultProps$1 = {
|
|
228825
228859
|
// Array of annotation shape objects (see annotationShapeObj in @vitessce/schemas).
|
|
228826
228860
|
data: { type: "object", value: [], compare: true },
|
|
228827
228861
|
// UID of the shape to highlight with a selection halo.
|
|
@@ -228880,7 +228914,122 @@ class AnnotationLayer extends CompositeLayer {
|
|
|
228880
228914
|
}
|
|
228881
228915
|
}
|
|
228882
228916
|
AnnotationLayer.layerName = "AnnotationLayer";
|
|
228883
|
-
AnnotationLayer.defaultProps = defaultProps;
|
|
228917
|
+
AnnotationLayer.defaultProps = defaultProps$1;
|
|
228918
|
+
const DIST_TO_CENTER_ORIGINAL = "float distToCenter = length(unitPosition) * outerRadiusPixels;";
|
|
228919
|
+
const DIST_TO_CENTER_REPLACEMENT = `float distToCenter = (
|
|
228920
|
+
uIsSquare
|
|
228921
|
+
? max(abs(unitPosition.x), abs(unitPosition.y))
|
|
228922
|
+
: length(unitPosition)
|
|
228923
|
+
) * outerRadiusPixels;`;
|
|
228924
|
+
const defaultProps = {
|
|
228925
|
+
spotShape: { type: "string", value: "circle", compare: true }
|
|
228926
|
+
};
|
|
228927
|
+
class SpotLayer extends ScatterplotLayer {
|
|
228928
|
+
getShaders() {
|
|
228929
|
+
const shaders = super.getShaders();
|
|
228930
|
+
if (!shaders.fs.includes(DIST_TO_CENTER_ORIGINAL)) {
|
|
228931
|
+
log$b.warn("SpotLayer: unable to modify ScatterplotLayer fragment shader; spots will be rendered as circles.");
|
|
228932
|
+
return shaders;
|
|
228933
|
+
}
|
|
228934
|
+
return {
|
|
228935
|
+
...shaders,
|
|
228936
|
+
fs: shaders.fs.replace("uniform bool antialiasing;", "uniform bool antialiasing;\nuniform bool uIsSquare;").replace(DIST_TO_CENTER_ORIGINAL, DIST_TO_CENTER_REPLACEMENT)
|
|
228937
|
+
};
|
|
228938
|
+
}
|
|
228939
|
+
draw(opts2) {
|
|
228940
|
+
const { spotShape } = this.props;
|
|
228941
|
+
super.draw({
|
|
228942
|
+
...opts2,
|
|
228943
|
+
uniforms: {
|
|
228944
|
+
...opts2.uniforms,
|
|
228945
|
+
uIsSquare: spotShape === "square"
|
|
228946
|
+
}
|
|
228947
|
+
});
|
|
228948
|
+
}
|
|
228949
|
+
}
|
|
228950
|
+
SpotLayer.layerName = "SpotLayer";
|
|
228951
|
+
SpotLayer.defaultProps = defaultProps;
|
|
228952
|
+
const useStyles$v = makeStyles()(() => ({
|
|
228953
|
+
toolButton: {
|
|
228954
|
+
display: "inline-flex",
|
|
228955
|
+
"&:active": {
|
|
228956
|
+
opacity: ".65",
|
|
228957
|
+
extend: "iconClicked"
|
|
228958
|
+
}
|
|
228959
|
+
},
|
|
228960
|
+
tool: {
|
|
228961
|
+
position: "absolute",
|
|
228962
|
+
display: "inline",
|
|
228963
|
+
zIndex: "1000",
|
|
228964
|
+
opacity: ".65",
|
|
228965
|
+
color: "black",
|
|
228966
|
+
"&:hover": {
|
|
228967
|
+
opacity: ".90"
|
|
228968
|
+
}
|
|
228969
|
+
},
|
|
228970
|
+
iconClicked: {
|
|
228971
|
+
// Styles for the clicked state
|
|
228972
|
+
boxShadow: "none",
|
|
228973
|
+
transform: "scale(0.98)"
|
|
228974
|
+
// make the button slightly smaller
|
|
228975
|
+
},
|
|
228976
|
+
toolIcon: {
|
|
228977
|
+
// btn btn-outline-secondary mr-2 icon
|
|
228978
|
+
padding: "0",
|
|
228979
|
+
height: "2em",
|
|
228980
|
+
width: "2em",
|
|
228981
|
+
backgroundColor: "white",
|
|
228982
|
+
display: "inline-block",
|
|
228983
|
+
fontWeight: "400",
|
|
228984
|
+
textAlign: "center",
|
|
228985
|
+
verticalAlign: "middle",
|
|
228986
|
+
cursor: "pointer",
|
|
228987
|
+
userSelect: "none",
|
|
228988
|
+
border: "1px solid #6c757d",
|
|
228989
|
+
fontSize: "16px",
|
|
228990
|
+
lineHeight: "1.5",
|
|
228991
|
+
borderRadius: "4px",
|
|
228992
|
+
transition: "color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out",
|
|
228993
|
+
color: "#6c757d",
|
|
228994
|
+
marginRight: "8px",
|
|
228995
|
+
"& > svg": {
|
|
228996
|
+
verticalAlign: "middle",
|
|
228997
|
+
display: "inline-block",
|
|
228998
|
+
color: "black"
|
|
228999
|
+
},
|
|
229000
|
+
"&:active": {
|
|
229001
|
+
extend: "iconClicked"
|
|
229002
|
+
}
|
|
229003
|
+
},
|
|
229004
|
+
toolActive: {
|
|
229005
|
+
// active
|
|
229006
|
+
color: "#fff",
|
|
229007
|
+
backgroundColor: "#6c757d",
|
|
229008
|
+
borderColor: "#6c757d",
|
|
229009
|
+
boxShadow: "0 0 0 3px rgba(108, 117, 125, 0.5)"
|
|
229010
|
+
}
|
|
229011
|
+
}));
|
|
229012
|
+
function IconTool(props) {
|
|
229013
|
+
const { alt, onClick, isActive: isActive2, children: children3 } = props;
|
|
229014
|
+
const { classes: classes2 } = useStyles$v();
|
|
229015
|
+
return jsx$1("button", { className: clsx(classes2.toolIcon, { [classes2.toolActive]: isActive2 }), onClick, type: "button", title: alt, children: children3 });
|
|
229016
|
+
}
|
|
229017
|
+
function IconButton(props) {
|
|
229018
|
+
const { alt, onClick, children: children3 } = props;
|
|
229019
|
+
const { classes: classes2 } = useStyles$v();
|
|
229020
|
+
return jsx$1("button", { className: clsx(classes2.toolIcon, classes2.toolButton), onClick, type: "button", title: alt, children: children3 });
|
|
229021
|
+
}
|
|
229022
|
+
function ToolMenu(props) {
|
|
229023
|
+
const pointerIconAltText = "Pointer tool";
|
|
229024
|
+
const lassoIconAltText = "Select lasso";
|
|
229025
|
+
const { setActiveTool, activeTool, visibleTools = { pan: true, selectLasso: true, recenter: true }, recenterOnClick = () => {
|
|
229026
|
+
} } = props;
|
|
229027
|
+
const { classes: classes2 } = useStyles$v();
|
|
229028
|
+
const onRecenterButtonCLick = () => {
|
|
229029
|
+
recenterOnClick();
|
|
229030
|
+
};
|
|
229031
|
+
return jsxs("div", { className: classes2.tool, children: [visibleTools.pan && jsx$1(IconTool, { alt: pointerIconAltText, onClick: () => setActiveTool(null), isActive: activeTool === null, children: jsx$1(SvgNearMe, {}) }), visibleTools.selectLasso ? jsx$1(IconTool, { alt: lassoIconAltText, onClick: () => setActiveTool(distEs6Exports$2.SELECTION_TYPE.POLYGON), isActive: activeTool === distEs6Exports$2.SELECTION_TYPE.POLYGON, children: jsx$1(SvgSelectionLasso, {}) }) : null, visibleTools.recenter ? jsx$1(IconButton, { alt: "click to recenter", onClick: () => onRecenterButtonCLick(), "aria-label": "Recenter scatterplot view", children: jsx$1(CenterFocusStrong, {}) }) : null] });
|
|
229032
|
+
}
|
|
228884
229033
|
const MOUSE = { ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
228885
229034
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
228886
229035
|
const WebGLCoordinateSystem = 2e3;
|
|
@@ -233230,87 +233379,6 @@ class RawView extends View$2 {
|
|
|
233230
233379
|
return OrbitController2;
|
|
233231
233380
|
}
|
|
233232
233381
|
}
|
|
233233
|
-
const useStyles$w = makeStyles()(() => ({
|
|
233234
|
-
toolButton: {
|
|
233235
|
-
display: "inline-flex",
|
|
233236
|
-
"&:active": {
|
|
233237
|
-
opacity: ".65",
|
|
233238
|
-
extend: "iconClicked"
|
|
233239
|
-
}
|
|
233240
|
-
},
|
|
233241
|
-
tool: {
|
|
233242
|
-
position: "absolute",
|
|
233243
|
-
display: "inline",
|
|
233244
|
-
zIndex: "1000",
|
|
233245
|
-
opacity: ".65",
|
|
233246
|
-
color: "black",
|
|
233247
|
-
"&:hover": {
|
|
233248
|
-
opacity: ".90"
|
|
233249
|
-
}
|
|
233250
|
-
},
|
|
233251
|
-
iconClicked: {
|
|
233252
|
-
// Styles for the clicked state
|
|
233253
|
-
boxShadow: "none",
|
|
233254
|
-
transform: "scale(0.98)"
|
|
233255
|
-
// make the button slightly smaller
|
|
233256
|
-
},
|
|
233257
|
-
toolIcon: {
|
|
233258
|
-
// btn btn-outline-secondary mr-2 icon
|
|
233259
|
-
padding: "0",
|
|
233260
|
-
height: "2em",
|
|
233261
|
-
width: "2em",
|
|
233262
|
-
backgroundColor: "white",
|
|
233263
|
-
display: "inline-block",
|
|
233264
|
-
fontWeight: "400",
|
|
233265
|
-
textAlign: "center",
|
|
233266
|
-
verticalAlign: "middle",
|
|
233267
|
-
cursor: "pointer",
|
|
233268
|
-
userSelect: "none",
|
|
233269
|
-
border: "1px solid #6c757d",
|
|
233270
|
-
fontSize: "16px",
|
|
233271
|
-
lineHeight: "1.5",
|
|
233272
|
-
borderRadius: "4px",
|
|
233273
|
-
transition: "color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out",
|
|
233274
|
-
color: "#6c757d",
|
|
233275
|
-
marginRight: "8px",
|
|
233276
|
-
"& > svg": {
|
|
233277
|
-
verticalAlign: "middle",
|
|
233278
|
-
display: "inline-block",
|
|
233279
|
-
color: "black"
|
|
233280
|
-
},
|
|
233281
|
-
"&:active": {
|
|
233282
|
-
extend: "iconClicked"
|
|
233283
|
-
}
|
|
233284
|
-
},
|
|
233285
|
-
toolActive: {
|
|
233286
|
-
// active
|
|
233287
|
-
color: "#fff",
|
|
233288
|
-
backgroundColor: "#6c757d",
|
|
233289
|
-
borderColor: "#6c757d",
|
|
233290
|
-
boxShadow: "0 0 0 3px rgba(108, 117, 125, 0.5)"
|
|
233291
|
-
}
|
|
233292
|
-
}));
|
|
233293
|
-
function IconTool(props) {
|
|
233294
|
-
const { alt, onClick, isActive: isActive2, children: children3 } = props;
|
|
233295
|
-
const { classes: classes2 } = useStyles$w();
|
|
233296
|
-
return jsx$1("button", { className: clsx(classes2.toolIcon, { [classes2.toolActive]: isActive2 }), onClick, type: "button", title: alt, children: children3 });
|
|
233297
|
-
}
|
|
233298
|
-
function IconButton(props) {
|
|
233299
|
-
const { alt, onClick, children: children3 } = props;
|
|
233300
|
-
const { classes: classes2 } = useStyles$w();
|
|
233301
|
-
return jsx$1("button", { className: clsx(classes2.toolIcon, classes2.toolButton), onClick, type: "button", title: alt, children: children3 });
|
|
233302
|
-
}
|
|
233303
|
-
function ToolMenu(props) {
|
|
233304
|
-
const pointerIconAltText = "Pointer tool";
|
|
233305
|
-
const lassoIconAltText = "Select lasso";
|
|
233306
|
-
const { setActiveTool, activeTool, visibleTools = { pan: true, selectLasso: true, recenter: true }, recenterOnClick = () => {
|
|
233307
|
-
} } = props;
|
|
233308
|
-
const { classes: classes2 } = useStyles$w();
|
|
233309
|
-
const onRecenterButtonCLick = () => {
|
|
233310
|
-
recenterOnClick();
|
|
233311
|
-
};
|
|
233312
|
-
return jsxs("div", { className: classes2.tool, children: [visibleTools.pan && jsx$1(IconTool, { alt: pointerIconAltText, onClick: () => setActiveTool(null), isActive: activeTool === null, children: jsx$1(SvgNearMe, {}) }), visibleTools.selectLasso ? jsx$1(IconTool, { alt: lassoIconAltText, onClick: () => setActiveTool(distEs6Exports$2.SELECTION_TYPE.POLYGON), isActive: activeTool === distEs6Exports$2.SELECTION_TYPE.POLYGON, children: jsx$1(SvgSelectionLasso, {}) }) : null, visibleTools.recenter ? jsx$1(IconButton, { alt: "click to recenter", onClick: () => onRecenterButtonCLick(), "aria-label": "Recenter scatterplot view", children: jsx$1(CenterFocusStrong, {}) }) : null] });
|
|
233313
|
-
}
|
|
233314
233382
|
const getCursorWithTool = () => "crosshair";
|
|
233315
233383
|
const getCursor = (interactionState) => interactionState.isDragging ? "grabbing" : "grab";
|
|
233316
233384
|
function getOnHoverCallback(obsIndex, setObsHighlight, setComponentHover) {
|
|
@@ -234795,7 +234863,7 @@ function ScatterplotOptions(props) {
|
|
|
234795
234863
|
id: `feature-aggregation-strategy-${scatterplotOptionsId}`
|
|
234796
234864
|
}, children: FEATURE_AGGREGATION_STRATEGIES$2.map((opt) => jsx$1("option", { value: opt, children: capitalize$3(opt) }, opt)) }) })] }) : null] });
|
|
234797
234865
|
}
|
|
234798
|
-
const useStyles$
|
|
234866
|
+
const useStyles$u = makeStyles()((theme) => ({
|
|
234799
234867
|
tooltipAnchor: {
|
|
234800
234868
|
position: "relative",
|
|
234801
234869
|
width: "0px",
|
|
@@ -234826,7 +234894,7 @@ const useStyles$v = makeStyles()((theme) => ({
|
|
|
234826
234894
|
function Tooltip3(props) {
|
|
234827
234895
|
const { x: x2, y: y2, parentWidth, parentHeight, children: children3 } = props;
|
|
234828
234896
|
const ref2 = useRef();
|
|
234829
|
-
const { classes: classes2 } = useStyles$
|
|
234897
|
+
const { classes: classes2 } = useStyles$u();
|
|
234830
234898
|
const [placementX, setPlacementX] = useState("start");
|
|
234831
234899
|
const [placementY, setPlacementY] = useState("bottom");
|
|
234832
234900
|
const getTooltipContainer = useVitessceContainer(ref2);
|
|
@@ -234842,7 +234910,7 @@ function Tooltip3(props) {
|
|
|
234842
234910
|
}, [x2, y2, parentWidth, parentHeight]);
|
|
234843
234911
|
return jsx$1("div", { ref: ref2, className: classes2.tooltipAnchor, children: ref2 && ref2.current ? jsx$1(Popper, { open: true, anchorEl: ref2.current, container: getTooltipContainer, transition: true, placement: `${placementY}-${placementX}`, children: jsx$1(Paper, { elevation: 8, className: classes2.tooltipContent, children: children3 }) }) : null });
|
|
234844
234912
|
}
|
|
234845
|
-
const useStyles$
|
|
234913
|
+
const useStyles$t = makeStyles()((theme) => ({
|
|
234846
234914
|
cellEmphasisCrosshair: {
|
|
234847
234915
|
zIndex: 50,
|
|
234848
234916
|
position: "absolute",
|
|
@@ -234853,7 +234921,7 @@ const useStyles$u = makeStyles()((theme) => ({
|
|
|
234853
234921
|
}));
|
|
234854
234922
|
function Tooltip2D(props) {
|
|
234855
234923
|
const { parentUuid, sourceUuid, x: x2, y: y2, parentWidth, parentHeight, children: children3 } = props;
|
|
234856
|
-
const { classes: classes2 } = useStyles$
|
|
234924
|
+
const { classes: classes2 } = useStyles$t();
|
|
234857
234925
|
if (x2 < 0 || x2 > parentWidth || y2 < 0 || y2 > parentHeight) {
|
|
234858
234926
|
return null;
|
|
234859
234927
|
}
|
|
@@ -238765,7 +238833,7 @@ function getXlinkHref(cmap) {
|
|
|
238765
238833
|
const xlinkHref = ramp(color2.copy().domain(quantize$3(interpolate$1$1(0, 1), n3))).toDataURL();
|
|
238766
238834
|
return xlinkHref;
|
|
238767
238835
|
}
|
|
238768
|
-
const useStyles$
|
|
238836
|
+
const useStyles$s = makeStyles()(() => ({
|
|
238769
238837
|
legend: {
|
|
238770
238838
|
position: "relative",
|
|
238771
238839
|
// Needed for absolute positioning of slider overlay
|
|
@@ -238947,7 +239015,7 @@ function Legend(props) {
|
|
|
238947
239015
|
spatialLayerColor,
|
|
238948
239016
|
obsSetSelection,
|
|
238949
239017
|
obsSetColor,
|
|
238950
|
-
featureAggregationStrategy,
|
|
239018
|
+
featureAggregationStrategy: featureAggregationStrategyProp,
|
|
238951
239019
|
extent: extent2,
|
|
238952
239020
|
missing,
|
|
238953
239021
|
width: width2 = 100,
|
|
@@ -238961,8 +239029,9 @@ function Legend(props) {
|
|
|
238961
239029
|
contourPercentiles,
|
|
238962
239030
|
contourThresholds
|
|
238963
239031
|
} = props;
|
|
239032
|
+
const featureAggregationStrategy = resolveFeatureAggregationStrategy(featureAggregationStrategyProp, featureSelection);
|
|
238964
239033
|
const svgRef = useRef(null);
|
|
238965
|
-
const { classes: classes2 } = useStyles$
|
|
239034
|
+
const { classes: classes2 } = useStyles$s();
|
|
238966
239035
|
const [localRange, setLocalRange] = useState(featureValueColormapRange);
|
|
238967
239036
|
useEffect(() => {
|
|
238968
239037
|
setLocalRange(featureValueColormapRange);
|
|
@@ -239296,7 +239365,7 @@ function Legend(props) {
|
|
|
239296
239365
|
}
|
|
239297
239366
|
} })] })] });
|
|
239298
239367
|
}
|
|
239299
|
-
const useStyles$
|
|
239368
|
+
const useStyles$r = makeStyles()(() => ({
|
|
239300
239369
|
multiLegend: {
|
|
239301
239370
|
position: "absolute",
|
|
239302
239371
|
top: "0px",
|
|
@@ -239323,7 +239392,7 @@ function MultiLegend(props) {
|
|
|
239323
239392
|
pointLayerCoordination,
|
|
239324
239393
|
pointMultiIndicesData
|
|
239325
239394
|
} = props;
|
|
239326
|
-
const { classes: classes2 } = useStyles$
|
|
239395
|
+
const { classes: classes2 } = useStyles$r();
|
|
239327
239396
|
const reversedSegmentationLayerScopes = useMemo$1(() => [...segmentationLayerScopes || []].reverse(), [segmentationLayerScopes]);
|
|
239328
239397
|
const reversedSpotLayerScopes = useMemo$1(() => [...spotLayerScopes || []].reverse(), [spotLayerScopes]);
|
|
239329
239398
|
const reversedPointLayerScopes = useMemo$1(() => [...pointLayerScopes || []].reverse(), [pointLayerScopes]);
|
|
@@ -239416,7 +239485,7 @@ function MultiLegend(props) {
|
|
|
239416
239485
|
}) : null;
|
|
239417
239486
|
}) : null] });
|
|
239418
239487
|
}
|
|
239419
|
-
const useStyles$
|
|
239488
|
+
const useStyles$q = makeStyles()(() => ({
|
|
239420
239489
|
channelNamesLegendContainer: {
|
|
239421
239490
|
position: "absolute",
|
|
239422
239491
|
bottom: "0px",
|
|
@@ -239442,7 +239511,7 @@ const useStyles$r = makeStyles()(() => ({
|
|
|
239442
239511
|
}));
|
|
239443
239512
|
function ChannelNamesLegend(props) {
|
|
239444
239513
|
const { images, imageLayerScopes, imageLayerCoordination, imageChannelScopesByLayer, imageChannelCoordination } = props;
|
|
239445
|
-
const { classes: classes2 } = useStyles$
|
|
239514
|
+
const { classes: classes2 } = useStyles$q();
|
|
239446
239515
|
const reversedImageLayerScopes = useMemo$1(() => [...imageLayerScopes || []].reverse(), [imageLayerScopes]);
|
|
239447
239516
|
return jsx$1("div", { className: classes2.channelNamesLegendContainer, children: imageLayerScopes ? reversedImageLayerScopes.map((layerScope) => {
|
|
239448
239517
|
const layerCoordination = imageLayerCoordination[0][layerScope];
|
|
@@ -239505,7 +239574,7 @@ function EmbeddingScatterplotSubscriber(props) {
|
|
|
239505
239574
|
const { embeddingZoom: initialZoom, embeddingTargetX: initialTargetX, embeddingTargetY: initialTargetY } = useInitialCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.SCATTERPLOT], coordinationScopes, coordinationValues);
|
|
239506
239575
|
const observationsLabel = observationsLabelOverride || obsType;
|
|
239507
239576
|
const sampleSetSelection = sampleSetSelectionFromProps || sampleSetSelectionFromCoordination;
|
|
239508
|
-
const featureAggregationStrategyToUse = featureAggregationStrategy ?? DEFAULT_FEATURE_AGGREGATION_STRATEGY$3;
|
|
239577
|
+
const featureAggregationStrategyToUse = resolveFeatureAggregationStrategy(featureAggregationStrategy, geneSelection) ?? DEFAULT_FEATURE_AGGREGATION_STRATEGY$3;
|
|
239509
239578
|
const [width2, height2, deckRef] = useDeckCanvasSize();
|
|
239510
239579
|
const title2 = titleOverride || `Scatterplot (${mapping})`;
|
|
239511
239580
|
const [, annotationStoryStatus, annotationStoryUrls, annotationStoryError] = useAnnotationStoryData(loaders, dataset, false, { setAnnotationStory }, { annotationStory }, {});
|
|
@@ -239767,7 +239836,10 @@ function EmbeddingScatterplotSubscriber(props) {
|
|
|
239767
239836
|
obsEmbeddingY: alignedEmbeddingData.data[1],
|
|
239768
239837
|
...uint8ExpressionData?.[0] ? { featureValue: uint8ExpressionData } : {}
|
|
239769
239838
|
},
|
|
239770
|
-
|
|
239839
|
+
// The featureAggregationStrategy has already been applied above
|
|
239840
|
+
// (uint8ExpressionData contains a single, aggregated array),
|
|
239841
|
+
// so we must not apply it again here.
|
|
239842
|
+
"first",
|
|
239771
239843
|
// Raw codes let the strata come from typed arrays when the indices match.
|
|
239772
239844
|
{ obsSetsColumns }
|
|
239773
239845
|
);
|
|
@@ -239784,7 +239856,6 @@ function EmbeddingScatterplotSubscriber(props) {
|
|
|
239784
239856
|
deferredSampleSetSelection,
|
|
239785
239857
|
deferredCellSetSelection,
|
|
239786
239858
|
mergedCellSets,
|
|
239787
|
-
featureAggregationStrategyToUse,
|
|
239788
239859
|
obsSetsColumns
|
|
239789
239860
|
]);
|
|
239790
239861
|
const annotationFrameCoordinationValues = getAnnotationFrameCoordinationValues(annotationStory, annotationFrameIndex, viewUid);
|
|
@@ -260242,7 +260313,7 @@ function SpatialSubscriber$1(props) {
|
|
|
260242
260313
|
subobservationsLabel,
|
|
260243
260314
|
locationsCount
|
|
260244
260315
|
});
|
|
260245
|
-
const featureAggregationStrategyToUse = featureAggregationStrategy ?? DEFAULT_FEATURE_AGGREGATION_STRATEGY$2;
|
|
260316
|
+
const featureAggregationStrategyToUse = resolveFeatureAggregationStrategy(featureAggregationStrategy, geneSelection) ?? DEFAULT_FEATURE_AGGREGATION_STRATEGY$2;
|
|
260246
260317
|
const aggregatedExpressionData = useMemo$1(() => {
|
|
260247
260318
|
if (featureAggregationStrategyToUse != null && expressionData && expressionData.length > 1) {
|
|
260248
260319
|
const aggregated = aggregateFeatureArrays(expressionData, featureAggregationStrategyToUse);
|
|
@@ -260734,10 +260805,10 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
260734
260805
|
const getExpressionValue = this.spotExpressionGetters[layerScope];
|
|
260735
260806
|
const obsIndex = layerObsSpots?.obsIndex;
|
|
260736
260807
|
const getSpotColor = makeDefaultGetCellColors(cellColors, obsIndex, theme);
|
|
260737
|
-
const { spatialLayerVisible, spatialLayerOpacity, spatialSpotRadius, spatialSpotFilled, spatialSpotStrokeWidth, obsColorEncoding, featureValueColormap, featureValueColormapRange, spatialLayerColor } = layerCoordination;
|
|
260808
|
+
const { spatialLayerVisible, spatialLayerOpacity, spatialSpotRadius, spatialSpotShape, spatialSpotFilled, spatialSpotStrokeWidth, obsColorEncoding, featureValueColormap, featureValueColormapRange, spatialLayerColor } = layerCoordination;
|
|
260738
260809
|
const isStaticColor = obsColorEncoding === "spatialLayerColor";
|
|
260739
260810
|
const staticColor = Array.isArray(spatialLayerColor) && spatialLayerColor.length === 3 ? spatialLayerColor : getDefaultColor(theme);
|
|
260740
|
-
return new
|
|
260811
|
+
return new SpotLayer({
|
|
260741
260812
|
id: `${SPOT_LAYER_PREFIX}${layerScope}`,
|
|
260742
260813
|
data: this.obsSpotsData[layerScope],
|
|
260743
260814
|
coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,
|
|
@@ -260749,6 +260820,7 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
260749
260820
|
getLineWidth: !spatialSpotFilled ? spatialSpotStrokeWidth : 0,
|
|
260750
260821
|
visible: spatialLayerVisible,
|
|
260751
260822
|
getRadius: spatialSpotRadius,
|
|
260823
|
+
spotShape: spatialSpotShape,
|
|
260752
260824
|
getPosition: (object2, { data: data2, index: index2, target: target2 }) => {
|
|
260753
260825
|
target2[0] = data2.src.obsSpots.data[0][index2];
|
|
260754
260826
|
target2[1] = data2.src.obsSpots.data[1][index2];
|
|
@@ -260775,7 +260847,12 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
260775
260847
|
}
|
|
260776
260848
|
createPointLayer(layerScope, layerCoordination, layerObsPoints) {
|
|
260777
260849
|
const { theme, delegateHover, targetZ, pointMatrixIndices, setTiledPointsLoadingProgress } = this.props;
|
|
260778
|
-
const { spatialLayerVisible, spatialLayerOpacity, obsColorEncoding, spatialLayerColor, featureSelection, featureFilterMode, featureColor, spatialLayerOpacityUnselected } = layerCoordination;
|
|
260850
|
+
const { spatialLayerVisible, spatialLayerOpacity, obsColorEncoding, spatialLayerColor, featureSelection, featureFilterMode, featureColor, spatialLayerOpacityUnselected, spatialPointRadius, spatialPointStrokeWidth } = layerCoordination;
|
|
260851
|
+
const pointRadius = spatialPointRadius ?? 2.5;
|
|
260852
|
+
const pointRadiusMaxPixels = pointRadius * 0.6;
|
|
260853
|
+
const pointLineWidth = spatialPointStrokeWidth ?? 0;
|
|
260854
|
+
const pointLineColor = [0, 0, 0];
|
|
260855
|
+
const arePointsStroked = pointLineWidth > 0;
|
|
260779
260856
|
const pointFeatureIndex = pointMatrixIndices?.[layerScope]?.featureIndex;
|
|
260780
260857
|
let featureIndices = [];
|
|
260781
260858
|
if (Array.isArray(featureSelection) && featureSelection.length >= 1) {
|
|
@@ -260907,6 +260984,13 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
260907
260984
|
};
|
|
260908
260985
|
}
|
|
260909
260986
|
}
|
|
260987
|
+
const getLineColor = (object2, { index: index2, data: data2, target: target2 }) => {
|
|
260988
|
+
getFillColor(object2, { index: index2, data: data2, target: target2 });
|
|
260989
|
+
target2[0] = pointLineColor[0];
|
|
260990
|
+
target2[1] = pointLineColor[1];
|
|
260991
|
+
target2[2] = pointLineColor[2];
|
|
260992
|
+
return target2;
|
|
260993
|
+
};
|
|
260910
260994
|
const {
|
|
260911
260995
|
obsPointsModelMatrix,
|
|
260912
260996
|
obsPoints,
|
|
@@ -260929,6 +261013,15 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
260929
261013
|
autoHighlight: true,
|
|
260930
261014
|
onHover: (info2) => delegateHover(info2, "point", layerScope),
|
|
260931
261015
|
opacity: 1,
|
|
261016
|
+
// deck.gl's TileLayer ignores changes to `renderSubLayers` itself (it's marked
|
|
261017
|
+
// `compare: false` internally, since it's usually just a fresh inline function
|
|
261018
|
+
// every render), so simply updating pointRadius/pointLineWidth inside this
|
|
261019
|
+
// closure won't make the tiles re-render on their own. This key is a dummy
|
|
261020
|
+
// value that changes whenever the point size or stroke width changes, just so
|
|
261021
|
+
// TileLayer re-renders the tiles.
|
|
261022
|
+
// It's separate from getTileData's updateTriggers on purpose, so we don't
|
|
261023
|
+
// re-fetch tile data -- we only want the existing data to be redrawn.
|
|
261024
|
+
pointStyleKey: `${pointRadius}_${pointRadiusMaxPixels}_${pointLineWidth}`,
|
|
260932
261025
|
visible: spatialLayerVisible,
|
|
260933
261026
|
// Since points are tiled but not multi-resolution,
|
|
260934
261027
|
// it provides no benefit to request tiles at different zoom levels.
|
|
@@ -260972,8 +261065,11 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
260972
261065
|
return new ScatterplotLayer(subLayerProps, {
|
|
260973
261066
|
bounds: [left2, top2, right2, bottom2],
|
|
260974
261067
|
data: tileData,
|
|
260975
|
-
getRadius:
|
|
260976
|
-
radiusMaxPixels:
|
|
261068
|
+
getRadius: pointRadius,
|
|
261069
|
+
radiusMaxPixels: pointRadiusMaxPixels,
|
|
261070
|
+
stroked: arePointsStroked,
|
|
261071
|
+
getLineWidth: pointLineWidth,
|
|
261072
|
+
getLineColor,
|
|
260977
261073
|
// getPosition: d => d,
|
|
260978
261074
|
// getFillColor: [255, 0, 0],
|
|
260979
261075
|
getPosition: (object2, { data: data2, index: index2, target: target2 }) => {
|
|
@@ -261052,8 +261148,11 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
261052
261148
|
opacity: spatialLayerOpacity,
|
|
261053
261149
|
visible: spatialLayerVisible,
|
|
261054
261150
|
modelMatrix: modelMatrix2,
|
|
261055
|
-
getRadius:
|
|
261056
|
-
radiusMaxPixels:
|
|
261151
|
+
getRadius: pointRadius,
|
|
261152
|
+
radiusMaxPixels: pointRadiusMaxPixels,
|
|
261153
|
+
stroked: arePointsStroked,
|
|
261154
|
+
getLineWidth: pointLineWidth,
|
|
261155
|
+
getLineColor,
|
|
261057
261156
|
getPosition: (object2, { data: data2, index: index2, target: target2 }) => {
|
|
261058
261157
|
target2[0] = data2.src.obsPoints.data[0][index2];
|
|
261059
261158
|
target2[1] = data2.src.obsPoints.data[1][index2];
|
|
@@ -261801,7 +261900,11 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
261801
261900
|
super.viewInfoDidUpdate(null, null, makeDefaultGetObsCoords);
|
|
261802
261901
|
}
|
|
261803
261902
|
recenter() {
|
|
261804
|
-
const { originalViewState, setViewState } = this.props;
|
|
261903
|
+
const { originalViewState, setViewState, onRequestCameraReset } = this.props;
|
|
261904
|
+
if (onRequestCameraReset) {
|
|
261905
|
+
onRequestCameraReset();
|
|
261906
|
+
return;
|
|
261907
|
+
}
|
|
261805
261908
|
if (Array.isArray(originalViewState?.target) && typeof originalViewState?.zoom === "number") {
|
|
261806
261909
|
setViewState(originalViewState);
|
|
261807
261910
|
}
|
|
@@ -262010,7 +262113,7 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
|
|
|
262010
262113
|
}
|
|
262011
262114
|
}
|
|
262012
262115
|
const SpatialWrapper = forwardRef$1((props, deckRef) => jsx$1(Spatial2, { ...props, deckRef }));
|
|
262013
|
-
function TooltipChild(props) {
|
|
262116
|
+
function TooltipChild$1(props) {
|
|
262014
262117
|
const { x: x2, y: y2, parentUuid, sourceUuid, width: width2, height: height2, info: info2, tooltipsVisible, tooltipCrosshairsVisible, featureType, featureLabelsMap } = props;
|
|
262015
262118
|
const visible = parentUuid === sourceUuid ? tooltipsVisible : tooltipCrosshairsVisible;
|
|
262016
262119
|
return visible ? jsx$1(Tooltip2D, { x: x2, y: y2, parentUuid, sourceUuid, parentWidth: width2, parentHeight: height2, children: jsx$1(TooltipContent, { info: info2, featureType, featureLabelsMap }) }) : null;
|
|
@@ -262029,7 +262132,7 @@ function getXY(obsHighlight, viewInfo, obsIndex, obsLocations, useHoverInfoForTo
|
|
|
262029
262132
|
const projectedObsCoord = viewInfo?.project(obsCoord);
|
|
262030
262133
|
return [projectedObsCoord?.[0], projectedObsCoord?.[1]];
|
|
262031
262134
|
}
|
|
262032
|
-
function getObsInfo(obsSetsData, obsType, obsId, obsSetSelection, tooltipObsSetsMode) {
|
|
262135
|
+
function getObsInfo$1(obsSetsData, obsType, obsId, obsSetSelection, tooltipObsSetsMode) {
|
|
262033
262136
|
let result = {
|
|
262034
262137
|
[`${capitalize$3(obsType)} ID`]: obsId
|
|
262035
262138
|
};
|
|
@@ -262080,13 +262183,13 @@ function SpatialTooltipSubscriber(props) {
|
|
|
262080
262183
|
let yOffset = -30;
|
|
262081
262184
|
return jsxs(Fragment, { children: [projectedHoverCoord && imageLayerScopes?.map((layerScope) => {
|
|
262082
262185
|
const { pixelHighlight, tooltipsVisible, spatialLayerVisible } = imageLayerCoordination?.[0]?.[layerScope] || {};
|
|
262083
|
-
return tooltipsVisible && pixelHighlight && spatialLayerVisible ? jsx$1(TooltipChild, { parentUuid, sourceUuid, width: width2, height: height2, info: {
|
|
262186
|
+
return tooltipsVisible && pixelHighlight && spatialLayerVisible ? jsx$1(TooltipChild$1, { parentUuid, sourceUuid, width: width2, height: height2, info: {
|
|
262084
262187
|
"Pixel Value": JSON.stringify(pixelHighlight)
|
|
262085
262188
|
}, x: projectedHoverCoord?.[0], y: projectedHoverCoord?.[1] + (yOffset += 30), featureType, featureLabelsMap }, layerScope) : null;
|
|
262086
262189
|
}), segmentationLayerScopes?.flatMap((layerScope) => segmentationChannelScopesByLayer?.[layerScope]?.map((channelScope) => {
|
|
262087
262190
|
const { obsType, obsHighlight, tooltipsVisible, tooltipCrosshairsVisible, spatialChannelVisible, obsSetSelection, tooltipObsSetsMode } = segmentationChannelCoordination?.[0]?.[layerScope]?.[channelScope] || {};
|
|
262088
262191
|
const obsSetsData = obsSegmentationsSetsData?.[layerScope]?.[channelScope];
|
|
262089
|
-
const obsInfo = getObsInfo(obsSetsData, obsType, obsHighlight, obsSetSelection, tooltipObsSetsMode);
|
|
262192
|
+
const obsInfo = getObsInfo$1(obsSetsData, obsType, obsHighlight, obsSetSelection, tooltipObsSetsMode);
|
|
262090
262193
|
if (!obsHighlight || !spatialChannelVisible || !tooltipsVisible && !tooltipCrosshairsVisible)
|
|
262091
262194
|
return null;
|
|
262092
262195
|
const { obsIndex, obsLocations } = obsSegmentationsLocations?.[layerScope]?.[channelScope] || {};
|
|
@@ -262094,7 +262197,7 @@ function SpatialTooltipSubscriber(props) {
|
|
|
262094
262197
|
if (!xy)
|
|
262095
262198
|
return null;
|
|
262096
262199
|
const [x2, y2] = xy;
|
|
262097
|
-
return jsx$1(TooltipChild, { parentUuid, sourceUuid, tooltipsVisible, tooltipCrosshairsVisible, width: width2, height: height2, info: obsInfo, x: x2, y: y2 + (yOffset += 20 + 15 * Object.keys(obsInfo).length), featureType, featureLabelsMap }, `${layerScope}-${channelScope}`);
|
|
262200
|
+
return jsx$1(TooltipChild$1, { parentUuid, sourceUuid, tooltipsVisible, tooltipCrosshairsVisible, width: width2, height: height2, info: obsInfo, x: x2, y: y2 + (yOffset += 20 + 15 * Object.keys(obsInfo).length), featureType, featureLabelsMap }, `${layerScope}-${channelScope}`);
|
|
262098
262201
|
})), spotLayerScopes?.map((layerScope) => {
|
|
262099
262202
|
const { obsType, obsHighlight, tooltipsVisible, tooltipCrosshairsVisible, spatialLayerVisible } = spotLayerCoordination?.[0]?.[layerScope] || {};
|
|
262100
262203
|
if (!obsHighlight || !spatialLayerVisible || !tooltipsVisible && !tooltipCrosshairsVisible)
|
|
@@ -262104,7 +262207,7 @@ function SpatialTooltipSubscriber(props) {
|
|
|
262104
262207
|
if (!xy)
|
|
262105
262208
|
return null;
|
|
262106
262209
|
const [x2, y2] = xy;
|
|
262107
|
-
return jsx$1(TooltipChild, { parentUuid, sourceUuid, tooltipsVisible, tooltipCrosshairsVisible, width: width2, height: height2, info: {
|
|
262210
|
+
return jsx$1(TooltipChild$1, { parentUuid, sourceUuid, tooltipsVisible, tooltipCrosshairsVisible, width: width2, height: height2, info: {
|
|
262108
262211
|
[`${capitalize$3(obsType)} ID`]: obsHighlight
|
|
262109
262212
|
}, x: x2, y: y2 + (yOffset += 30), featureType, featureLabelsMap }, layerScope);
|
|
262110
262213
|
}), pointLayerScopes?.map((layerScope) => {
|
|
@@ -262116,7 +262219,7 @@ function SpatialTooltipSubscriber(props) {
|
|
|
262116
262219
|
if (!xy)
|
|
262117
262220
|
return null;
|
|
262118
262221
|
const [x2, y2] = xy;
|
|
262119
|
-
return jsx$1(TooltipChild, { parentUuid, sourceUuid, tooltipsVisible, tooltipCrosshairsVisible, width: width2, height: height2, info: {
|
|
262222
|
+
return jsx$1(TooltipChild$1, { parentUuid, sourceUuid, tooltipsVisible, tooltipCrosshairsVisible, width: width2, height: height2, info: {
|
|
262120
262223
|
[`${capitalize$3(obsType)} ID`]: obsHighlight
|
|
262121
262224
|
}, x: x2, y: y2 + (yOffset += 30), featureType, featureLabelsMap }, layerScope);
|
|
262122
262225
|
})] });
|
|
@@ -262143,16 +262246,16 @@ class ErrorBoundary extends React__default.Component {
|
|
|
262143
262246
|
}
|
|
262144
262247
|
}
|
|
262145
262248
|
const LazySpatialThree = React__default.lazy(async () => {
|
|
262146
|
-
const { SpatialWrapper: SpatialWrapper2 } = await import("./index-
|
|
262249
|
+
const { SpatialWrapper: SpatialWrapper2 } = await import("./index-4JZT6bFU.js").then((n3) => n3.a);
|
|
262147
262250
|
return { default: SpatialWrapper2 };
|
|
262148
262251
|
});
|
|
262149
262252
|
const SpatialThreeAdapter = React__default.forwardRef((props, ref2) => jsx$1("div", { ref: ref2, style: { width: "100%", height: "100%" }, children: jsx$1(ErrorBoundary, { fallback: jsx$1("div", { children: "3D spatial view is not available in this environment." }), children: jsx$1(Suspense, { fallback: jsx$1("div", { children: "Loading..." }), children: jsx$1(LazySpatialThree, { ...props }) }) }) }));
|
|
262150
262253
|
const LazySpatialAccelerated = React__default.lazy(async () => {
|
|
262151
|
-
const { SpatialWrapper: SpatialWrapper2 } = await import("./index-
|
|
262254
|
+
const { SpatialWrapper: SpatialWrapper2 } = await import("./index-IrX1v-qA.js");
|
|
262152
262255
|
return { default: SpatialWrapper2 };
|
|
262153
262256
|
});
|
|
262154
262257
|
const SpatialAcceleratedAdapter = React__default.forwardRef((props, ref2) => jsx$1("div", { ref: ref2, style: { width: "100%", height: "100%" }, children: jsx$1(ErrorBoundary, { fallback: jsx$1("div", { children: "3D spatial view is not available in this environment." }), children: jsx$1(Suspense, { fallback: jsx$1("div", { children: "Loading..." }), children: jsx$1(LazySpatialAccelerated, { ...props }) }) }) }));
|
|
262155
|
-
const useStyles$
|
|
262258
|
+
const useStyles$p = makeStyles()(() => ({
|
|
262156
262259
|
spatialBetaCameraLabel: {
|
|
262157
262260
|
padding: "0px 0px 0px 16px"
|
|
262158
262261
|
},
|
|
@@ -262161,115 +262264,120 @@ const useStyles$q = makeStyles()(() => ({
|
|
|
262161
262264
|
}
|
|
262162
262265
|
}));
|
|
262163
262266
|
function SpatialOptions(props) {
|
|
262164
|
-
const { spatialAxisFixed, setSpatialAxisFixed, use3d } = props;
|
|
262267
|
+
const { spatialAxisFixed, setSpatialAxisFixed, use3d, spatialBackgroundTheme, setSpatialBackgroundTheme } = props;
|
|
262165
262268
|
const toggleAxisId = $bdb11010cef70236$export$f680877a34711e37();
|
|
262166
|
-
const
|
|
262167
|
-
|
|
262269
|
+
const backgroundId = $bdb11010cef70236$export$f680877a34711e37();
|
|
262270
|
+
const { classes: classes2 } = useStyles$p();
|
|
262271
|
+
return jsxs(OptionsContainer, { children: [jsxs(TableRow, { children: [jsx$1(TableCell, { className: classes2.spatialBetaCameraLabel, variant: "head", scope: "row", children: jsx$1("label", { htmlFor: `spatial-camera-axis-${toggleAxisId}`, children: "Fix Camera Axis" }) }), jsx$1(TableCell, { className: classes2.spatialBetaToggleBox, variant: "body", children: jsx$1(Checkbox$1, { onClick: () => setSpatialAxisFixed(!spatialAxisFixed), disabled: !use3d, checked: Boolean(spatialAxisFixed), slotProps: { input: {
|
|
262168
262272
|
"aria-label": "Fix or not fix spatial camera axis",
|
|
262169
262273
|
id: `spatial-camera-axis-${toggleAxisId}`
|
|
262170
|
-
} } }) })] }) })
|
|
262274
|
+
} } }) })] }), jsxs(TableRow, { children: [jsx$1(TableCell, { className: classes2.spatialBetaCameraLabel, variant: "head", scope: "row", children: jsx$1("label", { htmlFor: `spatial-background-${backgroundId}`, children: "Light Background" }) }), jsx$1(TableCell, { className: classes2.spatialBetaToggleBox, variant: "body", children: jsx$1(Checkbox$1, { onClick: () => setSpatialBackgroundTheme(spatialBackgroundTheme === "light" ? "dark" : "light"), checked: spatialBackgroundTheme === "light", slotProps: { input: {
|
|
262275
|
+
"aria-label": "Toggle light or dark background",
|
|
262276
|
+
id: `spatial-background-${backgroundId}`
|
|
262277
|
+
} } }) })] })] });
|
|
262171
262278
|
}
|
|
262172
262279
|
const DEFAULT_FEATURE_AGGREGATION_STRATEGY$1 = "first";
|
|
262173
|
-
function
|
|
262174
|
-
|
|
262175
|
-
|
|
262176
|
-
|
|
262280
|
+
function isValidExpressionArray(arr) {
|
|
262281
|
+
return filterValidExpressionArrays([arr]).length === 1;
|
|
262282
|
+
}
|
|
262283
|
+
function getSingleFeatureIndex(strategy, numFeatures) {
|
|
262284
|
+
if (strategy === "first") {
|
|
262285
|
+
return 0;
|
|
262286
|
+
}
|
|
262287
|
+
if (strategy === "last") {
|
|
262288
|
+
return numFeatures - 1;
|
|
262289
|
+
}
|
|
262290
|
+
if (typeof strategy === "number") {
|
|
262291
|
+
return strategy >= 0 && strategy < numFeatures ? strategy : 0;
|
|
262292
|
+
}
|
|
262293
|
+
return null;
|
|
262294
|
+
}
|
|
262295
|
+
function aggregateExpressionForScope(data2, normData, extents, strategy, featureSelection) {
|
|
262296
|
+
if (!Array.isArray(normData) || normData.length <= 1) {
|
|
262297
|
+
return null;
|
|
262298
|
+
}
|
|
262299
|
+
const strategyToUse = resolveFeatureAggregationStrategy(strategy, featureSelection) ?? DEFAULT_FEATURE_AGGREGATION_STRATEGY$1;
|
|
262300
|
+
const featureIndex = getSingleFeatureIndex(strategyToUse, normData.length);
|
|
262301
|
+
if (featureIndex !== null) {
|
|
262302
|
+
const selectedNormData = normData[featureIndex];
|
|
262303
|
+
if (!isValidExpressionArray(selectedNormData)) {
|
|
262304
|
+
return null;
|
|
262305
|
+
}
|
|
262306
|
+
return {
|
|
262307
|
+
normData: [selectedNormData],
|
|
262308
|
+
extents: [extents?.[featureIndex] ?? null]
|
|
262309
|
+
};
|
|
262310
|
+
}
|
|
262311
|
+
if (!Array.isArray(data2) || !data2.every(isValidExpressionArray)) {
|
|
262312
|
+
return null;
|
|
262313
|
+
}
|
|
262314
|
+
const aggregated = aggregateFeatureArrays(data2, strategyToUse);
|
|
262315
|
+
const normalized = normalizeAggregatedFeatureArray(aggregated);
|
|
262316
|
+
if (!normalized) {
|
|
262317
|
+
return null;
|
|
262318
|
+
}
|
|
262319
|
+
return {
|
|
262320
|
+
normData: [normalized.normData],
|
|
262321
|
+
extents: [normalized.extent]
|
|
262322
|
+
};
|
|
262323
|
+
}
|
|
262324
|
+
function useAggregatedNormalizedExpressionDataForLayers({ multiExpressionData: spotMultiExpressionData, multiExpressionNormData: spotMultiExpressionNormData, multiExpressionExtents: spotMultiExpressionExtents, layerScopes: spotLayerScopes, layerCoordination: spotLayerCoordination }) {
|
|
262325
|
+
return useMemo$1(() => {
|
|
262326
|
+
if (!spotMultiExpressionNormData || !spotLayerScopes?.length || !spotLayerCoordination?.[0]) {
|
|
262327
|
+
return [spotMultiExpressionNormData, spotMultiExpressionExtents];
|
|
262177
262328
|
}
|
|
262178
|
-
|
|
262179
|
-
|
|
262180
|
-
const normDataByLayer = {};
|
|
262181
|
-
const extentsByLayer = {};
|
|
262329
|
+
const normDataByLayer = { ...spotMultiExpressionNormData };
|
|
262330
|
+
const extentsByLayer = { ...spotMultiExpressionExtents };
|
|
262182
262331
|
spotLayerScopes.forEach((layerScope) => {
|
|
262183
|
-
const
|
|
262184
|
-
const
|
|
262185
|
-
if (
|
|
262186
|
-
|
|
262187
|
-
|
|
262188
|
-
const strategy = spotLayerCoordination?.[0]?.[layerScope]?.featureAggregationStrategy ?? DEFAULT_FEATURE_AGGREGATION_STRATEGY$1;
|
|
262189
|
-
if (strategy == null) {
|
|
262190
|
-
return;
|
|
262191
|
-
}
|
|
262192
|
-
const aggregated = aggregateFeatureArrays(validExpressionArrays, strategy);
|
|
262193
|
-
if (!aggregated) {
|
|
262194
|
-
return;
|
|
262195
|
-
}
|
|
262196
|
-
const normalized = normalizeAggregatedFeatureArray(aggregated);
|
|
262197
|
-
if (!normalized) {
|
|
262198
|
-
return;
|
|
262332
|
+
const { featureAggregationStrategy, featureSelection } = spotLayerCoordination[0][layerScope] || {};
|
|
262333
|
+
const result = aggregateExpressionForScope(spotMultiExpressionData?.[layerScope], spotMultiExpressionNormData[layerScope], spotMultiExpressionExtents?.[layerScope], featureAggregationStrategy, featureSelection);
|
|
262334
|
+
if (result) {
|
|
262335
|
+
normDataByLayer[layerScope] = result.normData;
|
|
262336
|
+
extentsByLayer[layerScope] = result.extents;
|
|
262199
262337
|
}
|
|
262200
|
-
normDataByLayer[layerScope] = [normalized.normData];
|
|
262201
|
-
extentsByLayer[layerScope] = [normalized.extent];
|
|
262202
|
-
hasNormData = true;
|
|
262203
|
-
hasExtents = true;
|
|
262204
262338
|
});
|
|
262205
|
-
return [
|
|
262206
|
-
|
|
262207
|
-
|
|
262208
|
-
|
|
262209
|
-
|
|
262210
|
-
|
|
262211
|
-
|
|
262212
|
-
|
|
262213
|
-
];
|
|
262339
|
+
return [normDataByLayer, extentsByLayer];
|
|
262340
|
+
}, [
|
|
262341
|
+
spotMultiExpressionData,
|
|
262342
|
+
spotMultiExpressionNormData,
|
|
262343
|
+
spotMultiExpressionExtents,
|
|
262344
|
+
spotLayerScopes,
|
|
262345
|
+
spotLayerCoordination
|
|
262346
|
+
]);
|
|
262214
262347
|
}
|
|
262215
|
-
function useAggregatedNormalizedExpressionDataForChannels({ multiExpressionData: segmentationMultiExpressionData, layerScopes: segmentationLayerScopes, channelScopesByLayer: segmentationChannelScopesByLayer, channelCoordination: segmentationChannelCoordination }) {
|
|
262216
|
-
|
|
262217
|
-
if (!
|
|
262218
|
-
return [
|
|
262348
|
+
function useAggregatedNormalizedExpressionDataForChannels({ multiExpressionData: segmentationMultiExpressionData, multiExpressionNormData: segmentationMultiExpressionNormData, multiExpressionExtents: segmentationMultiExpressionExtents, layerScopes: segmentationLayerScopes, channelScopesByLayer: segmentationChannelScopesByLayer, channelCoordination: segmentationChannelCoordination }) {
|
|
262349
|
+
return useMemo$1(() => {
|
|
262350
|
+
if (!segmentationMultiExpressionNormData || !segmentationLayerScopes?.length || !segmentationChannelScopesByLayer || !segmentationChannelCoordination?.[0]) {
|
|
262351
|
+
return [segmentationMultiExpressionNormData, segmentationMultiExpressionExtents];
|
|
262219
262352
|
}
|
|
262220
|
-
|
|
262221
|
-
|
|
262222
|
-
const normDataByLayer = {};
|
|
262223
|
-
const extentsByLayer = {};
|
|
262353
|
+
const normDataByLayer = { ...segmentationMultiExpressionNormData };
|
|
262354
|
+
const extentsByLayer = { ...segmentationMultiExpressionExtents };
|
|
262224
262355
|
segmentationLayerScopes.forEach((layerScope) => {
|
|
262225
|
-
const channelScopes = segmentationChannelScopesByLayer
|
|
262226
|
-
|
|
262227
|
-
|
|
262228
|
-
|
|
262229
|
-
|
|
262230
|
-
|
|
262231
|
-
|
|
262232
|
-
|
|
262233
|
-
|
|
262234
|
-
|
|
262235
|
-
|
|
262236
|
-
|
|
262237
|
-
|
|
262238
|
-
}
|
|
262239
|
-
const aggregated = aggregateFeatureArrays(validExpressionArrays, strategy);
|
|
262240
|
-
if (!aggregated) {
|
|
262241
|
-
return;
|
|
262242
|
-
}
|
|
262243
|
-
const normalized = normalizeAggregatedFeatureArray(aggregated);
|
|
262244
|
-
if (!normalized) {
|
|
262245
|
-
return;
|
|
262246
|
-
}
|
|
262247
|
-
if (!normDataByLayer[layerScope]) {
|
|
262248
|
-
normDataByLayer[layerScope] = {};
|
|
262249
|
-
}
|
|
262250
|
-
if (!extentsByLayer[layerScope]) {
|
|
262251
|
-
extentsByLayer[layerScope] = {};
|
|
262356
|
+
const channelScopes = segmentationChannelScopesByLayer[layerScope];
|
|
262357
|
+
channelScopes?.forEach((channelScope) => {
|
|
262358
|
+
const { featureAggregationStrategy, featureSelection } = segmentationChannelCoordination[0][layerScope]?.[channelScope] || {};
|
|
262359
|
+
const result = aggregateExpressionForScope(segmentationMultiExpressionData?.[layerScope]?.[channelScope], segmentationMultiExpressionNormData[layerScope]?.[channelScope], segmentationMultiExpressionExtents?.[layerScope]?.[channelScope], featureAggregationStrategy, featureSelection);
|
|
262360
|
+
if (result) {
|
|
262361
|
+
normDataByLayer[layerScope] = {
|
|
262362
|
+
...normDataByLayer[layerScope],
|
|
262363
|
+
[channelScope]: result.normData
|
|
262364
|
+
};
|
|
262365
|
+
extentsByLayer[layerScope] = {
|
|
262366
|
+
...extentsByLayer[layerScope],
|
|
262367
|
+
[channelScope]: result.extents
|
|
262368
|
+
};
|
|
262252
262369
|
}
|
|
262253
|
-
normDataByLayer[layerScope][channelScope] = [normalized.normData];
|
|
262254
|
-
extentsByLayer[layerScope][channelScope] = [normalized.extent];
|
|
262255
|
-
hasNormData = true;
|
|
262256
|
-
hasExtents = true;
|
|
262257
262370
|
});
|
|
262258
262371
|
});
|
|
262259
|
-
return [
|
|
262260
|
-
hasNormData ? normDataByLayer : null,
|
|
262261
|
-
hasExtents ? extentsByLayer : null
|
|
262262
|
-
];
|
|
262372
|
+
return [normDataByLayer, extentsByLayer];
|
|
262263
262373
|
}, [
|
|
262264
262374
|
segmentationMultiExpressionData,
|
|
262375
|
+
segmentationMultiExpressionNormData,
|
|
262376
|
+
segmentationMultiExpressionExtents,
|
|
262265
262377
|
segmentationLayerScopes,
|
|
262266
262378
|
segmentationChannelScopesByLayer,
|
|
262267
262379
|
segmentationChannelCoordination
|
|
262268
262380
|
]);
|
|
262269
|
-
return [
|
|
262270
|
-
segmentationMultiExpressionNormDataAggregated,
|
|
262271
|
-
segmentationMultiExpressionExtentsAggregated
|
|
262272
|
-
];
|
|
262273
262381
|
}
|
|
262274
262382
|
const DEFAULT_VIEW_STATE = {
|
|
262275
262383
|
zoom: 0,
|
|
@@ -262371,6 +262479,7 @@ function SpatialSubscriber(props) {
|
|
|
262371
262479
|
spatialRotationOrbit: rotationOrbit,
|
|
262372
262480
|
spatialOrbitAxis: orbitAxis,
|
|
262373
262481
|
spatialAxisFixed,
|
|
262482
|
+
spatialBackgroundTheme,
|
|
262374
262483
|
spatialCameraSnapshot,
|
|
262375
262484
|
// TODO: get obsSets per-layer or per-channel
|
|
262376
262485
|
additionalObsSets,
|
|
@@ -262395,6 +262504,7 @@ function SpatialSubscriber(props) {
|
|
|
262395
262504
|
setSpatialRotationOrbit: setRotationOrbit,
|
|
262396
262505
|
setSpatialOrbitAxis: setOrbitAxis,
|
|
262397
262506
|
setSpatialAxisFixed,
|
|
262507
|
+
setSpatialBackgroundTheme,
|
|
262398
262508
|
setSpatialCameraSnapshot,
|
|
262399
262509
|
// TODO: get obsSets per-layer or per-channel
|
|
262400
262510
|
setAdditionalObsSets,
|
|
@@ -262406,6 +262516,9 @@ function SpatialSubscriber(props) {
|
|
|
262406
262516
|
const annotationEditingProps = useAnnotationEditingForView(uuid2, Boolean(areAnnotationsEditable && annotationEditable && typeof annotationFrameIndex === "number"));
|
|
262407
262517
|
const { spatialZoom: initialZoom, spatialTargetX: initialTargetX, spatialTargetY: initialTargetY, spatialTargetZ: initialTargetZ } = useInitialCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.SPATIAL_BETA], coordinationScopes);
|
|
262408
262518
|
const hasSpatialCameraSnapshot = Boolean(spatialCameraSnapshot) && spatialRenderingMode === "3D";
|
|
262519
|
+
const requestCameraReset = useCallback(() => {
|
|
262520
|
+
setSpatialCameraSnapshot(null);
|
|
262521
|
+
}, [setSpatialCameraSnapshot]);
|
|
262409
262522
|
const [segmentationLayerScopes, segmentationChannelScopesByLayer] = useMultiCoordinationScopesSecondaryNonNull(CoordinationType$1.SEGMENTATION_CHANNEL, CoordinationType$1.SEGMENTATION_LAYER, coordinationScopes, coordinationScopesBy);
|
|
262410
262523
|
const [imageLayerScopes, imageChannelScopesByLayer] = useMultiCoordinationScopesSecondaryNonNull(CoordinationType$1.IMAGE_CHANNEL, CoordinationType$1.IMAGE_LAYER, coordinationScopes, coordinationScopesBy);
|
|
262411
262524
|
const spotLayerScopes = useMultiCoordinationScopesNonNull(CoordinationType$1.SPOT_LAYER, coordinationScopes);
|
|
@@ -262471,6 +262584,7 @@ function SpatialSubscriber(props) {
|
|
|
262471
262584
|
CoordinationType$1.SPATIAL_LAYER_VISIBLE,
|
|
262472
262585
|
CoordinationType$1.SPATIAL_LAYER_OPACITY,
|
|
262473
262586
|
CoordinationType$1.SPATIAL_SPOT_RADIUS,
|
|
262587
|
+
CoordinationType$1.SPATIAL_SPOT_SHAPE,
|
|
262474
262588
|
CoordinationType$1.SPATIAL_SPOT_FILLED,
|
|
262475
262589
|
CoordinationType$1.SPATIAL_SPOT_STROKE_WIDTH,
|
|
262476
262590
|
CoordinationType$1.OBS_COLOR_ENCODING,
|
|
@@ -262502,7 +262616,9 @@ function SpatialSubscriber(props) {
|
|
|
262502
262616
|
CoordinationType$1.OBS_HIGHLIGHT,
|
|
262503
262617
|
CoordinationType$1.TOOLTIPS_VISIBLE,
|
|
262504
262618
|
CoordinationType$1.TOOLTIP_CROSSHAIRS_VISIBLE,
|
|
262505
|
-
CoordinationType$1.LEGEND_VISIBLE
|
|
262619
|
+
CoordinationType$1.LEGEND_VISIBLE,
|
|
262620
|
+
CoordinationType$1.SPATIAL_POINT_RADIUS,
|
|
262621
|
+
CoordinationType$1.SPATIAL_POINT_STROKE_WIDTH
|
|
262506
262622
|
], coordinationScopes, coordinationScopesBy, CoordinationType$1.POINT_LAYER);
|
|
262507
262623
|
const [volumeLoadingStatus, setVolumeLoadingStatus] = useState(null);
|
|
262508
262624
|
const [{ volumeLoadingProgress, tiledPointsLoadingProgress }, { setVolumeLoadingProgress, setTiledPointsLoadingProgress }] = useAuxiliaryCoordination([
|
|
@@ -262537,12 +262653,16 @@ function SpatialSubscriber(props) {
|
|
|
262537
262653
|
const [segmentationMultiExpressionData, segmentationMultiLoadedFeatureSelection, segmentationMultiExpressionExtents, segmentationMultiExpressionNormData, segmentationMultiFeatureSelectionStatus, segmentationMultiFeatureSelectionErrors] = useSegmentationMultiFeatureSelection(coordinationScopes, coordinationScopesBy, loaders, dataset);
|
|
262538
262654
|
const [segmentationMultiIndicesData, segmentationMultiIndicesDataStatus, segmentationMultiIndicesDataErrors] = useSegmentationMultiObsFeatureMatrixIndices(coordinationScopes, coordinationScopesBy, loaders, dataset);
|
|
262539
262655
|
const [spotMultiExpressionNormDataAggregated, spotMultiExpressionExtentsAggregated] = useAggregatedNormalizedExpressionDataForLayers({
|
|
262540
|
-
multiExpressionData:
|
|
262656
|
+
multiExpressionData: spotMultiExpressionData,
|
|
262657
|
+
multiExpressionNormData: spotMultiExpressionNormData,
|
|
262658
|
+
multiExpressionExtents: spotMultiExpressionExtents,
|
|
262541
262659
|
layerScopes: spotLayerScopes,
|
|
262542
262660
|
layerCoordination: spotLayerCoordination
|
|
262543
262661
|
});
|
|
262544
262662
|
const [segmentationMultiExpressionNormDataAggregated, segmentationMultiExpressionExtentsAggregated] = useAggregatedNormalizedExpressionDataForChannels({
|
|
262545
|
-
multiExpressionData:
|
|
262663
|
+
multiExpressionData: segmentationMultiExpressionData,
|
|
262664
|
+
multiExpressionNormData: segmentationMultiExpressionNormData,
|
|
262665
|
+
multiExpressionExtents: segmentationMultiExpressionExtents,
|
|
262546
262666
|
layerScopes: segmentationLayerScopes,
|
|
262547
262667
|
channelScopesByLayer: segmentationChannelScopesByLayer,
|
|
262548
262668
|
channelCoordination: segmentationChannelCoordination
|
|
@@ -262875,7 +262995,7 @@ function SpatialSubscriber(props) {
|
|
|
262875
262995
|
}
|
|
262876
262996
|
}
|
|
262877
262997
|
};
|
|
262878
|
-
return jsxs(TitleInfo, { title: title2, info: subtitle, isSpatial: true, urls: urls2, theme, closeButtonVisible, downloadButtonVisible, removeGridComponent, isReady: isReady && !isSelectionPending, errors, helpText, options: jsx$1(SpatialOptions, { spatialAxisFixed, setSpatialAxisFixed, use3d: is3dMode }), children: [shouldUseThree ? acceleratedFor3d ? jsx$1(SpatialAcceleratedAdapter, { ref: threeRef, uuid: uuid2, width: width2, height: height2, theme, hideTools: !isSelectable, rotation: [rotationX, rotationY, rotationZ], setRotationX, setRotationY, setRotationZ, targetT, targetZ, viewState: isValidViewState ? {
|
|
262998
|
+
return jsxs(TitleInfo, { title: title2, info: subtitle, isSpatial: true, urls: urls2, theme, closeButtonVisible, downloadButtonVisible, removeGridComponent, isReady: isReady && !isSelectionPending, errors, helpText, spatialBackgroundTheme: spatialBackgroundTheme ?? "dark", options: jsx$1(SpatialOptions, { spatialAxisFixed, setSpatialAxisFixed, use3d: is3dMode, spatialBackgroundTheme: spatialBackgroundTheme ?? "dark", setSpatialBackgroundTheme }), children: [shouldUseThree ? acceleratedFor3d ? jsx$1(SpatialAcceleratedAdapter, { ref: threeRef, uuid: uuid2, width: width2, height: height2, theme, hideTools: !isSelectable, rotation: [rotationX, rotationY, rotationZ], setRotationX, setRotationY, setRotationZ, targetT, targetZ, viewState: isValidViewState ? {
|
|
262879
262999
|
zoom: zoom2,
|
|
262880
263000
|
target: [targetX2, targetY2, targetZ],
|
|
262881
263001
|
rotationX,
|
|
@@ -262885,13 +263005,66 @@ function SpatialSubscriber(props) {
|
|
|
262885
263005
|
target: [targetX2, targetY2, targetZ],
|
|
262886
263006
|
rotationX,
|
|
262887
263007
|
rotationOrbit
|
|
262888
|
-
} : DEFAULT_VIEW_STATE, orbitAxis, spatialAxisFixed, setViewState: isValidViewState ? setViewState : SET_VIEW_STATE_NOOP, originalViewState, spatialRenderingMode, updateViewInfo: setComponentViewInfo, delegateHover, onEntitySelected, obsPoints: obsPointsData, pointLayerScopes, pointLayerCoordination, pointMultiObsLabels: pointMultiObsLabelsData, obsSpots: obsSpotsData, spotLayerScopes, spotLayerCoordination, obsSpotsSets: obsSpotsSetsData, spotMatrixIndices: spotMultiIndicesData, spotMultiExpressionData: spotMultiExpressionNormDataAggregated || spotMultiExpressionNormData, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, obsSegmentations: obsSegmentationsData, obsSegmentationsLocations: obsSegmentationsLocationsData, obsSegmentationsSets: obsSegmentationsSetsData, segmentationMatrixIndices: segmentationMultiIndicesData, segmentationMultiExpressionData: segmentationMultiExpressionNormDataAggregated || segmentationMultiExpressionNormData, bitmaskValueIsIndex, images: imageData, imageLayerScopes, imageLayerCoordination, imageChannelScopesByLayer, imageChannelCoordination }) : jsx$1(SpatialWrapper, {
|
|
262889
|
-
|
|
262890
|
-
|
|
262891
|
-
|
|
262892
|
-
|
|
262893
|
-
|
|
262894
|
-
|
|
263008
|
+
} : DEFAULT_VIEW_STATE, orbitAxis, spatialAxisFixed, setViewState: isValidViewState ? setViewState : SET_VIEW_STATE_NOOP, originalViewState, spatialRenderingMode, updateViewInfo: setComponentViewInfo, delegateHover, onEntitySelected, obsPoints: obsPointsData, pointLayerScopes, pointLayerCoordination, pointMultiObsLabels: pointMultiObsLabelsData, obsSpots: obsSpotsData, spotLayerScopes, spotLayerCoordination, obsSpotsSets: obsSpotsSetsData, spotMatrixIndices: spotMultiIndicesData, spotMultiExpressionData: spotMultiExpressionNormDataAggregated || spotMultiExpressionNormData, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, obsSegmentations: obsSegmentationsData, obsSegmentationsLocations: obsSegmentationsLocationsData, obsSegmentationsSets: obsSegmentationsSetsData, segmentationMatrixIndices: segmentationMultiIndicesData, segmentationMultiExpressionData: segmentationMultiExpressionNormDataAggregated || segmentationMultiExpressionNormData, bitmaskValueIsIndex, images: imageData, imageLayerScopes, imageLayerCoordination, imageChannelScopesByLayer, imageChannelCoordination }) : jsx$1(SpatialWrapper, {
|
|
263009
|
+
ref: deckRef,
|
|
263010
|
+
uuid: uuid2,
|
|
263011
|
+
onSelectionBusy: setIsSelectionPending,
|
|
263012
|
+
width: width2,
|
|
263013
|
+
height: height2,
|
|
263014
|
+
theme,
|
|
263015
|
+
hideTools: !isSelectable,
|
|
263016
|
+
targetT,
|
|
263017
|
+
targetZ,
|
|
263018
|
+
viewState: isValidViewState ? {
|
|
263019
|
+
zoom: zoom2,
|
|
263020
|
+
target: [targetX2, targetY2, targetZ],
|
|
263021
|
+
rotationX,
|
|
263022
|
+
rotationOrbit,
|
|
263023
|
+
...annotationTransitionProps
|
|
263024
|
+
} : DEFAULT_VIEW_STATE,
|
|
263025
|
+
orbitAxis,
|
|
263026
|
+
spatialAxisFixed,
|
|
263027
|
+
setViewState: isValidViewState ? setViewState : SET_VIEW_STATE_NOOP,
|
|
263028
|
+
originalViewState,
|
|
263029
|
+
spatialRenderingMode,
|
|
263030
|
+
updateViewInfo: setComponentViewInfo,
|
|
263031
|
+
delegateHover,
|
|
263032
|
+
obsPoints: obsPointsData,
|
|
263033
|
+
pointLayerScopes,
|
|
263034
|
+
pointLayerCoordination,
|
|
263035
|
+
pointMultiObsLabels: pointMultiObsLabelsData,
|
|
263036
|
+
pointMatrixIndices: pointMultiIndicesData,
|
|
263037
|
+
obsSpots: obsSpotsData,
|
|
263038
|
+
spotLayerScopes,
|
|
263039
|
+
spotLayerCoordination,
|
|
263040
|
+
obsSpotsSets: obsSpotsSetsData,
|
|
263041
|
+
spotMatrixIndices: spotMultiIndicesData,
|
|
263042
|
+
spotMultiExpressionData: spotMultiExpressionNormDataAggregated || spotMultiExpressionNormData,
|
|
263043
|
+
segmentationLayerScopes,
|
|
263044
|
+
segmentationLayerCoordination,
|
|
263045
|
+
segmentationChannelScopesByLayer,
|
|
263046
|
+
segmentationChannelCoordination,
|
|
263047
|
+
obsSegmentations: obsSegmentationsData,
|
|
263048
|
+
obsSegmentationsLocations: obsSegmentationsLocationsData,
|
|
263049
|
+
obsSegmentationsSets: obsSegmentationsSetsData,
|
|
263050
|
+
segmentationMatrixIndices: segmentationMultiIndicesData,
|
|
263051
|
+
segmentationMultiExpressionData: segmentationMultiExpressionNormDataAggregated || segmentationMultiExpressionNormData,
|
|
263052
|
+
bitmaskValueIsIndex,
|
|
263053
|
+
images: imageData,
|
|
263054
|
+
imageLayerScopes,
|
|
263055
|
+
imageLayerCoordination,
|
|
263056
|
+
imageChannelScopesByLayer,
|
|
263057
|
+
imageChannelCoordination,
|
|
263058
|
+
setTiledPointsLoadingProgress,
|
|
263059
|
+
spatialCameraSnapshot: hasSpatialCameraSnapshot ? sceneCameraSnapshot : null,
|
|
263060
|
+
setSpatialCameraSnapshot: hasSpatialCameraSnapshot ? setSceneCameraSnapshot : null,
|
|
263061
|
+
annotationShapes,
|
|
263062
|
+
annotationOverlayVisible,
|
|
263063
|
+
annotationSemanticZoom,
|
|
263064
|
+
// Synced to Neuroglancer: recenter asks NG to restore its home camera (snapshot follows).
|
|
263065
|
+
onRequestCameraReset: hasSpatialCameraSnapshot ? requestCameraReset : void 0,
|
|
263066
|
+
...annotationEditingProps
|
|
263067
|
+
}), !disableTooltip && jsx$1(SpatialTooltipSubscriber, {
|
|
262895
263068
|
parentUuid: uuid2,
|
|
262896
263069
|
width: width2,
|
|
262897
263070
|
height: height2,
|
|
@@ -262916,8 +263089,8 @@ function SpatialSubscriber(props) {
|
|
|
262916
263089
|
}), jsx$1(
|
|
262917
263090
|
MultiLegend,
|
|
262918
263091
|
{
|
|
262919
|
-
//
|
|
262920
|
-
theme: "dark",
|
|
263092
|
+
// Match the plot background, which is configurable.
|
|
263093
|
+
theme: spatialBackgroundTheme ?? "dark",
|
|
262921
263094
|
maxHeight: height2,
|
|
262922
263095
|
// Segmentations
|
|
262923
263096
|
segmentationLayerScopes,
|
|
@@ -270308,7 +270481,7 @@ _defineProperty$3(WindowScroller, "defaultProps", {
|
|
|
270308
270481
|
serverHeight: 0,
|
|
270309
270482
|
serverWidth: 0
|
|
270310
270483
|
});
|
|
270311
|
-
const useStyles$
|
|
270484
|
+
const useStyles$o = makeStyles()((theme) => ({
|
|
270312
270485
|
selectableTable: {
|
|
270313
270486
|
flex: "1 1 auto",
|
|
270314
270487
|
outline: "none"
|
|
@@ -270458,7 +270631,7 @@ function SelectableTable(props) {
|
|
|
270458
270631
|
onChange(null);
|
|
270459
270632
|
}
|
|
270460
270633
|
}, [selectedRows, allowMultiple]);
|
|
270461
|
-
const { classes: classes2 } = useStyles$
|
|
270634
|
+
const { classes: classes2 } = useStyles$o();
|
|
270462
270635
|
const inputUuid = v4$1();
|
|
270463
270636
|
const rowRenderer = ({ index: index2, style: style2 }) => (
|
|
270464
270637
|
// eslint-disable-next-line jsx-a11y/interactive-supports-focus
|
|
@@ -270487,7 +270660,7 @@ const FEATURELIST_SORT_OPTIONS = [
|
|
|
270487
270660
|
"original"
|
|
270488
270661
|
];
|
|
270489
270662
|
const ALT_COLNAME = "Alternate ID";
|
|
270490
|
-
const useStyles$
|
|
270663
|
+
const useStyles$n = makeStyles()(() => ({
|
|
270491
270664
|
searchBar: {
|
|
270492
270665
|
marginTop: "10px",
|
|
270493
270666
|
marginLeft: "10px",
|
|
@@ -270500,7 +270673,7 @@ const useStyles$o = makeStyles()(() => ({
|
|
|
270500
270673
|
}));
|
|
270501
270674
|
function FeatureList(props) {
|
|
270502
270675
|
const { width: width2, height: height2, hasColorEncoding, geneList = [], featureLabelsMap, geneSelection = [], geneFilter = null, setGeneSelection, enableMultiSelect, requireShiftForMultiSelect, showFeatureTable, featureListSort, featureListSortKey, hasFeatureLabels, primaryColumnName } = props;
|
|
270503
|
-
const { classes: classes2 } = useStyles$
|
|
270676
|
+
const { classes: classes2 } = useStyles$n();
|
|
270504
270677
|
const [searchTerm, setSearchTerm] = useState("");
|
|
270505
270678
|
const selectableTableSortKey = featureListSortKey === "featureIndex" ? "key" : "name";
|
|
270506
270679
|
const searchResults = useMemo$1(() => geneList.filter((gene) => gene.toLowerCase().includes(searchTerm.toLowerCase()) || featureLabelsMap?.get(gene)?.toLowerCase().includes(searchTerm.toLowerCase()) || featureLabelsMap?.get(cleanFeatureId(gene))?.toLowerCase().includes(searchTerm.toLowerCase())), [geneList, searchTerm, featureLabelsMap]);
|
|
@@ -270573,7 +270746,7 @@ function FeatureListOptions(props) {
|
|
|
270573
270746
|
id: `feature-list-show-alternative-ids-${featureListId}`
|
|
270574
270747
|
} } }) })] })] }) : null] });
|
|
270575
270748
|
}
|
|
270576
|
-
const useStyles$
|
|
270749
|
+
const useStyles$m = makeStyles()((theme) => ({
|
|
270577
270750
|
featureListContainer: {
|
|
270578
270751
|
width: "100%",
|
|
270579
270752
|
height: "100%",
|
|
@@ -270588,7 +270761,7 @@ function FeatureListSubscriber(props) {
|
|
|
270588
270761
|
const loaders = useLoaders();
|
|
270589
270762
|
const coordinationScopes = useCoordinationScopes(coordinationScopesRaw);
|
|
270590
270763
|
const [width2, height2, containerRef] = useGridItemSize();
|
|
270591
|
-
const { classes: classes2 } = useStyles$
|
|
270764
|
+
const { classes: classes2 } = useStyles$m();
|
|
270592
270765
|
const [{ dataset, obsType, featureType, featureSelection: geneSelection, featureFilter: geneFilter, obsColorEncoding: cellColorEncoding }, { setFeatureSelection: setGeneSelection, setFeatureFilter: setGeneFilter, setFeatureHighlight: setGeneHighlight, setObsColorEncoding: setCellColorEncoding }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.FEATURE_LIST], coordinationScopes);
|
|
270593
270766
|
const variablesLabel = variablesLabelOverride || featureType;
|
|
270594
270767
|
const title2 = titleOverride || `${capitalize$3(variablesLabel)} List`;
|
|
@@ -270723,7 +270896,7 @@ const useSelectionSliderStyles = makeStyles()(() => ({
|
|
|
270723
270896
|
backgroundColor: "rgba(128, 128, 128, 0.7)"
|
|
270724
270897
|
}
|
|
270725
270898
|
}));
|
|
270726
|
-
const useStyles$
|
|
270899
|
+
const useStyles$l = makeStyles()((theme) => ({
|
|
270727
270900
|
paletteContainer: {
|
|
270728
270901
|
width: "70px",
|
|
270729
270902
|
height: "40px",
|
|
@@ -270744,10 +270917,10 @@ const useStyles$m = makeStyles()((theme) => ({
|
|
|
270744
270917
|
}
|
|
270745
270918
|
}));
|
|
270746
270919
|
const ColorPalette = ({ handleChange }) => {
|
|
270747
|
-
const { classes: classes2 } = useStyles$
|
|
270920
|
+
const { classes: classes2 } = useStyles$l();
|
|
270748
270921
|
return jsx$1("div", { className: classes2.paletteContainer, "aria-label": "Color swatch", children: VIEWER_PALETTE.map((color2) => jsx$1(IconButton$1, { className: classes2.button, onClick: () => handleChange(color2), "aria-label": `Change color to ${color2}`, children: jsx$1(LensIcon, { fontSize: "small", style: { color: `rgb(${color2})` }, className: classes2.icon }) }, color2)) });
|
|
270749
270922
|
};
|
|
270750
|
-
const useStyles$
|
|
270923
|
+
const useStyles$k = makeStyles()(() => ({
|
|
270751
270924
|
menuButton: {
|
|
270752
270925
|
backgroundColor: "transparent"
|
|
270753
270926
|
},
|
|
@@ -270766,7 +270939,7 @@ function MuiSpan(props) {
|
|
|
270766
270939
|
}
|
|
270767
270940
|
function ChannelOptions$1({ handlePropertyChange, handleChannelRemove, handleIQRUpdate }) {
|
|
270768
270941
|
const [open2, setOpen] = useState(false);
|
|
270769
|
-
const { classes: classes2 } = useStyles$
|
|
270942
|
+
const { classes: classes2 } = useStyles$k();
|
|
270770
270943
|
const handleColorSelect = (color2) => {
|
|
270771
270944
|
handlePropertyChange("color", color2);
|
|
270772
270945
|
};
|
|
@@ -270776,9 +270949,23 @@ function ChannelOptions$1({ handlePropertyChange, handleChannelRemove, handleIQR
|
|
|
270776
270949
|
};
|
|
270777
270950
|
return jsxs(PopperMenu, { open: open2, setOpen, buttonIcon: jsx$1(MoreVertIcon, { fontSize: "small" }), buttonClassName: classes2.menuButton, "aria-label": "Open channel options menu", children: [jsx$1(MenuItem, { dense: true, disableGutters: true, onClick: handleRemove, "aria-label": "Click to remove channel", children: jsx$1(MuiSpan, { children: "Remove" }) }), jsx$1(MenuItem, { dense: true, disableGutters: true, onClick: handleIQRUpdate, "aria-label": "Click to use IQR for channel", children: jsx$1(MuiSpan, { children: "Use IQR" }) }), jsx$1(MenuItem, { dense: true, disableGutters: true, className: classes2.colors, "aria-label": "Click to select color for channel", children: jsx$1(ColorPalette, { handleChange: handleColorSelect }) })] });
|
|
270778
270951
|
}
|
|
270779
|
-
|
|
270952
|
+
const CHANNELS_SORT_ORDER_OPTIONS = [
|
|
270953
|
+
{ value: "original", label: "Original" },
|
|
270954
|
+
{ value: "alphabetical", label: "Alphabetical" }
|
|
270955
|
+
];
|
|
270956
|
+
function getSortedChannelOptions(channelNames, channelsSortOrder) {
|
|
270957
|
+
if (!Array.isArray(channelNames))
|
|
270958
|
+
return [];
|
|
270959
|
+
const options = channelNames.map((channelName, channelIndex) => ({ channelName, channelIndex }));
|
|
270960
|
+
if (channelsSortOrder === "alphabetical") {
|
|
270961
|
+
return options.sort((a2, b2) => String(a2.channelName).localeCompare(String(b2.channelName), void 0, { numeric: true, sensitivity: "base" }));
|
|
270962
|
+
}
|
|
270963
|
+
return options;
|
|
270964
|
+
}
|
|
270965
|
+
function ChannelSelectionDropdown$1({ handleChange, disabled, channelOptions, selectionIndex, channelsSortOrder }) {
|
|
270780
270966
|
const { classes: classes2 } = useSelectStyles();
|
|
270781
|
-
|
|
270967
|
+
const sortedOptions = useMemo$1(() => getSortedChannelOptions(channelOptions, channelsSortOrder), [channelOptions, channelsSortOrder]);
|
|
270968
|
+
return jsx$1(NativeSelect, { classes: { root: classes2.selectRoot }, value: selectionIndex, onChange: (e3) => handleChange(Number(e3.target.value)), inputProps: { "aria-label": "Select a channel" }, children: sortedOptions.map(({ channelName, channelIndex }) => jsx$1("option", { disabled, value: channelIndex, children: channelName }, `${channelName}-${channelIndex}`)) });
|
|
270782
270969
|
}
|
|
270783
270970
|
function ChannelVisibilityCheckbox$1({ color: color2, checked, toggle: toggle2, disabled }) {
|
|
270784
270971
|
return jsx$1(Checkbox$1, { onChange: toggle2, checked, disabled, sx: { paddingLeft: 0 }, style: { color: color2, "&$checked": { color: color2 } }, slotProps: {
|
|
@@ -270802,7 +270989,7 @@ function ChannelSlider$1({ color: color2, slider = [0, 0], handleChange, domain:
|
|
|
270802
270989
|
return `${labelPrefix} for ${color2} colormap channel`;
|
|
270803
270990
|
}, getAriaValueText: () => `Current colormap values: ${color2}-${slider}`, min: min2, max: max2, step, orientation: "horizontal", style: { color: color2, marginTop: "7px" }, disabled });
|
|
270804
270991
|
}
|
|
270805
|
-
function RasterChannelController({ visibility = false, slider, color: color2, channels: channels2, channelId, domainType: newDomainType, dimName, theme, loader: loader2, colormapOn, channelOptions, handlePropertyChange, handleChannelRemove, handleIQRUpdate, selectionIndex, isLoading, use3d: newUse3d }) {
|
|
270992
|
+
function RasterChannelController({ visibility = false, slider, color: color2, channels: channels2, channelId, domainType: newDomainType, dimName, theme, loader: loader2, colormapOn, channelOptions, handlePropertyChange, handleChannelRemove, handleIQRUpdate, selectionIndex, isLoading, use3d: newUse3d, channelsSortOrder }) {
|
|
270806
270993
|
const { dtype } = getSourceFromLoader(loader2);
|
|
270807
270994
|
const [domain2, setDomain] = useState(null);
|
|
270808
270995
|
const [domainType, setDomainType] = useState(null);
|
|
@@ -270875,15 +271062,15 @@ function RasterChannelController({ visibility = false, slider, color: color2, ch
|
|
|
270875
271062
|
justifyContent: "center"
|
|
270876
271063
|
}, children: [jsxs(Grid$1, { container: true, direction: "row", sx: {
|
|
270877
271064
|
justifyContent: "space-between"
|
|
270878
|
-
}, children: [jsx$1(Grid$1, { size: 10, children: jsx$1(ChannelSelectionDropdown$1, { handleChange: (v) => handlePropertyChange("selection", createSelection(v)), selectionIndex, channelOptions, disabled: isLoading }) }), jsx$1(Grid$1, { size: 1, sx: { marginTop: "4px" }, children: jsx$1(ChannelOptions$1, { handlePropertyChange, handleChannelRemove, handleIQRUpdate, disabled: isLoading }) })] }), jsxs(Grid$1, { container: true, direction: "row", sx: {
|
|
271065
|
+
}, children: [jsx$1(Grid$1, { size: 10, children: jsx$1(ChannelSelectionDropdown$1, { handleChange: (v) => handlePropertyChange("selection", createSelection(v)), selectionIndex, channelOptions, disabled: isLoading, channelsSortOrder }) }), jsx$1(Grid$1, { size: 1, sx: { marginTop: "4px" }, children: jsx$1(ChannelOptions$1, { handlePropertyChange, handleChannelRemove, handleIQRUpdate, disabled: isLoading }) })] }), jsxs(Grid$1, { container: true, direction: "row", sx: {
|
|
270879
271066
|
justifyContent: "space-between"
|
|
270880
271067
|
}, children: [jsx$1(Grid$1, { size: 2, children: jsx$1(ChannelVisibilityCheckbox$1, { color: rgbColor, checked: visibility, toggle: () => handlePropertyChange("visible", !visibility), disabled: isLoading }) }), jsx$1(Grid$1, { size: 9, children: jsx$1(ChannelSlider$1, { color: rgbColor, slider, domain: domain2 || DOMAINS[dtype], dtype, handleChange: (v) => handlePropertyChange("slider", v), disabled: isLoading }) })] })] });
|
|
270881
271068
|
}
|
|
270882
|
-
function BitmaskChannelController({ visibility = false, dimName, channelOptions, handlePropertyChange, handleChannelRemove, selectionIndex, disableOptions = false }) {
|
|
271069
|
+
function BitmaskChannelController({ visibility = false, dimName, channelOptions, channelsSortOrder, handlePropertyChange, handleChannelRemove, selectionIndex, disableOptions = false }) {
|
|
270883
271070
|
const createSelection = (index2) => ({ [dimName]: index2 });
|
|
270884
271071
|
return jsxs(Grid$1, { container: true, direction: "row", sx: {
|
|
270885
271072
|
justifyContent: "space-between"
|
|
270886
|
-
}, children: [jsx$1(Grid$1, { size: 2, children: jsx$1(ChannelVisibilityCheckbox$1, { color: [220, 220, 220], checked: visibility, toggle: () => handlePropertyChange("visible", !visibility) }) }), jsx$1(Grid$1, { size: 9, children: jsx$1(ChannelSelectionDropdown$1, { handleChange: (v) => handlePropertyChange("selection", createSelection(v)), selectionIndex, disableOptions, channelOptions }) }), jsx$1(Grid$1, { size: 1, children: jsx$1(IconButton$1, { onClick: handleChannelRemove, style: { padding: "6px 6px 6px 0px" }, "aria-label": "Remove channel", children: jsx$1(RemoveCircle, {}) }) })] });
|
|
271073
|
+
}, children: [jsx$1(Grid$1, { size: 2, children: jsx$1(ChannelVisibilityCheckbox$1, { color: [220, 220, 220], checked: visibility, toggle: () => handlePropertyChange("visible", !visibility) }) }), jsx$1(Grid$1, { size: 9, children: jsx$1(ChannelSelectionDropdown$1, { handleChange: (v) => handlePropertyChange("selection", createSelection(v)), selectionIndex, disableOptions, channelOptions, channelsSortOrder }) }), jsx$1(Grid$1, { size: 1, children: jsx$1(IconButton$1, { onClick: handleChannelRemove, style: { padding: "6px 6px 6px 0px" }, "aria-label": "Remove channel", children: jsx$1(RemoveCircle, {}) }) })] });
|
|
270887
271074
|
}
|
|
270888
271075
|
function VectorLayerController(props) {
|
|
270889
271076
|
const { label: label2, layer, layerType, handleLayerChange } = props;
|
|
@@ -271004,6 +271191,10 @@ function OpacitySlider({ value: value2, inputId, handleChange }) {
|
|
|
271004
271191
|
const { classes: classes2 } = useChannelSliderStyles();
|
|
271005
271192
|
return jsx$1(Slider, { slotProps: { valueLabel: { className: classes2.sliderValueLabel } }, value: value2, onChange: (e3, v) => handleChange(v), valueLabelDisplay: "auto", "aria-label": "Layer opacity slider", id: inputId, min: 0, max: 1, step: 0.01, orientation: "horizontal" });
|
|
271006
271193
|
}
|
|
271194
|
+
function ChannelsSortOrderSelect({ value: value2, inputId, handleChange }) {
|
|
271195
|
+
const { classes: classes2 } = useSelectStyles();
|
|
271196
|
+
return jsx$1(NativeSelect, { onChange: (e3) => handleChange(e3.target.value), value: value2 || "original", id: inputId, inputProps: { "aria-label": "Channel sort order selector" }, style: { width: "100%" }, classes: { root: classes2.selectRoot }, children: CHANNELS_SORT_ORDER_OPTIONS.map(({ value: optValue, label: label2 }) => jsx$1("option", { value: optValue, children: label2 }, optValue)) });
|
|
271197
|
+
}
|
|
271007
271198
|
function SliderDomainSelector({ value: value2, inputId, handleChange }) {
|
|
271008
271199
|
const { classes: classes2 } = useSelectStyles();
|
|
271009
271200
|
return jsx$1(NativeSelect, { onChange: (e3) => handleChange(e3.target.value), value: value2, id: inputId, inputProps: { name: "domain-selector", "aria-label": "Domain type selector" }, style: { width: "100%" }, classes: { root: classes2.selectRoot }, children: DOMAIN_OPTIONS.map((name2) => jsx$1("option", { value: name2, children: name2 }, name2)) });
|
|
@@ -271037,7 +271228,7 @@ function LayerOption({ name: name2, inputId, children: children3 }) {
|
|
|
271037
271228
|
justifyContent: "center"
|
|
271038
271229
|
}, children: [jsx$1(Grid$1, { size: 6, children: jsxs(InputLabel, { htmlFor: inputId, children: [name2, ":"] }) }), jsx$1(Grid$1, { size: 6, children: children3 })] });
|
|
271039
271230
|
}
|
|
271040
|
-
function LayerOptions({ colormap, opacity: opacity2, handleColormapChange, handleOpacityChange, handleTransparentColorChange, globalControlLabels, globalLabelValues, handleGlobalChannelsSelectionChange, handleSliderChange, handleDomainChange, transparentColor, channels: channels2, domainType, disableChannelsIfRgbDetected, shouldShowTransparentColor, shouldShowDomain, shouldShowColormap, use3d, loader: loader2, handleMultiPropertyChange, resolution, disable3d, setRasterLayerCallback, setAreAllChannelsLoading, setViewState, spatialHeight, spatialWidth, modelMatrix: modelMatrix2 }) {
|
|
271231
|
+
function LayerOptions({ colormap, opacity: opacity2, handleColormapChange, handleOpacityChange, handleTransparentColorChange, globalControlLabels, globalLabelValues, handleGlobalChannelsSelectionChange, handleSliderChange, handleDomainChange, channelsSortOrder, handleChannelsSortOrderChange, transparentColor, channels: channels2, domainType, disableChannelsIfRgbDetected, shouldShowTransparentColor, shouldShowDomain, shouldShowColormap, use3d, loader: loader2, handleMultiPropertyChange, resolution, disable3d, setRasterLayerCallback, setAreAllChannelsLoading, setViewState, spatialHeight, spatialWidth, modelMatrix: modelMatrix2 }) {
|
|
271041
271232
|
const { labels: labels2, shape: shape2 } = Array.isArray(loader2.data) ? loader2.data[0] : loader2.data;
|
|
271042
271233
|
const hasDimensionsAndChannels = labels2.length > 0 && channels2.length > 0;
|
|
271043
271234
|
const hasZStack = shape2[labels2.indexOf("z")] > 1;
|
|
@@ -271049,7 +271240,8 @@ function LayerOptions({ colormap, opacity: opacity2, handleColormapChange, handl
|
|
|
271049
271240
|
const domainSelectorId = $bdb11010cef70236$export$f680877a34711e37();
|
|
271050
271241
|
const opacitySliderId = $bdb11010cef70236$export$f680877a34711e37();
|
|
271051
271242
|
const zeroTransparentId = $bdb11010cef70236$export$f680877a34711e37();
|
|
271052
|
-
|
|
271243
|
+
const channelsSortOrderId = $bdb11010cef70236$export$f680877a34711e37();
|
|
271244
|
+
return jsxs(Grid$1, { container: true, sx: { flexDirection: "column", width: "100%" }, children: [hasZStack && !disable3d && hasViewableResolutions && jsx$1(VolumeDropdown, { loader: loader2, handleSliderChange, handleDomainChange, channels: channels2, handleMultiPropertyChange, resolution, disable3d, setRasterLayerCallback, setAreAllChannelsLoading, setViewState, spatialHeight, spatialWidth, use3d, modelMatrix: modelMatrix2 }), hasDimensionsAndChannels && !use3d && globalControlLabels.map((field2) => shape2[labels2.indexOf(field2)] > 1 && jsx$1(LayerOption, { name: field2, inputId: `${field2}-${globalSelectionSliderId}`, children: jsx$1(GlobalSelectionSlider, { field: field2, inputId: `${field2}-${globalSelectionSliderId}`, value: globalLabelValues[field2], handleChange: handleGlobalChannelsSelectionChange, possibleValues: range$d(shape2[labels2.indexOf(field2)]) }) }, field2)), !disableChannelsIfRgbDetected ? jsxs(Fragment, { children: [shouldShowColormap && jsx$1(Grid$1, { children: jsx$1(LayerOption, { name: "Colormap", inputId: colormapSelectId, children: jsx$1(ColormapSelect, { value: colormap || "", inputId: colormapSelectId, handleChange: handleColormapChange }) }) }), hasDimensionsAndChannels && handleChannelsSortOrderChange && jsx$1(Grid$1, { children: jsx$1(LayerOption, { name: "Channel Order", inputId: channelsSortOrderId, children: jsx$1(ChannelsSortOrderSelect, { value: channelsSortOrder, inputId: channelsSortOrderId, handleChange: handleChannelsSortOrderChange }) }) }), shouldShowDomain && jsx$1(Grid$1, { children: jsx$1(LayerOption, { name: "Domain", inputId: domainSelectorId, children: jsx$1(SliderDomainSelector, { value: domainType || DEFAULT_RASTER_DOMAIN_TYPE, inputId: domainSelectorId, handleChange: (value2) => {
|
|
271053
271245
|
handleDomainChange(value2);
|
|
271054
271246
|
} }) }) })] }) : null, !use3d && jsx$1(Grid$1, { children: jsx$1(LayerOption, { name: "Opacity", inputId: opacitySliderId, children: jsx$1(OpacitySlider, { value: opacity2, handleChange: handleOpacityChange, inputId: opacitySliderId }) }) }), shouldShowTransparentColor && !use3d && jsx$1(Grid$1, { children: jsx$1(LayerOption, { name: "Zero Transparent", inputId: zeroTransparentId, children: jsx$1(TransparentColorCheckbox, { value: transparentColor, handleChange: handleTransparentColorChange, inputId: zeroTransparentId }) }) })] });
|
|
271055
271247
|
}
|
|
@@ -271146,7 +271338,7 @@ const buttonStyles = {
|
|
|
271146
271338
|
fontWeight: 400
|
|
271147
271339
|
};
|
|
271148
271340
|
function LayerController$1(props) {
|
|
271149
|
-
const { layer, name: name2, loader: loader2, theme, handleLayerRemove, handleLayerChange, shouldShowTransparentColor, shouldShowDomain, shouldShowColormap, ChannelController, setViewState, disable3d, setImageLayerCallback, setAreLayerChannelsLoading, areLayerChannelsLoading, disabled, spatialHeight, spatialWidth, photometricInterpretation, shouldShowRemoveLayerButton } = props;
|
|
271341
|
+
const { layer, name: name2, loader: loader2, theme, handleLayerRemove, handleLayerChange, shouldShowTransparentColor, shouldShowDomain, shouldShowColormap, ChannelController, setViewState, disable3d, setImageLayerCallback, setAreLayerChannelsLoading, areLayerChannelsLoading, disabled, spatialHeight, spatialWidth, photometricInterpretation, shouldShowRemoveLayerButton, channelsSortOrder, setChannelsSortOrder } = props;
|
|
271150
271342
|
const { colormap, opacity: opacity2, channels: channels2, transparentColor, renderingMode, xSlice, ySlice, zSlice, resolution, use3d, modelMatrix: modelMatrix2 } = layer;
|
|
271151
271343
|
const channelRef = useRef(channels2);
|
|
271152
271344
|
useEffect(() => {
|
|
@@ -271330,7 +271522,7 @@ function LayerController$1(props) {
|
|
|
271330
271522
|
};
|
|
271331
271523
|
return jsx$1(
|
|
271332
271524
|
ChannelController,
|
|
271333
|
-
{ dimName: channelLabel, visibility: c2.visible, selectionIndex: c2.selection[channelLabel], slider: c2.slider, color: c2.color, channels: channels2, channelId, domainType, loader: loader2, globalLabelValues, theme, channelOptions, colormapOn: Boolean(colormap), handlePropertyChange: handleChannelPropertyChange, handleChannelRemove, handleIQRUpdate, setRasterLayerCallback: setImageLayerCallback, isLoading: areLayerChannelsLoading[channelId], use3d },
|
|
271525
|
+
{ dimName: channelLabel, visibility: c2.visible, selectionIndex: c2.selection[channelLabel], slider: c2.slider, color: c2.color, channels: channels2, channelId, domainType, loader: loader2, globalLabelValues, theme, channelOptions, colormapOn: Boolean(colormap), handlePropertyChange: handleChannelPropertyChange, handleChannelRemove, handleIQRUpdate, setRasterLayerCallback: setImageLayerCallback, isLoading: areLayerChannelsLoading[channelId], use3d, channelsSortOrder },
|
|
271334
271526
|
`channel-controller-${channelId}`
|
|
271335
271527
|
);
|
|
271336
271528
|
}
|
|
@@ -271376,7 +271568,9 @@ function LayerController$1(props) {
|
|
|
271376
271568
|
setViewState,
|
|
271377
271569
|
spatialHeight,
|
|
271378
271570
|
spatialWidth,
|
|
271379
|
-
modelMatrix: modelMatrix2
|
|
271571
|
+
modelMatrix: modelMatrix2,
|
|
271572
|
+
channelsSortOrder,
|
|
271573
|
+
handleChannelsSortOrderChange: setChannelsSortOrder
|
|
271380
271574
|
}), photometricInterpretation === "RGB" ? null : channelControllers, photometricInterpretation === "RGB" ? null : jsx$1(Button, { disabled: channels2.length === MAX_CHANNELS$1, onClick: handleChannelAdd, fullWidth: true, variant: "outlined", style: buttonStyles, startIcon: jsx$1(AddIcon, {}), size: "small", children: "Add Channel" })] });
|
|
271381
271575
|
return jsxs(Accordion, { slotProps: {
|
|
271382
271576
|
root: { elevation: 4, className: controllerSectionClasses.accordionRoot }
|
|
@@ -271406,7 +271600,7 @@ function LayerController$1(props) {
|
|
|
271406
271600
|
minWidth: "50%"
|
|
271407
271601
|
} })] }), jsx$1(TabPanel, { value: tab2, index: 0, children: FullController }), jsx$1(TabPanel, { value: tab2, index: 1, style: { marginTop: 4 }, children: jsx$1(VolumeOptions, { loader: loader2, handleSlicerSetting, handleRenderingModeChange: setRenderingMode, renderingMode, xSlice, ySlice, zSlice, use3d, setViewState, spatialHeight, spatialWidth, modelMatrix: modelMatrix2 }) })] }) : FullController, shouldShowRemoveLayerButton ? jsx$1(Button, { onClick: handleLayerRemove, fullWidth: true, variant: "outlined", style: buttonStyles, size: "small", children: "Remove Image Layer" }) : null] })] });
|
|
271408
271602
|
}
|
|
271409
|
-
const useStyles$
|
|
271603
|
+
const useStyles$j = makeStyles()(() => ({
|
|
271410
271604
|
addButton: {
|
|
271411
271605
|
marginTop: "10px",
|
|
271412
271606
|
marginBottom: "10px",
|
|
@@ -271418,7 +271612,7 @@ function ImageAddIcon() {
|
|
|
271418
271612
|
}
|
|
271419
271613
|
function ImageAddButton({ imageOptions, handleImageAdd }) {
|
|
271420
271614
|
const [open2, setOpen] = useState(false);
|
|
271421
|
-
const { classes: classes2 } = useStyles$
|
|
271615
|
+
const { classes: classes2 } = useStyles$j();
|
|
271422
271616
|
const handleAdd = (imgData) => {
|
|
271423
271617
|
setOpen((prev2) => !prev2);
|
|
271424
271618
|
handleImageAdd(imgData);
|
|
@@ -271477,6 +271671,8 @@ const LayerControllerMemoized = React__default.memo(forwardRef$1((props, ref2) =
|
|
|
271477
271671
|
spatialLayout,
|
|
271478
271672
|
handleImageAdd,
|
|
271479
271673
|
enableLayerButtonsWithOneLayer,
|
|
271674
|
+
channelsSortOrder,
|
|
271675
|
+
setChannelsSortOrder,
|
|
271480
271676
|
helpText
|
|
271481
271677
|
} = props;
|
|
271482
271678
|
const shouldShowImageLayerButton = Boolean(enableLayerButtonsWithOneLayer || imageLayerLoaders?.length > 1);
|
|
@@ -271532,7 +271728,9 @@ const LayerControllerMemoized = React__default.memo(forwardRef$1((props, ref2) =
|
|
|
271532
271728
|
areLayerChannelsLoading,
|
|
271533
271729
|
spatialHeight: componentHeight * (spatialLayout ? spatialLayout.h : 1) / 12,
|
|
271534
271730
|
spatialWidth: componentWidth * (spatialLayout ? spatialLayout.w : 1) / 12,
|
|
271535
|
-
shouldShowRemoveLayerButton: shouldShowImageLayerButton
|
|
271731
|
+
shouldShowRemoveLayerButton: shouldShowImageLayerButton,
|
|
271732
|
+
channelsSortOrder,
|
|
271733
|
+
setChannelsSortOrder
|
|
271536
271734
|
}) },
|
|
271537
271735
|
`${dataset}-raster-${index2}-${i2}`
|
|
271538
271736
|
) : null;
|
|
@@ -271589,7 +271787,9 @@ const LayerControllerMemoized = React__default.memo(forwardRef$1((props, ref2) =
|
|
|
271589
271787
|
areLayerChannelsLoading,
|
|
271590
271788
|
spatialHeight: componentHeight * (spatialLayout ? spatialLayout.h : 1) / 12,
|
|
271591
271789
|
spatialWidth: componentWidth * (spatialLayout ? spatialLayout.w : 1) / 12,
|
|
271592
|
-
shouldShowRemoveLayerButton: shouldShowImageLayerButton
|
|
271790
|
+
shouldShowRemoveLayerButton: shouldShowImageLayerButton,
|
|
271791
|
+
channelsSortOrder,
|
|
271792
|
+
setChannelsSortOrder
|
|
271593
271793
|
}) },
|
|
271594
271794
|
`${dataset}-raster-${index2}-${i2}`
|
|
271595
271795
|
) : null;
|
|
@@ -271598,7 +271798,7 @@ const LayerControllerMemoized = React__default.memo(forwardRef$1((props, ref2) =
|
|
|
271598
271798
|
function LayerControllerSubscriber$1(props) {
|
|
271599
271799
|
const { coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, title: title2 = "Spatial Layers", disable3d, globalDisable3d, disableChannelsIfRgbDetected, enableLayerButtonsWithOneLayer, helpText = ViewHelpMapping.LAYER_CONTROLLER } = props;
|
|
271600
271800
|
const loaders = useLoaders();
|
|
271601
|
-
const [{ dataset, obsType, spatialImageLayer: rasterLayers, spatialSegmentationLayer: cellsLayer, spatialPointLayer: moleculesLayer, photometricInterpretation: photometricInterpretationFromCoordination }, { setSpatialImageLayer: setRasterLayers, setSpatialSegmentationLayer: setCellsLayer, setSpatialPointLayer: setMoleculesLayer, setSpatialTargetX: setTargetX, setSpatialTargetY: setTargetY, setSpatialTargetZ: setTargetZ, setSpatialRotationX: setRotationX, setSpatialRotationOrbit: setRotationOrbit, setSpatialZoom: setZoom }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.LAYER_CONTROLLER], coordinationScopes);
|
|
271801
|
+
const [{ dataset, obsType, spatialImageLayer: rasterLayers, spatialSegmentationLayer: cellsLayer, spatialPointLayer: moleculesLayer, photometricInterpretation: photometricInterpretationFromCoordination, spatialChannelsSortOrder: channelsSortOrder }, { setSpatialImageLayer: setRasterLayers, setSpatialSegmentationLayer: setCellsLayer, setSpatialPointLayer: setMoleculesLayer, setSpatialTargetX: setTargetX, setSpatialTargetY: setTargetY, setSpatialTargetZ: setTargetZ, setSpatialRotationX: setRotationX, setSpatialRotationOrbit: setRotationOrbit, setSpatialZoom: setZoom, setSpatialChannelsSortOrder: setChannelsSortOrder }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.LAYER_CONTROLLER], coordinationScopes);
|
|
271602
271802
|
const [{ imageLayerCallbacks, areLoadingImageChannels, segmentationLayerCallbacks, areLoadingSegmentationChannels }, { setImageLayerCallbacks, setAreLoadingImageChannels, setSegmentationLayerCallbacks, setAreLoadingSegmentationChannels }] = useAuxiliaryCoordination(COMPONENT_COORDINATION_TYPES.layerController, coordinationScopes);
|
|
271603
271803
|
const [spatialLayout] = useComponentLayout("spatial", ["spatialImageLayer"], coordinationScopes);
|
|
271604
271804
|
const layerControllerRef = useRef();
|
|
@@ -271687,6 +271887,8 @@ function LayerControllerSubscriber$1(props) {
|
|
|
271687
271887
|
handleRasterLayerChange,
|
|
271688
271888
|
handleRasterLayerRemove,
|
|
271689
271889
|
photometricInterpretation,
|
|
271890
|
+
channelsSortOrder,
|
|
271891
|
+
setChannelsSortOrder,
|
|
271690
271892
|
obsSegmentationsType,
|
|
271691
271893
|
segmentationLayerLoaders,
|
|
271692
271894
|
segmentationLayerMeta,
|
|
@@ -271780,7 +271982,7 @@ const channelControlCellSx = {
|
|
|
271780
271982
|
}
|
|
271781
271983
|
};
|
|
271782
271984
|
const channelSpacerCellSx = { flexShrink: 0, minWidth: "44px" };
|
|
271783
|
-
const useStyles$
|
|
271985
|
+
const useStyles$i = makeStyles()(() => ({
|
|
271784
271986
|
colorPickerPaper: {
|
|
271785
271987
|
overflow: "hidden",
|
|
271786
271988
|
"& > ul": {
|
|
@@ -271838,7 +272040,7 @@ function ChannelColorPickerMenu(props) {
|
|
|
271838
272040
|
setColor2([rgb2.r, rgb2.g, rgb2.b]);
|
|
271839
272041
|
}
|
|
271840
272042
|
}
|
|
271841
|
-
const { classes: classes2 } = useStyles$
|
|
272043
|
+
const { classes: classes2 } = useStyles$i();
|
|
271842
272044
|
const currentColor = color2 ? colorArrayToString(color2) : colorArrayToString(getDefaultColor(theme));
|
|
271843
272045
|
const isWritable = typeof setColor2 === "function";
|
|
271844
272046
|
const derivedOpen = isWritable ? isStaticColor && visible ? open2 : false : false;
|
|
@@ -271846,7 +272048,45 @@ function ChannelColorPickerMenu(props) {
|
|
|
271846
272048
|
[classes2.colorIconOutline]: theme !== "dark" && isEqual$3(color2, [255, 255, 255])
|
|
271847
272049
|
}), style: { backgroundColor: currentColor } }) : isColormap && visible && featureValueColormap ? jsx$1("div", { className: classes2.colorIcon, children: jsx$1("svg", { width: "18", height: "18", children: jsx$1("image", { x: 0, y: 0, width: 18, height: 18, preserveAspectRatio: "none", href: getXlinkHref(featureValueColormap), clipPath: "inset(0% round 4px)" }) }) }) : jsx$1("div", { className: classes2.colorIcon }), buttonClassName: classes2.colorIconButton, withPaper: true, paperClassName: classes2.colorPickerPaper, "aria-label": "Open color picker menu", children: jsx$1(Twitter$1, { className: classes2.colorPicker, disableAlpha: true, width: 108, triangle: "hide", colors: defaultPalette, color: currentColor, onChangeComplete: handleColorChange }) });
|
|
271848
272050
|
}
|
|
271849
|
-
const
|
|
272051
|
+
const FEATURE_INDEX_OPTION_PREFIX = "feature-index-";
|
|
272052
|
+
function getFeatureOptionValue(featureName, featureIndex) {
|
|
272053
|
+
return RESERVED_FEATURE_AGGREGATION_STRATEGIES.includes(featureName) ? `${FEATURE_INDEX_OPTION_PREFIX}${featureIndex}` : featureName;
|
|
272054
|
+
}
|
|
272055
|
+
function getSelectedOptionValue(featureAggregationStrategy, featureSelection) {
|
|
272056
|
+
const resolvedStrategy = resolveFeatureAggregationStrategy(featureAggregationStrategy, featureSelection) ?? "first";
|
|
272057
|
+
if (resolvedStrategy === "mean" || resolvedStrategy === "sum") {
|
|
272058
|
+
return resolvedStrategy;
|
|
272059
|
+
}
|
|
272060
|
+
if (resolvedStrategy === "difference" && featureSelection.length === 2) {
|
|
272061
|
+
return resolvedStrategy;
|
|
272062
|
+
}
|
|
272063
|
+
let featureIndex = 0;
|
|
272064
|
+
if (resolvedStrategy === "last") {
|
|
272065
|
+
featureIndex = featureSelection.length - 1;
|
|
272066
|
+
} else if (typeof resolvedStrategy === "number") {
|
|
272067
|
+
featureIndex = resolvedStrategy;
|
|
272068
|
+
}
|
|
272069
|
+
return getFeatureOptionValue(featureSelection[featureIndex], featureIndex);
|
|
272070
|
+
}
|
|
272071
|
+
function SingleFeatureSelect(props) {
|
|
272072
|
+
const { featureSelection, featureAggregationStrategy, setFeatureAggregationStrategy } = props;
|
|
272073
|
+
const { classes: lcClasses } = useControllerSectionStyles();
|
|
272074
|
+
const { classes: selectClasses2 } = useSelectStyles();
|
|
272075
|
+
const selectedOptionValue = getSelectedOptionValue(featureAggregationStrategy, featureSelection);
|
|
272076
|
+
const handleChange = useCallback((e3) => {
|
|
272077
|
+
const { value: value2 } = e3.target;
|
|
272078
|
+
if (value2.startsWith(FEATURE_INDEX_OPTION_PREFIX)) {
|
|
272079
|
+
setFeatureAggregationStrategy(Number(value2.substring(FEATURE_INDEX_OPTION_PREFIX.length)));
|
|
272080
|
+
} else {
|
|
272081
|
+
setFeatureAggregationStrategy(value2);
|
|
272082
|
+
}
|
|
272083
|
+
}, [setFeatureAggregationStrategy]);
|
|
272084
|
+
return jsx$1(Grid$1, { className: lcClasses.layerControllerGrid, children: jsx$1(Paper, { elevation: 2, className: lcClasses.layerControllerSubRow, children: jsxs(NativeSelect, { onChange: handleChange, value: selectedOptionValue, inputProps: { "aria-label": "Select the feature used for colormap-based coloring" }, classes: { root: selectClasses2.selectRoot }, children: [jsx$1("optgroup", { label: "Single feature", children: featureSelection.map((featureName, featureIndex) => {
|
|
272085
|
+
const optionValue = getFeatureOptionValue(featureName, featureIndex);
|
|
272086
|
+
return jsx$1("option", { value: optionValue, children: featureName }, optionValue);
|
|
272087
|
+
}) }), jsxs("optgroup", { label: "Combine features", children: [jsx$1("option", { value: "mean", children: "Mean" }), jsx$1("option", { value: "sum", children: "Sum" }), featureSelection.length === 2 ? jsx$1("option", { value: "difference", children: `Difference (${featureSelection[0]} − ${featureSelection[1]})` }) : null] })] }) }) });
|
|
272088
|
+
}
|
|
272089
|
+
const useStyles$h = makeStyles()(() => ({
|
|
271850
272090
|
layerTypeSpotIcon: {
|
|
271851
272091
|
height: "100%",
|
|
271852
272092
|
marginLeft: "1px",
|
|
@@ -271859,7 +272099,7 @@ const useStyles$i = makeStyles()(() => ({
|
|
|
271859
272099
|
function SpotLayerEllipsisMenu(props) {
|
|
271860
272100
|
const { strokeWidth, setStrokeWidth, filled, setFilled, featureSelection, obsColorEncoding, setObsColorEncoding, featureValueColormap, setFeatureValueColormap, featureValueColormapRange, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible } = props;
|
|
271861
272101
|
const [open2, setOpen] = useState(false);
|
|
271862
|
-
const { classes: classes2 } = useStyles$
|
|
272102
|
+
const { classes: classes2 } = useStyles$h();
|
|
271863
272103
|
const { classes: selectClasses2 } = useSelectStyles();
|
|
271864
272104
|
const { classes: menuClasses } = useEllipsisMenuStyles();
|
|
271865
272105
|
const filledId = $bdb11010cef70236$export$f680877a34711e37();
|
|
@@ -271874,14 +272114,15 @@ function SpotLayerEllipsisMenu(props) {
|
|
|
271874
272114
|
}
|
|
271875
272115
|
function SpotLayerController(props) {
|
|
271876
272116
|
const { theme, layerScope, layerCoordination, setLayerCoordination, palette = null } = props;
|
|
271877
|
-
const { obsType, spatialLayerVisible: visible, spatialLayerLabel, spatialLayerOpacity: opacity2, spatialSpotRadius: radius2, spatialSpotFilled: filled, spatialSpotStrokeWidth: strokeWidth, spatialLayerColor: color2, obsColorEncoding, featureSelection, featureValueColormap, featureValueColormapRange, tooltipsVisible, tooltipCrosshairsVisible, legendVisible } = layerCoordination;
|
|
271878
|
-
const { setSpatialLayerVisible: setVisible, setSpatialLayerOpacity: setOpacity2, setSpatialSpotRadius: setRadius, setSpatialSpotFilled: setFilled, setSpatialSpotStrokeWidth: setStrokeWidth, setSpatialLayerColor: setColor2, setObsColorEncoding, setFeatureSelection, setFeatureValueColormap, setFeatureValueColormapRange, setTooltipsVisible, setTooltipCrosshairsVisible, setLegendVisible } = setLayerCoordination;
|
|
272117
|
+
const { obsType, spatialLayerVisible: visible, spatialLayerLabel, spatialLayerOpacity: opacity2, spatialSpotRadius: radius2, spatialSpotFilled: filled, spatialSpotStrokeWidth: strokeWidth, spatialLayerColor: color2, obsColorEncoding, featureSelection, featureAggregationStrategy, featureValueColormap, featureValueColormapRange, tooltipsVisible, tooltipCrosshairsVisible, legendVisible } = layerCoordination;
|
|
272118
|
+
const { setSpatialLayerVisible: setVisible, setSpatialLayerOpacity: setOpacity2, setSpatialSpotRadius: setRadius, setSpatialSpotFilled: setFilled, setSpatialSpotStrokeWidth: setStrokeWidth, setSpatialLayerColor: setColor2, setObsColorEncoding, setFeatureSelection, setFeatureAggregationStrategy, setFeatureValueColormap, setFeatureValueColormapRange, setTooltipsVisible, setTooltipCrosshairsVisible, setLegendVisible } = setLayerCoordination;
|
|
271879
272119
|
const label2 = spatialLayerLabel || capitalize$3(obsType);
|
|
271880
272120
|
const visibleSetting = typeof visible === "boolean" ? visible : true;
|
|
271881
272121
|
const Visibility$1 = useMemo$1(() => visibleSetting ? Visibility : VisibilityOff, [visibleSetting]);
|
|
271882
272122
|
const isStaticColor = obsColorEncoding === "spatialLayerColor";
|
|
271883
272123
|
const isColormap = obsColorEncoding === "geneSelection";
|
|
271884
|
-
const
|
|
272124
|
+
const hasMultipleFeaturesSelected = Array.isArray(featureSelection) && featureSelection.length > 1;
|
|
272125
|
+
const { classes: classes2 } = useStyles$h();
|
|
271885
272126
|
const { classes: lcClasses } = useControllerSectionStyles();
|
|
271886
272127
|
const { classes: menuClasses } = useEllipsisMenuStyles();
|
|
271887
272128
|
const handleVisibleChange = useCallback(() => {
|
|
@@ -271889,11 +272130,11 @@ function SpotLayerController(props) {
|
|
|
271889
272130
|
setVisible(nextVisible);
|
|
271890
272131
|
}, [visible, setVisible]);
|
|
271891
272132
|
const handleOpacityChange = useCallback((e3, v) => setOpacity2(v), [setOpacity2]);
|
|
271892
|
-
return jsx$1(Grid$1, { className: lcClasses.layerControllerGrid, children: jsx$1(Paper, { elevation: 4, className: lcClasses.layerControllerRoot, children: jsxs(Grid$1, { container: true, direction: "row", sx: {
|
|
272133
|
+
return jsxs(Fragment, { children: [jsx$1(Grid$1, { className: lcClasses.layerControllerGrid, children: jsx$1(Paper, { elevation: 4, className: lcClasses.layerControllerRoot, children: jsxs(Grid$1, { container: true, direction: "row", sx: {
|
|
271893
272134
|
justifyContent: "space-between"
|
|
271894
|
-
}, children: [jsx$1(Grid$1, { size: 1, children: jsx$1(Button, { onClick: handleVisibleChange, className: menuClasses.imageLayerVisibleButton, "aria-label": "Toggle spot layer visibility", children: jsx$1(Visibility$1, {}) }) }), jsx$1(Grid$1, { size: 1, children: jsx$1(ChannelColorPickerMenu, { theme, color: color2, setColor: setColor2, palette, isStaticColor, isColormap, featureValueColormap, visible }) }), jsx$1(Grid$1, { size: 6, children: jsx$1(Typography, { className: menuClasses.imageLayerName, children: label2 }) }), jsx$1(Grid$1, { size: 2, children: jsx$1(Slider, { value: opacity2, min: 0, max: 1, step: 1e-3, onChange: handleOpacityChange, className: menuClasses.imageLayerOpacitySlider, orientation: "horizontal", "aria-label": `Adjust opacity for layer ${label2}` }) }), jsx$1(Grid$1, { size: 1, children: jsx$1(SpotLayerEllipsisMenu, { filled, setFilled, strokeWidth, setStrokeWidth, featureSelection, obsColorEncoding, setObsColorEncoding, featureValueColormap, setFeatureValueColormap, featureValueColormapRange, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible }) }), jsx$1(Grid$1, { size: 1, children: jsx$1(SvgSpots, { className: classes2.layerTypeSpotIcon }) })] }) }) });
|
|
272135
|
+
}, children: [jsx$1(Grid$1, { size: 1, children: jsx$1(Button, { onClick: handleVisibleChange, className: menuClasses.imageLayerVisibleButton, "aria-label": "Toggle spot layer visibility", children: jsx$1(Visibility$1, {}) }) }), jsx$1(Grid$1, { size: 1, children: jsx$1(ChannelColorPickerMenu, { theme, color: color2, setColor: setColor2, palette, isStaticColor, isColormap, featureValueColormap, visible }) }), jsx$1(Grid$1, { size: 6, children: jsx$1(Typography, { className: menuClasses.imageLayerName, children: label2 }) }), jsx$1(Grid$1, { size: 2, children: jsx$1(Slider, { value: opacity2, min: 0, max: 1, step: 1e-3, onChange: handleOpacityChange, className: menuClasses.imageLayerOpacitySlider, orientation: "horizontal", "aria-label": `Adjust opacity for layer ${label2}` }) }), jsx$1(Grid$1, { size: 1, children: jsx$1(SpotLayerEllipsisMenu, { filled, setFilled, strokeWidth, setStrokeWidth, featureSelection, obsColorEncoding, setObsColorEncoding, featureValueColormap, setFeatureValueColormap, featureValueColormapRange, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible }) }), jsx$1(Grid$1, { size: 1, children: jsx$1(SvgSpots, { className: classes2.layerTypeSpotIcon }) })] }) }) }), isColormap && hasMultipleFeaturesSelected ? jsx$1(SingleFeatureSelect, { featureSelection, featureAggregationStrategy, setFeatureAggregationStrategy }) : null] });
|
|
271895
272136
|
}
|
|
271896
|
-
const useStyles$
|
|
272137
|
+
const useStyles$g = makeStyles()(() => ({
|
|
271897
272138
|
layerFeatureControllerGrid: {
|
|
271898
272139
|
padding: "0",
|
|
271899
272140
|
flexWrap: "nowrap"
|
|
@@ -271954,7 +272195,7 @@ function LayerPerFeatureController(props) {
|
|
|
271954
272195
|
]);
|
|
271955
272196
|
}
|
|
271956
272197
|
}, [featureName, featureColor, setFeatureColor, featureColorIndex]);
|
|
271957
|
-
const { classes: classes2 } = useStyles$
|
|
272198
|
+
const { classes: classes2 } = useStyles$g();
|
|
271958
272199
|
const { classes: lcClasses } = useControllerSectionStyles();
|
|
271959
272200
|
const { classes: menuClasses } = useEllipsisMenuStyles();
|
|
271960
272201
|
const [open2, setOpen] = useState(false);
|
|
@@ -272013,7 +272254,8 @@ function LayerPerFeatureController(props) {
|
|
|
272013
272254
|
justifyContent: "space-between"
|
|
272014
272255
|
}, children: jsx$1(LinearProgress, { variant: loadingDoneFraction === 0 ? "indeterminate" : "determinate", value: loadingDoneFraction * 100 }) }) : null] }) }, featureName);
|
|
272015
272256
|
}
|
|
272016
|
-
const
|
|
272257
|
+
const DEFAULT_POINT_RADIUS = 2.5;
|
|
272258
|
+
const useStyles$f = makeStyles()(() => ({
|
|
272017
272259
|
pointLayerButton: {
|
|
272018
272260
|
borderStyle: "dashed",
|
|
272019
272261
|
marginTop: "10px",
|
|
@@ -272042,7 +272284,7 @@ const useStyles$g = makeStyles()(() => ({
|
|
|
272042
272284
|
}
|
|
272043
272285
|
}));
|
|
272044
272286
|
function PointLayerEllipsisMenu(props) {
|
|
272045
|
-
const { featureSelection, featureFilterMode, setFeatureFilterMode, obsColorEncoding, setObsColorEncoding, featureValueColormap, setFeatureValueColormap, featureValueColormapRange, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible } = props;
|
|
272287
|
+
const { featureSelection, featureFilterMode, setFeatureFilterMode, obsColorEncoding, setObsColorEncoding, featureValueColormap, setFeatureValueColormap, featureValueColormapRange, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible, strokeWidth, setStrokeWidth, pointRadius, setpointRadius } = props;
|
|
272046
272288
|
const [open2, setOpen] = useState(false);
|
|
272047
272289
|
const { classes: selectClasses2 } = useSelectStyles();
|
|
272048
272290
|
const { classes: menuClasses } = useEllipsisMenuStyles();
|
|
@@ -272053,7 +272295,9 @@ function PointLayerEllipsisMenu(props) {
|
|
|
272053
272295
|
const legendVisibleId = $bdb11010cef70236$export$f680877a34711e37();
|
|
272054
272296
|
const featureFilterModeId = $bdb11010cef70236$export$f680877a34711e37();
|
|
272055
272297
|
const colormapSelectorId = $bdb11010cef70236$export$f680877a34711e37();
|
|
272056
|
-
|
|
272298
|
+
const strokeWidthId = $bdb11010cef70236$export$f680877a34711e37();
|
|
272299
|
+
const pointRadiusId = $bdb11010cef70236$export$f680877a34711e37();
|
|
272300
|
+
return jsxs(PopperMenu, { open: open2, setOpen, buttonIcon: jsx$1(MoreVertIcon, {}), buttonClassName: menuClasses.imageLayerMenuButton, containerClassName: menuClasses.imageLayerPopperContainer, withPaper: true, getAriaLabel: () => "Open point layer options menu", children: [jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: colormapSelectorId, children: "Colormap: " }), jsx$1(NativeSelect, { onChange: (e3) => setFeatureValueColormap(e3.target.value), value: featureValueColormap, inputProps: { id: colormapSelectorId, "aria-label": "Colormap selector" }, classes: { root: selectClasses2.selectRoot }, children: GLSL_COLORMAPS.map((cmap) => jsx$1("option", { value: cmap, children: cmap }, cmap)) })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: quantitativeColormapId, children: "Color Encoding: " }), jsxs(NativeSelect, { onChange: (e3) => setObsColorEncoding(e3.target.value), value: obsColorEncoding, inputProps: { id: quantitativeColormapId, "aria-label": "Color encoding selector" }, classes: { root: selectClasses2.selectRoot }, children: [jsx$1("option", { value: "spatialLayerColor", children: "Static Color" }), jsx$1("option", { value: "geneSelection", children: "Feature Color" }), jsx$1("option", { value: "randomByFeature", children: "Random Color per Feature" }), jsx$1("option", { value: "random", children: "Random Color per Point" })] })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: featureFilterModeId, children: "Filter to Feature Selection: " }), jsx$1(Checkbox$1, { color: "primary", className: menuClasses.menuItemCheckbox, checked: featureFilterMode === "featureSelection", onChange: (e3, v) => setFeatureFilterMode(v ? "featureSelection" : null), slotProps: { input: { id: featureFilterModeId, "aria-label": "Toggle feature filter mode" } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: colormapRangeId, children: "Colormap Range: " }), jsx$1(Slider, { disabled: obsColorEncoding !== "geneSelection", value: featureValueColormapRange, min: 0, max: 1, step: 0.01, onChange: (e3, v) => setFeatureValueColormapRange(v), className: menuClasses.menuItemSlider, orientation: "horizontal", id: colormapRangeId, getAriaLabel: (index2) => index2 === 0 ? "Low value colormap range slider" : "High value colormap range slider" })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: tooltipsVisibleId, children: "Tooltips Visible: " }), jsx$1(Checkbox$1, { color: "primary", className: menuClasses.menuItemCheckbox, checked: tooltipsVisible, onChange: (e3, v) => setTooltipsVisible(v), slotProps: { input: { id: tooltipsVisibleId, "aria-label": "Toggle tooltip visibility" } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: crosshairsVisibleId, children: "Tooltip Crosshairs Visible: " }), jsx$1(Checkbox$1, { color: "primary", className: menuClasses.menuItemCheckbox, checked: tooltipCrosshairsVisible, onChange: (e3, v) => setTooltipCrosshairsVisible(v), slotProps: { input: { id: crosshairsVisibleId, "aria-label": "Toggle tooltip crosshair visibility" } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: legendVisibleId, children: "Legend Visible: " }), jsx$1(Checkbox$1, { color: "primary", className: menuClasses.menuItemCheckbox, checked: legendVisible, onChange: (e3, v) => setLegendVisible(v), slotProps: { input: { id: legendVisibleId, "aria-label": "Toggle legend visibility" } } })] }), setStrokeWidth ? jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: strokeWidthId, children: "Stroke Width: " }), jsx$1(Slider, { value: strokeWidth ?? 0, min: 0, max: 5, step: 0.1, valueLabelDisplay: "auto", onChange: (e3, v) => setStrokeWidth(v), className: menuClasses.menuItemSlider, orientation: "horizontal", id: strokeWidthId, "aria-label": "Point stroke width slider" })] }) : null, jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: pointRadiusId, children: "Point Size: " }), jsx$1(Slider, { value: pointRadius ?? DEFAULT_POINT_RADIUS, min: 0.1, max: 20, step: 0.1, valueLabelDisplay: "auto", onChange: (e3, v) => setpointRadius?.(v), className: menuClasses.menuItemSlider, orientation: "horizontal", id: pointRadiusId, "aria-label": "Point size slider" })] })] });
|
|
272057
272301
|
}
|
|
272058
272302
|
function PointLayerController(props) {
|
|
272059
272303
|
const { theme, layerScope, layerCoordination, setLayerCoordination, palette = null, pointMatrixIndicesData, tiledPointsLoadingProgress, layerPerFeatureForPoints } = props;
|
|
@@ -272064,8 +272308,8 @@ function PointLayerController(props) {
|
|
|
272064
272308
|
}
|
|
272065
272309
|
return 1;
|
|
272066
272310
|
}, [tiledPointsLoadingProgress]);
|
|
272067
|
-
const { obsType, spatialLayerVisible: visible, spatialLayerOpacity: opacity2, spatialLayerOpacityUnselected, spatialLayerLabel, obsColorEncoding, featureColor, featureFilterMode, featureSelection, featureValueColormap, featureValueColormapRange, spatialLayerColor, tooltipsVisible, tooltipCrosshairsVisible, legendVisible } = layerCoordination;
|
|
272068
|
-
const { setSpatialLayerVisible: setVisible, setSpatialLayerOpacity: setOpacity2, setSpatialLayerOpacityUnselected, setObsColorEncoding, setFeatureColor, setFeatureFilterMode, setFeatureSelection, setFeatureValueColormap, setFeatureValueColormapRange, setSpatialLayerColor, setTooltipsVisible, setTooltipCrosshairsVisible, setLegendVisible } = setLayerCoordination;
|
|
272311
|
+
const { obsType, spatialLayerVisible: visible, spatialLayerOpacity: opacity2, spatialLayerOpacityUnselected, spatialLayerLabel, obsColorEncoding, featureColor, featureFilterMode, featureSelection, featureValueColormap, featureValueColormapRange, spatialLayerColor, tooltipsVisible, tooltipCrosshairsVisible, legendVisible, spatialPointStrokeWidth, spatialPointRadius } = layerCoordination;
|
|
272312
|
+
const { setSpatialLayerVisible: setVisible, setSpatialLayerOpacity: setOpacity2, setSpatialLayerOpacityUnselected, setObsColorEncoding, setFeatureColor, setFeatureFilterMode, setFeatureSelection, setFeatureValueColormap, setFeatureValueColormapRange, setSpatialLayerColor, setTooltipsVisible, setTooltipCrosshairsVisible, setLegendVisible, setSpatialPointStrokeWidth, setSpatialPointRadius } = setLayerCoordination;
|
|
272069
272313
|
const label2 = spatialLayerLabel ?? capitalize$3(obsType);
|
|
272070
272314
|
const visibleSetting = typeof visible === "boolean" ? visible : true;
|
|
272071
272315
|
const Visibility$1 = useMemo$1(() => visibleSetting ? Visibility : VisibilityOff, [visibleSetting]);
|
|
@@ -272085,7 +272329,7 @@ function PointLayerController(props) {
|
|
|
272085
272329
|
} else if (!usesLayerColor) {
|
|
272086
272330
|
colorTooltip = "The layer color is not used by the current Color Encoding mode.";
|
|
272087
272331
|
}
|
|
272088
|
-
const { classes: classes2 } = useStyles$
|
|
272332
|
+
const { classes: classes2 } = useStyles$f();
|
|
272089
272333
|
const { classes: lcClasses } = useControllerSectionStyles();
|
|
272090
272334
|
const { classes: menuClasses } = useEllipsisMenuStyles();
|
|
272091
272335
|
const handleVisibleChange = useCallback(() => {
|
|
@@ -272114,14 +272358,14 @@ function PointLayerController(props) {
|
|
|
272114
272358
|
}, [featureSelection, obsColorEncoding, featureIndex, featureColor]);
|
|
272115
272359
|
return jsxs(Grid$1, { className: lcClasses.layerControllerGrid, children: [jsxs(Paper, { elevation: 4, className: lcClasses.layerControllerRoot, children: [jsxs(Grid$1, { container: true, direction: "row", sx: [{
|
|
272116
272360
|
justifyContent: "space-between"
|
|
272117
|
-
}, channelRowContainerSx], children: [jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(Button, { onClick: handleVisibleChange, className: menuClasses.imageLayerVisibleButton, "aria-label": "Toggle layer visibility", children: jsx$1(Visibility$1, {}) }) }), jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(Tooltip$3, { title: colorTooltip ?? "", disableHoverListener: !colorTooltip, placement: "top", children: jsx$1("span", { children: jsx$1(ChannelColorPickerMenu, { theme, color: color2, setColor: colorEditable ? setColor2 : null, palette, isStaticColor, isColormap, featureValueColormap, visible }) }) }) }), jsx$1(Grid$1, { size: 6, sx: channelSelectorCellSx, children: jsx$1(Typography, { className: menuClasses.imageLayerName, title: label2, children: label2 }) }), jsx$1(Grid$1, { size: 2, sx: channelSliderCellSx, children: jsx$1(Slider, { value: opacity2, min: 0, max: 1, step: 1e-3, onChange: handleOpacityChange, className: menuClasses.imageLayerOpacitySlider, orientation: "horizontal", "aria-label": `Adjust opacity for layer ${label2}` }) }), jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(PointLayerEllipsisMenu, { featureSelection, obsColorEncoding, setObsColorEncoding, featureValueColormapRange, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible, featureFilterMode, setFeatureFilterMode, featureValueColormap, setFeatureValueColormap }) }), jsxs(Grid$1, { size: 1, container: true, direction: "row", sx: channelControlCellSx, children: [jsx$1(SvgPoints, { className: classes2.layerTypePointIcon }), null] })] }), loadingDoneFraction < 1 ? jsx$1(Grid$1, { size: 12, container: true, className: classes2.pointFeatureControllerGrid, sx: {
|
|
272361
|
+
}, channelRowContainerSx], children: [jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(Button, { onClick: handleVisibleChange, className: menuClasses.imageLayerVisibleButton, "aria-label": "Toggle layer visibility", children: jsx$1(Visibility$1, {}) }) }), jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(Tooltip$3, { title: colorTooltip ?? "", disableHoverListener: !colorTooltip, placement: "top", children: jsx$1("span", { children: jsx$1(ChannelColorPickerMenu, { theme, color: color2, setColor: colorEditable ? setColor2 : null, palette, isStaticColor, isColormap, featureValueColormap, visible }) }) }) }), jsx$1(Grid$1, { size: 6, sx: channelSelectorCellSx, children: jsx$1(Typography, { className: menuClasses.imageLayerName, title: label2, children: label2 }) }), jsx$1(Grid$1, { size: 2, sx: channelSliderCellSx, children: jsx$1(Slider, { value: opacity2, min: 0, max: 1, step: 1e-3, onChange: handleOpacityChange, className: menuClasses.imageLayerOpacitySlider, orientation: "horizontal", "aria-label": `Adjust opacity for layer ${label2}` }) }), jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(PointLayerEllipsisMenu, { featureSelection, obsColorEncoding, setObsColorEncoding, featureValueColormapRange, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible, featureFilterMode, setFeatureFilterMode, featureValueColormap, setFeatureValueColormap, strokeWidth: spatialPointStrokeWidth, setStrokeWidth: setSpatialPointStrokeWidth, pointRadius: spatialPointRadius, setpointRadius: setSpatialPointRadius }) }), jsxs(Grid$1, { size: 1, container: true, direction: "row", sx: channelControlCellSx, children: [jsx$1(SvgPoints, { className: classes2.layerTypePointIcon }), null] })] }), loadingDoneFraction < 1 ? jsx$1(Grid$1, { size: 12, container: true, className: classes2.pointFeatureControllerGrid, sx: {
|
|
272118
272362
|
flexDirection: "column",
|
|
272119
272363
|
justifyContent: "space-between"
|
|
272120
272364
|
}, children: jsx$1(LinearProgress, { variant: loadingDoneFraction === 0 ? "indeterminate" : "determinate", value: loadingDoneFraction * 100 }) }) : null, null] }), layerPerFeatureForPoints && hasSelectedFeatures ? jsxs(Fragment, { children: [featureSelection.map((featureName) => jsx$1(LayerPerFeatureController, { theme, featureName, featureColor, setFeatureColor, spatialLayerColor, featureIndex, featureValueColormap, featureSelection, setFeatureSelection, obsColorEncoding, loadingDoneFraction }, featureName)), jsx$1(Grid$1, { className: lcClasses.layerControllerGrid, children: jsx$1(Paper, { elevation: 2, className: lcClasses.layerControllerSubRow, children: jsxs(Grid$1, { container: true, direction: "row", sx: {
|
|
272121
272365
|
justifyContent: "space-between"
|
|
272122
272366
|
}, children: [jsx$1(Grid$1, { size: 1, children: jsx$1(Button, { onClick: () => setFeatureFilterMode(featureFilterMode === "featureSelection" ? null : "featureSelection"), className: menuClasses.imageLayerVisibleButton, "aria-label": "Toggle visibility of unselected points", children: featureFilterMode === "featureSelection" ? jsx$1(VisibilityOff, {}) : jsx$1(Visibility, {}) }) }), jsx$1(Grid$1, { size: 1, children: jsx$1(ChannelColorPickerMenu, { theme, color: getDefaultColor(theme), setColor: null, isStaticColor: true, isColormap: false, visible: true }) }), jsx$1(Grid$1, { size: 6, children: jsx$1(Typography, { className: menuClasses.imageLayerName, children: "Unselected" }) }), jsx$1(Grid$1, { size: 2, sx: { paddingRight: "12px", overflow: "visible" }, children: jsx$1(Slider, { value: spatialLayerOpacityUnselected ?? 0.25, min: 0, max: 1, step: 1e-3, onChange: handleUnselectedOpacityChange, className: menuClasses.imageLayerOpacitySlider, orientation: "horizontal", "aria-label": "Adjust opacity for unselected layer" }) }), jsx$1(Grid$1, { size: 1, children: jsx$1(SvgPoints, { className: classes2.layerTypePointIcon }) })] }) }) })] }) : null] });
|
|
272123
272367
|
}
|
|
272124
|
-
const useStyles$
|
|
272368
|
+
const useStyles$e = makeStyles()(() => ({
|
|
272125
272369
|
// Cap the channel name's width; imageLayerName ellipsizes the overflow.
|
|
272126
272370
|
channelName: {
|
|
272127
272371
|
overflow: "hidden",
|
|
@@ -272140,7 +272384,7 @@ const useStyles$f = makeStyles()(() => ({
|
|
|
272140
272384
|
function SegmentationChannelEllipsisMenu(props) {
|
|
272141
272385
|
const { obsType, featureType, featureValueType, strokeWidth, setStrokeWidth, filled, setFilled, featureSelection, obsColorEncoding, setObsColorEncoding, featureValueColormap, setFeatureValueColormap, featureValueColormapRange, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible } = props;
|
|
272142
272386
|
const [open2, setOpen] = useState(false);
|
|
272143
|
-
const { classes: classes2 } = useStyles$
|
|
272387
|
+
const { classes: classes2 } = useStyles$e();
|
|
272144
272388
|
const { classes: selectClasses2 } = useSelectStyles();
|
|
272145
272389
|
const { classes: menuClasses } = useEllipsisMenuStyles();
|
|
272146
272390
|
const filledId = $bdb11010cef70236$export$f680877a34711e37();
|
|
@@ -272154,12 +272398,13 @@ function SegmentationChannelEllipsisMenu(props) {
|
|
|
272154
272398
|
return jsxs(PopperMenu, { open: open2, setOpen, buttonIcon: jsx$1(MoreVertIcon, {}), buttonClassName: menuClasses.imageLayerMenuButton, containerClassName: menuClasses.imageLayerPopperContainer, withPaper: true, "aria-label": "Open segmentation channel options menu", children: [jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: filledId, children: "Filled: " }), jsx$1(Checkbox$1, { color: "primary", className: menuClasses.menuItemCheckbox, checked: filled, onChange: (e3, v) => setFilled(v), slotProps: { input: { id: filledId, "aria-label": "Toggle between filled and stroked segmentations" } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: strokeWidthId, children: "Stroke Width:" }), jsx$1(Slider, { disabled: filled, value: strokeWidth, min: 0.01, max: 5, step: 0.01, onChange: (e3, v) => setStrokeWidth(v), className: menuClasses.menuItemSlider, orientation: "horizontal", id: strokeWidthId, "aria-label": "Stroke width slider" })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: colorEncodingId, children: "Color Encoding: " }), jsxs(NativeSelect, { onChange: (e3) => setObsColorEncoding(e3.target.value), value: obsColorEncoding, inputProps: { id: colorEncodingId, "aria-label": "Color encoding selector" }, classes: { root: selectClasses2.selectRoot }, children: [jsx$1("option", { value: "spatialChannelColor", children: "Static Color" }), jsx$1("option", { value: "geneSelection", children: "Feature Value" }), jsx$1("option", { value: "cellSetSelection", children: "Set Selection" }), jsx$1("option", { value: "obsColors", children: "Per-observation Colors" })] })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: quantitativeColormapId, children: "Colormap: " }), jsx$1(NativeSelect, { onChange: (e3) => setFeatureValueColormap(e3.target.value), value: featureValueColormap, inputProps: { id: quantitativeColormapId, "aria-label": "Colormap selector" }, classes: { root: selectClasses2.selectRoot }, children: GLSL_COLORMAPS.map((cmap) => jsx$1("option", { value: cmap, children: cmap }, cmap)) })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: colormapRangeId, children: "Colormap Range: " }), jsx$1(Slider, { disabled: obsColorEncoding !== "geneSelection", value: featureValueColormapRange, min: 0, max: 1, step: 0.01, onChange: (e3, v) => setFeatureValueColormapRange(v), className: menuClasses.menuItemSlider, orientation: "horizontal", id: colormapRangeId, getAriaLabel: (index2) => index2 === 0 ? "Low value colormap range slider" : "High value colormap range slider" })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: tooltipsVisibleId, children: "Tooltips Visible: " }), jsx$1(Checkbox$1, { color: "primary", className: menuClasses.menuItemCheckbox, checked: tooltipsVisible, onChange: (e3, v) => setTooltipsVisible(v), slotProps: { input: { id: tooltipsVisibleId, "aria-label": "Toggle tooltip visibility" } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: crosshairsVisibleId, children: "Tooltip Crosshairs Visible: " }), jsx$1(Checkbox$1, { color: "primary", className: menuClasses.menuItemCheckbox, checked: tooltipCrosshairsVisible, onChange: (e3, v) => setTooltipCrosshairsVisible(v), slotProps: { input: { id: crosshairsVisibleId, "aria-label": "Toggle tooltip crosshair visibility" } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: legendVisibleId, children: "Legend Visible: " }), jsx$1(Checkbox$1, { color: "primary", className: menuClasses.menuItemCheckbox, checked: legendVisible, onChange: (e3, v) => setLegendVisible(v), slotProps: { input: { id: legendVisibleId, "aria-label": "Toggle legend visibility" } } })] })] });
|
|
272155
272399
|
}
|
|
272156
272400
|
function SegmentationChannelController(props) {
|
|
272157
|
-
const { label: label2, theme, obsType, featureType, featureValueType, opacity: opacity2, setOpacity: setOpacity2, visible, setVisible, color: color2, setColor: setColor2, palette = null, filled, setFilled, strokeWidth, setStrokeWidth, featureSelection, obsColorEncoding, featureValueColormap, featureValueColormapRange, setObsColorEncoding, setFeatureValueColormap, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible } = props;
|
|
272401
|
+
const { label: label2, theme, obsType, featureType, featureValueType, opacity: opacity2, setOpacity: setOpacity2, visible, setVisible, color: color2, setColor: setColor2, palette = null, filled, setFilled, strokeWidth, setStrokeWidth, featureSelection, featureAggregationStrategy, setFeatureAggregationStrategy, obsColorEncoding, featureValueColormap, featureValueColormapRange, setObsColorEncoding, setFeatureValueColormap, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible } = props;
|
|
272158
272402
|
const visibleSetting = typeof visible === "boolean" ? visible : true;
|
|
272159
272403
|
const Visibility$1 = useMemo$1(() => visibleSetting ? Visibility : VisibilityOff, [visibleSetting]);
|
|
272160
272404
|
const isStaticColor = obsColorEncoding === "spatialChannelColor";
|
|
272161
272405
|
const isColormap = obsColorEncoding === "geneSelection";
|
|
272162
|
-
const
|
|
272406
|
+
const hasMultipleFeaturesSelected = Array.isArray(featureSelection) && featureSelection.length > 1;
|
|
272407
|
+
const { classes: classes2 } = useStyles$e();
|
|
272163
272408
|
const { classes: lcClasses } = useControllerSectionStyles();
|
|
272164
272409
|
const { classes: menuClasses } = useEllipsisMenuStyles();
|
|
272165
272410
|
const handleVisibleChange = useCallback(() => {
|
|
@@ -272167,9 +272412,9 @@ function SegmentationChannelController(props) {
|
|
|
272167
272412
|
setVisible(nextVisible);
|
|
272168
272413
|
}, [visible, setVisible]);
|
|
272169
272414
|
const handleOpacityChange = useCallback((e3, v) => setOpacity2(v), [setOpacity2]);
|
|
272170
|
-
return jsx$1(Grid$1, { className: lcClasses.layerControllerGrid, children: jsx$1(Paper, { elevation: 4, className: lcClasses.layerControllerRoot, children: jsxs(Grid$1, { container: true, direction: "row", sx: [{
|
|
272415
|
+
return jsxs(Fragment, { children: [jsx$1(Grid$1, { className: lcClasses.layerControllerGrid, children: jsx$1(Paper, { elevation: 4, className: lcClasses.layerControllerRoot, children: jsxs(Grid$1, { container: true, direction: "row", sx: [{
|
|
272171
272416
|
justifyContent: "space-between"
|
|
272172
|
-
}, channelRowContainerSx], children: [jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(Button, { onClick: handleVisibleChange, className: menuClasses.imageLayerVisibleButton, "aria-label": "Toggle channel visibility", children: jsx$1(Visibility$1, {}) }) }), jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(ChannelColorPickerMenu, { theme, color: color2, setColor: setColor2, palette, isStaticColor, isColormap, featureValueColormap, visible }) }), jsx$1(Grid$1, { size: 6, sx: channelSelectorCellSx, children: jsx$1(Typography, { className: clsx(menuClasses.imageLayerName, classes2.channelName), title: capitalize$3(label2), children: capitalize$3(label2) }) }), jsx$1(Grid$1, { size: 2, sx: channelSliderCellSx, children: jsx$1(Slider, { value: opacity2, min: 0, max: 1, step: 1e-3, onChange: handleOpacityChange, className: menuClasses.imageLayerOpacitySlider, orientation: "horizontal", "aria-label": `Adjust opacity for layer ${label2}` }) }), jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(SegmentationChannelEllipsisMenu, { obsType, featureType, featureValueType, strokeWidth, setStrokeWidth, filled, setFilled, featureSelection, obsColorEncoding, setObsColorEncoding, featureValueColormap, setFeatureValueColormap, featureValueColormapRange, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible }) }), jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(SvgVector, { className: classes2.layerTypeSegmentationIcon }) })] }) }) });
|
|
272417
|
+
}, channelRowContainerSx], children: [jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(Button, { onClick: handleVisibleChange, className: menuClasses.imageLayerVisibleButton, "aria-label": "Toggle channel visibility", children: jsx$1(Visibility$1, {}) }) }), jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(ChannelColorPickerMenu, { theme, color: color2, setColor: setColor2, palette, isStaticColor, isColormap, featureValueColormap, visible }) }), jsx$1(Grid$1, { size: 6, sx: channelSelectorCellSx, children: jsx$1(Typography, { className: clsx(menuClasses.imageLayerName, classes2.channelName), title: capitalize$3(label2), children: capitalize$3(label2) }) }), jsx$1(Grid$1, { size: 2, sx: channelSliderCellSx, children: jsx$1(Slider, { value: opacity2, min: 0, max: 1, step: 1e-3, onChange: handleOpacityChange, className: menuClasses.imageLayerOpacitySlider, orientation: "horizontal", "aria-label": `Adjust opacity for layer ${label2}` }) }), jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(SegmentationChannelEllipsisMenu, { obsType, featureType, featureValueType, strokeWidth, setStrokeWidth, filled, setFilled, featureSelection, obsColorEncoding, setObsColorEncoding, featureValueColormap, setFeatureValueColormap, featureValueColormapRange, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible }) }), jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(SvgVector, { className: classes2.layerTypeSegmentationIcon }) })] }) }) }), isColormap && hasMultipleFeaturesSelected ? jsx$1(SingleFeatureSelect, { featureSelection, featureAggregationStrategy, setFeatureAggregationStrategy }) : null] });
|
|
272173
272418
|
}
|
|
272174
272419
|
function SegmentationLayerController(props) {
|
|
272175
272420
|
const { theme, layerScope, layerCoordination, setLayerCoordination, channelScopes, channelCoordination, setChannelCoordination } = props;
|
|
@@ -272177,10 +272422,10 @@ function SegmentationLayerController(props) {
|
|
|
272177
272422
|
const { setSpatialLayerVisible, setSpatialLayerOpacity } = setLayerCoordination;
|
|
272178
272423
|
const reversedChannelScopes = useMemo$1(() => [...channelScopes || []].reverse(), [channelScopes]);
|
|
272179
272424
|
return jsx$1(Fragment, { children: reversedChannelScopes.map((cScope) => {
|
|
272180
|
-
const { obsType, featureType, featureValueType, spatialChannelVisible, spatialChannelOpacity, spatialChannelColor: color2, spatialSegmentationFilled: filled, spatialSegmentationStrokeWidth: strokeWidth, obsColorEncoding, featureSelection, featureValueColormap, featureValueColormapRange, tooltipsVisible, tooltipCrosshairsVisible, legendVisible } = channelCoordination[cScope];
|
|
272181
|
-
const { setSpatialChannelVisible, setSpatialChannelOpacity, setSpatialChannelColor: setColor2, setSpatialSegmentationFilled: setFilled, setSpatialSegmentationStrokeWidth: setStrokeWidth, setObsColorEncoding, setFeatureValueColormap, setFeatureValueColormapRange, setTooltipsVisible, setTooltipCrosshairsVisible, setLegendVisible } = setChannelCoordination[cScope];
|
|
272425
|
+
const { obsType, featureType, featureValueType, spatialChannelVisible, spatialChannelOpacity, spatialChannelColor: color2, spatialSegmentationFilled: filled, spatialSegmentationStrokeWidth: strokeWidth, obsColorEncoding, featureSelection, featureAggregationStrategy, featureValueColormap, featureValueColormapRange, tooltipsVisible, tooltipCrosshairsVisible, legendVisible } = channelCoordination[cScope];
|
|
272426
|
+
const { setSpatialChannelVisible, setSpatialChannelOpacity, setSpatialChannelColor: setColor2, setSpatialSegmentationFilled: setFilled, setSpatialSegmentationStrokeWidth: setStrokeWidth, setObsColorEncoding, setFeatureAggregationStrategy, setFeatureValueColormap, setFeatureValueColormapRange, setTooltipsVisible, setTooltipCrosshairsVisible, setLegendVisible } = setChannelCoordination[cScope];
|
|
272182
272427
|
const obsTypeName = spatialLayerLabel ?? obsType;
|
|
272183
|
-
return jsx$1(SegmentationChannelController, { theme, layerScope, label: obsTypeName, obsType, featureType, featureValueType, opacity: spatialChannelOpacity, setOpacity: setSpatialChannelOpacity, visible: spatialChannelVisible, setVisible: setSpatialChannelVisible, color: color2, setColor: setColor2, filled, setFilled, strokeWidth, setStrokeWidth, obsColorEncoding, featureSelection, featureValueColormap, featureValueColormapRange, setObsColorEncoding, setFeatureValueColormap, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible }, `${layerScope}-${cScope}`);
|
|
272428
|
+
return jsx$1(SegmentationChannelController, { theme, layerScope, label: obsTypeName, obsType, featureType, featureValueType, opacity: spatialChannelOpacity, setOpacity: setSpatialChannelOpacity, visible: spatialChannelVisible, setVisible: setSpatialChannelVisible, color: color2, setColor: setColor2, filled, setFilled, strokeWidth, setStrokeWidth, obsColorEncoding, featureSelection, featureAggregationStrategy, setFeatureAggregationStrategy, featureValueColormap, featureValueColormapRange, setObsColorEncoding, setFeatureValueColormap, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible }, `${layerScope}-${cScope}`);
|
|
272184
272429
|
}) });
|
|
272185
272430
|
}
|
|
272186
272431
|
var Subscribable = class {
|
|
@@ -273402,7 +273647,7 @@ function useBaseQuery(options, Observer, queryClient) {
|
|
|
273402
273647
|
function useQuery(options, queryClient) {
|
|
273403
273648
|
return useBaseQuery(options, QueryObserver);
|
|
273404
273649
|
}
|
|
273405
|
-
const useStyles$
|
|
273650
|
+
const useStyles$d = makeStyles()(() => ({
|
|
273406
273651
|
channelMenuButton: {
|
|
273407
273652
|
backgroundColor: "transparent",
|
|
273408
273653
|
padding: "3px 0",
|
|
@@ -273416,7 +273661,7 @@ const useStyles$e = makeStyles()(() => ({
|
|
|
273416
273661
|
function ChannelOptions(props) {
|
|
273417
273662
|
const { onRemove: onRemove2, onResetWindowUsingIQR, showValueExtent, setShowValueExtent, numResolutions, spatialMaxResolution, setSpatialMaxResolution } = props;
|
|
273418
273663
|
const [open2, setOpen] = useState(false);
|
|
273419
|
-
const { classes: classes2 } = useStyles$
|
|
273664
|
+
const { classes: classes2 } = useStyles$d();
|
|
273420
273665
|
const { classes: selectClasses2 } = useSelectStyles();
|
|
273421
273666
|
const { classes: menuClasses } = useEllipsisMenuStyles();
|
|
273422
273667
|
function handleRemove() {
|
|
@@ -273429,7 +273674,7 @@ function ChannelOptions(props) {
|
|
|
273429
273674
|
const domainTypeId = $bdb11010cef70236$export$f680877a34711e37();
|
|
273430
273675
|
return jsxs(PopperMenu, { open: open2, setOpen, buttonIcon: jsx$1(MoreVertIcon, { fontSize: "small" }), buttonClassName: classes2.channelMenuButton, containerClassName: menuClasses.imageLayerPopperContainer, placement: "bottom-end", withPaper: true, "aria-label": "Open channel options menu", children: [jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: domainTypeId, children: "Best Resolution: " }), jsx$1(Slider, { value: spatialMaxResolution || 1, valueLabelDisplay: "auto", onChange: (e3, v) => setSpatialMaxResolution(v), min: 1, max: numResolutions - 1, step: 1, orientation: "horizontal" })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: domainTypeId, children: "Slider Extent: " }), jsxs(NativeSelect, { onChange: handleDomainTypeChange, value: showValueExtent ? "Value Min/Max" : "Dtype Min/Max", inputProps: { id: domainTypeId, "aria-label": "Slider extent selector" }, classes: { root: selectClasses2.selectRoot }, children: [jsx$1("option", { value: "Value Min/Max", children: "Value Min/Max" }), jsx$1("option", { value: "Dtype Min/Max", children: "Dtype Min/Max" })] })] }), jsx$1(MenuItem, { dense: true, disableGutters: true, component: "button", onClick: onResetWindowUsingIQR, className: classes2.menuItemButton, "aria-label": "Click to use IQR for channel", children: "Reset window using IQR" }), jsx$1(MenuItem, { dense: true, disableGutters: true, component: "button", onClick: handleRemove, className: classes2.menuItemButton, "aria-label": "Click to remove channel", children: "Remove channel" })] });
|
|
273431
273676
|
}
|
|
273432
|
-
const useStyles$
|
|
273677
|
+
const useStyles$c = makeStyles()(() => ({
|
|
273433
273678
|
channelSlider: {
|
|
273434
273679
|
marginTop: "7px"
|
|
273435
273680
|
}
|
|
@@ -273439,7 +273684,7 @@ function ChannelSlider(props) {
|
|
|
273439
273684
|
const rgbColor = toRgbUIString(colormapOn, color2, theme);
|
|
273440
273685
|
const dtype = image2?.getDtype();
|
|
273441
273686
|
const fullDomain = dtype ? DOMAINS[dtype] : [0, 0];
|
|
273442
|
-
const { classes: classes2 } = useStyles$
|
|
273687
|
+
const { classes: classes2 } = useStyles$c();
|
|
273443
273688
|
useEffect(() => {
|
|
273444
273689
|
if (!window2 && !disabled && Array.isArray(minMaxDomain?.upperThreeQuarters)) {
|
|
273445
273690
|
setWindow2(minMaxDomain?.upperThreeQuarters);
|
|
@@ -273454,7 +273699,7 @@ function ChannelSlider(props) {
|
|
|
273454
273699
|
return `${labelPrefix} for ${rgbColor} colormap channel`;
|
|
273455
273700
|
}, getAriaValueText: () => `Current colormap values: ${rgbColor}-${window2}`, min: min2, max: max2, step, orientation: "horizontal", className: classes2.channelSlider, style: { color: rgbColor }, disabled });
|
|
273456
273701
|
}
|
|
273457
|
-
const useStyles$
|
|
273702
|
+
const useStyles$b = makeStyles()(() => ({
|
|
273458
273703
|
visibilityCheckbox: {
|
|
273459
273704
|
padding: "10px 0"
|
|
273460
273705
|
}
|
|
@@ -273468,10 +273713,10 @@ function getCheckboxColor(colormapOn, color2, theme) {
|
|
|
273468
273713
|
function ChannelVisibilityCheckbox(props) {
|
|
273469
273714
|
const { color: color2, visible, setVisible, disabled, theme, colormapOn } = props;
|
|
273470
273715
|
const rgbColor = getCheckboxColor(colormapOn, color2, theme);
|
|
273471
|
-
const { classes: classes2 } = useStyles$
|
|
273716
|
+
const { classes: classes2 } = useStyles$b();
|
|
273472
273717
|
return jsx$1(Checkbox$1, { onChange: (e3, v) => setVisible(v), checked: visible, disabled, className: classes2.visibilityCheckbox, style: { color: rgbColor, "&$checked": { color: rgbColor } }, slotProps: { input: { "aria-label": "Toggle channel visibility" } } });
|
|
273473
273718
|
}
|
|
273474
|
-
const useStyles$
|
|
273719
|
+
const useStyles$a = makeStyles()(() => ({
|
|
273475
273720
|
oneLineChannelSelect: {
|
|
273476
273721
|
width: "90%",
|
|
273477
273722
|
marginLeft: "5%",
|
|
@@ -273480,21 +273725,13 @@ const useStyles$b = makeStyles()(() => ({
|
|
|
273480
273725
|
}));
|
|
273481
273726
|
function ChannelSelectionDropdown(props) {
|
|
273482
273727
|
const { featureIndex, channelsSortOrder, targetC, setTargetC, setWindow: setWindow2, disabled } = props;
|
|
273483
|
-
const { classes: classes2 } = useStyles$
|
|
273728
|
+
const { classes: classes2 } = useStyles$a();
|
|
273484
273729
|
const { classes: selectClasses2 } = useSelectStyles();
|
|
273485
273730
|
function handleChange(event2) {
|
|
273486
273731
|
setTargetC(event2.target.value === "" ? null : Number(event2.target.value));
|
|
273487
273732
|
setWindow2(null);
|
|
273488
273733
|
}
|
|
273489
|
-
const sortedOptions = useMemo$1(() =>
|
|
273490
|
-
if (!Array.isArray(featureIndex))
|
|
273491
|
-
return [];
|
|
273492
|
-
const options = featureIndex.map((channelName, channelIndex) => ({ channelName, channelIndex }));
|
|
273493
|
-
if (channelsSortOrder === "alphabetical") {
|
|
273494
|
-
return options.sort((a2, b2) => a2.channelName.localeCompare(b2.channelName, void 0, { numeric: true, sensitivity: "base" }));
|
|
273495
|
-
}
|
|
273496
|
-
return options;
|
|
273497
|
-
}, [featureIndex, channelsSortOrder]);
|
|
273734
|
+
const sortedOptions = useMemo$1(() => getSortedChannelOptions(featureIndex, channelsSortOrder), [featureIndex, channelsSortOrder]);
|
|
273498
273735
|
return Array.isArray(featureIndex) ? jsx$1(NativeSelect, { classes: { root: selectClasses2.selectRoot }, className: classes2.oneLineChannelSelect, value: targetC === null ? "" : targetC, onChange: handleChange, inputProps: { "aria-label": "Channel selector" }, children: sortedOptions.map(({ channelName, channelIndex }) => jsx$1("option", { disabled, value: channelIndex, children: channelName }, `${channelName}-${channelIndex}`)) }) : null;
|
|
273499
273736
|
}
|
|
273500
273737
|
function ImageChannelController(props) {
|
|
@@ -273642,7 +273879,7 @@ function LoadingStatusIndicator(props) {
|
|
|
273642
273879
|
mb: 0.5
|
|
273643
273880
|
}, children: jsx$1(LinearProgress, { variant: "determinate", value: percentage }) })] });
|
|
273644
273881
|
}
|
|
273645
|
-
const useStyles$
|
|
273882
|
+
const useStyles$9 = makeStyles()(() => ({
|
|
273646
273883
|
imageLayerButton: {
|
|
273647
273884
|
borderStyle: "dashed",
|
|
273648
273885
|
marginTop: "10px",
|
|
@@ -273744,7 +273981,7 @@ function ImageLayerEllipsisMenu(props) {
|
|
|
273744
273981
|
...lodSliderRangeConfig,
|
|
273745
273982
|
inputMode: "numeric",
|
|
273746
273983
|
pattern: "[0-9]*"
|
|
273747
|
-
} })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: colormapId, children: "Colormap: " }), jsxs(NativeSelect, { disabled: photometricInterpretation === "RGB", onChange: handleColormapChange, value: colormap === null ? "" : colormap, inputProps: { id: colormapId, "aria-label": "Colormap selector" }, classes: { root: selectClasses2.selectRoot }, children: [jsx$1("option", { "aria-label": "None", value: "", children: "None" }), COLORMAP_OPTIONS.map((name2) => jsx$1("option", { value: name2, children: name2 }, name2))] })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: interpretationId, children: "Photometric Interpretation: " }), jsxs(NativeSelect, { onChange: handleInterpretationChange, value: photometricInterpretation, inputProps: { id: interpretationId, "aria-label": "Photometric interpretation selector" }, classes: { root: selectClasses2.selectRoot }, children: [jsx$1("option", { "aria-label": "RGB", value: "RGB", children: "RGB" }), channelScopes.length > 0 ? jsx$1("option", { "aria-label": "BlackIsZero", value: "BlackIsZero", children: "BlackIsZero" }) : null] })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: transparentId, children: "Zero Transparent: " }), jsx$1(Checkbox$1, { color: "primary", checked: spatialLayerTransparentColor !== null, onChange: (e3, v) => setSpatialLayerTransparentColor(v ? [0, 0, 0] : null), slotProps: { input: { id: transparentId, "aria-label": "Render zero-value pixels as transparent" } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: volumetricId, children: "Volumetric Rendering: " }), jsxs(NativeSelect, { onChange: handleVolumetricChange, value: volumetricRenderingAlgorithm, inputProps: { id: volumetricId, "aria-label": "Volumetric rendering algorithm selector" }, classes: { root: selectClasses2.selectRoot }, disabled: !is3dMode, children: [jsx$1("option", { "aria-label": "Additive", value: "additive", children: "Additive" }), jsx$1("option", { "aria-label": "Maximum Intensity Projection", value: "maximumIntensityProjection", children: "Maximum Intensity Projection" })] })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: resolutionId, children: "Volume Resolution: " }), jsxs(NativeSelect, { disabled: !is3dMode || !isMultiResolution, onChange: handleResolutionChange, value: spatialTargetResolution === null ? "auto" : spatialTargetResolution, inputProps: { id: resolutionId, "aria-label": "Volumetric resolution selector" }, classes: { root: selectClasses2.selectRoot }, children: [jsx$1("option", { value: "auto", children: "Auto" }), Array.isArray(multiResolutionStats) ? multiResolutionStats.map((stats, resolution) => stats.canLoad ? jsx$1("option", { value: resolution, children: `3D: ${resolution}x Downsampled, ~${formatBytes(stats.totalBytes)} per channel, (${stats.height}, ${stats.width}, ${stats.depthDownsampled})` }, `(${stats.height}, ${stats.width}, ${stats.depthDownsampled})`) : null) : null] })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: tooltipsVisibleId, children: "Tooltips Visible: " }), jsx$1(Checkbox$1, { color: "primary", checked: tooltipsVisible, onChange: (e3, v) => setTooltipsVisible(v), slotProps: { input: { id: tooltipsVisibleId, "aria-label": "Render pixel value tooltips" } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: channelLabelsVisibleId, children: "Channel Labels Visible: " }), jsx$1(Checkbox$1, { disabled: photometricInterpretation === "RGB", color: "primary", checked: channelLabelsVisible, onChange: (e3, v) => setChannelLabelsVisible(v), slotProps: { input: { id: channelLabelsVisibleId, "aria-label": "Render channel labels" } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: channelLabelsOrientationId, children: "Channel Labels Orientation: " }), jsxs(NativeSelect, { disabled: photometricInterpretation === "RGB", onChange: handleChannelLabelsOrientationChange, value: channelLabelsOrientation, inputProps: { id: channelLabelsOrientationId, "aria-label": "Channel labels orientation selector" }, classes: { root: selectClasses2.selectRoot }, children: [jsx$1("option", { "aria-label": "Vertical", value: "vertical", children: "Vertical" }), jsx$1("option", { "aria-label": "Horizontal", value: "horizontal", children: "Horizontal" })] })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: channelLabelSizeId, children: "Channel Labels Size: " }), jsx$1(Slider, { disabled: photometricInterpretation === "RGB", value: channelLabelSize, min: 8, max: 36, step: 1, onChange: (e3, v) => setChannelLabelSize(v), className: menuClasses.menuItemSlider, orientation: "horizontal", id: channelLabelSizeId, "aria-label": "Channel labels text size slider" })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: channelsSortOrderId, children: "Channel Ordering: " }),
|
|
273984
|
+
} })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: colormapId, children: "Colormap: " }), jsxs(NativeSelect, { disabled: photometricInterpretation === "RGB", onChange: handleColormapChange, value: colormap === null ? "" : colormap, inputProps: { id: colormapId, "aria-label": "Colormap selector" }, classes: { root: selectClasses2.selectRoot }, children: [jsx$1("option", { "aria-label": "None", value: "", children: "None" }), COLORMAP_OPTIONS.map((name2) => jsx$1("option", { value: name2, children: name2 }, name2))] })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: interpretationId, children: "Photometric Interpretation: " }), jsxs(NativeSelect, { onChange: handleInterpretationChange, value: photometricInterpretation, inputProps: { id: interpretationId, "aria-label": "Photometric interpretation selector" }, classes: { root: selectClasses2.selectRoot }, children: [jsx$1("option", { "aria-label": "RGB", value: "RGB", children: "RGB" }), channelScopes.length > 0 ? jsx$1("option", { "aria-label": "BlackIsZero", value: "BlackIsZero", children: "BlackIsZero" }) : null] })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: transparentId, children: "Zero Transparent: " }), jsx$1(Checkbox$1, { color: "primary", checked: spatialLayerTransparentColor !== null, onChange: (e3, v) => setSpatialLayerTransparentColor(v ? [0, 0, 0] : null), slotProps: { input: { id: transparentId, "aria-label": "Render zero-value pixels as transparent" } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: volumetricId, children: "Volumetric Rendering: " }), jsxs(NativeSelect, { onChange: handleVolumetricChange, value: volumetricRenderingAlgorithm, inputProps: { id: volumetricId, "aria-label": "Volumetric rendering algorithm selector" }, classes: { root: selectClasses2.selectRoot }, disabled: !is3dMode, children: [jsx$1("option", { "aria-label": "Additive", value: "additive", children: "Additive" }), jsx$1("option", { "aria-label": "Maximum Intensity Projection", value: "maximumIntensityProjection", children: "Maximum Intensity Projection" })] })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: resolutionId, children: "Volume Resolution: " }), jsxs(NativeSelect, { disabled: !is3dMode || !isMultiResolution, onChange: handleResolutionChange, value: spatialTargetResolution === null ? "auto" : spatialTargetResolution, inputProps: { id: resolutionId, "aria-label": "Volumetric resolution selector" }, classes: { root: selectClasses2.selectRoot }, children: [jsx$1("option", { value: "auto", children: "Auto" }), Array.isArray(multiResolutionStats) ? multiResolutionStats.map((stats, resolution) => stats.canLoad ? jsx$1("option", { value: resolution, children: `3D: ${resolution}x Downsampled, ~${formatBytes(stats.totalBytes)} per channel, (${stats.height}, ${stats.width}, ${stats.depthDownsampled})` }, `(${stats.height}, ${stats.width}, ${stats.depthDownsampled})`) : null) : null] })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: tooltipsVisibleId, children: "Tooltips Visible: " }), jsx$1(Checkbox$1, { color: "primary", checked: tooltipsVisible, onChange: (e3, v) => setTooltipsVisible(v), slotProps: { input: { id: tooltipsVisibleId, "aria-label": "Render pixel value tooltips" } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: channelLabelsVisibleId, children: "Channel Labels Visible: " }), jsx$1(Checkbox$1, { disabled: photometricInterpretation === "RGB", color: "primary", checked: channelLabelsVisible, onChange: (e3, v) => setChannelLabelsVisible(v), slotProps: { input: { id: channelLabelsVisibleId, "aria-label": "Render channel labels" } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: channelLabelsOrientationId, children: "Channel Labels Orientation: " }), jsxs(NativeSelect, { disabled: photometricInterpretation === "RGB", onChange: handleChannelLabelsOrientationChange, value: channelLabelsOrientation, inputProps: { id: channelLabelsOrientationId, "aria-label": "Channel labels orientation selector" }, classes: { root: selectClasses2.selectRoot }, children: [jsx$1("option", { "aria-label": "Vertical", value: "vertical", children: "Vertical" }), jsx$1("option", { "aria-label": "Horizontal", value: "horizontal", children: "Horizontal" })] })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: channelLabelSizeId, children: "Channel Labels Size: " }), jsx$1(Slider, { disabled: photometricInterpretation === "RGB", value: channelLabelSize, min: 8, max: 36, step: 1, onChange: (e3, v) => setChannelLabelSize(v), className: menuClasses.menuItemSlider, orientation: "horizontal", id: channelLabelSizeId, "aria-label": "Channel labels text size slider" })] }), jsxs(MenuItem, { dense: true, disableGutters: true, classes: menuClasses.menuItem, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: channelsSortOrderId, children: "Channel Ordering: " }), jsx$1(NativeSelect, { onChange: handleChannelsSortOrderChange, value: channelsSortOrder, inputProps: { id: channelsSortOrderId, "aria-label": "Channel sort order selector" }, classes: { root: selectClasses2.selectRoot }, children: CHANNELS_SORT_ORDER_OPTIONS.map(({ value: value2, label: label2 }) => jsx$1("option", { "aria-label": label2, value: value2, children: label2 }, value2)) })] })] });
|
|
273748
273985
|
}
|
|
273749
273986
|
function ImageLayerController(props) {
|
|
273750
273987
|
const {
|
|
@@ -273787,7 +274024,7 @@ function ImageLayerController(props) {
|
|
|
273787
274024
|
}, [visible, setVisible]);
|
|
273788
274025
|
const handleOpacityChange = useCallback((e3, v) => setOpacity2(v), [setOpacity2]);
|
|
273789
274026
|
const handleOpenChange = useCallback(() => setOpen((prev2) => !prev2), []);
|
|
273790
|
-
const { classes: classes2 } = useStyles$
|
|
274027
|
+
const { classes: classes2 } = useStyles$9();
|
|
273791
274028
|
const { classes: menuClasses } = useEllipsisMenuStyles();
|
|
273792
274029
|
const { classes: controllerSectionClasses } = useControllerSectionStyles();
|
|
273793
274030
|
const isMultiChannel = photometricInterpretation !== "RGB";
|
|
@@ -273807,7 +274044,7 @@ function ImageLayerController(props) {
|
|
|
273807
274044
|
justifyContent: "space-between"
|
|
273808
274045
|
}, children: [jsx$1(Typography, { className: classes2.clippingPanesLabel, children: "Clipping planes:" }), jsx$1(Grid$1, { size: 12, className: classes2.clippingSliders, children: jsx$1(ClippingSliders, { image: image2, spatialSliceX, spatialSliceY, spatialSliceZ, setSpatialSliceX, setSpatialSliceY, setSpatialSliceZ }) }), jsx$1(LoadingStatusIndicator, { loadingProgress: volumeLoadingProgress, onStopLoading: onStopVolumeLoading, onRestartLoading: onRestartVolumeLoading, stillRef: volumeStillRef, spatialRenderingMode })] }) : null] }) });
|
|
273809
274046
|
}
|
|
273810
|
-
const useStyles$
|
|
274047
|
+
const useStyles$8 = makeStyles()((theme) => ({
|
|
273811
274048
|
dimensionsIcon: {
|
|
273812
274049
|
height: "40px",
|
|
273813
274050
|
width: "40px",
|
|
@@ -273831,7 +274068,7 @@ const useStyles$9 = makeStyles()((theme) => ({
|
|
|
273831
274068
|
function GlobalDimensionSlider(props) {
|
|
273832
274069
|
const { label: label2, targetValue, setTargetValue, min: min2 = 0, max: max2 = 0, spatialRenderingMode = null, setSpatialRenderingMode = null, enable3d = true } = props;
|
|
273833
274070
|
const { classes: lcClasses } = useControllerSectionStyles();
|
|
273834
|
-
const { classes: classes2 } = useStyles$
|
|
274071
|
+
const { classes: classes2 } = useStyles$8();
|
|
273835
274072
|
const isForZ = spatialRenderingMode !== null;
|
|
273836
274073
|
const is3dMode = spatialRenderingMode === "3D";
|
|
273837
274074
|
function handleRenderingModeChange(event2) {
|
|
@@ -273842,127 +274079,27 @@ function GlobalDimensionSlider(props) {
|
|
|
273842
274079
|
}
|
|
273843
274080
|
return jsx$1(Grid$1, { className: lcClasses.layerControllerGrid, children: jsx$1(Paper, { elevation: 4, className: lcClasses.layerControllerRoot, children: jsxs(Grid$1, { container: true, direction: "row", sx: [{
|
|
273844
274081
|
justifyContent: "space-between"
|
|
273845
|
-
}, channelRowContainerSx], children: [jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(SvgDimensions, { className: classes2.dimensionsIcon }) }), jsx$1(Grid$1, { size: 1, sx: channelSelectorCellSx, children: jsx$1(Typography, { className: classes2.dimensionLabel, children: label2 }) }), jsx$1(Grid$1, { size: 8, sx: channelSliderCellSx, children: !is3dMode ? jsx$1(Slider, { value: targetValue, min: min2, max: max2, step: 1, onChange: (e3, v) => setTargetValue(v), className: classes2.dimensionSlider, valueLabelDisplay: "auto", orientation: "horizontal", disabled: spatialRenderingMode === "3D", "aria-label": `${label2}-slice slider` }) : null }), jsx$1(Grid$1, { size: 2, sx: channelControlCellSx, children: isForZ && enable3d ? jsx$1(FormGroup, { row: true, className: classes2.switchFormGroup, children: jsx$1(FormControlLabel$1, { control: jsx$1(Switch, { color: "primary", checked: spatialRenderingMode === "3D", onChange: handleRenderingModeChange, name: "is3dMode" }), label: "3D" }) }) : null })] }) }) });
|
|
273846
|
-
}
|
|
273847
|
-
const useStyles$8 = makeStyles()(() => ({
|
|
273848
|
-
layerTypeCentroidSegmentationIcon: {
|
|
273849
|
-
height: "100%",
|
|
273850
|
-
marginLeft: "1px",
|
|
273851
|
-
fill: "currentColor",
|
|
273852
|
-
fontSize: "24px",
|
|
273853
|
-
width: "50%",
|
|
273854
|
-
maxWidth: "24px"
|
|
273855
|
-
},
|
|
273856
|
-
divider: {
|
|
273857
|
-
width: "1px",
|
|
273858
|
-
height: "20px",
|
|
273859
|
-
background: "currentColor",
|
|
273860
|
-
flexShrink: 0,
|
|
273861
|
-
margin: "0 10px"
|
|
273862
|
-
},
|
|
273863
|
-
inlineLabel: {
|
|
273864
|
-
margin: "0px !important",
|
|
273865
|
-
lineHeight: 1,
|
|
273866
|
-
alignSelf: "center"
|
|
273867
|
-
},
|
|
273868
|
-
iconCell: {
|
|
273869
|
-
display: "flex",
|
|
273870
|
-
alignItems: "center",
|
|
273871
|
-
justifyContent: "center"
|
|
273872
|
-
}
|
|
273873
|
-
}));
|
|
273874
|
-
function CombinedEllipsisMenu(props) {
|
|
273875
|
-
const { obsType, featureType, featureValueType, filled, setFilled, strokeWidth, setStrokeWidth, obsColorEncoding, setObsColorEncoding, featureValueColormap, setFeatureValueColormap, featureValueColormapRange, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible, setPointObsColorEncoding, setPointFeatureValueColormap, setPointFeatureValueColormapRange, onColorEncodingChange } = props;
|
|
273876
|
-
const [open2, setOpen] = useState(false);
|
|
273877
|
-
const { classes: selectClasses2 } = useSelectStyles();
|
|
273878
|
-
const { classes: menuClasses } = useEllipsisMenuStyles();
|
|
273879
|
-
const filledId = $bdb11010cef70236$export$f680877a34711e37();
|
|
273880
|
-
const strokeWidthId = $bdb11010cef70236$export$f680877a34711e37();
|
|
273881
|
-
const colorEncodingId = $bdb11010cef70236$export$f680877a34711e37();
|
|
273882
|
-
const colormapId = $bdb11010cef70236$export$f680877a34711e37();
|
|
273883
|
-
const colormapRangeId = $bdb11010cef70236$export$f680877a34711e37();
|
|
273884
|
-
const tooltipsId = $bdb11010cef70236$export$f680877a34711e37();
|
|
273885
|
-
const crosshairsId = $bdb11010cef70236$export$f680877a34711e37();
|
|
273886
|
-
const legendId = $bdb11010cef70236$export$f680877a34711e37();
|
|
273887
|
-
return jsxs(PopperMenu, { open: open2, setOpen, buttonIcon: jsx$1(MoreVertIcon, {}), buttonClassName: menuClasses.imageLayerMenuButton, containerClassName: menuClasses.imageLayerPopperContainer, withPaper: true, getAriaLabel: () => "Open combined centroid and segmentation layer options menu", children: [jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: filledId, children: "Filled: " }), jsx$1(Checkbox$1, { color: "primary", className: menuClasses.menuItemCheckbox, checked: filled, onChange: (e3, v) => setFilled(v), slotProps: { input: { id: filledId } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: strokeWidthId, children: "Stroke width:" }), jsx$1(Slider, { disabled: filled, value: strokeWidth, min: 0.01, max: 5, step: 0.01, onChange: (e3, v) => setStrokeWidth(v), className: menuClasses.menuItemSlider, orientation: "horizontal", id: strokeWidthId, getAriaLabel: () => "Stroke width" })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: colorEncodingId, children: "Color encoding: " }), jsxs(NativeSelect, { onChange: onColorEncodingChange, value: obsColorEncoding, inputProps: { id: colorEncodingId }, classes: { root: selectClasses2.selectRoot }, children: [jsx$1("option", { value: "spatialChannelColor", children: "Static Color" }), jsx$1("option", { value: "geneSelection", children: "Feature Value" }), jsx$1("option", { value: "cellSetSelection", children: "Set Selection" })] })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: colormapId, children: "Colormap: " }), jsx$1(NativeSelect, { onChange: (e3) => {
|
|
273888
|
-
setFeatureValueColormap(e3.target.value);
|
|
273889
|
-
setPointFeatureValueColormap?.(e3.target.value);
|
|
273890
|
-
}, value: featureValueColormap, inputProps: { id: colormapId }, classes: { root: selectClasses2.selectRoot }, children: GLSL_COLORMAPS.map((cmap) => jsx$1("option", { value: cmap, children: cmap }, cmap)) })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: colormapRangeId, children: "Colormap range: " }), jsx$1(Slider, { disabled: obsColorEncoding !== "geneSelection", value: featureValueColormapRange, min: 0, max: 1, step: 0.01, onChange: (e3, v) => {
|
|
273891
|
-
setFeatureValueColormapRange(v);
|
|
273892
|
-
setPointFeatureValueColormapRange?.(v);
|
|
273893
|
-
}, className: menuClasses.menuItemSlider, orientation: "horizontal", id: colormapRangeId, getAriaLabel: (i2) => i2 === 0 ? "Low colormap range" : "High colormap range" })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: tooltipsId, children: "Tooltips visible: " }), jsx$1(Checkbox$1, { color: "primary", className: menuClasses.menuItemCheckbox, checked: tooltipsVisible, onChange: (e3, v) => setTooltipsVisible(v), slotProps: { input: { id: tooltipsId } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: crosshairsId, children: "Crosshairs visible: " }), jsx$1(Checkbox$1, { color: "primary", className: menuClasses.menuItemCheckbox, checked: tooltipCrosshairsVisible, onChange: (e3, v) => setTooltipCrosshairsVisible(v), slotProps: { input: { id: crosshairsId } } })] }), jsxs(MenuItem, { dense: true, disableGutters: true, children: [jsx$1("label", { className: menuClasses.imageLayerMenuLabel, htmlFor: legendId, children: "Legend visible: " }), jsx$1(Checkbox$1, { color: "primary", className: menuClasses.menuItemCheckbox, checked: legendVisible, onChange: (e3, v) => setLegendVisible(v), slotProps: { input: { id: legendId } } })] })] });
|
|
273894
|
-
}
|
|
273895
|
-
function SegmentationCentroidsController(props) {
|
|
273896
|
-
const { theme, segScope, segLayerCoordination, segChannelScopesByLayer, segChannelCoordination, pointScope, pointLayerCoordination } = props;
|
|
273897
|
-
const { classes: classes2 } = useStyles$8();
|
|
273898
|
-
const { classes: lcClasses } = useControllerSectionStyles();
|
|
273899
|
-
const { classes: menuClasses } = useEllipsisMenuStyles();
|
|
273900
|
-
const channelScopes = segChannelScopesByLayer?.[segScope] ?? [];
|
|
273901
|
-
const primaryChanScope = channelScopes[0];
|
|
273902
|
-
const chanValues = segChannelCoordination[0]?.[segScope]?.[primaryChanScope] ?? {};
|
|
273903
|
-
const chanSetters = segChannelCoordination[1]?.[segScope]?.[primaryChanScope] ?? {};
|
|
273904
|
-
const { obsType, featureType, featureValueType, spatialChannelVisible: segVisible, spatialChannelOpacity: segOpacity, spatialChannelColor: segColor, spatialSegmentationFilled: filled, spatialSegmentationStrokeWidth: strokeWidth, obsColorEncoding, featureSelection, featureValueColormap, featureValueColormapRange, tooltipsVisible, tooltipCrosshairsVisible, legendVisible } = chanValues;
|
|
273905
|
-
const { setSpatialChannelVisible: setSegVisible, setSpatialChannelOpacity: setSegOpacity, setSpatialChannelColor: setSegColor, setSpatialSegmentationFilled: setFilled, setSpatialSegmentationStrokeWidth: setStrokeWidth, setObsColorEncoding, setFeatureValueColormap, setFeatureValueColormapRange, setTooltipsVisible, setTooltipCrosshairsVisible, setLegendVisible } = chanSetters;
|
|
273906
|
-
const pointValues = pointLayerCoordination[0]?.[pointScope] ?? {};
|
|
273907
|
-
const pointSetters = pointLayerCoordination[1]?.[pointScope] ?? {};
|
|
273908
|
-
const { spatialLayerVisible: pointVisible, spatialLayerOpacity: pointOpacity, spatialLayerColor: pointColor, obsColorEncoding: pointObsColorEncoding, spatialLayerLabel: pointSpatialLayerLabel, featureValueColormap: pointFeatureValueColormap } = pointValues;
|
|
273909
|
-
const { setSpatialLayerVisible: setPointVisible, setSpatialLayerOpacity: setPointOpacity, setSpatialLayerColor: setPointColor, setObsColorEncoding: setPointObsColorEncoding, setFeatureValueColormap: setPointFeatureValueColormap, setFeatureValueColormapRange: setPointFeatureValueColormapRange } = pointSetters;
|
|
273910
|
-
const sharedOpacity = segOpacity ?? 1;
|
|
273911
|
-
const segValues = segLayerCoordination[0]?.[segScope] ?? {};
|
|
273912
|
-
const { spatialLayerLabel: segSpatialLayerLabel } = segValues;
|
|
273913
|
-
const handleOpacityChange = useCallback((e3, v) => {
|
|
273914
|
-
setSegOpacity?.(v);
|
|
273915
|
-
setPointOpacity?.(v);
|
|
273916
|
-
}, [setSegOpacity, setPointOpacity]);
|
|
273917
|
-
const handleSegVisibleChange = useCallback(() => {
|
|
273918
|
-
setSegVisible?.(typeof segVisible === "boolean" ? !segVisible : false);
|
|
273919
|
-
}, [segVisible, setSegVisible]);
|
|
273920
|
-
const handlePointVisibleChange = useCallback(() => {
|
|
273921
|
-
setPointVisible?.(typeof pointVisible === "boolean" ? !pointVisible : false);
|
|
273922
|
-
}, [pointVisible, setPointVisible]);
|
|
273923
|
-
const handleColorEncodingChange = useCallback((e3) => {
|
|
273924
|
-
const val = e3.target.value;
|
|
273925
|
-
setObsColorEncoding(val);
|
|
273926
|
-
if (val === "geneSelection") {
|
|
273927
|
-
setPointObsColorEncoding?.("geneSelection");
|
|
273928
|
-
} else if (val === "cellSetSelection") {
|
|
273929
|
-
setPointObsColorEncoding?.("cellSetSelection");
|
|
273930
|
-
} else {
|
|
273931
|
-
setPointObsColorEncoding?.("spatialChannelColor");
|
|
273932
|
-
}
|
|
273933
|
-
}, [setObsColorEncoding, setPointObsColorEncoding]);
|
|
273934
|
-
const segVisibleSetting = typeof segVisible === "boolean" ? segVisible : true;
|
|
273935
|
-
const pointVisibleSetting = typeof pointVisible === "boolean" ? pointVisible : true;
|
|
273936
|
-
const SegVisibility = segVisibleSetting ? Visibility : VisibilityOff;
|
|
273937
|
-
const PointVisibility = pointVisibleSetting ? Visibility : VisibilityOff;
|
|
273938
|
-
const isStaticColor = obsColorEncoding === "spatialChannelColor";
|
|
273939
|
-
const isColormap = obsColorEncoding === "geneSelection";
|
|
273940
|
-
const pointIsStaticColor = pointObsColorEncoding === "spatialChannelColor";
|
|
273941
|
-
const pointIsColormap = pointObsColorEncoding === "geneSelection";
|
|
273942
|
-
return jsx$1(Grid$1, { className: lcClasses.layerControllerGrid, children: jsx$1(Paper, { elevation: 4, className: lcClasses.layerControllerRoot, children: jsxs(Grid$1, { container: true, direction: "row", sx: {
|
|
273943
|
-
justifyContent: "space-between",
|
|
273944
|
-
alignItems: "center"
|
|
273945
|
-
}, children: [jsxs(Grid$1, { size: "grow", style: { display: "flex", alignItems: "center", minWidth: 0 }, children: [jsx$1(Button, { onClick: handleSegVisibleChange, className: menuClasses.imageLayerVisibleButton, getAriaLabel: () => "Toggle mesh visibility", children: jsx$1(SegVisibility, {}) }), jsx$1(ChannelColorPickerMenu, { theme, color: segColor, setColor: setSegColor, isStaticColor, isColormap, featureValueColormap, visible: segVisibleSetting }), jsx$1(Typography, { className: `${menuClasses.imageLayerName} ${classes2.inlineLabel}`, children: segSpatialLayerLabel ?? "Cell" }), jsx$1("div", { className: classes2.divider }), jsx$1(Button, { onClick: handlePointVisibleChange, className: menuClasses.imageLayerVisibleButton, getAriaLabel: () => "Toggle centroid visibility", children: jsx$1(PointVisibility, {}) }), jsx$1(ChannelColorPickerMenu, { theme, color: pointColor, setColor: setPointColor, isStaticColor: pointIsStaticColor, isColormap: pointIsColormap, featureValueColormap: pointFeatureValueColormap, visible: pointVisibleSetting }), jsx$1(Typography, { className: `${menuClasses.imageLayerName} ${classes2.inlineLabel}`, children: pointSpatialLayerLabel ?? "Point" })] }), jsx$1(Grid$1, { size: 2, children: jsx$1(Slider, { value: sharedOpacity, min: 0, max: 1, step: 1e-3, onChange: handleOpacityChange, className: menuClasses.imageLayerOpacitySlider, orientation: "horizontal", getAriaLabel: () => "Adjust shared opacity" }) }), jsx$1(Grid$1, { size: 1, children: jsx$1(CombinedEllipsisMenu, { obsType, featureType, featureValueType, filled, setFilled, strokeWidth, setStrokeWidth, obsColorEncoding, setObsColorEncoding, featureValueColormap, setFeatureValueColormap, featureValueColormapRange, setFeatureValueColormapRange, tooltipsVisible, setTooltipsVisible, tooltipCrosshairsVisible, setTooltipCrosshairsVisible, legendVisible, setLegendVisible, setPointObsColorEncoding, setPointFeatureValueColormap, setPointFeatureValueColormapRange, onColorEncodingChange: handleColorEncodingChange }) }), jsx$1(Grid$1, { size: 1, className: classes2.iconCell, children: jsx$1(SvgVector, { className: classes2.layerTypeCentroidSegmentationIcon }) })] }) }) });
|
|
274082
|
+
}, channelRowContainerSx], children: [jsx$1(Grid$1, { size: 1, sx: channelControlCellSx, children: jsx$1(SvgDimensions, { className: classes2.dimensionsIcon }) }), jsx$1(Grid$1, { size: 1, sx: channelSelectorCellSx, children: jsx$1(Typography, { className: classes2.dimensionLabel, children: label2 }) }), jsx$1(Grid$1, { size: 8, sx: channelSliderCellSx, children: !is3dMode && max2 > min2 ? jsx$1(Slider, { value: targetValue, min: min2, max: max2, step: 1, onChange: (e3, v) => setTargetValue(v), className: classes2.dimensionSlider, valueLabelDisplay: "auto", orientation: "horizontal", disabled: spatialRenderingMode === "3D", "aria-label": `${label2}-slice slider` }) : null }), jsx$1(Grid$1, { size: 2, sx: channelControlCellSx, children: isForZ && enable3d ? jsx$1(FormGroup, { row: true, className: classes2.switchFormGroup, children: jsx$1(FormControlLabel$1, { control: jsx$1(Switch, { color: "primary", checked: spatialRenderingMode === "3D", onChange: handleRenderingModeChange, name: "is3dMode" }), label: "3D" }) }) : null })] }) }) });
|
|
273946
274083
|
}
|
|
273947
274084
|
function LayerController(props) {
|
|
273948
|
-
const { theme, coordinationScopesRaw, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, images, imageLayerScopes, imageLayerCoordination, targetT, targetZ, setTargetT, setTargetZ, spatialRenderingMode, setSpatialRenderingMode, imageChannelScopesByLayer, imageChannelCoordination, spotLayerScopes, spotLayerCoordination, pointLayerScopes, pointLayerCoordination, pointMultiIndicesData, volumeLoadingStatus, tiledPointsLoadingProgress, layerPerFeatureForPoints, globalDisable3d,
|
|
274085
|
+
const { theme, coordinationScopesRaw, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, images, imageLayerScopes, imageLayerCoordination, targetT, targetZ, setTargetT, setTargetZ, spatialRenderingMode, setSpatialRenderingMode, imageChannelScopesByLayer, imageChannelCoordination, spotLayerScopes, spotLayerCoordination, pointLayerScopes, pointLayerCoordination, pointMultiIndicesData, volumeLoadingStatus, tiledPointsLoadingProgress, layerPerFeatureForPoints, globalDisable3d, forceEnable3d } = props;
|
|
273949
274086
|
const anyLayerHasT = Object.values(images || {}).some((image2) => image2?.image?.instance.hasTStack());
|
|
273950
|
-
const anyLayerHasZ = Object.values(images || {}).some((image2) => image2?.image?.instance.hasZStack());
|
|
274087
|
+
const anyLayerHasZ = forceEnable3d || Object.values(images || {}).some((image2) => image2?.image?.instance.hasZStack());
|
|
273951
274088
|
const maxT = Object.values(images || {}).reduce((a2, h2) => Math.max(a2, h2?.image?.instance.getNumT()), 1) - 1;
|
|
273952
274089
|
const maxZ = Object.values(images || {}).reduce((a2, h2) => Math.max(a2, h2?.image?.instance.getNumZ()), 1) - 1;
|
|
273953
274090
|
const reversedImageLayerScopes = useMemo$1(() => [...imageLayerScopes || []].reverse(), [imageLayerScopes]);
|
|
273954
274091
|
const reversedSpotLayerScopes = useMemo$1(() => [...spotLayerScopes || []].reverse(), [spotLayerScopes]);
|
|
273955
|
-
const reversedPointLayerScopes = useMemo$1(() => [...pointLayerScopes || []].
|
|
273956
|
-
const reversedSegmentationLayerScopes = useMemo$1(() => [...segmentationLayerScopes || []].
|
|
273957
|
-
return jsxs("div", { children: [anyLayerHasZ ? jsx$1(GlobalDimensionSlider, { label: "Z", targetValue: targetZ, setTargetValue: setTargetZ, max: maxZ, spatialRenderingMode, setSpatialRenderingMode, enable3d: !globalDisable3d }) : null, anyLayerHasT ? jsx$1(GlobalDimensionSlider, { label: "T", targetValue: targetT, setTargetValue: setTargetT, max: maxT }) : null,
|
|
274092
|
+
const reversedPointLayerScopes = useMemo$1(() => [...pointLayerScopes || []].reverse(), [pointLayerScopes]);
|
|
274093
|
+
const reversedSegmentationLayerScopes = useMemo$1(() => [...segmentationLayerScopes || []].reverse(), [segmentationLayerScopes]);
|
|
274094
|
+
return jsxs("div", { children: [anyLayerHasZ ? jsx$1(GlobalDimensionSlider, { label: "Z", targetValue: targetZ, setTargetValue: setTargetZ, max: maxZ, spatialRenderingMode, setSpatialRenderingMode, enable3d: !globalDisable3d }) : null, anyLayerHasT ? jsx$1(GlobalDimensionSlider, { label: "T", targetValue: targetT, setTargetValue: setTargetT, max: maxT }) : null, pointLayerScopes && reversedPointLayerScopes.map((layerScope) => jsx$1(PointLayerController, { theme, layerScope, layerCoordination: pointLayerCoordination[0][layerScope], setLayerCoordination: pointLayerCoordination[1][layerScope], pointMatrixIndicesData: pointMultiIndicesData?.[layerScope], tiledPointsLoadingProgress, layerPerFeatureForPoints }, layerScope)), spotLayerScopes && reversedSpotLayerScopes.map((layerScope) => jsx$1(SpotLayerController, { theme, layerScope, layerCoordination: spotLayerCoordination[0][layerScope], setLayerCoordination: spotLayerCoordination[1][layerScope] }, layerScope)), segmentationLayerScopes && reversedSegmentationLayerScopes.map((layerScope) => jsx$1(SegmentationLayerController, { theme, layerScope, layerCoordination: segmentationLayerCoordination[0][layerScope], setLayerCoordination: segmentationLayerCoordination[1][layerScope], channelScopes: segmentationChannelScopesByLayer[layerScope], channelCoordination: segmentationChannelCoordination[0][layerScope], setChannelCoordination: segmentationChannelCoordination[1][layerScope] }, layerScope)), imageLayerScopes && reversedImageLayerScopes.map((layerScope) => jsx$1(ImageLayerController, { theme, coordinationScopesRaw, layerScope, layerCoordination: imageLayerCoordination[0][layerScope], setLayerCoordination: imageLayerCoordination[1][layerScope], channelScopes: imageChannelScopesByLayer[layerScope], channelCoordination: imageChannelCoordination[0][layerScope], setChannelCoordination: imageChannelCoordination[1][layerScope], image: images[layerScope]?.image?.instance, featureIndex: images[layerScope]?.featureIndex, targetT, targetZ, spatialRenderingMode, volumeLoadingProgress: volumeLoadingStatus?.loadingProgress, onStopVolumeLoading: volumeLoadingStatus?.onStopLoading, onRestartVolumeLoading: volumeLoadingStatus?.onRestartLoading, volumeStillRef: volumeLoadingStatus?.stillRef }, layerScope))] });
|
|
273958
274095
|
}
|
|
273959
274096
|
function LayerControllerSubscriber(props) {
|
|
273960
|
-
const { coordinationScopes: coordinationScopesRaw, coordinationScopesBy: coordinationScopesByRaw, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, title: title2 = "Spatial Layers", uuid: uuid2, layerPerFeatureForPoints = false, globalDisable3d = false, cameraPresets, helpText = ViewHelpMapping.LAYER_CONTROLLER_BETA } = props;
|
|
274097
|
+
const { coordinationScopes: coordinationScopesRaw, coordinationScopesBy: coordinationScopesByRaw, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, title: title2 = "Spatial Layers", uuid: uuid2, layerPerFeatureForPoints = false, globalDisable3d = false, forceEnable3d = false, cameraPresets, helpText = ViewHelpMapping.LAYER_CONTROLLER_BETA, showViewerOptions = false } = props;
|
|
273961
274098
|
const loaders = useLoaders();
|
|
273962
274099
|
const mergeCoordination = useMergeCoordination();
|
|
273963
274100
|
const coordinationScopes = useCoordinationScopes(coordinationScopesRaw);
|
|
273964
274101
|
const coordinationScopesBy = useCoordinationScopesBy(coordinationScopes, coordinationScopesByRaw);
|
|
273965
|
-
const [{ dataset, spatialTargetT: targetT, spatialTargetZ: targetZ, spatialRenderingMode }, { setSpatialTargetX: setTargetX, setSpatialTargetY: setTargetY, setSpatialTargetZ: setTargetZ, setSpatialTargetT: setTargetT, setSpatialRotationX: setRotationX, setSpatialRotationOrbit: setRotationOrbit, setSpatialZoom: setZoom, setSpatialRenderingMode }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.LAYER_CONTROLLER_BETA], coordinationScopes);
|
|
274102
|
+
const [{ dataset, spatialTargetT: targetT, spatialTargetZ: targetZ, spatialRenderingMode, spatialAxisLinesVisible, spatialBoundsVisible }, { setSpatialTargetX: setTargetX, setSpatialTargetY: setTargetY, setSpatialTargetZ: setTargetZ, setSpatialTargetT: setTargetT, setSpatialRotationX: setRotationX, setSpatialRotationOrbit: setRotationOrbit, setSpatialZoom: setZoom, setSpatialRenderingMode, setSpatialAxisLinesVisible, setSpatialBoundsVisible }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.LAYER_CONTROLLER_BETA], coordinationScopes);
|
|
273966
274103
|
const applyPreset = useCallback((preset) => {
|
|
273967
274104
|
if (!preset)
|
|
273968
274105
|
return;
|
|
@@ -274022,6 +274159,7 @@ function LayerControllerSubscriber(props) {
|
|
|
274022
274159
|
CoordinationType$1.SPATIAL_SEGMENTATION_STROKE_WIDTH,
|
|
274023
274160
|
CoordinationType$1.OBS_COLOR_ENCODING,
|
|
274024
274161
|
CoordinationType$1.FEATURE_SELECTION,
|
|
274162
|
+
CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
|
|
274025
274163
|
CoordinationType$1.FEATURE_VALUE_COLORMAP,
|
|
274026
274164
|
CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
|
|
274027
274165
|
CoordinationType$1.TOOLTIPS_VISIBLE,
|
|
@@ -274067,6 +274205,7 @@ function LayerControllerSubscriber(props) {
|
|
|
274067
274205
|
CoordinationType$1.SPATIAL_SPOT_STROKE_WIDTH,
|
|
274068
274206
|
CoordinationType$1.OBS_COLOR_ENCODING,
|
|
274069
274207
|
CoordinationType$1.FEATURE_SELECTION,
|
|
274208
|
+
CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
|
|
274070
274209
|
CoordinationType$1.FEATURE_VALUE_COLORMAP,
|
|
274071
274210
|
CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
|
|
274072
274211
|
CoordinationType$1.SPATIAL_LAYER_COLOR,
|
|
@@ -274090,42 +274229,10 @@ function LayerControllerSubscriber(props) {
|
|
|
274090
274229
|
CoordinationType$1.SPATIAL_LAYER_COLOR,
|
|
274091
274230
|
CoordinationType$1.TOOLTIPS_VISIBLE,
|
|
274092
274231
|
CoordinationType$1.TOOLTIP_CROSSHAIRS_VISIBLE,
|
|
274093
|
-
CoordinationType$1.LEGEND_VISIBLE
|
|
274232
|
+
CoordinationType$1.LEGEND_VISIBLE,
|
|
274233
|
+
CoordinationType$1.SPATIAL_POINT_STROKE_WIDTH,
|
|
274234
|
+
CoordinationType$1.SPATIAL_POINT_RADIUS
|
|
274094
274235
|
], coordinationScopes, coordinationScopesBy, CoordinationType$1.POINT_LAYER);
|
|
274095
|
-
const centroidSegmentationPairs = React__default.useMemo(() => {
|
|
274096
|
-
const pairs = [];
|
|
274097
|
-
const pairedSegScopes = /* @__PURE__ */ new Set();
|
|
274098
|
-
const pairedPointScopes = /* @__PURE__ */ new Set();
|
|
274099
|
-
pointLayerScopes.forEach((pointScope) => {
|
|
274100
|
-
const pointCoord = pointLayerCoordination[0][pointScope];
|
|
274101
|
-
if (!pointCoord)
|
|
274102
|
-
return;
|
|
274103
|
-
const pointObsType = pointCoord[CoordinationType$1.OBS_TYPE];
|
|
274104
|
-
if (!pointObsType)
|
|
274105
|
-
return;
|
|
274106
|
-
const matchingSegScope = segmentationLayerScopes.find((segScope) => {
|
|
274107
|
-
if (pairedSegScopes.has(segScope))
|
|
274108
|
-
return false;
|
|
274109
|
-
const channelScopes = segmentationChannelScopesByLayer[segScope] || [];
|
|
274110
|
-
return channelScopes.some((chanScope) => {
|
|
274111
|
-
const chanCoord = segmentationChannelCoordination[0]?.[segScope]?.[chanScope];
|
|
274112
|
-
return chanCoord?.[CoordinationType$1.OBS_TYPE] === pointObsType;
|
|
274113
|
-
});
|
|
274114
|
-
});
|
|
274115
|
-
if (matchingSegScope) {
|
|
274116
|
-
pairs.push({ pointScope, segScope: matchingSegScope });
|
|
274117
|
-
pairedSegScopes.add(matchingSegScope);
|
|
274118
|
-
pairedPointScopes.add(pointScope);
|
|
274119
|
-
}
|
|
274120
|
-
});
|
|
274121
|
-
return { pairs, pairedSegScopes, pairedPointScopes };
|
|
274122
|
-
}, [
|
|
274123
|
-
pointLayerScopes,
|
|
274124
|
-
pointLayerCoordination,
|
|
274125
|
-
segmentationLayerScopes,
|
|
274126
|
-
segmentationChannelScopesByLayer,
|
|
274127
|
-
segmentationChannelCoordination
|
|
274128
|
-
]);
|
|
274129
274236
|
const [{ volumeLoadingProgress: volumeLoadingStatus, tiledPointsLoadingProgress }] = useAuxiliaryCoordination([
|
|
274130
274237
|
"spatialAcceleratedVolumeLoadingProgress",
|
|
274131
274238
|
"spatialTiledPointsLoadingProgress"
|
|
@@ -274153,7 +274260,7 @@ function LayerControllerSubscriber(props) {
|
|
|
274153
274260
|
imageDataStatus,
|
|
274154
274261
|
pointMultiIndicesDataStatus
|
|
274155
274262
|
]);
|
|
274156
|
-
return jsx$1(TitleInfo, { title: title2, isScroll: true, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady, errors, helpText, children: jsx$1(LayerController, { theme, coordinationScopesRaw, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, images: imageData, imageLayerScopes, imageLayerCoordination, targetT, targetZ, setTargetT, setTargetZ, spatialRenderingMode, setSpatialRenderingMode, imageChannelScopesByLayer, imageChannelCoordination, spotLayerScopes, spotLayerCoordination, pointLayerScopes, pointLayerCoordination, pointMultiIndicesData, layerPerFeatureForPoints, globalDisable3d, volumeLoadingStatus, tiledPointsLoadingProgress
|
|
274263
|
+
return jsx$1(TitleInfo, { title: title2, isScroll: true, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady, errors, helpText, children: jsx$1(LayerController, { theme, coordinationScopesRaw, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, images: imageData, imageLayerScopes, imageLayerCoordination, targetT, targetZ, setTargetT, setTargetZ, spatialRenderingMode, setSpatialRenderingMode, imageChannelScopesByLayer, imageChannelCoordination, spotLayerScopes, spotLayerCoordination, pointLayerScopes, pointLayerCoordination, pointMultiIndicesData, layerPerFeatureForPoints, globalDisable3d, forceEnable3d, volumeLoadingStatus, tiledPointsLoadingProgress }) });
|
|
274157
274264
|
}
|
|
274158
274265
|
const isIterable$2 = (obj) => Symbol.iterator in obj;
|
|
274159
274266
|
const hasIterableEntries = (value2) => (
|
|
@@ -274633,6 +274740,7 @@ const CAPTURE_CATEGORIES = [
|
|
|
274633
274740
|
coordinationTypes: [
|
|
274634
274741
|
CT.SPOT_LAYER,
|
|
274635
274742
|
CT.SPATIAL_SPOT_RADIUS,
|
|
274743
|
+
CT.SPATIAL_SPOT_SHAPE,
|
|
274636
274744
|
CT.SPATIAL_SPOT_FILLED,
|
|
274637
274745
|
CT.SPATIAL_SPOT_STROKE_WIDTH,
|
|
274638
274746
|
...SHARED_SPATIAL_LAYER_TYPES
|
|
@@ -275312,7 +275420,7 @@ const GEOMETRY_FIELDS = {
|
|
|
275312
275420
|
["Radius", [["radiusX", "rx"], ["radiusY", "ry"]]]
|
|
275313
275421
|
]
|
|
275314
275422
|
};
|
|
275315
|
-
function rgbToHex$
|
|
275423
|
+
function rgbToHex$1(rgb2) {
|
|
275316
275424
|
return `#${rgb2.slice(0, 3).map((c2) => Math.max(0, Math.min(255, Math.round(c2))).toString(16).padStart(2, "0")).join("")}`;
|
|
275317
275425
|
}
|
|
275318
275426
|
function hexToRgb(hex2) {
|
|
@@ -275343,7 +275451,7 @@ function ShapeEditor(props) {
|
|
|
275343
275451
|
const strokeColor = shape2.strokeColor ?? DEFAULT_SHAPE_STROKE_COLOR;
|
|
275344
275452
|
const measurement = getMeasurementLabel(shape2, null, viewType);
|
|
275345
275453
|
const numDigits = String(frames.length).length;
|
|
275346
|
-
return jsxs("div", { className: classes2.shapeEditor, children: [jsxs("div", { className: classes2.shapeEditorRow, children: [jsx$1("span", { className: classes2.shapeEditorLabel, children: "Label" }), jsx$1(TextField, { value: shape2.text ?? "", onChange: (e3) => onUpdate2({ text: e3.target.value || void 0 }), size: "small", variant: "standard", placeholder: "Label text", fullWidth: true, slotProps: { htmlInput: { className: classes2.inputText, "aria-label": "Label text" } } })] }), shape2.type === "line" && shape2.text ? jsxs("div", { className: classes2.shapeEditorRow, children: [jsx$1("span", { className: classes2.shapeEditorLabel, children: "Position" }), jsx$1(OptionButtons, { options: TEXT_POSITION_OPTIONS.map((p) => ({ value: p, label: p })), value: shape2.textPosition ?? "start", onChange: (textPosition) => onUpdate2({ textPosition }) })] }) : null, jsxs("div", { className: classes2.shapeEditorRow, children: [jsx$1("span", { className: classes2.shapeEditorLabel, children: "Stroke" }), jsx$1("input", { type: "color", className: classes2.colorSwatch, value: rgbToHex$
|
|
275454
|
+
return jsxs("div", { className: classes2.shapeEditor, children: [jsxs("div", { className: classes2.shapeEditorRow, children: [jsx$1("span", { className: classes2.shapeEditorLabel, children: "Label" }), jsx$1(TextField, { value: shape2.text ?? "", onChange: (e3) => onUpdate2({ text: e3.target.value || void 0 }), size: "small", variant: "standard", placeholder: "Label text", fullWidth: true, slotProps: { htmlInput: { className: classes2.inputText, "aria-label": "Label text" } } })] }), shape2.type === "line" && shape2.text ? jsxs("div", { className: classes2.shapeEditorRow, children: [jsx$1("span", { className: classes2.shapeEditorLabel, children: "Position" }), jsx$1(OptionButtons, { options: TEXT_POSITION_OPTIONS.map((p) => ({ value: p, label: p })), value: shape2.textPosition ?? "start", onChange: (textPosition) => onUpdate2({ textPosition }) })] }) : null, jsxs("div", { className: classes2.shapeEditorRow, children: [jsx$1("span", { className: classes2.shapeEditorLabel, children: "Stroke" }), jsx$1("input", { type: "color", className: classes2.colorSwatch, value: rgbToHex$1(strokeColor), onChange: (e3) => onUpdate2({ strokeColor: hexToRgb(e3.target.value) }), "aria-label": "Stroke color" }), jsx$1(OptionButtons, { options: DASH_OPTIONS, value: shape2.strokeDashArray === "none" ? void 0 : shape2.strokeDashArray, onChange: (strokeDashArray) => onUpdate2({ strokeDashArray }) })] }), jsxs("div", { className: classes2.shapeEditorRow, children: [jsx$1("span", { className: classes2.shapeEditorLabel, children: "Width" }), jsx$1(Slider, { size: "small", min: 1, max: 10, step: 1, value: shape2.strokeWidth ?? DEFAULT_SHAPE_STROKE_WIDTH, onChange: (_, strokeWidth) => onUpdate2({ strokeWidth }), valueLabelDisplay: "auto", className: classes2.annotationSlider, "aria-label": "Stroke width" })] }), hasFill ? jsxs("div", { className: classes2.shapeEditorRow, children: [jsx$1("span", { className: classes2.shapeEditorLabel, children: "Fill" }), jsx$1("input", { type: "color", className: classes2.colorSwatch, value: rgbToHex$1(shape2.fillColor ?? strokeColor), onChange: (e3) => onUpdate2({ fillColor: hexToRgb(e3.target.value) }), "aria-label": "Fill color" }), jsx$1(Slider, { size: "small", min: 0, max: 1, step: 0.05, value: shape2.fillOpacity ?? 0, onChange: (_, fillOpacity) => onUpdate2({ fillOpacity }), valueLabelDisplay: "auto", valueLabelFormat: (v) => v.toFixed(2), className: classes2.annotationSlider, "aria-label": "Fill opacity" })] }) : null, hasMarkers ? jsxs(Fragment, { children: [jsxs("div", { className: classes2.shapeEditorRow, children: [jsx$1("span", { className: classes2.shapeEditorLabel, children: "Start" }), jsx$1(OptionButtons, { options: MARKER_OPTIONS, value: shape2.markerStart ?? void 0, onChange: (markerStart) => onUpdate2({ markerStart }) })] }), jsxs("div", { className: classes2.shapeEditorRow, children: [jsx$1("span", { className: classes2.shapeEditorLabel, children: "End" }), jsx$1(OptionButtons, { options: MARKER_OPTIONS, value: shape2.markerEnd ?? void 0, onChange: (markerEnd) => onUpdate2({ markerEnd }) })] })] }) : null, jsxs("div", { className: classes2.shapeEditorRow, children: [jsxs("button", { type: "button", className: classes2.toggleTextButton, onClick: () => setIsGeometryOpen((prev2) => !prev2), "aria-expanded": isGeometryOpen, children: [isGeometryOpen ? "▾" : "▸", " Geometry"] }), jsx$1("span", { className: classes2.measurement, children: measurement }), frames.length > 1 ? jsxs(NativeSelect, { value: "", className: classes2.nativeSelect, onChange: (e3) => {
|
|
275347
275455
|
if (e3.target.value !== "") {
|
|
275348
275456
|
onCopyToFrame(Number(e3.target.value));
|
|
275349
275457
|
}
|
|
@@ -277613,7 +277721,7 @@ function HiglassGlobalStyles(props) {
|
|
|
277613
277721
|
}
|
|
277614
277722
|
register({ dataFetcher: ZarrMultivecDataFetcher_default, config: ZarrMultivecDataFetcher_default.config }, { pluginType: "dataFetcher" });
|
|
277615
277723
|
const LazyHiGlassComponent = React__default.lazy(async () => {
|
|
277616
|
-
const { HiGlassComponent } = await import("./higlass-
|
|
277724
|
+
const { HiGlassComponent } = await import("./higlass-B8HiKDgZ.js");
|
|
277617
277725
|
return { default: HiGlassComponent };
|
|
277618
277726
|
});
|
|
277619
277727
|
const HG_SIZE = 800;
|
|
@@ -280568,12 +280676,33 @@ function NeuroglancerGlobalStyles(props) {
|
|
|
280568
280676
|
const { classes: classes2 } = props;
|
|
280569
280677
|
return jsxs(Fragment, { children: [jsx$1(GlobalStyles$3, { styles: globalNeuroglancerCss }), jsx$1(ScopedGlobalStyles, { styles: globalNeuroglancerStyles, parentClassName: classes2.neuroglancerWrapper })] });
|
|
280570
280678
|
}
|
|
280571
|
-
const LazyReactNeuroglancer = React__default.lazy(() => import("./ReactNeuroglancer-
|
|
280679
|
+
const LazyReactNeuroglancer = React__default.lazy(() => import("./ReactNeuroglancer-D2Sm_o8g.js"));
|
|
280572
280680
|
function createWorker() {
|
|
280573
280681
|
const worker = new WorkerFactory$1();
|
|
280574
|
-
|
|
280682
|
+
const asyncWorkers = [];
|
|
280683
|
+
worker.AsyncComputationWorker = function TrackedAsyncComputationWorker() {
|
|
280684
|
+
const w2 = new WorkerFactory();
|
|
280685
|
+
asyncWorkers.push(w2);
|
|
280686
|
+
return w2;
|
|
280687
|
+
};
|
|
280688
|
+
worker.asyncWorkers = asyncWorkers;
|
|
280575
280689
|
return worker;
|
|
280576
280690
|
}
|
|
280691
|
+
function getPickedAnnotationLayerName(viewer, mouseState) {
|
|
280692
|
+
const { pickedAnnotationLayer, pickedRenderLayer } = mouseState;
|
|
280693
|
+
for (const managedLayer of viewer.layerManager.managedLayers) {
|
|
280694
|
+
const userLayer = managedLayer.layer;
|
|
280695
|
+
if (userLayer) {
|
|
280696
|
+
if (pickedAnnotationLayer && userLayer.annotationStates?.states?.includes(pickedAnnotationLayer)) {
|
|
280697
|
+
return managedLayer.name;
|
|
280698
|
+
}
|
|
280699
|
+
if (pickedRenderLayer && userLayer.renderLayers?.includes(pickedRenderLayer)) {
|
|
280700
|
+
return managedLayer.name;
|
|
280701
|
+
}
|
|
280702
|
+
}
|
|
280703
|
+
}
|
|
280704
|
+
return null;
|
|
280705
|
+
}
|
|
280577
280706
|
class NeuroglancerComp extends PureComponent {
|
|
280578
280707
|
constructor(props) {
|
|
280579
280708
|
super(props);
|
|
@@ -280613,23 +280742,35 @@ class NeuroglancerComp extends PureComponent {
|
|
|
280613
280742
|
}
|
|
280614
280743
|
};
|
|
280615
280744
|
remapWheelToZoom(viewer.inputEventBindings.perspectiveView);
|
|
280616
|
-
const {
|
|
280745
|
+
const { onViewerReady } = this.props;
|
|
280617
280746
|
this.prevHoverHandler = () => {
|
|
280618
280747
|
const ms = viewer.mouseState;
|
|
280748
|
+
const hoverCoord = ms.active && ms.position?.length >= 3 ? [ms.position[0], ms.position[1], ms.position[2]] : null;
|
|
280749
|
+
const { getMeshIdToCellId, centroidAnnotationUrlsByLayerName, decodeCentroidById } = this.props;
|
|
280619
280750
|
if (ms.pickedAnnotationId != null) {
|
|
280751
|
+
const layerName = getPickedAnnotationLayerName(viewer, ms);
|
|
280752
|
+
const annotationUrl = layerName ? centroidAnnotationUrlsByLayerName?.[layerName] : null;
|
|
280753
|
+
if (!annotationUrl) {
|
|
280754
|
+
this.latestOnSelectHoveredCoords?.(null);
|
|
280755
|
+
return;
|
|
280756
|
+
}
|
|
280620
280757
|
const byIdKey = String(ms.pickedAnnotationId);
|
|
280621
|
-
fetch(`${
|
|
280622
|
-
const
|
|
280623
|
-
|
|
280758
|
+
fetch(`${annotationUrl}/by_id/${byIdKey}`).then((r3) => r3.arrayBuffer()).then((buf) => {
|
|
280759
|
+
const actualMeshId = decodeCentroidById?.(layerName, buf);
|
|
280760
|
+
if (!actualMeshId) {
|
|
280761
|
+
this.latestOnSelectHoveredCoords?.(null);
|
|
280762
|
+
return;
|
|
280763
|
+
}
|
|
280624
280764
|
const cellId = getMeshIdToCellId?.(actualMeshId) ?? actualMeshId;
|
|
280625
|
-
this.latestOnSelectHoveredCoords?.(cellId);
|
|
280765
|
+
this.latestOnSelectHoveredCoords?.(cellId, hoverCoord);
|
|
280766
|
+
}).catch(() => {
|
|
280626
280767
|
});
|
|
280627
280768
|
return;
|
|
280628
280769
|
}
|
|
280629
280770
|
if (ms.pickedValue !== void 0 && ms.pickedValue !== null) {
|
|
280630
280771
|
const meshId = String(ms.pickedValue?.low);
|
|
280631
280772
|
const cellId = getMeshIdToCellId?.(meshId) ?? meshId;
|
|
280632
|
-
this.latestOnSelectHoveredCoords?.(cellId);
|
|
280773
|
+
this.latestOnSelectHoveredCoords?.(cellId, hoverCoord);
|
|
280633
280774
|
return;
|
|
280634
280775
|
}
|
|
280635
280776
|
this.latestOnSelectHoveredCoords?.(null);
|
|
@@ -280662,13 +280803,19 @@ class NeuroglancerComp extends PureComponent {
|
|
|
280662
280803
|
this.setState({ bundleRootReady: true });
|
|
280663
280804
|
}
|
|
280664
280805
|
componentWillUnmount() {
|
|
280806
|
+
this.bundleRoot?.asyncWorkers?.forEach((w2) => {
|
|
280807
|
+
try {
|
|
280808
|
+
w2.terminate();
|
|
280809
|
+
} catch {
|
|
280810
|
+
}
|
|
280811
|
+
});
|
|
280665
280812
|
this.bundleRoot?.terminate();
|
|
280666
280813
|
this.bundleRoot = null;
|
|
280667
280814
|
}
|
|
280668
280815
|
render() {
|
|
280669
|
-
const { classes: classes2, viewerState, cellColorMapping, onLayerLoadingChange, onAnnotationSourceReady, onViewerReady,
|
|
280816
|
+
const { classes: classes2, viewerState, cellColorMapping, onLayerLoadingChange, onAnnotationSourceReady, onViewerReady, allowEmptySegments, axisLinesVisible, boundsVisible, orthographic: orthographic2, scaleBarVisible, cameraResetRequest, backgroundTheme } = this.props;
|
|
280670
280817
|
const { bundleRootReady } = this.state;
|
|
280671
|
-
return jsxs(Fragment, { children: [jsx$1(NeuroglancerGlobalStyles, { classes: classes2 }), jsx$1("div", { className: classes2.neuroglancerWrapper, children: jsx$1(Suspense, { fallback: jsx$1("div", { children: "Loading..." }), children: bundleRootReady && jsx$1(LazyReactNeuroglancer, { brainMapsClientId: "NOT_A_VALID_ID", viewerState, onViewerStateChanged: this.onViewerStateChanged, onLayerLoadingChange, bundleRoot: this.bundleRoot, cellColorMapping, ref: this.onRef, onAnnotationSourceReady, onViewerReady,
|
|
280818
|
+
return jsxs(Fragment, { children: [jsx$1(NeuroglancerGlobalStyles, { classes: classes2 }), jsx$1("div", { className: classes2.neuroglancerWrapper, children: jsx$1(Suspense, { fallback: jsx$1("div", { children: "Loading..." }), children: bundleRootReady && jsx$1(LazyReactNeuroglancer, { brainMapsClientId: "NOT_A_VALID_ID", viewerState, onViewerStateChanged: this.onViewerStateChanged, onLayerLoadingChange, bundleRoot: this.bundleRoot, cellColorMapping, ref: this.onRef, onAnnotationSourceReady, onViewerReady, allowEmptySegments, axisLinesVisible, boundsVisible, orthographic: orthographic2, scaleBarVisible, cameraResetRequest, backgroundTheme }) }) })] });
|
|
280672
280819
|
}
|
|
280673
280820
|
}
|
|
280674
280821
|
function customIsEqualForCellColors(prevDeps, nextDeps) {
|
|
@@ -280703,7 +280850,8 @@ function customIsEqualForCellColors(prevDeps, nextDeps) {
|
|
|
280703
280850
|
"spatialChannelOpacity",
|
|
280704
280851
|
"featureValueColormap",
|
|
280705
280852
|
"featureValueColormapRange",
|
|
280706
|
-
"featureSelection"
|
|
280853
|
+
"featureSelection",
|
|
280854
|
+
"spatialLayerOpacityUnselected"
|
|
280707
280855
|
]) || curriedShallowDiffByChannel("segmentationMultiIndicesData", layerScope, channelScope) || curriedShallowDiffByChannel("segmentationMultiExpressionNormData", layerScope, channelScope)) {
|
|
280708
280856
|
forceUpdate = true;
|
|
280709
280857
|
}
|
|
@@ -280716,9 +280864,10 @@ function customIsEqualForInitialViewerState(prevDeps, nextDeps) {
|
|
|
280716
280864
|
let forceUpdate = false;
|
|
280717
280865
|
const curriedShallowDiff = (depName) => shallowDiff(prevDeps, nextDeps, depName);
|
|
280718
280866
|
const curriedShallowDiffByLayer = (depName, scopeName) => shallowDiffByLayer(prevDeps, nextDeps, depName, scopeName);
|
|
280867
|
+
const curriedShallowDiffByChannel = (depName, firstName, secondName) => shallowDiffByChannel(prevDeps, nextDeps, depName, firstName, secondName);
|
|
280719
280868
|
const curriedShallowDiffByLayerCoordinationWithKeys = (depName, layerScope, keys2) => shallowDiffByLayerCoordinationWithKeys(prevDeps, nextDeps, depName, layerScope, keys2);
|
|
280720
280869
|
const curriedShallowDiffByChannelCoordinationWithKeys = (depName, layerScope, channelScope, keys2) => shallowDiffByChannelCoordinationWithKeys(prevDeps, nextDeps, depName, layerScope, channelScope, keys2);
|
|
280721
|
-
if (["theme", "showAxisLines"].some(curriedShallowDiff)) {
|
|
280870
|
+
if (["theme", "showAxisLines", "viewerDimensionsOverride"].some(curriedShallowDiff)) {
|
|
280722
280871
|
forceUpdate = true;
|
|
280723
280872
|
}
|
|
280724
280873
|
if (["segmentationLayerScopes", "segmentationChannelScopesByLayer"].some(curriedShallowDiff)) {
|
|
@@ -280733,9 +280882,27 @@ function customIsEqualForInitialViewerState(prevDeps, nextDeps) {
|
|
|
280733
280882
|
nextDeps.segmentationChannelScopesByLayer?.[layerScope]?.forEach((channelScope) => {
|
|
280734
280883
|
if (curriedShallowDiffByChannelCoordinationWithKeys("segmentationChannelCoordination", layerScope, channelScope, [
|
|
280735
280884
|
"spatialChannelVisible"
|
|
280736
|
-
])) {
|
|
280885
|
+
]) || curriedShallowDiffByChannel("obsSegmentationsLocationsData", layerScope, channelScope)) {
|
|
280737
280886
|
forceUpdate = true;
|
|
280738
280887
|
}
|
|
280888
|
+
const hasCentroids = nextDeps.obsSegmentationsLocationsData?.[layerScope]?.[channelScope]?.obsLocationsTilingType === "neuroglancer";
|
|
280889
|
+
if (hasCentroids) {
|
|
280890
|
+
const getOpacity2 = (deps) => (deps?.segmentationLayerCoordination?.[0]?.[layerScope]?.spatialLayerOpacity ?? 1) * (deps?.segmentationChannelCoordination?.[0]?.[layerScope]?.[channelScope]?.spatialChannelOpacity ?? 1);
|
|
280891
|
+
const keysChanged = curriedShallowDiffByChannelCoordinationWithKeys("segmentationChannelCoordination", layerScope, channelScope, [
|
|
280892
|
+
"spatialChannelColor",
|
|
280893
|
+
"obsColorEncoding",
|
|
280894
|
+
"featureValueColormap",
|
|
280895
|
+
"featureValueColormapRange",
|
|
280896
|
+
"obsSetColor",
|
|
280897
|
+
"obsSetSelection",
|
|
280898
|
+
"additionalObsSets",
|
|
280899
|
+
"spatialSegmentationStrokeWidth"
|
|
280900
|
+
]);
|
|
280901
|
+
const opacityChanged = Math.abs(getOpacity2(prevDeps) - getOpacity2(nextDeps)) >= 0.05;
|
|
280902
|
+
if (keysChanged || opacityChanged) {
|
|
280903
|
+
forceUpdate = true;
|
|
280904
|
+
}
|
|
280905
|
+
}
|
|
280739
280906
|
});
|
|
280740
280907
|
});
|
|
280741
280908
|
}
|
|
@@ -280758,7 +280925,9 @@ function customIsEqualForInitialViewerState(prevDeps, nextDeps) {
|
|
|
280758
280925
|
"featureValueColormapRange",
|
|
280759
280926
|
"obsSetColor",
|
|
280760
280927
|
"obsSetSelection",
|
|
280761
|
-
"additionalObsSets"
|
|
280928
|
+
"additionalObsSets",
|
|
280929
|
+
"spatialPointProjectionSpacing",
|
|
280930
|
+
"spatialPointRadius"
|
|
280762
280931
|
]);
|
|
280763
280932
|
const opacityChanged = Math.abs((prevLayer?.spatialLayerOpacity ?? 1) - (nextLayer?.spatialLayerOpacity ?? 1)) >= 0.05;
|
|
280764
280933
|
const unselectedChanged = Math.abs((prevLayer?.spatialLayerOpacityUnselected ?? 0.25) - (nextLayer?.spatialLayerOpacityUnselected ?? 0.25)) >= 0.05;
|
|
@@ -280769,6 +280938,213 @@ function customIsEqualForInitialViewerState(prevDeps, nextDeps) {
|
|
|
280769
280938
|
}
|
|
280770
280939
|
return !forceUpdate;
|
|
280771
280940
|
}
|
|
280941
|
+
const ANNOTATION_HEADER_OFFSET = 8;
|
|
280942
|
+
function ngMetersPerUnit(dimensions) {
|
|
280943
|
+
if (!dimensions?.x)
|
|
280944
|
+
return null;
|
|
280945
|
+
const [scale2, unit2] = dimensions.x;
|
|
280946
|
+
const factor = UNIT_TO_METERS[unit2];
|
|
280947
|
+
return factor ? scale2 * factor : null;
|
|
280948
|
+
}
|
|
280949
|
+
const GREY_HEX = "#323232";
|
|
280950
|
+
const EPSILON_KEYS_MAPPING_NG = {
|
|
280951
|
+
projectionScale: 5,
|
|
280952
|
+
projectionOrientation: 0.02,
|
|
280953
|
+
position: 1
|
|
280954
|
+
};
|
|
280955
|
+
const SOFT_POS_FACTOR = 0.15;
|
|
280956
|
+
const Q_Y_UP = [1, 0, 0, 0];
|
|
280957
|
+
const multiplyQuat = (a2, b2) => {
|
|
280958
|
+
const [ax, ay, az, aw] = a2;
|
|
280959
|
+
const [bx, by, bz, bw] = b2;
|
|
280960
|
+
return [
|
|
280961
|
+
aw * bx + ax * bw + ay * bz - az * by,
|
|
280962
|
+
aw * by - ax * bz + ay * bw + az * bx,
|
|
280963
|
+
aw * bz + ax * by - ay * bx + az * bw,
|
|
280964
|
+
aw * bw - ax * bx - ay * by - az * bz
|
|
280965
|
+
];
|
|
280966
|
+
};
|
|
280967
|
+
const deg2rad = (d) => d * Math.PI / 180;
|
|
280968
|
+
const isFiniteNumberArray = (value2, length2) => Array.isArray(value2) && value2.length === length2 && value2.every(Number.isFinite);
|
|
280969
|
+
function isValidNgPosition(position2) {
|
|
280970
|
+
return isFiniteNumberArray(position2, 3);
|
|
280971
|
+
}
|
|
280972
|
+
function isValidNgOrientation(orientation) {
|
|
280973
|
+
return isFiniteNumberArray(orientation, 4) && orientation.some((v) => v !== 0);
|
|
280974
|
+
}
|
|
280975
|
+
function isValidNgScale(scale2) {
|
|
280976
|
+
return Number.isFinite(scale2) && scale2 > 0;
|
|
280977
|
+
}
|
|
280978
|
+
const NG_CAMERA_VALIDATORS = {
|
|
280979
|
+
position: isValidNgPosition,
|
|
280980
|
+
projectionOrientation: isValidNgOrientation,
|
|
280981
|
+
projectionScale: isValidNgScale,
|
|
280982
|
+
crossSectionScale: isValidNgScale
|
|
280983
|
+
};
|
|
280984
|
+
function applyColormap(colormap, t4) {
|
|
280985
|
+
const tClamped = Math.max(0, Math.min(1, t4));
|
|
280986
|
+
const interpolators = {
|
|
280987
|
+
plasma: interpolatePlasma,
|
|
280988
|
+
viridis: interpolateViridis,
|
|
280989
|
+
jet: interpolateJet,
|
|
280990
|
+
greys: interpolateGreys
|
|
280991
|
+
};
|
|
280992
|
+
const fn2 = interpolators[colormap] ?? interpolateViridis;
|
|
280993
|
+
return fn2(tClamped);
|
|
280994
|
+
}
|
|
280995
|
+
function valueGreaterThanEpsilon(a2, b2, epsilon3) {
|
|
280996
|
+
if (Array.isArray(a2) && Array.isArray(b2) && a2.length === b2.length) {
|
|
280997
|
+
return a2.some((val, i2) => Math.abs(val - b2[i2]) > epsilon3);
|
|
280998
|
+
}
|
|
280999
|
+
if (typeof a2 === "number" && typeof b2 === "number") {
|
|
281000
|
+
return Math.abs(a2 - b2) > epsilon3;
|
|
281001
|
+
}
|
|
281002
|
+
return void 0;
|
|
281003
|
+
}
|
|
281004
|
+
const nearEq = (a2, b2, epsilon3) => Number.isFinite(a2) && Number.isFinite(b2) ? Math.abs(a2 - b2) <= epsilon3 : a2 === b2;
|
|
281005
|
+
function diffCameraState(prev2, next4) {
|
|
281006
|
+
const eps = EPSILON_KEYS_MAPPING_NG;
|
|
281007
|
+
const scale2 = valueGreaterThanEpsilon(prev2?.projectionScale, next4?.projectionScale, eps.projectionScale);
|
|
281008
|
+
const posHard = valueGreaterThanEpsilon(prev2?.position, next4?.position, eps.position);
|
|
281009
|
+
const rot2 = valueGreaterThanEpsilon(prev2?.projectionOrientation, next4?.projectionOrientation, eps.projectionOrientation);
|
|
281010
|
+
const posSoft = !posHard && scale2 && valueGreaterThanEpsilon(prev2?.position, next4?.position, SOFT_POS_FACTOR);
|
|
281011
|
+
const pos = posHard || posSoft;
|
|
281012
|
+
return { changed: scale2 || pos || rot2, scale: scale2, pos, rot: rot2 };
|
|
281013
|
+
}
|
|
281014
|
+
function eulerToQuaternion(pitch, yaw, roll = 0) {
|
|
281015
|
+
const c1 = Math.cos(pitch / 2);
|
|
281016
|
+
const c2 = Math.cos(yaw / 2);
|
|
281017
|
+
const c3 = Math.cos(roll / 2);
|
|
281018
|
+
const s1 = Math.sin(pitch / 2);
|
|
281019
|
+
const s2 = Math.sin(yaw / 2);
|
|
281020
|
+
const s3 = Math.sin(roll / 2);
|
|
281021
|
+
return [
|
|
281022
|
+
s1 * c2 * c3 + c1 * s2 * s3,
|
|
281023
|
+
c1 * s2 * c3 - s1 * c2 * s3,
|
|
281024
|
+
c1 * c2 * s3 - s1 * s2 * c3,
|
|
281025
|
+
c1 * c2 * c3 + s1 * s2 * s3
|
|
281026
|
+
];
|
|
281027
|
+
}
|
|
281028
|
+
function applyQuat(q, v) {
|
|
281029
|
+
const [qx, qy, qz, qw] = q;
|
|
281030
|
+
const [vx, vy, vz] = v;
|
|
281031
|
+
const tx2 = 2 * (qy * vz - qz * vy);
|
|
281032
|
+
const ty = 2 * (qz * vx - qx * vz);
|
|
281033
|
+
const tz = 2 * (qx * vy - qy * vx);
|
|
281034
|
+
return [
|
|
281035
|
+
vx + qw * tx2 + qy * tz - qz * ty,
|
|
281036
|
+
vy + qw * ty + qz * tx2 - qx * tz,
|
|
281037
|
+
vz + qw * tz + qx * ty - qy * tx2
|
|
281038
|
+
];
|
|
281039
|
+
}
|
|
281040
|
+
function getAnnotationPropertyIndices(info2, { segmentIdProp } = {}) {
|
|
281041
|
+
const propertyIds = (info2?.properties ?? []).map((p) => p.id);
|
|
281042
|
+
const resolvedSegmentIdProp = segmentIdProp ?? (propertyIds.includes("id") ? "id" : null);
|
|
281043
|
+
return {
|
|
281044
|
+
propertyIds,
|
|
281045
|
+
segmentIdProp: resolvedSegmentIdProp,
|
|
281046
|
+
segmentIdIndex: resolvedSegmentIdProp ? propertyIds.indexOf(resolvedSegmentIdProp) : -1
|
|
281047
|
+
};
|
|
281048
|
+
}
|
|
281049
|
+
function toNamedProperties(propertyIds, values3) {
|
|
281050
|
+
const named2 = {};
|
|
281051
|
+
propertyIds.forEach((name2, k) => {
|
|
281052
|
+
named2[name2] = values3[k];
|
|
281053
|
+
});
|
|
281054
|
+
return named2;
|
|
281055
|
+
}
|
|
281056
|
+
function parseAnnotationChunkSegmentsWithPositions(buffer2, serializer2, layout) {
|
|
281057
|
+
const dv = new DataView(buffer2);
|
|
281058
|
+
if (buffer2.byteLength <= 8)
|
|
281059
|
+
return [];
|
|
281060
|
+
const { propertyIds = [], segmentIdIndex } = layout ?? {};
|
|
281061
|
+
if (!(segmentIdIndex >= 0))
|
|
281062
|
+
return [];
|
|
281063
|
+
const count2 = dv.getUint32(0, true);
|
|
281064
|
+
if (count2 === 0 || dv.getUint32(4, true) !== 0)
|
|
281065
|
+
return [];
|
|
281066
|
+
const geometryStride = serializer2.propertyGroupBytes?.[0] ?? serializer2.serializedBytes;
|
|
281067
|
+
const values3 = new Array(propertyIds.length).fill(null);
|
|
281068
|
+
const results = [];
|
|
281069
|
+
for (let i2 = 0; i2 < count2; i2++) {
|
|
281070
|
+
serializer2.deserialize(dv, ANNOTATION_HEADER_OFFSET, i2, count2, true, values3);
|
|
281071
|
+
const segId = values3[segmentIdIndex];
|
|
281072
|
+
if (segId > 0) {
|
|
281073
|
+
const propBase = ANNOTATION_HEADER_OFFSET + i2 * geometryStride;
|
|
281074
|
+
const x2 = dv.getFloat32(propBase + 0, true);
|
|
281075
|
+
const y2 = dv.getFloat32(propBase + 4, true);
|
|
281076
|
+
const z2 = dv.getFloat32(propBase + 8, true);
|
|
281077
|
+
if (x2 !== 0 || y2 !== 0 || z2 !== 0) {
|
|
281078
|
+
results.push({
|
|
281079
|
+
id: String(segId),
|
|
281080
|
+
// value of segmentIdProp: used for the NG segments array
|
|
281081
|
+
x: x2,
|
|
281082
|
+
y: y2,
|
|
281083
|
+
z: z2,
|
|
281084
|
+
properties: toNamedProperties(propertyIds, values3)
|
|
281085
|
+
});
|
|
281086
|
+
}
|
|
281087
|
+
}
|
|
281088
|
+
}
|
|
281089
|
+
return results;
|
|
281090
|
+
}
|
|
281091
|
+
function parseAnnotationById(buffer2, serializer2, layout) {
|
|
281092
|
+
const { propertyIds = [], segmentIdIndex } = layout ?? {};
|
|
281093
|
+
if (!(segmentIdIndex >= 0) || !buffer2 || !serializer2 || buffer2.byteLength < serializer2.serializedBytes)
|
|
281094
|
+
return null;
|
|
281095
|
+
const values3 = new Array(propertyIds.length).fill(null);
|
|
281096
|
+
serializer2.deserialize(new DataView(buffer2), 0, 0, 1, true, values3);
|
|
281097
|
+
const segId = values3[segmentIdIndex];
|
|
281098
|
+
if (!(segId > 0))
|
|
281099
|
+
return null;
|
|
281100
|
+
return { id: String(segId), properties: toNamedProperties(propertyIds, values3) };
|
|
281101
|
+
}
|
|
281102
|
+
const remapCellColors = (ngCellColors, cellIdToMeshIdRef) => {
|
|
281103
|
+
const remapped = {};
|
|
281104
|
+
Object.entries(ngCellColors).forEach(([cellId, color2]) => {
|
|
281105
|
+
const meshId = cellIdToMeshIdRef.current[cellId] ?? cellId;
|
|
281106
|
+
remapped[meshId] = color2;
|
|
281107
|
+
});
|
|
281108
|
+
return remapped;
|
|
281109
|
+
};
|
|
281110
|
+
const autoColorCache = /* @__PURE__ */ new Map();
|
|
281111
|
+
function hashStringToIndex(str, mod2) {
|
|
281112
|
+
let hash2 = 0;
|
|
281113
|
+
for (let i2 = 0; i2 < str.length; i2 += 1) {
|
|
281114
|
+
hash2 = (hash2 * 31 + str.charCodeAt(i2)) % 2 ** 32;
|
|
281115
|
+
}
|
|
281116
|
+
return hash2 % mod2;
|
|
281117
|
+
}
|
|
281118
|
+
function autoColorForId(id2) {
|
|
281119
|
+
const key2 = String(id2);
|
|
281120
|
+
let color2 = autoColorCache.get(key2);
|
|
281121
|
+
if (!color2) {
|
|
281122
|
+
color2 = PALETTE[hashStringToIndex(key2, PALETTE.length)].map((c2) => c2.toString(16).padStart(2, "0")).join("");
|
|
281123
|
+
color2 = `#${color2}`;
|
|
281124
|
+
autoColorCache.set(key2, color2);
|
|
281125
|
+
}
|
|
281126
|
+
return color2;
|
|
281127
|
+
}
|
|
281128
|
+
function reuseIfShallowEqual(cacheRef, next4) {
|
|
281129
|
+
const prev2 = cacheRef.current;
|
|
281130
|
+
const prevKeys = Object.keys(prev2);
|
|
281131
|
+
const nextKeys = Object.keys(next4);
|
|
281132
|
+
if (prevKeys.length === nextKeys.length && nextKeys.every((k) => prev2[k] === next4[k])) {
|
|
281133
|
+
return prev2;
|
|
281134
|
+
}
|
|
281135
|
+
cacheRef.current = next4;
|
|
281136
|
+
return next4;
|
|
281137
|
+
}
|
|
281138
|
+
function projectToScreen(mat, [x2, y2, z2], width2, height2) {
|
|
281139
|
+
if (!mat)
|
|
281140
|
+
return null;
|
|
281141
|
+
const cx = mat[0] * x2 + mat[4] * y2 + mat[8] * z2 + mat[12];
|
|
281142
|
+
const cy = mat[1] * x2 + mat[5] * y2 + mat[9] * z2 + mat[13];
|
|
281143
|
+
const cw2 = mat[3] * x2 + mat[7] * y2 + mat[11] * z2 + mat[15];
|
|
281144
|
+
if (!(cw2 > 0))
|
|
281145
|
+
return null;
|
|
281146
|
+
return [(cx / cw2 + 1) * 0.5 * width2, (1 - cy / cw2) * 0.5 * height2];
|
|
281147
|
+
}
|
|
280772
281148
|
function normalizeColor(rgbColor) {
|
|
280773
281149
|
if (!Array.isArray(rgbColor)) {
|
|
280774
281150
|
return [0, 0, 0];
|
|
@@ -280778,6 +281154,10 @@ function normalizeColor(rgbColor) {
|
|
|
280778
281154
|
function borderWidthGlsl(borderWidth = 0) {
|
|
280779
281155
|
return `setPointMarkerBorderWidth(${borderWidth.toFixed(1)});`;
|
|
280780
281156
|
}
|
|
281157
|
+
const DEFAULT_POINT_MARKER_SIZE = 5;
|
|
281158
|
+
function pointMarkerSizeGlsl(size2 = DEFAULT_POINT_MARKER_SIZE) {
|
|
281159
|
+
return `setPointMarkerSize(${size2.toFixed(1)});`;
|
|
281160
|
+
}
|
|
280781
281161
|
function toVec3(normalizedColor) {
|
|
280782
281162
|
return `vec3(${normalizedColor.join(", ")})`;
|
|
280783
281163
|
}
|
|
@@ -281157,7 +281537,7 @@ function getObsSetSelectionShader(phenotypeColors, opacity2, borderWidth = 0) {
|
|
|
281157
281537
|
}
|
|
281158
281538
|
`;
|
|
281159
281539
|
}
|
|
281160
|
-
function
|
|
281540
|
+
function getPointsShaderInner(layerCoordination) {
|
|
281161
281541
|
const { theme, featureIndex, spatialLayerOpacity, obsColorEncoding, spatialLayerColor, featureSelection, featureFilterMode, featureColor, pointMarkerBorderWidth = 0, featureIndexProp, pointIndexProp, quantitativeColorProp, featureValueColormap, featureValueColormapRange, obsSetColor, obsSetSelection, quantitativeColorMax, pointsAreSegmentationCentroids, spatialLayerOpacityUnselected } = layerCoordination;
|
|
281162
281542
|
const defaultColor = getDefaultColor(theme);
|
|
281163
281543
|
const opacity2 = spatialLayerOpacity ?? 1;
|
|
@@ -281257,6 +281637,12 @@ function getPointsShader(layerCoordination) {
|
|
|
281257
281637
|
}
|
|
281258
281638
|
return getSpatialLayerColorShader(staticColor, opacity2, pointMarkerBorderWidth);
|
|
281259
281639
|
}
|
|
281640
|
+
function getPointsShader(layerCoordination) {
|
|
281641
|
+
const { pointMarkerSize = DEFAULT_POINT_MARKER_SIZE } = layerCoordination;
|
|
281642
|
+
const shader = getPointsShaderInner(layerCoordination);
|
|
281643
|
+
return shader.replace(/setPointMarkerBorderWidth\([^)]*\);/g, (match2) => `${match2}
|
|
281644
|
+
${pointMarkerSizeGlsl(pointMarkerSize)}`);
|
|
281645
|
+
}
|
|
281260
281646
|
const DEFAULT_NG_DIMENSIONS = {
|
|
281261
281647
|
x: [1, "nm"],
|
|
281262
281648
|
y: [1, "nm"],
|
|
@@ -281271,6 +281657,56 @@ const DEFAULT_NG_PROPS = {
|
|
|
281271
281657
|
dimensions: DEFAULT_NG_DIMENSIONS,
|
|
281272
281658
|
layers: []
|
|
281273
281659
|
};
|
|
281660
|
+
const MIN_ANNOTATION_SPACING = 0.0625;
|
|
281661
|
+
const MAX_ANNOTATION_SPACING = 65536;
|
|
281662
|
+
function sanitizeNgCameraState(cameraState, fallbacks = {}) {
|
|
281663
|
+
const defaults2 = {
|
|
281664
|
+
projectionOrientation: [0, 0, 0, 1],
|
|
281665
|
+
projectionScale: DEFAULT_NG_PROPS.projectionScale,
|
|
281666
|
+
crossSectionScale: DEFAULT_NG_PROPS.crossSectionScale,
|
|
281667
|
+
...fallbacks
|
|
281668
|
+
};
|
|
281669
|
+
const result = {};
|
|
281670
|
+
Object.entries(cameraState ?? {}).forEach(([key2, value2]) => {
|
|
281671
|
+
const validate2 = NG_CAMERA_VALIDATORS[key2];
|
|
281672
|
+
if (!validate2) {
|
|
281673
|
+
if (value2 !== void 0)
|
|
281674
|
+
result[key2] = value2;
|
|
281675
|
+
return;
|
|
281676
|
+
}
|
|
281677
|
+
if (validate2(value2)) {
|
|
281678
|
+
result[key2] = value2;
|
|
281679
|
+
} else if (key2 in defaults2) {
|
|
281680
|
+
console.warn(`Invalid initialNgCameraState.${key2}:`, value2, "— using default", defaults2[key2]);
|
|
281681
|
+
result[key2] = defaults2[key2];
|
|
281682
|
+
} else {
|
|
281683
|
+
console.warn(`Invalid initialNgCameraState.${key2}:`, value2, "— ignored");
|
|
281684
|
+
}
|
|
281685
|
+
});
|
|
281686
|
+
return result;
|
|
281687
|
+
}
|
|
281688
|
+
function isValidNgDimensions(dims) {
|
|
281689
|
+
return !!dims && typeof dims === "object" && ["x", "y", "z"].every((axis2) => Array.isArray(dims[axis2]) && dims[axis2].length === 2 && Number.isFinite(dims[axis2][0]) && dims[axis2][0] > 0 && typeof dims[axis2][1] === "string");
|
|
281690
|
+
}
|
|
281691
|
+
function resolveViewerDimensions(annotationSources, viewerDimensionsOverride = null) {
|
|
281692
|
+
if (viewerDimensionsOverride != null) {
|
|
281693
|
+
if (isValidNgDimensions(viewerDimensionsOverride))
|
|
281694
|
+
return viewerDimensionsOverride;
|
|
281695
|
+
console.warn("Ignoring invalid viewerDimensions prop; expected { x: [scale, unit], y: [scale, unit], z: [scale, unit] }.");
|
|
281696
|
+
}
|
|
281697
|
+
const declared = (annotationSources ?? []).map(({ name: scope, neuroglancerOptions }) => ({
|
|
281698
|
+
scope,
|
|
281699
|
+
dims: neuroglancerOptions?.transform?.outputDimensions
|
|
281700
|
+
})).filter(({ dims }) => dims);
|
|
281701
|
+
if (!declared.length)
|
|
281702
|
+
return DEFAULT_NG_DIMENSIONS;
|
|
281703
|
+
const [{ dims: viewerDims }] = declared;
|
|
281704
|
+
const mismatched = declared.filter(({ dims }) => !isEqual$3(dims, viewerDims));
|
|
281705
|
+
if (mismatched.length) {
|
|
281706
|
+
console.warn(`Point layers declare different outputDimensions; using those of "${declared[0].scope}" for the viewer. Layers ${mismatched.map(({ scope }) => `"${scope}"`).join(", ")} keep their own outputDimensions in their source transform.`);
|
|
281707
|
+
}
|
|
281708
|
+
return viewerDims;
|
|
281709
|
+
}
|
|
281274
281710
|
function toPrecomputedSource(url) {
|
|
281275
281711
|
if (!url) {
|
|
281276
281712
|
throw new Error("toPrecomputedSource: URL is required");
|
|
@@ -281284,20 +281720,92 @@ function toNgLayerName(dataType, layerScope, channelScope = null) {
|
|
|
281284
281720
|
if (dataType === DataType$3.OBS_POINTS) {
|
|
281285
281721
|
return `obsPoints-${layerScope}`;
|
|
281286
281722
|
}
|
|
281723
|
+
if (dataType === DataType$3.OBS_LOCATIONS) {
|
|
281724
|
+
return `obsLocations-${layerScope}-${channelScope}`;
|
|
281725
|
+
}
|
|
281287
281726
|
throw new Error(`Unsupported data type: ${dataType}`);
|
|
281288
281727
|
}
|
|
281289
|
-
function
|
|
281290
|
-
return segmentationLayerScopes.
|
|
281291
|
-
const
|
|
281292
|
-
|
|
281293
|
-
|
|
281294
|
-
|
|
281295
|
-
|
|
281296
|
-
|
|
281728
|
+
function getSegmentationCentroidSources({ segmentationLayerScopes, segmentationChannelScopesByLayer, obsSegmentationsLocationsData }) {
|
|
281729
|
+
return (segmentationLayerScopes ?? []).flatMap((layerScope) => (segmentationChannelScopesByLayer?.[layerScope] ?? []).map((channelScope) => {
|
|
281730
|
+
const locationsData = obsSegmentationsLocationsData?.[layerScope]?.[channelScope];
|
|
281731
|
+
if (locationsData?.obsLocationsTilingType !== "neuroglancer" || !locationsData.neuroglancerUrl) {
|
|
281732
|
+
return null;
|
|
281733
|
+
}
|
|
281734
|
+
return {
|
|
281735
|
+
layerScope,
|
|
281736
|
+
channelScope,
|
|
281737
|
+
name: toNgLayerName(DataType$3.OBS_LOCATIONS, layerScope, channelScope),
|
|
281738
|
+
url: locationsData.neuroglancerUrl,
|
|
281739
|
+
neuroglancerOptions: locationsData.neuroglancerOptions ?? {},
|
|
281740
|
+
neuroglancerInfo: locationsData.neuroglancerInfo ?? null
|
|
281741
|
+
};
|
|
281742
|
+
}).filter(Boolean));
|
|
281743
|
+
}
|
|
281744
|
+
const CENTROID_POINT_STROKE_WIDTH = 0.2;
|
|
281745
|
+
function getCentroidShaderParams(layerCoordination, channelCoordination) {
|
|
281746
|
+
const { spatialLayerOpacity } = layerCoordination || {};
|
|
281747
|
+
const { spatialChannelOpacity, spatialChannelColor, obsColorEncoding, featureValueColormap, featureValueColormapRange, obsSetColor, obsSetSelection, additionalObsSets, spatialSegmentationStrokeWidth } = channelCoordination || {};
|
|
281748
|
+
return {
|
|
281749
|
+
spatialLayerOpacity: (spatialLayerOpacity ?? 1) * (spatialChannelOpacity ?? 1),
|
|
281750
|
+
// Segmentation channels use 'spatialChannelColor' for a static color,
|
|
281751
|
+
// whereas the points shader uses 'spatialLayerColor'.
|
|
281752
|
+
obsColorEncoding: obsColorEncoding === "spatialChannelColor" ? "spatialLayerColor" : obsColorEncoding,
|
|
281753
|
+
spatialLayerColor: spatialChannelColor,
|
|
281754
|
+
featureValueColormap,
|
|
281755
|
+
featureValueColormapRange,
|
|
281756
|
+
obsSetColor,
|
|
281757
|
+
obsSetSelection,
|
|
281758
|
+
additionalObsSets,
|
|
281759
|
+
// Only show the centroids of the selected obsSets.
|
|
281760
|
+
featureFilterMode: "featureSelection",
|
|
281761
|
+
pointMarkerBorderWidth: spatialSegmentationStrokeWidth ?? CENTROID_POINT_STROKE_WIDTH,
|
|
281762
|
+
// The points represent the centroids of the segmentations.
|
|
281763
|
+
// We pass this down to the getPointsShader, to determine whether to interpret
|
|
281764
|
+
// `obsColorEncoding === 'geneSelection'` as a
|
|
281765
|
+
// quantitative color encoding or a categorical color encoding.
|
|
281766
|
+
pointsAreSegmentationCentroids: true
|
|
281767
|
+
};
|
|
281297
281768
|
}
|
|
281298
|
-
function
|
|
281769
|
+
function toAnnotationSource(url, ngOptions, viewerDimensions) {
|
|
281770
|
+
return {
|
|
281771
|
+
url: toPrecomputedSource(url),
|
|
281772
|
+
subsources: {
|
|
281773
|
+
default: true
|
|
281774
|
+
},
|
|
281775
|
+
enableDefaultSubsources: false,
|
|
281776
|
+
...ngOptions?.transform?.matrix ? {
|
|
281777
|
+
transform: {
|
|
281778
|
+
matrix: ngOptions.transform.matrix,
|
|
281779
|
+
// Layer-local output space; falls back to the viewer's
|
|
281780
|
+
// dimensions (order-independent), never another layer's.
|
|
281781
|
+
outputDimensions: ngOptions.transform?.outputDimensions ?? viewerDimensions
|
|
281782
|
+
}
|
|
281783
|
+
} : {}
|
|
281784
|
+
};
|
|
281785
|
+
}
|
|
281786
|
+
function getQuantitativeColorMax(ngOptions, obsColorEncoding) {
|
|
281787
|
+
const quantitativeColorMax = ngOptions?.quantitativeColorMax;
|
|
281788
|
+
if (!quantitativeColorMax && obsColorEncoding === "geneSelection") {
|
|
281789
|
+
console.warn("quantitativeColorMax not specified in options — defaulting to 1.0 (no normalization)");
|
|
281790
|
+
}
|
|
281791
|
+
return quantitativeColorMax ?? 1;
|
|
281792
|
+
}
|
|
281793
|
+
function useNeuroglancerViewerState(theme, showAxisLines, segmentationLayerScopes, segmentationChannelScopesByLayer, segmentationLayerCoordination, segmentationChannelCoordination, obsSegmentationsUrls, obsSegmentationsData, obsSegmentationsLocationsData, pointLayerScopes, pointLayerCoordination, obsPointsUrls, obsPointsData, pointMultiIndicesData, viewerDimensionsOverride = null) {
|
|
281299
281794
|
const viewerState = useMemoCustomComparison(() => {
|
|
281300
281795
|
let result = cloneDeep$1(DEFAULT_NG_PROPS);
|
|
281796
|
+
const centroidSources = getSegmentationCentroidSources({
|
|
281797
|
+
segmentationLayerScopes,
|
|
281798
|
+
segmentationChannelScopesByLayer,
|
|
281799
|
+
obsSegmentationsLocationsData
|
|
281800
|
+
});
|
|
281801
|
+
const viewerDimensions = resolveViewerDimensions([
|
|
281802
|
+
...pointLayerScopes.map((layerScope) => ({
|
|
281803
|
+
name: toNgLayerName(DataType$3.OBS_POINTS, layerScope),
|
|
281804
|
+
neuroglancerOptions: obsPointsData?.[layerScope]?.neuroglancerOptions
|
|
281805
|
+
})),
|
|
281806
|
+
...centroidSources
|
|
281807
|
+
], viewerDimensionsOverride);
|
|
281808
|
+
result = { ...result, dimensions: viewerDimensions };
|
|
281301
281809
|
segmentationLayerScopes.forEach((layerScope) => {
|
|
281302
281810
|
const layerCoordination = segmentationLayerCoordination[0][layerScope];
|
|
281303
281811
|
const channelScopes = segmentationChannelScopesByLayer[layerScope] || [];
|
|
@@ -281318,8 +281826,6 @@ function useNeuroglancerViewerState(theme, showAxisLines, segmentationLayerScope
|
|
|
281318
281826
|
result = {
|
|
281319
281827
|
...result,
|
|
281320
281828
|
showAxisLines,
|
|
281321
|
-
showDefaultAnnotations: false,
|
|
281322
|
-
// this removes the yellow box around pointsLayer
|
|
281323
281829
|
layers: [
|
|
281324
281830
|
...result.layers,
|
|
281325
281831
|
{
|
|
@@ -281339,31 +281845,45 @@ function useNeuroglancerViewerState(theme, showAxisLines, segmentationLayerScope
|
|
|
281339
281845
|
});
|
|
281340
281846
|
}
|
|
281341
281847
|
});
|
|
281848
|
+
centroidSources.forEach(({ layerScope, channelScope, name: name2, url, neuroglancerOptions: ngOptions }) => {
|
|
281849
|
+
const layerCoordination = segmentationLayerCoordination[0][layerScope];
|
|
281850
|
+
const channelCoordination = segmentationChannelCoordination[0]?.[layerScope]?.[channelScope];
|
|
281851
|
+
const centroidShaderParams = getCentroidShaderParams(layerCoordination, channelCoordination);
|
|
281852
|
+
const shader = getPointsShader({
|
|
281853
|
+
theme,
|
|
281854
|
+
...centroidShaderParams,
|
|
281855
|
+
quantitativeColorProp: ngOptions.quantitativeColorProp,
|
|
281856
|
+
quantitativeColorMax: getQuantitativeColorMax(ngOptions, centroidShaderParams.obsColorEncoding)
|
|
281857
|
+
});
|
|
281858
|
+
result = {
|
|
281859
|
+
...result,
|
|
281860
|
+
layers: [
|
|
281861
|
+
...result.layers,
|
|
281862
|
+
{
|
|
281863
|
+
type: "annotation",
|
|
281864
|
+
source: toAnnotationSource(url, ngOptions, viewerDimensions),
|
|
281865
|
+
tab: "annotations",
|
|
281866
|
+
shader,
|
|
281867
|
+
name: name2,
|
|
281868
|
+
// Both layer and channel visibility must be true, as for the segmentation layer.
|
|
281869
|
+
visible: Boolean(layerCoordination?.spatialLayerVisible && channelCoordination?.spatialChannelVisible),
|
|
281870
|
+
projectionAnnotationSpacing: ngOptions.projectionAnnotationSpacing ?? 1
|
|
281871
|
+
}
|
|
281872
|
+
],
|
|
281873
|
+
selectedLayer: {
|
|
281874
|
+
layer: name2
|
|
281875
|
+
}
|
|
281876
|
+
};
|
|
281877
|
+
});
|
|
281342
281878
|
pointLayerScopes.forEach((layerScope) => {
|
|
281343
281879
|
const layerCoordination = pointLayerCoordination[0][layerScope];
|
|
281344
281880
|
const layerData = obsPointsData[layerScope];
|
|
281345
281881
|
const layerUrl = obsPointsUrls[layerScope]?.[0]?.url;
|
|
281346
281882
|
const ngOptions = layerData?.neuroglancerOptions;
|
|
281347
|
-
if (ngOptions?.transform?.matrix && ngOptions?.transform?.outputDimensions) {
|
|
281348
|
-
result = {
|
|
281349
|
-
...result,
|
|
281350
|
-
dimensions: ngOptions.transform.outputDimensions ?? DEFAULT_NG_DIMENSIONS
|
|
281351
|
-
};
|
|
281352
|
-
}
|
|
281353
|
-
const pointsAreSegmentationCentroids = pointsHaveMatchingSegmentation({
|
|
281354
|
-
pointObsType: layerCoordination?.obsType,
|
|
281355
|
-
segmentationLayerScopes,
|
|
281356
|
-
segmentationChannelScopesByLayer,
|
|
281357
|
-
segmentationChannelCoordination
|
|
281358
|
-
});
|
|
281359
281883
|
const featureIndex = pointMultiIndicesData[layerScope]?.featureIndex;
|
|
281360
281884
|
if (layerUrl && layerData) {
|
|
281361
|
-
const { spatialLayerVisible, spatialLayerOpacity, spatialLayerOpacityUnselected, obsColorEncoding, spatialLayerColor, featureSelection, featureFilterMode, featureColor, spatialPointStrokeWidth, featureValueColormap, featureValueColormapRange } = layerCoordination || {};
|
|
281362
|
-
const
|
|
281363
|
-
if (!quantitativeColorMax && obsColorEncoding === "geneSelection") {
|
|
281364
|
-
console.warn("quantitativeColorMax not specified in options — defaulting to 1.0 (no normalization)");
|
|
281365
|
-
}
|
|
281366
|
-
const quantitativeColorMaxSelected = quantitativeColorMax ?? 1;
|
|
281885
|
+
const { spatialLayerVisible, spatialLayerOpacity, spatialLayerOpacityUnselected, obsColorEncoding, spatialLayerColor, featureSelection, featureFilterMode, featureColor, spatialPointStrokeWidth, spatialPointProjectionSpacing, featureValueColormap, featureValueColormapRange, spatialPointRadius } = layerCoordination || {};
|
|
281886
|
+
const quantitativeColorMaxSelected = getQuantitativeColorMax(ngOptions, obsColorEncoding);
|
|
281367
281887
|
const shader = getPointsShader({
|
|
281368
281888
|
theme,
|
|
281369
281889
|
featureIndex,
|
|
@@ -281385,7 +281905,9 @@ function useNeuroglancerViewerState(theme, showAxisLines, segmentationLayerScope
|
|
|
281385
281905
|
obsSetSelection: layerCoordination.obsSetSelection,
|
|
281386
281906
|
additionalObsSets: layerCoordination.additionalObsSets,
|
|
281387
281907
|
quantitativeColorMax: quantitativeColorMaxSelected,
|
|
281388
|
-
|
|
281908
|
+
// spatialPointRadius is a radius (consistent with spatialSpotRadius), but NG's
|
|
281909
|
+
// own setPointMarkerSize expects a diameter, so double it here.
|
|
281910
|
+
pointMarkerSize: (spatialPointRadius ?? DEFAULT_POINT_MARKER_SIZE / 2) * 2
|
|
281389
281911
|
});
|
|
281390
281912
|
result = {
|
|
281391
281913
|
...result,
|
|
@@ -281393,26 +281915,15 @@ function useNeuroglancerViewerState(theme, showAxisLines, segmentationLayerScope
|
|
|
281393
281915
|
...result.layers,
|
|
281394
281916
|
{
|
|
281395
281917
|
type: "annotation",
|
|
281396
|
-
source:
|
|
281397
|
-
url: toPrecomputedSource(layerUrl),
|
|
281398
|
-
subsources: {
|
|
281399
|
-
default: true
|
|
281400
|
-
},
|
|
281401
|
-
enableDefaultSubsources: false,
|
|
281402
|
-
...ngOptions?.transform?.matrix ? {
|
|
281403
|
-
transform: {
|
|
281404
|
-
matrix: ngOptions.transform.matrix,
|
|
281405
|
-
outputDimensions: ngOptions.transform?.outputDimensions ?? result.dimensions
|
|
281406
|
-
}
|
|
281407
|
-
} : {}
|
|
281408
|
-
},
|
|
281918
|
+
source: toAnnotationSource(layerUrl, ngOptions, viewerDimensions),
|
|
281409
281919
|
tab: "annotations",
|
|
281410
281920
|
shader,
|
|
281411
281921
|
name: toNgLayerName(DataType$3.OBS_POINTS, layerScope),
|
|
281412
281922
|
visible: spatialLayerVisible,
|
|
281413
281923
|
// Options from layerData.neuroglancerOptions
|
|
281414
281924
|
// like projectionAnnotationSpacing:
|
|
281415
|
-
|
|
281925
|
+
// Coordination value (LC) > file option > 1.0; clamped to NG's valid range.
|
|
281926
|
+
projectionAnnotationSpacing: Math.min(MAX_ANNOTATION_SPACING, Math.max(MIN_ANNOTATION_SPACING, spatialPointProjectionSpacing ?? ngOptions?.projectionAnnotationSpacing ?? 1))
|
|
281416
281927
|
}
|
|
281417
281928
|
],
|
|
281418
281929
|
// TODO: is this needed?
|
|
@@ -281435,160 +281946,129 @@ function useNeuroglancerViewerState(theme, showAxisLines, segmentationLayerScope
|
|
|
281435
281946
|
segmentationChannelCoordination,
|
|
281436
281947
|
obsSegmentationsUrls,
|
|
281437
281948
|
obsSegmentationsData,
|
|
281949
|
+
obsSegmentationsLocationsData,
|
|
281438
281950
|
pointLayerScopes,
|
|
281439
281951
|
pointLayerCoordination,
|
|
281440
281952
|
obsPointsUrls,
|
|
281441
281953
|
obsPointsData,
|
|
281442
|
-
pointMultiIndicesData
|
|
281954
|
+
pointMultiIndicesData,
|
|
281955
|
+
viewerDimensionsOverride
|
|
281443
281956
|
}, customIsEqualForInitialViewerState);
|
|
281444
281957
|
return viewerState;
|
|
281445
281958
|
}
|
|
281446
|
-
|
|
281447
|
-
|
|
281448
|
-
|
|
281449
|
-
|
|
281450
|
-
const [scale2, unit2] = dimensions.x;
|
|
281451
|
-
const factor = UNIT_TO_METERS[unit2];
|
|
281452
|
-
return factor ? scale2 * factor : null;
|
|
281959
|
+
function TooltipChild(props) {
|
|
281960
|
+
const { x: x2, y: y2, parentUuid, sourceUuid, width: width2, height: height2, info: info2, tooltipsVisible, tooltipCrosshairsVisible, featureType, featureLabelsMap } = props;
|
|
281961
|
+
const visible = parentUuid === sourceUuid ? tooltipsVisible : tooltipCrosshairsVisible;
|
|
281962
|
+
return visible ? jsx$1(Tooltip2D, { x: x2, y: y2, parentUuid, sourceUuid, parentWidth: width2, parentHeight: height2, children: jsx$1(TooltipContent, { info: info2, featureType, featureLabelsMap }) }) : null;
|
|
281453
281963
|
}
|
|
281454
|
-
|
|
281455
|
-
|
|
281456
|
-
|
|
281457
|
-
|
|
281458
|
-
|
|
281459
|
-
|
|
281460
|
-
|
|
281461
|
-
|
|
281462
|
-
|
|
281463
|
-
const [ax, ay, az, aw] = a2;
|
|
281464
|
-
const [bx, by, bz, bw] = b2;
|
|
281465
|
-
return [
|
|
281466
|
-
aw * bx + ax * bw + ay * bz - az * by,
|
|
281467
|
-
aw * by - ax * bz + ay * bw + az * bx,
|
|
281468
|
-
aw * bz + ax * by - ay * bx + az * bw,
|
|
281469
|
-
aw * bw - ax * bx - ay * by - az * bz
|
|
281470
|
-
];
|
|
281471
|
-
};
|
|
281472
|
-
const deg2rad = (d) => d * Math.PI / 180;
|
|
281473
|
-
function applyColormap(colormap, t4) {
|
|
281474
|
-
const tClamped = Math.max(0, Math.min(1, t4));
|
|
281475
|
-
const interpolators = {
|
|
281476
|
-
plasma: interpolatePlasma,
|
|
281477
|
-
viridis: interpolateViridis,
|
|
281478
|
-
jet: interpolateJet,
|
|
281479
|
-
greys: interpolateGreys
|
|
281964
|
+
function getObsInfo(obsSetsData, obsType, obsId) {
|
|
281965
|
+
let result = { [`${capitalize$3(obsType)} ID`]: obsId };
|
|
281966
|
+
const obsMembership = obsSetsData?.obsSetsMembership?.get(obsId) || [];
|
|
281967
|
+
result = {
|
|
281968
|
+
...result,
|
|
281969
|
+
...Object.fromEntries(obsMembership.flatMap((path2) => path2.slice(1).map((pathEl, elLevel) => [
|
|
281970
|
+
`${path2[0]}${path2.length > 2 ? ` L${elLevel + 1}` : ""}`,
|
|
281971
|
+
pathEl
|
|
281972
|
+
])))
|
|
281480
281973
|
};
|
|
281481
|
-
|
|
281482
|
-
return fn2(tClamped);
|
|
281974
|
+
return result;
|
|
281483
281975
|
}
|
|
281484
|
-
function
|
|
281485
|
-
|
|
281486
|
-
|
|
281487
|
-
|
|
281488
|
-
|
|
281489
|
-
|
|
281490
|
-
|
|
281491
|
-
|
|
281976
|
+
function NeuroglancerTooltipSubscriber(props) {
|
|
281977
|
+
const { parentUuid, width: width2, height: height2, hoverCoord, getViewProjectionMat, getObsPosition, obsHighlight: viewObsHighlight, featureType, featureLabelsMap, segmentationLayerScopes, segmentationChannelScopesByLayer, segmentationChannelCoordination, obsSegmentationsSetsData } = props;
|
|
281978
|
+
const sourceUuid = useComponentHover();
|
|
281979
|
+
const isSource = sourceUuid === parentUuid;
|
|
281980
|
+
const mat = getViewProjectionMat?.();
|
|
281981
|
+
let yOffset = -30;
|
|
281982
|
+
return jsx$1(Fragment, { children: segmentationLayerScopes?.flatMap((layerScope) => segmentationChannelScopesByLayer?.[layerScope]?.map((channelScope) => {
|
|
281983
|
+
const { obsType, obsHighlight: channelObsHighlight, tooltipsVisible, tooltipCrosshairsVisible, spatialChannelVisible } = segmentationChannelCoordination?.[0]?.[layerScope]?.[channelScope] || {};
|
|
281984
|
+
const showTooltip = tooltipsVisible ?? true;
|
|
281985
|
+
const showCrosshair = tooltipCrosshairsVisible ?? true;
|
|
281986
|
+
const obsHighlight = channelObsHighlight ?? viewObsHighlight;
|
|
281987
|
+
if (!obsHighlight || spatialChannelVisible === false || !showTooltip && !showCrosshair)
|
|
281988
|
+
return null;
|
|
281989
|
+
const obsInfo = getObsInfo(obsSegmentationsSetsData?.[layerScope]?.[channelScope], obsType, String(obsHighlight));
|
|
281990
|
+
const coord = isSource ? hoverCoord : getObsPosition?.(obsHighlight);
|
|
281991
|
+
const xy = coord ? projectToScreen(mat, coord, width2, height2) : null;
|
|
281992
|
+
if (!xy)
|
|
281993
|
+
return null;
|
|
281994
|
+
return jsx$1(TooltipChild, {
|
|
281995
|
+
parentUuid,
|
|
281996
|
+
sourceUuid,
|
|
281997
|
+
tooltipsVisible: showTooltip,
|
|
281998
|
+
tooltipCrosshairsVisible: showCrosshair,
|
|
281999
|
+
width: width2,
|
|
282000
|
+
height: height2,
|
|
282001
|
+
info: obsInfo,
|
|
282002
|
+
x: xy[0],
|
|
282003
|
+
// Stack offset only applies to tooltips; crosshairs must sit on the point.
|
|
282004
|
+
y: isSource ? xy[1] + (yOffset += 20 + 15 * Object.keys(obsInfo).length) : xy[1],
|
|
282005
|
+
featureType,
|
|
282006
|
+
featureLabelsMap
|
|
282007
|
+
}, `${layerScope}-${channelScope}`);
|
|
282008
|
+
})) });
|
|
282009
|
+
}
|
|
282010
|
+
const MIN_EXP = -4;
|
|
282011
|
+
const MAX_EXP = 4;
|
|
282012
|
+
const toExp = (v) => Math.min(MAX_EXP, Math.max(MIN_EXP, Math.log2(v)));
|
|
282013
|
+
function CheckboxRow({ label: label2, checked, onChange, id: id2, disabled = false }) {
|
|
282014
|
+
const { classes: classes2 } = usePlotOptionsStyles();
|
|
282015
|
+
return jsxs(TableRow, { children: [jsx$1(TableCell, { className: classes2.labelCell, variant: "head", scope: "row", children: jsx$1("label", { htmlFor: id2, children: label2 }) }), jsx$1(TableCell, { className: classes2.inputCell, variant: "body", children: jsx$1(Checkbox$1, { className: classes2.checkbox, checked, disabled, onChange: (e3, v) => onChange(v), color: "default", slotProps: { input: { id: id2, "aria-label": label2 } } }) })] });
|
|
281492
282016
|
}
|
|
281493
|
-
|
|
281494
|
-
|
|
281495
|
-
|
|
281496
|
-
const scale2 = valueGreaterThanEpsilon(prev2?.projectionScale, next4?.projectionScale, eps.projectionScale);
|
|
281497
|
-
const posHard = valueGreaterThanEpsilon(prev2?.position, next4?.position, eps.position);
|
|
281498
|
-
const rot2 = valueGreaterThanEpsilon(prev2?.projectionOrientation, next4?.projectionOrientation, eps.projectionOrientation);
|
|
281499
|
-
const posSoft = !posHard && scale2 && valueGreaterThanEpsilon(prev2?.position, next4?.position, SOFT_POS_FACTOR);
|
|
281500
|
-
const pos = posHard || posSoft;
|
|
281501
|
-
return { changed: scale2 || pos || rot2, scale: scale2, pos, rot: rot2 };
|
|
282017
|
+
function SliderRow({ label: label2, id: id2, children: children3 }) {
|
|
282018
|
+
const { classes: classes2 } = usePlotOptionsStyles();
|
|
282019
|
+
return jsxs(TableRow, { children: [jsx$1(TableCell, { className: classes2.labelCell, variant: "head", scope: "row", children: jsx$1("label", { htmlFor: id2, children: label2 }) }), jsx$1(TableCell, { className: classes2.inputCell, variant: "body", children: children3 })] });
|
|
281502
282020
|
}
|
|
281503
|
-
function
|
|
281504
|
-
const
|
|
281505
|
-
const
|
|
281506
|
-
const
|
|
281507
|
-
|
|
281508
|
-
|
|
281509
|
-
|
|
281510
|
-
|
|
281511
|
-
|
|
281512
|
-
|
|
281513
|
-
|
|
281514
|
-
|
|
281515
|
-
];
|
|
282021
|
+
function PointLayerRows({ layer, baseId }) {
|
|
282022
|
+
const { classes: classes2 } = usePlotOptionsStyles();
|
|
282023
|
+
const { label: label2, spacing: spacing2, setSpacing } = layer;
|
|
282024
|
+
const [exp2, setExp] = useState(toExp(spacing2 ?? 1));
|
|
282025
|
+
useEffect(() => {
|
|
282026
|
+
setExp(toExp(spacing2 ?? 1));
|
|
282027
|
+
}, [spacing2]);
|
|
282028
|
+
const spacingId = `${baseId}-spacing`;
|
|
282029
|
+
return jsx$1(Fragment, { children: setSpacing ? jsx$1(SliderRow, { label: `${label2} spacing (3D)`, id: spacingId, children: jsx$1(Slider, { slotProps: {
|
|
282030
|
+
root: { className: classes2.slider },
|
|
282031
|
+
valueLabel: { className: classes2.sliderValueLabel }
|
|
282032
|
+
}, value: exp2, min: MIN_EXP, max: MAX_EXP, step: 0.5, scale: (x2) => 2 ** x2, valueLabelDisplay: "auto", valueLabelFormat: (v) => v <= 0.0625 ? "all" : v.toFixed(v < 1 ? 3 : 1), onChange: (e3, v) => setExp(v), onChangeCommitted: (e3, v) => setSpacing(2 ** v), id: spacingId, "aria-label": `${label2} projection spacing (lower shows more points)` }) }) : null });
|
|
281516
282033
|
}
|
|
281517
|
-
function
|
|
281518
|
-
const
|
|
281519
|
-
|
|
281520
|
-
|
|
281521
|
-
|
|
281522
|
-
|
|
281523
|
-
|
|
281524
|
-
|
|
281525
|
-
|
|
281526
|
-
|
|
281527
|
-
|
|
281528
|
-
|
|
281529
|
-
|
|
281530
|
-
|
|
281531
|
-
|
|
281532
|
-
|
|
281533
|
-
|
|
281534
|
-
|
|
281535
|
-
|
|
281536
|
-
|
|
281537
|
-
|
|
281538
|
-
id: String(segId),
|
|
281539
|
-
// mesh segment ID - use for segments array
|
|
281540
|
-
phenotype: Number(phenotype),
|
|
281541
|
-
x: x2,
|
|
281542
|
-
y: y2,
|
|
281543
|
-
z: z2
|
|
281544
|
-
});
|
|
281545
|
-
}
|
|
282034
|
+
function NeuroglancerOptions(props) {
|
|
282035
|
+
const { axisLinesVisible, setAxisLinesVisible, boundsVisible, setBoundsVisible, pointLayers = [], orthographic: orthographic2, scaleBarVisible, setScaleBarVisible, hideUnselected, setHideUnselected, backgroundTheme, setBackgroundTheme } = props;
|
|
282036
|
+
const id2 = useId$2();
|
|
282037
|
+
return jsxs(OptionsContainer, { children: [setBackgroundTheme ? jsx$1(CheckboxRow, { label: "Light background", id: `ng-light-background-${id2}`, checked: backgroundTheme === "light", onChange: (v) => setBackgroundTheme(v ? "light" : "dark") }) : null, setAxisLinesVisible ? jsx$1(CheckboxRow, { label: "Axis lines", id: `ng-axis-lines-${id2}`, checked: Boolean(axisLinesVisible), onChange: setAxisLinesVisible }) : null, setBoundsVisible ? jsx$1(CheckboxRow, { label: "Bounds", id: `ng-bounds-${id2}`, checked: Boolean(boundsVisible), onChange: setBoundsVisible }) : null, setScaleBarVisible ? jsx$1(
|
|
282038
|
+
CheckboxRow,
|
|
282039
|
+
{
|
|
282040
|
+
// Neuroglancer only draws the scale bar in orthographic projection.
|
|
282041
|
+
label: "Scale bar",
|
|
282042
|
+
id: `ng-scale-bar-${id2}`,
|
|
282043
|
+
checked: Boolean(scaleBarVisible) && Boolean(orthographic2),
|
|
282044
|
+
disabled: !orthographic2,
|
|
282045
|
+
onChange: setScaleBarVisible
|
|
282046
|
+
}
|
|
282047
|
+
) : null, pointLayers.map((layer) => jsx$1(PointLayerRows, { layer, baseId: `ng-points-${id2}-${layer.scope}` }, layer.scope)), setHideUnselected ? jsx$1(
|
|
282048
|
+
CheckboxRow,
|
|
282049
|
+
{
|
|
282050
|
+
// Applies when cells are colored by set selection and at least one set is selected.
|
|
282051
|
+
label: "Hide unselected cells",
|
|
282052
|
+
id: `ng-hide-unselected-${id2}`,
|
|
282053
|
+
checked: Boolean(hideUnselected),
|
|
282054
|
+
onChange: setHideUnselected
|
|
281546
282055
|
}
|
|
281547
|
-
}
|
|
281548
|
-
return results;
|
|
281549
|
-
}
|
|
281550
|
-
const remapCellColors = (ngCellColors, cellIdToMeshIdRef) => {
|
|
281551
|
-
const remapped = {};
|
|
281552
|
-
Object.entries(ngCellColors).forEach(([cellId, color2]) => {
|
|
281553
|
-
const meshId = cellIdToMeshIdRef.current[cellId] ?? cellId;
|
|
281554
|
-
remapped[meshId] = color2;
|
|
281555
|
-
});
|
|
281556
|
-
return remapped;
|
|
281557
|
-
};
|
|
281558
|
-
const autoColorCache = /* @__PURE__ */ new Map();
|
|
281559
|
-
function hashStringToIndex(str, mod2) {
|
|
281560
|
-
let hash2 = 0;
|
|
281561
|
-
for (let i2 = 0; i2 < str.length; i2 += 1) {
|
|
281562
|
-
hash2 = (hash2 * 31 + str.charCodeAt(i2)) % 2 ** 32;
|
|
281563
|
-
}
|
|
281564
|
-
return hash2 % mod2;
|
|
281565
|
-
}
|
|
281566
|
-
function autoColorForId(id2) {
|
|
281567
|
-
const key2 = String(id2);
|
|
281568
|
-
let color2 = autoColorCache.get(key2);
|
|
281569
|
-
if (!color2) {
|
|
281570
|
-
color2 = PALETTE[hashStringToIndex(key2, PALETTE.length)].map((c2) => c2.toString(16).padStart(2, "0")).join("");
|
|
281571
|
-
color2 = `#${color2}`;
|
|
281572
|
-
autoColorCache.set(key2, color2);
|
|
281573
|
-
}
|
|
281574
|
-
return color2;
|
|
282056
|
+
) : null] });
|
|
281575
282057
|
}
|
|
281576
282058
|
const ROTATION_EPS = 1e-3;
|
|
281577
282059
|
const TARGET_EPS = 0.5;
|
|
281578
282060
|
const MESH_LOAD_THRESHOLD = 100;
|
|
281579
282061
|
const MESH_LOADING_OVERLAY_TIMEOUT = 1500;
|
|
281580
282062
|
const GUIDE_URL = "https://vitessce.io/docs/ng-guide/";
|
|
281581
|
-
const
|
|
282063
|
+
const DEFAULT_UNSELECTED_OPACITY = 0.25;
|
|
281582
282064
|
const LAST_INTERACTION_SOURCE = {
|
|
281583
282065
|
vitessce: "vitessce",
|
|
281584
282066
|
neuroglancer: "neuroglancer"
|
|
281585
282067
|
};
|
|
281586
|
-
function rgbToHex$1(rgb2) {
|
|
281587
|
-
return typeof rgb2 === "string" ? rgb2 : `#${rgb2.map((c2) => c2.toString(16).padStart(2, "0")).join("")}`;
|
|
281588
|
-
}
|
|
281589
282068
|
function NeuroglancerSubscriber(props) {
|
|
281590
282069
|
const {
|
|
281591
282070
|
uuid: uuid2,
|
|
282071
|
+
disableTooltip = false,
|
|
281592
282072
|
coordinationScopes: coordinationScopesRaw,
|
|
281593
282073
|
coordinationScopesBy: coordinationScopesByRaw,
|
|
281594
282074
|
closeButtonVisible,
|
|
@@ -281613,27 +282093,35 @@ function NeuroglancerSubscriber(props) {
|
|
|
281613
282093
|
detailUseSelection = false,
|
|
281614
282094
|
// >1: this view shows the shared camera N× more zoomed in.
|
|
281615
282095
|
// Pan/rotation are shared via spatialCameraSnapshot; zoom keeps a fixed ratio.
|
|
281616
|
-
cameraZoomFactor = 1
|
|
282096
|
+
cameraZoomFactor = 1,
|
|
282097
|
+
// Optional global NG coordinate space, e.g.
|
|
282098
|
+
// { x: [1e-9, 'm'], y: [1e-9, 'm'], z: [1e-9, 'm'] }.
|
|
282099
|
+
// Overrides dimensions inferred from point layer transforms.
|
|
282100
|
+
viewerDimensions,
|
|
282101
|
+
// Column names in the obsSets CSV used to map mesh segment IDs <-> cell IDs.
|
|
282102
|
+
// If either column is missing from the CSV, IDs are assumed identical.
|
|
282103
|
+
meshIdColumn = "MeshID",
|
|
282104
|
+
cellIdColumn = "CellID"
|
|
281617
282105
|
} = props;
|
|
281618
282106
|
const loaders = useLoaders();
|
|
281619
282107
|
const mergeCoordination = useMergeCoordination();
|
|
281620
282108
|
const { classes: classes2 } = useStyles$4();
|
|
281621
282109
|
const initialRotationPushedRef = useRef(false);
|
|
281622
282110
|
const getViewProjectionMatRef = useRef(null);
|
|
281623
|
-
const
|
|
282111
|
+
const centroidPosByMeshIdRef = useRef(/* @__PURE__ */ new Map());
|
|
281624
282112
|
const meshIdToCellIdRef = useRef({});
|
|
281625
282113
|
const cellIdToMeshIdRef = useRef({});
|
|
281626
282114
|
const lastInteractionSource = useRef(null);
|
|
281627
282115
|
const initialRenderCalibratorRef = useRef(null);
|
|
281628
282116
|
const translationOffsetRef = useRef([0, 0, 0]);
|
|
281629
|
-
const
|
|
281630
|
-
const
|
|
281631
|
-
const
|
|
282117
|
+
const annotationInfoByScopeRef = useRef({});
|
|
282118
|
+
const annotationTransformByScopeRef = useRef({});
|
|
282119
|
+
const visibleSegmentIdsBySegLayerRef = useRef({});
|
|
281632
282120
|
const chunkCacheRef = useRef(/* @__PURE__ */ new Map());
|
|
281633
282121
|
const resizeObserverRef = useRef(null);
|
|
281634
282122
|
const [isLayersLoaded, setIsLayersLoaded] = useState(false);
|
|
281635
282123
|
const [isMeshLoading, setIsMeshLoading] = useState(false);
|
|
281636
|
-
const [
|
|
282124
|
+
const [annotationReadyIteration, bumpAnnotationReady] = useReducer((x2) => x2 + 1, 0);
|
|
281637
282125
|
const [csvLoaded, setCsvLoaded] = useState(false);
|
|
281638
282126
|
const updateVisibleSegmentsThrottledRef = useRef(null);
|
|
281639
282127
|
const viewportSizeRef = useRef({ width: 0, height: 0 });
|
|
@@ -281657,8 +282145,12 @@ function NeuroglancerSubscriber(props) {
|
|
|
281657
282145
|
additionalObsSets: additionalCellSets,
|
|
281658
282146
|
obsHighlight: cellHighlight,
|
|
281659
282147
|
spatialCameraSnapshot,
|
|
281660
|
-
spatialRenderingMode
|
|
281661
|
-
|
|
282148
|
+
spatialRenderingMode,
|
|
282149
|
+
spatialAxisLinesVisible,
|
|
282150
|
+
spatialBoundsVisible,
|
|
282151
|
+
spatialScaleBarVisible,
|
|
282152
|
+
spatialBackgroundTheme
|
|
282153
|
+
}, { setSpatialCameraSnapshot, setSpatialAxisLinesVisible, setSpatialBoundsVisible, setSpatialScaleBarVisible, setSpatialBackgroundTheme, setAdditionalObsSets: setAdditionalCellSets, setObsSetColor: setCellSetColor, setObsColorEncoding: setCellColorEncoding, setObsSetSelection: setCellSetSelection, setObsHighlight: setCellHighlight }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.NEUROGLANCER], coordinationScopes);
|
|
281662
282154
|
const csvUrlRef = useRef(null);
|
|
281663
282155
|
const csvUrl = useMemo$1(() => {
|
|
281664
282156
|
if (csvUrlRef.current)
|
|
@@ -281673,6 +282165,8 @@ function NeuroglancerSubscriber(props) {
|
|
|
281673
282165
|
return url;
|
|
281674
282166
|
}, [loaders, dataset]);
|
|
281675
282167
|
const [ngWidth, ngHeight, containerRef] = useGridItemSize();
|
|
282168
|
+
const setComponentHover = useSetComponentHover();
|
|
282169
|
+
const [hoverCoord, setHoverCoord] = useState(null);
|
|
281676
282170
|
const [segmentationLayerScopes, segmentationChannelScopesByLayer] = useMultiCoordinationScopesSecondaryNonNull(CoordinationType$1.SEGMENTATION_CHANNEL, CoordinationType$1.SEGMENTATION_LAYER, coordinationScopes, coordinationScopesBy);
|
|
281677
282171
|
const pointLayerScopes = useMultiCoordinationScopesNonNull(CoordinationType$1.POINT_LAYER, coordinationScopes);
|
|
281678
282172
|
const segmentationLayerCoordination = useComplexCoordination([
|
|
@@ -281703,7 +282197,8 @@ function NeuroglancerSubscriber(props) {
|
|
|
281703
282197
|
CoordinationType$1.TOOLTIP_CROSSHAIRS_VISIBLE,
|
|
281704
282198
|
CoordinationType$1.LEGEND_VISIBLE,
|
|
281705
282199
|
CoordinationType$1.FEATURE_TYPE,
|
|
281706
|
-
CoordinationType$1.FEATURE_VALUE_TYPE
|
|
282200
|
+
CoordinationType$1.FEATURE_VALUE_TYPE,
|
|
282201
|
+
CoordinationType$1.SPATIAL_LAYER_OPACITY_UNSELECTED
|
|
281707
282202
|
], coordinationScopes, coordinationScopesBy, CoordinationType$1.SEGMENTATION_LAYER, CoordinationType$1.SEGMENTATION_CHANNEL);
|
|
281708
282203
|
const pointLayerCoordination = useComplexCoordination([
|
|
281709
282204
|
CoordinationType$1.OBS_TYPE,
|
|
@@ -281722,6 +282217,9 @@ function NeuroglancerSubscriber(props) {
|
|
|
281722
282217
|
CoordinationType$1.TOOLTIP_CROSSHAIRS_VISIBLE,
|
|
281723
282218
|
CoordinationType$1.LEGEND_VISIBLE,
|
|
281724
282219
|
CoordinationType$1.SPATIAL_POINT_STROKE_WIDTH,
|
|
282220
|
+
CoordinationType$1.SPATIAL_POINT_RADIUS,
|
|
282221
|
+
CoordinationType$1.SPATIAL_LAYER_LABEL,
|
|
282222
|
+
CoordinationType$1.SPATIAL_POINT_PROJECTION_SPACING,
|
|
281725
282223
|
CoordinationType$1.OBS_SET_COLOR,
|
|
281726
282224
|
CoordinationType$1.OBS_SET_SELECTION,
|
|
281727
282225
|
CoordinationType$1.ADDITIONAL_OBS_SETS
|
|
@@ -281731,27 +282229,67 @@ function NeuroglancerSubscriber(props) {
|
|
|
281731
282229
|
const [obsSegmentationsData, obsSegmentationsDataStatus, obsSegmentationsUrls, obsSegmentationsDataErrors] = useMultiObsSegmentations(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid2);
|
|
281732
282230
|
const [obsSegmentationsSetsData, obsSegmentationsSetsDataStatus, obsSegmentationsSetsDataErrors] = useSegmentationMultiObsSets(coordinationScopes, coordinationScopesBy, loaders, dataset);
|
|
281733
282231
|
const [obsSegmentationsColorsData, obsSegmentationsColorsDataStatus, obsSegmentationsColorsDataErrors] = useSegmentationMultiObsColors(coordinationScopes, coordinationScopesBy, loaders, dataset);
|
|
282232
|
+
const [obsSegmentationsLocationsData, obsSegmentationsLocationsDataStatus, obsSegmentationsLocationsDataErrors] = useSegmentationMultiObsLocations(coordinationScopes, coordinationScopesBy, loaders, dataset);
|
|
281734
282233
|
const [segmentationMultiExpressionData, segmentationMultiLoadedFeatureSelection, segmentationMultiExpressionExtents, segmentationMultiExpressionNormData, segmentationMultiFeatureSelectionStatus, segmentationMultiFeatureSelectionErrors] = useSegmentationMultiFeatureSelection(coordinationScopes, coordinationScopesBy, loaders, dataset);
|
|
281735
282234
|
const [segmentationMultiIndicesData, segmentationMultiIndicesDataStatus, segmentationMultiIndicesDataErrors] = useSegmentationMultiObsFeatureMatrixIndices(coordinationScopes, coordinationScopesBy, loaders, dataset);
|
|
281736
|
-
const
|
|
281737
|
-
const
|
|
282235
|
+
const viewerDimensionsKey = viewerDimensions ? JSON.stringify(viewerDimensions) : null;
|
|
282236
|
+
const viewerDimensionsOverride = useMemo$1(() => viewerDimensions ?? null, [viewerDimensionsKey]);
|
|
282237
|
+
const initialViewerState = useNeuroglancerViewerState(theme, showAxisLines, segmentationLayerScopes, segmentationChannelScopesByLayer, segmentationLayerCoordination, segmentationChannelCoordination, obsSegmentationsUrls, obsSegmentationsData, obsSegmentationsLocationsData, pointLayerScopes, pointLayerCoordination, obsPointsUrls, obsPointsData, pointMultiIndicesData, viewerDimensionsOverride);
|
|
282238
|
+
const validInitialNgCamera = useMemo$1(() => sanitizeNgCameraState(initialNgCameraState, { projectionOrientation: Q_Y_UP }), []);
|
|
282239
|
+
const hasInitialNgPosition = "position" in validInitialNgCamera;
|
|
282240
|
+
const [hasResolvedInitialCamera, setHasResolvedInitialCamera] = useState(hasInitialNgPosition);
|
|
281738
282241
|
const latestViewerStateRef = useRef({
|
|
281739
282242
|
...initialViewerState,
|
|
281740
|
-
...
|
|
282243
|
+
...validInitialNgCamera
|
|
281741
282244
|
});
|
|
281742
282245
|
const segmentationUrl = useMemo$1(() => {
|
|
281743
282246
|
const firstScope = segmentationLayerScopes?.[0];
|
|
281744
282247
|
return obsSegmentationsUrls?.[firstScope]?.[0]?.url ?? null;
|
|
281745
282248
|
}, [segmentationLayerScopes, obsSegmentationsUrls]);
|
|
281746
|
-
const
|
|
281747
|
-
|
|
281748
|
-
|
|
281749
|
-
|
|
282249
|
+
const centroidSourcesCacheRef = useRef([]);
|
|
282250
|
+
const centroidSources = useMemo$1(() => {
|
|
282251
|
+
const next4 = getSegmentationCentroidSources({
|
|
282252
|
+
segmentationLayerScopes,
|
|
282253
|
+
segmentationChannelScopesByLayer,
|
|
282254
|
+
obsSegmentationsLocationsData
|
|
282255
|
+
});
|
|
282256
|
+
if (!isEqual$3(next4, centroidSourcesCacheRef.current)) {
|
|
282257
|
+
centroidSourcesCacheRef.current = next4;
|
|
282258
|
+
}
|
|
282259
|
+
return centroidSourcesCacheRef.current;
|
|
282260
|
+
}, [segmentationLayerScopes, segmentationChannelScopesByLayer, obsSegmentationsLocationsData]);
|
|
282261
|
+
const centroidLayerRoles = useMemo$1(() => {
|
|
282262
|
+
const centroidToSegLayers = Object.fromEntries(centroidSources.map(({ name: name2, layerScope }) => [name2, [layerScope]]));
|
|
282263
|
+
return {
|
|
282264
|
+
centroidScopes: centroidSources.map(({ name: name2 }) => name2),
|
|
282265
|
+
centroidToSegLayers,
|
|
282266
|
+
culledSegLayerScopes: new Set(Object.values(centroidToSegLayers).flat())
|
|
282267
|
+
};
|
|
282268
|
+
}, [centroidSources]);
|
|
282269
|
+
const centroidLayerUrls = useMemo$1(() => Object.fromEntries(centroidSources.map(({ name: name2, url }) => [name2, url])), [centroidSources]);
|
|
282270
|
+
const pointScopeByNgLayerName = useMemo$1(() => Object.fromEntries(centroidLayerRoles.centroidScopes.map((scope) => [scope, scope])), [centroidLayerRoles]);
|
|
282271
|
+
const centroidAnnotationUrlsByLayerName = useMemo$1(() => Object.fromEntries(centroidLayerRoles.centroidScopes.filter((scope) => centroidLayerUrls[scope]).map((scope) => [scope, centroidLayerUrls[scope]])), [centroidLayerRoles, centroidLayerUrls]);
|
|
281750
282272
|
const segmentationInfo = obsSegmentationsData?.[segmentationLayerScopes?.[0]]?.neuroglancerInfo ?? null;
|
|
281751
|
-
const
|
|
282273
|
+
const annotationInfoByScopeCacheRef = useRef({});
|
|
282274
|
+
const annotationInfoByScope = useMemo$1(() => {
|
|
282275
|
+
const next4 = Object.fromEntries([
|
|
282276
|
+
...(pointLayerScopes ?? []).map((scope) => [scope, obsPointsData?.[scope]?.neuroglancerInfo ?? null]),
|
|
282277
|
+
...centroidSources.map(({ name: name2, neuroglancerInfo }) => [name2, neuroglancerInfo])
|
|
282278
|
+
].filter(([, info2]) => info2));
|
|
282279
|
+
return reuseIfShallowEqual(annotationInfoByScopeCacheRef, next4);
|
|
282280
|
+
}, [pointLayerScopes, obsPointsData, centroidSources]);
|
|
282281
|
+
const segmentIdPropByScope = useMemo$1(() => Object.fromEntries(centroidSources.map(({ name: name2, neuroglancerOptions }) => [
|
|
282282
|
+
name2,
|
|
282283
|
+
neuroglancerOptions.segmentIdProp
|
|
282284
|
+
])), [centroidSources]);
|
|
281752
282285
|
const derivedCenter = useMemo$1(() => {
|
|
281753
|
-
const
|
|
281754
|
-
|
|
282286
|
+
const validBounds = (scopes) => scopes.map((scope) => annotationInfoByScope[scope]).map((info2) => [info2?.lower_bound, info2?.upper_bound]).filter(([lo, up]) => Array.isArray(lo) && Array.isArray(up) && lo.length === 3 && up.length === 3 && lo.every(Number.isFinite) && up.every(Number.isFinite));
|
|
282287
|
+
let bounds2 = validBounds(centroidLayerRoles.centroidScopes);
|
|
282288
|
+
if (!bounds2.length)
|
|
282289
|
+
bounds2 = validBounds(Object.keys(annotationInfoByScope));
|
|
282290
|
+
if (bounds2.length) {
|
|
282291
|
+
const lower2 = [0, 1, 2].map((i2) => Math.min(...bounds2.map(([lo]) => lo[i2])));
|
|
282292
|
+
const upper = [0, 1, 2].map((i2) => Math.max(...bounds2.map(([, up]) => up[i2])));
|
|
281755
282293
|
return lower2.map((lo, i2) => (lo + upper[i2]) / 2);
|
|
281756
282294
|
}
|
|
281757
282295
|
const scale2 = segmentationInfo?.scales?.[0];
|
|
@@ -281762,9 +282300,9 @@ function NeuroglancerSubscriber(props) {
|
|
|
281762
282300
|
return size2.map((s2, i2) => ((voxelOffset[i2] ?? 0) + s2 / 2) * (resolution[i2] ?? 1));
|
|
281763
282301
|
}
|
|
281764
282302
|
return null;
|
|
281765
|
-
}, [segmentationInfo,
|
|
282303
|
+
}, [segmentationInfo, annotationInfoByScope, centroidLayerRoles]);
|
|
281766
282304
|
useEffect(() => {
|
|
281767
|
-
if (
|
|
282305
|
+
if (hasInitialNgPosition || !segmentationUrl) {
|
|
281768
282306
|
setHasResolvedInitialCamera(true);
|
|
281769
282307
|
return;
|
|
281770
282308
|
}
|
|
@@ -281776,12 +282314,13 @@ function NeuroglancerSubscriber(props) {
|
|
|
281776
282314
|
incrementLatestViewerStateIteration();
|
|
281777
282315
|
}
|
|
281778
282316
|
setHasResolvedInitialCamera(true);
|
|
281779
|
-
}, [segmentationUrl, derivedCenter,
|
|
282317
|
+
}, [segmentationUrl, derivedCenter, hasInitialNgPosition]);
|
|
281780
282318
|
const errors = [
|
|
281781
282319
|
...obsPointsErrors,
|
|
281782
282320
|
...obsSegmentationsDataErrors,
|
|
281783
282321
|
...obsSegmentationsSetsDataErrors,
|
|
281784
282322
|
...obsSegmentationsColorsDataErrors,
|
|
282323
|
+
...obsSegmentationsLocationsDataErrors,
|
|
281785
282324
|
...pointMultiIndicesDataErrors,
|
|
281786
282325
|
...segmentationMultiFeatureSelectionErrors,
|
|
281787
282326
|
...segmentationMultiIndicesDataErrors
|
|
@@ -281794,6 +282333,7 @@ function NeuroglancerSubscriber(props) {
|
|
|
281794
282333
|
obsSegmentationsDataStatus,
|
|
281795
282334
|
obsSegmentationsSetsDataStatus,
|
|
281796
282335
|
obsSegmentationsColorsDataStatus,
|
|
282336
|
+
obsSegmentationsLocationsDataStatus,
|
|
281797
282337
|
segmentationMultiFeatureSelectionStatus,
|
|
281798
282338
|
segmentationMultiIndicesDataStatus
|
|
281799
282339
|
]);
|
|
@@ -281815,7 +282355,8 @@ function NeuroglancerSubscriber(props) {
|
|
|
281815
282355
|
const lastSeenCameraSnapshotRef = useRef(null);
|
|
281816
282356
|
const spatialBetaJustPushedRef = useRef(false);
|
|
281817
282357
|
const is3dMode = spatialRenderingMode === "3D";
|
|
281818
|
-
const
|
|
282358
|
+
const fromNeuroglancer = spatialCameraSnapshot?.source === "neuroglancer";
|
|
282359
|
+
const hasSpatialCameraSnapshot = Boolean(spatialCameraSnapshot) && (fromNeuroglancer || is3dMode);
|
|
281819
282360
|
useEffect(() => {
|
|
281820
282361
|
if (detailMode)
|
|
281821
282362
|
return;
|
|
@@ -281874,7 +282415,7 @@ function NeuroglancerSubscriber(props) {
|
|
|
281874
282415
|
if (knownIdSet.has(String(id2))) {
|
|
281875
282416
|
const color2 = obsColorMap.get(id2);
|
|
281876
282417
|
if (color2) {
|
|
281877
|
-
ngCellColors[id2] =
|
|
282418
|
+
ngCellColors[id2] = colorArrayToString(color2);
|
|
281878
282419
|
} else {
|
|
281879
282420
|
ngCellColors[id2] = GREY_HEX;
|
|
281880
282421
|
}
|
|
@@ -281891,7 +282432,7 @@ function NeuroglancerSubscriber(props) {
|
|
|
281891
282432
|
finalizeChannelColors(ngCellColors, spatialChannelOpacity, GREY_HEX);
|
|
281892
282433
|
}
|
|
281893
282434
|
} else if (obsColorEncoding === "spatialChannelColor") {
|
|
281894
|
-
const hex2 = spatialChannelColor ?
|
|
282435
|
+
const hex2 = spatialChannelColor ? colorArrayToString(spatialChannelColor) : autoColorForId(layerScope + channelScope);
|
|
281895
282436
|
if (spatialChannelColor) {
|
|
281896
282437
|
const ngCellColors = {};
|
|
281897
282438
|
if (layerIndex) {
|
|
@@ -281936,11 +282477,11 @@ function NeuroglancerSubscriber(props) {
|
|
|
281936
282477
|
const tScaled = (t4 - low) / Math.max(high - low, 1e-4);
|
|
281937
282478
|
const tClamped = Math.max(0, Math.min(1, tScaled));
|
|
281938
282479
|
const color2 = applyColormap(featureValueColormap ?? "viridis", tClamped);
|
|
281939
|
-
ngCellColors[id2] =
|
|
282480
|
+
ngCellColors[id2] = colorArrayToString(color2);
|
|
281940
282481
|
});
|
|
281941
282482
|
finalizeChannelColors(ngCellColors, spatialChannelOpacity);
|
|
281942
282483
|
} else if (restrictedObsIndex) {
|
|
281943
|
-
const fallbackColor = spatialChannelColor ?
|
|
282484
|
+
const fallbackColor = spatialChannelColor ? colorArrayToString(spatialChannelColor) : GREY_HEX;
|
|
281944
282485
|
const ngCellColors = {};
|
|
281945
282486
|
restrictedObsIndex.forEach((id2) => {
|
|
281946
282487
|
ngCellColors[id2] = fallbackColor;
|
|
@@ -281957,17 +282498,23 @@ function NeuroglancerSubscriber(props) {
|
|
|
281957
282498
|
theme
|
|
281958
282499
|
});
|
|
281959
282500
|
const ngCellColors = {};
|
|
282501
|
+
const selectedCellIds = [];
|
|
281960
282502
|
idsToColor.forEach((id2) => {
|
|
281961
282503
|
if (knownIdSet.has(String(id2))) {
|
|
281962
282504
|
const color2 = cellColors.get(String(id2));
|
|
281963
282505
|
if (color2) {
|
|
281964
|
-
ngCellColors[id2] =
|
|
282506
|
+
ngCellColors[id2] = colorArrayToString(color2);
|
|
282507
|
+
selectedCellIds.push(id2);
|
|
281965
282508
|
} else {
|
|
281966
282509
|
ngCellColors[id2] = GREY_HEX;
|
|
281967
282510
|
}
|
|
281968
282511
|
}
|
|
281969
282512
|
});
|
|
281970
282513
|
finalizeChannelColors(ngCellColors, spatialChannelOpacity);
|
|
282514
|
+
const { spatialLayerOpacityUnselected } = segmentationChannelCoordination[0][layerScope][channelScope];
|
|
282515
|
+
if (spatialLayerOpacityUnselected === 0 && obsSetSelection?.length > 0) {
|
|
282516
|
+
result[layerScope].visibleMeshIds = new Set(selectedCellIds.map((id2) => String(cellIdToMeshIdRef.current?.[String(id2)] ?? id2)));
|
|
282517
|
+
}
|
|
281971
282518
|
}
|
|
281972
282519
|
});
|
|
281973
282520
|
});
|
|
@@ -281989,16 +282536,21 @@ function NeuroglancerSubscriber(props) {
|
|
|
281989
282536
|
if (!csvUrl)
|
|
281990
282537
|
return;
|
|
281991
282538
|
fetch(csvUrl).then((r3) => r3.text()).then((text2) => {
|
|
281992
|
-
const
|
|
281993
|
-
const
|
|
281994
|
-
const
|
|
281995
|
-
const
|
|
282539
|
+
const clean = (v) => v?.trim().replace(/^"(.*)"$/, "$1");
|
|
282540
|
+
const lines = text2.split(/\r?\n/);
|
|
282541
|
+
const header = lines[0].split(",").map(clean);
|
|
282542
|
+
const meshIdIdx = header.indexOf(meshIdColumn);
|
|
282543
|
+
const cellIdIdx = header.indexOf(cellIdColumn);
|
|
282544
|
+
if (meshIdIdx < 0 || cellIdIdx < 0) {
|
|
282545
|
+
setCsvLoaded(true);
|
|
282546
|
+
return;
|
|
282547
|
+
}
|
|
281996
282548
|
const meshMap = {};
|
|
281997
282549
|
const cellMap = {};
|
|
281998
282550
|
lines.slice(1).forEach((l2) => {
|
|
281999
282551
|
const cols = l2.split(",");
|
|
282000
|
-
const meshId = cols[meshIdIdx]
|
|
282001
|
-
const cellId = cols[cellIdIdx]
|
|
282552
|
+
const meshId = clean(cols[meshIdIdx]);
|
|
282553
|
+
const cellId = clean(cols[cellIdIdx]);
|
|
282002
282554
|
if (meshId && cellId) {
|
|
282003
282555
|
meshMap[meshId] = cellId;
|
|
282004
282556
|
cellMap[cellId] = meshId;
|
|
@@ -282008,10 +282560,10 @@ function NeuroglancerSubscriber(props) {
|
|
|
282008
282560
|
cellIdToMeshIdRef.current = cellMap;
|
|
282009
282561
|
setCsvLoaded(true);
|
|
282010
282562
|
});
|
|
282011
|
-
}, [csvUrl]);
|
|
282563
|
+
}, [csvUrl, meshIdColumn, cellIdColumn]);
|
|
282012
282564
|
useEffect(() => {
|
|
282013
282565
|
chunkCacheRef.current.clear();
|
|
282014
|
-
}, [
|
|
282566
|
+
}, [centroidSources]);
|
|
282015
282567
|
useEffect(() => {
|
|
282016
282568
|
if (ngWidth && ngHeight) {
|
|
282017
282569
|
viewportSizeRef.current = { width: ngWidth, height: ngHeight };
|
|
@@ -282044,61 +282596,59 @@ function NeuroglancerSubscriber(props) {
|
|
|
282044
282596
|
const updateVisibleSegments = useCallback(async () => {
|
|
282045
282597
|
if (detailMode)
|
|
282046
282598
|
return;
|
|
282047
|
-
if (!annotationInfoRef.current)
|
|
282048
|
-
return;
|
|
282049
|
-
if (!annotationTransformRef.current)
|
|
282050
|
-
return;
|
|
282051
282599
|
if (!segmentationLayerScopes?.length)
|
|
282052
282600
|
return;
|
|
282053
|
-
|
|
282601
|
+
const { centroidToSegLayers } = centroidLayerRoles;
|
|
282602
|
+
const infoByScope = annotationInfoByScopeRef.current;
|
|
282603
|
+
const transformByScope = annotationTransformByScopeRef.current;
|
|
282604
|
+
const readyScopes = Object.keys(infoByScope).filter((scope) => centroidToSegLayers[scope] && transformByScope[scope]);
|
|
282605
|
+
if (!readyScopes.length)
|
|
282054
282606
|
return;
|
|
282055
282607
|
const { position: position2, projectionScale } = latestViewerStateRef.current;
|
|
282056
282608
|
if (!position2 || !projectionScale)
|
|
282057
282609
|
return;
|
|
282058
|
-
const
|
|
282059
|
-
|
|
282060
|
-
|
|
282061
|
-
|
|
282610
|
+
const commitVisibleIds = (nextBySegLayer) => {
|
|
282611
|
+
const prevBySegLayer = visibleSegmentIdsBySegLayerRef.current ?? {};
|
|
282612
|
+
const segLayers = /* @__PURE__ */ new Set([...Object.keys(prevBySegLayer), ...Object.keys(nextBySegLayer)]);
|
|
282613
|
+
let changed = false;
|
|
282614
|
+
let added = 0;
|
|
282615
|
+
segLayers.forEach((segLayer) => {
|
|
282616
|
+
const prevIds = prevBySegLayer[segLayer] ?? [];
|
|
282617
|
+
const nextIds = nextBySegLayer[segLayer] ?? [];
|
|
282618
|
+
const prevSet = new Set(prevIds);
|
|
282619
|
+
added += nextIds.filter((id2) => !prevSet.has(id2)).length;
|
|
282620
|
+
if ([...prevIds].sort().join(",") !== [...nextIds].sort().join(","))
|
|
282621
|
+
changed = true;
|
|
282622
|
+
});
|
|
282623
|
+
if (changed) {
|
|
282624
|
+
visibleSegmentIdsBySegLayerRef.current = nextBySegLayer;
|
|
282062
282625
|
incrementLatestViewerStateIteration();
|
|
282063
|
-
setIsMeshLoading(false);
|
|
282064
282626
|
}
|
|
282627
|
+
return added;
|
|
282628
|
+
};
|
|
282629
|
+
const maxProjectionScale = meshLoadProjectionScaleThreshold ?? MESH_LOAD_THRESHOLD;
|
|
282630
|
+
if (projectionScale > maxProjectionScale) {
|
|
282631
|
+
commitVisibleIds({});
|
|
282632
|
+
setIsMeshLoading(false);
|
|
282065
282633
|
return;
|
|
282066
282634
|
}
|
|
282067
282635
|
const { width: width2, height: height2 } = viewportSizeRef.current;
|
|
282068
282636
|
if (!width2 || !height2)
|
|
282069
282637
|
return;
|
|
282070
|
-
const
|
|
282071
|
-
|
|
282072
|
-
|
|
282073
|
-
const allLevelCoords = info2.spatial.flatMap((level) => {
|
|
282074
|
-
const [gx, gy, gz] = level.grid_shape;
|
|
282075
|
-
const coords = [];
|
|
282076
|
-
for (let cx = 0; cx < gx; cx++) {
|
|
282077
|
-
for (let cy = 0; cy < gy; cy++) {
|
|
282078
|
-
for (let cz = 0; cz < gz; cz++) {
|
|
282079
|
-
coords.push({ level: level.key, cx, cy, cz });
|
|
282080
|
-
}
|
|
282081
|
-
}
|
|
282082
|
-
}
|
|
282083
|
-
return coords;
|
|
282084
|
-
});
|
|
282085
|
-
const fetchChunkWithPositions = async ({ level, cx, cy, cz }) => {
|
|
282086
|
-
const { serializers, serializer: defaultSerializer } = annotationTransformRef.current;
|
|
282087
|
-
const serializer2 = serializers?.[0] ?? defaultSerializer;
|
|
282088
|
-
if (!serializer2)
|
|
282089
|
-
return [];
|
|
282090
|
-
const cacheKey = `${cellsInfoUrl}/${level}/${cx}_${cy}_${cz}`;
|
|
282638
|
+
const fetchChunkWithPositions = async (cellsInfoUrl, serializer2, layout, { level, cx, cy, cz }) => {
|
|
282639
|
+
const chunkUrl = `${cellsInfoUrl}/${level}/${cx}_${cy}_${cz}`;
|
|
282640
|
+
const cacheKey = `${chunkUrl}#${layout.segmentIdProp}`;
|
|
282091
282641
|
if (chunkCacheRef.current.has(cacheKey)) {
|
|
282092
282642
|
return chunkCacheRef.current.get(cacheKey);
|
|
282093
282643
|
}
|
|
282094
282644
|
try {
|
|
282095
|
-
const res = await fetch(
|
|
282645
|
+
const res = await fetch(chunkUrl);
|
|
282096
282646
|
if (!res.ok) {
|
|
282097
282647
|
chunkCacheRef.current.set(cacheKey, []);
|
|
282098
282648
|
return [];
|
|
282099
282649
|
}
|
|
282100
282650
|
const buffer2 = await res.arrayBuffer();
|
|
282101
|
-
const entries2 = parseAnnotationChunkSegmentsWithPositions(buffer2, serializer2);
|
|
282651
|
+
const entries2 = parseAnnotationChunkSegmentsWithPositions(buffer2, serializer2, layout);
|
|
282102
282652
|
chunkCacheRef.current.set(cacheKey, entries2);
|
|
282103
282653
|
return entries2;
|
|
282104
282654
|
} catch (e3) {
|
|
@@ -282106,28 +282656,57 @@ function NeuroglancerSubscriber(props) {
|
|
|
282106
282656
|
return [];
|
|
282107
282657
|
}
|
|
282108
282658
|
};
|
|
282109
|
-
|
|
282110
|
-
const
|
|
282659
|
+
const collectEntriesForScope = async (scope) => {
|
|
282660
|
+
const info2 = infoByScope[scope];
|
|
282661
|
+
const { serializers, serializer: defaultSerializer } = transformByScope[scope];
|
|
282662
|
+
const serializer2 = serializers?.[0] ?? defaultSerializer;
|
|
282663
|
+
if (!serializer2 || !Array.isArray(info2.spatial))
|
|
282664
|
+
return [];
|
|
282665
|
+
const layout = getAnnotationPropertyIndices(info2, { segmentIdProp: info2.segmentIdProp });
|
|
282666
|
+
if (layout.segmentIdIndex < 0) {
|
|
282667
|
+
console.warn(`[updateVisibleSegments] No segment ID property found for centroid layer "${scope}" (properties: ${layout.propertyIds.join(", ") || "none"}). Set options.segmentIdProp on the obsLocations.ng-annotations file.`);
|
|
282668
|
+
return [];
|
|
282669
|
+
}
|
|
282670
|
+
const allLevelCoords = info2.spatial.flatMap((level) => {
|
|
282671
|
+
const [gx, gy, gz] = level.grid_shape;
|
|
282672
|
+
const coords = [];
|
|
282673
|
+
for (let cx = 0; cx < gx; cx++) {
|
|
282674
|
+
for (let cy = 0; cy < gy; cy++) {
|
|
282675
|
+
for (let cz = 0; cz < gz; cz++) {
|
|
282676
|
+
coords.push({ level: level.key, cx, cy, cz });
|
|
282677
|
+
}
|
|
282678
|
+
}
|
|
282679
|
+
}
|
|
282680
|
+
return coords;
|
|
282681
|
+
});
|
|
282682
|
+
const results = await Promise.all(allLevelCoords.map((c2) => fetchChunkWithPositions(info2.url, serializer2, layout, c2)));
|
|
282111
282683
|
const seenIds = /* @__PURE__ */ new Set();
|
|
282112
|
-
|
|
282684
|
+
return results.flat().filter(({ id: id2 }) => {
|
|
282113
282685
|
if (seenIds.has(id2))
|
|
282114
282686
|
return false;
|
|
282115
282687
|
seenIds.add(id2);
|
|
282116
282688
|
return true;
|
|
282117
282689
|
});
|
|
282118
|
-
|
|
282119
|
-
|
|
282120
|
-
|
|
282121
|
-
});
|
|
282122
|
-
obsIdToMeshIdRef.current = obsIdToMeshId;
|
|
282690
|
+
};
|
|
282691
|
+
try {
|
|
282692
|
+
const entriesByScope = await Promise.all(readyScopes.map(collectEntriesForScope));
|
|
282123
282693
|
const mat = getViewProjectionMatRef.current?.();
|
|
282124
|
-
let visibleIds;
|
|
282125
282694
|
if (!mat) {
|
|
282126
282695
|
console.warn("No viewProjectionMatrix, loading all");
|
|
282127
|
-
|
|
282128
|
-
|
|
282129
|
-
|
|
282130
|
-
|
|
282696
|
+
}
|
|
282697
|
+
const margin2 = Math.max(width2, height2) * 0.5;
|
|
282698
|
+
const nextBySegLayer = {};
|
|
282699
|
+
readyScopes.forEach((scope, i2) => {
|
|
282700
|
+
const allEntries = entriesByScope[i2];
|
|
282701
|
+
const transform3 = transformByScope[scope];
|
|
282702
|
+
allEntries.forEach(({ id: id2, x: x2, y: y2, z: z2 }) => {
|
|
282703
|
+
centroidPosByMeshIdRef.current.set(String(id2), [x2 / transform3.x, y2 / transform3.y, (z2 || 0) / transform3.z]);
|
|
282704
|
+
});
|
|
282705
|
+
const obsIdToMeshId = {};
|
|
282706
|
+
allEntries.forEach(({ id: id2, obsId }) => {
|
|
282707
|
+
obsIdToMeshId[obsId] = id2;
|
|
282708
|
+
});
|
|
282709
|
+
const visibleEntries = !mat ? allEntries : allEntries.filter(({ x: x2, y: y2, z: z2 }) => {
|
|
282131
282710
|
const vx = x2 / transform3.x;
|
|
282132
282711
|
const vy = y2 / transform3.y;
|
|
282133
282712
|
const vz = (z2 || 0) / transform3.z;
|
|
@@ -282137,36 +282716,29 @@ function NeuroglancerSubscriber(props) {
|
|
|
282137
282716
|
const screenX = (cx / cw2 + 1) * 0.5 * width2;
|
|
282138
282717
|
const screenY = (1 - cy / cw2) * 0.5 * height2;
|
|
282139
282718
|
return screenX >= -margin2 && screenX <= width2 + margin2 && screenY >= -margin2 && screenY <= height2 + margin2;
|
|
282140
|
-
})
|
|
282141
|
-
|
|
282142
|
-
|
|
282143
|
-
|
|
282144
|
-
|
|
282145
|
-
|
|
282146
|
-
|
|
282719
|
+
});
|
|
282720
|
+
centroidToSegLayers[scope].forEach((segLayer) => {
|
|
282721
|
+
const merged = new Set(nextBySegLayer[segLayer] ?? []);
|
|
282722
|
+
visibleEntries.forEach(({ id: id2 }) => merged.add(id2));
|
|
282723
|
+
nextBySegLayer[segLayer] = Array.from(merged);
|
|
282724
|
+
});
|
|
282725
|
+
});
|
|
282726
|
+
const addedIdsCount = commitVisibleIds(nextBySegLayer);
|
|
282727
|
+
const totalVisible = Object.values(nextBySegLayer).reduce((acc, ids) => acc + ids.length, 0);
|
|
282728
|
+
if (totalVisible === 0) {
|
|
282147
282729
|
setIsMeshLoading(false);
|
|
282148
282730
|
return;
|
|
282149
282731
|
}
|
|
282150
|
-
const prevIds = new Set(visibleSegmentIdsRef.current ?? []);
|
|
282151
|
-
const addedIdsCount = visibleIds.filter((id2) => !prevIds.has(id2)).length;
|
|
282152
282732
|
const hasSignificantChange = addedIdsCount > 20;
|
|
282153
|
-
if (hasSignificantChange && visibleIds.length > 0) {
|
|
282154
|
-
setIsMeshLoading(true);
|
|
282155
|
-
}
|
|
282156
|
-
const prevSorted = [...visibleSegmentIdsRef.current ?? []].sort().join(",");
|
|
282157
|
-
const nextSorted = [...visibleIds].sort().join(",");
|
|
282158
|
-
if (prevSorted !== nextSorted) {
|
|
282159
|
-
visibleSegmentIdsRef.current = visibleIds;
|
|
282160
|
-
incrementLatestViewerStateIteration();
|
|
282161
|
-
}
|
|
282162
282733
|
if (hasSignificantChange) {
|
|
282734
|
+
setIsMeshLoading(true);
|
|
282163
282735
|
setTimeout(() => setIsMeshLoading(false), MESH_LOADING_OVERLAY_TIMEOUT);
|
|
282164
282736
|
}
|
|
282165
282737
|
} catch (e3) {
|
|
282166
282738
|
console.warn("[updateVisibleSegments] error:", e3);
|
|
282167
282739
|
setIsMeshLoading(false);
|
|
282168
282740
|
}
|
|
282169
|
-
}, [segmentationLayerScopes,
|
|
282741
|
+
}, [segmentationLayerScopes, centroidLayerRoles, meshLoadProjectionScaleThreshold, detailMode]);
|
|
282170
282742
|
useEffect(() => {
|
|
282171
282743
|
updateVisibleSegmentsThrottledRef.current = throttle$1(updateVisibleSegments, 500);
|
|
282172
282744
|
return () => updateVisibleSegmentsThrottledRef.current?.cancel();
|
|
@@ -282183,38 +282755,62 @@ function NeuroglancerSubscriber(props) {
|
|
|
282183
282755
|
};
|
|
282184
282756
|
incrementLatestViewerStateIteration();
|
|
282185
282757
|
}, [initialViewerState]);
|
|
282186
|
-
const
|
|
282187
|
-
|
|
282188
|
-
|
|
282189
|
-
|
|
282190
|
-
return pointsHaveMatchingSegmentation({
|
|
282191
|
-
pointObsType: pointLayerCoordination[0]?.[firstPointScope]?.obsType,
|
|
282192
|
-
segmentationLayerScopes,
|
|
282193
|
-
segmentationChannelScopesByLayer,
|
|
282194
|
-
segmentationChannelCoordination
|
|
282195
|
-
});
|
|
282196
|
-
}, [cellsUrl, pointLayerScopes, segmentationLayerScopes, segmentationChannelScopesByLayer, detailMode]);
|
|
282197
|
-
useEffect(() => {
|
|
282198
|
-
if (!cellsUrl || !annotationInfo)
|
|
282758
|
+
const hasCentroidLayers = useMemo$1(() => centroidLayerRoles.centroidScopes.some((scope) => centroidLayerUrls[scope]), [centroidLayerRoles, centroidLayerUrls]);
|
|
282759
|
+
const readyCentroidScopesRef = useRef(/* @__PURE__ */ new Set());
|
|
282760
|
+
const markScopeReadyIfComplete = useCallback((scope) => {
|
|
282761
|
+
if (readyCentroidScopesRef.current.has(scope))
|
|
282199
282762
|
return;
|
|
282200
|
-
|
|
282201
|
-
|
|
282202
|
-
|
|
282203
|
-
}
|
|
282204
|
-
|
|
282205
|
-
|
|
282206
|
-
|
|
282763
|
+
if (annotationInfoByScopeRef.current[scope] && annotationTransformByScopeRef.current[scope]) {
|
|
282764
|
+
readyCentroidScopesRef.current.add(scope);
|
|
282765
|
+
bumpAnnotationReady();
|
|
282766
|
+
}
|
|
282767
|
+
}, []);
|
|
282768
|
+
useEffect(() => {
|
|
282769
|
+
const prev2 = annotationInfoByScopeRef.current;
|
|
282770
|
+
const next4 = {};
|
|
282771
|
+
centroidLayerRoles.centroidScopes.forEach((scope) => {
|
|
282772
|
+
const url = centroidLayerUrls[scope];
|
|
282773
|
+
const info2 = annotationInfoByScope[scope];
|
|
282774
|
+
if (url && info2) {
|
|
282775
|
+
next4[scope] = { ...info2, url, segmentIdProp: segmentIdPropByScope[scope] };
|
|
282776
|
+
}
|
|
282777
|
+
});
|
|
282778
|
+
Object.keys(prev2).forEach((scope) => {
|
|
282779
|
+
if (prev2[scope]?.url !== next4[scope]?.url || prev2[scope]?.segmentIdProp !== next4[scope]?.segmentIdProp) {
|
|
282780
|
+
readyCentroidScopesRef.current.delete(scope);
|
|
282781
|
+
}
|
|
282782
|
+
});
|
|
282783
|
+
annotationInfoByScopeRef.current = next4;
|
|
282784
|
+
Object.keys(next4).forEach(markScopeReadyIfComplete);
|
|
282785
|
+
}, [centroidLayerRoles, centroidLayerUrls, annotationInfoByScope, segmentIdPropByScope, markScopeReadyIfComplete]);
|
|
282786
|
+
const updateVisibleSegmentsRef = useRef(updateVisibleSegments);
|
|
282787
|
+
updateVisibleSegmentsRef.current = updateVisibleSegments;
|
|
282207
282788
|
useEffect(() => {
|
|
282208
|
-
if (
|
|
282789
|
+
if (annotationReadyIteration > 0) {
|
|
282209
282790
|
setIsLayersLoaded(true);
|
|
282210
|
-
|
|
282791
|
+
updateVisibleSegmentsRef.current();
|
|
282211
282792
|
}
|
|
282212
|
-
}, [
|
|
282213
|
-
const onAnnotationSourceReady = useCallback((transform3) => {
|
|
282214
|
-
|
|
282215
|
-
if (
|
|
282216
|
-
|
|
282217
|
-
|
|
282793
|
+
}, [annotationReadyIteration]);
|
|
282794
|
+
const onAnnotationSourceReady = useCallback(({ layerName, ...transform3 }) => {
|
|
282795
|
+
const scope = pointScopeByNgLayerName[layerName];
|
|
282796
|
+
if (!scope)
|
|
282797
|
+
return;
|
|
282798
|
+
annotationTransformByScopeRef.current = {
|
|
282799
|
+
...annotationTransformByScopeRef.current,
|
|
282800
|
+
[scope]: transform3
|
|
282801
|
+
};
|
|
282802
|
+
markScopeReadyIfComplete(scope);
|
|
282803
|
+
}, [pointScopeByNgLayerName, markScopeReadyIfComplete]);
|
|
282804
|
+
const decodeCentroidById = useCallback((layerName, buffer2) => {
|
|
282805
|
+
const scope = pointScopeByNgLayerName[layerName];
|
|
282806
|
+
const info2 = scope ? annotationInfoByScopeRef.current[scope] : null;
|
|
282807
|
+
const transform3 = scope ? annotationTransformByScopeRef.current[scope] : null;
|
|
282808
|
+
const serializer2 = transform3?.serializers?.[0] ?? transform3?.serializer;
|
|
282809
|
+
if (!info2 || !serializer2)
|
|
282810
|
+
return null;
|
|
282811
|
+
const layout = getAnnotationPropertyIndices(info2, { segmentIdProp: info2.segmentIdProp });
|
|
282812
|
+
return parseAnnotationById(buffer2, serializer2, layout)?.id ?? null;
|
|
282813
|
+
}, [pointScopeByNgLayerName]);
|
|
282218
282814
|
const handleStateUpdate = useCallback((newState) => {
|
|
282219
282815
|
lastInteractionSource.current = LAST_INTERACTION_SOURCE.neuroglancer;
|
|
282220
282816
|
const { projectionScale, projectionOrientation, position: position2 } = newState;
|
|
@@ -282225,7 +282821,8 @@ function NeuroglancerSubscriber(props) {
|
|
|
282225
282821
|
quaternion: Array.from(flippedQuaternion),
|
|
282226
282822
|
projectionScale: Number.isFinite(projectionScale) ? projectionScale * cameraZoomFactor : latestViewerStateRef.current?.projectionScale,
|
|
282227
282823
|
fovDegrees: 45,
|
|
282228
|
-
metersPerUnit: ngMetersPerUnit(latestViewerStateRef.current?.dimensions)
|
|
282824
|
+
metersPerUnit: ngMetersPerUnit(latestViewerStateRef.current?.dimensions),
|
|
282825
|
+
source: "neuroglancer"
|
|
282229
282826
|
};
|
|
282230
282827
|
lastSeenCameraSnapshotRef.current = snapshot;
|
|
282231
282828
|
setSpatialCameraSnapshot(snapshot);
|
|
@@ -282264,16 +282861,18 @@ function NeuroglancerSubscriber(props) {
|
|
|
282264
282861
|
result[layerScope] = {
|
|
282265
282862
|
colors: segmentationColorMapping?.[layerScope]?.[channelScope] ?? {},
|
|
282266
282863
|
opacity: segmentationColorMapping?.[layerScope]?.opacity ?? 1,
|
|
282267
|
-
defaultColor: segmentationColorMapping?.[layerScope]?.defaultColor ?? null
|
|
282864
|
+
defaultColor: segmentationColorMapping?.[layerScope]?.defaultColor ?? null,
|
|
282865
|
+
// Set only when "hide unselected" is active (unselected opacity 0 + a set selection).
|
|
282866
|
+
visibleMeshIds: segmentationColorMapping?.[layerScope]?.visibleMeshIds ?? null
|
|
282268
282867
|
};
|
|
282269
282868
|
});
|
|
282270
282869
|
return result;
|
|
282271
282870
|
}, [segmentationColorMapping, segmentationLayerScopes, segmentationChannelScopesByLayer]);
|
|
282272
282871
|
useEffect(() => {
|
|
282273
|
-
if (!
|
|
282872
|
+
if (!hasCentroidLayers && isReady && !segmentationLayerScopes?.length) {
|
|
282274
282873
|
setIsLayersLoaded(true);
|
|
282275
282874
|
}
|
|
282276
|
-
}, [
|
|
282875
|
+
}, [hasCentroidLayers, isReady, segmentationLayerScopes]);
|
|
282277
282876
|
const lastHoveredIdRef = useRef(null);
|
|
282278
282877
|
if (detailMode && cellHighlight != null) {
|
|
282279
282878
|
lastHoveredIdRef.current = String(cellHighlight);
|
|
@@ -282320,7 +282919,6 @@ function NeuroglancerSubscriber(props) {
|
|
|
282320
282919
|
cellHighlight,
|
|
282321
282920
|
csvLoaded
|
|
282322
282921
|
]);
|
|
282323
|
-
const meshOpacity = hasMatchingAnnotationSource ? MESH_OPACITY : void 0;
|
|
282324
282922
|
const derivedViewerState = useMemo$1(() => {
|
|
282325
282923
|
const { current: current2 } = latestViewerStateRef;
|
|
282326
282924
|
if (spatialBetaJustPushedRef.current) {
|
|
@@ -282422,20 +283020,25 @@ function NeuroglancerSubscriber(props) {
|
|
|
282422
283020
|
return layer;
|
|
282423
283021
|
const layerColorMapping = cellColorMappingByLayer?.[layerScope]?.colors ?? {};
|
|
282424
283022
|
const defaultColor = cellColorMappingByLayer?.[layerScope]?.defaultColor;
|
|
283023
|
+
const isCulled = centroidLayerRoles.culledSegLayerScopes.has(layerScope);
|
|
282425
283024
|
let segments2 = [];
|
|
282426
|
-
if (
|
|
282427
|
-
segments2 =
|
|
283025
|
+
if (isCulled) {
|
|
283026
|
+
segments2 = visibleSegmentIdsBySegLayerRef.current?.[layerScope] ?? [];
|
|
282428
283027
|
} else if (Object.keys(layerColorMapping).length > 0) {
|
|
282429
283028
|
segments2 = Object.keys(layerColorMapping);
|
|
282430
283029
|
}
|
|
283030
|
+
const visibleMeshIds = cellColorMappingByLayer?.[layerScope]?.visibleMeshIds;
|
|
283031
|
+
if (visibleMeshIds) {
|
|
283032
|
+
segments2 = segments2.filter((id2) => visibleMeshIds.has(String(id2)));
|
|
283033
|
+
}
|
|
282431
283034
|
let derivedSegmentColors = {};
|
|
282432
|
-
if (
|
|
283035
|
+
if (isCulled && segments2.length > 0) {
|
|
282433
283036
|
segments2.forEach((meshId) => {
|
|
282434
283037
|
const color2 = layerColorMapping[meshId] || defaultColor;
|
|
282435
283038
|
if (color2)
|
|
282436
283039
|
derivedSegmentColors[meshId] = color2;
|
|
282437
283040
|
});
|
|
282438
|
-
} else if (!
|
|
283041
|
+
} else if (!isCulled) {
|
|
282439
283042
|
derivedSegmentColors = layerColorMapping;
|
|
282440
283043
|
}
|
|
282441
283044
|
return {
|
|
@@ -282474,26 +283077,75 @@ function NeuroglancerSubscriber(props) {
|
|
|
282474
283077
|
spatialTargetY,
|
|
282475
283078
|
initialViewerState,
|
|
282476
283079
|
latestViewerStateIteration,
|
|
282477
|
-
hasMatchingAnnotationSource,
|
|
282478
283080
|
detailMode,
|
|
282479
283081
|
detailSegmentIds,
|
|
282480
|
-
is3dMode
|
|
283082
|
+
is3dMode,
|
|
283083
|
+
centroidLayerRoles
|
|
282481
283084
|
]);
|
|
282482
|
-
const onSegmentHighlight = useCallback((obsId) => {
|
|
283085
|
+
const onSegmentHighlight = useCallback((obsId, coord = null) => {
|
|
282483
283086
|
const next4 = obsId != null ? String(obsId) : null;
|
|
282484
|
-
if (next4
|
|
282485
|
-
|
|
283087
|
+
if (next4 != null && coord) {
|
|
283088
|
+
setHoverCoord(coord);
|
|
283089
|
+
setComponentHover(uuid2);
|
|
283090
|
+
} else {
|
|
283091
|
+
setHoverCoord(null);
|
|
283092
|
+
}
|
|
282486
283093
|
setCellHighlight(next4);
|
|
282487
|
-
}, [setCellHighlight, cellHighlight]);
|
|
283094
|
+
}, [setCellHighlight, cellHighlight, setComponentHover, uuid2]);
|
|
283095
|
+
const getObsPosition = useCallback((obsId) => {
|
|
283096
|
+
if (obsId == null)
|
|
283097
|
+
return null;
|
|
283098
|
+
const stripped = String(obsId).replace(/^.*_/, "");
|
|
283099
|
+
const meshId = String(cellIdToMeshIdRef.current?.[stripped] ?? stripped);
|
|
283100
|
+
return centroidPosByMeshIdRef.current.get(meshId) ?? null;
|
|
283101
|
+
}, []);
|
|
282488
283102
|
const handleLayerLoadingChange = useCallback((isLoaded) => {
|
|
282489
283103
|
if (!isLayersLoaded && isLoaded) {
|
|
282490
283104
|
setIsLayersLoaded(true);
|
|
282491
283105
|
}
|
|
282492
283106
|
}, [isLayersLoaded]);
|
|
282493
283107
|
const hasLayers = derivedViewerState?.layers?.length > 0;
|
|
282494
|
-
const
|
|
282495
|
-
|
|
282496
|
-
|
|
283108
|
+
const legendPointLayerScopes = pointLayerScopes?.length > 0 ? pointLayerScopes : void 0;
|
|
283109
|
+
const axisLinesVisibleEffective = spatialAxisLinesVisible ?? showAxisLines;
|
|
283110
|
+
const boundsVisibleEffective = spatialBoundsVisible ?? false;
|
|
283111
|
+
const orthographicEffective = spatialRenderingMode !== "3D";
|
|
283112
|
+
const scaleBarVisibleEffective = spatialScaleBarVisible ?? true;
|
|
283113
|
+
const pointLayersForOptions = useMemo$1(() => (pointLayerScopes || []).map((scope) => {
|
|
283114
|
+
const values3 = pointLayerCoordination[0]?.[scope] ?? {};
|
|
283115
|
+
const setters = pointLayerCoordination[1]?.[scope] ?? {};
|
|
283116
|
+
const ngLayer = derivedViewerState?.layers?.find((l2) => l2?.name === `obsPoints-${scope}`);
|
|
283117
|
+
return {
|
|
283118
|
+
scope,
|
|
283119
|
+
label: values3.spatialLayerLabel || `Points ${scope}`,
|
|
283120
|
+
strokeWidth: values3.spatialPointStrokeWidth,
|
|
283121
|
+
setStrokeWidth: setters.setSpatialPointStrokeWidth,
|
|
283122
|
+
spacing: ngLayer?.projectionAnnotationSpacing ?? values3.spatialPointProjectionSpacing,
|
|
283123
|
+
setSpacing: setters.setSpatialPointProjectionSpacing
|
|
283124
|
+
};
|
|
283125
|
+
}), [pointLayerScopes, pointLayerCoordination, derivedViewerState]);
|
|
283126
|
+
const hideUnselected = useMemo$1(() => (segmentationLayerScopes ?? []).some((layerScope) => (segmentationChannelScopesByLayer?.[layerScope] ?? []).some((channelScope) => segmentationChannelCoordination?.[0]?.[layerScope]?.[channelScope]?.spatialLayerOpacityUnselected === 0)), [segmentationLayerScopes, segmentationChannelScopesByLayer, segmentationChannelCoordination]);
|
|
283127
|
+
const setHideUnselected = useCallback((hide2) => {
|
|
283128
|
+
const value2 = hide2 ? 0 : DEFAULT_UNSELECTED_OPACITY;
|
|
283129
|
+
(segmentationLayerScopes ?? []).forEach((layerScope) => {
|
|
283130
|
+
(segmentationChannelScopesByLayer?.[layerScope] ?? []).forEach((channelScope) => {
|
|
283131
|
+
segmentationChannelCoordination?.[1]?.[layerScope]?.[channelScope]?.setSpatialLayerOpacityUnselected?.(value2);
|
|
283132
|
+
});
|
|
283133
|
+
});
|
|
283134
|
+
}, [segmentationLayerScopes, segmentationChannelScopesByLayer, segmentationChannelCoordination]);
|
|
283135
|
+
const onRecenter = useCallback(() => {
|
|
283136
|
+
setSpatialCameraSnapshot(null);
|
|
283137
|
+
}, [setSpatialCameraSnapshot]);
|
|
283138
|
+
const [cameraResetTick, setCameraResetTick] = useState(0);
|
|
283139
|
+
const prevSpatialCameraSnapshotForResetRef = useRef(spatialCameraSnapshot);
|
|
283140
|
+
useEffect(() => {
|
|
283141
|
+
if (prevSpatialCameraSnapshotForResetRef.current && !spatialCameraSnapshot) {
|
|
283142
|
+
setCameraResetTick((tick2) => tick2 + 1);
|
|
283143
|
+
}
|
|
283144
|
+
prevSpatialCameraSnapshotForResetRef.current = spatialCameraSnapshot;
|
|
283145
|
+
}, [spatialCameraSnapshot]);
|
|
283146
|
+
const backgroundTheme = spatialBackgroundTheme ?? "dark";
|
|
283147
|
+
return jsx$1(TitleInfo, { title: title2, info: subtitle, helpText, isSpatial: true, theme, closeButtonVisible, downloadButtonVisible, removeGridComponent, isReady: isReady && isLayersLoaded, errors, withPadding: false, guideUrl: GUIDE_URL, spatialBackgroundTheme: backgroundTheme, options: jsx$1(NeuroglancerOptions, { axisLinesVisible: axisLinesVisibleEffective, setAxisLinesVisible: setSpatialAxisLinesVisible, boundsVisible: boundsVisibleEffective, orthographic: orthographicEffective, setBoundsVisible: setSpatialBoundsVisible, pointLayers: pointLayersForOptions, scaleBarVisible: scaleBarVisibleEffective, setScaleBarVisible: setSpatialScaleBarVisible, hideUnselected, setHideUnselected: segmentationLayerScopes?.length ? setHideUnselected : void 0, backgroundTheme, setBackgroundTheme: setSpatialBackgroundTheme }), children: hasLayers && hasResolvedInitialCamera ? jsxs("div", { style: { position: "relative", width: "100%", height: "100%" }, ref: setContainerNode, children: [jsx$1("div", { style: { position: "absolute", top: 12, left: 12, zIndex: 1e3 }, children: jsx$1(ToolMenu, { visibleTools: { pan: false, selectLasso: false, recenter: true }, recenterOnClick: onRecenter }) }), jsx$1("div", { style: { position: "absolute", top: 0, right: 0, zIndex: 50 }, children: jsx$1(MultiLegend, {
|
|
283148
|
+
theme: backgroundTheme,
|
|
282497
283149
|
maxHeight: ngHeight,
|
|
282498
283150
|
// Segmentations
|
|
282499
283151
|
segmentationLayerScopes,
|
|
@@ -282501,12 +283153,58 @@ function NeuroglancerSubscriber(props) {
|
|
|
282501
283153
|
segmentationChannelScopesByLayer,
|
|
282502
283154
|
segmentationChannelCoordination,
|
|
282503
283155
|
// Points
|
|
282504
|
-
pointLayerScopes:
|
|
283156
|
+
pointLayerScopes: legendPointLayerScopes,
|
|
282505
283157
|
pointLayerCoordination,
|
|
282506
283158
|
pointMultiIndicesData
|
|
282507
|
-
}) }), isMeshLoading ? jsx$1(Chip, { label: "Loading meshes...", size: "small", color: "primary", className: classes2.meshLoadingIndicator }) : null, jsx$1(NeuroglancerComp, {
|
|
282508
|
-
|
|
282509
|
-
|
|
283159
|
+
}) }), isMeshLoading ? jsx$1(Chip, { label: "Loading meshes...", size: "small", color: "primary", className: classes2.meshLoadingIndicator }) : null, jsx$1(NeuroglancerComp, {
|
|
283160
|
+
classes: classes2,
|
|
283161
|
+
onSegmentClick,
|
|
283162
|
+
onSelectHoveredCoords: detailMode ? void 0 : onSegmentHighlight,
|
|
283163
|
+
viewerState: derivedViewerState,
|
|
283164
|
+
cellColorMapping: cellColorMappingByLayer,
|
|
283165
|
+
setViewerState: handleStateUpdate,
|
|
283166
|
+
onLayerLoadingChange: handleLayerLoadingChange,
|
|
283167
|
+
onAnnotationSourceReady,
|
|
283168
|
+
onViewerReady: (getFn) => {
|
|
283169
|
+
getViewProjectionMatRef.current = getFn;
|
|
283170
|
+
},
|
|
283171
|
+
getMeshIdToCellId: (meshId) => meshIdToCellIdRef.current[meshId],
|
|
283172
|
+
centroidAnnotationUrlsByLayerName,
|
|
283173
|
+
decodeCentroidById,
|
|
283174
|
+
// Hiding unselected (esp. with on-demand culling) can legitimately leave zero meshes in view.
|
|
283175
|
+
allowEmptySegments: detailMode || hideUnselected,
|
|
283176
|
+
axisLinesVisible: axisLinesVisibleEffective,
|
|
283177
|
+
boundsVisible: boundsVisibleEffective,
|
|
283178
|
+
scaleBarVisible: scaleBarVisibleEffective,
|
|
283179
|
+
orthographic: orthographicEffective,
|
|
283180
|
+
cameraResetRequest: cameraResetTick,
|
|
283181
|
+
backgroundTheme: spatialBackgroundTheme ?? "dark"
|
|
283182
|
+
}), !disableTooltip && !detailMode ? (
|
|
283183
|
+
// Overlay pinned to the container's top-left so the tooltip anchor's (x, y)
|
|
283184
|
+
// offsets are relative to the canvas, not to the end of the NG wrapper.
|
|
283185
|
+
jsx$1("div", { style: {
|
|
283186
|
+
position: "absolute",
|
|
283187
|
+
top: 0,
|
|
283188
|
+
left: 0,
|
|
283189
|
+
width: "100%",
|
|
283190
|
+
height: "100%",
|
|
283191
|
+
pointerEvents: "none",
|
|
283192
|
+
zIndex: 60
|
|
283193
|
+
}, children: jsx$1(NeuroglancerTooltipSubscriber, {
|
|
283194
|
+
parentUuid: uuid2,
|
|
283195
|
+
hoverCoord,
|
|
283196
|
+
// useGridItemSize can report 0x0; viewportSizeRef holds the real container size.
|
|
283197
|
+
width: viewportSizeRef.current.width || ngWidth,
|
|
283198
|
+
height: viewportSizeRef.current.height || ngHeight,
|
|
283199
|
+
getViewProjectionMat: () => getViewProjectionMatRef.current?.(),
|
|
283200
|
+
obsHighlight: cellHighlight,
|
|
283201
|
+
getObsPosition,
|
|
283202
|
+
segmentationLayerScopes,
|
|
283203
|
+
segmentationChannelScopesByLayer,
|
|
283204
|
+
segmentationChannelCoordination,
|
|
283205
|
+
obsSegmentationsSetsData
|
|
283206
|
+
}) })
|
|
283207
|
+
) : null] }) : null });
|
|
282510
283208
|
}
|
|
282511
283209
|
const FEATURE_AGGREGATION_STRATEGIES = ["first", "last", "sum", "mean"];
|
|
282512
283210
|
function CellSetExpressionPlotOptions(props) {
|
|
@@ -284733,7 +285431,7 @@ function CellSetExpressionPlotSubscriber(props) {
|
|
|
284733
285431
|
sampleSetsUrls,
|
|
284734
285432
|
sampleEdgesUrls
|
|
284735
285433
|
]);
|
|
284736
|
-
const featureAggregationStrategyToUse = featureAggregationStrategy ?? DEFAULT_FEATURE_AGGREGATION_STRATEGY;
|
|
285434
|
+
const featureAggregationStrategyToUse = resolveFeatureAggregationStrategy(featureAggregationStrategy, geneSelection) ?? DEFAULT_FEATURE_AGGREGATION_STRATEGY;
|
|
284737
285435
|
const [histogramData, setArr, exprMax] = useExpressionByCellSet(sampleEdges, sampleSets, sampleSetSelection, expressionData, obsIndex, cellSets, additionalCellSets, geneSelection, cellSetSelection, cellSetColor, featureValueTransform, featureValueTransformCoefficient, theme, yMin, featureAggregationStrategyToUse, obsSetsColumns);
|
|
284738
285436
|
const featureSuffix = useMemo$1(() => {
|
|
284739
285437
|
const cleanedGeneSelection = geneSelection?.map((geneName) => featureLabelsMap?.get(geneName) || featureLabelsMap?.get(cleanFeatureId(geneName)) || geneName);
|
|
@@ -335019,7 +335717,7 @@ const VEGA_THEMES = {
|
|
|
335019
335717
|
};
|
|
335020
335718
|
const DATASET_NAME = "table";
|
|
335021
335719
|
function VegaGlobalStyles() {
|
|
335022
|
-
const { theme } = useStyles$
|
|
335720
|
+
const { theme } = useStyles$z();
|
|
335023
335721
|
return jsx$1(GlobalStyles$3, { styles: {
|
|
335024
335722
|
"#vg-tooltip-element.vg-tooltip.custom-theme": {
|
|
335025
335723
|
boxShadow: "0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)",
|
|
@@ -335053,7 +335751,7 @@ function renderTooltipContents(tooltipText) {
|
|
|
335053
335751
|
}
|
|
335054
335752
|
function VegaPlot(props) {
|
|
335055
335753
|
const { spec: partialSpec, data: data2, getTooltipText, signalListeners, renderer = "svg", onNewView } = props;
|
|
335056
|
-
const { classes: tooltipClasses2 } = useStyles$
|
|
335754
|
+
const { classes: tooltipClasses2 } = useStyles$u();
|
|
335057
335755
|
const tooltipHandler = useMemo$1(() => {
|
|
335058
335756
|
if (typeof getTooltipText === "function") {
|
|
335059
335757
|
const tooltipConfig = {
|
|
@@ -335355,10 +336053,11 @@ function ExpressionHistogramSubscriber(props) {
|
|
|
335355
336053
|
matrixUrls
|
|
335356
336054
|
]);
|
|
335357
336055
|
const numGenesSelected = geneSelection ? geneSelection.length : 0;
|
|
335358
|
-
const aggregationStrategy = featureAggregationStrategy ?? "first";
|
|
336056
|
+
const aggregationStrategy = resolveFeatureAggregationStrategy(featureAggregationStrategy, geneSelection) ?? "first";
|
|
336057
|
+
const aggregationStrategyLabel = typeof aggregationStrategy === "number" ? geneSelection[aggregationStrategy] : aggregationStrategy;
|
|
335359
336058
|
const titleSuffix = (
|
|
335360
336059
|
// eslint-disable-next-line no-nested-ternary
|
|
335361
|
-
numGenesSelected > 1 ? ` (${numGenesSelected} genes, ${
|
|
336060
|
+
numGenesSelected > 1 ? ` (${numGenesSelected} genes, ${aggregationStrategyLabel})` : numGenesSelected === 1 ? ` (${geneSelection[0]})` : ""
|
|
335362
336061
|
);
|
|
335363
336062
|
const data2 = useMemo$1(() => {
|
|
335364
336063
|
if (numGenesSelected > 0 && obsFeatureMatrix && expressionData) {
|
|
@@ -335398,7 +336097,7 @@ function ExpressionHistogramSubscriber(props) {
|
|
|
335398
336097
|
const onSelect = useCallback((value2) => {
|
|
335399
336098
|
const geneName = (
|
|
335400
336099
|
// eslint-disable-next-line no-nested-ternary
|
|
335401
|
-
numGenesSelected > 1 ? `${numGenesSelected} genes (${
|
|
336100
|
+
numGenesSelected > 1 ? `${numGenesSelected} genes (${aggregationStrategyLabel})` : numGenesSelected === 1 ? ` ${geneSelection[0]}` : "transcript count"
|
|
335402
336101
|
);
|
|
335403
336102
|
const selectedCellIds = getObsInfoFromDataWithinRange(value2, data2);
|
|
335404
336103
|
setObsSelection(selectedCellIds, additionalCellSets, cellSetColor, setCellSetSelection, setAdditionalCellSets, setCellSetColor, setCellColorEncoding, "Selection ", `: based on ${geneName} in range [${value2[0].toFixed(1)}, ${value2[1].toFixed(1)}] `);
|
|
@@ -335411,7 +336110,7 @@ function ExpressionHistogramSubscriber(props) {
|
|
|
335411
336110
|
setCellSetColor,
|
|
335412
336111
|
setCellSetSelection,
|
|
335413
336112
|
numGenesSelected,
|
|
335414
|
-
|
|
336113
|
+
aggregationStrategyLabel,
|
|
335415
336114
|
geneSelection
|
|
335416
336115
|
]);
|
|
335417
336116
|
return jsx$1(TitleInfo, { title: `Histogram ${titleSuffix}`, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, helpText, errors, children: jsx$1("div", { ref: containerRef, className: classes2.vegaContainer, children: jsx$1(ExpressionHistogram, { geneSelection, obsType, featureType, featureValueType, onSelect, data: data2, theme, width: width2, height: height2 }) }) });
|
|
@@ -335699,9 +336398,8 @@ function DotPlotSubscriber(props) {
|
|
|
335699
336398
|
const [resultArr, meanExpressionMax] = useExpressionSummaries(sampleEdges, sampleSets, sampleSetSelection, expressionData, obsIndex, cellSets, additionalCellSets, geneSelection, cellSetSelection, cellSetColor, featureValueTransform, featureValueTransformCoefficient, posThreshold, featureLabelsMap, obsSetsColumns);
|
|
335700
336399
|
const selectedTransformName = transformOptions.find((o2) => o2.value === featureValueTransform)?.name;
|
|
335701
336400
|
const onDotSelect = useCallback((featureName, isShiftDown = false) => {
|
|
335702
|
-
|
|
335703
|
-
|
|
335704
|
-
setFeatureAggregationStrategy(featureI);
|
|
336401
|
+
if (geneSelection.includes(featureName?.[0])) {
|
|
336402
|
+
setFeatureAggregationStrategy(featureName[0]);
|
|
335705
336403
|
}
|
|
335706
336404
|
}, [setFeatureAggregationStrategy, geneSelection]);
|
|
335707
336405
|
return jsx$1(TitleInfo, { title: title2, removeGridComponent, urls: urls2, theme, isReady, helpText, errors, options: jsx$1(CellSetExpressionPlotOptions, { featureValueTransform, setFeatureValueTransform, featureValueTransformCoefficient, setFeatureValueTransformCoefficient, transformOptions, featureValuePositivityThreshold: posThreshold, setFeatureValuePositivityThreshold: setPosThreshold, featureValueColormap, setFeatureValueColormap }), children: jsx$1("div", { ref: containerRef, className: classes2.vegaContainer, children: resultArr ? jsx$1(DotPlot, { isStratified, transpose: transpose2, domainMax: meanExpressionMax, data: resultArr, theme, width: width2, height: height2, obsType, sampleType, featureType, featureValueType, featureValueTransformName: selectedTransformName, featureValueColormap, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, onDotSelect }) : jsxs("span", { children: ["Select at least one ", featureType, "."] }) }) });
|
|
@@ -337466,7 +338164,9 @@ class ObsSpotsCsvLoader extends CsvLoader {
|
|
|
337466
338164
|
// spatialLayerColor: [255, 255, 255],
|
|
337467
338165
|
spatialLayerVisible: true,
|
|
337468
338166
|
spatialLayerOpacity: 1,
|
|
337469
|
-
spatialSpotRadius: 10
|
|
338167
|
+
spatialSpotRadius: 10,
|
|
338168
|
+
spatialSpotShape: null,
|
|
338169
|
+
featureAggregationStrategy: null
|
|
337470
338170
|
// TODO: spatialSpotRadiusUnit: 'µm' or 'um'
|
|
337471
338171
|
// after resolving https://github.com/vitessce/vitessce/issues/1760
|
|
337472
338172
|
// featureValueColormapRange: [0, 1],
|
|
@@ -337713,7 +338413,8 @@ class ObsSegmentationsJsonLoader extends JsonLoader {
|
|
|
337713
338413
|
obsColorEncoding: "spatialChannelColor",
|
|
337714
338414
|
spatialSegmentationFilled: true,
|
|
337715
338415
|
spatialSegmentationStrokeWidth: 1,
|
|
337716
|
-
obsHighlight: null
|
|
338416
|
+
obsHighlight: null,
|
|
338417
|
+
featureAggregationStrategy: null
|
|
337717
338418
|
}];
|
|
337718
338419
|
const coordinationValues = {
|
|
337719
338420
|
// spatialTargetZ: imageWrapper.getDefaultTargetZ(),
|
|
@@ -339514,8 +340215,9 @@ class ObsSpotsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
339514
340215
|
// spatialLayerColor: [255, 255, 255],
|
|
339515
340216
|
spatialLayerVisible: true,
|
|
339516
340217
|
spatialLayerOpacity: 1,
|
|
339517
|
-
spatialSpotRadius: 10
|
|
340218
|
+
spatialSpotRadius: 10,
|
|
339518
340219
|
// TODO: get this from adata.uns if possible.
|
|
340220
|
+
spatialSpotShape: null,
|
|
339519
340221
|
// TODO: spatialSpotRadiusUnit: 'µm' or 'um'
|
|
339520
340222
|
// after resolving https://github.com/vitessce/vitessce/issues/1760
|
|
339521
340223
|
// featureValueColormapRange: [0, 1],
|
|
@@ -339523,6 +340225,7 @@ class ObsSpotsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
339523
340225
|
// obsSetColor: null,
|
|
339524
340226
|
// obsSetSelection: null,
|
|
339525
340227
|
// additionalObsSets: null,
|
|
340228
|
+
featureAggregationStrategy: null
|
|
339526
340229
|
})
|
|
339527
340230
|
};
|
|
339528
340231
|
const [obsIndex, obsSpots] = await Promise.all([
|
|
@@ -339648,7 +340351,8 @@ class ObsSegmentationsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
339648
340351
|
obsColorEncoding: "spatialChannelColor",
|
|
339649
340352
|
spatialSegmentationFilled: true,
|
|
339650
340353
|
spatialSegmentationStrokeWidth: 1,
|
|
339651
|
-
obsHighlight: null
|
|
340354
|
+
obsHighlight: null,
|
|
340355
|
+
featureAggregationStrategy: null
|
|
339652
340356
|
}];
|
|
339653
340357
|
const coordinationValues = {
|
|
339654
340358
|
// Old
|
|
@@ -340948,6 +341652,7 @@ class OmeZarrAsObsSegmentationsLoader extends OmeZarrLoader {
|
|
|
340948
341652
|
spatialSegmentationStrokeWidth: 1,
|
|
340949
341653
|
obsHighlight: null,
|
|
340950
341654
|
featureValueColormap: GLSL_COLORMAP_DEFAULT,
|
|
341655
|
+
featureAggregationStrategy: null,
|
|
340951
341656
|
...obsTypesFromChannelNames ? { obsType: channelObj.name } : {}
|
|
340952
341657
|
}));
|
|
340953
341658
|
const coordinationValues = {
|
|
@@ -340995,7 +341700,8 @@ class SpatialDataLabelsLoader extends SpatialDataImageLoader {
|
|
|
340995
341700
|
obsColorEncoding: "spatialChannelColor",
|
|
340996
341701
|
spatialSegmentationFilled: true,
|
|
340997
341702
|
spatialSegmentationStrokeWidth: 1,
|
|
340998
|
-
obsHighlight: null
|
|
341703
|
+
obsHighlight: null,
|
|
341704
|
+
featureAggregationStrategy: null
|
|
340999
341705
|
}));
|
|
341000
341706
|
const coordinationValues = {
|
|
341001
341707
|
spatialTargetZ: imageWrapper.getDefaultTargetZ(),
|
|
@@ -341160,7 +341866,9 @@ class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
|
|
|
341160
341866
|
// spatialLayerColor: [255, 255, 255],
|
|
341161
341867
|
spatialLayerVisible: true,
|
|
341162
341868
|
spatialLayerOpacity: 1,
|
|
341163
|
-
spatialSpotRadius
|
|
341869
|
+
spatialSpotRadius,
|
|
341870
|
+
spatialSpotShape: null,
|
|
341871
|
+
featureAggregationStrategy: null
|
|
341164
341872
|
// TODO: spatialSpotRadiusUnit: 'µm' or 'um'
|
|
341165
341873
|
// after resolving https://github.com/vitessce/vitessce/issues/1760
|
|
341166
341874
|
// featureValueColormapRange: [0, 1],
|
|
@@ -341243,7 +341951,8 @@ class SpatialDataObsSegmentationsLoader extends AbstractTwoStepLoader {
|
|
|
341243
341951
|
spatialSegmentationFilled: true,
|
|
341244
341952
|
spatialSegmentationStrokeWidth: 1,
|
|
341245
341953
|
obsHighlight: null,
|
|
341246
|
-
featureValueColormap: GLSL_COLORMAP_DEFAULT
|
|
341954
|
+
featureValueColormap: GLSL_COLORMAP_DEFAULT,
|
|
341955
|
+
featureAggregationStrategy: null
|
|
341247
341956
|
}];
|
|
341248
341957
|
const coordinationValues = {
|
|
341249
341958
|
segmentationLayer: CL([
|
|
@@ -341486,6 +342195,27 @@ class NgAnnotationPointsDataLoader extends AbstractTwoStepLoader {
|
|
|
341486
342195
|
}, url);
|
|
341487
342196
|
}
|
|
341488
342197
|
}
|
|
342198
|
+
class NgAnnotationLocationsDataLoader extends AbstractTwoStepLoader {
|
|
342199
|
+
async load() {
|
|
342200
|
+
const { url, requestInit: requestInit2, options } = this;
|
|
342201
|
+
if (!this.neuroglancerInfo) {
|
|
342202
|
+
this.neuroglancerInfo = fetchNeuroglancerInfo(url, requestInit2);
|
|
342203
|
+
}
|
|
342204
|
+
const neuroglancerInfo = await this.neuroglancerInfo;
|
|
342205
|
+
return new LoaderResult({
|
|
342206
|
+
obsIndex: null,
|
|
342207
|
+
obsLocations: null,
|
|
342208
|
+
obsLocationsTilingType: "neuroglancer",
|
|
342209
|
+
neuroglancerOptions: options,
|
|
342210
|
+
// Contents of the annotation source's `info` JSON file
|
|
342211
|
+
// (e.g., lower_bound, upper_bound, spatial, properties).
|
|
342212
|
+
neuroglancerInfo,
|
|
342213
|
+
// The multi-level data hooks only return the `data` part of the
|
|
342214
|
+
// LoaderResult, so the source URL is also included here.
|
|
342215
|
+
neuroglancerUrl: url
|
|
342216
|
+
}, url);
|
|
342217
|
+
}
|
|
342218
|
+
}
|
|
341489
342219
|
const decoder = new TextDecoder("utf-8");
|
|
341490
342220
|
const decodeUtf8 = (buffer2) => decoder.decode(buffer2);
|
|
341491
342221
|
const encoder = new TextEncoder();
|
|
@@ -358085,6 +358815,7 @@ class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
|
|
|
358085
358815
|
spatialSegmentationFilled: true,
|
|
358086
358816
|
spatialSegmentationStrokeWidth: 1,
|
|
358087
358817
|
obsHighlight: null,
|
|
358818
|
+
featureAggregationStrategy: null,
|
|
358088
358819
|
...obsTypesFromChannelNames ? { obsType: channelObj.name } : {}
|
|
358089
358820
|
}));
|
|
358090
358821
|
const imagesWithLoaderCreators = [
|
|
@@ -360717,6 +361448,7 @@ const baseFileTypes = [
|
|
|
360717
361448
|
makeFileType(FileType$1.OBS_SEGMENTATIONS_GLB, DataType$3.OBS_SEGMENTATIONS, GlbDataLoader, GlbSource, meshGlbSchema),
|
|
360718
361449
|
makeFileType(FileType$1.OBS_SEGMENTATIONS_NG_PRECOMPUTED, DataType$3.OBS_SEGMENTATIONS, PrecomputedMeshDataLoader, PrecomputedMeshSource, ngPrecomputedMeshSchema),
|
|
360719
361450
|
makeFileType(FileType$1.OBS_POINTS_NG_ANNOTATIONS, DataType$3.OBS_POINTS, NgAnnotationPointsDataLoader, PrecomputedMeshSource, ngPointAnnotationSchema),
|
|
361451
|
+
makeFileType(FileType$1.OBS_LOCATIONS_NG_ANNOTATIONS, DataType$3.OBS_LOCATIONS, NgAnnotationLocationsDataLoader, PrecomputedMeshSource, ngLocationsAnnotationSchema),
|
|
360720
361452
|
// All legacy file types
|
|
360721
361453
|
makeFileType(FileType$1.OBS_FEATURE_MATRIX_EXPRESSION_MATRIX_ZARR, DataType$3.OBS_FEATURE_MATRIX, MatrixZarrAsObsFeatureMatrixLoader, ZarrDataSource, z.null()),
|
|
360722
361454
|
makeFileType(FileType$1.IMAGE_RASTER_JSON, DataType$3.IMAGE, RasterJsonAsImageLoader, JsonSource, rasterJsonSchema),
|
|
@@ -360906,7 +361638,10 @@ const baseCoordinationTypes = [
|
|
|
360906
361638
|
"difference"
|
|
360907
361639
|
]),
|
|
360908
361640
|
// An index of a featureSelection array element.
|
|
360909
|
-
z.number()
|
|
361641
|
+
z.number(),
|
|
361642
|
+
// The name of a featureSelection array element.
|
|
361643
|
+
// Any string other than the reserved values above is treated as a feature name.
|
|
361644
|
+
z.string()
|
|
360910
361645
|
]).nullable()),
|
|
360911
361646
|
new PluginCoordinationType(
|
|
360912
361647
|
CoordinationType$1.FEATURE_SET_SELECTION,
|
|
@@ -360990,7 +361725,17 @@ const baseCoordinationTypes = [
|
|
|
360990
361725
|
new PluginCoordinationType(CoordinationType$1.SPATIAL_SEGMENTATION_STROKE_WIDTH, 1, z.number()),
|
|
360991
361726
|
new PluginCoordinationType(CoordinationType$1.SPATIAL_POINT_STROKE_WIDTH, 0, z.number()),
|
|
360992
361727
|
new PluginCoordinationType(CoordinationType$1.SPATIAL_LOD_FACTOR, 1, z.number()),
|
|
361728
|
+
// null = fall back to the neuroglancer view's showAxisLines prop / NG default.
|
|
361729
|
+
new PluginCoordinationType(CoordinationType$1.SPATIAL_AXIS_LINES_VISIBLE, null, z.boolean().nullable()),
|
|
361730
|
+
// Neuroglancer default annotations (data-source bounding boxes).
|
|
361731
|
+
new PluginCoordinationType(CoordinationType$1.SPATIAL_BOUNDS_VISIBLE, null, z.boolean().nullable()),
|
|
360993
361732
|
// Reference: https://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html
|
|
361733
|
+
// null = use the file's projectionAnnotationSpacing option. NG valid range [0.0625, 65536].
|
|
361734
|
+
new PluginCoordinationType(CoordinationType$1.SPATIAL_POINT_PROJECTION_SPACING, null, z.number().nullable()),
|
|
361735
|
+
new PluginCoordinationType(CoordinationType$1.SPATIAL_SCALE_BAR_VISIBLE, true, z.boolean().nullable()),
|
|
361736
|
+
// Default matches Neuroglancer's own default point marker diameter
|
|
361737
|
+
new PluginCoordinationType(CoordinationType$1.SPATIAL_POINT_RADIUS, 2.5, z.number()),
|
|
361738
|
+
new PluginCoordinationType(CoordinationType$1.SPATIAL_BACKGROUND_THEME, "dark", z.enum(["dark", "light"]).nullable()),
|
|
360994
361739
|
new PluginCoordinationType(CoordinationType$1.PHOTOMETRIC_INTERPRETATION, null, z.enum(["BlackIsZero", "RGB"]).nullable()),
|
|
360995
361740
|
new PluginCoordinationType(CoordinationType$1.SPATIAL_RENDERING_MODE, "2D", z.enum(["2D", "3D"]).nullable()),
|
|
360996
361741
|
new PluginCoordinationType(CoordinationType$1.VOLUMETRIC_RENDERING_ALGORITHM, "additive", z.enum(["maximumIntensityProjection", "additive"])),
|
|
@@ -361002,6 +361747,7 @@ const baseCoordinationTypes = [
|
|
|
361002
361747
|
new PluginCoordinationType(CoordinationType$1.SPOT_LAYER, null, z.string().nullable()),
|
|
361003
361748
|
new PluginCoordinationType(CoordinationType$1.POINT_LAYER, null, z.string().nullable()),
|
|
361004
361749
|
new PluginCoordinationType(CoordinationType$1.SPATIAL_SPOT_RADIUS, 25, z.number().nullable()),
|
|
361750
|
+
new PluginCoordinationType(CoordinationType$1.SPATIAL_SPOT_SHAPE, "circle", z.enum(["circle", "square"]).nullable()),
|
|
361005
361751
|
new PluginCoordinationType(CoordinationType$1.SPATIAL_SPOT_FILLED, true, z.boolean()),
|
|
361006
361752
|
new PluginCoordinationType(CoordinationType$1.SPATIAL_SPOT_STROKE_WIDTH, 1, z.number()),
|
|
361007
361753
|
new PluginCoordinationType(CoordinationType$1.SPATIAL_LAYER_COLOR, null, z.array(z.number()).length(3).nullable()),
|
|
@@ -361151,20 +361897,21 @@ export {
|
|
|
361151
361897
|
require_objectAssign as _,
|
|
361152
361898
|
LercAddCompression as a,
|
|
361153
361899
|
diffCameraState as a0,
|
|
361154
|
-
|
|
361155
|
-
|
|
361156
|
-
|
|
361157
|
-
|
|
361158
|
-
|
|
361159
|
-
|
|
361160
|
-
|
|
361161
|
-
|
|
361162
|
-
|
|
361163
|
-
|
|
361164
|
-
|
|
361165
|
-
|
|
361166
|
-
|
|
361167
|
-
|
|
361900
|
+
applyQuat as a1,
|
|
361901
|
+
Vitessce as a2,
|
|
361902
|
+
PluginFileType as a3,
|
|
361903
|
+
PluginViewType as a4,
|
|
361904
|
+
PluginCoordinationType as a5,
|
|
361905
|
+
PluginJointFileType as a6,
|
|
361906
|
+
PluginAsyncFunction as a7,
|
|
361907
|
+
z as a8,
|
|
361908
|
+
hasAnnotationControllerView as a9,
|
|
361909
|
+
addAnnotationControllerView as aa,
|
|
361910
|
+
removeAnnotationControllerView as ab,
|
|
361911
|
+
hasAnyAnnotationStory as ac,
|
|
361912
|
+
isAnyAnnotationEditing as ad,
|
|
361913
|
+
enableAnnotationEditing as ae,
|
|
361914
|
+
disableAnnotationEditing as af,
|
|
361168
361915
|
getImageSize as b,
|
|
361169
361916
|
commonjsGlobal$1 as c,
|
|
361170
361917
|
requireAssign as d,
|