@vitessce/layer-controller 3.5.11 → 3.6.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.
Files changed (48) hide show
  1. package/dist/deflate-DcFBP_ON.js +10 -0
  2. package/dist/{index-9f5d422b.js → index-BYqNjxB4.js} +68409 -65627
  3. package/dist/index.js +1 -4
  4. package/dist/{jpeg-de2a446b.js → jpeg-BRMnDFy7.js} +20 -4
  5. package/dist/lerc-edG1hf7C.js +2020 -0
  6. package/dist/{lzw-fcb90a13.js → lzw-ByU_vDUr.js} +1 -4
  7. package/dist/{packbits-37339fac.js → packbits-6stor0im.js} +1 -4
  8. package/dist/{pako.esm-68f84e2a.js → pako.esm-SxljTded.js} +33 -1839
  9. package/dist/{raw-043cf610.js → raw-CTEIV_TP.js} +1 -4
  10. package/dist/{webimage-22a3672d.js → webimage-BPClhqkm.js} +1 -4
  11. package/dist-tsc/BitmaskChannelController.d.ts.map +1 -1
  12. package/dist-tsc/BitmaskChannelController.js +2 -3
  13. package/dist-tsc/ChannelOptions.d.ts.map +1 -1
  14. package/dist-tsc/ChannelOptions.js +4 -5
  15. package/dist-tsc/ColorPalette.d.ts.map +1 -1
  16. package/dist-tsc/ColorPalette.js +4 -5
  17. package/dist-tsc/ImageAddButton.d.ts.map +1 -1
  18. package/dist-tsc/ImageAddButton.js +3 -4
  19. package/dist-tsc/LayerController.d.ts.map +1 -1
  20. package/dist-tsc/LayerController.js +16 -23
  21. package/dist-tsc/LayerControllerSubscriber.d.ts.map +1 -1
  22. package/dist-tsc/LayerControllerSubscriber.js +11 -9
  23. package/dist-tsc/LayerOptions.d.ts.map +1 -1
  24. package/dist-tsc/LayerOptions.js +15 -15
  25. package/dist-tsc/RasterChannelController.js +4 -4
  26. package/dist-tsc/VectorLayerController.js +4 -4
  27. package/dist-tsc/VolumeOptions.d.ts.map +1 -1
  28. package/dist-tsc/VolumeOptions.js +7 -7
  29. package/dist-tsc/shared-channel-controls.d.ts.map +1 -1
  30. package/dist-tsc/shared-channel-controls.js +6 -4
  31. package/dist-tsc/styles.d.ts +72 -8
  32. package/dist-tsc/styles.d.ts.map +1 -1
  33. package/dist-tsc/styles.js +31 -16
  34. package/package.json +10 -11
  35. package/src/BitmaskChannelController.js +4 -5
  36. package/src/ChannelOptions.js +4 -5
  37. package/src/ColorPalette.js +4 -5
  38. package/src/ImageAddButton.js +3 -4
  39. package/src/LayerController.js +34 -37
  40. package/src/LayerControllerSubscriber.js +13 -7
  41. package/src/LayerOptions.js +21 -24
  42. package/src/RasterChannelController.js +8 -8
  43. package/src/VectorLayerController.js +7 -7
  44. package/src/VolumeOptions.js +12 -14
  45. package/src/shared-channel-controls.js +8 -6
  46. package/src/styles.js +31 -16
  47. package/dist/deflate-8a6ed1b8.js +0 -13
  48. package/dist/lerc-e50baa38.js +0 -2014
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import { Checkbox, Select } from '@material-ui/core';
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(Select, { classes: { root: classes.selectRoot }, native: true, 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))) }));
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 } }, inputProps: { 'aria-label': 'Toggle on or off a channel' } }));
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
  }
