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
|
@@ -12,6 +12,7 @@ import { chartPixel } from "../../chart/core/chartScale.js";
|
|
|
12
12
|
import { PEAK_LABEL } from "../../chart/core/chartTheme.js";
|
|
13
13
|
import { labelStackBaselines } from "../../chart/core/labelStack.js";
|
|
14
14
|
import { bandLabel } from "./assignBands.js";
|
|
15
|
+
import { bandHeight, bandValue } from "./irBand.js";
|
|
15
16
|
import { formatWavenumber } from "./irFormat.js";
|
|
16
17
|
import { bandsPointDown } from "./irMode.js";
|
|
17
18
|
/**
|
|
@@ -34,30 +35,34 @@ export function planBandLabels(options) {
|
|
|
34
35
|
const { assigned, plot, xScale, yScale, mode, showAssignments = false, limit = 12, } = options;
|
|
35
36
|
const inside = [];
|
|
36
37
|
for (const entry of assigned) {
|
|
38
|
+
// A band with no value on the axis being read has no tip to hang from.
|
|
39
|
+
const value = bandValue(entry.band, mode);
|
|
40
|
+
if (value === undefined)
|
|
41
|
+
continue;
|
|
37
42
|
const pixelX = chartPixel(xScale, entry.band.wavenumber);
|
|
38
43
|
if (!Number.isFinite(pixelX))
|
|
39
44
|
continue;
|
|
40
45
|
if (pixelX < plot.left || pixelX > plot.right)
|
|
41
46
|
continue;
|
|
42
|
-
inside.push(entry);
|
|
47
|
+
inside.push({ entry, value });
|
|
43
48
|
}
|
|
44
49
|
const named = inside.length <= limit
|
|
45
50
|
? inside
|
|
46
51
|
: inside
|
|
47
|
-
.toSorted((first, second) => second.band
|
|
52
|
+
.toSorted((first, second) => bandHeight(second.entry.band) - bandHeight(first.entry.band))
|
|
48
53
|
.slice(0, limit)
|
|
49
|
-
.toSorted((first, second) => first.band.wavenumber - second.band.wavenumber);
|
|
54
|
+
.toSorted((first, second) => first.entry.band.wavenumber - second.entry.band.wavenumber);
|
|
50
55
|
const centres = new Float64Array(named.length);
|
|
51
56
|
for (let index = 0; index < named.length; index++) {
|
|
52
|
-
centres[index] = chartPixel(xScale, named[index].band.wavenumber);
|
|
57
|
+
centres[index] = chartPixel(xScale, named[index].entry.band.wavenumber);
|
|
53
58
|
}
|
|
54
59
|
const placed = layoutAnnotationBoxes(centres, [plot.left, plot.right], LABEL_WIDTH, LABEL_GAP);
|
|
55
60
|
const down = bandsPointDown(mode);
|
|
56
61
|
const plans = new Array(named.length);
|
|
57
62
|
for (let index = 0; index < named.length; index++) {
|
|
58
|
-
const entry = named[index];
|
|
63
|
+
const { entry, value } = named[index];
|
|
59
64
|
const lines = labelLines(entry, showAssignments);
|
|
60
|
-
const tipY = chartPixel(yScale,
|
|
65
|
+
const tipY = chartPixel(yScale, value);
|
|
61
66
|
plans[index] = {
|
|
62
67
|
band: entry.band,
|
|
63
68
|
tipX: centres[index],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bandLabelPlan.js","sourceRoot":"","sources":["../../../src/ir/core/bandLabelPlan.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAqD7C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,cAAc,CAAC,OAA6B;IAC1D,MAAM,EACJ,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,eAAe,GAAG,KAAK,EACvB,KAAK,GAAG,EAAE,GACX,GAAG,OAAO,CAAC;IAEZ,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"bandLabelPlan.js","sourceRoot":"","sources":["../../../src/ir/core/bandLabelPlan.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAqD7C;;;;;;;;;;;;;;;GAeG;AACH,M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,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAUD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAE9B,4DAA4D;AAC5D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC;AAE3B,kEAAkE;AAClE,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,CAAC;AAE5C;;;;;GAKG;AACH,SAAS,UAAU,CAAC,KAAmB,EAAE,eAAwB;IAC/D,MAAM,KAAK,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACxD,IAAI,CAAC,eAAe;QAAE,OAAO,KAAK,CAAC;IACnC,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,yEAAyE;IACzE,qDAAqD;IACrD,IAAI,KAAK,KAAK,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/lib/ir/core/index.d.ts
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
* transmittance and a band points the other way in each, and that a wavenumber
|
|
11
11
|
* maps to a range of vibrations rather than to one. Nothing here knows what a
|
|
12
12
|
* glycan is, and nothing should: an infrared spectrum answers for whatever was
|
|
13
|
-
* put in the beam.
|
|
13
|
+
* put in the beam. A Raman spectrum is the one other technique held, and what
|
|
14
|
+
* differs for it is in `IR_TECHNIQUE_RULES`.
|
|
14
15
|
*/
|
|
15
16
|
export type { LoadedIrSpectrum } from './analysisSpectra.ts';
|
|
16
17
|
export { analysisSpectra } from './analysisSpectra.ts';
|
|
@@ -25,19 +26,22 @@ export { downloadIrSpectra, downloadIrSpectrum } from './downloadSpectra.ts';
|
|
|
25
26
|
export type { IrJcampReadOptions } from './fromJcamp.ts';
|
|
26
27
|
export type { IrSpcReadOptions } from './fromSpc.ts';
|
|
27
28
|
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';
|
|
29
|
+
export { bandHeight, bandValue, sameIrBand } from './irBand.ts';
|
|
30
|
+
export type { IrCommand, IrCommandHandlers, IrCommandId, IrCommandTable, IrGesture, IrShortcut, RunIrCommand, } from './irCommands.ts';
|
|
31
|
+
export { irCommandEntryLabel, irCommandLabel, irCommands, } from './irCommands.ts';
|
|
32
|
+
export { irCommandOffered, irCommandsFor } from './irTechniqueCommands.ts';
|
|
31
33
|
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 type { IrEditorHandle, IrPlotClick, ZoomToBandOptions, } from './irEditorApi.ts';
|
|
35
|
+
export { ABSORBANCE_DECIMALS, INTENSITY_DIGITS, TRANSMITTANCE_DECIMALS, formatIrValue, formatWavenumber, formatWavenumberRange, shortModeLabel, } from './irFormat.ts';
|
|
34
36
|
export { IR_MODES, IR_MODE_RULES, bandsPointDown, boxZoomOnly, otherIrMode, yAxisRules, yAxisTitle, zoomGestures, } from './irMode.ts';
|
|
35
|
-
export type {
|
|
36
|
-
export {
|
|
37
|
+
export type { IrAction } from './irReducer.ts';
|
|
38
|
+
export { irReducer } from './irReducer.ts';
|
|
37
39
|
export type { IrDomain, IrFormat, IrMeta, IrMetaField, IrMode, IrOrigin, IrSpectrum, IrTrace, } from './irSpectrum.ts';
|
|
38
40
|
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 { CreateIrStateOptions, IrData, IrSettings, IrState, IrTool, IrView, PartialIrState, } from './irState.ts';
|
|
42
|
+
export { DEFAULT_LABEL_LIMIT, DEFAULT_PICKING, DEFAULT_SETTINGS, DEFAULT_SIDE_PANEL, DEFAULT_SIDE_PANELS, MAXIMUM_LABEL_LIMIT, createIrState, isIrWindow, mergeIrSettings, } from './irState.ts';
|
|
43
|
+
export type { IrTechnique, IrTechniqueRules } from './irTechnique.ts';
|
|
44
|
+
export { IR_TECHNIQUES, IR_TECHNIQUE_RULES, defaultIrMode, irModeFor, irModeTechnique, offersIrMode, } from './irTechnique.ts';
|
|
41
45
|
export type { LoadIrSpectraOptions, LoadIrSpectraResult, } from './loadIrSpectra.ts';
|
|
42
46
|
export { loadIrSpectra } from './loadIrSpectra.ts';
|
|
43
47
|
export { BAND_HIT_RADIUS, nearestBandAt } from './nearestBand.ts';
|
|
@@ -46,6 +50,6 @@ export { pickBands } from './pickBands.ts';
|
|
|
46
50
|
export { DEFAULT_DATA_TYPE, JCAMP_EXTENSION, JCAMP_MIME_TYPE, irSpectraToJcamp, irSpectrumToJcamp, } from './spectrumJcamp.ts';
|
|
47
51
|
export type { ToIrSpectrumOptions } from './toIrSpectrum.ts';
|
|
48
52
|
export { toIrSpectra, toIrSpectrum } from './toIrSpectrum.ts';
|
|
49
|
-
export type { IrSidePanelId } from './irSidePanels.ts';
|
|
53
|
+
export type { IrPanelId, IrSidePanelId } from './irSidePanels.ts';
|
|
50
54
|
export { irSidePanels } from './irSidePanels.ts';
|
|
51
55
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ir/core/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ir/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACzE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,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;AAC7E,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAChE,YAAY,EACV,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,SAAS,EACT,UAAU,EACV,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAA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C5B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC9D,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/lib/ir/core/index.js
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
* transmittance and a band points the other way in each, and that a wavenumber
|
|
11
11
|
* maps to a range of vibrations rather than to one. Nothing here knows what a
|
|
12
12
|
* glycan is, and nothing should: an infrared spectrum answers for whatever was
|
|
13
|
-
* put in the beam.
|
|
13
|
+
* put in the beam. A Raman spectrum is the one other technique held, and what
|
|
14
|
+
* differs for it is in `IR_TECHNIQUE_RULES`.
|
|
14
15
|
*/
|
|
15
16
|
export { analysisSpectra } from "./analysisSpectra.js";
|
|
16
17
|
export { assignBands, bandLabel, countAssigned } from "./assignBands.js";
|
|
@@ -18,14 +19,16 @@ export { BAND_ASSIGNMENTS } from "./bandAssignments.js";
|
|
|
18
19
|
export { planBandLabels } from "./bandLabelPlan.js";
|
|
19
20
|
export { detectIrFormat } from "./detectIrFormat.js";
|
|
20
21
|
export { downloadIrSpectra, downloadIrSpectrum } from "./downloadSpectra.js";
|
|
21
|
-
export { sameIrBand } from "./irBand.js";
|
|
22
|
-
export { irCommandLabel, irCommands } from "./irCommands.js";
|
|
22
|
+
export { bandHeight, bandValue, sameIrBand } from "./irBand.js";
|
|
23
|
+
export { irCommandEntryLabel, irCommandLabel, irCommands, } from "./irCommands.js";
|
|
24
|
+
export { irCommandOffered, irCommandsFor } from "./irTechniqueCommands.js";
|
|
23
25
|
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";
|
|
26
|
+
export { ABSORBANCE_DECIMALS, INTENSITY_DIGITS, TRANSMITTANCE_DECIMALS, formatIrValue, formatWavenumber, formatWavenumberRange, shortModeLabel, } from "./irFormat.js";
|
|
25
27
|
export { IR_MODES, IR_MODE_RULES, bandsPointDown, boxZoomOnly, otherIrMode, yAxisRules, yAxisTitle, zoomGestures, } from "./irMode.js";
|
|
26
|
-
export {
|
|
28
|
+
export { irReducer } from "./irReducer.js";
|
|
27
29
|
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";
|
|
30
|
+
export { DEFAULT_LABEL_LIMIT, DEFAULT_PICKING, DEFAULT_SETTINGS, DEFAULT_SIDE_PANEL, DEFAULT_SIDE_PANELS, MAXIMUM_LABEL_LIMIT, createIrState, isIrWindow, mergeIrSettings, } from "./irState.js";
|
|
31
|
+
export { IR_TECHNIQUES, IR_TECHNIQUE_RULES, defaultIrMode, irModeFor, irModeTechnique, offersIrMode, } from "./irTechnique.js";
|
|
29
32
|
export { loadIrSpectra } from "./loadIrSpectra.js";
|
|
30
33
|
export { BAND_HIT_RADIUS, nearestBandAt } from "./nearestBand.js";
|
|
31
34
|
export { pickBands } from "./pickBands.js";
|
package/lib/ir/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ir/core/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ir/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;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,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAUhE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,UAAU,GACX,MAAM,eAAe,CAAC;AAMvB,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,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,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAW3C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAU1C,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,eAAe,EACf,YAAY,GACb,MAAM,kBAAkB,CAAC;AAK1B,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"}
|
package/lib/ir/core/irBand.d.ts
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* One band picked out of a spectrum.
|
|
3
3
|
*
|
|
4
|
-
* A band is the
|
|
5
|
-
* points at, names, and reads a functional group off.
|
|
6
|
-
* for the same reason
|
|
7
|
-
* transmittance and the one a table calls strongly
|
|
8
|
-
* making the caller convert to find out would be the
|
|
9
|
-
* does not do.
|
|
4
|
+
* A band is the vibrational analogue of a mass spectrum's peak: the thing a
|
|
5
|
+
* chemist points at, names, and reads a functional group off. An infrared band
|
|
6
|
+
* carries both value axes for the same reason its spectrum does — the band a
|
|
7
|
+
* reader sees at 30 percent transmittance and the one a table calls strongly
|
|
8
|
+
* absorbing are one band, and making the caller convert to find out would be the
|
|
9
|
+
* conversion this package does not do. A Raman band carries its intensity.
|
|
10
10
|
*/
|
|
11
|
+
import type { IrMode } from './irSpectrum.ts';
|
|
11
12
|
/**
|
|
12
13
|
* How strong a band is, in the letters a correlation table uses.
|
|
13
14
|
*
|
|
14
|
-
* `w` weak, `m` medium, `S` strong —
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* `w` weak, `m` medium, `S` strong — decided from where the band sits between
|
|
16
|
+
* the spectrum's own extremes, so the letters are relative to the spectrum in
|
|
17
|
+
* hand rather than to an absolute value. That is what a printed table means by
|
|
18
|
+
* them too. `ir-spectrum` decides it for an infrared band from its
|
|
19
|
+
* transmittance, and the same rule is applied to a Raman band's intensity.
|
|
18
20
|
*/
|
|
19
21
|
export type IrBandStrength = 'w' | 'm' | 'S';
|
|
20
22
|
/** One band picked out of one spectrum. */
|
|
@@ -23,10 +25,21 @@ export interface IrBand {
|
|
|
23
25
|
spectrumId: string;
|
|
24
26
|
/** Where it sits, in cm⁻¹. */
|
|
25
27
|
wavenumber: number;
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Its absorbance, which an infrared band is picked as a maximum of.
|
|
30
|
+
* @default undefined
|
|
31
|
+
*/
|
|
32
|
+
absorbance?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Its percent transmittance, the same infrared band read the other way up.
|
|
35
|
+
* @default undefined
|
|
36
|
+
*/
|
|
37
|
+
transmittance?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Its intensity, which a Raman band is picked as a maximum of.
|
|
40
|
+
* @default undefined
|
|
41
|
+
*/
|
|
42
|
+
intensity?: number;
|
|
30
43
|
/** How strong it is, relative to the spectrum it came from. */
|
|
31
44
|
strength: IrBandStrength;
|
|
32
45
|
}
|
|
@@ -42,4 +55,22 @@ export interface IrBand {
|
|
|
42
55
|
* @returns Whether the report can be skipped.
|
|
43
56
|
*/
|
|
44
57
|
export declare function sameIrBand(current: IrBand | null, next: IrBand | null): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* A band's value on the axis being read.
|
|
60
|
+
* @param band - The band.
|
|
61
|
+
* @param mode - Which value axis is being read.
|
|
62
|
+
* @returns The value, or `undefined` when its spectrum carries no such axis.
|
|
63
|
+
*/
|
|
64
|
+
export declare function bandValue(band: IrBand, mode: IrMode): number | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* How tall a band stands, which is what a cut to the strongest bands ranks by.
|
|
67
|
+
*
|
|
68
|
+
* The value it was picked as a maximum of: its absorbance for an infrared band,
|
|
69
|
+
* its intensity for a Raman one. Never its transmittance, in which a stronger
|
|
70
|
+
* band is a smaller number.
|
|
71
|
+
* @param band - The band.
|
|
72
|
+
* @returns The height, or negative infinity for a band carrying neither, so it
|
|
73
|
+
* ranks last.
|
|
74
|
+
*/
|
|
75
|
+
export declare function bandHeight(band: IrBand): number;
|
|
45
76
|
//# sourceMappingURL=irBand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irBand.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irBand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH
|
|
1
|
+
{"version":3,"file":"irBand.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irBand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;;;;GAQG;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;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+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;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAExE;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
package/lib/ir/core/irBand.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* One band picked out of a spectrum.
|
|
3
3
|
*
|
|
4
|
-
* A band is the
|
|
5
|
-
* points at, names, and reads a functional group off.
|
|
6
|
-
* for the same reason
|
|
7
|
-
* transmittance and the one a table calls strongly
|
|
8
|
-
* making the caller convert to find out would be the
|
|
9
|
-
* does not do.
|
|
4
|
+
* A band is the vibrational analogue of a mass spectrum's peak: the thing a
|
|
5
|
+
* chemist points at, names, and reads a functional group off. An infrared band
|
|
6
|
+
* carries both value axes for the same reason its spectrum does — the band a
|
|
7
|
+
* reader sees at 30 percent transmittance and the one a table calls strongly
|
|
8
|
+
* absorbing are one band, and making the caller convert to find out would be the
|
|
9
|
+
* conversion this package does not do. A Raman band carries its intensity.
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
12
|
* Whether two bands are the same band.
|
|
@@ -27,4 +27,26 @@ export function sameIrBand(current, next) {
|
|
|
27
27
|
return (current.spectrumId === next.spectrumId &&
|
|
28
28
|
current.wavenumber === next.wavenumber);
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* A band's value on the axis being read.
|
|
32
|
+
* @param band - The band.
|
|
33
|
+
* @param mode - Which value axis is being read.
|
|
34
|
+
* @returns The value, or `undefined` when its spectrum carries no such axis.
|
|
35
|
+
*/
|
|
36
|
+
export function bandValue(band, mode) {
|
|
37
|
+
return band[mode];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* How tall a band stands, which is what a cut to the strongest bands ranks by.
|
|
41
|
+
*
|
|
42
|
+
* The value it was picked as a maximum of: its absorbance for an infrared band,
|
|
43
|
+
* its intensity for a Raman one. Never its transmittance, in which a stronger
|
|
44
|
+
* band is a smaller number.
|
|
45
|
+
* @param band - The band.
|
|
46
|
+
* @returns The height, or negative infinity for a band carrying neither, so it
|
|
47
|
+
* ranks last.
|
|
48
|
+
*/
|
|
49
|
+
export function bandHeight(band) {
|
|
50
|
+
return band.absorbance ?? band.intensity ?? Number.NEGATIVE_INFINITY;
|
|
51
|
+
}
|
|
30
52
|
//# sourceMappingURL=irBand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irBand.js","sourceRoot":"","sources":["../../../src/ir/core/irBand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"irBand.js","sourceRoot":"","sources":["../../../src/ir/core/irBand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAwCH;;;;;;;;;;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;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,IAAY;IAClD,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC,iBAAiB,CAAC;AACvE,CAAC"}
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
* this one, because a module that exports a component and a constant together
|
|
11
11
|
* cannot be hot reloaded — `react-refresh/only-export-components` is the rule
|
|
12
12
|
* that says so, and the split is the fix rather than the exception.
|
|
13
|
+
*
|
|
14
|
+
* This is the infrared table; `irTechniqueCommands.ts` derives the Raman one
|
|
15
|
+
* from it.
|
|
13
16
|
*/
|
|
14
17
|
/** The key a command answers to. */
|
|
15
18
|
export interface IrShortcut {
|
|
@@ -155,6 +158,8 @@ export declare const irCommands: {
|
|
|
155
158
|
};
|
|
156
159
|
/** Identity of one of the commands the viewer offers. */
|
|
157
160
|
export type IrCommandId = keyof typeof irCommands;
|
|
161
|
+
/** The commands a viewer offers, in the order they are reached for. */
|
|
162
|
+
export type IrCommandTable = Readonly<Partial<Record<IrCommandId, IrCommand>>>;
|
|
158
163
|
/** What to do when each command is run, as the shell wires them. */
|
|
159
164
|
export type IrCommandHandlers = Partial<Record<IrCommandId, (() => void) | undefined>>;
|
|
160
165
|
/** How a component runs a command. */
|
|
@@ -165,4 +170,10 @@ export type RunIrCommand = (id: IrCommandId) => void;
|
|
|
165
170
|
* @returns The title, and the key in parentheses when it has one.
|
|
166
171
|
*/
|
|
167
172
|
export declare function irCommandLabel(id: IrCommandId): string;
|
|
173
|
+
/**
|
|
174
|
+
* A command's title, with its key in parentheses when it has one.
|
|
175
|
+
* @param entry - The command, as a table words it.
|
|
176
|
+
* @returns The label.
|
|
177
|
+
*/
|
|
178
|
+
export declare function irCommandEntryLabel(entry: IrCommand): string;
|
|
168
179
|
//# sourceMappingURL=irCommands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irCommands.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irCommands.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"irCommands.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irCommands.ts"],"names":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AAC,EAAE,EAAE,WAAW,GAAG,MAAM,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAG5D"}
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
* this one, because a module that exports a component and a constant together
|
|
11
11
|
* cannot be hot reloaded — `react-refresh/only-export-components` is the rule
|
|
12
12
|
* that says so, and the split is the fix rather than the exception.
|
|
13
|
+
*
|
|
14
|
+
* This is the infrared table; `irTechniqueCommands.ts` derives the Raman one
|
|
15
|
+
* from it.
|
|
13
16
|
*/
|
|
14
17
|
/** Everything the viewer offers, in the order it is reached for. */
|
|
15
18
|
export const irCommands = {
|
|
@@ -87,7 +90,14 @@ export const irCommands = {
|
|
|
87
90
|
* @returns The title, and the key in parentheses when it has one.
|
|
88
91
|
*/
|
|
89
92
|
export function irCommandLabel(id) {
|
|
90
|
-
|
|
93
|
+
return irCommandEntryLabel(irCommands[id]);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* A command's title, with its key in parentheses when it has one.
|
|
97
|
+
* @param entry - The command, as a table words it.
|
|
98
|
+
* @returns The label.
|
|
99
|
+
*/
|
|
100
|
+
export function irCommandEntryLabel(entry) {
|
|
91
101
|
const key = entry.shortcut?.label?.[0] ?? entry.shortcut?.keys[0];
|
|
92
102
|
return key === undefined ? entry.title : `${entry.title} (${key})`;
|
|
93
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irCommands.js","sourceRoot":"","sources":["../../../src/ir/core/irCommands.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"irCommands.js","sourceRoot":"","sources":["../../../src/ir/core/irCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA0CH,oEAAoE;AACpE,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE;QACL,KAAK,EAAE,2BAA2B;QAClC,WAAW,EAAE,0DAA0D;KACxE;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AAG,CAAC;AACrE,CAAC"}
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* something usable when it is handed nothing at all — a chart with no data is
|
|
6
6
|
* still mounted, still measured, and still builds its scales.
|
|
7
7
|
*
|
|
8
|
-
* The x window is in ascending wavenumbers even though the axis is
|
|
9
|
-
* 4000 down to 400: which way round it is read is the chart's
|
|
10
|
-
* every piece of arithmetic that moves a window expects its ends
|
|
8
|
+
* The x window is in ascending wavenumbers even though the infrared axis is
|
|
9
|
+
* drawn from 4000 down to 400: which way round it is read is the chart's
|
|
10
|
+
* business, and every piece of arithmetic that moves a window expects its ends
|
|
11
|
+
* in order.
|
|
11
12
|
*/
|
|
12
13
|
import type { IrDomain, IrMode, IrSpectrum } from './irSpectrum.ts';
|
|
13
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irDomain.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irDomain.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"irDomain.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irDomain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGpE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,IAAI,EAAE,MAAM,GACX,QAAQ,CAyBV;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAO7E"}
|
package/lib/ir/core/irDomain.js
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* something usable when it is handed nothing at all — a chart with no data is
|
|
6
6
|
* still mounted, still measured, and still builds its scales.
|
|
7
7
|
*
|
|
8
|
-
* The x window is in ascending wavenumbers even though the axis is
|
|
9
|
-
* 4000 down to 400: which way round it is read is the chart's
|
|
10
|
-
* every piece of arithmetic that moves a window expects its ends
|
|
8
|
+
* The x window is in ascending wavenumbers even though the infrared axis is
|
|
9
|
+
* drawn from 4000 down to 400: which way round it is read is the chart's
|
|
10
|
+
* business, and every piece of arithmetic that moves a window expects its ends
|
|
11
|
+
* in order.
|
|
11
12
|
*/
|
|
12
13
|
import { xMaxValue, xMinValue } from 'ml-spectra-processing';
|
|
13
14
|
import { bandsPointDown } from "./irMode.js";
|
|
@@ -46,9 +47,8 @@ export const LABEL_HEADROOM = 0.2;
|
|
|
46
47
|
export function fullDomain(spectra, mode) {
|
|
47
48
|
const extent = traceExtent(spectra, mode, false) ?? traceExtent(spectra, mode, true);
|
|
48
49
|
if (extent === null) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
: { x: [400, 4000], y: [0, 100] };
|
|
50
|
+
// A percentage runs to 100; absorbance and intensity are open at the top.
|
|
51
|
+
return { x: [400, 4000], y: mode === 'transmittance' ? [0, 100] : [0, 1] };
|
|
52
52
|
}
|
|
53
53
|
const { xMinimum, xMaximum, yMinimum, yMaximum } = extent;
|
|
54
54
|
const xPadding = (xMaximum - xMinimum) * X_DOMAIN_PADDING;
|
|
@@ -106,7 +106,10 @@ function traceExtent(spectra, mode, includeExcluded) {
|
|
|
106
106
|
continue;
|
|
107
107
|
if (!includeExcluded && spectrum.excludeFromDomain)
|
|
108
108
|
continue;
|
|
109
|
-
const
|
|
109
|
+
const trace = traceOf(spectrum, mode);
|
|
110
|
+
if (trace === undefined)
|
|
111
|
+
continue;
|
|
112
|
+
const { x, y } = trace;
|
|
110
113
|
if (x.length === 0 || y.length === 0)
|
|
111
114
|
continue;
|
|
112
115
|
// The wavenumber ends are read off the first and last sample rather than
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irDomain.js","sourceRoot":"","sources":["../../../src/ir/core/irDomain.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"irDomain.js","sourceRoot":"","sources":["../../../src/ir/core/irDomain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAErC,kFAAkF;AAClF,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAErC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAElC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,UAAU,CACxB,OAA8B,EAC9B,IAAY;IAEZ,MAAM,MAAM,GACV,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACxE,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,0EAA0E;QAC1E,OAAO,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAC7E,CAAC;IAED,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAC1D,MAAM,QAAQ,GAAG,CAAC,QAAQ,GAAG,QAA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AI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC;iBAC7C,CAAC;IACV,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -39,4 +39,16 @@ export interface IrEditorHandle {
|
|
|
39
39
|
/** Point the panels at one spectrum, or at none. */
|
|
40
40
|
selectSpectrum: (id: string | null) => void;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* A click on the plot, as the viewer tells its host about it.
|
|
44
|
+
*
|
|
45
|
+
* A click is a press let go over the plot without travelling: the end of a
|
|
46
|
+
* zoom drag is never one, and a click on the axis labels is not reported.
|
|
47
|
+
*/
|
|
48
|
+
export interface IrPlotClick {
|
|
49
|
+
/** Where it landed on the horizontal axis, in cm⁻¹ — a Raman shift for Raman. */
|
|
50
|
+
wavenumber: number;
|
|
51
|
+
/** Identity of the spectrum selected when it was made, `null` for none. */
|
|
52
|
+
spectrumId: string | null;
|
|
53
|
+
}
|
|
42
54
|
//# sourceMappingURL=irEditorApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irEditorApi.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irEditorApi.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE5D,6EAA6E;AAC7E,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,UAAU,EAAE,MAAM,UAAU,EAAE,CAAC;IAC/B,6DAA6D;IAC7D,UAAU,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAC5C,0CAA0C;IAC1C,UAAU,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAC5C,4BAA4B;IAC5B,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AC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B"}
|
|
@@ -10,6 +10,8 @@ import type { IrMode } from './irSpectrum.ts';
|
|
|
10
10
|
export declare const ABSORBANCE_DECIMALS = 3;
|
|
11
11
|
/** How many a percent transmittance is written to. */
|
|
12
12
|
export declare const TRANSMITTANCE_DECIMALS = 1;
|
|
13
|
+
/** How many significant digits an intensity is written to. */
|
|
14
|
+
export declare const INTENSITY_DIGITS = 4;
|
|
13
15
|
/**
|
|
14
16
|
* Write a wavenumber the way a chemist quotes one.
|
|
15
17
|
*
|
|
@@ -27,7 +29,9 @@ export declare function formatWavenumber(wavenumber: number): string;
|
|
|
27
29
|
* Three decimals for an absorbance and one for a percent transmittance, which is
|
|
28
30
|
* roughly the same precision expressed two ways — an absorbance of 0.001 and a
|
|
29
31
|
* transmittance of 0.2 percent are both about where a real spectrum's noise
|
|
30
|
-
* sits.
|
|
32
|
+
* sits. An intensity is counts from one instrument and a fraction of the
|
|
33
|
+
* strongest band from another, so no count of decimals suits it: it keeps
|
|
34
|
+
* `INTENSITY_DIGITS` significant digits instead.
|
|
31
35
|
* @param value - The value.
|
|
32
36
|
* @param mode - Which axis it is in.
|
|
33
37
|
* @returns The number as a string, without its unit.
|
|
@@ -36,7 +40,15 @@ export declare function formatIrValue(value: number, mode: IrMode): string;
|
|
|
36
40
|
/**
|
|
37
41
|
* What the value axis is called where there is room for one word.
|
|
38
42
|
* @param mode - Which axis is being drawn.
|
|
39
|
-
* @returns `A` or
|
|
43
|
+
* @returns `A`, `%T` or `I`, as a spectrum is annotated by hand.
|
|
40
44
|
*/
|
|
41
45
|
export declare function shortModeLabel(mode: IrMode): string;
|
|
46
|
+
/**
|
|
47
|
+
* The range a spectrum covers, written in the order its axis is read.
|
|
48
|
+
* @param wavenumbers - Its wavenumbers, ascending.
|
|
49
|
+
* @param reversed - Whether the axis runs from high to low, as infrared's does.
|
|
50
|
+
* @returns `4000–400 cm⁻¹` on a reversed axis, `100–3200 cm⁻¹` on one that is
|
|
51
|
+
* not, and an empty string for a spectrum with no point.
|
|
52
|
+
*/
|
|
53
|
+
export declare function formatWavenumberRange(wavenumbers: Float64Array, reversed: boolean): string;
|
|
42
54
|
//# sourceMappingURL=irFormat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irFormat.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irFormat.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"irFormat.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irFormat.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,qDAAqD;AACrD,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,sDAAsD;AACtD,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMjE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,YAAY,EACzB,QAAQ,EAAE,OAAO,GAChB,MAAM,CAMR"}
|
package/lib/ir/core/irFormat.js
CHANGED
|
@@ -5,10 +5,13 @@
|
|
|
5
5
|
* table beside them must agree to the digit: a band the chart calls 1715 and a
|
|
6
6
|
* row that calls it 1714.6 read as two bands.
|
|
7
7
|
*/
|
|
8
|
+
import { formatTrimmed } from "../../format/core/numbers.js";
|
|
8
9
|
/** How many decimals an absorbance is written to. */
|
|
9
10
|
export const ABSORBANCE_DECIMALS = 3;
|
|
10
11
|
/** How many a percent transmittance is written to. */
|
|
11
12
|
export const TRANSMITTANCE_DECIMALS = 1;
|
|
13
|
+
/** How many significant digits an intensity is written to. */
|
|
14
|
+
export const INTENSITY_DIGITS = 4;
|
|
12
15
|
/**
|
|
13
16
|
* Write a wavenumber the way a chemist quotes one.
|
|
14
17
|
*
|
|
@@ -30,7 +33,9 @@ export function formatWavenumber(wavenumber) {
|
|
|
30
33
|
* Three decimals for an absorbance and one for a percent transmittance, which is
|
|
31
34
|
* roughly the same precision expressed two ways — an absorbance of 0.001 and a
|
|
32
35
|
* transmittance of 0.2 percent are both about where a real spectrum's noise
|
|
33
|
-
* sits.
|
|
36
|
+
* sits. An intensity is counts from one instrument and a fraction of the
|
|
37
|
+
* strongest band from another, so no count of decimals suits it: it keeps
|
|
38
|
+
* `INTENSITY_DIGITS` significant digits instead.
|
|
34
39
|
* @param value - The value.
|
|
35
40
|
* @param mode - Which axis it is in.
|
|
36
41
|
* @returns The number as a string, without its unit.
|
|
@@ -38,14 +43,38 @@ export function formatWavenumber(wavenumber) {
|
|
|
38
43
|
export function formatIrValue(value, mode) {
|
|
39
44
|
if (!Number.isFinite(value))
|
|
40
45
|
return '';
|
|
41
|
-
|
|
46
|
+
const { decimals } = VALUE_FORMATS[mode];
|
|
47
|
+
return decimals === undefined
|
|
48
|
+
? formatTrimmed(value, { significant: INTENSITY_DIGITS })
|
|
49
|
+
: value.toFixed(decimals);
|
|
42
50
|
}
|
|
43
51
|
/**
|
|
44
52
|
* What the value axis is called where there is room for one word.
|
|
45
53
|
* @param mode - Which axis is being drawn.
|
|
46
|
-
* @returns `A` or
|
|
54
|
+
* @returns `A`, `%T` or `I`, as a spectrum is annotated by hand.
|
|
47
55
|
*/
|
|
48
56
|
export function shortModeLabel(mode) {
|
|
49
|
-
return mode
|
|
57
|
+
return VALUE_FORMATS[mode].symbol;
|
|
50
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* The range a spectrum covers, written in the order its axis is read.
|
|
61
|
+
* @param wavenumbers - Its wavenumbers, ascending.
|
|
62
|
+
* @param reversed - Whether the axis runs from high to low, as infrared's does.
|
|
63
|
+
* @returns `4000–400 cm⁻¹` on a reversed axis, `100–3200 cm⁻¹` on one that is
|
|
64
|
+
* not, and an empty string for a spectrum with no point.
|
|
65
|
+
*/
|
|
66
|
+
export function formatWavenumberRange(wavenumbers, reversed) {
|
|
67
|
+
const lowest = wavenumbers[0];
|
|
68
|
+
const highest = wavenumbers.at(-1);
|
|
69
|
+
if (lowest === undefined || highest === undefined)
|
|
70
|
+
return '';
|
|
71
|
+
const [first, last] = reversed ? [highest, lowest] : [lowest, highest];
|
|
72
|
+
return `${formatWavenumber(first)}–${formatWavenumber(last)} cm⁻¹`;
|
|
73
|
+
}
|
|
74
|
+
/** How each value axis is written: its symbol, and its count of decimals. */
|
|
75
|
+
const VALUE_FORMATS = {
|
|
76
|
+
transmittance: { symbol: '%T', decimals: TRANSMITTANCE_DECIMALS },
|
|
77
|
+
absorbance: { symbol: 'A', decimals: ABSORBANCE_DECIMALS },
|
|
78
|
+
intensity: { symbol: 'I' },
|
|
79
|
+
};
|
|
51
80
|
//# sourceMappingURL=irFormat.js.map
|