@vitessce/layer-controller 2.0.3 → 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 (74) hide show
  1. package/dist/{deflate.b44720d0.mjs → deflate-75511377.js} +2 -2
  2. package/dist/{index.ca9e70ae.mjs → index-841a1af6.js} +137252 -126353
  3. package/dist/{index.mjs → index.js} +2 -3
  4. package/dist/{jpeg.edb20ff0.mjs → jpeg-6023316d.js} +1 -1
  5. package/dist/{lerc.df2f1733.mjs → lerc-82182c45.js} +76 -5
  6. package/dist/{lzw.2a639594.mjs → lzw-2ab01db2.js} +1 -1
  7. package/dist/{packbits.958f7a40.mjs → packbits-2633f360.js} +1 -1
  8. package/dist/{pako.esm.4b234125.mjs → pako.esm-68f84e2a.js} +97 -15
  9. package/dist/{raw.4239192e.mjs → raw-51e455c7.js} +1 -1
  10. package/dist/{webimage.de21cf13.mjs → webimage-bbb56d18.js} +1 -1
  11. package/dist-tsc/BitmaskChannelController.d.ts +21 -0
  12. package/dist-tsc/BitmaskChannelController.d.ts.map +1 -0
  13. package/dist-tsc/BitmaskChannelController.js +30 -0
  14. package/dist-tsc/ChannelOptions.d.ts +13 -0
  15. package/dist-tsc/ChannelOptions.d.ts.map +1 -0
  16. package/dist-tsc/ChannelOptions.js +38 -0
  17. package/dist-tsc/ColorPalette.d.ts +5 -0
  18. package/dist-tsc/ColorPalette.d.ts.map +1 -0
  19. package/dist-tsc/ColorPalette.js +30 -0
  20. package/dist-tsc/ImageAddButton.d.ts +6 -0
  21. package/dist-tsc/ImageAddButton.d.ts.map +1 -0
  22. package/dist-tsc/ImageAddButton.js +27 -0
  23. package/dist-tsc/LayerController.d.ts +10 -0
  24. package/dist-tsc/LayerController.d.ts.map +1 -0
  25. package/dist-tsc/LayerController.js +303 -0
  26. package/dist-tsc/LayerControllerSubscriber.d.ts +27 -0
  27. package/dist-tsc/LayerControllerSubscriber.d.ts.map +1 -0
  28. package/dist-tsc/LayerControllerSubscriber.js +194 -0
  29. package/dist-tsc/LayerOptions.d.ts +46 -0
  30. package/dist-tsc/LayerOptions.d.ts.map +1 -0
  31. package/dist-tsc/LayerOptions.js +207 -0
  32. package/dist-tsc/RasterChannelController.d.ts +35 -0
  33. package/dist-tsc/RasterChannelController.d.ts.map +1 -0
  34. package/dist-tsc/RasterChannelController.js +150 -0
  35. package/dist-tsc/RasterChannelController.test.d.ts +2 -0
  36. package/dist-tsc/RasterChannelController.test.d.ts.map +1 -0
  37. package/dist-tsc/RasterChannelController.test.js +21 -0
  38. package/dist-tsc/VectorLayerController.d.ts +2 -0
  39. package/dist-tsc/VectorLayerController.d.ts.map +1 -0
  40. package/dist-tsc/VectorLayerController.js +26 -0
  41. package/dist-tsc/VolumeOptions.d.ts +16 -0
  42. package/dist-tsc/VolumeOptions.d.ts.map +1 -0
  43. package/dist-tsc/VolumeOptions.js +71 -0
  44. package/dist-tsc/constants.d.ts +2 -0
  45. package/dist-tsc/constants.d.ts.map +1 -0
  46. package/dist-tsc/constants.js +12 -0
  47. package/dist-tsc/index.d.ts +4 -0
  48. package/dist-tsc/index.d.ts.map +1 -0
  49. package/dist-tsc/index.js +3 -3
  50. package/dist-tsc/shared-channel-controls.d.ts +27 -0
  51. package/dist-tsc/shared-channel-controls.d.ts.map +1 -0
  52. package/dist-tsc/shared-channel-controls.js +25 -0
  53. package/dist-tsc/styles.d.ts +76 -0
  54. package/dist-tsc/styles.d.ts.map +1 -0
  55. package/dist-tsc/styles.js +98 -0
  56. package/dist-tsc/utils.d.ts +24 -0
  57. package/dist-tsc/utils.d.ts.map +1 -0
  58. package/dist-tsc/utils.js +117 -0
  59. package/package.json +19 -10
  60. package/src/BitmaskChannelController.js +3 -4
  61. package/src/ChannelOptions.js +4 -5
  62. package/src/ColorPalette.js +2 -3
  63. package/src/ImageAddButton.js +2 -3
  64. package/src/LayerController.js +13 -16
  65. package/src/LayerControllerSubscriber.js +6 -15
  66. package/src/LayerOptions.js +4 -8
  67. package/src/RasterChannelController.js +7 -18
  68. package/src/RasterChannelController.test.js +1 -1
  69. package/src/VectorLayerController.js +2 -6
  70. package/src/VolumeOptions.js +13 -10
  71. package/src/index.js +3 -3
  72. package/src/shared-channel-controls.js +2 -3
  73. package/src/styles.js +9 -6
  74. package/src/utils.js +9 -0
