Repository: silx-kit/h5web
Pull request #798 (2021-09-30 09:54:14)

Replace `@h5web/lib/src/...` imports to fix @h5web/app package


Patch:
diff --git a/apps/storybook/src/ColorBar.stories.tsx b/apps/storybook/src/ColorBar.stories.tsx
index 2ea5cfa2..424123cb 100644
--- a/apps/storybook/src/ColorBar.stories.tsx
+++ b/apps/storybook/src/ColorBar.stories.tsx
@@ -1,6 +1,6 @@
 import type { Meta, Story } from '@storybook/react/types-6-0';
 import { ColorBar, ScaleType } from '@h5web/lib';
-import type { ColorBarProps } from '@h5web/lib/src/h5web/vis-packs/core/heatmap/ColorBar';
+import type { ColorBarProps } from '@h5web/lib';
 import FillHeight from './decorators/FillHeight';
 
 export interface TemplateProps extends Omit<ColorBarProps, 'domain'> {
diff --git a/apps/storybook/src/DomainSlider.stories.tsx b/apps/storybook/src/DomainSlider.stories.tsx
index bddeb0ca..537c26fb 100644
--- a/apps/storybook/src/DomainSlider.stories.tsx
+++ b/apps/storybook/src/DomainSlider.stories.tsx
@@ -1,7 +1,6 @@
 import type { Meta, Story } from '@storybook/react/types-6-0';
-import type { CustomDomain } from '@h5web/lib';
+import type { DomainSliderProps, CustomDomain } from '@h5web/lib';
 import { DomainSlider, ScaleType } from '@h5web/lib';
-import type { DomainSliderProps } from '@h5web/lib/src/h5web/toolbar/controls/DomainSlider/DomainSlider';
 import { useState } from 'react';
 import Center from './decorators/Center';
 
diff --git a/apps/storybook/src/LineVis.stories.tsx b/apps/storybook/src/LineVis.stories.tsx
index 3c1a9c63..42af69a6 100644
--- a/apps/storybook/src/LineVis.stories.tsx
+++ b/apps/storybook/src/LineVis.stories.tsx
@@ -10,8 +10,8 @@ import {
   getMockDataArray,
   mockValues,
   getCombinedDomain,
+  getDomains,
 } from '@h5web/lib';
-import { getDomains } from '@h5web/lib/src/h5web/vis-packs/core/utils';
 
 const dataArray = getMockDataArray('/nD_datasets/oneD_linear');
 const domain = getDomain(dataArray);
diff --git a/apps/storybook/src/VisCanvas.stories.tsx b/apps/storybook/src/VisCanvas.stories.tsx
index 18190c5f..ec9b487b 100644
--- a/apps/storybook/src/VisCanvas.stories.tsx
+++ b/apps/storybook/src/VisCanvas.stories.tsx
@@ -1,5 +1,5 @@
 import type { Meta, Story } from '@storybook/react/types-6-0';
-import type { VisCanvasProps } from '@h5web/lib/src/h5web/vis-packs/core/shared/VisCanvas';
+import type { VisCanvasProps } from '@h5web/lib';
 import { VisCanvas, ScaleType } from '@h5web/lib';
 import FillHeight from './decorators/FillHeight';
 
diff --git a/apps/storybook/src/VisCanvasInteraction.stories.tsx b/apps/storybook/src/VisCanvasInteraction.stories.tsx
index aea70036..72f55ccf 100644
--- a/apps/storybook/src/VisCanvasInteraction.stories.tsx
+++ b/apps/storybook/src/VisCanvasInteraction.stories.tsx
@@ -1,7 +1,7 @@
 import type { Meta, Story } from '@storybook/react';
 import VisCanvasStoriesConfig from './VisCanvas.stories';
 import { PanZoomMesh, TooltipMesh, VisCanvas } from '@h5web/lib';
-import type { TooltipMeshProps } from '@h5web/lib/src/h5web/vis-packs/core/shared/TooltipMesh';
+import type { TooltipMeshProps } from '@h5web/lib';
 import { formatTooltipVal } from '@h5web/shared';
 
 interface TemplateProps {
diff --git a/packages/app/src/h5web/toolbar/RgbToolbar.tsx b/packages/app/src/h5web/toolbar/RgbToolbar.tsx
index e39847e8..7354d12c 100644
--- a/packages/app/src/h5web/toolbar/RgbToolbar.tsx
+++ b/packages/app/src/h5web/toolbar/RgbToolbar.tsx
@@ -1,7 +1,12 @@
 import { MdAspectRatio } from 'react-icons/md';
 import shallow from 'zustand/shallow';
-import { GridToggler, ToggleBtn, ToggleGroup, Toolbar } from '@h5web/lib';
-import { ImageType } from '@h5web/lib/src/h5web/vis-packs/core/rgb/models';
+import {
+  ImageType,
+  GridToggler,
+  ToggleBtn,
+  ToggleGroup,
+  Toolbar,
+} from '@h5web/lib';
 import { useRgbVisConfig } from '../vis-packs/core/rgb/config';
 
 function RgbToolbar() {
diff --git a/packages/app/src/h5web/vis-packs/core/complex/hooks.ts b/packages/app/src/h5web/vis-packs/core/complex/hooks.ts
index a19adcb9..8162dad9 100644
--- a/packages/app/src/h5web/vis-packs/core/complex/hooks.ts
+++ b/packages/app/src/h5web/vis-packs/core/complex/hooks.ts
@@ -1,7 +1,5 @@
-import type { Domain } from '@h5web/lib';
-import { getValidDomainForScale } from '@h5web/lib/src/h5web/vis-packs/core/utils';
-import type { H5WebComplex } from '@h5web/shared';
-import { ScaleType } from '@h5web/shared';
+import { ScaleType, getValidDomainForScale } from '@h5web/shared';
+import type { Domain, H5WebComplex } from '@h5web/shared';
 import type { NdArray } from 'ndarray';
 import ndarray from 'ndarray';
 import { useMemo } from 'react';
diff --git a/packages/app/src/h5web/vis-packs/core/complex/utils.ts b/packages/app/src/h5web/vis-packs/core/complex/utils.ts
index cd6cc385..c3b20195 100644
--- a/packages/app/src/h5web/vis-packs/core/complex/utils.ts
+++ b/packages/app/src/h5web/vis-packs/core/complex/utils.ts
@@ -1,6 +1,5 @@
-import type { Bounds } from '@h5web/lib/src/h5web/vis-packs/core/models';
-import { getNewBounds } from '@h5web/lib/src/h5web/vis-packs/core/utils';
-import type { H5WebComplex } from '@h5web/shared';
+import { getNewBounds } from '@h5web/shared';
+import type { H5WebComplex, Bounds } from '@h5web/shared';
 
 const INITIAL_BOUNDS: Bounds = {
   min: Infinity,
diff --git a/packages/app/src/h5web/vis-packs/core/containers/RawVisContainer.tsx b/packages/app/src/h5web/vis-packs/core/containers/RawVisContainer.tsx
index 93ed55b7..b0213b30 100644
--- a/packages/app/src/h5web/vis-packs/core/containers/RawVisContainer.tsx
+++ b/packages/app/src/h5web/vis-packs/core/containers/RawVisContainer.tsx
@@ -1,4 +1,4 @@
-import RawVis from '@h5web/lib/src/h5web/vis-packs/core/raw/RawVis';
+import { RawVis } from '@h5web/lib';
 import type { VisContainerProps } from '../../models';
 import { assertDataset, assertNonNullShape } from '@h5web/shared';
 import VisBoundary from '../VisBoundary';
diff --git a/packages/app/src/h5web/vis-packs/core/containers/RgbVisContainer.tsx b/packages/app/src/h5web/vis-packs/core/containers/RgbVisContainer.tsx
index 8b83906e..a483449f 100644
--- a/packages/app/src/h5web/vis-packs/core/containers/RgbVisContainer.tsx
+++ b/packages/app/src/h5web/vis-packs/core/containers/RgbVisContainer.tsx
@@ -6,7 +6,7 @@ import {
   assertNumDims,
   DTypeClass,
 } from '@h5web/shared';
-import RgbVis from '@h5web/lib/src/h5web/vis-packs/core/rgb/RgbVis';
+import { RgbVis } from '@h5web/lib';
 import type { VisContainerProps } from '../../models';
 import VisBoundary from '../VisBoundary';
 import ValueFetcher from '../ValueFetcher';
diff --git a/packages/app/src/h5web/vis-packs/core/containers/ScalarVisContainer.tsx b/packages/app/src/h5web/vis-packs/core/containers/ScalarVisContainer.tsx
index 8b0f8471..ad64fc37 100644
--- a/packages/app/src/h5web/vis-packs/core/containers/ScalarVisContainer.tsx
+++ b/packages/app/src/h5web/vis-packs/core/containers/ScalarVisContainer.tsx
@@ -3,7 +3,7 @@ import {
   assertPrintableType,
   assertScalarShape,
 } from '@h5web/shared';
-import ScalarVis from '@h5web/lib/src/h5web/vis-packs/core/scalar/ScalarVis';
+import { ScalarVis } from '@h5web/lib';
 import type { VisContainerProps } from '../../models';
 import { getFormatter } from '../scalar/utils';
 import ValueFetcher from '../ValueFetcher';
diff --git a/packages/app/src/h5web/vis-packs/core/hooks.ts b/packages/app/src/h5web/vis-packs/core/hooks.ts
index 7cf69d73..b1c1398c 100644
--- a/packages/app/src/h5web/vis-packs/core/hooks.ts
+++ b/packages/app/src/h5web/vis-packs/core/hooks.ts
@@ -1,17 +1,18 @@
 import type { NdArray } from 'ndarray';
 import { ProviderContext } from '../../providers/context';
 import type { Dataset, Value } from '@h5web/shared';
-import { isDefined, ScaleType } from '@h5web/shared';
+import {
+  isDefined,
+  ScaleType,
+  getBounds,
+  getValidDomainForScale,
+} from '@h5web/shared';
 import { useContext, useMemo } from 'react';
 import type { DimensionMapping } from '../../dimension-mapper/models';
 import { applyMapping, getBaseArray, getSliceSelection } from './utils';
 import { createMemo } from 'react-use';
 import { isAxis } from '../../dimension-mapper/utils';
 import { getCombinedDomain } from '@h5web/lib';
-import {
-  getBounds,
-  getValidDomainForScale,
-} from '@h5web/lib/src/h5web/vis-packs/core/utils';
 
 export function usePrefetchValues(
   datasets: (Dataset | undefined)[],
diff --git a/packages/app/src/h5web/vis-packs/core/models.ts b/packages/app/src/h5web/vis-packs/core/models.ts
index c589182c..c6d855ca 100644
--- a/packages/app/src/h5web/vis-packs/core/models.ts
+++ b/packages/app/src/h5web/vis-packs/core/models.ts
@@ -1,4 +1,4 @@
-import type { AxisParams } from '@h5web/lib/src/h5web/vis-packs/core/models';
+import type { AxisParams } from '@h5web/lib';
 
 export type AxisMapping = (AxisParams | undefined)[];
 
diff --git a/packages/app/src/h5web/vis-packs/core/rgb/config.tsx b/packages/app/src/h5web/vis-packs/core/rgb/config.tsx
index 824ca314..649d46a1 100644
--- a/packages/app/src/h5web/vis-packs/core/rgb/config.tsx
+++ b/packages/app/src/h5web/vis-packs/core/rgb/config.tsx
@@ -1,7 +1,7 @@
 import create from 'zustand';
 import createContext from 'zustand/context';
 import { persist } from 'zustand/middleware';
-import { ImageType } from '@h5web/lib/src/h5web/vis-packs/core/rgb/models';
+import { ImageType } from '@h5web/lib';
 import type { Layout } from '../heatmap/models';
 import type { ConfigProviderProps } from '../../models';
 
diff --git a/packages/app/src/h5web/vis-packs/core/utils.ts b/packages/app/src/h5web/vis-packs/core/utils.ts
index d9369069..2bdb8526 100644
--- a/packages/app/src/h5web/vis-packs/core/utils.ts
+++ b/packages/app/src/h5web/vis-packs/core/utils.ts
@@ -1,12 +1,11 @@
 import ndarray from 'ndarray';
 import type { NdArray } from 'ndarray';
 import { isNumber } from 'lodash';
-import type { Dataset } from '@h5web/shared';
+import type { Domain, Dataset } from '@h5web/shared';
 import { createArrayFromView } from '@h5web/shared';
 import { getAttributeValue } from '../../utils';
 import type { Axis, DimensionMapping } from '../../dimension-mapper/models';
 import { isAxis } from '../../dimension-mapper/utils';
-import type { Domain } from '@h5web/lib';
 
 export const DEFAULT_DOMAIN: Domain = [0.1, 1];
 
diff --git a/packages/app/src/h5web/vis-packs/nexus/containers/NxRgbContainer.tsx b/packages/app/src/h5web/vis-packs/nexus/containers/NxRgbContainer.tsx
index f94afb69..393a16e9 100644
--- a/packages/app/src/h5web/vis-packs/nexus/containers/NxRgbContainer.tsx
+++ b/packages/app/src/h5web/vis-packs/nexus/containers/NxRgbContainer.tsx
@@ -5,7 +5,7 @@ import {
   assertNumDims,
   DTypeClass,
 } from '@h5web/shared';
-import RgbVis from '@h5web/lib/src/h5web/vis-packs/core/rgb/RgbVis';
+import { RgbVis } from '@h5web/lib';
 import type { VisContainerProps } from '../../models';
 import VisBoundary from '../../core/VisBoundary';
 import NxValuesFetcher from '../NxValuesFetcher';
diff --git a/packages/app/src/h5web/vis-packs/nexus/utils.ts b/packages/app/src/h5web/vis-packs/nexus/utils.ts
index 3b66c78d..3680c8db 100644
--- a/packages/app/src/h5web/vis-packs/nexus/utils.ts
+++ b/packages/app/src/h5web/vis-packs/nexus/utils.ts
@@ -11,6 +11,7 @@ import {
   getChildEntity,
   isDefined,
   isGroup,
+  isScaleType,
 } from '@h5web/shared';
 import type {
   Entity,
@@ -25,7 +26,6 @@ import type {
   NumArrayDataset,
 } from '@h5web/shared';
 import { getAttributeValue } from '../../utils';
-import { isScaleType } from '@h5web/lib/src/h5web/vis-packs/core/utils';
 import type { NxData, SilxStyle } from './models';
 
 export function isNxDataGroup(group: Group): boolean {
diff --git a/packages/lib/src/h5web/toolbar/controls/DomainSlider/DomainSlider.tsx b/packages/lib/src/h5web/toolbar/controls/DomainSlider/DomainSlider.tsx
index e78ced25..79dfc1b3 100644
--- a/packages/lib/src/h5web/toolbar/controls/DomainSlider/DomainSlider.tsx
+++ b/packages/lib/src/h5web/toolbar/controls/DomainSlider/DomainSlider.tsx
@@ -2,7 +2,6 @@ import { useEffect, useRef, useState } from 'react';
 import styles from './DomainSlider.module.css';
 import type {
   CustomDomain,
-  Domain,
   HistogramParams,
 } from '../../../vis-packs/core/models';
 import ToggleBtn from '../ToggleBtn';
@@ -15,7 +14,7 @@ import {
   useSafeDomain,
   useVisDomain,
 } from '../../../vis-packs/core/heatmap/hooks';
-import type { ScaleType } from '@h5web/shared';
+import type { ScaleType, Domain } from '@h5web/shared';
 
 const TOOLTIP_ID = 'domain-tooltip';
 
diff --git a/packages/lib/src/h5web/toolbar/controls/DomainSlider/DomainTooltip.tsx b/packages/lib/src/h5web/toolbar/controls/DomainSlider/DomainTooltip.tsx
index 9f262c15..a10895b4 100644
--- a/packages/lib/src/h5web/toolbar/controls/DomainSlider/DomainTooltip.tsx
+++ b/packages/lib/src/h5web/toolbar/controls/DomainSlider/DomainTooltip.tsx
@@ -1,6 +1,5 @@
 import { forwardRef, useImperativeHandle, useRef } from 'react';
 import type {
-  Domain,
   DomainErrors,
   HistogramParams,
 } from '../../../vis-packs/core/models';
@@ -12,7 +11,7 @@ import Histogram from './Histogram';
 import styles from './DomainTooltip.module.css';
 import ErrorMessage from './ErrorMessage';
 import { formatBound } from '@h5web/shared';
-import type { ScaleType } from '@h5web/shared';
+import type { Domain, ScaleType } from '@h5web/shared';
 
 interface Props {
   id: string;
diff --git a/packages/lib/src/h5web/toolbar/controls/DomainSlider/Histogram.tsx b/packages/lib/src/h5web/toolbar/controls/DomainSlider/Histogram.tsx
index 2ad05d0e..c74fd49b 100644
--- a/packages/lib/src/h5web/toolbar/controls/DomainSlider/Histogram.tsx
+++ b/packages/lib/src/h5web/toolbar/controls/DomainSlider/Histogram.tsx
@@ -2,14 +2,14 @@ import { useMeasure } from '@react-hookz/web';
 import { AxisBottom, AxisLeft } from '@visx/axis';
 import { scaleLinear } from '@visx/scale';
 import { useCombinedDomain, useDomain } from '../../../vis-packs/core/hooks';
-import type { Domain, HistogramParams } from '../../../vis-packs/core/models';
+import type { HistogramParams } from '../../../vis-packs/core/models';
 import { H5WEB_SCALES } from '../../../vis-packs/core/scales';
 import Tick from '../../../vis-packs/core/shared/Tick';
 import { adaptedNumTicks, DEFAULT_DOMAIN } from '../../../vis-packs/core/utils';
 import HistogramColorBar from './HistogramColorBar';
 import HistogramIndicators from './HistogramIndicators';
 import styles from './Histogram.module.css';
-import type { ScaleType } from '@h5web/shared';
+import type { Domain, ScaleType } from '@h5web/shared';
 
 interface Props extends HistogramParams {
   scaleType: ScaleType;
diff --git a/packages/lib/src/h5web/toolbar/controls/DomainSlider/HistogramIndicators.tsx b/packages/lib/src/h5web/toolbar/controls/DomainSlider/HistogramIndicators.tsx
index 825c9e28..e429072b 100644
--- a/packages/lib/src/h5web/toolbar/controls/DomainSlider/HistogramIndicators.tsx
+++ b/packages/lib/src/h5web/toolbar/controls/DomainSlider/HistogramIndicators.tsx
@@ -1,4 +1,4 @@
-import type { Domain } from '../../../vis-packs/core/models';
+import type { Domain } from '@h5web/shared';
 import styles from './Histogram.module.css';
 
 const ARROW_SIZE = 10;
diff --git a/packages/lib/src/h5web/toolbar/controls/DomainSlider/ScaledSlider.tsx b/packages/lib/src/h5web/toolbar/controls/DomainSlider/ScaledSlider.tsx
index 3d07c97d..22283b1d 100644
--- a/packages/lib/src/h5web/toolbar/controls/DomainSlider/ScaledSlider.tsx
+++ b/packages/lib/src/h5web/toolbar/controls/DomainSlider/ScaledSlider.tsx
@@ -6,12 +6,12 @@ import {
   createAxisScale,
   extendDomain,
 } from '../../../vis-packs/core/utils';
-import type { Domain, DomainErrors } from '../../../vis-packs/core/models';
+import type { DomainErrors } from '../../../vis-packs/core/models';
 import styles from './DomainSlider.module.css';
 import Thumb from './Thumb';
 import Track from './Track';
 import { getSafeDomain } from '../../../vis-packs/core/heatmap/utils';
-import type { ScaleType } from '@h5web/shared';
+import type { Domain, ScaleType } from '@h5web/shared';
 
 const SLIDER_RANGE: Domain = [1, 100];
 const EXTEND_FACTOR = 0.3;
diff --git a/packages/lib/src/h5web/toolbar/controls/DomainSlider/Track.tsx b/packages/lib/src/h5web/toolbar/controls/DomainSlider/Track.tsx
index 683bed28..aa478e5a 100644
--- a/packages/lib/src/h5web/toolbar/controls/DomainSlider/Track.tsx
+++ b/packages/lib/src/h5web/toolbar/controls/DomainSlider/Track.tsx
@@ -1,5 +1,6 @@
-import type { AxisScale, Domain } from '../../../vis-packs/core/models';
+import type { AxisScale } from '../../../vis-packs/core/models';
 import styles from './Track.module.css';
+import type { Domain } from '@h5web/shared';
 
 interface Props {
   scale: AxisScale;
diff --git a/packages/lib/src/h5web/vis-packs/core/heatmap/ColorBar.tsx b/packages/lib/src/h5web/vis-packs/core/heatmap/ColorBar.tsx
index 42bf8a7e..e33541ed 100644
--- a/packages/lib/src/h5web/vis-packs/core/heatmap/ColorBar.tsx
+++ b/packages/lib/src/h5web/vis-packs/core/heatmap/ColorBar.tsx
@@ -3,8 +3,9 @@ import { useMeasure } from '@react-hookz/web';
 import { adaptedNumTicks, createAxisScale } from '../utils';
 import styles from './ColorBar.module.css';
 import { getInterpolator, getLinearGradient } from './utils';
+import type { Domain } from '@h5web/shared';
 import { formatBound } from '@h5web/shared';
-import type { Domain, VisScaleType } from '../models';
+import type { VisScaleType } from '../models';
 import type { ColorMap } from './models';
 import Tick from '../shared/Tick';
 
diff --git a/packages/lib/src/h5web/vis-packs/core/heatmap/HeatmapMesh.tsx b/packages/lib/src/h5web/vis-packs/core/heatmap/HeatmapMesh.tsx
index 846bb10a..1c8d9234 100644
--- a/packages/lib/src/h5web/vis-packs/core/heatmap/HeatmapMesh.tsx
+++ b/packages/lib/src/h5web/vis-packs/core/heatmap/HeatmapMesh.tsx
@@ -7,13 +7,13 @@ import {
   RGBFormat,
   UnsignedByteType,
 } from 'three';
-import type { Domain, VisScaleType } from '../models';
+import type { VisScaleType } from '../models';
 import { useAxisSystemContext } from '../shared/AxisSystemContext';
 import VisMesh from '../shared/VisMesh';
 import type { ColorMap, ScaleShader } from './models';
-import { isScaleType } from '../utils';
 import { getInterpolator } from './utils';
-import { ScaleType, assertDefined } from '@h5web/shared';
+import type { Domain } from '@h5web/shared';
+import { ScaleType, assertDefined, isScaleType } from '@h5web/shared';
 
 interface Props {
   rows: number;
diff --git a/packages/lib/src/h5web/vis-packs/core/heatmap/HeatmapVis.tsx b/packages/lib/src/h5web/vis-packs/core/heatmap/HeatmapVis.tsx
index 92665660..8e2ffdae 100644
--- a/packages/lib/src/h5web/vis-packs/core/heatmap/HeatmapVis.tsx
+++ b/packages/lib/src/h5web/vis-packs/core/heatmap/HeatmapVis.tsx
@@ -6,12 +6,13 @@ import TooltipMesh from '../shared/TooltipMesh';
 import PanZoomMesh from '../shared/PanZoomMesh';
 import VisCanvas from '../shared/VisCanvas';
 import { getDims } from './utils';
-import type { Domain, VisScaleType, AxisParams } from '../models';
+import type { VisScaleType, AxisParams } from '../models';
 import type { ColorMap, Layout, TooltipData } from './models';
 import { DEFAULT_DOMAIN } from '../utils';
 import { useAxisValues } from './hooks';
 import { useDomain, useValueToIndexScale } from '../hooks';
 import HeatmapMesh from './HeatmapMesh';
+import type { Domain } from '@h5web/shared';
 import { assertDefined, formatTooltipVal, ScaleType } from '@h5web/shared';
 
 interface Props {
diff --git a/packages/lib/src/h5web/vis-packs/core/heatmap/utils.ts b/packages/lib/src/h5web/vis-packs/core/heatmap/utils.ts
index 869cff1a..eb8a1aee 100644
--- a/packages/lib/src/h5web/vis-packs/core/heatmap/utils.ts
+++ b/packages/lib/src/h5web/vis-packs/core/heatmap/utils.ts
@@ -1,7 +1,7 @@
-import type { ScaleType } from '@h5web/shared';
+import type { Domain, ScaleType } from '@h5web/shared';
 import { range } from 'lodash';
 import type { NdArray } from 'ndarray';
-import type { CustomDomain, Domain, DomainErrors } from '../models';
+import type { CustomDomain, DomainErrors } from '../models';
 import { DomainError } from '../models';
 import { H5WEB_SCALES } from '../scales';
 import { INTERPOLATORS } from './interpolators';
diff --git a/packages/lib/src/h5web/vis-packs/core/hooks.ts b/packages/lib/src/h5web/vis-packs/core/hooks.ts
index a3cf0d05..a4874a25 100644
--- a/packages/lib/src/h5web/vis-packs/core/hooks.ts
+++ b/packages/lib/src/h5web/vis-packs/core/hooks.ts
@@ -4,14 +4,9 @@ import type { RefCallback } from 'react';
 import { useEventListener } from '@react-hookz/web';
 import { createMemo } from 'react-use';
 import { useFrame, useThree } from '@react-three/fiber';
-import {
-  getBounds,
-  getCombinedDomain,
-  getValidDomainForScale,
-  getValueToIndexScale,
-} from './utils';
+import { getCombinedDomain, getValueToIndexScale } from './utils';
 import type { Size } from './models';
-import { ScaleType } from '@h5web/shared';
+import { ScaleType, getBounds, getValidDomainForScale } from '@h5web/shared';
 
 const useBounds = createMemo(getBounds);
 const useValidDomainForScale = createMemo(getValidDomainForScale);
diff --git a/packages/lib/src/h5web/vis-packs/core/line/LineVis.tsx b/packages/lib/src/h5web/vis-packs/core/line/LineVis.tsx
index 31df6ea0..5cf6bd33 100644
--- a/packages/lib/src/h5web/vis-packs/core/line/LineVis.tsx
+++ b/packages/lib/src/h5web/vis-packs/core/line/LineVis.tsx
@@ -7,10 +7,11 @@ import DataCurve from './DataCurve';
 import VisCanvas from '../shared/VisCanvas';
 import PanZoomMesh from '../shared/PanZoomMesh';
 import TooltipMesh from '../shared/TooltipMesh';
-import type { Domain, AxisParams } from '../models';
+import type { AxisParams } from '../models';
 import type { TooltipData } from './models';
 import { CurveType } from './models';
 import { getDomain, extendDomain, DEFAULT_DOMAIN } from '../utils';
+import type { Domain } from '@h5web/shared';
 import {
   assertDataLength,
   assertDefined,
diff --git a/packages/lib/src/h5web/vis-packs/core/models.ts b/packages/lib/src/h5web/vis-packs/core/models.ts
index f2dbb394..0abd9dda 100644
--- a/packages/lib/src/h5web/vis-packs/core/models.ts
+++ b/packages/lib/src/h5web/vis-packs/core/models.ts
@@ -1,5 +1,6 @@
 import type { PickD3Scale, PickScaleConfigWithoutType } from '@visx/scale';
 import type {
+  Domain,
   NumericType,
   StringType,
   BooleanType,
@@ -15,7 +16,6 @@ export interface Size {
 }
 
 export type Bound = 'min' | 'max';
-export type Domain = [number, number];
 export type CustomDomain = [number | null, number | null]; // `null` for persistability
 
 export interface DomainErrors {
@@ -75,13 +75,6 @@ export interface AxisParams {
   scaleType?: ScaleType;
 }
 
-export interface Bounds {
-  min: number;
-  max: number;
-  positiveMin: number;
-  strictPositiveMin: number;
-}
-
 export type Coords = [number, number];
 
 export type PrintableType =
diff --git a/packages/lib/src/h5web/vis-packs/core/scaleGamma.ts b/packages/lib/src/h5web/vis-packs/core/scaleGamma.ts
index 6287e61c..fa0d2e7f 100644
--- a/packages/lib/src/h5web/vis-packs/core/scaleGamma.ts
+++ b/packages/lib/src/h5web/vis-packs/core/scaleGamma.ts
@@ -1,5 +1,6 @@
 import { scalePower } from '@visx/scale';
-import type { Domain, ScaleGammaConfig } from './models';
+import type { Domain } from '@h5web/shared';
+import type { ScaleGammaConfig } from './models';
 import { interpolateNumber, interpolateRound } from 'd3-interpolate';
 import type {
   InterpolatorFactory,
diff --git a/packages/lib/src/h5web/vis-packs/core/shared/Axis.tsx b/packages/lib/src/h5web/vis-packs/core/shared/Axis.tsx
index 62f33c94..70ce03b6 100644
--- a/packages/lib/src/h5web/vis-packs/core/shared/Axis.tsx
+++ b/packages/lib/src/h5web/vis-packs/core/shared/Axis.tsx
@@ -3,7 +3,7 @@ import type { SharedAxisProps } from '@visx/axis';
 import { AxisLeft, AxisBottom } from '@visx/axis';
 import { GridColumns, GridRows } from '@visx/grid';
 import styles from './AxisSystem.module.css';
-import type { Domain, Size, AxisConfig, AxisScale } from '../models';
+import type { Size, AxisConfig, AxisScale } from '../models';
 import {
   adaptedNumTicks,
   getIntegerTicks,
@@ -11,6 +11,7 @@ import {
   createAxisScale,
 } from '../utils';
 import Tick from './Tick';
+import type { Domain } from '@h5web/shared';
 import { ScaleType } from '@h5web/shared';
 
 const AXIS_PROPS: Partial<SharedAxisProps<AxisScale>> = {
diff --git a/packages/lib/src/h5web/vis-packs/core/shared/AxisSystem.tsx b/packages/lib/src/h5web/vis-packs/core/shared/AxisSystem.tsx
index 02ecc658..5ee9af2d 100644
--- a/packages/lib/src/h5web/vis-packs/core/shared/AxisSystem.tsx
+++ b/packages/lib/src/h5web/vis-packs/core/shared/AxisSystem.tsx
@@ -1,10 +1,11 @@
 import { useThree } from '@react-three/fiber';
 import { useFrameRendering } from '../hooks';
-import type { AxisOffsets, Domain } from '../models';
+import type { AxisOffsets } from '../models';
 import { useAxisSystemContext } from './AxisSystemContext';
 import Html from './Html';
 import styles from './AxisSystem.module.css';
 import Axis from './Axis';
+import type { Domain } from '@h5web/shared';
 
 interface Props {
   axisOffsets: AxisOffsets;
diff --git a/packages/lib/src/h5web/vis-packs/core/utils.ts b/packages/lib/src/h5web/vis-packs/core/utils.ts
index 81e76f63..8cf0a939 100644
--- a/packages/lib/src/h5web/vis-packs/core/utils.ts
+++ b/packages/lib/src/h5web/vis-packs/core/utils.ts
@@ -4,10 +4,8 @@ import { tickStep, range } from 'd3-array';
 import type { NdArray } from 'ndarray';
 import type {
   Size,
-  Domain,
   AxisScale,
   AxisConfig,
-  Bounds,
   AxisOffsets,
   ScaleGammaConfig,
   VisxScaleConfig,
@@ -15,12 +13,14 @@ import type {
 } from './models';
 import { H5WEB_SCALES } from './scales';
 import { clamp } from 'three/src/math/MathUtils';
+import type { Domain } from '@h5web/shared';
 import {
+  getValidDomainForScale,
   ScaleType,
-  assertDataLength,
   isDefined,
   formatTick,
-  toArray,
+  isScaleType,
+  getBounds,
 } from '@h5web/shared';
 
 export const DEFAULT_DOMAIN: Domain = [0.1, 1];
@@ -74,55 +74,6 @@ export function computeCanvasSize(
     : { width, height: width / aspectRatio };
 }
 
-export function getNewBounds(oldBounds: Bounds, value: number): Bounds {
-  const {
-    min: oldMin,
-    max: oldMax,
-    positiveMin: oldPositiveMin,
-    strictPositiveMin: oldStrictPositiveMin,
-  } = oldBounds;
-  return {
-    min: Math.min(value, oldMin),
-    max: Math.max(value, oldMax),
-    positiveMin: value >= 0 ? Math.min(value, oldPositiveMin) : oldPositiveMin,
-    strictPositiveMin:
-      value > 0 ? Math.min(value, oldStrictPositiveMin) : oldStrictPositiveMin,
-  };
-}
-
-export function getBounds(
-  valuesArray: NdArray<number[]> | number[],
-  errorArray?: NdArray<number[]> | number[]
-): Bounds | undefined {
-  assertDataLength(errorArray, valuesArray, 'error');
-
-  const values = toArray(valuesArray);
-  const errors = errorArray && toArray(errorArray);
-
-  const bounds = values.reduce<Bounds>(
-    (acc, val, i) => {
-      // Ignore NaN and Infinity from the bounds computation
-      if (!Number.isFinite(val)) {
-        return acc;
-      }
-      const newBounds = getNewBounds(acc, val);
-      const err = errors?.[i];
-      return err
-        ? getNewBounds(getNewBounds(newBounds, val - err), val + err)
-        : newBounds;
-    },
-    {
-      min: Infinity,
-      max: -Infinity,
-      positiveMin: Infinity,
-      strictPositiveMin: Infinity,
-    }
-  );
-
-  // Return undefined if min is Infinity (values is empty or contains only NaN/Infinity)
-  return Number.isFinite(bounds.min) ? bounds : undefined;
-}
-
 export function getDomain(
   valuesArray: NdArray<number[]> | number[],
   scaleType: ScaleType = ScaleType.Linear,
@@ -284,12 +235,6 @@ export function getTickFormatter(
   };
 }
 
-export function isScaleType(val: unknown): val is ScaleType {
-  return (
-    typeof val === 'string' && Object.values<string>(ScaleType).includes(val)
-  );
-}
-
 export function getCombinedDomain(
   domains: (Domain | undefined)[]
 ): Domain | undefined {
@@ -304,30 +249,6 @@ export function getCombinedDomain(
   ]);
 }
 
-export function getValidDomainForScale(
-  bounds: Bounds | undefined,
-  scaleType: ScaleType
-): Domain | undefined {
-  if (bounds === undefined) {
-    return undefined;
-  }
-
-  const { min, max, positiveMin, strictPositiveMin } = bounds;
-  if (scaleType === ScaleType.Log && min * max <= 0) {
-    // Clamp domain minimum to first positive value,
-    // or return `undefined` if domain is not unsupported: `[-x, 0]`
-    return Number.isFinite(strictPositiveMin)
-      ? [strictPositiveMin, max]
-      : undefined;
-  }
-
-  if (scaleType === ScaleType.Sqrt && min * max < 0) {
-    return [positiveMin, max];
-  }
-
-  return [min, max];
-}
-
 export function getAxisOffsets(
   hasLabel: Partial<Record<keyof AxisOffsets, boolean>> = {}
 ) {
diff --git a/packages/lib/src/index.ts b/packages/lib/src/index.ts
index 72f871cf..b24306c2 100644
--- a/packages/lib/src/index.ts
+++ b/packages/lib/src/index.ts
@@ -16,6 +16,7 @@ export { default as DownloadBtn } from './h5web/toolbar/controls/DownloadBtn';
 export { default as ToggleBtn } from './h5web/toolbar/controls/ToggleBtn';
 export { default as ToggleGroup } from './h5web/toolbar/controls/ToggleGroup';
 export { default as DomainSlider } from './h5web/toolbar/controls/DomainSlider/DomainSlider';
+export type { DomainSliderProps } from './h5web/toolbar/controls/DomainSlider/DomainSlider';
 export { default as ColorMapSelector } from './h5web/toolbar/controls/ColorMapSelector/ColorMapSelector';
 export { default as ScaleSelector } from './h5web/toolbar/controls/ScaleSelector/ScaleSelector';
 export { default as GridToggler } from './h5web/toolbar/controls/GridToggler';
@@ -24,10 +25,13 @@ export { default as Selector } from './h5web/toolbar/controls/Selector/Selector'
 
 // Building blocks
 export { default as VisCanvas } from './h5web/vis-packs/core/shared/VisCanvas';
+export type { VisCanvasProps } from './h5web/vis-packs/core/shared/VisCanvas';
 export { default as PanZoomMesh } from './h5web/vis-packs/core/shared/PanZoomMesh';
 export { default as TooltipMesh } from './h5web/vis-packs/core/shared/TooltipMesh';
+export type { TooltipMeshProps } from './h5web/vis-packs/core/shared/TooltipMesh';
 export { default as VisMesh } from './h5web/vis-packs/core/shared/VisMesh';
 export { default as ColorBar } from './h5web/vis-packs/core/heatmap/ColorBar';
+export type { ColorBarProps } from './h5web/vis-packs/core/heatmap/ColorBar';
 export { default as HeatmapMesh } from './h5web/vis-packs/core/heatmap/HeatmapMesh';
 export { default as DataCurve } from './h5web/vis-packs/core/line/DataCurve';
 export { default as Html } from './h5web/vis-packs/core/shared/Html';
@@ -70,12 +74,14 @@ export { INTERPOLATORS } from './h5web/vis-packs/core/heatmap/interpolators';
 export { ScaleType } from '@h5web/shared';
 export { CurveType } from './h5web/vis-packs/core/line/models';
 
+export type { Domain } from '@h5web/shared';
+
 export type {
-  Domain,
   DomainErrors,
   CustomDomain,
   Size,
   AxisConfig,
+  AxisParams,
 } from './h5web/vis-packs/core/models';
 
 export type {
@@ -91,3 +97,9 @@ export {
   findMockEntity,
   getMockDataArray,
 } from '@h5web/shared';
+
+// Undocumented (for @h5web/app)
+export { default as RawVis } from './h5web/vis-packs/core/raw/RawVis';
+export { default as ScalarVis } from './h5web/vis-packs/core/scalar/ScalarVis';
+export { default as RgbVis } from './h5web/vis-packs/core/rgb/RgbVis';
+export { ImageType } from './h5web/vis-packs/core/rgb/models';
diff --git a/packages/shared/src/guards.ts b/packages/shared/src/guards.ts
index 0d7b5bb0..c96e1c44 100644
--- a/packages/shared/src/guards.ts
+++ b/packages/shared/src/guards.ts
@@ -1,6 +1,7 @@
 import type { ReactChild, ReactElement } from 'react';
 import type { NdArray } from 'ndarray';
 import { toArray } from './utils';
+import { ScaleType } from './models-vis';
 import { EntityKind, DTypeClass } from './models-hdf5';
 import type {
   Entity,
@@ -283,3 +284,9 @@ export function assertDataLength(
     );
   }
 }
+
+export function isScaleType(val: unknown): val is ScaleType {
+  return (
+    typeof val === 'string' && Object.values<string>(ScaleType).includes(val)
+  );
+}
diff --git a/packages/shared/src/models-vis.ts b/packages/shared/src/models-vis.ts
index 7455f3d0..ea387d0c 100644
--- a/packages/shared/src/models-vis.ts
+++ b/packages/shared/src/models-vis.ts
@@ -1,3 +1,5 @@
+export type Domain = [number, number];
+
 export enum ScaleType {
   Linear = 'linear',
   Log = 'log',
@@ -5,3 +7,10 @@ export enum ScaleType {
   Sqrt = 'sqrt',
   Gamma = 'gamma',
 }
+
+export interface Bounds {
+  min: number;
+  max: number;
+  positiveMin: number;
+  strictPositiveMin: number;
+}
diff --git a/packages/shared/src/utils.ts b/packages/shared/src/utils.ts
index 3ef8800f..f7dcee76 100644
--- a/packages/shared/src/utils.ts
+++ b/packages/shared/src/utils.ts
@@ -2,7 +2,10 @@ import { format } from 'd3-format';
 import ndarray from 'ndarray';
 import { assign } from 'ndarray-ops';
 import type { Entity, GroupWithChildren, H5WebComplex } from './models-hdf5';
+import { ScaleType } from './models-vis';
+import type { Bounds, Domain } from './models-vis';
 import type { NdArray } from 'ndarray';
+import { assertDataLength } from './guards';
 
 export const formatTick = format('.5~g');
 export const formatBound = format('.3~e');
@@ -73,3 +76,76 @@ export function createArrayFromView<T>(view: NdArray<T[]>): NdArray<T[]> {
 
   return array;
 }
+
+export function getNewBounds(oldBounds: Bounds, value: number): Bounds {
+  const {
+    min: oldMin,
+    max: oldMax,
+    positiveMin: oldPositiveMin,
+    strictPositiveMin: oldStrictPositiveMin,
+  } = oldBounds;
+  return {
+    min: Math.min(value, oldMin),
+    max: Math.max(value, oldMax),
+    positiveMin: value >= 0 ? Math.min(value, oldPositiveMin) : oldPositiveMin,
+    strictPositiveMin:
+      value > 0 ? Math.min(value, oldStrictPositiveMin) : oldStrictPositiveMin,
+  };
+}
+
+export function getBounds(
+  valuesArray: NdArray<number[]> | number[],
+  errorArray?: NdArray<number[]> | number[]
+): Bounds | undefined {
+  assertDataLength(errorArray, valuesArray, 'error');
+
+  const values = toArray(valuesArray);
+  const errors = errorArray && toArray(errorArray);
+
+  const bounds = values.reduce<Bounds>(
+    (acc, val, i) => {
+      // Ignore NaN and Infinity from the bounds computation
+      if (!Number.isFinite(val)) {
+        return acc;
+      }
+      const newBounds = getNewBounds(acc, val);
+      const err = errors?.[i];
+      return err
+        ? getNewBounds(getNewBounds(newBounds, val - err), val + err)
+        : newBounds;
+    },
+    {
+      min: Infinity,
+      max: -Infinity,
+      positiveMin: Infinity,
+      strictPositiveMin: Infinity,
+    }
+  );
+
+  // Return undefined if min is Infinity (values is empty or contains only NaN/Infinity)
+  return Number.isFinite(bounds.min) ? bounds : undefined;
+}
+
+export function getValidDomainForScale(
+  bounds: Bounds | undefined,
+  scaleType: ScaleType
+): Domain | undefined {
+  if (bounds === undefined) {
+    return undefined;
+  }
+
+  const { min, max, positiveMin, strictPositiveMin } = bounds;
+  if (scaleType === ScaleType.Log && min * max <= 0) {
+    // Clamp domain minimum to first positive value,
+    // or return `undefined` if domain is not unsupported: `[-x, 0]`
+    return Number.isFinite(strictPositiveMin)
+      ? [strictPositiveMin, max]
+      : undefined;
+  }
+
+  if (scaleType === ScaleType.Sqrt && min * max < 0) {
+    return [positiveMin, max];
+  }
+
+  return [min, max];
+}


Test patch:
diff --git a/packages/lib/src/h5web/vis-packs/core/utils.test.ts b/packages/lib/src/h5web/vis-packs/core/utils.test.ts
index b3f109d6..2226138a 100644
--- a/packages/lib/src/h5web/vis-packs/core/utils.test.ts
+++ b/packages/lib/src/h5web/vis-packs/core/utils.test.ts
@@ -9,7 +9,7 @@ import {
   getCombinedDomain,
   clampBound,
 } from './utils';
-import type { Domain } from './models';
+import type { Domain } from '@h5web/shared';
 import { ScaleType } from '@h5web/shared';
 
 const MAX = Number.MAX_VALUE / 2;