@vitessce/vit-s 2.0.0-beta.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/LICENSE +21 -0
- package/dist/CallbackPublisher.js +68 -0
- package/dist/LoadingIndicator.js +27 -0
- package/dist/TitleInfo.js +151 -0
- package/dist/VitS.js +113 -0
- package/dist/Vitessce.integration.test.js +36 -0
- package/dist/Vitessce.js +101 -0
- package/dist/VitessceGrid.js +55 -0
- package/dist/VitessceGrid.test.js +36 -0
- package/dist/Warning.js +45 -0
- package/dist/classNames.js +8 -0
- package/dist/component-registry.js +16 -0
- package/dist/data/AbstractLoader.js +35 -0
- package/dist/data/AbstractTwoStepLoader.js +7 -0
- package/dist/data/LoaderResult.js +7 -0
- package/dist/data/index.js +3 -0
- package/dist/data/loader-registry.js +15 -0
- package/dist/data-hook-utils.js +175 -0
- package/dist/data-hooks.js +241 -0
- package/dist/errors/AbstractLoaderError.js +13 -0
- package/dist/errors/DataSourceFetchError.js +13 -0
- package/dist/errors/DatasetNotFoundError.js +17 -0
- package/dist/errors/LoaderNotFoundError.js +17 -0
- package/dist/errors/LoaderValidationError.js +15 -0
- package/dist/errors/OptionsValidationError.js +15 -0
- package/dist/errors/index.js +6 -0
- package/dist/export-utils.js +70 -0
- package/dist/export-utils.test.js +66 -0
- package/dist/file-options-schemas-legacy.js +136 -0
- package/dist/file-options-schemas-legacy.test.js +126 -0
- package/dist/file-options-schemas.js +322 -0
- package/dist/file-options-schemas.test.js +23 -0
- package/dist/hooks.js +215 -0
- package/dist/index.js +18 -0
- package/dist/joint-file-types-legacy.js +278 -0
- package/dist/joint-file-types-legacy.test.js +400 -0
- package/dist/joint-file-types.js +148 -0
- package/dist/joint-file-types.test.js +139 -0
- package/dist/loader-registry.js +98 -0
- package/dist/plugins.js +154 -0
- package/dist/plugins.test.fixtures.js +76 -0
- package/dist/plugins.test.js +30 -0
- package/dist/schemas/PrettyJsonSchema.js +34 -0
- package/dist/schemas/config-0.1.0.schema.json +84 -0
- package/dist/schemas/config-1.0.0.schema.json +733 -0
- package/dist/schemas/config-1.0.1.schema.json +909 -0
- package/dist/schemas/config-1.0.10.schema.json +969 -0
- package/dist/schemas/config-1.0.11.schema.json +990 -0
- package/dist/schemas/config-1.0.12.schema.json +997 -0
- package/dist/schemas/config-1.0.13.schema.json +1013 -0
- package/dist/schemas/config-1.0.14.schema.json +1048 -0
- package/dist/schemas/config-1.0.15.schema.json +1048 -0
- package/dist/schemas/config-1.0.15.schema.test.js +22 -0
- package/dist/schemas/config-1.0.2.schema.json +910 -0
- package/dist/schemas/config-1.0.3.schema.json +910 -0
- package/dist/schemas/config-1.0.4.schema.json +949 -0
- package/dist/schemas/config-1.0.5.schema.json +949 -0
- package/dist/schemas/config-1.0.6.schema.json +949 -0
- package/dist/schemas/config-1.0.7.schema.json +949 -0
- package/dist/schemas/config-1.0.8.schema.json +965 -0
- package/dist/schemas/config-1.0.9.schema.json +965 -0
- package/dist/schemas/obsSets.schema.js +195 -0
- package/dist/schemas/obsSets.schema.json +194 -0
- package/dist/schemas/obsSetsTabular.schema.js +38 -0
- package/dist/schemas/obsSetsTabular.schema.json +37 -0
- package/dist/schemas/raster.schema.js +120 -0
- package/dist/schemas/raster.schema.json +119 -0
- package/dist/schemas/schema.test-old.js +50 -0
- package/dist/schemas/schema.test.js +46 -0
- package/dist/schemas.js +4 -0
- package/dist/shared-mui/components.js +35 -0
- package/dist/shared-mui/container.js +211 -0
- package/dist/shared-mui/styles.js +63 -0
- package/dist/shared-plot-options/CellColorEncodingOption.js +18 -0
- package/dist/shared-plot-options/OptionSelect.js +12 -0
- package/dist/shared-plot-options/OptionsContainer.js +12 -0
- package/dist/shared-plot-options/index.js +4 -0
- package/dist/shared-plot-options/styles.js +48 -0
- package/dist/state/hooks.js +550 -0
- package/dist/view-config-upgraders.js +525 -0
- package/dist/view-config-utils.js +286 -0
- package/dist/view-config-utils.test.fixtures.js +765 -0
- package/dist/view-config-utils.test.js +66 -0
- package/dist/view-config-versions.js +47 -0
- package/dist/vitessce-grid-layout/VitessceGridLayout.js +96 -0
- package/dist/vitessce-grid-layout/VitessceGridLayout.test.js +40 -0
- package/dist/vitessce-grid-layout/index.js +1 -0
- package/dist/vitessce-grid-layout/layout-utils.js +61 -0
- package/dist/vitessce-grid-layout/layout-utils.test.js +146 -0
- package/dist/vitessce-grid-utils.js +140 -0
- package/package.json +43 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://github.com/vitessce/vitessce/#raster",
|
|
4
|
+
"title": "Vitessce image data",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"definitions": {
|
|
7
|
+
"transform": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"oneOf": [{ "required": ["scale", "translate"] }, { "required": ["matrix"] }],
|
|
11
|
+
"properties": {
|
|
12
|
+
"scale": { "type": "number" },
|
|
13
|
+
"translate": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": ["y", "x"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"y": { "type": "number" },
|
|
19
|
+
"x": { "type": "number" }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"matrix": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": { "type": "number" },
|
|
25
|
+
"minItems": 16,
|
|
26
|
+
"maxItems": 16
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"dimensions": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"items": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"additionalProperties": false,
|
|
35
|
+
"required": ["field", "type", "values"],
|
|
36
|
+
"properties": {
|
|
37
|
+
"field": { "type": "string" },
|
|
38
|
+
"type": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"enum": ["quantitative", "nominal", "ordinal", "temporal"]
|
|
41
|
+
},
|
|
42
|
+
"values": {
|
|
43
|
+
"type": ["array", "null"],
|
|
44
|
+
"items": { "type": "string" }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"metadata": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"additionalProperties": false,
|
|
52
|
+
"anyOf": [{ "required": ["dimensions", "isPyramid"] }, { "required": ["transform"] }, { "required": ["omeTiffOffsetsUrl"] }, { "required": ["isBitmask"] }],
|
|
53
|
+
"properties": {
|
|
54
|
+
"dimensions": { "$ref": "#/definitions/dimensions" },
|
|
55
|
+
"isPyramid": { "type": "boolean" },
|
|
56
|
+
"transform": { "$ref": "#/definitions/transform" },
|
|
57
|
+
"isBitmask": { "type": "boolean" },
|
|
58
|
+
"omeTiffOffsetsUrl": { "type": "string", "format": "uri" }
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"requestInit": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"required": [],
|
|
65
|
+
"properties": {
|
|
66
|
+
"method": {
|
|
67
|
+
"type": "string"
|
|
68
|
+
},
|
|
69
|
+
"headers": {
|
|
70
|
+
"type": "object"
|
|
71
|
+
},
|
|
72
|
+
"body": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
"mode": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"credentials": {
|
|
79
|
+
"type": "string"
|
|
80
|
+
},
|
|
81
|
+
"cache": {
|
|
82
|
+
"type": "string"
|
|
83
|
+
},
|
|
84
|
+
"redirect": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
},
|
|
87
|
+
"referrer": {
|
|
88
|
+
"type": "string"
|
|
89
|
+
},
|
|
90
|
+
"integrity": {
|
|
91
|
+
"type": "string"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"image": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"additionalProperties": false,
|
|
98
|
+
"required": ["name", "url", "type"],
|
|
99
|
+
"properties": {
|
|
100
|
+
"name": { "type": "string" },
|
|
101
|
+
"url": { "type": "string", "format": "uri" },
|
|
102
|
+
"type": { "type": "string" },
|
|
103
|
+
"metadata": { "$ref": "#/definitions/metadata" },
|
|
104
|
+
"requestInit": { "$ref": "#/definitions/requestInit" }
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"additionalProperties": false,
|
|
109
|
+
"required": ["schemaVersion", "images"],
|
|
110
|
+
"properties": {
|
|
111
|
+
"schemaVersion": { "type": "string" },
|
|
112
|
+
"usePhysicalSizeScaling": { "type": "boolean", "description": "Default is false: passing true in will infer scaling from the reported physcial size" },
|
|
113
|
+
"renderLayers": { "type": "array", "items": { "type": "string" } },
|
|
114
|
+
"images": {
|
|
115
|
+
"type": "array",
|
|
116
|
+
"items": { "$ref": "#/definitions/image" }
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// TODO(monorepo)
|
|
3
|
+
/*
|
|
4
|
+
import Ajv from 'ajv';
|
|
5
|
+
import obsSetsSchema from './obsSets.schema';
|
|
6
|
+
import rasterSchema from './raster.schema';
|
|
7
|
+
describe('schemas', () => {
|
|
8
|
+
[
|
|
9
|
+
'config-1.0.1',
|
|
10
|
+
'obsSets',
|
|
11
|
+
'obsSetsTabular',
|
|
12
|
+
'raster',
|
|
13
|
+
].forEach((type) => {
|
|
14
|
+
const schemaFile = `${type}.schema.json`;
|
|
15
|
+
describe(schemaFile, async () => {
|
|
16
|
+
const schema = await import(`./${schemaFile}`);
|
|
17
|
+
let validate;
|
|
18
|
+
if (type === 'config-1.0.1') {
|
|
19
|
+
const obsSets = obsSetsSchema;
|
|
20
|
+
const raster = rasterSchema;
|
|
21
|
+
validate = new Ajv()
|
|
22
|
+
.addSchema(obsSets)
|
|
23
|
+
.addSchema(raster)
|
|
24
|
+
.compile(schema);
|
|
25
|
+
} else {
|
|
26
|
+
validate = new Ajv().compile(schema);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const [goodFixture, badFixture, badMessage] = [
|
|
30
|
+
'good', 'bad', 'bad.message',
|
|
31
|
+
].map(stem => `${type}.${stem}.json`);
|
|
32
|
+
|
|
33
|
+
it(`passes ${goodFixture}`, async () => {
|
|
34
|
+
const data = await import(`./fixtures/${goodFixture}`);
|
|
35
|
+
const valid = validate(data);
|
|
36
|
+
if (!valid) { console.warn(validate.errors); }
|
|
37
|
+
expect(valid).toEqual(true);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it(`fails ${badFixture}`, async () => {
|
|
41
|
+
const data = await import(`./fixtures/${badFixture}`);
|
|
42
|
+
const message = await import(`./fixtures/${badMessage}`);
|
|
43
|
+
const valid = validate(data);
|
|
44
|
+
expect(valid).toEqual(false);
|
|
45
|
+
expect(validate.errors).toEqual(message);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import Ajv from 'ajv';
|
|
2
|
+
/* eslint-disable import/no-dynamic-require */
|
|
3
|
+
/* eslint-disable global-require */
|
|
4
|
+
describe('schemas', () => {
|
|
5
|
+
[
|
|
6
|
+
'config-1.0.1',
|
|
7
|
+
'obsSets',
|
|
8
|
+
'obsSetsTabular',
|
|
9
|
+
'raster',
|
|
10
|
+
].forEach((type) => {
|
|
11
|
+
const schemaFile = `${type}.schema.json`;
|
|
12
|
+
describe(schemaFile, () => {
|
|
13
|
+
const schema = require(`./${schemaFile}`);
|
|
14
|
+
let validate;
|
|
15
|
+
if (type === 'config-1.0.1') {
|
|
16
|
+
const obsSets = require('./obsSets.schema.json');
|
|
17
|
+
const raster = require('./raster.schema.json');
|
|
18
|
+
validate = new Ajv()
|
|
19
|
+
.addSchema(obsSets)
|
|
20
|
+
.addSchema(raster)
|
|
21
|
+
.compile(schema);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
validate = new Ajv().compile(schema);
|
|
25
|
+
}
|
|
26
|
+
const [goodFixture, badFixture, badMessage] = [
|
|
27
|
+
'good', 'bad', 'bad.message',
|
|
28
|
+
].map(stem => `${type}.${stem}.json`);
|
|
29
|
+
it(`passes ${goodFixture}`, () => {
|
|
30
|
+
const data = require(`./fixtures/${goodFixture}`);
|
|
31
|
+
const valid = validate(data);
|
|
32
|
+
if (!valid) {
|
|
33
|
+
console.warn(validate.errors);
|
|
34
|
+
}
|
|
35
|
+
expect(valid).toEqual(true);
|
|
36
|
+
});
|
|
37
|
+
it(`fails ${badFixture}`, () => {
|
|
38
|
+
const data = require(`./fixtures/${badFixture}`);
|
|
39
|
+
const message = require(`./fixtures/${badMessage}`);
|
|
40
|
+
const valid = validate(data);
|
|
41
|
+
expect(valid).toEqual(false);
|
|
42
|
+
expect(validate.errors).toEqual(message);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
});
|
package/dist/schemas.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
+
import Paper from '@material-ui/core/Paper';
|
|
5
|
+
import Popper from '@material-ui/core/Popper';
|
|
6
|
+
import IconButton from '@material-ui/core/IconButton';
|
|
7
|
+
import MenuList from '@material-ui/core/MenuList';
|
|
8
|
+
import ClickAwayListener from '@material-ui/core/ClickAwayListener';
|
|
9
|
+
import Fade from '@material-ui/core/Fade';
|
|
10
|
+
import { useVitessceContainer } from '../hooks';
|
|
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
|
+
export function PopperMenu(props) {
|
|
23
|
+
const { buttonIcon, open, setOpen, children, buttonClassName, placement = 'bottom-end', } = props;
|
|
24
|
+
const classes = useStyles();
|
|
25
|
+
const anchorRef = useRef();
|
|
26
|
+
const handleClick = () => {
|
|
27
|
+
setOpen(prev => !prev);
|
|
28
|
+
};
|
|
29
|
+
const handleClose = () => {
|
|
30
|
+
setOpen(false);
|
|
31
|
+
};
|
|
32
|
+
const id = open ? 'v-popover-menu' : undefined;
|
|
33
|
+
const getTooltipContainer = useVitessceContainer(anchorRef);
|
|
34
|
+
return (_jsxs("div", { ref: anchorRef, className: classes.container, children: [_jsx(IconButton, { "aria-describedby": id, onClick: handleClick, size: "small", className: buttonClassName, children: buttonIcon }), _jsx(Popper, { id: id, open: open, anchorEl: anchorRef && anchorRef.current, container: getTooltipContainer, onClose: handleClose, placement: placement, transition: true, children: ({ TransitionProps }) => (_jsx(ClickAwayListener, { onClickAway: handleClose, children: _jsx(Fade, { ...TransitionProps, timeout: 100, children: _jsx(Paper, { elevation: 4, className: classes.paper, children: _jsx(MenuList, { children: children }) }) }) })) })] }));
|
|
35
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
2
|
+
export const useVitessceContainerStyles = makeStyles(theme => ({
|
|
3
|
+
vitessceContainer: {
|
|
4
|
+
position: 'relative',
|
|
5
|
+
margin: '0',
|
|
6
|
+
textAlign: 'left',
|
|
7
|
+
backgroundColor: theme.palette.gridLayoutBackground,
|
|
8
|
+
'& div': {
|
|
9
|
+
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"',
|
|
10
|
+
fontSize: '1rem',
|
|
11
|
+
fontWeight: '400',
|
|
12
|
+
lineHeight: '1.5',
|
|
13
|
+
textAlign: 'left',
|
|
14
|
+
},
|
|
15
|
+
'& p': {
|
|
16
|
+
marginTop: '0',
|
|
17
|
+
marginBottom: '1rem',
|
|
18
|
+
},
|
|
19
|
+
'& *, ::after, ::before': {
|
|
20
|
+
boxSizing: 'border-box',
|
|
21
|
+
},
|
|
22
|
+
// Manually converted styles from 'react-grid-layout/css/styles.css',
|
|
23
|
+
// using https://cssinjs.org/jss-plugin-global/?v=v10.9.2
|
|
24
|
+
// so that no CSS or SCSS import is required.
|
|
25
|
+
'@global .react-grid-layout': {
|
|
26
|
+
transition: 'height 200ms ease',
|
|
27
|
+
// Custom
|
|
28
|
+
height: 'auto',
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
width: '100%',
|
|
31
|
+
},
|
|
32
|
+
'@global .react-grid-item': {
|
|
33
|
+
transition: 'all 200ms ease',
|
|
34
|
+
transitionProperty: 'left, top',
|
|
35
|
+
// Custom
|
|
36
|
+
flexDirection: 'column!important',
|
|
37
|
+
display: 'flex!important',
|
|
38
|
+
/* So the resize handle position looks correct: */
|
|
39
|
+
paddingRight: '10px',
|
|
40
|
+
},
|
|
41
|
+
'@global .react-grid-item img': {
|
|
42
|
+
pointerEvents: 'none',
|
|
43
|
+
userSelect: 'none',
|
|
44
|
+
},
|
|
45
|
+
'@global .react-grid-item.cssTransforms': {
|
|
46
|
+
transitionProperty: 'transform',
|
|
47
|
+
},
|
|
48
|
+
'@global .react-grid-item.resizing': {
|
|
49
|
+
zIndex: '1',
|
|
50
|
+
willChange: 'width, height',
|
|
51
|
+
},
|
|
52
|
+
'@global .react-grid-item.react-draggable-dragging': {
|
|
53
|
+
transition: 'none',
|
|
54
|
+
zIndex: '3',
|
|
55
|
+
willChange: 'transform',
|
|
56
|
+
},
|
|
57
|
+
'@global .react-grid-item.dropping': {
|
|
58
|
+
visibility: 'hidden',
|
|
59
|
+
},
|
|
60
|
+
'@global .react-grid-item.react-grid-placeholder': {
|
|
61
|
+
background: 'red',
|
|
62
|
+
opacity: '0.2',
|
|
63
|
+
transitionDuration: '100ms',
|
|
64
|
+
zIndex: '2',
|
|
65
|
+
userSelect: 'none',
|
|
66
|
+
},
|
|
67
|
+
'@global .react-grid-item > .react-resizable-handle': {
|
|
68
|
+
position: 'absolute',
|
|
69
|
+
width: '20px',
|
|
70
|
+
height: '20px',
|
|
71
|
+
},
|
|
72
|
+
'@global .react-grid-item > .react-resizable-handle::after': {
|
|
73
|
+
content: '""',
|
|
74
|
+
position: 'absolute',
|
|
75
|
+
right: '3px',
|
|
76
|
+
bottom: '3px',
|
|
77
|
+
width: '5px',
|
|
78
|
+
height: '5px',
|
|
79
|
+
borderRight: '2px solid rgba(0, 0, 0, 0.4)',
|
|
80
|
+
borderBottom: '2px solid rgba(0, 0, 0, 0.4)',
|
|
81
|
+
},
|
|
82
|
+
'@global .react-resizable-hide > .react-resizable-handle': {
|
|
83
|
+
display: 'none',
|
|
84
|
+
},
|
|
85
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-sw': {
|
|
86
|
+
bottom: '0',
|
|
87
|
+
left: '0',
|
|
88
|
+
cursor: 'sw-resize',
|
|
89
|
+
transform: 'rotate(90deg)',
|
|
90
|
+
},
|
|
91
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-se': {
|
|
92
|
+
bottom: '0',
|
|
93
|
+
right: '0',
|
|
94
|
+
cursor: 'se-resize',
|
|
95
|
+
},
|
|
96
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-nw': {
|
|
97
|
+
top: '0',
|
|
98
|
+
left: '0',
|
|
99
|
+
cursor: 'nw-resize',
|
|
100
|
+
transform: 'rotate(180deg)',
|
|
101
|
+
},
|
|
102
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-ne': {
|
|
103
|
+
top: '0',
|
|
104
|
+
right: '0',
|
|
105
|
+
cursor: 'ne-resize',
|
|
106
|
+
transform: 'rotate(270deg)',
|
|
107
|
+
},
|
|
108
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-w': {
|
|
109
|
+
top: '50%',
|
|
110
|
+
marginTop: '-10px',
|
|
111
|
+
cursor: 'ew-resize',
|
|
112
|
+
left: '0',
|
|
113
|
+
transform: 'rotate(135deg)',
|
|
114
|
+
},
|
|
115
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-e': {
|
|
116
|
+
top: '50%',
|
|
117
|
+
marginTop: '-10px',
|
|
118
|
+
cursor: 'ew-resize',
|
|
119
|
+
right: '0',
|
|
120
|
+
transform: 'rotate(315deg)',
|
|
121
|
+
},
|
|
122
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-n': {
|
|
123
|
+
left: '50%',
|
|
124
|
+
marginLeft: '-10px',
|
|
125
|
+
cursor: 'ns-resize',
|
|
126
|
+
top: '0',
|
|
127
|
+
transform: 'rotate(225deg)',
|
|
128
|
+
},
|
|
129
|
+
'@global .react-grid-item > .react-resizable-handle.react-resizable-handle-s': {
|
|
130
|
+
left: '50%',
|
|
131
|
+
marginLeft: '-10px',
|
|
132
|
+
cursor: 'ns-resize',
|
|
133
|
+
bottom: '0',
|
|
134
|
+
transform: 'rotate(45deg)',
|
|
135
|
+
},
|
|
136
|
+
// Manually converted styles from 'react-resizable/css/styles.css',
|
|
137
|
+
'@global .react-resizable': {
|
|
138
|
+
position: 'relative',
|
|
139
|
+
},
|
|
140
|
+
'@global .react-resizable-handle': {
|
|
141
|
+
position: 'absolute',
|
|
142
|
+
width: '20px',
|
|
143
|
+
height: '20px',
|
|
144
|
+
backgroundRepeat: 'no-repeat',
|
|
145
|
+
backgroundOrigin: 'content-box',
|
|
146
|
+
boxSizing: 'border-box',
|
|
147
|
+
backgroundImage: "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+')",
|
|
148
|
+
backgroundPosition: 'bottom right',
|
|
149
|
+
padding: '0 3px 3px 0',
|
|
150
|
+
},
|
|
151
|
+
'@global .react-resizable-handle-sw': {
|
|
152
|
+
bottom: '0',
|
|
153
|
+
left: '0',
|
|
154
|
+
cursor: 'sw-resize',
|
|
155
|
+
transform: 'rotate(90deg)',
|
|
156
|
+
},
|
|
157
|
+
'@global .react-resizable-handle-se': {
|
|
158
|
+
bottom: '0',
|
|
159
|
+
right: '0',
|
|
160
|
+
cursor: 'se-resize',
|
|
161
|
+
},
|
|
162
|
+
'@global .react-resizable-handle-nw': {
|
|
163
|
+
top: '0',
|
|
164
|
+
left: '0',
|
|
165
|
+
cursor: 'nw-resize',
|
|
166
|
+
transform: 'rotate(180deg)',
|
|
167
|
+
},
|
|
168
|
+
'@global .react-resizable-handle-ne': {
|
|
169
|
+
top: '0',
|
|
170
|
+
right: '0',
|
|
171
|
+
cursor: 'ne-resize',
|
|
172
|
+
transform: 'rotate(270deg)',
|
|
173
|
+
},
|
|
174
|
+
'@global .react-resizable-handle-w': {
|
|
175
|
+
top: '50%',
|
|
176
|
+
marginTop: '-10px',
|
|
177
|
+
cursor: 'ew-resize',
|
|
178
|
+
left: '0',
|
|
179
|
+
transform: 'rotate(135deg)',
|
|
180
|
+
},
|
|
181
|
+
'@global .react-resizable-handle-e': {
|
|
182
|
+
top: '50%',
|
|
183
|
+
marginTop: '-10px',
|
|
184
|
+
cursor: 'ew-resize',
|
|
185
|
+
right: '0',
|
|
186
|
+
transform: 'rotate(315deg)',
|
|
187
|
+
},
|
|
188
|
+
'@global .react-resizable-handle-n': {
|
|
189
|
+
left: '50%',
|
|
190
|
+
marginLeft: '-10px',
|
|
191
|
+
cursor: 'ns-resize',
|
|
192
|
+
top: '0',
|
|
193
|
+
transform: 'rotate(225deg)',
|
|
194
|
+
},
|
|
195
|
+
'@global .react-resizable-handle-s': {
|
|
196
|
+
left: '50%',
|
|
197
|
+
marginLeft: '-10px',
|
|
198
|
+
cursor: 'ns-resize',
|
|
199
|
+
bottom: '0',
|
|
200
|
+
transform: 'rotate(45deg)',
|
|
201
|
+
},
|
|
202
|
+
// Custom
|
|
203
|
+
'@global .react-draggable-transparent-selection .react-grid-item': {
|
|
204
|
+
/* These styles prevent text selection during resize drag interactions.
|
|
205
|
+
The react-draggable-transparent-selection class is added to the body
|
|
206
|
+
element during resizing and removed after resizing has finished.
|
|
207
|
+
Not part of mixin because acts outside of .vitessce-container. */
|
|
208
|
+
userSelect: 'none !important',
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
}));
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { createTheme } from '@material-ui/core/styles';
|
|
2
|
+
import { grey } from '@material-ui/core/colors';
|
|
3
|
+
const globalColors = {
|
|
4
|
+
white: '#FFFFFF',
|
|
5
|
+
grayLight: '#D3D3D3',
|
|
6
|
+
grayMid: '#808080',
|
|
7
|
+
grayDark: '#555555',
|
|
8
|
+
black: '#000000',
|
|
9
|
+
};
|
|
10
|
+
export const muiTheme = {
|
|
11
|
+
dark: createTheme({
|
|
12
|
+
palette: {
|
|
13
|
+
type: 'dark',
|
|
14
|
+
primary: grey,
|
|
15
|
+
secondary: grey,
|
|
16
|
+
primaryBackground: '#222222',
|
|
17
|
+
primaryBackgroundHighlight: '#000000',
|
|
18
|
+
primaryBackgroundInput: '#D3D3D3',
|
|
19
|
+
primaryBackgroundDim: '#333333',
|
|
20
|
+
primaryBackgroundLight: '#757575',
|
|
21
|
+
primaryForeground: '#D3D3D3',
|
|
22
|
+
primaryForegroundDim: '#000000',
|
|
23
|
+
primaryForegroundActive: '#9bb7d6',
|
|
24
|
+
secondaryBackground: '#000000',
|
|
25
|
+
secondaryBackgroundDim: '#444444',
|
|
26
|
+
secondaryForeground: '#D3D3D3',
|
|
27
|
+
gridLayoutBackground: '#333333',
|
|
28
|
+
cardBorder: 'rgba(0, 0, 0, 0.125)',
|
|
29
|
+
...globalColors,
|
|
30
|
+
},
|
|
31
|
+
props: {
|
|
32
|
+
MuiButtonBase: {
|
|
33
|
+
disableRipple: true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
light: createTheme({
|
|
38
|
+
palette: {
|
|
39
|
+
type: 'light',
|
|
40
|
+
primary: grey,
|
|
41
|
+
secondary: grey,
|
|
42
|
+
primaryBackground: '#F1F1F1',
|
|
43
|
+
primaryBackgroundHighlight: '#FFFFFF',
|
|
44
|
+
primaryBackgroundInput: '#FFFFFF',
|
|
45
|
+
primaryBackgroundDim: '#8A8A8A',
|
|
46
|
+
primaryBackgroundLight: '#e0e0e0',
|
|
47
|
+
primaryForeground: '#333333',
|
|
48
|
+
primaryForegroundDim: '#808080',
|
|
49
|
+
primaryForegroundActive: '#0074D9',
|
|
50
|
+
secondaryBackground: '#F1F1F1',
|
|
51
|
+
secondaryBackgroundDim: '#C0C0C0',
|
|
52
|
+
secondaryForeground: '#222222',
|
|
53
|
+
gridLayoutBackground: '#FFFFFF',
|
|
54
|
+
cardBorder: 'rgba(241, 241, 241, 0.125)',
|
|
55
|
+
...globalColors,
|
|
56
|
+
},
|
|
57
|
+
props: {
|
|
58
|
+
MuiButtonBase: {
|
|
59
|
+
disableRipple: true,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import TableCell from '@material-ui/core/TableCell';
|
|
4
|
+
import TableRow from '@material-ui/core/TableRow';
|
|
5
|
+
import { capitalize } from '@vitessce/utils';
|
|
6
|
+
import OptionSelect from './OptionSelect';
|
|
7
|
+
import { useStyles } from './styles';
|
|
8
|
+
export default function CellColorEncodingOption(props) {
|
|
9
|
+
const { observationsLabel, cellColorEncoding, setCellColorEncoding, } = props;
|
|
10
|
+
const classes = useStyles();
|
|
11
|
+
const observationsLabelNice = capitalize(observationsLabel);
|
|
12
|
+
function handleColorEncodingChange(event) {
|
|
13
|
+
setCellColorEncoding(event.target.value);
|
|
14
|
+
}
|
|
15
|
+
return (_jsxs(TableRow, { children: [_jsxs(TableCell, { className: classes.labelCell, htmlFor: "cell-color-encoding-select", children: [observationsLabelNice, " Color Encoding"] }), _jsx(TableCell, { className: classes.inputCell, children: _jsxs(OptionSelect, { className: classes.select, value: cellColorEncoding, onChange: handleColorEncodingChange, inputProps: {
|
|
16
|
+
id: 'cell-color-encoding-select',
|
|
17
|
+
}, children: [_jsx("option", { value: "cellSetSelection", children: "Cell Sets" }), _jsx("option", { value: "geneSelection", children: "Gene Expression" })] }) })] }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Select from '@material-ui/core/Select';
|
|
4
|
+
import { useStyles } from './styles';
|
|
5
|
+
export default function OptionSelect(props) {
|
|
6
|
+
const { classes: classesProp = {} } = props;
|
|
7
|
+
const classes = useStyles();
|
|
8
|
+
return (_jsx(Select, { native: true, disableUnderline: true, ...props, classes: {
|
|
9
|
+
root: classes.selectRoot,
|
|
10
|
+
...classesProp,
|
|
11
|
+
} }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Box from '@material-ui/core/Box';
|
|
4
|
+
import Table from '@material-ui/core/Table';
|
|
5
|
+
import TableBody from '@material-ui/core/TableBody';
|
|
6
|
+
import TableContainer from '@material-ui/core/TableContainer';
|
|
7
|
+
import { useStyles } from './styles';
|
|
8
|
+
export default function OptionsContainer(props) {
|
|
9
|
+
const { children, } = props;
|
|
10
|
+
const classes = useStyles();
|
|
11
|
+
return (_jsx(Box, { className: classes.box, children: _jsx(TableContainer, { className: classes.tableContainer, children: _jsx(Table, { className: classes.table, size: "small", children: _jsx(TableBody, { children: children }) }) }) }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
2
|
+
export const useStyles = makeStyles(theme => ({
|
|
3
|
+
box: {
|
|
4
|
+
boxSizing: 'border-box',
|
|
5
|
+
},
|
|
6
|
+
checkbox: {
|
|
7
|
+
padding: '3px',
|
|
8
|
+
color: theme.palette.primaryForeground,
|
|
9
|
+
'&:checked': {
|
|
10
|
+
color: theme.palette.primaryForeground,
|
|
11
|
+
},
|
|
12
|
+
'& input': {
|
|
13
|
+
height: '100%',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
slider: {
|
|
17
|
+
color: theme.palette.primaryForeground,
|
|
18
|
+
minWidth: '60px',
|
|
19
|
+
padding: '10px 0 10px 0',
|
|
20
|
+
},
|
|
21
|
+
sliderValueLabel: {
|
|
22
|
+
'& span': {
|
|
23
|
+
'& span': {
|
|
24
|
+
color: theme.palette.primaryBackground,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
tableContainer: {
|
|
29
|
+
overflow: 'hidden',
|
|
30
|
+
overflowX: 'hidden !important',
|
|
31
|
+
},
|
|
32
|
+
labelCell: {
|
|
33
|
+
padding: '2px 8px 2px 16px',
|
|
34
|
+
},
|
|
35
|
+
inputCell: {
|
|
36
|
+
padding: '2px 16px 2px 8px',
|
|
37
|
+
overflow: 'visible',
|
|
38
|
+
},
|
|
39
|
+
select: {
|
|
40
|
+
'& select': {
|
|
41
|
+
fontSize: '.875rem',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
selectRoot: {
|
|
45
|
+
padding: 0,
|
|
46
|
+
height: 'auto',
|
|
47
|
+
},
|
|
48
|
+
}));
|