@@ -4,31 +4,28 @@ import {
4
4
  GLOBAL_LABELS, getSourceFromLoader, isRgb,
5
5
  } from '@vitessce/spatial-utils';
6
6
 
7
- import Grid from '@material-ui/core/Grid';
8
- import Button from '@material-ui/core/Button';
9
- import AddIcon from '@material-ui/icons/Add';
10
- import Slider from '@material-ui/core/Slider';
11
- import Tabs from '@material-ui/core/Tabs';
12
- import Tab from '@material-ui/core/Tab';
13
-
14
- import Accordion from '@material-ui/core/Accordion';
15
- import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
16
- import VisibilityIcon from '@material-ui/icons/Visibility';
17
- import VisibilityOffIcon from '@material-ui/icons/VisibilityOff';
7
+ import { Grid, Button, Slider, Tabs, Tab, Accordion } from '@material-ui/core';
8
+ import {
9
+ Add as AddIcon,
10
+ ExpandMore as ExpandMoreIcon,
11
+ Visibility as VisibilityIcon,
12
+ VisibilityOff as VisibilityOffIcon,
13
+ } from '@material-ui/icons';
14
+
18
15
 
19
16
  import { canLoadResolution } from '@vitessce/utils';
20
- import LayerOptions from './LayerOptions';
21
- import VolumeOptions from './VolumeOptions';
17
+ import LayerOptions from './LayerOptions.js';
18
+ import VolumeOptions from './VolumeOptions.js';
22
19
  import {
23
20
  useControllerSectionStyles,
24
21
  StyledAccordionDetails,
25
22
  StyledAccordionSummary,
26
23
  StyledInputLabel,
27
24
  OverflowEllipsisGrid,
28
- } from './styles';
29
- import { getMultiSelectionStats } from './utils';
25
+ } from './styles.js';
26
+ import { getMultiSelectionStats } from './utils.js';
30
27
 
31
- import { DOMAINS } from './constants';
28
+ import { DOMAINS } from './constants.js';
32
29
 
