@vitessce/vit-s 2.0.2 → 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.
Files changed (172) hide show
  1. package/dist/index.mjs +84801 -0
  2. package/{dist → dist-tsc}/index.js +2 -2
  3. package/package.json +7 -7
  4. package/src/CallbackPublisher.js +81 -0
  5. package/src/LoadingIndicator.js +34 -0
  6. package/src/TitleInfo.js +240 -0
  7. package/src/VitS.js +180 -0
  8. package/src/VitessceGrid.js +110 -0
  9. package/src/VitessceGrid.test.jsx +48 -0
  10. package/src/Warning.js +62 -0
  11. package/{dist → src}/classNames.js +0 -0
  12. package/src/component-registry.js +21 -0
  13. package/src/data/AbstractLoader.js +46 -0
  14. package/{dist → src}/data/AbstractTwoStepLoader.js +5 -4
  15. package/src/data/LoaderResult.js +8 -0
  16. package/{dist → src}/data/index.js +0 -0
  17. package/src/data/loader-registry.js +19 -0
  18. package/src/data-hook-utils.js +197 -0
  19. package/src/data-hooks.js +354 -0
  20. package/src/errors/AbstractLoaderError.js +14 -0
  21. package/src/errors/DataSourceFetchError.js +15 -0
  22. package/src/errors/DatasetNotFoundError.js +23 -0
  23. package/src/errors/LoaderNotFoundError.js +24 -0
  24. package/src/errors/LoaderValidationError.js +23 -0
  25. package/src/errors/OptionsValidationError.js +25 -0
  26. package/{dist → src}/errors/index.js +0 -0
  27. package/src/file-options-schemas-legacy.js +139 -0
  28. package/src/file-options-schemas-legacy.test.js +138 -0
  29. package/src/file-options-schemas.js +327 -0
  30. package/src/file-options-schemas.test.js +26 -0
  31. package/src/hooks.js +252 -0
  32. package/src/index.js +101 -0
  33. package/src/joint-file-types-legacy.js +298 -0
  34. package/src/joint-file-types-legacy.test.js +412 -0
  35. package/src/joint-file-types.js +171 -0
  36. package/src/joint-file-types.test.js +144 -0
  37. package/{dist/schemas.js → src/json-schemas.js} +6 -1
  38. package/{dist → src}/plugins.js +102 -70
  39. package/src/plugins.test.fixtures.js +78 -0
  40. package/src/plugins.test.js +42 -0
  41. package/src/schemas/config-0.1.0.schema.json +85 -0
  42. package/src/schemas/config-1.0.0.schema.json +733 -0
  43. package/src/schemas/config-1.0.1.schema.json +909 -0
  44. package/src/schemas/config-1.0.10.schema.json +969 -0
  45. package/src/schemas/config-1.0.11.schema.json +990 -0
  46. package/src/schemas/config-1.0.12.schema.json +997 -0
  47. package/src/schemas/config-1.0.13.schema.json +1013 -0
  48. package/src/schemas/config-1.0.14.schema.json +1048 -0
  49. package/src/schemas/config-1.0.15.schema.json +1048 -0
  50. package/src/schemas/config-1.0.16.schema.json +1069 -0
  51. package/src/schemas/config-1.0.16.schema.test.js +32 -0
  52. package/src/schemas/config-1.0.2.schema.json +911 -0
  53. package/src/schemas/config-1.0.3.schema.json +911 -0
  54. package/src/schemas/config-1.0.4.schema.json +949 -0
  55. package/src/schemas/config-1.0.5.schema.json +949 -0
  56. package/src/schemas/config-1.0.6.schema.json +950 -0
  57. package/src/schemas/config-1.0.7.schema.json +950 -0
  58. package/src/schemas/config-1.0.8.schema.json +966 -0
  59. package/src/schemas/config-1.0.9.schema.json +965 -0
  60. package/src/schemas/fixtures/cellSets.good.json +16 -0
  61. package/src/schemas/fixtures/config-1.0.1.bad.json +1 -0
  62. package/src/schemas/fixtures/config-1.0.1.bad.message.json +11 -0
  63. package/src/schemas/fixtures/config-1.0.1.good.json +37 -0
  64. package/src/schemas/fixtures/config-1.0.2.bad.json +1 -0
  65. package/src/schemas/fixtures/config-1.0.2.bad.message.json +11 -0
  66. package/src/schemas/fixtures/config-1.0.2.good.json +38 -0
  67. package/src/schemas/fixtures/config-1.0.3.bad.json +1 -0
  68. package/src/schemas/fixtures/config-1.0.3.bad.message.json +11 -0
  69. package/src/schemas/fixtures/config-1.0.3.good.json +38 -0
  70. package/src/schemas/fixtures/obsSets.bad.json +1 -0
  71. package/src/schemas/fixtures/obsSets.bad.message.json +11 -0
  72. package/src/schemas/fixtures/obsSets.good.json +16 -0
  73. package/src/schemas/fixtures/obsSetsTabular.bad.json +1 -0
  74. package/src/schemas/fixtures/obsSetsTabular.bad.message.json +11 -0
  75. package/src/schemas/fixtures/obsSetsTabular.good.json +26 -0
  76. package/src/schemas/fixtures/raster.bad.json +1 -0
  77. package/src/schemas/fixtures/raster.bad.message.json +11 -0
  78. package/src/schemas/fixtures/raster.good.json +39 -0
  79. package/src/schemas/obsSets.schema.js +195 -0
  80. package/src/schemas/obsSetsTabular.schema.js +39 -0
  81. package/src/schemas/raster.schema.js +121 -0
  82. package/src/schemas/schema-schema.sh +34 -0
  83. package/{dist → src}/schemas/schema.test-old.js +0 -1
  84. package/src/shared-mui/components.js +79 -0
  85. package/src/shared-mui/container.js +212 -0
  86. package/src/shared-mui/styles.js +110 -0
  87. package/src/shared-plot-options/CellColorEncodingOption.js +43 -0
  88. package/src/shared-plot-options/OptionSelect.js +19 -0
  89. package/src/shared-plot-options/OptionsContainer.js +26 -0
  90. package/{dist → src}/shared-plot-options/index.js +0 -0
  91. package/src/shared-plot-options/styles.js +49 -0
  92. package/src/state/hooks.js +633 -0
  93. package/src/view-config-upgraders.js +628 -0
  94. package/src/view-config-utils.js +315 -0
  95. package/src/view-config-utils.test.fixtures.js +893 -0
  96. package/src/view-config-utils.test.js +95 -0
  97. package/src/view-config-versions.js +68 -0
  98. package/src/vitessce-grid-layout/VitessceGridLayout.js +158 -0
  99. package/src/vitessce-grid-layout/VitessceGridLayout.test.jsx +56 -0
  100. package/{dist → src}/vitessce-grid-layout/index.js +0 -0
  101. package/src/vitessce-grid-layout/layout-utils.js +76 -0
  102. package/src/vitessce-grid-layout/layout-utils.test.js +167 -0
  103. package/src/vitessce-grid-utils.js +160 -0
  104. package/dist/CallbackPublisher.js +0 -68
  105. package/dist/LoadingIndicator.js +0 -27
  106. package/dist/TitleInfo.js +0 -151
  107. package/dist/VitS.js +0 -112
  108. package/dist/VitessceGrid.js +0 -59
  109. package/dist/VitessceGrid.test.js +0 -36
  110. package/dist/Warning.js +0 -45
  111. package/dist/component-registry.js +0 -16
  112. package/dist/data/AbstractLoader.js +0 -35
  113. package/dist/data/LoaderResult.js +0 -7
  114. package/dist/data/loader-registry.js +0 -15
  115. package/dist/data-hook-utils.js +0 -175
  116. package/dist/data-hooks.js +0 -241
  117. package/dist/errors/AbstractLoaderError.js +0 -13
  118. package/dist/errors/DataSourceFetchError.js +0 -13
  119. package/dist/errors/DatasetNotFoundError.js +0 -17
  120. package/dist/errors/LoaderNotFoundError.js +0 -17
  121. package/dist/errors/LoaderValidationError.js +0 -15
  122. package/dist/errors/OptionsValidationError.js +0 -15
  123. package/dist/file-options-schemas-legacy.js +0 -136
  124. package/dist/file-options-schemas-legacy.test.js +0 -126
  125. package/dist/file-options-schemas.js +0 -322
  126. package/dist/file-options-schemas.test.js +0 -23
  127. package/dist/hooks.js +0 -215
  128. package/dist/joint-file-types-legacy.js +0 -278
  129. package/dist/joint-file-types-legacy.test.js +0 -400
  130. package/dist/joint-file-types.js +0 -148
  131. package/dist/joint-file-types.test.js +0 -139
  132. package/dist/plugins.test.fixtures.js +0 -76
  133. package/dist/plugins.test.js +0 -30
  134. package/dist/schemas/config-0.1.0.schema.json +0 -84
  135. package/dist/schemas/config-1.0.0.schema.json +0 -733
  136. package/dist/schemas/config-1.0.1.schema.json +0 -909
  137. package/dist/schemas/config-1.0.10.schema.json +0 -969
  138. package/dist/schemas/config-1.0.11.schema.json +0 -990
  139. package/dist/schemas/config-1.0.12.schema.json +0 -997
  140. package/dist/schemas/config-1.0.13.schema.json +0 -1013
  141. package/dist/schemas/config-1.0.14.schema.json +0 -1048
  142. package/dist/schemas/config-1.0.15.schema.json +0 -1048
  143. package/dist/schemas/config-1.0.15.schema.test.js +0 -22
  144. package/dist/schemas/config-1.0.2.schema.json +0 -910
  145. package/dist/schemas/config-1.0.3.schema.json +0 -910
  146. package/dist/schemas/config-1.0.4.schema.json +0 -949
  147. package/dist/schemas/config-1.0.5.schema.json +0 -949
  148. package/dist/schemas/config-1.0.6.schema.json +0 -949
  149. package/dist/schemas/config-1.0.7.schema.json +0 -949
  150. package/dist/schemas/config-1.0.8.schema.json +0 -965
  151. package/dist/schemas/config-1.0.9.schema.json +0 -965
  152. package/dist/schemas/obsSets.schema.js +0 -195
  153. package/dist/schemas/obsSetsTabular.schema.js +0 -38
  154. package/dist/schemas/raster.schema.js +0 -120
  155. package/dist/shared-mui/components.js +0 -35
  156. package/dist/shared-mui/container.js +0 -211
  157. package/dist/shared-mui/styles.js +0 -73
  158. package/dist/shared-plot-options/CellColorEncodingOption.js +0 -18
  159. package/dist/shared-plot-options/OptionSelect.js +0 -12
  160. package/dist/shared-plot-options/OptionsContainer.js +0 -12
  161. package/dist/shared-plot-options/styles.js +0 -48
  162. package/dist/state/hooks.js +0 -549
  163. package/dist/view-config-upgraders.js +0 -525
  164. package/dist/view-config-utils.js +0 -286
  165. package/dist/view-config-utils.test.fixtures.js +0 -765
  166. package/dist/view-config-utils.test.js +0 -66
  167. package/dist/view-config-versions.js +0 -47
  168. package/dist/vitessce-grid-layout/VitessceGridLayout.js +0 -95
  169. package/dist/vitessce-grid-layout/VitessceGridLayout.test.js +0 -40
  170. package/dist/vitessce-grid-layout/layout-utils.js +0 -60
  171. package/dist/vitessce-grid-layout/layout-utils.test.js +0 -146
  172. 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
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  // TODO(monorepo)
3
2
  /*
4
3
  import Ajv from 'ajv';
@@ -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
+ }));