@vitessce/vit-s 2.0.3-beta.0 → 2.0.3
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/index.mjs +84801 -0
- package/{dist → dist-tsc}/index.js +2 -2
- package/package.json +7 -7
- package/src/CallbackPublisher.js +81 -0
- package/src/LoadingIndicator.js +34 -0
- package/src/TitleInfo.js +240 -0
- package/src/VitS.js +180 -0
- package/src/VitessceGrid.js +110 -0
- package/src/VitessceGrid.test.jsx +48 -0
- package/src/Warning.js +62 -0
- package/{dist → src}/classNames.js +0 -0
- package/src/component-registry.js +21 -0
- package/src/data/AbstractLoader.js +46 -0
- package/{dist → src}/data/AbstractTwoStepLoader.js +5 -4
- package/src/data/LoaderResult.js +8 -0
- package/{dist → src}/data/index.js +0 -0
- package/src/data/loader-registry.js +19 -0
- package/src/data-hook-utils.js +197 -0
- package/src/data-hooks.js +354 -0
- package/src/errors/AbstractLoaderError.js +14 -0
- package/src/errors/DataSourceFetchError.js +15 -0
- package/src/errors/DatasetNotFoundError.js +23 -0
- package/src/errors/LoaderNotFoundError.js +24 -0
- package/src/errors/LoaderValidationError.js +23 -0
- package/src/errors/OptionsValidationError.js +25 -0
- package/{dist → src}/errors/index.js +0 -0
- package/src/file-options-schemas-legacy.js +139 -0
- package/src/file-options-schemas-legacy.test.js +138 -0
- package/src/file-options-schemas.js +327 -0
- package/src/file-options-schemas.test.js +26 -0
- package/src/hooks.js +252 -0
- package/src/index.js +101 -0
- package/src/joint-file-types-legacy.js +298 -0
- package/src/joint-file-types-legacy.test.js +412 -0
- package/src/joint-file-types.js +171 -0
- package/src/joint-file-types.test.js +144 -0
- package/{dist/schemas.js → src/json-schemas.js} +6 -1
- package/{dist → src}/plugins.js +102 -70
- package/src/plugins.test.fixtures.js +78 -0
- package/src/plugins.test.js +42 -0
- package/src/schemas/config-0.1.0.schema.json +85 -0
- package/src/schemas/config-1.0.0.schema.json +733 -0
- package/src/schemas/config-1.0.1.schema.json +909 -0
- package/src/schemas/config-1.0.10.schema.json +969 -0
- package/src/schemas/config-1.0.11.schema.json +990 -0
- package/src/schemas/config-1.0.12.schema.json +997 -0
- package/src/schemas/config-1.0.13.schema.json +1013 -0
- package/src/schemas/config-1.0.14.schema.json +1048 -0
- package/src/schemas/config-1.0.15.schema.json +1048 -0
- package/src/schemas/config-1.0.16.schema.json +1069 -0
- package/src/schemas/config-1.0.16.schema.test.js +32 -0
- package/src/schemas/config-1.0.2.schema.json +911 -0
- package/src/schemas/config-1.0.3.schema.json +911 -0
- package/src/schemas/config-1.0.4.schema.json +949 -0
- package/src/schemas/config-1.0.5.schema.json +949 -0
- package/src/schemas/config-1.0.6.schema.json +950 -0
- package/src/schemas/config-1.0.7.schema.json +950 -0
- package/src/schemas/config-1.0.8.schema.json +966 -0
- package/src/schemas/config-1.0.9.schema.json +965 -0
- package/src/schemas/fixtures/cellSets.good.json +16 -0
- package/src/schemas/fixtures/config-1.0.1.bad.json +1 -0
- package/src/schemas/fixtures/config-1.0.1.bad.message.json +11 -0
- package/src/schemas/fixtures/config-1.0.1.good.json +37 -0
- package/src/schemas/fixtures/config-1.0.2.bad.json +1 -0
- package/src/schemas/fixtures/config-1.0.2.bad.message.json +11 -0
- package/src/schemas/fixtures/config-1.0.2.good.json +38 -0
- package/src/schemas/fixtures/config-1.0.3.bad.json +1 -0
- package/src/schemas/fixtures/config-1.0.3.bad.message.json +11 -0
- package/src/schemas/fixtures/config-1.0.3.good.json +38 -0
- package/src/schemas/fixtures/obsSets.bad.json +1 -0
- package/src/schemas/fixtures/obsSets.bad.message.json +11 -0
- package/src/schemas/fixtures/obsSets.good.json +16 -0
- package/src/schemas/fixtures/obsSetsTabular.bad.json +1 -0
- package/src/schemas/fixtures/obsSetsTabular.bad.message.json +11 -0
- package/src/schemas/fixtures/obsSetsTabular.good.json +26 -0
- package/src/schemas/fixtures/raster.bad.json +1 -0
- package/src/schemas/fixtures/raster.bad.message.json +11 -0
- package/src/schemas/fixtures/raster.good.json +39 -0
- package/src/schemas/obsSets.schema.js +195 -0
- package/src/schemas/obsSetsTabular.schema.js +39 -0
- package/src/schemas/raster.schema.js +121 -0
- package/src/schemas/schema-schema.sh +34 -0
- package/{dist → src}/schemas/schema.test-old.js +0 -1
- package/src/shared-mui/components.js +79 -0
- package/src/shared-mui/container.js +212 -0
- package/src/shared-mui/styles.js +110 -0
- package/src/shared-plot-options/CellColorEncodingOption.js +43 -0
- package/src/shared-plot-options/OptionSelect.js +19 -0
- package/src/shared-plot-options/OptionsContainer.js +26 -0
- package/{dist → src}/shared-plot-options/index.js +0 -0
- package/src/shared-plot-options/styles.js +49 -0
- package/src/state/hooks.js +633 -0
- package/src/view-config-upgraders.js +628 -0
- package/src/view-config-utils.js +315 -0
- package/src/view-config-utils.test.fixtures.js +893 -0
- package/src/view-config-utils.test.js +95 -0
- package/src/view-config-versions.js +68 -0
- package/src/vitessce-grid-layout/VitessceGridLayout.js +158 -0
- package/src/vitessce-grid-layout/VitessceGridLayout.test.jsx +56 -0
- package/{dist → src}/vitessce-grid-layout/index.js +0 -0
- package/src/vitessce-grid-layout/layout-utils.js +76 -0
- package/src/vitessce-grid-layout/layout-utils.test.js +167 -0
- package/src/vitessce-grid-utils.js +160 -0
- package/dist/CallbackPublisher.js +0 -68
- package/dist/LoadingIndicator.js +0 -27
- package/dist/TitleInfo.js +0 -151
- package/dist/VitS.js +0 -117
- package/dist/Vitessce.integration.test.js +0 -36
- package/dist/Vitessce.js +0 -101
- package/dist/VitessceGrid.js +0 -59
- package/dist/VitessceGrid.test.js +0 -36
- package/dist/Warning.js +0 -45
- package/dist/component-registry.js +0 -16
- package/dist/data/AbstractLoader.js +0 -35
- package/dist/data/LoaderResult.js +0 -7
- package/dist/data/loader-registry.js +0 -15
- package/dist/data-hook-utils.js +0 -175
- package/dist/data-hooks.js +0 -241
- package/dist/errors/AbstractLoaderError.js +0 -13
- package/dist/errors/DataSourceFetchError.js +0 -13
- package/dist/errors/DatasetNotFoundError.js +0 -17
- package/dist/errors/LoaderNotFoundError.js +0 -17
- package/dist/errors/LoaderValidationError.js +0 -15
- package/dist/errors/OptionsValidationError.js +0 -15
- package/dist/export-utils.js +0 -70
- package/dist/export-utils.test.js +0 -66
- package/dist/file-options-schemas-legacy.js +0 -136
- package/dist/file-options-schemas-legacy.test.js +0 -126
- package/dist/file-options-schemas.js +0 -322
- package/dist/file-options-schemas.test.js +0 -23
- package/dist/hooks.js +0 -215
- package/dist/joint-file-types-legacy.js +0 -278
- package/dist/joint-file-types-legacy.test.js +0 -400
- package/dist/joint-file-types.js +0 -148
- package/dist/joint-file-types.test.js +0 -139
- package/dist/loader-registry.js +0 -98
- package/dist/plugins.test.fixtures.js +0 -76
- package/dist/plugins.test.js +0 -30
- package/dist/schemas/PrettyJsonSchema.js +0 -34
- package/dist/schemas/config-0.1.0.schema.json +0 -84
- package/dist/schemas/config-1.0.0.schema.json +0 -733
- package/dist/schemas/config-1.0.1.schema.json +0 -909
- package/dist/schemas/config-1.0.10.schema.json +0 -969
- package/dist/schemas/config-1.0.11.schema.json +0 -990
- package/dist/schemas/config-1.0.12.schema.json +0 -997
- package/dist/schemas/config-1.0.13.schema.json +0 -1013
- package/dist/schemas/config-1.0.14.schema.json +0 -1048
- package/dist/schemas/config-1.0.15.schema.json +0 -1048
- package/dist/schemas/config-1.0.15.schema.test.js +0 -22
- package/dist/schemas/config-1.0.16.schema.json +0 -1109
- package/dist/schemas/config-1.0.16.schema.test.js +0 -22
- package/dist/schemas/config-1.0.2.schema.json +0 -910
- package/dist/schemas/config-1.0.3.schema.json +0 -910
- package/dist/schemas/config-1.0.4.schema.json +0 -949
- package/dist/schemas/config-1.0.5.schema.json +0 -949
- package/dist/schemas/config-1.0.6.schema.json +0 -949
- package/dist/schemas/config-1.0.7.schema.json +0 -949
- package/dist/schemas/config-1.0.8.schema.json +0 -965
- package/dist/schemas/config-1.0.9.schema.json +0 -965
- package/dist/schemas/obs-sets-tabular.schema.js +0 -37
- package/dist/schemas/obs-sets.schema.js +0 -194
- package/dist/schemas/obsSets.schema.js +0 -195
- package/dist/schemas/obsSetsTabular.schema.js +0 -38
- package/dist/schemas/raster.schema.js +0 -120
- package/dist/schemas/schema.test.js +0 -46
- package/dist/schemas-extra.js +0 -3
- package/dist/shared-mui/components.js +0 -35
- package/dist/shared-mui/container.js +0 -211
- package/dist/shared-mui/styles.js +0 -107
- package/dist/shared-plot-options/CellColorEncodingOption.js +0 -18
- package/dist/shared-plot-options/OptionSelect.js +0 -12
- package/dist/shared-plot-options/OptionsContainer.js +0 -12
- package/dist/shared-plot-options/styles.js +0 -48
- package/dist/state/hooks.js +0 -549
- package/dist/view-config-upgraders.js +0 -525
- package/dist/view-config-utils.js +0 -286
- package/dist/view-config-utils.test.fixtures.js +0 -765
- package/dist/view-config-utils.test.js +0 -66
- package/dist/view-config-versions.js +0 -47
- package/dist/vitessce-grid-layout/VitessceGridLayout.js +0 -95
- package/dist/vitessce-grid-layout/VitessceGridLayout.test.js +0 -40
- package/dist/vitessce-grid-layout/layout-utils.js +0 -60
- package/dist/vitessce-grid-layout/layout-utils.test.js +0 -146
- package/dist/vitessce-grid-utils.js +0 -140
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -o errexit
|
|
3
|
+
|
|
4
|
+
die() { set +v; echo "$*" 1>&2 ; exit 1; }
|
|
5
|
+
|
|
6
|
+
# This is a totally ad-hoc script to ensure some consistency in our schemas.
|
|
7
|
+
# We want to be sure that each "properties" also specifies "additionalProperties" and "required".
|
|
8
|
+
|
|
9
|
+
FAILURES=$(
|
|
10
|
+
SCHEMA_DIR=`dirname $0`
|
|
11
|
+
for SCHEMA in $SCHEMA_DIR/*.schema.json; do
|
|
12
|
+
export SCHEMA
|
|
13
|
+
grep -B2 '"properties"' $SCHEMA \
|
|
14
|
+
| perl -pne 's/\n//; s/\s+/ /g; s/--/\n/;' \
|
|
15
|
+
| perl -ne 'next unless /properties/; print "$ENV{SCHEMA}: $_" unless /"additionalProperties".*"(required|oneOf|allOf|anyOf)".*"properties"/;'
|
|
16
|
+
done
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
if [[ $FAILURES ]]; then
|
|
20
|
+
die "Check that 'additionalProperties' & 'required' & 'properties' are provided:
|
|
21
|
+
$FAILURES"
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
# Check that existing schemas have not changed.
|
|
25
|
+
for SCHEMA in $SCHEMA_DIR/config-*.schema.json; do
|
|
26
|
+
SCHEMA_NAME=`basename $SCHEMA`
|
|
27
|
+
SCHEMA_RESPONSE=`curl -s https://raw.githubusercontent.com/vitessce/vitessce/main/src/schemas/$SCHEMA_NAME`
|
|
28
|
+
if [ "$SCHEMA_RESPONSE" == "404: Not Found" ]; then
|
|
29
|
+
echo "Schema $SCHEMA is not in production yet."
|
|
30
|
+
else
|
|
31
|
+
diff --ignore-all-space $SCHEMA <(echo "$SCHEMA_RESPONSE") \
|
|
32
|
+
|| die "$SCHEMA has changed. Please do not change existing schema; instead, make a new schema."
|
|
33
|
+
fi
|
|
34
|
+
done
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
3
|
+
import Paper from '@material-ui/core/Paper';
|
|
4
|
+
import Popper from '@material-ui/core/Popper';
|
|
5
|
+
import IconButton from '@material-ui/core/IconButton';
|
|
6
|
+
import MenuList from '@material-ui/core/MenuList';
|
|
7
|
+
import ClickAwayListener from '@material-ui/core/ClickAwayListener';
|
|
8
|
+
import Fade from '@material-ui/core/Fade';
|
|
9
|
+
import { useVitessceContainer } from '../hooks';
|
|
10
|
+
|
|
11
|
+
const useStyles = makeStyles(() => ({
|
|
12
|
+
paper: {
|
|
13
|
+
maxHeight: 200,
|
|
14
|
+
overflow: 'auto',
|
|
15
|
+
},
|
|
16
|
+
container: {
|
|
17
|
+
position: 'relative',
|
|
18
|
+
left: 0,
|
|
19
|
+
top: 0,
|
|
20
|
+
},
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
export function PopperMenu(props) {
|
|
24
|
+
const {
|
|
25
|
+
buttonIcon,
|
|
26
|
+
open,
|
|
27
|
+
setOpen,
|
|
28
|
+
children,
|
|
29
|
+
buttonClassName,
|
|
30
|
+
placement = 'bottom-end',
|
|
31
|
+
} = props;
|
|
32
|
+
const classes = useStyles();
|
|
33
|
+
|
|
34
|
+
const anchorRef = useRef();
|
|
35
|
+
|
|
36
|
+
const handleClick = () => {
|
|
37
|
+
setOpen(prev => !prev);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const handleClose = () => {
|
|
41
|
+
setOpen(false);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const id = open ? 'v-popover-menu' : undefined;
|
|
45
|
+
|
|
46
|
+
const getTooltipContainer = useVitessceContainer(anchorRef);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div ref={anchorRef} className={classes.container}>
|
|
50
|
+
<IconButton
|
|
51
|
+
aria-describedby={id}
|
|
52
|
+
onClick={handleClick}
|
|
53
|
+
size="small"
|
|
54
|
+
className={buttonClassName}
|
|
55
|
+
>
|
|
56
|
+
{buttonIcon}
|
|
57
|
+
</IconButton>
|
|
58
|
+
<Popper
|
|
59
|
+
id={id}
|
|
60
|
+
open={open}
|
|
61
|
+
anchorEl={anchorRef && anchorRef.current}
|
|
62
|
+
container={getTooltipContainer}
|
|
63
|
+
onClose={handleClose}
|
|
64
|
+
placement={placement}
|
|
65
|
+
transition
|
|
66
|
+
>
|
|
67
|
+
{({ TransitionProps }) => (
|
|
68
|
+
<ClickAwayListener onClickAway={handleClose}>
|
|
69
|
+
<Fade {...TransitionProps} timeout={100}>
|
|
70
|
+
<Paper elevation={4} className={classes.paper}>
|
|
71
|
+
<MenuList>{children}</MenuList>
|
|
72
|
+
</Paper>
|
|
73
|
+
</Fade>
|
|
74
|
+
</ClickAwayListener>
|
|
75
|
+
)}
|
|
76
|
+
</Popper>
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
2
|
+
|
|
3
|
+
export const useVitessceContainerStyles = makeStyles(theme => ({
|
|
4
|
+
vitessceContainer: {
|
|
5
|
+
position: 'relative',
|
|
6
|
+
margin: '0',
|
|
7
|
+
textAlign: 'left',
|
|
8
|
+
backgroundColor: theme.palette.gridLayoutBackground,
|
|
9
|
+
'& div': {
|
|
10
|
+
fontFamily: '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"',
|
|
11
|
+
fontSize: '16px',
|
|
12
|
+
fontWeight: '400',
|
|
13
|
+
lineHeight: '1.5',
|
|
14
|
+
textAlign: 'left',
|
|
15
|
+
},
|
|
16
|
+
'& p': {
|
|
17
|
+
marginTop: '0',
|
|
18
|
+
marginBottom: '16px',
|
|
19
|
+
},
|
|
20
|
+
'& *, ::after, ::before': {
|
|
21
|
+
boxSizing: 'border-box',
|
|
22
|
+
},
|
|
23
|
+
// Manually converted styles from 'react-grid-layout/css/styles.css',
|
|
24
|
+
// using https://cssinjs.org/jss-plugin-global/?v=v10.9.2
|
|
25
|
+
// so that no CSS or SCSS import is required.
|
|
26
|
+
'@global .react-grid-layout': {
|
|
27
|
+
transition: 'height 200ms ease',
|
|
28
|
+
// Custom
|
|
29
|
+
height: 'auto',
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
width: '100%',
|
|
32
|
+
},
|
|
33
|
+
'@global .react-grid-item': {
|
|
34
|
+
transition: 'all 200ms ease',
|
|
35
|
+
transitionProperty: 'left, top',
|
|
36
|
+
// Custom
|
|
37
|
+
flexDirection: 'column!important',
|
|
38
|
+
display: 'flex!important',
|
|
39
|
+
/* So the resize handle position looks correct: */
|
|
40
|
+
paddingRight: '10px',
|
|
41
|
+
},
|
|
42
|
+
'@global .react-grid-item img': {
|
|
43
|
+
pointerEvents: 'none',
|
|
44
|
+
userSelect: 'none',
|
|
45
|
+
},
|
|
46
|
+
'@global .react-grid-item.cssTransforms': {
|
|
47
|
+
transitionProperty: 'transform',
|
|
48
|
+
},
|
|
49
|
+
'@global .react-grid-item.resizing': {
|
|
50
|
+
zIndex: '1',
|
|
51
|
+
willChange: 'width, height',
|
|
52
|
+
},
|
|
53
|
+
'@global .react-grid-item.react-draggable-dragging': {
|
|
54
|
+
transition: 'none',
|
|
55
|
+
zIndex: '3',
|
|
56
|
+
willChange: 'transform',
|
|
57
|
+
},
|
|
58
|
+
'@global .react-grid-item.dropping': {
|
|
59
|
+
visibility: 'hidden',
|
|
60
|
+
},
|
|
61
|
+
'@global .react-grid-item.react-grid-placeholder': {
|
|
62
|
+
background: 'red',
|
|
63
|
+
opacity: '0.2',
|
|
64
|
+
transitionDuration: '100ms',
|
|
65
|
+
zIndex: '2',
|
|
66
|
+
userSelect: 'none',
|
|
67
|
+
},
|
|
68
|
+
'@global .react-grid-item > .react-resizable-handle': {
|
|
69
|
+
position: 'absolute',
|
|
70
|
+
width: '20px',
|
|
71
|
+
height: '20px',
|
|
72
|
+
},
|
|
73
|
+
'@global .react-grid-item > .react-resizable-handle::after': {
|
|
74
|
+
content: '""',
|
|
75
|
+
position: 'absolute',
|
|
76
|
+
right: '3px',
|
|
77
|
+
bottom: '3px',
|
|
78
|
+
width: '5px',
|
|
79
|
+
height: '5px',
|
|
80
|
+
borderRight: '2px solid rgba(0, 0, 0, 0.4)',
|
|
81
|
+
borderBottom: '2px solid rgba(0, 0, 0, 0.4)',
|
|
82
|
+
},
|
|
83
|
+
'@global .react-resizable-hide > .react-resizable-handle': {
|
|
84
|
+
display: 'none',
|
|
85
|
+
},
|
|
86
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-sw': {
|
|
87
|
+
bottom: '0',
|
|
88
|
+
left: '0',
|
|
89
|
+
cursor: 'sw-resize',
|
|
90
|
+
transform: 'rotate(90deg)',
|
|
91
|
+
},
|
|
92
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-se': {
|
|
93
|
+
bottom: '0',
|
|
94
|
+
right: '0',
|
|
95
|
+
cursor: 'se-resize',
|
|
96
|
+
},
|
|
97
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-nw': {
|
|
98
|
+
top: '0',
|
|
99
|
+
left: '0',
|
|
100
|
+
cursor: 'nw-resize',
|
|
101
|
+
transform: 'rotate(180deg)',
|
|
102
|
+
},
|
|
103
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-ne': {
|
|
104
|
+
top: '0',
|
|
105
|
+
right: '0',
|
|
106
|
+
cursor: 'ne-resize',
|
|
107
|
+
transform: 'rotate(270deg)',
|
|
108
|
+
},
|
|
109
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-w': {
|
|
110
|
+
top: '50%',
|
|
111
|
+
marginTop: '-10px',
|
|
112
|
+
cursor: 'ew-resize',
|
|
113
|
+
left: '0',
|
|
114
|
+
transform: 'rotate(135deg)',
|
|
115
|
+
},
|
|
116
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-e': {
|
|
117
|
+
top: '50%',
|
|
118
|
+
marginTop: '-10px',
|
|
119
|
+
cursor: 'ew-resize',
|
|
120
|
+
right: '0',
|
|
121
|
+
transform: 'rotate(315deg)',
|
|
122
|
+
},
|
|
123
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-n': {
|
|
124
|
+
left: '50%',
|
|
125
|
+
marginLeft: '-10px',
|
|
126
|
+
cursor: 'ns-resize',
|
|
127
|
+
top: '0',
|
|
128
|
+
transform: 'rotate(225deg)',
|
|
129
|
+
},
|
|
130
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-s': {
|
|
131
|
+
left: '50%',
|
|
132
|
+
marginLeft: '-10px',
|
|
133
|
+
cursor: 'ns-resize',
|
|
134
|
+
bottom: '0',
|
|
135
|
+
transform: 'rotate(45deg)',
|
|
136
|
+
},
|
|
137
|
+
// Manually converted styles from 'react-resizable/css/styles.css',
|
|
138
|
+
'@global .react-resizable': {
|
|
139
|
+
position: 'relative',
|
|
140
|
+
},
|
|
141
|
+
'@global .react-resizable-handle': {
|
|
142
|
+
position: 'absolute',
|
|
143
|
+
width: '20px',
|
|
144
|
+
height: '20px',
|
|
145
|
+
backgroundRepeat: 'no-repeat',
|
|
146
|
+
backgroundOrigin: 'content-box',
|
|
147
|
+
boxSizing: 'border-box',
|
|
148
|
+
backgroundImage: "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+')",
|
|
149
|
+
backgroundPosition: 'bottom right',
|
|
150
|
+
padding: '0 3px 3px 0',
|
|
151
|
+
},
|
|
152
|
+
'@global .react-resizable-handle-sw': {
|
|
153
|
+
bottom: '0',
|
|
154
|
+
left: '0',
|
|
155
|
+
cursor: 'sw-resize',
|
|
156
|
+
transform: 'rotate(90deg)',
|
|
157
|
+
},
|
|
158
|
+
'@global .react-resizable-handle-se': {
|
|
159
|
+
bottom: '0',
|
|
160
|
+
right: '0',
|
|
161
|
+
cursor: 'se-resize',
|
|
162
|
+
},
|
|
163
|
+
'@global .react-resizable-handle-nw': {
|
|
164
|
+
top: '0',
|
|
165
|
+
left: '0',
|
|
166
|
+
cursor: 'nw-resize',
|
|
167
|
+
transform: 'rotate(180deg)',
|
|
168
|
+
},
|
|
169
|
+
'@global .react-resizable-handle-ne': {
|
|
170
|
+
top: '0',
|
|
171
|
+
right: '0',
|
|
172
|
+
cursor: 'ne-resize',
|
|
173
|
+
transform: 'rotate(270deg)',
|
|
174
|
+
},
|
|
175
|
+
'@global .react-resizable-handle-w': {
|
|
176
|
+
top: '50%',
|
|
177
|
+
marginTop: '-10px',
|
|
178
|
+
cursor: 'ew-resize',
|
|
179
|
+
left: '0',
|
|
180
|
+
transform: 'rotate(135deg)',
|
|
181
|
+
},
|
|
182
|
+
'@global .react-resizable-handle-e': {
|
|
183
|
+
top: '50%',
|
|
184
|
+
marginTop: '-10px',
|
|
185
|
+
cursor: 'ew-resize',
|
|
186
|
+
right: '0',
|
|
187
|
+
transform: 'rotate(315deg)',
|
|
188
|
+
},
|
|
189
|
+
'@global .react-resizable-handle-n': {
|
|
190
|
+
left: '50%',
|
|
191
|
+
marginLeft: '-10px',
|
|
192
|
+
cursor: 'ns-resize',
|
|
193
|
+
top: '0',
|
|
194
|
+
transform: 'rotate(225deg)',
|
|
195
|
+
},
|
|
196
|
+
'@global .react-resizable-handle-s': {
|
|
197
|
+
left: '50%',
|
|
198
|
+
marginLeft: '-10px',
|
|
199
|
+
cursor: 'ns-resize',
|
|
200
|
+
bottom: '0',
|
|
201
|
+
transform: 'rotate(45deg)',
|
|
202
|
+
},
|
|
203
|
+
// Custom
|
|
204
|
+
'@global .react-draggable-transparent-selection .react-grid-item': {
|
|
205
|
+
/* These styles prevent text selection during resize drag interactions.
|
|
206
|
+
The react-draggable-transparent-selection class is added to the body
|
|
207
|
+
element during resizing and removed after resizing has finished.
|
|
208
|
+
Not part of mixin because acts outside of .vitessce-container. */
|
|
209
|
+
userSelect: 'none !important',
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
}));
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { createTheme } from '@material-ui/core/styles';
|
|
2
|
+
import { grey } from '@material-ui/core/colors';
|
|
3
|
+
|
|
4
|
+
const globalColors = {
|
|
5
|
+
white: '#FFFFFF',
|
|
6
|
+
grayLight: '#D3D3D3',
|
|
7
|
+
grayMid: '#808080',
|
|
8
|
+
grayDark: '#555555',
|
|
9
|
+
black: '#000000',
|
|
10
|
+
grayDarkL5: 'rgb(98, 98, 98)', // lighten(map-get($global-colors, "gray-dark"), 5%);
|
|
11
|
+
grayDarkD15: 'rgb(47, 47, 47)', // darken(map-get($global-colors, "gray-dark"), 15%);
|
|
12
|
+
grayMidL10: 'rgb(154, 154, 154)', // lighten(map-get($global-colors, "gray-mid"), 10%);
|
|
13
|
+
grayLightL10: 'rgb(237, 237, 237)', // lighten(map-get($global-colors, "gray-light"), 10%);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const sharedThemeOptions = {
|
|
17
|
+
// Use px instead of rem, so that sizing is consistent despite the root element font-size.
|
|
18
|
+
// Reference: https://github.com/mui/material-ui/blob/627c08fc/src/styles/createTypography.js
|
|
19
|
+
typography: {
|
|
20
|
+
pxToRem: size => `${size}px`,
|
|
21
|
+
display4: {
|
|
22
|
+
fontSize: '112px',
|
|
23
|
+
},
|
|
24
|
+
display3: {
|
|
25
|
+
fontSize: '56px',
|
|
26
|
+
},
|
|
27
|
+
display2: {
|
|
28
|
+
fontSize: '45px',
|
|
29
|
+
},
|
|
30
|
+
display1: {
|
|
31
|
+
fontSize: '34px',
|
|
32
|
+
},
|
|
33
|
+
headline: {
|
|
34
|
+
fontSize: '24px',
|
|
35
|
+
},
|
|
36
|
+
title: {
|
|
37
|
+
fontSize: '21px',
|
|
38
|
+
},
|
|
39
|
+
subheading: {
|
|
40
|
+
fontSize: '16px',
|
|
41
|
+
},
|
|
42
|
+
body2: {
|
|
43
|
+
fontSize: '14px',
|
|
44
|
+
},
|
|
45
|
+
body1: {
|
|
46
|
+
fontSize: '14px',
|
|
47
|
+
},
|
|
48
|
+
caption: {
|
|
49
|
+
fontSize: '12px',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
props: {
|
|
53
|
+
MuiButtonBase: {
|
|
54
|
+
disableRipple: true,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const muiTheme = {
|
|
60
|
+
dark: createTheme({
|
|
61
|
+
palette: {
|
|
62
|
+
type: 'dark',
|
|
63
|
+
primary: grey,
|
|
64
|
+
secondary: grey,
|
|
65
|
+
primaryBackground: '#222222',
|
|
66
|
+
primaryBackgroundHighlight: '#000000',
|
|
67
|
+
primaryBackgroundInput: '#D3D3D3',
|
|
68
|
+
primaryBackgroundDim: '#333333',
|
|
69
|
+
primaryBackgroundLight: '#757575',
|
|
70
|
+
primaryForeground: '#D3D3D3',
|
|
71
|
+
primaryForegroundL5: 'rgb(224, 224, 224)',
|
|
72
|
+
primaryForegroundL10: 'rgb(237, 237, 237)',
|
|
73
|
+
primaryForegroundD15: 'rgb(173, 173, 173)',
|
|
74
|
+
primaryForegroundDim: '#000000',
|
|
75
|
+
primaryForegroundActive: '#9bb7d6',
|
|
76
|
+
secondaryBackground: '#000000',
|
|
77
|
+
secondaryBackgroundDim: '#444444',
|
|
78
|
+
secondaryForeground: '#D3D3D3',
|
|
79
|
+
gridLayoutBackground: '#333333',
|
|
80
|
+
cardBorder: 'rgba(0, 0, 0, 0.125)',
|
|
81
|
+
...globalColors,
|
|
82
|
+
},
|
|
83
|
+
...sharedThemeOptions,
|
|
84
|
+
}),
|
|
85
|
+
light: createTheme({
|
|
86
|
+
palette: {
|
|
87
|
+
type: 'light',
|
|
88
|
+
primary: grey,
|
|
89
|
+
secondary: grey,
|
|
90
|
+
primaryBackground: '#F1F1F1',
|
|
91
|
+
primaryBackgroundHighlight: '#FFFFFF',
|
|
92
|
+
primaryBackgroundInput: '#FFFFFF',
|
|
93
|
+
primaryBackgroundDim: '#8A8A8A',
|
|
94
|
+
primaryBackgroundLight: '#e0e0e0',
|
|
95
|
+
primaryForeground: '#333333',
|
|
96
|
+
primaryForegroundL5: 'rgb(64, 64, 64)', // lighten(map-get($theme-colors, "primary-foreground"), 5%);
|
|
97
|
+
primaryForegroundL10: 'rgb(77, 77, 77)', // lighten(map-get($theme-colors, "primary-foreground"), 10%);
|
|
98
|
+
primaryForegroundD15: 'rgb(13, 13, 13)', // darken(map-get($theme-colors, "primary-foreground"), 15%);
|
|
99
|
+
primaryForegroundDim: '#808080',
|
|
100
|
+
primaryForegroundActive: '#0074D9',
|
|
101
|
+
secondaryBackground: '#F1F1F1',
|
|
102
|
+
secondaryBackgroundDim: '#C0C0C0',
|
|
103
|
+
secondaryForeground: '#222222',
|
|
104
|
+
gridLayoutBackground: '#FFFFFF',
|
|
105
|
+
cardBorder: 'rgba(241, 241, 241, 0.125)',
|
|
106
|
+
...globalColors,
|
|
107
|
+
},
|
|
108
|
+
...sharedThemeOptions,
|
|
109
|
+
}),
|
|
110
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import TableCell from '@material-ui/core/TableCell';
|
|
3
|
+
import TableRow from '@material-ui/core/TableRow';
|
|
4
|
+
import { capitalize } from '@vitessce/utils';
|
|
5
|
+
import OptionSelect from './OptionSelect';
|
|
6
|
+
import { useStyles } from './styles';
|
|
7
|
+
|
|
8
|
+
export default function CellColorEncodingOption(props) {
|
|
9
|
+
const {
|
|
10
|
+
observationsLabel,
|
|
11
|
+
cellColorEncoding,
|
|
12
|
+
setCellColorEncoding,
|
|
13
|
+
} = props;
|
|
14
|
+
|
|
15
|
+
const classes = useStyles();
|
|
16
|
+
|
|
17
|
+
const observationsLabelNice = capitalize(observationsLabel);
|
|
18
|
+
|
|
19
|
+
function handleColorEncodingChange(event) {
|
|
20
|
+
setCellColorEncoding(event.target.value);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<TableRow>
|
|
25
|
+
<TableCell className={classes.labelCell} htmlFor="cell-color-encoding-select">
|
|
26
|
+
{observationsLabelNice} Color Encoding
|
|
27
|
+
</TableCell>
|
|
28
|
+
<TableCell className={classes.inputCell}>
|
|
29
|
+
<OptionSelect
|
|
30
|
+
className={classes.select}
|
|
31
|
+
value={cellColorEncoding}
|
|
32
|
+
onChange={handleColorEncodingChange}
|
|
33
|
+
inputProps={{
|
|
34
|
+
id: 'cell-color-encoding-select',
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
<option value="cellSetSelection">Cell Sets</option>
|
|
38
|
+
<option value="geneSelection">Gene Expression</option>
|
|
39
|
+
</OptionSelect>
|
|
40
|
+
</TableCell>
|
|
41
|
+
</TableRow>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Select from '@material-ui/core/Select';
|
|
3
|
+
import { useStyles } from './styles';
|
|
4
|
+
|
|
5
|
+
export default function OptionSelect(props) {
|
|
6
|
+
const { classes: classesProp = {} } = props;
|
|
7
|
+
const classes = useStyles();
|
|
8
|
+
return (
|
|
9
|
+
<Select
|
|
10
|
+
native
|
|
11
|
+
disableUnderline
|
|
12
|
+
{...props}
|
|
13
|
+
classes={{
|
|
14
|
+
root: classes.selectRoot,
|
|
15
|
+
...classesProp,
|
|
16
|
+
}}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Box from '@material-ui/core/Box';
|
|
3
|
+
import Table from '@material-ui/core/Table';
|
|
4
|
+
import TableBody from '@material-ui/core/TableBody';
|
|
5
|
+
import TableContainer from '@material-ui/core/TableContainer';
|
|
6
|
+
import { useStyles } from './styles';
|
|
7
|
+
|
|
8
|
+
export default function OptionsContainer(props) {
|
|
9
|
+
const {
|
|
10
|
+
children,
|
|
11
|
+
} = props;
|
|
12
|
+
|
|
13
|
+
const classes = useStyles();
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Box className={classes.box}>
|
|
17
|
+
<TableContainer className={classes.tableContainer}>
|
|
18
|
+
<Table className={classes.table} size="small">
|
|
19
|
+
<TableBody>
|
|
20
|
+
{children}
|
|
21
|
+
</TableBody>
|
|
22
|
+
</Table>
|
|
23
|
+
</TableContainer>
|
|
24
|
+
</Box>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
2
|
+
|
|
3
|
+
export const useStyles = makeStyles(theme => ({
|
|
4
|
+
box: {
|
|
5
|
+
boxSizing: 'border-box',
|
|
6
|
+
},
|
|
7
|
+
checkbox: {
|
|
8
|
+
padding: '3px',
|
|
9
|
+
color: theme.palette.primaryForeground,
|
|
10
|
+
'&:checked': {
|
|
11
|
+
color: theme.palette.primaryForeground,
|
|
12
|
+
},
|
|
13
|
+
'& input': {
|
|
14
|
+
height: '100%',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
slider: {
|
|
18
|
+
color: theme.palette.primaryForeground,
|
|
19
|
+
minWidth: '60px',
|
|
20
|
+
padding: '10px 0 10px 0',
|
|
21
|
+
},
|
|
22
|
+
sliderValueLabel: {
|
|
23
|
+
'& span': {
|
|
24
|
+
'& span': {
|
|
25
|
+
color: theme.palette.primaryBackground,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
tableContainer: {
|
|
30
|
+
overflow: 'hidden',
|
|
31
|
+
overflowX: 'hidden !important',
|
|
32
|
+
},
|
|
33
|
+
labelCell: {
|
|
34
|
+
padding: '2px 8px 2px 16px',
|
|
35
|
+
},
|
|
36
|
+
inputCell: {
|
|
37
|
+
padding: '2px 16px 2px 8px',
|
|
38
|
+
overflow: 'visible',
|
|
39
|
+
},
|
|
40
|
+
select: {
|
|
41
|
+
'& select': {
|
|
42
|
+
fontSize: '14px',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
selectRoot: {
|
|
46
|
+
padding: 0,
|
|
47
|
+
height: 'auto',
|
|
48
|
+
},
|
|
49
|
+
}));
|