@vitessce/layer-controller 3.6.6 → 3.6.8

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.
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { B as BaseDecoder } from "./index-33bfVj66.js";
2
+ import { B as BaseDecoder } from "./index-CtwSBXNo.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -11666,113 +11666,6 @@ AccordionSummary.propTypes = {
11666
11666
  */
11667
11667
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
11668
11668
  };
11669
- function HTMLElementType(props, propName, componentName, location, propFullName) {
11670
- const propValue = props[propName];
11671
- const safePropName = propFullName || propName;
11672
- if (propValue == null) {
11673
- return null;
11674
- }
11675
- if (propValue && propValue.nodeType !== 1) {
11676
- return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. Expected an HTMLElement.`);
11677
- }
11678
- return null;
11679
- }
11680
- function useSlotProps(parameters) {
11681
- var _a3;
11682
- const {
11683
- elementType,
11684
- externalSlotProps,
11685
- ownerState,
11686
- skipResolvingSlotProps = false,
11687
- ...other
11688
- } = parameters;
11689
- const resolvedComponentsProps = skipResolvingSlotProps ? {} : resolveComponentProps(externalSlotProps, ownerState);
11690
- const {
11691
- props: mergedProps,
11692
- internalRef
11693
- } = mergeSlotProps({
11694
- ...other,
11695
- externalSlotProps: resolvedComponentsProps
11696
- });
11697
- const ref = useForkRef$1(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_a3 = parameters.additionalProps) == null ? void 0 : _a3.ref);
11698
- const props = appendOwnerState(elementType, {
11699
- ...mergedProps,
11700
- ref
11701
- }, ownerState);
11702
- return props;
11703
- }
11704
- function getReactElementRef(element) {
11705
- var _a3;
11706
- if (parseInt(React.version, 10) >= 19) {
11707
- return ((_a3 = element == null ? void 0 : element.props) == null ? void 0 : _a3.ref) || null;
11708
- }
11709
- return (element == null ? void 0 : element.ref) || null;
11710
- }
11711
- function getContainer(container) {
11712
- return typeof container === "function" ? container() : container;
11713
- }
11714
- const Portal = /* @__PURE__ */ React.forwardRef(function Portal2(props, forwardedRef) {
11715
- const {
11716
- children,
11717
- container,
11718
- disablePortal = false
11719
- } = props;
11720
- const [mountNode, setMountNode] = React.useState(null);
11721
- const handleRef = useForkRef$1(/* @__PURE__ */ React.isValidElement(children) ? getReactElementRef(children) : null, forwardedRef);
11722
- useEnhancedEffect$1(() => {
11723
- if (!disablePortal) {
11724
- setMountNode(getContainer(container) || document.body);
11725
- }
11726
- }, [container, disablePortal]);
11727
- useEnhancedEffect$1(() => {
11728
- if (mountNode && !disablePortal) {
11729
- setRef$1(forwardedRef, mountNode);
11730
- return () => {
11731
- setRef$1(forwardedRef, null);
11732
- };
11733
- }
11734
- return void 0;
11735
- }, [forwardedRef, mountNode, disablePortal]);
11736
- if (disablePortal) {
11737
- if (/* @__PURE__ */ React.isValidElement(children)) {
11738
- const newProps = {
11739
- ref: handleRef
11740
- };
11741
- return /* @__PURE__ */ React.cloneElement(children, newProps);
11742
- }
11743
- return children;
11744
- }
11745
- return mountNode ? /* @__PURE__ */ ReactDOM.createPortal(children, mountNode) : mountNode;
11746
- });
11747
- Portal.propTypes = {
11748
- // ┌────────────────────────────── Warning ──────────────────────────────┐
11749
- // │ These PropTypes are generated from the TypeScript type definitions. │
11750
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
11751
- // └─────────────────────────────────────────────────────────────────────┘
11752
- /**
11753
- * The children to render into the `container`.
11754
- */
11755
- children: PropTypes.node,
11756
- /**
11757
- * An HTML element or function that returns one.
11758
- * The `container` will have the portal children appended to it.
11759
- *
11760
- * You can also provide a callback, which is called in a React layout effect.
11761
- * This lets you set the container from a ref, and also makes server-side rendering possible.
11762
- *
11763
- * By default, it uses the body of the top-level document object,
11764
- * so it's simply `document.body` most of the time.
11765
- */
11766
- container: PropTypes.oneOfType([HTMLElementType, PropTypes.func]),
11767
- /**
11768
- * The `children` will be under the DOM hierarchy of the parent component.
11769
- * @default false
11770
- */
11771
- disablePortal: PropTypes.bool
11772
- };
11773
- {
11774
- Portal["propTypes"] = exactProp(Portal.propTypes);
11775
- }
11776
11669
  function hasCorrectMainProperty(obj) {
11777
11670
  return typeof obj.main === "string";
11778
11671
  }
@@ -12350,6 +12243,113 @@ IconButton.propTypes = {
12350
12243
  */
12351
12244
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
12352
12245
  };
12246
+ function HTMLElementType(props, propName, componentName, location, propFullName) {
12247
+ const propValue = props[propName];
12248
+ const safePropName = propFullName || propName;
12249
+ if (propValue == null) {
12250
+ return null;
12251
+ }
12252
+ if (propValue && propValue.nodeType !== 1) {
12253
+ return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. Expected an HTMLElement.`);
12254
+ }
12255
+ return null;
12256
+ }
12257
+ function useSlotProps(parameters) {
12258
+ var _a3;
12259
+ const {
12260
+ elementType,
12261
+ externalSlotProps,
12262
+ ownerState,
12263
+ skipResolvingSlotProps = false,
12264
+ ...other
12265
+ } = parameters;
12266
+ const resolvedComponentsProps = skipResolvingSlotProps ? {} : resolveComponentProps(externalSlotProps, ownerState);
12267
+ const {
12268
+ props: mergedProps,
12269
+ internalRef
12270
+ } = mergeSlotProps({
12271
+ ...other,
12272
+ externalSlotProps: resolvedComponentsProps
12273
+ });
12274
+ const ref = useForkRef$1(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_a3 = parameters.additionalProps) == null ? void 0 : _a3.ref);
12275
+ const props = appendOwnerState(elementType, {
12276
+ ...mergedProps,
12277
+ ref
12278
+ }, ownerState);
12279
+ return props;
12280
+ }
12281
+ function getReactElementRef(element) {
12282
+ var _a3;
12283
+ if (parseInt(React.version, 10) >= 19) {
12284
+ return ((_a3 = element == null ? void 0 : element.props) == null ? void 0 : _a3.ref) || null;
12285
+ }
12286
+ return (element == null ? void 0 : element.ref) || null;
12287
+ }
12288
+ function getContainer(container) {
12289
+ return typeof container === "function" ? container() : container;
12290
+ }
12291
+ const Portal = /* @__PURE__ */ React.forwardRef(function Portal2(props, forwardedRef) {
12292
+ const {
12293
+ children,
12294
+ container,
12295
+ disablePortal = false
12296
+ } = props;
12297
+ const [mountNode, setMountNode] = React.useState(null);
12298
+ const handleRef = useForkRef$1(/* @__PURE__ */ React.isValidElement(children) ? getReactElementRef(children) : null, forwardedRef);
12299
+ useEnhancedEffect$1(() => {
12300
+ if (!disablePortal) {
12301
+ setMountNode(getContainer(container) || document.body);
12302
+ }
12303
+ }, [container, disablePortal]);
12304
+ useEnhancedEffect$1(() => {
12305
+ if (mountNode && !disablePortal) {
12306
+ setRef$1(forwardedRef, mountNode);
12307
+ return () => {
12308
+ setRef$1(forwardedRef, null);
12309
+ };
12310
+ }
12311
+ return void 0;
12312
+ }, [forwardedRef, mountNode, disablePortal]);
12313
+ if (disablePortal) {
12314
+ if (/* @__PURE__ */ React.isValidElement(children)) {
12315
+ const newProps = {
12316
+ ref: handleRef
12317
+ };
12318
+ return /* @__PURE__ */ React.cloneElement(children, newProps);
12319
+ }
12320
+ return children;
12321
+ }
12322
+ return mountNode ? /* @__PURE__ */ ReactDOM.createPortal(children, mountNode) : mountNode;
12323
+ });
12324
+ Portal.propTypes = {
12325
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
12326
+ // │ These PropTypes are generated from the TypeScript type definitions. │
12327
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
12328
+ // └─────────────────────────────────────────────────────────────────────┘
12329
+ /**
12330
+ * The children to render into the `container`.
12331
+ */
12332
+ children: PropTypes.node,
12333
+ /**
12334
+ * An HTML element or function that returns one.
12335
+ * The `container` will have the portal children appended to it.
12336
+ *
12337
+ * You can also provide a callback, which is called in a React layout effect.
12338
+ * This lets you set the container from a ref, and also makes server-side rendering possible.
12339
+ *
12340
+ * By default, it uses the body of the top-level document object,
12341
+ * so it's simply `document.body` most of the time.
12342
+ */
12343
+ container: PropTypes.oneOfType([HTMLElementType, PropTypes.func]),
12344
+ /**
12345
+ * The `children` will be under the DOM hierarchy of the parent component.
12346
+ * @default false
12347
+ */
12348
+ disablePortal: PropTypes.bool
12349
+ };
12350
+ {
12351
+ Portal["propTypes"] = exactProp(Portal.propTypes);
12352
+ }
12353
12353
  function getStyleValue(value) {
12354
12354
  return parseInt(value, 10) || 0;
12355
12355
  }
