From 746f43f83a1518109e5c81fea89ffa3567903c54 Mon Sep 17 00:00:00 2001 From: Axel Bocciarelli Date: Wed, 15 Jan 2025 11:38:00 +0100 Subject: [PATCH] Switch to inline type imports --- .vscode/settings.json | 1 + apps/demo/src/h5wasm/DropZone.tsx | 5 +- apps/demo/src/h5wasm/H5WasmApp.tsx | 2 +- apps/demo/src/h5wasm/UrlForm.tsx | 5 +- apps/demo/src/utils.ts | 3 +- apps/storybook/.storybook/main.ts | 2 +- apps/storybook/src/Annotation.stories.tsx | 6 +- .../src/AxialSelectToZoom.stories.tsx | 2 +- .../src/AxialSelectionTool.stories.tsx | 4 +- apps/storybook/src/ColorBar.stories.tsx | 5 +- .../src/ColorBarHorizontal.stories.tsx | 8 ++- apps/storybook/src/DataCurve.stories.tsx | 2 +- .../src/DefaultInteractions.stories.tsx | 2 +- apps/storybook/src/DomainControls.stories.tsx | 4 +- apps/storybook/src/DomainSlider.stories.tsx | 6 +- apps/storybook/src/DomainWidget.stories.tsx | 5 +- apps/storybook/src/ErrorBars.stories.tsx | 2 +- .../storybook/src/FloatingControl.stories.tsx | 2 +- apps/storybook/src/Glyphs.stories.tsx | 2 +- apps/storybook/src/HeatmapMesh.stories.tsx | 4 +- apps/storybook/src/HeatmapVis.stories.tsx | 2 +- .../src/HeatmapVisDisplay.stories.tsx | 2 +- .../src/HeatmapVisScales.stories.tsx | 11 +++- apps/storybook/src/Histogram.stories.tsx | 2 +- apps/storybook/src/Html.stories.tsx | 5 +- apps/storybook/src/Line.stories.tsx | 2 +- apps/storybook/src/LineVis.stories.tsx | 2 +- apps/storybook/src/LineVisDisplay.stories.tsx | 2 +- apps/storybook/src/LineVisScales.stories.tsx | 5 +- apps/storybook/src/MatrixVis.stories.tsx | 2 +- apps/storybook/src/Overlay.stories.tsx | 2 +- apps/storybook/src/Pan.stories.tsx | 2 +- apps/storybook/src/RgbVis.stories.tsx | 2 +- apps/storybook/src/ScatterVis.stories.tsx | 2 +- apps/storybook/src/SelectToZoom.stories.tsx | 2 +- apps/storybook/src/SelectionTool.stories.tsx | 5 +- apps/storybook/src/Stacking.stories.tsx | 2 +- apps/storybook/src/SurfaceVis.stories.tsx | 2 +- apps/storybook/src/SvgElement.stories.tsx | 2 +- .../src/TiledHeatmapMesh/LinearAxesGroup.tsx | 2 +- .../TiledHeatmapMesh.stories.tsx | 6 +- .../src/TiledHeatmapMesh/checkerboard-api.ts | 11 ++-- .../src/TiledHeatmapMesh/mandlebrot-api.ts | 13 ++-- apps/storybook/src/TiledHeatmapMesh/models.ts | 2 +- apps/storybook/src/TiledHeatmapMesh/utils.tsx | 2 +- apps/storybook/src/Toolbar.stories.tsx | 7 +- apps/storybook/src/TooltipMesh.stories.tsx | 2 +- apps/storybook/src/VisCanvas.stories.tsx | 2 +- apps/storybook/src/XAxisZoom.stories.tsx | 2 +- apps/storybook/src/YAxisZoom.stories.tsx | 2 +- apps/storybook/src/Zoom.stories.tsx | 2 +- .../src/decorators/DomainWidgetDecorator.tsx | 2 +- apps/storybook/src/decorators/FillHeight.tsx | 2 +- apps/storybook/src/useDrag.stories.tsx | 2 +- apps/storybook/src/utils.ts | 2 +- eslint.config.base.js | 4 +- packages/app/src/App.tsx | 2 +- packages/app/src/ErrorFallback.tsx | 2 +- packages/app/src/VisConfigProvider.tsx | 4 +- .../app/src/breadcrumbs/BreadcrumbsBar.tsx | 2 +- packages/app/src/breadcrumbs/utils.ts | 2 +- .../app/src/dimension-mapper/AxisMapper.tsx | 6 +- .../src/dimension-mapper/DimensionMapper.tsx | 4 +- packages/app/src/dimension-mapper/models.ts | 2 +- packages/app/src/dimension-mapper/store.tsx | 16 +++-- packages/app/src/dimension-mapper/utils.ts | 5 +- packages/app/src/explorer/EntityItem.tsx | 5 +- packages/app/src/explorer/Icon.tsx | 3 +- packages/app/src/explorer/NxBadge.tsx | 2 +- packages/app/src/explorer/utils.ts | 6 +- packages/app/src/index.ts | 2 +- .../src/metadata-viewer/AttrErrorFallback.tsx | 2 +- .../src/metadata-viewer/AttributesInfo.tsx | 2 +- .../app/src/metadata-viewer/EntityInfo.tsx | 2 +- .../app/src/metadata-viewer/FiltersInfo.tsx | 2 +- .../app/src/metadata-viewer/MetadataTable.tsx | 2 +- .../app/src/metadata-viewer/RawInspector.tsx | 2 +- packages/app/src/metadata-viewer/utils.ts | 12 ++-- packages/app/src/providers/DataProvider.tsx | 22 ++++--- packages/app/src/providers/api.ts | 22 ++++--- .../src/providers/h5grove/H5GroveProvider.tsx | 7 +- .../app/src/providers/h5grove/h5grove-api.ts | 41 +++++++----- packages/app/src/providers/h5grove/models.ts | 2 +- .../app/src/providers/h5grove/utils.test.ts | 2 +- packages/app/src/providers/h5grove/utils.ts | 27 ++++---- .../app/src/providers/hsds/HsdsProvider.tsx | 5 +- packages/app/src/providers/hsds/hsds-api.ts | 65 ++++++++++--------- packages/app/src/providers/hsds/models.ts | 4 +- packages/app/src/providers/hsds/utils.test.ts | 14 ++-- packages/app/src/providers/hsds/utils.ts | 46 ++++++------- .../app/src/providers/mock/MockProvider.tsx | 5 +- packages/app/src/providers/mock/mock-api.ts | 24 ++++--- packages/app/src/providers/mock/mock-file.ts | 2 +- packages/app/src/providers/mock/utils.ts | 16 ++--- packages/app/src/providers/models.ts | 18 ++--- packages/app/src/providers/utils.ts | 21 +++--- packages/app/src/setupTests.ts | 2 +- packages/app/src/test-utils.tsx | 13 ++-- packages/app/src/utils.ts | 4 +- packages/app/src/vis-packs/VisBoundary.tsx | 3 +- .../app/src/vis-packs/core/ValueFetcher.tsx | 12 ++-- .../core/complex/ComplexLineToolbar.tsx | 7 +- .../core/complex/ComplexLineVisContainer.tsx | 2 +- .../vis-packs/core/complex/ComplexToolbar.tsx | 6 +- .../core/complex/ComplexVisContainer.tsx | 2 +- .../core/complex/MappedComplexLineVis.tsx | 12 ++-- .../core/complex/MappedComplexVis.tsx | 13 ++-- .../app/src/vis-packs/core/complex/config.tsx | 5 +- .../app/src/vis-packs/core/complex/hooks.ts | 8 +-- .../src/vis-packs/core/complex/lineConfig.tsx | 11 ++-- .../app/src/vis-packs/core/complex/utils.ts | 5 +- .../core/compound/CompoundVisContainer.tsx | 2 +- .../core/compound/MappedCompoundVis.tsx | 18 ++--- .../vis-packs/core/heatmap/HeatmapToolbar.tsx | 6 +- .../core/heatmap/HeatmapVisContainer.tsx | 2 +- .../core/heatmap/MappedHeatmapVis.tsx | 18 ++--- .../app/src/vis-packs/core/heatmap/config.tsx | 12 ++-- .../app/src/vis-packs/core/heatmap/models.ts | 2 +- packages/app/src/vis-packs/core/hooks.ts | 16 ++--- .../src/vis-packs/core/line/LineToolbar.tsx | 6 +- .../vis-packs/core/line/LineVisContainer.tsx | 2 +- .../src/vis-packs/core/line/MappedLineVis.tsx | 18 ++--- .../app/src/vis-packs/core/line/config.tsx | 11 ++-- .../vis-packs/core/matrix/MappedMatrixVis.tsx | 14 ++-- .../vis-packs/core/matrix/MatrixToolbar.tsx | 4 +- .../core/matrix/MatrixVisContainer.tsx | 2 +- .../app/src/vis-packs/core/matrix/config.tsx | 5 +- .../app/src/vis-packs/core/matrix/utils.ts | 16 ++--- .../app/src/vis-packs/core/raw/RawToolbar.tsx | 4 +- .../vis-packs/core/raw/RawVisContainer.tsx | 2 +- .../app/src/vis-packs/core/raw/config.tsx | 5 +- .../src/vis-packs/core/rgb/MappedRgbVis.tsx | 12 ++-- .../app/src/vis-packs/core/rgb/RgbToolbar.tsx | 2 +- .../vis-packs/core/rgb/RgbVisContainer.tsx | 2 +- .../app/src/vis-packs/core/rgb/config.tsx | 5 +- .../core/scalar/ScalarVisContainer.tsx | 2 +- .../app/src/vis-packs/core/scalar/utils.ts | 12 ++-- .../core/scatter/MappedScatterVis.tsx | 6 +- .../vis-packs/core/scatter/ScatterToolbar.tsx | 4 +- .../app/src/vis-packs/core/scatter/config.tsx | 16 +++-- .../core/surface/MappedSurfaceVis.tsx | 8 +-- .../vis-packs/core/surface/SurfaceToolbar.tsx | 4 +- .../core/surface/SurfaceVisContainer.tsx | 2 +- .../app/src/vis-packs/core/surface/config.tsx | 12 ++-- packages/app/src/vis-packs/core/utils.ts | 20 ++++-- .../src/vis-packs/core/visualizations.test.ts | 4 +- .../app/src/vis-packs/core/visualizations.ts | 6 +- packages/app/src/vis-packs/models.ts | 6 +- .../app/src/vis-packs/nexus/NxNoteFetcher.tsx | 10 +-- .../src/vis-packs/nexus/NxSignalPicker.tsx | 4 +- .../src/vis-packs/nexus/NxValuesFetcher.tsx | 6 +- .../containers/NxComplexImageContainer.tsx | 2 +- .../containers/NxComplexSpectrumContainer.tsx | 2 +- .../nexus/containers/NxImageContainer.tsx | 2 +- .../nexus/containers/NxNoteContainer.tsx | 2 +- .../nexus/containers/NxRgbContainer.tsx | 2 +- .../nexus/containers/NxScatterContainer.tsx | 2 +- .../nexus/containers/NxSpectrumContainer.tsx | 2 +- packages/app/src/vis-packs/nexus/guards.ts | 4 +- packages/app/src/vis-packs/nexus/hooks.ts | 12 ++-- packages/app/src/vis-packs/nexus/models.ts | 26 ++++---- packages/app/src/vis-packs/nexus/utils.ts | 24 +++---- .../app/src/vis-packs/nexus/visualizations.ts | 2 +- packages/app/src/visualizer/VisManager.tsx | 4 +- packages/app/src/visualizer/VisSelector.tsx | 2 +- packages/app/src/visualizer/hooks.ts | 2 +- packages/app/src/visualizer/utils.ts | 16 +++-- packages/h5wasm/src/H5WasmBufferProvider.tsx | 8 +-- .../h5wasm/src/H5WasmLocalFileProvider.tsx | 8 +-- packages/h5wasm/src/h5wasm-api.test.ts | 3 +- packages/h5wasm/src/h5wasm-api.ts | 26 ++++---- packages/h5wasm/src/remote.ts | 5 +- packages/h5wasm/src/utils.ts | 6 +- packages/h5wasm/src/worker-utils.ts | 32 +++++---- packages/h5wasm/src/worker.ts | 2 +- .../src/interactions/AxialSelectToZoom.tsx | 4 +- .../src/interactions/AxialSelectionTool.tsx | 14 ++-- .../src/interactions/DefaultInteractions.tsx | 22 +++---- .../src/interactions/InteractionsProvider.tsx | 11 +++- packages/lib/src/interactions/Pan.tsx | 9 ++- .../lib/src/interactions/SelectToZoom.tsx | 6 +- .../lib/src/interactions/SelectionTool.tsx | 23 +++---- packages/lib/src/interactions/XAxisZoom.tsx | 2 +- packages/lib/src/interactions/YAxisZoom.tsx | 2 +- packages/lib/src/interactions/Zoom.tsx | 2 +- packages/lib/src/interactions/box.ts | 4 +- packages/lib/src/interactions/hooks.ts | 16 ++--- packages/lib/src/interactions/interaction.ts | 5 +- packages/lib/src/interactions/models.ts | 2 +- .../lib/src/interactions/svg/SvgCircle.tsx | 4 +- .../lib/src/interactions/svg/SvgElement.tsx | 2 +- packages/lib/src/interactions/svg/SvgLine.tsx | 4 +- packages/lib/src/interactions/svg/SvgRect.tsx | 4 +- packages/lib/src/toolbar/MeasuredControl.tsx | 2 +- packages/lib/src/toolbar/OverflowMenu.tsx | 8 ++- packages/lib/src/toolbar/Separator.tsx | 2 +- packages/lib/src/toolbar/Toolbar.tsx | 6 +- packages/lib/src/toolbar/controls/Btn.tsx | 8 ++- .../ColorMapSelector/ColorMapGradient.tsx | 2 +- .../ColorMapSelector/ColorMapSelector.tsx | 2 +- .../controls/ColorMapSelector/groups.ts | 2 +- .../controls/DomainWidget/BoundEditor.tsx | 2 +- .../controls/DomainWidget/DomainControls.tsx | 8 +-- .../controls/DomainWidget/DomainSlider.tsx | 4 +- .../controls/DomainWidget/DomainWidget.tsx | 7 +- .../toolbar/controls/DomainWidget/Thumb.tsx | 7 +- .../toolbar/controls/DomainWidget/Track.tsx | 4 +- .../toolbar/controls/Histogram/ColorBar.tsx | 4 +- .../toolbar/controls/Histogram/Histogram.tsx | 6 +- .../src/toolbar/controls/Histogram/Marker.tsx | 5 +- .../toolbar/controls/Histogram/Markers.tsx | 4 +- .../src/toolbar/controls/InteractionHelp.tsx | 2 +- packages/lib/src/toolbar/controls/LinkBtn.tsx | 6 +- .../ScaleSelector/MdGraphicEqRotated.tsx | 2 +- .../controls/ScaleSelector/ScaleSelector.tsx | 2 +- .../controls/ScaleSelector/SqrtIcon.tsx | 2 +- .../src/toolbar/controls/Selector/Option.tsx | 5 +- .../toolbar/controls/Selector/Selector.tsx | 3 +- .../lib/src/toolbar/controls/ToggleBtn.tsx | 3 +- .../controls/ToggleGroup/ToggleGroup.tsx | 8 +-- .../controls/ToggleGroup/ToggleGroupBtn.tsx | 2 +- packages/lib/src/toolbar/controls/hooks.ts | 11 ++-- .../src/toolbar/floating/FloatingControl.tsx | 2 +- packages/lib/src/toolbar/models.ts | 2 +- packages/lib/src/toolbar/utils.ts | 5 +- packages/lib/src/vis/heatmap/ColorBar.tsx | 7 +- .../lib/src/vis/heatmap/HeatmapMaterial.tsx | 16 ++--- packages/lib/src/vis/heatmap/HeatmapMesh.tsx | 15 ++--- packages/lib/src/vis/heatmap/HeatmapVis.tsx | 28 ++++---- packages/lib/src/vis/heatmap/interpolators.ts | 2 +- packages/lib/src/vis/heatmap/models.ts | 2 +- packages/lib/src/vis/heatmap/utils.ts | 21 +++--- packages/lib/src/vis/hooks.ts | 22 +++++-- packages/lib/src/vis/line/DataCurve.tsx | 4 +- packages/lib/src/vis/line/ErrorBars.tsx | 2 +- packages/lib/src/vis/line/Glyphs.tsx | 4 +- packages/lib/src/vis/line/Line.tsx | 5 +- packages/lib/src/vis/line/LineVis.tsx | 23 ++++--- .../lib/src/vis/line/errorBarsGeometry.ts | 4 +- .../lib/src/vis/line/errorCapsGeometry.ts | 4 +- packages/lib/src/vis/line/glyphsGeometry.ts | 4 +- packages/lib/src/vis/line/lineGeometry.ts | 4 +- packages/lib/src/vis/line/models.ts | 4 +- packages/lib/src/vis/line/utils.ts | 2 +- packages/lib/src/vis/matrix/Cell.tsx | 2 +- packages/lib/src/vis/matrix/Grid.tsx | 2 +- packages/lib/src/vis/matrix/MatrixVis.tsx | 4 +- packages/lib/src/vis/matrix/StickyGrid.tsx | 8 ++- packages/lib/src/vis/matrix/context.tsx | 7 +- packages/lib/src/vis/models.ts | 20 +++--- packages/lib/src/vis/raw/RawImageVis.tsx | 2 +- packages/lib/src/vis/raw/RawVis.tsx | 2 +- packages/lib/src/vis/rgb/RgbMesh.tsx | 5 +- packages/lib/src/vis/rgb/RgbVis.tsx | 14 ++-- packages/lib/src/vis/rgb/utils.ts | 5 +- packages/lib/src/vis/scalar/ScalarVis.tsx | 2 +- packages/lib/src/vis/scaleGamma.ts | 14 ++-- .../lib/src/vis/scatter/ScatterPoints.tsx | 12 ++-- packages/lib/src/vis/scatter/ScatterVis.tsx | 27 ++++---- packages/lib/src/vis/scatter/models.ts | 2 +- .../src/vis/scatter/scatterPointsGeometry.ts | 6 +- packages/lib/src/vis/shared/Annotation.tsx | 2 +- packages/lib/src/vis/shared/Axis.tsx | 10 ++- packages/lib/src/vis/shared/AxisSystem.tsx | 2 +- packages/lib/src/vis/shared/DataToHtml.tsx | 6 +- packages/lib/src/vis/shared/Html.tsx | 6 +- packages/lib/src/vis/shared/Overlay.tsx | 2 +- packages/lib/src/vis/shared/R3FCanvas.tsx | 2 +- packages/lib/src/vis/shared/Tick.tsx | 2 +- packages/lib/src/vis/shared/TooltipMesh.tsx | 7 +- .../lib/src/vis/shared/TooltipOverlay.tsx | 2 +- .../lib/src/vis/shared/ViewportCenterer.tsx | 2 +- packages/lib/src/vis/shared/VisCanvas.tsx | 5 +- .../lib/src/vis/shared/VisCanvasProvider.tsx | 16 +++-- packages/lib/src/vis/shared/VisMesh.tsx | 4 +- packages/lib/src/vis/shared/h5webGeometry.ts | 3 +- packages/lib/src/vis/surface/SurfaceMesh.tsx | 12 ++-- packages/lib/src/vis/surface/SurfaceVis.tsx | 18 ++--- .../src/vis/surface/surfaceMeshGeometry.ts | 2 +- packages/lib/src/vis/tiles/Tile.tsx | 9 ++- .../lib/src/vis/tiles/TiledHeatmapMesh.tsx | 9 ++- packages/lib/src/vis/tiles/TiledLayer.tsx | 11 ++-- .../lib/src/vis/tiles/TiledTooltipMesh.tsx | 4 +- packages/lib/src/vis/tiles/api.ts | 6 +- packages/lib/src/vis/tiles/hooks.ts | 4 +- packages/lib/src/vis/tiles/models.ts | 8 +-- packages/lib/src/vis/tiles/utils.ts | 18 +++-- packages/lib/src/vis/utils.test.ts | 3 +- packages/lib/src/vis/utils.ts | 45 +++++++------ packages/shared/src/guards.ts | 61 ++++++++--------- packages/shared/src/hdf5-models.ts | 18 ++--- packages/shared/src/hdf5-utils.ts | 38 +++++------ packages/shared/src/mock-models.ts | 9 ++- packages/shared/src/mock-utils.ts | 38 ++++++----- packages/shared/src/mock-values.ts | 5 +- packages/shared/src/nexus-models.ts | 2 +- packages/shared/src/react-suspense-fetch.ts | 3 +- packages/shared/src/vis-models.ts | 4 +- packages/shared/src/vis-utils.ts | 35 +++++----- 299 files changed, 1151 insertions(+), 1095 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 464b24fda..0c024335b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -16,6 +16,7 @@ "typescript.tsdk": "node_modules/typescript/lib", "typescript.enablePromptUseWorkspaceTsdk": true, "typescript.preferences.importModuleSpecifier": "relative", + "typescript.preferences.preferTypeOnlyAutoImports": true, "typescript.preferences.autoImportSpecifierExcludeRegexes": [ "^(node:)?(console|util)$", "^three/.*$" diff --git a/apps/demo/src/h5wasm/DropZone.tsx b/apps/demo/src/h5wasm/DropZone.tsx index 4a04c4561..b6d01d7e3 100644 --- a/apps/demo/src/h5wasm/DropZone.tsx +++ b/apps/demo/src/h5wasm/DropZone.tsx @@ -1,9 +1,8 @@ -import type { PropsWithChildren } from 'react'; -import { useCallback } from 'react'; +import { type PropsWithChildren, useCallback } from 'react'; import { useDropzone } from 'react-dropzone'; import styles from './DropZone.module.css'; -import type { RemoteFile } from './models'; +import { type RemoteFile } from './models'; import UrlForm from './UrlForm'; const EXT = ['.h5', '.hdf5', '.hdf', '.nx', '.nx5', '.nexus', '.nxs', '.cxi']; diff --git a/apps/demo/src/h5wasm/H5WasmApp.tsx b/apps/demo/src/h5wasm/H5WasmApp.tsx index 2f627b2c7..26e5cd836 100644 --- a/apps/demo/src/h5wasm/H5WasmApp.tsx +++ b/apps/demo/src/h5wasm/H5WasmApp.tsx @@ -5,7 +5,7 @@ import { useSearch } from 'wouter'; import { getFeedbackURL } from '../utils'; import DropZone from './DropZone'; -import type { RemoteFile } from './models'; +import { type RemoteFile } from './models'; import { getPlugin } from './plugin-utils'; function H5WasmApp() { diff --git a/apps/demo/src/h5wasm/UrlForm.tsx b/apps/demo/src/h5wasm/UrlForm.tsx index 5e633ff67..621476b2e 100644 --- a/apps/demo/src/h5wasm/UrlForm.tsx +++ b/apps/demo/src/h5wasm/UrlForm.tsx @@ -1,10 +1,9 @@ import useAxios from 'axios-hooks'; -import type { FormEvent } from 'react'; -import { useCallback, useEffect } from 'react'; +import { type FormEvent, useCallback, useEffect } from 'react'; import { FiLoader } from 'react-icons/fi'; import { useLocation, useSearch } from 'wouter'; -import type { RemoteFile } from './models'; +import { type RemoteFile } from './models'; import styles from './UrlForm.module.css'; interface Props { diff --git a/apps/demo/src/utils.ts b/apps/demo/src/utils.ts index d6dcadefb..3d2f4d185 100644 --- a/apps/demo/src/utils.ts +++ b/apps/demo/src/utils.ts @@ -1,5 +1,4 @@ -import type { FeedbackContext } from '@h5web/app'; -import { getFeedbackMailto } from '@h5web/app'; +import { type FeedbackContext, getFeedbackMailto } from '@h5web/app'; export function getFeedbackURL(context: FeedbackContext): string { const email = import.meta.env.VITE_FEEDBACK_EMAIL as string; diff --git a/apps/storybook/.storybook/main.ts b/apps/storybook/.storybook/main.ts index 4a2a92315..41b338f92 100644 --- a/apps/storybook/.storybook/main.ts +++ b/apps/storybook/.storybook/main.ts @@ -1,4 +1,4 @@ -import type { StorybookConfig } from '@storybook/react-vite'; +import { type StorybookConfig } from '@storybook/react-vite'; import remarkGfm from 'remark-gfm'; const config: StorybookConfig = { diff --git a/apps/storybook/src/Annotation.stories.tsx b/apps/storybook/src/Annotation.stories.tsx index c60476e4b..03f157b77 100644 --- a/apps/storybook/src/Annotation.stories.tsx +++ b/apps/storybook/src/Annotation.stories.tsx @@ -1,13 +1,13 @@ -import type { CanvasEvent } from '@h5web/lib'; import { Annotation, + type CanvasEvent, DefaultInteractions, useCanvasEvent, VisCanvas, } from '@h5web/lib'; import { useRafState } from '@react-hookz/web'; -import type { Meta, StoryObj } from '@storybook/react'; -import type { ReactNode } from 'react'; +import { type Meta, type StoryObj } from '@storybook/react'; +import { type ReactNode } from 'react'; import FillHeight from './decorators/FillHeight'; import { formatCoord } from './utils'; diff --git a/apps/storybook/src/AxialSelectToZoom.stories.tsx b/apps/storybook/src/AxialSelectToZoom.stories.tsx index b9e87ea08..1d644bf6b 100644 --- a/apps/storybook/src/AxialSelectToZoom.stories.tsx +++ b/apps/storybook/src/AxialSelectToZoom.stories.tsx @@ -12,7 +12,7 @@ import { VisCanvas, Zoom, } from '@h5web/lib'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { range } from 'd3-array'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/AxialSelectionTool.stories.tsx b/apps/storybook/src/AxialSelectionTool.stories.tsx index d07078893..c9078f8dc 100644 --- a/apps/storybook/src/AxialSelectionTool.stories.tsx +++ b/apps/storybook/src/AxialSelectionTool.stories.tsx @@ -1,16 +1,16 @@ -import type { Selection } from '@h5web/lib'; import { AxialSelectionTool, Box, Pan, ResetZoomButton, + type Selection, SvgElement, SvgRect, VisCanvas, Zoom, } from '@h5web/lib'; import { useThrottledState } from '@react-hookz/web'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; import { getTitleForSelection } from './utils'; diff --git a/apps/storybook/src/ColorBar.stories.tsx b/apps/storybook/src/ColorBar.stories.tsx index a9d1ca4a8..68763e829 100644 --- a/apps/storybook/src/ColorBar.stories.tsx +++ b/apps/storybook/src/ColorBar.stories.tsx @@ -1,7 +1,6 @@ -import type { ColorBarProps } from '@h5web/lib'; -import { ColorBar, ScaleType } from '@h5web/lib'; +import { ColorBar, type ColorBarProps, ScaleType } from '@h5web/lib'; import { COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils'; -import type { Meta, StoryFn, StoryObj } from '@storybook/react'; +import { type Meta, type StoryFn, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/ColorBarHorizontal.stories.tsx b/apps/storybook/src/ColorBarHorizontal.stories.tsx index ec39e618c..c6955575b 100644 --- a/apps/storybook/src/ColorBarHorizontal.stories.tsx +++ b/apps/storybook/src/ColorBarHorizontal.stories.tsx @@ -1,7 +1,9 @@ -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; -import type { StoryProps } from './ColorBar.stories'; -import ColorBarStoriesMeta, { Default } from './ColorBar.stories'; +import ColorBarStoriesMeta, { + Default, + type StoryProps, +} from './ColorBar.stories'; const meta = { ...ColorBarStoriesMeta, diff --git a/apps/storybook/src/DataCurve.stories.tsx b/apps/storybook/src/DataCurve.stories.tsx index bcb123f81..f90fe64a1 100644 --- a/apps/storybook/src/DataCurve.stories.tsx +++ b/apps/storybook/src/DataCurve.stories.tsx @@ -9,7 +9,7 @@ import { VisCanvas, } from '@h5web/lib'; import { assertDefined } from '@h5web/shared/guards'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { range } from 'd3-array'; import { useState } from 'react'; diff --git a/apps/storybook/src/DefaultInteractions.stories.tsx b/apps/storybook/src/DefaultInteractions.stories.tsx index a8e31cc5c..1179541c7 100644 --- a/apps/storybook/src/DefaultInteractions.stories.tsx +++ b/apps/storybook/src/DefaultInteractions.stories.tsx @@ -9,7 +9,7 @@ import { useDomain, VisCanvas, } from '@h5web/lib'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/DomainControls.stories.tsx b/apps/storybook/src/DomainControls.stories.tsx index 847eeda83..11a662208 100644 --- a/apps/storybook/src/DomainControls.stories.tsx +++ b/apps/storybook/src/DomainControls.stories.tsx @@ -1,7 +1,7 @@ import { DomainControls } from '@h5web/lib'; -import type { Domain } from '@h5web/shared/vis-models'; +import { type Domain } from '@h5web/shared/vis-models'; import { useToggle } from '@react-hookz/web'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { useEffect, useState } from 'react'; const meta = { diff --git a/apps/storybook/src/DomainSlider.stories.tsx b/apps/storybook/src/DomainSlider.stories.tsx index 2b464e882..84f89cd1b 100644 --- a/apps/storybook/src/DomainSlider.stories.tsx +++ b/apps/storybook/src/DomainSlider.stories.tsx @@ -1,13 +1,13 @@ -import type { CustomDomain } from '@h5web/lib'; import { + type CustomDomain, DomainSlider, ScaleType, useSafeDomain, useVisDomain, } from '@h5web/lib'; -import type { Domain } from '@h5web/shared/vis-models'; +import { type Domain } from '@h5web/shared/vis-models'; import { COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { useEffect, useState } from 'react'; import styles from './DomainSlider.stories.module.css'; diff --git a/apps/storybook/src/DomainWidget.stories.tsx b/apps/storybook/src/DomainWidget.stories.tsx index f9abcec2d..83097098f 100644 --- a/apps/storybook/src/DomainWidget.stories.tsx +++ b/apps/storybook/src/DomainWidget.stories.tsx @@ -1,7 +1,6 @@ -import type { CustomDomain } from '@h5web/lib'; -import { DomainWidget, ScaleType } from '@h5web/lib'; +import { type CustomDomain, DomainWidget, ScaleType } from '@h5web/lib'; import { COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { useState } from 'react'; import DomainWidgetDecorator from './decorators/DomainWidgetDecorator'; diff --git a/apps/storybook/src/ErrorBars.stories.tsx b/apps/storybook/src/ErrorBars.stories.tsx index ee8d88133..ca343b4c0 100644 --- a/apps/storybook/src/ErrorBars.stories.tsx +++ b/apps/storybook/src/ErrorBars.stories.tsx @@ -7,7 +7,7 @@ import { } from '@h5web/lib'; import { assertDefined } from '@h5web/shared/guards'; import { ScaleType } from '@h5web/shared/vis-models'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { range } from 'd3-array'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/FloatingControl.stories.tsx b/apps/storybook/src/FloatingControl.stories.tsx index e08728526..27e1cef1a 100644 --- a/apps/storybook/src/FloatingControl.stories.tsx +++ b/apps/storybook/src/FloatingControl.stories.tsx @@ -1,6 +1,6 @@ import { DefaultInteractions, FloatingControl, VisCanvas } from '@h5web/lib'; import { useToggle } from '@react-hookz/web'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/Glyphs.stories.tsx b/apps/storybook/src/Glyphs.stories.tsx index 7d9ce70e0..812d2759b 100644 --- a/apps/storybook/src/Glyphs.stories.tsx +++ b/apps/storybook/src/Glyphs.stories.tsx @@ -8,7 +8,7 @@ import { } from '@h5web/lib'; import { assertDefined } from '@h5web/shared/guards'; import { ScaleType } from '@h5web/shared/vis-models'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { range } from 'd3-array'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/HeatmapMesh.stories.tsx b/apps/storybook/src/HeatmapMesh.stories.tsx index 5f0902c2f..01f62937b 100644 --- a/apps/storybook/src/HeatmapMesh.stories.tsx +++ b/apps/storybook/src/HeatmapMesh.stories.tsx @@ -1,6 +1,6 @@ -import type { Domain } from '@h5web/lib'; import { DefaultInteractions, + type Domain, getDomain, HeatmapMesh, mockValues, @@ -9,7 +9,7 @@ import { import { assertDefined } from '@h5web/shared/guards'; import { ScaleType } from '@h5web/shared/vis-models'; import { COLOR_SCALE_TYPES, toTypedNdArray } from '@h5web/shared/vis-utils'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { range } from 'd3-array'; import ndarray from 'ndarray'; import { LinearFilter, NearestFilter } from 'three'; diff --git a/apps/storybook/src/HeatmapVis.stories.tsx b/apps/storybook/src/HeatmapVis.stories.tsx index 204c37ab7..7359de3f3 100644 --- a/apps/storybook/src/HeatmapVis.stories.tsx +++ b/apps/storybook/src/HeatmapVis.stories.tsx @@ -7,7 +7,7 @@ import { } from '@h5web/lib'; import { assertDefined } from '@h5web/shared/guards'; import { COLOR_SCALE_TYPES, toTypedNdArray } from '@h5web/shared/vis-utils'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import ndarray from 'ndarray'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/HeatmapVisDisplay.stories.tsx b/apps/storybook/src/HeatmapVisDisplay.stories.tsx index 23517b4b6..4eebb51ae 100644 --- a/apps/storybook/src/HeatmapVisDisplay.stories.tsx +++ b/apps/storybook/src/HeatmapVisDisplay.stories.tsx @@ -5,7 +5,7 @@ import { mockValues, } from '@h5web/lib'; import { formatTooltipVal } from '@h5web/shared/vis-utils'; -import type { Meta, StoryFn, StoryObj } from '@storybook/react'; +import { type Meta, type StoryFn, type StoryObj } from '@storybook/react'; import HeatmapVisStoriesMeta from './HeatmapVis.stories'; diff --git a/apps/storybook/src/HeatmapVisScales.stories.tsx b/apps/storybook/src/HeatmapVisScales.stories.tsx index 07a3e279b..2d8e5eae6 100644 --- a/apps/storybook/src/HeatmapVisScales.stories.tsx +++ b/apps/storybook/src/HeatmapVisScales.stories.tsx @@ -1,6 +1,11 @@ -import type { HeatmapVisProps } from '@h5web/lib'; -import { getDomain, HeatmapVis, mockValues, ScaleType } from '@h5web/lib'; -import type { Meta, StoryObj } from '@storybook/react'; +import { + getDomain, + HeatmapVis, + type HeatmapVisProps, + mockValues, + ScaleType, +} from '@h5web/lib'; +import { type Meta, type StoryObj } from '@storybook/react'; import HeatmapVisStoriesMeta from './HeatmapVis.stories'; diff --git a/apps/storybook/src/Histogram.stories.tsx b/apps/storybook/src/Histogram.stories.tsx index f4d33b36a..3ad04c7f3 100644 --- a/apps/storybook/src/Histogram.stories.tsx +++ b/apps/storybook/src/Histogram.stories.tsx @@ -1,6 +1,6 @@ import { Histogram, ScaleType } from '@h5web/lib'; import { COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { useState } from 'react'; const meta = { diff --git a/apps/storybook/src/Html.stories.tsx b/apps/storybook/src/Html.stories.tsx index 4fddec1ec..8b32d1bfb 100644 --- a/apps/storybook/src/Html.stories.tsx +++ b/apps/storybook/src/Html.stories.tsx @@ -6,9 +6,8 @@ import { VisCanvas, } from '@h5web/lib'; import { useToggle } from '@react-hookz/web'; -import type { Meta, StoryObj } from '@storybook/react'; -import type { PropsWithChildren } from 'react'; -import { useState } from 'react'; +import { type Meta, type StoryObj } from '@storybook/react'; +import { type PropsWithChildren, useState } from 'react'; import { createPortal } from 'react-dom'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/Line.stories.tsx b/apps/storybook/src/Line.stories.tsx index 4689f66a2..fa1f0d426 100644 --- a/apps/storybook/src/Line.stories.tsx +++ b/apps/storybook/src/Line.stories.tsx @@ -7,7 +7,7 @@ import { } from '@h5web/lib'; import { assertDefined } from '@h5web/shared/guards'; import { ScaleType } from '@h5web/shared/vis-models'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { range } from 'd3-array'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/LineVis.stories.tsx b/apps/storybook/src/LineVis.stories.tsx index 8a2274da3..eebabe5b6 100644 --- a/apps/storybook/src/LineVis.stories.tsx +++ b/apps/storybook/src/LineVis.stories.tsx @@ -12,7 +12,7 @@ import { createArrayFromView, toTypedNdArray, } from '@h5web/shared/vis-utils'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import ndarray from 'ndarray'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/LineVisDisplay.stories.tsx b/apps/storybook/src/LineVisDisplay.stories.tsx index 8e905cca1..8464b59b8 100644 --- a/apps/storybook/src/LineVisDisplay.stories.tsx +++ b/apps/storybook/src/LineVisDisplay.stories.tsx @@ -6,7 +6,7 @@ import { mockValues, } from '@h5web/lib'; import { formatTooltipVal } from '@h5web/shared/vis-utils'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import LineVisStoriesMeta, { Default } from './LineVis.stories'; diff --git a/apps/storybook/src/LineVisScales.stories.tsx b/apps/storybook/src/LineVisScales.stories.tsx index bc9fd1c89..5ecf100fb 100644 --- a/apps/storybook/src/LineVisScales.stories.tsx +++ b/apps/storybook/src/LineVisScales.stories.tsx @@ -1,6 +1,5 @@ -import type { LineVis } from '@h5web/lib'; -import { mockValues, ScaleType } from '@h5web/lib'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type LineVis, mockValues, ScaleType } from '@h5web/lib'; +import { type Meta, type StoryObj } from '@storybook/react'; import LineVisStoriesMeta, { Default } from './LineVis.stories'; diff --git a/apps/storybook/src/MatrixVis.stories.tsx b/apps/storybook/src/MatrixVis.stories.tsx index 006a8ab31..07efd4eca 100644 --- a/apps/storybook/src/MatrixVis.stories.tsx +++ b/apps/storybook/src/MatrixVis.stories.tsx @@ -3,7 +3,7 @@ import { createComplexFormatter, toTypedNdArray, } from '@h5web/shared/vis-utils'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { format } from 'd3-format'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/Overlay.stories.tsx b/apps/storybook/src/Overlay.stories.tsx index 75e106d89..498a0a1a4 100644 --- a/apps/storybook/src/Overlay.stories.tsx +++ b/apps/storybook/src/Overlay.stories.tsx @@ -1,5 +1,5 @@ import { Overlay, Pan, ResetZoomButton, VisCanvas, Zoom } from '@h5web/lib'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/Pan.stories.tsx b/apps/storybook/src/Pan.stories.tsx index baec342c0..648592f74 100644 --- a/apps/storybook/src/Pan.stories.tsx +++ b/apps/storybook/src/Pan.stories.tsx @@ -1,5 +1,5 @@ import { MouseButton, Pan, ResetZoomButton, VisCanvas, Zoom } from '@h5web/lib'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/RgbVis.stories.tsx b/apps/storybook/src/RgbVis.stories.tsx index 4343570b7..96285147c 100644 --- a/apps/storybook/src/RgbVis.stories.tsx +++ b/apps/storybook/src/RgbVis.stories.tsx @@ -1,5 +1,5 @@ import { ImageType, mockValues, RgbVis } from '@h5web/lib'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/ScatterVis.stories.tsx b/apps/storybook/src/ScatterVis.stories.tsx index b9c1a4c28..6de6dc7ef 100644 --- a/apps/storybook/src/ScatterVis.stories.tsx +++ b/apps/storybook/src/ScatterVis.stories.tsx @@ -2,7 +2,7 @@ import { getDomain, INTERPOLATORS, ScatterVis } from '@h5web/lib'; import { assertDefined } from '@h5web/shared/guards'; import { ScaleType } from '@h5web/shared/vis-models'; import { COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import ndarray from 'ndarray'; import { useState } from 'react'; diff --git a/apps/storybook/src/SelectToZoom.stories.tsx b/apps/storybook/src/SelectToZoom.stories.tsx index 8bcb93f9b..2e29f3768 100644 --- a/apps/storybook/src/SelectToZoom.stories.tsx +++ b/apps/storybook/src/SelectToZoom.stories.tsx @@ -11,7 +11,7 @@ import { Zoom, } from '@h5web/lib'; import { ScaleType } from '@h5web/shared/vis-models'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/SelectionTool.stories.tsx b/apps/storybook/src/SelectionTool.stories.tsx index c5982db5f..c6e54e11e 100644 --- a/apps/storybook/src/SelectionTool.stories.tsx +++ b/apps/storybook/src/SelectionTool.stories.tsx @@ -1,9 +1,10 @@ -import type { Rect, Selection } from '@h5web/lib'; import { Box, DataToHtml, Pan, + type Rect, ResetZoomButton, + type Selection, SelectionTool, SvgElement, SvgLine, @@ -12,7 +13,7 @@ import { Zoom, } from '@h5web/lib'; import { useThrottledState } from '@react-hookz/web'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { useState } from 'react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/Stacking.stories.tsx b/apps/storybook/src/Stacking.stories.tsx index 46bd719b4..0411a5b03 100644 --- a/apps/storybook/src/Stacking.stories.tsx +++ b/apps/storybook/src/Stacking.stories.tsx @@ -8,7 +8,7 @@ import { TooltipMesh, VisCanvas, } from '@h5web/lib'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { Vector3 } from 'three'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/SurfaceVis.stories.tsx b/apps/storybook/src/SurfaceVis.stories.tsx index 894ae7b0b..fca80fc0c 100644 --- a/apps/storybook/src/SurfaceVis.stories.tsx +++ b/apps/storybook/src/SurfaceVis.stories.tsx @@ -2,7 +2,7 @@ import { getDomain, mockValues, SurfaceVis } from '@h5web/lib'; import { assertDefined } from '@h5web/shared/guards'; import { createArrayFromView } from '@h5web/shared/vis-utils'; import { OrbitControls } from '@react-three/drei'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/SvgElement.stories.tsx b/apps/storybook/src/SvgElement.stories.tsx index 9500d878b..eff3160d6 100644 --- a/apps/storybook/src/SvgElement.stories.tsx +++ b/apps/storybook/src/SvgElement.stories.tsx @@ -8,7 +8,7 @@ import { SvgRect, VisCanvas, } from '@h5web/lib'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { Vector3 } from 'three'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/TiledHeatmapMesh/LinearAxesGroup.tsx b/apps/storybook/src/TiledHeatmapMesh/LinearAxesGroup.tsx index 546a079dc..a4a53ad91 100644 --- a/apps/storybook/src/TiledHeatmapMesh/LinearAxesGroup.tsx +++ b/apps/storybook/src/TiledHeatmapMesh/LinearAxesGroup.tsx @@ -1,5 +1,5 @@ import { useVisCanvasContext } from '@h5web/lib'; -import type { PropsWithChildren } from 'react'; +import { type PropsWithChildren } from 'react'; interface Props {} diff --git a/apps/storybook/src/TiledHeatmapMesh/TiledHeatmapMesh.stories.tsx b/apps/storybook/src/TiledHeatmapMesh/TiledHeatmapMesh.stories.tsx index 3187df9cb..f42003883 100644 --- a/apps/storybook/src/TiledHeatmapMesh/TiledHeatmapMesh.stories.tsx +++ b/apps/storybook/src/TiledHeatmapMesh/TiledHeatmapMesh.stories.tsx @@ -1,13 +1,15 @@ -import type { AxisConfig, Domain, TiledHeatmapMeshProps } from '@h5web/lib'; import { + type AxisConfig, DefaultInteractions, + type Domain, TiledHeatmapMesh, + type TiledHeatmapMeshProps, TiledTooltipMesh, VisCanvas, } from '@h5web/lib'; import { ScaleType } from '@h5web/shared/vis-models'; import { COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import FillHeight from '../decorators/FillHeight'; import { CheckerboardTilesApi } from './checkerboard-api'; diff --git a/apps/storybook/src/TiledHeatmapMesh/checkerboard-api.ts b/apps/storybook/src/TiledHeatmapMesh/checkerboard-api.ts index 733af176d..73ff9da15 100644 --- a/apps/storybook/src/TiledHeatmapMesh/checkerboard-api.ts +++ b/apps/storybook/src/TiledHeatmapMesh/checkerboard-api.ts @@ -1,13 +1,10 @@ -import type { Size } from '@h5web/lib'; -import { getLayerSizes, TilesApi } from '@h5web/lib'; +import { getLayerSizes, type Size, TilesApi } from '@h5web/lib'; import { createFetchStore } from '@h5web/shared/react-suspense-fetch'; import greenlet from 'greenlet'; -import type { NdArray } from 'ndarray'; -import ndarray from 'ndarray'; -import type { Vector2 } from 'three'; -import { MathUtils } from 'three'; +import ndarray, { type NdArray } from 'ndarray'; +import { MathUtils, type Vector2 } from 'three'; -import type { TileParams } from './models'; +import { type TileParams } from './models'; import { areTilesEqual } from './utils'; const getCheckerboardArray = greenlet( diff --git a/apps/storybook/src/TiledHeatmapMesh/mandlebrot-api.ts b/apps/storybook/src/TiledHeatmapMesh/mandlebrot-api.ts index a764197e7..9c42f6491 100644 --- a/apps/storybook/src/TiledHeatmapMesh/mandlebrot-api.ts +++ b/apps/storybook/src/TiledHeatmapMesh/mandlebrot-api.ts @@ -1,14 +1,11 @@ -import type { Size } from '@h5web/lib'; -import { getLayerSizes, TilesApi } from '@h5web/lib'; +import { getLayerSizes, type Size, TilesApi } from '@h5web/lib'; import { createFetchStore } from '@h5web/shared/react-suspense-fetch'; -import type { Domain } from '@h5web/shared/vis-models'; +import { type Domain } from '@h5web/shared/vis-models'; import greenlet from 'greenlet'; -import type { NdArray } from 'ndarray'; -import ndarray from 'ndarray'; -import type { Vector2 } from 'three'; -import { MathUtils } from 'three'; +import ndarray, { type NdArray } from 'ndarray'; +import { MathUtils, type Vector2 } from 'three'; -import type { TileParams } from './models'; +import { type TileParams } from './models'; import { areTilesEqual } from './utils'; // https://en.wikipedia.org/wiki/Mandelbrot_set diff --git a/apps/storybook/src/TiledHeatmapMesh/models.ts b/apps/storybook/src/TiledHeatmapMesh/models.ts index fd23cd8db..dfa8332e1 100644 --- a/apps/storybook/src/TiledHeatmapMesh/models.ts +++ b/apps/storybook/src/TiledHeatmapMesh/models.ts @@ -1,4 +1,4 @@ -import type { Vector2 } from 'three'; +import { type Vector2 } from 'three'; export interface TileParams { layer: number; diff --git a/apps/storybook/src/TiledHeatmapMesh/utils.tsx b/apps/storybook/src/TiledHeatmapMesh/utils.tsx index 79079b7bd..8b4f1de23 100644 --- a/apps/storybook/src/TiledHeatmapMesh/utils.tsx +++ b/apps/storybook/src/TiledHeatmapMesh/utils.tsx @@ -1,6 +1,6 @@ import { formatTooltipVal } from '@h5web/shared/vis-utils'; -import type { TileParams } from './models'; +import { type TileParams } from './models'; export function renderTooltip(x: number, y: number, v: number) { return ( diff --git a/apps/storybook/src/Toolbar.stories.tsx b/apps/storybook/src/Toolbar.stories.tsx index 4b4f8530c..a32c58efe 100644 --- a/apps/storybook/src/Toolbar.stories.tsx +++ b/apps/storybook/src/Toolbar.stories.tsx @@ -1,7 +1,8 @@ -import type { ColorMap, CustomDomain } from '@h5web/lib'; import { Btn, + type ColorMap, ColorMapSelector, + type CustomDomain, DomainWidget, ScaleSelector, ScaleType, @@ -10,10 +11,10 @@ import { ToggleGroup, Toolbar, } from '@h5web/lib'; -import type { AxisScaleType } from '@h5web/shared/vis-models'; +import { type AxisScaleType } from '@h5web/shared/vis-models'; import { AXIS_SCALE_TYPES } from '@h5web/shared/vis-utils'; import { useToggle } from '@react-hookz/web'; -import type { Meta, StoryFn, StoryObj } from '@storybook/react'; +import { type Meta, type StoryFn, type StoryObj } from '@storybook/react'; import { useState } from 'react'; import { FiTarget } from 'react-icons/fi'; import { MdGridOn } from 'react-icons/md'; diff --git a/apps/storybook/src/TooltipMesh.stories.tsx b/apps/storybook/src/TooltipMesh.stories.tsx index 02a72aeee..f8ef9ffbf 100644 --- a/apps/storybook/src/TooltipMesh.stories.tsx +++ b/apps/storybook/src/TooltipMesh.stories.tsx @@ -1,6 +1,6 @@ import { DefaultInteractions, TooltipMesh, VisCanvas } from '@h5web/lib'; import { formatTooltipVal } from '@h5web/shared/vis-utils'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/VisCanvas.stories.tsx b/apps/storybook/src/VisCanvas.stories.tsx index cb0ef8650..2651b33e6 100644 --- a/apps/storybook/src/VisCanvas.stories.tsx +++ b/apps/storybook/src/VisCanvas.stories.tsx @@ -1,5 +1,5 @@ import { ScaleType, VisCanvas } from '@h5web/lib'; -import type { Meta, StoryFn, StoryObj } from '@storybook/react'; +import { type Meta, type StoryFn, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/XAxisZoom.stories.tsx b/apps/storybook/src/XAxisZoom.stories.tsx index fefb22397..5c4b637ef 100644 --- a/apps/storybook/src/XAxisZoom.stories.tsx +++ b/apps/storybook/src/XAxisZoom.stories.tsx @@ -1,5 +1,5 @@ import { Pan, ResetZoomButton, VisCanvas, XAxisZoom } from '@h5web/lib'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/YAxisZoom.stories.tsx b/apps/storybook/src/YAxisZoom.stories.tsx index c43285b58..2df8bd7ac 100644 --- a/apps/storybook/src/YAxisZoom.stories.tsx +++ b/apps/storybook/src/YAxisZoom.stories.tsx @@ -1,5 +1,5 @@ import { Pan, ResetZoomButton, VisCanvas, YAxisZoom } from '@h5web/lib'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/Zoom.stories.tsx b/apps/storybook/src/Zoom.stories.tsx index 0aa1eaf64..406411cbd 100644 --- a/apps/storybook/src/Zoom.stories.tsx +++ b/apps/storybook/src/Zoom.stories.tsx @@ -1,5 +1,5 @@ import { Pan, ResetZoomButton, VisCanvas, Zoom } from '@h5web/lib'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import FillHeight from './decorators/FillHeight'; diff --git a/apps/storybook/src/decorators/DomainWidgetDecorator.tsx b/apps/storybook/src/decorators/DomainWidgetDecorator.tsx index 836a3ee39..085ad830b 100644 --- a/apps/storybook/src/decorators/DomainWidgetDecorator.tsx +++ b/apps/storybook/src/decorators/DomainWidgetDecorator.tsx @@ -1,4 +1,4 @@ -import type { StoryFn } from '@storybook/react'; +import { type StoryFn } from '@storybook/react'; function DomainWidgetDecorator(Story: StoryFn) { return ( diff --git a/apps/storybook/src/decorators/FillHeight.tsx b/apps/storybook/src/decorators/FillHeight.tsx index 64f87728b..ef4964d82 100644 --- a/apps/storybook/src/decorators/FillHeight.tsx +++ b/apps/storybook/src/decorators/FillHeight.tsx @@ -1,4 +1,4 @@ -import type { StoryContext, StoryFn } from '@storybook/react'; +import { type StoryContext, type StoryFn } from '@storybook/react'; function FillHeight(Story: StoryFn, context: StoryContext) { const { viewMode } = context; diff --git a/apps/storybook/src/useDrag.stories.tsx b/apps/storybook/src/useDrag.stories.tsx index e81af5891..6b75dde4c 100644 --- a/apps/storybook/src/useDrag.stories.tsx +++ b/apps/storybook/src/useDrag.stories.tsx @@ -6,7 +6,7 @@ import { useDrag, VisCanvas, } from '@h5web/lib'; -import type { Meta, StoryObj } from '@storybook/react'; +import { type Meta, type StoryObj } from '@storybook/react'; import { useState } from 'react'; import { Vector3 } from 'three'; diff --git a/apps/storybook/src/utils.ts b/apps/storybook/src/utils.ts index 11ac67c14..d828927b6 100644 --- a/apps/storybook/src/utils.ts +++ b/apps/storybook/src/utils.ts @@ -1,4 +1,4 @@ -import type { CustomDomain, Domain, Rect } from '@h5web/lib'; +import { type CustomDomain, type Domain, type Rect } from '@h5web/lib'; import { format } from 'd3-format'; export const formatCoord = format('.2f'); diff --git a/eslint.config.base.js b/eslint.config.base.js index 2365c148c..7005281f7 100644 --- a/eslint.config.base.js +++ b/eslint.config.base.js @@ -515,7 +515,7 @@ export function createConfig(opts = {}) { rules: { 'import/consistent-type-specifier-style': [ 'warn', - 'prefer-top-level', // TODO switch to `prefer-inline`: `import { type Foo } from 'foo';` + 'prefer-inline', // `import { type Foo } from 'foo';` ], 'import/default': 'error', // 'import/dynamic-import-chunkname': 'off', // bundler-specific @@ -539,7 +539,7 @@ export function createConfig(opts = {}) { 'warn', { considerQueryString: true, // e.g. `?worker` - 'prefer-inline': false, // TODO switch to `true` for compatibility with TypeScript inline `type` imports + 'prefer-inline': true, // for compatibility with TypeScript's inline `type` imports }, ], // 'import/no-dynamic-require': 'off', // CommonJS diff --git a/packages/app/src/App.tsx b/packages/app/src/App.tsx index 9c0fe1f1f..ae7b9e2a6 100644 --- a/packages/app/src/App.tsx +++ b/packages/app/src/App.tsx @@ -7,7 +7,7 @@ import { ReflexContainer, ReflexElement, ReflexSplitter } from 'react-reflex'; import styles from './App.module.css'; import BreadcrumbsBar from './breadcrumbs/BreadcrumbsBar'; -import type { FeedbackContext } from './breadcrumbs/models'; +import { type FeedbackContext } from './breadcrumbs/models'; import { DimMappingProvider } from './dimension-mapper/store'; import EntityLoader from './EntityLoader'; import ErrorFallback from './ErrorFallback'; diff --git a/packages/app/src/ErrorFallback.tsx b/packages/app/src/ErrorFallback.tsx index 6bd431e2b..854e3654b 100644 --- a/packages/app/src/ErrorFallback.tsx +++ b/packages/app/src/ErrorFallback.tsx @@ -1,4 +1,4 @@ -import type { FallbackProps } from 'react-error-boundary'; +import { type FallbackProps } from 'react-error-boundary'; import styles from './App.module.css'; import { CANCELLED_ERROR_MSG } from './providers/utils'; diff --git a/packages/app/src/VisConfigProvider.tsx b/packages/app/src/VisConfigProvider.tsx index 7b4377253..1b6b0dae5 100644 --- a/packages/app/src/VisConfigProvider.tsx +++ b/packages/app/src/VisConfigProvider.tsx @@ -1,8 +1,8 @@ import { isDefined } from '@h5web/shared/guards'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { CORE_VIS } from './vis-packs/core/visualizations'; -import type { VisDef } from './vis-packs/models'; +import { type VisDef } from './vis-packs/models'; import { NEXUS_VIS } from './vis-packs/nexus/visualizations'; const coreProviders = Object.values(CORE_VIS) diff --git a/packages/app/src/breadcrumbs/BreadcrumbsBar.tsx b/packages/app/src/breadcrumbs/BreadcrumbsBar.tsx index c8d591e50..db65752b5 100644 --- a/packages/app/src/breadcrumbs/BreadcrumbsBar.tsx +++ b/packages/app/src/breadcrumbs/BreadcrumbsBar.tsx @@ -10,7 +10,7 @@ import { import { useDataContext } from '../providers/DataProvider'; import Breadcrumbs from './Breadcrumbs'; import styles from './BreadcrumbsBar.module.css'; -import type { FeedbackContext } from './models'; +import { type FeedbackContext } from './models'; interface Props { path: string; diff --git a/packages/app/src/breadcrumbs/utils.ts b/packages/app/src/breadcrumbs/utils.ts index 31b00d895..82eec7945 100644 --- a/packages/app/src/breadcrumbs/utils.ts +++ b/packages/app/src/breadcrumbs/utils.ts @@ -1,4 +1,4 @@ -import type { FeedbackContext } from './models'; +import { type FeedbackContext } from './models'; export function getFeedbackMailto( context: FeedbackContext, diff --git a/packages/app/src/dimension-mapper/AxisMapper.tsx b/packages/app/src/dimension-mapper/AxisMapper.tsx index ed60a8afc..95d767197 100644 --- a/packages/app/src/dimension-mapper/AxisMapper.tsx +++ b/packages/app/src/dimension-mapper/AxisMapper.tsx @@ -1,9 +1,9 @@ import { ToggleGroup } from '@h5web/lib'; -import type { AxisMapping } from '@h5web/shared/nexus-models'; -import type { Axis } from '@h5web/shared/vis-models'; +import { type AxisMapping } from '@h5web/shared/nexus-models'; +import { type Axis } from '@h5web/shared/vis-models'; import styles from './DimensionMapper.module.css'; -import type { DimensionMapping } from './models'; +import { type DimensionMapping } from './models'; interface Props { axis: Axis; diff --git a/packages/app/src/dimension-mapper/DimensionMapper.tsx b/packages/app/src/dimension-mapper/DimensionMapper.tsx index 3668f328a..e740afde6 100644 --- a/packages/app/src/dimension-mapper/DimensionMapper.tsx +++ b/packages/app/src/dimension-mapper/DimensionMapper.tsx @@ -1,8 +1,8 @@ -import type { AxisMapping } from '@h5web/shared/nexus-models'; +import { type AxisMapping } from '@h5web/shared/nexus-models'; import AxisMapper from './AxisMapper'; import styles from './DimensionMapper.module.css'; -import type { DimensionMapping } from './models'; +import { type DimensionMapping } from './models'; import SlicingSlider from './SlicingSlider'; interface Props { diff --git a/packages/app/src/dimension-mapper/models.ts b/packages/app/src/dimension-mapper/models.ts index 27f59832b..1d2ffe245 100644 --- a/packages/app/src/dimension-mapper/models.ts +++ b/packages/app/src/dimension-mapper/models.ts @@ -1,3 +1,3 @@ -import type { Axis } from '@h5web/shared/vis-models'; +import { type Axis } from '@h5web/shared/vis-models'; export type DimensionMapping = (number | Axis)[]; diff --git a/packages/app/src/dimension-mapper/store.tsx b/packages/app/src/dimension-mapper/store.tsx index 02ad5bc65..daf66bac9 100644 --- a/packages/app/src/dimension-mapper/store.tsx +++ b/packages/app/src/dimension-mapper/store.tsx @@ -1,11 +1,15 @@ -import type { ArrayShape } from '@h5web/shared/hdf5-models'; -import type { PropsWithChildren } from 'react'; -import { createContext, useContext, useEffect, useState } from 'react'; -import type { StoreApi } from 'zustand'; -import { createStore, useStore } from 'zustand'; +import { type ArrayShape } from '@h5web/shared/hdf5-models'; +import { + createContext, + type PropsWithChildren, + useContext, + useEffect, + useState, +} from 'react'; +import { createStore, type StoreApi, useStore } from 'zustand'; import { areSameDims } from '../vis-packs/nexus/utils'; -import type { DimensionMapping } from './models'; +import { type DimensionMapping } from './models'; interface DimMappingState { dims: ArrayShape; diff --git a/packages/app/src/dimension-mapper/utils.ts b/packages/app/src/dimension-mapper/utils.ts index 12d461df4..f343e6713 100644 --- a/packages/app/src/dimension-mapper/utils.ts +++ b/packages/app/src/dimension-mapper/utils.ts @@ -1,7 +1,6 @@ -import type { Axis } from '@h5web/shared/vis-models'; +import { type Axis } from '@h5web/shared/vis-models'; import { useSyncedRef, useUnmountEffect } from '@react-hookz/web'; -import type { DependencyList } from 'react'; -import { useEffect, useMemo, useRef } from 'react'; +import { type DependencyList, useEffect, useMemo, useRef } from 'react'; export function isAxis(elem: number | Axis): elem is Axis { return typeof elem !== 'number'; diff --git a/packages/app/src/explorer/EntityItem.tsx b/packages/app/src/explorer/EntityItem.tsx index e6e2ae4bc..44a99e61b 100644 --- a/packages/app/src/explorer/EntityItem.tsx +++ b/packages/app/src/explorer/EntityItem.tsx @@ -1,8 +1,9 @@ import { isGroup } from '@h5web/shared/guards'; -import type { ChildEntity } from '@h5web/shared/hdf5-models'; +import { type ChildEntity } from '@h5web/shared/hdf5-models'; import { useToggle } from '@react-hookz/web'; -import type { CSSProperties, KeyboardEvent } from 'react'; import { + type CSSProperties, + type KeyboardEvent, Suspense, useCallback, useEffect, diff --git a/packages/app/src/explorer/Icon.tsx b/packages/app/src/explorer/Icon.tsx index 22c4341ff..6696047d4 100644 --- a/packages/app/src/explorer/Icon.tsx +++ b/packages/app/src/explorer/Icon.tsx @@ -1,6 +1,5 @@ import { isGroup } from '@h5web/shared/guards'; -import type { ChildEntity } from '@h5web/shared/hdf5-models'; -import { EntityKind } from '@h5web/shared/hdf5-models'; +import { type ChildEntity, EntityKind } from '@h5web/shared/hdf5-models'; import { FiChevronDown, FiChevronRight, diff --git a/packages/app/src/explorer/NxBadge.tsx b/packages/app/src/explorer/NxBadge.tsx index f0f40071e..a4504feb8 100644 --- a/packages/app/src/explorer/NxBadge.tsx +++ b/packages/app/src/explorer/NxBadge.tsx @@ -1,4 +1,4 @@ -import type { ChildEntity } from '@h5web/shared/hdf5-models'; +import { type ChildEntity } from '@h5web/shared/hdf5-models'; import { useDataContext } from '../providers/DataProvider'; import styles from './Explorer.module.css'; diff --git a/packages/app/src/explorer/utils.ts b/packages/app/src/explorer/utils.ts index f8ea2911f..66470f0d1 100644 --- a/packages/app/src/explorer/utils.ts +++ b/packages/app/src/explorer/utils.ts @@ -1,8 +1,8 @@ import { assertStr, isGroup } from '@h5web/shared/guards'; -import type { ChildEntity } from '@h5web/shared/hdf5-models'; -import type { KeyboardEvent } from 'react'; +import { type ChildEntity } from '@h5web/shared/hdf5-models'; +import { type KeyboardEvent } from 'react'; -import type { AttrValuesStore } from '../providers/models'; +import { type AttrValuesStore } from '../providers/models'; import { hasAttribute } from '../utils'; const SUPPORTED_NX_CLASSES = new Set(['NXdata', 'NXentry', 'NXprocess']); diff --git a/packages/app/src/index.ts b/packages/app/src/index.ts index d01b0c98f..339954491 100644 --- a/packages/app/src/index.ts +++ b/packages/app/src/index.ts @@ -1,4 +1,4 @@ -import type { DataProviderApi } from './providers/api'; +import { type DataProviderApi } from './providers/api'; export { default as App } from './App'; diff --git a/packages/app/src/metadata-viewer/AttrErrorFallback.tsx b/packages/app/src/metadata-viewer/AttrErrorFallback.tsx index 34e789ba1..a732725cf 100644 --- a/packages/app/src/metadata-viewer/AttrErrorFallback.tsx +++ b/packages/app/src/metadata-viewer/AttrErrorFallback.tsx @@ -1,4 +1,4 @@ -import type { FallbackProps } from 'react-error-boundary'; +import { type FallbackProps } from 'react-error-boundary'; import styles from './MetadataViewer.module.css'; diff --git a/packages/app/src/metadata-viewer/AttributesInfo.tsx b/packages/app/src/metadata-viewer/AttributesInfo.tsx index f42ef0e9d..406e32385 100644 --- a/packages/app/src/metadata-viewer/AttributesInfo.tsx +++ b/packages/app/src/metadata-viewer/AttributesInfo.tsx @@ -1,5 +1,5 @@ import { isComplexValue } from '@h5web/shared/guards'; -import type { ProvidedEntity } from '@h5web/shared/hdf5-models'; +import { type ProvidedEntity } from '@h5web/shared/hdf5-models'; import { useDataContext } from '../providers/DataProvider'; import AttributeLink from './AttributeLink'; diff --git a/packages/app/src/metadata-viewer/EntityInfo.tsx b/packages/app/src/metadata-viewer/EntityInfo.tsx index bc93958b8..e2e87b92b 100644 --- a/packages/app/src/metadata-viewer/EntityInfo.tsx +++ b/packages/app/src/metadata-viewer/EntityInfo.tsx @@ -1,5 +1,5 @@ import { isDataset, isDatatype } from '@h5web/shared/guards'; -import type { ProvidedEntity } from '@h5web/shared/hdf5-models'; +import { type ProvidedEntity } from '@h5web/shared/hdf5-models'; import { useDataContext } from '../providers/DataProvider'; import styles from './MetadataViewer.module.css'; diff --git a/packages/app/src/metadata-viewer/FiltersInfo.tsx b/packages/app/src/metadata-viewer/FiltersInfo.tsx index 92cee4efa..9a14ed5ad 100644 --- a/packages/app/src/metadata-viewer/FiltersInfo.tsx +++ b/packages/app/src/metadata-viewer/FiltersInfo.tsx @@ -1,4 +1,4 @@ -import type { Filter } from '@h5web/shared/hdf5-models'; +import { type Filter } from '@h5web/shared/hdf5-models'; interface Props { filters: Filter[]; diff --git a/packages/app/src/metadata-viewer/MetadataTable.tsx b/packages/app/src/metadata-viewer/MetadataTable.tsx index c114cc796..88ea53191 100644 --- a/packages/app/src/metadata-viewer/MetadataTable.tsx +++ b/packages/app/src/metadata-viewer/MetadataTable.tsx @@ -1,4 +1,4 @@ -import type { PropsWithChildren } from 'react'; +import { type PropsWithChildren } from 'react'; import styles from './MetadataViewer.module.css'; diff --git a/packages/app/src/metadata-viewer/RawInspector.tsx b/packages/app/src/metadata-viewer/RawInspector.tsx index 0f371025c..459ed0d08 100644 --- a/packages/app/src/metadata-viewer/RawInspector.tsx +++ b/packages/app/src/metadata-viewer/RawInspector.tsx @@ -1,4 +1,4 @@ -import type { ProvidedEntity } from '@h5web/shared/hdf5-models'; +import { type ProvidedEntity } from '@h5web/shared/hdf5-models'; import styles from './RawInspector.module.css'; diff --git a/packages/app/src/metadata-viewer/utils.ts b/packages/app/src/metadata-viewer/utils.ts index 329d8c867..88c40541d 100644 --- a/packages/app/src/metadata-viewer/utils.ts +++ b/packages/app/src/metadata-viewer/utils.ts @@ -3,13 +3,13 @@ import { isNumericType, isScalarShape, } from '@h5web/shared/guards'; -import type { - ComplexArray, - DType, - H5WebComplex, - Shape, +import { + type ComplexArray, + type DType, + DTypeClass, + type H5WebComplex, + type Shape, } from '@h5web/shared/hdf5-models'; -import { DTypeClass } from '@h5web/shared/hdf5-models'; import { formatScalarComplex } from '@h5web/shared/vis-utils'; export function renderShape(shape: Shape): string { diff --git a/packages/app/src/providers/DataProvider.tsx b/packages/app/src/providers/DataProvider.tsx index 3f48e8ebe..4975b5e69 100644 --- a/packages/app/src/providers/DataProvider.tsx +++ b/packages/app/src/providers/DataProvider.tsx @@ -1,17 +1,21 @@ import { isGroup } from '@h5web/shared/guards'; -import type { Entity } from '@h5web/shared/hdf5-models'; +import { type Entity } from '@h5web/shared/hdf5-models'; import { getNameFromPath } from '@h5web/shared/hdf5-utils'; import { createFetchStore } from '@h5web/shared/react-suspense-fetch'; -import type { PropsWithChildren } from 'react'; -import { createContext, useContext, useMemo } from 'react'; +import { + createContext, + type PropsWithChildren, + useContext, + useMemo, +} from 'react'; import { hasAttribute } from '../utils'; -import type { DataProviderApi } from './api'; -import type { - AttrName, - AttrValuesStore, - EntitiesStore, - ValuesStore, +import { type DataProviderApi } from './api'; +import { + type AttrName, + type AttrValuesStore, + type EntitiesStore, + type ValuesStore, } from './models'; export interface DataContextValue { diff --git a/packages/app/src/providers/api.ts b/packages/app/src/providers/api.ts index 07d43c9a5..622b14122 100644 --- a/packages/app/src/providers/api.ts +++ b/packages/app/src/providers/api.ts @@ -1,15 +1,19 @@ /* eslint-disable @typescript-eslint/member-ordering */ -import type { - ArrayShape, - AttributeValues, - Dataset, - Entity, - ProvidedEntity, - Value, +import { + type ArrayShape, + type AttributeValues, + type Dataset, + type Entity, + type ProvidedEntity, + type Value, } from '@h5web/shared/hdf5-models'; -import type { OnProgress } from '@h5web/shared/react-suspense-fetch'; +import { type OnProgress } from '@h5web/shared/react-suspense-fetch'; -import type { ExportFormat, ExportURL, ValuesStoreParams } from './models'; +import { + type ExportFormat, + type ExportURL, + type ValuesStoreParams, +} from './models'; export abstract class DataProviderApi { public constructor(public readonly filepath: string) {} diff --git a/packages/app/src/providers/h5grove/H5GroveProvider.tsx b/packages/app/src/providers/h5grove/H5GroveProvider.tsx index 49b25fb47..bfed5bb20 100644 --- a/packages/app/src/providers/h5grove/H5GroveProvider.tsx +++ b/packages/app/src/providers/h5grove/H5GroveProvider.tsx @@ -1,8 +1,7 @@ -import type { AxiosRequestConfig } from 'axios'; -import type { PropsWithChildren } from 'react'; -import { useMemo } from 'react'; +import { type AxiosRequestConfig } from 'axios'; +import { type PropsWithChildren, useMemo } from 'react'; -import type { DataProviderApi } from '../api'; +import { type DataProviderApi } from '../api'; import DataProvider from '../DataProvider'; import { H5GroveApi } from './h5grove-api'; diff --git a/packages/app/src/providers/h5grove/h5grove-api.ts b/packages/app/src/providers/h5grove/h5grove-api.ts index 712261b3f..ce268dc63 100644 --- a/packages/app/src/providers/h5grove/h5grove-api.ts +++ b/packages/app/src/providers/h5grove/h5grove-api.ts @@ -1,25 +1,32 @@ import { hasNumericType, hasScalarShape } from '@h5web/shared/guards'; -import type { - ArrayShape, - AttributeValues, - Dataset, - Entity, - ProvidedEntity, - Value, +import { + type ArrayShape, + type AttributeValues, + type Dataset, + DTypeClass, + type Entity, + type ProvidedEntity, + type Value, } from '@h5web/shared/hdf5-models'; -import { DTypeClass } from '@h5web/shared/hdf5-models'; -import type { OnProgress } from '@h5web/shared/react-suspense-fetch'; -import type { AxiosInstance, AxiosRequestConfig } from 'axios'; -import axios, { AxiosError } from 'axios'; +import { type OnProgress } from '@h5web/shared/react-suspense-fetch'; +import axios, { + AxiosError, + type AxiosInstance, + type AxiosRequestConfig, +} from 'axios'; import { DataProviderApi } from '../api'; -import type { ExportFormat, ExportURL, ValuesStoreParams } from '../models'; +import { + type ExportFormat, + type ExportURL, + type ValuesStoreParams, +} from '../models'; import { createAxiosProgressHandler } from '../utils'; -import type { - H5GroveAttrValuesResponse, - H5GroveDataResponse, - H5GroveEntityResponse, - H5GrovePathsResponse, +import { + type H5GroveAttrValuesResponse, + type H5GroveDataResponse, + type H5GroveEntityResponse, + type H5GrovePathsResponse, } from './models'; import { h5groveTypedArrayFromDType, diff --git a/packages/app/src/providers/h5grove/models.ts b/packages/app/src/providers/h5grove/models.ts index 1afd4710d..e9892b1e6 100644 --- a/packages/app/src/providers/h5grove/models.ts +++ b/packages/app/src/providers/h5grove/models.ts @@ -1,4 +1,4 @@ -import type { AttributeValues, Filter } from '@h5web/shared/hdf5-models'; +import { type AttributeValues, type Filter } from '@h5web/shared/hdf5-models'; export type H5GroveEntityResponse = H5GroveEntity; export type H5GroveDataResponse = unknown; diff --git a/packages/app/src/providers/h5grove/utils.test.ts b/packages/app/src/providers/h5grove/utils.test.ts index 26e1adca6..ce30416e0 100644 --- a/packages/app/src/providers/h5grove/utils.test.ts +++ b/packages/app/src/providers/h5grove/utils.test.ts @@ -17,7 +17,7 @@ import { } from '@h5web/shared/hdf5-utils'; import { describe, expect, it } from 'vitest'; -import type { H5GroveType } from './models'; +import { type H5GroveType } from './models'; import { parseDType } from './utils'; describe('parseDType', () => { diff --git a/packages/app/src/providers/h5grove/utils.ts b/packages/app/src/providers/h5grove/utils.ts index 1cda96061..773d673c0 100644 --- a/packages/app/src/providers/h5grove/utils.ts +++ b/packages/app/src/providers/h5grove/utils.ts @@ -1,13 +1,14 @@ import { isNumericType } from '@h5web/shared/guards'; import { H5T_CLASS } from '@h5web/shared/h5t'; -import type { - Attribute, - ChildEntity, - DType, - Group, - ProvidedEntity, +import { + type Attribute, + type ChildEntity, + type DType, + DTypeClass, + EntityKind, + type Group, + type ProvidedEntity, } from '@h5web/shared/hdf5-models'; -import { DTypeClass, EntityKind } from '@h5web/shared/hdf5-models'; import { arrayType, bitfieldType, @@ -22,14 +23,14 @@ import { timeType, unknownType, } from '@h5web/shared/hdf5-utils'; -import type { TypedArrayConstructor } from '@h5web/shared/vis-models'; +import { type TypedArrayConstructor } from '@h5web/shared/vis-models'; import { typedArrayFromDType } from '../utils'; -import type { - H5GroveAttribute, - H5GroveEntity, - H5GroveErrorResponse, - H5GroveType, +import { + type H5GroveAttribute, + type H5GroveEntity, + type H5GroveErrorResponse, + type H5GroveType, } from './models'; export function parseEntity( diff --git a/packages/app/src/providers/hsds/HsdsProvider.tsx b/packages/app/src/providers/hsds/HsdsProvider.tsx index 3e7692188..af101a2ad 100644 --- a/packages/app/src/providers/hsds/HsdsProvider.tsx +++ b/packages/app/src/providers/hsds/HsdsProvider.tsx @@ -1,7 +1,6 @@ -import type { PropsWithChildren } from 'react'; -import { useMemo } from 'react'; +import { type PropsWithChildren, useMemo } from 'react'; -import type { DataProviderApi } from '../api'; +import { type DataProviderApi } from '../api'; import DataProvider from '../DataProvider'; import { HsdsApi } from './hsds-api'; diff --git a/packages/app/src/providers/hsds/hsds-api.ts b/packages/app/src/providers/hsds/hsds-api.ts index e4971e2b7..72a8d947d 100644 --- a/packages/app/src/providers/hsds/hsds-api.ts +++ b/packages/app/src/providers/hsds/hsds-api.ts @@ -3,42 +3,45 @@ import { assertGroup, hasArrayShape, } from '@h5web/shared/guards'; -import type { - ArrayShape, - AttributeValues, - ChildEntity, - Dataset, - Datatype, - Entity, - Group, - GroupWithChildren, - ProvidedEntity, - Value, +import { + type ArrayShape, + type AttributeValues, + type ChildEntity, + type Dataset, + type Datatype, + type Entity, + EntityKind, + type Group, + type GroupWithChildren, + type ProvidedEntity, + type Value, } from '@h5web/shared/hdf5-models'; -import { EntityKind } from '@h5web/shared/hdf5-models'; import { buildEntityPath, getChildEntity } from '@h5web/shared/hdf5-utils'; -import type { OnProgress } from '@h5web/shared/react-suspense-fetch'; -import type { AxiosInstance } from 'axios'; -import axios, { AxiosError } from 'axios'; +import { type OnProgress } from '@h5web/shared/react-suspense-fetch'; +import axios, { AxiosError, type AxiosInstance } from 'axios'; import { DataProviderApi } from '../api'; -import type { ExportFormat, ExportURL, ValuesStoreParams } from '../models'; +import { + type ExportFormat, + type ExportURL, + type ValuesStoreParams, +} from '../models'; import { createAxiosProgressHandler } from '../utils'; -import type { - BaseHsdsEntity, - HsdsAttribute, - HsdsAttributesResponse, - HsdsAttributeWithValueResponse, - HsdsCollection, - HsdsDatasetResponse, - HsdsDatatypeResponse, - HsdsEntity, - HsdsGroupResponse, - HsdsId, - HsdsLink, - HsdsLinksResponse, - HsdsRootResponse, - HsdsValueResponse, +import { + type BaseHsdsEntity, + type HsdsAttribute, + type HsdsAttributesResponse, + type HsdsAttributeWithValueResponse, + type HsdsCollection, + type HsdsDatasetResponse, + type HsdsDatatypeResponse, + type HsdsEntity, + type HsdsGroupResponse, + type HsdsId, + type HsdsLink, + type HsdsLinksResponse, + type HsdsRootResponse, + type HsdsValueResponse, } from './models'; import { assertHsdsDataset, diff --git a/packages/app/src/providers/hsds/models.ts b/packages/app/src/providers/hsds/models.ts index 0c04bff9f..f477766e0 100644 --- a/packages/app/src/providers/hsds/models.ts +++ b/packages/app/src/providers/hsds/models.ts @@ -1,5 +1,5 @@ -import type { H5T_CSET, H5T_STR } from '@h5web/shared/h5t'; -import type { Entity } from '@h5web/shared/hdf5-models'; +import { type H5T_CSET, type H5T_STR } from '@h5web/shared/h5t'; +import { type Entity } from '@h5web/shared/hdf5-models'; /* --------------------- */ /* ----- RESPONSES ----- */ diff --git a/packages/app/src/providers/hsds/utils.test.ts b/packages/app/src/providers/hsds/utils.test.ts index 088a9167d..446ab060e 100644 --- a/packages/app/src/providers/hsds/utils.test.ts +++ b/packages/app/src/providers/hsds/utils.test.ts @@ -1,5 +1,5 @@ import { H5T_CSET, H5T_ORDER, H5T_STR } from '@h5web/shared/h5t'; -import type { DType } from '@h5web/shared/hdf5-models'; +import { type DType } from '@h5web/shared/hdf5-models'; import { arrayType, boolType, @@ -13,12 +13,12 @@ import { } from '@h5web/shared/hdf5-utils'; import { describe, expect, it } from 'vitest'; -import type { - HsdsArrayType, - HsdsCompoundType, - HsdsEnumType, - HsdsStringType, - HsdsType, +import { + type HsdsArrayType, + type HsdsCompoundType, + type HsdsEnumType, + type HsdsStringType, + type HsdsType, } from './models'; import { convertHsdsType } from './utils'; diff --git a/packages/app/src/providers/hsds/utils.ts b/packages/app/src/providers/hsds/utils.ts index 5a68d1a5d..61b09be1c 100644 --- a/packages/app/src/providers/hsds/utils.ts +++ b/packages/app/src/providers/hsds/utils.ts @@ -1,21 +1,21 @@ import { assertArray, isGroup } from '@h5web/shared/guards'; import { H5T_CSET, H5T_ORDER, H5T_STR } from '@h5web/shared/h5t'; -import type { - ArrayShape, - Attribute, - BooleanType, - ComplexType, - CompoundType, - Dataset, - DType, - Entity, - EnumType, - Group, - NumericType, - ScalarShape, - Shape, +import { + type ArrayShape, + type Attribute, + type BooleanType, + type ComplexType, + type CompoundType, + type Dataset, + type DType, + DTypeClass, + type Entity, + type EnumType, + type Group, + type NumericType, + type ScalarShape, + type Shape, } from '@h5web/shared/hdf5-models'; -import { DTypeClass } from '@h5web/shared/hdf5-models'; import { compoundType, cplxType, @@ -27,14 +27,14 @@ import { unknownType, } from '@h5web/shared/hdf5-utils'; -import type { - HsdsAttribute, - HsdsCompoundType, - HsdsEntity, - HsdsEnumType, - HsdsNumericType, - HsdsShape, - HsdsType, +import { + type HsdsAttribute, + type HsdsCompoundType, + type HsdsEntity, + type HsdsEnumType, + type HsdsNumericType, + type HsdsShape, + type HsdsType, } from './models'; export function isHsdsGroup(entity: HsdsEntity): entity is HsdsEntity { diff --git a/packages/app/src/providers/mock/MockProvider.tsx b/packages/app/src/providers/mock/MockProvider.tsx index 96e73798d..519cfc619 100644 --- a/packages/app/src/providers/mock/MockProvider.tsx +++ b/packages/app/src/providers/mock/MockProvider.tsx @@ -1,7 +1,6 @@ -import type { PropsWithChildren } from 'react'; -import { useMemo } from 'react'; +import { type PropsWithChildren, useMemo } from 'react'; -import type { DataProviderApi } from '../api'; +import { type DataProviderApi } from '../api'; import DataProvider from '../DataProvider'; import { MockApi } from './mock-api'; diff --git a/packages/app/src/providers/mock/mock-api.ts b/packages/app/src/providers/mock/mock-api.ts index e191a7106..9a46b353e 100644 --- a/packages/app/src/providers/mock/mock-api.ts +++ b/packages/app/src/providers/mock/mock-api.ts @@ -3,15 +3,15 @@ import { assertDefined, hasNumericType, } from '@h5web/shared/guards'; -import type { - ArrayShape, - AttributeValues, - Dataset, - Entity, - GroupWithChildren, - NumArrayDataset, - ProvidedEntity, - Value, +import { + type ArrayShape, + type AttributeValues, + type Dataset, + type Entity, + type GroupWithChildren, + type NumArrayDataset, + type ProvidedEntity, + type Value, } from '@h5web/shared/hdf5-models'; import { assertMockAttribute, @@ -19,7 +19,11 @@ import { } from '@h5web/shared/mock-utils'; import { DataProviderApi } from '../api'; -import type { ExportFormat, ExportURL, ValuesStoreParams } from '../models'; +import { + type ExportFormat, + type ExportURL, + type ValuesStoreParams, +} from '../models'; import { makeMockFile } from './mock-file'; import { cancellableDelay, diff --git a/packages/app/src/providers/mock/mock-file.ts b/packages/app/src/providers/mock/mock-file.ts index cbdf8c77f..903cff783 100644 --- a/packages/app/src/providers/mock/mock-file.ts +++ b/packages/app/src/providers/mock/mock-file.ts @@ -1,5 +1,5 @@ import { H5T_CSET, H5T_STR } from '@h5web/shared/h5t'; -import type { GroupWithChildren } from '@h5web/shared/hdf5-models'; +import { type GroupWithChildren } from '@h5web/shared/hdf5-models'; import { arrayType, boolType, diff --git a/packages/app/src/providers/mock/utils.ts b/packages/app/src/providers/mock/utils.ts index 6969259ef..02fa7af79 100644 --- a/packages/app/src/providers/mock/utils.ts +++ b/packages/app/src/providers/mock/utils.ts @@ -4,14 +4,14 @@ import { assertGroupWithChildren, isGroup, } from '@h5web/shared/guards'; -import type { - ArrayShape, - Dataset, - DType, - GroupWithChildren, - Primitive, - ProvidedEntity, - ScalarShape, +import { + type ArrayShape, + type Dataset, + type DType, + type GroupWithChildren, + type Primitive, + type ProvidedEntity, + type ScalarShape, } from '@h5web/shared/hdf5-models'; import { getChildEntity } from '@h5web/shared/hdf5-utils'; import ndarray from 'ndarray'; diff --git a/packages/app/src/providers/models.ts b/packages/app/src/providers/models.ts index 69ad77dfc..145c89225 100644 --- a/packages/app/src/providers/models.ts +++ b/packages/app/src/providers/models.ts @@ -1,14 +1,14 @@ -import type { - ArrayShape, - AttributeValues, - Dataset, - Entity, - ProvidedEntity, - ScalarShape, +import { + type ArrayShape, + type AttributeValues, + type Dataset, + type Entity, + type ProvidedEntity, + type ScalarShape, } from '@h5web/shared/hdf5-models'; -import type { FetchStore } from '@h5web/shared/react-suspense-fetch'; +import { type FetchStore } from '@h5web/shared/react-suspense-fetch'; -import type { NxAttribute } from '../vis-packs/nexus/models'; +import { type NxAttribute } from '../vis-packs/nexus/models'; export type EntitiesStore = FetchStore; export type ValuesStore = FetchStore; diff --git a/packages/app/src/providers/utils.ts b/packages/app/src/providers/utils.ts index d8beb0b9e..07107188b 100644 --- a/packages/app/src/providers/utils.ts +++ b/packages/app/src/providers/utils.ts @@ -1,17 +1,16 @@ import { isBoolType, isEnumType, isNumericType } from '@h5web/shared/guards'; -import type { - ArrayShape, - Dataset, - DType, - ScalarShape, +import { + type ArrayShape, + type Dataset, + type DType, + DTypeClass, + type ScalarShape, } from '@h5web/shared/hdf5-models'; -import { DTypeClass } from '@h5web/shared/hdf5-models'; -import type { OnProgress } from '@h5web/shared/react-suspense-fetch'; -import type { TypedArrayConstructor } from '@h5web/shared/vis-models'; -import type { AxiosProgressEvent } from 'axios'; -import { isAxiosError } from 'axios'; +import { type OnProgress } from '@h5web/shared/react-suspense-fetch'; +import { type TypedArrayConstructor } from '@h5web/shared/vis-models'; +import { type AxiosProgressEvent, isAxiosError } from 'axios'; -import type { DataProviderApi } from './api'; +import { type DataProviderApi } from './api'; export const CANCELLED_ERROR_MSG = 'Request cancelled'; diff --git a/packages/app/src/setupTests.ts b/packages/app/src/setupTests.ts index 633694218..73714476c 100644 --- a/packages/app/src/setupTests.ts +++ b/packages/app/src/setupTests.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-empty-function */ import '@testing-library/jest-dom/vitest'; -import type { Measures } from '@react-hookz/web'; +import { type Measures } from '@react-hookz/web'; import { cleanup as rtlCleanup } from '@testing-library/react'; import { useState } from 'react'; import { afterEach, vi } from 'vitest'; diff --git a/packages/app/src/test-utils.tsx b/packages/app/src/test-utils.tsx index 774514b40..1236d91dc 100644 --- a/packages/app/src/test-utils.tsx +++ b/packages/app/src/test-utils.tsx @@ -1,13 +1,16 @@ import { assertDefined, assertNonNull } from '@h5web/shared/guards'; -import type { RenderResult } from '@testing-library/react'; -import { render, screen, within } from '@testing-library/react'; +import { + render, + type RenderResult, + screen, + within, +} from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import type { MockInstance } from 'vitest'; -import { expect, vi } from 'vitest'; +import { expect, type MockInstance, vi } from 'vitest'; import App from './App'; import MockProvider from './providers/mock/MockProvider'; -import type { Vis } from './vis-packs/core/visualizations'; +import { type Vis } from './vis-packs/core/visualizations'; interface RenderAppResult extends RenderResult { user: ReturnType; diff --git a/packages/app/src/utils.ts b/packages/app/src/utils.ts index b31905ce1..941c9767f 100644 --- a/packages/app/src/utils.ts +++ b/packages/app/src/utils.ts @@ -1,6 +1,6 @@ -import type { Entity } from '@h5web/shared/hdf5-models'; +import { type Entity } from '@h5web/shared/hdf5-models'; -import type { AttrName } from './providers/models'; +import { type AttrName } from './providers/models'; export function hasAttribute(entity: Entity, attributeName: AttrName): boolean { return entity.attributes.some((attr) => attr.name === attributeName); diff --git a/packages/app/src/vis-packs/VisBoundary.tsx b/packages/app/src/vis-packs/VisBoundary.tsx index 2d5db9084..7b2e2b471 100644 --- a/packages/app/src/vis-packs/VisBoundary.tsx +++ b/packages/app/src/vis-packs/VisBoundary.tsx @@ -1,5 +1,4 @@ -import type { ReactNode } from 'react'; -import { Suspense } from 'react'; +import { type ReactNode, Suspense } from 'react'; import { ErrorBoundary } from 'react-error-boundary'; import ErrorFallback from '../ErrorFallback'; diff --git a/packages/app/src/vis-packs/core/ValueFetcher.tsx b/packages/app/src/vis-packs/core/ValueFetcher.tsx index 36ce79217..670b6a681 100644 --- a/packages/app/src/vis-packs/core/ValueFetcher.tsx +++ b/packages/app/src/vis-packs/core/ValueFetcher.tsx @@ -1,10 +1,10 @@ -import type { - ArrayShape, - Dataset, - ScalarShape, - Value, +import { + type ArrayShape, + type Dataset, + type ScalarShape, + type Value, } from '@h5web/shared/hdf5-models'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { useDatasetValue } from './hooks'; diff --git a/packages/app/src/vis-packs/core/complex/ComplexLineToolbar.tsx b/packages/app/src/vis-packs/core/complex/ComplexLineToolbar.tsx index 0a198a40d..72a2e511d 100644 --- a/packages/app/src/vis-packs/core/complex/ComplexLineToolbar.tsx +++ b/packages/app/src/vis-packs/core/complex/ComplexLineToolbar.tsx @@ -8,14 +8,13 @@ import { ToggleGroup, Toolbar, } from '@h5web/lib'; -import type { Domain } from '@h5web/shared/vis-models'; -import { ComplexVisType } from '@h5web/shared/vis-models'; +import { ComplexVisType, type Domain } from '@h5web/shared/vis-models'; import { AXIS_SCALE_TYPES } from '@h5web/shared/vis-utils'; import { MdGridOn } from 'react-icons/md'; -import type { LineConfig } from '../line/config'; +import { type LineConfig } from '../line/config'; import { INTERACTIONS_WITH_AXIAL_ZOOM } from '../utils'; -import type { ComplexLineConfig } from './lineConfig'; +import { type ComplexLineConfig } from './lineConfig'; interface Props { dataDomain: Domain; diff --git a/packages/app/src/vis-packs/core/complex/ComplexLineVisContainer.tsx b/packages/app/src/vis-packs/core/complex/ComplexLineVisContainer.tsx index 6eaeeaaaa..ff0b4acaf 100644 --- a/packages/app/src/vis-packs/core/complex/ComplexLineVisContainer.tsx +++ b/packages/app/src/vis-packs/core/complex/ComplexLineVisContainer.tsx @@ -6,7 +6,7 @@ import { import DimensionMapper from '../../../dimension-mapper/DimensionMapper'; import { useDimMappingState } from '../../../dimension-mapper/store'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { useValuesInCache } from '../hooks'; import { useLineConfig } from '../line/config'; diff --git a/packages/app/src/vis-packs/core/complex/ComplexToolbar.tsx b/packages/app/src/vis-packs/core/complex/ComplexToolbar.tsx index e5fbf74b8..04e08839f 100644 --- a/packages/app/src/vis-packs/core/complex/ComplexToolbar.tsx +++ b/packages/app/src/vis-packs/core/complex/ComplexToolbar.tsx @@ -1,7 +1,7 @@ -import type { Domain } from '@h5web/lib'; import { ColorMapSelector, ComplexVisTypeSelector, + type Domain, DomainWidget, ScaleSelector, Separator, @@ -13,9 +13,9 @@ import { ComplexVisType } from '@h5web/shared/vis-models'; import { COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils'; import { MdAspectRatio, MdGridOn } from 'react-icons/md'; -import type { HeatmapConfig } from '../heatmap/config'; +import { type HeatmapConfig } from '../heatmap/config'; import { getImageInteractions } from '../utils'; -import type { ComplexConfig } from './config'; +import { type ComplexConfig } from './config'; interface Props { dataDomain: Domain; diff --git a/packages/app/src/vis-packs/core/complex/ComplexVisContainer.tsx b/packages/app/src/vis-packs/core/complex/ComplexVisContainer.tsx index 61daaeb81..845d421dd 100644 --- a/packages/app/src/vis-packs/core/complex/ComplexVisContainer.tsx +++ b/packages/app/src/vis-packs/core/complex/ComplexVisContainer.tsx @@ -7,7 +7,7 @@ import { import DimensionMapper from '../../../dimension-mapper/DimensionMapper'; import { useDimMappingState } from '../../../dimension-mapper/store'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { useHeatmapConfig } from '../heatmap/config'; import { useValuesInCache } from '../hooks'; diff --git a/packages/app/src/vis-packs/core/complex/MappedComplexLineVis.tsx b/packages/app/src/vis-packs/core/complex/MappedComplexLineVis.tsx index 30a2842c5..38528b60d 100644 --- a/packages/app/src/vis-packs/core/complex/MappedComplexLineVis.tsx +++ b/packages/app/src/vis-packs/core/complex/MappedComplexLineVis.tsx @@ -6,18 +6,18 @@ import { useSafeDomain, useVisDomain, } from '@h5web/lib'; -import type { ArrayValue, ComplexType } from '@h5web/shared/hdf5-models'; -import type { AxisMapping } from '@h5web/shared/nexus-models'; -import type { NumArray } from '@h5web/shared/vis-models'; +import { type ArrayValue, type ComplexType } from '@h5web/shared/hdf5-models'; +import { type AxisMapping } from '@h5web/shared/nexus-models'; +import { type NumArray } from '@h5web/shared/vis-models'; import { createPortal } from 'react-dom'; -import type { DimensionMapping } from '../../../dimension-mapper/models'; +import { type DimensionMapping } from '../../../dimension-mapper/models'; import visualizerStyles from '../../../visualizer/Visualizer.module.css'; -import type { LineConfig } from '../line/config'; +import { type LineConfig } from '../line/config'; import { DEFAULT_DOMAIN } from '../utils'; import ComplexLineToolbar from './ComplexLineToolbar'; import { useMappedComplexArrays } from './hooks'; -import type { ComplexLineConfig } from './lineConfig'; +import { type ComplexLineConfig } from './lineConfig'; import { COMPLEX_VIS_TYPE_LABELS } from './utils'; interface Props { diff --git a/packages/app/src/vis-packs/core/complex/MappedComplexVis.tsx b/packages/app/src/vis-packs/core/complex/MappedComplexVis.tsx index db54e96cd..32d386d21 100644 --- a/packages/app/src/vis-packs/core/complex/MappedComplexVis.tsx +++ b/packages/app/src/vis-packs/core/complex/MappedComplexVis.tsx @@ -4,16 +4,15 @@ import { useValidDomainForScale, useVisDomain, } from '@h5web/lib'; -import type { H5WebComplex } from '@h5web/shared/hdf5-models'; -import type { AxisMapping } from '@h5web/shared/nexus-models'; -import type { NumArray } from '@h5web/shared/vis-models'; -import { ComplexVisType } from '@h5web/shared/vis-models'; +import { type H5WebComplex } from '@h5web/shared/hdf5-models'; +import { type AxisMapping } from '@h5web/shared/nexus-models'; +import { ComplexVisType, type NumArray } from '@h5web/shared/vis-models'; import { useMemo } from 'react'; import { createPortal } from 'react-dom'; -import type { DimensionMapping } from '../../../dimension-mapper/models'; +import { type DimensionMapping } from '../../../dimension-mapper/models'; import visualizerStyles from '../../../visualizer/Visualizer.module.css'; -import type { HeatmapConfig } from '../heatmap/config'; +import { type HeatmapConfig } from '../heatmap/config'; import { useBaseArray, useMappedArray, @@ -21,7 +20,7 @@ import { } from '../hooks'; import { DEFAULT_DOMAIN } from '../utils'; import ComplexToolbar from './ComplexToolbar'; -import type { ComplexConfig } from './config'; +import { type ComplexConfig } from './config'; import { COMPLEX_VIS_TYPE_LABELS, getPhaseAmplitudeValues } from './utils'; interface Props { diff --git a/packages/app/src/vis-packs/core/complex/config.tsx b/packages/app/src/vis-packs/core/complex/config.tsx index 7631a1c42..3aa8825fb 100644 --- a/packages/app/src/vis-packs/core/complex/config.tsx +++ b/packages/app/src/vis-packs/core/complex/config.tsx @@ -1,10 +1,9 @@ import { ComplexVisType } from '@h5web/shared/vis-models'; import { createContext, useContext, useState } from 'react'; -import type { StoreApi } from 'zustand'; -import { createStore, useStore } from 'zustand'; +import { createStore, type StoreApi, useStore } from 'zustand'; import { persist } from 'zustand/middleware'; -import type { ConfigProviderProps } from '../../models'; +import { type ConfigProviderProps } from '../../models'; export interface ComplexConfig { visType: ComplexVisType; diff --git a/packages/app/src/vis-packs/core/complex/hooks.ts b/packages/app/src/vis-packs/core/complex/hooks.ts index eb430f672..cff7a17e9 100644 --- a/packages/app/src/vis-packs/core/complex/hooks.ts +++ b/packages/app/src/vis-packs/core/complex/hooks.ts @@ -1,10 +1,10 @@ import { ComplexVisType } from '@h5web/lib'; -import type { H5WebComplex } from '@h5web/shared/hdf5-models'; -import type { ComplexLineVisType } from '@h5web/shared/vis-models'; -import type { NdArray } from 'ndarray'; +import { type H5WebComplex } from '@h5web/shared/hdf5-models'; +import { type ComplexLineVisType } from '@h5web/shared/vis-models'; +import { type NdArray } from 'ndarray'; import { useMemo } from 'react'; -import type { DimensionMapping } from '../../../dimension-mapper/models'; +import { type DimensionMapping } from '../../../dimension-mapper/models'; import { useSlicedDimsAndMapping } from '../hooks'; import { applyMapping, getBaseArray } from '../utils'; import { getPhaseAmplitudeValues } from './utils'; diff --git a/packages/app/src/vis-packs/core/complex/lineConfig.tsx b/packages/app/src/vis-packs/core/complex/lineConfig.tsx index 4d413b5ca..e8c62ec27 100644 --- a/packages/app/src/vis-packs/core/complex/lineConfig.tsx +++ b/packages/app/src/vis-packs/core/complex/lineConfig.tsx @@ -1,11 +1,12 @@ -import type { ComplexLineVisType } from '@h5web/shared/vis-models'; -import { ComplexVisType } from '@h5web/shared/vis-models'; +import { + type ComplexLineVisType, + ComplexVisType, +} from '@h5web/shared/vis-models'; import { createContext, useContext, useState } from 'react'; -import type { StoreApi } from 'zustand'; -import { createStore, useStore } from 'zustand'; +import { createStore, type StoreApi, useStore } from 'zustand'; import { persist } from 'zustand/middleware'; -import type { ConfigProviderProps } from '../../models'; +import { type ConfigProviderProps } from '../../models'; export interface ComplexLineConfig { visType: ComplexLineVisType; diff --git a/packages/app/src/vis-packs/core/complex/utils.ts b/packages/app/src/vis-packs/core/complex/utils.ts index f6e4a4d40..cae2551b9 100644 --- a/packages/app/src/vis-packs/core/complex/utils.ts +++ b/packages/app/src/vis-packs/core/complex/utils.ts @@ -1,6 +1,5 @@ -import type { H5WebComplex } from '@h5web/shared/hdf5-models'; -import type { Bounds } from '@h5web/shared/vis-models'; -import { ComplexVisType } from '@h5web/shared/vis-models'; +import { type H5WebComplex } from '@h5web/shared/hdf5-models'; +import { type Bounds, ComplexVisType } from '@h5web/shared/vis-models'; import { getNewBounds } from '@h5web/shared/vis-utils'; const INITIAL_BOUNDS: Bounds = { diff --git a/packages/app/src/vis-packs/core/compound/CompoundVisContainer.tsx b/packages/app/src/vis-packs/core/compound/CompoundVisContainer.tsx index e5b65efe5..4fe1093be 100644 --- a/packages/app/src/vis-packs/core/compound/CompoundVisContainer.tsx +++ b/packages/app/src/vis-packs/core/compound/CompoundVisContainer.tsx @@ -7,7 +7,7 @@ import { import DimensionMapper from '../../../dimension-mapper/DimensionMapper'; import { useDimMappingState } from '../../../dimension-mapper/store'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { useValuesInCache } from '../hooks'; import { useMatrixConfig } from '../matrix/config'; diff --git a/packages/app/src/vis-packs/core/compound/MappedCompoundVis.tsx b/packages/app/src/vis-packs/core/compound/MappedCompoundVis.tsx index 12b9e67ae..369570b5b 100644 --- a/packages/app/src/vis-packs/core/compound/MappedCompoundVis.tsx +++ b/packages/app/src/vis-packs/core/compound/MappedCompoundVis.tsx @@ -1,19 +1,19 @@ import { MatrixVis } from '@h5web/lib'; -import type { - ArrayShape, - CompoundType, - Dataset, - PrintableType, - ScalarShape, - Value, +import { + type ArrayShape, + type CompoundType, + type Dataset, + type PrintableType, + type ScalarShape, + type Value, } from '@h5web/shared/hdf5-models'; import { createPortal } from 'react-dom'; -import type { DimensionMapping } from '../../../dimension-mapper/models'; +import { type DimensionMapping } from '../../../dimension-mapper/models'; import { useDataContext } from '../../../providers/DataProvider'; import visualizerStyles from '../../../visualizer/Visualizer.module.css'; import { useMappedArray, useSlicedDimsAndMapping } from '../hooks'; -import type { MatrixVisConfig } from '../matrix/config'; +import { type MatrixVisConfig } from '../matrix/config'; import MatrixToolbar from '../matrix/MatrixToolbar'; import { getCellWidth, getFormatter } from '../matrix/utils'; import { getSliceSelection } from '../utils'; diff --git a/packages/app/src/vis-packs/core/heatmap/HeatmapToolbar.tsx b/packages/app/src/vis-packs/core/heatmap/HeatmapToolbar.tsx index 2ffdf58f0..ef6ed4f97 100644 --- a/packages/app/src/vis-packs/core/heatmap/HeatmapToolbar.tsx +++ b/packages/app/src/vis-packs/core/heatmap/HeatmapToolbar.tsx @@ -1,6 +1,6 @@ -import type { Domain } from '@h5web/lib'; import { ColorMapSelector, + type Domain, DomainWidget, ExportMenu, ScaleSelector, @@ -17,9 +17,9 @@ import { MdSwapVert, } from 'react-icons/md'; -import type { ExportFormat, ExportURL } from '../../../providers/models'; +import { type ExportFormat, type ExportURL } from '../../../providers/models'; import { getImageInteractions } from '../utils'; -import type { HeatmapConfig } from './config'; +import { type HeatmapConfig } from './config'; const EXPORT_FORMATS: ExportFormat[] = ['tiff', 'npy']; diff --git a/packages/app/src/vis-packs/core/heatmap/HeatmapVisContainer.tsx b/packages/app/src/vis-packs/core/heatmap/HeatmapVisContainer.tsx index ad38e9db6..0dda37743 100644 --- a/packages/app/src/vis-packs/core/heatmap/HeatmapVisContainer.tsx +++ b/packages/app/src/vis-packs/core/heatmap/HeatmapVisContainer.tsx @@ -7,7 +7,7 @@ import { import DimensionMapper from '../../../dimension-mapper/DimensionMapper'; import { useDimMappingState } from '../../../dimension-mapper/store'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { useIgnoreFillValue, useValuesInCache } from '../hooks'; import { getSliceSelection } from '../utils'; diff --git a/packages/app/src/vis-packs/core/heatmap/MappedHeatmapVis.tsx b/packages/app/src/vis-packs/core/heatmap/MappedHeatmapVis.tsx index e5b169060..de66ee686 100644 --- a/packages/app/src/vis-packs/core/heatmap/MappedHeatmapVis.tsx +++ b/packages/app/src/vis-packs/core/heatmap/MappedHeatmapVis.tsx @@ -1,15 +1,15 @@ import { HeatmapVis, useDomain, useSafeDomain, useVisDomain } from '@h5web/lib'; -import type { - ArrayShape, - ArrayValue, - Dataset, - NumericLikeType, +import { + type ArrayShape, + type ArrayValue, + type Dataset, + type NumericLikeType, } from '@h5web/shared/hdf5-models'; -import type { AxisMapping } from '@h5web/shared/nexus-models'; -import type { NumArray } from '@h5web/shared/vis-models'; +import { type AxisMapping } from '@h5web/shared/nexus-models'; +import { type NumArray } from '@h5web/shared/vis-models'; import { createPortal } from 'react-dom'; -import type { DimensionMapping } from '../../../dimension-mapper/models'; +import { type DimensionMapping } from '../../../dimension-mapper/models'; import { useDataContext } from '../../../providers/DataProvider'; import visualizerStyles from '../../../visualizer/Visualizer.module.css'; import { @@ -18,7 +18,7 @@ import { useToNumArray, } from '../hooks'; import { DEFAULT_DOMAIN, formatNumLikeType, getSliceSelection } from '../utils'; -import type { HeatmapConfig } from './config'; +import { type HeatmapConfig } from './config'; import HeatmapToolbar from './HeatmapToolbar'; interface Props { diff --git a/packages/app/src/vis-packs/core/heatmap/config.tsx b/packages/app/src/vis-packs/core/heatmap/config.tsx index b9426b901..25f14eef2 100644 --- a/packages/app/src/vis-packs/core/heatmap/config.tsx +++ b/packages/app/src/vis-packs/core/heatmap/config.tsx @@ -1,15 +1,13 @@ -import type { CustomDomain } from '@h5web/lib'; +import { type CustomDomain } from '@h5web/lib'; import { isDefined } from '@h5web/shared/guards'; -import type { ColorScaleType } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; +import { type ColorScaleType, ScaleType } from '@h5web/shared/vis-models'; import { useMap } from '@react-hookz/web'; import { createContext, useContext, useState } from 'react'; -import type { StoreApi } from 'zustand'; -import { createStore, useStore } from 'zustand'; +import { createStore, type StoreApi, useStore } from 'zustand'; import { persist } from 'zustand/middleware'; -import type { ConfigProviderProps } from '../../models'; -import type { ColorMap } from './models'; +import { type ConfigProviderProps } from '../../models'; +import { type ColorMap } from './models'; export interface HeatmapConfig { customDomain: CustomDomain; diff --git a/packages/app/src/vis-packs/core/heatmap/models.ts b/packages/app/src/vis-packs/core/heatmap/models.ts index 65d57c326..21942324d 100644 --- a/packages/app/src/vis-packs/core/heatmap/models.ts +++ b/packages/app/src/vis-packs/core/heatmap/models.ts @@ -1,3 +1,3 @@ -import type { INTERPOLATORS } from '@h5web/lib'; +import { type INTERPOLATORS } from '@h5web/lib'; export type ColorMap = keyof typeof INTERPOLATORS; diff --git a/packages/app/src/vis-packs/core/hooks.ts b/packages/app/src/vis-packs/core/hooks.ts index 1149b1443..1cd2a34f7 100644 --- a/packages/app/src/vis-packs/core/hooks.ts +++ b/packages/app/src/vis-packs/core/hooks.ts @@ -1,17 +1,17 @@ import { createMemo } from '@h5web/shared/createMemo'; import { assertDatasetValue, isDefined } from '@h5web/shared/guards'; -import type { - ArrayShape, - Dataset, - ScalarShape, - Value, +import { + type ArrayShape, + type Dataset, + type ScalarShape, + type Value, } from '@h5web/shared/hdf5-models'; -import type { NumArray } from '@h5web/shared/vis-models'; +import { type NumArray } from '@h5web/shared/vis-models'; import { castArray } from '@h5web/shared/vis-utils'; -import type { NdArray, TypedArray } from 'ndarray'; +import { type NdArray, type TypedArray } from 'ndarray'; import { useMemo } from 'react'; -import type { DimensionMapping } from '../../dimension-mapper/models'; +import { type DimensionMapping } from '../../dimension-mapper/models'; import { isAxis } from '../../dimension-mapper/utils'; import { useDataContext } from '../../providers/DataProvider'; import { typedArrayFromDType } from '../../providers/utils'; diff --git a/packages/app/src/vis-packs/core/line/LineToolbar.tsx b/packages/app/src/vis-packs/core/line/LineToolbar.tsx index dfbcf85d8..4529a1b6f 100644 --- a/packages/app/src/vis-packs/core/line/LineToolbar.tsx +++ b/packages/app/src/vis-packs/core/line/LineToolbar.tsx @@ -1,6 +1,6 @@ -import type { Domain } from '@h5web/lib'; import { CurveType, + type Domain, DomainWidget, ExportMenu, ScaleSelector, @@ -13,9 +13,9 @@ import { AXIS_SCALE_TYPES } from '@h5web/shared/vis-utils'; import { FiItalic } from 'react-icons/fi'; import { MdGridOn } from 'react-icons/md'; -import type { ExportFormat, ExportURL } from '../../../providers/models'; +import { type ExportFormat, type ExportURL } from '../../../providers/models'; import { INTERACTIONS_WITH_AXIAL_ZOOM } from '../utils'; -import type { LineConfig } from './config'; +import { type LineConfig } from './config'; const EXPORT_FORMATS: ExportFormat[] = ['npy', 'csv']; diff --git a/packages/app/src/vis-packs/core/line/LineVisContainer.tsx b/packages/app/src/vis-packs/core/line/LineVisContainer.tsx index 9745954e7..4d7a26467 100644 --- a/packages/app/src/vis-packs/core/line/LineVisContainer.tsx +++ b/packages/app/src/vis-packs/core/line/LineVisContainer.tsx @@ -6,7 +6,7 @@ import { import DimensionMapper from '../../../dimension-mapper/DimensionMapper'; import { useDimMappingState } from '../../../dimension-mapper/store'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { useIgnoreFillValue, useValuesInCache } from '../hooks'; import { getSliceSelection } from '../utils'; diff --git a/packages/app/src/vis-packs/core/line/MappedLineVis.tsx b/packages/app/src/vis-packs/core/line/MappedLineVis.tsx index 7727a5a7d..71714ec11 100644 --- a/packages/app/src/vis-packs/core/line/MappedLineVis.tsx +++ b/packages/app/src/vis-packs/core/line/MappedLineVis.tsx @@ -6,17 +6,17 @@ import { useSafeDomain, useVisDomain, } from '@h5web/lib'; -import type { - ArrayShape, - ArrayValue, - Dataset, - NumericLikeType, +import { + type ArrayShape, + type ArrayValue, + type Dataset, + type NumericLikeType, } from '@h5web/shared/hdf5-models'; -import type { AxisMapping } from '@h5web/shared/nexus-models'; -import type { NumArray } from '@h5web/shared/vis-models'; +import { type AxisMapping } from '@h5web/shared/nexus-models'; +import { type NumArray } from '@h5web/shared/vis-models'; import { createPortal } from 'react-dom'; -import type { DimensionMapping } from '../../../dimension-mapper/models'; +import { type DimensionMapping } from '../../../dimension-mapper/models'; import { useDataContext } from '../../../providers/DataProvider'; import visualizerStyles from '../../../visualizer/Visualizer.module.css'; import { @@ -26,7 +26,7 @@ import { useToNumArray, } from '../hooks'; import { DEFAULT_DOMAIN, formatNumLikeType, getSliceSelection } from '../utils'; -import type { LineConfig } from './config'; +import { type LineConfig } from './config'; import LineToolbar from './LineToolbar'; interface Props { diff --git a/packages/app/src/vis-packs/core/line/config.tsx b/packages/app/src/vis-packs/core/line/config.tsx index 5f6210d5c..1d15c2bec 100644 --- a/packages/app/src/vis-packs/core/line/config.tsx +++ b/packages/app/src/vis-packs/core/line/config.tsx @@ -1,15 +1,12 @@ -import type { CustomDomain } from '@h5web/lib'; -import { CurveType } from '@h5web/lib'; +import { CurveType, type CustomDomain } from '@h5web/lib'; import { isDefined } from '@h5web/shared/guards'; -import type { AxisScaleType } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; +import { type AxisScaleType, ScaleType } from '@h5web/shared/vis-models'; import { useMap } from '@react-hookz/web'; import { createContext, useContext, useState } from 'react'; -import type { StoreApi } from 'zustand'; -import { createStore, useStore } from 'zustand'; +import { createStore, type StoreApi, useStore } from 'zustand'; import { persist } from 'zustand/middleware'; -import type { ConfigProviderProps } from '../../models'; +import { type ConfigProviderProps } from '../../models'; export interface LineConfig { customDomain: CustomDomain; diff --git a/packages/app/src/vis-packs/core/matrix/MappedMatrixVis.tsx b/packages/app/src/vis-packs/core/matrix/MappedMatrixVis.tsx index 38e26b1b2..3a5fc2ef4 100644 --- a/packages/app/src/vis-packs/core/matrix/MappedMatrixVis.tsx +++ b/packages/app/src/vis-packs/core/matrix/MappedMatrixVis.tsx @@ -1,18 +1,18 @@ import { MatrixVis } from '@h5web/lib'; -import type { - ArrayShape, - Dataset, - PrintableType, - Value, +import { + type ArrayShape, + type Dataset, + type PrintableType, + type Value, } from '@h5web/shared/hdf5-models'; import { createPortal } from 'react-dom'; -import type { DimensionMapping } from '../../../dimension-mapper/models'; +import { type DimensionMapping } from '../../../dimension-mapper/models'; import { useDataContext } from '../../../providers/DataProvider'; import visualizerStyles from '../../../visualizer/Visualizer.module.css'; import { useMappedArray, useSlicedDimsAndMapping } from '../hooks'; import { getSliceSelection } from '../utils'; -import type { MatrixVisConfig } from './config'; +import { type MatrixVisConfig } from './config'; import MatrixToolbar from './MatrixToolbar'; import { getCellWidth, getFormatter } from './utils'; diff --git a/packages/app/src/vis-packs/core/matrix/MatrixToolbar.tsx b/packages/app/src/vis-packs/core/matrix/MatrixToolbar.tsx index b9f92859b..4f58806fd 100644 --- a/packages/app/src/vis-packs/core/matrix/MatrixToolbar.tsx +++ b/packages/app/src/vis-packs/core/matrix/MatrixToolbar.tsx @@ -8,8 +8,8 @@ import { } from '@h5web/lib'; import { FiAnchor } from 'react-icons/fi'; -import type { ExportFormat, ExportURL } from '../../../providers/models'; -import type { MatrixVisConfig } from './config'; +import { type ExportFormat, type ExportURL } from '../../../providers/models'; +import { type MatrixVisConfig } from './config'; const EXPORT_FORMATS: ExportFormat[] = ['npy', 'csv']; diff --git a/packages/app/src/vis-packs/core/matrix/MatrixVisContainer.tsx b/packages/app/src/vis-packs/core/matrix/MatrixVisContainer.tsx index c8861d998..219a0630f 100644 --- a/packages/app/src/vis-packs/core/matrix/MatrixVisContainer.tsx +++ b/packages/app/src/vis-packs/core/matrix/MatrixVisContainer.tsx @@ -6,7 +6,7 @@ import { import DimensionMapper from '../../../dimension-mapper/DimensionMapper'; import { useDimMappingState } from '../../../dimension-mapper/store'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { useValuesInCache } from '../hooks'; import { getSliceSelection } from '../utils'; diff --git a/packages/app/src/vis-packs/core/matrix/config.tsx b/packages/app/src/vis-packs/core/matrix/config.tsx index cd505a2d0..e137cb0b7 100644 --- a/packages/app/src/vis-packs/core/matrix/config.tsx +++ b/packages/app/src/vis-packs/core/matrix/config.tsx @@ -1,10 +1,9 @@ import { Notation } from '@h5web/lib'; import { createContext, useContext, useState } from 'react'; -import type { StoreApi } from 'zustand'; -import { createStore, useStore } from 'zustand'; +import { createStore, type StoreApi, useStore } from 'zustand'; import { persist } from 'zustand/middleware'; -import type { ConfigProviderProps } from '../../models'; +import { type ConfigProviderProps } from '../../models'; export interface MatrixVisConfig { sticky: boolean; diff --git a/packages/app/src/vis-packs/core/matrix/utils.ts b/packages/app/src/vis-packs/core/matrix/utils.ts index c2f54a27a..dbcf250df 100644 --- a/packages/app/src/vis-packs/core/matrix/utils.ts +++ b/packages/app/src/vis-packs/core/matrix/utils.ts @@ -5,15 +5,15 @@ import { isEnumType, isNumericType, } from '@h5web/shared/guards'; -import type { - BooleanType, - ComplexType, - CompoundType, - NumericType, - PrintableType, +import { + type BooleanType, + type ComplexType, + type CompoundType, + DTypeClass, + type NumericType, + type PrintableType, } from '@h5web/shared/hdf5-models'; -import { DTypeClass } from '@h5web/shared/hdf5-models'; -import type { ValueFormatter } from '@h5web/shared/vis-models'; +import { type ValueFormatter } from '@h5web/shared/vis-models'; import { createComplexFormatter, createEnumFormatter, diff --git a/packages/app/src/vis-packs/core/raw/RawToolbar.tsx b/packages/app/src/vis-packs/core/raw/RawToolbar.tsx index 30ec76cbf..f537f83c3 100644 --- a/packages/app/src/vis-packs/core/raw/RawToolbar.tsx +++ b/packages/app/src/vis-packs/core/raw/RawToolbar.tsx @@ -1,8 +1,8 @@ import { ExportMenu, Separator, ToggleBtn, Toolbar } from '@h5web/lib'; import { MdOutlineFitScreen } from 'react-icons/md'; -import type { ExportFormat, ExportURL } from '../../../providers/models'; -import type { RawConfig } from './config'; +import { type ExportFormat, type ExportURL } from '../../../providers/models'; +import { type RawConfig } from './config'; interface Props { isImage: boolean; diff --git a/packages/app/src/vis-packs/core/raw/RawVisContainer.tsx b/packages/app/src/vis-packs/core/raw/RawVisContainer.tsx index e81834193..448e64a61 100644 --- a/packages/app/src/vis-packs/core/raw/RawVisContainer.tsx +++ b/packages/app/src/vis-packs/core/raw/RawVisContainer.tsx @@ -4,7 +4,7 @@ import { createPortal } from 'react-dom'; import { useDataContext } from '../../../providers/DataProvider'; import visualizerStyles from '../../../visualizer/Visualizer.module.css'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import ValueFetcher from '../ValueFetcher'; import { useRawConfig } from './config'; diff --git a/packages/app/src/vis-packs/core/raw/config.tsx b/packages/app/src/vis-packs/core/raw/config.tsx index f4e4931a1..9c587af7e 100644 --- a/packages/app/src/vis-packs/core/raw/config.tsx +++ b/packages/app/src/vis-packs/core/raw/config.tsx @@ -1,9 +1,8 @@ import { createContext, useContext, useState } from 'react'; -import type { StoreApi } from 'zustand'; -import { createStore, useStore } from 'zustand'; +import { createStore, type StoreApi, useStore } from 'zustand'; import { persist } from 'zustand/middleware'; -import type { ConfigProviderProps } from '../../models'; +import { type ConfigProviderProps } from '../../models'; export interface RawConfig { fitImage: boolean; diff --git a/packages/app/src/vis-packs/core/rgb/MappedRgbVis.tsx b/packages/app/src/vis-packs/core/rgb/MappedRgbVis.tsx index 5e237b3ba..a81bea754 100644 --- a/packages/app/src/vis-packs/core/rgb/MappedRgbVis.tsx +++ b/packages/app/src/vis-packs/core/rgb/MappedRgbVis.tsx @@ -1,14 +1,14 @@ import { RgbVis } from '@h5web/lib'; -import type { NumArrayDataset } from '@h5web/shared/hdf5-models'; -import type { AxisMapping } from '@h5web/shared/nexus-models'; -import type { NumArray } from '@h5web/shared/vis-models'; -import type { TypedArray } from 'ndarray'; +import { type NumArrayDataset } from '@h5web/shared/hdf5-models'; +import { type AxisMapping } from '@h5web/shared/nexus-models'; +import { type NumArray } from '@h5web/shared/vis-models'; +import { type TypedArray } from 'ndarray'; import { createPortal } from 'react-dom'; -import type { DimensionMapping } from '../../../dimension-mapper/models'; +import { type DimensionMapping } from '../../../dimension-mapper/models'; import visualizerStyles from '../../../visualizer/Visualizer.module.css'; import { useMappedArray, useSlicedDimsAndMapping } from '../hooks'; -import type { RgbVisConfig } from './config'; +import { type RgbVisConfig } from './config'; import RgbToolbar from './RgbToolbar'; interface Props { diff --git a/packages/app/src/vis-packs/core/rgb/RgbToolbar.tsx b/packages/app/src/vis-packs/core/rgb/RgbToolbar.tsx index 16dd22d30..819997bc1 100644 --- a/packages/app/src/vis-packs/core/rgb/RgbToolbar.tsx +++ b/packages/app/src/vis-packs/core/rgb/RgbToolbar.tsx @@ -13,7 +13,7 @@ import { } from 'react-icons/md'; import { getImageInteractions } from '../utils'; -import type { RgbVisConfig } from './config'; +import { type RgbVisConfig } from './config'; interface Props { config: RgbVisConfig; diff --git a/packages/app/src/vis-packs/core/rgb/RgbVisContainer.tsx b/packages/app/src/vis-packs/core/rgb/RgbVisContainer.tsx index 3ab6b147c..4bc8c9027 100644 --- a/packages/app/src/vis-packs/core/rgb/RgbVisContainer.tsx +++ b/packages/app/src/vis-packs/core/rgb/RgbVisContainer.tsx @@ -8,7 +8,7 @@ import { import DimensionMapper from '../../../dimension-mapper/DimensionMapper'; import { useDimMappingState } from '../../../dimension-mapper/store'; import { useDataContext } from '../../../providers/DataProvider'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { useValuesInCache } from '../hooks'; import { getSliceSelection } from '../utils'; diff --git a/packages/app/src/vis-packs/core/rgb/config.tsx b/packages/app/src/vis-packs/core/rgb/config.tsx index 63e4d5475..e70492ddd 100644 --- a/packages/app/src/vis-packs/core/rgb/config.tsx +++ b/packages/app/src/vis-packs/core/rgb/config.tsx @@ -1,10 +1,9 @@ import { ImageType } from '@h5web/lib'; import { createContext, useContext, useState } from 'react'; -import type { StoreApi } from 'zustand'; -import { createStore, useStore } from 'zustand'; +import { createStore, type StoreApi, useStore } from 'zustand'; import { persist } from 'zustand/middleware'; -import type { ConfigProviderProps } from '../../models'; +import { type ConfigProviderProps } from '../../models'; export interface RgbVisConfig { showGrid: boolean; diff --git a/packages/app/src/vis-packs/core/scalar/ScalarVisContainer.tsx b/packages/app/src/vis-packs/core/scalar/ScalarVisContainer.tsx index 0437859cb..baa8392a2 100644 --- a/packages/app/src/vis-packs/core/scalar/ScalarVisContainer.tsx +++ b/packages/app/src/vis-packs/core/scalar/ScalarVisContainer.tsx @@ -6,7 +6,7 @@ import { } from '@h5web/shared/guards'; import visualizerStyles from '../../../visualizer/Visualizer.module.css'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import ValueFetcher from '../ValueFetcher'; import { getFormatter } from './utils'; diff --git a/packages/app/src/vis-packs/core/scalar/utils.ts b/packages/app/src/vis-packs/core/scalar/utils.ts index a1815c67f..71d96d874 100644 --- a/packages/app/src/vis-packs/core/scalar/utils.ts +++ b/packages/app/src/vis-packs/core/scalar/utils.ts @@ -1,11 +1,11 @@ import { hasBoolType, hasComplexType, hasEnumType } from '@h5web/shared/guards'; -import type { - ArrayShape, - BooleanType, - Dataset, - PrintableType, +import { + type ArrayShape, + type BooleanType, + type Dataset, + type PrintableType, } from '@h5web/shared/hdf5-models'; -import type { ValueFormatter } from '@h5web/shared/vis-models'; +import { type ValueFormatter } from '@h5web/shared/vis-models'; import { createEnumFormatter, formatBool, diff --git a/packages/app/src/vis-packs/core/scatter/MappedScatterVis.tsx b/packages/app/src/vis-packs/core/scatter/MappedScatterVis.tsx index e7b3b1cd9..b8e51a6f2 100644 --- a/packages/app/src/vis-packs/core/scatter/MappedScatterVis.tsx +++ b/packages/app/src/vis-packs/core/scatter/MappedScatterVis.tsx @@ -1,13 +1,13 @@ import { ScatterVis, useDomain, useSafeDomain, useVisDomain } from '@h5web/lib'; import { assertDefined } from '@h5web/shared/guards'; -import type { AxisMapping } from '@h5web/shared/nexus-models'; -import type { NumArray } from '@h5web/shared/vis-models'; +import { type AxisMapping } from '@h5web/shared/nexus-models'; +import { type NumArray } from '@h5web/shared/vis-models'; import { createPortal } from 'react-dom'; import visualizerStyles from '../../../visualizer/Visualizer.module.css'; import { useBaseArray } from '../hooks'; import { DEFAULT_DOMAIN } from '../utils'; -import type { ScatterConfig } from './config'; +import { type ScatterConfig } from './config'; import ScatterToolbar from './ScatterToolbar'; interface Props { diff --git a/packages/app/src/vis-packs/core/scatter/ScatterToolbar.tsx b/packages/app/src/vis-packs/core/scatter/ScatterToolbar.tsx index 7278bf787..2dcbf901d 100644 --- a/packages/app/src/vis-packs/core/scatter/ScatterToolbar.tsx +++ b/packages/app/src/vis-packs/core/scatter/ScatterToolbar.tsx @@ -1,6 +1,6 @@ -import type { Domain } from '@h5web/lib'; import { ColorMapSelector, + type Domain, DomainWidget, ScaleSelector, Separator, @@ -11,7 +11,7 @@ import { AXIS_SCALE_TYPES, COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils'; import { MdGridOn } from 'react-icons/md'; import { BASE_INTERACTIONS } from '../utils'; -import type { ScatterConfig } from './config'; +import { type ScatterConfig } from './config'; interface Props { dataDomain: Domain; diff --git a/packages/app/src/vis-packs/core/scatter/config.tsx b/packages/app/src/vis-packs/core/scatter/config.tsx index 985c8045f..6eb7a73e9 100644 --- a/packages/app/src/vis-packs/core/scatter/config.tsx +++ b/packages/app/src/vis-packs/core/scatter/config.tsx @@ -1,15 +1,17 @@ -import type { CustomDomain } from '@h5web/lib'; +import { type CustomDomain } from '@h5web/lib'; import { isDefined } from '@h5web/shared/guards'; -import type { AxisScaleType, ColorScaleType } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; +import { + type AxisScaleType, + type ColorScaleType, + ScaleType, +} from '@h5web/shared/vis-models'; import { useMap } from '@react-hookz/web'; import { createContext, useContext, useState } from 'react'; -import type { StoreApi } from 'zustand'; -import { createStore, useStore } from 'zustand'; +import { createStore, type StoreApi, useStore } from 'zustand'; import { persist } from 'zustand/middleware'; -import type { ConfigProviderProps } from '../../models'; -import type { ColorMap } from '../heatmap/models'; +import { type ConfigProviderProps } from '../../models'; +import { type ColorMap } from '../heatmap/models'; export interface ScatterConfig { customDomain: CustomDomain; diff --git a/packages/app/src/vis-packs/core/surface/MappedSurfaceVis.tsx b/packages/app/src/vis-packs/core/surface/MappedSurfaceVis.tsx index 8b19cf0a5..0961d5b6e 100644 --- a/packages/app/src/vis-packs/core/surface/MappedSurfaceVis.tsx +++ b/packages/app/src/vis-packs/core/surface/MappedSurfaceVis.tsx @@ -1,13 +1,13 @@ import { SurfaceVis, useDomain, useSafeDomain, useVisDomain } from '@h5web/lib'; -import type { NumArrayDataset } from '@h5web/shared/hdf5-models'; -import type { TypedArray } from 'ndarray'; +import { type NumArrayDataset } from '@h5web/shared/hdf5-models'; +import { type TypedArray } from 'ndarray'; import { createPortal } from 'react-dom'; -import type { DimensionMapping } from '../../../dimension-mapper/models'; +import { type DimensionMapping } from '../../../dimension-mapper/models'; import visualizerStyles from '../../../visualizer/Visualizer.module.css'; import { useMappedArray, useSlicedDimsAndMapping } from '../hooks'; import { DEFAULT_DOMAIN } from '../utils'; -import type { SurfaceConfig } from './config'; +import { type SurfaceConfig } from './config'; import SurfaceToolbar from './SurfaceToolbar'; interface Props { diff --git a/packages/app/src/vis-packs/core/surface/SurfaceToolbar.tsx b/packages/app/src/vis-packs/core/surface/SurfaceToolbar.tsx index 48040fb85..4ebb4d187 100644 --- a/packages/app/src/vis-packs/core/surface/SurfaceToolbar.tsx +++ b/packages/app/src/vis-packs/core/surface/SurfaceToolbar.tsx @@ -1,6 +1,6 @@ -import type { Domain } from '@h5web/lib'; import { ColorMapSelector, + type Domain, DomainWidget, ScaleSelector, Separator, @@ -9,7 +9,7 @@ import { } from '@h5web/lib'; import { COLOR_SCALE_TYPES } from '@h5web/shared/vis-utils'; -import type { SurfaceConfig } from './config'; +import { type SurfaceConfig } from './config'; interface Props { dataDomain: Domain; diff --git a/packages/app/src/vis-packs/core/surface/SurfaceVisContainer.tsx b/packages/app/src/vis-packs/core/surface/SurfaceVisContainer.tsx index e1e8f1c3a..16faf1db5 100644 --- a/packages/app/src/vis-packs/core/surface/SurfaceVisContainer.tsx +++ b/packages/app/src/vis-packs/core/surface/SurfaceVisContainer.tsx @@ -7,7 +7,7 @@ import { import DimensionMapper from '../../../dimension-mapper/DimensionMapper'; import { useDimMappingState } from '../../../dimension-mapper/store'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { useValuesInCache } from '../hooks'; import { getSliceSelection } from '../utils'; diff --git a/packages/app/src/vis-packs/core/surface/config.tsx b/packages/app/src/vis-packs/core/surface/config.tsx index 7249818c5..a0da25486 100644 --- a/packages/app/src/vis-packs/core/surface/config.tsx +++ b/packages/app/src/vis-packs/core/surface/config.tsx @@ -1,15 +1,13 @@ -import type { CustomDomain } from '@h5web/lib'; +import { type CustomDomain } from '@h5web/lib'; import { isDefined } from '@h5web/shared/guards'; -import type { ColorScaleType } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; +import { type ColorScaleType, ScaleType } from '@h5web/shared/vis-models'; import { useMap } from '@react-hookz/web'; import { createContext, useContext, useState } from 'react'; -import type { StoreApi } from 'zustand'; -import { createStore, useStore } from 'zustand'; +import { createStore, type StoreApi, useStore } from 'zustand'; import { persist } from 'zustand/middleware'; -import type { ConfigProviderProps } from '../../models'; -import type { ColorMap } from '../heatmap/models'; +import { type ConfigProviderProps } from '../../models'; +import { type ColorMap } from '../heatmap/models'; export interface SurfaceConfig { customDomain: CustomDomain; diff --git a/packages/app/src/vis-packs/core/utils.ts b/packages/app/src/vis-packs/core/utils.ts index 18ccb15ef..54955b6d3 100644 --- a/packages/app/src/vis-packs/core/utils.ts +++ b/packages/app/src/vis-packs/core/utils.ts @@ -1,13 +1,19 @@ -import type { InteractionInfo } from '@h5web/lib'; +import { type InteractionInfo } from '@h5web/lib'; import { isNumericType } from '@h5web/shared/guards'; -import type { ArrayValue, NumericLikeType } from '@h5web/shared/hdf5-models'; -import { DTypeClass } from '@h5web/shared/hdf5-models'; -import type { Axis, Domain, NumArray } from '@h5web/shared/vis-models'; +import { + type ArrayValue, + DTypeClass, + type NumericLikeType, +} from '@h5web/shared/hdf5-models'; +import { + type Axis, + type Domain, + type NumArray, +} from '@h5web/shared/vis-models'; import { createArrayFromView } from '@h5web/shared/vis-utils'; -import type { NdArray, TypedArray } from 'ndarray'; -import ndarray from 'ndarray'; +import ndarray, { type NdArray, type TypedArray } from 'ndarray'; -import type { DimensionMapping } from '../../dimension-mapper/models'; +import { type DimensionMapping } from '../../dimension-mapper/models'; import { isAxis } from '../../dimension-mapper/utils'; export const DEFAULT_DOMAIN: Domain = [0.1, 1]; diff --git a/packages/app/src/vis-packs/core/visualizations.test.ts b/packages/app/src/vis-packs/core/visualizations.test.ts index 7ad4821d9..fe149d5a3 100644 --- a/packages/app/src/vis-packs/core/visualizations.test.ts +++ b/packages/app/src/vis-packs/core/visualizations.test.ts @@ -1,4 +1,4 @@ -import type { Entity } from '@h5web/shared/hdf5-models'; +import { type Entity } from '@h5web/shared/hdf5-models'; import { boolType, compoundType, @@ -15,7 +15,7 @@ import { } from '@h5web/shared/mock-utils'; import { describe, expect, it } from 'vitest'; -import type { AttrValuesStore } from '../../providers/models'; +import { type AttrValuesStore } from '../../providers/models'; import { CORE_VIS } from './visualizations'; const mockStore = { diff --git a/packages/app/src/vis-packs/core/visualizations.ts b/packages/app/src/vis-packs/core/visualizations.ts index 2ac8e5466..e3dc1feb7 100644 --- a/packages/app/src/vis-packs/core/visualizations.ts +++ b/packages/app/src/vis-packs/core/visualizations.ts @@ -10,7 +10,7 @@ import { hasPrintableType, hasScalarShape, } from '@h5web/shared/guards'; -import type { Dataset } from '@h5web/shared/hdf5-models'; +import { type Dataset } from '@h5web/shared/hdf5-models'; import { FiActivity, FiCode, @@ -21,8 +21,8 @@ import { FiPackage, } from 'react-icons/fi'; -import type { AttrValuesStore } from '../../providers/models'; -import type { VisDef } from '../models'; +import { type AttrValuesStore } from '../../providers/models'; +import { type VisDef } from '../models'; import { ComplexConfigProvider, ComplexLineConfigProvider, diff --git a/packages/app/src/vis-packs/models.ts b/packages/app/src/vis-packs/models.ts index 848e59483..db99be0ed 100644 --- a/packages/app/src/vis-packs/models.ts +++ b/packages/app/src/vis-packs/models.ts @@ -1,6 +1,6 @@ -import type { ProvidedEntity } from '@h5web/shared/hdf5-models'; -import type { ElementType, ReactNode } from 'react'; -import type { IconType } from 'react-icons'; +import { type ProvidedEntity } from '@h5web/shared/hdf5-models'; +import { type ElementType, type ReactNode } from 'react'; +import { type IconType } from 'react-icons'; export interface VisContainerProps { entity: ProvidedEntity; diff --git a/packages/app/src/vis-packs/nexus/NxNoteFetcher.tsx b/packages/app/src/vis-packs/nexus/NxNoteFetcher.tsx index ac4d4900c..c0fe4cb1a 100644 --- a/packages/app/src/vis-packs/nexus/NxNoteFetcher.tsx +++ b/packages/app/src/vis-packs/nexus/NxNoteFetcher.tsx @@ -1,9 +1,9 @@ -import type { - Dataset, - ScalarShape, - StringType, +import { + type Dataset, + type ScalarShape, + type StringType, } from '@h5web/shared/hdf5-models'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { useDatasetValues, usePrefetchValues } from '../core/hooks'; diff --git a/packages/app/src/vis-packs/nexus/NxSignalPicker.tsx b/packages/app/src/vis-packs/nexus/NxSignalPicker.tsx index a39aeeb67..1a0d58304 100644 --- a/packages/app/src/vis-packs/nexus/NxSignalPicker.tsx +++ b/packages/app/src/vis-packs/nexus/NxSignalPicker.tsx @@ -1,6 +1,6 @@ -import type { ComplexType, NumericType } from '@h5web/shared/hdf5-models'; +import { type ComplexType, type NumericType } from '@h5web/shared/hdf5-models'; -import type { DatasetDef } from './models'; +import { type DatasetDef } from './models'; import styles from './NxSignalPicker.module.css'; interface Props { diff --git a/packages/app/src/vis-packs/nexus/NxValuesFetcher.tsx b/packages/app/src/vis-packs/nexus/NxValuesFetcher.tsx index c43d9316a..6654e8cb4 100644 --- a/packages/app/src/vis-packs/nexus/NxValuesFetcher.tsx +++ b/packages/app/src/vis-packs/nexus/NxValuesFetcher.tsx @@ -1,12 +1,12 @@ -import type { ComplexType, NumericType } from '@h5web/shared/hdf5-models'; -import type { ReactNode } from 'react'; +import { type ComplexType, type NumericType } from '@h5web/shared/hdf5-models'; +import { type ReactNode } from 'react'; import { useDatasetValue, useDatasetValues, usePrefetchValues, } from '../core/hooks'; -import type { NxData, NxValues } from './models'; +import { type NxData, type NxValues } from './models'; interface Props { nxData: NxData; diff --git a/packages/app/src/vis-packs/nexus/containers/NxComplexImageContainer.tsx b/packages/app/src/vis-packs/nexus/containers/NxComplexImageContainer.tsx index b41ad03fc..d05aa810b 100644 --- a/packages/app/src/vis-packs/nexus/containers/NxComplexImageContainer.tsx +++ b/packages/app/src/vis-packs/nexus/containers/NxComplexImageContainer.tsx @@ -7,7 +7,7 @@ import { useComplexConfig } from '../../core/complex/config'; import MappedComplexVis from '../../core/complex/MappedComplexVis'; import { useHeatmapConfig } from '../../core/heatmap/config'; import { getSliceSelection } from '../../core/utils'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { assertComplexNxData } from '../guards'; import { useNxData, useNxImageDataToFetch, useNxValuesCached } from '../hooks'; diff --git a/packages/app/src/vis-packs/nexus/containers/NxComplexSpectrumContainer.tsx b/packages/app/src/vis-packs/nexus/containers/NxComplexSpectrumContainer.tsx index cd1176bdf..ec0324b99 100644 --- a/packages/app/src/vis-packs/nexus/containers/NxComplexSpectrumContainer.tsx +++ b/packages/app/src/vis-packs/nexus/containers/NxComplexSpectrumContainer.tsx @@ -7,7 +7,7 @@ import { useComplexLineConfig } from '../../core/complex/lineConfig'; import MappedComplexLineVis from '../../core/complex/MappedComplexLineVis'; import { useLineConfig } from '../../core/line/config'; import { getSliceSelection } from '../../core/utils'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { assertComplexNxData } from '../guards'; import { useNxData, useNxValuesCached } from '../hooks'; diff --git a/packages/app/src/vis-packs/nexus/containers/NxImageContainer.tsx b/packages/app/src/vis-packs/nexus/containers/NxImageContainer.tsx index e7e83823d..64865929d 100644 --- a/packages/app/src/vis-packs/nexus/containers/NxImageContainer.tsx +++ b/packages/app/src/vis-packs/nexus/containers/NxImageContainer.tsx @@ -6,7 +6,7 @@ import { useDimMappingState } from '../../../dimension-mapper/store'; import { useHeatmapConfig } from '../../core/heatmap/config'; import MappedHeatmapVis from '../../core/heatmap/MappedHeatmapVis'; import { getSliceSelection } from '../../core/utils'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { assertNumericLikeNxData } from '../guards'; import { useNxData, useNxImageDataToFetch, useNxValuesCached } from '../hooks'; diff --git a/packages/app/src/vis-packs/nexus/containers/NxNoteContainer.tsx b/packages/app/src/vis-packs/nexus/containers/NxNoteContainer.tsx index a2dfb1666..21fb1878a 100644 --- a/packages/app/src/vis-packs/nexus/containers/NxNoteContainer.tsx +++ b/packages/app/src/vis-packs/nexus/containers/NxNoteContainer.tsx @@ -9,7 +9,7 @@ import { import { getChildEntity } from '@h5web/shared/hdf5-utils'; import visualizerStyles from '../../../visualizer/Visualizer.module.css'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import NxNoteFetcher from '../NxNoteFetcher'; import { parseJson } from '../utils'; diff --git a/packages/app/src/vis-packs/nexus/containers/NxRgbContainer.tsx b/packages/app/src/vis-packs/nexus/containers/NxRgbContainer.tsx index a70b81afa..e67346608 100644 --- a/packages/app/src/vis-packs/nexus/containers/NxRgbContainer.tsx +++ b/packages/app/src/vis-packs/nexus/containers/NxRgbContainer.tsx @@ -5,7 +5,7 @@ import { useDimMappingState } from '../../../dimension-mapper/store'; import { useRgbConfig } from '../../core/rgb/config'; import MappedRgbVis from '../../core/rgb/MappedRgbVis'; import { getSliceSelection } from '../../core/utils'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { assertNumericNxData } from '../guards'; import { useNxData, useNxValuesCached } from '../hooks'; diff --git a/packages/app/src/vis-packs/nexus/containers/NxScatterContainer.tsx b/packages/app/src/vis-packs/nexus/containers/NxScatterContainer.tsx index b8fcf2293..d33a6100a 100644 --- a/packages/app/src/vis-packs/nexus/containers/NxScatterContainer.tsx +++ b/packages/app/src/vis-packs/nexus/containers/NxScatterContainer.tsx @@ -6,7 +6,7 @@ import { import { useScatterConfig } from '../../core/scatter/config'; import MappedScatterVis from '../../core/scatter/MappedScatterVis'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { assertNumericNxData } from '../guards'; import { useNxData } from '../hooks'; diff --git a/packages/app/src/vis-packs/nexus/containers/NxSpectrumContainer.tsx b/packages/app/src/vis-packs/nexus/containers/NxSpectrumContainer.tsx index d33b78c1a..f5592fcc7 100644 --- a/packages/app/src/vis-packs/nexus/containers/NxSpectrumContainer.tsx +++ b/packages/app/src/vis-packs/nexus/containers/NxSpectrumContainer.tsx @@ -6,7 +6,7 @@ import { useDimMappingState } from '../../../dimension-mapper/store'; import { useLineConfig } from '../../core/line/config'; import MappedLineVis from '../../core/line/MappedLineVis'; import { getSliceSelection } from '../../core/utils'; -import type { VisContainerProps } from '../../models'; +import { type VisContainerProps } from '../../models'; import VisBoundary from '../../VisBoundary'; import { assertNumericLikeNxData } from '../guards'; import { useNxData, useNxValuesCached } from '../hooks'; diff --git a/packages/app/src/vis-packs/nexus/guards.ts b/packages/app/src/vis-packs/nexus/guards.ts index c92b598d0..5e183b385 100644 --- a/packages/app/src/vis-packs/nexus/guards.ts +++ b/packages/app/src/vis-packs/nexus/guards.ts @@ -3,9 +3,9 @@ import { assertNumericLikeType, assertNumericType, } from '@h5web/shared/guards'; -import type { ComplexType, NumericType } from '@h5web/shared/hdf5-models'; +import { type ComplexType, type NumericType } from '@h5web/shared/hdf5-models'; -import type { NxData } from './models'; +import { type NxData } from './models'; export function assertNumericLikeNxData( nxData: NxData, diff --git a/packages/app/src/vis-packs/nexus/hooks.ts b/packages/app/src/vis-packs/nexus/hooks.ts index abfa88db0..389899ab6 100644 --- a/packages/app/src/vis-packs/nexus/hooks.ts +++ b/packages/app/src/vis-packs/nexus/hooks.ts @@ -1,13 +1,13 @@ -import type { - ComplexType, - GroupWithChildren, - NumericType, +import { + type ComplexType, + type GroupWithChildren, + type NumericType, } from '@h5web/shared/hdf5-models'; -import type { DimensionMapping } from '../../dimension-mapper/models'; +import { type DimensionMapping } from '../../dimension-mapper/models'; import { useDataContext } from '../../providers/DataProvider'; import { useValuesInCache } from '../core/hooks'; -import type { DatasetDef, NxData } from './models'; +import { type DatasetDef, type NxData } from './models'; import { assertNxDataGroup, findAuxErrorDataset, diff --git a/packages/app/src/vis-packs/nexus/models.ts b/packages/app/src/vis-packs/nexus/models.ts index 7a5027a38..530ebce3e 100644 --- a/packages/app/src/vis-packs/nexus/models.ts +++ b/packages/app/src/vis-packs/nexus/models.ts @@ -1,17 +1,17 @@ -import type { AxisScaleType, ColorScaleType } from '@h5web/lib'; -import type { - ArrayShape, - ArrayValue, - ComplexType, - Dataset, - NumArrayDataset, - NumericLikeType, - NumericType, - ScalarShape, - StringType, +import { type AxisScaleType, type ColorScaleType } from '@h5web/lib'; +import { + type ArrayShape, + type ArrayValue, + type ComplexType, + type Dataset, + type NumArrayDataset, + type NumericLikeType, + type NumericType, + type ScalarShape, + type StringType, } from '@h5web/shared/hdf5-models'; -import type { AxisMapping } from '@h5web/shared/nexus-models'; -import type { NumArray } from '@h5web/shared/vis-models'; +import { type AxisMapping } from '@h5web/shared/nexus-models'; +import { type NumArray } from '@h5web/shared/vis-models'; export type NxAttribute = | 'NX_class' diff --git a/packages/app/src/vis-packs/nexus/utils.ts b/packages/app/src/vis-packs/nexus/utils.ts index 864e7c312..334e488cc 100644 --- a/packages/app/src/vis-packs/nexus/utils.ts +++ b/packages/app/src/vis-packs/nexus/utils.ts @@ -12,22 +12,22 @@ import { isColorScaleType, isDefined, } from '@h5web/shared/guards'; -import type { - ArrayShape, - ComplexType, - Dataset, - Group, - GroupWithChildren, - NumArrayDataset, - NumericLikeType, - ScalarShape, - StringType, +import { + type ArrayShape, + type ComplexType, + type Dataset, + type Group, + type GroupWithChildren, + type NumArrayDataset, + type NumericLikeType, + type ScalarShape, + type StringType, } from '@h5web/shared/hdf5-models'; import { getChildEntity } from '@h5web/shared/hdf5-utils'; -import type { AttrValuesStore } from '../../providers/models'; +import { type AttrValuesStore } from '../../providers/models'; import { hasAttribute } from '../../utils'; -import type { AxisDef, DatasetInfo, SilxStyle } from './models'; +import { type AxisDef, type DatasetInfo, type SilxStyle } from './models'; export function isNxDataGroup( group: GroupWithChildren, diff --git a/packages/app/src/vis-packs/nexus/visualizations.ts b/packages/app/src/vis-packs/nexus/visualizations.ts index 31e43908a..bf44c4871 100644 --- a/packages/app/src/vis-packs/nexus/visualizations.ts +++ b/packages/app/src/vis-packs/nexus/visualizations.ts @@ -9,7 +9,7 @@ import { RgbConfigProvider, } from '../core/configs'; import { ScatterConfigProvider } from '../core/scatter/config'; -import type { VisDef } from '../models'; +import { type VisDef } from '../models'; import { NxComplexImageContainer, NxComplexSpectrumContainer, diff --git a/packages/app/src/visualizer/VisManager.tsx b/packages/app/src/visualizer/VisManager.tsx index 9fdbffae9..56d28f5be 100644 --- a/packages/app/src/visualizer/VisManager.tsx +++ b/packages/app/src/visualizer/VisManager.tsx @@ -1,9 +1,9 @@ import { assertDefined } from '@h5web/shared/guards'; -import type { ProvidedEntity } from '@h5web/shared/hdf5-models'; +import { type ProvidedEntity } from '@h5web/shared/hdf5-models'; import { useState } from 'react'; import { useDataContext } from '../providers/DataProvider'; -import type { VisDef } from '../vis-packs/models'; +import { type VisDef } from '../vis-packs/models'; import { useActiveVis } from './hooks'; import VisSelector from './VisSelector'; import styles from './Visualizer.module.css'; diff --git a/packages/app/src/visualizer/VisSelector.tsx b/packages/app/src/visualizer/VisSelector.tsx index a4c3eb10b..4c5d8dc19 100644 --- a/packages/app/src/visualizer/VisSelector.tsx +++ b/packages/app/src/visualizer/VisSelector.tsx @@ -1,4 +1,4 @@ -import type { VisDef } from '../vis-packs/models'; +import { type VisDef } from '../vis-packs/models'; import styles from './VisSelector.module.css'; interface Props { diff --git a/packages/app/src/visualizer/hooks.ts b/packages/app/src/visualizer/hooks.ts index 351fa79ea..c2d1d53b0 100644 --- a/packages/app/src/visualizer/hooks.ts +++ b/packages/app/src/visualizer/hooks.ts @@ -1,7 +1,7 @@ import { useLocalStorageValue } from '@react-hookz/web'; import { useState } from 'react'; -import type { VisDef } from '../vis-packs/models'; +import { type VisDef } from '../vis-packs/models'; export function useActiveVis( supportedVis: T[], diff --git a/packages/app/src/visualizer/utils.ts b/packages/app/src/visualizer/utils.ts index 6007149fa..194f4d07c 100644 --- a/packages/app/src/visualizer/utils.ts +++ b/packages/app/src/visualizer/utils.ts @@ -6,15 +6,21 @@ import { isDataset, isGroup, } from '@h5web/shared/guards'; -import type { ChildEntity, ProvidedEntity } from '@h5web/shared/hdf5-models'; +import { + type ChildEntity, + type ProvidedEntity, +} from '@h5web/shared/hdf5-models'; import { buildEntityPath } from '@h5web/shared/hdf5-utils'; import { NxInterpretation } from '@h5web/shared/nexus-models'; -import type { AttrValuesStore, EntitiesStore } from '../providers/models'; +import { type AttrValuesStore, type EntitiesStore } from '../providers/models'; import { hasAttribute } from '../utils'; -import type { CoreVisDef } from '../vis-packs/core/visualizations'; -import { CORE_VIS, Vis } from '../vis-packs/core/visualizations'; -import type { VisDef } from '../vis-packs/models'; +import { + CORE_VIS, + type CoreVisDef, + Vis, +} from '../vis-packs/core/visualizations'; +import { type VisDef } from '../vis-packs/models'; import { findAxesDatasets, findSignalDataset, diff --git a/packages/h5wasm/src/H5WasmBufferProvider.tsx b/packages/h5wasm/src/H5WasmBufferProvider.tsx index 1adbfe26d..089b25610 100644 --- a/packages/h5wasm/src/H5WasmBufferProvider.tsx +++ b/packages/h5wasm/src/H5WasmBufferProvider.tsx @@ -1,10 +1,8 @@ -import type { DataProviderApi } from '@h5web/app'; -import { DataProvider } from '@h5web/app'; -import type { PropsWithChildren } from 'react'; -import { useMemo, useRef } from 'react'; +import { DataProvider, type DataProviderApi } from '@h5web/app'; +import { type PropsWithChildren, useMemo, useRef } from 'react'; import { H5WasmApi } from './h5wasm-api'; -import type { Plugin } from './models'; +import { type Plugin } from './models'; import { getH5WasmRemote } from './remote'; interface Props { diff --git a/packages/h5wasm/src/H5WasmLocalFileProvider.tsx b/packages/h5wasm/src/H5WasmLocalFileProvider.tsx index 99016aaed..4fa0298e0 100644 --- a/packages/h5wasm/src/H5WasmLocalFileProvider.tsx +++ b/packages/h5wasm/src/H5WasmLocalFileProvider.tsx @@ -1,10 +1,8 @@ -import type { DataProviderApi } from '@h5web/app'; -import { DataProvider } from '@h5web/app'; -import type { PropsWithChildren } from 'react'; -import { useMemo, useRef } from 'react'; +import { DataProvider, type DataProviderApi } from '@h5web/app'; +import { type PropsWithChildren, useMemo, useRef } from 'react'; import { H5WasmApi } from './h5wasm-api'; -import type { Plugin } from './models'; +import { type Plugin } from './models'; import { getH5WasmRemote } from './remote'; interface Props { diff --git a/packages/h5wasm/src/h5wasm-api.test.ts b/packages/h5wasm/src/h5wasm-api.test.ts index 5cd0a6ed2..87660995a 100644 --- a/packages/h5wasm/src/h5wasm-api.test.ts +++ b/packages/h5wasm/src/h5wasm-api.test.ts @@ -10,8 +10,7 @@ import { assertGroupWithChildren, hasNonNullShape, } from '@h5web/shared/guards'; -import type { Dataset } from '@h5web/shared/hdf5-models'; -import { DTypeClass } from '@h5web/shared/hdf5-models'; +import { type Dataset, DTypeClass } from '@h5web/shared/hdf5-models'; import { beforeAll, expect, test } from 'vitest'; import { H5WasmApi } from './h5wasm-api'; diff --git a/packages/h5wasm/src/h5wasm-api.ts b/packages/h5wasm/src/h5wasm-api.ts index 0f747267c..94296355f 100644 --- a/packages/h5wasm/src/h5wasm-api.ts +++ b/packages/h5wasm/src/h5wasm-api.ts @@ -1,24 +1,28 @@ -import type { ExportFormat, ExportURL, ValuesStoreParams } from '@h5web/app'; -import { DataProviderApi } from '@h5web/app'; +import { + DataProviderApi, + type ExportFormat, + type ExportURL, + type ValuesStoreParams, +} from '@h5web/app'; import { assertDataset, isDefined } from '@h5web/shared/guards'; -import type { - ArrayShape, - AttributeValues, - Dataset, - Entity, - ProvidedEntity, - Value, +import { + type ArrayShape, + type AttributeValues, + type Dataset, + type Entity, + type ProvidedEntity, + type Value, } from '@h5web/shared/hdf5-models'; import { transfer } from 'comlink'; -import type { Plugin } from './models'; +import { type Plugin } from './models'; import { getEnhancedError, hasBigInts, PLUGINS_BY_FILTER_ID, sanitizeBigInts, } from './utils'; -import type { H5WasmWorkerAPI } from './worker'; +import { type H5WasmWorkerAPI } from './worker'; export class H5WasmApi extends DataProviderApi { public constructor( diff --git a/packages/h5wasm/src/remote.ts b/packages/h5wasm/src/remote.ts index 5c1788220..9b5a32b8d 100644 --- a/packages/h5wasm/src/remote.ts +++ b/packages/h5wasm/src/remote.ts @@ -1,7 +1,6 @@ -import type { Remote } from 'comlink'; -import { wrap } from 'comlink'; +import { type Remote, wrap } from 'comlink'; -import type { H5WasmWorkerAPI } from './worker'; +import { type H5WasmWorkerAPI } from './worker'; import LocalWorker from './worker?worker&inline'; let remote: Remote; diff --git a/packages/h5wasm/src/utils.ts b/packages/h5wasm/src/utils.ts index d60138d13..7e50e3a4c 100644 --- a/packages/h5wasm/src/utils.ts +++ b/packages/h5wasm/src/utils.ts @@ -1,8 +1,6 @@ -import type { DType } from '@h5web/shared/hdf5-models'; -import { DTypeClass } from '@h5web/shared/hdf5-models'; +import { type DType, DTypeClass } from '@h5web/shared/hdf5-models'; -import type { HDF5Diag } from './models'; -import { Plugin } from './models'; +import { type HDF5Diag, Plugin } from './models'; // https://support.hdfgroup.org/services/contributions.html export const PLUGINS_BY_FILTER_ID: Record = { diff --git a/packages/h5wasm/src/worker-utils.ts b/packages/h5wasm/src/worker-utils.ts index 0358a4d14..0568a9068 100644 --- a/packages/h5wasm/src/worker-utils.ts +++ b/packages/h5wasm/src/worker-utils.ts @@ -3,17 +3,21 @@ import { assertNonNull, isNumericType, } from '@h5web/shared/guards'; -import type { H5T_STR } from '@h5web/shared/h5t'; -import { H5T_CLASS, H5T_ORDER, H5T_SIGN } from '@h5web/shared/h5t'; -import type { - Attribute, - ChildEntity, - DType, - Group, - ProvidedEntity, - VirtualSource, +import { + H5T_CLASS, + H5T_ORDER, + H5T_SIGN, + type H5T_STR, +} from '@h5web/shared/h5t'; +import { + type Attribute, + type ChildEntity, + type DType, + EntityKind, + type Group, + type ProvidedEntity, + type VirtualSource, } from '@h5web/shared/hdf5-models'; -import { EntityKind } from '@h5web/shared/hdf5-models'; import { arrayType, bitfieldType, @@ -29,8 +33,12 @@ import { timeType, unknownType, } from '@h5web/shared/hdf5-utils'; -import type { Dataset as H5WasmDataset, Metadata, OutputData } from 'h5wasm'; -import { ready as h5wasmReady } from 'h5wasm'; +import { + type Dataset as H5WasmDataset, + type Metadata, + type OutputData, + ready as h5wasmReady, +} from 'h5wasm'; import { nanoid } from 'nanoid'; export const PLUGINS_FOLDER = 'plugins'; // path to plugins on EMScripten virtual file system diff --git a/packages/h5wasm/src/worker.ts b/packages/h5wasm/src/worker.ts index 7c2124ce8..266b24d3d 100644 --- a/packages/h5wasm/src/worker.ts +++ b/packages/h5wasm/src/worker.ts @@ -1,5 +1,5 @@ import { isTypedArray } from '@h5web/shared/guards'; -import type { ProvidedEntity } from '@h5web/shared/hdf5-models'; +import { type ProvidedEntity } from '@h5web/shared/hdf5-models'; import { expose, transfer } from 'comlink'; import { Attribute, Dataset } from 'h5wasm'; diff --git a/packages/lib/src/interactions/AxialSelectToZoom.tsx b/packages/lib/src/interactions/AxialSelectToZoom.tsx index ccb330d4c..4b8611373 100644 --- a/packages/lib/src/interactions/AxialSelectToZoom.tsx +++ b/packages/lib/src/interactions/AxialSelectToZoom.tsx @@ -1,10 +1,10 @@ -import type { Axis } from '@h5web/shared/vis-models'; +import { type Axis } from '@h5web/shared/vis-models'; import { useVisCanvasContext } from '../vis/shared/VisCanvasProvider'; import AxialSelectionTool from './AxialSelectionTool'; import Box from './box'; import { useZoomOnSelection } from './hooks'; -import type { CommonInteractionProps } from './models'; +import { type CommonInteractionProps } from './models'; import styles from './SelectToZoom.module.css'; import SvgElement from './svg/SvgElement'; import SvgRect from './svg/SvgRect'; diff --git a/packages/lib/src/interactions/AxialSelectionTool.tsx b/packages/lib/src/interactions/AxialSelectionTool.tsx index 1804aec76..42c4dba92 100644 --- a/packages/lib/src/interactions/AxialSelectionTool.tsx +++ b/packages/lib/src/interactions/AxialSelectionTool.tsx @@ -1,11 +1,9 @@ -import type { Axis } from '@h5web/shared/vis-models'; -import type { Camera } from 'three'; -import { Vector3 } from 'three'; - -import type { VisCanvasContextValue } from '../vis/shared/VisCanvasProvider'; -import type { Rect, Selection } from './models'; -import type { SelectionToolProps } from './SelectionTool'; -import SelectionTool from './SelectionTool'; +import { type Axis } from '@h5web/shared/vis-models'; +import { type Camera, Vector3 } from 'three'; + +import { type VisCanvasContextValue } from '../vis/shared/VisCanvasProvider'; +import { type Rect, type Selection } from './models'; +import SelectionTool, { type SelectionToolProps } from './SelectionTool'; interface Props extends Omit { axis: Axis; diff --git a/packages/lib/src/interactions/DefaultInteractions.tsx b/packages/lib/src/interactions/DefaultInteractions.tsx index 69dc7fc24..11bf5d398 100644 --- a/packages/lib/src/interactions/DefaultInteractions.tsx +++ b/packages/lib/src/interactions/DefaultInteractions.tsx @@ -1,15 +1,13 @@ -import type { PanProps } from '../interactions/Pan'; -import Pan from '../interactions/Pan'; -import type { SelectToZoomProps } from '../interactions/SelectToZoom'; -import SelectToZoom from '../interactions/SelectToZoom'; -import type { XAxisZoomProps } from '../interactions/XAxisZoom'; -import XAxisZoom from '../interactions/XAxisZoom'; -import type { YAxisZoomProps } from '../interactions/YAxisZoom'; -import YAxisZoom from '../interactions/YAxisZoom'; -import type { ZoomProps } from '../interactions/Zoom'; -import Zoom from '../interactions/Zoom'; -import type { AxialSelectToZoomProps } from './AxialSelectToZoom'; -import AxialSelectToZoom from './AxialSelectToZoom'; +import Pan, { type PanProps } from '../interactions/Pan'; +import SelectToZoom, { + type SelectToZoomProps, +} from '../interactions/SelectToZoom'; +import XAxisZoom, { type XAxisZoomProps } from '../interactions/XAxisZoom'; +import YAxisZoom, { type YAxisZoomProps } from '../interactions/YAxisZoom'; +import Zoom, { type ZoomProps } from '../interactions/Zoom'; +import AxialSelectToZoom, { + type AxialSelectToZoomProps, +} from './AxialSelectToZoom'; export interface DefaultInteractionsConfig { pan?: PanProps | false; diff --git a/packages/lib/src/interactions/InteractionsProvider.tsx b/packages/lib/src/interactions/InteractionsProvider.tsx index 4bd12ea1e..6d1a630e3 100644 --- a/packages/lib/src/interactions/InteractionsProvider.tsx +++ b/packages/lib/src/interactions/InteractionsProvider.tsx @@ -1,8 +1,13 @@ -import type { ReactNode } from 'react'; -import { createContext, useCallback, useContext, useState } from 'react'; +import { + createContext, + type ReactNode, + useCallback, + useContext, + useState, +} from 'react'; import { Interaction } from './interaction'; -import type { InteractionConfig } from './models'; +import { type InteractionConfig } from './models'; export interface InteractionsContextValue { registerInteraction: (id: string, config: InteractionConfig) => void; diff --git a/packages/lib/src/interactions/Pan.tsx b/packages/lib/src/interactions/Pan.tsx index 9fd4312aa..41b2b9314 100644 --- a/packages/lib/src/interactions/Pan.tsx +++ b/packages/lib/src/interactions/Pan.tsx @@ -1,6 +1,6 @@ import { useThree } from '@react-three/fiber'; import { useRef } from 'react'; -import type { Vector3 } from 'three'; +import { type Vector3 } from 'three'; import { useCanvasEvent, @@ -8,8 +8,11 @@ import { useModifierKeyPressed, useMoveCameraTo, } from './hooks'; -import type { CanvasEvent, CommonInteractionProps } from './models'; -import { MouseButton } from './models'; +import { + type CanvasEvent, + type CommonInteractionProps, + MouseButton, +} from './models'; interface Props extends CommonInteractionProps { id?: string; diff --git a/packages/lib/src/interactions/SelectToZoom.tsx b/packages/lib/src/interactions/SelectToZoom.tsx index d91d8517a..4d8a4edbd 100644 --- a/packages/lib/src/interactions/SelectToZoom.tsx +++ b/packages/lib/src/interactions/SelectToZoom.tsx @@ -4,7 +4,11 @@ import { Vector3 } from 'three'; import { useVisCanvasContext } from '../vis/shared/VisCanvasProvider'; import Box from './box'; import { useZoomOnSelection } from './hooks'; -import type { CommonInteractionProps, Rect, Selection } from './models'; +import { + type CommonInteractionProps, + type Rect, + type Selection, +} from './models'; import SelectionTool from './SelectionTool'; import styles from './SelectToZoom.module.css'; import SvgElement from './svg/SvgElement'; diff --git a/packages/lib/src/interactions/SelectionTool.tsx b/packages/lib/src/interactions/SelectionTool.tsx index 75aff533e..414cd3808 100644 --- a/packages/lib/src/interactions/SelectionTool.tsx +++ b/packages/lib/src/interactions/SelectionTool.tsx @@ -7,20 +7,21 @@ import { useSyncedRef, } from '@react-hookz/web'; import { useThree } from '@react-three/fiber'; -import type { ReactNode } from 'react'; -import { useEffect, useMemo, useRef } from 'react'; -import type { Camera, Vector3 } from 'three'; +import { type ReactNode, useEffect, useMemo, useRef } from 'react'; +import { type Camera, type Vector3 } from 'three'; -import type { VisCanvasContextValue } from '../vis/shared/VisCanvasProvider'; -import { useVisCanvasContext } from '../vis/shared/VisCanvasProvider'; +import { + useVisCanvasContext, + type VisCanvasContextValue, +} from '../vis/shared/VisCanvasProvider'; import { useCanvasEvent, useInteraction, useModifierKeyPressed } from './hooks'; -import type { - CanvasEvent, - CommonInteractionProps, - Rect, - Selection, +import { + type CanvasEvent, + type CommonInteractionProps, + MouseButton, + type Rect, + type Selection, } from './models'; -import { MouseButton } from './models'; interface Props extends CommonInteractionProps { id?: string; diff --git a/packages/lib/src/interactions/XAxisZoom.tsx b/packages/lib/src/interactions/XAxisZoom.tsx index 7e402e616..7dce7e9ef 100644 --- a/packages/lib/src/interactions/XAxisZoom.tsx +++ b/packages/lib/src/interactions/XAxisZoom.tsx @@ -5,7 +5,7 @@ import { useWheelCapture, useZoomOnWheel, } from './hooks'; -import type { CommonInteractionProps } from './models'; +import { type CommonInteractionProps } from './models'; type Props = CommonInteractionProps; diff --git a/packages/lib/src/interactions/YAxisZoom.tsx b/packages/lib/src/interactions/YAxisZoom.tsx index 70626d0f8..4b56bfa20 100644 --- a/packages/lib/src/interactions/YAxisZoom.tsx +++ b/packages/lib/src/interactions/YAxisZoom.tsx @@ -5,7 +5,7 @@ import { useWheelCapture, useZoomOnWheel, } from './hooks'; -import type { CommonInteractionProps } from './models'; +import { type CommonInteractionProps } from './models'; type Props = CommonInteractionProps; diff --git a/packages/lib/src/interactions/Zoom.tsx b/packages/lib/src/interactions/Zoom.tsx index 1aa5dcdee..194f20238 100644 --- a/packages/lib/src/interactions/Zoom.tsx +++ b/packages/lib/src/interactions/Zoom.tsx @@ -4,7 +4,7 @@ import { useWheelCapture, useZoomOnWheel, } from './hooks'; -import type { CommonInteractionProps } from './models'; +import { type CommonInteractionProps } from './models'; type Props = CommonInteractionProps; diff --git a/packages/lib/src/interactions/box.ts b/packages/lib/src/interactions/box.ts index c84f57aba..a727e69aa 100644 --- a/packages/lib/src/interactions/box.ts +++ b/packages/lib/src/interactions/box.ts @@ -1,7 +1,7 @@ import { Box3, Vector3 } from 'three'; -import type { Size } from '../vis/models'; -import type { Rect } from './models'; +import { type Size } from '../vis/models'; +import { type Rect } from './models'; const ZERO_VECTOR = new Vector3(0, 0, 0); diff --git a/packages/lib/src/interactions/hooks.ts b/packages/lib/src/interactions/hooks.ts index fea83e4e7..7053ec2e4 100644 --- a/packages/lib/src/interactions/hooks.ts +++ b/packages/lib/src/interactions/hooks.ts @@ -7,14 +7,14 @@ import { Vector3 } from 'three'; import { useVisCanvasContext } from '../vis/shared/VisCanvasProvider'; import Box from './box'; import { useInteractionsContext } from './InteractionsProvider'; -import type { - CanvasEvent, - InteractionConfig, - ModifierKey, - MouseEventName, - Selection, - UseDragOpts, - UseDragState, +import { + type CanvasEvent, + type InteractionConfig, + type ModifierKey, + type MouseEventName, + type Selection, + type UseDragOpts, + type UseDragState, } from './models'; const ZOOM_FACTOR = 0.95; diff --git a/packages/lib/src/interactions/interaction.ts b/packages/lib/src/interactions/interaction.ts index eb0dd6693..0a797459b 100644 --- a/packages/lib/src/interactions/interaction.ts +++ b/packages/lib/src/interactions/interaction.ts @@ -1,8 +1,7 @@ import { castArray } from '@h5web/shared/vis-utils'; -import type { ModifierKey } from 'react'; +import { type ModifierKey } from 'react'; -import type { InteractionConfig } from './models'; -import { MouseButton } from './models'; +import { type InteractionConfig, MouseButton } from './models'; export class Interaction { public readonly buttons: MouseButton[]; diff --git a/packages/lib/src/interactions/models.ts b/packages/lib/src/interactions/models.ts index 04792c5e2..b263e7ac6 100644 --- a/packages/lib/src/interactions/models.ts +++ b/packages/lib/src/interactions/models.ts @@ -1,4 +1,4 @@ -import type { Vector3 } from 'three'; +import { type Vector3 } from 'three'; export type ModifierKey = 'Alt' | 'Control' | 'Shift'; diff --git a/packages/lib/src/interactions/svg/SvgCircle.tsx b/packages/lib/src/interactions/svg/SvgCircle.tsx index 00be379b6..329b150c4 100644 --- a/packages/lib/src/interactions/svg/SvgCircle.tsx +++ b/packages/lib/src/interactions/svg/SvgCircle.tsx @@ -1,6 +1,6 @@ -import type { SVGProps } from 'react'; +import { type SVGProps } from 'react'; -import type { Rect } from '../models'; +import { type Rect } from '../models'; interface Props extends SVGProps { coords: Rect; diff --git a/packages/lib/src/interactions/svg/SvgElement.tsx b/packages/lib/src/interactions/svg/SvgElement.tsx index 7f005b0c0..2b9299959 100644 --- a/packages/lib/src/interactions/svg/SvgElement.tsx +++ b/packages/lib/src/interactions/svg/SvgElement.tsx @@ -1,4 +1,4 @@ -import type { PropsWithChildren } from 'react'; +import { type PropsWithChildren } from 'react'; import { createPortal } from 'react-dom'; import Html from '../../vis/shared/Html'; diff --git a/packages/lib/src/interactions/svg/SvgLine.tsx b/packages/lib/src/interactions/svg/SvgLine.tsx index 9cffb17f4..7bfc9dba3 100644 --- a/packages/lib/src/interactions/svg/SvgLine.tsx +++ b/packages/lib/src/interactions/svg/SvgLine.tsx @@ -1,6 +1,6 @@ -import type { SVGProps } from 'react'; +import { type SVGProps } from 'react'; -import type { Rect } from '../models'; +import { type Rect } from '../models'; interface Props extends SVGProps { coords: Rect; diff --git a/packages/lib/src/interactions/svg/SvgRect.tsx b/packages/lib/src/interactions/svg/SvgRect.tsx index 4c3424950..d31eb6c54 100644 --- a/packages/lib/src/interactions/svg/SvgRect.tsx +++ b/packages/lib/src/interactions/svg/SvgRect.tsx @@ -1,7 +1,7 @@ -import type { SVGProps } from 'react'; +import { type SVGProps } from 'react'; import Box from '../box'; -import type { Rect } from '../models'; +import { type Rect } from '../models'; interface Props extends SVGProps { coords: Rect; diff --git a/packages/lib/src/toolbar/MeasuredControl.tsx b/packages/lib/src/toolbar/MeasuredControl.tsx index f6096baa7..8f9e7781c 100644 --- a/packages/lib/src/toolbar/MeasuredControl.tsx +++ b/packages/lib/src/toolbar/MeasuredControl.tsx @@ -1,4 +1,4 @@ -import type { ReactElement } from 'react'; +import { type ReactElement } from 'react'; import Measure from 'react-measure'; import styles from './MeasuredControl.module.css'; diff --git a/packages/lib/src/toolbar/OverflowMenu.tsx b/packages/lib/src/toolbar/OverflowMenu.tsx index 320b727d8..b33f1d4e0 100644 --- a/packages/lib/src/toolbar/OverflowMenu.tsx +++ b/packages/lib/src/toolbar/OverflowMenu.tsx @@ -7,8 +7,12 @@ import { useInteractions, } from '@floating-ui/react'; import { useToggle } from '@react-hookz/web'; -import type { PropsWithChildren } from 'react'; -import { cloneElement, isValidElement, useId } from 'react'; +import { + cloneElement, + isValidElement, + type PropsWithChildren, + useId, +} from 'react'; import { FiMenu } from 'react-icons/fi'; import flattenChildren from 'react-keyed-flatten-children'; diff --git a/packages/lib/src/toolbar/Separator.tsx b/packages/lib/src/toolbar/Separator.tsx index e89510301..393ab2675 100644 --- a/packages/lib/src/toolbar/Separator.tsx +++ b/packages/lib/src/toolbar/Separator.tsx @@ -1,4 +1,4 @@ -import type { HTMLAttributes } from 'react'; +import { type HTMLAttributes } from 'react'; import styles from './Toolbar.module.css'; diff --git a/packages/lib/src/toolbar/Toolbar.tsx b/packages/lib/src/toolbar/Toolbar.tsx index 0981e3e0d..3a04d4666 100644 --- a/packages/lib/src/toolbar/Toolbar.tsx +++ b/packages/lib/src/toolbar/Toolbar.tsx @@ -1,11 +1,11 @@ import { useMap, useMeasure } from '@react-hookz/web'; -import type { PropsWithChildren, ReactNode } from 'react'; +import { type PropsWithChildren, type ReactNode } from 'react'; import flattenChildren from 'react-keyed-flatten-children'; -import type { InteractionInfo } from '../interactions/models'; +import { type InteractionInfo } from '../interactions/models'; import InteractionHelp from './controls/InteractionHelp'; import MeasuredControl from './MeasuredControl'; -import type { ReactElementWithKey } from './models'; +import { type ReactElementWithKey } from './models'; import OverflowMenu from './OverflowMenu'; import Separator from './Separator'; import styles from './Toolbar.module.css'; diff --git a/packages/lib/src/toolbar/controls/Btn.tsx b/packages/lib/src/toolbar/controls/Btn.tsx index 185041aff..114499188 100644 --- a/packages/lib/src/toolbar/controls/Btn.tsx +++ b/packages/lib/src/toolbar/controls/Btn.tsx @@ -1,5 +1,9 @@ -import type { ComponentType, HTMLAttributes, SVGAttributes } from 'react'; -import { forwardRef } from 'react'; +import { + type ComponentType, + forwardRef, + type HTMLAttributes, + type SVGAttributes, +} from 'react'; import { MdArrowDropDown } from 'react-icons/md'; import styles from '../Toolbar.module.css'; diff --git a/packages/lib/src/toolbar/controls/ColorMapSelector/ColorMapGradient.tsx b/packages/lib/src/toolbar/controls/ColorMapSelector/ColorMapGradient.tsx index 7932e2003..55e43d155 100644 --- a/packages/lib/src/toolbar/controls/ColorMapSelector/ColorMapGradient.tsx +++ b/packages/lib/src/toolbar/controls/ColorMapSelector/ColorMapGradient.tsx @@ -1,5 +1,5 @@ import { INTERPOLATORS } from '../../../vis/heatmap/interpolators'; -import type { ColorMap } from '../../../vis/heatmap/models'; +import { type ColorMap } from '../../../vis/heatmap/models'; import { getLinearGradient } from '../../../vis/heatmap/utils'; import styles from './ColorMapSelector.module.css'; diff --git a/packages/lib/src/toolbar/controls/ColorMapSelector/ColorMapSelector.tsx b/packages/lib/src/toolbar/controls/ColorMapSelector/ColorMapSelector.tsx index 35ede1386..cfe03bd1d 100644 --- a/packages/lib/src/toolbar/controls/ColorMapSelector/ColorMapSelector.tsx +++ b/packages/lib/src/toolbar/controls/ColorMapSelector/ColorMapSelector.tsx @@ -1,6 +1,6 @@ import { FiShuffle } from 'react-icons/fi'; -import type { ColorMap } from '../../../vis/heatmap/models'; +import { type ColorMap } from '../../../vis/heatmap/models'; import Selector from '../Selector/Selector'; import ToggleBtn from '../ToggleBtn'; import ColorMapGradient from './ColorMapGradient'; diff --git a/packages/lib/src/toolbar/controls/ColorMapSelector/groups.ts b/packages/lib/src/toolbar/controls/ColorMapSelector/groups.ts index 09c2b64f5..35efb01cf 100644 --- a/packages/lib/src/toolbar/controls/ColorMapSelector/groups.ts +++ b/packages/lib/src/toolbar/controls/ColorMapSelector/groups.ts @@ -1,4 +1,4 @@ -import type { ColorMap } from '../../../vis/heatmap/models'; +import { type ColorMap } from '../../../vis/heatmap/models'; export const COLORMAP_GROUPS = { Recommended: ['Viridis', 'Inferno', 'Greys', 'RdBu', 'Rainbow', 'Sinebow'], diff --git a/packages/lib/src/toolbar/controls/DomainWidget/BoundEditor.tsx b/packages/lib/src/toolbar/controls/DomainWidget/BoundEditor.tsx index 324f5e3d1..75f97d35b 100644 --- a/packages/lib/src/toolbar/controls/DomainWidget/BoundEditor.tsx +++ b/packages/lib/src/toolbar/controls/DomainWidget/BoundEditor.tsx @@ -8,7 +8,7 @@ import { } from 'react'; import { FiCheck, FiSlash } from 'react-icons/fi'; -import type { Bound } from '../../../vis/models'; +import { type Bound } from '../../../vis/models'; import { clampBound } from '../../../vis/utils'; import styles from './BoundEditor.module.css'; import domainControlsStyles from './DomainControls.module.css'; diff --git a/packages/lib/src/toolbar/controls/DomainWidget/DomainControls.tsx b/packages/lib/src/toolbar/controls/DomainWidget/DomainControls.tsx index 7dc3c7b63..99a1c834b 100644 --- a/packages/lib/src/toolbar/controls/DomainWidget/DomainControls.tsx +++ b/packages/lib/src/toolbar/controls/DomainWidget/DomainControls.tsx @@ -1,12 +1,10 @@ -import type { Domain } from '@h5web/shared/vis-models'; +import { type Domain } from '@h5web/shared/vis-models'; import { formatBound } from '@h5web/shared/vis-utils'; import { forwardRef, useImperativeHandle, useRef } from 'react'; -import type { DomainErrors } from '../../../vis/models'; -import { DomainError } from '../../../vis/models'; +import { DomainError, type DomainErrors } from '../../../vis/models'; import ToggleBtn from '../ToggleBtn'; -import type { BoundEditorHandle } from './BoundEditor'; -import BoundEditor from './BoundEditor'; +import BoundEditor, { type BoundEditorHandle } from './BoundEditor'; import styles from './DomainControls.module.css'; import ErrorMessage from './ErrorMessage'; diff --git a/packages/lib/src/toolbar/controls/DomainWidget/DomainSlider.tsx b/packages/lib/src/toolbar/controls/DomainWidget/DomainSlider.tsx index 572caeb1e..8445a7566 100644 --- a/packages/lib/src/toolbar/controls/DomainWidget/DomainSlider.tsx +++ b/packages/lib/src/toolbar/controls/DomainWidget/DomainSlider.tsx @@ -1,11 +1,11 @@ -import type { ColorScaleType, Domain } from '@h5web/shared/vis-models'; +import { type ColorScaleType, type Domain } from '@h5web/shared/vis-models'; import { useState } from 'react'; import { FiSkipBack, FiSkipForward } from 'react-icons/fi'; import ReactSlider from 'react-slider'; import { getSafeDomain } from '../../../vis/heatmap/utils'; import { useCombinedDomain } from '../../../vis/hooks'; -import type { DomainErrors } from '../../../vis/models'; +import { type DomainErrors } from '../../../vis/models'; import { clampBound, createScale, extendDomain } from '../../../vis/utils'; import styles from './DomainSlider.module.css'; import Thumb from './Thumb'; diff --git a/packages/lib/src/toolbar/controls/DomainWidget/DomainWidget.tsx b/packages/lib/src/toolbar/controls/DomainWidget/DomainWidget.tsx index 34618fd8c..2e5660a09 100644 --- a/packages/lib/src/toolbar/controls/DomainWidget/DomainWidget.tsx +++ b/packages/lib/src/toolbar/controls/DomainWidget/DomainWidget.tsx @@ -1,14 +1,13 @@ -import type { ColorScaleType, Domain } from '@h5web/shared/vis-models'; +import { type ColorScaleType, type Domain } from '@h5web/shared/vis-models'; import { useClickOutside, useKeyboardEvent, useToggle } from '@react-hookz/web'; import { useEffect, useRef, useState } from 'react'; import { FiEdit3 } from 'react-icons/fi'; import { useSafeDomain, useVisDomain } from '../../../vis/heatmap/hooks'; -import type { CustomDomain, HistogramParams } from '../../../vis/models'; +import { type CustomDomain, type HistogramParams } from '../../../vis/models'; import Histogram from '../Histogram/Histogram'; import ToggleBtn from '../ToggleBtn'; -import type { DomainControlsHandle } from './DomainControls'; -import DomainControls from './DomainControls'; +import DomainControls, { type DomainControlsHandle } from './DomainControls'; import DomainSlider from './DomainSlider'; import styles from './DomainWidget.module.css'; diff --git a/packages/lib/src/toolbar/controls/DomainWidget/Thumb.tsx b/packages/lib/src/toolbar/controls/DomainWidget/Thumb.tsx index da6882f80..d362cc7bd 100644 --- a/packages/lib/src/toolbar/controls/DomainWidget/Thumb.tsx +++ b/packages/lib/src/toolbar/controls/DomainWidget/Thumb.tsx @@ -1,9 +1,8 @@ -import type { HTMLProps } from 'react'; -import { forwardRef } from 'react'; +import { forwardRef, type HTMLProps } from 'react'; import { FiAlertCircle } from 'react-icons/fi'; -import type { IconType } from 'react-icons/lib'; +import { type IconType } from 'react-icons/lib'; -import type { Bound } from '../../../vis/models'; +import { type Bound } from '../../../vis/models'; import styles from './Thumb.module.css'; interface Props extends HTMLProps { diff --git a/packages/lib/src/toolbar/controls/DomainWidget/Track.tsx b/packages/lib/src/toolbar/controls/DomainWidget/Track.tsx index 4b23582c9..9e0c9f85b 100644 --- a/packages/lib/src/toolbar/controls/DomainWidget/Track.tsx +++ b/packages/lib/src/toolbar/controls/DomainWidget/Track.tsx @@ -1,6 +1,6 @@ -import type { Domain } from '@h5web/shared/vis-models'; +import { type Domain } from '@h5web/shared/vis-models'; -import type { Scale } from '../../../vis/models'; +import { type Scale } from '../../../vis/models'; import styles from './Track.module.css'; interface Props { diff --git a/packages/lib/src/toolbar/controls/Histogram/ColorBar.tsx b/packages/lib/src/toolbar/controls/Histogram/ColorBar.tsx index 6eb26541e..522d22ada 100644 --- a/packages/lib/src/toolbar/controls/Histogram/ColorBar.tsx +++ b/packages/lib/src/toolbar/controls/Histogram/ColorBar.tsx @@ -1,6 +1,6 @@ -import type { SVGProps } from 'react'; +import { type SVGProps } from 'react'; -import type { ColorMap } from '../../../vis/heatmap/models'; +import { type ColorMap } from '../../../vis/heatmap/models'; import { getInterpolator, GRADIENT_RANGE } from '../../../vis/heatmap/utils'; interface Props diff --git a/packages/lib/src/toolbar/controls/Histogram/Histogram.tsx b/packages/lib/src/toolbar/controls/Histogram/Histogram.tsx index 493dbba60..e759ba1e6 100644 --- a/packages/lib/src/toolbar/controls/Histogram/Histogram.tsx +++ b/packages/lib/src/toolbar/controls/Histogram/Histogram.tsx @@ -1,12 +1,12 @@ -import type { ColorScaleType, Domain } from '@h5web/shared/vis-models'; +import { type ColorScaleType, type Domain } from '@h5web/shared/vis-models'; import { useMeasure } from '@react-hookz/web'; import { AxisBottom, AxisLeft } from '@visx/axis'; import { scaleLinear } from '@visx/scale'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { useSafeDomain } from '../../../vis/heatmap/hooks'; import { useCombinedDomain, useDomain } from '../../../vis/hooks'; -import type { HistogramParams } from '../../../vis/models'; +import { type HistogramParams } from '../../../vis/models'; import Tick from '../../../vis/shared/Tick'; import { adaptedNumTicks, diff --git a/packages/lib/src/toolbar/controls/Histogram/Marker.tsx b/packages/lib/src/toolbar/controls/Histogram/Marker.tsx index fb8214d5a..db69b0f7c 100644 --- a/packages/lib/src/toolbar/controls/Histogram/Marker.tsx +++ b/packages/lib/src/toolbar/controls/Histogram/Marker.tsx @@ -1,6 +1,5 @@ -import type { UseDrag } from '@visx/drag/lib/useDrag'; -import type { PointerEvent } from 'react'; -import { useMemo } from 'react'; +import { type UseDrag } from '@visx/drag/lib/useDrag'; +import { type PointerEvent, useMemo } from 'react'; const ARROW_SIZE = 10; diff --git a/packages/lib/src/toolbar/controls/Histogram/Markers.tsx b/packages/lib/src/toolbar/controls/Histogram/Markers.tsx index 0f17400c2..5f9709a8b 100644 --- a/packages/lib/src/toolbar/controls/Histogram/Markers.tsx +++ b/packages/lib/src/toolbar/controls/Histogram/Markers.tsx @@ -1,8 +1,8 @@ -import type { Domain } from '@h5web/shared/vis-models'; +import { type Domain } from '@h5web/shared/vis-models'; import { Drag } from '@visx/drag'; import { useState } from 'react'; -import type { Size } from '../../../vis/models'; +import { type Size } from '../../../vis/models'; import styles from './Histogram.module.css'; import Marker from './Marker'; diff --git a/packages/lib/src/toolbar/controls/InteractionHelp.tsx b/packages/lib/src/toolbar/controls/InteractionHelp.tsx index bce59ad19..d37d88a0d 100644 --- a/packages/lib/src/toolbar/controls/InteractionHelp.tsx +++ b/packages/lib/src/toolbar/controls/InteractionHelp.tsx @@ -10,7 +10,7 @@ import { useToggle } from '@react-hookz/web'; import { useId } from 'react'; import { FiHelpCircle } from 'react-icons/fi'; -import type { InteractionInfo } from '../../interactions/models'; +import { type InteractionInfo } from '../../interactions/models'; import toolbarStyles from '../Toolbar.module.css'; import Btn from './Btn'; import { POPOVER_CLEARANCE, useFloatingDismiss } from './hooks'; diff --git a/packages/lib/src/toolbar/controls/LinkBtn.tsx b/packages/lib/src/toolbar/controls/LinkBtn.tsx index 888a3f0df..bffe83085 100644 --- a/packages/lib/src/toolbar/controls/LinkBtn.tsx +++ b/packages/lib/src/toolbar/controls/LinkBtn.tsx @@ -1,4 +1,8 @@ -import type { AnchorHTMLAttributes, ComponentType, SVGAttributes } from 'react'; +import { + type AnchorHTMLAttributes, + type ComponentType, + type SVGAttributes, +} from 'react'; import styles from '../Toolbar.module.css'; diff --git a/packages/lib/src/toolbar/controls/ScaleSelector/MdGraphicEqRotated.tsx b/packages/lib/src/toolbar/controls/ScaleSelector/MdGraphicEqRotated.tsx index babcc08eb..eae9f4591 100644 --- a/packages/lib/src/toolbar/controls/ScaleSelector/MdGraphicEqRotated.tsx +++ b/packages/lib/src/toolbar/controls/ScaleSelector/MdGraphicEqRotated.tsx @@ -2,7 +2,7 @@ * Apache License 2.0 - https://github.com/google/material-design-icons * Copyright (c) Google */ -import type { SVGProps } from 'react'; +import { type SVGProps } from 'react'; function MdGraphicEqRotated(props: SVGProps) { return ( diff --git a/packages/lib/src/toolbar/controls/ScaleSelector/ScaleSelector.tsx b/packages/lib/src/toolbar/controls/ScaleSelector/ScaleSelector.tsx index c8558f18c..75192dd76 100644 --- a/packages/lib/src/toolbar/controls/ScaleSelector/ScaleSelector.tsx +++ b/packages/lib/src/toolbar/controls/ScaleSelector/ScaleSelector.tsx @@ -1,5 +1,5 @@ import { ScaleType } from '@h5web/shared/vis-models'; -import type { IconType } from 'react-icons'; +import { type IconType } from 'react-icons'; import { MdFilterList, MdFlare, MdSort } from 'react-icons/md'; import toolbarStyles from '../../Toolbar.module.css'; diff --git a/packages/lib/src/toolbar/controls/ScaleSelector/SqrtIcon.tsx b/packages/lib/src/toolbar/controls/ScaleSelector/SqrtIcon.tsx index 032bd4eb4..3a34ed7d5 100644 --- a/packages/lib/src/toolbar/controls/ScaleSelector/SqrtIcon.tsx +++ b/packages/lib/src/toolbar/controls/ScaleSelector/SqrtIcon.tsx @@ -1,7 +1,7 @@ /** * Inspired by FiActivity */ -import type { SVGProps } from 'react'; +import { type SVGProps } from 'react'; function SqrtIcon(props: SVGProps) { return ( diff --git a/packages/lib/src/toolbar/controls/Selector/Option.tsx b/packages/lib/src/toolbar/controls/Selector/Option.tsx index f50fc80b3..ce0142529 100644 --- a/packages/lib/src/toolbar/controls/Selector/Option.tsx +++ b/packages/lib/src/toolbar/controls/Selector/Option.tsx @@ -1,6 +1,5 @@ -import type { UseInteractionsReturn } from '@floating-ui/react'; -import { useListItem } from '@floating-ui/react'; -import type { PropsWithChildren } from 'react'; +import { type UseInteractionsReturn, useListItem } from '@floating-ui/react'; +import { type PropsWithChildren } from 'react'; import toolbarStyles from '../../Toolbar.module.css'; diff --git a/packages/lib/src/toolbar/controls/Selector/Selector.tsx b/packages/lib/src/toolbar/controls/Selector/Selector.tsx index bad0b05f5..3d1b4dac1 100644 --- a/packages/lib/src/toolbar/controls/Selector/Selector.tsx +++ b/packages/lib/src/toolbar/controls/Selector/Selector.tsx @@ -4,8 +4,7 @@ import { useInteractions, useListNavigation, } from '@floating-ui/react'; -import type { ReactNode } from 'react'; -import { useId, useRef, useState } from 'react'; +import { type ReactNode, useId, useRef, useState } from 'react'; import { MdArrowDropDown } from 'react-icons/md'; import toolbarStyles from '../../Toolbar.module.css'; diff --git a/packages/lib/src/toolbar/controls/ToggleBtn.tsx b/packages/lib/src/toolbar/controls/ToggleBtn.tsx index 0662158e5..c2b9dd26a 100644 --- a/packages/lib/src/toolbar/controls/ToggleBtn.tsx +++ b/packages/lib/src/toolbar/controls/ToggleBtn.tsx @@ -1,5 +1,4 @@ -import type { BtnProps } from './Btn'; -import Btn from './Btn'; +import Btn, { type BtnProps } from './Btn'; interface Props extends Omit { value: boolean; diff --git a/packages/lib/src/toolbar/controls/ToggleGroup/ToggleGroup.tsx b/packages/lib/src/toolbar/controls/ToggleGroup/ToggleGroup.tsx index 11b2ac6c2..e1cd8e665 100644 --- a/packages/lib/src/toolbar/controls/ToggleGroup/ToggleGroup.tsx +++ b/packages/lib/src/toolbar/controls/ToggleGroup/ToggleGroup.tsx @@ -1,10 +1,8 @@ -import type { ReactElement } from 'react'; +import { type ReactElement } from 'react'; -import type { ToggleGroupContextValue } from './context'; -import { ToggleGroupContext } from './context'; +import { ToggleGroupContext, type ToggleGroupContextValue } from './context'; import styles from './ToggleGroup.module.css'; -import type { ToggleGroupBtnProps } from './ToggleGroupBtn'; -import ToggleGroupBtn from './ToggleGroupBtn'; +import ToggleGroupBtn, { type ToggleGroupBtnProps } from './ToggleGroupBtn'; interface Props extends ToggleGroupContextValue { ariaLabel?: string; diff --git a/packages/lib/src/toolbar/controls/ToggleGroup/ToggleGroupBtn.tsx b/packages/lib/src/toolbar/controls/ToggleGroup/ToggleGroupBtn.tsx index e41f5ff30..742d6ca63 100644 --- a/packages/lib/src/toolbar/controls/ToggleGroup/ToggleGroupBtn.tsx +++ b/packages/lib/src/toolbar/controls/ToggleGroup/ToggleGroupBtn.tsx @@ -1,4 +1,4 @@ -import type { ComponentType, SVGAttributes } from 'react'; +import { type ComponentType, type SVGAttributes } from 'react'; import { useToggleGroupProps } from './context'; import styles from './ToggleGroup.module.css'; diff --git a/packages/lib/src/toolbar/controls/hooks.ts b/packages/lib/src/toolbar/controls/hooks.ts index 7a30bbd38..baf2e765e 100644 --- a/packages/lib/src/toolbar/controls/hooks.ts +++ b/packages/lib/src/toolbar/controls/hooks.ts @@ -1,18 +1,15 @@ -import type { - ElementProps, - FloatingContext, - UseFloatingReturn, -} from '@floating-ui/react'; import { autoUpdate, + type ElementProps, + type FloatingContext, offset, shift, size, useFloating, + type UseFloatingReturn, } from '@floating-ui/react'; import { useClickOutside, useKeyboardEvent, useToggle } from '@react-hookz/web'; -import type { FocusEvent } from 'react'; -import { useCallback, useMemo } from 'react'; +import { type FocusEvent, useCallback, useMemo } from 'react'; export const POPOVER_CLEARANCE = 6; diff --git a/packages/lib/src/toolbar/floating/FloatingControl.tsx b/packages/lib/src/toolbar/floating/FloatingControl.tsx index 3ff77e3ab..7ebcbf741 100644 --- a/packages/lib/src/toolbar/floating/FloatingControl.tsx +++ b/packages/lib/src/toolbar/floating/FloatingControl.tsx @@ -1,4 +1,4 @@ -import type { PropsWithChildren } from 'react'; +import { type PropsWithChildren } from 'react'; import { createPortal } from 'react-dom'; import Html from '../../vis/shared/Html'; diff --git a/packages/lib/src/toolbar/models.ts b/packages/lib/src/toolbar/models.ts index e67245085..990a276d8 100644 --- a/packages/lib/src/toolbar/models.ts +++ b/packages/lib/src/toolbar/models.ts @@ -1,4 +1,4 @@ -import type { ReactElement } from 'react'; +import { type ReactElement } from 'react'; export interface ReactElementWithKey extends ReactElement { key: string; diff --git a/packages/lib/src/toolbar/utils.ts b/packages/lib/src/toolbar/utils.ts index 13600a327..816881345 100644 --- a/packages/lib/src/toolbar/utils.ts +++ b/packages/lib/src/toolbar/utils.ts @@ -1,7 +1,6 @@ -import type { ReactNode } from 'react'; -import { isValidElement } from 'react'; +import { isValidElement, type ReactNode } from 'react'; -import type { ReactElementWithKey } from './models'; +import { type ReactElementWithKey } from './models'; export function isValidElementWithKey( node: ReactNode, diff --git a/packages/lib/src/vis/heatmap/ColorBar.tsx b/packages/lib/src/vis/heatmap/ColorBar.tsx index ea52482eb..3e3d72ea6 100644 --- a/packages/lib/src/vis/heatmap/ColorBar.tsx +++ b/packages/lib/src/vis/heatmap/ColorBar.tsx @@ -1,14 +1,13 @@ -import type { Domain } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; +import { type Domain, ScaleType } from '@h5web/shared/vis-models'; import { formatBound, formatTick } from '@h5web/shared/vis-utils'; import { useMeasure } from '@react-hookz/web'; import { AxisBottom, AxisRight } from '@visx/axis'; -import type { VisScaleType } from '../models'; +import { type VisScaleType } from '../models'; import Tick from '../shared/Tick'; import { adaptedNumTicks, createScale } from '../utils'; import styles from './ColorBar.module.css'; -import type { ColorMap } from './models'; +import { type ColorMap } from './models'; import { getInterpolator, getLinearGradient } from './utils'; interface Props { diff --git a/packages/lib/src/vis/heatmap/HeatmapMaterial.tsx b/packages/lib/src/vis/heatmap/HeatmapMaterial.tsx index a02812a44..abf86a3b4 100644 --- a/packages/lib/src/vis/heatmap/HeatmapMaterial.tsx +++ b/packages/lib/src/vis/heatmap/HeatmapMaterial.tsx @@ -1,23 +1,21 @@ -import type { Domain } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; -import type { RGBColor } from 'd3-color'; -import { rgb } from 'd3-color'; -import type { NdArray } from 'ndarray'; +import { type Domain, ScaleType } from '@h5web/shared/vis-models'; +import { rgb, type RGBColor } from 'd3-color'; +import { type NdArray } from 'ndarray'; import { memo, useMemo } from 'react'; -import type { MagnificationTextureFilter } from 'three'; import { DataTexture, DoubleSide, + type MagnificationTextureFilter, RGBAFormat, UnsignedByteType, Vector4, } from 'three'; -import type { VisScaleType } from '../models'; -import type { VisMeshProps } from '../shared/VisMesh'; +import { type VisScaleType } from '../models'; +import { type VisMeshProps } from '../shared/VisMesh'; import { DEFAULT_DOMAIN, getUniforms, VERTEX_SHADER } from '../utils'; import { useDataTexture } from './hooks'; -import type { ColorMap, TextureSafeTypedArray } from './models'; +import { type ColorMap, type TextureSafeTypedArray } from './models'; import { getInterpolator, scaleDomain } from './utils'; interface Props extends VisMeshProps { diff --git a/packages/lib/src/vis/heatmap/HeatmapMesh.tsx b/packages/lib/src/vis/heatmap/HeatmapMesh.tsx index 9bfdcbbfc..558825792 100644 --- a/packages/lib/src/vis/heatmap/HeatmapMesh.tsx +++ b/packages/lib/src/vis/heatmap/HeatmapMesh.tsx @@ -1,13 +1,12 @@ -import type { Domain } from '@h5web/shared/vis-models'; -import type { RGBColor } from 'd3-color'; -import type { NdArray } from 'ndarray'; -import type { MagnificationTextureFilter } from 'three'; +import { type Domain } from '@h5web/shared/vis-models'; +import { type RGBColor } from 'd3-color'; +import { type NdArray } from 'ndarray'; +import { type MagnificationTextureFilter } from 'three'; -import type { VisScaleType } from '../models'; -import type { VisMeshProps } from '../shared/VisMesh'; -import VisMesh from '../shared/VisMesh'; +import { type VisScaleType } from '../models'; +import VisMesh, { type VisMeshProps } from '../shared/VisMesh'; import HeatmapMaterial from './HeatmapMaterial'; -import type { ColorMap, TextureSafeTypedArray } from './models'; +import { type ColorMap, type TextureSafeTypedArray } from './models'; interface Props extends VisMeshProps { values: NdArray; // uint16 values are treated as half floats diff --git a/packages/lib/src/vis/heatmap/HeatmapVis.tsx b/packages/lib/src/vis/heatmap/HeatmapVis.tsx index adcbca1bd..e8fd4f520 100644 --- a/packages/lib/src/vis/heatmap/HeatmapVis.tsx +++ b/packages/lib/src/vis/heatmap/HeatmapVis.tsx @@ -1,19 +1,23 @@ import { assertDefined } from '@h5web/shared/guards'; -import type { Domain, NumArray } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; +import { + type Domain, + type NumArray, + ScaleType, +} from '@h5web/shared/vis-models'; import { formatTooltipVal, getDims } from '@h5web/shared/vis-utils'; -import type { NdArray } from 'ndarray'; -import type { ReactElement, ReactNode } from 'react'; +import { type NdArray } from 'ndarray'; +import { type ReactElement, type ReactNode } from 'react'; -import type { DefaultInteractionsConfig } from '../../interactions/DefaultInteractions'; -import DefaultInteractions from '../../interactions/DefaultInteractions'; +import DefaultInteractions, { + type DefaultInteractionsConfig, +} from '../../interactions/DefaultInteractions'; import ResetZoomButton from '../../toolbar/floating/ResetZoomButton'; import { useAxisDomain, useValueToIndexScale } from '../hooks'; -import type { - Aspect, - AxisParams, - ClassStyleAttrs, - VisScaleType, +import { + type Aspect, + type AxisParams, + type ClassStyleAttrs, + type VisScaleType, } from '../models'; import TooltipMesh from '../shared/TooltipMesh'; import VisCanvas from '../shared/VisCanvas'; @@ -22,7 +26,7 @@ import ColorBar from './ColorBar'; import HeatmapMesh from './HeatmapMesh'; import styles from './HeatmapVis.module.css'; import { useMask, usePixelEdgeValues, useTextureSafeNdArray } from './hooks'; -import type { ColorMap, TooltipData } from './models'; +import { type ColorMap, type TooltipData } from './models'; interface Props extends ClassStyleAttrs { dataArray: NdArray; diff --git a/packages/lib/src/vis/heatmap/interpolators.ts b/packages/lib/src/vis/heatmap/interpolators.ts index 469de088f..6c61c56d6 100644 --- a/packages/lib/src/vis/heatmap/interpolators.ts +++ b/packages/lib/src/vis/heatmap/interpolators.ts @@ -40,7 +40,7 @@ import { interpolateYlOrRd, } from 'd3-scale-chromatic'; -import type { D3Interpolator } from './models'; +import { type D3Interpolator } from './models'; function interpolateHsl(t: number): string { return hsl(t * 360, 1, 0.5).formatRgb(); diff --git a/packages/lib/src/vis/heatmap/models.ts b/packages/lib/src/vis/heatmap/models.ts index ed52ff4cf..f2d939249 100644 --- a/packages/lib/src/vis/heatmap/models.ts +++ b/packages/lib/src/vis/heatmap/models.ts @@ -1,4 +1,4 @@ -import type { INTERPOLATORS } from './interpolators'; +import { type INTERPOLATORS } from './interpolators'; export type D3Interpolator = (t: number) => string; diff --git a/packages/lib/src/vis/heatmap/utils.ts b/packages/lib/src/vis/heatmap/utils.ts index a6724bb3b..45f8b9bd0 100644 --- a/packages/lib/src/vis/heatmap/utils.ts +++ b/packages/lib/src/vis/heatmap/utils.ts @@ -1,26 +1,31 @@ -import type { Domain, NumArray } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; +import { + type Domain, + type NumArray, + ScaleType, +} from '@h5web/shared/vis-models'; import { getDims, toTypedNdArray } from '@h5web/shared/vis-utils'; import { range } from 'd3-array'; -import type { NdArray } from 'ndarray'; -import ndarray from 'ndarray'; -import type { MagnificationTextureFilter } from 'three'; +import ndarray, { type NdArray } from 'ndarray'; import { ClampToEdgeWrapping, DataTexture, FloatType, HalfFloatType, + type MagnificationTextureFilter, NearestFilter, RedFormat, UnsignedByteType, UVMapping, } from 'three'; -import type { CustomDomain, DomainErrors } from '../models'; -import { DomainError } from '../models'; +import { type CustomDomain, DomainError, type DomainErrors } from '../models'; import { SCALES_VALID_MINS } from '../utils'; import { INTERPOLATORS } from './interpolators'; -import type { ColorMap, D3Interpolator, TextureSafeTypedArray } from './models'; +import { + type ColorMap, + type D3Interpolator, + type TextureSafeTypedArray, +} from './models'; const GRADIENT_PRECISION = 1 / 20; export const GRADIENT_RANGE = range( diff --git a/packages/lib/src/vis/hooks.ts b/packages/lib/src/vis/hooks.ts index 3760a9637..29f07a955 100644 --- a/packages/lib/src/vis/hooks.ts +++ b/packages/lib/src/vis/hooks.ts @@ -1,13 +1,21 @@ import { createMemo } from '@h5web/shared/createMemo'; -import type { AnyNumArray, Domain } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; +import { + type AnyNumArray, + type Domain, + ScaleType, +} from '@h5web/shared/vis-models'; import { getBounds, getValidDomainForScale } from '@h5web/shared/vis-utils'; import { useRerender, useSyncedRef } from '@react-hookz/web'; -import type { Camera } from '@react-three/fiber'; -import { useFrame, useThree } from '@react-three/fiber'; -import type { RefCallback } from 'react'; -import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react'; -import type { BufferAttribute } from 'three'; +import { type Camera, useFrame, useThree } from '@react-three/fiber'; +import { + type RefCallback, + useCallback, + useLayoutEffect, + useMemo, + useRef, + useState, +} from 'react'; +import { type BufferAttribute } from 'three'; import type H5WebGeometry from './shared/h5webGeometry'; import { diff --git a/packages/lib/src/vis/line/DataCurve.tsx b/packages/lib/src/vis/line/DataCurve.tsx index 9d03696d5..0bd998628 100644 --- a/packages/lib/src/vis/line/DataCurve.tsx +++ b/packages/lib/src/vis/line/DataCurve.tsx @@ -1,5 +1,5 @@ -import type { NumArray } from '@h5web/shared/vis-models'; -import type { ThreeEvent } from '@react-three/fiber'; +import { type NumArray } from '@h5web/shared/vis-models'; +import { type ThreeEvent } from '@react-three/fiber'; import { useCallback } from 'react'; import ErrorBars from './ErrorBars'; diff --git a/packages/lib/src/vis/line/ErrorBars.tsx b/packages/lib/src/vis/line/ErrorBars.tsx index b2ebf84a5..33b56fce7 100644 --- a/packages/lib/src/vis/line/ErrorBars.tsx +++ b/packages/lib/src/vis/line/ErrorBars.tsx @@ -1,4 +1,4 @@ -import type { NumArray } from '@h5web/shared/vis-models'; +import { type NumArray } from '@h5web/shared/vis-models'; import { useGeometry } from '../hooks'; import { useVisCanvasContext } from '../shared/VisCanvasProvider'; diff --git a/packages/lib/src/vis/line/Glyphs.tsx b/packages/lib/src/vis/line/Glyphs.tsx index 172c00a3f..ac1d8a9d6 100644 --- a/packages/lib/src/vis/line/Glyphs.tsx +++ b/packages/lib/src/vis/line/Glyphs.tsx @@ -1,5 +1,5 @@ -import type { NumArray } from '@h5web/shared/vis-models'; -import type { PointsProps } from '@react-three/fiber'; +import { type NumArray } from '@h5web/shared/vis-models'; +import { type PointsProps } from '@react-three/fiber'; import { useGeometry } from '../hooks'; import { useVisCanvasContext } from '../shared/VisCanvasProvider'; diff --git a/packages/lib/src/vis/line/Line.tsx b/packages/lib/src/vis/line/Line.tsx index 8cd3ccde6..52b5e5d80 100644 --- a/packages/lib/src/vis/line/Line.tsx +++ b/packages/lib/src/vis/line/Line.tsx @@ -1,6 +1,5 @@ -import type { NumArray } from '@h5web/shared/vis-models'; -import type { Object3DNode } from '@react-three/fiber'; -import { extend } from '@react-three/fiber'; +import { type NumArray } from '@h5web/shared/vis-models'; +import { extend, type Object3DNode } from '@react-three/fiber'; import { Line as R3FLine } from 'three'; import { useGeometry } from '../hooks'; diff --git a/packages/lib/src/vis/line/LineVis.tsx b/packages/lib/src/vis/line/LineVis.tsx index bf251a103..f3ecbda43 100644 --- a/packages/lib/src/vis/line/LineVis.tsx +++ b/packages/lib/src/vis/line/LineVis.tsx @@ -1,24 +1,27 @@ import { assertDefined, assertLength } from '@h5web/shared/guards'; -import type { AxisScaleType, Domain, NumArray } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; +import { + type AxisScaleType, + type Domain, + type NumArray, + ScaleType, +} from '@h5web/shared/vis-models'; import { formatTooltipErr, formatTooltipVal } from '@h5web/shared/vis-utils'; -import type { NdArray } from 'ndarray'; -import type { ReactElement, ReactNode } from 'react'; -import { useMemo } from 'react'; +import { type NdArray } from 'ndarray'; +import { type ReactElement, type ReactNode, useMemo } from 'react'; -import type { DefaultInteractionsConfig } from '../../interactions/DefaultInteractions'; -import DefaultInteractions from '../../interactions/DefaultInteractions'; +import DefaultInteractions, { + type DefaultInteractionsConfig, +} from '../../interactions/DefaultInteractions'; import ResetZoomButton from '../../toolbar/floating/ResetZoomButton'; import { useAxisDomain, useCssColors, useValueToIndexScale } from '../hooks'; -import type { AxisParams, ClassStyleAttrs } from '../models'; +import { type AxisParams, type ClassStyleAttrs } from '../models'; import TooltipMesh from '../shared/TooltipMesh'; import VisCanvas from '../shared/VisCanvas'; import { DEFAULT_DOMAIN, extendDomain } from '../utils'; import DataCurve from './DataCurve'; import { useAxisValues } from './hooks'; import styles from './LineVis.module.css'; -import type { AuxiliaryParams, TooltipData } from './models'; -import { CurveType } from './models'; +import { type AuxiliaryParams, CurveType, type TooltipData } from './models'; interface Props extends ClassStyleAttrs { dataArray: NdArray; diff --git a/packages/lib/src/vis/line/errorBarsGeometry.ts b/packages/lib/src/vis/line/errorBarsGeometry.ts index cda2b78cd..e8f6ff18e 100644 --- a/packages/lib/src/vis/line/errorBarsGeometry.ts +++ b/packages/lib/src/vis/line/errorBarsGeometry.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import type { NumArray } from '@h5web/shared/vis-models'; +import { type NumArray } from '@h5web/shared/vis-models'; -import type { AxisScale } from '../models'; +import { type AxisScale } from '../models'; import H5WebGeometry from '../shared/h5webGeometry'; import { createBufferAttr, Z_OUT } from '../utils'; diff --git a/packages/lib/src/vis/line/errorCapsGeometry.ts b/packages/lib/src/vis/line/errorCapsGeometry.ts index 8e465182c..1776a9c00 100644 --- a/packages/lib/src/vis/line/errorCapsGeometry.ts +++ b/packages/lib/src/vis/line/errorCapsGeometry.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import type { NumArray } from '@h5web/shared/vis-models'; +import { type NumArray } from '@h5web/shared/vis-models'; -import type { AxisScale } from '../models'; +import { type AxisScale } from '../models'; import H5WebGeometry from '../shared/h5webGeometry'; import { createBufferAttr, Z_OUT } from '../utils'; diff --git a/packages/lib/src/vis/line/glyphsGeometry.ts b/packages/lib/src/vis/line/glyphsGeometry.ts index 98c763106..8dbe04ef3 100644 --- a/packages/lib/src/vis/line/glyphsGeometry.ts +++ b/packages/lib/src/vis/line/glyphsGeometry.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import type { NumArray } from '@h5web/shared/vis-models'; +import { type NumArray } from '@h5web/shared/vis-models'; -import type { AxisScale } from '../models'; +import { type AxisScale } from '../models'; import H5WebGeometry from '../shared/h5webGeometry'; import { createBufferAttr, Z_OUT } from '../utils'; diff --git a/packages/lib/src/vis/line/lineGeometry.ts b/packages/lib/src/vis/line/lineGeometry.ts index dcb208965..c9313d68a 100644 --- a/packages/lib/src/vis/line/lineGeometry.ts +++ b/packages/lib/src/vis/line/lineGeometry.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import type { NumArray } from '@h5web/shared/vis-models'; +import { type NumArray } from '@h5web/shared/vis-models'; -import type { AxisScale } from '../models'; +import { type AxisScale } from '../models'; import H5WebGeometry from '../shared/h5webGeometry'; import { createBufferAttr, Z_OUT } from '../utils'; diff --git a/packages/lib/src/vis/line/models.ts b/packages/lib/src/vis/line/models.ts index cc776eb63..f7b638a7b 100644 --- a/packages/lib/src/vis/line/models.ts +++ b/packages/lib/src/vis/line/models.ts @@ -1,5 +1,5 @@ -import type { NumArray } from '@h5web/shared/vis-models'; -import type { NdArray } from 'ndarray'; +import { type NumArray } from '@h5web/shared/vis-models'; +import { type NdArray } from 'ndarray'; export enum CurveType { LineOnly = 'OnlyLine', diff --git a/packages/lib/src/vis/line/utils.ts b/packages/lib/src/vis/line/utils.ts index da3219c5d..6ee852ccf 100644 --- a/packages/lib/src/vis/line/utils.ts +++ b/packages/lib/src/vis/line/utils.ts @@ -1,4 +1,4 @@ -import type { NumArray } from '@h5web/shared/vis-models'; +import { type NumArray } from '@h5web/shared/vis-models'; import { range } from 'd3-array'; export function getAxisValues( diff --git a/packages/lib/src/vis/matrix/Cell.tsx b/packages/lib/src/vis/matrix/Cell.tsx index ce623de61..bbbfe3e0b 100644 --- a/packages/lib/src/vis/matrix/Cell.tsx +++ b/packages/lib/src/vis/matrix/Cell.tsx @@ -1,5 +1,5 @@ import { memo, useContext } from 'react'; -import type { GridChildComponentProps } from 'react-window'; +import { type GridChildComponentProps } from 'react-window'; import { SettingsContext } from './context'; import styles from './MatrixVis.module.css'; diff --git a/packages/lib/src/vis/matrix/Grid.tsx b/packages/lib/src/vis/matrix/Grid.tsx index c54ce103f..3df8271b4 100644 --- a/packages/lib/src/vis/matrix/Grid.tsx +++ b/packages/lib/src/vis/matrix/Grid.tsx @@ -2,7 +2,7 @@ import { useMeasure } from '@react-hookz/web'; import { useContext } from 'react'; import { FixedSizeGrid as IndexedGrid } from 'react-window'; -import type { ClassStyleAttrs } from '../models'; +import { type ClassStyleAttrs } from '../models'; import Cell from './Cell'; import { SettingsContext } from './context'; import styles from './MatrixVis.module.css'; diff --git a/packages/lib/src/vis/matrix/MatrixVis.tsx b/packages/lib/src/vis/matrix/MatrixVis.tsx index 4c0fc966c..e8d6de3d1 100644 --- a/packages/lib/src/vis/matrix/MatrixVis.tsx +++ b/packages/lib/src/vis/matrix/MatrixVis.tsx @@ -1,6 +1,6 @@ -import type { ArrayShape } from '@h5web/shared/hdf5-models'; +import { type ArrayShape } from '@h5web/shared/hdf5-models'; -import type { ClassStyleAttrs } from '../models'; +import { type ClassStyleAttrs } from '../models'; import GridProvider from './context'; import Grid from './Grid'; diff --git a/packages/lib/src/vis/matrix/StickyGrid.tsx b/packages/lib/src/vis/matrix/StickyGrid.tsx index 9d3c8a542..bacce9cf2 100644 --- a/packages/lib/src/vis/matrix/StickyGrid.tsx +++ b/packages/lib/src/vis/matrix/StickyGrid.tsx @@ -1,5 +1,9 @@ -import type { CSSProperties, ReactNode } from 'react'; -import { forwardRef, useContext } from 'react'; +import { + type CSSProperties, + forwardRef, + type ReactNode, + useContext, +} from 'react'; import { RenderedItemsContext, SettingsContext } from './context'; import HeaderCells from './HeaderCells'; diff --git a/packages/lib/src/vis/matrix/context.tsx b/packages/lib/src/vis/matrix/context.tsx index 7eb238dc0..4ff477ae4 100644 --- a/packages/lib/src/vis/matrix/context.tsx +++ b/packages/lib/src/vis/matrix/context.tsx @@ -1,8 +1,7 @@ -import type { ReactNode } from 'react'; -import { createContext, useMemo, useState } from 'react'; -import type { GridOnItemsRenderedProps } from 'react-window'; +import { createContext, type ReactNode, useMemo, useState } from 'react'; +import { type GridOnItemsRenderedProps } from 'react-window'; -import type { Size } from '../models'; +import { type Size } from '../models'; interface GridSettings { rowCount: number; diff --git a/packages/lib/src/vis/models.ts b/packages/lib/src/vis/models.ts index 3ec843f06..9efe8ca05 100644 --- a/packages/lib/src/vis/models.ts +++ b/packages/lib/src/vis/models.ts @@ -1,15 +1,15 @@ -import type { - AxisScaleType, - ColorScaleType, - Domain, - NumArray, - ScaleType, +import { + type AxisScaleType, + type ColorScaleType, + type Domain, + type NumArray, + type ScaleType, } from '@h5web/shared/vis-models'; -import type { PickD3Scale, PickScaleConfigWithoutType } from '@visx/scale'; -import type { HTMLAttributes } from 'react'; +import { type PickD3Scale, type PickScaleConfigWithoutType } from '@visx/scale'; +import { type HTMLAttributes } from 'react'; -import type { ColorMap } from './heatmap/models'; -import type { ScaleGamma } from './scaleGamma'; +import { type ColorMap } from './heatmap/models'; +import { type ScaleGamma } from './scaleGamma'; export interface Size { width: number; diff --git a/packages/lib/src/vis/raw/RawImageVis.tsx b/packages/lib/src/vis/raw/RawImageVis.tsx index ba9ec3b51..720083893 100644 --- a/packages/lib/src/vis/raw/RawImageVis.tsx +++ b/packages/lib/src/vis/raw/RawImageVis.tsx @@ -1,4 +1,4 @@ -import type { ClassStyleAttrs } from '../models'; +import { type ClassStyleAttrs } from '../models'; import styles from './RawImageVis.module.css'; interface Props extends ClassStyleAttrs { diff --git a/packages/lib/src/vis/raw/RawVis.tsx b/packages/lib/src/vis/raw/RawVis.tsx index 492057deb..6748ebb11 100644 --- a/packages/lib/src/vis/raw/RawVis.tsx +++ b/packages/lib/src/vis/raw/RawVis.tsx @@ -1,6 +1,6 @@ import { isTypedArray } from '@h5web/shared/guards'; -import type { ClassStyleAttrs } from '../models'; +import { type ClassStyleAttrs } from '../models'; import styles from './RawVis.module.css'; const LARGE_THRESHOLD = 1_000_000; diff --git a/packages/lib/src/vis/rgb/RgbMesh.tsx b/packages/lib/src/vis/rgb/RgbMesh.tsx index d3938e22a..eac1da40d 100644 --- a/packages/lib/src/vis/rgb/RgbMesh.tsx +++ b/packages/lib/src/vis/rgb/RgbMesh.tsx @@ -1,8 +1,7 @@ -import type { NdArray } from 'ndarray'; +import { type NdArray } from 'ndarray'; import { useMemo } from 'react'; -import type { VisMeshProps } from '../shared/VisMesh'; -import VisMesh from '../shared/VisMesh'; +import VisMesh, { type VisMeshProps } from '../shared/VisMesh'; import { getUniforms, VERTEX_SHADER } from '../utils'; import { getData3DTexture } from './utils'; diff --git a/packages/lib/src/vis/rgb/RgbVis.tsx b/packages/lib/src/vis/rgb/RgbVis.tsx index 206747e41..073249602 100644 --- a/packages/lib/src/vis/rgb/RgbVis.tsx +++ b/packages/lib/src/vis/rgb/RgbVis.tsx @@ -1,17 +1,17 @@ import { assertDefined } from '@h5web/shared/guards'; -import type { NumArray } from '@h5web/shared/vis-models'; +import { type NumArray } from '@h5web/shared/vis-models'; import { getDims } from '@h5web/shared/vis-utils'; -import type { NdArray } from 'ndarray'; -import type { ReactNode } from 'react'; -import { useMemo } from 'react'; +import { type NdArray } from 'ndarray'; +import { type ReactNode, useMemo } from 'react'; -import type { DefaultInteractionsConfig } from '../../interactions/DefaultInteractions'; -import DefaultInteractions from '../../interactions/DefaultInteractions'; +import DefaultInteractions, { + type DefaultInteractionsConfig, +} from '../../interactions/DefaultInteractions'; import ResetZoomButton from '../../toolbar/floating/ResetZoomButton'; import styles from '../heatmap/HeatmapVis.module.css'; import { usePixelEdgeValues } from '../heatmap/hooks'; import { useAxisDomain } from '../hooks'; -import type { Aspect, AxisParams, ClassStyleAttrs } from '../models'; +import { type Aspect, type AxisParams, type ClassStyleAttrs } from '../models'; import VisCanvas from '../shared/VisCanvas'; import { ImageType } from './models'; import RgbMesh from './RgbMesh'; diff --git a/packages/lib/src/vis/rgb/utils.ts b/packages/lib/src/vis/rgb/utils.ts index 5302c957c..6a83b13a9 100644 --- a/packages/lib/src/vis/rgb/utils.ts +++ b/packages/lib/src/vis/rgb/utils.ts @@ -1,7 +1,6 @@ -import type { NumArray } from '@h5web/shared/vis-models'; +import { type NumArray } from '@h5web/shared/vis-models'; import { getDims, toTypedNdArray } from '@h5web/shared/vis-utils'; -import type { NdArray } from 'ndarray'; -import ndarray from 'ndarray'; +import ndarray, { type NdArray } from 'ndarray'; import { Data3DTexture, FloatType, RedFormat, UnsignedByteType } from 'three'; /* diff --git a/packages/lib/src/vis/scalar/ScalarVis.tsx b/packages/lib/src/vis/scalar/ScalarVis.tsx index 8ace95c7e..47a458d72 100644 --- a/packages/lib/src/vis/scalar/ScalarVis.tsx +++ b/packages/lib/src/vis/scalar/ScalarVis.tsx @@ -1,4 +1,4 @@ -import type { ClassStyleAttrs } from '../models'; +import { type ClassStyleAttrs } from '../models'; import styles from './ScalarVis.module.css'; interface Props extends ClassStyleAttrs { diff --git a/packages/lib/src/vis/scaleGamma.ts b/packages/lib/src/vis/scaleGamma.ts index 63be7b695..a74f568ae 100644 --- a/packages/lib/src/vis/scaleGamma.ts +++ b/packages/lib/src/vis/scaleGamma.ts @@ -1,14 +1,14 @@ -import type { Domain } from '@h5web/shared/vis-models'; +import { type Domain } from '@h5web/shared/vis-models'; import { scalePower } from '@visx/scale'; import { interpolateNumber, interpolateRound } from 'd3-interpolate'; -import type { - InterpolatorFactory, - NumberValue, - ScalePower, - UnknownReturnType, +import { + type InterpolatorFactory, + type NumberValue, + type ScalePower, + type UnknownReturnType, } from 'd3-scale'; -import type { ScaleGammaConfig } from './models'; +import { type ScaleGammaConfig } from './models'; function normalize(a: number, b: number) { const extent = b - a; diff --git a/packages/lib/src/vis/scatter/ScatterPoints.tsx b/packages/lib/src/vis/scatter/ScatterPoints.tsx index d98841da4..ad4c486c6 100644 --- a/packages/lib/src/vis/scatter/ScatterPoints.tsx +++ b/packages/lib/src/vis/scatter/ScatterPoints.tsx @@ -1,13 +1,13 @@ -import type { - ColorScaleType, - Domain, - NumArray, +import { + type ColorScaleType, + type Domain, + type NumArray, } from '@h5web/shared/vis-models'; -import type { ThreeEvent } from '@react-three/fiber'; +import { type ThreeEvent } from '@react-three/fiber'; import { useCallback, useMemo } from 'react'; import { useInterpolator } from '../heatmap/hooks'; -import type { ColorMap } from '../heatmap/models'; +import { type ColorMap } from '../heatmap/models'; import { useGeometry } from '../hooks'; import GlyphMaterial from '../line/GlyphMaterial'; import { GlyphType } from '../line/models'; diff --git a/packages/lib/src/vis/scatter/ScatterVis.tsx b/packages/lib/src/vis/scatter/ScatterVis.tsx index 8dd1fb3b9..6cb019519 100644 --- a/packages/lib/src/vis/scatter/ScatterVis.tsx +++ b/packages/lib/src/vis/scatter/ScatterVis.tsx @@ -1,26 +1,27 @@ import { assertDefined, assertLength } from '@h5web/shared/guards'; -import type { - ColorScaleType, - Domain, - NumArray, +import { + type ColorScaleType, + type Domain, + type NumArray, + ScaleType, } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; import { formatTooltipVal } from '@h5web/shared/vis-utils'; -import type { ThreeEvent } from '@react-three/fiber'; +import { type ThreeEvent } from '@react-three/fiber'; import { useTooltip } from '@visx/tooltip'; -import type { NdArray } from 'ndarray'; -import type { ReactNode } from 'react'; +import { type NdArray } from 'ndarray'; +import { type ReactNode } from 'react'; -import type { DefaultInteractionsConfig } from '../../interactions/DefaultInteractions'; -import DefaultInteractions from '../../interactions/DefaultInteractions'; +import DefaultInteractions, { + type DefaultInteractionsConfig, +} from '../../interactions/DefaultInteractions'; import ResetZoomButton from '../../toolbar/floating/ResetZoomButton'; import ColorBar from '../heatmap/ColorBar'; -import type { ColorMap } from '../heatmap/models'; +import { type ColorMap } from '../heatmap/models'; import { useAxisDomain } from '../hooks'; -import type { ClassStyleAttrs } from '../models'; +import { type ClassStyleAttrs } from '../models'; import TooltipOverlay from '../shared/TooltipOverlay'; import VisCanvas from '../shared/VisCanvas'; -import type { ScatterAxisParams } from './models'; +import { type ScatterAxisParams } from './models'; import ScatterPoints from './ScatterPoints'; import styles from './ScatterVis.module.css'; diff --git a/packages/lib/src/vis/scatter/models.ts b/packages/lib/src/vis/scatter/models.ts index 500dd5b10..ef833f567 100644 --- a/packages/lib/src/vis/scatter/models.ts +++ b/packages/lib/src/vis/scatter/models.ts @@ -1,4 +1,4 @@ -import type { AxisScaleType, NumArray } from '@h5web/shared/vis-models'; +import { type AxisScaleType, type NumArray } from '@h5web/shared/vis-models'; export interface ScatterAxisParams { label?: string; diff --git a/packages/lib/src/vis/scatter/scatterPointsGeometry.ts b/packages/lib/src/vis/scatter/scatterPointsGeometry.ts index 094e80a64..af1b0b38d 100644 --- a/packages/lib/src/vis/scatter/scatterPointsGeometry.ts +++ b/packages/lib/src/vis/scatter/scatterPointsGeometry.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import type { ColorScaleType, NumArray } from '@h5web/shared/vis-models'; +import { type ColorScaleType, type NumArray } from '@h5web/shared/vis-models'; import { rgb } from 'd3-color'; -import type { D3Interpolator } from '../heatmap/models'; -import type { AxisScale, Scale } from '../models'; +import { type D3Interpolator } from '../heatmap/models'; +import { type AxisScale, type Scale } from '../models'; import H5WebGeometry from '../shared/h5webGeometry'; import { createBufferAttr, Z_OUT } from '../utils'; diff --git a/packages/lib/src/vis/shared/Annotation.tsx b/packages/lib/src/vis/shared/Annotation.tsx index a8e452a1b..21a09b9e6 100644 --- a/packages/lib/src/vis/shared/Annotation.tsx +++ b/packages/lib/src/vis/shared/Annotation.tsx @@ -1,4 +1,4 @@ -import type { HTMLAttributes } from 'react'; +import { type HTMLAttributes } from 'react'; import { Vector3 } from 'three'; import { useCameraState } from '../hooks'; diff --git a/packages/lib/src/vis/shared/Axis.tsx b/packages/lib/src/vis/shared/Axis.tsx index 6d6dab4aa..b8342f56b 100644 --- a/packages/lib/src/vis/shared/Axis.tsx +++ b/packages/lib/src/vis/shared/Axis.tsx @@ -1,11 +1,9 @@ -import type { Domain } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; -import type { SharedAxisProps } from '@visx/axis'; -import { AxisBottom, AxisLeft } from '@visx/axis'; +import { type Domain, ScaleType } from '@h5web/shared/vis-models'; +import { AxisBottom, AxisLeft, type SharedAxisProps } from '@visx/axis'; import { GridColumns, GridRows } from '@visx/grid'; -import type { ElementType } from 'react'; +import { type ElementType } from 'react'; -import type { AxisConfig, AxisScale, Size } from '../models'; +import { type AxisConfig, type AxisScale, type Size } from '../models'; import { adaptedNumTicks, createScale, diff --git a/packages/lib/src/vis/shared/AxisSystem.tsx b/packages/lib/src/vis/shared/AxisSystem.tsx index 518d322c2..b93b348ab 100644 --- a/packages/lib/src/vis/shared/AxisSystem.tsx +++ b/packages/lib/src/vis/shared/AxisSystem.tsx @@ -1,7 +1,7 @@ import { createPortal } from 'react-dom'; import { useCameraState } from '../hooks'; -import type { AxisOffsets } from '../models'; +import { type AxisOffsets } from '../models'; import Axis from './Axis'; import Html from './Html'; import { useVisCanvasContext } from './VisCanvasProvider'; diff --git a/packages/lib/src/vis/shared/DataToHtml.tsx b/packages/lib/src/vis/shared/DataToHtml.tsx index ac8217ba5..b423e5be0 100644 --- a/packages/lib/src/vis/shared/DataToHtml.tsx +++ b/packages/lib/src/vis/shared/DataToHtml.tsx @@ -1,6 +1,6 @@ -import type { MappedTuple } from '@h5web/shared/vis-models'; -import type { ReactNode } from 'react'; -import type { Vector3 } from 'three'; +import { type MappedTuple } from '@h5web/shared/vis-models'; +import { type ReactNode } from 'react'; +import { type Vector3 } from 'three'; import { useCameraState } from '../hooks'; import { useVisCanvasContext } from './VisCanvasProvider'; diff --git a/packages/lib/src/vis/shared/Html.tsx b/packages/lib/src/vis/shared/Html.tsx index ec14685f4..a84b16863 100644 --- a/packages/lib/src/vis/shared/Html.tsx +++ b/packages/lib/src/vis/shared/Html.tsx @@ -1,8 +1,6 @@ -import type { PropsWithChildren } from 'react'; -import { useLayoutEffect, useState } from 'react'; +import { type PropsWithChildren, useLayoutEffect, useState } from 'react'; import { createPortal } from 'react-dom'; -import type { Root } from 'react-dom/client'; -import { createRoot } from 'react-dom/client'; +import { createRoot, type Root } from 'react-dom/client'; import { useVisCanvasContext } from './VisCanvasProvider'; diff --git a/packages/lib/src/vis/shared/Overlay.tsx b/packages/lib/src/vis/shared/Overlay.tsx index 7183da770..341ae469d 100644 --- a/packages/lib/src/vis/shared/Overlay.tsx +++ b/packages/lib/src/vis/shared/Overlay.tsx @@ -1,4 +1,4 @@ -import type { CSSProperties, PropsWithChildren } from 'react'; +import { type CSSProperties, type PropsWithChildren } from 'react'; import Html from './Html'; import { useVisCanvasContext } from './VisCanvasProvider'; diff --git a/packages/lib/src/vis/shared/R3FCanvas.tsx b/packages/lib/src/vis/shared/R3FCanvas.tsx index 51fb05845..699626cbe 100644 --- a/packages/lib/src/vis/shared/R3FCanvas.tsx +++ b/packages/lib/src/vis/shared/R3FCanvas.tsx @@ -1,5 +1,5 @@ import { Canvas } from '@react-three/fiber'; -import type { PropsWithChildren } from 'react'; +import { type PropsWithChildren } from 'react'; import { CAMERA_FAR, CAMERA_NEAR, CAMERA_Z } from '../utils'; diff --git a/packages/lib/src/vis/shared/Tick.tsx b/packages/lib/src/vis/shared/Tick.tsx index da8849e31..fd6ec71ee 100644 --- a/packages/lib/src/vis/shared/Tick.tsx +++ b/packages/lib/src/vis/shared/Tick.tsx @@ -1,4 +1,4 @@ -import type { TickRendererProps } from '@visx/axis'; +import { type TickRendererProps } from '@visx/axis'; function Tick(props: TickRendererProps) { const { formattedValue, ...tickProps } = props; diff --git a/packages/lib/src/vis/shared/TooltipMesh.tsx b/packages/lib/src/vis/shared/TooltipMesh.tsx index 6dc71ee4e..b2f964923 100644 --- a/packages/lib/src/vis/shared/TooltipMesh.tsx +++ b/packages/lib/src/vis/shared/TooltipMesh.tsx @@ -1,9 +1,8 @@ -import type { ThreeEvent } from '@react-three/fiber'; +import { type ThreeEvent } from '@react-three/fiber'; import { useTooltip } from '@visx/tooltip'; -import type { ReactElement } from 'react'; -import { useCallback } from 'react'; +import { type ReactElement, useCallback } from 'react'; -import type { Coords, Size } from '../models'; +import { type Coords, type Size } from '../models'; import TooltipOverlay from './TooltipOverlay'; import { useVisCanvasContext } from './VisCanvasProvider'; import VisMesh from './VisMesh'; diff --git a/packages/lib/src/vis/shared/TooltipOverlay.tsx b/packages/lib/src/vis/shared/TooltipOverlay.tsx index 2c05d4e53..9d4650b85 100644 --- a/packages/lib/src/vis/shared/TooltipOverlay.tsx +++ b/packages/lib/src/vis/shared/TooltipOverlay.tsx @@ -1,6 +1,6 @@ import { Line } from '@visx/shape'; import { TooltipWithBounds } from '@visx/tooltip'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import Overlay from './Overlay'; import styles from './TooltipMesh.module.css'; diff --git a/packages/lib/src/vis/shared/ViewportCenterer.tsx b/packages/lib/src/vis/shared/ViewportCenterer.tsx index f8a3229e3..e15a94292 100644 --- a/packages/lib/src/vis/shared/ViewportCenterer.tsx +++ b/packages/lib/src/vis/shared/ViewportCenterer.tsx @@ -1,6 +1,6 @@ import { useFrame, useThree } from '@react-three/fiber'; import { useEffect, useRef } from 'react'; -import type { Vector3 } from 'three'; +import { type Vector3 } from 'three'; import { useMoveCameraTo } from '../../interactions/hooks'; import { useVisCanvasContext } from './VisCanvasProvider'; diff --git a/packages/lib/src/vis/shared/VisCanvas.tsx b/packages/lib/src/vis/shared/VisCanvas.tsx index fa41d660c..c95c5b640 100644 --- a/packages/lib/src/vis/shared/VisCanvas.tsx +++ b/packages/lib/src/vis/shared/VisCanvas.tsx @@ -1,8 +1,7 @@ -import type { PropsWithChildren } from 'react'; -import { useState } from 'react'; +import { type PropsWithChildren, useState } from 'react'; import InteractionsProvider from '../../interactions/InteractionsProvider'; -import type { Aspect, AxisConfig } from '../models'; +import { type Aspect, type AxisConfig } from '../models'; import { getAxisOffsets, getVisRatio } from '../utils'; import AxisSystem from './AxisSystem'; import R3FCanvas from './R3FCanvas'; diff --git a/packages/lib/src/vis/shared/VisCanvasProvider.tsx b/packages/lib/src/vis/shared/VisCanvasProvider.tsx index 16aa21822..7b66a6a8c 100644 --- a/packages/lib/src/vis/shared/VisCanvasProvider.tsx +++ b/packages/lib/src/vis/shared/VisCanvasProvider.tsx @@ -1,13 +1,17 @@ import { assertDefined, assertNonNull } from '@h5web/shared/guards'; -import type { VisibleDomains } from '@h5web/shared/vis-models'; +import { type VisibleDomains } from '@h5web/shared/vis-models'; import { useThree } from '@react-three/fiber'; -import type { PropsWithChildren } from 'react'; -import { createContext, useCallback, useContext, useMemo } from 'react'; -import type { Camera } from 'three'; -import { Matrix4, Vector3 } from 'three'; +import { + createContext, + type PropsWithChildren, + useCallback, + useContext, + useMemo, +} from 'react'; +import { type Camera, Matrix4, Vector3 } from 'three'; import Box from '../../interactions/box'; -import type { AxisConfig, AxisScale, Size } from '../models'; +import { type AxisConfig, type AxisScale, type Size } from '../models'; import { getCanvasAxisScale, getSizeToFit } from '../utils'; export interface VisCanvasContextValue { diff --git a/packages/lib/src/vis/shared/VisMesh.tsx b/packages/lib/src/vis/shared/VisMesh.tsx index c9732be5a..ce687ba6e 100644 --- a/packages/lib/src/vis/shared/VisMesh.tsx +++ b/packages/lib/src/vis/shared/VisMesh.tsx @@ -1,6 +1,6 @@ -import type { MeshProps } from '@react-three/fiber'; +import { type MeshProps } from '@react-three/fiber'; -import type { Size } from '../models'; +import { type Size } from '../models'; import { useVisCanvasContext } from './VisCanvasProvider'; interface Props extends MeshProps { diff --git a/packages/lib/src/vis/shared/h5webGeometry.ts b/packages/lib/src/vis/shared/h5webGeometry.ts index f31c90bec..126128ada 100644 --- a/packages/lib/src/vis/shared/h5webGeometry.ts +++ b/packages/lib/src/vis/shared/h5webGeometry.ts @@ -1,5 +1,4 @@ -import type { BufferAttribute } from 'three'; -import { BufferGeometry } from 'three'; +import { type BufferAttribute, BufferGeometry } from 'three'; abstract class H5WebGeometry< AttributeNames extends string, diff --git a/packages/lib/src/vis/surface/SurfaceMesh.tsx b/packages/lib/src/vis/surface/SurfaceMesh.tsx index e6d5ce03c..a59056517 100644 --- a/packages/lib/src/vis/surface/SurfaceMesh.tsx +++ b/packages/lib/src/vis/surface/SurfaceMesh.tsx @@ -1,15 +1,15 @@ -import type { - ColorScaleType, - Domain, - NumArray, +import { + type ColorScaleType, + type Domain, + type NumArray, } from '@h5web/shared/vis-models'; import { getDims } from '@h5web/shared/vis-utils'; -import type { NdArray } from 'ndarray'; +import { type NdArray } from 'ndarray'; import { LinearFilter } from 'three'; import HeatmapMaterial from '../heatmap/HeatmapMaterial'; import { useTextureSafeNdArray } from '../heatmap/hooks'; -import type { ColorMap } from '../heatmap/models'; +import { type ColorMap } from '../heatmap/models'; import { useGeometry } from '../hooks'; import GlyphMaterial from '../line/GlyphMaterial'; import { GlyphType } from '../line/models'; diff --git a/packages/lib/src/vis/surface/SurfaceVis.tsx b/packages/lib/src/vis/surface/SurfaceVis.tsx index a5fae7b75..6d148fd04 100644 --- a/packages/lib/src/vis/surface/SurfaceVis.tsx +++ b/packages/lib/src/vis/surface/SurfaceVis.tsx @@ -1,15 +1,15 @@ -import type { - ColorScaleType, - Domain, - NumArray, +import { + type ColorScaleType, + type Domain, + type NumArray, + ScaleType, } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; -import type { NdArray } from 'ndarray'; -import type { PropsWithChildren } from 'react'; +import { type NdArray } from 'ndarray'; +import { type PropsWithChildren } from 'react'; import ColorBar from '../heatmap/ColorBar'; -import type { ColorMap } from '../heatmap/models'; -import type { ClassStyleAttrs } from '../models'; +import { type ColorMap } from '../heatmap/models'; +import { type ClassStyleAttrs } from '../models'; import R3FCanvas from '../shared/R3FCanvas'; import SurfaceMesh from './SurfaceMesh'; import styles from './SurfaceVis.module.css'; diff --git a/packages/lib/src/vis/surface/surfaceMeshGeometry.ts b/packages/lib/src/vis/surface/surfaceMeshGeometry.ts index 96df64bea..bc8f65a2a 100644 --- a/packages/lib/src/vis/surface/surfaceMeshGeometry.ts +++ b/packages/lib/src/vis/surface/surfaceMeshGeometry.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import type { NumArray } from '@h5web/shared/vis-models'; +import { type NumArray } from '@h5web/shared/vis-models'; import H5WebGeometry from '../shared/h5webGeometry'; import { createBufferAttr, createIndex } from '../utils'; diff --git a/packages/lib/src/vis/tiles/Tile.tsx b/packages/lib/src/vis/tiles/Tile.tsx index 348736cf9..f646a4caa 100644 --- a/packages/lib/src/vis/tiles/Tile.tsx +++ b/packages/lib/src/vis/tiles/Tile.tsx @@ -1,12 +1,11 @@ import { useThrottledCallback } from '@react-hookz/web'; -import type { ThreeEvent } from '@react-three/fiber'; +import { type ThreeEvent } from '@react-three/fiber'; import { memo } from 'react'; -import type { MagnificationTextureFilter } from 'three'; -import { Vector2 } from 'three'; +import { type MagnificationTextureFilter, Vector2 } from 'three'; import HeatmapMesh from '../heatmap/HeatmapMesh'; -import type { TilesApi } from './api'; -import type { ColorMapProps, TileArray } from './models'; +import { type TilesApi } from './api'; +import { type ColorMapProps, type TileArray } from './models'; interface Props extends ColorMapProps { api: TilesApi; diff --git a/packages/lib/src/vis/tiles/TiledHeatmapMesh.tsx b/packages/lib/src/vis/tiles/TiledHeatmapMesh.tsx index c1d7b13d7..57a87b067 100644 --- a/packages/lib/src/vis/tiles/TiledHeatmapMesh.tsx +++ b/packages/lib/src/vis/tiles/TiledHeatmapMesh.tsx @@ -1,14 +1,13 @@ import { range } from 'd3-array'; import { useRef } from 'react'; -import type { Group } from 'three'; -import { MathUtils } from 'three'; +import { type Group, MathUtils } from 'three'; import { useCameraState } from '../hooks'; -import type { Size } from '../models'; +import { type Size } from '../models'; import { useVisCanvasContext } from '../shared/VisCanvasProvider'; -import type { TilesApi } from './api'; +import { type TilesApi } from './api'; import { useTooltipOnMoveHandler } from './hooks'; -import type { ColorMapProps } from './models'; +import { type ColorMapProps } from './models'; import TiledLayer from './TiledLayer'; import { getNdcToObject3DMatrix, diff --git a/packages/lib/src/vis/tiles/TiledLayer.tsx b/packages/lib/src/vis/tiles/TiledLayer.tsx index 93b8a37a7..c11002f58 100644 --- a/packages/lib/src/vis/tiles/TiledLayer.tsx +++ b/packages/lib/src/vis/tiles/TiledLayer.tsx @@ -1,11 +1,10 @@ -import type { ThreeEvent } from '@react-three/fiber'; +import { type ThreeEvent } from '@react-three/fiber'; import { Suspense } from 'react'; -import type { Box3 } from 'three'; -import { LinearFilter, NearestFilter, Vector2 } from 'three'; +import { type Box3, LinearFilter, NearestFilter, Vector2 } from 'three'; -import type { Size } from '../models'; -import type { TilesApi } from './api'; -import type { ColorMapProps, TileArray } from './models'; +import { type Size } from '../models'; +import { type TilesApi } from './api'; +import { type ColorMapProps, type TileArray } from './models'; import Tile from './Tile'; import { getTileOffsets, diff --git a/packages/lib/src/vis/tiles/TiledTooltipMesh.tsx b/packages/lib/src/vis/tiles/TiledTooltipMesh.tsx index c7a97e037..201b514be 100644 --- a/packages/lib/src/vis/tiles/TiledTooltipMesh.tsx +++ b/packages/lib/src/vis/tiles/TiledTooltipMesh.tsx @@ -1,6 +1,6 @@ -import type { ReactElement } from 'react'; +import { type ReactElement } from 'react'; -import type { Size } from '../models'; +import { type Size } from '../models'; import TooltipMesh from '../shared/TooltipMesh'; import { useTooltipStore } from './store'; diff --git a/packages/lib/src/vis/tiles/api.ts b/packages/lib/src/vis/tiles/api.ts index f71a82ca0..34c2a8404 100644 --- a/packages/lib/src/vis/tiles/api.ts +++ b/packages/lib/src/vis/tiles/api.ts @@ -1,7 +1,7 @@ -import type { Vector2 } from 'three'; +import { type Vector2 } from 'three'; -import type { Size } from '../models'; -import type { TileArray } from './models'; +import { type Size } from '../models'; +import { type TileArray } from './models'; export function getLayerSizes( baseLayerSize: Size, diff --git a/packages/lib/src/vis/tiles/hooks.ts b/packages/lib/src/vis/tiles/hooks.ts index 582ea10f0..424d2552b 100644 --- a/packages/lib/src/vis/tiles/hooks.ts +++ b/packages/lib/src/vis/tiles/hooks.ts @@ -1,8 +1,8 @@ -import type { ThreeEvent } from '@react-three/fiber'; +import { type ThreeEvent } from '@react-three/fiber'; import { useCallback } from 'react'; import { useVisCanvasContext } from '../shared/VisCanvasProvider'; -import type { TileArray } from './models'; +import { type TileArray } from './models'; import { useTooltipStore } from './store'; export function useTooltipOnMoveHandler(): ( diff --git a/packages/lib/src/vis/tiles/models.ts b/packages/lib/src/vis/tiles/models.ts index ae836d943..a5711502f 100644 --- a/packages/lib/src/vis/tiles/models.ts +++ b/packages/lib/src/vis/tiles/models.ts @@ -1,8 +1,8 @@ -import type { Domain } from '@h5web/shared/vis-models'; -import type { NdArray } from 'ndarray'; +import { type Domain } from '@h5web/shared/vis-models'; +import { type NdArray } from 'ndarray'; -import type { ColorMap, TextureSafeTypedArray } from '../heatmap/models'; -import type { VisScaleType } from '../models'; +import { type ColorMap, type TextureSafeTypedArray } from '../heatmap/models'; +import { type VisScaleType } from '../models'; export interface ColorMapProps { domain: Domain; diff --git a/packages/lib/src/vis/tiles/utils.ts b/packages/lib/src/vis/tiles/utils.ts index 5d8f13961..db5da5bda 100644 --- a/packages/lib/src/vis/tiles/utils.ts +++ b/packages/lib/src/vis/tiles/utils.ts @@ -1,10 +1,16 @@ import { ScaleType } from '@h5web/shared/vis-models'; -import type { Camera } from '@react-three/fiber'; -import type { RefObject } from 'react'; -import type { Matrix4, Object3D } from 'three'; -import { Box2, Box3, Vector2, Vector3 } from 'three'; - -import type { Size } from '../models'; +import { type Camera } from '@react-three/fiber'; +import { type RefObject } from 'react'; +import { + Box2, + Box3, + type Matrix4, + type Object3D, + Vector2, + Vector3, +} from 'three'; + +import { type Size } from '../models'; import { createScale } from '../utils'; export function getTileOffsets(box: Box2, tileSize: Size): Vector2[] { diff --git a/packages/lib/src/vis/utils.test.ts b/packages/lib/src/vis/utils.test.ts index b8a6a1a06..72a405e1b 100644 --- a/packages/lib/src/vis/utils.test.ts +++ b/packages/lib/src/vis/utils.test.ts @@ -1,5 +1,4 @@ -import type { Domain } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; +import { type Domain, ScaleType } from '@h5web/shared/vis-models'; import { tickStep } from 'd3-array'; import { describe, expect, it } from 'vitest'; diff --git a/packages/lib/src/vis/utils.ts b/packages/lib/src/vis/utils.ts index e6949c513..34e26f2f3 100644 --- a/packages/lib/src/vis/utils.ts +++ b/packages/lib/src/vis/utils.ts @@ -1,13 +1,13 @@ import { isDefined } from '@h5web/shared/guards'; -import type { - AnyNumArray, - AxisScaleType, - ColorScaleType, - Domain, - NumArray, - TypedArrayConstructor, +import { + type AnyNumArray, + type AxisScaleType, + type ColorScaleType, + type Domain, + type NumArray, + ScaleType, + type TypedArrayConstructor, } from '@h5web/shared/vis-models'; -import { ScaleType } from '@h5web/shared/vis-models'; import { formatTick, getBounds, @@ -21,21 +21,20 @@ import { scaleThreshold, } from '@visx/scale'; import { range, tickStep } from 'd3-array'; -import type { ScaleLinear, ScaleThreshold } from 'd3-scale'; -import type { IUniform } from 'three'; -import { BufferAttribute, MathUtils } from 'three'; - -import type { - Aspect, - AxisConfig, - AxisOffsets, - AxisScale, - ExtractScaleType, - Scale, - ScaleConfig, - ScaleGammaConfig, - Size, - VisScaleType, +import { type ScaleLinear, type ScaleThreshold } from 'd3-scale'; +import { BufferAttribute, type IUniform, MathUtils } from 'three'; + +import { + type Aspect, + type AxisConfig, + type AxisOffsets, + type AxisScale, + type ExtractScaleType, + type Scale, + type ScaleConfig, + type ScaleGammaConfig, + type Size, + type VisScaleType, } from './models'; import { scaleGamma } from './scaleGamma'; diff --git a/packages/shared/src/guards.ts b/packages/shared/src/guards.ts index 3b7e0e5ac..fce963fe7 100644 --- a/packages/shared/src/guards.ts +++ b/packages/shared/src/guards.ts @@ -1,34 +1,35 @@ -import type { Data, NdArray, TypedArray } from 'ndarray'; - -import type { - ArrayShape, - BooleanType, - ComplexArray, - ComplexType, - CompoundType, - Dataset, - Datatype, - DType, - Entity, - EnumType, - Group, - GroupWithChildren, - H5WebComplex, - NumericLikeType, - NumericType, - Primitive, - PrintableType, - ScalarShape, - Shape, - StringType, - Value, +import { type Data, type NdArray, type TypedArray } from 'ndarray'; + +import { + type ArrayShape, + type BooleanType, + type ComplexArray, + type ComplexType, + type CompoundType, + type Dataset, + type Datatype, + type DType, + DTypeClass, + type Entity, + EntityKind, + type EnumType, + type Group, + type GroupWithChildren, + type H5WebComplex, + type NumericLikeType, + type NumericType, + type Primitive, + type PrintableType, + type ScalarShape, + type Shape, + type StringType, + type Value, } from './hdf5-models'; -import { DTypeClass, EntityKind } from './hdf5-models'; -import type { - AnyNumArray, - AxisScaleType, - ColorScaleType, - NumArray, +import { + type AnyNumArray, + type AxisScaleType, + type ColorScaleType, + type NumArray, } from './vis-models'; import { AXIS_SCALE_TYPES, COLOR_SCALE_TYPES, getValues } from './vis-utils'; diff --git a/packages/shared/src/hdf5-models.ts b/packages/shared/src/hdf5-models.ts index d680c5bb3..8b615954a 100644 --- a/packages/shared/src/hdf5-models.ts +++ b/packages/shared/src/hdf5-models.ts @@ -1,15 +1,15 @@ /* -------------------- */ /* ----- ENTITIES ----- */ -import type { TypedArray } from 'ndarray'; - -import type { - H5T_CSET, - H5T_ORDER, - H5T_STR, - H5T_TO_CHAR_SET, - H5T_TO_ENDIANNESS, - H5T_TO_STR_PAD, +import { type TypedArray } from 'ndarray'; + +import { + type H5T_CSET, + type H5T_ORDER, + type H5T_STR, + type H5T_TO_CHAR_SET, + type H5T_TO_ENDIANNESS, + type H5T_TO_STR_PAD, } from './h5t'; export enum EntityKind { diff --git a/packages/shared/src/hdf5-utils.ts b/packages/shared/src/hdf5-utils.ts index dbbfea3a0..2005d1f48 100644 --- a/packages/shared/src/hdf5-utils.ts +++ b/packages/shared/src/hdf5-utils.ts @@ -8,26 +8,26 @@ import { H5T_TO_ENDIANNESS, H5T_TO_STR_PAD, } from './h5t'; -import type { - ArrayType, - BitfieldType, - BooleanType, - ChildEntity, - ComplexType, - CompoundType, - DType, - EnumType, - GroupWithChildren, - H5WebComplex, - NumericType, - OpaqueType, - PrintableType, - ReferenceType, - StringType, - TimeType, - UnknownType, +import { + type ArrayType, + type BitfieldType, + type BooleanType, + type ChildEntity, + type ComplexType, + type CompoundType, + type DType, + DTypeClass, + type EnumType, + type GroupWithChildren, + type H5WebComplex, + type NumericType, + type OpaqueType, + type PrintableType, + type ReferenceType, + type StringType, + type TimeType, + type UnknownType, } from './hdf5-models'; -import { DTypeClass } from './hdf5-models'; export function getChildEntity( group: GroupWithChildren, diff --git a/packages/shared/src/mock-models.ts b/packages/shared/src/mock-models.ts index ebc4c4a42..fbbd8b2d2 100644 --- a/packages/shared/src/mock-models.ts +++ b/packages/shared/src/mock-models.ts @@ -1,5 +1,10 @@ -import type { Attribute, Dataset, DType, Shape } from './hdf5-models'; -import type { mockValues } from './mock-values'; +import { + type Attribute, + type Dataset, + type DType, + type Shape, +} from './hdf5-models'; +import { type mockValues } from './mock-values'; export interface MockDataset extends Dataset { diff --git a/packages/shared/src/mock-utils.ts b/packages/shared/src/mock-utils.ts index c5c05649e..fcc11aa32 100644 --- a/packages/shared/src/mock-utils.ts +++ b/packages/shared/src/mock-utils.ts @@ -1,20 +1,20 @@ import { hasChildren, isGroup } from './guards'; -import type { - ArrayShape, - Attribute, - ChildEntity, - Dataset, - Datatype, - DType, - Entity, - Group, - GroupWithChildren, - LinkClass, - ScalarShape, - Shape, - UnresolvedEntity, +import { + type ArrayShape, + type Attribute, + type ChildEntity, + type Dataset, + type Datatype, + type DType, + type Entity, + EntityKind, + type Group, + type GroupWithChildren, + type LinkClass, + type ScalarShape, + type Shape, + type UnresolvedEntity, } from './hdf5-models'; -import { EntityKind } from './hdf5-models'; import { boolType, buildEntityPath, @@ -24,9 +24,13 @@ import { strType, unknownType, } from './hdf5-utils'; -import type { MockAttribute, MockDataset, MockValueId } from './mock-models'; +import { + type MockAttribute, + type MockDataset, + type MockValueId, +} from './mock-models'; import { mockValues } from './mock-values'; -import type { SilxStyle } from './nexus-models'; +import { type SilxStyle } from './nexus-models'; export function assertMockDataset( dtst: Dataset, diff --git a/packages/shared/src/mock-values.ts b/packages/shared/src/mock-values.ts index 3e6b29130..49985fc71 100644 --- a/packages/shared/src/mock-values.ts +++ b/packages/shared/src/mock-values.ts @@ -1,9 +1,8 @@ /* eslint-disable func-style */ import { range } from 'd3-array'; -import type { NdArray } from 'ndarray'; -import ndarray from 'ndarray'; +import ndarray, { type NdArray } from 'ndarray'; -import type { ArrayValue, DType, H5WebComplex } from './hdf5-models'; +import { type ArrayValue, type DType, type H5WebComplex } from './hdf5-models'; import { cplx } from './hdf5-utils'; const range1 = () => range(-20, 21); diff --git a/packages/shared/src/nexus-models.ts b/packages/shared/src/nexus-models.ts index dc7e4dfa1..7c9e75fb3 100644 --- a/packages/shared/src/nexus-models.ts +++ b/packages/shared/src/nexus-models.ts @@ -1,4 +1,4 @@ -import type { ScaleType } from './vis-models'; +import { type ScaleType } from './vis-models'; export enum NxInterpretation { Spectrum = 'spectrum', diff --git a/packages/shared/src/react-suspense-fetch.ts b/packages/shared/src/react-suspense-fetch.ts index 905ac599b..07c8cf3df 100644 --- a/packages/shared/src/react-suspense-fetch.ts +++ b/packages/shared/src/react-suspense-fetch.ts @@ -1,5 +1,4 @@ -import type { StoreApi } from 'zustand/vanilla'; -import { createStore } from 'zustand/vanilla'; +import { createStore, type StoreApi } from 'zustand/vanilla'; type FetchFunc = ( input: Input, diff --git a/packages/shared/src/vis-models.ts b/packages/shared/src/vis-models.ts index abcc1522a..942b4498a 100644 --- a/packages/shared/src/vis-models.ts +++ b/packages/shared/src/vis-models.ts @@ -1,6 +1,6 @@ -import type { NdArray, TypedArray } from 'ndarray'; +import { type NdArray, type TypedArray } from 'ndarray'; -import type { DType, Primitive } from './hdf5-models'; +import { type DType, type Primitive } from './hdf5-models'; export type NumArray = TypedArray | number[]; export type AnyNumArray = NdArray | NumArray; diff --git a/packages/shared/src/vis-utils.ts b/packages/shared/src/vis-utils.ts index 36f2517d8..f1ae4999e 100644 --- a/packages/shared/src/vis-utils.ts +++ b/packages/shared/src/vis-utils.ts @@ -1,27 +1,26 @@ import { format } from 'd3-format'; -import type { NdArray, TypedArray } from 'ndarray'; -import ndarray from 'ndarray'; +import ndarray, { type NdArray, type TypedArray } from 'ndarray'; import { assign } from 'ndarray-ops'; import { assertLength, isNdArray } from './guards'; -import type { - BooleanType, - ComplexType, - EnumType, - Primitive, +import { + type BooleanType, + type ComplexType, + type EnumType, + type Primitive, } from './hdf5-models'; -import type { - AnyNumArray, - AxisScaleType, - Bounds, - ColorScaleType, - Dims, - Domain, - NumArray, - TypedArrayConstructor, - ValueFormatter, +import { + type AnyNumArray, + type AxisScaleType, + type Bounds, + type ColorScaleType, + type Dims, + type Domain, + type NumArray, + ScaleType, + type TypedArrayConstructor, + type ValueFormatter, } from './vis-models'; -import { ScaleType } from './vis-models'; export const AXIS_SCALE_TYPES: AxisScaleType[] = [ ScaleType.Linear,