react-cheminfo 0.28.0 → 0.30.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 +79 -26
- 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/chrome/ui/AccountButton.d.ts +76 -0
- package/lib/chrome/ui/AccountButton.d.ts.map +1 -0
- package/lib/chrome/ui/AccountButton.js +66 -0
- package/lib/chrome/ui/AccountButton.js.map +1 -0
- package/lib/chrome/ui/index.d.ts +2 -0
- package/lib/chrome/ui/index.d.ts.map +1 -1
- package/lib/chrome/ui/index.js +1 -0
- package/lib/chrome/ui/index.js.map +1 -1
- 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/ClickToCopy.d.ts +6 -0
- package/lib/clipboard/ui/ClickToCopy.d.ts.map +1 -1
- package/lib/clipboard/ui/ClickToCopy.js +3 -3
- package/lib/clipboard/ui/ClickToCopy.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/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.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/locales/de.json +3 -0
- package/lib/locales/en.json +3 -0
- package/lib/locales/es.json +3 -0
- package/lib/locales/fr.json +3 -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/structure/core/conformerBoltzmann.d.ts +56 -0
- package/lib/structure/core/conformerBoltzmann.d.ts.map +1 -0
- package/lib/structure/core/conformerBoltzmann.js +96 -0
- package/lib/structure/core/conformerBoltzmann.js.map +1 -0
- package/lib/structure/core/conformerEnergy.d.ts +69 -0
- package/lib/structure/core/conformerEnergy.d.ts.map +1 -0
- package/lib/structure/core/conformerEnergy.js +47 -0
- package/lib/structure/core/conformerEnergy.js.map +1 -0
- package/lib/structure/core/index.d.ts +3 -0
- package/lib/structure/core/index.d.ts.map +1 -1
- package/lib/structure/core/index.js +2 -0
- package/lib/structure/core/index.js.map +1 -1
- package/lib/structure/ui/ConformerTable.d.ts +73 -0
- package/lib/structure/ui/ConformerTable.d.ts.map +1 -0
- package/lib/structure/ui/ConformerTable.js +259 -0
- package/lib/structure/ui/ConformerTable.js.map +1 -0
- package/lib/structure/ui/conformerColumns.d.ts +30 -0
- package/lib/structure/ui/conformerColumns.d.ts.map +1 -0
- package/lib/structure/ui/conformerColumns.js +37 -0
- package/lib/structure/ui/conformerColumns.js.map +1 -0
- package/lib/ui.d.ts +5 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +3 -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/chrome/ui/AccountButton.tsx +185 -0
- package/src/chrome/ui/index.ts +2 -0
- package/src/clipboard/core/copyPng.ts +20 -0
- package/src/clipboard/core/index.ts +1 -0
- package/src/clipboard/ui/ClickToCopy.tsx +9 -1
- 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/locales/de.json +3 -0
- package/src/locales/en.json +3 -0
- package/src/locales/es.json +3 -0
- package/src/locales/fr.json +3 -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/structure/core/conformerBoltzmann.ts +102 -0
- package/src/structure/core/conformerEnergy.ts +97 -0
- package/src/structure/core/index.ts +15 -0
- package/src/structure/ui/ConformerTable.tsx +429 -0
- package/src/structure/ui/conformerColumns.ts +55 -0
- package/src/ui.ts +13 -0
- package/styles/chrome.css +55 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import type { Ref } from 'react';
|
|
2
|
+
import { useCallback, useImperativeHandle, useMemo, useState } from 'react';
|
|
3
|
+
import { SplitPane, useFullscreen } from 'react-science/ui';
|
|
4
|
+
|
|
5
|
+
import { sanitizeFileName } from '../../download/core/sanitizeFileName.ts';
|
|
6
|
+
import { ExportImageDialog } from '../../download/ui/ExportImageDialog.tsx';
|
|
7
|
+
import { useDrawingBox } from '../../download/ui/useDrawingBox.ts';
|
|
8
|
+
import { PanelRail } from '../../panel/ui/PanelRail.tsx';
|
|
9
|
+
import type { IrBand } from '../core/irBand.ts';
|
|
10
|
+
import type { IrCommandHandlers } from '../core/irCommands.ts';
|
|
11
|
+
import { fullDomain } from '../core/irDomain.ts';
|
|
12
|
+
import type { IrEditorHandle, ZoomToBandOptions } from '../core/irEditorApi.ts';
|
|
13
|
+
import { otherIrMode, yAxisRules } from '../core/irMode.ts';
|
|
14
|
+
import { irSidePanels } from '../core/irSidePanels.ts';
|
|
15
|
+
import type { IrDomain, IrSpectrum } from '../core/irSpectrum.ts';
|
|
16
|
+
import { DEFAULT_SIDE_PANEL } from '../core/irState.ts';
|
|
17
|
+
|
|
18
|
+
import { IrAboutDialog } from './IrAboutDialog.tsx';
|
|
19
|
+
import { IrCanvas } from './IrCanvas.tsx';
|
|
20
|
+
import { IrCommandProvider } from './IrCommandProvider.tsx';
|
|
21
|
+
import { IrDocumentationDialog } from './IrDocumentationDialog.tsx';
|
|
22
|
+
import { IrHeader } from './IrHeader.tsx';
|
|
23
|
+
import { IrSidePanel } from './IrSidePanel.tsx';
|
|
24
|
+
import { IrToolbar } from './IrToolbar.tsx';
|
|
25
|
+
import { useIrActions, useIrEditorState } from './irStateContext.ts';
|
|
26
|
+
import { useIrShortcuts } from './useIrShortcuts.ts';
|
|
27
|
+
|
|
28
|
+
export interface IrShellProps {
|
|
29
|
+
/**
|
|
30
|
+
* The handle to fill in, once there is a state for it to act on.
|
|
31
|
+
* @default undefined
|
|
32
|
+
*/
|
|
33
|
+
handle?: Ref<IrEditorHandle>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The viewer's screen: a header, the rails, and the split between the chart and
|
|
38
|
+
* the panels.
|
|
39
|
+
*
|
|
40
|
+
* Kept apart from `IrEditor` so that the handle, the commands and the highlight —
|
|
41
|
+
* all of which need the state — sit below the providers rather than beside them,
|
|
42
|
+
* and so the sealed component above is nothing but its props.
|
|
43
|
+
*
|
|
44
|
+
* The panels run to the bottom edge while the status bar stops at the splitter,
|
|
45
|
+
* which is what says the bar belongs to the chart and the panels are their own
|
|
46
|
+
* column.
|
|
47
|
+
* @param props - Component props.
|
|
48
|
+
* @returns The screen.
|
|
49
|
+
*/
|
|
50
|
+
export function IrShell(props: IrShellProps) {
|
|
51
|
+
const { handle } = props;
|
|
52
|
+
|
|
53
|
+
const { state, visibleSpectra, selectedSpectrum } = useIrEditorState();
|
|
54
|
+
const actions = useIrActions();
|
|
55
|
+
const { toggle: toggleFullScreen } = useFullscreen();
|
|
56
|
+
const { openPanelIds, tool, domain } = state.view;
|
|
57
|
+
const { mode, pickBands, showAssignments } = state.settings;
|
|
58
|
+
|
|
59
|
+
const [isAboutOpen, setIsAboutOpen] = useState(false);
|
|
60
|
+
const [isDocumentationOpen, setIsDocumentationOpen] = useState(false);
|
|
61
|
+
const [isExportImageOpen, setIsExportImageOpen] = useState(false);
|
|
62
|
+
|
|
63
|
+
// The chart is the picture, so the box it is drawn in is what the export
|
|
64
|
+
// dialog is pointed at: the viewer around it is full of SVG — every icon in
|
|
65
|
+
// every toolbar is one — and the first found there would be a magnifier.
|
|
66
|
+
const chart = useDrawingBox();
|
|
67
|
+
// The highlight is held here rather than in the reducer: what the pointer is
|
|
68
|
+
// resting on is not part of the document and changes on every move across the
|
|
69
|
+
// chart, so putting it through the reducer would run every panel's memo sixty
|
|
70
|
+
// times a second.
|
|
71
|
+
const [highlight, setHighlight] = useState<IrBand | null>(null);
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* ChartScale the value axis by a factor, about the baseline the mode hangs from.
|
|
75
|
+
* @param factor - Above one to zoom out.
|
|
76
|
+
*/
|
|
77
|
+
const scaleValueAxis = useCallback(
|
|
78
|
+
(factor: number) => {
|
|
79
|
+
const shown = domain ?? fullDomain(visibleSpectra, mode);
|
|
80
|
+
// Asked of the mode rather than written out again here: the baseline a
|
|
81
|
+
// value axis is scaled about is `irMode`'s to know, and a second copy of
|
|
82
|
+
// it is a second thing to get wrong.
|
|
83
|
+
const { baseline = 0 } = yAxisRules(mode);
|
|
84
|
+
actions.setDomain({
|
|
85
|
+
x: shown.x,
|
|
86
|
+
y: [
|
|
87
|
+
baseline + (shown.y[0] - baseline) * factor,
|
|
88
|
+
baseline + (shown.y[1] - baseline) * factor,
|
|
89
|
+
],
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
[actions, domain, visibleSpectra, mode],
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const commands = useMemo<IrCommandHandlers>(
|
|
96
|
+
() => ({
|
|
97
|
+
about: () => setIsAboutOpen(true),
|
|
98
|
+
documentation: () => setIsDocumentationOpen(true),
|
|
99
|
+
fullScreen: toggleFullScreen,
|
|
100
|
+
readTool: () => actions.setTool('read'),
|
|
101
|
+
boxTool: () => actions.setTool(tool === 'box' ? 'read' : 'box'),
|
|
102
|
+
zoomIn: () => scaleValueAxis(1 / ZOOM_STEP),
|
|
103
|
+
zoomOut: () => scaleValueAxis(ZOOM_STEP),
|
|
104
|
+
resetZoom: () => actions.resetDomain(),
|
|
105
|
+
toggleMode: () => actions.setSettings({ mode: otherIrMode(mode) }),
|
|
106
|
+
togglePicking: () => actions.setSettings({ pickBands: !pickBands }),
|
|
107
|
+
toggleAssignments: () =>
|
|
108
|
+
actions.setSettings({ showAssignments: !showAssignments }),
|
|
109
|
+
exportImage: () => setIsExportImageOpen(true),
|
|
110
|
+
clear: () => actions.clear(),
|
|
111
|
+
}),
|
|
112
|
+
[
|
|
113
|
+
actions,
|
|
114
|
+
tool,
|
|
115
|
+
mode,
|
|
116
|
+
pickBands,
|
|
117
|
+
showAssignments,
|
|
118
|
+
scaleValueAxis,
|
|
119
|
+
toggleFullScreen,
|
|
120
|
+
],
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
// The root is held as state rather than in a ref because the keys are bound to
|
|
124
|
+
// it from an effect: a ref filled in during the commit would leave the effect
|
|
125
|
+
// with nothing to listen on for the first render, and no reason ever to run
|
|
126
|
+
// again.
|
|
127
|
+
const [root, setRoot] = useState<HTMLElement | null>(null);
|
|
128
|
+
useIrShortcuts(root, commands);
|
|
129
|
+
|
|
130
|
+
useImperativeHandle(
|
|
131
|
+
handle,
|
|
132
|
+
(): IrEditorHandle => ({
|
|
133
|
+
getSpectra: () => state.data.spectra,
|
|
134
|
+
setSpectra: (spectra) => actions.setSpectra(spectra),
|
|
135
|
+
addSpectra: (spectra) => actions.addSpectra(spectra),
|
|
136
|
+
clear: () => actions.clear(),
|
|
137
|
+
setDomain: (next) => actions.setDomain(next),
|
|
138
|
+
resetDomain: () => actions.resetDomain(),
|
|
139
|
+
zoomToWavenumber: (wavenumber, options: ZoomToBandOptions = {}) => {
|
|
140
|
+
const { width = DEFAULT_FRAME_WIDTH } = options;
|
|
141
|
+
const shown: IrDomain = domain ?? fullDomain(visibleSpectra, mode);
|
|
142
|
+
actions.setDomain({
|
|
143
|
+
x: [wavenumber - width / 2, wavenumber + width / 2],
|
|
144
|
+
y: shown.y,
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
selectSpectrum: (id) => actions.selectSpectrum(id),
|
|
148
|
+
}),
|
|
149
|
+
[state.data.spectra, actions, domain, visibleSpectra, mode],
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Open or close the side, as the splitter is dragged shut and back open.
|
|
154
|
+
* @param open - Whether the side is now open.
|
|
155
|
+
*/
|
|
156
|
+
function setSideOpen(open: boolean): void {
|
|
157
|
+
if (!open) {
|
|
158
|
+
for (const panelId of openPanelIds) actions.togglePanel(panelId);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
// Dragging the splitter back open must land on something, or it opens on an
|
|
162
|
+
// empty column and reads as broken.
|
|
163
|
+
if (openPanelIds.length === 0) actions.togglePanel(DEFAULT_SIDE_PANEL);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return (
|
|
167
|
+
<IrCommandProvider handlers={commands}>
|
|
168
|
+
{/* `tabIndex` so a click anywhere in the viewer makes this the target the
|
|
169
|
+
shortcuts are heard on: keys are delivered to whatever holds the caret,
|
|
170
|
+
and an SVG never does. */}
|
|
171
|
+
<div ref={setRoot} tabIndex={-1} style={rootStyle}>
|
|
172
|
+
<IrHeader />
|
|
173
|
+
|
|
174
|
+
<div style={mainStyle}>
|
|
175
|
+
{/* The rails are chrome of a fixed width, and a flex child shrinks by
|
|
176
|
+
default: in a narrow viewer the row would take the width it is
|
|
177
|
+
short of out of them, and half an icon is what that looks like. */}
|
|
178
|
+
<div style={railStyle}>
|
|
179
|
+
<IrToolbar />
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<SplitPane
|
|
183
|
+
direction="horizontal"
|
|
184
|
+
controlledSide="end"
|
|
185
|
+
defaultSize="360px"
|
|
186
|
+
open={openPanelIds.length > 0}
|
|
187
|
+
onOpenChange={setSideOpen}
|
|
188
|
+
>
|
|
189
|
+
<IrCanvas
|
|
190
|
+
highlight={highlight}
|
|
191
|
+
onHighlight={setHighlight}
|
|
192
|
+
attachChart={chart.attach}
|
|
193
|
+
/>
|
|
194
|
+
|
|
195
|
+
<IrSidePanel highlight={highlight} onHighlight={setHighlight} />
|
|
196
|
+
</SplitPane>
|
|
197
|
+
|
|
198
|
+
{/* Outside the split, so the icons stay put against the right edge
|
|
199
|
+
while the panel beside them is resized or closed. */}
|
|
200
|
+
<div style={railStyle}>
|
|
201
|
+
<PanelRail
|
|
202
|
+
panels={irSidePanels}
|
|
203
|
+
openIds={openPanelIds}
|
|
204
|
+
onToggle={actions.togglePanel}
|
|
205
|
+
/>
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<IrAboutDialog
|
|
211
|
+
isOpen={isAboutOpen}
|
|
212
|
+
onClose={() => setIsAboutOpen(false)}
|
|
213
|
+
/>
|
|
214
|
+
<IrDocumentationDialog
|
|
215
|
+
isOpen={isDocumentationOpen}
|
|
216
|
+
onClose={() => setIsDocumentationOpen(false)}
|
|
217
|
+
/>
|
|
218
|
+
|
|
219
|
+
{/* `element`, not `content`: the chart is drawn to the box it was given,
|
|
220
|
+
so the box is the picture — measuring the marks inside it would crop
|
|
221
|
+
the frame to wherever the trace happens to reach and leave the axes
|
|
222
|
+
hanging. */}
|
|
223
|
+
<ExportImageDialog
|
|
224
|
+
isOpen={isExportImageOpen}
|
|
225
|
+
getDrawing={chart.getDrawing}
|
|
226
|
+
frame="element"
|
|
227
|
+
filename={pictureName(visibleSpectra, selectedSpectrum)}
|
|
228
|
+
label="Infrared spectrum"
|
|
229
|
+
onClose={() => setIsExportImageOpen(false)}
|
|
230
|
+
/>
|
|
231
|
+
</IrCommandProvider>
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* What one press of zoom in or out is worth.
|
|
237
|
+
*
|
|
238
|
+
* A fifth, which is about what one notch of a mouse wheel does — so the button
|
|
239
|
+
* and the wheel feel like the same gesture at two speeds rather than two
|
|
240
|
+
* different ones.
|
|
241
|
+
*/
|
|
242
|
+
const ZOOM_STEP = 1.2;
|
|
243
|
+
|
|
244
|
+
/** How wide a window a host gets when it asks to frame a band without saying. */
|
|
245
|
+
const DEFAULT_FRAME_WIDTH = 200;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* What a picture of the chart is called before anything is typed in the box.
|
|
249
|
+
*
|
|
250
|
+
* The spectrum being looked at, since a figure of the chart is a figure of that
|
|
251
|
+
* spectrum, and a chemist who has one run open should not have to work out
|
|
252
|
+
* which of their downloads `spectra.png` was. A chart holding several and
|
|
253
|
+
* pointing at none of them is named after the lot.
|
|
254
|
+
* @param spectra - What is drawn.
|
|
255
|
+
* @param selected - The one being looked at, `null` when none is.
|
|
256
|
+
* @returns The name, without its extension.
|
|
257
|
+
*/
|
|
258
|
+
function pictureName(
|
|
259
|
+
spectra: readonly IrSpectrum[],
|
|
260
|
+
selected: IrSpectrum | null,
|
|
261
|
+
): string {
|
|
262
|
+
const named = selected ?? (spectra.length === 1 ? spectra[0] : undefined);
|
|
263
|
+
return named === undefined
|
|
264
|
+
? 'spectra'
|
|
265
|
+
: sanitizeFileName(named.name, 'spectrum');
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const rootStyle = {
|
|
269
|
+
display: 'flex',
|
|
270
|
+
flexDirection: 'column',
|
|
271
|
+
flex: '1 1 1px',
|
|
272
|
+
width: '100%',
|
|
273
|
+
height: '100%',
|
|
274
|
+
minHeight: 0,
|
|
275
|
+
outline: 'none',
|
|
276
|
+
} as const;
|
|
277
|
+
|
|
278
|
+
const mainStyle = {
|
|
279
|
+
display: 'flex',
|
|
280
|
+
flex: '1 1 1px',
|
|
281
|
+
minWidth: 0,
|
|
282
|
+
minHeight: 0,
|
|
283
|
+
} as const;
|
|
284
|
+
|
|
285
|
+
const railStyle = { flex: 'none' } as const;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { SidePanelStack } from '../../panel/ui/SidePanelStack.tsx';
|
|
2
|
+
import type { IrBand } from '../core/irBand.ts';
|
|
3
|
+
import type { IrSidePanelId } from '../core/irSidePanels.ts';
|
|
4
|
+
import { irSidePanels } from '../core/irSidePanels.ts';
|
|
5
|
+
|
|
6
|
+
import { BandsPanel } from './BandsPanel.tsx';
|
|
7
|
+
import { MetadataPanel } from './MetadataPanel.tsx';
|
|
8
|
+
import { SpectraPanel } from './SpectraPanel.tsx';
|
|
9
|
+
import { useIrActions, useIrEditorState } from './irStateContext.ts';
|
|
10
|
+
|
|
11
|
+
export interface IrSidePanelProps {
|
|
12
|
+
/**
|
|
13
|
+
* The band the pointer is resting on.
|
|
14
|
+
* @default null
|
|
15
|
+
*/
|
|
16
|
+
highlight?: IrBand | null;
|
|
17
|
+
/**
|
|
18
|
+
* Told when a row is hovered.
|
|
19
|
+
* @default undefined
|
|
20
|
+
*/
|
|
21
|
+
onHighlight?: (band: IrBand | null) => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The panels that are open, stacked down the right.
|
|
26
|
+
*
|
|
27
|
+
* Every open panel gets a share of the height rather than a turn, because the
|
|
28
|
+
* things they hold are read together: which spectrum is selected and what its
|
|
29
|
+
* bands are is one question asked of two panels. The header carries the close
|
|
30
|
+
* button and nothing else — a panel's own actions are a toolbar inside its body,
|
|
31
|
+
* so they travel with it.
|
|
32
|
+
* @param props - Component props.
|
|
33
|
+
* @returns The panel stack.
|
|
34
|
+
*/
|
|
35
|
+
export function IrSidePanel(props: IrSidePanelProps) {
|
|
36
|
+
const { highlight = null, onHighlight } = props;
|
|
37
|
+
const { state } = useIrEditorState();
|
|
38
|
+
const actions = useIrActions();
|
|
39
|
+
const { openPanelIds } = state.view;
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<SidePanelStack
|
|
43
|
+
panels={irSidePanels}
|
|
44
|
+
openPanelIds={openPanelIds}
|
|
45
|
+
onClose={actions.togglePanel}
|
|
46
|
+
>
|
|
47
|
+
{(panel) => (
|
|
48
|
+
<PanelBody
|
|
49
|
+
panelId={panel.id}
|
|
50
|
+
highlight={highlight}
|
|
51
|
+
onHighlight={onHighlight}
|
|
52
|
+
/>
|
|
53
|
+
)}
|
|
54
|
+
</SidePanelStack>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface PanelBodyProps {
|
|
59
|
+
/** Which panel to draw. */
|
|
60
|
+
panelId: IrSidePanelId;
|
|
61
|
+
/** The band the pointer is resting on. */
|
|
62
|
+
highlight: IrBand | null;
|
|
63
|
+
/** Told when a row is hovered. */
|
|
64
|
+
onHighlight?: (band: IrBand | null) => void;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Which panel a panel id is.
|
|
69
|
+
* @param props - Component props.
|
|
70
|
+
* @returns The panel's body.
|
|
71
|
+
*/
|
|
72
|
+
function PanelBody(props: PanelBodyProps) {
|
|
73
|
+
const { panelId, highlight, onHighlight } = props;
|
|
74
|
+
|
|
75
|
+
if (panelId === 'spectra') return <SpectraPanel />;
|
|
76
|
+
if (panelId === 'metadata') return <MetadataPanel />;
|
|
77
|
+
return <BandsPanel highlight={highlight} onHighlight={onHighlight} />;
|
|
78
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { actionsContext, stateContext } from './irStateContext.ts';
|
|
4
|
+
import type { IrEditorApi } from './useIrEditor.ts';
|
|
5
|
+
|
|
6
|
+
export interface IrStateProviderProps {
|
|
7
|
+
/** The viewer's state, as `useIrEditor` holds it. */
|
|
8
|
+
editor: IrEditorApi;
|
|
9
|
+
/** The viewer. */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Put one viewer's state where its panels can reach it.
|
|
15
|
+
*
|
|
16
|
+
* The state and the actions go into separate contexts on purpose — see
|
|
17
|
+
* `irStateContext.ts` for why — and the actions are handed over as they are,
|
|
18
|
+
* since `useIrEditor` already keeps them stable for the life of the viewer.
|
|
19
|
+
* @param props - Component props.
|
|
20
|
+
* @returns The provider.
|
|
21
|
+
*/
|
|
22
|
+
export function IrStateProvider(props: IrStateProviderProps) {
|
|
23
|
+
const { editor, children } = props;
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<stateContext.Provider value={editor}>
|
|
27
|
+
<actionsContext.Provider value={editor.actions}>
|
|
28
|
+
{children}
|
|
29
|
+
</actionsContext.Provider>
|
|
30
|
+
</stateContext.Provider>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Icon } from '@blueprintjs/core';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
countLabel,
|
|
5
|
+
statusBarStyle as barStyle,
|
|
6
|
+
statusItemStyle as itemStyle,
|
|
7
|
+
statusMutedStyle as mutedStyle,
|
|
8
|
+
statusSpacerStyle as spacerStyle,
|
|
9
|
+
} from '../../panel/core/statusBar.ts';
|
|
10
|
+
import { countAssigned } from '../core/assignBands.ts';
|
|
11
|
+
import { formatWavenumber } from '../core/irFormat.ts';
|
|
12
|
+
import { boxZoomOnly, yAxisTitle } from '../core/irMode.ts';
|
|
13
|
+
|
|
14
|
+
import { useIrEditorState } from './irStateContext.ts';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The one line under the chart: what is drawn, what was found, what went wrong.
|
|
18
|
+
*
|
|
19
|
+
* Everything in it is derived, so it is the cheapest place in the viewer to
|
|
20
|
+
* answer "did that work" — how many spectra are drawn of those open, how many
|
|
21
|
+
* bands the picking found and how many the table had something to say about, and
|
|
22
|
+
* the range the selected spectrum covers.
|
|
23
|
+
*
|
|
24
|
+
* The refusal is last and is the only red in the shell, so the eye that has just
|
|
25
|
+
* pressed something and seen nothing happen lands on the reason.
|
|
26
|
+
* @returns The status bar.
|
|
27
|
+
*/
|
|
28
|
+
export function IrStatusBar() {
|
|
29
|
+
const { state, visibleSpectra, selectedSpectrum, assigned } =
|
|
30
|
+
useIrEditorState();
|
|
31
|
+
const { spectra } = state.data;
|
|
32
|
+
const { error, tool } = state.view;
|
|
33
|
+
const { mode, pickBands } = state.settings;
|
|
34
|
+
|
|
35
|
+
const range =
|
|
36
|
+
selectedSpectrum === null || selectedSpectrum.wavenumber.length === 0
|
|
37
|
+
? null
|
|
38
|
+
: `${formatWavenumber(selectedSpectrum.wavenumber.at(-1) as number)}–${formatWavenumber(selectedSpectrum.wavenumber[0] as number)} cm⁻¹`;
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div style={barStyle}>
|
|
42
|
+
<span style={itemStyle}>
|
|
43
|
+
{spectra.length === 0
|
|
44
|
+
? 'no spectrum open'
|
|
45
|
+
: `${countLabel(visibleSpectra.length, 'spectrum', 'spectra')} drawn of ${spectra.length}`}
|
|
46
|
+
</span>
|
|
47
|
+
|
|
48
|
+
<span style={itemStyle}>{yAxisTitle(mode)}</span>
|
|
49
|
+
|
|
50
|
+
{selectedSpectrum === null ? null : (
|
|
51
|
+
<span style={nameStyle} title={selectedSpectrum.name}>
|
|
52
|
+
{selectedSpectrum.name}
|
|
53
|
+
</span>
|
|
54
|
+
)}
|
|
55
|
+
|
|
56
|
+
{range === null ? null : <span style={mutedStyle}>{range}</span>}
|
|
57
|
+
|
|
58
|
+
{pickBands && assigned.length > 0 ? (
|
|
59
|
+
<span style={itemStyle}>
|
|
60
|
+
{countLabel(assigned.length, 'band', 'bands')},{' '}
|
|
61
|
+
{countAssigned(assigned)} assigned
|
|
62
|
+
</span>
|
|
63
|
+
) : null}
|
|
64
|
+
|
|
65
|
+
{boxZoomOnly(mode) || tool === 'box' ? (
|
|
66
|
+
<span style={mutedStyle}>square zoom: drag a rectangle</span>
|
|
67
|
+
) : null}
|
|
68
|
+
|
|
69
|
+
<span style={spacerStyle} />
|
|
70
|
+
|
|
71
|
+
{error === null ? null : (
|
|
72
|
+
<span style={errorStyle} title={error}>
|
|
73
|
+
<Icon icon="warning-sign" size={12} />
|
|
74
|
+
{error}
|
|
75
|
+
</span>
|
|
76
|
+
)}
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const nameStyle = {
|
|
82
|
+
...itemStyle,
|
|
83
|
+
overflow: 'hidden',
|
|
84
|
+
textOverflow: 'ellipsis',
|
|
85
|
+
maxWidth: '32%',
|
|
86
|
+
fontWeight: 600,
|
|
87
|
+
} as const;
|
|
88
|
+
|
|
89
|
+
/** The one red in the shell: a refusal, and nothing else, is written in it. */
|
|
90
|
+
const errorStyle = {
|
|
91
|
+
...itemStyle,
|
|
92
|
+
gap: 4,
|
|
93
|
+
color: '#C0392B',
|
|
94
|
+
overflow: 'hidden',
|
|
95
|
+
textOverflow: 'ellipsis',
|
|
96
|
+
maxWidth: '60%',
|
|
97
|
+
} as const;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Toolbar } from 'react-science/ui';
|
|
2
|
+
|
|
3
|
+
import { boxZoomOnly } from '../core/irMode.ts';
|
|
4
|
+
|
|
5
|
+
import { useIrCommandProps } from './irCommandContext.tsx';
|
|
6
|
+
import { useIrEditorState } from './irStateContext.ts';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The tools, down the left of the chart.
|
|
10
|
+
*
|
|
11
|
+
* Only what is done to the spectra: what is asked of the viewer itself — the
|
|
12
|
+
* mark, help, full screen — is in the header. The two **tools** — read and
|
|
13
|
+
* square zoom — come first and show which of the two a drag is currently
|
|
14
|
+
* running, then the zoom commands that act at once, then what is being read: the
|
|
15
|
+
* value axis, the picking, the assignments. Closing every spectrum is last and
|
|
16
|
+
* alone, being the only one that throws something away.
|
|
17
|
+
*
|
|
18
|
+
* Reading percent transmittance, the pair is settled rather than chosen: every
|
|
19
|
+
* drag on that axis is a rectangle, so both buttons go dead with the square zoom
|
|
20
|
+
* lit. Showing `read` as available there would offer a gesture the chart does not
|
|
21
|
+
* make, and showing it as *active* would name the wrong one.
|
|
22
|
+
* @returns The toolbar.
|
|
23
|
+
*/
|
|
24
|
+
export function IrToolbar() {
|
|
25
|
+
const { state, selectedSpectrum } = useIrEditorState();
|
|
26
|
+
const command = useIrCommandProps();
|
|
27
|
+
const { spectra } = state.data;
|
|
28
|
+
const { domain, tool } = state.view;
|
|
29
|
+
const { mode, pickBands, showAssignments } = state.settings;
|
|
30
|
+
|
|
31
|
+
const isEmpty = spectra.length === 0;
|
|
32
|
+
const settled = boxZoomOnly(mode);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
// `collapse`, not the default `wrap`: a wrapping vertical toolbar measures
|
|
36
|
+
// itself and writes the result back as an inline width, so in a row short of
|
|
37
|
+
// space it settles at half an icon and stays there.
|
|
38
|
+
<Toolbar vertical overflow="collapse" aria-label="Infrared spectrum tools">
|
|
39
|
+
<Toolbar.Item
|
|
40
|
+
icon="trash"
|
|
41
|
+
intent="danger"
|
|
42
|
+
{...command('clear')}
|
|
43
|
+
disabled={isEmpty}
|
|
44
|
+
/>
|
|
45
|
+
{/* The read tool drags along one axis, so it is drawn as that; the box
|
|
46
|
+
tool sweeps a rectangle, which is what a marquee icon means. */}
|
|
47
|
+
<Toolbar.Item
|
|
48
|
+
icon="arrows-horizontal"
|
|
49
|
+
active={!settled && tool === 'read'}
|
|
50
|
+
{...command('readTool')}
|
|
51
|
+
disabled={isEmpty || settled}
|
|
52
|
+
/>
|
|
53
|
+
<Toolbar.Item
|
|
54
|
+
icon="select"
|
|
55
|
+
active={settled || tool === 'box'}
|
|
56
|
+
{...command('boxTool')}
|
|
57
|
+
disabled={isEmpty || settled}
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
<Toolbar.Item icon="zoom-in" {...command('zoomIn')} disabled={isEmpty} />
|
|
61
|
+
<Toolbar.Item
|
|
62
|
+
icon="zoom-out"
|
|
63
|
+
{...command('zoomOut')}
|
|
64
|
+
disabled={isEmpty}
|
|
65
|
+
/>
|
|
66
|
+
<Toolbar.Item
|
|
67
|
+
icon="zoom-to-fit"
|
|
68
|
+
{...command('resetZoom')}
|
|
69
|
+
disabled={domain === null}
|
|
70
|
+
/>
|
|
71
|
+
|
|
72
|
+
<Toolbar.Item
|
|
73
|
+
icon={mode === 'absorbance' ? 'arrow-up' : 'arrow-down'}
|
|
74
|
+
active={mode === 'absorbance'}
|
|
75
|
+
{...command('toggleMode')}
|
|
76
|
+
disabled={isEmpty}
|
|
77
|
+
/>
|
|
78
|
+
<Toolbar.Item
|
|
79
|
+
icon="locate"
|
|
80
|
+
active={pickBands}
|
|
81
|
+
{...command('togglePicking')}
|
|
82
|
+
disabled={selectedSpectrum === null}
|
|
83
|
+
/>
|
|
84
|
+
<Toolbar.Item
|
|
85
|
+
icon="label"
|
|
86
|
+
active={showAssignments}
|
|
87
|
+
{...command('toggleAssignments')}
|
|
88
|
+
disabled={!pickBands || selectedSpectrum === null}
|
|
89
|
+
/>
|
|
90
|
+
|
|
91
|
+
{/* What the chart looks like right now is what a figure is of — the
|
|
92
|
+
window it was dragged to, the way up it is being read, the
|
|
93
|
+
assignments written under the bands — so the picture is taken here
|
|
94
|
+
rather than rebuilt from the spectra in a panel. */}
|
|
95
|
+
<Toolbar.Item
|
|
96
|
+
icon="media"
|
|
97
|
+
{...command('exportImage')}
|
|
98
|
+
disabled={isEmpty}
|
|
99
|
+
/>
|
|
100
|
+
</Toolbar>
|
|
101
|
+
);
|
|
102
|
+
}
|