@@ -128042,22 +128042,22 @@ function addDecoder(cases, importFn) {
128042
128042
  }
128043
128043
  cases.forEach((c) => registry$1.set(c, importFn));
128044
128044
  }
128045
- addDecoder([void 0, 1], () => import("./raw-O2tds5XZ.js").then((m) => m.default));
128046
- addDecoder(5, () => import("./lzw-Bq_A3XVG.js").then((m) => m.default));
128045
+ addDecoder([void 0, 1], () => import("./raw-C7vA6Rjj.js").then((m) => m.default));
128046
+ addDecoder(5, () => import("./lzw-DfJwiQaC.js").then((m) => m.default));
128047
128047
  addDecoder(6, () => {
128048
128048
  throw new Error("old style JPEG compression is not supported.");
128049
128049
  });
128050
- addDecoder(7, () => import("./jpeg-BdMUgt4w.js").then((m) => m.default));
128051
- addDecoder([8, 32946], () => import("./deflate-BVjbK7jw.js").then((m) => m.default));
128052
- addDecoder(32773, () => import("./packbits-QWCdXTTY.js").then((m) => m.default));
128050
+ addDecoder(7, () => import("./jpeg-v3q2yek2.js").then((m) => m.default));
128051
+ addDecoder([8, 32946], () => import("./deflate-BlOWB5t3.js").then((m) => m.default));
128052
+ addDecoder(32773, () => import("./packbits-B_YfvWt1.js").then((m) => m.default));
128053
128053
  addDecoder(
128054
128054
  34887,
128055
- () => import("./lerc-CDb6hblk.js").then(async (m) => {
128055
+ () => import("./lerc-i3huWfSg.js").then(async (m) => {
128056
128056
  await m.zstd.init();
128057
128057
  return m;
128058
128058
  }).then((m) => m.default)
128059
128059
  );
128060
- addDecoder(50001, () => import("./webimage-CfZ_aK6l.js").then((m) => m.default));
128060
+ addDecoder(50001, () => import("./webimage-DZ9GJKJ8.js").then((m) => m.default));
128061
128061
  function decodeRowAcc(row, stride) {
128062
128062
  let length2 = row.length - stride;
128063
128063
  let offset2 = 0;
@@ -147078,6 +147078,7 @@ const LayerControllerMemoized = React__default.memo(
147078
147078
  forwardRef((props, ref) => {
147079
147079
  const {
147080
147080
  title,
147081
+ errors,
147081
147082
  closeButtonVisible,
147082
147083
  downloadButtonVisible,
147083
147084
  removeGridComponent,
@@ -147139,7 +147140,8 @@ const LayerControllerMemoized = React__default.memo(
147139
147140
  removeGridComponent,
147140
147141
  theme,
147141
147142
  isReady,
147142
- helpText
147143
+ helpText,
147144
+ errors
147143
147145
  },
147144
147146
  /* @__PURE__ */ React__default.createElement("div", { className: "layer-controller-container", ref }, moleculesLayer && /* @__PURE__ */ React__default.createElement(
147145
147147
  VectorLayerController,
@@ -147360,7 +147362,13 @@ function LayerControllerSubscriber(props) {
147360
147362
  const layerControllerRef = useRef();
147361
147363
  const [componentWidth, componentHeight] = useClosestVitessceContainerSize(layerControllerRef);
147362
147364
  const { height: windowHeight, width: windowWidth } = useWindowDimensions();
147363
- const [obsLocationsData, obsLocationsStatus] = useObsLocationsData(
147365
+ const [
147366
+ // eslint-disable-next-line no-unused-vars
147367
+ obsLocationsData,
147368
+ obsLocationsStatus,
147369
+ obsLocationsUrls,
147370
+ obsLocationsError
147371
+ ] = useObsLocationsData(
147364
147372
  loaders,
147365
147373
  dataset,
147366
147374
  false,
@@ -147371,7 +147379,9 @@ function LayerControllerSubscriber(props) {
147371
147379
  );
147372
147380
  const [
147373
147381
  { obsSegmentations, obsSegmentationsType },
147374
- obsSegmentationsStatus
147382
+ obsSegmentationsStatus,
147383
+ obsSegmentationsUrls,
147384
+ obsSegmentationsError
147375
147385
  ] = useObsSegmentationsData(
147376
147386
  loaders,
147377
147387
  dataset,
@@ -147381,7 +147391,7 @@ function LayerControllerSubscriber(props) {
147381
147391
  {}
147382
147392
  // TODO: use obsType once #1240 is merged.
147383
147393
  );
147384
- const [{ image }, imageStatus] = useImageData(
147394
+ const [{ image }, imageStatus, imageUrls, imageError] = useImageData(
147385
147395
  loaders,
147386
147396
  dataset,
147387
147397
  false,
@@ -147391,6 +147401,11 @@ function LayerControllerSubscriber(props) {
147391
147401
  // TODO: which values to match on
147392
147402
  );
147393
147403
  const { loaders: imageLayerLoaders, meta: imageLayerMeta, instance } = image || {};
147404
+ const errors = [
147405
+ obsLocationsError,
147406
+ obsSegmentationsError,
147407
+ imageError
147408
+ ];
147394
147409
  const isReady = useReady([
147395
147410
  obsLocationsStatus,
147396
147411
  obsSegmentationsStatus,
@@ -147442,6 +147457,7 @@ function LayerControllerSubscriber(props) {
147442
147457
  {
147443
147458
  ref: layerControllerRef,
147444
147459
  title,
147460
+ errors,
147445
147461
  closeButtonVisible,
147446
147462
  downloadButtonVisible,
147447
147463
  removeGridComponent,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a, L, V, d, c, e, f, b, h, u } from "./index-33bfVj66.js";
1
+ import { a, L, V, d, c, e, f, b, h, u } from "./index-CtwSBXNo.js";
2
2
  export {
3
3
  a as LayerController,
4
4
  L as LayerControllerSubscriber,
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-33bfVj66.js";
1
+ import { B as BaseDecoder } from "./index-CtwSBXNo.js";
2
2
  const dctZigZag = new Int32Array([
3
3
  0,
4
4
  1,
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-33bfVj66.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-CtwSBXNo.js";
3
3
  const LercParameters = {
4
4
  AddCompression: 1
5
5
  };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-33bfVj66.js";
1
+ import { B as BaseDecoder } from "./index-CtwSBXNo.js";
2
2
  const MIN_BITS = 9;
3
3
  const CLEAR_CODE = 256;
4
4
  const EOI_CODE = 257;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-33bfVj66.js";
1
+ import { B as BaseDecoder } from "./index-CtwSBXNo.js";
2
2
  class PackbitsDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  const dataView = new DataView(buffer);
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-33bfVj66.js";
1
+ import { B as BaseDecoder } from "./index-CtwSBXNo.js";
2
2
  class RawDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  return buffer;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-33bfVj66.js";
1
+ import { B as BaseDecoder } from "./index-CtwSBXNo.js";
2
2
  class WebImageDecoder extends BaseDecoder {
3
3
  constructor() {
4
4
  super();
@@ -1 +1 @@
1
- {"version":3,"file":"LayerControllerSubscriber.d.ts","sourceRoot":"","sources":["../src/LayerControllerSubscriber.js"],"names":[],"mappings":"AAuSA;;;;;;;;;;;;;;;GAeG;AACH,iDAbG;IAAsB,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;IAEU,mBAAmB;IAErB,KAAK,EAAnB,MAAM;IACQ,SAAS,EAAvB,MAAM;IACS,eAAe,EAA9B,OAAO;IACQ,4BAA4B,EAA3C,OAAO;IAEQ,8BAA8B,EAA7C,OAAO;CAEjB,eAgNA"}
1
+ {"version":3,"file":"LayerControllerSubscriber.d.ts","sourceRoot":"","sources":["../src/LayerControllerSubscriber.js"],"names":[],"mappings":"AAySA;;;;;;;;;;;;;;;GAeG;AACH,iDAbG;IAAsB,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;IAEU,mBAAmB;IAErB,KAAK,EAAnB,MAAM;IACQ,SAAS,EAAvB,MAAM;IACS,eAAe,EAA9B,OAAO;IACQ,4BAA4B,EAA3C,OAAO;IAEQ,8BAA8B,EAA7C,OAAO;CAEjB,eA2NA"}
@@ -17,10 +17,10 @@ import ImageAddButton from './ImageAddButton.js';
17
17
  // the actual Spatial component. Re-rendering this component is very
18
18
  // expensive so we have to be careful with props in this file in general.
19
19
  const LayerControllerMemoized = React.memo(forwardRef((props, ref) => {
20
- const { title, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady, dataset, obsType, moleculesLayer, setMoleculesLayer, cellsLayer, // May be one polygon layer object or an array of bitmask layers.
20
+ const { title, errors, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady, dataset, obsType, moleculesLayer, setMoleculesLayer, cellsLayer, // May be one polygon layer object or an array of bitmask layers.
21
21
  setCellsLayer, rasterLayers, imageLayerLoaders, imageLayerMeta, imageLayerCallbacks, setImageLayerCallbacks, areLoadingImageChannels, setAreLoadingImageChannels, handleRasterLayerChange, handleRasterLayerRemove, photometricInterpretation, obsSegmentationsType, segmentationLayerLoaders, segmentationLayerMeta, segmentationLayerCallbacks, setSegmentationLayerCallbacks, areLoadingSegmentationChannels, setAreLoadingSegmentationChannels, handleSegmentationLayerChange, handleSegmentationLayerRemove, disable3d, globalDisable3d, disableChannelsIfRgbDetected, layerIs3DIndex, setZoom, setTargetX, setTargetY, setTargetZ, setRotationX, setRotationOrbit, componentHeight, componentWidth, spatialLayout, handleImageAdd, enableLayerButtonsWithOneLayer, helpText, } = props;
22
22
  const shouldShowImageLayerButton = Boolean(enableLayerButtonsWithOneLayer || imageLayerLoaders?.length > 1);
23
- return (_jsx(TitleInfo, { title: title, isScroll: true, closeButtonVisible: closeButtonVisible, downloadButtonVisible: downloadButtonVisible, removeGridComponent: removeGridComponent, theme: theme, isReady: isReady, helpText: helpText, children: _jsxs("div", { className: "layer-controller-container", ref: ref, children: [moleculesLayer && (_jsx(VectorLayerController, { label: "Molecules", layerType: "molecules", layer: moleculesLayer, handleLayerChange: setMoleculesLayer }, `${dataset}-molecules`)), cellsLayer && obsSegmentationsType === 'polygon' && (_jsx(VectorLayerController, { label: `${capitalize(obsType)} Segmentations`, layerType: "cells", layer: cellsLayer, handleLayerChange: setCellsLayer }, `${dataset}-cells`)), cellsLayer && obsSegmentationsType === 'bitmask'
23
+ return (_jsx(TitleInfo, { title: title, isScroll: true, closeButtonVisible: closeButtonVisible, downloadButtonVisible: downloadButtonVisible, removeGridComponent: removeGridComponent, theme: theme, isReady: isReady, helpText: helpText, errors: errors, children: _jsxs("div", { className: "layer-controller-container", ref: ref, children: [moleculesLayer && (_jsx(VectorLayerController, { label: "Molecules", layerType: "molecules", layer: moleculesLayer, handleLayerChange: setMoleculesLayer }, `${dataset}-molecules`)), cellsLayer && obsSegmentationsType === 'polygon' && (_jsx(VectorLayerController, { label: `${capitalize(obsType)} Segmentations`, layerType: "cells", layer: cellsLayer, handleLayerChange: setCellsLayer }, `${dataset}-cells`)), cellsLayer && obsSegmentationsType === 'bitmask'
24
24
  && cellsLayer.map((layer, i) => {
25
25
  const { index } = layer;
26
26
  const loader = segmentationLayerLoaders?.[index];
@@ -138,11 +138,17 @@ export function LayerControllerSubscriber(props) {
138
138
  const [componentWidth, componentHeight] = useClosestVitessceContainerSize(layerControllerRef);
139
139
  const { height: windowHeight, width: windowWidth } = useWindowDimensions();
140
140
  // Get data from loaders using the data hooks.
141
+ const [
141
142
  // eslint-disable-next-line no-unused-vars
142
- const [obsLocationsData, obsLocationsStatus] = useObsLocationsData(loaders, dataset, false, { setSpatialPointLayer: setMoleculesLayer }, { spatialPointLayer: moleculesLayer }, {});
143
- const [{ obsSegmentations, obsSegmentationsType }, obsSegmentationsStatus,] = useObsSegmentationsData(loaders, dataset, false, { setSpatialSegmentationLayer: setCellsLayer }, { spatialSegmentationLayer: cellsLayer }, {});
144
- const [{ image }, imageStatus] = useImageData(loaders, dataset, false, { setSpatialImageLayer: setRasterLayers }, { spatialImageLayer: rasterLayers }, {});
143
+ obsLocationsData, obsLocationsStatus, obsLocationsUrls, obsLocationsError,] = useObsLocationsData(loaders, dataset, false, { setSpatialPointLayer: setMoleculesLayer }, { spatialPointLayer: moleculesLayer }, {});
144
+ const [{ obsSegmentations, obsSegmentationsType }, obsSegmentationsStatus, obsSegmentationsUrls, obsSegmentationsError,] = useObsSegmentationsData(loaders, dataset, false, { setSpatialSegmentationLayer: setCellsLayer }, { spatialSegmentationLayer: cellsLayer }, {});
145
+ const [{ image }, imageStatus, imageUrls, imageError] = useImageData(loaders, dataset, false, { setSpatialImageLayer: setRasterLayers }, { spatialImageLayer: rasterLayers }, {});
145
146
  const { loaders: imageLayerLoaders, meta: imageLayerMeta, instance } = image || {};
147
+ const errors = [
148
+ obsLocationsError,
149
+ obsSegmentationsError,
150
+ imageError,
151
+ ];
146
152
  const isReady = useReady([
147
153
  obsLocationsStatus,
148
154
  obsSegmentationsStatus,
@@ -190,7 +196,7 @@ export function LayerControllerSubscriber(props) {
190
196
  setCellsLayer(newLayers);
191
197
  }, [cellsLayer, setCellsLayer]);
192
198
  const layerIs3DIndex = rasterLayers?.findIndex && rasterLayers.findIndex(layer => layer.use3d);
193
- return (_jsx(LayerControllerMemoized, { ref: layerControllerRef, title: title, closeButtonVisible: closeButtonVisible, downloadButtonVisible: downloadButtonVisible, removeGridComponent: removeGridComponent, theme: theme, isReady: isReady, moleculesLayer: moleculesLayer, dataset: dataset, obsType: obsType, setMoleculesLayer: setMoleculesLayer, cellsLayer: cellsLayer, setCellsLayer: setCellsLayer, helpText: helpText, rasterLayers: rasterLayers, imageLayerLoaders: imageLayerLoaders, imageLayerMeta: imageLayerMeta, imageLayerCallbacks: imageLayerCallbacks, setImageLayerCallbacks: setImageLayerCallbacks, areLoadingImageChannels: areLoadingImageChannels, setAreLoadingImageChannels: setAreLoadingImageChannels, handleRasterLayerChange: handleRasterLayerChange, handleRasterLayerRemove: handleRasterLayerRemove, photometricInterpretation: photometricInterpretation, obsSegmentationsType: obsSegmentationsType, segmentationLayerLoaders: segmentationLayerLoaders, segmentationLayerMeta: segmentationLayerMeta, segmentationLayerCallbacks: segmentationLayerCallbacks, setSegmentationLayerCallbacks: setSegmentationLayerCallbacks, areLoadingSegmentationChannels: areLoadingSegmentationChannels, setAreLoadingSegmentationChannels: setAreLoadingSegmentationChannels, handleSegmentationLayerChange: handleSegmentationLayerChange, handleSegmentationLayerRemove: handleSegmentationLayerRemove, disable3d: disable3d, globalDisable3d: globalDisable3d, layerIs3DIndex: layerIs3DIndex, disableChannelsIfRgbDetected: disableChannelsIfRgbDetected, enableLayerButtonsWithOneLayer: enableLayerButtonsWithOneLayer, setZoom: setZoom, setTargetX: setTargetX, setTargetY: setTargetY, setTargetZ: setTargetZ, setRotationX: setRotationX, setRotationOrbit: setRotationOrbit,
199
+ return (_jsx(LayerControllerMemoized, { ref: layerControllerRef, title: title, errors: errors, closeButtonVisible: closeButtonVisible, downloadButtonVisible: downloadButtonVisible, removeGridComponent: removeGridComponent, theme: theme, isReady: isReady, moleculesLayer: moleculesLayer, dataset: dataset, obsType: obsType, setMoleculesLayer: setMoleculesLayer, cellsLayer: cellsLayer, setCellsLayer: setCellsLayer, helpText: helpText, rasterLayers: rasterLayers, imageLayerLoaders: imageLayerLoaders, imageLayerMeta: imageLayerMeta, imageLayerCallbacks: imageLayerCallbacks, setImageLayerCallbacks: setImageLayerCallbacks, areLoadingImageChannels: areLoadingImageChannels, setAreLoadingImageChannels: setAreLoadingImageChannels, handleRasterLayerChange: handleRasterLayerChange, handleRasterLayerRemove: handleRasterLayerRemove, photometricInterpretation: photometricInterpretation, obsSegmentationsType: obsSegmentationsType, segmentationLayerLoaders: segmentationLayerLoaders, segmentationLayerMeta: segmentationLayerMeta, segmentationLayerCallbacks: segmentationLayerCallbacks, setSegmentationLayerCallbacks: setSegmentationLayerCallbacks, areLoadingSegmentationChannels: areLoadingSegmentationChannels, setAreLoadingSegmentationChannels: setAreLoadingSegmentationChannels, handleSegmentationLayerChange: handleSegmentationLayerChange, handleSegmentationLayerRemove: handleSegmentationLayerRemove, disable3d: disable3d, globalDisable3d: globalDisable3d, layerIs3DIndex: layerIs3DIndex, disableChannelsIfRgbDetected: disableChannelsIfRgbDetected, enableLayerButtonsWithOneLayer: enableLayerButtonsWithOneLayer, setZoom: setZoom, setTargetX: setTargetX, setTargetY: setTargetY, setTargetZ: setTargetZ, setRotationX: setRotationX, setRotationOrbit: setRotationOrbit,
194
200
  // Fall back to window for height and width.
195
201
  componentHeight: componentHeight || windowHeight, componentWidth: componentWidth || windowWidth, spatialLayout: spatialLayout, handleImageAdd: handleImageAdd }));
196
202
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/layer-controller",
3
- "version": "3.6.6",
3
+ "version": "3.6.8",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -19,12 +19,12 @@
19
19
  "lodash-es": "^4.17.21",
20
20
  "math.gl": "^3.5.6",
21
21
  "react-aria": "^3.28.0",
22
- "@vitessce/styles": "3.6.6",
23
- "@vitessce/constants-internal": "3.6.6",
24
- "@vitessce/gl": "3.6.6",
25
- "@vitessce/spatial-utils": "3.6.6",
26
- "@vitessce/utils": "3.6.6",
27
- "@vitessce/vit-s": "3.6.6"
22
+ "@vitessce/styles": "3.6.8",
23
+ "@vitessce/constants-internal": "3.6.8",
24
+ "@vitessce/gl": "3.6.8",
25
+ "@vitessce/spatial-utils": "3.6.8",
26
+ "@vitessce/utils": "3.6.8",
27
+ "@vitessce/vit-s": "3.6.8"
28
28
  },
29
29
  "devDependencies": {
30
30
  "react": "^18.0.0",
@@ -33,6 +33,7 @@ const LayerControllerMemoized = React.memo(
33
33
  forwardRef((props, ref) => {
34
34
  const {
35
35
  title,
36
+ errors,
36
37
  closeButtonVisible,
37
38
  downloadButtonVisible,
38
39
  removeGridComponent,
@@ -96,6 +97,7 @@ const LayerControllerMemoized = React.memo(
96
97
  theme={theme}
97
98
  isReady={isReady}
98
99
  helpText={helpText}
100
+ errors={errors}
99
101
  >
100
102
  <div className="layer-controller-container" ref={ref}>
101
103
  {moleculesLayer && (
@@ -378,8 +380,10 @@ export function LayerControllerSubscriber(props) {
378
380
  const { height: windowHeight, width: windowWidth } = useWindowDimensions();
379
381
 
380
382
  // Get data from loaders using the data hooks.
381
- // eslint-disable-next-line no-unused-vars
382
- const [obsLocationsData, obsLocationsStatus] = useObsLocationsData(
383
+ const [
384
+ // eslint-disable-next-line no-unused-vars
385
+ obsLocationsData, obsLocationsStatus, obsLocationsUrls, obsLocationsError,
386
+ ] = useObsLocationsData(
383
387
  loaders, dataset, false,
384
388
  { setSpatialPointLayer: setMoleculesLayer },
385
389
  { spatialPointLayer: moleculesLayer },
@@ -388,19 +392,27 @@ export function LayerControllerSubscriber(props) {
388
392
  const [
389
393
  { obsSegmentations, obsSegmentationsType },
390
394
  obsSegmentationsStatus,
395
+ obsSegmentationsUrls,
396
+ obsSegmentationsError,
391
397
  ] = useObsSegmentationsData(
392
398
  loaders, dataset, false,
393
399
  { setSpatialSegmentationLayer: setCellsLayer },
394
400
  { spatialSegmentationLayer: cellsLayer },
395
401
  {}, // TODO: use obsType once #1240 is merged.
396
402
  );
397
- const [{ image }, imageStatus] = useImageData(
403
+ const [{ image }, imageStatus, imageUrls, imageError] = useImageData(
398
404
  loaders, dataset, false,
399
405
  { setSpatialImageLayer: setRasterLayers },
400
406
  { spatialImageLayer: rasterLayers },
401
407
  {}, // TODO: which values to match on
402
408
  );
403
409
  const { loaders: imageLayerLoaders, meta: imageLayerMeta, instance } = image || {};
410
+
411
+ const errors = [
412
+ obsLocationsError,
413
+ obsSegmentationsError,
414
+ imageError,
415
+ ];
404
416
  const isReady = useReady([
405
417
  obsLocationsStatus,
406
418
  obsSegmentationsStatus,
@@ -464,6 +476,7 @@ export function LayerControllerSubscriber(props) {
464
476
  <LayerControllerMemoized
465
477
  ref={layerControllerRef}
466
478
  title={title}
479
+ errors={errors}
467
480
  closeButtonVisible={closeButtonVisible}
468
481
  downloadButtonVisible={downloadButtonVisible}
469
482
  removeGridComponent={removeGridComponent}