@vitessce/layer-controller 2.0.3-beta.0 → 3.0.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-75511377.js +13 -0
- package/dist/index-841a1af6.js +148439 -0
- package/dist/index.js +9 -3
- package/dist/jpeg-6023316d.js +840 -0
- package/dist/lerc-82182c45.js +2014 -0
- package/dist/lzw-2ab01db2.js +128 -0
- package/dist/packbits-2633f360.js +30 -0
- package/dist/pako.esm-68f84e2a.js +4022 -0
- package/dist/raw-51e455c7.js +12 -0
- package/dist/webimage-bbb56d18.js +32 -0
- package/dist-tsc/BitmaskChannelController.d.ts +21 -0
- package/dist-tsc/BitmaskChannelController.d.ts.map +1 -0
- package/{dist → dist-tsc}/BitmaskChannelController.js +3 -4
- package/dist-tsc/ChannelOptions.d.ts +13 -0
- package/dist-tsc/ChannelOptions.d.ts.map +1 -0
- package/{dist → dist-tsc}/ChannelOptions.js +4 -5
- package/dist-tsc/ColorPalette.d.ts +5 -0
- package/dist-tsc/ColorPalette.d.ts.map +1 -0
- package/{dist → dist-tsc}/ColorPalette.js +2 -3
- package/dist-tsc/ImageAddButton.d.ts +6 -0
- package/dist-tsc/ImageAddButton.d.ts.map +1 -0
- package/{dist → dist-tsc}/ImageAddButton.js +2 -3
- package/dist-tsc/LayerController.d.ts +10 -0
- package/dist-tsc/LayerController.d.ts.map +1 -0
- package/{dist → dist-tsc}/LayerController.js +7 -15
- package/dist-tsc/LayerControllerSubscriber.d.ts +27 -0
- package/dist-tsc/LayerControllerSubscriber.d.ts.map +1 -0
- package/{dist → dist-tsc}/LayerControllerSubscriber.js +7 -10
- package/dist-tsc/LayerOptions.d.ts +46 -0
- package/dist-tsc/LayerOptions.d.ts.map +1 -0
- package/{dist → dist-tsc}/LayerOptions.js +4 -8
- package/dist-tsc/RasterChannelController.d.ts +35 -0
- package/dist-tsc/RasterChannelController.d.ts.map +1 -0
- package/{dist → dist-tsc}/RasterChannelController.js +7 -17
- package/dist-tsc/RasterChannelController.test.d.ts +2 -0
- package/dist-tsc/RasterChannelController.test.d.ts.map +1 -0
- package/{dist → dist-tsc}/RasterChannelController.test.js +1 -1
- package/dist-tsc/VectorLayerController.d.ts +2 -0
- package/dist-tsc/VectorLayerController.d.ts.map +1 -0
- package/{dist → dist-tsc}/VectorLayerController.js +2 -6
- package/dist-tsc/VolumeOptions.d.ts +16 -0
- package/dist-tsc/VolumeOptions.d.ts.map +1 -0
- package/{dist → dist-tsc}/VolumeOptions.js +3 -10
- package/dist-tsc/constants.d.ts +2 -0
- package/dist-tsc/constants.d.ts.map +1 -0
- package/dist-tsc/index.d.ts +4 -0
- package/dist-tsc/index.d.ts.map +1 -0
- package/dist-tsc/index.js +3 -0
- package/dist-tsc/shared-channel-controls.d.ts +27 -0
- package/dist-tsc/shared-channel-controls.d.ts.map +1 -0
- package/{dist → dist-tsc}/shared-channel-controls.js +2 -3
- package/dist-tsc/styles.d.ts +76 -0
- package/dist-tsc/styles.d.ts.map +1 -0
- package/{dist → dist-tsc}/styles.js +1 -6
- package/dist-tsc/utils.d.ts +24 -0
- package/dist-tsc/utils.d.ts.map +1 -0
- package/{dist → dist-tsc}/utils.js +8 -0
- package/package.json +20 -11
- package/src/BitmaskChannelController.js +62 -0
- package/src/ChannelOptions.js +61 -0
- package/src/ColorPalette.js +48 -0
- package/src/ImageAddButton.js +50 -0
- package/src/LayerController.js +596 -0
- package/src/LayerControllerSubscriber.js +501 -0
- package/src/LayerOptions.js +459 -0
- package/src/RasterChannelController.js +245 -0
- package/src/RasterChannelController.test.js +23 -0
- package/src/VectorLayerController.js +61 -0
- package/src/VolumeOptions.js +221 -0
- package/src/constants.js +14 -0
- package/src/index.js +3 -0
- package/src/shared-channel-controls.js +54 -0
- package/src/styles.js +116 -0
- package/src/utils.js +138 -0
- /package/{dist → dist-tsc}/constants.js +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { B as BaseDecoder } from "./index-841a1af6.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "@vitessce/vit-s";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
class WebImageDecoder extends BaseDecoder {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
if (typeof createImageBitmap === "undefined") {
|
|
9
|
+
throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");
|
|
10
|
+
} else if (typeof document === "undefined" && typeof OffscreenCanvas === "undefined") {
|
|
11
|
+
throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async decode(fileDirectory, buffer) {
|
|
15
|
+
const blob = new Blob([buffer]);
|
|
16
|
+
const imageBitmap = await createImageBitmap(blob);
|
|
17
|
+
let canvas;
|
|
18
|
+
if (typeof document !== "undefined") {
|
|
19
|
+
canvas = document.createElement("canvas");
|
|
20
|
+
canvas.width = imageBitmap.width;
|
|
21
|
+
canvas.height = imageBitmap.height;
|
|
22
|
+
} else {
|
|
23
|
+
canvas = new OffscreenCanvas(imageBitmap.width, imageBitmap.height);
|
|
24
|
+
}
|
|
25
|
+
const ctx = canvas.getContext("2d");
|
|
26
|
+
ctx.drawImage(imageBitmap, 0, 0);
|
|
27
|
+
return ctx.getImageData(0, 0, imageBitmap.width, imageBitmap.height).data.buffer;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
WebImageDecoder as default
|
|
32
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default BitmaskChannelController;
|
|
2
|
+
/**
|
|
3
|
+
* Controller for the handling the bitmask channels.
|
|
4
|
+
* @prop {boolean} visibility Whether or not this channel is "on"
|
|
5
|
+
* @prop {string} dimName Name of the dimensions this slider controls (usually "channel").
|
|
6
|
+
* @prop {object} channelOptions All available options for this dimension (i.e channel names).
|
|
7
|
+
* @prop {function} handlePropertyChange Callback for when a property (color, slider etc.) changes.
|
|
8
|
+
* @prop {function} handleChannelRemove When a channel is removed, this is called.
|
|
9
|
+
* @prop {number} selectionIndex The current numeric index of the selection.
|
|
10
|
+
* @prop {boolean} disableOptions Whether or not channel options are be disabled (default: false).
|
|
11
|
+
*/
|
|
12
|
+
declare function BitmaskChannelController({ visibility, dimName, channelOptions, handlePropertyChange, handleChannelRemove, selectionIndex, disableOptions, }: {
|
|
13
|
+
visibility?: boolean | undefined;
|
|
14
|
+
dimName: any;
|
|
15
|
+
channelOptions: any;
|
|
16
|
+
handlePropertyChange: any;
|
|
17
|
+
handleChannelRemove: any;
|
|
18
|
+
selectionIndex: any;
|
|
19
|
+
disableOptions?: boolean | undefined;
|
|
20
|
+
}): JSX.Element;
|
|
21
|
+
//# sourceMappingURL=BitmaskChannelController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BitmaskChannelController.d.ts","sourceRoot":"","sources":["../src/BitmaskChannelController.js"],"names":[],"mappings":";AAKA;;;;;;;;;GASG;AACH;;;;;;;;gBA4CC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import RemoveCircleIcon from '@material-ui/icons
|
|
4
|
-
import IconButton from '@material-ui/core
|
|
5
|
-
import
|
|
6
|
-
import { ChannelSelectionDropdown, ChannelVisibilityCheckbox } from './shared-channel-controls';
|
|
3
|
+
import { RemoveCircle as RemoveCircleIcon } from '@material-ui/icons';
|
|
4
|
+
import { IconButton, Grid } from '@material-ui/core';
|
|
5
|
+
import { ChannelSelectionDropdown, ChannelVisibilityCheckbox } from './shared-channel-controls.js';
|
|
7
6
|
/**
|
|
8
7
|
* Controller for the handling the bitmask channels.
|
|
9
8
|
* @prop {boolean} visibility Whether or not this channel is "on"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default ChannelOptions;
|
|
2
|
+
/**
|
|
3
|
+
* Dropdown for options for a channel on the three dots button.
|
|
4
|
+
* @prop {function} handlePropertyChange Callback for changing property (color, IQR of sliders).
|
|
5
|
+
* @prop {function} handleChannelRemove Callback for channel removal.
|
|
6
|
+
* @prop {function} handleIQRUpdate Callback for IQR slider update.
|
|
7
|
+
*/
|
|
8
|
+
declare function ChannelOptions({ handlePropertyChange, handleChannelRemove, handleIQRUpdate }: {
|
|
9
|
+
handlePropertyChange: any;
|
|
10
|
+
handleChannelRemove: any;
|
|
11
|
+
handleIQRUpdate: any;
|
|
12
|
+
}): JSX.Element;
|
|
13
|
+
//# sourceMappingURL=ChannelOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelOptions.d.ts","sourceRoot":"","sources":["../src/ChannelOptions.js"],"names":[],"mappings":";AAoBA;;;;;GAKG;AACH;;;;gBAgCC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
-
import { makeStyles } from '@material-ui/core
|
|
4
|
-
import MoreVertIcon from '@material-ui/icons
|
|
5
|
-
import MenuItem from '@material-ui/core/MenuItem';
|
|
3
|
+
import { makeStyles, MenuItem } from '@material-ui/core';
|
|
4
|
+
import { MoreVert as MoreVertIcon } from '@material-ui/icons';
|
|
6
5
|
import { PopperMenu } from '@vitessce/vit-s';
|
|
7
|
-
import { MuiSpan } from './styles';
|
|
8
|
-
import ColorPalette from './ColorPalette';
|
|
6
|
+
import { MuiSpan } from './styles.js';
|
|
7
|
+
import ColorPalette from './ColorPalette.js';
|
|
9
8
|
const useStyles = makeStyles(() => ({
|
|
10
9
|
menuButton: {
|
|
11
10
|
backgroundColor: 'transparent',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPalette.d.ts","sourceRoot":"","sources":["../src/ColorPalette.js"],"names":[],"mappings":";AA0BA;;gBAmBC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import IconButton from '@material-ui/core
|
|
4
|
-
import LensIcon from '@material-ui/icons
|
|
5
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
3
|
+
import { IconButton, makeStyles } from '@material-ui/core';
|
|
4
|
+
import { Lens as LensIcon } from '@material-ui/icons';
|
|
6
5
|
import { VIEWER_PALETTE } from '@vitessce/utils';
|
|
7
6
|
const useStyles = makeStyles(theme => ({
|
|
8
7
|
container: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageAddButton.d.ts","sourceRoot":"","sources":["../src/ImageAddButton.js"],"names":[],"mappings":";AAsBA;;;uBAyBC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
-
import { makeStyles } from '@material-ui/core
|
|
4
|
-
import AddIcon from '@material-ui/icons
|
|
5
|
-
import MenuItem from '@material-ui/core/MenuItem';
|
|
3
|
+
import { makeStyles, MenuItem } from '@material-ui/core';
|
|
4
|
+
import { Add as AddIcon } from '@material-ui/icons';
|
|
6
5
|
import { PopperMenu } from '@vitessce/vit-s';
|
|
7
6
|
const useStyles = makeStyles(() => ({
|
|
8
7
|
addButton: {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Controller for the various imaging options (color, opactiy, sliders etc.)
|
|
3
|
+
* @prop {object} imageData Image config object, one of the `images` in the raster schema.
|
|
4
|
+
* @prop {object} layerId Randomly generated id for the image layer that this controller handles.
|
|
5
|
+
* @prop {function} handleLayerRemove Callback for handling the removal of a layer.
|
|
6
|
+
* @prop {object} loader Loader object for the current imaging layer.
|
|
7
|
+
* @prop {function} handleLayerChange Callback for handling the changing of layer properties.
|
|
8
|
+
*/
|
|
9
|
+
export default function LayerController(props: any): JSX.Element;
|
|
10
|
+
//# sourceMappingURL=LayerController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayerController.d.ts","sourceRoot":"","sources":["../src/LayerController.js"],"names":[],"mappings":"AAyEA;;;;;;;GAOG;AACH,iEAkgBC"}
|
|
@@ -2,22 +2,14 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import React, { useState, useRef, useEffect } from 'react';
|
|
3
3
|
import { viv } from '@vitessce/gl';
|
|
4
4
|
import { GLOBAL_LABELS, getSourceFromLoader, isRgb, } from '@vitessce/spatial-utils';
|
|
5
|
-
import Grid from '@material-ui/core
|
|
6
|
-
import
|
|
7
|
-
import AddIcon from '@material-ui/icons/Add';
|
|
8
|
-
import Slider from '@material-ui/core/Slider';
|
|
9
|
-
import Tabs from '@material-ui/core/Tabs';
|
|
10
|
-
import Tab from '@material-ui/core/Tab';
|
|
11
|
-
import Accordion from '@material-ui/core/Accordion';
|
|
12
|
-
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
|
|
13
|
-
import VisibilityIcon from '@material-ui/icons/Visibility';
|
|
14
|
-
import VisibilityOffIcon from '@material-ui/icons/VisibilityOff';
|
|
5
|
+
import { Grid, Button, Slider, Tabs, Tab, Accordion } from '@material-ui/core';
|
|
6
|
+
import { Add as AddIcon, ExpandMore as ExpandMoreIcon, Visibility as VisibilityIcon, VisibilityOff as VisibilityOffIcon, } from '@material-ui/icons';
|
|
15
7
|
import { canLoadResolution } from '@vitessce/utils';
|
|
16
|
-
import LayerOptions from './LayerOptions';
|
|
17
|
-
import VolumeOptions from './VolumeOptions';
|
|
18
|
-
import { useControllerSectionStyles, StyledAccordionDetails, StyledAccordionSummary, StyledInputLabel, OverflowEllipsisGrid, } from './styles';
|
|
19
|
-
import { getMultiSelectionStats } from './utils';
|
|
20
|
-
import { DOMAINS } from './constants';
|
|
8
|
+
import LayerOptions from './LayerOptions.js';
|
|
9
|
+
import VolumeOptions from './VolumeOptions.js';
|
|
10
|
+
import { useControllerSectionStyles, StyledAccordionDetails, StyledAccordionSummary, StyledInputLabel, OverflowEllipsisGrid, } from './styles.js';
|
|
11
|
+
import { getMultiSelectionStats } from './utils.js';
|
|
12
|
+
import { DOMAINS } from './constants.js';
|
|
21
13
|
function TabPanel(props) {
|
|
22
14
|
const { children, value, index, ...other } = props;
|
|
23
15
|
return (_jsx("div", { role: "tabpanel", hidden: value !== index, id: `simple-tabpanel-${index}`, "aria-labelledby": `simple-tab-${index}`, ...other, children: value === index && children }));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A subscriber component for the spatial layer controller.
|
|
3
|
+
* @param {object} props
|
|
4
|
+
* @param {string} props.theme The current theme name.
|
|
5
|
+
* @param {object} props.coordinationScopes The mapping from coordination types to coordination
|
|
6
|
+
* scopes.
|
|
7
|
+
* @param {function} props.removeGridComponent The callback function to pass to TitleInfo,
|
|
8
|
+
* to call when the component has been removed from the grid.
|
|
9
|
+
* @param {string} props.title The component title.
|
|
10
|
+
* @param {Object} props.disable3d Which layers should have 3D disabled (from `raster.json` names).
|
|
11
|
+
* @param {boolean} props.globalDisable3d Disable 3D for all layers. Overrides the `disable3d` prop.
|
|
12
|
+
* @param {boolean} props.disableChannelsIfRgbDetected Disable channel controls if an
|
|
13
|
+
* RGB image is detected i.e 3 channel 8 bit.
|
|
14
|
+
* @param {boolean} props.enableLayerButtonsWithOneLayer If there is only one layer,
|
|
15
|
+
* show the the layer add/remove buttons.
|
|
16
|
+
*/
|
|
17
|
+
export function LayerControllerSubscriber(props: {
|
|
18
|
+
theme: string;
|
|
19
|
+
coordinationScopes: object;
|
|
20
|
+
removeGridComponent: Function;
|
|
21
|
+
title: string;
|
|
22
|
+
disable3d: Object;
|
|
23
|
+
globalDisable3d: boolean;
|
|
24
|
+
disableChannelsIfRgbDetected: boolean;
|
|
25
|
+
enableLayerButtonsWithOneLayer: boolean;
|
|
26
|
+
}): JSX.Element;
|
|
27
|
+
//# sourceMappingURL=LayerControllerSubscriber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayerControllerSubscriber.d.ts","sourceRoot":"","sources":["../src/LayerControllerSubscriber.js"],"names":[],"mappings":"AAiSA;;;;;;;;;;;;;;;GAeG;AACH;IAbyB,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;IAEU,mBAAmB;IAErB,KAAK,EAAnB,MAAM;IACQ,SAAS,EAAvB,MAAM;IACS,eAAe,EAA9B,OAAO;IACQ,4BAA4B,EAA3C,OAAO;IAEQ,8BAA8B,EAA7C,OAAO;gBAsMjB"}
|
|
@@ -2,16 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
/* eslint-disable dot-notation */
|
|
3
3
|
/* eslint-disable no-unused-vars */
|
|
4
4
|
import React, { useCallback, useRef, forwardRef, } from 'react';
|
|
5
|
-
import Grid from '@material-ui/core
|
|
6
|
-
import { TitleInfo, useReady, useClosestVitessceContainerSize, useWindowDimensions, useImageData, useObsLocationsData, useObsSegmentationsData, useCoordination, useLoaders, useAuxiliaryCoordination, useComponentLayout,
|
|
5
|
+
import { Grid } from '@material-ui/core';
|
|
6
|
+
import { TitleInfo, useReady, useClosestVitessceContainerSize, useWindowDimensions, useImageData, useObsLocationsData, useObsSegmentationsData, useCoordination, useLoaders, useAuxiliaryCoordination, useComponentLayout, } from '@vitessce/vit-s';
|
|
7
7
|
import { ViewType, COMPONENT_COORDINATION_TYPES } from '@vitessce/constants-internal';
|
|
8
8
|
import { capitalize } from '@vitessce/utils';
|
|
9
9
|
import { initializeLayerChannels, DEFAULT_RASTER_LAYER_PROPS } from '@vitessce/spatial-utils';
|
|
10
|
-
import RasterChannelController from './RasterChannelController';
|
|
11
|
-
import BitmaskChannelController from './BitmaskChannelController';
|
|
12
|
-
import VectorLayerController from './VectorLayerController';
|
|
13
|
-
import LayerController from './LayerController';
|
|
14
|
-
import ImageAddButton from './ImageAddButton';
|
|
10
|
+
import RasterChannelController from './RasterChannelController.js';
|
|
11
|
+
import BitmaskChannelController from './BitmaskChannelController.js';
|
|
12
|
+
import VectorLayerController from './VectorLayerController.js';
|
|
13
|
+
import LayerController from './LayerController.js';
|
|
14
|
+
import ImageAddButton from './ImageAddButton.js';
|
|
15
15
|
// LayerController is memoized to prevent updates from prop changes that
|
|
16
16
|
// are caused by view state updates i.e zooming and panning within
|
|
17
17
|
// the actual Spatial component. Re-rendering this component is very
|
|
@@ -192,6 +192,3 @@ export function LayerControllerSubscriber(props) {
|
|
|
192
192
|
// Fall back to window for height and width.
|
|
193
193
|
componentHeight: componentHeight || windowHeight, componentWidth: componentWidth || windowWidth, spatialLayout: spatialLayout, handleImageAdd: handleImageAdd }));
|
|
194
194
|
}
|
|
195
|
-
export function register() {
|
|
196
|
-
registerPluginViewType(ViewType.LAYER_CONTROLLER, LayerControllerSubscriber, COMPONENT_COORDINATION_TYPES[ViewType.LAYER_CONTROLLER]);
|
|
197
|
-
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export default LayerOptions;
|
|
2
|
+
/**
|
|
3
|
+
* Gloabl options for all channels (opacity, colormap, etc.).
|
|
4
|
+
* @prop {string} colormap What colormap is currently selected (None, viridis etc.).
|
|
5
|
+
* @prop {number} opacity Current opacity value.
|
|
6
|
+
* @prop {function} handleColormapChange Callback for when colormap changes.
|
|
7
|
+
* @prop {function} handleOpacityChange Callback for when opacity changes.
|
|
8
|
+
* @prop {object} globalControlLabels All available options for global control (z and t).
|
|
9
|
+
* @prop {function} handleGlobalChannelsSelectionChange Callback for global selection changes.
|
|
10
|
+
* @prop {function} handleDomainChange Callback for domain type changes (full or min/max).
|
|
11
|
+
* @prop {array} channels Current channel object for inferring the current global selection.
|
|
12
|
+
* @prop {array} dimensions Currently available dimensions (channel, z, t etc.).
|
|
13
|
+
* @prop {string} domainType One of Max/Min or Full (soon presets as well).
|
|
14
|
+
* @prop {boolean} disableChannelsIfRgbDetected Whether or not we need colormap controllers if RGB.
|
|
15
|
+
*/
|
|
16
|
+
declare function LayerOptions({ colormap, opacity, handleColormapChange, handleOpacityChange, handleTransparentColorChange, globalControlLabels, globalLabelValues, handleGlobalChannelsSelectionChange, handleSliderChange, handleDomainChange, transparentColor, channels, domainType, disableChannelsIfRgbDetected, shouldShowTransparentColor, shouldShowDomain, shouldShowColormap, use3d, loader, handleMultiPropertyChange, resolution, disable3d, setRasterLayerCallback, setAreAllChannelsLoading, setViewState, spatialHeight, spatialWidth, modelMatrix, }: {
|
|
17
|
+
colormap: any;
|
|
18
|
+
opacity: any;
|
|
19
|
+
handleColormapChange: any;
|
|
20
|
+
handleOpacityChange: any;
|
|
21
|
+
handleTransparentColorChange: any;
|
|
22
|
+
globalControlLabels: any;
|
|
23
|
+
globalLabelValues: any;
|
|
24
|
+
handleGlobalChannelsSelectionChange: any;
|
|
25
|
+
handleSliderChange: any;
|
|
26
|
+
handleDomainChange: any;
|
|
27
|
+
transparentColor: any;
|
|
28
|
+
channels: any;
|
|
29
|
+
domainType: any;
|
|
30
|
+
disableChannelsIfRgbDetected: any;
|
|
31
|
+
shouldShowTransparentColor: any;
|
|
32
|
+
shouldShowDomain: any;
|
|
33
|
+
shouldShowColormap: any;
|
|
34
|
+
use3d: any;
|
|
35
|
+
loader: any;
|
|
36
|
+
handleMultiPropertyChange: any;
|
|
37
|
+
resolution: any;
|
|
38
|
+
disable3d: any;
|
|
39
|
+
setRasterLayerCallback: any;
|
|
40
|
+
setAreAllChannelsLoading: any;
|
|
41
|
+
setViewState: any;
|
|
42
|
+
spatialHeight: any;
|
|
43
|
+
spatialWidth: any;
|
|
44
|
+
modelMatrix: any;
|
|
45
|
+
}): JSX.Element;
|
|
46
|
+
//# sourceMappingURL=LayerOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayerOptions.d.ts","sourceRoot":"","sources":["../src/LayerOptions.js"],"names":[],"mappings":";AA8TA;;;;;;;;;;;;;GAaG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA4HC"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import range from 'lodash
|
|
3
|
+
import { range } from 'lodash-es';
|
|
4
4
|
import { Matrix4 } from 'math.gl';
|
|
5
|
-
import Grid from '@material-ui/core
|
|
6
|
-
import Slider from '@material-ui/core/Slider';
|
|
7
|
-
import InputLabel from '@material-ui/core/InputLabel';
|
|
8
|
-
import Select from '@material-ui/core/Select';
|
|
9
|
-
import Checkbox from '@material-ui/core/Checkbox';
|
|
5
|
+
import { Grid, Slider, InputLabel, Select, Checkbox } from '@material-ui/core';
|
|
10
6
|
import { viv } from '@vitessce/gl';
|
|
11
7
|
import { DEFAULT_RASTER_DOMAIN_TYPE } from '@vitessce/spatial-utils';
|
|
12
8
|
import { COLORMAP_OPTIONS, canLoadResolution, formatBytes, getStatsForResolution, } from '@vitessce/utils';
|
|
13
|
-
import { getBoundingCube, getMultiSelectionStats, } from './utils';
|
|
14
|
-
import { StyledSelectionSlider, useSelectStyles } from './styles';
|
|
9
|
+
import { getBoundingCube, getMultiSelectionStats, } from './utils.js';
|
|
10
|
+
import { StyledSelectionSlider, useSelectStyles } from './styles.js';
|
|
15
11
|
const DOMAIN_OPTIONS = ['Full', 'Min/Max'];
|
|
16
12
|
/**
|
|
17
13
|
* Wrapper for the dropdown that selects a colormap (None, viridis, magma, etc.).
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export default RasterChannelController;
|
|
2
|
+
/**
|
|
3
|
+
* Controller for the handling the colormapping sliders.
|
|
4
|
+
* @prop {boolean} visibility Whether or not this channel is "on"
|
|
5
|
+
* @prop {array} slider Current slider range.
|
|
6
|
+
* @prop {array} color Current color for this channel.
|
|
7
|
+
* @prop {array} domain Current max/min for this channel.
|
|
8
|
+
* @prop {string} dimName Name of the dimensions this slider controls (usually "channel").
|
|
9
|
+
* @prop {boolean} colormapOn Whether or not the colormap (viridis, magma etc.) is on.
|
|
10
|
+
* @prop {object} channelOptions All available options for this dimension (i.e channel names).
|
|
11
|
+
* @prop {function} handlePropertyChange Callback for when a property (color, slider etc.) changes.
|
|
12
|
+
* @prop {function} handleChannelRemove When a channel is removed, this is called.
|
|
13
|
+
* @prop {function} handleIQRUpdate When the IQR button is clicked, this is called.
|
|
14
|
+
* @prop {number} selectionIndex The current numeric index of the selection.
|
|
15
|
+
*/
|
|
16
|
+
declare function RasterChannelController({ visibility, slider, color, channels, channelId, domainType: newDomainType, dimName, theme, loader, colormapOn, channelOptions, handlePropertyChange, handleChannelRemove, handleIQRUpdate, selectionIndex, isLoading, use3d: newUse3d, }: {
|
|
17
|
+
visibility?: boolean | undefined;
|
|
18
|
+
slider: any;
|
|
19
|
+
color: any;
|
|
20
|
+
channels: any;
|
|
21
|
+
channelId: any;
|
|
22
|
+
domainType: any;
|
|
23
|
+
dimName: any;
|
|
24
|
+
theme: any;
|
|
25
|
+
loader: any;
|
|
26
|
+
colormapOn: any;
|
|
27
|
+
channelOptions: any;
|
|
28
|
+
handlePropertyChange: any;
|
|
29
|
+
handleChannelRemove: any;
|
|
30
|
+
handleIQRUpdate: any;
|
|
31
|
+
selectionIndex: any;
|
|
32
|
+
isLoading: any;
|
|
33
|
+
use3d: any;
|
|
34
|
+
}): JSX.Element;
|
|
35
|
+
//# sourceMappingURL=RasterChannelController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RasterChannelController.d.ts","sourceRoot":"","sources":["../src/RasterChannelController.js"],"names":[],"mappings":";AAqFA;;;;;;;;;;;;;GAaG;AACH;;;;;;;;;;;;;;;;;;gBA+IC"}
|
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useState, useEffect } from 'react';
|
|
3
|
-
import Grid from '@material-ui/core
|
|
4
|
-
import
|
|
5
|
-
import debounce from 'lodash/debounce';
|
|
6
|
-
import isEqual from 'lodash/isEqual';
|
|
3
|
+
import { Grid, Slider } from '@material-ui/core';
|
|
4
|
+
import { debounce, isEqual } from 'lodash-es';
|
|
7
5
|
import { getSourceFromLoader } from '@vitessce/spatial-utils';
|
|
8
|
-
import ChannelOptions from './ChannelOptions';
|
|
9
|
-
import { DOMAINS } from './constants';
|
|
10
|
-
import { getMultiSelectionStats } from './utils';
|
|
11
|
-
import { ChannelSelectionDropdown, ChannelVisibilityCheckbox, } from './shared-channel-controls';
|
|
12
|
-
// Returns an rgb string for display, and changes the color (arr)
|
|
13
|
-
// to use a grey for light theme + white color or if the colormap is on.
|
|
14
|
-
export const toRgbUIString = (on, arr, theme) => {
|
|
15
|
-
const color = on || (theme === 'light' && arr.every(i => i === 255))
|
|
16
|
-
? [220, 220, 220]
|
|
17
|
-
: arr;
|
|
18
|
-
return `rgb(${color})`;
|
|
19
|
-
};
|
|
6
|
+
import ChannelOptions from './ChannelOptions.js';
|
|
7
|
+
import { DOMAINS } from './constants.js';
|
|
8
|
+
import { getMultiSelectionStats, toRgbUIString } from './utils.js';
|
|
9
|
+
import { ChannelSelectionDropdown, ChannelVisibilityCheckbox, } from './shared-channel-controls.js';
|
|
20
10
|
function abbreviateNumber(value) {
|
|
21
11
|
// Return an abbreviated representation of value, in 5 characters or less.
|
|
22
12
|
const maxLength = 5;
|
|
@@ -56,7 +46,7 @@ function ChannelSlider({ color, slider = [0, 0], handleChange, domain = [0, 0],
|
|
|
56
46
|
sliderCopy[1] = max;
|
|
57
47
|
}
|
|
58
48
|
const handleChangeDebounced = useCallback(debounce(handleChange, 3, { trailing: true }), [handleChange]);
|
|
59
|
-
const step = max - min < 500 && dtype
|
|
49
|
+
const step = max - min < 500 && dtype.startsWith('Float') ? (max - min) / 500 : 1;
|
|
60
50
|
return (_jsx(Slider, { value: slider, valueLabelFormat: abbreviateNumber, onChange: (e, v) => handleChangeDebounced(v), valueLabelDisplay: "auto", getAriaLabel: () => `${color}-${slider}`, min: min, max: max, step: step, orientation: "horizontal", style: { color, marginTop: '7px' }, disabled: disabled }));
|
|
61
51
|
}
|
|
62
52
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RasterChannelController.test.d.ts","sourceRoot":"","sources":["../src/RasterChannelController.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VectorLayerController.d.ts","sourceRoot":"","sources":["../src/VectorLayerController.js"],"names":[],"mappings":"AAKA,uEAuDC"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import Grid from '@material-ui/core
|
|
4
|
-
import
|
|
5
|
-
import Paper from '@material-ui/core/Paper';
|
|
6
|
-
import Typography from '@material-ui/core/Typography';
|
|
7
|
-
import Slider from '@material-ui/core/Slider';
|
|
8
|
-
import { useControllerSectionStyles } from './styles';
|
|
3
|
+
import { Grid, Checkbox, Paper, Typography, Slider } from '@material-ui/core';
|
|
4
|
+
import { useControllerSectionStyles } from './styles.js';
|
|
9
5
|
export default function VectorLayerController(props) {
|
|
10
6
|
const { label, layer, layerType, handleLayerChange, } = props;
|
|
11
7
|
const slider = layer.opacity;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default VolumeOptions;
|
|
2
|
+
declare function VolumeOptions({ handleSlicerSetting, handleRenderingModeChange, renderingMode, xSlice, ySlice, zSlice, use3d, loader, setViewState, spatialHeight, spatialWidth, modelMatrix, }: {
|
|
3
|
+
handleSlicerSetting: any;
|
|
4
|
+
handleRenderingModeChange: any;
|
|
5
|
+
renderingMode: any;
|
|
6
|
+
xSlice: any;
|
|
7
|
+
ySlice: any;
|
|
8
|
+
zSlice: any;
|
|
9
|
+
use3d: any;
|
|
10
|
+
loader: any;
|
|
11
|
+
setViewState: any;
|
|
12
|
+
spatialHeight: any;
|
|
13
|
+
spatialWidth: any;
|
|
14
|
+
modelMatrix: any;
|
|
15
|
+
}): JSX.Element;
|
|
16
|
+
//# sourceMappingURL=VolumeOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VolumeOptions.d.ts","sourceRoot":"","sources":["../src/VolumeOptions.js"],"names":[],"mappings":";AAqLA;;;;;;;;;;;;;gBAqCC"}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Matrix4 } from 'math.gl';
|
|
4
|
-
import Grid from '@material-ui/core
|
|
5
|
-
import Typography from '@material-ui/core/Typography';
|
|
6
|
-
import Button from '@material-ui/core/Button';
|
|
7
|
-
import { makeStyles, createStyles } from '@material-ui/core/styles';
|
|
8
|
-
import FormControl from '@material-ui/core/FormControl';
|
|
9
|
-
import Select from '@material-ui/core/Select';
|
|
10
|
-
import InputLabel from '@material-ui/core/InputLabel';
|
|
11
|
-
import Slider from '@material-ui/core/Slider';
|
|
4
|
+
import { Grid, Typography, Button, makeStyles, createStyles, FormControl, Select, InputLabel, Slider, } from '@material-ui/core';
|
|
12
5
|
import { viv } from '@vitessce/gl';
|
|
13
|
-
import { abbreviateNumber, getBoundingCube } from './utils';
|
|
14
|
-
import { useSelectStyles } from './styles';
|
|
6
|
+
import { abbreviateNumber, getBoundingCube } from './utils.js';
|
|
7
|
+
import { useSelectStyles } from './styles.js';
|
|
15
8
|
const useSlicerStyles = makeStyles(theme => createStyles({
|
|
16
9
|
enabled: {},
|
|
17
10
|
disabled: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.js"],"names":[],"mappings":"AAaA,yBAAoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dropdown for selecting a channel.
|
|
3
|
+
* @prop {function} handleChange Callback for each new selection.
|
|
4
|
+
* @prop {array} channelOptions List of available selections, like ['DAPI', 'FITC', ...].
|
|
5
|
+
* @prop {boolean} disabled Whether or not the component is disabled.
|
|
6
|
+
* @prop {number} selectionIndex Current numeric index of a selection.
|
|
7
|
+
*/
|
|
8
|
+
export function ChannelSelectionDropdown({ handleChange, disabled, channelOptions, selectionIndex, }: {
|
|
9
|
+
handleChange: any;
|
|
10
|
+
disabled: any;
|
|
11
|
+
channelOptions: any;
|
|
12
|
+
selectionIndex: any;
|
|
13
|
+
}): JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Checkbox for toggling on/off of a channel.
|
|
16
|
+
* @prop {string} color Current color for this channel.
|
|
17
|
+
* @prop {boolean} checked Whether or not this channel is "on".
|
|
18
|
+
* @prop {boolean} disabled Whether or not the component is disabled.
|
|
19
|
+
* @prop {function} toggle Callback for toggling on/off.
|
|
20
|
+
*/
|
|
21
|
+
export function ChannelVisibilityCheckbox({ color, checked, toggle, disabled, }: {
|
|
22
|
+
color: any;
|
|
23
|
+
checked: any;
|
|
24
|
+
toggle: any;
|
|
25
|
+
disabled: any;
|
|
26
|
+
}): JSX.Element;
|
|
27
|
+
//# sourceMappingURL=shared-channel-controls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-channel-controls.d.ts","sourceRoot":"","sources":["../src/shared-channel-controls.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH;;;;;gBAqBC;AAED;;;;;;GAMG;AACH;;;;;gBAWC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import Checkbox from '@material-ui/core
|
|
4
|
-
import
|
|
5
|
-
import { useSelectStyles } from './styles';
|
|
3
|
+
import { Checkbox, Select } from '@material-ui/core';
|
|
4
|
+
import { useSelectStyles } from './styles.js';
|
|
6
5
|
/**
|
|
7
6
|
* Dropdown for selecting a channel.
|
|
8
7
|
* @prop {function} handleChange Callback for each new selection.
|