@vitessce/layer-controller 3.5.12 → 3.6.1
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-BVjbK7jw.js +10 -0
- package/dist/{index-d816962c.js → index-33bfVj66.js} +70412 -67894
- package/dist/index.js +1 -4
- package/dist/{jpeg-f0fc1e44.js → jpeg-BdMUgt4w.js} +20 -4
- package/dist/lerc-CDb6hblk.js +2065 -0
- package/dist/{lzw-af978121.js → lzw-Bq_A3XVG.js} +1 -4
- package/dist/{packbits-48365e34.js → packbits-QWCdXTTY.js} +1 -4
- package/dist/{pako.esm-68f84e2a.js → pako.esm-SxljTded.js} +33 -1839
- package/dist/{raw-0be8a541.js → raw-O2tds5XZ.js} +1 -4
- package/dist/{webimage-0d7dbd51.js → webimage-CfZ_aK6l.js} +1 -4
- package/dist-tsc/BitmaskChannelController.d.ts.map +1 -1
- package/dist-tsc/BitmaskChannelController.js +2 -3
- package/dist-tsc/ChannelOptions.d.ts.map +1 -1
- package/dist-tsc/ChannelOptions.js +4 -5
- package/dist-tsc/ColorPalette.d.ts.map +1 -1
- package/dist-tsc/ColorPalette.js +4 -5
- package/dist-tsc/ImageAddButton.d.ts.map +1 -1
- package/dist-tsc/ImageAddButton.js +3 -4
- package/dist-tsc/LayerController.d.ts.map +1 -1
- package/dist-tsc/LayerController.js +12 -19
- package/dist-tsc/LayerControllerSubscriber.d.ts.map +1 -1
- package/dist-tsc/LayerControllerSubscriber.js +4 -4
- package/dist-tsc/LayerOptions.d.ts.map +1 -1
- package/dist-tsc/LayerOptions.js +15 -15
- package/dist-tsc/RasterChannelController.js +4 -4
- package/dist-tsc/VectorLayerController.js +4 -4
- package/dist-tsc/VolumeOptions.d.ts.map +1 -1
- package/dist-tsc/VolumeOptions.js +7 -7
- package/dist-tsc/shared-channel-controls.d.ts.map +1 -1
- package/dist-tsc/shared-channel-controls.js +6 -4
- package/dist-tsc/styles.d.ts +72 -8
- package/dist-tsc/styles.d.ts.map +1 -1
- package/dist-tsc/styles.js +31 -16
- package/package.json +11 -11
- package/src/BitmaskChannelController.js +4 -5
- package/src/ChannelOptions.js +4 -5
- package/src/ColorPalette.js +4 -5
- package/src/ImageAddButton.js +3 -4
- package/src/LayerController.js +30 -30
- package/src/LayerControllerSubscriber.js +4 -6
- package/src/LayerOptions.js +21 -24
- package/src/RasterChannelController.js +8 -8
- package/src/VectorLayerController.js +7 -7
- package/src/VolumeOptions.js +12 -14
- package/src/shared-channel-controls.js +8 -6
- package/src/styles.js +31 -16
- package/dist/deflate-2c798302.js +0 -13
- package/dist/lerc-59798e8d.js +0 -2014
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitmaskChannelController.d.ts","sourceRoot":"","sources":["../src/BitmaskChannelController.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"BitmaskChannelController.d.ts","sourceRoot":"","sources":["../src/BitmaskChannelController.js"],"names":[],"mappings":";AAIA;;;;;;;;;GASG;AACH;;;;;;;;gBAgDC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { RemoveCircle as RemoveCircleIcon } from '@
|
|
4
|
-
import { IconButton, Grid } from '@material-ui/core';
|
|
3
|
+
import { RemoveCircle as RemoveCircleIcon, IconButton, Grid } from '@vitessce/styles';
|
|
5
4
|
import { ChannelSelectionDropdown, ChannelVisibilityCheckbox } from './shared-channel-controls.js';
|
|
6
5
|
/**
|
|
7
6
|
* Controller for the handling the bitmask channels.
|
|
@@ -25,6 +24,6 @@ function BitmaskChannelController({ visibility = false, dimName, channelOptions,
|
|
|
25
24
|
* e.g { channel: 2 } // channel dimension, third channel
|
|
26
25
|
*/
|
|
27
26
|
const createSelection = index => ({ [dimName]: index });
|
|
28
|
-
return (_jsxs(Grid, { container: true, direction: "row", justifyContent: "space-between", children: [_jsx(Grid, {
|
|
27
|
+
return (_jsxs(Grid, { container: true, direction: "row", justifyContent: "space-between", children: [_jsx(Grid, { size: 2, children: _jsx(ChannelVisibilityCheckbox, { color: [220, 220, 220], checked: visibility, toggle: () => handlePropertyChange('visible', !visibility) }) }), _jsx(Grid, { size: 9, children: _jsx(ChannelSelectionDropdown, { handleChange: v => handlePropertyChange('selection', createSelection(v)), selectionIndex: selectionIndex, disableOptions: disableOptions, channelOptions: channelOptions }) }), _jsx(Grid, { size: 1, children: _jsx(IconButton, { onClick: handleChannelRemove, style: { padding: '6px 6px 6px 0px' }, "aria-label": "Remove channel", children: _jsx(RemoveCircleIcon, {}) }) })] }));
|
|
29
28
|
}
|
|
30
29
|
export default BitmaskChannelController;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelOptions.d.ts","sourceRoot":"","sources":["../src/ChannelOptions.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ChannelOptions.d.ts","sourceRoot":"","sources":["../src/ChannelOptions.js"],"names":[],"mappings":";AAyBA;;;;;GAKG;AACH;;;;gBA2CC"}
|
|
@@ -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, MenuItem } from '@
|
|
4
|
-
import { MoreVert as MoreVertIcon } from '@material-ui/icons';
|
|
3
|
+
import { makeStyles, MenuItem, MoreVert as MoreVertIcon } from '@vitessce/styles';
|
|
5
4
|
import { PopperMenu } from '@vitessce/vit-s';
|
|
6
5
|
import { useSpanStyles } from './styles.js';
|
|
7
6
|
import ColorPalette from './ColorPalette.js';
|
|
8
|
-
const useStyles = makeStyles(() => ({
|
|
7
|
+
const useStyles = makeStyles()(() => ({
|
|
9
8
|
menuButton: {
|
|
10
9
|
backgroundColor: 'transparent',
|
|
11
10
|
},
|
|
@@ -19,7 +18,7 @@ const useStyles = makeStyles(() => ({
|
|
|
19
18
|
}));
|
|
20
19
|
function MuiSpan(props) {
|
|
21
20
|
const { children } = props;
|
|
22
|
-
const classes = useSpanStyles();
|
|
21
|
+
const { classes } = useSpanStyles();
|
|
23
22
|
return _jsx("span", { className: classes.span, children: children });
|
|
24
23
|
}
|
|
25
24
|
/**
|
|
@@ -30,7 +29,7 @@ function MuiSpan(props) {
|
|
|
30
29
|
*/
|
|
31
30
|
function ChannelOptions({ handlePropertyChange, handleChannelRemove, handleIQRUpdate }) {
|
|
32
31
|
const [open, setOpen] = useState(false);
|
|
33
|
-
const classes = useStyles();
|
|
32
|
+
const { classes } = useStyles();
|
|
34
33
|
const handleColorSelect = (color) => {
|
|
35
34
|
handlePropertyChange('color', color);
|
|
36
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPalette.d.ts","sourceRoot":"","sources":["../src/ColorPalette.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ColorPalette.d.ts","sourceRoot":"","sources":["../src/ColorPalette.js"],"names":[],"mappings":";AAyBA;;gBAoBC"}
|
package/dist-tsc/ColorPalette.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { IconButton, makeStyles } from '@
|
|
4
|
-
import { Lens as LensIcon } from '@material-ui/icons';
|
|
3
|
+
import { IconButton, makeStyles, Lens as LensIcon } from '@vitessce/styles';
|
|
5
4
|
import { VIEWER_PALETTE } from '@vitessce/utils';
|
|
6
|
-
const useStyles = makeStyles(theme => ({
|
|
5
|
+
const useStyles = makeStyles()(theme => ({
|
|
7
6
|
paletteContainer: {
|
|
8
7
|
width: '70px',
|
|
9
8
|
height: '40px',
|
|
@@ -20,11 +19,11 @@ const useStyles = makeStyles(theme => ({
|
|
|
20
19
|
width: '17px',
|
|
21
20
|
height: '17px',
|
|
22
21
|
stroke: theme.palette.action.selected,
|
|
23
|
-
|
|
22
|
+
strokeWidth: '1px',
|
|
24
23
|
},
|
|
25
24
|
}));
|
|
26
25
|
const ColorPalette = ({ handleChange }) => {
|
|
27
|
-
const classes = useStyles();
|
|
26
|
+
const { classes } = useStyles();
|
|
28
27
|
return (_jsx("div", { className: classes.paletteContainer, "aria-label": "Color swatch", children: VIEWER_PALETTE.map(color => (_jsx(IconButton, { className: classes.button, onClick: () => handleChange(color), "aria-label": `Change color to ${color}`, children: _jsx(LensIcon, { fontSize: "small", style: { color: `rgb(${color})` }, className: classes.icon }) }, color))) }));
|
|
29
28
|
};
|
|
30
29
|
export default ColorPalette;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageAddButton.d.ts","sourceRoot":"","sources":["../src/ImageAddButton.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ImageAddButton.d.ts","sourceRoot":"","sources":["../src/ImageAddButton.js"],"names":[],"mappings":";AAqBA;;;uBA0BC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
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, MenuItem } from '@
|
|
4
|
-
import { Add as AddIcon } from '@material-ui/icons';
|
|
3
|
+
import { makeStyles, MenuItem, Add as AddIcon } from '@vitessce/styles';
|
|
5
4
|
import { PopperMenu } from '@vitessce/vit-s';
|
|
6
|
-
const useStyles = makeStyles(() => ({
|
|
5
|
+
const useStyles = makeStyles()(() => ({
|
|
7
6
|
addButton: {
|
|
8
7
|
marginTop: '10px',
|
|
9
8
|
marginBottom: '10px',
|
|
@@ -15,7 +14,7 @@ function ImageAddIcon() {
|
|
|
15
14
|
}
|
|
16
15
|
function ImageAddButton({ imageOptions, handleImageAdd }) {
|
|
17
16
|
const [open, setOpen] = useState(false);
|
|
18
|
-
const classes = useStyles();
|
|
17
|
+
const { classes } = useStyles();
|
|
19
18
|
const handleAdd = (imgData) => {
|
|
20
19
|
setOpen(prev => !prev);
|
|
21
20
|
handleImageAdd(imgData);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayerController.d.ts","sourceRoot":"","sources":["../src/LayerController.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LayerController.d.ts","sourceRoot":"","sources":["../src/LayerController.js"],"names":[],"mappings":"AA2EA;;;;;;;GAOG;AACH,iEAshBC"}
|
|
@@ -3,8 +3,7 @@ import React, { useState, useRef, useEffect } from 'react';
|
|
|
3
3
|
import { useId } from 'react-aria';
|
|
4
4
|
import { viv } from '@vitessce/gl';
|
|
5
5
|
import { GLOBAL_LABELS, getSourceFromLoader, getMultiSelectionStats, DOMAINS, canLoadResolution, } from '@vitessce/spatial-utils';
|
|
6
|
-
import { Grid, Button, Slider, Tabs, Tab, InputLabel, Accordion, AccordionDetails, AccordionSummary, } from '@
|
|
7
|
-
import { Add as AddIcon, ExpandMore as ExpandMoreIcon, Visibility as VisibilityIcon, VisibilityOff as VisibilityOffIcon, } from '@material-ui/icons';
|
|
6
|
+
import { Grid, Button, Slider, Tabs, Tab, InputLabel, Accordion, AccordionDetails, AccordionSummary, Box, Add as AddIcon, ExpandMore as ExpandMoreIcon, Visibility as VisibilityIcon, VisibilityOff as VisibilityOffIcon, } from '@vitessce/styles';
|
|
8
7
|
import LayerOptions from './LayerOptions.js';
|
|
9
8
|
import VolumeOptions from './VolumeOptions.js';
|
|
10
9
|
import { useControllerSectionStyles, useInputLabelStyles, useOverflowEllipsisGridStyles, useAccordionStyles, } from './styles.js';
|
|
@@ -260,10 +259,10 @@ export default function LayerController(props) {
|
|
|
260
259
|
, { dimName: channelLabel, visibility: c.visible, selectionIndex: c.selection[channelLabel], slider: c.slider, color: c.color, channels: channels, channelId: channelId, domainType: domainType, loader: loader, globalLabelValues: globalLabelValues, theme: theme, channelOptions: channelOptions, colormapOn: Boolean(colormap), handlePropertyChange: handleChannelPropertyChange, handleChannelRemove: handleChannelRemove, handleIQRUpdate: handleIQRUpdate, setRasterLayerCallback: setImageLayerCallback, isLoading: areLayerChannelsLoading[channelId], use3d: use3d }, `channel-controller-${channelId}`));
|
|
261
260
|
});
|
|
262
261
|
}
|
|
263
|
-
const controllerSectionClasses = useControllerSectionStyles();
|
|
264
|
-
const accordionClasses = useAccordionStyles();
|
|
265
|
-
const inputLabelClasses = useInputLabelStyles();
|
|
266
|
-
const overflowEllipsisGridClasses = useOverflowEllipsisGridStyles();
|
|
262
|
+
const { classes: controllerSectionClasses } = useControllerSectionStyles();
|
|
263
|
+
const { classes: accordionClasses } = useAccordionStyles();
|
|
264
|
+
const { classes: inputLabelClasses } = useInputLabelStyles();
|
|
265
|
+
const { classes: overflowEllipsisGridClasses } = useOverflowEllipsisGridStyles();
|
|
267
266
|
const { visible } = layer;
|
|
268
267
|
const visibleSetting = typeof visible === 'boolean' ? visible : true;
|
|
269
268
|
const Visibility = visibleSetting ? VisibilityIcon : VisibilityOffIcon;
|
|
@@ -278,25 +277,19 @@ export default function LayerController(props) {
|
|
|
278
277
|
globalControlLabels: labels.filter(label => GLOBAL_LABELS.includes(label)), globalLabelValues: globalLabelValues, handleOpacityChange: setOpacity, handleColormapChange: setColormap, handleGlobalChannelsSelectionChange: handleGlobalChannelsSelectionChange, handleTransparentColorChange: setTransparentColor, disableChannelsIfRgbDetected: photometricInterpretation === 'RGB', handleDomainChange: handleDomainChange, shouldShowTransparentColor: shouldShowTransparentColor, shouldShowDomain: shouldShowDomain, shouldShowColormap: shouldShowColormap, use3d: use3d, loader: loader, handleMultiPropertyChange: handleMultiPropertyChange, resolution: resolution, disable3d: disable3d, setRasterLayerCallback: setImageLayerCallback, setAreAllChannelsLoading: setAreAllChannelsLoading, setViewState: setViewState, spatialHeight: spatialHeight, spatialWidth: spatialWidth, modelMatrix: modelMatrix }), photometricInterpretation === 'RGB'
|
|
279
278
|
? null
|
|
280
279
|
: channelControllers, photometricInterpretation === 'RGB' ? null : (_jsx(Button, { disabled: channels.length === viv.MAX_CHANNELS, onClick: handleChannelAdd, fullWidth: true, variant: "outlined", style: buttonStyles, startIcon: _jsx(AddIcon, {}), size: "small", children: "Add Channel" }))] }));
|
|
281
|
-
return (_jsxs(Accordion, {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}, expandIcon: _jsx(ExpandMoreIcon, { role: "presentation" }), "aria-controls": `layer-${name}-controls`, "aria-expanded": isExpanded, children: _jsxs(Grid, { container: true, direction: "column", m: 1, justifyContent: "center", children: [_jsxs(Grid, { item: true, classes: { item: overflowEllipsisGridClasses.item }, children: [_jsx(Button, { "aria-label": "Toggle layer visibility", onClick: (e) => {
|
|
280
|
+
return (_jsxs(Accordion, { slotProps: {
|
|
281
|
+
root: { elevation: 4, className: controllerSectionClasses.accordionRoot },
|
|
282
|
+
}, onChange: (e, expanded) => !disabled
|
|
283
|
+
&& setIsExpanded(expanded && e?.target?.attributes?.role?.value === 'presentation'), expanded: !disabled && isExpanded, id: `layer-controls-accordion-${layerControlsId}`, children: [_jsx(AccordionSummary, { slotProps: {
|
|
284
|
+
content: { className: accordionClasses.content },
|
|
285
|
+
}, expandIcon: _jsx(ExpandMoreIcon, { role: "presentation" }), "aria-controls": `layer-${name}-controls`, "aria-expanded": isExpanded, children: _jsxs(Grid, { container: true, direction: "column", justifyContent: "center", sx: { flexGrow: 1 }, children: [_jsxs(Grid, { container: true, size: 12, direction: "row", alignItems: "flex-start", classes: { item: overflowEllipsisGridClasses.item }, children: [_jsx(Box, { component: "div", role: "button", "aria-label": "Toggle layer visibility", onClick: (e) => {
|
|
288
286
|
if (!disabled) {
|
|
289
287
|
// Needed to prevent affecting the expansion panel from changing
|
|
290
288
|
e.stopPropagation();
|
|
291
289
|
const nextVisible = typeof visible === 'boolean' ? !visible : false;
|
|
292
290
|
setVisible(nextVisible);
|
|
293
291
|
}
|
|
294
|
-
}, style: {
|
|
295
|
-
marginRight: 8,
|
|
296
|
-
marginBottom: 2,
|
|
297
|
-
padding: 0,
|
|
298
|
-
minWidth: 0,
|
|
299
|
-
}, children: _jsx(Visibility, {}) }), name] }), !disabled && !isExpanded && !use3d && (_jsxs(Grid, { container: true, direction: "row", alignItems: "center", justifyContent: "center", children: [_jsx(Grid, { item: true, xs: 6, children: _jsx(InputLabel, { htmlFor: `layer-${name}-opacity-closed`, classes: { root: inputLabelClasses.inputLabelRoot }, children: "Opacity:" }) }), _jsx(Grid, { item: true, xs: 6, children: _jsx(Slider, { id: `layer-${name}-opacity-closed`, value: opacity, onChange: (e, v) => setOpacity(v), valueLabelDisplay: "auto", "aria-label": `Adjust opacity for layer ${name}`, min: 0, max: 1, step: 0.01, orientation: "horizontal" }) })] }))] }) }), _jsxs(AccordionDetails, { classes: { root: accordionClasses.accordionDetailsRoot }, id: `layer-${name}-controls`, children: [useVolumeTabs ? (_jsxs(_Fragment, { children: [_jsxs(Tabs, { value: tab, onChange: handleTabChange, "aria-label": "Change the layer tab type", style: { height: '24px', minHeight: '24px' }, children: [_jsx(Tab, { label: "Channels", "aria-label": "Channels tab", style: {
|
|
292
|
+
}, className: accordionClasses.accordionVisibilityIconBox, children: _jsx(Visibility, {}) }), _jsx(Box, { component: "div", className: accordionClasses.accordionNameBox, children: name })] }), !disabled && !isExpanded && !use3d && (_jsxs(Grid, { container: true, direction: "row", sx: { justifyContent: 'flex-start', flexGrow: 1 }, children: [_jsx(Grid, { size: 5, children: _jsx(InputLabel, { htmlFor: `layer-${name}-opacity-closed`, classes: { root: inputLabelClasses.inputLabelRoot }, children: "Opacity:" }) }), _jsx(Grid, { size: 6, children: _jsx(Slider, { id: `layer-${name}-opacity-closed`, value: opacity, onChange: (e, v) => setOpacity(v), valueLabelDisplay: "auto", "aria-label": `Adjust opacity for layer ${name}`, min: 0, max: 1, step: 0.01, orientation: "horizontal" }) })] }))] }) }), _jsxs(AccordionDetails, { id: `layer-${name}-controls`, children: [useVolumeTabs ? (_jsxs(_Fragment, { children: [_jsxs(Tabs, { value: tab, onChange: handleTabChange, "aria-label": "Change the layer tab type", style: { height: '24px', minHeight: '24px' }, children: [_jsx(Tab, { label: "Channels", "aria-label": "Channels tab", style: {
|
|
300
293
|
fontSize: '.75rem',
|
|
301
294
|
bottom: 12,
|
|
302
295
|
width: '50%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayerControllerSubscriber.d.ts","sourceRoot":"","sources":["../src/LayerControllerSubscriber.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LayerControllerSubscriber.d.ts","sourceRoot":"","sources":["../src/LayerControllerSubscriber.js"],"names":[],"mappings":"AAuSA;;;;;;;;;;;;;;;GAeG;AACH,iDAbG;IAAsB,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;CAEjB,eAgNA"}
|
|
@@ -2,7 +2,7 @@ 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 '@
|
|
5
|
+
import { Grid } from '@vitessce/styles';
|
|
6
6
|
import { TitleInfo, useReady, useClosestVitessceContainerSize, useWindowDimensions, useImageData, useObsLocationsData, useObsSegmentationsData, useCoordination, useLoaders, useAuxiliaryCoordination, useComponentLayout, } from '@vitessce/vit-s';
|
|
7
7
|
import { ViewType, COMPONENT_COORDINATION_TYPES, ViewHelpMapping } from '@vitessce/constants-internal';
|
|
8
8
|
import { capitalize } from '@vitessce/utils';
|
|
@@ -45,7 +45,7 @@ const LayerControllerMemoized = React.memo(forwardRef((props, ref) => {
|
|
|
45
45
|
};
|
|
46
46
|
return loader && layerMeta ? (_jsx(Grid
|
|
47
47
|
// eslint-disable-next-line react/no-array-index-key
|
|
48
|
-
, {
|
|
48
|
+
, { sx: { marginTop: '10px' }, children: _jsx(LayerController, { name: layerMeta.name, layer: layer, loader: loader, theme: theme, handleLayerChange: v => handleSegmentationLayerChange(v, i), handleLayerRemove: () => handleSegmentationLayerRemove(i), ChannelController: BitmaskChannelController, shouldShowTransparentColor: isRaster, shouldShowDomain: isRaster, shouldShowColormap: isRaster,
|
|
49
49
|
// Disable 3D if given explicit instructions to do so
|
|
50
50
|
// or if another layer is using 3D mode.
|
|
51
51
|
disable3d: globalDisable3d
|
|
@@ -88,7 +88,7 @@ const LayerControllerMemoized = React.memo(forwardRef((props, ref) => {
|
|
|
88
88
|
};
|
|
89
89
|
return loader && layerMeta ? (_jsx(Grid
|
|
90
90
|
// eslint-disable-next-line react/no-array-index-key
|
|
91
|
-
, {
|
|
91
|
+
, { sx: { marginTop: '10px' }, children: _jsx(LayerController, { name: layerMeta.name, layer: layer, loader: loader, theme: theme, handleLayerChange: v => handleRasterLayerChange(v, i), handleLayerRemove: () => handleRasterLayerRemove(i), ChannelController: RasterChannelController, shouldShowTransparentColor: isRaster, shouldShowDomain: isRaster, shouldShowColormap: isRaster,
|
|
92
92
|
// Disable 3D if given explicit instructions to do so
|
|
93
93
|
// or if another layer is using 3D mode.
|
|
94
94
|
disable3d: globalDisable3d
|
|
@@ -106,7 +106,7 @@ const LayerControllerMemoized = React.memo(forwardRef((props, ref) => {
|
|
|
106
106
|
setRotationOrbit(newRotationOrbit);
|
|
107
107
|
}, setAreLayerChannelsLoading: setAreLayerChannelsLoading, areLayerChannelsLoading: areLayerChannelsLoading, spatialHeight: (componentHeight * (spatialLayout ? spatialLayout.h : 1)) / 12, spatialWidth: (componentWidth * (spatialLayout ? spatialLayout.w : 1)) / 12, shouldShowRemoveLayerButton: shouldShowImageLayerButton }) }, `${dataset}-raster-${index}-${i}`)) : null;
|
|
108
108
|
}), shouldShowImageLayerButton
|
|
109
|
-
? (_jsx(Grid, {
|
|
109
|
+
? (_jsx(Grid, { children: _jsx(ImageAddButton, { imageOptions: imageLayerMeta, handleImageAdd: handleImageAdd }) })) : null] }) }));
|
|
110
110
|
}));
|
|
111
111
|
/**
|
|
112
112
|
* A subscriber component for the spatial layer controller.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayerOptions.d.ts","sourceRoot":"","sources":["../src/LayerOptions.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"LayerOptions.d.ts","sourceRoot":"","sources":["../src/LayerOptions.js"],"names":[],"mappings":";AA4UA;;;;;;;;;;;;;GAaG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAyIC"}
|
package/dist-tsc/LayerOptions.js
CHANGED
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { useId } from 'react-aria';
|
|
4
4
|
import { range } from 'lodash-es';
|
|
5
5
|
import { Matrix4 } from 'math.gl';
|
|
6
|
-
import { Grid, Slider, InputLabel,
|
|
6
|
+
import { Grid, Slider, InputLabel, NativeSelect, Checkbox } from '@vitessce/styles';
|
|
7
7
|
import { viv } from '@vitessce/gl';
|
|
8
8
|
import { getBoundingCube, getMultiSelectionStats, DEFAULT_RASTER_DOMAIN_TYPE, canLoadResolution, getStatsForResolution, } from '@vitessce/spatial-utils';
|
|
9
9
|
import { COLORMAP_OPTIONS, formatBytes, } from '@vitessce/utils';
|
|
@@ -25,7 +25,7 @@ const DOMAIN_OPTIONS = ['Full', 'Min/Max'];
|
|
|
25
25
|
* @prop {boolean} use3d Whether or not 3D is enabled for this layer.
|
|
26
26
|
*/
|
|
27
27
|
function VolumeDropdown({ loader: loaderWithMeta, handleMultiPropertyChange, resolution: currResolution, disable3d, setRasterLayerCallback, setAreAllChannelsLoading, setViewState, spatialHeight, spatialWidth, channels, use3d, modelMatrix, }) {
|
|
28
|
-
const classes = useSelectStyles();
|
|
28
|
+
const { classes } = useSelectStyles();
|
|
29
29
|
const selections = channels.map(i => i.selection);
|
|
30
30
|
const { data: loader } = loaderWithMeta;
|
|
31
31
|
const handleChange = async (val) => {
|
|
@@ -94,7 +94,7 @@ function VolumeDropdown({ loader: loaderWithMeta, handleMultiPropertyChange, res
|
|
|
94
94
|
};
|
|
95
95
|
const { labels, shape } = Array.isArray(loader) ? loader[0] : loader;
|
|
96
96
|
const hasZStack = shape[labels.indexOf('z')] > 1;
|
|
97
|
-
return (_jsx(_Fragment, { children: _jsxs(
|
|
97
|
+
return (_jsx(_Fragment, { children: _jsxs(NativeSelect, { value: currResolution, onChange: e => handleChange(e.target.value === '2D' ? e.target.value : Number(e.target.value)), inputProps: { 'aria-label': 'Resolution selector' }, classes: { root: classes.selectRoot }, children: [_jsx("option", { value: "2D", children: "2D Visualization" }, "2D"), Array.from({ length: loader.length })
|
|
98
98
|
.fill(0)
|
|
99
99
|
// eslint-disable-next-line no-unused-vars
|
|
100
100
|
.map((_, resolution) => {
|
|
@@ -115,8 +115,8 @@ function VolumeDropdown({ loader: loaderWithMeta, handleMultiPropertyChange, res
|
|
|
115
115
|
* @prop {function} handleChange Callback for every change in colormap.
|
|
116
116
|
*/
|
|
117
117
|
function ColormapSelect({ value, inputId, handleChange }) {
|
|
118
|
-
const classes = useSelectStyles();
|
|
119
|
-
return (_jsxs(
|
|
118
|
+
const { classes } = useSelectStyles();
|
|
119
|
+
return (_jsxs(NativeSelect, { onChange: e => handleChange(e.target.value === '' ? null : e.target.value), value: value, inputProps: { name: 'colormap', id: inputId, 'aria-label': 'Colormap selector' }, style: { width: '100%' }, classes: { root: classes.selectRoot }, children: [_jsx("option", { "aria-label": "None", value: "", children: "None" }), COLORMAP_OPTIONS.map(name => (_jsx("option", { value: name, children: name }, name)))] }));
|
|
120
120
|
}
|
|
121
121
|
function TransparentColorCheckbox({ value, inputId, handleChange }) {
|
|
122
122
|
return (_jsx(Checkbox, { style: { float: 'left', padding: 0 }, color: "default", onChange: () => {
|
|
@@ -126,7 +126,7 @@ function TransparentColorCheckbox({ value, inputId, handleChange }) {
|
|
|
126
126
|
else {
|
|
127
127
|
handleChange([0, 0, 0]);
|
|
128
128
|
}
|
|
129
|
-
}, checked: Boolean(value), id: inputId,
|
|
129
|
+
}, checked: Boolean(value), id: inputId, slotProps: { input: { 'aria-label': 'Enable or disable color transparency' } } }));
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
132
|
* Wrapper for the slider that updates opacity.
|
|
@@ -134,8 +134,8 @@ function TransparentColorCheckbox({ value, inputId, handleChange }) {
|
|
|
134
134
|
* @prop {function} handleChange Callback for every change in opacity.
|
|
135
135
|
*/
|
|
136
136
|
function OpacitySlider({ value, inputId, handleChange }) {
|
|
137
|
-
const classes = useChannelSliderStyles();
|
|
138
|
-
return (_jsx(Slider, {
|
|
137
|
+
const { classes } = useChannelSliderStyles();
|
|
138
|
+
return (_jsx(Slider, { slotProps: { valueLabel: { className: classes.sliderValueLabel } }, value: value, onChange: (e, v) => handleChange(v), valueLabelDisplay: "auto", "aria-label": "Layer opacity slider", id: inputId, min: 0, max: 1, step: 0.01, orientation: "horizontal" }));
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
141
|
* Wrapper for the dropdown that chooses the domain type.
|
|
@@ -144,8 +144,8 @@ function OpacitySlider({ value, inputId, handleChange }) {
|
|
|
144
144
|
* @prop {function} handleChange Callback for every change in domain.
|
|
145
145
|
*/
|
|
146
146
|
function SliderDomainSelector({ value, inputId, handleChange }) {
|
|
147
|
-
const classes = useSelectStyles();
|
|
148
|
-
return (_jsx(
|
|
147
|
+
const { classes } = useSelectStyles();
|
|
148
|
+
return (_jsx(NativeSelect, { onChange: e => handleChange(e.target.value), value: value, id: inputId, inputProps: { name: 'domain-selector', 'aria-label': 'Domain type selector' }, style: { width: '100%' }, classes: { root: classes.selectRoot }, children: DOMAIN_OPTIONS.map(name => (_jsx("option", { value: name, children: name }, name))) }));
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
151
|
* Wrapper for the slider that chooses global selections (z, t etc.).
|
|
@@ -155,7 +155,7 @@ function SliderDomainSelector({ value, inputId, handleChange }) {
|
|
|
155
155
|
* @prop {function} possibleValues All available values for the field.
|
|
156
156
|
*/
|
|
157
157
|
function GlobalSelectionSlider({ field, value, inputId, handleChange, possibleValues, }) {
|
|
158
|
-
const classes = useSelectionSliderStyles();
|
|
158
|
+
const { classes } = useSelectionSliderStyles();
|
|
159
159
|
return (_jsx(Slider, { classes: { root: classes.selectionSliderRoot, markActive: classes.markActive }, value: value,
|
|
160
160
|
// See https://github.com/hms-dbmi/viv/issues/176 for why
|
|
161
161
|
// we have the two handlers.
|
|
@@ -173,7 +173,7 @@ function GlobalSelectionSlider({ field, value, inputId, handleChange, possibleVa
|
|
|
173
173
|
* @prop {object} children Components to be rendered next to the name (slider, dropdown etc.).
|
|
174
174
|
*/
|
|
175
175
|
function LayerOption({ name, inputId, children }) {
|
|
176
|
-
return (_jsxs(Grid, { container: true, direction: "row", alignItems: "center", justifyContent: "center", children: [_jsx(Grid, {
|
|
176
|
+
return (_jsxs(Grid, { container: true, direction: "row", alignItems: "center", justifyContent: "center", children: [_jsx(Grid, { size: 6, children: _jsxs(InputLabel, { htmlFor: inputId, children: [name, ":"] }) }), _jsx(Grid, { size: 6, children: children })] }));
|
|
177
177
|
}
|
|
178
178
|
/**
|
|
179
179
|
* Gloabl options for all channels (opacity, colormap, etc.).
|
|
@@ -202,13 +202,13 @@ function LayerOptions({ colormap, opacity, handleColormapChange, handleOpacityCh
|
|
|
202
202
|
const domainSelectorId = useId();
|
|
203
203
|
const opacitySliderId = useId();
|
|
204
204
|
const zeroTransparentId = useId();
|
|
205
|
-
return (_jsxs(Grid, { container: true, direction: "column",
|
|
205
|
+
return (_jsxs(Grid, { container: true, direction: "column", sx: { width: '100%' }, children: [hasZStack
|
|
206
206
|
&& !disable3d
|
|
207
207
|
&& hasViewableResolutions
|
|
208
208
|
&& (_jsx(VolumeDropdown, { loader: loader, handleSliderChange: handleSliderChange, handleDomainChange: handleDomainChange, channels: channels, handleMultiPropertyChange: handleMultiPropertyChange, resolution: resolution, disable3d: disable3d, setRasterLayerCallback: setRasterLayerCallback, setAreAllChannelsLoading: setAreAllChannelsLoading, setViewState: setViewState, spatialHeight: spatialHeight, spatialWidth: spatialWidth, use3d: use3d, modelMatrix: modelMatrix })), hasDimensionsAndChannels
|
|
209
209
|
&& !use3d
|
|
210
|
-
&& globalControlLabels.map(field => shape[labels.indexOf(field)] > 1 && (_jsx(LayerOption, { name: field, inputId: `${field}-${globalSelectionSliderId}`, children: _jsx(GlobalSelectionSlider, { field: field, inputId: `${field}-${globalSelectionSliderId}`, value: globalLabelValues[field], handleChange: handleGlobalChannelsSelectionChange, possibleValues: range(shape[labels.indexOf(field)]) }) }, field))), !disableChannelsIfRgbDetected ? (_jsxs(_Fragment, { children: [shouldShowColormap && (_jsx(Grid, {
|
|
210
|
+
&& globalControlLabels.map(field => shape[labels.indexOf(field)] > 1 && (_jsx(LayerOption, { name: field, inputId: `${field}-${globalSelectionSliderId}`, children: _jsx(GlobalSelectionSlider, { field: field, inputId: `${field}-${globalSelectionSliderId}`, value: globalLabelValues[field], handleChange: handleGlobalChannelsSelectionChange, possibleValues: range(shape[labels.indexOf(field)]) }) }, field))), !disableChannelsIfRgbDetected ? (_jsxs(_Fragment, { children: [shouldShowColormap && (_jsx(Grid, { children: _jsx(LayerOption, { name: "Colormap", inputId: colormapSelectId, children: _jsx(ColormapSelect, { value: colormap || '', inputId: colormapSelectId, handleChange: handleColormapChange }) }) })), shouldShowDomain && (_jsx(Grid, { children: _jsx(LayerOption, { name: "Domain", inputId: domainSelectorId, children: _jsx(SliderDomainSelector, { value: domainType || DEFAULT_RASTER_DOMAIN_TYPE, inputId: domainSelectorId, handleChange: (value) => {
|
|
211
211
|
handleDomainChange(value);
|
|
212
|
-
} }) }) }))] })) : null, !use3d && (_jsx(Grid, {
|
|
212
|
+
} }) }) }))] })) : null, !use3d && (_jsx(Grid, { children: _jsx(LayerOption, { name: "Opacity", inputId: opacitySliderId, children: _jsx(OpacitySlider, { value: opacity, handleChange: handleOpacityChange, inputId: opacitySliderId }) }) })), shouldShowTransparentColor && !use3d && (_jsx(Grid, { children: _jsx(LayerOption, { name: "Zero Transparent", inputId: zeroTransparentId, children: _jsx(TransparentColorCheckbox, { value: transparentColor, handleChange: handleTransparentColorChange, inputId: zeroTransparentId }) }) }))] }));
|
|
213
213
|
}
|
|
214
214
|
export default LayerOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
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, Slider } from '@
|
|
3
|
+
import { Grid, Slider } from '@vitessce/styles';
|
|
4
4
|
import { debounce, isEqual } from 'lodash-es';
|
|
5
5
|
import { getSourceFromLoader, getMultiSelectionStats, toRgbUIString, abbreviateNumber, DOMAINS, } from '@vitessce/spatial-utils';
|
|
6
6
|
import ChannelOptions from './ChannelOptions.js';
|
|
@@ -23,9 +23,9 @@ function ChannelSlider({ color, slider = [0, 0], handleChange, domain = [0, 0],
|
|
|
23
23
|
sliderCopy[1] = max;
|
|
24
24
|
}
|
|
25
25
|
const handleChangeDebounced = useCallback(debounce(handleChange, 3, { trailing: true }), [handleChange]);
|
|
26
|
-
const classes = useChannelSliderStyles();
|
|
26
|
+
const { classes } = useChannelSliderStyles();
|
|
27
27
|
const step = max - min < 500 && dtype.startsWith('Float') ? (max - min) / 500 : 1;
|
|
28
|
-
return (_jsx(Slider, {
|
|
28
|
+
return (_jsx(Slider, { slotProps: { valueLabel: { className: classes.valueLabel } }, value: slider, valueLabelFormat: abbreviateNumber, onChange: (e, v) => handleChangeDebounced(v), valueLabelDisplay: "auto", getAriaLabel: (index) => {
|
|
29
29
|
const labelPrefix = index === 0 ? 'Low value slider' : 'High value slider';
|
|
30
30
|
return `${labelPrefix} for ${color} colormap channel`;
|
|
31
31
|
}, getAriaValueText: () => `Current colormap values: ${color}-${slider}`, min: min, max: max, step: step, orientation: "horizontal", style: { color, marginTop: '7px' }, disabled: disabled }));
|
|
@@ -126,6 +126,6 @@ function RasterChannelController({ visibility = false, slider, color, channels,
|
|
|
126
126
|
* e.g { channel: 2 } // channel dimension, third channel
|
|
127
127
|
*/
|
|
128
128
|
const createSelection = index => ({ [dimName]: index });
|
|
129
|
-
return (_jsxs(Grid, { container: true, direction: "column",
|
|
129
|
+
return (_jsxs(Grid, { container: true, direction: "column", justifyContent: "center", children: [_jsxs(Grid, { container: true, direction: "row", justifyContent: "space-between", children: [_jsx(Grid, { size: 10, children: _jsx(ChannelSelectionDropdown, { handleChange: v => handlePropertyChange('selection', createSelection(v)), selectionIndex: selectionIndex, channelOptions: channelOptions, disabled: isLoading }) }), _jsx(Grid, { size: 1, sx: { marginTop: '4px' }, children: _jsx(ChannelOptions, { handlePropertyChange: handlePropertyChange, handleChannelRemove: handleChannelRemove, handleIQRUpdate: handleIQRUpdate, disabled: isLoading }) })] }), _jsxs(Grid, { container: true, direction: "row", justifyContent: "space-between", children: [_jsx(Grid, { size: 2, children: _jsx(ChannelVisibilityCheckbox, { color: rgbColor, checked: visibility, toggle: () => handlePropertyChange('visible', !visibility), disabled: isLoading }) }), _jsx(Grid, { size: 9, children: _jsx(ChannelSlider, { color: rgbColor, slider: slider, domain: domain || DOMAINS[dtype], dtype: dtype, handleChange: v => handlePropertyChange('slider', v), disabled: isLoading }) })] })] }));
|
|
130
130
|
}
|
|
131
131
|
export default RasterChannelController;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Grid, Checkbox, Paper, Typography, Slider } from '@
|
|
3
|
+
import { Grid, Checkbox, Paper, Typography, Slider } from '@vitessce/styles';
|
|
4
4
|
import { useControllerSectionStyles } from './styles.js';
|
|
5
5
|
export default function VectorLayerController(props) {
|
|
6
6
|
const { label, layer, layerType, handleLayerChange, } = props;
|
|
@@ -18,11 +18,11 @@ export default function VectorLayerController(props) {
|
|
|
18
18
|
function handleCheckBoxChange(v) {
|
|
19
19
|
handleLayerChange({ ...layer, visible: v });
|
|
20
20
|
}
|
|
21
|
-
const classes = useControllerSectionStyles();
|
|
22
|
-
return (_jsx(Grid, {
|
|
21
|
+
const { classes } = useControllerSectionStyles();
|
|
22
|
+
return (_jsx(Grid, { sx: { marginTop: '10px' }, children: _jsxs(Paper, { elevation: 4, className: classes.layerControllerRoot, children: [_jsx(Typography, { style: {
|
|
23
23
|
padding: '15px 8px 0px 8px',
|
|
24
24
|
marginBottom: '-5px',
|
|
25
|
-
}, children: label }), _jsxs(Grid, { container: true, direction: "row", justifyContent: "space-between", children: [_jsx(Grid, {
|
|
25
|
+
}, children: label }), _jsxs(Grid, { container: true, direction: "row", justifyContent: "space-between", children: [_jsx(Grid, { size: 2, children: _jsx(Checkbox, { color: "primary", checked: isOn, onChange: (e, v) => handleCheckBoxChange(v), slotProps: { input: { 'aria-label': 'Show or hide vector layer' } } }) }), _jsx(Grid, { size: 9, sx: { paddingRight: '16px' }, children: _jsx(Slider, { value: slider, min: 0, max: 1, step: 0.001, onChange: (e, v) => handleSliderChange(v), style: { marginTop: '7px' }, orientation: "horizontal", getAriaLabel: (index) => {
|
|
26
26
|
const labelPrefix = index === 0 ? 'Low value slider' : 'High value slider';
|
|
27
27
|
return `${labelPrefix} for ${label} layer controller`;
|
|
28
28
|
} }) })] })] }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VolumeOptions.d.ts","sourceRoot":"","sources":["../src/VolumeOptions.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"VolumeOptions.d.ts","sourceRoot":"","sources":["../src/VolumeOptions.js"],"names":[],"mappings":";AAqLA;;;;;;;;;;;;;gBAqCC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
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, Typography, Button, makeStyles,
|
|
4
|
+
import { Grid, Typography, Button, makeStyles, FormControl, NativeSelect, InputLabel, Slider, } from '@vitessce/styles';
|
|
5
5
|
import { viv } from '@vitessce/gl';
|
|
6
6
|
import { abbreviateNumber, getBoundingCube } from '@vitessce/spatial-utils';
|
|
7
7
|
import { useSelectStyles } from './styles.js';
|
|
8
|
-
const useSlicerStyles = makeStyles(theme =>
|
|
8
|
+
const useSlicerStyles = makeStyles()(theme => ({
|
|
9
9
|
enabled: {},
|
|
10
10
|
disabled: {
|
|
11
11
|
color: theme.palette.text.disabled,
|
|
@@ -42,22 +42,22 @@ const Slicer = ({ xSlice, ySlice, zSlice, handleSlicerSetting, loader, use3d, })
|
|
|
42
42
|
zSliceInit,
|
|
43
43
|
],
|
|
44
44
|
];
|
|
45
|
-
const classes = useSlicerStyles();
|
|
46
|
-
const Slicers = sliceValuesAndSetSliceFunctions.map(([val, setVal, label, [min, max]]) => (_jsxs(Grid, { container: true, direction: "row", justifyContent: "flex-start", alignItems: "center", children: [_jsx(Grid, {
|
|
45
|
+
const { classes } = useSlicerStyles();
|
|
46
|
+
const Slicers = sliceValuesAndSetSliceFunctions.map(([val, setVal, label, [min, max]]) => (_jsxs(Grid, { container: true, direction: "row", justifyContent: "flex-start", alignItems: "center", children: [_jsx(Grid, { size: 1, children: _jsxs(Typography, { className: !use3d ? classes.disabled : classes.enabled, style: { marginBottom: 0 }, children: [label, ":"] }) }), _jsx(Grid, { size: 11, children: _jsx(Slider, { disabled: !use3d, className: !use3d ? classes.disabled : classes.enabled, value: val, onChange: (e, v) => setVal(v), valueLabelDisplay: "auto", valueLabelFormat: v => abbreviateNumber(v), getAriaLabel: index => `Clipping plane ${label} slider ${index === 0 ? 'min' : 'max'}`, min: min, max: max, step: 0.005, orientation: "horizontal" }) })] }, label)));
|
|
47
47
|
return (_jsxs(_Fragment, { children: [_jsxs(Typography, { className: !use3d ? classes.disabled : classes.enabled, style: { marginTop: 16, marginBottom: 0 }, children: ["Clipping Planes:", ' '] }), ' ', Slicers] }));
|
|
48
48
|
};
|
|
49
49
|
const renderingOptions = Object.values(viv.RENDERING_MODES);
|
|
50
50
|
function RenderingModeSelect({ handleRenderingModeChange, renderingMode, use3d, }) {
|
|
51
|
-
const classes = useSelectStyles();
|
|
51
|
+
const { classes } = useSelectStyles();
|
|
52
52
|
// Empty option allows for displaying the title of the dropdown fully in the UI.
|
|
53
53
|
const options = !use3d ? [...renderingOptions, ''] : renderingOptions;
|
|
54
|
-
return (_jsxs(FormControl, { fullWidth: true, children: [_jsx(InputLabel, { htmlFor: "rendering-mode-select", children: "Rendering Mode" }), _jsx(
|
|
54
|
+
return (_jsxs(FormControl, { fullWidth: true, children: [_jsx(InputLabel, { htmlFor: "rendering-mode-select", variant: "standard", children: "Rendering Mode" }), _jsx(NativeSelect, { onChange: e => handleRenderingModeChange(e.target.value), value: use3d ? renderingMode : '', inputProps: {
|
|
55
55
|
name: 'rendering-mode',
|
|
56
56
|
id: 'rendering-mode-select',
|
|
57
57
|
'aria-label': 'Select rendering mode option',
|
|
58
58
|
}, disabled: !use3d, classes: { root: classes.selectRoot }, children: options.map(name => (_jsx("option", { value: name, children: name }, name))) })] }));
|
|
59
59
|
}
|
|
60
|
-
const ReCenterButton = ({ setViewState, use3d, spatialHeight, spatialWidth, loader, modelMatrix, }) => (_jsx(Grid, {
|
|
60
|
+
const ReCenterButton = ({ setViewState, use3d, spatialHeight, spatialWidth, loader, modelMatrix, }) => (_jsx(Grid, { size: "auto", children: _jsx(Button, { onClick: () => {
|
|
61
61
|
const defaultViewState = viv.getDefaultInitialViewState(loader.data, { height: spatialHeight, width: spatialWidth }, 1.5, use3d, new Matrix4(modelMatrix));
|
|
62
62
|
setViewState({
|
|
63
63
|
...defaultViewState,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-channel-controls.d.ts","sourceRoot":"","sources":["../src/shared-channel-controls.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH;;;;;
|
|
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;;;;;gBAeC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Checkbox,
|
|
3
|
+
import { Checkbox, NativeSelect } from '@vitessce/styles';
|
|
4
4
|
import { useSelectStyles } from './styles.js';
|
|
5
5
|
/**
|
|
6
6
|
* Dropdown for selecting a channel.
|
|
@@ -10,8 +10,8 @@ import { useSelectStyles } from './styles.js';
|
|
|
10
10
|
* @prop {number} selectionIndex Current numeric index of a selection.
|
|
11
11
|
*/
|
|
12
12
|
export function ChannelSelectionDropdown({ handleChange, disabled, channelOptions, selectionIndex, }) {
|
|
13
|
-
const classes = useSelectStyles();
|
|
14
|
-
return (_jsx(
|
|
13
|
+
const { classes } = useSelectStyles();
|
|
14
|
+
return (_jsx(NativeSelect, { classes: { root: classes.selectRoot }, value: selectionIndex, onChange: e => handleChange(Number(e.target.value)), inputProps: { 'aria-label': 'Select a channel' }, children: channelOptions.map((opt, i) => (_jsx("option", { disabled: disabled, value: i, children: opt }, opt))) }));
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Checkbox for toggling on/off of a channel.
|
|
@@ -21,5 +21,7 @@ export function ChannelSelectionDropdown({ handleChange, disabled, channelOption
|
|
|
21
21
|
* @prop {function} toggle Callback for toggling on/off.
|
|
22
22
|
*/
|
|
23
23
|
export function ChannelVisibilityCheckbox({ color, checked, toggle, disabled, }) {
|
|
24
|
-
return (_jsx(Checkbox, { onChange: toggle, checked: checked, disabled: disabled, style: { color, '&$checked': { color } },
|
|
24
|
+
return (_jsx(Checkbox, { onChange: toggle, checked: checked, disabled: disabled, sx: { paddingLeft: 0 }, style: { color, '&$checked': { color } }, slotProps: {
|
|
25
|
+
input: { 'aria-label': 'Toggle on or off a channel' },
|
|
26
|
+
} }));
|
|
25
27
|
}
|
package/dist-tsc/styles.d.ts
CHANGED
|
@@ -1,9 +1,73 @@
|
|
|
1
|
-
export const useSpanStyles: (
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export const useSpanStyles: (params: void, muiStyleOverridesParams?: {
|
|
2
|
+
props: Record<string, unknown>;
|
|
3
|
+
ownerState?: Record<string, unknown> | undefined;
|
|
4
|
+
} | undefined) => {
|
|
5
|
+
classes: Record<"span", string>;
|
|
6
|
+
theme: import("@mui/material").Theme;
|
|
7
|
+
css: import("tss-react").Css;
|
|
8
|
+
cx: import("tss-react").Cx;
|
|
9
|
+
};
|
|
10
|
+
export const useChannelSliderStyles: (params: void, muiStyleOverridesParams?: {
|
|
11
|
+
props: Record<string, unknown>;
|
|
12
|
+
ownerState?: Record<string, unknown> | undefined;
|
|
13
|
+
} | undefined) => {
|
|
14
|
+
classes: Record<"valueLabel", string>;
|
|
15
|
+
theme: import("@mui/material").Theme;
|
|
16
|
+
css: import("tss-react").Css;
|
|
17
|
+
cx: import("tss-react").Cx;
|
|
18
|
+
};
|
|
19
|
+
export const useSelectStyles: (params: void, muiStyleOverridesParams?: {
|
|
20
|
+
props: Record<string, unknown>;
|
|
21
|
+
ownerState?: Record<string, unknown> | undefined;
|
|
22
|
+
} | undefined) => {
|
|
23
|
+
classes: Record<"selectRoot", string>;
|
|
24
|
+
theme: import("@mui/material").Theme;
|
|
25
|
+
css: import("tss-react").Css;
|
|
26
|
+
cx: import("tss-react").Cx;
|
|
27
|
+
};
|
|
28
|
+
export const useControllerSectionStyles: (params: void, muiStyleOverridesParams?: {
|
|
29
|
+
props: Record<string, unknown>;
|
|
30
|
+
ownerState?: Record<string, unknown> | undefined;
|
|
31
|
+
} | undefined) => {
|
|
32
|
+
classes: Record<"layerControllerRoot" | "accordionRoot" | "layerControllerGrid", string>;
|
|
33
|
+
theme: import("@mui/material").Theme;
|
|
34
|
+
css: import("tss-react").Css;
|
|
35
|
+
cx: import("tss-react").Cx;
|
|
36
|
+
};
|
|
37
|
+
export const useAccordionStyles: (params: void, muiStyleOverridesParams?: {
|
|
38
|
+
props: Record<string, unknown>;
|
|
39
|
+
ownerState?: Record<string, unknown> | undefined;
|
|
40
|
+
} | undefined) => {
|
|
41
|
+
classes: Record<"content" | "accordionVisibilityIconBox" | "accordionNameBox" | "accordionDetailsRoot" | "accordionSummaryRoot" | "expanded" | "expandIcon", string>;
|
|
42
|
+
theme: import("@mui/material").Theme;
|
|
43
|
+
css: import("tss-react").Css;
|
|
44
|
+
cx: import("tss-react").Cx;
|
|
45
|
+
};
|
|
46
|
+
export const useInputLabelStyles: (params: void, muiStyleOverridesParams?: {
|
|
47
|
+
props: Record<string, unknown>;
|
|
48
|
+
ownerState?: Record<string, unknown> | undefined;
|
|
49
|
+
} | undefined) => {
|
|
50
|
+
classes: Record<"inputLabelRoot", string>;
|
|
51
|
+
theme: import("@mui/material").Theme;
|
|
52
|
+
css: import("tss-react").Css;
|
|
53
|
+
cx: import("tss-react").Cx;
|
|
54
|
+
};
|
|
55
|
+
export const useOverflowEllipsisGridStyles: (params: void, muiStyleOverridesParams?: {
|
|
56
|
+
props: Record<string, unknown>;
|
|
57
|
+
ownerState?: Record<string, unknown> | undefined;
|
|
58
|
+
} | undefined) => {
|
|
59
|
+
classes: Record<"item", string>;
|
|
60
|
+
theme: import("@mui/material").Theme;
|
|
61
|
+
css: import("tss-react").Css;
|
|
62
|
+
cx: import("tss-react").Cx;
|
|
63
|
+
};
|
|
64
|
+
export const useSelectionSliderStyles: (params: void, muiStyleOverridesParams?: {
|
|
65
|
+
props: Record<string, unknown>;
|
|
66
|
+
ownerState?: Record<string, unknown> | undefined;
|
|
67
|
+
} | undefined) => {
|
|
68
|
+
classes: Record<"selectionSliderRoot" | "markActive", string>;
|
|
69
|
+
theme: import("@mui/material").Theme;
|
|
70
|
+
css: import("tss-react").Css;
|
|
71
|
+
cx: import("tss-react").Cx;
|
|
72
|
+
};
|
|
9
73
|
//# sourceMappingURL=styles.d.ts.map
|