@vitessce/vit-s 2.0.3-beta.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/dist/index.js +41348 -18
  2. package/dist-tsc/CallbackPublisher.d.ts +18 -0
  3. package/dist-tsc/CallbackPublisher.d.ts.map +1 -0
  4. package/{dist → dist-tsc}/CallbackPublisher.js +6 -12
  5. package/dist-tsc/LoadingIndicator.d.ts +2 -0
  6. package/dist-tsc/LoadingIndicator.d.ts.map +1 -0
  7. package/{dist → dist-tsc}/LoadingIndicator.js +1 -2
  8. package/dist-tsc/TitleInfo.d.ts +2 -0
  9. package/dist-tsc/TitleInfo.d.ts.map +1 -0
  10. package/{dist → dist-tsc}/TitleInfo.js +6 -83
  11. package/dist-tsc/VitS.d.ts +45 -0
  12. package/dist-tsc/VitS.d.ts.map +1 -0
  13. package/dist-tsc/VitS.js +119 -0
  14. package/dist-tsc/VitessceGrid.d.ts +23 -0
  15. package/dist-tsc/VitessceGrid.d.ts.map +1 -0
  16. package/{dist → dist-tsc}/VitessceGrid.js +14 -13
  17. package/dist-tsc/VitessceGrid.test.d.ts +2 -0
  18. package/dist-tsc/VitessceGrid.test.d.ts.map +1 -0
  19. package/{dist → dist-tsc}/VitessceGrid.test.js +8 -4
  20. package/dist-tsc/Warning.d.ts +2 -0
  21. package/dist-tsc/Warning.d.ts.map +1 -0
  22. package/{dist → dist-tsc}/Warning.js +2 -2
  23. package/dist-tsc/classNames.d.ts +8 -0
  24. package/dist-tsc/classNames.d.ts.map +1 -0
  25. package/dist-tsc/data/AbstractLoader.d.ts +22 -0
  26. package/dist-tsc/data/AbstractLoader.d.ts.map +1 -0
  27. package/dist-tsc/data/AbstractLoader.js +18 -0
  28. package/dist-tsc/data/AbstractTwoStepLoader.d.ts +6 -0
  29. package/dist-tsc/data/AbstractTwoStepLoader.d.ts.map +1 -0
  30. package/{dist → dist-tsc}/data/AbstractTwoStepLoader.js +1 -1
  31. package/dist-tsc/data/LoaderResult.d.ts +7 -0
  32. package/dist-tsc/data/LoaderResult.d.ts.map +1 -0
  33. package/dist-tsc/data/index.d.ts +4 -0
  34. package/dist-tsc/data/index.d.ts.map +1 -0
  35. package/dist-tsc/data/index.js +3 -0
  36. package/dist-tsc/data/loader-registry.d.ts +9 -0
  37. package/dist-tsc/data/loader-registry.d.ts.map +1 -0
  38. package/dist-tsc/data/loader-registry.js +27 -0
  39. package/dist-tsc/data-hook-utils.d.ts +69 -0
  40. package/dist-tsc/data-hook-utils.d.ts.map +1 -0
  41. package/{dist → dist-tsc}/data-hook-utils.js +4 -6
  42. package/dist-tsc/data-hooks.d.ts +77 -0
  43. package/dist-tsc/data-hooks.d.ts.map +1 -0
  44. package/{dist → dist-tsc}/data-hooks.js +4 -4
  45. package/dist-tsc/errors/AbstractLoaderError.d.ts +10 -0
  46. package/dist-tsc/errors/AbstractLoaderError.d.ts.map +1 -0
  47. package/dist-tsc/errors/DataSourceFetchError.d.ts +8 -0
  48. package/dist-tsc/errors/DataSourceFetchError.d.ts.map +1 -0
  49. package/{dist → dist-tsc}/errors/DataSourceFetchError.js +1 -1
  50. package/dist-tsc/errors/DatasetNotFoundError.d.ts +6 -0
  51. package/dist-tsc/errors/DatasetNotFoundError.d.ts.map +1 -0
  52. package/{dist → dist-tsc}/errors/DatasetNotFoundError.js +1 -1
  53. package/dist-tsc/errors/LoaderNotFoundError.d.ts +10 -0
  54. package/dist-tsc/errors/LoaderNotFoundError.d.ts.map +1 -0
  55. package/{dist → dist-tsc}/errors/LoaderNotFoundError.js +1 -1
  56. package/dist-tsc/errors/LoaderValidationError.d.ts +10 -0
  57. package/dist-tsc/errors/LoaderValidationError.d.ts.map +1 -0
  58. package/{dist → dist-tsc}/errors/LoaderValidationError.js +1 -1
  59. package/dist-tsc/errors/index.d.ts +6 -0
  60. package/dist-tsc/errors/index.d.ts.map +1 -0
  61. package/{dist → dist-tsc}/errors/index.js +5 -6
  62. package/dist-tsc/hooks.d.ts +80 -0
  63. package/dist-tsc/hooks.d.ts.map +1 -0
  64. package/{dist → dist-tsc}/hooks.js +60 -4
  65. package/dist-tsc/index.d.ts +11 -0
  66. package/dist-tsc/index.d.ts.map +1 -0
  67. package/dist-tsc/index.js +11 -0
  68. package/dist-tsc/plugins.test.fixtures.d.ts +61 -0
  69. package/dist-tsc/plugins.test.fixtures.d.ts.map +1 -0
  70. package/{dist → dist-tsc}/schemas/config-1.0.16.schema.json +21 -41
  71. package/dist-tsc/schemas/obsSets.schema.d.ts +179 -0
  72. package/dist-tsc/schemas/obsSets.schema.d.ts.map +1 -0
  73. package/dist-tsc/schemas/obsSetsTabular.schema.d.ts +57 -0
  74. package/dist-tsc/schemas/obsSetsTabular.schema.d.ts.map +1 -0
  75. package/dist-tsc/schemas/raster.schema.d.ts +239 -0
  76. package/dist-tsc/schemas/raster.schema.d.ts.map +1 -0
  77. package/dist-tsc/shared-mui/components.d.ts +2 -0
  78. package/dist-tsc/shared-mui/components.d.ts.map +1 -0
  79. package/{dist → dist-tsc}/shared-mui/components.js +2 -8
  80. package/dist-tsc/shared-mui/container.d.ts +2 -0
  81. package/dist-tsc/shared-mui/container.d.ts.map +1 -0
  82. package/{dist → dist-tsc}/shared-mui/container.js +1 -1
  83. package/dist-tsc/shared-mui/styles.d.ts +5 -0
  84. package/dist-tsc/shared-mui/styles.d.ts.map +1 -0
  85. package/{dist → dist-tsc}/shared-mui/styles.js +4 -2
  86. package/dist-tsc/shared-plot-options/CellColorEncodingOption.d.ts +2 -0
  87. package/dist-tsc/shared-plot-options/CellColorEncodingOption.d.ts.map +1 -0
  88. package/{dist → dist-tsc}/shared-plot-options/CellColorEncodingOption.js +3 -4
  89. package/dist-tsc/shared-plot-options/OptionSelect.d.ts +2 -0
  90. package/dist-tsc/shared-plot-options/OptionSelect.d.ts.map +1 -0
  91. package/{dist → dist-tsc}/shared-plot-options/OptionSelect.js +2 -2
  92. package/dist-tsc/shared-plot-options/OptionsContainer.d.ts +2 -0
  93. package/dist-tsc/shared-plot-options/OptionsContainer.d.ts.map +1 -0
  94. package/{dist → dist-tsc}/shared-plot-options/OptionsContainer.js +2 -5
  95. package/dist-tsc/shared-plot-options/index.d.ts +5 -0
  96. package/dist-tsc/shared-plot-options/index.d.ts.map +1 -0
  97. package/dist-tsc/shared-plot-options/index.js +4 -0
  98. package/dist-tsc/shared-plot-options/styles.d.ts +2 -0
  99. package/dist-tsc/shared-plot-options/styles.d.ts.map +1 -0
  100. package/{dist → dist-tsc}/shared-plot-options/styles.js +1 -1
  101. package/dist-tsc/state/hooks.d.ts +216 -0
  102. package/dist-tsc/state/hooks.d.ts.map +1 -0
  103. package/{dist → dist-tsc}/state/hooks.js +47 -21
  104. package/dist-tsc/title-styles.d.ts +2 -0
  105. package/dist-tsc/title-styles.d.ts.map +1 -0
  106. package/dist-tsc/title-styles.js +72 -0
  107. package/dist-tsc/view-config-utils.d.ts +30 -0
  108. package/dist-tsc/view-config-utils.d.ts.map +1 -0
  109. package/{dist → dist-tsc}/view-config-utils.js +32 -84
  110. package/dist-tsc/view-config-utils.test.d.ts +2 -0
  111. package/dist-tsc/view-config-utils.test.d.ts.map +1 -0
  112. package/dist-tsc/view-config-utils.test.fixtures.d.ts +1049 -0
  113. package/dist-tsc/view-config-utils.test.fixtures.d.ts.map +1 -0
  114. package/{dist → dist-tsc}/view-config-utils.test.fixtures.js +118 -0
  115. package/dist-tsc/view-config-utils.test.js +209 -0
  116. package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.d.ts +8 -0
  117. package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.d.ts.map +1 -0
  118. package/{dist → dist-tsc}/vitessce-grid-layout/VitessceGridLayout.js +47 -28
  119. package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.test.d.ts +2 -0
  120. package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.test.d.ts.map +1 -0
  121. package/{dist → dist-tsc}/vitessce-grid-layout/VitessceGridLayout.test.js +13 -5
  122. package/dist-tsc/vitessce-grid-layout/index.d.ts +2 -0
  123. package/dist-tsc/vitessce-grid-layout/index.d.ts.map +1 -0
  124. package/dist-tsc/vitessce-grid-layout/index.js +1 -0
  125. package/dist-tsc/vitessce-grid-layout/layout-utils.d.ts +15 -0
  126. package/dist-tsc/vitessce-grid-layout/layout-utils.d.ts.map +1 -0
  127. package/{dist → dist-tsc}/vitessce-grid-layout/layout-utils.js +2 -1
  128. package/dist-tsc/vitessce-grid-layout/layout-utils.test.d.ts +2 -0
  129. package/dist-tsc/vitessce-grid-layout/layout-utils.test.d.ts.map +1 -0
  130. package/{dist → dist-tsc}/vitessce-grid-layout/layout-utils.test.js +3 -1
  131. package/dist-tsc/vitessce-grid-utils.d.ts +13 -0
  132. package/dist-tsc/vitessce-grid-utils.d.ts.map +1 -0
  133. package/{dist → dist-tsc}/vitessce-grid-utils.js +15 -14
  134. package/package.json +24 -11
  135. package/src/CallbackPublisher.js +77 -0
  136. package/src/LoadingIndicator.js +33 -0
  137. package/src/TitleInfo.js +167 -0
  138. package/src/VitS.js +202 -0
  139. package/src/VitessceGrid.js +118 -0
  140. package/src/VitessceGrid.test.jsx +57 -0
  141. package/src/Warning.js +62 -0
  142. package/src/classNames.js +8 -0
  143. package/src/data/AbstractLoader.js +23 -0
  144. package/src/data/AbstractTwoStepLoader.js +8 -0
  145. package/src/data/LoaderResult.js +8 -0
  146. package/src/data/index.js +3 -0
  147. package/src/data/loader-registry.js +28 -0
  148. package/src/data-hook-utils.js +195 -0
  149. package/src/data-hooks.js +354 -0
  150. package/src/errors/AbstractLoaderError.js +14 -0
  151. package/src/errors/DataSourceFetchError.js +15 -0
  152. package/src/errors/DatasetNotFoundError.js +23 -0
  153. package/src/errors/LoaderNotFoundError.js +24 -0
  154. package/src/errors/LoaderValidationError.js +23 -0
  155. package/src/errors/index.js +5 -0
  156. package/src/hooks.js +317 -0
  157. package/src/index.js +76 -0
  158. package/src/plugins.test.fixtures.js +78 -0
  159. package/src/schemas/config-0.1.0.schema.json +85 -0
  160. package/src/schemas/config-1.0.0.schema.json +733 -0
  161. package/src/schemas/config-1.0.1.schema.json +909 -0
  162. package/src/schemas/config-1.0.10.schema.json +969 -0
  163. package/src/schemas/config-1.0.11.schema.json +990 -0
  164. package/src/schemas/config-1.0.12.schema.json +997 -0
  165. package/src/schemas/config-1.0.13.schema.json +1013 -0
  166. package/src/schemas/config-1.0.14.schema.json +1048 -0
  167. package/src/schemas/config-1.0.15.schema.json +1048 -0
  168. package/src/schemas/config-1.0.16.schema.json +1089 -0
  169. package/src/schemas/config-1.0.2.schema.json +911 -0
  170. package/src/schemas/config-1.0.3.schema.json +911 -0
  171. package/src/schemas/config-1.0.4.schema.json +949 -0
  172. package/src/schemas/config-1.0.5.schema.json +949 -0
  173. package/src/schemas/config-1.0.6.schema.json +950 -0
  174. package/src/schemas/config-1.0.7.schema.json +950 -0
  175. package/src/schemas/config-1.0.8.schema.json +966 -0
  176. package/src/schemas/config-1.0.9.schema.json +965 -0
  177. package/src/schemas/fixtures/cellSets.good.json +16 -0
  178. package/src/schemas/fixtures/config-1.0.1.bad.json +1 -0
  179. package/src/schemas/fixtures/config-1.0.1.bad.message.json +11 -0
  180. package/src/schemas/fixtures/config-1.0.1.good.json +37 -0
  181. package/src/schemas/fixtures/config-1.0.2.bad.json +1 -0
  182. package/src/schemas/fixtures/config-1.0.2.bad.message.json +11 -0
  183. package/src/schemas/fixtures/config-1.0.2.good.json +38 -0
  184. package/src/schemas/fixtures/config-1.0.3.bad.json +1 -0
  185. package/src/schemas/fixtures/config-1.0.3.bad.message.json +11 -0
  186. package/src/schemas/fixtures/config-1.0.3.good.json +38 -0
  187. package/src/schemas/fixtures/obsSets.bad.json +1 -0
  188. package/src/schemas/fixtures/obsSets.bad.message.json +11 -0
  189. package/src/schemas/fixtures/obsSets.good.json +16 -0
  190. package/src/schemas/fixtures/obsSetsTabular.bad.json +1 -0
  191. package/src/schemas/fixtures/obsSetsTabular.bad.message.json +11 -0
  192. package/src/schemas/fixtures/obsSetsTabular.good.json +26 -0
  193. package/src/schemas/fixtures/raster.bad.json +1 -0
  194. package/src/schemas/fixtures/raster.bad.message.json +11 -0
  195. package/src/schemas/fixtures/raster.good.json +39 -0
  196. package/src/schemas/obsSets.schema.js +195 -0
  197. package/src/schemas/obsSetsTabular.schema.js +39 -0
  198. package/src/schemas/raster.schema.js +121 -0
  199. package/src/schemas/schema-schema.sh +34 -0
  200. package/src/shared-mui/components.js +81 -0
  201. package/src/shared-mui/container.js +212 -0
  202. package/src/shared-mui/styles.js +113 -0
  203. package/src/shared-plot-options/CellColorEncodingOption.js +42 -0
  204. package/src/shared-plot-options/OptionSelect.js +19 -0
  205. package/src/shared-plot-options/OptionsContainer.js +23 -0
  206. package/src/shared-plot-options/index.js +4 -0
  207. package/src/shared-plot-options/styles.js +49 -0
  208. package/src/state/hooks.js +640 -0
  209. package/src/title-styles.js +73 -0
  210. package/src/view-config-utils.js +263 -0
  211. package/src/view-config-utils.test.fixtures.js +893 -0
  212. package/src/view-config-utils.test.jsx +222 -0
  213. package/src/vitessce-grid-layout/VitessceGridLayout.js +179 -0
  214. package/src/vitessce-grid-layout/VitessceGridLayout.test.jsx +64 -0
  215. package/src/vitessce-grid-layout/index.js +1 -0
  216. package/src/vitessce-grid-layout/layout-utils.js +76 -0
  217. package/src/vitessce-grid-layout/layout-utils.test.js +167 -0
  218. package/src/vitessce-grid-utils.js +172 -0
  219. package/dist/VitS.js +0 -117
  220. package/dist/Vitessce.integration.test.js +0 -36
  221. package/dist/Vitessce.js +0 -101
  222. package/dist/component-registry.js +0 -16
  223. package/dist/data/AbstractLoader.js +0 -35
  224. package/dist/data/index.js +0 -3
  225. package/dist/data/loader-registry.js +0 -15
  226. package/dist/errors/OptionsValidationError.js +0 -15
  227. package/dist/export-utils.js +0 -70
  228. package/dist/export-utils.test.js +0 -66
  229. package/dist/file-options-schemas-legacy.js +0 -136
  230. package/dist/file-options-schemas-legacy.test.js +0 -126
  231. package/dist/file-options-schemas.js +0 -322
  232. package/dist/file-options-schemas.test.js +0 -23
  233. package/dist/joint-file-types-legacy.js +0 -278
  234. package/dist/joint-file-types-legacy.test.js +0 -400
  235. package/dist/joint-file-types.js +0 -148
  236. package/dist/joint-file-types.test.js +0 -139
  237. package/dist/loader-registry.js +0 -98
  238. package/dist/plugins.js +0 -154
  239. package/dist/plugins.test.js +0 -30
  240. package/dist/schemas/PrettyJsonSchema.js +0 -34
  241. package/dist/schemas/config-1.0.15.schema.test.js +0 -22
  242. package/dist/schemas/config-1.0.16.schema.test.js +0 -22
  243. package/dist/schemas/obs-sets-tabular.schema.js +0 -37
  244. package/dist/schemas/obs-sets.schema.js +0 -194
  245. package/dist/schemas/schema.test-old.js +0 -50
  246. package/dist/schemas/schema.test.js +0 -46
  247. package/dist/schemas-extra.js +0 -3
  248. package/dist/schemas.js +0 -4
  249. package/dist/shared-plot-options/index.js +0 -4
  250. package/dist/view-config-upgraders.js +0 -525
  251. package/dist/view-config-utils.test.js +0 -66
  252. package/dist/view-config-versions.js +0 -47
  253. package/dist/vitessce-grid-layout/index.js +0 -1
  254. /package/{dist → dist-tsc}/classNames.js +0 -0
  255. /package/{dist → dist-tsc}/data/LoaderResult.js +0 -0
  256. /package/{dist → dist-tsc}/errors/AbstractLoaderError.js +0 -0
  257. /package/{dist → dist-tsc}/plugins.test.fixtures.js +0 -0
  258. /package/{dist → dist-tsc}/schemas/config-0.1.0.schema.json +0 -0
  259. /package/{dist → dist-tsc}/schemas/config-1.0.0.schema.json +0 -0
  260. /package/{dist → dist-tsc}/schemas/config-1.0.1.schema.json +0 -0
  261. /package/{dist → dist-tsc}/schemas/config-1.0.10.schema.json +0 -0
  262. /package/{dist → dist-tsc}/schemas/config-1.0.11.schema.json +0 -0
  263. /package/{dist → dist-tsc}/schemas/config-1.0.12.schema.json +0 -0
  264. /package/{dist → dist-tsc}/schemas/config-1.0.13.schema.json +0 -0
  265. /package/{dist → dist-tsc}/schemas/config-1.0.14.schema.json +0 -0
  266. /package/{dist → dist-tsc}/schemas/config-1.0.15.schema.json +0 -0
  267. /package/{dist → dist-tsc}/schemas/config-1.0.2.schema.json +0 -0
  268. /package/{dist → dist-tsc}/schemas/config-1.0.3.schema.json +0 -0
  269. /package/{dist → dist-tsc}/schemas/config-1.0.4.schema.json +0 -0
  270. /package/{dist → dist-tsc}/schemas/config-1.0.5.schema.json +0 -0
  271. /package/{dist → dist-tsc}/schemas/config-1.0.6.schema.json +0 -0
  272. /package/{dist → dist-tsc}/schemas/config-1.0.7.schema.json +0 -0
  273. /package/{dist → dist-tsc}/schemas/config-1.0.8.schema.json +0 -0
  274. /package/{dist → dist-tsc}/schemas/config-1.0.9.schema.json +0 -0
  275. /package/{dist → dist-tsc}/schemas/obsSets.schema.js +0 -0
  276. /package/{dist → dist-tsc}/schemas/obsSetsTabular.schema.js +0 -0
  277. /package/{dist → dist-tsc}/schemas/raster.schema.js +0 -0
