@vitessce/layer-controller 3.0.0 → 3.1.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 → deflate-806a8813.js} +1 -1
- package/dist/{index-841a1af6.js → index-f05b8dd7.js} +474 -769
- package/dist/index.js +1 -1
- package/dist/{jpeg-6023316d.js → jpeg-ad5bae1d.js} +1 -1
- package/dist/{lerc-82182c45.js → lerc-588ff773.js} +1 -1
- package/dist/{lzw-2ab01db2.js → lzw-8827a384.js} +1 -1
- package/dist/{packbits-2633f360.js → packbits-88aef591.js} +1 -1
- package/dist/{raw-51e455c7.js → raw-86577f38.js} +1 -1
- package/dist/{webimage-bbb56d18.js → webimage-c9cb4e30.js} +1 -1
- package/dist-tsc/ColorPalette.js +2 -2
- package/dist-tsc/LayerController.d.ts.map +1 -1
- package/dist-tsc/LayerController.js +13 -5
- package/dist-tsc/LayerControllerSubscriber.js +3 -3
- package/dist-tsc/LayerOptions.d.ts.map +1 -1
- package/dist-tsc/LayerOptions.js +3 -2
- package/dist-tsc/RasterChannelController.test.js +1 -0
- package/dist-tsc/VectorLayerController.js +1 -1
- package/dist-tsc/styles.d.ts +5 -73
- package/dist-tsc/styles.d.ts.map +1 -1
- package/dist-tsc/styles.js +14 -37
- package/package.json +8 -8
- package/src/ColorPalette.js +2 -2
- package/src/LayerController.js +28 -14
- package/src/LayerControllerSubscriber.js +3 -3
- package/src/LayerOptions.js +4 -2
- package/src/RasterChannelController.test.js +1 -0
- package/src/VectorLayerController.js +1 -1
- package/src/styles.js +14 -47
package/src/LayerController.js
CHANGED
|
@@ -4,7 +4,10 @@ import {
|
|
|
4
4
|
GLOBAL_LABELS, getSourceFromLoader, isRgb,
|
|
5
5
|
} from '@vitessce/spatial-utils';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
Grid, Button, Slider, Tabs, Tab, InputLabel,
|
|
9
|
+
Accordion, AccordionDetails, AccordionSummary,
|
|
10
|
+
} from '@material-ui/core';
|
|
8
11
|
import {
|
|
9
12
|
Add as AddIcon,
|
|
10
13
|
ExpandMore as ExpandMoreIcon,
|
|
@@ -18,10 +21,9 @@ import LayerOptions from './LayerOptions.js';
|
|
|
18
21
|
import VolumeOptions from './VolumeOptions.js';
|
|
19
22
|
import {
|
|
20
23
|
useControllerSectionStyles,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
OverflowEllipsisGrid,
|
|
24
|
+
useInputLabelStyles,
|
|
25
|
+
useOverflowEllipsisGridStyles,
|
|
26
|
+
useAccordionStyles,
|
|
25
27
|
} from './styles.js';
|
|
26
28
|
import { getMultiSelectionStats } from './utils.js';
|
|
27
29
|
|
|
@@ -395,6 +397,9 @@ export default function LayerController(props) {
|
|
|
395
397
|
}
|
|
396
398
|
|
|
397
399
|
const controllerSectionClasses = useControllerSectionStyles();
|
|
400
|
+
const accordionClasses = useAccordionStyles();
|
|
401
|
+
const inputLabelClasses = useInputLabelStyles();
|
|
402
|
+
const overflowEllipsisGridClasses = useOverflowEllipsisGridStyles();
|
|
398
403
|
|
|
399
404
|
const { visible } = layer;
|
|
400
405
|
const visibleSetting = typeof visible === 'boolean' ? visible : true;
|
|
@@ -463,7 +468,7 @@ export default function LayerController(props) {
|
|
|
463
468
|
);
|
|
464
469
|
return (
|
|
465
470
|
<Accordion
|
|
466
|
-
className={controllerSectionClasses.
|
|
471
|
+
className={controllerSectionClasses.layerControllerRoot}
|
|
467
472
|
onChange={(e, expanded) => !disabled
|
|
468
473
|
&& setIsExpanded(
|
|
469
474
|
expanded && e?.target?.attributes?.role?.value === 'presentation',
|
|
@@ -472,12 +477,18 @@ export default function LayerController(props) {
|
|
|
472
477
|
TransitionProps={{ enter: false }}
|
|
473
478
|
expanded={!disabled && isExpanded}
|
|
474
479
|
>
|
|
475
|
-
<
|
|
480
|
+
<AccordionSummary
|
|
481
|
+
classes={{
|
|
482
|
+
root: accordionClasses.accordionSummaryRoot,
|
|
483
|
+
content: accordionClasses.content,
|
|
484
|
+
expanded: accordionClasses.expanded,
|
|
485
|
+
expandIcon: accordionClasses.expandIcon,
|
|
486
|
+
}}
|
|
476
487
|
expandIcon={<ExpandMoreIcon role="presentation" />}
|
|
477
488
|
aria-controls={`layer-${name}-controls`}
|
|
478
489
|
>
|
|
479
490
|
<Grid container direction="column" m={1} justifyContent="center">
|
|
480
|
-
<
|
|
491
|
+
<Grid item classes={{ item: overflowEllipsisGridClasses.item }}>
|
|
481
492
|
<Button
|
|
482
493
|
onClick={(e) => {
|
|
483
494
|
if (!disabled) {
|
|
@@ -497,7 +508,7 @@ export default function LayerController(props) {
|
|
|
497
508
|
<Visibility />
|
|
498
509
|
</Button>
|
|
499
510
|
{name}
|
|
500
|
-
</
|
|
511
|
+
</Grid>
|
|
501
512
|
{!disabled && !isExpanded && !use3d && (
|
|
502
513
|
<Grid
|
|
503
514
|
container
|
|
@@ -506,9 +517,12 @@ export default function LayerController(props) {
|
|
|
506
517
|
justifyContent="center"
|
|
507
518
|
>
|
|
508
519
|
<Grid item xs={6}>
|
|
509
|
-
<
|
|
520
|
+
<InputLabel
|
|
521
|
+
htmlFor={`layer-${name}-opacity-closed`}
|
|
522
|
+
classes={{ root: inputLabelClasses.inputLabelRoot }}
|
|
523
|
+
>
|
|
510
524
|
Opacity:
|
|
511
|
-
</
|
|
525
|
+
</InputLabel>
|
|
512
526
|
</Grid>
|
|
513
527
|
<Grid item xs={6}>
|
|
514
528
|
<Slider
|
|
@@ -526,8 +540,8 @@ export default function LayerController(props) {
|
|
|
526
540
|
</Grid>
|
|
527
541
|
)}
|
|
528
542
|
</Grid>
|
|
529
|
-
</
|
|
530
|
-
<
|
|
543
|
+
</AccordionSummary>
|
|
544
|
+
<AccordionDetails classes={{ root: accordionClasses.accordionDetailsRoot }}>
|
|
531
545
|
{useVolumeTabs ? (
|
|
532
546
|
<>
|
|
533
547
|
<Tabs
|
|
@@ -590,7 +604,7 @@ export default function LayerController(props) {
|
|
|
590
604
|
Remove Image Layer
|
|
591
605
|
</Button>
|
|
592
606
|
) : null}
|
|
593
|
-
</
|
|
607
|
+
</AccordionDetails>
|
|
594
608
|
</Accordion>
|
|
595
609
|
);
|
|
596
610
|
}
|
|
@@ -370,7 +370,7 @@ export function LayerControllerSubscriber(props) {
|
|
|
370
370
|
// Get data from loaders using the data hooks.
|
|
371
371
|
// eslint-disable-next-line no-unused-vars
|
|
372
372
|
const [obsLocationsData, obsLocationsStatus] = useObsLocationsData(
|
|
373
|
-
loaders, dataset,
|
|
373
|
+
loaders, dataset, false,
|
|
374
374
|
{ setSpatialPointLayer: setMoleculesLayer },
|
|
375
375
|
{ spatialPointLayer: moleculesLayer },
|
|
376
376
|
{}, // TODO: use obsType once #1240 is merged.
|
|
@@ -379,13 +379,13 @@ export function LayerControllerSubscriber(props) {
|
|
|
379
379
|
{ obsSegmentations, obsSegmentationsType },
|
|
380
380
|
obsSegmentationsStatus,
|
|
381
381
|
] = useObsSegmentationsData(
|
|
382
|
-
loaders, dataset,
|
|
382
|
+
loaders, dataset, false,
|
|
383
383
|
{ setSpatialSegmentationLayer: setCellsLayer },
|
|
384
384
|
{ spatialSegmentationLayer: cellsLayer },
|
|
385
385
|
{}, // TODO: use obsType once #1240 is merged.
|
|
386
386
|
);
|
|
387
387
|
const [{ image }, imageStatus] = useImageData(
|
|
388
|
-
loaders, dataset,
|
|
388
|
+
loaders, dataset, false,
|
|
389
389
|
{ setSpatialImageLayer: setRasterLayers },
|
|
390
390
|
{ spatialImageLayer: rasterLayers },
|
|
391
391
|
{}, // TODO: which values to match on
|
package/src/LayerOptions.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
getBoundingCube, getMultiSelectionStats,
|
|
15
15
|
} from './utils.js';
|
|
16
|
-
import {
|
|
16
|
+
import { useSelectionSliderStyles, useSelectStyles } from './styles.js';
|
|
17
17
|
|
|
18
18
|
const DOMAIN_OPTIONS = ['Full', 'Min/Max'];
|
|
19
19
|
|
|
@@ -270,8 +270,10 @@ function GlobalSelectionSlider({
|
|
|
270
270
|
handleChange,
|
|
271
271
|
possibleValues,
|
|
272
272
|
}) {
|
|
273
|
+
const classes = useSelectionSliderStyles();
|
|
273
274
|
return (
|
|
274
|
-
<
|
|
275
|
+
<Slider
|
|
276
|
+
classes={{ root: classes.selectionSliderRoot, markActive: classes.markActive }}
|
|
275
277
|
value={value}
|
|
276
278
|
// See https://github.com/hms-dbmi/viv/issues/176 for why
|
|
277
279
|
// we have the two handlers.
|
|
@@ -30,7 +30,7 @@ export default function VectorLayerController(props) {
|
|
|
30
30
|
const classes = useControllerSectionStyles();
|
|
31
31
|
return (
|
|
32
32
|
<Grid item style={{ marginTop: '10px' }}>
|
|
33
|
-
<Paper className={classes.
|
|
33
|
+
<Paper className={classes.layerControllerRoot}>
|
|
34
34
|
<Typography
|
|
35
35
|
style={{
|
|
36
36
|
padding: '15px 8px 0px 8px',
|
package/src/styles.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
makeStyles,
|
|
3
|
-
withStyles,
|
|
4
|
-
AccordionSummary,
|
|
5
|
-
AccordionDetails,
|
|
6
|
-
InputLabel,
|
|
7
|
-
Slider,
|
|
8
|
-
Grid,
|
|
9
|
-
} from '@material-ui/core';
|
|
1
|
+
import { makeStyles } from '@material-ui/core';
|
|
10
2
|
|
|
11
3
|
const useSpanStyles = makeStyles(() => ({
|
|
12
4
|
span: {
|
|
@@ -31,49 +23,24 @@ export const useSelectStyles = makeStyles(() => ({
|
|
|
31
23
|
},
|
|
32
24
|
}));
|
|
33
25
|
|
|
34
|
-
export const useOptionStyles = withStyles(theme => ({
|
|
35
|
-
paper: {
|
|
36
|
-
backgroundColor: theme.palette.background.paper,
|
|
37
|
-
},
|
|
38
|
-
span: {
|
|
39
|
-
width: '70px',
|
|
40
|
-
textAlign: 'center',
|
|
41
|
-
paddingLeft: '2px',
|
|
42
|
-
paddingRight: '2px',
|
|
43
|
-
},
|
|
44
|
-
colors: {
|
|
45
|
-
'&:hover': {
|
|
46
|
-
backgroundColor: 'transparent',
|
|
47
|
-
},
|
|
48
|
-
paddingLeft: '2px',
|
|
49
|
-
paddingRight: '2px',
|
|
50
|
-
},
|
|
51
|
-
popper: {
|
|
52
|
-
zIndex: 4,
|
|
53
|
-
},
|
|
54
|
-
}));
|
|
55
|
-
|
|
56
26
|
const sharedControllerStyles = {
|
|
57
27
|
width: '100%',
|
|
58
28
|
flexDirection: 'column',
|
|
59
29
|
};
|
|
60
30
|
|
|
61
31
|
export const useControllerSectionStyles = makeStyles(() => ({
|
|
62
|
-
|
|
32
|
+
layerControllerRoot: {
|
|
63
33
|
...sharedControllerStyles,
|
|
64
34
|
padding: '0px 8px',
|
|
65
35
|
},
|
|
66
36
|
}));
|
|
67
37
|
|
|
68
|
-
export const
|
|
69
|
-
|
|
38
|
+
export const useAccordionStyles = makeStyles(theme => ({
|
|
39
|
+
accordionDetailsRoot: {
|
|
70
40
|
...sharedControllerStyles,
|
|
71
41
|
padding: '8px 8px 24px 8px',
|
|
72
42
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
export const StyledAccordionSummary = withStyles(theme => ({
|
|
76
|
-
root: {
|
|
43
|
+
accordionSummaryRoot: {
|
|
77
44
|
padding: '0px 8px',
|
|
78
45
|
},
|
|
79
46
|
content: {
|
|
@@ -89,28 +56,28 @@ export const StyledAccordionSummary = withStyles(theme => ({
|
|
|
89
56
|
top: theme.spacing(-1.3),
|
|
90
57
|
},
|
|
91
58
|
},
|
|
92
|
-
}))
|
|
59
|
+
}));
|
|
93
60
|
|
|
94
|
-
export const
|
|
95
|
-
|
|
61
|
+
export const useInputLabelStyles = makeStyles(() => ({
|
|
62
|
+
inputLabelRoot: {
|
|
96
63
|
fontSize: '14px',
|
|
97
64
|
},
|
|
98
|
-
}))
|
|
65
|
+
}));
|
|
99
66
|
|
|
100
|
-
export const
|
|
67
|
+
export const useOverflowEllipsisGridStyles = makeStyles(() => ({
|
|
101
68
|
item: {
|
|
102
69
|
width: '100%',
|
|
103
70
|
overflow: 'hidden',
|
|
104
71
|
whiteSpace: 'nowrap',
|
|
105
72
|
textOverflow: 'ellipsis',
|
|
106
73
|
},
|
|
107
|
-
}))
|
|
74
|
+
}));
|
|
108
75
|
|
|
109
|
-
export const
|
|
110
|
-
|
|
76
|
+
export const useSelectionSliderStyles = makeStyles(() => ({
|
|
77
|
+
selectionSliderRoot: {
|
|
111
78
|
marginTop: '7px',
|
|
112
79
|
},
|
|
113
80
|
markActive: {
|
|
114
81
|
backgroundColor: 'rgba(128, 128, 128, 0.7)',
|
|
115
82
|
},
|
|
116
|
-
}))
|
|
83
|
+
}));
|