react-cheminfo 0.27.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -25
- package/lib/chart/core/axisLabels.d.ts +82 -0
- package/lib/chart/core/axisLabels.d.ts.map +1 -0
- package/lib/chart/core/axisLabels.js +111 -0
- package/lib/chart/core/axisLabels.js.map +1 -0
- package/lib/chart/core/boxLayout.d.ts +53 -0
- package/lib/chart/core/boxLayout.d.ts.map +1 -0
- package/lib/chart/core/boxLayout.js +112 -0
- package/lib/chart/core/boxLayout.js.map +1 -0
- package/lib/chart/core/chartAxisScale.d.ts +23 -2
- package/lib/chart/core/chartAxisScale.d.ts.map +1 -1
- package/lib/chart/core/chartAxisScale.js +64 -13
- package/lib/chart/core/chartAxisScale.js.map +1 -1
- package/lib/chart/core/chartDomain.d.ts +160 -0
- package/lib/chart/core/chartDomain.d.ts.map +1 -0
- package/lib/chart/core/chartDomain.js +46 -0
- package/lib/chart/core/chartDomain.js.map +1 -0
- package/lib/chart/core/chartGeometry.d.ts +131 -0
- package/lib/chart/core/chartGeometry.d.ts.map +1 -0
- package/lib/chart/core/chartGeometry.js +101 -0
- package/lib/chart/core/chartGeometry.js.map +1 -0
- package/lib/chart/core/chartPane.d.ts +11 -0
- package/lib/chart/core/chartPane.d.ts.map +1 -0
- package/lib/chart/core/chartPane.js +11 -0
- package/lib/chart/core/chartPane.js.map +1 -0
- package/lib/chart/core/chartScale.d.ts +4 -1
- package/lib/chart/core/chartScale.d.ts.map +1 -1
- package/lib/chart/core/chartScale.js +8 -4
- package/lib/chart/core/chartScale.js.map +1 -1
- package/lib/chart/core/chartTheme.d.ts +156 -0
- package/lib/chart/core/chartTheme.d.ts.map +1 -0
- package/lib/chart/core/chartTheme.js +156 -0
- package/lib/chart/core/chartTheme.js.map +1 -0
- package/lib/chart/core/chartViewport.d.ts +32 -5
- package/lib/chart/core/chartViewport.d.ts.map +1 -1
- package/lib/chart/core/chartViewport.js +40 -11
- package/lib/chart/core/chartViewport.js.map +1 -1
- package/lib/chart/core/guidePlacement.d.ts +52 -0
- package/lib/chart/core/guidePlacement.d.ts.map +1 -0
- package/lib/chart/core/guidePlacement.js +52 -0
- package/lib/chart/core/guidePlacement.js.map +1 -0
- package/lib/chart/core/index.d.ts +29 -2
- package/lib/chart/core/index.d.ts.map +1 -1
- package/lib/chart/core/index.js +19 -2
- package/lib/chart/core/index.js.map +1 -1
- package/lib/chart/core/labelStack.d.ts +27 -0
- package/lib/chart/core/labelStack.d.ts.map +1 -0
- package/lib/chart/core/labelStack.js +62 -0
- package/lib/chart/core/labelStack.js.map +1 -0
- package/lib/chart/core/legendBox.d.ts +152 -0
- package/lib/chart/core/legendBox.d.ts.map +1 -0
- package/lib/chart/core/legendBox.js +169 -0
- package/lib/chart/core/legendBox.js.map +1 -0
- package/lib/chart/core/selectionGeometry.d.ts +45 -0
- package/lib/chart/core/selectionGeometry.d.ts.map +1 -0
- package/lib/chart/core/selectionGeometry.js +49 -0
- package/lib/chart/core/selectionGeometry.js.map +1 -0
- package/lib/chart/core/spectrumColor.d.ts +80 -0
- package/lib/chart/core/spectrumColor.d.ts.map +1 -0
- package/lib/chart/core/spectrumColor.js +120 -0
- package/lib/chart/core/spectrumColor.js.map +1 -0
- package/lib/chart/core/stackCapacity.d.ts +136 -0
- package/lib/chart/core/stackCapacity.d.ts.map +1 -0
- package/lib/chart/core/stackCapacity.js +153 -0
- package/lib/chart/core/stackCapacity.js.map +1 -0
- package/lib/chart/core/svgPoint.d.ts +62 -0
- package/lib/chart/core/svgPoint.d.ts.map +1 -0
- package/lib/chart/core/svgPoint.js +43 -0
- package/lib/chart/core/svgPoint.js.map +1 -0
- package/lib/chart/core/tracePath.d.ts +94 -0
- package/lib/chart/core/tracePath.d.ts.map +1 -0
- package/lib/chart/core/tracePath.js +191 -0
- package/lib/chart/core/tracePath.js.map +1 -0
- package/lib/chart/core/trackerReadout.d.ts +55 -0
- package/lib/chart/core/trackerReadout.d.ts.map +1 -0
- package/lib/chart/core/trackerReadout.js +53 -0
- package/lib/chart/core/trackerReadout.js.map +1 -0
- package/lib/chart/core/viewTransform.d.ts +167 -0
- package/lib/chart/core/viewTransform.d.ts.map +1 -0
- package/lib/chart/core/viewTransform.js +188 -0
- package/lib/chart/core/viewTransform.js.map +1 -0
- package/lib/chart/core/zoomDomain.d.ts +127 -0
- package/lib/chart/core/zoomDomain.d.ts.map +1 -0
- package/lib/chart/core/zoomDomain.js +175 -0
- package/lib/chart/core/zoomDomain.js.map +1 -0
- package/lib/chart/ui/Axes.d.ts +104 -0
- package/lib/chart/ui/Axes.d.ts.map +1 -0
- package/lib/chart/ui/Axes.js +155 -0
- package/lib/chart/ui/Axes.js.map +1 -0
- package/lib/chart/ui/AxisGuide.d.ts +60 -0
- package/lib/chart/ui/AxisGuide.d.ts.map +1 -0
- package/lib/chart/ui/AxisGuide.js +111 -0
- package/lib/chart/ui/AxisGuide.js.map +1 -0
- package/lib/chart/ui/ChartStack.d.ts +81 -0
- package/lib/chart/ui/ChartStack.d.ts.map +1 -0
- package/lib/chart/ui/ChartStack.js +42 -0
- package/lib/chart/ui/ChartStack.js.map +1 -0
- package/lib/chart/ui/ChartTracker.d.ts +36 -0
- package/lib/chart/ui/ChartTracker.d.ts.map +1 -0
- package/lib/chart/ui/ChartTracker.js +27 -0
- package/lib/chart/ui/ChartTracker.js.map +1 -0
- package/lib/chart/ui/PlotCaption.d.ts +44 -0
- package/lib/chart/ui/PlotCaption.d.ts.map +1 -0
- package/lib/chart/ui/PlotCaption.js +68 -0
- package/lib/chart/ui/PlotCaption.js.map +1 -0
- package/lib/chart/ui/SelectionRect.d.ts +27 -0
- package/lib/chart/ui/SelectionRect.d.ts.map +1 -0
- package/lib/chart/ui/SelectionRect.js +31 -0
- package/lib/chart/ui/SelectionRect.js.map +1 -0
- package/lib/chart/ui/TraceLegend.d.ts +99 -0
- package/lib/chart/ui/TraceLegend.d.ts.map +1 -0
- package/lib/chart/ui/TraceLegend.js +45 -0
- package/lib/chart/ui/TraceLegend.js.map +1 -0
- package/lib/chart/ui/chartGestures.d.ts +158 -0
- package/lib/chart/ui/chartGestures.d.ts.map +1 -0
- package/lib/chart/ui/chartGestures.js +145 -0
- package/lib/chart/ui/chartGestures.js.map +1 -0
- package/lib/chart/ui/chartStackLevel.d.ts +115 -0
- package/lib/chart/ui/chartStackLevel.d.ts.map +1 -0
- package/lib/chart/ui/chartStackLevel.js +96 -0
- package/lib/chart/ui/chartStackLevel.js.map +1 -0
- package/lib/chart/ui/chartSurface.d.ts +35 -0
- package/lib/chart/ui/chartSurface.d.ts.map +1 -0
- package/lib/chart/ui/chartSurface.js +58 -0
- package/lib/chart/ui/chartSurface.js.map +1 -0
- package/lib/chart/ui/index.d.ts +24 -0
- package/lib/chart/ui/index.d.ts.map +1 -1
- package/lib/chart/ui/index.js +13 -0
- package/lib/chart/ui/index.js.map +1 -1
- package/lib/chart/ui/useChartPointer.d.ts +124 -0
- package/lib/chart/ui/useChartPointer.d.ts.map +1 -0
- package/lib/chart/ui/useChartPointer.js +152 -0
- package/lib/chart/ui/useChartPointer.js.map +1 -0
- package/lib/chart/ui/useChartSize.d.ts +49 -0
- package/lib/chart/ui/useChartSize.d.ts.map +1 -0
- package/lib/chart/ui/useChartSize.js +91 -0
- package/lib/chart/ui/useChartSize.js.map +1 -0
- package/lib/chart/ui/useChartWindow.d.ts +147 -0
- package/lib/chart/ui/useChartWindow.d.ts.map +1 -0
- package/lib/chart/ui/useChartWindow.js +135 -0
- package/lib/chart/ui/useChartWindow.js.map +1 -0
- package/lib/chart/ui/useChartZoom.d.ts +88 -0
- package/lib/chart/ui/useChartZoom.d.ts.map +1 -0
- package/lib/chart/ui/useChartZoom.js +142 -0
- package/lib/chart/ui/useChartZoom.js.map +1 -0
- package/lib/chart/ui/useWheelListener.d.ts +30 -0
- package/lib/chart/ui/useWheelListener.d.ts.map +1 -0
- package/lib/chart/ui/useWheelListener.js +57 -0
- package/lib/chart/ui/useWheelListener.js.map +1 -0
- package/lib/clipboard/core/copyPng.d.ts +13 -0
- package/lib/clipboard/core/copyPng.d.ts.map +1 -0
- package/lib/clipboard/core/copyPng.js +19 -0
- package/lib/clipboard/core/copyPng.js.map +1 -0
- package/lib/clipboard/core/index.d.ts +1 -0
- package/lib/clipboard/core/index.d.ts.map +1 -1
- package/lib/clipboard/core/index.js +1 -0
- package/lib/clipboard/core/index.js.map +1 -1
- package/lib/clipboard/ui/CopyableValue.d.ts +12 -9
- package/lib/clipboard/ui/CopyableValue.d.ts.map +1 -1
- package/lib/clipboard/ui/CopyableValue.js +11 -15
- package/lib/clipboard/ui/CopyableValue.js.map +1 -1
- package/lib/core.d.ts +1 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +1 -0
- package/lib/core.js.map +1 -1
- package/lib/download/core/exportStyles.d.ts +22 -0
- package/lib/download/core/exportStyles.d.ts.map +1 -0
- package/lib/download/core/exportStyles.js +19 -0
- package/lib/download/core/exportStyles.js.map +1 -0
- package/lib/download/core/imageResolution.d.ts +88 -0
- package/lib/download/core/imageResolution.d.ts.map +1 -0
- package/lib/download/core/imageResolution.js +77 -0
- package/lib/download/core/imageResolution.js.map +1 -0
- package/lib/download/core/index.d.ts +13 -0
- package/lib/download/core/index.d.ts.map +1 -1
- package/lib/download/core/index.js +8 -0
- package/lib/download/core/index.js.map +1 -1
- package/lib/download/core/pictureExport.d.ts +93 -0
- package/lib/download/core/pictureExport.d.ts.map +1 -0
- package/lib/download/core/pictureExport.js +116 -0
- package/lib/download/core/pictureExport.js.map +1 -0
- package/lib/download/core/stackedDrawing.d.ts +36 -0
- package/lib/download/core/stackedDrawing.d.ts.map +1 -0
- package/lib/download/core/stackedDrawing.js +98 -0
- package/lib/download/core/stackedDrawing.js.map +1 -0
- package/lib/download/core/svgBounds.d.ts +44 -0
- package/lib/download/core/svgBounds.d.ts.map +1 -0
- package/lib/download/core/svgBounds.js +69 -0
- package/lib/download/core/svgBounds.js.map +1 -0
- package/lib/download/core/svgNamespace.d.ts +9 -0
- package/lib/download/core/svgNamespace.d.ts.map +1 -0
- package/lib/download/core/svgNamespace.js +10 -0
- package/lib/download/core/svgNamespace.js.map +1 -0
- package/lib/download/core/svgToPng.d.ts +43 -0
- package/lib/download/core/svgToPng.d.ts.map +1 -0
- package/lib/download/core/svgToPng.js +79 -0
- package/lib/download/core/svgToPng.js.map +1 -0
- package/lib/download/core/svgToString.d.ts +45 -0
- package/lib/download/core/svgToString.d.ts.map +1 -0
- package/lib/download/core/svgToString.js +58 -0
- package/lib/download/core/svgToString.js.map +1 -0
- package/lib/download/ui/ExportDialogFrame.d.ts +46 -0
- package/lib/download/ui/ExportDialogFrame.d.ts.map +1 -0
- package/lib/download/ui/ExportDialogFrame.js +24 -0
- package/lib/download/ui/ExportDialogFrame.js.map +1 -0
- package/lib/download/ui/ExportImageDialog.d.ts +47 -0
- package/lib/download/ui/ExportImageDialog.d.ts.map +1 -0
- package/lib/download/ui/ExportImageDialog.js +25 -0
- package/lib/download/ui/ExportImageDialog.js.map +1 -0
- package/lib/download/ui/ExportNameField.d.ts +29 -0
- package/lib/download/ui/ExportNameField.d.ts.map +1 -0
- package/lib/download/ui/ExportNameField.js +99 -0
- package/lib/download/ui/ExportNameField.js.map +1 -0
- package/lib/download/ui/ExportPictureSection.d.ts +38 -0
- package/lib/download/ui/ExportPictureSection.d.ts.map +1 -0
- package/lib/download/ui/ExportPictureSection.js +48 -0
- package/lib/download/ui/ExportPictureSection.js.map +1 -0
- package/lib/download/ui/index.d.ts +10 -0
- package/lib/download/ui/index.d.ts.map +1 -1
- package/lib/download/ui/index.js +5 -0
- package/lib/download/ui/index.js.map +1 -1
- package/lib/download/ui/useDrawingBox.d.ts +23 -0
- package/lib/download/ui/useDrawingBox.d.ts.map +1 -0
- package/lib/download/ui/useDrawingBox.js +21 -0
- package/lib/download/ui/useDrawingBox.js.map +1 -0
- package/lib/error/core/describeSource.d.ts +17 -0
- package/lib/error/core/describeSource.d.ts.map +1 -0
- package/lib/error/core/describeSource.js +19 -0
- package/lib/error/core/describeSource.js.map +1 -0
- package/lib/error/core/index.d.ts +1 -0
- package/lib/error/core/index.d.ts.map +1 -1
- package/lib/error/core/index.js +1 -0
- package/lib/error/core/index.js.map +1 -1
- package/lib/help/ui/HelpBody.d.ts +10 -1
- package/lib/help/ui/HelpBody.d.ts.map +1 -1
- package/lib/help/ui/HelpBody.js +24 -1
- package/lib/help/ui/HelpBody.js.map +1 -1
- package/lib/help/ui/index.d.ts +1 -1
- package/lib/help/ui/index.d.ts.map +1 -1
- package/lib/help/ui/index.js.map +1 -1
- package/lib/ir/core/analysisSpectra.d.ts +46 -0
- package/lib/ir/core/analysisSpectra.d.ts.map +1 -0
- package/lib/ir/core/analysisSpectra.js +187 -0
- package/lib/ir/core/analysisSpectra.js.map +1 -0
- package/lib/ir/core/assignBands.d.ts +83 -0
- package/lib/ir/core/assignBands.d.ts.map +1 -0
- package/lib/ir/core/assignBands.js +83 -0
- package/lib/ir/core/assignBands.js.map +1 -0
- package/lib/ir/core/bandAssignments.d.ts +47 -0
- package/lib/ir/core/bandAssignments.d.ts.map +1 -0
- package/lib/ir/core/bandAssignments.js +305 -0
- package/lib/ir/core/bandAssignments.js.map +1 -0
- package/lib/ir/core/bandLabelPlan.d.ts +93 -0
- package/lib/ir/core/bandLabelPlan.d.ts.map +1 -0
- package/lib/ir/core/bandLabelPlan.js +104 -0
- package/lib/ir/core/bandLabelPlan.js.map +1 -0
- package/lib/ir/core/detectIrFormat.d.ts +23 -0
- package/lib/ir/core/detectIrFormat.d.ts.map +1 -0
- package/lib/ir/core/detectIrFormat.js +133 -0
- package/lib/ir/core/detectIrFormat.js.map +1 -0
- package/lib/ir/core/downloadSpectra.d.ts +26 -0
- package/lib/ir/core/downloadSpectra.d.ts.map +1 -0
- package/lib/ir/core/downloadSpectra.js +37 -0
- package/lib/ir/core/downloadSpectra.js.map +1 -0
- package/lib/ir/core/fromJcamp.d.ts +35 -0
- package/lib/ir/core/fromJcamp.d.ts.map +1 -0
- package/lib/ir/core/fromJcamp.js +48 -0
- package/lib/ir/core/fromJcamp.js.map +1 -0
- package/lib/ir/core/fromSpc.d.ts +30 -0
- package/lib/ir/core/fromSpc.d.ts.map +1 -0
- package/lib/ir/core/fromSpc.js +40 -0
- package/lib/ir/core/fromSpc.js.map +1 -0
- package/lib/ir/core/index.d.ts +51 -0
- package/lib/ir/core/index.d.ts.map +1 -0
- package/lib/ir/core/index.js +35 -0
- package/lib/ir/core/index.js.map +1 -0
- package/lib/ir/core/irBand.d.ts +45 -0
- package/lib/ir/core/irBand.d.ts.map +1 -0
- package/lib/ir/core/irBand.js +30 -0
- package/lib/ir/core/irBand.js.map +1 -0
- package/lib/ir/core/irCommands.d.ts +168 -0
- package/lib/ir/core/irCommands.d.ts.map +1 -0
- package/lib/ir/core/irCommands.js +94 -0
- package/lib/ir/core/irCommands.js.map +1 -0
- package/lib/ir/core/irDomain.d.ts +63 -0
- package/lib/ir/core/irDomain.d.ts.map +1 -0
- package/lib/ir/core/irDomain.js +136 -0
- package/lib/ir/core/irDomain.js.map +1 -0
- package/lib/ir/core/irEditorApi.d.ts +42 -0
- package/lib/ir/core/irEditorApi.d.ts.map +1 -0
- package/lib/ir/core/irEditorApi.js +10 -0
- package/lib/ir/core/irEditorApi.js.map +1 -0
- package/lib/ir/core/irFormat.d.ts +42 -0
- package/lib/ir/core/irFormat.d.ts.map +1 -0
- package/lib/ir/core/irFormat.js +51 -0
- package/lib/ir/core/irFormat.js.map +1 -0
- package/lib/ir/core/irMode.d.ts +160 -0
- package/lib/ir/core/irMode.d.ts.map +1 -0
- package/lib/ir/core/irMode.js +175 -0
- package/lib/ir/core/irMode.js.map +1 -0
- package/lib/ir/core/irReducer.d.ts +101 -0
- package/lib/ir/core/irReducer.d.ts.map +1 -0
- package/lib/ir/core/irReducer.js +207 -0
- package/lib/ir/core/irReducer.js.map +1 -0
- package/lib/ir/core/irSidePanels.d.ts +22 -0
- package/lib/ir/core/irSidePanels.d.ts.map +1 -0
- package/lib/ir/core/irSidePanels.js +12 -0
- package/lib/ir/core/irSidePanels.js.map +1 -0
- package/lib/ir/core/irSpectrum.d.ts +140 -0
- package/lib/ir/core/irSpectrum.d.ts.map +1 -0
- package/lib/ir/core/irSpectrum.js +34 -0
- package/lib/ir/core/irSpectrum.js.map +1 -0
- package/lib/ir/core/irState.d.ts +119 -0
- package/lib/ir/core/irState.d.ts.map +1 -0
- package/lib/ir/core/irState.js +92 -0
- package/lib/ir/core/irState.js.map +1 -0
- package/lib/ir/core/loadIrSpectra.d.ts +36 -0
- package/lib/ir/core/loadIrSpectra.d.ts.map +1 -0
- package/lib/ir/core/loadIrSpectra.js +44 -0
- package/lib/ir/core/loadIrSpectra.js.map +1 -0
- package/lib/ir/core/nearestBand.d.ts +35 -0
- package/lib/ir/core/nearestBand.d.ts.map +1 -0
- package/lib/ir/core/nearestBand.js +47 -0
- package/lib/ir/core/nearestBand.js.map +1 -0
- package/lib/ir/core/pickBands.d.ts +70 -0
- package/lib/ir/core/pickBands.d.ts.map +1 -0
- package/lib/ir/core/pickBands.js +125 -0
- package/lib/ir/core/pickBands.js.map +1 -0
- package/lib/ir/core/spectrumJcamp.d.ts +58 -0
- package/lib/ir/core/spectrumJcamp.d.ts.map +1 -0
- package/lib/ir/core/spectrumJcamp.js +156 -0
- package/lib/ir/core/spectrumJcamp.js.map +1 -0
- package/lib/ir/core/toIrSpectrum.d.ts +59 -0
- package/lib/ir/core/toIrSpectrum.d.ts.map +1 -0
- package/lib/ir/core/toIrSpectrum.js +56 -0
- package/lib/ir/core/toIrSpectrum.js.map +1 -0
- package/lib/ir/ui/BandMarks.d.ts +52 -0
- package/lib/ir/ui/BandMarks.d.ts.map +1 -0
- package/lib/ir/ui/BandMarks.js +71 -0
- package/lib/ir/ui/BandMarks.js.map +1 -0
- package/lib/ir/ui/BandsPanel.d.ts +31 -0
- package/lib/ir/ui/BandsPanel.d.ts.map +1 -0
- package/lib/ir/ui/BandsPanel.js +94 -0
- package/lib/ir/ui/BandsPanel.js.map +1 -0
- package/lib/ir/ui/IrAboutDialog.d.ts +18 -0
- package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -0
- package/lib/ir/ui/IrAboutDialog.js +32 -0
- package/lib/ir/ui/IrAboutDialog.js.map +1 -0
- package/lib/ir/ui/IrCanvas.d.ts +38 -0
- package/lib/ir/ui/IrCanvas.d.ts.map +1 -0
- package/lib/ir/ui/IrCanvas.js +41 -0
- package/lib/ir/ui/IrCanvas.js.map +1 -0
- package/lib/ir/ui/IrChart.d.ts +28 -0
- package/lib/ir/ui/IrChart.d.ts.map +1 -0
- package/lib/ir/ui/IrChart.js +114 -0
- package/lib/ir/ui/IrChart.js.map +1 -0
- package/lib/ir/ui/IrCommandProvider.d.ts +15 -0
- package/lib/ir/ui/IrCommandProvider.d.ts.map +1 -0
- package/lib/ir/ui/IrCommandProvider.js +14 -0
- package/lib/ir/ui/IrCommandProvider.js.map +1 -0
- package/lib/ir/ui/IrCommandTooltip.d.ts +16 -0
- package/lib/ir/ui/IrCommandTooltip.d.ts.map +1 -0
- package/lib/ir/ui/IrCommandTooltip.js +22 -0
- package/lib/ir/ui/IrCommandTooltip.js.map +1 -0
- package/lib/ir/ui/IrDocumentationDialog.d.ts +18 -0
- package/lib/ir/ui/IrDocumentationDialog.d.ts.map +1 -0
- package/lib/ir/ui/IrDocumentationDialog.js +68 -0
- package/lib/ir/ui/IrDocumentationDialog.js.map +1 -0
- package/lib/ir/ui/IrEditor.d.ts +60 -0
- package/lib/ir/ui/IrEditor.d.ts.map +1 -0
- package/lib/ir/ui/IrEditor.js +42 -0
- package/lib/ir/ui/IrEditor.js.map +1 -0
- package/lib/ir/ui/IrHeader.d.ts +13 -0
- package/lib/ir/ui/IrHeader.d.ts.map +1 -0
- package/lib/ir/ui/IrHeader.js +21 -0
- package/lib/ir/ui/IrHeader.js.map +1 -0
- package/lib/ir/ui/IrLogo.d.ts +20 -0
- package/lib/ir/ui/IrLogo.d.ts.map +1 -0
- package/lib/ir/ui/IrLogo.js +17 -0
- package/lib/ir/ui/IrLogo.js.map +1 -0
- package/lib/ir/ui/IrPointerTracker.d.ts +29 -0
- package/lib/ir/ui/IrPointerTracker.d.ts.map +1 -0
- package/lib/ir/ui/IrPointerTracker.js +47 -0
- package/lib/ir/ui/IrPointerTracker.js.map +1 -0
- package/lib/ir/ui/IrShell.d.ts +25 -0
- package/lib/ir/ui/IrShell.d.ts.map +1 -0
- package/lib/ir/ui/IrShell.js +178 -0
- package/lib/ir/ui/IrShell.js.map +1 -0
- package/lib/ir/ui/IrSidePanel.d.ts +26 -0
- package/lib/ir/ui/IrSidePanel.d.ts.map +1 -0
- package/lib/ir/ui/IrSidePanel.js +39 -0
- package/lib/ir/ui/IrSidePanel.js.map +1 -0
- package/lib/ir/ui/IrStateProvider.d.ts +19 -0
- package/lib/ir/ui/IrStateProvider.d.ts.map +1 -0
- package/lib/ir/ui/IrStateProvider.js +16 -0
- package/lib/ir/ui/IrStateProvider.js.map +1 -0
- package/lib/ir/ui/IrStatusBar.d.ts +14 -0
- package/lib/ir/ui/IrStatusBar.d.ts.map +1 -0
- package/lib/ir/ui/IrStatusBar.js +48 -0
- package/lib/ir/ui/IrStatusBar.js.map +1 -0
- package/lib/ir/ui/IrToolbar.d.ts +18 -0
- package/lib/ir/ui/IrToolbar.d.ts.map +1 -0
- package/lib/ir/ui/IrToolbar.js +32 -0
- package/lib/ir/ui/IrToolbar.js.map +1 -0
- package/lib/ir/ui/IrTraces.d.ts +63 -0
- package/lib/ir/ui/IrTraces.d.ts.map +1 -0
- package/lib/ir/ui/IrTraces.js +72 -0
- package/lib/ir/ui/IrTraces.js.map +1 -0
- package/lib/ir/ui/MetadataPanel.d.ts +15 -0
- package/lib/ir/ui/MetadataPanel.d.ts.map +1 -0
- package/lib/ir/ui/MetadataPanel.js +49 -0
- package/lib/ir/ui/MetadataPanel.js.map +1 -0
- package/lib/ir/ui/SpectraPanel.d.ts +20 -0
- package/lib/ir/ui/SpectraPanel.d.ts.map +1 -0
- package/lib/ir/ui/SpectraPanel.js +42 -0
- package/lib/ir/ui/SpectraPanel.js.map +1 -0
- package/lib/ir/ui/SpectrumRow.d.ts +26 -0
- package/lib/ir/ui/SpectrumRow.d.ts.map +1 -0
- package/lib/ir/ui/SpectrumRow.js +41 -0
- package/lib/ir/ui/SpectrumRow.js.map +1 -0
- package/lib/ir/ui/index.d.ts +56 -0
- package/lib/ir/ui/index.d.ts.map +1 -0
- package/lib/ir/ui/index.js +36 -0
- package/lib/ir/ui/index.js.map +1 -0
- package/lib/ir/ui/irActions.d.ts +52 -0
- package/lib/ir/ui/irActions.d.ts.map +1 -0
- package/lib/ir/ui/irActions.js +62 -0
- package/lib/ir/ui/irActions.js.map +1 -0
- package/lib/ir/ui/irChartProps.d.ts +116 -0
- package/lib/ir/ui/irChartProps.d.ts.map +1 -0
- package/lib/ir/ui/irChartProps.js +14 -0
- package/lib/ir/ui/irChartProps.js.map +1 -0
- package/lib/ir/ui/irCommandContext.d.ts +35 -0
- package/lib/ir/ui/irCommandContext.d.ts.map +1 -0
- package/lib/ir/ui/irCommandContext.js +44 -0
- package/lib/ir/ui/irCommandContext.js.map +1 -0
- package/lib/ir/ui/irStateContext.d.ts +26 -0
- package/lib/ir/ui/irStateContext.d.ts.map +1 -0
- package/lib/ir/ui/irStateContext.js +37 -0
- package/lib/ir/ui/irStateContext.js.map +1 -0
- package/lib/ir/ui/useIrEditor.d.ts +51 -0
- package/lib/ir/ui/useIrEditor.d.ts.map +1 -0
- package/lib/ir/ui/useIrEditor.js +88 -0
- package/lib/ir/ui/useIrEditor.js.map +1 -0
- package/lib/ir/ui/useIrPointer.d.ts +66 -0
- package/lib/ir/ui/useIrPointer.d.ts.map +1 -0
- package/lib/ir/ui/useIrPointer.js +53 -0
- package/lib/ir/ui/useIrPointer.js.map +1 -0
- package/lib/ir/ui/useIrShortcuts.d.ts +24 -0
- package/lib/ir/ui/useIrShortcuts.d.ts.map +1 -0
- package/lib/ir/ui/useIrShortcuts.js +73 -0
- package/lib/ir/ui/useIrShortcuts.js.map +1 -0
- package/lib/ir/ui/useIrZoom.d.ts +51 -0
- package/lib/ir/ui/useIrZoom.d.ts.map +1 -0
- package/lib/ir/ui/useIrZoom.js +46 -0
- package/lib/ir/ui/useIrZoom.js.map +1 -0
- package/lib/ir.d.ts +13 -0
- package/lib/ir.d.ts.map +1 -0
- package/lib/ir.js +13 -0
- package/lib/ir.js.map +1 -0
- package/lib/panel/core/dialogStyles.d.ts +13 -0
- package/lib/panel/core/dialogStyles.d.ts.map +1 -0
- package/lib/panel/core/dialogStyles.js +11 -0
- package/lib/panel/core/dialogStyles.js.map +1 -0
- package/lib/panel/core/index.d.ts +19 -0
- package/lib/panel/core/index.d.ts.map +1 -0
- package/lib/panel/core/index.js +18 -0
- package/lib/panel/core/index.js.map +1 -0
- package/lib/panel/core/isEditingField.d.ts +17 -0
- package/lib/panel/core/isEditingField.d.ts.map +1 -0
- package/lib/panel/core/isEditingField.js +25 -0
- package/lib/panel/core/isEditingField.js.map +1 -0
- package/lib/panel/core/panelStyles.d.ts +242 -0
- package/lib/panel/core/panelStyles.d.ts.map +1 -0
- package/lib/panel/core/panelStyles.js +228 -0
- package/lib/panel/core/panelStyles.js.map +1 -0
- package/lib/panel/core/rowSpacers.d.ts +38 -0
- package/lib/panel/core/rowSpacers.d.ts.map +1 -0
- package/lib/panel/core/rowSpacers.js +31 -0
- package/lib/panel/core/rowSpacers.js.map +1 -0
- package/lib/panel/core/statusBar.d.ts +44 -0
- package/lib/panel/core/statusBar.d.ts.map +1 -0
- package/lib/panel/core/statusBar.js +40 -0
- package/lib/panel/core/statusBar.js.map +1 -0
- package/lib/panel/core/textFilter.d.ts +22 -0
- package/lib/panel/core/textFilter.d.ts.map +1 -0
- package/lib/panel/core/textFilter.js +32 -0
- package/lib/panel/core/textFilter.js.map +1 -0
- package/lib/panel/core/yieldToPainting.d.ts +17 -0
- package/lib/panel/core/yieldToPainting.d.ts.map +1 -0
- package/lib/panel/core/yieldToPainting.js +21 -0
- package/lib/panel/core/yieldToPainting.js.map +1 -0
- package/lib/panel/ui/AboutDialogFrame.d.ts +36 -0
- package/lib/panel/ui/AboutDialogFrame.d.ts.map +1 -0
- package/lib/panel/ui/AboutDialogFrame.js +43 -0
- package/lib/panel/ui/AboutDialogFrame.js.map +1 -0
- package/lib/panel/ui/ClearButton.d.ts +28 -0
- package/lib/panel/ui/ClearButton.d.ts.map +1 -0
- package/lib/panel/ui/ClearButton.js +23 -0
- package/lib/panel/ui/ClearButton.js.map +1 -0
- package/lib/panel/ui/DocumentationDialogFrame.d.ts +39 -0
- package/lib/panel/ui/DocumentationDialogFrame.d.ts.map +1 -0
- package/lib/panel/ui/DocumentationDialogFrame.js +29 -0
- package/lib/panel/ui/DocumentationDialogFrame.js.map +1 -0
- package/lib/panel/ui/FilterInput.d.ts +31 -0
- package/lib/panel/ui/FilterInput.d.ts.map +1 -0
- package/lib/panel/ui/FilterInput.js +23 -0
- package/lib/panel/ui/FilterInput.js.map +1 -0
- package/lib/panel/ui/HelpLabel.d.ts +24 -0
- package/lib/panel/ui/HelpLabel.d.ts.map +1 -0
- package/lib/panel/ui/HelpLabel.js +23 -0
- package/lib/panel/ui/HelpLabel.js.map +1 -0
- package/lib/panel/ui/PanelMessage.d.ts +41 -0
- package/lib/panel/ui/PanelMessage.d.ts.map +1 -0
- package/lib/panel/ui/PanelMessage.js +30 -0
- package/lib/panel/ui/PanelMessage.js.map +1 -0
- package/lib/panel/ui/PanelRail.d.ts +41 -0
- package/lib/panel/ui/PanelRail.d.ts.map +1 -0
- package/lib/panel/ui/PanelRail.js +12 -0
- package/lib/panel/ui/PanelRail.js.map +1 -0
- package/lib/panel/ui/Section.d.ts +25 -0
- package/lib/panel/ui/Section.d.ts.map +1 -0
- package/lib/panel/ui/Section.js +41 -0
- package/lib/panel/ui/Section.js.map +1 -0
- package/lib/panel/ui/SidePanelStack.d.ts +62 -0
- package/lib/panel/ui/SidePanelStack.d.ts.map +1 -0
- package/lib/panel/ui/SidePanelStack.js +40 -0
- package/lib/panel/ui/SidePanelStack.js.map +1 -0
- package/lib/panel/ui/SpectrumColorSwatch.d.ts +33 -0
- package/lib/panel/ui/SpectrumColorSwatch.d.ts.map +1 -0
- package/lib/panel/ui/SpectrumColorSwatch.js +76 -0
- package/lib/panel/ui/SpectrumColorSwatch.js.map +1 -0
- package/lib/panel/ui/index.d.ts +37 -0
- package/lib/panel/ui/index.d.ts.map +1 -0
- package/lib/panel/ui/index.js +24 -0
- package/lib/panel/ui/index.js.map +1 -0
- package/lib/panel/ui/useConfirmOnEnter.d.ts +19 -0
- package/lib/panel/ui/useConfirmOnEnter.d.ts.map +1 -0
- package/lib/panel/ui/useConfirmOnEnter.js +64 -0
- package/lib/panel/ui/useConfirmOnEnter.js.map +1 -0
- package/lib/panel/ui/useFilterBox.d.ts +23 -0
- package/lib/panel/ui/useFilterBox.d.ts.map +1 -0
- package/lib/panel/ui/useFilterBox.js +22 -0
- package/lib/panel/ui/useFilterBox.js.map +1 -0
- package/lib/panel/ui/useVirtualRows.d.ts +46 -0
- package/lib/panel/ui/useVirtualRows.d.ts.map +1 -0
- package/lib/panel/ui/useVirtualRows.js +56 -0
- package/lib/panel/ui/useVirtualRows.js.map +1 -0
- package/lib/panel/ui/useVirtualWindowRows.d.ts +40 -0
- package/lib/panel/ui/useVirtualWindowRows.d.ts.map +1 -0
- package/lib/panel/ui/useVirtualWindowRows.js +65 -0
- package/lib/panel/ui/useVirtualWindowRows.js.map +1 -0
- package/lib/ui.d.ts +1 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +1 -0
- package/lib/ui.js.map +1 -1
- package/package.json +8 -1
- package/src/chart/core/axisLabels.ts +117 -0
- package/src/chart/core/boxLayout.ts +126 -0
- package/src/chart/core/chartAxisScale.ts +92 -10
- package/src/chart/core/chartDomain.ts +185 -0
- package/src/chart/core/chartGeometry.ts +159 -0
- package/src/chart/core/chartPane.ts +10 -0
- package/src/chart/core/chartScale.ts +7 -4
- package/src/chart/core/chartTheme.ts +161 -0
- package/src/chart/core/chartViewport.ts +40 -13
- package/src/chart/core/guidePlacement.ts +66 -0
- package/src/chart/core/index.ts +121 -2
- package/src/chart/core/labelStack.ts +72 -0
- package/src/chart/core/legendBox.ts +263 -0
- package/src/chart/core/selectionGeometry.ts +68 -0
- package/src/chart/core/spectrumColor.ts +129 -0
- package/src/chart/core/stackCapacity.ts +162 -0
- package/src/chart/core/svgPoint.ts +77 -0
- package/src/chart/core/tracePath.ts +228 -0
- package/src/chart/core/trackerReadout.ts +78 -0
- package/src/chart/core/viewTransform.ts +287 -0
- package/src/chart/core/zoomDomain.ts +235 -0
- package/src/chart/ui/Axes.tsx +361 -0
- package/src/chart/ui/AxisGuide.tsx +187 -0
- package/src/chart/ui/ChartStack.tsx +130 -0
- package/src/chart/ui/ChartTracker.tsx +101 -0
- package/src/chart/ui/PlotCaption.tsx +108 -0
- package/src/chart/ui/SelectionRect.tsx +52 -0
- package/src/chart/ui/TraceLegend.tsx +193 -0
- package/src/chart/ui/chartGestures.ts +270 -0
- package/src/chart/ui/chartStackLevel.tsx +210 -0
- package/src/chart/ui/chartSurface.ts +66 -0
- package/src/chart/ui/index.ts +35 -0
- package/src/chart/ui/useChartPointer.ts +223 -0
- package/src/chart/ui/useChartSize.ts +115 -0
- package/src/chart/ui/useChartWindow.ts +240 -0
- package/src/chart/ui/useChartZoom.ts +255 -0
- package/src/chart/ui/useWheelListener.ts +62 -0
- package/src/clipboard/core/copyPng.ts +20 -0
- package/src/clipboard/core/index.ts +1 -0
- package/src/clipboard/ui/CopyableValue.tsx +22 -35
- package/src/core.ts +1 -0
- package/src/download/core/exportStyles.ts +20 -0
- package/src/download/core/imageResolution.ts +118 -0
- package/src/download/core/index.ts +34 -0
- package/src/download/core/pictureExport.ts +207 -0
- package/src/download/core/stackedDrawing.ts +108 -0
- package/src/download/core/svgBounds.ts +80 -0
- package/src/download/core/svgNamespace.ts +9 -0
- package/src/download/core/svgToPng.ts +121 -0
- package/src/download/core/svgToString.ts +95 -0
- package/src/download/ui/ExportDialogFrame.tsx +86 -0
- package/src/download/ui/ExportImageDialog.tsx +91 -0
- package/src/download/ui/ExportNameField.tsx +148 -0
- package/src/download/ui/ExportPictureSection.tsx +142 -0
- package/src/download/ui/index.ts +11 -0
- package/src/download/ui/useDrawingBox.ts +37 -0
- package/src/error/core/describeSource.ts +18 -0
- package/src/error/core/index.ts +1 -0
- package/src/help/ui/HelpBody.tsx +41 -2
- package/src/help/ui/index.ts +6 -1
- package/src/ir/core/analysisSpectra.ts +231 -0
- package/src/ir/core/assignBands.ts +144 -0
- package/src/ir/core/bandAssignments.ts +329 -0
- package/src/ir/core/bandLabelPlan.ts +194 -0
- package/src/ir/core/detectIrFormat.ts +139 -0
- package/src/ir/core/downloadSpectra.ts +57 -0
- package/src/ir/core/fromJcamp.ts +70 -0
- package/src/ir/core/fromSpc.ts +61 -0
- package/src/ir/core/index.ts +113 -0
- package/src/ir/core/irBand.ts +57 -0
- package/src/ir/core/irCommands.ts +154 -0
- package/src/ir/core/irDomain.ts +163 -0
- package/src/ir/core/irEditorApi.ts +44 -0
- package/src/ir/core/irFormat.ts +57 -0
- package/src/ir/core/irMode.ts +203 -0
- package/src/ir/core/irReducer.ts +273 -0
- package/src/ir/core/irSidePanels.ts +20 -0
- package/src/ir/core/irSpectrum.ts +155 -0
- package/src/ir/core/irState.ts +173 -0
- package/src/ir/core/loadIrSpectra.ts +79 -0
- package/src/ir/core/nearestBand.ts +57 -0
- package/src/ir/core/pickBands.ts +181 -0
- package/src/ir/core/spectrumJcamp.ts +178 -0
- package/src/ir/core/toIrSpectrum.ts +102 -0
- package/src/ir/ui/BandMarks.tsx +166 -0
- package/src/ir/ui/BandsPanel.tsx +271 -0
- package/src/ir/ui/IrAboutDialog.tsx +121 -0
- package/src/ir/ui/IrCanvas.tsx +91 -0
- package/src/ir/ui/IrChart.tsx +215 -0
- package/src/ir/ui/IrCommandProvider.tsx +32 -0
- package/src/ir/ui/IrCommandTooltip.tsx +36 -0
- package/src/ir/ui/IrDocumentationDialog.tsx +174 -0
- package/src/ir/ui/IrEditor.tsx +99 -0
- package/src/ir/ui/IrHeader.tsx +39 -0
- package/src/ir/ui/IrLogo.tsx +49 -0
- package/src/ir/ui/IrPointerTracker.tsx +102 -0
- package/src/ir/ui/IrShell.tsx +285 -0
- package/src/ir/ui/IrSidePanel.tsx +78 -0
- package/src/ir/ui/IrStateProvider.tsx +32 -0
- package/src/ir/ui/IrStatusBar.tsx +97 -0
- package/src/ir/ui/IrToolbar.tsx +102 -0
- package/src/ir/ui/IrTraces.tsx +134 -0
- package/src/ir/ui/MetadataPanel.tsx +88 -0
- package/src/ir/ui/SpectraPanel.tsx +114 -0
- package/src/ir/ui/SpectrumRow.tsx +127 -0
- package/src/ir/ui/index.ts +56 -0
- package/src/ir/ui/irActions.ts +103 -0
- package/src/ir/ui/irChartProps.ts +118 -0
- package/src/ir/ui/irCommandContext.tsx +62 -0
- package/src/ir/ui/irStateContext.ts +48 -0
- package/src/ir/ui/useIrEditor.ts +139 -0
- package/src/ir/ui/useIrPointer.ts +109 -0
- package/src/ir/ui/useIrShortcuts.ts +95 -0
- package/src/ir/ui/useIrZoom.ts +86 -0
- package/src/ir.ts +13 -0
- package/src/panel/core/dialogStyles.ts +11 -0
- package/src/panel/core/index.ts +47 -0
- package/src/panel/core/isEditingField.ts +23 -0
- package/src/panel/core/panelStyles.ts +248 -0
- package/src/panel/core/rowSpacers.ts +50 -0
- package/src/panel/core/statusBar.ts +48 -0
- package/src/panel/core/textFilter.ts +33 -0
- package/src/panel/core/yieldToPainting.ts +20 -0
- package/src/panel/ui/AboutDialogFrame.tsx +100 -0
- package/src/panel/ui/ClearButton.tsx +42 -0
- package/src/panel/ui/DocumentationDialogFrame.tsx +86 -0
- package/src/panel/ui/FilterInput.tsx +60 -0
- package/src/panel/ui/HelpLabel.tsx +43 -0
- package/src/panel/ui/PanelMessage.tsx +64 -0
- package/src/panel/ui/PanelRail.tsx +64 -0
- package/src/panel/ui/Section.tsx +66 -0
- package/src/panel/ui/SidePanelStack.tsx +109 -0
- package/src/panel/ui/SpectrumColorSwatch.tsx +119 -0
- package/src/panel/ui/index.ts +47 -0
- package/src/panel/ui/useConfirmOnEnter.ts +68 -0
- package/src/panel/ui/useFilterBox.ts +35 -0
- package/src/panel/ui/useVirtualRows.ts +82 -0
- package/src/panel/ui/useVirtualWindowRows.ts +86 -0
- package/src/ui.ts +1 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from 'react-science/ui';
|
|
3
|
+
import { SpectrumColorSwatch } from "../../panel/ui/SpectrumColorSwatch.js";
|
|
4
|
+
import { formatWavenumber } from "../core/irFormat.js";
|
|
5
|
+
/**
|
|
6
|
+
* One spectrum: its colour, its name, where it runs, and what can be done to it.
|
|
7
|
+
* @param props - Component props.
|
|
8
|
+
* @returns The row.
|
|
9
|
+
*/
|
|
10
|
+
export function SpectrumRow(props) {
|
|
11
|
+
const { spectrum, selected, onSelect, onToggle, onColor, onDownload, onRemove, onRename, } = props;
|
|
12
|
+
const range = spectrum.wavenumber.length === 0
|
|
13
|
+
? ''
|
|
14
|
+
: `${formatWavenumber(spectrum.wavenumber.at(-1))}–${formatWavenumber(spectrum.wavenumber[0])} cm⁻¹`;
|
|
15
|
+
return (_jsxs("div", { style: selected ? selectedRowStyle : rowStyle, "data-selected": selected ? 'true' : undefined, children: [_jsx(Button, { variant: "minimal", icon: spectrum.visible ? 'eye-open' : 'eye-off', tooltipProps: { content: spectrum.visible ? 'Hide' : 'Draw' }, "aria-label": spectrum.visible ? 'Hide this spectrum' : 'Draw it', onClick: onToggle }), _jsx(SpectrumColorSwatch, { color: spectrum.color, name: spectrum.name, onPick: onColor }), _jsx("input", { style: nameStyle, value: spectrum.name, spellCheck: false, autoComplete: "off", "aria-label": "What this spectrum is called", onFocus: onSelect, onChange: (event) => onRename(event.target.value) }), _jsx("span", { style: rangeStyle, children: range }), _jsx(Button, { variant: "minimal", icon: "download", tooltipProps: { content: 'Download this spectrum as a JCAMP-DX file' }, "aria-label": "Download this spectrum", onClick: onDownload }), _jsx(Button, { variant: "minimal", icon: "cross", intent: "danger", tooltipProps: { content: 'Close this spectrum' }, "aria-label": "Close this spectrum", onClick: onRemove })] }));
|
|
16
|
+
}
|
|
17
|
+
const rowStyle = {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
gap: 4,
|
|
21
|
+
padding: '1px 2px',
|
|
22
|
+
borderRadius: 3,
|
|
23
|
+
};
|
|
24
|
+
const selectedRowStyle = { ...rowStyle, background: '#e8f1fb' };
|
|
25
|
+
const nameStyle = {
|
|
26
|
+
flex: '1 1 1px',
|
|
27
|
+
minWidth: 0,
|
|
28
|
+
border: '1px solid transparent',
|
|
29
|
+
borderRadius: 2,
|
|
30
|
+
background: 'transparent',
|
|
31
|
+
font: 'inherit',
|
|
32
|
+
fontSize: 12,
|
|
33
|
+
padding: '1px 3px',
|
|
34
|
+
};
|
|
35
|
+
const rangeStyle = {
|
|
36
|
+
flex: 'none',
|
|
37
|
+
fontSize: 11,
|
|
38
|
+
opacity: 0.6,
|
|
39
|
+
fontVariantNumeric: 'tabular-nums',
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=SpectrumRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpectrumRow.js","sourceRoot":"","sources":["../../../src/ir/ui/SpectrumRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAwC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAsBvD;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,EACJ,QAAQ,EACR,QAAQ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,KAAK,CAAC,GACjD,EAEF,eAAM,KAAK,EAAE,UAAU,YAAG,KAAK,GAAQ,EAEvC,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,UAAU,EACf,YAAY,EAAE,EAAE,OAAO,EAAE,2CAA2C,EAAE,gBAC3D,wBAAwB,EACnC,OAAO,EAAE,UAAU,GACnB,EAEF,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,OAAO,EACZ,MAAM,EAAC,QAAQ,EACf,YAAY,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,gBACrC,qBAAqB,EAChC,OAAO,EAAE,QAAQ,GACjB,IACE,CACP,CAAC;AACJ,CAAC;AAED,MAAM,QAAQ,GAAG;IACf,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,GAAG,EAAE,CAAC;IACN,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,CAAC;CACP,CAAC;AAEX,MAAM,gBAAgB,GAAG,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAW,CAAC;AAEzE,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,CAAC;IACX,MAAM,EAAE,uBAAuB;IAC/B,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,aAAa;IACzB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,MAAM,UAAU,GAAG;IACjB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE,GAAG;IACZ,kBAAkB,EAAE,cAAc;CAC1B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The infrared chart, the panels beside it and the editor they sit in.
|
|
3
|
+
*
|
|
4
|
+
* `IrChart` is the drawing and holds nothing: it takes spectra, bands, a mode
|
|
5
|
+
* and a window as props and hands every gesture back, so it fits a report page
|
|
6
|
+
* or a test as readily as an editor. The chart's own drawing — scales, ticks,
|
|
7
|
+
* plot geometry, the zoom gestures and the label placement — is the shared
|
|
8
|
+
* chart layer, which every viewer of the family draws with.
|
|
9
|
+
*/
|
|
10
|
+
export type { BandMarksProps } from './BandMarks.tsx';
|
|
11
|
+
export { BandMarks } from './BandMarks.tsx';
|
|
12
|
+
export type { BandsPanelProps } from './BandsPanel.tsx';
|
|
13
|
+
export { BandsPanel } from './BandsPanel.tsx';
|
|
14
|
+
export type { IrAboutDialogProps } from './IrAboutDialog.tsx';
|
|
15
|
+
export { IrAboutDialog } from './IrAboutDialog.tsx';
|
|
16
|
+
export type { IrCanvasProps } from './IrCanvas.tsx';
|
|
17
|
+
export { IrCanvas } from './IrCanvas.tsx';
|
|
18
|
+
export { IrChart } from './IrChart.tsx';
|
|
19
|
+
export type { IrCommandProviderProps } from './IrCommandProvider.tsx';
|
|
20
|
+
export { IrCommandProvider } from './IrCommandProvider.tsx';
|
|
21
|
+
export type { IrCommandTooltipProps } from './IrCommandTooltip.tsx';
|
|
22
|
+
export { IrCommandTooltip } from './IrCommandTooltip.tsx';
|
|
23
|
+
export type { IrDocumentationDialogProps } from './IrDocumentationDialog.tsx';
|
|
24
|
+
export { IrDocumentationDialog } from './IrDocumentationDialog.tsx';
|
|
25
|
+
export type { IrEditorProps } from './IrEditor.tsx';
|
|
26
|
+
export { IrEditor } from './IrEditor.tsx';
|
|
27
|
+
export type { IrLogoProps } from './IrLogo.tsx';
|
|
28
|
+
export { IrLogo } from './IrLogo.tsx';
|
|
29
|
+
export type { IrPointerTrackerProps } from './IrPointerTracker.tsx';
|
|
30
|
+
export { IrPointerTracker } from './IrPointerTracker.tsx';
|
|
31
|
+
export type { IrSidePanelProps } from './IrSidePanel.tsx';
|
|
32
|
+
export { IrSidePanel } from './IrSidePanel.tsx';
|
|
33
|
+
export type { IrStateProviderProps } from './IrStateProvider.tsx';
|
|
34
|
+
export { IrStateProvider } from './IrStateProvider.tsx';
|
|
35
|
+
export { IrStatusBar } from './IrStatusBar.tsx';
|
|
36
|
+
export { IrToolbar } from './IrToolbar.tsx';
|
|
37
|
+
export type { IrTracesProps } from './IrTraces.tsx';
|
|
38
|
+
export { IrTraces } from './IrTraces.tsx';
|
|
39
|
+
export { MetadataPanel } from './MetadataPanel.tsx';
|
|
40
|
+
export { SpectraPanel } from './SpectraPanel.tsx';
|
|
41
|
+
export type { SpectrumRowProps } from './SpectrumRow.tsx';
|
|
42
|
+
export { SpectrumRow } from './SpectrumRow.tsx';
|
|
43
|
+
export type { IrEditorActions } from './irActions.ts';
|
|
44
|
+
export { createIrActions } from './irActions.ts';
|
|
45
|
+
export type { IrChartProps } from './irChartProps.ts';
|
|
46
|
+
export type { IrCommandContextValue } from './irCommandContext.tsx';
|
|
47
|
+
export { useIrCommand, useIrCommandProps } from './irCommandContext.tsx';
|
|
48
|
+
export { useIrActions, useIrEditorState } from './irStateContext.ts';
|
|
49
|
+
export type { IrEditorApi, UseIrEditorOptions } from './useIrEditor.ts';
|
|
50
|
+
export { useIrEditor } from './useIrEditor.ts';
|
|
51
|
+
export type { IrPointerOptions, IrReadout } from './useIrPointer.ts';
|
|
52
|
+
export { sameIrReadout, useIrPointer } from './useIrPointer.ts';
|
|
53
|
+
export { useIrShortcuts } from './useIrShortcuts.ts';
|
|
54
|
+
export type { IrZoomOptions } from './useIrZoom.ts';
|
|
55
|
+
export { useIrZoom } from './useIrZoom.ts';
|
|
56
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE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5C,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACrE,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The infrared chart, the panels beside it and the editor they sit in.
|
|
3
|
+
*
|
|
4
|
+
* `IrChart` is the drawing and holds nothing: it takes spectra, bands, a mode
|
|
5
|
+
* and a window as props and hands every gesture back, so it fits a report page
|
|
6
|
+
* or a test as readily as an editor. The chart's own drawing — scales, ticks,
|
|
7
|
+
* plot geometry, the zoom gestures and the label placement — is the shared
|
|
8
|
+
* chart layer, which every viewer of the family draws with.
|
|
9
|
+
*/
|
|
10
|
+
export { BandMarks } from "./BandMarks.js";
|
|
11
|
+
export { BandsPanel } from "./BandsPanel.js";
|
|
12
|
+
export { IrAboutDialog } from "./IrAboutDialog.js";
|
|
13
|
+
export { IrCanvas } from "./IrCanvas.js";
|
|
14
|
+
export { IrChart } from "./IrChart.js";
|
|
15
|
+
export { IrCommandProvider } from "./IrCommandProvider.js";
|
|
16
|
+
export { IrCommandTooltip } from "./IrCommandTooltip.js";
|
|
17
|
+
export { IrDocumentationDialog } from "./IrDocumentationDialog.js";
|
|
18
|
+
export { IrEditor } from "./IrEditor.js";
|
|
19
|
+
export { IrLogo } from "./IrLogo.js";
|
|
20
|
+
export { IrPointerTracker } from "./IrPointerTracker.js";
|
|
21
|
+
export { IrSidePanel } from "./IrSidePanel.js";
|
|
22
|
+
export { IrStateProvider } from "./IrStateProvider.js";
|
|
23
|
+
export { IrStatusBar } from "./IrStatusBar.js";
|
|
24
|
+
export { IrToolbar } from "./IrToolbar.js";
|
|
25
|
+
export { IrTraces } from "./IrTraces.js";
|
|
26
|
+
export { MetadataPanel } from "./MetadataPanel.js";
|
|
27
|
+
export { SpectraPanel } from "./SpectraPanel.js";
|
|
28
|
+
export { SpectrumRow } from "./SpectrumRow.js";
|
|
29
|
+
export { createIrActions } from "./irActions.js";
|
|
30
|
+
export { useIrCommand, useIrCommandProps } from "./irCommandContext.js";
|
|
31
|
+
export { useIrActions, useIrEditorState } from "./irStateContext.js";
|
|
32
|
+
export { useIrEditor } from "./useIrEditor.js";
|
|
33
|
+
export { sameIrReadout, useIrPointer } from "./useIrPointer.js";
|
|
34
|
+
export { useIrShortcuts } from "./useIrShortcuts.js";
|
|
35
|
+
export { useIrZoom } from "./useIrZoom.js";
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|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AE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything the viewer can be asked to do, as functions rather than actions.
|
|
3
|
+
*
|
|
4
|
+
* A component that dispatched action objects would have the shape of the reducer
|
|
5
|
+
* spread across every panel; one that calls `actions.selectSpectrum(id)` does
|
|
6
|
+
* not, and the reducer stays free to change how it holds things.
|
|
7
|
+
*/
|
|
8
|
+
import type { Dispatch } from 'react';
|
|
9
|
+
import type { IrAction } from '../core/irReducer.ts';
|
|
10
|
+
import type { IrSidePanelId } from '../core/irSidePanels.ts';
|
|
11
|
+
import type { IrDomain, IrSpectrum } from '../core/irSpectrum.ts';
|
|
12
|
+
import type { IrSettings, IrTool, PartialIrState } from '../core/irState.ts';
|
|
13
|
+
/** Everything the viewer can be asked to do. */
|
|
14
|
+
export interface IrEditorActions {
|
|
15
|
+
/** Draw these as well as what is already open. */
|
|
16
|
+
addSpectra: (spectra: IrSpectrum[]) => void;
|
|
17
|
+
/** Draw these instead of what is open, and refit the window to them. */
|
|
18
|
+
setSpectra: (spectra: IrSpectrum[]) => void;
|
|
19
|
+
/** Close one. */
|
|
20
|
+
removeSpectrum: (id: string) => void;
|
|
21
|
+
/** Call one something else. */
|
|
22
|
+
renameSpectrum: (id: string, name: string) => void;
|
|
23
|
+
/** Draw one in another colour. */
|
|
24
|
+
setSpectrumColor: (id: string, color: string) => void;
|
|
25
|
+
/** Draw one, or stop drawing it. */
|
|
26
|
+
setSpectrumVisible: (id: string, visible: boolean) => void;
|
|
27
|
+
/** Point the panels at one, or at none. */
|
|
28
|
+
selectSpectrum: (id: string | null) => void;
|
|
29
|
+
/** Show this window. */
|
|
30
|
+
setDomain: (domain: IrDomain) => void;
|
|
31
|
+
/** Show what fits again. */
|
|
32
|
+
resetDomain: () => void;
|
|
33
|
+
/** Run this tool on the next drag. */
|
|
34
|
+
setTool: (tool: IrTool) => void;
|
|
35
|
+
/** Open or close a side panel. */
|
|
36
|
+
togglePanel: (panelId: IrSidePanelId) => void;
|
|
37
|
+
/** Say why something was refused, or that nothing is wrong any more. */
|
|
38
|
+
setError: (error: string | null) => void;
|
|
39
|
+
/** Change how the spectra are drawn and read. */
|
|
40
|
+
setSettings: (settings: Partial<IrSettings>) => void;
|
|
41
|
+
/** Take a whole state, as a host restoring one supplies it. */
|
|
42
|
+
loadState: (state: PartialIrState) => void;
|
|
43
|
+
/** Close every spectrum and start again from an empty chart. */
|
|
44
|
+
clear: () => void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Bind every action to a dispatch.
|
|
48
|
+
* @param dispatch - The reducer's dispatch.
|
|
49
|
+
* @returns The actions, stable for as long as the dispatch is.
|
|
50
|
+
*/
|
|
51
|
+
export declare function createIrActions(dispatch: Dispatch<IrAction>): IrEditorActions;
|
|
52
|
+
//# sourceMappingURL=irActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irActions.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/irActions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oBAAoB,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E,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,eAAe,CAgD7E"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything the viewer can be asked to do, as functions rather than actions.
|
|
3
|
+
*
|
|
4
|
+
* A component that dispatched action objects would have the shape of the reducer
|
|
5
|
+
* spread across every panel; one that calls `actions.selectSpectrum(id)` does
|
|
6
|
+
* not, and the reducer stays free to change how it holds things.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Bind every action to a dispatch.
|
|
10
|
+
* @param dispatch - The reducer's dispatch.
|
|
11
|
+
* @returns The actions, stable for as long as the dispatch is.
|
|
12
|
+
*/
|
|
13
|
+
export function createIrActions(dispatch) {
|
|
14
|
+
return {
|
|
15
|
+
addSpectra(spectra) {
|
|
16
|
+
dispatch({ type: 'addSpectra', spectra });
|
|
17
|
+
},
|
|
18
|
+
setSpectra(spectra) {
|
|
19
|
+
dispatch({ type: 'setSpectra', spectra });
|
|
20
|
+
},
|
|
21
|
+
removeSpectrum(id) {
|
|
22
|
+
dispatch({ type: 'removeSpectrum', id });
|
|
23
|
+
},
|
|
24
|
+
renameSpectrum(id, name) {
|
|
25
|
+
dispatch({ type: 'renameSpectrum', id, name });
|
|
26
|
+
},
|
|
27
|
+
setSpectrumColor(id, color) {
|
|
28
|
+
dispatch({ type: 'setSpectrumColor', id, color });
|
|
29
|
+
},
|
|
30
|
+
setSpectrumVisible(id, visible) {
|
|
31
|
+
dispatch({ type: 'setSpectrumVisible', id, visible });
|
|
32
|
+
},
|
|
33
|
+
selectSpectrum(id) {
|
|
34
|
+
dispatch({ type: 'selectSpectrum', id });
|
|
35
|
+
},
|
|
36
|
+
setDomain(domain) {
|
|
37
|
+
dispatch({ type: 'setDomain', domain });
|
|
38
|
+
},
|
|
39
|
+
resetDomain() {
|
|
40
|
+
dispatch({ type: 'resetDomain' });
|
|
41
|
+
},
|
|
42
|
+
setTool(tool) {
|
|
43
|
+
dispatch({ type: 'setTool', tool });
|
|
44
|
+
},
|
|
45
|
+
togglePanel(panelId) {
|
|
46
|
+
dispatch({ type: 'togglePanel', panelId });
|
|
47
|
+
},
|
|
48
|
+
setError(error) {
|
|
49
|
+
dispatch({ type: 'setError', error });
|
|
50
|
+
},
|
|
51
|
+
setSettings(settings) {
|
|
52
|
+
dispatch({ type: 'setSettings', settings });
|
|
53
|
+
},
|
|
54
|
+
loadState(state) {
|
|
55
|
+
dispatch({ type: 'loadState', state });
|
|
56
|
+
},
|
|
57
|
+
clear() {
|
|
58
|
+
dispatch({ type: 'clear' });
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=irActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irActions.js","sourceRoot":"","sources":["../../../src/ir/ui/irActions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA2CH;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,QAA4B;IAC1D,OAAO;QACL,UAAU,CAAC,OAAO;YAChB,QAAQ,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC;QAC5C,CAAC;QACD,UAAU,CAAC,OAAO;YAChB,QAAQ,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC;QAC5C,CAAC;QACD,cAAc,CAAC,EAAE;YACf,QAAQ,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3C,CAAC;QACD,cAAc,CAAC,EAAE,EAAE,IAAI;YACrB,QAAQ,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QACjD,CAAC;QACD,gBAAgB,CAAC,EAAE,EAAE,KAAK;YACxB,QAAQ,CAA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* What a consumer hands the chart, and what the chart tells it back.
|
|
3
|
+
*
|
|
4
|
+
* Held apart from the component because it is the whole of the chart's public
|
|
5
|
+
* API — every spectrum drawn, every band marked on it and every gesture that
|
|
6
|
+
* comes back out is one of these — while the component behind it is an assembly
|
|
7
|
+
* of half a dozen layers nobody needs to read in order to mount one.
|
|
8
|
+
*
|
|
9
|
+
* Everything arrives as a prop and nothing is reached for: the chart reads no
|
|
10
|
+
* context and no store, so the same component serves an editor, a report page
|
|
11
|
+
* that only ever draws one spectrum, and a test.
|
|
12
|
+
*/
|
|
13
|
+
import type { ReactNode } from 'react';
|
|
14
|
+
import type { ZoomDragMode } from '../../chart/core/chartDomain.ts';
|
|
15
|
+
import type { AssignedBand } from '../core/assignBands.ts';
|
|
16
|
+
import type { IrBand } from '../core/irBand.ts';
|
|
17
|
+
import type { IrDomain, IrMode, IrSpectrum } from '../core/irSpectrum.ts';
|
|
18
|
+
export interface IrChartProps {
|
|
19
|
+
/** The spectra to draw, each saying in itself whether it is drawn. */
|
|
20
|
+
spectra: readonly IrSpectrum[];
|
|
21
|
+
/**
|
|
22
|
+
* Which value axis to draw them in.
|
|
23
|
+
*
|
|
24
|
+
* A prop rather than state, so the switch lives with whoever owns the toolbar
|
|
25
|
+
* that flips it — and so two charts of the same spectra can be shown side by
|
|
26
|
+
* side, one in each, which is the clearest way to see what the pair means.
|
|
27
|
+
* @default 'transmittance'
|
|
28
|
+
*/
|
|
29
|
+
mode?: IrMode;
|
|
30
|
+
/**
|
|
31
|
+
* The bands to mark, with whatever the correlation table said about them.
|
|
32
|
+
*
|
|
33
|
+
* Handed in rather than picked here, because the same bands answer the chart,
|
|
34
|
+
* a table beside it and any assignment count — and picking three times over
|
|
35
|
+
* would let them disagree.
|
|
36
|
+
* @default no bands
|
|
37
|
+
*/
|
|
38
|
+
assigned?: readonly AssignedBand[];
|
|
39
|
+
/**
|
|
40
|
+
* Whether each band label names its assignment as well as its wavenumber.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
showAssignments?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* At most how many bands are labelled; all of them are still marked.
|
|
46
|
+
* @default 12
|
|
47
|
+
*/
|
|
48
|
+
labelLimit?: number;
|
|
49
|
+
/**
|
|
50
|
+
* The band the pointer has come to rest on, wherever it was hovered. The chart
|
|
51
|
+
* draws its mark larger, which is how a band hovered in a panel beside the
|
|
52
|
+
* chart shows up on the trace.
|
|
53
|
+
* @default null
|
|
54
|
+
*/
|
|
55
|
+
highlight?: IrBand | null;
|
|
56
|
+
/**
|
|
57
|
+
* Told which band the pointer has come to rest on, and told `null` when it
|
|
58
|
+
* leaves — called only when the answer changes, so it is safe to hang a
|
|
59
|
+
* highlight that redraws half the page on it.
|
|
60
|
+
* @default undefined
|
|
61
|
+
*/
|
|
62
|
+
onHighlight?: (band: IrBand | null) => void;
|
|
63
|
+
/**
|
|
64
|
+
* The window to show, `null` to let the chart show what fits.
|
|
65
|
+
*
|
|
66
|
+
* The chart holds a window of its own — where you are looking is neither saved
|
|
67
|
+
* nor undone — so this is an override rather than the chart's state. Every
|
|
68
|
+
* window a gesture arrives at is reported through `onDomainChange`, and a host
|
|
69
|
+
* that keeps one is expected to hand back what it is told. Handing back `null`
|
|
70
|
+
* where a window was is how a host asks for the fit again, which is what "zoom
|
|
71
|
+
* to fit" on a toolbar comes down to.
|
|
72
|
+
*
|
|
73
|
+
* `x` is in wavenumbers and runs low to high, whichever way the axis is drawn.
|
|
74
|
+
* @default null
|
|
75
|
+
*/
|
|
76
|
+
domain?: IrDomain | null;
|
|
77
|
+
/**
|
|
78
|
+
* Told the window the chart has come to show, whenever it changes — a drag, a
|
|
79
|
+
* turn of the wheel, the double click that fits everything again, or a refit
|
|
80
|
+
* after what is drawn changed.
|
|
81
|
+
* @default undefined
|
|
82
|
+
*/
|
|
83
|
+
onDomainChange?: (domain: IrDomain) => void;
|
|
84
|
+
/**
|
|
85
|
+
* What a drag across the plot asks for: the wavenumber axis alone, or exactly
|
|
86
|
+
* the rectangle it sweeps out. A viewer offering a square-zoom tool switches
|
|
87
|
+
* this while the tool is chosen.
|
|
88
|
+
* @default 'xAxis'
|
|
89
|
+
*/
|
|
90
|
+
drag?: ZoomDragMode;
|
|
91
|
+
/**
|
|
92
|
+
* Identity of the spectrum drawn thicker than the rest, `null` for none.
|
|
93
|
+
* @default null
|
|
94
|
+
*/
|
|
95
|
+
emphasisedId?: string | null;
|
|
96
|
+
/**
|
|
97
|
+
* How wide the chart is drawn, in pixels. Left out, it fills the box it is
|
|
98
|
+
* given and follows it as that box is resized.
|
|
99
|
+
* @default the width of its container
|
|
100
|
+
*/
|
|
101
|
+
width?: number;
|
|
102
|
+
/**
|
|
103
|
+
* How tall it is drawn, in pixels.
|
|
104
|
+
* @default the height of its container
|
|
105
|
+
*/
|
|
106
|
+
height?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Anything else to draw over the spectra, in the same pixels and under the
|
|
109
|
+
* same clip — a band marking a region of interest, a second producer's layer,
|
|
110
|
+
* a ruler. It is rendered last inside the plot, so a host adds to the chart
|
|
111
|
+
* instead of forking it.
|
|
112
|
+
* @default undefined
|
|
113
|
+
*/
|
|
114
|
+
children?: ReactNode;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=irChartProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irChartProps.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/irChartProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE1E,MAAM,WAAW,YAAY;IAC3B,sEAAsE;IACtE,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IAC/B;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IACnC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IACzB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC5C;;;;;OAKG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a consumer hands the chart, and what the chart tells it back.
|
|
3
|
+
*
|
|
4
|
+
* Held apart from the component because it is the whole of the chart's public
|
|
5
|
+
* API — every spectrum drawn, every band marked on it and every gesture that
|
|
6
|
+
* comes back out is one of these — while the component behind it is an assembly
|
|
7
|
+
* of half a dozen layers nobody needs to read in order to mount one.
|
|
8
|
+
*
|
|
9
|
+
* Everything arrives as a prop and nothing is reached for: the chart reads no
|
|
10
|
+
* context and no store, so the same component serves an editor, a report page
|
|
11
|
+
* that only ever draws one spectrum, and a test.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=irChartProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irChartProps.js","sourceRoot":"","sources":["../../../src/ir/ui/irChartProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a component reaches the commands, and what a toolbar item needs to be one.
|
|
3
|
+
*
|
|
4
|
+
* The hooks and the context object, with no component of its own — see
|
|
5
|
+
* `irCommands.ts` for why the four files are split the way they are.
|
|
6
|
+
*/
|
|
7
|
+
import type { IrCommandHandlers, IrCommandId, RunIrCommand } from '../core/irCommands.ts';
|
|
8
|
+
/** What the provider holds. */
|
|
9
|
+
export interface IrCommandContextValue {
|
|
10
|
+
/** What each command does. */
|
|
11
|
+
handlers: IrCommandHandlers;
|
|
12
|
+
/** Run one. */
|
|
13
|
+
run: RunIrCommand;
|
|
14
|
+
}
|
|
15
|
+
/** Where the provider puts it. */
|
|
16
|
+
export declare const commandContext: import("react").Context<IrCommandContextValue | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Run a command from anywhere inside the viewer.
|
|
19
|
+
* @returns The runner; a command nothing handles does nothing.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useIrCommand(): RunIrCommand;
|
|
22
|
+
/**
|
|
23
|
+
* Everything a toolbar item needs to be one command, in one spread.
|
|
24
|
+
*
|
|
25
|
+
* The tooltip, the label a screen reader is given and the click handler all come
|
|
26
|
+
* from the same table entry, so a button cannot end up titled one thing and
|
|
27
|
+
* doing another.
|
|
28
|
+
* @returns A function from a command's identity to the props for its button.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useIrCommandProps(): (id: IrCommandId) => {
|
|
31
|
+
tooltip: import("react").JSX.Element;
|
|
32
|
+
'aria-label': string;
|
|
33
|
+
onClick: () => void;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=irCommandContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irCommandContext.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/irCommandContext.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACX,YAAY,EACb,MAAM,uBAAuB,CAAC;AAK/B,+BAA+B;AAC/B,MAAM,WAAW,qBAAqB;IACpC,8BAA8B;IAC9B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,eAAe;IACf,GAAG,EAAE,YAAY,CAAC;CACnB;AAED,kCAAkC;AAClC,eAAO,MAAM,cAAc,uDAAoD,CAAC;AAEhF;;;GAGG;AACH,wBAAgB,YAAY,IAAI,YAAY,CAG3C;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,KAEP,IAAI,WAAW;;;;EAOxC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* How a component reaches the commands, and what a toolbar item needs to be one.
|
|
4
|
+
*
|
|
5
|
+
* The hooks and the context object, with no component of its own — see
|
|
6
|
+
* `irCommands.ts` for why the four files are split the way they are.
|
|
7
|
+
*/
|
|
8
|
+
import { createContext, useContext } from 'react';
|
|
9
|
+
import { irCommandLabel } from "../core/irCommands.js";
|
|
10
|
+
import { IrCommandTooltip } from "./IrCommandTooltip.js";
|
|
11
|
+
/** Where the provider puts it. */
|
|
12
|
+
export const commandContext = createContext(null);
|
|
13
|
+
/**
|
|
14
|
+
* Run a command from anywhere inside the viewer.
|
|
15
|
+
* @returns The runner; a command nothing handles does nothing.
|
|
16
|
+
*/
|
|
17
|
+
export function useIrCommand() {
|
|
18
|
+
const value = useContext(commandContext);
|
|
19
|
+
return value?.run ?? noRun;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Everything a toolbar item needs to be one command, in one spread.
|
|
23
|
+
*
|
|
24
|
+
* The tooltip, the label a screen reader is given and the click handler all come
|
|
25
|
+
* from the same table entry, so a button cannot end up titled one thing and
|
|
26
|
+
* doing another.
|
|
27
|
+
* @returns A function from a command's identity to the props for its button.
|
|
28
|
+
*/
|
|
29
|
+
export function useIrCommandProps() {
|
|
30
|
+
const run = useIrCommand();
|
|
31
|
+
return function command(id) {
|
|
32
|
+
return {
|
|
33
|
+
tooltip: _jsx(IrCommandTooltip, { id: id }),
|
|
34
|
+
'aria-label': irCommandLabel(id),
|
|
35
|
+
onClick: () => run(id),
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** What running a command comes to outside a provider: nothing at all. */
|
|
40
|
+
function noRun() {
|
|
41
|
+
// Deliberately empty: a chart mounted without the shell has no commands, and
|
|
42
|
+
// a missing provider is not a reason to throw at a button press.
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=irCommandContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irCommandContext.js","sourceRoot":"","sources":["../../../src/ir/ui/irCommandContext.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAOlD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAwB,CAAC;AAU1D,kCAAkC;AAClC,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAA+B,IAAI,CAAC,CAAC;AAEhF;;;GAGG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,KAAK,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IACzC,OAAO,KAAK,EAAE,GAAG,IAAI,KAAK,CAAC;AAC7B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAG,YAAY,EAAE,CAAC;IAC3B,OAAO,SAAS,OAAO,CAAC,EAAe;QACrC,OAAO;YACL,OAAO,EAAE,KAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,GAAI;YACrC,YAAY,EAAE,cAAc,CAAC,EAAE,CAAC;YAChC,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;SACvB,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,0EAA0E;AAC1E,SAAS,KAAK;IACZ,6EAA6E;IAC7E,iEAAiE;AACnE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a panel reaches the viewer it is inside.
|
|
3
|
+
*
|
|
4
|
+
* Two contexts rather than one, because the actions never change while the state
|
|
5
|
+
* changes on every pointer move: a panel that only ever acts — a toolbar button —
|
|
6
|
+
* reads the second and is not re-rendered by the first.
|
|
7
|
+
*/
|
|
8
|
+
import type { IrEditorActions } from './irActions.ts';
|
|
9
|
+
import type { IrEditorApi } from './useIrEditor.ts';
|
|
10
|
+
/** Everything one viewer knows, as the provider holds it. */
|
|
11
|
+
export declare const stateContext: import("react").Context<IrEditorApi | null>;
|
|
12
|
+
/** Everything that changes it, as the provider holds it. */
|
|
13
|
+
export declare const actionsContext: import("react").Context<IrEditorActions | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Everything the viewer knows, from inside it.
|
|
16
|
+
* @returns The state and what follows from it.
|
|
17
|
+
* @throws {Error} When read outside an `IrStateProvider`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useIrEditorState(): IrEditorApi;
|
|
20
|
+
/**
|
|
21
|
+
* Everything to do, from inside the viewer.
|
|
22
|
+
* @returns The actions.
|
|
23
|
+
* @throws {Error} When read outside an `IrStateProvider`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useIrActions(): IrEditorActions;
|
|
26
|
+
//# sourceMappingURL=irStateContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irStateContext.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/irStateContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,6DAA6D;AAC7D,eAAO,MAAM,YAAY,6CAA0C,CAAC;AAEpE,4DAA4D;AAC5D,eAAO,MAAM,cAAc,iDAA8C,CAAC;AAE1E;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,WAAW,CAQ9C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,eAAe,CAQ9C"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a panel reaches the viewer it is inside.
|
|
3
|
+
*
|
|
4
|
+
* Two contexts rather than one, because the actions never change while the state
|
|
5
|
+
* changes on every pointer move: a panel that only ever acts — a toolbar button —
|
|
6
|
+
* reads the second and is not re-rendered by the first.
|
|
7
|
+
*/
|
|
8
|
+
import { createContext, useContext } from 'react';
|
|
9
|
+
/** Everything one viewer knows, as the provider holds it. */
|
|
10
|
+
export const stateContext = createContext(null);
|
|
11
|
+
/** Everything that changes it, as the provider holds it. */
|
|
12
|
+
export const actionsContext = createContext(null);
|
|
13
|
+
/**
|
|
14
|
+
* Everything the viewer knows, from inside it.
|
|
15
|
+
* @returns The state and what follows from it.
|
|
16
|
+
* @throws {Error} When read outside an `IrStateProvider`.
|
|
17
|
+
*/
|
|
18
|
+
export function useIrEditorState() {
|
|
19
|
+
const editor = useContext(stateContext);
|
|
20
|
+
if (editor === null) {
|
|
21
|
+
throw new Error('The infrared viewer state was read outside an IrStateProvider');
|
|
22
|
+
}
|
|
23
|
+
return editor;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Everything to do, from inside the viewer.
|
|
27
|
+
* @returns The actions.
|
|
28
|
+
* @throws {Error} When read outside an `IrStateProvider`.
|
|
29
|
+
*/
|
|
30
|
+
export function useIrActions() {
|
|
31
|
+
const actions = useContext(actionsContext);
|
|
32
|
+
if (actions === null) {
|
|
33
|
+
throw new Error('The infrared viewer actions were read outside an IrStateProvider');
|
|
34
|
+
}
|
|
35
|
+
return actions;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=irStateContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irStateContext.js","sourceRoot":"","sources":["../../../src/ir/ui/irStateContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAKlD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAqB,IAAI,CAAC,CAAC;AAEpE,4DAA4D;AAC5D,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAyB,IAAI,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACxC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,+DAA+D,CAChE,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One viewer's state, and everything derived from it.
|
|
3
|
+
*
|
|
4
|
+
* The bands are derived here rather than held, and that is the one structural
|
|
5
|
+
* decision in this file. Picking is a pure function of a spectrum and the
|
|
6
|
+
* picking settings, so a band held in state would be an answer that has to be
|
|
7
|
+
* invalidated by hand every time either changes — and the version that is wrong
|
|
8
|
+
* is the one drawn on the chart. Derived, a stale band cannot exist.
|
|
9
|
+
*
|
|
10
|
+
* It is memoised on the selected spectrum rather than on all of them: picking
|
|
11
|
+
* runs a peak detection over a few thousand points, and doing it for six loaded
|
|
12
|
+
* spectra when the panels only ever show one would cost six times what it needs
|
|
13
|
+
* to on every change of a threshold.
|
|
14
|
+
*/
|
|
15
|
+
import type { AssignedBand } from '../core/assignBands.ts';
|
|
16
|
+
import type { CreateIrStateOptions } from '../core/irReducer.ts';
|
|
17
|
+
import type { IrSpectrum } from '../core/irSpectrum.ts';
|
|
18
|
+
import type { IrState } from '../core/irState.ts';
|
|
19
|
+
import type { IrEditorActions } from './irActions.ts';
|
|
20
|
+
/** What a viewer opens on, and who to tell when the spectra change. */
|
|
21
|
+
export interface UseIrEditorOptions extends CreateIrStateOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Called whenever the spectra open change — one loaded, one closed, the chart
|
|
24
|
+
* cleared — with the spectra now open.
|
|
25
|
+
* @default undefined
|
|
26
|
+
*/
|
|
27
|
+
onChange?: (spectra: IrSpectrum[]) => void;
|
|
28
|
+
}
|
|
29
|
+
/** What a component drives the viewer through. */
|
|
30
|
+
export interface IrEditorApi {
|
|
31
|
+
/** Everything the viewer knows, in its three buckets. */
|
|
32
|
+
state: IrState;
|
|
33
|
+
/** The spectra currently drawn, in the order they were loaded. */
|
|
34
|
+
visibleSpectra: IrSpectrum[];
|
|
35
|
+
/** The spectrum the panels act on, `null` while none is selected. */
|
|
36
|
+
selectedSpectrum: IrSpectrum | null;
|
|
37
|
+
/**
|
|
38
|
+
* The bands of the selected spectrum, with everything each might be. Empty
|
|
39
|
+
* while nothing is selected or while picking is switched off.
|
|
40
|
+
*/
|
|
41
|
+
assigned: AssignedBand[];
|
|
42
|
+
/** Everything to do. */
|
|
43
|
+
actions: IrEditorActions;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Hold one viewer's state.
|
|
47
|
+
* @param options - What it opens on.
|
|
48
|
+
* @returns The state, what follows from it, and everything to do.
|
|
49
|
+
*/
|
|
50
|
+
export declare function useIrEditor(options?: UseIrEditorOptions): IrEditorApi;
|
|
51
|
+
//# sourceMappingURL=useIrEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIrEditor.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/useIrEditor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,uEAAuE;AACvE,MAAM,WAAW,kBAAmB,SAAQ,oBAAoB;IAC9D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;CAC5C;AAED,kDAAkD;AAClD,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,KAAK,EAAE,OAAO,CAAC;IACf,kEAAkE;IAClE,cAAc,EAAE,UAAU,EAAE,CAAC;IAC7B,qEAAqE;IACrE,gBAAgB,EAAE,UAAU,GAAG,IAAI,CAAC;IACpC;;;OAGG;IACH,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,wBAAwB;IACxB,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,WAAW,CA0DzE"}
|