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,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which reader a dropped infrared file belongs to, decided from the file itself.
|
|
3
|
+
*
|
|
4
|
+
* The extension is the least reliable thing about a spectrum file: instruments
|
|
5
|
+
* export JCAMP as `.txt`, LIMS systems rename everything to `.dat`, and a user
|
|
6
|
+
* pasting into a text box has no extension at all. So the content decides and
|
|
7
|
+
* the name is consulted only when the content stayed silent.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* How much of the file the decision is taken on.
|
|
11
|
+
*
|
|
12
|
+
* Every marker looked for here sits in the header — the SPC flag pair in the
|
|
13
|
+
* first two bytes, `##TITLE=` at the very top of a JCAMP. Reading further would
|
|
14
|
+
* only cost a decode of the whole file.
|
|
15
|
+
*/
|
|
16
|
+
const HEADER_BYTES = 4096;
|
|
17
|
+
/**
|
|
18
|
+
* Extensions that name a format outright, once the content has said nothing.
|
|
19
|
+
*
|
|
20
|
+
* A `Map` rather than an object, because the key comes off a file name the user
|
|
21
|
+
* chose: `spectrum.constructor` read out of an object literal answers with a
|
|
22
|
+
* function inherited from `Object.prototype`, which is neither a format nor
|
|
23
|
+
* `undefined` and so passes every check made of it.
|
|
24
|
+
*/
|
|
25
|
+
const EXTENSIONS = new Map([
|
|
26
|
+
['jdx', 'jcamp'],
|
|
27
|
+
['dx', 'jcamp'],
|
|
28
|
+
['jcamp', 'jcamp'],
|
|
29
|
+
['spc', 'spc'],
|
|
30
|
+
['txt', 'text'],
|
|
31
|
+
['csv', 'text'],
|
|
32
|
+
['tsv', 'text'],
|
|
33
|
+
['xy', 'text'],
|
|
34
|
+
['dpt', 'text'],
|
|
35
|
+
]);
|
|
36
|
+
/**
|
|
37
|
+
* The one decoder the header is read through, kept because a drop of fifty
|
|
38
|
+
* files would otherwise build a hundred of them for four kilobytes each.
|
|
39
|
+
*/
|
|
40
|
+
const DECODER = new TextDecoder();
|
|
41
|
+
/**
|
|
42
|
+
* Decide what a dropped file is, from its first bytes and only then its name.
|
|
43
|
+
*
|
|
44
|
+
* Returns `'unknown'` rather than guessing `'text'` for the two cases the
|
|
45
|
+
* readers cannot survive: nothing at all, and bytes that are plainly not text.
|
|
46
|
+
* Handing either to the text reader produces an empty spectrum and a message
|
|
47
|
+
* about missing columns, which sends whoever dropped the file looking in the
|
|
48
|
+
* wrong place.
|
|
49
|
+
* @param data - The file, or the pasted text.
|
|
50
|
+
* @param fileName - Its name, when it has one.
|
|
51
|
+
* @returns The format, or `'unknown'` when nothing in the file names one.
|
|
52
|
+
*/
|
|
53
|
+
export function detectIrFormat(data, fileName) {
|
|
54
|
+
if (isSpc(data))
|
|
55
|
+
return 'spc';
|
|
56
|
+
const header = stripByteOrderMark(readHeader(data)).trimStart();
|
|
57
|
+
if (header.startsWith('##'))
|
|
58
|
+
return 'jcamp';
|
|
59
|
+
const named = formatFromExtension(fileName);
|
|
60
|
+
if (named !== undefined)
|
|
61
|
+
return named;
|
|
62
|
+
if (header.length === 0)
|
|
63
|
+
return 'unknown';
|
|
64
|
+
// A binary file the SPC check did not claim decodes to replacement characters;
|
|
65
|
+
// a `.dpt` export of two columns decodes to digits. Telling them apart on the
|
|
66
|
+
// decode is what stops a stray binary from reaching the text reader.
|
|
67
|
+
if (header.includes('\uFFFD') || header.includes('\0'))
|
|
68
|
+
return 'unknown';
|
|
69
|
+
return 'text';
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Whether the first bytes are an SPC file header.
|
|
73
|
+
*
|
|
74
|
+
* The second byte is the format version, and Thermo Galactic only ever wrote
|
|
75
|
+
* three: `0x4B` for the new LSB-first format, `0x4C` for MSB-first, and `0x4D`
|
|
76
|
+
* for the old format. Checked before anything is decoded, because putting a
|
|
77
|
+
* binary file through a UTF-8 decode turns its header into replacement
|
|
78
|
+
* characters that happen to match nothing — a right answer reached by luck.
|
|
79
|
+
* @param data - The file, or the pasted text.
|
|
80
|
+
* @returns Whether it looks like SPC.
|
|
81
|
+
*/
|
|
82
|
+
function isSpc(data) {
|
|
83
|
+
// A pasted string is never SPC: the bytes would not have survived the decode.
|
|
84
|
+
if (typeof data === 'string' || data.length < 2)
|
|
85
|
+
return false;
|
|
86
|
+
return SPC_VERSIONS.has(data[1]);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The format versions Thermo Galactic ever wrote, as the second byte states it.
|
|
90
|
+
*
|
|
91
|
+
* `0x4B` is the current LSB-first format, `0x4C` the MSB-first one, and `0x4D`
|
|
92
|
+
* the old format still exported by instruments of a certain age.
|
|
93
|
+
*/
|
|
94
|
+
const SPC_VERSIONS = new Set([0x4b, 0x4c, 0x4d]);
|
|
95
|
+
/**
|
|
96
|
+
* The first bytes of the file, as text.
|
|
97
|
+
* @param data - The file, or the pasted text.
|
|
98
|
+
* @param length - How many bytes to read, defaulting to the whole header.
|
|
99
|
+
* @returns The decoded prefix; a byte sequence cut in half at the end decodes
|
|
100
|
+
* to a replacement character, which no marker looked for here contains.
|
|
101
|
+
*/
|
|
102
|
+
function readHeader(data, length = HEADER_BYTES) {
|
|
103
|
+
if (typeof data === 'string')
|
|
104
|
+
return data.slice(0, length);
|
|
105
|
+
return DECODER.decode(data.subarray(0, length));
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Drop a leading UTF-8 byte order mark.
|
|
109
|
+
*
|
|
110
|
+
* This is the whole reason the header is normalised before it is tested: a
|
|
111
|
+
* `U+FEFF` in front of `##TITLE=` makes a plain `startsWith('##')` fail, and a
|
|
112
|
+
* BOM-prefixed JCAMP then goes silently to the text reader, which reads its
|
|
113
|
+
* records as unparsable lines and reports two columns of nothing.
|
|
114
|
+
* @param header - The decoded prefix.
|
|
115
|
+
* @returns The prefix without its mark.
|
|
116
|
+
*/
|
|
117
|
+
function stripByteOrderMark(header) {
|
|
118
|
+
return header.startsWith('\uFEFF') ? header.slice(1) : header;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The format a file name claims, used only once the content has said nothing.
|
|
122
|
+
* @param fileName - The name, when the file has one.
|
|
123
|
+
* @returns The format, or `undefined` when the extension names none.
|
|
124
|
+
*/
|
|
125
|
+
function formatFromExtension(fileName) {
|
|
126
|
+
if (fileName === undefined)
|
|
127
|
+
return undefined;
|
|
128
|
+
const extension = fileName.split('.').pop();
|
|
129
|
+
if (extension === undefined || extension === fileName)
|
|
130
|
+
return undefined;
|
|
131
|
+
return EXTENSIONS.get(extension.toLowerCase());
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=detectIrFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detectIrFormat.js","sourceRoot":"","sources":["../../../src/ir/core/detectIrFormat.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handing spectra over as a file, from the list they are drawn from.
|
|
3
|
+
*
|
|
4
|
+
* Kept apart from `spectrumJcamp.ts` so that what a file holds can be tested
|
|
5
|
+
* without a DOM, and so that a page wanting the text for something other than a
|
|
6
|
+
* download — a POST to an ELN, a zip of a whole session — reaches for the writer
|
|
7
|
+
* and not for this.
|
|
8
|
+
*/
|
|
9
|
+
import type { IrMode, IrSpectrum } from './irSpectrum.ts';
|
|
10
|
+
/**
|
|
11
|
+
* Download one spectrum, named after what the list calls it.
|
|
12
|
+
* @param spectrum - The spectrum.
|
|
13
|
+
* @param mode - The axis being read, used when the file named none.
|
|
14
|
+
*/
|
|
15
|
+
export declare function downloadIrSpectrum(spectrum: IrSpectrum, mode: IrMode): void;
|
|
16
|
+
/**
|
|
17
|
+
* Download the whole list as one file.
|
|
18
|
+
*
|
|
19
|
+
* A list of one is saved under that spectrum's own name, since the file is that
|
|
20
|
+
* spectrum: a chemist who has one spectrum open and asks the panel for it should
|
|
21
|
+
* not have to work out which of their downloads `spectra.jdx` was.
|
|
22
|
+
* @param spectra - The spectra, in the order the list holds them.
|
|
23
|
+
* @param mode - The axis being read, used for a spectrum whose file named none.
|
|
24
|
+
*/
|
|
25
|
+
export declare function downloadIrSpectra(spectra: readonly IrSpectrum[], mode: IrMode): void;
|
|
26
|
+
//# sourceMappingURL=downloadSpectra.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"downloadSpectra.d.ts","sourceRoot":"","sources":["../../../src/ir/core/downloadSpectra.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAQ1D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAM3E;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,IAAI,EAAE,MAAM,GACX,IAAI,CAWN"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handing spectra over as a file, from the list they are drawn from.
|
|
3
|
+
*
|
|
4
|
+
* Kept apart from `spectrumJcamp.ts` so that what a file holds can be tested
|
|
5
|
+
* without a DOM, and so that a page wanting the text for something other than a
|
|
6
|
+
* download — a POST to an ELN, a zip of a whole session — reaches for the writer
|
|
7
|
+
* and not for this.
|
|
8
|
+
*/
|
|
9
|
+
import { downloadText } from "../../download/core/downloadText.js";
|
|
10
|
+
import { sanitizeFileName } from "../../download/core/sanitizeFileName.js";
|
|
11
|
+
import { JCAMP_EXTENSION, JCAMP_MIME_TYPE, irSpectraToJcamp, irSpectrumToJcamp, } from "./spectrumJcamp.js";
|
|
12
|
+
/**
|
|
13
|
+
* Download one spectrum, named after what the list calls it.
|
|
14
|
+
* @param spectrum - The spectrum.
|
|
15
|
+
* @param mode - The axis being read, used when the file named none.
|
|
16
|
+
*/
|
|
17
|
+
export function downloadIrSpectrum(spectrum, mode) {
|
|
18
|
+
downloadText(irSpectrumToJcamp(spectrum, mode), `${sanitizeFileName(spectrum.name, 'spectrum')}${JCAMP_EXTENSION}`, JCAMP_MIME_TYPE);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Download the whole list as one file.
|
|
22
|
+
*
|
|
23
|
+
* A list of one is saved under that spectrum's own name, since the file is that
|
|
24
|
+
* spectrum: a chemist who has one spectrum open and asks the panel for it should
|
|
25
|
+
* not have to work out which of their downloads `spectra.jdx` was.
|
|
26
|
+
* @param spectra - The spectra, in the order the list holds them.
|
|
27
|
+
* @param mode - The axis being read, used for a spectrum whose file named none.
|
|
28
|
+
*/
|
|
29
|
+
export function downloadIrSpectra(spectra, mode) {
|
|
30
|
+
const only = spectra.length === 1 ? spectra[0] : undefined;
|
|
31
|
+
if (only !== undefined) {
|
|
32
|
+
downloadIrSpectrum(only, mode);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
downloadText(irSpectraToJcamp(spectra, mode), `spectra${JCAMP_EXTENSION}`, JCAMP_MIME_TYPE);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=downloadSpectra.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"downloadSpectra.js","sourceRoot":"","sources":["../../../src/ir/core/downloadSpectra.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAG3E,OAAO,EACL,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAoB,EAAE,IAAY;IACnE,YAAY,CACV,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,EACjC,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,eAAe,EAAE,EAClE,eAAe,CAChB,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAA8B,EAC9B,IAAY;IAEZ,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/B,OAAO;IACT,CAAC;IACD,YAAY,CACV,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,EAC/B,UAAU,eAAe,EAAE,EAC3B,eAAe,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a JCAMP-DX file into infrared spectra.
|
|
3
|
+
*
|
|
4
|
+
* `ir-spectrum` does the reading, which matters for one reason worth stating: it
|
|
5
|
+
* adds an absorbance and a percent transmittance variable to every spectrum it
|
|
6
|
+
* builds, whichever of the two the instrument wrote. So a file exported as
|
|
7
|
+
* transmittance and one exported as absorbance arrive carrying both axes, and
|
|
8
|
+
* nothing downstream has to know which it was — or to do the conversion itself.
|
|
9
|
+
*/
|
|
10
|
+
import type { TextData } from 'cheminfo-types';
|
|
11
|
+
import type { LoadedIrSpectrum } from './analysisSpectra.ts';
|
|
12
|
+
/** How a JCAMP is read. */
|
|
13
|
+
export interface IrJcampReadOptions {
|
|
14
|
+
/**
|
|
15
|
+
* The file's name, carried onto every spectrum it produced.
|
|
16
|
+
* @default undefined
|
|
17
|
+
*/
|
|
18
|
+
fileName?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Read every infrared spectrum a JCAMP-DX file holds.
|
|
22
|
+
*
|
|
23
|
+
* All of them, never the first: a JCAMP is a container, and an instrument
|
|
24
|
+
* exporting a sample beside its background writes both as blocks of one file.
|
|
25
|
+
* Taking only the first would quietly drop the block the chemist exported the
|
|
26
|
+
* file for, and would do it without an error, which is the worst way to lose
|
|
27
|
+
* data.
|
|
28
|
+
* @param data - The file, as bytes or as text.
|
|
29
|
+
* @param options - The file's name.
|
|
30
|
+
* @returns One entry per block, in the order the file wrote them.
|
|
31
|
+
* @throws {Error} When the file holds no readable spectrum, or when the
|
|
32
|
+
* converter gave up on it.
|
|
33
|
+
*/
|
|
34
|
+
export declare function fromJcamp(data: TextData, options?: IrJcampReadOptions): LoadedIrSpectrum[];
|
|
35
|
+
//# sourceMappingURL=fromJcamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromJcamp.d.ts","sourceRoot":"","sources":["../../../src/ir/core/fromJcamp.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAK/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,2BAA2B;AAC3B,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE,kBAAuB,GAC/B,gBAAgB,EAAE,CAyBpB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a JCAMP-DX file into infrared spectra.
|
|
3
|
+
*
|
|
4
|
+
* `ir-spectrum` does the reading, which matters for one reason worth stating: it
|
|
5
|
+
* adds an absorbance and a percent transmittance variable to every spectrum it
|
|
6
|
+
* builds, whichever of the two the instrument wrote. So a file exported as
|
|
7
|
+
* transmittance and one exported as absorbance arrive carrying both axes, and
|
|
8
|
+
* nothing downstream has to know which it was — or to do the conversion itself.
|
|
9
|
+
*/
|
|
10
|
+
import { fromJcamp as irAnalysis } from 'ir-spectrum';
|
|
11
|
+
import { describeSource, errorMessage } from "../../error/core/index.js";
|
|
12
|
+
import { analysisSpectra } from "./analysisSpectra.js";
|
|
13
|
+
/**
|
|
14
|
+
* Read every infrared spectrum a JCAMP-DX file holds.
|
|
15
|
+
*
|
|
16
|
+
* All of them, never the first: a JCAMP is a container, and an instrument
|
|
17
|
+
* exporting a sample beside its background writes both as blocks of one file.
|
|
18
|
+
* Taking only the first would quietly drop the block the chemist exported the
|
|
19
|
+
* file for, and would do it without an error, which is the worst way to lose
|
|
20
|
+
* data.
|
|
21
|
+
* @param data - The file, as bytes or as text.
|
|
22
|
+
* @param options - The file's name.
|
|
23
|
+
* @returns One entry per block, in the order the file wrote them.
|
|
24
|
+
* @throws {Error} When the file holds no readable spectrum, or when the
|
|
25
|
+
* converter gave up on it.
|
|
26
|
+
*/
|
|
27
|
+
export function fromJcamp(data, options = {}) {
|
|
28
|
+
const { fileName } = options;
|
|
29
|
+
let spectra;
|
|
30
|
+
try {
|
|
31
|
+
const origin = { format: 'jcamp' };
|
|
32
|
+
if (fileName !== undefined)
|
|
33
|
+
origin.fileName = fileName;
|
|
34
|
+
spectra = analysisSpectra(irAnalysis(data), origin);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
// The converter's own words are kept because they name the record it
|
|
38
|
+
// stopped on, which is more than anything written here could say — but they
|
|
39
|
+
// are said about nothing, and a chemist who has just dropped eleven files
|
|
40
|
+
// needs to know which of them this is.
|
|
41
|
+
throw new Error(`${describeSource(fileName)} could not be read as JCAMP-DX — the converter stopped on it with: ${errorMessage(error)}`, { cause: error });
|
|
42
|
+
}
|
|
43
|
+
if (spectra.length === 0) {
|
|
44
|
+
throw new Error(`${describeSource(fileName)} was read as JCAMP-DX but holds no infrared spectrum — no block in it carries an XY data record with at least two points.`);
|
|
45
|
+
}
|
|
46
|
+
return spectra;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=fromJcamp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromJcamp.js","sourceRoot":"","sources":["../../../src/ir/core/fromJcamp.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAWvD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,SAAS,CACvB,IAAc,EACd,UAA8B,EAAE;IAEhC,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAE7B,IAAI,OAA2B,CAAC;IAChC,IAAI,CAAC;QACH,MAAM,MAAM,GAA+B,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;QAC/D,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACvD,OAAO,GAAG,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,qEAAqE;QACrE,4EAA4E;QAC5E,0EAA0E;QAC1E,uCAAuC;QACvC,MAAM,IAAI,KAAK,CACb,GAAG,cAAc,CAAC,QAAQ,CAAC,sEAAsE,YAAY,CAAC,KAAK,CAAC,EAAE,EACtH,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,GAAG,cAAc,CAAC,QAAQ,CAAC,2HAA2H,CACvJ,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a Thermo Galactic SPC file into infrared spectra.
|
|
3
|
+
*
|
|
4
|
+
* `ir-spectrum` does the reading, through `spc-parser`, and adds both value axes
|
|
5
|
+
* exactly as it does for a JCAMP — so an SPC and a JCAMP of the same measurement
|
|
6
|
+
* reach the viewer indistinguishable but for their `origin`.
|
|
7
|
+
*/
|
|
8
|
+
import type { LoadedIrSpectrum } from './analysisSpectra.ts';
|
|
9
|
+
/** How an SPC file is read. */
|
|
10
|
+
export interface IrSpcReadOptions {
|
|
11
|
+
/**
|
|
12
|
+
* The file's name, carried onto every spectrum it produced.
|
|
13
|
+
* @default undefined
|
|
14
|
+
*/
|
|
15
|
+
fileName?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Read every infrared spectrum an SPC file holds.
|
|
19
|
+
*
|
|
20
|
+
* SPC is a multi-file format in its own right — one file can carry a whole
|
|
21
|
+
* kinetic series — so every subfile becomes a spectrum, for the same reason
|
|
22
|
+
* every JCAMP block does.
|
|
23
|
+
* @param data - The file, as bytes.
|
|
24
|
+
* @param options - The file's name.
|
|
25
|
+
* @returns One entry per subfile, in the order the file wrote them.
|
|
26
|
+
* @throws {Error} When the file holds no readable spectrum, or when the parser
|
|
27
|
+
* gave up on it.
|
|
28
|
+
*/
|
|
29
|
+
export declare function fromSpc(data: ArrayBuffer | Uint8Array, options?: IrSpcReadOptions): LoadedIrSpectrum[];
|
|
30
|
+
//# sourceMappingURL=fromSpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromSpc.d.ts","sourceRoot":"","sources":["../../../src/ir/core/fromSpc.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,+BAA+B;AAC/B,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,WAAW,GAAG,UAAU,EAC9B,OAAO,GAAE,gBAAqB,GAC7B,gBAAgB,EAAE,CAqBpB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a Thermo Galactic SPC file into infrared spectra.
|
|
3
|
+
*
|
|
4
|
+
* `ir-spectrum` does the reading, through `spc-parser`, and adds both value axes
|
|
5
|
+
* exactly as it does for a JCAMP — so an SPC and a JCAMP of the same measurement
|
|
6
|
+
* reach the viewer indistinguishable but for their `origin`.
|
|
7
|
+
*/
|
|
8
|
+
import { fromSPC as irAnalysis } from 'ir-spectrum';
|
|
9
|
+
import { describeSource, errorMessage } from "../../error/core/index.js";
|
|
10
|
+
import { analysisSpectra } from "./analysisSpectra.js";
|
|
11
|
+
/**
|
|
12
|
+
* Read every infrared spectrum an SPC file holds.
|
|
13
|
+
*
|
|
14
|
+
* SPC is a multi-file format in its own right — one file can carry a whole
|
|
15
|
+
* kinetic series — so every subfile becomes a spectrum, for the same reason
|
|
16
|
+
* every JCAMP block does.
|
|
17
|
+
* @param data - The file, as bytes.
|
|
18
|
+
* @param options - The file's name.
|
|
19
|
+
* @returns One entry per subfile, in the order the file wrote them.
|
|
20
|
+
* @throws {Error} When the file holds no readable spectrum, or when the parser
|
|
21
|
+
* gave up on it.
|
|
22
|
+
*/
|
|
23
|
+
export function fromSpc(data, options = {}) {
|
|
24
|
+
const { fileName } = options;
|
|
25
|
+
let spectra;
|
|
26
|
+
try {
|
|
27
|
+
const origin = { format: 'spc' };
|
|
28
|
+
if (fileName !== undefined)
|
|
29
|
+
origin.fileName = fileName;
|
|
30
|
+
spectra = analysisSpectra(irAnalysis(data), origin);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw new Error(`${describeSource(fileName)} could not be read as SPC — the parser stopped on it with: ${errorMessage(error)}`, { cause: error });
|
|
34
|
+
}
|
|
35
|
+
if (spectra.length === 0) {
|
|
36
|
+
throw new Error(`${describeSource(fileName)} was read as SPC but holds no infrared spectrum — no subfile in it carries at least two points.`);
|
|
37
|
+
}
|
|
38
|
+
return spectra;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=fromSpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromSpc.js","sourceRoot":"","sources":["../../../src/ir/core/fromSpc.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAWvD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,OAAO,CACrB,IAA8B,EAC9B,UAA4B,EAAE;IAE9B,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAE7B,IAAI,OAA2B,CAAC;IAChC,IAAI,CAAC;QACH,MAAM,MAAM,GAA+B,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QAC7D,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACvD,OAAO,GAAG,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,GAAG,cAAc,CAAC,QAAQ,CAAC,8DAA8D,YAAY,CAAC,KAAK,CAAC,EAAE,EAC9G,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,GAAG,cAAc,CAAC,QAAQ,CAAC,iGAAiG,CAC7H,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an infrared spectrum is, and everything true of one that draws nothing.
|
|
3
|
+
*
|
|
4
|
+
* Reading a file, picking the bands, saying what each band might be, writing
|
|
5
|
+
* the spectra back out as JCAMP — none of it needs React, so a script that
|
|
6
|
+
* assigns a directory of spectra loads none.
|
|
7
|
+
*
|
|
8
|
+
* What is here is only what is true of infrared: that the axis runs from 4000
|
|
9
|
+
* down to 400, that a spectrum is read either as absorbance or as percent
|
|
10
|
+
* transmittance and a band points the other way in each, and that a wavenumber
|
|
11
|
+
* maps to a range of vibrations rather than to one. Nothing here knows what a
|
|
12
|
+
* glycan is, and nothing should: an infrared spectrum answers for whatever was
|
|
13
|
+
* put in the beam.
|
|
14
|
+
*/
|
|
15
|
+
export type { LoadedIrSpectrum } from './analysisSpectra.ts';
|
|
16
|
+
export { analysisSpectra } from './analysisSpectra.ts';
|
|
17
|
+
export type { AssignBandsOptions, AssignedBand } from './assignBands.ts';
|
|
18
|
+
export { assignBands, bandLabel, countAssigned } from './assignBands.ts';
|
|
19
|
+
export type { BandAssignment } from './bandAssignments.ts';
|
|
20
|
+
export { BAND_ASSIGNMENTS } from './bandAssignments.ts';
|
|
21
|
+
export type { BandLabelPlan, BandLabelPlanOptions } from './bandLabelPlan.ts';
|
|
22
|
+
export { planBandLabels } from './bandLabelPlan.ts';
|
|
23
|
+
export { detectIrFormat } from './detectIrFormat.ts';
|
|
24
|
+
export { downloadIrSpectra, downloadIrSpectrum } from './downloadSpectra.ts';
|
|
25
|
+
export type { IrJcampReadOptions } from './fromJcamp.ts';
|
|
26
|
+
export type { IrSpcReadOptions } from './fromSpc.ts';
|
|
27
|
+
export type { IrBand, IrBandStrength } from './irBand.ts';
|
|
28
|
+
export { sameIrBand } from './irBand.ts';
|
|
29
|
+
export type { IrCommand, IrCommandHandlers, IrCommandId, IrGesture, IrShortcut, RunIrCommand, } from './irCommands.ts';
|
|
30
|
+
export { irCommandLabel, irCommands } from './irCommands.ts';
|
|
31
|
+
export { LABEL_HEADROOM, X_DOMAIN_PADDING, Y_DOMAIN_PADDING, fittedTo, fullDomain, } from './irDomain.ts';
|
|
32
|
+
export type { IrEditorHandle, ZoomToBandOptions } from './irEditorApi.ts';
|
|
33
|
+
export { ABSORBANCE_DECIMALS, TRANSMITTANCE_DECIMALS, formatIrValue, formatWavenumber, shortModeLabel, } from './irFormat.ts';
|
|
34
|
+
export { IR_MODES, IR_MODE_RULES, bandsPointDown, boxZoomOnly, otherIrMode, yAxisRules, yAxisTitle, zoomGestures, } from './irMode.ts';
|
|
35
|
+
export type { CreateIrStateOptions, IrAction } from './irReducer.ts';
|
|
36
|
+
export { createIrState, irReducer } from './irReducer.ts';
|
|
37
|
+
export type { IrDomain, IrFormat, IrMeta, IrMetaField, IrMode, IrOrigin, IrSpectrum, IrTrace, } from './irSpectrum.ts';
|
|
38
|
+
export { traceOf } from './irSpectrum.ts';
|
|
39
|
+
export type { IrData, IrSettings, IrState, IrTool, IrView, PartialIrState, } from './irState.ts';
|
|
40
|
+
export { DEFAULT_LABEL_LIMIT, DEFAULT_PICKING, DEFAULT_SETTINGS, DEFAULT_SIDE_PANEL, DEFAULT_SIDE_PANELS, MAXIMUM_LABEL_LIMIT, isIrWindow, mergeIrSettings, } from './irState.ts';
|
|
41
|
+
export type { LoadIrSpectraOptions, LoadIrSpectraResult, } from './loadIrSpectra.ts';
|
|
42
|
+
export { loadIrSpectra } from './loadIrSpectra.ts';
|
|
43
|
+
export { BAND_HIT_RADIUS, nearestBandAt } from './nearestBand.ts';
|
|
44
|
+
export type { PickBandsOptions } from './pickBands.ts';
|
|
45
|
+
export { pickBands } from './pickBands.ts';
|
|
46
|
+
export { DEFAULT_DATA_TYPE, JCAMP_EXTENSION, JCAMP_MIME_TYPE, irSpectraToJcamp, irSpectrumToJcamp, } from './spectrumJcamp.ts';
|
|
47
|
+
export type { ToIrSpectrumOptions } from './toIrSpectrum.ts';
|
|
48
|
+
export { toIrSpectra, toIrSpectrum } from './toIrSpectrum.ts';
|
|
49
|
+
export type { IrSidePanelId } from './irSidePanels.ts';
|
|
50
|
+
export { irSidePanels } from './irSidePanels.ts';
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ir/core/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an infrared spectrum is, and everything true of one that draws nothing.
|
|
3
|
+
*
|
|
4
|
+
* Reading a file, picking the bands, saying what each band might be, writing
|
|
5
|
+
* the spectra back out as JCAMP — none of it needs React, so a script that
|
|
6
|
+
* assigns a directory of spectra loads none.
|
|
7
|
+
*
|
|
8
|
+
* What is here is only what is true of infrared: that the axis runs from 4000
|
|
9
|
+
* down to 400, that a spectrum is read either as absorbance or as percent
|
|
10
|
+
* transmittance and a band points the other way in each, and that a wavenumber
|
|
11
|
+
* maps to a range of vibrations rather than to one. Nothing here knows what a
|
|
12
|
+
* glycan is, and nothing should: an infrared spectrum answers for whatever was
|
|
13
|
+
* put in the beam.
|
|
14
|
+
*/
|
|
15
|
+
export { analysisSpectra } from "./analysisSpectra.js";
|
|
16
|
+
export { assignBands, bandLabel, countAssigned } from "./assignBands.js";
|
|
17
|
+
export { BAND_ASSIGNMENTS } from "./bandAssignments.js";
|
|
18
|
+
export { planBandLabels } from "./bandLabelPlan.js";
|
|
19
|
+
export { detectIrFormat } from "./detectIrFormat.js";
|
|
20
|
+
export { downloadIrSpectra, downloadIrSpectrum } from "./downloadSpectra.js";
|
|
21
|
+
export { sameIrBand } from "./irBand.js";
|
|
22
|
+
export { irCommandLabel, irCommands } from "./irCommands.js";
|
|
23
|
+
export { LABEL_HEADROOM, X_DOMAIN_PADDING, Y_DOMAIN_PADDING, fittedTo, fullDomain, } from "./irDomain.js";
|
|
24
|
+
export { ABSORBANCE_DECIMALS, TRANSMITTANCE_DECIMALS, formatIrValue, formatWavenumber, shortModeLabel, } from "./irFormat.js";
|
|
25
|
+
export { IR_MODES, IR_MODE_RULES, bandsPointDown, boxZoomOnly, otherIrMode, yAxisRules, yAxisTitle, zoomGestures, } from "./irMode.js";
|
|
26
|
+
export { createIrState, irReducer } from "./irReducer.js";
|
|
27
|
+
export { traceOf } from "./irSpectrum.js";
|
|
28
|
+
export { DEFAULT_LABEL_LIMIT, DEFAULT_PICKING, DEFAULT_SETTINGS, DEFAULT_SIDE_PANEL, DEFAULT_SIDE_PANELS, MAXIMUM_LABEL_LIMIT, isIrWindow, mergeIrSettings, } from "./irState.js";
|
|
29
|
+
export { loadIrSpectra } from "./loadIrSpectra.js";
|
|
30
|
+
export { BAND_HIT_RADIUS, nearestBandAt } from "./nearestBand.js";
|
|
31
|
+
export { pickBands } from "./pickBands.js";
|
|
32
|
+
export { DEFAULT_DATA_TYPE, JCAMP_EXTENSION, JCAMP_MIME_TYPE, irSpectraToJcamp, irSpectrumToJcamp, } from "./spectrumJcamp.js";
|
|
33
|
+
export { toIrSpectra, toIrSpectrum } from "./toIrSpectrum.js";
|
|
34
|
+
export { irSidePanels } from "./irSidePanels.js";
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ir/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI7E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AASzC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,UAAU,GACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,QAAQ,EACR,aAAa,EACb,cAAc,EACd,WAAW,EACX,WAAW,EACX,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAW1D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAS1C,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,eAAe,GAChB,MAAM,cAAc,CAAC;AAKtB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One band picked out of a spectrum.
|
|
3
|
+
*
|
|
4
|
+
* A band is the infrared analogue of a mass spectrum's peak: the thing a chemist
|
|
5
|
+
* points at, names, and reads a functional group off. It carries both value axes
|
|
6
|
+
* for the same reason the spectrum does — the band a reader sees at 30 percent
|
|
7
|
+
* transmittance and the one a table calls strongly absorbing are one band, and
|
|
8
|
+
* making the caller convert to find out would be the conversion this package
|
|
9
|
+
* does not do.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* How strong a band is, in the letters a correlation table uses.
|
|
13
|
+
*
|
|
14
|
+
* `w` weak, `m` medium, `S` strong — `ir-spectrum` decides which from where the
|
|
15
|
+
* band sits between the spectrum's own extremes, so the letters are relative to
|
|
16
|
+
* the spectrum in hand rather than to an absolute absorbance. That is what a
|
|
17
|
+
* printed table means by them too.
|
|
18
|
+
*/
|
|
19
|
+
export type IrBandStrength = 'w' | 'm' | 'S';
|
|
20
|
+
/** One band picked out of one spectrum. */
|
|
21
|
+
export interface IrBand {
|
|
22
|
+
/** Identity of the spectrum it was picked from. */
|
|
23
|
+
spectrumId: string;
|
|
24
|
+
/** Where it sits, in cm⁻¹. */
|
|
25
|
+
wavenumber: number;
|
|
26
|
+
/** Its absorbance, which is what it was picked as a maximum of. */
|
|
27
|
+
absorbance: number;
|
|
28
|
+
/** Its percent transmittance, the same band read the other way up. */
|
|
29
|
+
transmittance: number;
|
|
30
|
+
/** How strong it is, relative to the spectrum it came from. */
|
|
31
|
+
strength: IrBandStrength;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Whether two bands are the same band.
|
|
35
|
+
*
|
|
36
|
+
* The wavenumber is compared exactly, and that is not an oversight: both numbers
|
|
37
|
+
* were read out of the same picked band, so either they are the very same
|
|
38
|
+
* measurement or they are two different bands. A tolerance here would declare a
|
|
39
|
+
* carbonyl pair thirty wavenumbers apart to be one band.
|
|
40
|
+
* @param current - What was last reported.
|
|
41
|
+
* @param next - What would be reported now.
|
|
42
|
+
* @returns Whether the report can be skipped.
|
|
43
|
+
*/
|
|
44
|
+
export declare function sameIrBand(current: IrBand | null, next: IrBand | null): boolean;
|
|
45
|
+
//# sourceMappingURL=irBand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irBand.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irBand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAE7C,2CAA2C;AAC3C,MAAM,WAAW,MAAM;IACrB,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,aAAa,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,IAAI,EAAE,MAAM,GAAG,IAAI,GAClB,OAAO,CAOT"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One band picked out of a spectrum.
|
|
3
|
+
*
|
|
4
|
+
* A band is the infrared analogue of a mass spectrum's peak: the thing a chemist
|
|
5
|
+
* points at, names, and reads a functional group off. It carries both value axes
|
|
6
|
+
* for the same reason the spectrum does — the band a reader sees at 30 percent
|
|
7
|
+
* transmittance and the one a table calls strongly absorbing are one band, and
|
|
8
|
+
* making the caller convert to find out would be the conversion this package
|
|
9
|
+
* does not do.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Whether two bands are the same band.
|
|
13
|
+
*
|
|
14
|
+
* The wavenumber is compared exactly, and that is not an oversight: both numbers
|
|
15
|
+
* were read out of the same picked band, so either they are the very same
|
|
16
|
+
* measurement or they are two different bands. A tolerance here would declare a
|
|
17
|
+
* carbonyl pair thirty wavenumbers apart to be one band.
|
|
18
|
+
* @param current - What was last reported.
|
|
19
|
+
* @param next - What would be reported now.
|
|
20
|
+
* @returns Whether the report can be skipped.
|
|
21
|
+
*/
|
|
22
|
+
export function sameIrBand(current, next) {
|
|
23
|
+
if (current === next)
|
|
24
|
+
return true;
|
|
25
|
+
if (current === null || next === null)
|
|
26
|
+
return false;
|
|
27
|
+
return (current.spectrumId === next.spectrumId &&
|
|
28
|
+
current.wavenumber === next.wavenumber);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=irBand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irBand.js","sourceRoot":"","sources":["../../../src/ir/core/irBand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA0BH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CACxB,OAAsB,EACtB,IAAmB;IAEnB,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAClC,IAAI,OAAO,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACpD,OAAO,CACL,OAAO,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU;QACtC,OAAO,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,CACvC,CAAC;AACJ,CAAC"}
|