@@ -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,81 @@
1
+ import React, { useRef } from 'react';
2
+ import {
3
+ makeStyles,
4
+ Paper,
5
+ Popper,
6
+ IconButton,
7
+ MenuList,
8
+ ClickAwayListener,
9
+ Fade,
10
+ } from '@material-ui/core';
11
+ import { useVitessceContainer } from '../hooks.js';
12
+
13
+ const useStyles = makeStyles(() => ({
14
+ paper: {
15
+ maxHeight: 200,
16
+ overflow: 'auto',
17
+ },
18
+ container: {
19
+ position: 'relative',
20
+ left: 0,
21
+ top: 0,
22
+ },
23
+ }));
24
+
25
+ export function PopperMenu(props) {
26
+ const {
27
+ buttonIcon,
28
+ open,
29
+ setOpen,
30
+ children,
31
+ buttonClassName,
32
+ placement = 'bottom-end',
33
+ } = props;
34
+ const classes = useStyles();
35
+
36
+ const anchorRef = useRef();
37
+
38
+ const handleClick = () => {
39
+ setOpen(prev => !prev);
40
+ };
41
+
42
+ const handleClose = () => {
43
+ setOpen(false);
44
+ };
45
+
46
+ const id = open ? 'v-popover-menu' : undefined;
47
+
48
+ const getTooltipContainer = useVitessceContainer(anchorRef);
49
+
50
+ return (
51
+ <div ref={anchorRef} className={classes.container}>
52
+ <IconButton
53
+ aria-describedby={id}
54
+ onClick={handleClick}
55
+ size="small"
56
+ className={buttonClassName}
57
+ >
58
+ {buttonIcon}
59
+ </IconButton>
60
+ <Popper
61
+ id={id}
62
+ open={open}
63
+ anchorEl={anchorRef && anchorRef.current}
64
+ container={getTooltipContainer}
65
+ onClose={handleClose}
66
+ placement={placement}
67
+ transition
68
+ >
69
+ {({ TransitionProps }) => (
70
+ <ClickAwayListener onClickAway={handleClose}>
71
+ <Fade {...TransitionProps} timeout={100}>
72
+ <Paper elevation={4} className={classes.paper}>
73
+ <MenuList>{children}</MenuList>
74
+ </Paper>
75
+ </Fade>
76
+ </ClickAwayListener>
77
+ )}
78
+ </Popper>
79
+ </div>
80
+ );
81
+ }
@@ -0,0 +1,212 @@
1
+ import { makeStyles } from '@material-ui/core';
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,113 @@
1
+ import { createTheme, colors } from '@material-ui/core';
2
+
3
+ const { grey } = colors;
4
+
5
+ const globalColors = {
6
+ white: '#FFFFFF',
7
+ grayLight: '#D3D3D3',
8
+ grayMid: '#808080',
9
+ grayDark: '#555555',
10
+ black: '#000000',
11
+ grayDarkL5: 'rgb(98, 98, 98)', // lighten(map-get($global-colors, "gray-dark"), 5%);
12
+ grayDarkD15: 'rgb(47, 47, 47)', // darken(map-get($global-colors, "gray-dark"), 15%);
13
+ grayMidL10: 'rgb(154, 154, 154)', // lighten(map-get($global-colors, "gray-mid"), 10%);
14
+ grayLightL10: 'rgb(237, 237, 237)', // lighten(map-get($global-colors, "gray-light"), 10%);
15
+ };
16
+
17
+ const sharedThemeOptions = {
18
+ // Use px instead of rem, so that sizing is consistent despite the root element font-size.
19
+ // Reference: https://github.com/mui/material-ui/blob/627c08fc/src/styles/createTypography.js
20
+ typography: {
21
+ pxToRem: size => `${size}px`,
22
+ display4: {
23
+ fontSize: '112px',
24
+ },
25
+ display3: {
26
+ fontSize: '56px',
27
+ },
28
+ display2: {
29
+ fontSize: '45px',
30
+ },
31
+ display1: {
32
+ fontSize: '34px',
33
+ },
34
+ headline: {
35
+ fontSize: '24px',
36
+ },
37
+ title: {
38
+ fontSize: '21px',
39
+ },
40
+ subheading: {
41
+ fontSize: '16px',
42
+ },
43
+ body2: {
44
+ fontSize: '14px',
45
+ },
46
+ body1: {
47
+ fontSize: '14px',
48
+ },
49
+ caption: {
50
+ fontSize: '12px',
51
+ },
52
+ },
53
+ props: {
54
+ MuiButtonBase: {
55
+ disableRipple: true,
56
+ },
57
+ },
58
+ };
59
+
60
+ export const muiTheme = {
61
+ dark: createTheme({
62
+ palette: {
63
+ type: 'dark',
64
+ primary: grey,
65
+ secondary: grey,
66
+ primaryBackground: '#222222',
67
+ primaryBackgroundHighlight: '#000000',
68
+ primaryBackgroundInput: '#D3D3D3',
69
+ primaryBackgroundDim: '#333333',
70
+ primaryBackgroundLight: '#757575',
71
+ primaryForeground: '#D3D3D3',
72
+ primaryForegroundL5: 'rgb(224, 224, 224)',
73
+ primaryForegroundL10: 'rgb(237, 237, 237)',
74
+ primaryForegroundD15: 'rgb(173, 173, 173)',
75
+ primaryForegroundDim: '#000000',
76
+ primaryForegroundActive: '#9bb7d6',
77
+ secondaryBackground: '#000000',
78
+ secondaryBackgroundDim: '#444444',
79
+ secondaryForeground: '#D3D3D3',
80
+ gridLayoutBackground: '#333333',
81
+ cardBorder: 'rgba(0, 0, 0, 0.125)',
82
+ tooltipText: '#FFFFFF',
83
+ ...globalColors,
84
+ },
85
+ ...sharedThemeOptions,
86
+ }),
87
+ light: createTheme({
88
+ palette: {
89
+ type: 'light',
90
+ primary: grey,
91
+ secondary: grey,
92
+ primaryBackground: '#F1F1F1',
93
+ primaryBackgroundHighlight: '#FFFFFF',
94
+ primaryBackgroundInput: '#FFFFFF',
95
+ primaryBackgroundDim: '#8A8A8A',
96
+ primaryBackgroundLight: '#e0e0e0',
97
+ primaryForeground: '#333333',
98
+ primaryForegroundL5: 'rgb(64, 64, 64)', // lighten(map-get($theme-colors, "primary-foreground"), 5%);
99
+ primaryForegroundL10: 'rgb(77, 77, 77)', // lighten(map-get($theme-colors, "primary-foreground"), 10%);
100
+ primaryForegroundD15: 'rgb(13, 13, 13)', // darken(map-get($theme-colors, "primary-foreground"), 15%);
101
+ primaryForegroundDim: '#808080',
102
+ primaryForegroundActive: '#0074D9',
103
+ secondaryBackground: '#F1F1F1',
104
+ secondaryBackgroundDim: '#C0C0C0',
105
+ secondaryForeground: '#222222',
106
+ gridLayoutBackground: '#FFFFFF',
107
+ cardBorder: 'rgba(241, 241, 241, 0.125)',
108
+ tooltipText: 'rgba(0, 0, 0, 0.87)',
109
+ ...globalColors,
110
+ },
111
+ ...sharedThemeOptions,
112
+ }),
113
+ };
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { TableCell, TableRow } from '@material-ui/core';
3
+ import { capitalize } from '@vitessce/utils';
4
+ import OptionSelect from './OptionSelect.js';
5
+ import { useStyles } from './styles.js';
6
+
7
+ export default function CellColorEncodingOption(props) {
8
+ const {
9
+ observationsLabel,
10
+ cellColorEncoding,
11
+ setCellColorEncoding,
12
+ } = props;
13
+
14
+ const classes = useStyles();
15
+
16
+ const observationsLabelNice = capitalize(observationsLabel);
17
+
18
+ function handleColorEncodingChange(event) {
19
+ setCellColorEncoding(event.target.value);
20
+ }
21
+
22
+ return (
23
+ <TableRow>
24
+ <TableCell className={classes.labelCell} htmlFor="cell-color-encoding-select">
25
+ {observationsLabelNice} Color Encoding
26
+ </TableCell>
27
+ <TableCell className={classes.inputCell}>
28
+ <OptionSelect
29
+ className={classes.select}
30
+ value={cellColorEncoding}
31
+ onChange={handleColorEncodingChange}
32
+ inputProps={{
33
+ id: 'cell-color-encoding-select',
34
+ }}
35
+ >
36
+ <option value="cellSetSelection">Cell Sets</option>
37
+ <option value="geneSelection">Gene Expression</option>
38
+ </OptionSelect>
39
+ </TableCell>
40
+ </TableRow>
41
+ );
42
+ }
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { Select } from '@material-ui/core';
3
+ import { useStyles } from './styles.js';
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,23 @@
1
+ import React from 'react';
2
+ import { Box, Table, TableBody, TableContainer } from '@material-ui/core';
3
+ import { useStyles } from './styles.js';
4
+
5
+ export default function OptionsContainer(props) {
6
+ const {
7
+ children,
8
+ } = props;
9
+
10
+ const classes = useStyles();
11
+
12
+ return (
13
+ <Box className={classes.box}>
14
+ <TableContainer className={classes.tableContainer}>
15
+ <Table className={classes.table} size="small">
16
+ <TableBody>
17
+ {children}
18
+ </TableBody>
19
+ </Table>
20
+ </TableContainer>
21
+ </Box>
22
+ );
23
+ }
@@ -0,0 +1,4 @@
1
+ export { default as CellColorEncodingOption } from './CellColorEncodingOption.js';
2
+ export { default as OptionsContainer } from './OptionsContainer.js';
3
+ export { default as OptionSelect } from './OptionSelect.js';
4
+ export { useStyles as usePlotOptionsStyles } from './styles.js';
@@ -0,0 +1,49 @@
1
+ import { makeStyles } from '@material-ui/core';
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
+ }));