@@ -1,9 +1,73 @@
1
- export const useSpanStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"span">;
2
- export const useChannelSliderStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"valueLabel">;
3
- export const useSelectStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"selectRoot">;
4
- export const useControllerSectionStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"layerControllerRoot" | "layerControllerGrid">;
5
- export const useAccordionStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"content" | "expanded" | "accordionDetailsRoot" | "accordionSummaryRoot" | "expandIcon">;
6
- export const useInputLabelStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"inputLabelRoot">;
7
- export const useOverflowEllipsisGridStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"item">;
8
- export const useSelectionSliderStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"selectionSliderRoot" | "markActive">;
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
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.js"],"names":[],"mappings":"AAEA,gHAOI;AAEJ,+HAQI;AAEJ,wHAQI;AAEJ,oKASI;AAEJ,sMAsBI;AAEJ,gIAII;AAEJ,gIAOI;AAEJ,yJAOI"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.js"],"names":[],"mappings":"AAEA;;cAgCM,CAAC;;;kBAKL,eAGQ;gBAAyB,WAAU;eACrC,WAAU;EAlCd;AAEJ;;cAuBM,CAAC;;;kBAKL,eAGQ;gBAAyB,WAAU;eACrC,WAAU;EA5Bd;AAEJ;;cAiBM,CAAC;;;kBAKL,eAGQ;gBAAyB,WAAU;eACrC,WAAU;EAlBd;AAEJ;;cAOM,CAAC;;;kBAKL,eAGQ;gBAAyB,WAAU;eACrC,WAAU;EAHd;AAEJ;;cARM,CAAC;;;kBAKL,eAGQ;gBAAyB,WAAU;eACrC,WAAU;EAoCd;AAEJ;;cA/CM,CAAC;;;kBAKL,eAGQ;gBAAyB,WAAU;eACrC,WAAU;EA0Cd;AAEJ;;cArDM,CAAC;;;kBAKL,eAGQ;gBAAyB,WAAU;eACrC,WAAU;EAmDd;AAEJ;;cA9DM,CAAC;;;kBAKL,eAGQ;gBAAyB,WAAU;eACrC,WAAU;EA4Dd"}
@@ -1,5 +1,5 @@
1
- import { makeStyles } from '@material-ui/core';
2
- export const useSpanStyles = makeStyles(() => ({
1
+ import { makeStyles } from '@vitessce/styles';
2
+ export const useSpanStyles = makeStyles()(() => ({
3
3
  span: {
4
4
  width: '70px',
5
5
  textAlign: 'center',
@@ -7,35 +7,50 @@ export const useSpanStyles = makeStyles(() => ({
7
7
  paddingRight: '2px',
8
8
  },
9
9
  }));
10
- export const useChannelSliderStyles = makeStyles(theme => ({
10
+ export const useChannelSliderStyles = makeStyles()(() => ({
11
11
  valueLabel: {
12
12
  marginTop: '7px',
13
- '& span': {
14
- color: theme.palette.secondaryForeground, // Change color here
15
- backgroundColor: theme.palette.secondaryBackgroundDim, // Change color here
16
- },
17
13
  },
18
14
  }));
19
- export const useSelectStyles = makeStyles(() => ({
15
+ export const useSelectStyles = makeStyles()(() => ({
20
16
  selectRoot: {
21
17
  padding: 0,
22
18
  height: 'auto',
23
- margin: '4px 0',
24
- fontSize: '14px',
19
+ margin: 0,
20
+ fontSize: '14px !important',
25
21
  width: '100%',
26
22
  },
27
23
  }));
28
- export const useControllerSectionStyles = makeStyles(() => ({
24
+ export const useControllerSectionStyles = makeStyles()(theme => ({
29
25
  layerControllerRoot: {
30
26
  width: '100%',
31
27
  flexDirection: 'column',
32
28
  padding: '0px 8px',
29
+ backgroundColor: theme.palette.paperBackground,
30
+ },
31
+ accordionRoot: {
32
+ backgroundColor: theme.palette.paperBackground,
33
33
  },
34
34
  layerControllerGrid: {
35
35
  marginTop: '10px',
36
36
  },
37
37
  }));
38
- export const useAccordionStyles = makeStyles(theme => ({
38
+ export const useAccordionStyles = makeStyles()(theme => ({
39
+ accordionVisibilityIconBox: {
40
+ margin: 0,
41
+ padding: 0,
42
+ minWidth: 0,
43
+ cursor: 'pointer',
44
+ display: 'inline-flex',
45
+ '&:hover': {
46
+ opacity: 0.8,
47
+ },
48
+ color: theme.palette.primary[500],
49
+ },
50
+ accordionNameBox: {
51
+ marginLeft: '10px',
52
+ fontSize: '14px !important',
53
+ },
39
54
  accordionDetailsRoot: {
40
55
  width: '100%',
41
56
  flexDirection: 'column',
@@ -45,7 +60,7 @@ export const useAccordionStyles = makeStyles(theme => ({
45
60
  padding: '0px 8px',
46
61
  },
47
62
  content: {
48
- margin: '4px 0px',
63
+ margin: '4px 0px !important',
49
64
  minWidth: '0px',
50
65
  },
51
66
  expanded: {
@@ -58,12 +73,12 @@ export const useAccordionStyles = makeStyles(theme => ({
58
73
  },
59
74
  },
60
75
  }));
61
- export const useInputLabelStyles = makeStyles(() => ({
76
+ export const useInputLabelStyles = makeStyles()(() => ({
62
77
  inputLabelRoot: {
63
78
  fontSize: '14px',
64
79
  },
65
80
  }));
66
- export const useOverflowEllipsisGridStyles = makeStyles(() => ({
81
+ export const useOverflowEllipsisGridStyles = makeStyles()(() => ({
67
82
  item: {
68
83
  width: '100%',
69
84
  overflow: 'hidden',
@@ -71,7 +86,7 @@ export const useOverflowEllipsisGridStyles = makeStyles(() => ({
71
86
  textOverflow: 'ellipsis',
72
87
  },
73
88
  }));
74
- export const useSelectionSliderStyles = makeStyles(() => ({
89
+ export const useSelectionSliderStyles = makeStyles()(() => ({
75
90
  selectionSliderRoot: {
76
91
  marginTop: '7px',
77
92
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/layer-controller",
3
- "version": "3.5.11",
3
+ "version": "3.6.0",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -16,24 +16,23 @@
16
16
  "dist-tsc"
17
17
  ],
18
18
  "dependencies": {
19
- "@material-ui/core": "~4.12.3",
20
- "@material-ui/icons": "~4.11.2",
21
19
  "lodash-es": "^4.17.21",
22
20
  "math.gl": "^3.5.6",
23
21
  "react-aria": "^3.28.0",
24
- "@vitessce/constants-internal": "3.5.11",
25
- "@vitessce/gl": "3.5.11",
26
- "@vitessce/spatial-utils": "3.5.11",
27
- "@vitessce/utils": "3.5.11",
28
- "@vitessce/vit-s": "3.5.11"
22
+ "@vitessce/styles": "3.6.0",
23
+ "@vitessce/constants-internal": "3.6.0",
24
+ "@vitessce/spatial-utils": "3.6.0",
25
+ "@vitessce/utils": "3.6.0",
26
+ "@vitessce/vit-s": "3.6.0",
27
+ "@vitessce/gl": "3.6.0"
29
28
  },
30
29
  "devDependencies": {
31
30
  "react": "^18.0.0",
32
- "vite": "^4.3.0",
33
- "vitest": "^0.32.2"
31
+ "vite": "^6.3.5",
32
+ "vitest": "^3.1.4"
34
33
  },
35
34
  "peerDependencies": {
36
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
35
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
37
36
  },
38
37
  "scripts": {
39
38
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { RemoveCircle as RemoveCircleIcon } from '@material-ui/icons';
3
- import { IconButton, Grid } from '@material-ui/core';
2
+ import { RemoveCircle as RemoveCircleIcon, IconButton, Grid } from '@vitessce/styles';
4
3
  import { ChannelSelectionDropdown, ChannelVisibilityCheckbox } from './shared-channel-controls.js';
5
4
 
6
5
  /**
@@ -35,14 +34,14 @@ function BitmaskChannelController({
35
34
  const createSelection = index => ({ [dimName]: index });
36
35
  return (
37
36
  <Grid container direction="row" justifyContent="space-between">
38
- <Grid item xs={2}>
37
+ <Grid size={2}>
39
38
  <ChannelVisibilityCheckbox
40
39
  color={[220, 220, 220]}
41
40
  checked={visibility}
42
41
  toggle={() => handlePropertyChange('visible', !visibility)}
43
42
  />
44
43
  </Grid>
45
- <Grid item xs={9}>
44
+ <Grid size={9}>
46
45
  <ChannelSelectionDropdown
47
46
  handleChange={v => handlePropertyChange('selection', createSelection(v))}
48
47
  selectionIndex={selectionIndex}
@@ -50,7 +49,7 @@ function BitmaskChannelController({
50
49
  channelOptions={channelOptions}
51
50
  />
52
51
  </Grid>
53
- <Grid item xs={1}>
52
+ <Grid size={1}>
54
53
  <IconButton
55
54
  onClick={handleChannelRemove}
56
55
  style={{ padding: '6px 6px 6px 0px' }}
@@ -1,11 +1,10 @@
1
1
  import React, { useState } from 'react';
2
- import { makeStyles, MenuItem } from '@material-ui/core';
3
- import { MoreVert as MoreVertIcon } from '@material-ui/icons';
2
+ import { makeStyles, MenuItem, MoreVert as MoreVertIcon } from '@vitessce/styles';
4
3
  import { PopperMenu } from '@vitessce/vit-s';
5
4
  import { useSpanStyles } from './styles.js';
6
5
  import ColorPalette from './ColorPalette.js';
7
6
 
8
- const useStyles = makeStyles(() => ({
7
+ const useStyles = makeStyles()(() => ({
9
8
  menuButton: {
10
9
  backgroundColor: 'transparent',
11
10
  },
@@ -20,7 +19,7 @@ const useStyles = makeStyles(() => ({
20
19
 
21
20
  function MuiSpan(props) {
22
21
  const { children } = props;
23
- const classes = useSpanStyles();
22
+ const { classes } = useSpanStyles();
24
23
  return <span className={classes.span}>{children}</span>;
25
24
  }
26
25
 
@@ -33,7 +32,7 @@ function MuiSpan(props) {
33
32
  function ChannelOptions({ handlePropertyChange, handleChannelRemove, handleIQRUpdate }) {
34
33
  const [open, setOpen] = useState(false);
35
34
 
36
- const classes = useStyles();
35
+ const { classes } = useStyles();
37
36
 
38
37
  const handleColorSelect = (color) => {
39
38
  handlePropertyChange('color', color);
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
- import { IconButton, makeStyles } from '@material-ui/core';
3
- import { Lens as LensIcon } from '@material-ui/icons';
2
+ import { IconButton, makeStyles, Lens as LensIcon } from '@vitessce/styles';
4
3
  import { VIEWER_PALETTE } from '@vitessce/utils';
5
4
 
6
- const useStyles = makeStyles(theme => ({
5
+ const useStyles = makeStyles()(theme => ({
7
6
  paletteContainer: {
8
7
  width: '70px',
9
8
  height: '40px',
@@ -20,12 +19,12 @@ const useStyles = makeStyles(theme => ({
20
19
  width: '17px',
21
20
  height: '17px',
22
21
  stroke: theme.palette.action.selected,
23
- 'stroke-width': '1px',
22
+ strokeWidth: '1px',
24
23
  },
25
24
  }));
26
25
 
27
26
  const ColorPalette = ({ handleChange }) => {
28
- const classes = useStyles();
27
+ const { classes } = useStyles();
29
28
  return (
30
29
  <div className={classes.paletteContainer} aria-label="Color swatch">
31
30
  {VIEWER_PALETTE.map(color => (
@@ -1,9 +1,8 @@
1
1
  import React, { useState } from 'react';
2
- import { makeStyles, MenuItem } from '@material-ui/core';
3
- import { Add as AddIcon } from '@material-ui/icons';
2
+ import { makeStyles, MenuItem, Add as AddIcon } from '@vitessce/styles';
4
3
  import { PopperMenu } from '@vitessce/vit-s';
5
4
 
6
- const useStyles = makeStyles(() => ({
5
+ const useStyles = makeStyles()(() => ({
7
6
  addButton: {
8
7
  marginTop: '10px',
9
8
  marginBottom: '10px',
@@ -22,7 +21,7 @@ function ImageAddIcon() {
22
21
 
23
22
  function ImageAddButton({ imageOptions, handleImageAdd }) {
24
23
  const [open, setOpen] = useState(false);
25
- const classes = useStyles();
24
+ const { classes } = useStyles();
26
25
 
27
26
  const handleAdd = (imgData) => {
28
27
  setOpen(prev => !prev);
@@ -4,7 +4,6 @@ import { viv } from '@vitessce/gl';
4
4
  import {
5
5
  GLOBAL_LABELS,
6
6
  getSourceFromLoader,
7
- isRgb,
8
7
  getMultiSelectionStats,
9
8
  DOMAINS,
10
9
  canLoadResolution,
@@ -13,13 +12,12 @@ import {
13
12
  import {
14
13
  Grid, Button, Slider, Tabs, Tab, InputLabel,
15
14
  Accordion, AccordionDetails, AccordionSummary,
16
- } from '@material-ui/core';
17
- import {
15
+ Box,
18
16
  Add as AddIcon,
19
17
  ExpandMore as ExpandMoreIcon,
20
18
  Visibility as VisibilityIcon,
21
19
  VisibilityOff as VisibilityOffIcon,
22
- } from '@material-ui/icons';
20
+ } from '@vitessce/styles';
23
21
 
24
22
  import LayerOptions from './LayerOptions.js';
25
23
  import VolumeOptions from './VolumeOptions.js';
@@ -103,7 +101,7 @@ export default function LayerController(props) {
103
101
  disabled,
104
102
  spatialHeight,
105
103
  spatialWidth,
106
- disableChannelsIfRgbDetected,
104
+ photometricInterpretation,
107
105
  shouldShowRemoveLayerButton,
108
106
  } = props;
109
107
 
@@ -399,10 +397,10 @@ export default function LayerController(props) {
399
397
  );
400
398
  }
401
399
 
402
- const controllerSectionClasses = useControllerSectionStyles();
403
- const accordionClasses = useAccordionStyles();
404
- const inputLabelClasses = useInputLabelStyles();
405
- const overflowEllipsisGridClasses = useOverflowEllipsisGridStyles();
400
+ const { classes: controllerSectionClasses } = useControllerSectionStyles();
401
+ const { classes: accordionClasses } = useAccordionStyles();
402
+ const { classes: inputLabelClasses } = useInputLabelStyles();
403
+ const { classes: overflowEllipsisGridClasses } = useOverflowEllipsisGridStyles();
406
404
 
407
405
  const { visible } = layer;
408
406
  const visibleSetting = typeof visible === 'boolean' ? visible : true;
@@ -432,9 +430,7 @@ export default function LayerController(props) {
432
430
  handleGlobalChannelsSelectionChange
433
431
  }
434
432
  handleTransparentColorChange={setTransparentColor}
435
- disableChannelsIfRgbDetected={
436
- isRgb(loader, channels) && disableChannelsIfRgbDetected
437
- }
433
+ disableChannelsIfRgbDetected={photometricInterpretation === 'RGB'}
438
434
  handleDomainChange={handleDomainChange}
439
435
  shouldShowTransparentColor={shouldShowTransparentColor}
440
436
  shouldShowDomain={shouldShowDomain}
@@ -451,10 +447,10 @@ export default function LayerController(props) {
451
447
  spatialWidth={spatialWidth}
452
448
  modelMatrix={modelMatrix}
453
449
  />
454
- {isRgb(loader, channels) && disableChannelsIfRgbDetected
450
+ {photometricInterpretation === 'RGB'
455
451
  ? null
456
452
  : channelControllers}
457
- {isRgb(loader, channels) && disableChannelsIfRgbDetected ? null : (
453
+ {photometricInterpretation === 'RGB' ? null : (
458
454
  <Button
459
455
  disabled={channels.length === viv.MAX_CHANNELS}
460
456
  onClick={handleChannelAdd}
@@ -471,30 +467,36 @@ export default function LayerController(props) {
471
467
  );
472
468
  return (
473
469
  <Accordion
474
- className={controllerSectionClasses.layerControllerRoot}
470
+ slotProps={{
471
+ root: { elevation: 4, className: controllerSectionClasses.accordionRoot },
472
+ }}
475
473
  onChange={(e, expanded) => !disabled
476
474
  && setIsExpanded(
477
475
  expanded && e?.target?.attributes?.role?.value === 'presentation',
478
476
  )
479
477
  }
480
- TransitionProps={{ enter: false }}
481
478
  expanded={!disabled && isExpanded}
482
479
  id={`layer-controls-accordion-${layerControlsId}`}
483
480
  >
484
481
  <AccordionSummary
485
- classes={{
486
- root: accordionClasses.accordionSummaryRoot,
487
- content: accordionClasses.content,
488
- expanded: accordionClasses.expanded,
489
- expandIcon: accordionClasses.expandIcon,
482
+ slotProps={{
483
+ content: { className: accordionClasses.content },
490
484
  }}
491
485
  expandIcon={<ExpandMoreIcon role="presentation" />}
492
486
  aria-controls={`layer-${name}-controls`}
493
487
  aria-expanded={isExpanded}
494
488
  >
495
- <Grid container direction="column" m={1} justifyContent="center">
496
- <Grid item classes={{ item: overflowEllipsisGridClasses.item }}>
497
- <Button
489
+ <Grid container direction="column" justifyContent="center" sx={{ flexGrow: 1 }}>
490
+ <Grid
491
+ container
492
+ size={12}
493
+ direction="row"
494
+ alignItems="flex-start"
495
+ classes={{ item: overflowEllipsisGridClasses.item }}
496
+ >
497
+ <Box
498
+ component="div"
499
+ role="button"
498
500
  aria-label="Toggle layer visibility"
499
501
  onClick={(e) => {
500
502
  if (!disabled) {
@@ -504,25 +506,21 @@ export default function LayerController(props) {
504
506
  setVisible(nextVisible);
505
507
  }
506
508
  }}
507
- style={{
508
- marginRight: 8,
509
- marginBottom: 2,
510
- padding: 0,
511
- minWidth: 0,
512
- }}
509
+ className={accordionClasses.accordionVisibilityIconBox}
513
510
  >
514
511
  <Visibility />
515
- </Button>
516
- {name}
512
+ </Box>
513
+ <Box component="div" className={accordionClasses.accordionNameBox}>
514
+ {name}
515
+ </Box>
517
516
  </Grid>
518
517
  {!disabled && !isExpanded && !use3d && (
519
518
  <Grid
520
519
  container
521
520
  direction="row"
522
- alignItems="center"
523
- justifyContent="center"
521
+ sx={{ justifyContent: 'flex-start', flexGrow: 1 }}
524
522
  >
525
- <Grid item xs={6}>
523
+ <Grid size={5}>
526
524
  <InputLabel
527
525
  htmlFor={`layer-${name}-opacity-closed`}
528
526
  classes={{ root: inputLabelClasses.inputLabelRoot }}
@@ -530,7 +528,7 @@ export default function LayerController(props) {
530
528
  Opacity:
531
529
  </InputLabel>
532
530
  </Grid>
533
- <Grid item xs={6}>
531
+ <Grid size={6}>
534
532
  <Slider
535
533
  id={`layer-${name}-opacity-closed`}
536
534
  value={opacity}
@@ -548,7 +546,6 @@ export default function LayerController(props) {
548
546
  </Grid>
549
547
  </AccordionSummary>
550
548
  <AccordionDetails
551
- classes={{ root: accordionClasses.accordionDetailsRoot }}
552
549
  id={`layer-${name}-controls`}
553
550
  >
554
551
  {useVolumeTabs ? (
@@ -3,7 +3,7 @@
3
3
  import React, {
4
4
  useCallback, useRef, forwardRef,
5
5
  } from 'react';
6
- import { Grid } from '@material-ui/core';
6
+ import { Grid } from '@vitessce/styles';
7
7
  import {
8
8
  TitleInfo,
9
9
  useReady,
@@ -54,6 +54,7 @@ const LayerControllerMemoized = React.memo(
54
54
  setAreLoadingImageChannels,
55
55
  handleRasterLayerChange,
56
56
  handleRasterLayerRemove,
57
+ photometricInterpretation,
57
58
 
58
59
  obsSegmentationsType,
59
60
  segmentationLayerLoaders,
@@ -143,8 +144,7 @@ const LayerControllerMemoized = React.memo(
143
144
  <Grid
144
145
  // eslint-disable-next-line react/no-array-index-key
145
146
  key={`${dataset}-raster-${index}-${i}`}
146
- item
147
- style={{ marginTop: '10px' }}
147
+ sx={{ marginTop: '10px' }}
148
148
  >
149
149
  <LayerController
150
150
  name={layerMeta.name}
@@ -225,8 +225,7 @@ const LayerControllerMemoized = React.memo(
225
225
  <Grid
226
226
  // eslint-disable-next-line react/no-array-index-key
227
227
  key={`${dataset}-raster-${index}-${i}`}
228
- item
229
- style={{ marginTop: '10px' }}
228
+ sx={{ marginTop: '10px' }}
230
229
  >
231
230
  <LayerController
232
231
  name={layerMeta.name}
@@ -254,6 +253,7 @@ const LayerControllerMemoized = React.memo(
254
253
  && layerIs3DIndex !== i
255
254
  }
256
255
  disableChannelsIfRgbDetected={disableChannelsIfRgbDetected}
256
+ photometricInterpretation={photometricInterpretation}
257
257
  imageLayerCallbacks={imageLayerCallbacks}
258
258
  setImageLayerCallback={setImageLayerCallback}
259
259
  setViewState={({
@@ -280,7 +280,7 @@ const LayerControllerMemoized = React.memo(
280
280
  })}
281
281
  {shouldShowImageLayerButton
282
282
  ? (
283
- <Grid item>
283
+ <Grid>
284
284
  <ImageAddButton
285
285
  imageOptions={imageLayerMeta}
286
286
  handleImageAdd={handleImageAdd}
@@ -334,6 +334,7 @@ export function LayerControllerSubscriber(props) {
334
334
  spatialImageLayer: rasterLayers,
335
335
  spatialSegmentationLayer: cellsLayer,
336
336
  spatialPointLayer: moleculesLayer,
337
+ photometricInterpretation: photometricInterpretationFromCoordination,
337
338
  },
338
339
  {
339
340
  setSpatialImageLayer: setRasterLayers,
@@ -399,13 +400,17 @@ export function LayerControllerSubscriber(props) {
399
400
  { spatialImageLayer: rasterLayers },
400
401
  {}, // TODO: which values to match on
401
402
  );
402
- const { loaders: imageLayerLoaders, meta: imageLayerMeta } = image || {};
403
+ const { loaders: imageLayerLoaders, meta: imageLayerMeta, instance } = image || {};
403
404
  const isReady = useReady([
404
405
  obsLocationsStatus,
405
406
  obsSegmentationsStatus,
406
407
  imageStatus,
407
408
  ]);
408
409
 
410
+ const photometricInterpretation = (
411
+ photometricInterpretationFromCoordination
412
+ ?? instance?.getPhotometricInterpretation()
413
+ );
409
414
  const segmentationLayerLoaders = obsSegmentations && obsSegmentationsType === 'bitmask' ? obsSegmentations.loaders : null;
410
415
  const segmentationLayerMeta = obsSegmentations && obsSegmentationsType === 'bitmask' ? obsSegmentations.meta : null;
411
416
 
@@ -481,6 +486,7 @@ export function LayerControllerSubscriber(props) {
481
486
  setAreLoadingImageChannels={setAreLoadingImageChannels}
482
487
  handleRasterLayerChange={handleRasterLayerChange}
483
488
  handleRasterLayerRemove={handleRasterLayerRemove}
489
+ photometricInterpretation={photometricInterpretation}
484
490
 
485
491
  obsSegmentationsType={obsSegmentationsType}
486
492
  segmentationLayerLoaders={segmentationLayerLoaders}