@vitessce/layer-controller 3.1.2 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{deflate-460ebda8.js → deflate-4152c8e9.js} +1 -1
- package/dist/{index-7295e6e7.js → index-64da21ec.js} +982 -244
- package/dist/index.js +9 -2
- package/dist/{jpeg-5e6a02ae.js → jpeg-29889288.js} +1 -1
- package/dist/{lerc-f147b9b3.js → lerc-899a010f.js} +1 -1
- package/dist/{lzw-328dcf22.js → lzw-f5a9e721.js} +1 -1
- package/dist/{packbits-d1842d12.js → packbits-5fc9c646.js} +1 -1
- package/dist/{raw-e59a20ba.js → raw-0ae87697.js} +1 -1
- package/dist/{webimage-30f949aa.js → webimage-1731afb4.js} +1 -1
- package/dist-tsc/ChannelOptions.d.ts.map +1 -1
- package/dist-tsc/ChannelOptions.js +6 -1
- package/dist-tsc/LayerController.d.ts.map +1 -1
- package/dist-tsc/LayerController.js +1 -4
- package/dist-tsc/LayerOptions.d.ts.map +1 -1
- package/dist-tsc/LayerOptions.js +3 -4
- package/dist-tsc/RasterChannelController.d.ts.map +1 -1
- package/dist-tsc/RasterChannelController.js +1 -25
- package/dist-tsc/VolumeOptions.js +1 -1
- package/dist-tsc/index.d.ts +1 -0
- package/dist-tsc/index.js +1 -0
- package/dist-tsc/styles.d.ts +3 -3
- package/dist-tsc/styles.d.ts.map +1 -1
- package/dist-tsc/styles.js +10 -13
- package/package.json +6 -6
- package/src/ChannelOptions.js +7 -1
- package/src/LayerController.js +6 -5
- package/src/LayerOptions.js +11 -7
- package/src/RasterChannelController.js +7 -29
- package/src/VolumeOptions.js +1 -1
- package/src/index.js +9 -0
- package/src/styles.js +10 -14
- package/dist-tsc/RasterChannelController.test.d.ts +0 -2
- package/dist-tsc/RasterChannelController.test.d.ts.map +0 -1
- package/dist-tsc/RasterChannelController.test.js +0 -22
- package/dist-tsc/constants.d.ts +0 -2
- package/dist-tsc/constants.d.ts.map +0 -1
- package/dist-tsc/constants.js +0 -12
- package/dist-tsc/utils.d.ts +0 -24
- package/dist-tsc/utils.d.ts.map +0 -1
- package/dist-tsc/utils.js +0 -117
- package/src/RasterChannelController.test.js +0 -24
- package/src/constants.js +0 -14
- package/src/utils.js +0 -138
|
@@ -16808,8 +16808,10 @@ const ViewType$1 = {
|
|
|
16808
16808
|
STATUS: "status",
|
|
16809
16809
|
SCATTERPLOT: "scatterplot",
|
|
16810
16810
|
SPATIAL: "spatial",
|
|
16811
|
+
SPATIAL_BETA: "spatialBeta",
|
|
16811
16812
|
HEATMAP: "heatmap",
|
|
16812
16813
|
LAYER_CONTROLLER: "layerController",
|
|
16814
|
+
LAYER_CONTROLLER_BETA: "layerControllerBeta",
|
|
16813
16815
|
GENOMIC_PROFILES: "genomicProfiles",
|
|
16814
16816
|
GATING: "gating",
|
|
16815
16817
|
FEATURE_LIST: "featureList",
|
|
@@ -16821,20 +16823,24 @@ const ViewType$1 = {
|
|
|
16821
16823
|
const DataType$2 = {
|
|
16822
16824
|
OBS_LABELS: "obsLabels",
|
|
16823
16825
|
OBS_EMBEDDING: "obsEmbedding",
|
|
16824
|
-
OBS_LOCATIONS: "obsLocations",
|
|
16825
16826
|
OBS_FEATURE_MATRIX: "obsFeatureMatrix",
|
|
16826
16827
|
OBS_SETS: "obsSets",
|
|
16827
16828
|
FEATURE_LABELS: "featureLabels",
|
|
16828
16829
|
IMAGE: "image",
|
|
16829
16830
|
OBS_SEGMENTATIONS: "obsSegmentations",
|
|
16830
16831
|
NEIGHBORHOODS: "neighborhoods",
|
|
16831
|
-
GENOMIC_PROFILES: "genomic-profiles"
|
|
16832
|
+
GENOMIC_PROFILES: "genomic-profiles",
|
|
16833
|
+
OBS_SPOTS: "obsSpots",
|
|
16834
|
+
OBS_POINTS: "obsPoints",
|
|
16835
|
+
OBS_LOCATIONS: "obsLocations"
|
|
16832
16836
|
};
|
|
16833
16837
|
const FileType$1 = {
|
|
16834
16838
|
// Joint file types
|
|
16835
16839
|
ANNDATA_ZARR: "anndata.zarr",
|
|
16836
16840
|
// Atomic file types
|
|
16837
16841
|
OBS_EMBEDDING_CSV: "obsEmbedding.csv",
|
|
16842
|
+
OBS_SPOTS_CSV: "obsSpots.csv",
|
|
16843
|
+
OBS_POINTS_CSV: "obsPoints.csv",
|
|
16838
16844
|
OBS_LOCATIONS_CSV: "obsLocations.csv",
|
|
16839
16845
|
OBS_LABELS_CSV: "obsLabels.csv",
|
|
16840
16846
|
FEATURE_LABELS_CSV: "featureLabels.csv",
|
|
@@ -16847,6 +16853,8 @@ const FileType$1 = {
|
|
|
16847
16853
|
OBS_FEATURE_MATRIX_ANNDATA_ZARR: "obsFeatureMatrix.anndata.zarr",
|
|
16848
16854
|
OBS_SETS_ANNDATA_ZARR: "obsSets.anndata.zarr",
|
|
16849
16855
|
OBS_EMBEDDING_ANNDATA_ZARR: "obsEmbedding.anndata.zarr",
|
|
16856
|
+
OBS_SPOTS_ANNDATA_ZARR: "obsSpots.anndata.zarr",
|
|
16857
|
+
OBS_POINTS_ANNDATA_ZARR: "obsPoints.anndata.zarr",
|
|
16850
16858
|
OBS_LOCATIONS_ANNDATA_ZARR: "obsLocations.anndata.zarr",
|
|
16851
16859
|
OBS_SEGMENTATIONS_ANNDATA_ZARR: "obsSegmentations.anndata.zarr",
|
|
16852
16860
|
OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
|
|
@@ -16855,6 +16863,8 @@ const FileType$1 = {
|
|
|
16855
16863
|
OBS_FEATURE_MATRIX_MUDATA_ZARR: "obsFeatureMatrix.mudata.zarr",
|
|
16856
16864
|
OBS_SETS_MUDATA_ZARR: "obsSets.mudata.zarr",
|
|
16857
16865
|
OBS_EMBEDDING_MUDATA_ZARR: "obsEmbedding.mudata.zarr",
|
|
16866
|
+
OBS_SPOTS_MUDATA_ZARR: "obsSpots.mudata.zarr",
|
|
16867
|
+
OBS_POINTS_MUDATA_ZARR: "obsPoints.mudata.zarr",
|
|
16858
16868
|
OBS_LOCATIONS_MUDATA_ZARR: "obsLocations.mudata.zarr",
|
|
16859
16869
|
OBS_SEGMENTATIONS_MUDATA_ZARR: "obsSegmentations.mudata.zarr",
|
|
16860
16870
|
OBS_LABELS_MUDATA_ZARR: "obsLabels.mudata.zarr",
|
|
@@ -16898,10 +16908,8 @@ const FileType$1 = {
|
|
|
16898
16908
|
ANNDATA_EXPRESSION_MATRIX_ZARR: "anndata-expression-matrix.zarr"
|
|
16899
16909
|
};
|
|
16900
16910
|
const CoordinationType$1 = {
|
|
16901
|
-
// Meta coordination scopes
|
|
16902
16911
|
META_COORDINATION_SCOPES: "metaCoordinationScopes",
|
|
16903
16912
|
META_COORDINATION_SCOPES_BY: "metaCoordinationScopesBy",
|
|
16904
|
-
// Other coordination scopes
|
|
16905
16913
|
DATASET: "dataset",
|
|
16906
16914
|
// Entity types
|
|
16907
16915
|
OBS_TYPE: "obsType",
|
|
@@ -16927,6 +16935,7 @@ const CoordinationType$1 = {
|
|
|
16927
16935
|
SPATIAL_TARGET_X: "spatialTargetX",
|
|
16928
16936
|
SPATIAL_TARGET_Y: "spatialTargetY",
|
|
16929
16937
|
SPATIAL_TARGET_Z: "spatialTargetZ",
|
|
16938
|
+
SPATIAL_TARGET_T: "spatialTargetT",
|
|
16930
16939
|
SPATIAL_ROTATION_X: "spatialRotationX",
|
|
16931
16940
|
SPATIAL_ROTATION_Y: "spatialRotationY",
|
|
16932
16941
|
SPATIAL_ROTATION_Z: "spatialRotationZ",
|
|
@@ -16964,7 +16973,46 @@ const CoordinationType$1 = {
|
|
|
16964
16973
|
GATING_FEATURE_SELECTION_X: "gatingFeatureSelectionX",
|
|
16965
16974
|
GATING_FEATURE_SELECTION_Y: "gatingFeatureSelectionY",
|
|
16966
16975
|
FEATURE_VALUE_TRANSFORM_COEFFICIENT: "featureValueTransformCoefficient",
|
|
16967
|
-
TOOLTIPS_VISIBLE: "tooltipsVisible"
|
|
16976
|
+
TOOLTIPS_VISIBLE: "tooltipsVisible",
|
|
16977
|
+
FILE_UID: "fileUid",
|
|
16978
|
+
IMAGE_LAYER: "imageLayer",
|
|
16979
|
+
IMAGE_CHANNEL: "imageChannel",
|
|
16980
|
+
SEGMENTATION_LAYER: "segmentationLayer",
|
|
16981
|
+
SEGMENTATION_CHANNEL: "segmentationChannel",
|
|
16982
|
+
SPATIAL_TARGET_C: "spatialTargetC",
|
|
16983
|
+
SPATIAL_LAYER_VISIBLE: "spatialLayerVisible",
|
|
16984
|
+
SPATIAL_LAYER_OPACITY: "spatialLayerOpacity",
|
|
16985
|
+
SPATIAL_LAYER_COLORMAP: "spatialLayerColormap",
|
|
16986
|
+
SPATIAL_LAYER_TRANSPARENT_COLOR: "spatialLayerTransparentColor",
|
|
16987
|
+
SPATIAL_LAYER_MODEL_MATRIX: "spatialLayerModelMatrix",
|
|
16988
|
+
SPATIAL_SEGMENTATION_FILLED: "spatialSegmentationFilled",
|
|
16989
|
+
SPATIAL_SEGMENTATION_STROKE_WIDTH: "spatialSegmentationStrokeWidth",
|
|
16990
|
+
SPATIAL_CHANNEL_COLOR: "spatialChannelColor",
|
|
16991
|
+
SPATIAL_CHANNEL_VISIBLE: "spatialChannelVisible",
|
|
16992
|
+
SPATIAL_CHANNEL_OPACITY: "spatialChannelOpacity",
|
|
16993
|
+
SPATIAL_CHANNEL_WINDOW: "spatialChannelWindow",
|
|
16994
|
+
PHOTOMETRIC_INTERPRETATION: "photometricInterpretation",
|
|
16995
|
+
// For 3D volume rendering
|
|
16996
|
+
SPATIAL_RENDERING_MODE: "spatialRenderingMode",
|
|
16997
|
+
VOLUMETRIC_RENDERING_ALGORITHM: "volumetricRenderingAlgorithm",
|
|
16998
|
+
SPATIAL_TARGET_RESOLUTION: "spatialTargetResolution",
|
|
16999
|
+
// For clipping plane sliders
|
|
17000
|
+
SPATIAL_SLICE_X: "spatialSliceX",
|
|
17001
|
+
SPATIAL_SLICE_Y: "spatialSliceY",
|
|
17002
|
+
SPATIAL_SLICE_Z: "spatialSliceZ",
|
|
17003
|
+
// For spatial spot and point layers
|
|
17004
|
+
SPOT_LAYER: "spotLayer",
|
|
17005
|
+
POINT_LAYER: "pointLayer",
|
|
17006
|
+
SPATIAL_SPOT_RADIUS: "spatialSpotRadius",
|
|
17007
|
+
SPATIAL_SPOT_FILLED: "spatialSpotFilled",
|
|
17008
|
+
SPATIAL_SPOT_STROKE_WIDTH: "spatialSpotStrokeWidth",
|
|
17009
|
+
SPATIAL_LAYER_COLOR: "spatialLayerColor",
|
|
17010
|
+
PIXEL_HIGHLIGHT: "pixelHighlight",
|
|
17011
|
+
TOOLTIP_CROSSHAIRS_VISIBLE: "tooltipCrosshairsVisible",
|
|
17012
|
+
LEGEND_VISIBLE: "legendVisible",
|
|
17013
|
+
SPATIAL_CHANNEL_LABELS_VISIBLE: "spatialChannelLabelsVisible",
|
|
17014
|
+
SPATIAL_CHANNEL_LABELS_ORIENTATION: "spatialChannelLabelsOrientation",
|
|
17015
|
+
SPATIAL_CHANNEL_LABEL_SIZE: "spatialChannelLabelSize"
|
|
16968
17016
|
};
|
|
16969
17017
|
const COMPONENT_COORDINATION_TYPES = {
|
|
16970
17018
|
[ViewType$1.SCATTERPLOT]: [
|
|
@@ -17068,6 +17116,77 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
17068
17116
|
CoordinationType$1.MOLECULE_HIGHLIGHT,
|
|
17069
17117
|
CoordinationType$1.TOOLTIPS_VISIBLE
|
|
17070
17118
|
],
|
|
17119
|
+
[ViewType$1.SPATIAL_BETA]: [
|
|
17120
|
+
CoordinationType$1.META_COORDINATION_SCOPES,
|
|
17121
|
+
CoordinationType$1.META_COORDINATION_SCOPES_BY,
|
|
17122
|
+
CoordinationType$1.DATASET,
|
|
17123
|
+
CoordinationType$1.OBS_TYPE,
|
|
17124
|
+
CoordinationType$1.OBS_LABELS_TYPE,
|
|
17125
|
+
CoordinationType$1.FEATURE_TYPE,
|
|
17126
|
+
CoordinationType$1.FEATURE_VALUE_TYPE,
|
|
17127
|
+
CoordinationType$1.SPATIAL_ZOOM,
|
|
17128
|
+
CoordinationType$1.SPATIAL_ROTATION,
|
|
17129
|
+
CoordinationType$1.SPATIAL_POINT_LAYER,
|
|
17130
|
+
CoordinationType$1.SPATIAL_NEIGHBORHOOD_LAYER,
|
|
17131
|
+
CoordinationType$1.SPATIAL_TARGET_X,
|
|
17132
|
+
CoordinationType$1.SPATIAL_TARGET_Y,
|
|
17133
|
+
CoordinationType$1.SPATIAL_TARGET_Z,
|
|
17134
|
+
CoordinationType$1.SPATIAL_TARGET_T,
|
|
17135
|
+
CoordinationType$1.SPATIAL_ROTATION_X,
|
|
17136
|
+
CoordinationType$1.SPATIAL_ROTATION_Y,
|
|
17137
|
+
CoordinationType$1.SPATIAL_ROTATION_Z,
|
|
17138
|
+
CoordinationType$1.SPATIAL_ROTATION_ORBIT,
|
|
17139
|
+
CoordinationType$1.SPATIAL_ORBIT_AXIS,
|
|
17140
|
+
CoordinationType$1.SPATIAL_AXIS_FIXED,
|
|
17141
|
+
CoordinationType$1.OBS_FILTER,
|
|
17142
|
+
CoordinationType$1.OBS_HIGHLIGHT,
|
|
17143
|
+
CoordinationType$1.OBS_SET_SELECTION,
|
|
17144
|
+
CoordinationType$1.OBS_SET_HIGHLIGHT,
|
|
17145
|
+
CoordinationType$1.OBS_SET_COLOR,
|
|
17146
|
+
CoordinationType$1.FEATURE_HIGHLIGHT,
|
|
17147
|
+
CoordinationType$1.FEATURE_SELECTION,
|
|
17148
|
+
CoordinationType$1.FEATURE_VALUE_COLORMAP,
|
|
17149
|
+
CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
|
|
17150
|
+
CoordinationType$1.OBS_COLOR_ENCODING,
|
|
17151
|
+
CoordinationType$1.ADDITIONAL_OBS_SETS,
|
|
17152
|
+
CoordinationType$1.MOLECULE_HIGHLIGHT,
|
|
17153
|
+
CoordinationType$1.TOOLTIPS_VISIBLE,
|
|
17154
|
+
CoordinationType$1.FILE_UID,
|
|
17155
|
+
CoordinationType$1.SPATIAL_TARGET_C,
|
|
17156
|
+
CoordinationType$1.SPATIAL_LAYER_VISIBLE,
|
|
17157
|
+
CoordinationType$1.SPATIAL_LAYER_OPACITY,
|
|
17158
|
+
CoordinationType$1.SPATIAL_LAYER_COLORMAP,
|
|
17159
|
+
CoordinationType$1.SPATIAL_LAYER_TRANSPARENT_COLOR,
|
|
17160
|
+
CoordinationType$1.SPATIAL_LAYER_MODEL_MATRIX,
|
|
17161
|
+
CoordinationType$1.SPATIAL_CHANNEL_COLOR,
|
|
17162
|
+
CoordinationType$1.SPATIAL_SEGMENTATION_FILLED,
|
|
17163
|
+
CoordinationType$1.SPATIAL_SEGMENTATION_STROKE_WIDTH,
|
|
17164
|
+
CoordinationType$1.IMAGE_LAYER,
|
|
17165
|
+
CoordinationType$1.SEGMENTATION_LAYER,
|
|
17166
|
+
CoordinationType$1.IMAGE_CHANNEL,
|
|
17167
|
+
CoordinationType$1.SEGMENTATION_CHANNEL,
|
|
17168
|
+
CoordinationType$1.SPATIAL_CHANNEL_VISIBLE,
|
|
17169
|
+
CoordinationType$1.SPATIAL_CHANNEL_OPACITY,
|
|
17170
|
+
CoordinationType$1.SPATIAL_CHANNEL_WINDOW,
|
|
17171
|
+
CoordinationType$1.SPATIAL_RENDERING_MODE,
|
|
17172
|
+
CoordinationType$1.VOLUMETRIC_RENDERING_ALGORITHM,
|
|
17173
|
+
CoordinationType$1.SPATIAL_TARGET_RESOLUTION,
|
|
17174
|
+
CoordinationType$1.SPATIAL_SLICE_X,
|
|
17175
|
+
CoordinationType$1.SPATIAL_SLICE_Y,
|
|
17176
|
+
CoordinationType$1.SPATIAL_SLICE_Z,
|
|
17177
|
+
CoordinationType$1.SPOT_LAYER,
|
|
17178
|
+
CoordinationType$1.POINT_LAYER,
|
|
17179
|
+
CoordinationType$1.SPATIAL_SPOT_RADIUS,
|
|
17180
|
+
CoordinationType$1.SPATIAL_SPOT_FILLED,
|
|
17181
|
+
CoordinationType$1.SPATIAL_SPOT_STROKE_WIDTH,
|
|
17182
|
+
CoordinationType$1.SPATIAL_LAYER_COLOR,
|
|
17183
|
+
CoordinationType$1.PIXEL_HIGHLIGHT,
|
|
17184
|
+
CoordinationType$1.TOOLTIP_CROSSHAIRS_VISIBLE,
|
|
17185
|
+
CoordinationType$1.LEGEND_VISIBLE,
|
|
17186
|
+
CoordinationType$1.SPATIAL_CHANNEL_LABELS_VISIBLE,
|
|
17187
|
+
CoordinationType$1.SPATIAL_CHANNEL_LABELS_ORIENTATION,
|
|
17188
|
+
CoordinationType$1.SPATIAL_CHANNEL_LABEL_SIZE
|
|
17189
|
+
],
|
|
17071
17190
|
[ViewType$1.HEATMAP]: [
|
|
17072
17191
|
CoordinationType$1.DATASET,
|
|
17073
17192
|
CoordinationType$1.OBS_TYPE,
|
|
@@ -17173,6 +17292,61 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
17173
17292
|
CoordinationType$1.SPATIAL_ROTATION_ORBIT,
|
|
17174
17293
|
CoordinationType$1.SPATIAL_ORBIT_AXIS
|
|
17175
17294
|
],
|
|
17295
|
+
[ViewType$1.LAYER_CONTROLLER_BETA]: [
|
|
17296
|
+
CoordinationType$1.META_COORDINATION_SCOPES,
|
|
17297
|
+
CoordinationType$1.META_COORDINATION_SCOPES_BY,
|
|
17298
|
+
CoordinationType$1.DATASET,
|
|
17299
|
+
CoordinationType$1.OBS_TYPE,
|
|
17300
|
+
CoordinationType$1.FEATURE_TYPE,
|
|
17301
|
+
CoordinationType$1.FEATURE_VALUE_TYPE,
|
|
17302
|
+
CoordinationType$1.SPATIAL_POINT_LAYER,
|
|
17303
|
+
CoordinationType$1.SPATIAL_NEIGHBORHOOD_LAYER,
|
|
17304
|
+
CoordinationType$1.SPATIAL_ZOOM,
|
|
17305
|
+
CoordinationType$1.SPATIAL_TARGET_X,
|
|
17306
|
+
CoordinationType$1.SPATIAL_TARGET_Y,
|
|
17307
|
+
CoordinationType$1.SPATIAL_TARGET_Z,
|
|
17308
|
+
CoordinationType$1.SPATIAL_TARGET_T,
|
|
17309
|
+
CoordinationType$1.SPATIAL_ROTATION_X,
|
|
17310
|
+
CoordinationType$1.SPATIAL_ROTATION_Y,
|
|
17311
|
+
CoordinationType$1.SPATIAL_ROTATION_Z,
|
|
17312
|
+
CoordinationType$1.SPATIAL_ROTATION_ORBIT,
|
|
17313
|
+
CoordinationType$1.SPATIAL_ORBIT_AXIS,
|
|
17314
|
+
CoordinationType$1.FILE_UID,
|
|
17315
|
+
CoordinationType$1.SPATIAL_TARGET_C,
|
|
17316
|
+
CoordinationType$1.SPATIAL_LAYER_VISIBLE,
|
|
17317
|
+
CoordinationType$1.SPATIAL_LAYER_OPACITY,
|
|
17318
|
+
CoordinationType$1.SPATIAL_LAYER_COLORMAP,
|
|
17319
|
+
CoordinationType$1.SPATIAL_LAYER_TRANSPARENT_COLOR,
|
|
17320
|
+
CoordinationType$1.SPATIAL_LAYER_MODEL_MATRIX,
|
|
17321
|
+
CoordinationType$1.SPATIAL_CHANNEL_COLOR,
|
|
17322
|
+
CoordinationType$1.SPATIAL_SEGMENTATION_FILLED,
|
|
17323
|
+
CoordinationType$1.SPATIAL_SEGMENTATION_STROKE_WIDTH,
|
|
17324
|
+
CoordinationType$1.IMAGE_CHANNEL,
|
|
17325
|
+
CoordinationType$1.SEGMENTATION_CHANNEL,
|
|
17326
|
+
CoordinationType$1.SPATIAL_CHANNEL_VISIBLE,
|
|
17327
|
+
CoordinationType$1.SPATIAL_CHANNEL_OPACITY,
|
|
17328
|
+
CoordinationType$1.SPATIAL_CHANNEL_WINDOW,
|
|
17329
|
+
CoordinationType$1.PHOTOMETRIC_INTERPRETATION,
|
|
17330
|
+
CoordinationType$1.SPATIAL_RENDERING_MODE,
|
|
17331
|
+
CoordinationType$1.VOLUMETRIC_RENDERING_ALGORITHM,
|
|
17332
|
+
CoordinationType$1.SPATIAL_TARGET_RESOLUTION,
|
|
17333
|
+
CoordinationType$1.SPATIAL_SLICE_X,
|
|
17334
|
+
CoordinationType$1.SPATIAL_SLICE_Y,
|
|
17335
|
+
CoordinationType$1.SPATIAL_SLICE_Z,
|
|
17336
|
+
CoordinationType$1.SPOT_LAYER,
|
|
17337
|
+
CoordinationType$1.POINT_LAYER,
|
|
17338
|
+
CoordinationType$1.SPATIAL_SPOT_RADIUS,
|
|
17339
|
+
CoordinationType$1.SPATIAL_SPOT_FILLED,
|
|
17340
|
+
CoordinationType$1.SPATIAL_SPOT_STROKE_WIDTH,
|
|
17341
|
+
CoordinationType$1.SPATIAL_LAYER_COLOR,
|
|
17342
|
+
CoordinationType$1.OBS_COLOR_ENCODING,
|
|
17343
|
+
CoordinationType$1.TOOLTIPS_VISIBLE,
|
|
17344
|
+
CoordinationType$1.TOOLTIP_CROSSHAIRS_VISIBLE,
|
|
17345
|
+
CoordinationType$1.LEGEND_VISIBLE,
|
|
17346
|
+
CoordinationType$1.SPATIAL_CHANNEL_LABELS_VISIBLE,
|
|
17347
|
+
CoordinationType$1.SPATIAL_CHANNEL_LABELS_ORIENTATION,
|
|
17348
|
+
CoordinationType$1.SPATIAL_CHANNEL_LABEL_SIZE
|
|
17349
|
+
],
|
|
17176
17350
|
[ViewType$1.GENOMIC_PROFILES]: [
|
|
17177
17351
|
CoordinationType$1.DATASET,
|
|
17178
17352
|
CoordinationType$1.OBS_TYPE,
|
|
@@ -17628,27 +17802,6 @@ function formatBytes(bytes, decimals = 2) {
|
|
|
17628
17802
|
const i2 = Math.floor(Math.log(bytes) / Math.log(k));
|
|
17629
17803
|
return `${parseFloat((bytes / Math.pow(k, i2)).toFixed(dm))} ${sizes[i2]}`;
|
|
17630
17804
|
}
|
|
17631
|
-
const getStatsForResolution = (loader, resolution) => {
|
|
17632
|
-
const { shape: shape2, labels } = loader[resolution];
|
|
17633
|
-
const height = shape2[labels.indexOf("y")];
|
|
17634
|
-
const width = shape2[labels.indexOf("x")];
|
|
17635
|
-
const depth = shape2[labels.indexOf("z")];
|
|
17636
|
-
const depthDownsampled = Math.max(1, depth >> resolution);
|
|
17637
|
-
const totalBytes = 4 * height * width * depthDownsampled;
|
|
17638
|
-
return {
|
|
17639
|
-
height,
|
|
17640
|
-
width,
|
|
17641
|
-
depthDownsampled,
|
|
17642
|
-
totalBytes
|
|
17643
|
-
};
|
|
17644
|
-
};
|
|
17645
|
-
const canLoadResolution = (loader, resolution) => {
|
|
17646
|
-
var _a2, _b, _c;
|
|
17647
|
-
const { totalBytes, height, width, depthDownsampled } = getStatsForResolution(loader, resolution);
|
|
17648
|
-
const maxHeapSize = ((_a2 = window.performance) == null ? void 0 : _a2.memory) && ((_c = (_b = window.performance) == null ? void 0 : _b.memory) == null ? void 0 : _c.jsHeapSizeLimit) / 2;
|
|
17649
|
-
const maxSize = maxHeapSize || 2 ** 31 - 1;
|
|
17650
|
-
return totalBytes < maxSize && height <= 2048 && depthDownsampled <= 2048 && width <= 2048 && depthDownsampled > 1;
|
|
17651
|
-
};
|
|
17652
17805
|
let getRandomValues$1;
|
|
17653
17806
|
const rnds8$1 = new Uint8Array(16);
|
|
17654
17807
|
function rng$1() {
|
|
@@ -27347,6 +27500,8 @@ const annDataObsSets = z.array(z.object({
|
|
|
27347
27500
|
]),
|
|
27348
27501
|
scorePath: z.string().optional().describe("The location in the AnnData store for the set confidence scores, like 'obs/celltype_prediction_score.'")
|
|
27349
27502
|
}));
|
|
27503
|
+
const annDataObsSpots = annDataObsm;
|
|
27504
|
+
const annDataObsPoints = annDataObsm;
|
|
27350
27505
|
const annDataObsLocations = annDataObsm;
|
|
27351
27506
|
const annDataObsEmbedding = annDataObsm;
|
|
27352
27507
|
const annDataObsSegmentations = annDataObs;
|
|
@@ -27373,10 +27528,21 @@ z.object({
|
|
|
27373
27528
|
z.object({
|
|
27374
27529
|
obsIndex: z.string(),
|
|
27375
27530
|
obsEmbedding: z.array(z.string()).length(2)
|
|
27531
|
+
// TODO: support 3D?
|
|
27532
|
+
});
|
|
27533
|
+
z.object({
|
|
27534
|
+
obsIndex: z.string(),
|
|
27535
|
+
obsSpots: z.array(z.string()).length(2)
|
|
27536
|
+
// TODO: support 3D?
|
|
27537
|
+
});
|
|
27538
|
+
z.object({
|
|
27539
|
+
obsIndex: z.string(),
|
|
27540
|
+
obsPoints: z.array(z.string()).length(3)
|
|
27376
27541
|
});
|
|
27377
27542
|
z.object({
|
|
27378
27543
|
obsIndex: z.string(),
|
|
27379
27544
|
obsLocations: z.array(z.string()).length(2)
|
|
27545
|
+
// TODO: support 3D?
|
|
27380
27546
|
});
|
|
27381
27547
|
z.object({
|
|
27382
27548
|
obsIndex: z.string(),
|
|
@@ -27408,6 +27574,8 @@ z.object({
|
|
|
27408
27574
|
]),
|
|
27409
27575
|
obsFeatureMatrix: annDataObsFeatureMatrix,
|
|
27410
27576
|
obsSets: annDataObsSets,
|
|
27577
|
+
obsSpots: annDataObsSpots,
|
|
27578
|
+
obsPoints: annDataObsPoints,
|
|
27411
27579
|
obsLocations: annDataObsLocations,
|
|
27412
27580
|
obsSegmentations: annDataObsSegmentations,
|
|
27413
27581
|
obsEmbedding: z.union([
|
|
@@ -34709,7 +34877,7 @@ function negate(out, a2) {
|
|
|
34709
34877
|
out[2] = -a2[2];
|
|
34710
34878
|
return out;
|
|
34711
34879
|
}
|
|
34712
|
-
function normalize$
|
|
34880
|
+
function normalize$4(out, a2) {
|
|
34713
34881
|
var x2 = a2[0];
|
|
34714
34882
|
var y2 = a2[1];
|
|
34715
34883
|
var z2 = a2[2];
|
|
@@ -36018,7 +36186,7 @@ function squaredLength$1(a2) {
|
|
|
36018
36186
|
var w2 = a2[3];
|
|
36019
36187
|
return x2 * x2 + y2 * y2 + z2 * z2 + w2 * w2;
|
|
36020
36188
|
}
|
|
36021
|
-
function normalize$
|
|
36189
|
+
function normalize$3(out, a2) {
|
|
36022
36190
|
var x2 = a2[0];
|
|
36023
36191
|
var y2 = a2[1];
|
|
36024
36192
|
var z2 = a2[2];
|
|
@@ -36655,7 +36823,7 @@ var dot$1 = dot$2;
|
|
|
36655
36823
|
var lerp$1 = lerp$2;
|
|
36656
36824
|
var length$2 = length$3;
|
|
36657
36825
|
var squaredLength = squaredLength$1;
|
|
36658
|
-
var normalize$
|
|
36826
|
+
var normalize$2 = normalize$3;
|
|
36659
36827
|
var rotationTo = function() {
|
|
36660
36828
|
var tmpvec3 = create$3();
|
|
36661
36829
|
var xUnitVec3 = fromValues(1, 0, 0);
|
|
@@ -36666,7 +36834,7 @@ var rotationTo = function() {
|
|
|
36666
36834
|
cross(tmpvec3, xUnitVec3, a2);
|
|
36667
36835
|
if (len(tmpvec3) < 1e-6)
|
|
36668
36836
|
cross(tmpvec3, yUnitVec3, a2);
|
|
36669
|
-
normalize$
|
|
36837
|
+
normalize$4(tmpvec3, tmpvec3);
|
|
36670
36838
|
setAxisAngle(out, tmpvec3, Math.PI);
|
|
36671
36839
|
return out;
|
|
36672
36840
|
} else if (dot2 > 0.999999) {
|
|
@@ -36681,7 +36849,7 @@ var rotationTo = function() {
|
|
|
36681
36849
|
out[1] = tmpvec3[1];
|
|
36682
36850
|
out[2] = tmpvec3[2];
|
|
36683
36851
|
out[3] = 1 + dot2;
|
|
36684
|
-
return normalize$
|
|
36852
|
+
return normalize$2(out, out);
|
|
36685
36853
|
}
|
|
36686
36854
|
};
|
|
36687
36855
|
}();
|
|
@@ -36707,7 +36875,7 @@ var rotationTo = function() {
|
|
|
36707
36875
|
matr[2] = -view[0];
|
|
36708
36876
|
matr[5] = -view[1];
|
|
36709
36877
|
matr[8] = -view[2];
|
|
36710
|
-
return normalize$
|
|
36878
|
+
return normalize$2(out, fromMat3(out, matr));
|
|
36711
36879
|
};
|
|
36712
36880
|
})();
|
|
36713
36881
|
const IDENTITY_QUATERNION = [0, 0, 0, 1];
|
|
@@ -38950,17 +39118,17 @@ let COLOR;
|
|
|
38950
39118
|
COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
38951
39119
|
COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
38952
39120
|
})(COLOR || (COLOR = {}));
|
|
38953
|
-
function getColor(color) {
|
|
39121
|
+
function getColor$1(color) {
|
|
38954
39122
|
return typeof color === "string" ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;
|
|
38955
39123
|
}
|
|
38956
39124
|
function addColor(string, color, background) {
|
|
38957
39125
|
if (!isBrowser$1 && typeof string === "string") {
|
|
38958
39126
|
if (color) {
|
|
38959
|
-
color = getColor(color);
|
|
39127
|
+
color = getColor$1(color);
|
|
38960
39128
|
string = "\x1B[".concat(color, "m").concat(string, "\x1B[39m");
|
|
38961
39129
|
}
|
|
38962
39130
|
if (background) {
|
|
38963
|
-
color = getColor(background);
|
|
39131
|
+
color = getColor$1(background);
|
|
38964
39132
|
string = "\x1B[".concat(background + 10, "m").concat(string, "\x1B[49m");
|
|
38965
39133
|
}
|
|
38966
39134
|
}
|
|
@@ -69070,7 +69238,7 @@ function copyFlatRing(target, targetStartIndex, positions, size, srcStartIndex =
|
|
|
69070
69238
|
modifyPolygonWindingDirection(target, windingDirection, windingOptions);
|
|
69071
69239
|
return targetIndex;
|
|
69072
69240
|
}
|
|
69073
|
-
function normalize(polygon2, positionSize) {
|
|
69241
|
+
function normalize$1(polygon2, positionSize) {
|
|
69074
69242
|
validate(polygon2);
|
|
69075
69243
|
const positions = [];
|
|
69076
69244
|
const holeIndices = [];
|
|
@@ -69176,7 +69344,7 @@ class PolygonTesselator extends Tesselator {
|
|
|
69176
69344
|
}
|
|
69177
69345
|
normalizeGeometry(polygon2) {
|
|
69178
69346
|
if (this.normalize) {
|
|
69179
|
-
const normalizedPolygon = normalize(polygon2, this.positionSize);
|
|
69347
|
+
const normalizedPolygon = normalize$1(polygon2, this.positionSize);
|
|
69180
69348
|
if (this.opts.resolution) {
|
|
69181
69349
|
return cutPolygonByGrid(getPositions(normalizedPolygon), getHoleIndices(normalizedPolygon), {
|
|
69182
69350
|
size: this.positionSize,
|
|
@@ -69798,7 +69966,7 @@ class PolygonLayer extends CompositeLayer {
|
|
|
69798
69966
|
objectInfo.index++;
|
|
69799
69967
|
let polygon2 = getPolygon(object2, objectInfo);
|
|
69800
69968
|
if (_normalize) {
|
|
69801
|
-
polygon2 = normalize(polygon2, positionSize);
|
|
69969
|
+
polygon2 = normalize$1(polygon2, positionSize);
|
|
69802
69970
|
}
|
|
69803
69971
|
const {
|
|
69804
69972
|
holeIndices
|
|
@@ -113625,7 +113793,7 @@ function clipExtent(x02, y02, x12, y12) {
|
|
|
113625
113793
|
return clipStream;
|
|
113626
113794
|
};
|
|
113627
113795
|
}
|
|
113628
|
-
function extent() {
|
|
113796
|
+
function extent$1() {
|
|
113629
113797
|
var x02 = 0, y02 = 0, x12 = 960, y12 = 500, cache2, cacheStream, clip2;
|
|
113630
113798
|
return clip2 = {
|
|
113631
113799
|
stream: function(stream) {
|
|
@@ -115032,7 +115200,7 @@ const d3Geo$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
115032
115200
|
geoBounds: bounds,
|
|
115033
115201
|
geoCentroid: centroid$3,
|
|
115034
115202
|
geoCircle: circle$2,
|
|
115035
|
-
geoClipExtent: extent,
|
|
115203
|
+
geoClipExtent: extent$1,
|
|
115036
115204
|
geoConicConformal: conicConformal,
|
|
115037
115205
|
geoConicConformalRaw: conicConformalRaw,
|
|
115038
115206
|
geoConicEqualArea: conicEqualArea,
|
|
@@ -134235,28 +134403,38 @@ const PASS_THROUGH_PROPS = [
|
|
|
134235
134403
|
];
|
|
134236
134404
|
class SelectionLayer extends CompositeLayer {
|
|
134237
134405
|
_selectPolygonObjects(coordinates2) {
|
|
134238
|
-
const {
|
|
134406
|
+
const { flipY, obsLayers } = this.props;
|
|
134239
134407
|
const flippedCoordinates = flipY ? coordinates2.map((poly) => poly.map((p) => [p[0], -p[1]])) : coordinates2;
|
|
134240
134408
|
const selectedPolygon = polygon(flippedCoordinates);
|
|
134241
|
-
|
|
134242
|
-
|
|
134243
|
-
const
|
|
134244
|
-
|
|
134245
|
-
|
|
134246
|
-
|
|
134247
|
-
|
|
134248
|
-
|
|
134249
|
-
|
|
134250
|
-
|
|
134251
|
-
|
|
134252
|
-
|
|
134253
|
-
|
|
134254
|
-
|
|
134409
|
+
obsLayers.forEach((obsLayer) => {
|
|
134410
|
+
const { getObsCoords, obsQuadTree, obsIndex, onSelect: layerOnSelect } = obsLayer;
|
|
134411
|
+
const pickingInfos = [];
|
|
134412
|
+
obsQuadTree == null ? void 0 : obsQuadTree.visit((node2, x02, y02, x12, y12) => {
|
|
134413
|
+
const nodePoints = [[[x02, y02], [x12, y02], [x12, y12], [x02, y12], [x02, y02]]];
|
|
134414
|
+
const nodePolygon = polygon(nodePoints);
|
|
134415
|
+
const nodePolygonContainsSelectedPolygon = booleanContains(nodePolygon, selectedPolygon);
|
|
134416
|
+
const nodePolygonWithinSelectedPolygon = booleanWithin(nodePolygon, selectedPolygon);
|
|
134417
|
+
const nodePolygonOverlapsSelectedPolgyon = booleanOverlap(nodePolygon, selectedPolygon);
|
|
134418
|
+
if (!nodePolygonContainsSelectedPolygon && !nodePolygonWithinSelectedPolygon && !nodePolygonOverlapsSelectedPolgyon) {
|
|
134419
|
+
return true;
|
|
134420
|
+
}
|
|
134421
|
+
if (node2.data && booleanPointInPolygon$1(point([].slice.call(getObsCoords(node2.data))), selectedPolygon)) {
|
|
134422
|
+
pickingInfos.push(node2.data);
|
|
134423
|
+
}
|
|
134424
|
+
return false;
|
|
134425
|
+
});
|
|
134426
|
+
const pickingIds = pickingInfos.map((obsI) => obsIndex[obsI]);
|
|
134427
|
+
layerOnSelect(pickingIds);
|
|
134428
|
+
});
|
|
134429
|
+
}
|
|
134430
|
+
_selectEmpty() {
|
|
134431
|
+
const { obsLayers } = this.props;
|
|
134432
|
+
obsLayers.forEach((obsLayer) => {
|
|
134433
|
+
const { onSelect: layerOnSelect } = obsLayer;
|
|
134434
|
+
layerOnSelect([]);
|
|
134255
134435
|
});
|
|
134256
|
-
onSelect({ pickingInfos });
|
|
134257
134436
|
}
|
|
134258
134437
|
renderLayers() {
|
|
134259
|
-
const { onSelect } = this.props;
|
|
134260
134438
|
const mode = MODE_MAP[this.props.selectionType] || distEs6.ViewMode;
|
|
134261
134439
|
const inheritedProps = {};
|
|
134262
134440
|
PASS_THROUGH_PROPS.forEach((p) => {
|
|
@@ -134278,7 +134456,7 @@ class SelectionLayer extends CompositeLayer {
|
|
|
134278
134456
|
const { coordinates: coordinates2 } = updatedData.features[0].geometry;
|
|
134279
134457
|
this._selectPolygonObjects(coordinates2);
|
|
134280
134458
|
} else if (editType === EDIT_TYPE_CLEAR) {
|
|
134281
|
-
|
|
134459
|
+
this._selectEmpty();
|
|
134282
134460
|
}
|
|
134283
134461
|
},
|
|
134284
134462
|
_subLayerProps: {
|
|
@@ -135418,16 +135596,16 @@ function addDecoder(cases, importFn) {
|
|
|
135418
135596
|
}
|
|
135419
135597
|
cases.forEach((c) => registry$1.set(c, importFn));
|
|
135420
135598
|
}
|
|
135421
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
135422
|
-
addDecoder(5, () => import("./lzw-
|
|
135599
|
+
addDecoder([void 0, 1], () => import("./raw-0ae87697.js").then((m) => m.default));
|
|
135600
|
+
addDecoder(5, () => import("./lzw-f5a9e721.js").then((m) => m.default));
|
|
135423
135601
|
addDecoder(6, () => {
|
|
135424
135602
|
throw new Error("old style JPEG compression is not supported.");
|
|
135425
135603
|
});
|
|
135426
|
-
addDecoder(7, () => import("./jpeg-
|
|
135427
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
135428
|
-
addDecoder(32773, () => import("./packbits-
|
|
135429
|
-
addDecoder(34887, () => import("./lerc-
|
|
135430
|
-
addDecoder(50001, () => import("./webimage-
|
|
135604
|
+
addDecoder(7, () => import("./jpeg-29889288.js").then((m) => m.default));
|
|
135605
|
+
addDecoder([8, 32946], () => import("./deflate-4152c8e9.js").then((m) => m.default));
|
|
135606
|
+
addDecoder(32773, () => import("./packbits-5fc9c646.js").then((m) => m.default));
|
|
135607
|
+
addDecoder(34887, () => import("./lerc-899a010f.js").then((m) => m.default));
|
|
135608
|
+
addDecoder(50001, () => import("./webimage-1731afb4.js").then((m) => m.default));
|
|
135431
135609
|
function decodeRowAcc(row, stride) {
|
|
135432
135610
|
let length2 = row.length - stride;
|
|
135433
135611
|
let offset4 = 0;
|
|
@@ -142322,7 +142500,7 @@ const SIGNAL_ABORTED = "__vivSignalAborted";
|
|
|
142322
142500
|
addDecoder(5, () => LZWDecoder);
|
|
142323
142501
|
const MAX_COLOR_INTENSITY = 255;
|
|
142324
142502
|
const DEFAULT_COLOR_OFF = [0, 0, 0];
|
|
142325
|
-
const MAX_CHANNELS = 6;
|
|
142503
|
+
const MAX_CHANNELS$1 = 6;
|
|
142326
142504
|
const DEFAULT_FONT_FAMILY = "-apple-system, 'Helvetica Neue', Arial, sans-serif";
|
|
142327
142505
|
const DTYPE_VALUES = {
|
|
142328
142506
|
Uint8: {
|
|
@@ -143844,7 +144022,7 @@ const AdditiveColormapExtension = class extends LayerExtension {
|
|
|
143844
144022
|
};
|
|
143845
144023
|
AdditiveColormapExtension.extensionName = "AdditiveColormapExtension";
|
|
143846
144024
|
AdditiveColormapExtension.defaultProps = defaultProps$4$1;
|
|
143847
|
-
const fs$1$
|
|
144025
|
+
const fs$1$2 = `uniform vec3 transparentColor;
|
|
143848
144026
|
uniform bool useTransparentColor;
|
|
143849
144027
|
uniform float opacity;
|
|
143850
144028
|
|
|
@@ -143871,12 +144049,12 @@ rgba = apply_opacity(rgb);
|
|
|
143871
144049
|
`;
|
|
143872
144050
|
const colorPalette = {
|
|
143873
144051
|
name: "color-palette-module",
|
|
143874
|
-
fs: fs$1$
|
|
144052
|
+
fs: fs$1$2,
|
|
143875
144053
|
inject: {
|
|
143876
144054
|
"fs:DECKGL_MUTATE_COLOR": DECKGL_MUTATE_COLOR
|
|
143877
144055
|
}
|
|
143878
144056
|
};
|
|
143879
|
-
function padWithDefault$
|
|
144057
|
+
function padWithDefault$3(arr, defaultValue2, padWidth) {
|
|
143880
144058
|
for (let i2 = 0; i2 < padWidth; i2 += 1) {
|
|
143881
144059
|
arr.push(defaultValue2);
|
|
143882
144060
|
}
|
|
@@ -143902,8 +144080,8 @@ function padColors({ colors, channelsVisible }) {
|
|
|
143902
144080
|
const newColors = colors.map(
|
|
143903
144081
|
(color, i2) => channelsVisible[i2] ? color.map((c) => c / MAX_COLOR_INTENSITY) : DEFAULT_COLOR_OFF
|
|
143904
144082
|
);
|
|
143905
|
-
const padSize = MAX_CHANNELS - newColors.length;
|
|
143906
|
-
const paddedColors = padWithDefault$
|
|
144083
|
+
const padSize = MAX_CHANNELS$1 - newColors.length;
|
|
144084
|
+
const paddedColors = padWithDefault$3(
|
|
143907
144085
|
newColors,
|
|
143908
144086
|
DEFAULT_COLOR_OFF,
|
|
143909
144087
|
padSize
|
|
@@ -144147,7 +144325,7 @@ vec4 colormap(float intensity, float opacity) {
|
|
|
144147
144325
|
fs: fs2
|
|
144148
144326
|
};
|
|
144149
144327
|
}
|
|
144150
|
-
const defaultProps$1$
|
|
144328
|
+
const defaultProps$1$2 = {
|
|
144151
144329
|
colormap: { type: "string", value: "viridis", compare: true }
|
|
144152
144330
|
};
|
|
144153
144331
|
const BaseExtension$1 = class extends LayerExtension {
|
|
@@ -144157,7 +144335,7 @@ const BaseExtension$1 = class extends LayerExtension {
|
|
|
144157
144335
|
}
|
|
144158
144336
|
getShaders() {
|
|
144159
144337
|
var _a2;
|
|
144160
|
-
const name2 = ((_a2 = this == null ? void 0 : this.props) == null ? void 0 : _a2.colormap) || defaultProps$1$
|
|
144338
|
+
const name2 = ((_a2 = this == null ? void 0 : this.props) == null ? void 0 : _a2.colormap) || defaultProps$1$2.colormap.value;
|
|
144161
144339
|
const apply_cmap = cmaps[name2];
|
|
144162
144340
|
return {
|
|
144163
144341
|
...super.getShaders(),
|
|
@@ -144176,7 +144354,7 @@ const BaseExtension$1 = class extends LayerExtension {
|
|
|
144176
144354
|
}
|
|
144177
144355
|
};
|
|
144178
144356
|
BaseExtension$1.extensionName = "BaseExtension";
|
|
144179
|
-
BaseExtension$1.defaultProps = defaultProps$1$
|
|
144357
|
+
BaseExtension$1.defaultProps = defaultProps$1$2;
|
|
144180
144358
|
const _BEFORE_RENDER$5 = "";
|
|
144181
144359
|
const _RENDER$5 = ` float intensityArray[6] = float[6](intensityValue0, intensityValue1, intensityValue2, intensityValue3, intensityValue4, intensityValue5);
|
|
144182
144360
|
float total = 0.0;
|
|
@@ -144375,7 +144553,7 @@ const channels = {
|
|
|
144375
144553
|
function range(len2) {
|
|
144376
144554
|
return [...Array(len2).keys()];
|
|
144377
144555
|
}
|
|
144378
|
-
function padWithDefault$
|
|
144556
|
+
function padWithDefault$2(arr, defaultValue2, padWidth) {
|
|
144379
144557
|
for (let i2 = 0; i2 < padWidth; i2 += 1) {
|
|
144380
144558
|
arr.push(defaultValue2);
|
|
144381
144559
|
}
|
|
@@ -144399,13 +144577,13 @@ function padContrastLimits({
|
|
|
144399
144577
|
const newContrastLimits = contrastLimits.map(
|
|
144400
144578
|
(slider, i2) => channelsVisible[i2] ? slider : [maxSliderValue, maxSliderValue]
|
|
144401
144579
|
);
|
|
144402
|
-
const padSize = MAX_CHANNELS - newContrastLimits.length;
|
|
144580
|
+
const padSize = MAX_CHANNELS$1 - newContrastLimits.length;
|
|
144403
144581
|
if (padSize < 0) {
|
|
144404
144582
|
throw Error(
|
|
144405
144583
|
`${newContrastLimits.lengths} channels passed in, but only 6 are allowed.`
|
|
144406
144584
|
);
|
|
144407
144585
|
}
|
|
144408
|
-
const paddedContrastLimits = padWithDefault$
|
|
144586
|
+
const paddedContrastLimits = padWithDefault$2(
|
|
144409
144587
|
newContrastLimits,
|
|
144410
144588
|
[maxSliderValue, maxSliderValue],
|
|
144411
144589
|
padSize
|
|
@@ -144435,7 +144613,7 @@ function makeBoundingBox(viewState) {
|
|
|
144435
144613
|
viewport.unproject([0, viewport.height])
|
|
144436
144614
|
];
|
|
144437
144615
|
}
|
|
144438
|
-
const fs$1 = `#define SHADER_NAME xr-layer-fragment-shader
|
|
144616
|
+
const fs$1$1 = `#define SHADER_NAME xr-layer-fragment-shader
|
|
144439
144617
|
|
|
144440
144618
|
precision highp float;
|
|
144441
144619
|
precision highp int;
|
|
@@ -144476,7 +144654,7 @@ void main() {
|
|
|
144476
144654
|
DECKGL_FILTER_COLOR(gl_FragColor, geometry);
|
|
144477
144655
|
}
|
|
144478
144656
|
`;
|
|
144479
|
-
const vs$1 = `#define SHADER_NAME xr-layer-vertex-shader
|
|
144657
|
+
const vs$1$1 = `#define SHADER_NAME xr-layer-vertex-shader
|
|
144480
144658
|
|
|
144481
144659
|
attribute vec2 texCoords;
|
|
144482
144660
|
attribute vec3 positions;
|
|
@@ -144495,7 +144673,7 @@ void main(void) {
|
|
|
144495
144673
|
DECKGL_FILTER_COLOR(color, geometry);
|
|
144496
144674
|
}
|
|
144497
144675
|
`;
|
|
144498
|
-
const coreShaderModule = { fs: fs$1, vs: vs$1 };
|
|
144676
|
+
const coreShaderModule = { fs: fs$1$1, vs: vs$1$1 };
|
|
144499
144677
|
function validateWebGL2Filter(gl, interpolation) {
|
|
144500
144678
|
const canShowFloat = hasFeature(gl, FEATURES$1.TEXTURE_FLOAT);
|
|
144501
144679
|
const canShowLinear = hasFeature(gl, FEATURES$1.TEXTURE_FILTER_LINEAR_FLOAT);
|
|
@@ -145586,7 +145764,7 @@ const CUBE_STRIP = [
|
|
|
145586
145764
|
0
|
|
145587
145765
|
];
|
|
145588
145766
|
const NUM_PLANES_DEFAULT = 1;
|
|
145589
|
-
const defaultProps$1 = {
|
|
145767
|
+
const defaultProps$1$1 = {
|
|
145590
145768
|
pickable: false,
|
|
145591
145769
|
coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,
|
|
145592
145770
|
channelData: { type: "object", value: {}, compare: true },
|
|
@@ -145728,7 +145906,7 @@ const XR3DLayer = class extends Layer {
|
|
|
145728
145906
|
});
|
|
145729
145907
|
const invertedScaleMatrix = scaleMatrix.clone().invert();
|
|
145730
145908
|
const invertedResolutionMatrix = resolutionMatrix.clone().invert();
|
|
145731
|
-
const paddedClippingPlanes = padWithDefault$
|
|
145909
|
+
const paddedClippingPlanes = padWithDefault$2(
|
|
145732
145910
|
clippingPlanes.map(
|
|
145733
145911
|
(p) => p.clone().transform(invertedScaleMatrix).transform(invertedResolutionMatrix)
|
|
145734
145912
|
),
|
|
@@ -145818,7 +145996,7 @@ const XR3DLayer = class extends Layer {
|
|
|
145818
145996
|
}
|
|
145819
145997
|
};
|
|
145820
145998
|
XR3DLayer.layerName = "XR3DLayer";
|
|
145821
|
-
XR3DLayer.defaultProps = defaultProps$1;
|
|
145999
|
+
XR3DLayer.defaultProps = defaultProps$1$1;
|
|
145822
146000
|
async function getVolume({
|
|
145823
146001
|
source,
|
|
145824
146002
|
selection,
|
|
@@ -146065,7 +146243,7 @@ function getDefaultInitialViewState(loader, viewSize, zoomBackOff = 0, use3d = f
|
|
|
146065
146243
|
};
|
|
146066
146244
|
return loaderInitialViewState;
|
|
146067
146245
|
}
|
|
146068
|
-
const vs = `
|
|
146246
|
+
const vs$1 = `
|
|
146069
146247
|
#define SHADER_NAME bitmask-layer-vertex-shader
|
|
146070
146248
|
|
|
146071
146249
|
attribute vec2 texCoords;
|
|
@@ -146086,7 +146264,7 @@ void main(void) {
|
|
|
146086
146264
|
DECKGL_FILTER_COLOR(color, geometry);
|
|
146087
146265
|
}
|
|
146088
146266
|
`;
|
|
146089
|
-
const fs = `
|
|
146267
|
+
const fs$1 = `
|
|
146090
146268
|
#define SHADER_NAME bitmask-layer-fragment-shader
|
|
146091
146269
|
precision highp float;
|
|
146092
146270
|
|
|
@@ -146154,14 +146332,14 @@ void main() {
|
|
|
146154
146332
|
DECKGL_FILTER_COLOR(gl_FragColor, geometry);
|
|
146155
146333
|
}
|
|
146156
146334
|
`;
|
|
146157
|
-
function padWithDefault(arr, defaultValue2, padWidth) {
|
|
146335
|
+
function padWithDefault$1(arr, defaultValue2, padWidth) {
|
|
146158
146336
|
const newArr = [...arr];
|
|
146159
146337
|
for (let i2 = 0; i2 < padWidth; i2 += 1) {
|
|
146160
146338
|
newArr.push(defaultValue2);
|
|
146161
146339
|
}
|
|
146162
146340
|
return newArr;
|
|
146163
146341
|
}
|
|
146164
|
-
const defaultProps = {
|
|
146342
|
+
const defaultProps$1 = {
|
|
146165
146343
|
hoveredCell: { type: "number", value: null, compare: true },
|
|
146166
146344
|
// We do not want to deep-compare cellColorData,
|
|
146167
146345
|
// as it is potentially a TypedArray with millions of elements.
|
|
@@ -146173,13 +146351,13 @@ const defaultProps = {
|
|
|
146173
146351
|
// Same as with cellColorData, we do not want to deep-compare expressionData.
|
|
146174
146352
|
expressionData: { type: "object", value: null, compare: 0 }
|
|
146175
146353
|
};
|
|
146176
|
-
class BitmaskLayer extends XRLayer {
|
|
146354
|
+
let BitmaskLayer$1 = class BitmaskLayer extends XRLayer {
|
|
146177
146355
|
// eslint-disable-next-line class-methods-use-this
|
|
146178
146356
|
getShaders() {
|
|
146179
146357
|
const { colormap } = this.props;
|
|
146180
146358
|
return {
|
|
146181
|
-
fs,
|
|
146182
|
-
vs,
|
|
146359
|
+
fs: fs$1,
|
|
146360
|
+
vs: vs$1,
|
|
146183
146361
|
modules: [project32, picking],
|
|
146184
146362
|
defines: {
|
|
146185
146363
|
[COLORMAP_SHADER_PLACEHOLDER]: GLSL_COLORMAPS.includes(colormap) ? colormap : GLSL_COLORMAP_DEFAULT
|
|
@@ -146239,7 +146417,7 @@ class BitmaskLayer extends XRLayer {
|
|
|
146239
146417
|
expressionTex,
|
|
146240
146418
|
colorTexHeight: colorTex.height,
|
|
146241
146419
|
colorTexWidth: colorTex.width,
|
|
146242
|
-
channelsVisible: padWithDefault(
|
|
146420
|
+
channelsVisible: padWithDefault$1(
|
|
146243
146421
|
channelsVisible,
|
|
146244
146422
|
false,
|
|
146245
146423
|
// There are six texture entries on the shaders
|
|
@@ -146276,28 +146454,632 @@ class BitmaskLayer extends XRLayer {
|
|
|
146276
146454
|
type: GL$1.FLOAT
|
|
146277
146455
|
});
|
|
146278
146456
|
}
|
|
146457
|
+
};
|
|
146458
|
+
BitmaskLayer$1.layerName = "BitmaskLayer";
|
|
146459
|
+
BitmaskLayer$1.defaultProps = defaultProps$1;
|
|
146460
|
+
const vs = `
|
|
146461
|
+
#define SHADER_NAME bitmask-layer-vertex-shader
|
|
146462
|
+
|
|
146463
|
+
attribute vec2 texCoords;
|
|
146464
|
+
attribute vec3 positions;
|
|
146465
|
+
attribute vec3 positions64Low;
|
|
146466
|
+
attribute vec3 instancePickingColors;
|
|
146467
|
+
|
|
146468
|
+
varying vec2 vTexCoord;
|
|
146469
|
+
|
|
146470
|
+
void main(void) {
|
|
146471
|
+
geometry.worldPosition = positions;
|
|
146472
|
+
geometry.uv = texCoords;
|
|
146473
|
+
geometry.pickingColor = instancePickingColors;
|
|
146474
|
+
gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);
|
|
146475
|
+
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
|
|
146476
|
+
vTexCoord = texCoords;
|
|
146477
|
+
vec4 color = vec4(0.0);
|
|
146478
|
+
DECKGL_FILTER_COLOR(color, geometry);
|
|
146479
|
+
}
|
|
146480
|
+
`;
|
|
146481
|
+
const fs = `
|
|
146482
|
+
#define SHADER_NAME bitmask-layer-fragment-shader
|
|
146483
|
+
precision highp float;
|
|
146484
|
+
|
|
146485
|
+
${colormaps}
|
|
146486
|
+
|
|
146487
|
+
// Note: can have a maximum of 16 textures in most browsers
|
|
146488
|
+
// Reference: https://webglreport.com/
|
|
146489
|
+
|
|
146490
|
+
// Data (mask) texture
|
|
146491
|
+
uniform sampler2D channel0;
|
|
146492
|
+
uniform sampler2D channel1;
|
|
146493
|
+
uniform sampler2D channel2;
|
|
146494
|
+
uniform sampler2D channel3;
|
|
146495
|
+
uniform sampler2D channel4;
|
|
146496
|
+
uniform sampler2D channel5;
|
|
146497
|
+
uniform sampler2D channel6;
|
|
146498
|
+
|
|
146499
|
+
// Color texture
|
|
146500
|
+
uniform float hovered;
|
|
146501
|
+
|
|
146502
|
+
// Channel-specific properties
|
|
146503
|
+
uniform bool channelsVisible[7];
|
|
146504
|
+
uniform float channelOpacities[7];
|
|
146505
|
+
uniform bool channelIsStaticColorMode[7]; // TODO: should this be a single float?
|
|
146506
|
+
uniform bool channelIsSetColorMode[7]; // TODO: should this be a single float?
|
|
146507
|
+
|
|
146508
|
+
// TODO: can array of tuples/vec2 be used?
|
|
146509
|
+
uniform float channelColormapRangeStarts[7];
|
|
146510
|
+
uniform float channelColormapRangeEnds[7];
|
|
146511
|
+
|
|
146512
|
+
uniform float multiFeatureTexSize;
|
|
146513
|
+
|
|
146514
|
+
// Use one expressionTex for all channels, using an offset mechanism.
|
|
146515
|
+
uniform sampler2D valueTex;
|
|
146516
|
+
uniform float valueTexOffsets[7];
|
|
146517
|
+
uniform float valueTexHeight;
|
|
146518
|
+
|
|
146519
|
+
// Textures for set colors, using the same offset mechanism.
|
|
146520
|
+
uniform sampler2D colorTex;
|
|
146521
|
+
uniform float colorTexOffsets[7];
|
|
146522
|
+
uniform float colorTexHeight;
|
|
146523
|
+
|
|
146524
|
+
|
|
146525
|
+
// Static colors
|
|
146526
|
+
// TODO: For some reason I cannot use uniform vec3 colors[7]; and i cannot figure out why.
|
|
146527
|
+
uniform vec3 color0;
|
|
146528
|
+
uniform vec3 color1;
|
|
146529
|
+
uniform vec3 color2;
|
|
146530
|
+
uniform vec3 color3;
|
|
146531
|
+
uniform vec3 color4;
|
|
146532
|
+
uniform vec3 color5;
|
|
146533
|
+
uniform vec3 color6;
|
|
146534
|
+
|
|
146535
|
+
// Info for edge-only mode
|
|
146536
|
+
uniform float scaleFactor;
|
|
146537
|
+
uniform bool channelsFilled[7];
|
|
146538
|
+
uniform float channelStrokeWidths[7];
|
|
146539
|
+
|
|
146540
|
+
// opacity
|
|
146541
|
+
uniform float opacity;
|
|
146542
|
+
|
|
146543
|
+
varying vec2 vTexCoord;
|
|
146544
|
+
|
|
146545
|
+
vec3 sampleAndGetData(sampler2D dataTex, vec2 coord, bool isFilled, float strokeWidth, bool isOn) {
|
|
146546
|
+
float sampledData = texture(dataTex, coord).r;
|
|
146547
|
+
float clampedSampledData = max(0., min(sampledData, 1.));
|
|
146548
|
+
|
|
146549
|
+
bool isEdge = true;
|
|
146550
|
+
|
|
146551
|
+
if(!isFilled) {
|
|
146552
|
+
vec2 uTextureSize = vec2(2048.0, 2048.0);
|
|
146553
|
+
vec2 onePixel = vec2(1.0, 1.0) / uTextureSize;
|
|
146554
|
+
|
|
146555
|
+
// Vary the edgeSize based on user-defined stroke width.
|
|
146556
|
+
float edgeSize = 150.0 * strokeWidth * scaleFactor;
|
|
146557
|
+
|
|
146558
|
+
float pixN = texture(dataTex, coord + vec2(0.0, onePixel.y * edgeSize)).r;
|
|
146559
|
+
float pixS = texture(dataTex, coord - vec2(0.0, onePixel.y * edgeSize)).r;
|
|
146560
|
+
float pixW = texture(dataTex, coord + vec2(onePixel.x * edgeSize, 0.0)).r;
|
|
146561
|
+
float pixE = texture(dataTex, coord - vec2(onePixel.x * edgeSize, 0.0)).r;
|
|
146562
|
+
|
|
146563
|
+
float pixNW = texture(dataTex, coord + vec2(onePixel.y * edgeSize, onePixel.y * edgeSize)).r;
|
|
146564
|
+
float pixNE = texture(dataTex, coord + vec2(-1.0 * onePixel.x * edgeSize, onePixel.y * edgeSize)).r;
|
|
146565
|
+
float pixSW = texture(dataTex, coord - vec2(onePixel.x * edgeSize, onePixel.y * edgeSize)).r;
|
|
146566
|
+
float pixSE = texture(dataTex, coord - vec2(-1.0 * onePixel.x * edgeSize, onePixel.y * edgeSize)).r;
|
|
146567
|
+
|
|
146568
|
+
isEdge = (pixN != sampledData || pixS != sampledData || pixW != sampledData || pixE != sampledData || pixNW != sampledData || pixNE != sampledData || pixSW != sampledData || pixSE != sampledData);
|
|
146569
|
+
}
|
|
146570
|
+
// Return a tuple of (sampledData, isEdge)
|
|
146571
|
+
return vec3(clampedSampledData * float(isOn), sampledData, float(isEdge));
|
|
146572
|
+
}
|
|
146573
|
+
|
|
146574
|
+
vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
|
|
146575
|
+
float clampedSampledDataAndIsOn = sampledDataAndIsEdge.x;
|
|
146576
|
+
float sampledData = sampledDataAndIsEdge.y;
|
|
146577
|
+
float isEdge = sampledDataAndIsEdge.z;
|
|
146578
|
+
|
|
146579
|
+
|
|
146580
|
+
vec4 hoveredColor = float(sampledData == hovered && sampledData > 0. && hovered > 0.) * vec4(0., 0., 1., 1.);
|
|
146581
|
+
|
|
146582
|
+
// Colors are laid out corresponding to ids in row-major order in the texture. So if width of the texture is 10, and you want ID 25,
|
|
146583
|
+
// you need coordinate (1, 4) (i.e 2 rows down, and 5 columns over indexed from 0 for a total of 25 units covered in row major order).
|
|
146584
|
+
float offsetSampledData = sampledData + valueOffset - 1.0;
|
|
146585
|
+
vec2 colorTexCoord = vec2(mod(offsetSampledData, multiFeatureTexSize) / multiFeatureTexSize, floor(offsetSampledData / multiFeatureTexSize) / (valueTexHeight - 1.));
|
|
146586
|
+
|
|
146587
|
+
// Get expression value
|
|
146588
|
+
float expressionValue = texture(valueTex, colorTexCoord).r / 255.;
|
|
146589
|
+
float scaledExpressionValue = (expressionValue - rangeStart) / max(0.005, (rangeEnd - rangeStart));
|
|
146590
|
+
|
|
146591
|
+
|
|
146592
|
+
// Get set color index value
|
|
146593
|
+
vec2 setIndicesTexCoord = vec2(mod(offsetSampledData, multiFeatureTexSize) / multiFeatureTexSize, floor(offsetSampledData / multiFeatureTexSize) / (valueTexHeight - 1.));
|
|
146594
|
+
float setColorIndex = texture(valueTex, setIndicesTexCoord).r;
|
|
146595
|
+
|
|
146596
|
+
// Initialize to the default "null" color.
|
|
146597
|
+
vec3 setColor = vec3(200. / 255., 200. / 255., 200. / 255.);
|
|
146598
|
+
if(setColorIndex != 0.) {
|
|
146599
|
+
// Subtract one from setColorIndex because we have already checked for the "null" value.
|
|
146600
|
+
setColorIndex = setColorIndex - 1.;
|
|
146601
|
+
|
|
146602
|
+
float setColorOffsetR = (setColorIndex + setColorOffset) * 3.0 + 0.0;
|
|
146603
|
+
vec2 setColorTexCoordR = vec2(mod(setColorOffsetR, multiFeatureTexSize) / multiFeatureTexSize, floor(setColorOffsetR / multiFeatureTexSize) / (colorTexHeight - 1.));
|
|
146604
|
+
float setColorR = texture(colorTex, setColorTexCoordR).r / 255.;
|
|
146605
|
+
|
|
146606
|
+
float setColorOffsetG = (setColorIndex + setColorOffset) * 3.0 + 1.0;
|
|
146607
|
+
vec2 setColorTexCoordG = vec2(mod(setColorOffsetG, multiFeatureTexSize) / multiFeatureTexSize, floor(setColorOffsetG / multiFeatureTexSize) / (colorTexHeight - 1.));
|
|
146608
|
+
float setColorG = texture(colorTex, setColorTexCoordG).r / 255.;
|
|
146609
|
+
|
|
146610
|
+
float setColorOffsetB = (setColorIndex + setColorOffset) * 3.0 + 2.0;
|
|
146611
|
+
vec2 setColorTexCoordB = vec2(mod(setColorOffsetB, multiFeatureTexSize) / multiFeatureTexSize, floor(setColorOffsetB / multiFeatureTexSize) / (colorTexHeight - 1.));
|
|
146612
|
+
float setColorB = texture(colorTex, setColorTexCoordB).r / 255.;
|
|
146613
|
+
|
|
146614
|
+
setColor = vec3(setColorR, setColorG, setColorB);
|
|
146615
|
+
}
|
|
146616
|
+
|
|
146617
|
+
|
|
146618
|
+
vec4 sampledColor = (1. - (float(isStaticColorMode) + float(isSetColorMode))) * vec4(COLORMAP_FUNC(clamp(scaledExpressionValue, 0.0, 1.0)).rgb, channelOpacity) + float(isStaticColorMode) * vec4(channelColor.rgb, channelOpacity) + float(isSetColorMode) * vec4(setColor, channelOpacity);
|
|
146619
|
+
// Only return a color if the data is non-zero.
|
|
146620
|
+
|
|
146621
|
+
return clampedSampledDataAndIsOn * isEdge * sampledColor;
|
|
146622
|
+
}
|
|
146623
|
+
|
|
146624
|
+
void main() {
|
|
146625
|
+
|
|
146626
|
+
// Get the color and alpha value for each channel.
|
|
146627
|
+
vec3 dat0 = sampleAndGetData(channel0, vTexCoord, channelsFilled[0], channelStrokeWidths[0], channelsVisible[0]);
|
|
146628
|
+
vec3 dat1 = sampleAndGetData(channel1, vTexCoord, channelsFilled[1], channelStrokeWidths[1], channelsVisible[1]);
|
|
146629
|
+
vec3 dat2 = sampleAndGetData(channel2, vTexCoord, channelsFilled[2], channelStrokeWidths[2], channelsVisible[2]);
|
|
146630
|
+
vec3 dat3 = sampleAndGetData(channel3, vTexCoord, channelsFilled[3], channelStrokeWidths[3], channelsVisible[3]);
|
|
146631
|
+
vec3 dat4 = sampleAndGetData(channel4, vTexCoord, channelsFilled[4], channelStrokeWidths[4], channelsVisible[4]);
|
|
146632
|
+
vec3 dat5 = sampleAndGetData(channel5, vTexCoord, channelsFilled[5], channelStrokeWidths[5], channelsVisible[5]);
|
|
146633
|
+
vec3 dat6 = sampleAndGetData(channel6, vTexCoord, channelsFilled[6], channelStrokeWidths[6], channelsVisible[6]);
|
|
146634
|
+
|
|
146635
|
+
vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
|
|
146636
|
+
vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
|
|
146637
|
+
vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
|
|
146638
|
+
vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
|
|
146639
|
+
vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
|
|
146640
|
+
vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
|
|
146641
|
+
vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
|
|
146642
|
+
|
|
146643
|
+
// If all of the channels are "empty", then discard this pixel so that it is not considered during picking.
|
|
146644
|
+
float emptyDat = 0.;
|
|
146645
|
+
if(dat0.x == emptyDat && dat1.x == emptyDat && dat2.x == emptyDat && dat3.x == emptyDat && dat4.x == emptyDat && dat5.x == emptyDat && dat6.x == emptyDat) {
|
|
146646
|
+
discard;
|
|
146647
|
+
}
|
|
146648
|
+
|
|
146649
|
+
// If the next channel color and the currently stored color (gl_FragColor) are identical,
|
|
146650
|
+
// or the next channel color is transparent black,
|
|
146651
|
+
// just use the currently stored color. Repeat this for all channels.
|
|
146652
|
+
|
|
146653
|
+
// Mix colors where necessary, using the alpha value of the next channel as the weight.
|
|
146654
|
+
// Use the maximum alpha value as the resulting alpha value.
|
|
146655
|
+
gl_FragColor = val0;
|
|
146656
|
+
gl_FragColor = (val1 == gl_FragColor || val1 == vec4(0.)) ? gl_FragColor : vec4(mix(gl_FragColor, val1, val1.a).rgb, max(gl_FragColor.a, val1.a));
|
|
146657
|
+
gl_FragColor = (val2 == gl_FragColor || val2 == vec4(0.)) ? gl_FragColor : vec4(mix(gl_FragColor, val2, val2.a).rgb, max(gl_FragColor.a, val2.a));
|
|
146658
|
+
gl_FragColor = (val3 == gl_FragColor || val3 == vec4(0.)) ? gl_FragColor : vec4(mix(gl_FragColor, val3, val3.a).rgb, max(gl_FragColor.a, val3.a));
|
|
146659
|
+
gl_FragColor = (val4 == gl_FragColor || val4 == vec4(0.)) ? gl_FragColor : vec4(mix(gl_FragColor, val4, val4.a).rgb, max(gl_FragColor.a, val4.a));
|
|
146660
|
+
gl_FragColor = (val5 == gl_FragColor || val5 == vec4(0.)) ? gl_FragColor : vec4(mix(gl_FragColor, val5, val5.a).rgb, max(gl_FragColor.a, val5.a));
|
|
146661
|
+
gl_FragColor = (val6 == gl_FragColor || val6 == vec4(0.)) ? gl_FragColor : vec4(mix(gl_FragColor, val6, val6.a).rgb, max(gl_FragColor.a, val6.a));
|
|
146662
|
+
|
|
146663
|
+
|
|
146664
|
+
|
|
146665
|
+
// TODO: multiply the resulting channel-level opacity value by the layer-level opacity value.
|
|
146666
|
+
|
|
146667
|
+
geometry.uv = vTexCoord;
|
|
146668
|
+
DECKGL_FILTER_COLOR(gl_FragColor, geometry);
|
|
146669
|
+
}
|
|
146670
|
+
`;
|
|
146671
|
+
function extent(values2, valueof) {
|
|
146672
|
+
let min;
|
|
146673
|
+
let max;
|
|
146674
|
+
if (valueof === void 0) {
|
|
146675
|
+
for (const value of values2) {
|
|
146676
|
+
if (value != null) {
|
|
146677
|
+
if (min === void 0) {
|
|
146678
|
+
if (value >= value)
|
|
146679
|
+
min = max = value;
|
|
146680
|
+
} else {
|
|
146681
|
+
if (min > value)
|
|
146682
|
+
min = value;
|
|
146683
|
+
if (max < value)
|
|
146684
|
+
max = value;
|
|
146685
|
+
}
|
|
146686
|
+
}
|
|
146687
|
+
}
|
|
146688
|
+
} else {
|
|
146689
|
+
let index2 = -1;
|
|
146690
|
+
for (let value of values2) {
|
|
146691
|
+
if ((value = valueof(value, ++index2, values2)) != null) {
|
|
146692
|
+
if (min === void 0) {
|
|
146693
|
+
if (value >= value)
|
|
146694
|
+
min = max = value;
|
|
146695
|
+
} else {
|
|
146696
|
+
if (min > value)
|
|
146697
|
+
min = value;
|
|
146698
|
+
if (max < value)
|
|
146699
|
+
max = value;
|
|
146700
|
+
}
|
|
146701
|
+
}
|
|
146702
|
+
}
|
|
146703
|
+
}
|
|
146704
|
+
return [min, max];
|
|
146279
146705
|
}
|
|
146280
|
-
|
|
146281
|
-
|
|
146282
|
-
|
|
146706
|
+
function normalize(arr) {
|
|
146707
|
+
const [min, max] = extent(arr);
|
|
146708
|
+
const ratio = 255 / (max - min);
|
|
146709
|
+
const data = new Uint8Array(arr.map((i2) => Math.floor((i2 - min) * ratio)));
|
|
146710
|
+
return data;
|
|
146711
|
+
}
|
|
146712
|
+
function multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSetColorMode, texSize) {
|
|
146713
|
+
let totalValuesLength = 0;
|
|
146714
|
+
let totalColorsLength = 0;
|
|
146715
|
+
channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
|
|
146716
|
+
var _a2, _b, _c, _d, _e;
|
|
146717
|
+
if (isSetColorMode) {
|
|
146718
|
+
totalValuesLength += ((_b = (_a2 = setColorValues[channelIndex]) == null ? void 0 : _a2.obsIndex) == null ? void 0 : _b.length) || 0;
|
|
146719
|
+
totalColorsLength += (((_d = (_c = setColorValues[channelIndex]) == null ? void 0 : _c.setColors) == null ? void 0 : _d.length) || 0) * 3;
|
|
146720
|
+
} else {
|
|
146721
|
+
totalValuesLength += ((_e = multiFeatureValues[channelIndex]) == null ? void 0 : _e.length) || 0;
|
|
146722
|
+
}
|
|
146723
|
+
});
|
|
146724
|
+
const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
|
|
146725
|
+
const colorTexHeight = Math.max(2, Math.ceil(totalColorsLength / texSize));
|
|
146726
|
+
if (valueTexHeight > texSize) {
|
|
146727
|
+
console.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
|
|
146728
|
+
}
|
|
146729
|
+
if (colorTexHeight > texSize) {
|
|
146730
|
+
console.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
|
|
146731
|
+
}
|
|
146732
|
+
const totalData = new Uint8Array(texSize * valueTexHeight);
|
|
146733
|
+
const totalColors = new Uint8Array(texSize * colorTexHeight);
|
|
146734
|
+
const indicesOffsets = [];
|
|
146735
|
+
const colorsOffsets = [];
|
|
146736
|
+
let indexOffset = 0;
|
|
146737
|
+
let colorOffset = 0;
|
|
146738
|
+
channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
|
|
146739
|
+
if (isSetColorMode) {
|
|
146740
|
+
const { setColorIndices, setColors, obsIndex } = setColorValues[channelIndex] || {};
|
|
146741
|
+
if (setColorIndices && setColors && obsIndex) {
|
|
146742
|
+
for (let i2 = 0; i2 < obsIndex.length; i2++) {
|
|
146743
|
+
const colorIndex = setColorIndices.get(String(i2 + 1));
|
|
146744
|
+
totalData[indexOffset + i2] = colorIndex === void 0 ? 0 : colorIndex + 1;
|
|
146745
|
+
}
|
|
146746
|
+
for (let i2 = 0; i2 < setColors.length; i2++) {
|
|
146747
|
+
const { color: [r2, g2, b] } = setColors[i2];
|
|
146748
|
+
totalColors[(colorOffset + i2) * 3 + 0] = r2;
|
|
146749
|
+
totalColors[(colorOffset + i2) * 3 + 1] = g2;
|
|
146750
|
+
totalColors[(colorOffset + i2) * 3 + 2] = b;
|
|
146751
|
+
}
|
|
146752
|
+
}
|
|
146753
|
+
indicesOffsets.push(indexOffset);
|
|
146754
|
+
colorsOffsets.push(colorOffset);
|
|
146755
|
+
indexOffset += (obsIndex == null ? void 0 : obsIndex.length) || 0;
|
|
146756
|
+
colorOffset += (setColors == null ? void 0 : setColors.length) || 0;
|
|
146757
|
+
} else {
|
|
146758
|
+
const featureArr = multiFeatureValues[channelIndex];
|
|
146759
|
+
totalData.set(normalize(featureArr), indexOffset);
|
|
146760
|
+
indicesOffsets.push(indexOffset);
|
|
146761
|
+
indexOffset += featureArr.length;
|
|
146762
|
+
colorsOffsets.push(colorOffset);
|
|
146763
|
+
}
|
|
146764
|
+
});
|
|
146765
|
+
return [
|
|
146766
|
+
totalData,
|
|
146767
|
+
valueTexHeight,
|
|
146768
|
+
indicesOffsets,
|
|
146769
|
+
totalColors,
|
|
146770
|
+
colorTexHeight,
|
|
146771
|
+
colorsOffsets
|
|
146772
|
+
];
|
|
146773
|
+
}
|
|
146774
|
+
const MAX_CHANNELS = 7;
|
|
146775
|
+
const MULTI_FEATURE_TEX_SIZE = 2048;
|
|
146776
|
+
function padWithDefault(arr, defaultValue2, padWidth) {
|
|
146777
|
+
const newArr = [...arr];
|
|
146778
|
+
for (let i2 = 0; i2 < padWidth; i2 += 1) {
|
|
146779
|
+
newArr.push(defaultValue2);
|
|
146780
|
+
}
|
|
146781
|
+
return newArr;
|
|
146782
|
+
}
|
|
146783
|
+
function getColor(arr) {
|
|
146784
|
+
return arr ? arr.map((v) => v / 255) : [0, 0, 0];
|
|
146785
|
+
}
|
|
146786
|
+
const defaultProps = {
|
|
146787
|
+
channelStrokeWidths: { type: "array", value: null, compare: true },
|
|
146788
|
+
channelsFilled: { type: "array", value: null, compare: true },
|
|
146789
|
+
channelOpacities: { type: "array", value: null, compare: true },
|
|
146790
|
+
channelColors: { type: "array", value: null, compare: true },
|
|
146791
|
+
hoveredCell: { type: "number", value: null, compare: true },
|
|
146792
|
+
colormap: { type: "string", value: GLSL_COLORMAP_DEFAULT, compare: true },
|
|
146793
|
+
expressionData: { type: "object", value: null, compare: true },
|
|
146794
|
+
multiFeatureValues: { type: "array", value: null, compare: true },
|
|
146795
|
+
setColorValues: { type: "array", value: null, compare: true },
|
|
146796
|
+
channelFeatureValueColormaps: { type: "array", value: null, compare: true },
|
|
146797
|
+
channelFeatureValueColormapRanges: { type: "array", value: null, compare: true },
|
|
146798
|
+
channelIsStaticColorMode: { type: "array", value: null, compare: true },
|
|
146799
|
+
channelIsSetColorMode: { type: "array", value: null, compare: true }
|
|
146800
|
+
};
|
|
146801
|
+
class BitmaskLayer2 extends XRLayer {
|
|
146802
|
+
// eslint-disable-next-line class-methods-use-this
|
|
146803
|
+
getShaders() {
|
|
146804
|
+
const { colormap } = this.props;
|
|
146805
|
+
return {
|
|
146806
|
+
fs,
|
|
146807
|
+
vs,
|
|
146808
|
+
modules: [project32, picking],
|
|
146809
|
+
defines: {
|
|
146810
|
+
[COLORMAP_SHADER_PLACEHOLDER]: GLSL_COLORMAPS.includes(colormap) ? colormap : GLSL_COLORMAP_DEFAULT
|
|
146811
|
+
}
|
|
146812
|
+
};
|
|
146813
|
+
}
|
|
146814
|
+
/**
|
|
146815
|
+
* Override the parent loadChannelTextures to enable
|
|
146816
|
+
* up to eight channels (rather than six).
|
|
146817
|
+
* Reference: https://github.com/hms-dbmi/viv/blob/v0.13.3/packages/layers/src/xr-layer/xr-layer.js#L316
|
|
146818
|
+
*/
|
|
146819
|
+
loadChannelTextures(channelData) {
|
|
146820
|
+
const textures = {
|
|
146821
|
+
channel0: null,
|
|
146822
|
+
channel1: null,
|
|
146823
|
+
channel2: null,
|
|
146824
|
+
channel3: null,
|
|
146825
|
+
channel4: null,
|
|
146826
|
+
channel5: null,
|
|
146827
|
+
channel6: null
|
|
146828
|
+
};
|
|
146829
|
+
if (this.state.textures) {
|
|
146830
|
+
Object.values(this.state.textures).forEach((tex) => tex && tex.delete());
|
|
146831
|
+
}
|
|
146832
|
+
if (channelData && Object.keys(channelData).length > 0 && channelData.data) {
|
|
146833
|
+
channelData.data.forEach((d, i2) => {
|
|
146834
|
+
textures[`channel${i2}`] = this.dataToTexture(d, channelData.width, channelData.height);
|
|
146835
|
+
}, this);
|
|
146836
|
+
this.setState({ textures });
|
|
146837
|
+
}
|
|
146838
|
+
}
|
|
146839
|
+
updateState({ props: props2, oldProps, changeFlags }) {
|
|
146840
|
+
super.updateState({ props: props2, oldProps, changeFlags });
|
|
146841
|
+
if (props2.multiFeatureValues !== oldProps.multiFeatureValues || props2.setColorValues !== oldProps.setColorValues || props2.channelIsSetColorMode !== oldProps.channelIsSetColorMode) {
|
|
146842
|
+
const { multiFeatureValues, setColorValues, channelIsSetColorMode } = this.props;
|
|
146843
|
+
const [valueTex, colorTex, valueTexOffsets, colorTexOffsets, valueTexHeight, colorTexHeight] = this.multiSetsToTexture(multiFeatureValues, setColorValues, channelIsSetColorMode);
|
|
146844
|
+
this.setState({
|
|
146845
|
+
valueTex,
|
|
146846
|
+
colorTex,
|
|
146847
|
+
valueTexOffsets,
|
|
146848
|
+
colorTexOffsets,
|
|
146849
|
+
valueTexHeight,
|
|
146850
|
+
colorTexHeight
|
|
146851
|
+
});
|
|
146852
|
+
}
|
|
146853
|
+
if (props2.colormap !== oldProps.colormap) {
|
|
146854
|
+
const { gl } = this.context;
|
|
146855
|
+
if (this.state.model) {
|
|
146856
|
+
this.state.model.delete();
|
|
146857
|
+
}
|
|
146858
|
+
this.setState({ model: this._getModel(gl) });
|
|
146859
|
+
this.getAttributeManager().invalidateAll();
|
|
146860
|
+
}
|
|
146861
|
+
}
|
|
146862
|
+
draw(opts2) {
|
|
146863
|
+
const { uniforms } = opts2;
|
|
146864
|
+
const {
|
|
146865
|
+
channelStrokeWidths,
|
|
146866
|
+
channelsFilled,
|
|
146867
|
+
channelOpacities,
|
|
146868
|
+
channelColors,
|
|
146869
|
+
channelsVisible,
|
|
146870
|
+
// TODO: use `channelFeatureValueColormaps` in shader,
|
|
146871
|
+
// figure out how to call multiple GLSL colormap functions
|
|
146872
|
+
channelFeatureValueColormaps,
|
|
146873
|
+
channelFeatureValueColormapRanges,
|
|
146874
|
+
channelIsStaticColorMode,
|
|
146875
|
+
channelIsSetColorMode,
|
|
146876
|
+
hoveredCell,
|
|
146877
|
+
colorScaleLo,
|
|
146878
|
+
colorScaleHi,
|
|
146879
|
+
isExpressionMode,
|
|
146880
|
+
zoom,
|
|
146881
|
+
minZoom,
|
|
146882
|
+
maxZoom,
|
|
146883
|
+
zoomOffset
|
|
146884
|
+
// TODO: figure out if this needs to be used or not
|
|
146885
|
+
} = this.props;
|
|
146886
|
+
const {
|
|
146887
|
+
textures,
|
|
146888
|
+
model,
|
|
146889
|
+
// Expression and set index (and colors) textures with offsets
|
|
146890
|
+
valueTex,
|
|
146891
|
+
colorTex,
|
|
146892
|
+
valueTexOffsets,
|
|
146893
|
+
colorTexOffsets,
|
|
146894
|
+
valueTexHeight,
|
|
146895
|
+
colorTexHeight
|
|
146896
|
+
} = this.state;
|
|
146897
|
+
if (textures && model) {
|
|
146898
|
+
const scaleFactor = 1 / 2 ** (maxZoom - zoom);
|
|
146899
|
+
const colors = fromEntries(range$5(MAX_CHANNELS).map((i2) => [`color${i2}`, getColor(channelColors[i2])]));
|
|
146900
|
+
model.setUniforms(Object.assign({}, uniforms, {
|
|
146901
|
+
...colors,
|
|
146902
|
+
// Bitmask image channel data textures
|
|
146903
|
+
...textures,
|
|
146904
|
+
multiFeatureTexSize: MULTI_FEATURE_TEX_SIZE,
|
|
146905
|
+
// Expression textures with offsets
|
|
146906
|
+
valueTex,
|
|
146907
|
+
valueTexOffsets: padWithDefault(valueTexOffsets, 0, MAX_CHANNELS - valueTexOffsets.length),
|
|
146908
|
+
valueTexHeight,
|
|
146909
|
+
// Set indices and colors textures with offsets
|
|
146910
|
+
colorTex,
|
|
146911
|
+
colorTexOffsets: padWithDefault(colorTexOffsets, 0, MAX_CHANNELS - colorTexOffsets.length),
|
|
146912
|
+
colorTexHeight,
|
|
146913
|
+
// Visualization properties
|
|
146914
|
+
channelsFilled: padWithDefault(
|
|
146915
|
+
channelsFilled,
|
|
146916
|
+
true,
|
|
146917
|
+
// There are six texture entries on the shaders
|
|
146918
|
+
MAX_CHANNELS - channelsFilled.length
|
|
146919
|
+
),
|
|
146920
|
+
channelOpacities: padWithDefault(
|
|
146921
|
+
channelOpacities,
|
|
146922
|
+
0,
|
|
146923
|
+
// There are six texture entries on the shaders
|
|
146924
|
+
MAX_CHANNELS - channelOpacities.length
|
|
146925
|
+
),
|
|
146926
|
+
channelStrokeWidths: padWithDefault(
|
|
146927
|
+
channelStrokeWidths,
|
|
146928
|
+
1,
|
|
146929
|
+
// There are six texture entries on the shaders
|
|
146930
|
+
MAX_CHANNELS - channelStrokeWidths.length
|
|
146931
|
+
),
|
|
146932
|
+
channelColormapRangeStarts: padWithDefault(
|
|
146933
|
+
channelFeatureValueColormapRanges.map((r2) => (r2 == null ? void 0 : r2[0]) || 0),
|
|
146934
|
+
0,
|
|
146935
|
+
// There are six texture entries on the shaders
|
|
146936
|
+
MAX_CHANNELS - channelFeatureValueColormapRanges.length
|
|
146937
|
+
),
|
|
146938
|
+
channelColormapRangeEnds: padWithDefault(
|
|
146939
|
+
channelFeatureValueColormapRanges.map((r2) => (r2 == null ? void 0 : r2[1]) || 1),
|
|
146940
|
+
1,
|
|
146941
|
+
// There are six texture entries on the shaders
|
|
146942
|
+
MAX_CHANNELS - channelFeatureValueColormapRanges.length
|
|
146943
|
+
),
|
|
146944
|
+
channelIsStaticColorMode: padWithDefault(
|
|
146945
|
+
channelIsStaticColorMode,
|
|
146946
|
+
true,
|
|
146947
|
+
// There are six texture entries on the shaders
|
|
146948
|
+
MAX_CHANNELS - channelIsStaticColorMode.length
|
|
146949
|
+
),
|
|
146950
|
+
channelIsSetColorMode: padWithDefault(
|
|
146951
|
+
channelIsSetColorMode,
|
|
146952
|
+
false,
|
|
146953
|
+
// There are six texture entries on the shaders
|
|
146954
|
+
MAX_CHANNELS - channelIsSetColorMode.length
|
|
146955
|
+
),
|
|
146956
|
+
hovered: hoveredCell || 0,
|
|
146957
|
+
channelsVisible: padWithDefault(
|
|
146958
|
+
channelsVisible,
|
|
146959
|
+
false,
|
|
146960
|
+
// There are six texture entries on the shaders
|
|
146961
|
+
MAX_CHANNELS - channelsVisible.length
|
|
146962
|
+
),
|
|
146963
|
+
// uColorScaleRange: [colorScaleLo, colorScaleHi],
|
|
146964
|
+
// uIsExpressionMode: isExpressionMode,
|
|
146965
|
+
// uIsOutlined: false,
|
|
146966
|
+
scaleFactor
|
|
146967
|
+
})).draw();
|
|
146968
|
+
}
|
|
146969
|
+
}
|
|
146970
|
+
/**
|
|
146971
|
+
* This function creates textures from the data
|
|
146972
|
+
*/
|
|
146973
|
+
dataToTexture(data, width, height) {
|
|
146974
|
+
const isWebGL2On = isWebGL2$1(this.context.gl);
|
|
146975
|
+
return new Texture2D(this.context.gl, {
|
|
146976
|
+
width,
|
|
146977
|
+
height,
|
|
146978
|
+
// Only use Float32 so we don't have to write two shaders
|
|
146979
|
+
data: new Float32Array(data),
|
|
146980
|
+
// we don't want or need mimaps
|
|
146981
|
+
mipmaps: false,
|
|
146982
|
+
parameters: {
|
|
146983
|
+
// NEAREST for integer data
|
|
146984
|
+
[GL$1.TEXTURE_MIN_FILTER]: GL$1.NEAREST,
|
|
146985
|
+
[GL$1.TEXTURE_MAG_FILTER]: GL$1.NEAREST,
|
|
146986
|
+
// CLAMP_TO_EDGE to remove tile artifacts
|
|
146987
|
+
[GL$1.TEXTURE_WRAP_S]: GL$1.CLAMP_TO_EDGE,
|
|
146988
|
+
[GL$1.TEXTURE_WRAP_T]: GL$1.CLAMP_TO_EDGE
|
|
146989
|
+
},
|
|
146990
|
+
format: isWebGL2On ? GL$1.R32F : GL$1.LUMINANCE,
|
|
146991
|
+
dataFormat: isWebGL2On ? GL$1.RED : GL$1.LUMINANCE,
|
|
146992
|
+
type: GL$1.FLOAT
|
|
146993
|
+
});
|
|
146994
|
+
}
|
|
146995
|
+
multiSetsToTexture(multiFeatureValues, setColorValues, channelIsSetColorMode) {
|
|
146996
|
+
const isWebGL2On = isWebGL2$1(this.context.gl);
|
|
146997
|
+
const [totalData, valueTexHeight, indicesOffsets, totalColors, colorTexHeight, colorsOffsets] = multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSetColorMode, MULTI_FEATURE_TEX_SIZE);
|
|
146998
|
+
return [
|
|
146999
|
+
// Color indices texture
|
|
147000
|
+
new Texture2D(this.context.gl, {
|
|
147001
|
+
width: MULTI_FEATURE_TEX_SIZE,
|
|
147002
|
+
height: valueTexHeight,
|
|
147003
|
+
// Only use Float32 so we don't have to write two shaders
|
|
147004
|
+
data: new Float32Array(totalData),
|
|
147005
|
+
// we don't want or need mimaps
|
|
147006
|
+
mipmaps: false,
|
|
147007
|
+
parameters: {
|
|
147008
|
+
// NEAREST for integer data
|
|
147009
|
+
[GL$1.TEXTURE_MIN_FILTER]: GL$1.NEAREST,
|
|
147010
|
+
[GL$1.TEXTURE_MAG_FILTER]: GL$1.NEAREST,
|
|
147011
|
+
// CLAMP_TO_EDGE to remove tile artifacts
|
|
147012
|
+
[GL$1.TEXTURE_WRAP_S]: GL$1.CLAMP_TO_EDGE,
|
|
147013
|
+
[GL$1.TEXTURE_WRAP_T]: GL$1.CLAMP_TO_EDGE
|
|
147014
|
+
},
|
|
147015
|
+
format: isWebGL2On ? GL$1.R32F : GL$1.LUMINANCE,
|
|
147016
|
+
dataFormat: isWebGL2On ? GL$1.RED : GL$1.LUMINANCE,
|
|
147017
|
+
type: GL$1.FLOAT
|
|
147018
|
+
}),
|
|
147019
|
+
// Colors texture
|
|
147020
|
+
new Texture2D(this.context.gl, {
|
|
147021
|
+
width: MULTI_FEATURE_TEX_SIZE,
|
|
147022
|
+
height: colorTexHeight,
|
|
147023
|
+
// Only use Float32 so we don't have to write two shaders
|
|
147024
|
+
data: new Float32Array(totalColors),
|
|
147025
|
+
// we don't want or need mimaps
|
|
147026
|
+
mipmaps: false,
|
|
147027
|
+
parameters: {
|
|
147028
|
+
// NEAREST for integer data
|
|
147029
|
+
[GL$1.TEXTURE_MIN_FILTER]: GL$1.NEAREST,
|
|
147030
|
+
[GL$1.TEXTURE_MAG_FILTER]: GL$1.NEAREST,
|
|
147031
|
+
// CLAMP_TO_EDGE to remove tile artifacts
|
|
147032
|
+
[GL$1.TEXTURE_WRAP_S]: GL$1.CLAMP_TO_EDGE,
|
|
147033
|
+
[GL$1.TEXTURE_WRAP_T]: GL$1.CLAMP_TO_EDGE
|
|
147034
|
+
},
|
|
147035
|
+
format: isWebGL2On ? GL$1.R32F : GL$1.LUMINANCE,
|
|
147036
|
+
dataFormat: isWebGL2On ? GL$1.RED : GL$1.LUMINANCE,
|
|
147037
|
+
type: GL$1.FLOAT
|
|
147038
|
+
}),
|
|
147039
|
+
// Offsets
|
|
147040
|
+
indicesOffsets,
|
|
147041
|
+
colorsOffsets,
|
|
147042
|
+
// Texture heights
|
|
147043
|
+
valueTexHeight,
|
|
147044
|
+
colorTexHeight
|
|
147045
|
+
];
|
|
147046
|
+
}
|
|
147047
|
+
}
|
|
147048
|
+
BitmaskLayer2.layerName = "BitmaskLayer";
|
|
147049
|
+
BitmaskLayer2.defaultProps = defaultProps;
|
|
147050
|
+
const toRgbUIString = (on, arr, theme) => {
|
|
147051
|
+
const color = on || theme === "light" && (arr == null ? void 0 : arr.every((i2) => i2 === 255)) ? [220, 220, 220] : arr;
|
|
147052
|
+
return `rgb(${color})`;
|
|
147053
|
+
};
|
|
147054
|
+
function filterSelection(loader, selection) {
|
|
147055
|
+
if (!selection) {
|
|
147056
|
+
return selection;
|
|
147057
|
+
}
|
|
147058
|
+
const data = Array.isArray(loader) ? loader[loader.length - 1] : loader;
|
|
147059
|
+
const { labels } = data;
|
|
147060
|
+
return fromEntries(Object.entries(selection).filter(([key]) => labels.includes(key)));
|
|
147061
|
+
}
|
|
147062
|
+
async function getSingleSelectionStats2D({ loader, selection }) {
|
|
146283
147063
|
const data = Array.isArray(loader) ? loader[loader.length - 1] : loader;
|
|
146284
|
-
const
|
|
147064
|
+
const filteredSelection = filterSelection(loader, selection);
|
|
147065
|
+
const raster = await data.getRaster({ selection: filteredSelection });
|
|
146285
147066
|
const selectionStats = getChannelStats(raster.data);
|
|
146286
147067
|
const { domain, contrastLimits: slider } = selectionStats;
|
|
146287
147068
|
return { domain, slider };
|
|
146288
147069
|
}
|
|
146289
|
-
async function getSingleSelectionStats3D
|
|
147070
|
+
async function getSingleSelectionStats3D({ loader, selection }) {
|
|
146290
147071
|
const lowResSource = loader[loader.length - 1];
|
|
147072
|
+
const filteredSelection = filterSelection(lowResSource, selection);
|
|
146291
147073
|
const { shape: shape2, labels } = lowResSource;
|
|
146292
147074
|
const sizeZ = shape2[labels.indexOf("z")] >> loader.length - 1;
|
|
146293
147075
|
const raster0 = await lowResSource.getRaster({
|
|
146294
|
-
selection: { ...
|
|
147076
|
+
selection: { ...filteredSelection, z: 0 }
|
|
146295
147077
|
});
|
|
146296
147078
|
const rasterMid = await lowResSource.getRaster({
|
|
146297
|
-
selection: { ...
|
|
147079
|
+
selection: { ...filteredSelection, z: Math.floor(sizeZ / 2) }
|
|
146298
147080
|
});
|
|
146299
147081
|
const rasterTop = await lowResSource.getRaster({
|
|
146300
|
-
selection: { ...
|
|
147082
|
+
selection: { ...filteredSelection, z: Math.max(0, sizeZ - 1) }
|
|
146301
147083
|
});
|
|
146302
147084
|
const stats0 = getChannelStats(raster0.data);
|
|
146303
147085
|
const statsMid = getChannelStats(rasterMid.data);
|
|
@@ -146313,16 +147095,55 @@ async function getSingleSelectionStats3D$1({ loader, selection }) {
|
|
|
146313
147095
|
]
|
|
146314
147096
|
};
|
|
146315
147097
|
}
|
|
146316
|
-
const getSingleSelectionStats
|
|
146317
|
-
const getStats = use3d ? getSingleSelectionStats3D
|
|
147098
|
+
const getSingleSelectionStats = async ({ loader, selection, use3d }) => {
|
|
147099
|
+
const getStats = use3d ? getSingleSelectionStats3D : getSingleSelectionStats2D;
|
|
146318
147100
|
return getStats({ loader, selection });
|
|
146319
147101
|
};
|
|
146320
|
-
const getMultiSelectionStats
|
|
146321
|
-
const stats = await Promise.all(selections.map((selection) => getSingleSelectionStats
|
|
147102
|
+
const getMultiSelectionStats = async ({ loader, selections, use3d }) => {
|
|
147103
|
+
const stats = await Promise.all(selections.map((selection) => getSingleSelectionStats({ loader, selection, use3d })));
|
|
146322
147104
|
const domains = stats.map((stat) => stat.domain);
|
|
146323
147105
|
const sliders = stats.map((stat) => stat.slider);
|
|
146324
147106
|
return { domains, sliders };
|
|
146325
147107
|
};
|
|
147108
|
+
function getPhysicalSizeScalingMatrix(loader) {
|
|
147109
|
+
var _a2;
|
|
147110
|
+
const { x: x2, y: y2, z: z2 } = ((_a2 = loader == null ? void 0 : loader.meta) == null ? void 0 : _a2.physicalSizes) ?? {};
|
|
147111
|
+
if ((x2 == null ? void 0 : x2.size) && (y2 == null ? void 0 : y2.size) && (z2 == null ? void 0 : z2.size)) {
|
|
147112
|
+
const min = Math.min(z2.size, x2.size, y2.size);
|
|
147113
|
+
const ratio = [x2.size / min, y2.size / min, z2.size / min];
|
|
147114
|
+
return new Matrix4().scale(ratio);
|
|
147115
|
+
}
|
|
147116
|
+
return new Matrix4().identity();
|
|
147117
|
+
}
|
|
147118
|
+
function getBoundingCube(loader) {
|
|
147119
|
+
const source = Array.isArray(loader) ? loader[0] : loader;
|
|
147120
|
+
const { shape: shape2, labels } = source;
|
|
147121
|
+
const physicalSizeScalingMatrix = getPhysicalSizeScalingMatrix(source);
|
|
147122
|
+
const xSlice = [0, physicalSizeScalingMatrix[0] * shape2[labels.indexOf("x")]];
|
|
147123
|
+
const ySlice = [0, physicalSizeScalingMatrix[5] * shape2[labels.indexOf("y")]];
|
|
147124
|
+
const zSlice = [
|
|
147125
|
+
0,
|
|
147126
|
+
physicalSizeScalingMatrix[10] * shape2[labels.indexOf("z")]
|
|
147127
|
+
];
|
|
147128
|
+
return [xSlice, ySlice, zSlice];
|
|
147129
|
+
}
|
|
147130
|
+
function abbreviateNumber(value) {
|
|
147131
|
+
const maxLength = 5;
|
|
147132
|
+
let maxNaiveDigits = maxLength;
|
|
147133
|
+
if (!Number.isInteger(value)) {
|
|
147134
|
+
--maxNaiveDigits;
|
|
147135
|
+
}
|
|
147136
|
+
if (value < 1) {
|
|
147137
|
+
--maxNaiveDigits;
|
|
147138
|
+
}
|
|
147139
|
+
const naive = Intl.NumberFormat("en-US", {
|
|
147140
|
+
maximumSignificantDigits: maxNaiveDigits,
|
|
147141
|
+
useGrouping: false
|
|
147142
|
+
}).format(value);
|
|
147143
|
+
if (naive.length <= maxLength)
|
|
147144
|
+
return naive;
|
|
147145
|
+
return value.toExponential(0);
|
|
147146
|
+
}
|
|
146326
147147
|
const GLOBAL_LABELS = ["z", "t"];
|
|
146327
147148
|
const DEFAULT_RASTER_DOMAIN_TYPE = "Min/Max";
|
|
146328
147149
|
const DEFAULT_RASTER_LAYER_PROPS = {
|
|
@@ -146339,6 +147160,27 @@ function getSourceFromLoader(loader, level) {
|
|
|
146339
147160
|
const source = Array.isArray(data) ? data[level || data.length - 1] : data;
|
|
146340
147161
|
return source;
|
|
146341
147162
|
}
|
|
147163
|
+
const getStatsForResolution = (loader, resolution) => {
|
|
147164
|
+
const { shape: shape2, labels } = loader[resolution];
|
|
147165
|
+
const height = shape2[labels.indexOf("y")];
|
|
147166
|
+
const width = shape2[labels.indexOf("x")];
|
|
147167
|
+
const depth = shape2[labels.indexOf("z")];
|
|
147168
|
+
const depthDownsampled = Math.max(1, depth >> resolution);
|
|
147169
|
+
const totalBytes = 4 * height * width * depthDownsampled;
|
|
147170
|
+
return {
|
|
147171
|
+
height,
|
|
147172
|
+
width,
|
|
147173
|
+
depthDownsampled,
|
|
147174
|
+
totalBytes
|
|
147175
|
+
};
|
|
147176
|
+
};
|
|
147177
|
+
const canLoadResolution = (loader, resolution) => {
|
|
147178
|
+
var _a2, _b, _c;
|
|
147179
|
+
const { totalBytes, height, width, depthDownsampled } = getStatsForResolution(loader, resolution);
|
|
147180
|
+
const maxHeapSize = ((_a2 = window.performance) == null ? void 0 : _a2.memory) && ((_c = (_b = window.performance) == null ? void 0 : _b.memory) == null ? void 0 : _c.jsHeapSizeLimit) / 2;
|
|
147181
|
+
const maxSize = maxHeapSize || 2 ** 31 - 1;
|
|
147182
|
+
return totalBytes < maxSize && height <= 2048 && depthDownsampled <= 2048 && width <= 2048 && depthDownsampled > 1;
|
|
147183
|
+
};
|
|
146342
147184
|
function isRgb(loader, channels2) {
|
|
146343
147185
|
const source = getSourceFromLoader(loader);
|
|
146344
147186
|
const { shape: shape2, dtype, labels } = source;
|
|
@@ -146380,7 +147222,7 @@ async function initializeLayerChannels(loader, use3d) {
|
|
|
146380
147222
|
const source = getSourceFromLoader(loader);
|
|
146381
147223
|
let defaultSelection = buildDefaultSelection(source);
|
|
146382
147224
|
defaultSelection = isInterleaved(source.shape) ? [{ ...defaultSelection[0], c: 0 }] : defaultSelection;
|
|
146383
|
-
const stats = await getMultiSelectionStats
|
|
147225
|
+
const stats = await getMultiSelectionStats({
|
|
146384
147226
|
loader: loader.data,
|
|
146385
147227
|
selections: defaultSelection,
|
|
146386
147228
|
use3d
|
|
@@ -146402,6 +147244,17 @@ async function initializeLayerChannels(loader, use3d) {
|
|
|
146402
147244
|
});
|
|
146403
147245
|
return result;
|
|
146404
147246
|
}
|
|
147247
|
+
function getDomains() {
|
|
147248
|
+
const domains = {};
|
|
147249
|
+
const needMin = ["Int8", "Int16", "Int32"];
|
|
147250
|
+
Object.keys(DTYPE_VALUES).forEach((dtype) => {
|
|
147251
|
+
const { max } = DTYPE_VALUES[dtype];
|
|
147252
|
+
const min = needMin.includes(dtype) ? -(max + 1) : 0;
|
|
147253
|
+
domains[dtype] = [min, max];
|
|
147254
|
+
});
|
|
147255
|
+
return domains;
|
|
147256
|
+
}
|
|
147257
|
+
const DOMAINS = getDomains();
|
|
146405
147258
|
const AddIcon = createSvgIcon(/* @__PURE__ */ React.createElement("path", {
|
|
146406
147259
|
d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
|
|
146407
147260
|
}), "Add");
|
|
@@ -146442,31 +147295,29 @@ const useChannelSliderStyles = makeStyles((theme) => ({
|
|
|
146442
147295
|
}
|
|
146443
147296
|
}
|
|
146444
147297
|
}));
|
|
146445
|
-
function MuiSpan(props2) {
|
|
146446
|
-
const { children } = props2;
|
|
146447
|
-
const classes = useSpanStyles();
|
|
146448
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: classes.span, children });
|
|
146449
|
-
}
|
|
146450
147298
|
const useSelectStyles = makeStyles(() => ({
|
|
146451
147299
|
selectRoot: {
|
|
146452
147300
|
padding: 0,
|
|
146453
147301
|
height: "auto",
|
|
146454
|
-
margin: "4px 0"
|
|
147302
|
+
margin: "4px 0",
|
|
147303
|
+
fontSize: "14px",
|
|
147304
|
+
width: "100%"
|
|
146455
147305
|
}
|
|
146456
147306
|
}));
|
|
146457
|
-
const sharedControllerStyles = {
|
|
146458
|
-
width: "100%",
|
|
146459
|
-
flexDirection: "column"
|
|
146460
|
-
};
|
|
146461
147307
|
const useControllerSectionStyles = makeStyles(() => ({
|
|
146462
147308
|
layerControllerRoot: {
|
|
146463
|
-
|
|
147309
|
+
width: "100%",
|
|
147310
|
+
flexDirection: "column",
|
|
146464
147311
|
padding: "0px 8px"
|
|
147312
|
+
},
|
|
147313
|
+
layerControllerGrid: {
|
|
147314
|
+
marginTop: "10px"
|
|
146465
147315
|
}
|
|
146466
147316
|
}));
|
|
146467
147317
|
const useAccordionStyles = makeStyles((theme) => ({
|
|
146468
147318
|
accordionDetailsRoot: {
|
|
146469
|
-
|
|
147319
|
+
width: "100%",
|
|
147320
|
+
flexDirection: "column",
|
|
146470
147321
|
padding: "8px 8px 24px 8px"
|
|
146471
147322
|
},
|
|
146472
147323
|
accordionSummaryRoot: {
|
|
@@ -146559,6 +147410,11 @@ const useStyles$1 = makeStyles(() => ({
|
|
|
146559
147410
|
paddingRight: "2px"
|
|
146560
147411
|
}
|
|
146561
147412
|
}));
|
|
147413
|
+
function MuiSpan(props2) {
|
|
147414
|
+
const { children } = props2;
|
|
147415
|
+
const classes = useSpanStyles();
|
|
147416
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: classes.span, children });
|
|
147417
|
+
}
|
|
146562
147418
|
function ChannelOptions({ handlePropertyChange, handleChannelRemove, handleIQRUpdate }) {
|
|
146563
147419
|
const [open, setOpen] = useState(false);
|
|
146564
147420
|
const classes = useStyles$1();
|
|
@@ -146603,114 +147459,6 @@ function ChannelOptions({ handlePropertyChange, handleChannelRemove, handleIQRUp
|
|
|
146603
147459
|
}
|
|
146604
147460
|
);
|
|
146605
147461
|
}
|
|
146606
|
-
function getDomains() {
|
|
146607
|
-
const domains = {};
|
|
146608
|
-
const needMin = ["Int8", "Int16", "Int32"];
|
|
146609
|
-
Object.keys(DTYPE_VALUES).forEach((dtype) => {
|
|
146610
|
-
const { max } = DTYPE_VALUES[dtype];
|
|
146611
|
-
const min = needMin.includes(dtype) ? -(max + 1) : 0;
|
|
146612
|
-
domains[dtype] = [min, max];
|
|
146613
|
-
});
|
|
146614
|
-
return domains;
|
|
146615
|
-
}
|
|
146616
|
-
const DOMAINS = getDomains();
|
|
146617
|
-
const toRgbUIString = (on, arr, theme) => {
|
|
146618
|
-
const color = on || theme === "light" && arr.every((i2) => i2 === 255) ? [220, 220, 220] : arr;
|
|
146619
|
-
return `rgb(${color})`;
|
|
146620
|
-
};
|
|
146621
|
-
async function getSingleSelectionStats2D({ loader, selection }) {
|
|
146622
|
-
const data = Array.isArray(loader) ? loader[loader.length - 1] : loader;
|
|
146623
|
-
const raster = await data.getRaster({ selection });
|
|
146624
|
-
const selectionStats = getChannelStats(raster.data);
|
|
146625
|
-
const { domain, contrastLimits: slider } = selectionStats;
|
|
146626
|
-
return { domain, slider };
|
|
146627
|
-
}
|
|
146628
|
-
async function getSingleSelectionStats3D({ loader, selection }) {
|
|
146629
|
-
const lowResSource = loader[loader.length - 1];
|
|
146630
|
-
const { shape: shape2, labels } = lowResSource;
|
|
146631
|
-
const sizeZ = shape2[labels.indexOf("z")] >> loader.length - 1;
|
|
146632
|
-
const raster0 = await lowResSource.getRaster({
|
|
146633
|
-
selection: { ...selection, z: 0 }
|
|
146634
|
-
});
|
|
146635
|
-
const rasterMid = await lowResSource.getRaster({
|
|
146636
|
-
selection: { ...selection, z: Math.floor(sizeZ / 2) }
|
|
146637
|
-
});
|
|
146638
|
-
const rasterTop = await lowResSource.getRaster({
|
|
146639
|
-
selection: { ...selection, z: Math.max(0, sizeZ - 1) }
|
|
146640
|
-
});
|
|
146641
|
-
const stats0 = getChannelStats(raster0.data);
|
|
146642
|
-
const statsMid = getChannelStats(rasterMid.data);
|
|
146643
|
-
const statsTop = getChannelStats(rasterTop.data);
|
|
146644
|
-
return {
|
|
146645
|
-
domain: [
|
|
146646
|
-
Math.min(stats0.domain[0], statsMid.domain[0], statsTop.domain[0]),
|
|
146647
|
-
Math.max(stats0.domain[1], statsMid.domain[1], statsTop.domain[1])
|
|
146648
|
-
],
|
|
146649
|
-
slider: [
|
|
146650
|
-
Math.min(
|
|
146651
|
-
stats0.contrastLimits[0],
|
|
146652
|
-
statsMid.contrastLimits[0],
|
|
146653
|
-
statsTop.contrastLimits[0]
|
|
146654
|
-
),
|
|
146655
|
-
Math.max(
|
|
146656
|
-
stats0.contrastLimits[1],
|
|
146657
|
-
statsMid.contrastLimits[1],
|
|
146658
|
-
statsTop.contrastLimits[1]
|
|
146659
|
-
)
|
|
146660
|
-
]
|
|
146661
|
-
};
|
|
146662
|
-
}
|
|
146663
|
-
const getSingleSelectionStats = async ({ loader, selection, use3d }) => {
|
|
146664
|
-
const getStats = use3d ? getSingleSelectionStats3D : getSingleSelectionStats2D;
|
|
146665
|
-
return getStats({ loader, selection });
|
|
146666
|
-
};
|
|
146667
|
-
const getMultiSelectionStats = async ({ loader, selections, use3d }) => {
|
|
146668
|
-
const stats = await Promise.all(
|
|
146669
|
-
selections.map((selection) => getSingleSelectionStats({ loader, selection, use3d }))
|
|
146670
|
-
);
|
|
146671
|
-
const domains = stats.map((stat) => stat.domain);
|
|
146672
|
-
const sliders = stats.map((stat) => stat.slider);
|
|
146673
|
-
return { domains, sliders };
|
|
146674
|
-
};
|
|
146675
|
-
function getPhysicalSizeScalingMatrix(loader) {
|
|
146676
|
-
var _a2;
|
|
146677
|
-
const { x: x2, y: y2, z: z2 } = ((_a2 = loader == null ? void 0 : loader.meta) == null ? void 0 : _a2.physicalSizes) ?? {};
|
|
146678
|
-
if ((x2 == null ? void 0 : x2.size) && (y2 == null ? void 0 : y2.size) && (z2 == null ? void 0 : z2.size)) {
|
|
146679
|
-
const min = Math.min(z2.size, x2.size, y2.size);
|
|
146680
|
-
const ratio = [x2.size / min, y2.size / min, z2.size / min];
|
|
146681
|
-
return new Matrix4().scale(ratio);
|
|
146682
|
-
}
|
|
146683
|
-
return new Matrix4().identity();
|
|
146684
|
-
}
|
|
146685
|
-
function getBoundingCube(loader) {
|
|
146686
|
-
const source = Array.isArray(loader) ? loader[0] : loader;
|
|
146687
|
-
const { shape: shape2, labels } = source;
|
|
146688
|
-
const physicalSizeScalingMatrix = getPhysicalSizeScalingMatrix(source);
|
|
146689
|
-
const xSlice = [0, physicalSizeScalingMatrix[0] * shape2[labels.indexOf("x")]];
|
|
146690
|
-
const ySlice = [0, physicalSizeScalingMatrix[5] * shape2[labels.indexOf("y")]];
|
|
146691
|
-
const zSlice = [
|
|
146692
|
-
0,
|
|
146693
|
-
physicalSizeScalingMatrix[10] * shape2[labels.indexOf("z")]
|
|
146694
|
-
];
|
|
146695
|
-
return [xSlice, ySlice, zSlice];
|
|
146696
|
-
}
|
|
146697
|
-
function abbreviateNumber$1(value) {
|
|
146698
|
-
const maxLength = 5;
|
|
146699
|
-
let maxNaiveDigits = maxLength;
|
|
146700
|
-
if (!Number.isInteger(value)) {
|
|
146701
|
-
--maxNaiveDigits;
|
|
146702
|
-
}
|
|
146703
|
-
if (value < 1) {
|
|
146704
|
-
--maxNaiveDigits;
|
|
146705
|
-
}
|
|
146706
|
-
const naive = Intl.NumberFormat("en-US", {
|
|
146707
|
-
maximumSignificantDigits: maxNaiveDigits,
|
|
146708
|
-
useGrouping: false
|
|
146709
|
-
}).format(value);
|
|
146710
|
-
if (naive.length <= maxLength)
|
|
146711
|
-
return naive;
|
|
146712
|
-
return value.toExponential(0);
|
|
146713
|
-
}
|
|
146714
147462
|
function ChannelSelectionDropdown({
|
|
146715
147463
|
handleChange,
|
|
146716
147464
|
disabled,
|
|
@@ -146747,23 +147495,6 @@ function ChannelVisibilityCheckbox({
|
|
|
146747
147495
|
}
|
|
146748
147496
|
);
|
|
146749
147497
|
}
|
|
146750
|
-
function abbreviateNumber(value) {
|
|
146751
|
-
const maxLength = 5;
|
|
146752
|
-
let maxNaiveDigits = maxLength;
|
|
146753
|
-
if (!Number.isInteger(value)) {
|
|
146754
|
-
--maxNaiveDigits;
|
|
146755
|
-
}
|
|
146756
|
-
if (value < 1) {
|
|
146757
|
-
--maxNaiveDigits;
|
|
146758
|
-
}
|
|
146759
|
-
const naive = Intl.NumberFormat("en-US", {
|
|
146760
|
-
maximumSignificantDigits: maxNaiveDigits,
|
|
146761
|
-
useGrouping: false
|
|
146762
|
-
}).format(value);
|
|
146763
|
-
if (naive.length <= maxLength)
|
|
146764
|
-
return naive;
|
|
146765
|
-
return value.toExponential(0);
|
|
146766
|
-
}
|
|
146767
147498
|
function ChannelSlider({
|
|
146768
147499
|
color,
|
|
146769
147500
|
slider = [0, 0],
|
|
@@ -147472,7 +148203,7 @@ const Slicer = ({
|
|
|
147472
148203
|
value: val,
|
|
147473
148204
|
onChange: (e2, v) => setVal(v),
|
|
147474
148205
|
valueLabelDisplay: "auto",
|
|
147475
|
-
valueLabelFormat: (v) => abbreviateNumber
|
|
148206
|
+
valueLabelFormat: (v) => abbreviateNumber(v),
|
|
147476
148207
|
"aria-label": `Volume options ${label} slider`,
|
|
147477
148208
|
min,
|
|
147478
148209
|
max,
|
|
@@ -147966,7 +148697,7 @@ function LayerController(props2) {
|
|
|
147966
148697
|
isRgb(loader, channels2) && disableChannelsIfRgbDetected ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
147967
148698
|
Button$1,
|
|
147968
148699
|
{
|
|
147969
|
-
disabled: channels2.length === MAX_CHANNELS,
|
|
148700
|
+
disabled: channels2.length === MAX_CHANNELS$1,
|
|
147970
148701
|
onClick: handleChannelAdd,
|
|
147971
148702
|
fullWidth: true,
|
|
147972
148703
|
variant: "outlined",
|
|
@@ -148593,5 +149324,12 @@ export {
|
|
|
148593
149324
|
LayerControllerSubscriber as L,
|
|
148594
149325
|
VectorLayerController as V,
|
|
148595
149326
|
LayerController as a,
|
|
148596
|
-
|
|
149327
|
+
useSelectStyles as b,
|
|
149328
|
+
useControllerSectionStyles as c,
|
|
149329
|
+
useAccordionStyles as d,
|
|
149330
|
+
useInputLabelStyles as e,
|
|
149331
|
+
useOverflowEllipsisGridStyles as f,
|
|
149332
|
+
getDefaultExportFromCjs as g,
|
|
149333
|
+
useSelectionSliderStyles as h,
|
|
149334
|
+
useSpanStyles as u
|
|
148597
149335
|
};
|