react-cheminfo 0.28.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/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/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,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turning what a reader produced into what the viewer holds.
|
|
3
|
+
*
|
|
4
|
+
* A reader answers about a file and knows nothing about the session it is being
|
|
5
|
+
* read into — which spectra are already open, what colours they took, what this
|
|
6
|
+
* one should be called. That is the gap this closes, and it is the only place an
|
|
7
|
+
* identity or a colour is invented.
|
|
8
|
+
*/
|
|
9
|
+
import type { LoadedIrSpectrum } from './analysisSpectra.ts';
|
|
10
|
+
import type { IrSpectrum } from './irSpectrum.ts';
|
|
11
|
+
/** What has to be decided for a loaded spectrum to become a held one. */
|
|
12
|
+
export interface ToIrSpectrumOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Identity, which every later edit and selection is keyed on.
|
|
15
|
+
* @default a fresh UUID
|
|
16
|
+
*/
|
|
17
|
+
id?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The colour to draw it in.
|
|
20
|
+
* @default the lowest hue not in `taken`
|
|
21
|
+
*/
|
|
22
|
+
color?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The colours the spectra already open have taken, so a new one is told apart
|
|
25
|
+
* from them. Ignored when `color` says outright.
|
|
26
|
+
* @default no colours taken
|
|
27
|
+
*/
|
|
28
|
+
taken?: readonly string[];
|
|
29
|
+
/**
|
|
30
|
+
* What to call it, overriding the file's own title.
|
|
31
|
+
* @default the file's title, then its name, then `spectrum`
|
|
32
|
+
*/
|
|
33
|
+
name?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Whether it is drawn as soon as it is added.
|
|
36
|
+
* @default true
|
|
37
|
+
*/
|
|
38
|
+
visible?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Make a held spectrum out of a read one.
|
|
42
|
+
* @param loaded - What the reader produced.
|
|
43
|
+
* @param options - The identity, colour and name to give it.
|
|
44
|
+
* @returns The spectrum as the viewer holds it.
|
|
45
|
+
*/
|
|
46
|
+
export declare function toIrSpectrum(loaded: LoadedIrSpectrum, options?: ToIrSpectrumOptions): IrSpectrum;
|
|
47
|
+
/**
|
|
48
|
+
* Make held spectra out of everything one file held.
|
|
49
|
+
*
|
|
50
|
+
* The colours are handed out one at a time against a growing list, so a file
|
|
51
|
+
* carrying a sample and its background gives two spectra of two colours rather
|
|
52
|
+
* than two of the same — `nextSpectrumColor` can only answer that if it is told
|
|
53
|
+
* what the previous call took.
|
|
54
|
+
* @param loaded - What the reader produced, in file order.
|
|
55
|
+
* @param options - The colours already taken, and whether the spectra are drawn.
|
|
56
|
+
* @returns The spectra, in the same order.
|
|
57
|
+
*/
|
|
58
|
+
export declare function toIrSpectra(loaded: readonly LoadedIrSpectrum[], options?: Pick<ToIrSpectrumOptions, 'taken' | 'visible'>): IrSpectrum[];
|
|
59
|
+
//# sourceMappingURL=toIrSpectrum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toIrSpectrum.d.ts","sourceRoot":"","sources":["../../../src/ir/core/toIrSpectrum.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,yEAAyE;AACzE,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,mBAAwB,GAChC,UAAU,CAmBZ;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,SAAS,gBAAgB,EAAE,EACnC,OAAO,GAAE,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,SAAS,CAAM,GAC3D,UAAU,EAAE,CAad"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turning what a reader produced into what the viewer holds.
|
|
3
|
+
*
|
|
4
|
+
* A reader answers about a file and knows nothing about the session it is being
|
|
5
|
+
* read into — which spectra are already open, what colours they took, what this
|
|
6
|
+
* one should be called. That is the gap this closes, and it is the only place an
|
|
7
|
+
* identity or a colour is invented.
|
|
8
|
+
*/
|
|
9
|
+
import { nextSpectrumColor } from "../../chart/core/spectrumColor.js";
|
|
10
|
+
/**
|
|
11
|
+
* Make a held spectrum out of a read one.
|
|
12
|
+
* @param loaded - What the reader produced.
|
|
13
|
+
* @param options - The identity, colour and name to give it.
|
|
14
|
+
* @returns The spectrum as the viewer holds it.
|
|
15
|
+
*/
|
|
16
|
+
export function toIrSpectrum(loaded, options = {}) {
|
|
17
|
+
const { id = crypto.randomUUID(), taken = [], name, visible = true, } = options;
|
|
18
|
+
const color = options.color ?? nextSpectrumColor(taken);
|
|
19
|
+
return {
|
|
20
|
+
id,
|
|
21
|
+
name: name ?? loaded.name ?? loaded.origin.fileName ?? 'spectrum',
|
|
22
|
+
color,
|
|
23
|
+
wavenumber: loaded.wavenumber,
|
|
24
|
+
absorbance: loaded.absorbance,
|
|
25
|
+
transmittance: loaded.transmittance,
|
|
26
|
+
meta: loaded.meta,
|
|
27
|
+
origin: loaded.origin,
|
|
28
|
+
visible,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Make held spectra out of everything one file held.
|
|
33
|
+
*
|
|
34
|
+
* The colours are handed out one at a time against a growing list, so a file
|
|
35
|
+
* carrying a sample and its background gives two spectra of two colours rather
|
|
36
|
+
* than two of the same — `nextSpectrumColor` can only answer that if it is told
|
|
37
|
+
* what the previous call took.
|
|
38
|
+
* @param loaded - What the reader produced, in file order.
|
|
39
|
+
* @param options - The colours already taken, and whether the spectra are drawn.
|
|
40
|
+
* @returns The spectra, in the same order.
|
|
41
|
+
*/
|
|
42
|
+
export function toIrSpectra(loaded, options = {}) {
|
|
43
|
+
const { taken = [], visible } = options;
|
|
44
|
+
const colors = [...taken];
|
|
45
|
+
const spectra = [];
|
|
46
|
+
for (const entry of loaded) {
|
|
47
|
+
const spectrum = toIrSpectrum(entry, {
|
|
48
|
+
taken: colors,
|
|
49
|
+
...(visible === undefined ? {} : { visible }),
|
|
50
|
+
});
|
|
51
|
+
colors.push(spectrum.color);
|
|
52
|
+
spectra.push(spectrum);
|
|
53
|
+
}
|
|
54
|
+
return spectra;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=toIrSpectrum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toIrSpectrum.js","sourceRoot":"","sources":["../../../src/ir/core/toIrSpectrum.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAmCtE;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAwB,EACxB,UAA+B,EAAE;IAEjC,MAAM,EACJ,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,EACxB,KAAK,GAAG,EAAE,EACV,IAAI,EACJ,OAAO,GAAG,IAAI,GACf,GAAG,OAAO,CAAC;IACZ,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACxD,OAAO;QACL,EAAE;QACF,IAAI,EAAE,IAAI,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,IAAI,UAAU;QACjE,KAAK;QACL,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CACzB,MAAmC,EACnC,UAA0D,EAAE;IAE5D,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IAC1B,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE;YACnC,KAAK,EAAE,MAAM;YACb,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;SAC9C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC5B,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { PlotRect } from '../../chart/core/chartGeometry.ts';
|
|
3
|
+
import type { ChartScale } from '../../chart/core/chartScale.ts';
|
|
4
|
+
import type { AssignedBand } from '../core/assignBands.ts';
|
|
5
|
+
import type { IrBand } from '../core/irBand.ts';
|
|
6
|
+
import type { IrMode } from '../core/irSpectrum.ts';
|
|
7
|
+
export interface BandMarksProps {
|
|
8
|
+
/** The bands to mark, with whatever the table said about them. */
|
|
9
|
+
assigned: readonly AssignedBand[];
|
|
10
|
+
/** Where the plot sits inside the SVG. */
|
|
11
|
+
plot: PlotRect;
|
|
12
|
+
/** The wavenumber axis as it is currently zoomed. */
|
|
13
|
+
xScale: ChartScale;
|
|
14
|
+
/** The value axis as it is currently zoomed. */
|
|
15
|
+
yScale: ChartScale;
|
|
16
|
+
/** Which value axis is being drawn. */
|
|
17
|
+
mode: IrMode;
|
|
18
|
+
/**
|
|
19
|
+
* Whether each label names the assignment as well as the wavenumber.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
showAssignments?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* At most how many bands are named. Marks are drawn on all of them.
|
|
25
|
+
* @default 12
|
|
26
|
+
*/
|
|
27
|
+
limit?: number;
|
|
28
|
+
/**
|
|
29
|
+
* The band the pointer has come to rest on, drawn larger, `null` for none.
|
|
30
|
+
* @default null
|
|
31
|
+
*/
|
|
32
|
+
highlight?: IrBand | null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A mark on every band, and a label on the ones there is room for.
|
|
36
|
+
*
|
|
37
|
+
* The mark reaches *away* from the label, into the band, because the clear space
|
|
38
|
+
* on the label's side is where the numbers are written and the mark is there to
|
|
39
|
+
* say which band they are about. So in transmittance both hang downwards from a
|
|
40
|
+
* dip and in absorbance both rise from a maximum, and the pair reads the same way
|
|
41
|
+
* up in either.
|
|
42
|
+
*
|
|
43
|
+
* A leader line is drawn only when a label had to be slid off its band to clear
|
|
44
|
+
* its neighbours — a leader from a label that is already directly above its band
|
|
45
|
+
* is a line saying what the position already said. A label slid too far is not
|
|
46
|
+
* drawn at all; the mark still says the band is there, which is the honest
|
|
47
|
+
* outcome, where a label hanging over a band it says nothing about is not.
|
|
48
|
+
* @param props - Component props.
|
|
49
|
+
* @returns The marks and labels, as SVG.
|
|
50
|
+
*/
|
|
51
|
+
export declare function BandMarks(props: BandMarksProps): ReactElement;
|
|
52
|
+
//# sourceMappingURL=BandMarks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BandMarks.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/BandMarks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAMjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAC;IACf,qDAAqD;IACrD,MAAM,EAAE,UAAU,CAAC;IACnB,gDAAgD;IAChD,MAAM,EAAE,UAAU,CAAC;IACnB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CAyE7D"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { CHART_COLORS, CHART_FONT, LABEL_HALO, } from "../../chart/core/chartTheme.js";
|
|
4
|
+
import { BAND_MARK, planBandLabels } from "../core/bandLabelPlan.js";
|
|
5
|
+
import { sameIrBand } from "../core/irBand.js";
|
|
6
|
+
import { bandsPointDown } from "../core/irMode.js";
|
|
7
|
+
/**
|
|
8
|
+
* A mark on every band, and a label on the ones there is room for.
|
|
9
|
+
*
|
|
10
|
+
* The mark reaches *away* from the label, into the band, because the clear space
|
|
11
|
+
* on the label's side is where the numbers are written and the mark is there to
|
|
12
|
+
* say which band they are about. So in transmittance both hang downwards from a
|
|
13
|
+
* dip and in absorbance both rise from a maximum, and the pair reads the same way
|
|
14
|
+
* up in either.
|
|
15
|
+
*
|
|
16
|
+
* A leader line is drawn only when a label had to be slid off its band to clear
|
|
17
|
+
* its neighbours — a leader from a label that is already directly above its band
|
|
18
|
+
* is a line saying what the position already said. A label slid too far is not
|
|
19
|
+
* drawn at all; the mark still says the band is there, which is the honest
|
|
20
|
+
* outcome, where a label hanging over a band it says nothing about is not.
|
|
21
|
+
* @param props - Component props.
|
|
22
|
+
* @returns The marks and labels, as SVG.
|
|
23
|
+
*/
|
|
24
|
+
export function BandMarks(props) {
|
|
25
|
+
const { assigned, plot, xScale, yScale, mode, showAssignments = false, limit = 12, highlight = null, } = props;
|
|
26
|
+
const plans = useMemo(() => planBandLabels({
|
|
27
|
+
assigned,
|
|
28
|
+
plot,
|
|
29
|
+
xScale,
|
|
30
|
+
yScale,
|
|
31
|
+
mode,
|
|
32
|
+
showAssignments,
|
|
33
|
+
limit,
|
|
34
|
+
}), [assigned, plot, xScale, yScale, mode, showAssignments, limit]);
|
|
35
|
+
const down = bandsPointDown(mode);
|
|
36
|
+
const reach = down ? BAND_MARK : -BAND_MARK;
|
|
37
|
+
return (_jsx("g", { pointerEvents: "none", children: plans.map((plan) => {
|
|
38
|
+
const highlighted = sameIrBand(plan.band, highlight);
|
|
39
|
+
const dropped = !Number.isFinite(plan.labelX);
|
|
40
|
+
const firstBaseline = plan.baselines[0];
|
|
41
|
+
const slid = !dropped && Math.abs(plan.labelX - plan.tipX) > LEADER_AT;
|
|
42
|
+
return (_jsxs("g", { children: [_jsx("line", { x1: plan.tipX, y1: plan.tipY, x2: plan.tipX, y2: plan.tipY + reach, style: highlighted ? highlightMarkStyle : markStyle, strokeWidth: highlighted ? 2 : 1 }), slid && firstBaseline !== undefined ? (_jsx("line", { x1: plan.tipX, y1: plan.tipY + reach, x2: plan.labelX, y2: firstBaseline, style: leaderStyle })) : null, dropped
|
|
43
|
+
? null
|
|
44
|
+
: plan.lines.map((line, index) => (_jsx("text", { x: plan.labelX, y: plan.baselines[index], textAnchor: "middle", style: highlighted ? highlightTextStyle : textStyle, children: line }, line)))] }, `${plan.band.spectrumId} ${plan.band.wavenumber}`));
|
|
45
|
+
}) }));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* How far a label may sit from its band before a leader is drawn to it.
|
|
49
|
+
*
|
|
50
|
+
* Two pixels: below that the label is over its band and a leader would be a
|
|
51
|
+
* line nobody needs, and the declutter sweep leaves most labels within a pixel
|
|
52
|
+
* of where they wanted to be.
|
|
53
|
+
*/
|
|
54
|
+
const LEADER_AT = 2;
|
|
55
|
+
const markStyle = { stroke: CHART_COLORS.annotation };
|
|
56
|
+
const highlightMarkStyle = { stroke: CHART_COLORS.highlight };
|
|
57
|
+
const leaderStyle = { stroke: CHART_COLORS.leader };
|
|
58
|
+
// Haloed: an infrared label is written over the trace as often as beside it,
|
|
59
|
+
// since a band is named where it dips and the neighbouring bands dip too.
|
|
60
|
+
const textStyle = {
|
|
61
|
+
fill: CHART_COLORS.labelText,
|
|
62
|
+
fontSize: CHART_FONT.label,
|
|
63
|
+
...LABEL_HALO,
|
|
64
|
+
};
|
|
65
|
+
const highlightTextStyle = {
|
|
66
|
+
fill: CHART_COLORS.highlight,
|
|
67
|
+
fontSize: CHART_FONT.label,
|
|
68
|
+
fontWeight: 600,
|
|
69
|
+
...LABEL_HALO,
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=BandMarks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BandMarks.js","sourceRoot":"","sources":["../../../src/ir/ui/BandMarks.tsx"],"names":[],"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C,CAAC,GACA,CACL,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB,MAAM,SAAS,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,UAAU,EAAW,CAAC;AAE/D,MAAM,kBAAkB,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,SAAS,EAAW,CAAC;AAEvE,MAAM,WAAW,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,EAAW,CAAC;AAE7D,6EAA6E;AAC7E,0EAA0E;AAC1E,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,YAAY,CAAC,SAAS;IAC5B,QAAQ,EAAE,UAAU,CAAC,KAAK;IAC1B,GAAG,UAAU;CACL,CAAC;AAEX,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,YAAY,CAAC,SAAS;IAC5B,QAAQ,EAAE,UAAU,CAAC,KAAK;IAC1B,UAAU,EAAE,GAAG;IACf,GAAG,UAAU;CACL,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IrBand } from '../core/irBand.ts';
|
|
2
|
+
export interface BandsPanelProps {
|
|
3
|
+
/**
|
|
4
|
+
* The band the pointer is resting on, wherever it was hovered.
|
|
5
|
+
* @default null
|
|
6
|
+
*/
|
|
7
|
+
highlight?: IrBand | null;
|
|
8
|
+
/**
|
|
9
|
+
* Told which band a row is hovered, so the chart can mark it.
|
|
10
|
+
* @default undefined
|
|
11
|
+
*/
|
|
12
|
+
onHighlight?: (band: IrBand | null) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Every band of the selected spectrum, and everything each one might be.
|
|
16
|
+
*
|
|
17
|
+
* This is the panel the viewer exists for. A trace can be looked at on its own;
|
|
18
|
+
* it is the table beside it that lets it be *read*, and the column that matters
|
|
19
|
+
* is the last one — **every** vibration whose range contains the band, not the
|
|
20
|
+
* best-fitting one. A band at 1715 cm⁻¹ genuinely is a ketone, an aldehyde and a
|
|
21
|
+
* carboxylic acid until something else decides, and a panel that named one would
|
|
22
|
+
* be asserting a structure the spectrum does not determine.
|
|
23
|
+
*
|
|
24
|
+
* Hovering a row marks the band on the chart and hovering the chart lights the
|
|
25
|
+
* row, which is the whole reason the highlight is threaded through the shell
|
|
26
|
+
* rather than held here: the two views are of one thing.
|
|
27
|
+
* @param props - Component props.
|
|
28
|
+
* @returns The panel.
|
|
29
|
+
*/
|
|
30
|
+
export declare function BandsPanel(props: BandsPanelProps): import("react").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=BandsPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BandsPanel.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/BandsPanel.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMhD,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BA2GhD"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from '@blueprintjs/core';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { Button, Toolbar } from 'react-science/ui';
|
|
5
|
+
import { panelBodyStyle, panelCellStyle, panelEmptyStyle, panelHeaderCellStyle, panelNumberCellStyle, panelStyle, panelTableStyle, panelToolbarStyle, } from "../../panel/core/panelStyles.js";
|
|
6
|
+
import { sameIrBand } from "../core/irBand.js";
|
|
7
|
+
import { formatIrValue, formatWavenumber } from "../core/irFormat.js";
|
|
8
|
+
import { useIrActions, useIrEditorState } from "./irStateContext.js";
|
|
9
|
+
/**
|
|
10
|
+
* Every band of the selected spectrum, and everything each one might be.
|
|
11
|
+
*
|
|
12
|
+
* This is the panel the viewer exists for. A trace can be looked at on its own;
|
|
13
|
+
* it is the table beside it that lets it be *read*, and the column that matters
|
|
14
|
+
* is the last one — **every** vibration whose range contains the band, not the
|
|
15
|
+
* best-fitting one. A band at 1715 cm⁻¹ genuinely is a ketone, an aldehyde and a
|
|
16
|
+
* carboxylic acid until something else decides, and a panel that named one would
|
|
17
|
+
* be asserting a structure the spectrum does not determine.
|
|
18
|
+
*
|
|
19
|
+
* Hovering a row marks the band on the chart and hovering the chart lights the
|
|
20
|
+
* row, which is the whole reason the highlight is threaded through the shell
|
|
21
|
+
* rather than held here: the two views are of one thing.
|
|
22
|
+
* @param props - Component props.
|
|
23
|
+
* @returns The panel.
|
|
24
|
+
*/
|
|
25
|
+
export function BandsPanel(props) {
|
|
26
|
+
const { highlight = null, onHighlight } = props;
|
|
27
|
+
const { state, selectedSpectrum, assigned } = useIrEditorState();
|
|
28
|
+
const actions = useIrActions();
|
|
29
|
+
const { mode, pickBands, showAssignments, picking } = state.settings;
|
|
30
|
+
const rows = useMemo(() => assigned, [assigned]);
|
|
31
|
+
const tsv = useMemo(() => bandsToTsv(rows, mode), [rows, mode]);
|
|
32
|
+
return (_jsxs("div", { style: panelStyle, children: [_jsxs("div", { style: panelToolbarStyle, children: [_jsxs(Toolbar, { "aria-label": "Band actions", children: [_jsx(Toolbar.Item, { icon: "locate", active: pickBands, tooltip: pickBands ? 'Stop picking bands' : 'Pick the bands', "aria-label": "Pick the bands", onClick: () => actions.setSettings({ pickBands: !pickBands }) }), _jsx(Toolbar.Item, { icon: "label", active: showAssignments, tooltip: "Name the assignments on the chart", "aria-label": "Name the assignments on the chart", disabled: !pickBands, onClick: () => actions.setSettings({ showAssignments: !showAssignments }) })] }), _jsxs("label", { style: thresholdStyle, children: [_jsx("span", { style: { opacity: 0.7 }, children: "threshold" }), _jsx("input", { type: "range", min: 0.005, max: 0.3, step: 0.005, value: picking.minRelativeHeight ?? 0.02, disabled: !pickBands, "aria-label": "How tall a band must be to be picked", onChange: (event) => actions.setSettings({
|
|
33
|
+
picking: { minRelativeHeight: event.target.valueAsNumber },
|
|
34
|
+
}) })] }), _jsx("span", { style: { flex: 1 } }), _jsx(Button, { variant: "minimal", icon: "clipboard", disabled: rows.length === 0, tooltipProps: { content: 'Copy the table' }, "aria-label": "Copy the table", onClick: () => void navigator.clipboard?.writeText(tsv) })] }), _jsx("div", { style: panelBodyStyle, children: selectedSpectrum === null ? (_jsx("p", { style: panelEmptyStyle, children: "No spectrum is selected." })) : !pickBands ? (_jsx("p", { style: panelEmptyStyle, children: "The bands are not being picked. Press the locate button above to find them." })) : rows.length === 0 ? (_jsx("p", { style: panelEmptyStyle, children: "No band was found above the threshold. Lower it to pick the weaker ones." })) : (_jsxs("table", { style: panelTableStyle, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { style: panelHeaderCellStyle, children: "cm\u207B\u00B9" }), _jsx("th", { style: panelHeaderCellStyle }), _jsx("th", { style: { ...panelHeaderCellStyle, textAlign: 'right' }, children: mode === 'absorbance' ? 'A' : '%T' }), _jsx("th", { style: panelHeaderCellStyle, children: "could be" })] }) }), _jsx("tbody", { children: rows.map((entry) => (_jsx(BandRow, { entry: entry, mode: mode, lit: sameIrBand(entry.band, highlight), onHighlight: onHighlight }, `${entry.band.spectrumId} ${entry.band.wavenumber}`))) })] })) })] }));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* One band: where it is, how strong, and every vibration it could be.
|
|
38
|
+
*
|
|
39
|
+
* The candidates are written as one line rather than a list, so a strong band
|
|
40
|
+
* with four of them stays one row of the table and the wavenumbers keep reading
|
|
41
|
+
* down the column. The `title` carries them again with each one's note, which is
|
|
42
|
+
* where the reason to prefer one lives.
|
|
43
|
+
* @param props - Component props.
|
|
44
|
+
* @returns The row.
|
|
45
|
+
*/
|
|
46
|
+
function BandRow(props) {
|
|
47
|
+
const { entry, mode, lit, onHighlight } = props;
|
|
48
|
+
const { band, candidates } = entry;
|
|
49
|
+
const value = mode === 'absorbance' ? band.absorbance : band.transmittance;
|
|
50
|
+
const detail = candidates
|
|
51
|
+
.map((candidate) => candidate.note === undefined
|
|
52
|
+
? `${candidate.group} ${candidate.vibration}`
|
|
53
|
+
: `${candidate.group} ${candidate.vibration} — ${candidate.note}`)
|
|
54
|
+
.join('\n');
|
|
55
|
+
return (_jsxs("tr", { style: lit ? litRowStyle : undefined, onPointerEnter: () => onHighlight?.(band), onPointerLeave: () => onHighlight?.(null), children: [_jsx("td", { style: panelNumberCellStyle, children: formatWavenumber(band.wavenumber) }), _jsx("td", { style: panelCellStyle, title: STRENGTH_TITLES[band.strength], children: band.strength }), _jsx("td", { style: panelNumberCellStyle, children: formatIrValue(value, mode) }), _jsx("td", { style: panelCellStyle, title: detail, children: candidates.length === 0 ? (_jsx("span", { style: { opacity: 0.5 }, children: "\u2014" })) : (_jsxs("span", { style: { whiteSpace: 'normal' }, children: [candidates[0]?.group, " ", candidates[0]?.vibration, candidates.length > 1 ? (_jsxs("span", { style: { opacity: 0.6 }, children: [' ', _jsx(Icon, { icon: "more", size: 10 }), " ", candidates.length - 1, " more"] })) : null] })) })] }));
|
|
56
|
+
}
|
|
57
|
+
/** What each strength letter means, for the column that shows only the letter. */
|
|
58
|
+
const STRENGTH_TITLES = {
|
|
59
|
+
w: 'weak, relative to this spectrum',
|
|
60
|
+
m: 'medium, relative to this spectrum',
|
|
61
|
+
S: 'strong, relative to this spectrum',
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* The table as text, for pasting into a notebook.
|
|
65
|
+
*
|
|
66
|
+
* Tab separated with every candidate on the row, because the reason to copy a
|
|
67
|
+
* band table is to put it beside a structure and argue about it — and the
|
|
68
|
+
* argument is over the candidates rather than over the wavenumbers.
|
|
69
|
+
* @param rows - The bands, as they are shown.
|
|
70
|
+
* @param mode - Which value axis is being read.
|
|
71
|
+
* @returns The table, one line per band, with a heading.
|
|
72
|
+
*/
|
|
73
|
+
function bandsToTsv(rows, mode) {
|
|
74
|
+
const heading = ['wavenumber', 'strength', mode, 'could be'].join('\t');
|
|
75
|
+
const lines = rows.map((entry) => [
|
|
76
|
+
formatWavenumber(entry.band.wavenumber),
|
|
77
|
+
entry.band.strength,
|
|
78
|
+
formatIrValue(mode === 'absorbance'
|
|
79
|
+
? entry.band.absorbance
|
|
80
|
+
: entry.band.transmittance, mode),
|
|
81
|
+
entry.candidates
|
|
82
|
+
.map((candidate) => `${candidate.group} ${candidate.vibration}`)
|
|
83
|
+
.join('; '),
|
|
84
|
+
].join('\t'));
|
|
85
|
+
return [heading, ...lines].join('\n');
|
|
86
|
+
}
|
|
87
|
+
const litRowStyle = { background: '#fff3e0' };
|
|
88
|
+
const thresholdStyle = {
|
|
89
|
+
display: 'inline-flex',
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
gap: 4,
|
|
92
|
+
fontSize: 11,
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=BandsPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BandsPanel.js","sourceRoot":"","sources":["../../../src/ir/ui/BandsPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EACL,cAAc,EACd,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,iBAAiB,GAClB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,YAAY,E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
|
4
|
+
/** Close it. */
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* What the viewer is, what it stands on, and who is owed for it.
|
|
9
|
+
*
|
|
10
|
+
* The credits are not decoration. Every band this viewer names is named out of a
|
|
11
|
+
* correlation table that generations of chemists compiled, every file it opens is
|
|
12
|
+
* read by somebody else's parser, and the examples it opens on are somebody
|
|
13
|
+
* else's measurements — so each is named here, with its licence where it has one.
|
|
14
|
+
* @param props - Component props.
|
|
15
|
+
* @returns The dialog.
|
|
16
|
+
*/
|
|
17
|
+
export declare function IrAboutDialog(props: IrAboutDialogProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=IrAboutDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IrAboutDialog.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrAboutDialog.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BA+EtD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog, DialogBody } from '@blueprintjs/core';
|
|
3
|
+
import { IrLogo } from "./IrLogo.js";
|
|
4
|
+
/**
|
|
5
|
+
* What the viewer is, what it stands on, and who is owed for it.
|
|
6
|
+
*
|
|
7
|
+
* The credits are not decoration. Every band this viewer names is named out of a
|
|
8
|
+
* correlation table that generations of chemists compiled, every file it opens is
|
|
9
|
+
* read by somebody else's parser, and the examples it opens on are somebody
|
|
10
|
+
* else's measurements — so each is named here, with its licence where it has one.
|
|
11
|
+
* @param props - Component props.
|
|
12
|
+
* @returns The dialog.
|
|
13
|
+
*/
|
|
14
|
+
export function IrAboutDialog(props) {
|
|
15
|
+
const { isOpen, onClose } = props;
|
|
16
|
+
return (_jsx(Dialog, { isOpen: isOpen, onClose: onClose, title: "About the infrared viewer", icon: _jsx(IrLogo, { size: 20 }), style: dialogStyle, children: _jsxs(DialogBody, { children: [_jsxs("div", { style: brandStyle, children: [_jsx(IrLogo, { size: 64 }), _jsxs("div", { children: [_jsx("p", { style: leadStyle, children: "react-cheminfo/ir" }), _jsx("p", { style: paragraphStyle, children: "Draws an infrared spectrum the way infrared is printed, reads it as absorbance or as percent transmittance, picks its bands and offers every functional group each band could be." })] })] }), _jsx("h4", { style: headingStyle, children: "Credits" }), _jsxs("ul", { style: listStyle, children: [_jsxs("li", { children: [_jsx("strong", { children: "ir-spectrum" }), " (cheminfo, MIT) reads the JCAMP-DX and SPC files, derives the absorbance/transmittance pair, and picks the bands. This package deliberately does none of that arithmetic itself."] }), _jsxs("li", { children: [_jsx("strong", { children: "common-spectrum" }), ", ", _jsx("strong", { children: "jcampconverter" }), ' ', "and ", _jsx("strong", { children: "spc-parser" }), " (cheminfo, MIT) are what it reads through."] }), _jsxs("li", { children: [_jsx("strong", { children: "ml-spectra-processing" }), " (mljs, MIT) for the array work."] }), _jsxs("li", { children: ["The ", _jsx("strong", { children: "shared chart" }), " of this package for the drawing \u2014 the same arithmetic every other spectrum viewer of the family is drawn with."] }), _jsxs("li", { children: [_jsx("strong", { children: "react-science" }), " and ", _jsx("strong", { children: "BlueprintJS" }), "(zakodium, Palantir) for the shell this viewer is shaped like."] }), _jsxs("li", { children: ["The ", _jsx("strong", { children: "correlation table" }), " is the conventional teaching set of group frequencies, as any introductory spectroscopy text tabulates them. The ranges are deliberately the rounded, generous ones: narrowing them to look precise would rule out assignments that are genuinely possible."] }), _jsxs("li", { children: ["The ", _jsx("strong", { children: "colours" }), " are Okabe and Ito's colour-universal palette, so two traces stay distinguishable for a reader with a colour vision deficiency."] })] }), _jsx("h4", { style: headingStyle, children: "Licence" }), _jsxs("p", { style: paragraphStyle, children: ["MIT, in the", ' ', _jsx("a", { href: "https://github.com/cheminfo/glycans", target: "_blank", rel: "noopener noreferrer", children: "cheminfo/glycans" }), ' ', "monorepo."] })] }) }));
|
|
17
|
+
}
|
|
18
|
+
const dialogStyle = { width: 'min(680px, 92vw)' };
|
|
19
|
+
const brandStyle = {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'flex-start',
|
|
22
|
+
gap: 16,
|
|
23
|
+
};
|
|
24
|
+
const leadStyle = {
|
|
25
|
+
margin: '0 0 4px',
|
|
26
|
+
fontWeight: 600,
|
|
27
|
+
fontSize: 16,
|
|
28
|
+
};
|
|
29
|
+
const paragraphStyle = { margin: '0 0 6px' };
|
|
30
|
+
const headingStyle = { margin: '14px 0 4px' };
|
|
31
|
+
const listStyle = { margin: 0, paddingLeft: 20 };
|
|
32
|
+
//# sourceMappingURL=IrAboutDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IrAboutDialog.js","sourceRoot":"","sources":["../../../src/ir/ui/IrAboutDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAc,CAAC;AAStC;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAElC,OAAO,CACL,KAAC,MAAM,IACL,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,KAAK,EAAC,2BAA2B,EACjC,IAAI,EAAE,KAAC,MAAM,IAAC,IAAI,EAAE,EAAE,GAAI,EAC1B,KAAK,EAAE,WAAW,YAElB,MAAC,UAAU,eACT,eAAK,KAAK,EAAE,UAAU,aACpB,KAAC,MAAM,IAAC,IAAI,EAAE,EAAE,GAAI,EACpB,0BACE,YAAG,KAAK,EAAE,SAAS,kCAAuB,EAC1C,YAAG,KAAK,EAAE,cAAc,kMAIpB,IACA,IACF,EAEN,aAAI,KAAK,EAAE,YAAY,wBAAc,EACrC,cAAI,KAAK,EAAE,SAAS,aAClB,yBACE,2CAA4B,yLAIzB,EACL,yBACE,+CAAgC,QAAE,8CAA+B,EAAC,GAAG,UACjE,0CAA2B,mDAE5B,EACL,yBACE,qDAAsC,wCAEnC,EACL,iCACM,4CAA6B,4HAG9B,EACL,yBACE,6CAA8B,WAAK,2CAA4B,sEAE5D,EACL,iCACM,iDAAkC,oQAKnC,EACL,iCACM,uCAAwB,uIAGzB,IACF,EAEL,aAAI,KAAK,EAAE,YAAY,wBAAc,EACrC,aAAG,KAAK,EAAE,cAAc,4BACV,GAAG,EACf,YACE,IAAI,EAAC,qCAAqC,EAC1C,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,iCAGvB,EAAC,GAAG,iBAEN,IACO,GACN,CACV,CAAC;AACJ,CAAC;AAED,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAW,CAAC;AAE3D,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,YAAY;IACxB,GAAG,EAAE,EAAE;CACC,CAAC;AAEX,MAAM,SAAS,GAAG;IAChB,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,GAAG;IACf,QAAQ,EAAE,EAAE;CACJ,CAAC;AAEX,MAAM,cAAc,GAAG,EAAE,MAAM,EAAE,SAAS,EAAW,CAAC;AAEtD,MAAM,YAAY,GAAG,EAAE,MAAM,EAAE,YAAY,EAAW,CAAC;AAEvD,MAAM,SAAS,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAW,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { IrBand } from '../core/irBand.ts';
|
|
2
|
+
export interface IrCanvasProps {
|
|
3
|
+
/**
|
|
4
|
+
* The band the pointer is resting on, wherever it was hovered — the chart or
|
|
5
|
+
* the band table.
|
|
6
|
+
* @default null
|
|
7
|
+
*/
|
|
8
|
+
highlight?: IrBand | null;
|
|
9
|
+
/**
|
|
10
|
+
* Told which band the pointer has come to rest on.
|
|
11
|
+
* @default undefined
|
|
12
|
+
*/
|
|
13
|
+
onHighlight?: (band: IrBand | null) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Put on the box the chart is drawn in, so a picture can be taken of it. The
|
|
16
|
+
* box rather than the chart itself, because the chart is laid out again on
|
|
17
|
+
* every resize.
|
|
18
|
+
* @default undefined
|
|
19
|
+
*/
|
|
20
|
+
attachChart?: (element: HTMLDivElement | null) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The chart, and the status bar under it.
|
|
24
|
+
*
|
|
25
|
+
* This is where the state meets the drawing: the chart holds nothing, so
|
|
26
|
+
* everything it draws is read out of the state here and every gesture it reports
|
|
27
|
+
* is written back. The window in particular goes **both** ways — the chart is
|
|
28
|
+
* told what to show and reports what it arrives at — which is what lets a toolbar
|
|
29
|
+
* button and a drag both move it.
|
|
30
|
+
*
|
|
31
|
+
* The status bar is inside the canvas rather than under the whole shell, so it
|
|
32
|
+
* stops at the splitter: what is open on the right belongs to the chart, and a
|
|
33
|
+
* bar running under the panels as well would read as belonging to the page.
|
|
34
|
+
* @param props - Component props.
|
|
35
|
+
* @returns The canvas.
|
|
36
|
+
*/
|
|
37
|
+
export declare function IrCanvas(props: IrCanvasProps): import("react").JSX.Element;
|
|
38
|
+
//# sourceMappingURL=IrCanvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IrCanvas.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrCanvas.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAOhD,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;CACxD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAkC5C"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { IrChart } from "./IrChart.js";
|
|
4
|
+
import { IrStatusBar } from "./IrStatusBar.js";
|
|
5
|
+
import { useIrActions, useIrEditorState } from "./irStateContext.js";
|
|
6
|
+
/**
|
|
7
|
+
* The chart, and the status bar under it.
|
|
8
|
+
*
|
|
9
|
+
* This is where the state meets the drawing: the chart holds nothing, so
|
|
10
|
+
* everything it draws is read out of the state here and every gesture it reports
|
|
11
|
+
* is written back. The window in particular goes **both** ways — the chart is
|
|
12
|
+
* told what to show and reports what it arrives at — which is what lets a toolbar
|
|
13
|
+
* button and a drag both move it.
|
|
14
|
+
*
|
|
15
|
+
* The status bar is inside the canvas rather than under the whole shell, so it
|
|
16
|
+
* stops at the splitter: what is open on the right belongs to the chart, and a
|
|
17
|
+
* bar running under the panels as well would read as belonging to the page.
|
|
18
|
+
* @param props - Component props.
|
|
19
|
+
* @returns The canvas.
|
|
20
|
+
*/
|
|
21
|
+
export function IrCanvas(props) {
|
|
22
|
+
const { highlight = null, onHighlight, attachChart } = props;
|
|
23
|
+
const { state, visibleSpectra, assigned } = useIrEditorState();
|
|
24
|
+
const actions = useIrActions();
|
|
25
|
+
const { domain, tool, selectedId } = state.view;
|
|
26
|
+
const { mode, showAssignments, labelLimit } = state.settings;
|
|
27
|
+
const onDomainChange = useCallback((next) => {
|
|
28
|
+
actions.setDomain(next);
|
|
29
|
+
}, [actions]);
|
|
30
|
+
return (_jsxs("div", { style: rootStyle, children: [_jsx("div", { ref: attachChart, style: chartStyle, children: _jsx(IrChart, { spectra: visibleSpectra, mode: mode, assigned: assigned, showAssignments: showAssignments, labelLimit: labelLimit, highlight: highlight, onHighlight: onHighlight, domain: domain, onDomainChange: onDomainChange, drag: tool === 'box' ? 'box' : 'xAxis', emphasisedId: selectedId }) }), _jsx(IrStatusBar, {})] }));
|
|
31
|
+
}
|
|
32
|
+
const rootStyle = {
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
flex: '1 1 1px',
|
|
36
|
+
minWidth: 0,
|
|
37
|
+
minHeight: 0,
|
|
38
|
+
};
|
|
39
|
+
/** The chart takes what the status bar does not. */
|
|
40
|
+
const chartStyle = { flex: '1 1 1px', minHeight: 0 };
|
|
41
|
+
//# sourceMappingURL=IrCanvas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IrCanvas.js","sourceRoot":"","sources":["../../../src/ir/ui/IrCanvas.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAKpC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAuBrE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC7D,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAC/D,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IAChD,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC;IAE7D,MAAM,cAAc,GAAG,WAAW,CAChC,CAAC,IAAc,EAAE,EAAE;QACjB,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,CACL,eAAK,KAAK,EAAE,SAAS,aACnB,cAAK,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,YACtC,KAAC,OAAO,IACN,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EACtC,YAAY,EAAE,UAAU,GACxB,GACE,EACN,KAAC,WAAW,KAAG,IACX,CACP,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;CACJ,CAAC;AAEX,oDAAoD;AACpD,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAAW,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { IrChartProps } from './irChartProps.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The chart: every layer of an infrared spectrum, in one SVG.
|
|
5
|
+
*
|
|
6
|
+
* **The wavenumber axis runs right to left**, 4000 at the left edge down to 400
|
|
7
|
+
* at the right, which is how every infrared spectrum has been printed since the
|
|
8
|
+
* technique was dispersive and the instrument scanned that way. It is done by
|
|
9
|
+
* building the scale onto a reversed pixel range and nothing else: the data stays
|
|
10
|
+
* in ascending wavenumbers, every window stays low end first, and no other piece
|
|
11
|
+
* of arithmetic in either package has to know. That is the whole reason
|
|
12
|
+
* `createScale` takes its range rather than deriving it.
|
|
13
|
+
*
|
|
14
|
+
* The axes go under the data, so a grid line is never read as a band. Only the
|
|
15
|
+
* data band is clipped, so a zoomed trace stops at the plot edge while the
|
|
16
|
+
* wavenumbers pinned to the bands are allowed out over the margin — clip those
|
|
17
|
+
* and the strongest band in the window loses its label. The drag rectangle and
|
|
18
|
+
* the crosshair go over everything, because each answers a question being asked
|
|
19
|
+
* right now.
|
|
20
|
+
*
|
|
21
|
+
* Nothing is held here. The spectra, the bands, what is being looked at and the
|
|
22
|
+
* window are all props, and every gesture comes back out as a callback — so one
|
|
23
|
+
* component draws an editor's chart, a report page's single spectrum and a test.
|
|
24
|
+
* @param props - Component props.
|
|
25
|
+
* @returns The chart.
|
|
26
|
+
*/
|
|
27
|
+
export declare function IrChart(props: IrChartProps): ReactElement;
|
|
28
|
+
//# sourceMappingURL=IrChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IrChart.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAiB1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAmJzD"}
|