33
30
  function TabPanel(props) {
34
31
  const {
@@ -3,7 +3,7 @@
3
3
  import React, {
4
4
  useCallback, useRef, forwardRef,
5
5
  } from 'react';
6
- import Grid from '@material-ui/core/Grid';
6
+ import { Grid } from '@material-ui/core';
7
7
  import {
8
8
  TitleInfo,
9
9
  useReady,
@@ -15,16 +15,15 @@ import {
15
15
  useLoaders,
16
16
  useAuxiliaryCoordination,
17
17
  useComponentLayout,
18
- registerPluginViewType,
19
18
  } from '@vitessce/vit-s';
20
19
  import { ViewType, COMPONENT_COORDINATION_TYPES } from '@vitessce/constants-internal';
21
20
  import { capitalize } from '@vitessce/utils';
22
21
  import { initializeLayerChannels, DEFAULT_RASTER_LAYER_PROPS } from '@vitessce/spatial-utils';
23
- import RasterChannelController from './RasterChannelController';
24
- import BitmaskChannelController from './BitmaskChannelController';
25
- import VectorLayerController from './VectorLayerController';
26
- import LayerController from './LayerController';
27
- import ImageAddButton from './ImageAddButton';
22
+ import RasterChannelController from './RasterChannelController.js';
23
+ import BitmaskChannelController from './BitmaskChannelController.js';
24
+ import VectorLayerController from './VectorLayerController.js';
25
+ import LayerController from './LayerController.js';
26
+ import ImageAddButton from './ImageAddButton.js';
28
27
 
29
28
  // LayerController is memoized to prevent updates from prop changes that
30
29
  // are caused by view state updates i.e zooming and panning within
@@ -500,11 +499,3 @@ export function LayerControllerSubscriber(props) {
500
499
  />
501
500
  );
502
501
  }
503
-
504
- export function register() {
505
- registerPluginViewType(
506
- ViewType.LAYER_CONTROLLER,
507
- LayerControllerSubscriber,
508
- COMPONENT_COORDINATION_TYPES[ViewType.LAYER_CONTROLLER],
509
- );
510
- }
@@ -1,11 +1,7 @@
1
1
  import React from 'react';
2
- import range from 'lodash/range';
2
+ import { range } from 'lodash-es';
3
3
  import { Matrix4 } from 'math.gl';
4
- import Grid from '@material-ui/core/Grid';
5
- import Slider from '@material-ui/core/Slider';
6
- import InputLabel from '@material-ui/core/InputLabel';
7
- import Select from '@material-ui/core/Select';
8
- import Checkbox from '@material-ui/core/Checkbox';
4
+ import { Grid, Slider, InputLabel, Select, Checkbox } from '@material-ui/core';
9
5
  import { viv } from '@vitessce/gl';
10
6
  import { DEFAULT_RASTER_DOMAIN_TYPE } from '@vitessce/spatial-utils';
11
7
  import {
@@ -16,8 +12,8 @@ import {
16
12
  } from '@vitessce/utils';
17
13
  import {
18
14
  getBoundingCube, getMultiSelectionStats,
19
- } from './utils';
20
- import { StyledSelectionSlider, useSelectStyles } from './styles';
15
+ } from './utils.js';
16
+ import { StyledSelectionSlider, useSelectStyles } from './styles.js';
21
17
 
22
18
  const DOMAIN_OPTIONS = ['Full', 'Min/Max'];
23
19
 
@@ -1,27 +1,16 @@
1
1
  import React, { useCallback, useState, useEffect } from 'react';
2
2
 
3
- import Grid from '@material-ui/core/Grid';
4
- import Slider from '@material-ui/core/Slider';
5
- import debounce from 'lodash/debounce';
6
- import isEqual from 'lodash/isEqual';
3
+ import { Grid, Slider } from '@material-ui/core';
4
+ import { debounce, isEqual } from 'lodash-es';
7
5
 
8
6
  import { getSourceFromLoader } from '@vitessce/spatial-utils';
9
- import ChannelOptions from './ChannelOptions';
10
- import { DOMAINS } from './constants';
11
- import { getMultiSelectionStats } from './utils';
7
+ import ChannelOptions from './ChannelOptions.js';
8
+ import { DOMAINS } from './constants.js';
9
+ import { getMultiSelectionStats, toRgbUIString } from './utils.js';
12
10
  import {
13
11
  ChannelSelectionDropdown,
14
12
  ChannelVisibilityCheckbox,
15
- } from './shared-channel-controls';
16
-
17
- // Returns an rgb string for display, and changes the color (arr)
18
- // to use a grey for light theme + white color or if the colormap is on.
19
- export const toRgbUIString = (on, arr, theme) => {
20
- const color = on || (theme === 'light' && arr.every(i => i === 255))
21
- ? [220, 220, 220]
22
- : arr;
23
- return `rgb(${color})`;
24
- };
13
+ } from './shared-channel-controls.js';
25
14
 
26
15
  function abbreviateNumber(value) {
27
16
  // Return an abbreviated representation of value, in 5 characters or less.
@@ -76,7 +65,7 @@ function ChannelSlider({
76
65
  debounce(handleChange, 3, { trailing: true }),
77
66
  [handleChange],
78
67
  );
79
- const step = max - min < 500 && dtype === 'Float32' ? (max - min) / 500 : 1;
68
+ const step = max - min < 500 && dtype.startsWith('Float') ? (max - min) / 500 : 1;
80
69
  return (
81
70
  <Slider
82
71
  value={slider}
@@ -1,4 +1,4 @@
1
- import { toRgbUIString } from './RasterChannelController';
1
+ import { toRgbUIString } from './utils.js';
2
2
 
3
3
  const GREY = [220, 220, 220];
4
4
 
@@ -1,11 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
- import Grid from '@material-ui/core/Grid';
4
- import Checkbox from '@material-ui/core/Checkbox';
5
- import Paper from '@material-ui/core/Paper';
6
- import Typography from '@material-ui/core/Typography';
7
- import Slider from '@material-ui/core/Slider';
8
- import { useControllerSectionStyles } from './styles';
3
+ import { Grid, Checkbox, Paper, Typography, Slider } from '@material-ui/core';
4
+ import { useControllerSectionStyles } from './styles.js';
9
5
 
10
6
  export default function VectorLayerController(props) {
11
7
  const {
@@ -1,16 +1,19 @@
1
1
  import React from 'react';
2
2
  import { Matrix4 } from 'math.gl';
3
- import Grid from '@material-ui/core/Grid';
4
- import Typography from '@material-ui/core/Typography';
5
- import Button from '@material-ui/core/Button';
6
- import { makeStyles, createStyles } from '@material-ui/core/styles';
7
- import FormControl from '@material-ui/core/FormControl';
8
- import Select from '@material-ui/core/Select';
9
- import InputLabel from '@material-ui/core/InputLabel';
10
- import Slider from '@material-ui/core/Slider';
3
+ import {
4
+ Grid,
5
+ Typography,
6
+ Button,
7
+ makeStyles,
8
+ createStyles,
9
+ FormControl,
10
+ Select,
11
+ InputLabel,
12
+ Slider,
13
+ } from '@material-ui/core';
11
14
  import { viv } from '@vitessce/gl';
12
- import { abbreviateNumber, getBoundingCube } from './utils';
13
- import { useSelectStyles } from './styles';
15
+ import { abbreviateNumber, getBoundingCube } from './utils.js';
16
+ import { useSelectStyles } from './styles.js';
14
17
 
15
18
  const useSlicerStyles = makeStyles(theme => createStyles({
16
19
  enabled: {},
package/src/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { LayerControllerSubscriber, register } from './LayerControllerSubscriber';
2
- export { default as LayerController } from './LayerController';
3
- export { default as VectorLayerController } from './VectorLayerController';
1
+ export { LayerControllerSubscriber } from './LayerControllerSubscriber.js';
2
+ export { default as LayerController } from './LayerController.js';
3
+ export { default as VectorLayerController } from './VectorLayerController.js';
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
- import Checkbox from '@material-ui/core/Checkbox';
4
- import Select from '@material-ui/core/Select';
5
- import { useSelectStyles } from './styles';
3
+ import { Checkbox, Select } from '@material-ui/core';
4
+ import { useSelectStyles } from './styles.js';
6
5
 
7
6
  /**
8
7
  * Dropdown for selecting a channel.
package/src/styles.js CHANGED
@@ -1,9 +1,12 @@
1
- import { makeStyles, withStyles } from '@material-ui/core/styles';
2
- import AccordionSummary from '@material-ui/core/AccordionSummary';
3
- import AccordionDetails from '@material-ui/core/AccordionDetails';
4
- import InputLabel from '@material-ui/core/InputLabel';
5
- import Slider from '@material-ui/core/Slider';
6
- import Grid from '@material-ui/core/Grid';
1
+ import {
2
+ makeStyles,
3
+ withStyles,
4
+ AccordionSummary,
5
+ AccordionDetails,
6
+ InputLabel,
7
+ Slider,
8
+ Grid,
9
+ } from '@material-ui/core';
7
10
 
8
11
  const useSpanStyles = makeStyles(() => ({
9
12
  span: {
package/src/utils.js CHANGED
@@ -1,6 +1,15 @@
1
1
  import { viv } from '@vitessce/gl';
2
2
  import { Matrix4 } from 'math.gl';
3
3
 
4
+ // Returns an rgb string for display, and changes the color (arr)
5
+ // to use a grey for light theme + white color or if the colormap is on.
6
+ export const toRgbUIString = (on, arr, theme) => {
7
+ const color = on || (theme === 'light' && arr.every(i => i === 255))
8
+ ? [220, 220, 220]
9
+ : arr;
10
+ return `rgb(${color})`;
11
+ };
12
+
4
13
  async function getSingleSelectionStats2D({ loader, selection }) {
5
14
  const data = Array.isArray(loader) ? loader[loader.length - 1] : loader;
6
15
  const raster = await data.getRaster({ selection });