react-cheminfo 0.65.0 → 0.67.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 +33 -17
- package/lib/download/ui/FigureDownloadPanel.d.ts +7 -1
- package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
- package/lib/download/ui/FigureDownloadPanel.js +2 -2
- package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
- package/lib/ecosystem/core/sites.js +3 -3
- package/lib/ecosystem/core/sites.js.map +1 -1
- package/lib/ecosystem/core/types.d.ts +1 -1
- package/lib/ecosystem/core/types.d.ts.map +1 -1
- package/lib/ecosystem/ui/glyphs.js +1 -1
- package/lib/ecosystem/ui/glyphs.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/i18n/core/messageCatalog.d.ts +2 -2
- package/lib/i18n/vite/localeCatalog.d.ts +1 -1
- package/lib/ir/core/analysisSpectra.d.ts +23 -6
- package/lib/ir/core/analysisSpectra.d.ts.map +1 -1
- package/lib/ir/core/analysisSpectra.js.map +1 -1
- package/lib/ir/core/bandLabelPlan.d.ts.map +1 -1
- package/lib/ir/core/bandLabelPlan.js +11 -6
- package/lib/ir/core/bandLabelPlan.js.map +1 -1
- package/lib/ir/core/index.d.ts +15 -11
- package/lib/ir/core/index.d.ts.map +1 -1
- package/lib/ir/core/index.js +9 -6
- package/lib/ir/core/index.js.map +1 -1
- package/lib/ir/core/irBand.d.ts +45 -14
- package/lib/ir/core/irBand.d.ts.map +1 -1
- package/lib/ir/core/irBand.js +28 -6
- package/lib/ir/core/irBand.js.map +1 -1
- package/lib/ir/core/irCommands.d.ts +11 -0
- package/lib/ir/core/irCommands.d.ts.map +1 -1
- package/lib/ir/core/irCommands.js +11 -1
- package/lib/ir/core/irCommands.js.map +1 -1
- package/lib/ir/core/irDomain.d.ts +4 -3
- package/lib/ir/core/irDomain.d.ts.map +1 -1
- package/lib/ir/core/irDomain.js +10 -7
- package/lib/ir/core/irDomain.js.map +1 -1
- package/lib/ir/core/irEditorApi.d.ts +12 -0
- package/lib/ir/core/irEditorApi.d.ts.map +1 -1
- package/lib/ir/core/irFormat.d.ts +14 -2
- package/lib/ir/core/irFormat.d.ts.map +1 -1
- package/lib/ir/core/irFormat.js +33 -4
- package/lib/ir/core/irFormat.js.map +1 -1
- package/lib/ir/core/irMode.d.ts +35 -8
- package/lib/ir/core/irMode.d.ts.map +1 -1
- package/lib/ir/core/irMode.js +38 -10
- package/lib/ir/core/irMode.js.map +1 -1
- package/lib/ir/core/irReducer.d.ts +2 -30
- package/lib/ir/core/irReducer.d.ts.map +1 -1
- package/lib/ir/core/irReducer.js +1 -24
- package/lib/ir/core/irReducer.js.map +1 -1
- package/lib/ir/core/irSidePanels.d.ts +7 -1
- package/lib/ir/core/irSidePanels.d.ts.map +1 -1
- package/lib/ir/core/irSpectrum.d.ts +52 -26
- package/lib/ir/core/irSpectrum.d.ts.map +1 -1
- package/lib/ir/core/irSpectrum.js +21 -15
- package/lib/ir/core/irSpectrum.js.map +1 -1
- package/lib/ir/core/irState.d.ts +46 -5
- package/lib/ir/core/irState.d.ts.map +1 -1
- package/lib/ir/core/irState.js +38 -1
- package/lib/ir/core/irState.js.map +1 -1
- package/lib/ir/core/irTechnique.d.ts +94 -0
- package/lib/ir/core/irTechnique.d.ts.map +1 -0
- package/lib/ir/core/irTechnique.js +87 -0
- package/lib/ir/core/irTechnique.js.map +1 -0
- package/lib/ir/core/irTechniqueCommands.d.ts +26 -0
- package/lib/ir/core/irTechniqueCommands.d.ts.map +1 -0
- package/lib/ir/core/irTechniqueCommands.js +68 -0
- package/lib/ir/core/irTechniqueCommands.js.map +1 -0
- package/lib/ir/core/pickBands.d.ts +6 -5
- package/lib/ir/core/pickBands.d.ts.map +1 -1
- package/lib/ir/core/pickBands.js +49 -26
- package/lib/ir/core/pickBands.js.map +1 -1
- package/lib/ir/core/ramanBands.d.ts +30 -0
- package/lib/ir/core/ramanBands.d.ts.map +1 -0
- package/lib/ir/core/ramanBands.js +83 -0
- package/lib/ir/core/ramanBands.js.map +1 -0
- package/lib/ir/core/spectrumJcamp.d.ts +10 -5
- package/lib/ir/core/spectrumJcamp.d.ts.map +1 -1
- package/lib/ir/core/spectrumJcamp.js +63 -15
- package/lib/ir/core/spectrumJcamp.js.map +1 -1
- package/lib/ir/core/toIrSpectrum.d.ts.map +1 -1
- package/lib/ir/core/toIrSpectrum.js +17 -2
- package/lib/ir/core/toIrSpectrum.js.map +1 -1
- package/lib/ir/ui/BandRow.d.ts +30 -0
- package/lib/ir/ui/BandRow.d.ts.map +1 -0
- package/lib/ir/ui/BandRow.js +42 -0
- package/lib/ir/ui/BandRow.js.map +1 -0
- package/lib/ir/ui/BandsPanel.d.ts +4 -0
- package/lib/ir/ui/BandsPanel.d.ts.map +1 -1
- package/lib/ir/ui/BandsPanel.js +14 -59
- package/lib/ir/ui/BandsPanel.js.map +1 -1
- package/lib/ir/ui/IrAboutDialog.d.ts +7 -0
- package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -1
- package/lib/ir/ui/IrAboutDialog.js +16 -3
- package/lib/ir/ui/IrAboutDialog.js.map +1 -1
- package/lib/ir/ui/IrCanvas.d.ts +7 -0
- package/lib/ir/ui/IrCanvas.d.ts.map +1 -1
- package/lib/ir/ui/IrCanvas.js +9 -4
- package/lib/ir/ui/IrCanvas.js.map +1 -1
- package/lib/ir/ui/IrChart.d.ts +2 -1
- package/lib/ir/ui/IrChart.d.ts.map +1 -1
- package/lib/ir/ui/IrChart.js +22 -21
- package/lib/ir/ui/IrChart.js.map +1 -1
- package/lib/ir/ui/IrCommandProvider.d.ts +7 -0
- package/lib/ir/ui/IrCommandProvider.d.ts.map +1 -1
- package/lib/ir/ui/IrCommandProvider.js +2 -2
- package/lib/ir/ui/IrCommandProvider.js.map +1 -1
- package/lib/ir/ui/IrCommandTooltip.d.ts +7 -0
- package/lib/ir/ui/IrCommandTooltip.d.ts.map +1 -1
- package/lib/ir/ui/IrCommandTooltip.js +3 -2
- package/lib/ir/ui/IrCommandTooltip.js.map +1 -1
- package/lib/ir/ui/IrDocumentationDialog.d.ts +8 -1
- package/lib/ir/ui/IrDocumentationDialog.d.ts.map +1 -1
- package/lib/ir/ui/IrDocumentationDialog.js +30 -7
- package/lib/ir/ui/IrDocumentationDialog.js.map +1 -1
- package/lib/ir/ui/IrEditor.d.ts +25 -5
- package/lib/ir/ui/IrEditor.d.ts.map +1 -1
- package/lib/ir/ui/IrEditor.js +3 -20
- package/lib/ir/ui/IrEditor.js.map +1 -1
- package/lib/ir/ui/IrHeader.d.ts.map +1 -1
- package/lib/ir/ui/IrHeader.js +5 -1
- package/lib/ir/ui/IrHeader.js.map +1 -1
- package/lib/ir/ui/IrLogo.d.ts +11 -3
- package/lib/ir/ui/IrLogo.d.ts.map +1 -1
- package/lib/ir/ui/IrLogo.js +14 -5
- package/lib/ir/ui/IrLogo.js.map +1 -1
- package/lib/ir/ui/IrShell.d.ts +9 -1
- package/lib/ir/ui/IrShell.d.ts.map +1 -1
- package/lib/ir/ui/IrShell.js +26 -74
- package/lib/ir/ui/IrShell.js.map +1 -1
- package/lib/ir/ui/IrSidePanel.d.ts +11 -0
- package/lib/ir/ui/IrSidePanel.d.ts.map +1 -1
- package/lib/ir/ui/IrSidePanel.js +12 -3
- package/lib/ir/ui/IrSidePanel.js.map +1 -1
- package/lib/ir/ui/IrStatusBar.d.ts +3 -2
- package/lib/ir/ui/IrStatusBar.d.ts.map +1 -1
- package/lib/ir/ui/IrStatusBar.js +14 -9
- package/lib/ir/ui/IrStatusBar.js.map +1 -1
- package/lib/ir/ui/IrToolbar.d.ts +3 -0
- package/lib/ir/ui/IrToolbar.d.ts.map +1 -1
- package/lib/ir/ui/IrToolbar.js +10 -3
- package/lib/ir/ui/IrToolbar.js.map +1 -1
- package/lib/ir/ui/IrTraces.d.ts +4 -1
- package/lib/ir/ui/IrTraces.d.ts.map +1 -1
- package/lib/ir/ui/IrTraces.js +2 -0
- package/lib/ir/ui/IrTraces.js.map +1 -1
- package/lib/ir/ui/RamanEditor.d.ts +64 -0
- package/lib/ir/ui/RamanEditor.d.ts.map +1 -0
- package/lib/ir/ui/RamanEditor.js +17 -0
- package/lib/ir/ui/RamanEditor.js.map +1 -0
- package/lib/ir/ui/SpectraPanel.d.ts.map +1 -1
- package/lib/ir/ui/SpectraPanel.js +2 -2
- package/lib/ir/ui/SpectraPanel.js.map +1 -1
- package/lib/ir/ui/SpectrumRow.d.ts +7 -0
- package/lib/ir/ui/SpectrumRow.d.ts.map +1 -1
- package/lib/ir/ui/SpectrumRow.js +4 -5
- package/lib/ir/ui/SpectrumRow.js.map +1 -1
- package/lib/ir/ui/VibrationalEditor.d.ts +62 -0
- package/lib/ir/ui/VibrationalEditor.d.ts.map +1 -0
- package/lib/ir/ui/VibrationalEditor.js +33 -0
- package/lib/ir/ui/VibrationalEditor.js.map +1 -0
- package/lib/ir/ui/bandsTsv.d.ts +19 -0
- package/lib/ir/ui/bandsTsv.d.ts.map +1 -0
- package/lib/ir/ui/bandsTsv.js +38 -0
- package/lib/ir/ui/bandsTsv.js.map +1 -0
- package/lib/ir/ui/index.d.ts +1 -0
- package/lib/ir/ui/index.d.ts.map +1 -1
- package/lib/ir/ui/index.js.map +1 -1
- package/lib/ir/ui/irActions.d.ts +3 -3
- package/lib/ir/ui/irActions.d.ts.map +1 -1
- package/lib/ir/ui/irChartProps.d.ts +21 -4
- package/lib/ir/ui/irChartProps.d.ts.map +1 -1
- package/lib/ir/ui/irChartProps.js +3 -2
- package/lib/ir/ui/irChartProps.js.map +1 -1
- package/lib/ir/ui/irCommandContext.d.ts +8 -0
- package/lib/ir/ui/irCommandContext.d.ts.map +1 -1
- package/lib/ir/ui/irCommandContext.js +14 -3
- package/lib/ir/ui/irCommandContext.js.map +1 -1
- package/lib/ir/ui/irHostPanels.d.ts +53 -0
- package/lib/ir/ui/irHostPanels.d.ts.map +1 -0
- package/lib/ir/ui/irHostPanels.js +41 -0
- package/lib/ir/ui/irHostPanels.js.map +1 -0
- package/lib/ir/ui/useIrEditor.d.ts +3 -3
- package/lib/ir/ui/useIrEditor.d.ts.map +1 -1
- package/lib/ir/ui/useIrEditor.js +13 -4
- package/lib/ir/ui/useIrEditor.js.map +1 -1
- package/lib/ir/ui/useIrHandle.d.ts +14 -0
- package/lib/ir/ui/useIrHandle.d.ts.map +1 -0
- package/lib/ir/ui/useIrHandle.js +39 -0
- package/lib/ir/ui/useIrHandle.js.map +1 -0
- package/lib/ir/ui/useIrSide.d.ts +27 -0
- package/lib/ir/ui/useIrSide.d.ts.map +1 -0
- package/lib/ir/ui/useIrSide.js +42 -0
- package/lib/ir/ui/useIrSide.js.map +1 -0
- package/lib/ir/ui/useIrText.d.ts +40 -0
- package/lib/ir/ui/useIrText.d.ts.map +1 -0
- package/lib/ir/ui/useIrText.js +118 -0
- package/lib/ir/ui/useIrText.js.map +1 -0
- package/lib/ir/ui/useIrZoom.d.ts +15 -0
- package/lib/ir/ui/useIrZoom.d.ts.map +1 -1
- package/lib/ir/ui/useIrZoom.js +6 -4
- package/lib/ir/ui/useIrZoom.js.map +1 -1
- package/lib/ir/ui/useValueAxisZoom.d.ts +20 -0
- package/lib/ir/ui/useValueAxisZoom.d.ts.map +1 -0
- package/lib/ir/ui/useValueAxisZoom.js +54 -0
- package/lib/ir/ui/useValueAxisZoom.js.map +1 -0
- package/lib/ir.d.ts +3 -0
- package/lib/ir.d.ts.map +1 -1
- package/lib/ir.js +3 -0
- package/lib/ir.js.map +1 -1
- package/lib/locales/de.json +29 -2
- package/lib/locales/en.json +29 -2
- package/lib/locales/es.json +29 -2
- package/lib/locales/fr.json +29 -2
- package/lib/locales/it.json +29 -2
- package/lib/molecule3d/core/animatedPng.d.ts +25 -0
- package/lib/molecule3d/core/animatedPng.d.ts.map +1 -0
- package/lib/molecule3d/core/animatedPng.js +59 -0
- package/lib/molecule3d/core/animatedPng.js.map +1 -0
- package/lib/molecule3d/core/file.d.ts +24 -0
- package/lib/molecule3d/core/file.d.ts.map +1 -0
- package/lib/molecule3d/core/file.js +2 -0
- package/lib/molecule3d/core/file.js.map +1 -0
- package/lib/molecule3d/core/index.d.ts +4 -1
- package/lib/molecule3d/core/index.d.ts.map +1 -1
- package/lib/molecule3d/core/index.js +1 -0
- package/lib/molecule3d/core/index.js.map +1 -1
- package/lib/molecule3d/core/settings.d.ts +0 -7
- package/lib/molecule3d/core/settings.d.ts.map +1 -1
- package/lib/molecule3d/core/settings.js.map +1 -1
- package/lib/molecule3d/ui/Molecule3DExport.d.ts +10 -2
- package/lib/molecule3d/ui/Molecule3DExport.d.ts.map +1 -1
- package/lib/molecule3d/ui/Molecule3DExport.js +15 -2
- package/lib/molecule3d/ui/Molecule3DExport.js.map +1 -1
- package/lib/molecule3d/ui/Molecule3DToolbar.js +9 -2
- package/lib/molecule3d/ui/Molecule3DToolbar.js.map +1 -1
- package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
- package/lib/molecule3d/ui/MoleculeCanvas3D.js +23 -41
- package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
- package/lib/molecule3d/ui/drawScene.d.ts +2 -1
- package/lib/molecule3d/ui/drawScene.d.ts.map +1 -1
- package/lib/molecule3d/ui/drawScene.js.map +1 -1
- package/lib/molecule3d/ui/exportMoleculeImage.d.ts +15 -1
- package/lib/molecule3d/ui/exportMoleculeImage.d.ts.map +1 -1
- package/lib/molecule3d/ui/exportMoleculeImage.js +14 -2
- package/lib/molecule3d/ui/exportMoleculeImage.js.map +1 -1
- package/lib/molecule3d/ui/moleculeFrames.d.ts +47 -0
- package/lib/molecule3d/ui/moleculeFrames.d.ts.map +1 -0
- package/lib/molecule3d/ui/moleculeFrames.js +65 -0
- package/lib/molecule3d/ui/moleculeFrames.js.map +1 -0
- package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts +14 -1
- package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts.map +1 -1
- package/lib/molecule3d/ui/renderMolecule.d.ts +3 -3
- package/lib/molecule3d/ui/renderMolecule.d.ts.map +1 -1
- package/lib/molecule3d/ui/renderMolecule.js +2 -1
- package/lib/molecule3d/ui/renderMolecule.js.map +1 -1
- package/lib/molecule3d/ui/sceneDrawer.d.ts +2 -1
- package/lib/molecule3d/ui/sceneDrawer.d.ts.map +1 -1
- package/lib/molecule3d/ui/sceneDrawer.js +9 -1
- package/lib/molecule3d/ui/sceneDrawer.js.map +1 -1
- package/lib/molecule3d/ui/useImageExport.d.ts +8 -3
- package/lib/molecule3d/ui/useImageExport.d.ts.map +1 -1
- package/lib/molecule3d/ui/useImageExport.js +13 -4
- package/lib/molecule3d/ui/useImageExport.js.map +1 -1
- package/lib/molecule3d/ui/useMoleculeScene.d.ts +2 -1
- package/lib/molecule3d/ui/useMoleculeScene.d.ts.map +1 -1
- package/lib/molecule3d/ui/useMoleculeScene.js.map +1 -1
- package/lib/molecule3d/ui/useMoleculeViewer.d.ts +16 -0
- package/lib/molecule3d/ui/useMoleculeViewer.d.ts.map +1 -0
- package/lib/molecule3d/ui/useMoleculeViewer.js +37 -0
- package/lib/molecule3d/ui/useMoleculeViewer.js.map +1 -0
- package/lib/molecule3d/ui/usePolarSurfaceArea.d.ts +3 -3
- package/lib/molecule3d/ui/usePolarSurfaceArea.d.ts.map +1 -1
- package/lib/molecule3d/ui/usePolarSurfaceArea.js +4 -3
- package/lib/molecule3d/ui/usePolarSurfaceArea.js.map +1 -1
- package/lib/molecule3d/ui/viewer.d.ts +4 -1
- package/lib/molecule3d/ui/viewer.d.ts.map +1 -1
- package/lib/molecule3d/ui/viewer.js +21 -19
- package/lib/molecule3d/ui/viewer.js.map +1 -1
- package/lib/molecule3d/ui/viewerTypes.d.ts +6 -0
- package/lib/molecule3d/ui/viewerTypes.d.ts.map +1 -1
- package/lib/molstar/core/captureScene.d.ts +19 -1
- package/lib/molstar/core/captureScene.d.ts.map +1 -1
- package/lib/molstar/core/captureScene.js +57 -2
- package/lib/molstar/core/captureScene.js.map +1 -1
- package/lib/molstar/core/index.d.ts +5 -2
- package/lib/molstar/core/index.d.ts.map +1 -1
- package/lib/molstar/core/index.js +4 -2
- package/lib/molstar/core/index.js.map +1 -1
- package/lib/molstar/core/trajectory.d.ts +56 -0
- package/lib/molstar/core/trajectory.d.ts.map +1 -0
- package/lib/molstar/core/trajectory.js +96 -0
- package/lib/molstar/core/trajectory.js.map +1 -0
- package/lib/panel/ui/PanelRail.d.ts.map +1 -1
- package/lib/panel/ui/PanelRail.js +1 -1
- package/lib/panel/ui/PanelRail.js.map +1 -1
- package/lib/raman.d.ts +17 -0
- package/lib/raman.d.ts.map +1 -0
- package/lib/raman.js +12 -0
- package/lib/raman.js.map +1 -0
- package/lib/router/core/basePath.d.ts +2 -2
- package/lib/router/core/basePath.js +2 -2
- package/lib/router/core/siteAddresses.d.ts +1 -1
- package/lib/router/core/siteAddresses.js +1 -1
- package/lib/seo/core/siteFiles.js +1 -1
- package/lib/seo/core/siteFiles.js.map +1 -1
- package/lib/server/answerAddresses.d.ts +3 -3
- package/lib/server/answerAddresses.js +3 -3
- package/lib/structure/core/index.d.ts +2 -0
- package/lib/structure/core/index.d.ts.map +1 -1
- package/lib/structure/core/index.js +1 -0
- package/lib/structure/core/index.js.map +1 -1
- package/lib/structure/core/structureTransfer.d.ts +29 -0
- package/lib/structure/core/structureTransfer.d.ts.map +1 -0
- package/lib/structure/core/structureTransfer.js +26 -0
- package/lib/structure/core/structureTransfer.js.map +1 -0
- package/lib/structure/ui/EditorImportButton.d.ts +20 -0
- package/lib/structure/ui/EditorImportButton.d.ts.map +1 -0
- package/lib/structure/ui/EditorImportButton.js +24 -0
- package/lib/structure/ui/EditorImportButton.js.map +1 -0
- package/lib/structure/ui/EditorImportProblem.d.ts +17 -0
- package/lib/structure/ui/EditorImportProblem.d.ts.map +1 -0
- package/lib/structure/ui/EditorImportProblem.js +32 -0
- package/lib/structure/ui/EditorImportProblem.js.map +1 -0
- package/lib/structure/ui/StructureDrop.d.ts +39 -0
- package/lib/structure/ui/StructureDrop.d.ts.map +1 -0
- package/lib/structure/ui/StructureDrop.js +19 -0
- package/lib/structure/ui/StructureDrop.js.map +1 -0
- package/lib/structure/ui/StructureDropOverlay.d.ts +16 -0
- package/lib/structure/ui/StructureDropOverlay.d.ts.map +1 -0
- package/lib/structure/ui/StructureDropOverlay.js +29 -0
- package/lib/structure/ui/StructureDropOverlay.js.map +1 -0
- package/lib/structure/ui/StructureEditor.d.ts +3 -80
- package/lib/structure/ui/StructureEditor.d.ts.map +1 -1
- package/lib/structure/ui/StructureEditor.js +21 -33
- package/lib/structure/ui/StructureEditor.js.map +1 -1
- package/lib/structure/ui/importedStructure.d.ts +25 -0
- package/lib/structure/ui/importedStructure.d.ts.map +1 -0
- package/lib/structure/ui/importedStructure.js +74 -0
- package/lib/structure/ui/importedStructure.js.map +1 -0
- package/lib/structure/ui/index.d.ts +2 -0
- package/lib/structure/ui/index.d.ts.map +1 -1
- package/lib/structure/ui/index.js +1 -0
- package/lib/structure/ui/index.js.map +1 -1
- package/lib/structure/ui/structureEditorProps.d.ts +98 -0
- package/lib/structure/ui/structureEditorProps.d.ts.map +1 -0
- package/lib/structure/ui/structureEditorProps.js +2 -0
- package/lib/structure/ui/structureEditorProps.js.map +1 -0
- package/lib/structure/ui/useDebouncedChange.d.ts +16 -0
- package/lib/structure/ui/useDebouncedChange.d.ts.map +1 -0
- package/lib/structure/ui/useDebouncedChange.js +30 -0
- package/lib/structure/ui/useDebouncedChange.js.map +1 -0
- package/lib/structure/ui/useStructureDrop.d.ts +30 -0
- package/lib/structure/ui/useStructureDrop.d.ts.map +1 -0
- package/lib/structure/ui/useStructureDrop.js +49 -0
- package/lib/structure/ui/useStructureDrop.js.map +1 -0
- package/lib/structure/ui/useStructureImport.d.ts +45 -0
- package/lib/structure/ui/useStructureImport.d.ts.map +1 -0
- package/lib/structure/ui/useStructureImport.js +62 -0
- package/lib/structure/ui/useStructureImport.js.map +1 -0
- package/package.json +5 -1
- package/src/download/ui/FigureDownloadPanel.tsx +9 -2
- package/src/ecosystem/core/sites.ts +3 -3
- package/src/ecosystem/core/types.ts +1 -1
- package/src/ecosystem/ui/glyphs.tsx +1 -1
- package/src/i18n/core/messageCatalog.ts +2 -2
- package/src/i18n/vite/localeCatalog.ts +1 -1
- package/src/ir/core/analysisSpectra.ts +26 -10
- package/src/ir/core/bandLabelPlan.ts +21 -10
- package/src/ir/core/index.ts +31 -7
- package/src/ir/core/irBand.ts +52 -14
- package/src/ir/core/irCommands.ts +15 -1
- package/src/ir/core/irDomain.ts +9 -7
- package/src/ir/core/irEditorApi.ts +13 -0
- package/src/ir/core/irFormat.ts +39 -6
- package/src/ir/core/irMode.ts +42 -10
- package/src/ir/core/irReducer.ts +3 -51
- package/src/ir/core/irSidePanels.ts +8 -1
- package/src/ir/core/irSpectrum.ts +59 -30
- package/src/ir/core/irState.ts +73 -5
- package/src/ir/core/irTechnique.ts +115 -0
- package/src/ir/core/irTechniqueCommands.ts +82 -0
- package/src/ir/core/pickBands.ts +63 -28
- package/src/ir/core/ramanBands.ts +105 -0
- package/src/ir/core/spectrumJcamp.ts +65 -16
- package/src/ir/core/toIrSpectrum.ts +20 -2
- package/src/ir/ui/BandRow.tsx +107 -0
- package/src/ir/ui/BandsPanel.tsx +32 -125
- package/src/ir/ui/IrAboutDialog.tsx +69 -28
- package/src/ir/ui/IrCanvas.tsx +29 -3
- package/src/ir/ui/IrChart.tsx +31 -24
- package/src/ir/ui/IrCommandProvider.tsx +10 -3
- package/src/ir/ui/IrCommandTooltip.tsx +11 -2
- package/src/ir/ui/IrDocumentationDialog.tsx +99 -55
- package/src/ir/ui/IrEditor.tsx +27 -40
- package/src/ir/ui/IrHeader.tsx +10 -3
- package/src/ir/ui/IrLogo.tsx +28 -9
- package/src/ir/ui/IrShell.tsx +47 -96
- package/src/ir/ui/IrSidePanel.tsx +36 -10
- package/src/ir/ui/IrStatusBar.tsx +17 -12
- package/src/ir/ui/IrToolbar.tsx +26 -15
- package/src/ir/ui/IrTraces.tsx +5 -1
- package/src/ir/ui/RamanEditor.tsx +71 -0
- package/src/ir/ui/SpectraPanel.tsx +2 -1
- package/src/ir/ui/SpectrumRow.tsx +14 -5
- package/src/ir/ui/VibrationalEditor.tsx +113 -0
- package/src/ir/ui/bandsTsv.ts +46 -0
- package/src/ir/ui/index.ts +1 -0
- package/src/ir/ui/irActions.ts +3 -3
- package/src/ir/ui/irChartProps.ts +21 -4
- package/src/ir/ui/irCommandContext.tsx +18 -3
- package/src/ir/ui/irHostPanels.ts +76 -0
- package/src/ir/ui/useIrEditor.ts +20 -8
- package/src/ir/ui/useIrHandle.ts +51 -0
- package/src/ir/ui/useIrSide.ts +60 -0
- package/src/ir/ui/useIrText.ts +170 -0
- package/src/ir/ui/useIrZoom.ts +22 -3
- package/src/ir/ui/useValueAxisZoom.ts +67 -0
- package/src/ir.ts +3 -0
- package/src/locales/de.json +29 -2
- package/src/locales/en.json +29 -2
- package/src/locales/es.json +29 -2
- package/src/locales/fr.json +29 -2
- package/src/locales/it.json +29 -2
- package/src/molecule3d/core/animatedPng.ts +79 -0
- package/src/molecule3d/core/file.ts +23 -0
- package/src/molecule3d/core/index.ts +3 -1
- package/src/molecule3d/core/settings.ts +0 -8
- package/src/molecule3d/ui/Molecule3DExport.tsx +43 -5
- package/src/molecule3d/ui/Molecule3DToolbar.tsx +9 -2
- package/src/molecule3d/ui/MoleculeCanvas3D.tsx +24 -38
- package/src/molecule3d/ui/drawScene.ts +2 -1
- package/src/molecule3d/ui/exportMoleculeImage.ts +28 -3
- package/src/molecule3d/ui/moleculeFrames.ts +88 -0
- package/src/molecule3d/ui/moleculeViewer3DProps.ts +14 -5
- package/src/molecule3d/ui/renderMolecule.ts +5 -3
- package/src/molecule3d/ui/sceneDrawer.ts +14 -2
- package/src/molecule3d/ui/useImageExport.ts +22 -5
- package/src/molecule3d/ui/useMoleculeScene.ts +2 -1
- package/src/molecule3d/ui/useMoleculeViewer.ts +46 -0
- package/src/molecule3d/ui/usePolarSurfaceArea.ts +6 -4
- package/src/molecule3d/ui/viewer.ts +34 -27
- package/src/molecule3d/ui/viewerTypes.ts +6 -0
- package/src/molstar/core/captureScene.ts +85 -2
- package/src/molstar/core/index.ts +13 -2
- package/src/molstar/core/trajectory.ts +117 -0
- package/src/panel/ui/PanelRail.tsx +3 -0
- package/src/raman.ts +20 -0
- package/src/router/core/basePath.ts +2 -2
- package/src/router/core/siteAddresses.ts +1 -1
- package/src/seo/core/siteFiles.ts +1 -1
- package/src/server/answerAddresses.ts +3 -3
- package/src/structure/core/index.ts +8 -0
- package/src/structure/core/structureTransfer.ts +37 -0
- package/src/structure/ui/EditorImportButton.tsx +59 -0
- package/src/structure/ui/EditorImportProblem.tsx +63 -0
- package/src/structure/ui/StructureDrop.tsx +66 -0
- package/src/structure/ui/StructureDropOverlay.tsx +50 -0
- package/src/structure/ui/StructureEditor.tsx +49 -134
- package/src/structure/ui/importedStructure.ts +83 -0
- package/src/structure/ui/index.ts +2 -0
- package/src/structure/ui/structureEditorProps.ts +103 -0
- package/src/structure/ui/useDebouncedChange.ts +41 -0
- package/src/structure/ui/useStructureDrop.ts +76 -0
- package/src/structure/ui/useStructureImport.ts +122 -0
package/src/ir/core/irState.ts
CHANGED
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
* a stale band is then impossible rather than merely unlikely.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import type { IrSidePanelId } from './irSidePanels.ts';
|
|
16
|
+
import type { IrPanelId, IrSidePanelId } from './irSidePanels.ts';
|
|
17
17
|
import type { IrDomain, IrMode, IrSpectrum } from './irSpectrum.ts';
|
|
18
|
+
import type { IrTechnique } from './irTechnique.ts';
|
|
19
|
+
import { defaultIrMode, irModeFor, offersIrMode } from './irTechnique.ts';
|
|
18
20
|
import type { PickBandsOptions } from './pickBands.ts';
|
|
19
21
|
|
|
20
22
|
/** The document: what a file holds. */
|
|
@@ -40,15 +42,23 @@ export interface IrView {
|
|
|
40
42
|
domain: IrDomain | null;
|
|
41
43
|
/** Which tool a drag across the chart is running. */
|
|
42
44
|
tool: IrTool;
|
|
43
|
-
/**
|
|
44
|
-
|
|
45
|
+
/**
|
|
46
|
+
* The side panels that are open: the viewer's own and any a host added. An id
|
|
47
|
+
* no panel on offer answers to opens nothing.
|
|
48
|
+
*/
|
|
49
|
+
openPanelIds: IrPanelId[];
|
|
45
50
|
/** Why the last action was refused, `null` as soon as one succeeds. */
|
|
46
51
|
error: string | null;
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
/** The workspace: how every spectrum is drawn, whichever ones are open. */
|
|
50
55
|
export interface IrSettings {
|
|
51
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* What the spectra were measured with. Chosen when the viewer opens and fixed
|
|
58
|
+
* from then on: a change asking for another is ignored.
|
|
59
|
+
*/
|
|
60
|
+
technique: IrTechnique;
|
|
61
|
+
/** Which value axis the spectra are read in, always one the technique offers. */
|
|
52
62
|
mode: IrMode;
|
|
53
63
|
/** Whether the bands are picked at all. */
|
|
54
64
|
pickBands: boolean;
|
|
@@ -108,6 +118,7 @@ export const DEFAULT_PICKING: PickBandsOptions = {
|
|
|
108
118
|
|
|
109
119
|
/** The workspace a fresh viewer starts from. */
|
|
110
120
|
export const DEFAULT_SETTINGS: IrSettings = {
|
|
121
|
+
technique: 'infrared',
|
|
111
122
|
mode: 'transmittance',
|
|
112
123
|
pickBands: true,
|
|
113
124
|
picking: DEFAULT_PICKING,
|
|
@@ -116,6 +127,57 @@ export const DEFAULT_SETTINGS: IrSettings = {
|
|
|
116
127
|
assignmentTolerance: 5,
|
|
117
128
|
};
|
|
118
129
|
|
|
130
|
+
/** What a viewer opens on. */
|
|
131
|
+
export interface CreateIrStateOptions {
|
|
132
|
+
/**
|
|
133
|
+
* The spectra to open on.
|
|
134
|
+
* @default []
|
|
135
|
+
*/
|
|
136
|
+
spectra?: IrSpectrum[];
|
|
137
|
+
/**
|
|
138
|
+
* The workspace to open in. Its `technique` is fixed for the life of the
|
|
139
|
+
* viewer, and its `mode` falls back to the technique's first when the
|
|
140
|
+
* technique does not offer it.
|
|
141
|
+
* @default DEFAULT_SETTINGS
|
|
142
|
+
*/
|
|
143
|
+
settings?: Partial<IrSettings>;
|
|
144
|
+
/**
|
|
145
|
+
* The panels open to begin with, the viewer's own or a host's.
|
|
146
|
+
* @default DEFAULT_SIDE_PANELS
|
|
147
|
+
*/
|
|
148
|
+
panelIds?: readonly IrPanelId[];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The state a viewer opens with.
|
|
153
|
+
*
|
|
154
|
+
* The panel list is spread rather than stored by reference: a caller's array is
|
|
155
|
+
* the caller's to mutate, and a viewer holding it would find its open panels
|
|
156
|
+
* changing under it.
|
|
157
|
+
* @param options - What it opens on.
|
|
158
|
+
* @returns The state.
|
|
159
|
+
*/
|
|
160
|
+
export function createIrState(options: CreateIrStateOptions = {}): IrState {
|
|
161
|
+
const { spectra = [], settings, panelIds } = options;
|
|
162
|
+
const technique = settings?.technique ?? DEFAULT_SETTINGS.technique;
|
|
163
|
+
const opened: IrSettings = {
|
|
164
|
+
...DEFAULT_SETTINGS,
|
|
165
|
+
technique,
|
|
166
|
+
mode: defaultIrMode(technique),
|
|
167
|
+
};
|
|
168
|
+
return {
|
|
169
|
+
data: { spectra: [...spectra] },
|
|
170
|
+
view: {
|
|
171
|
+
selectedId: spectra[0]?.id ?? null,
|
|
172
|
+
domain: null,
|
|
173
|
+
tool: 'read',
|
|
174
|
+
openPanelIds: [...(panelIds ?? DEFAULT_SIDE_PANELS)],
|
|
175
|
+
error: null,
|
|
176
|
+
},
|
|
177
|
+
settings: mergeIrSettings(opened, settings),
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
119
181
|
/**
|
|
120
182
|
* Fold a change into the workspace, refusing what no chart survives.
|
|
121
183
|
*
|
|
@@ -123,7 +185,9 @@ export const DEFAULT_SETTINGS: IrSettings = {
|
|
|
123
185
|
* not yet a number — a lone minus sign, an empty box — and a limit of `NaN`
|
|
124
186
|
* silently stops every label being drawn. So each is checked, and the current
|
|
125
187
|
* value is kept where the new one is unusable rather than the field being
|
|
126
|
-
* fought with while it is being typed in.
|
|
188
|
+
* fought with while it is being typed in. The technique is never changed, and a
|
|
189
|
+
* mode it does not offer is refused the same way: a Raman spectrum has no
|
|
190
|
+
* absorbance to draw.
|
|
127
191
|
* @param current - The workspace in force.
|
|
128
192
|
* @param change - What to change about it.
|
|
129
193
|
* @returns The new workspace.
|
|
@@ -137,6 +201,10 @@ export function mergeIrSettings(
|
|
|
137
201
|
return {
|
|
138
202
|
...current,
|
|
139
203
|
...change,
|
|
204
|
+
technique: current.technique,
|
|
205
|
+
mode: offersIrMode(current.technique, change.mode)
|
|
206
|
+
? change.mode
|
|
207
|
+
: irModeFor(current.technique, current.mode),
|
|
140
208
|
picking: { ...current.picking, ...change.picking },
|
|
141
209
|
labelLimit: Number.isFinite(asked)
|
|
142
210
|
? Math.min(MAXIMUM_LABEL_LIMIT, Math.max(0, Math.round(asked)))
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything that differs between an infrared spectrum and a Raman one.
|
|
3
|
+
*
|
|
4
|
+
* Both are vibrational spectra over wavenumbers in cm⁻¹, and the viewer reads
|
|
5
|
+
* them the same way — one chart, one set of panels, one set of gestures — so
|
|
6
|
+
* what is left to differ is a handful of facts: which value axes a spectrum is
|
|
7
|
+
* read on, what the horizontal axis is called and which way it runs, whether the
|
|
8
|
+
* correlation table has anything to say about a band, and what a written file
|
|
9
|
+
* calls itself. They are gathered here for the reason `IR_MODE_RULES` gathers
|
|
10
|
+
* what differs between the value axes: a component that asked which technique
|
|
11
|
+
* it was drawing would be the first of many to ask, and they would come to
|
|
12
|
+
* disagree.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type { IrMode } from './irSpectrum.ts';
|
|
16
|
+
|
|
17
|
+
/** What was measured: the light a sample absorbs, or the light it scatters. */
|
|
18
|
+
export type IrTechnique = 'infrared' | 'raman';
|
|
19
|
+
|
|
20
|
+
/** What is true of one technique. */
|
|
21
|
+
export interface IrTechniqueRules {
|
|
22
|
+
/** How it is written inside a sentence; a sentence opening on it capitalises it. */
|
|
23
|
+
name: string;
|
|
24
|
+
/** The value axes a spectrum is read on, in the order a control offers them. */
|
|
25
|
+
modes: readonly IrMode[];
|
|
26
|
+
/** What the horizontal axis is called. */
|
|
27
|
+
xTitle: string;
|
|
28
|
+
/** Whether the horizontal axis runs from high at the left to low at the right. */
|
|
29
|
+
reverseX: boolean;
|
|
30
|
+
/** Whether the correlation table is asked what a band might be. */
|
|
31
|
+
assignments: boolean;
|
|
32
|
+
/** The `##DATA TYPE=` a written spectrum states when its file stated none. */
|
|
33
|
+
dataType: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The techniques, in the order a control would offer them. */
|
|
37
|
+
export const IR_TECHNIQUES: readonly IrTechnique[] = ['infrared', 'raman'];
|
|
38
|
+
|
|
39
|
+
/** How each technique behaves, every fact in one place. */
|
|
40
|
+
export const IR_TECHNIQUE_RULES = {
|
|
41
|
+
infrared: {
|
|
42
|
+
name: 'infrared',
|
|
43
|
+
modes: ['transmittance', 'absorbance'],
|
|
44
|
+
xTitle: 'wavenumber (cm⁻¹)',
|
|
45
|
+
/**
|
|
46
|
+
* 4000 at the left and 400 at the right, which is how every infrared
|
|
47
|
+
* spectrum has been printed since the instruments scanned that way.
|
|
48
|
+
*/
|
|
49
|
+
reverseX: true,
|
|
50
|
+
assignments: true,
|
|
51
|
+
dataType: 'INFRARED SPECTRUM',
|
|
52
|
+
},
|
|
53
|
+
raman: {
|
|
54
|
+
name: 'Raman',
|
|
55
|
+
/** One axis: a Raman spectrum is the light scattered, and nothing else. */
|
|
56
|
+
modes: ['intensity'],
|
|
57
|
+
xTitle: 'Raman shift (cm⁻¹)',
|
|
58
|
+
/** The shift grows away from the laser line, left to right. */
|
|
59
|
+
reverseX: false,
|
|
60
|
+
/**
|
|
61
|
+
* The table holds infrared group frequencies and infrared strengths. A
|
|
62
|
+
* vibration strong in one technique is often weak or silent in the other,
|
|
63
|
+
* so its candidates offered for a Raman band would claim what the table
|
|
64
|
+
* does not know.
|
|
65
|
+
*/
|
|
66
|
+
assignments: false,
|
|
67
|
+
dataType: 'RAMAN SPECTRUM',
|
|
68
|
+
},
|
|
69
|
+
} as const satisfies Record<IrTechnique, IrTechniqueRules>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The value axis a viewer of a technique opens on.
|
|
73
|
+
* @param technique - What was measured.
|
|
74
|
+
* @returns Its first mode.
|
|
75
|
+
*/
|
|
76
|
+
export function defaultIrMode(technique: IrTechnique): IrMode {
|
|
77
|
+
return IR_TECHNIQUE_RULES[technique].modes[0];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Whether a technique reads its spectra on a value axis.
|
|
82
|
+
* @param technique - What was measured.
|
|
83
|
+
* @param mode - The axis asked about; `undefined` is offered by none.
|
|
84
|
+
* @returns Whether the technique offers it.
|
|
85
|
+
*/
|
|
86
|
+
export function offersIrMode(
|
|
87
|
+
technique: IrTechnique,
|
|
88
|
+
mode: IrMode | undefined,
|
|
89
|
+
): mode is IrMode {
|
|
90
|
+
if (mode === undefined) return false;
|
|
91
|
+
const modes: readonly IrMode[] = IR_TECHNIQUE_RULES[technique].modes;
|
|
92
|
+
return modes.includes(mode);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The value axis to read a technique's spectra on, given the one asked for.
|
|
97
|
+
* @param technique - What was measured.
|
|
98
|
+
* @param mode - The axis asked for, if any.
|
|
99
|
+
* @returns It when the technique offers it, the technique's first otherwise.
|
|
100
|
+
*/
|
|
101
|
+
export function irModeFor(technique: IrTechnique, mode?: IrMode): IrMode {
|
|
102
|
+
return offersIrMode(technique, mode) ? mode : defaultIrMode(technique);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The technique that reads its spectra on a value axis.
|
|
107
|
+
*
|
|
108
|
+
* Every axis belongs to exactly one technique, so the axis a file was written
|
|
109
|
+
* on says what was measured.
|
|
110
|
+
* @param mode - The value axis.
|
|
111
|
+
* @returns The technique offering it.
|
|
112
|
+
*/
|
|
113
|
+
export function irModeTechnique(mode: IrMode): IrTechnique {
|
|
114
|
+
return offersIrMode('raman', mode) ? 'raman' : 'infrared';
|
|
115
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The commands each technique's viewer offers.
|
|
3
|
+
*
|
|
4
|
+
* A Raman viewer offers the infrared table less the commands with nothing to
|
|
5
|
+
* act on — one value axis is nothing to toggle, and no assignment is nothing to
|
|
6
|
+
* name — and words the rest without the absorbance and transmittance it does
|
|
7
|
+
* not have. It is built from the infrared table, so a command added there
|
|
8
|
+
* reaches both.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { IrCommand, IrCommandId, IrCommandTable } from './irCommands.ts';
|
|
12
|
+
import { irCommands } from './irCommands.ts';
|
|
13
|
+
import type { IrTechnique } from './irTechnique.ts';
|
|
14
|
+
import { IR_TECHNIQUE_RULES } from './irTechnique.ts';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Whether a viewer of a technique offers a command at all.
|
|
18
|
+
* @param technique - What was measured.
|
|
19
|
+
* @param id - Which command.
|
|
20
|
+
* @returns False for the toggle of a technique with one value axis, and for
|
|
21
|
+
* the assignments of one the correlation table says nothing about.
|
|
22
|
+
*/
|
|
23
|
+
export function irCommandOffered(
|
|
24
|
+
technique: IrTechnique,
|
|
25
|
+
id: IrCommandId,
|
|
26
|
+
): boolean {
|
|
27
|
+
const { modes, assignments } = IR_TECHNIQUE_RULES[technique];
|
|
28
|
+
if (id === 'toggleMode') return modes.length > 1;
|
|
29
|
+
if (id === 'toggleAssignments') return assignments;
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Everything a viewer of a technique offers, in the order it is reached for.
|
|
35
|
+
* @param technique - What was measured.
|
|
36
|
+
* @returns The table; for infrared, `irCommands` itself.
|
|
37
|
+
*/
|
|
38
|
+
export function irCommandsFor(technique: IrTechnique): IrCommandTable {
|
|
39
|
+
return COMMAND_TABLES[technique];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Where the chart is, for a gesture made anywhere on it. */
|
|
43
|
+
const OVER_THE_CHART = 'Over the chart';
|
|
44
|
+
|
|
45
|
+
/** How a Raman viewer words the commands it shares with infrared. */
|
|
46
|
+
const RAMAN_WORDING: Partial<Record<IrCommandId, Partial<IrCommand>>> = {
|
|
47
|
+
about: { title: 'About the Raman viewer' },
|
|
48
|
+
documentation: {
|
|
49
|
+
description: 'How the bands are read, and every gesture.',
|
|
50
|
+
},
|
|
51
|
+
readTool: {
|
|
52
|
+
description:
|
|
53
|
+
'A drag narrows the Raman shift axis. Released past the baseline, it takes the intensity axis with it.',
|
|
54
|
+
gestures: [{ title: OVER_THE_CHART, shortcuts: ['Drag'] }],
|
|
55
|
+
},
|
|
56
|
+
boxTool: {
|
|
57
|
+
description:
|
|
58
|
+
'A drag zooms to exactly the rectangle it sweeps out, both axes at once — for looking into a baseline or a shoulder rather than across the spectrum.',
|
|
59
|
+
},
|
|
60
|
+
zoomIn: {
|
|
61
|
+
description:
|
|
62
|
+
'Brings the weak bands up, scaling the intensity axis about zero.',
|
|
63
|
+
gestures: [{ title: OVER_THE_CHART, shortcuts: ['Scroll wheel'] }],
|
|
64
|
+
},
|
|
65
|
+
zoomOut: {
|
|
66
|
+
gestures: [{ title: OVER_THE_CHART, shortcuts: ['Scroll wheel'] }],
|
|
67
|
+
},
|
|
68
|
+
togglePicking: {
|
|
69
|
+
description:
|
|
70
|
+
'Finds the bands of the selected spectrum, marks them on the chart and lists them.',
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** The command table of each technique. */
|
|
75
|
+
const COMMAND_TABLES: Record<IrTechnique, IrCommandTable> = {
|
|
76
|
+
infrared: irCommands,
|
|
77
|
+
raman: Object.fromEntries(
|
|
78
|
+
(Object.keys(irCommands) as IrCommandId[])
|
|
79
|
+
.filter((id) => irCommandOffered('raman', id))
|
|
80
|
+
.map((id) => [id, { ...irCommands[id], ...RAMAN_WORDING[id] }]),
|
|
81
|
+
),
|
|
82
|
+
};
|
package/src/ir/core/pickBands.ts
CHANGED
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Everything here is the two things that call needs and does not have: a
|
|
5
5
|
* `MeasurementXY` built out of the arrays the viewer holds, and the decision to
|
|
6
|
-
* pick on **absorbance** rather than on transmittance. That
|
|
7
|
-
* only judgement in the file and it is not a preference — peak
|
|
8
|
-
* maxima, and a band is a maximum in absorbance but a *minimum* in
|
|
9
|
-
* so picking on transmittance would return the flat baseline
|
|
10
|
-
* and miss every band there is.
|
|
6
|
+
* pick an infrared spectrum on **absorbance** rather than on transmittance. That
|
|
7
|
+
* second one is the only judgement in the file and it is not a preference — peak
|
|
8
|
+
* picking finds maxima, and a band is a maximum in absorbance but a *minimum* in
|
|
9
|
+
* transmittance, so picking on transmittance would return the flat baseline
|
|
10
|
+
* between the bands and miss every band there is. A Raman spectrum is picked on
|
|
11
|
+
* its intensity, by `ramanBands`, with the same picker.
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
import type { MeasurementXY } from 'cheminfo-types';
|
|
@@ -15,7 +16,10 @@ import { autoPeakPicking } from 'ir-spectrum';
|
|
|
15
16
|
import { xMaxValue, xMinValue } from 'ml-spectra-processing';
|
|
16
17
|
|
|
17
18
|
import type { IrBand, IrBandStrength } from './irBand.ts';
|
|
19
|
+
import { bandHeight } from './irBand.ts';
|
|
18
20
|
import type { IrSpectrum } from './irSpectrum.ts';
|
|
21
|
+
import type { PeakPickingOptions } from './ramanBands.ts';
|
|
22
|
+
import { ramanBands } from './ramanBands.ts';
|
|
19
23
|
|
|
20
24
|
/** How the bands are picked. */
|
|
21
25
|
export interface PickBandsOptions {
|
|
@@ -86,20 +90,50 @@ export function pickBands(
|
|
|
86
90
|
} = options;
|
|
87
91
|
if (spectrum.wavenumber.length < 2) return [];
|
|
88
92
|
|
|
89
|
-
const
|
|
90
|
-
// Absorbance, because a band is a maximum there and a minimum in the other.
|
|
91
|
-
yVariable: 'a',
|
|
93
|
+
const picking: PeakPickingOptions = {
|
|
92
94
|
minMaxRatio: minRelativeHeight,
|
|
93
95
|
minPeakWidth,
|
|
94
96
|
...(from === undefined ? {} : { from }),
|
|
95
97
|
...(to === undefined ? {} : { to }),
|
|
96
|
-
}
|
|
98
|
+
};
|
|
99
|
+
// A spectrum carrying an intensity is a Raman one; any other is infrared.
|
|
100
|
+
const bands =
|
|
101
|
+
spectrum.intensity === undefined
|
|
102
|
+
? infraredBands(spectrum, picking)
|
|
103
|
+
: ramanBands(spectrum, spectrum.intensity, picking);
|
|
104
|
+
|
|
105
|
+
const kept =
|
|
106
|
+
limit === undefined || bands.length <= limit
|
|
107
|
+
? bands
|
|
108
|
+
: bands.toSorted(byDescendingHeight).slice(0, limit);
|
|
109
|
+
return kept.toSorted(byAscendingWavenumber);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The bands of an infrared spectrum, picked on its absorbance.
|
|
114
|
+
* @param spectrum - The spectrum to pick from.
|
|
115
|
+
* @param picking - Where to pick, and how finely.
|
|
116
|
+
* @returns The bands, in the order they were found; none when the spectrum
|
|
117
|
+
* carries only one of its two axes, since the strength is read off the other.
|
|
118
|
+
*/
|
|
119
|
+
function infraredBands(
|
|
120
|
+
spectrum: IrSpectrum,
|
|
121
|
+
picking: PeakPickingOptions,
|
|
122
|
+
): IrBand[] {
|
|
123
|
+
const { id, wavenumber, absorbance, transmittance } = spectrum;
|
|
124
|
+
if (absorbance === undefined || transmittance === undefined) return [];
|
|
125
|
+
|
|
126
|
+
const picked = autoPeakPicking(
|
|
127
|
+
measurementOf(wavenumber, absorbance, transmittance),
|
|
128
|
+
// Absorbance, because a band is a maximum there and a minimum in the other.
|
|
129
|
+
{ yVariable: 'a', ...picking },
|
|
130
|
+
);
|
|
97
131
|
|
|
98
132
|
const bands: IrBand[] = [];
|
|
99
133
|
for (const peak of picked) {
|
|
100
134
|
if (!Number.isFinite(peak.wavenumber)) continue;
|
|
101
135
|
bands.push({
|
|
102
|
-
spectrumId:
|
|
136
|
+
spectrumId: id,
|
|
103
137
|
wavenumber: peak.wavenumber,
|
|
104
138
|
absorbance: peak.absorbance,
|
|
105
139
|
// `ConvertedPeak.transmittance` is a fraction where the spectrum's own
|
|
@@ -109,12 +143,7 @@ export function pickBands(
|
|
|
109
143
|
strength: peak.kind as IrBandStrength,
|
|
110
144
|
});
|
|
111
145
|
}
|
|
112
|
-
|
|
113
|
-
const kept =
|
|
114
|
-
limit === undefined || bands.length <= limit
|
|
115
|
-
? bands
|
|
116
|
-
: bands.toSorted(byDescendingAbsorbance).slice(0, limit);
|
|
117
|
-
return kept.toSorted(byAscendingWavenumber);
|
|
146
|
+
return bands;
|
|
118
147
|
}
|
|
119
148
|
|
|
120
149
|
/**
|
|
@@ -124,17 +153,23 @@ export function pickBands(
|
|
|
124
153
|
* letter is worked out from: without them the conversion assumes a spectrum
|
|
125
154
|
* running the full 0 to 100 percent, and every band of a shallow ATR trace that
|
|
126
155
|
* never leaves the eighties comes back weak.
|
|
127
|
-
* @param
|
|
156
|
+
* @param wavenumber - The wavenumbers, ascending.
|
|
157
|
+
* @param absorbance - Absorbance at each.
|
|
158
|
+
* @param transmittance - Percent transmittance at each.
|
|
128
159
|
* @returns A measurement carrying all three variables.
|
|
129
160
|
*/
|
|
130
|
-
function measurementOf(
|
|
131
|
-
|
|
161
|
+
function measurementOf(
|
|
162
|
+
wavenumber: Float64Array,
|
|
163
|
+
absorbance: Float64Array,
|
|
164
|
+
transmittance: Float64Array,
|
|
165
|
+
): MeasurementXY {
|
|
166
|
+
const percent = {
|
|
132
167
|
label: 'Transmittance (%)',
|
|
133
168
|
units: '%',
|
|
134
169
|
symbol: 't' as const,
|
|
135
|
-
data:
|
|
136
|
-
min: xMinValue(
|
|
137
|
-
max: xMaxValue(
|
|
170
|
+
data: transmittance,
|
|
171
|
+
min: xMinValue(transmittance),
|
|
172
|
+
max: xMaxValue(transmittance),
|
|
138
173
|
};
|
|
139
174
|
return {
|
|
140
175
|
variables: {
|
|
@@ -142,20 +177,20 @@ function measurementOf(spectrum: IrSpectrum): MeasurementXY {
|
|
|
142
177
|
label: 'Wavenumber',
|
|
143
178
|
units: '1/cm',
|
|
144
179
|
symbol: 'x',
|
|
145
|
-
data:
|
|
180
|
+
data: wavenumber,
|
|
146
181
|
},
|
|
147
182
|
// `y` is required of every measurement, and stands for whichever axis was
|
|
148
183
|
// recorded. Nothing here reads it — the picking is told to use `a` and the
|
|
149
184
|
// strength letter is read off `t` — so it carries the transmittance rather
|
|
150
185
|
// than a third copy of anything.
|
|
151
|
-
y:
|
|
186
|
+
y: percent,
|
|
152
187
|
a: {
|
|
153
188
|
label: 'Absorbance',
|
|
154
189
|
units: '',
|
|
155
190
|
symbol: 'a',
|
|
156
|
-
data:
|
|
191
|
+
data: absorbance,
|
|
157
192
|
},
|
|
158
|
-
t:
|
|
193
|
+
t: percent,
|
|
159
194
|
},
|
|
160
195
|
};
|
|
161
196
|
}
|
|
@@ -166,8 +201,8 @@ function measurementOf(spectrum: IrSpectrum): MeasurementXY {
|
|
|
166
201
|
* @param second - The other.
|
|
167
202
|
* @returns The comparison.
|
|
168
203
|
*/
|
|
169
|
-
function
|
|
170
|
-
return second
|
|
204
|
+
function byDescendingHeight(first: IrBand, second: IrBand): number {
|
|
205
|
+
return bandHeight(second) - bandHeight(first);
|
|
171
206
|
}
|
|
172
207
|
|
|
173
208
|
/**
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding the bands of a Raman spectrum, with the picker infrared bands are
|
|
3
|
+
* found with.
|
|
4
|
+
*
|
|
5
|
+
* `autoPeakPicking` from `ir-spectrum` is `common-spectrum`'s, which runs
|
|
6
|
+
* `ml-gsd` over whichever variable it is pointed at — the picker
|
|
7
|
+
* `raman-spectrum` itself exports — and converts each peak to absorbance and
|
|
8
|
+
* transmittance on top. A Raman band is a maximum of intensity, so the picker is
|
|
9
|
+
* pointed at the intensity and only where each peak sits is read back: the
|
|
10
|
+
* conversion speaks two axes a Raman spectrum does not have.
|
|
11
|
+
*
|
|
12
|
+
* The strength letter follows the rule `ir-spectrum` applies to transmittance,
|
|
13
|
+
* applied to intensity: where the band's top sits between the spectrum's own
|
|
14
|
+
* lowest and highest intensity — below a third weak, below two thirds medium,
|
|
15
|
+
* strong above.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type { MeasurementXY } from 'cheminfo-types';
|
|
19
|
+
import { autoPeakPicking } from 'ir-spectrum';
|
|
20
|
+
import { xFindClosestIndex, xMinMaxValues } from 'ml-spectra-processing';
|
|
21
|
+
|
|
22
|
+
import type { IrBand, IrBandStrength } from './irBand.ts';
|
|
23
|
+
import type { IrSpectrum } from './irSpectrum.ts';
|
|
24
|
+
|
|
25
|
+
/** What the picker is asked, whichever technique it picks for. */
|
|
26
|
+
export type PeakPickingOptions = NonNullable<
|
|
27
|
+
Parameters<typeof autoPeakPicking>[1]
|
|
28
|
+
>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The bands of a Raman spectrum, picked on its intensity.
|
|
32
|
+
* @param spectrum - The spectrum to pick from.
|
|
33
|
+
* @param intensity - Its intensity, which the bands are maxima of.
|
|
34
|
+
* @param picking - Where to pick, and how finely.
|
|
35
|
+
* @returns The bands, in the order they were found.
|
|
36
|
+
*/
|
|
37
|
+
export function ramanBands(
|
|
38
|
+
spectrum: IrSpectrum,
|
|
39
|
+
intensity: Float64Array,
|
|
40
|
+
picking: PeakPickingOptions,
|
|
41
|
+
): IrBand[] {
|
|
42
|
+
const { id, wavenumber } = spectrum;
|
|
43
|
+
const picked = autoPeakPicking(measurementOf(wavenumber, intensity), {
|
|
44
|
+
...picking,
|
|
45
|
+
yVariable: 'y',
|
|
46
|
+
});
|
|
47
|
+
const { min, max } = xMinMaxValues(intensity);
|
|
48
|
+
|
|
49
|
+
const bands: IrBand[] = [];
|
|
50
|
+
for (const peak of picked) {
|
|
51
|
+
if (!Number.isFinite(peak.wavenumber)) continue;
|
|
52
|
+
// The peak sits on a sample, so its intensity is read off that sample.
|
|
53
|
+
const value = intensity[xFindClosestIndex(wavenumber, peak.wavenumber)];
|
|
54
|
+
if (value === undefined) continue;
|
|
55
|
+
bands.push({
|
|
56
|
+
spectrumId: id,
|
|
57
|
+
wavenumber: peak.wavenumber,
|
|
58
|
+
intensity: value,
|
|
59
|
+
strength: strengthOf(value, min, max),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return bands;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* How strong a band is, from where its top sits in the spectrum's range.
|
|
67
|
+
* @param value - The band's intensity.
|
|
68
|
+
* @param lowest - The spectrum's lowest intensity.
|
|
69
|
+
* @param highest - Its highest.
|
|
70
|
+
* @returns The letter a correlation table would use.
|
|
71
|
+
*/
|
|
72
|
+
function strengthOf(
|
|
73
|
+
value: number,
|
|
74
|
+
lowest: number,
|
|
75
|
+
highest: number,
|
|
76
|
+
): IrBandStrength {
|
|
77
|
+
const position = (value - lowest) / (highest - lowest);
|
|
78
|
+
if (position < WEAK_BELOW) return 'w';
|
|
79
|
+
if (position < MEDIUM_BELOW) return 'm';
|
|
80
|
+
return 'S';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Below this fraction of the spectrum's range a band is weak. */
|
|
84
|
+
const WEAK_BELOW = 0.33;
|
|
85
|
+
|
|
86
|
+
/** Below this one it is medium, and strong from here up. */
|
|
87
|
+
const MEDIUM_BELOW = 0.66;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The spectrum as `ir-spectrum` wants it: the shifts, and the intensity as `y`.
|
|
91
|
+
* @param shift - The Raman shifts, ascending.
|
|
92
|
+
* @param intensity - The intensity at each.
|
|
93
|
+
* @returns The measurement.
|
|
94
|
+
*/
|
|
95
|
+
function measurementOf(
|
|
96
|
+
shift: Float64Array,
|
|
97
|
+
intensity: Float64Array,
|
|
98
|
+
): MeasurementXY {
|
|
99
|
+
return {
|
|
100
|
+
variables: {
|
|
101
|
+
x: { label: 'Raman shift', units: '1/cm', symbol: 'x', data: shift },
|
|
102
|
+
y: { label: 'Intensity', units: '', symbol: 'y', data: intensity },
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|