react-cheminfo 0.69.0 → 0.71.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 +70 -2
- package/lib/about/core/providers.d.ts +6 -0
- package/lib/about/core/providers.d.ts.map +1 -1
- package/lib/about/core/providers.js +7 -0
- package/lib/about/core/providers.js.map +1 -1
- package/lib/about/ui/AboutProvidedBy.js +34 -0
- package/lib/about/ui/AboutProvidedBy.js.map +1 -1
- package/lib/chart/ui/useChartPointer.d.ts +9 -1
- package/lib/chart/ui/useChartPointer.d.ts.map +1 -1
- package/lib/chart/ui/useChartPointer.js +11 -3
- package/lib/chart/ui/useChartPointer.js.map +1 -1
- package/lib/credits/core/credits.d.ts +41 -0
- package/lib/credits/core/credits.d.ts.map +1 -1
- package/lib/credits/core/credits.js +50 -0
- package/lib/credits/core/credits.js.map +1 -1
- package/lib/download/core/drawingMarkup.d.ts +8 -1
- package/lib/download/core/drawingMarkup.d.ts.map +1 -1
- package/lib/download/core/drawingMarkup.js +13 -1
- package/lib/download/core/drawingMarkup.js.map +1 -1
- package/lib/download/core/figurePng.d.ts +14 -0
- package/lib/download/core/figurePng.d.ts.map +1 -1
- package/lib/download/core/figurePng.js +21 -6
- package/lib/download/core/figurePng.js.map +1 -1
- package/lib/download/core/figureSvg.d.ts.map +1 -1
- package/lib/download/core/figureSvg.js +5 -3
- package/lib/download/core/figureSvg.js.map +1 -1
- package/lib/download/core/figureTarget.d.ts +13 -0
- package/lib/download/core/figureTarget.d.ts.map +1 -1
- package/lib/download/core/figureTarget.js +25 -5
- package/lib/download/core/figureTarget.js.map +1 -1
- package/lib/download/core/svgBounds.d.ts +15 -0
- package/lib/download/core/svgBounds.d.ts.map +1 -1
- package/lib/download/core/svgBounds.js +20 -0
- package/lib/download/core/svgBounds.js.map +1 -1
- package/lib/download/core/svgToPng.d.ts.map +1 -1
- package/lib/download/core/svgToPng.js +4 -2
- package/lib/download/core/svgToPng.js.map +1 -1
- package/lib/format/core/relativeTime.d.ts +8 -3
- package/lib/format/core/relativeTime.d.ts.map +1 -1
- package/lib/format/core/relativeTime.js +19 -7
- package/lib/format/core/relativeTime.js.map +1 -1
- package/lib/host/core/connectHost.d.ts +25 -34
- package/lib/host/core/connectHost.d.ts.map +1 -1
- package/lib/host/core/connectHost.js +43 -89
- package/lib/host/core/connectHost.js.map +1 -1
- package/lib/host/core/hostOutputs.d.ts +58 -0
- package/lib/host/core/hostOutputs.d.ts.map +1 -0
- package/lib/host/core/hostOutputs.js +151 -0
- package/lib/host/core/hostOutputs.js.map +1 -0
- package/lib/host/core/index.d.ts +9 -3
- package/lib/host/core/index.d.ts.map +1 -1
- package/lib/host/core/index.js +4 -1
- package/lib/host/core/index.js.map +1 -1
- package/lib/host/core/irKinds.d.ts +124 -0
- package/lib/host/core/irKinds.d.ts.map +1 -0
- package/lib/host/core/irKinds.js +46 -0
- package/lib/host/core/irKinds.js.map +1 -0
- package/lib/host/core/kinds.d.ts +13 -5
- package/lib/host/core/kinds.d.ts.map +1 -1
- package/lib/host/core/kinds.js +11 -5
- package/lib/host/core/kinds.js.map +1 -1
- package/lib/host/core/protocol.d.ts +50 -7
- package/lib/host/core/protocol.d.ts.map +1 -1
- package/lib/host/core/protocol.js +10 -6
- package/lib/host/core/protocol.js.map +1 -1
- package/lib/host/core/selectInputs.d.ts +37 -0
- package/lib/host/core/selectInputs.d.ts.map +1 -0
- package/lib/host/core/selectInputs.js +110 -0
- package/lib/host/core/selectInputs.js.map +1 -0
- package/lib/host/testing/sciPeaks.d.ts +31 -0
- package/lib/host/testing/sciPeaks.d.ts.map +1 -1
- package/lib/host/testing/sciPeaks.js +73 -0
- package/lib/host/testing/sciPeaks.js.map +1 -1
- package/lib/host/testing/standInHost.d.ts +9 -1
- package/lib/host/testing/standInHost.d.ts.map +1 -1
- package/lib/host/testing/standInHost.js +19 -1
- package/lib/host/testing/standInHost.js.map +1 -1
- package/lib/host/ui/useHostConnection.d.ts +13 -5
- package/lib/host/ui/useHostConnection.d.ts.map +1 -1
- package/lib/host/ui/useHostConnection.js +4 -3
- package/lib/host/ui/useHostConnection.js.map +1 -1
- package/lib/host-testing.d.ts +2 -2
- package/lib/host-testing.d.ts.map +1 -1
- package/lib/host-testing.js +2 -2
- package/lib/host-testing.js.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/ir/core/handPicking.d.ts +58 -0
- package/lib/ir/core/handPicking.d.ts.map +1 -0
- package/lib/ir/core/handPicking.js +130 -0
- package/lib/ir/core/handPicking.js.map +1 -0
- package/lib/ir/core/index.d.ts +3 -0
- package/lib/ir/core/index.d.ts.map +1 -1
- package/lib/ir/core/index.js +3 -0
- package/lib/ir/core/index.js.map +1 -1
- package/lib/ir/core/irBandState.d.ts +57 -0
- package/lib/ir/core/irBandState.d.ts.map +1 -0
- package/lib/ir/core/irBandState.js +119 -0
- package/lib/ir/core/irBandState.js.map +1 -0
- 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 +6 -0
- package/lib/ir/core/irCommands.js.map +1 -1
- package/lib/ir/core/irPeaks.d.ts +28 -0
- package/lib/ir/core/irPeaks.d.ts.map +1 -0
- package/lib/ir/core/irPeaks.js +66 -0
- package/lib/ir/core/irPeaks.js.map +1 -0
- package/lib/ir/core/irReducer.d.ts +8 -0
- package/lib/ir/core/irReducer.d.ts.map +1 -1
- package/lib/ir/core/irReducer.js +15 -32
- package/lib/ir/core/irReducer.js.map +1 -1
- package/lib/ir/core/irSpectrum.d.ts +15 -0
- package/lib/ir/core/irSpectrum.d.ts.map +1 -1
- package/lib/ir/core/irSpectrum.js.map +1 -1
- package/lib/ir/core/irState.d.ts +9 -6
- package/lib/ir/core/irState.d.ts.map +1 -1
- package/lib/ir/core/irState.js +10 -6
- package/lib/ir/core/irState.js.map +1 -1
- package/lib/ir/core/pickBands.d.ts +14 -0
- package/lib/ir/core/pickBands.d.ts.map +1 -1
- package/lib/ir/core/pickBands.js +39 -33
- package/lib/ir/core/pickBands.js.map +1 -1
- package/lib/ir/core/ramanBands.d.ts +9 -1
- package/lib/ir/core/ramanBands.d.ts.map +1 -1
- package/lib/ir/core/ramanBands.js +2 -2
- package/lib/ir/core/ramanBands.js.map +1 -1
- package/lib/ir/core/spectrumBands.d.ts +46 -0
- package/lib/ir/core/spectrumBands.d.ts.map +1 -0
- package/lib/ir/core/spectrumBands.js +98 -0
- package/lib/ir/core/spectrumBands.js.map +1 -0
- package/lib/ir/ui/BandRow.d.ts +5 -0
- package/lib/ir/ui/BandRow.d.ts.map +1 -1
- package/lib/ir/ui/BandRow.js +4 -3
- package/lib/ir/ui/BandRow.js.map +1 -1
- package/lib/ir/ui/BandsPanel.d.ts +5 -0
- package/lib/ir/ui/BandsPanel.d.ts.map +1 -1
- package/lib/ir/ui/BandsPanel.js +36 -16
- package/lib/ir/ui/BandsPanel.js.map +1 -1
- package/lib/ir/ui/BandsToolbar.d.ts +9 -0
- package/lib/ir/ui/BandsToolbar.d.ts.map +1 -0
- package/lib/ir/ui/BandsToolbar.js +61 -0
- package/lib/ir/ui/BandsToolbar.js.map +1 -0
- package/lib/ir/ui/IrCanvas.d.ts +2 -1
- package/lib/ir/ui/IrCanvas.d.ts.map +1 -1
- package/lib/ir/ui/IrCanvas.js +19 -5
- package/lib/ir/ui/IrCanvas.js.map +1 -1
- package/lib/ir/ui/IrChart.d.ts.map +1 -1
- package/lib/ir/ui/IrChart.js +8 -1
- package/lib/ir/ui/IrChart.js.map +1 -1
- package/lib/ir/ui/IrDocumentationDialog.js +1 -1
- package/lib/ir/ui/IrDocumentationDialog.js.map +1 -1
- package/lib/ir/ui/IrEditor.d.ts +4 -2
- package/lib/ir/ui/IrEditor.d.ts.map +1 -1
- package/lib/ir/ui/IrEditor.js.map +1 -1
- package/lib/ir/ui/IrShell.d.ts.map +1 -1
- package/lib/ir/ui/IrShell.js +6 -0
- package/lib/ir/ui/IrShell.js.map +1 -1
- package/lib/ir/ui/IrStatusBar.d.ts.map +1 -1
- package/lib/ir/ui/IrStatusBar.js +1 -1
- package/lib/ir/ui/IrStatusBar.js.map +1 -1
- package/lib/ir/ui/IrToolbar.d.ts +4 -3
- package/lib/ir/ui/IrToolbar.d.ts.map +1 -1
- package/lib/ir/ui/IrToolbar.js +5 -4
- package/lib/ir/ui/IrToolbar.js.map +1 -1
- package/lib/ir/ui/VibrationalEditor.d.ts +2 -1
- package/lib/ir/ui/VibrationalEditor.d.ts.map +1 -1
- package/lib/ir/ui/VibrationalEditor.js.map +1 -1
- package/lib/ir/ui/irActions.d.ts +5 -0
- package/lib/ir/ui/irActions.d.ts.map +1 -1
- package/lib/ir/ui/irActions.js +6 -0
- package/lib/ir/ui/irActions.js.map +1 -1
- package/lib/ir/ui/irChartProps.d.ts +4 -1
- package/lib/ir/ui/irChartProps.d.ts.map +1 -1
- package/lib/ir/ui/useIrEditor.d.ts +5 -11
- package/lib/ir/ui/useIrEditor.d.ts.map +1 -1
- package/lib/ir/ui/useIrEditor.js +17 -18
- package/lib/ir/ui/useIrEditor.js.map +1 -1
- package/lib/locales/de.json +63 -0
- package/lib/locales/en.json +63 -0
- package/lib/locales/es.json +63 -0
- package/lib/locales/fr.json +63 -0
- package/lib/locales/it.json +63 -0
- package/lib/mass/core/analyseSpectrum.d.ts +85 -0
- package/lib/mass/core/analyseSpectrum.d.ts.map +1 -0
- package/lib/mass/core/analyseSpectrum.js +101 -0
- package/lib/mass/core/analyseSpectrum.js.map +1 -0
- package/lib/mass/core/ascendingTrace.d.ts +24 -0
- package/lib/mass/core/ascendingTrace.d.ts.map +1 -0
- package/lib/mass/core/ascendingTrace.js +57 -0
- package/lib/mass/core/ascendingTrace.js.map +1 -0
- package/lib/mass/core/centroidPeaks.d.ts +77 -0
- package/lib/mass/core/centroidPeaks.d.ts.map +1 -0
- package/lib/mass/core/centroidPeaks.js +62 -0
- package/lib/mass/core/centroidPeaks.js.map +1 -0
- package/lib/mass/core/detectMassFormat.d.ts +24 -0
- package/lib/mass/core/detectMassFormat.d.ts.map +1 -0
- package/lib/mass/core/detectMassFormat.js +105 -0
- package/lib/mass/core/detectMassFormat.js.map +1 -0
- package/lib/mass/core/downloadSpectra.d.ts +24 -0
- package/lib/mass/core/downloadSpectra.d.ts.map +1 -0
- package/lib/mass/core/downloadSpectra.js +35 -0
- package/lib/mass/core/downloadSpectra.js.map +1 -0
- package/lib/mass/core/fromJcamp.d.ts +46 -0
- package/lib/mass/core/fromJcamp.d.ts.map +1 -0
- package/lib/mass/core/fromJcamp.js +123 -0
- package/lib/mass/core/fromJcamp.js.map +1 -0
- package/lib/mass/core/fromText.d.ts +30 -0
- package/lib/mass/core/fromText.d.ts.map +1 -0
- package/lib/mass/core/fromText.js +39 -0
- package/lib/mass/core/fromText.js.map +1 -0
- package/lib/mass/core/index.d.ts +70 -0
- package/lib/mass/core/index.d.ts.map +1 -0
- package/lib/mass/core/index.js +42 -0
- package/lib/mass/core/index.js.map +1 -0
- package/lib/mass/core/jcampTechnique.d.ts +38 -0
- package/lib/mass/core/jcampTechnique.d.ts.map +1 -0
- package/lib/mass/core/jcampTechnique.js +70 -0
- package/lib/mass/core/jcampTechnique.js.map +1 -0
- package/lib/mass/core/labelStackBox.d.ts +49 -0
- package/lib/mass/core/labelStackBox.d.ts.map +1 -0
- package/lib/mass/core/labelStackBox.js +44 -0
- package/lib/mass/core/labelStackBox.js.map +1 -0
- package/lib/mass/core/labelledPeaks.d.ts +79 -0
- package/lib/mass/core/labelledPeaks.d.ts.map +1 -0
- package/lib/mass/core/labelledPeaks.js +74 -0
- package/lib/mass/core/labelledPeaks.js.map +1 -0
- package/lib/mass/core/loadMassSpectra.d.ts +57 -0
- package/lib/mass/core/loadMassSpectra.d.ts.map +1 -0
- package/lib/mass/core/loadMassSpectra.js +45 -0
- package/lib/mass/core/loadMassSpectra.js.map +1 -0
- package/lib/mass/core/loadedMassSpectrum.d.ts +42 -0
- package/lib/mass/core/loadedMassSpectrum.d.ts.map +1 -0
- package/lib/mass/core/loadedMassSpectrum.js +15 -0
- package/lib/mass/core/loadedMassSpectrum.js.map +1 -0
- package/lib/mass/core/massCommands.d.ts +170 -0
- package/lib/mass/core/massCommands.d.ts.map +1 -0
- package/lib/mass/core/massCommands.js +95 -0
- package/lib/mass/core/massCommands.js.map +1 -0
- package/lib/mass/core/massDomain.d.ts +121 -0
- package/lib/mass/core/massDomain.d.ts.map +1 -0
- package/lib/mass/core/massDomain.js +179 -0
- package/lib/mass/core/massDomain.js.map +1 -0
- package/lib/mass/core/massEditorApi.d.ts +65 -0
- package/lib/mass/core/massEditorApi.d.ts.map +1 -0
- package/lib/mass/core/massEditorApi.js +10 -0
- package/lib/mass/core/massEditorApi.js.map +1 -0
- package/lib/mass/core/massFormat.d.ts +78 -0
- package/lib/mass/core/massFormat.d.ts.map +1 -0
- package/lib/mass/core/massFormat.js +168 -0
- package/lib/mass/core/massFormat.js.map +1 -0
- package/lib/mass/core/massMeta.d.ts +85 -0
- package/lib/mass/core/massMeta.d.ts.map +1 -0
- package/lib/mass/core/massMeta.js +182 -0
- package/lib/mass/core/massMeta.js.map +1 -0
- package/lib/mass/core/massReducer.d.ts +82 -0
- package/lib/mass/core/massReducer.d.ts.map +1 -0
- package/lib/mass/core/massReducer.js +163 -0
- package/lib/mass/core/massReducer.js.map +1 -0
- package/lib/mass/core/massResolution.d.ts +92 -0
- package/lib/mass/core/massResolution.d.ts.map +1 -0
- package/lib/mass/core/massResolution.js +126 -0
- package/lib/mass/core/massResolution.js.map +1 -0
- package/lib/mass/core/massSidePanels.d.ts +28 -0
- package/lib/mass/core/massSidePanels.d.ts.map +1 -0
- package/lib/mass/core/massSidePanels.js +12 -0
- package/lib/mass/core/massSidePanels.js.map +1 -0
- package/lib/mass/core/massSpectrum.d.ts +206 -0
- package/lib/mass/core/massSpectrum.d.ts.map +1 -0
- package/lib/mass/core/massSpectrum.js +41 -0
- package/lib/mass/core/massSpectrum.js.map +1 -0
- package/lib/mass/core/massState.d.ts +145 -0
- package/lib/mass/core/massState.d.ts.map +1 -0
- package/lib/mass/core/massState.js +102 -0
- package/lib/mass/core/massState.js.map +1 -0
- package/lib/mass/core/massStateEdits.d.ts +51 -0
- package/lib/mass/core/massStateEdits.d.ts.map +1 -0
- package/lib/mass/core/massStateEdits.js +90 -0
- package/lib/mass/core/massStateEdits.js.map +1 -0
- package/lib/mass/core/massSummary.d.ts +77 -0
- package/lib/mass/core/massSummary.d.ts.map +1 -0
- package/lib/mass/core/massSummary.js +174 -0
- package/lib/mass/core/massSummary.js.map +1 -0
- package/lib/mass/core/mzDecimalsSetting.d.ts +36 -0
- package/lib/mass/core/mzDecimalsSetting.d.ts.map +1 -0
- package/lib/mass/core/mzDecimalsSetting.js +42 -0
- package/lib/mass/core/mzDecimalsSetting.js.map +1 -0
- package/lib/mass/core/nearestPeak.d.ts +75 -0
- package/lib/mass/core/nearestPeak.d.ts.map +1 -0
- package/lib/mass/core/nearestPeak.js +99 -0
- package/lib/mass/core/nearestPeak.js.map +1 -0
- package/lib/mass/core/peakLabelLines.d.ts +77 -0
- package/lib/mass/core/peakLabelLines.d.ts.map +1 -0
- package/lib/mass/core/peakLabelLines.js +54 -0
- package/lib/mass/core/peakLabelLines.js.map +1 -0
- package/lib/mass/core/peakLabelPlan.d.ts +109 -0
- package/lib/mass/core/peakLabelPlan.d.ts.map +1 -0
- package/lib/mass/core/peakLabelPlan.js +143 -0
- package/lib/mass/core/peakLabelPlan.js.map +1 -0
- package/lib/mass/core/peakTable.d.ts +54 -0
- package/lib/mass/core/peakTable.d.ts.map +1 -0
- package/lib/mass/core/peakTable.js +53 -0
- package/lib/mass/core/peakTable.js.map +1 -0
- package/lib/mass/core/resolutionOf.d.ts +60 -0
- package/lib/mass/core/resolutionOf.d.ts.map +1 -0
- package/lib/mass/core/resolutionOf.js +84 -0
- package/lib/mass/core/resolutionOf.js.map +1 -0
- package/lib/mass/core/scanFilter.d.ts +25 -0
- package/lib/mass/core/scanFilter.d.ts.map +1 -0
- package/lib/mass/core/scanFilter.js +107 -0
- package/lib/mass/core/scanFilter.js.map +1 -0
- package/lib/mass/core/spectrumJcamp.d.ts +47 -0
- package/lib/mass/core/spectrumJcamp.d.ts.map +1 -0
- package/lib/mass/core/spectrumJcamp.js +167 -0
- package/lib/mass/core/spectrumJcamp.js.map +1 -0
- package/lib/mass/core/toMassSpectrum.d.ts +67 -0
- package/lib/mass/core/toMassSpectrum.d.ts.map +1 -0
- package/lib/mass/core/toMassSpectrum.js +78 -0
- package/lib/mass/core/toMassSpectrum.js.map +1 -0
- package/lib/mass/core/traceIcon.d.ts +82 -0
- package/lib/mass/core/traceIcon.d.ts.map +1 -0
- package/lib/mass/core/traceIcon.js +66 -0
- package/lib/mass/core/traceIcon.js.map +1 -0
- package/lib/mass/core/writtenResolution.d.ts +40 -0
- package/lib/mass/core/writtenResolution.d.ts.map +1 -0
- package/lib/mass/core/writtenResolution.js +77 -0
- package/lib/mass/core/writtenResolution.js.map +1 -0
- package/lib/mass/ui/MassAboutDialog.d.ts +16 -0
- package/lib/mass/ui/MassAboutDialog.d.ts.map +1 -0
- package/lib/mass/ui/MassAboutDialog.js +44 -0
- package/lib/mass/ui/MassAboutDialog.js.map +1 -0
- package/lib/mass/ui/MassCanvas.d.ts +46 -0
- package/lib/mass/ui/MassCanvas.d.ts.map +1 -0
- package/lib/mass/ui/MassCanvas.js +84 -0
- package/lib/mass/ui/MassCanvas.js.map +1 -0
- package/lib/mass/ui/MassChart.d.ts +21 -0
- package/lib/mass/ui/MassChart.d.ts.map +1 -0
- package/lib/mass/ui/MassChart.js +139 -0
- package/lib/mass/ui/MassChart.js.map +1 -0
- package/lib/mass/ui/MassCommandProvider.d.ts +15 -0
- package/lib/mass/ui/MassCommandProvider.d.ts.map +1 -0
- package/lib/mass/ui/MassCommandProvider.js +14 -0
- package/lib/mass/ui/MassCommandProvider.js.map +1 -0
- package/lib/mass/ui/MassCommandTooltip.d.ts +16 -0
- package/lib/mass/ui/MassCommandTooltip.d.ts.map +1 -0
- package/lib/mass/ui/MassCommandTooltip.js +22 -0
- package/lib/mass/ui/MassCommandTooltip.js.map +1 -0
- package/lib/mass/ui/MassDocumentationDialog.d.ts +18 -0
- package/lib/mass/ui/MassDocumentationDialog.d.ts.map +1 -0
- package/lib/mass/ui/MassDocumentationDialog.js +70 -0
- package/lib/mass/ui/MassDocumentationDialog.js.map +1 -0
- package/lib/mass/ui/MassEditor.d.ts +78 -0
- package/lib/mass/ui/MassEditor.d.ts.map +1 -0
- package/lib/mass/ui/MassEditor.js +42 -0
- package/lib/mass/ui/MassEditor.js.map +1 -0
- package/lib/mass/ui/MassHeader.d.ts +12 -0
- package/lib/mass/ui/MassHeader.d.ts.map +1 -0
- package/lib/mass/ui/MassHeader.js +20 -0
- package/lib/mass/ui/MassHeader.js.map +1 -0
- package/lib/mass/ui/MassLogo.d.ts +21 -0
- package/lib/mass/ui/MassLogo.d.ts.map +1 -0
- package/lib/mass/ui/MassLogo.js +36 -0
- package/lib/mass/ui/MassLogo.js.map +1 -0
- package/lib/mass/ui/MassPointerTracker.d.ts +44 -0
- package/lib/mass/ui/MassPointerTracker.d.ts.map +1 -0
- package/lib/mass/ui/MassPointerTracker.js +29 -0
- package/lib/mass/ui/MassPointerTracker.js.map +1 -0
- package/lib/mass/ui/MassShell.d.ts +29 -0
- package/lib/mass/ui/MassShell.d.ts.map +1 -0
- package/lib/mass/ui/MassShell.js +133 -0
- package/lib/mass/ui/MassShell.js.map +1 -0
- package/lib/mass/ui/MassSidePanel.d.ts +32 -0
- package/lib/mass/ui/MassSidePanel.d.ts.map +1 -0
- package/lib/mass/ui/MassSidePanel.js +44 -0
- package/lib/mass/ui/MassSidePanel.js.map +1 -0
- package/lib/mass/ui/MassStateProvider.d.ts +19 -0
- package/lib/mass/ui/MassStateProvider.d.ts.map +1 -0
- package/lib/mass/ui/MassStateProvider.js +16 -0
- package/lib/mass/ui/MassStateProvider.js.map +1 -0
- package/lib/mass/ui/MassStatusBar.d.ts +15 -0
- package/lib/mass/ui/MassStatusBar.d.ts.map +1 -0
- package/lib/mass/ui/MassStatusBar.js +50 -0
- package/lib/mass/ui/MassStatusBar.js.map +1 -0
- package/lib/mass/ui/MassToolbar.d.ts +24 -0
- package/lib/mass/ui/MassToolbar.d.ts.map +1 -0
- package/lib/mass/ui/MassToolbar.js +36 -0
- package/lib/mass/ui/MassToolbar.js.map +1 -0
- package/lib/mass/ui/MetadataPanel.d.ts +35 -0
- package/lib/mass/ui/MetadataPanel.d.ts.map +1 -0
- package/lib/mass/ui/MetadataPanel.js +100 -0
- package/lib/mass/ui/MetadataPanel.js.map +1 -0
- package/lib/mass/ui/MzDecimalsMenu.d.ts +28 -0
- package/lib/mass/ui/MzDecimalsMenu.d.ts.map +1 -0
- package/lib/mass/ui/MzDecimalsMenu.js +40 -0
- package/lib/mass/ui/MzDecimalsMenu.js.map +1 -0
- package/lib/mass/ui/PeakLabels.d.ts +93 -0
- package/lib/mass/ui/PeakLabels.d.ts.map +1 -0
- package/lib/mass/ui/PeakLabels.js +91 -0
- package/lib/mass/ui/PeakLabels.js.map +1 -0
- package/lib/mass/ui/PeakTable.d.ts +34 -0
- package/lib/mass/ui/PeakTable.d.ts.map +1 -0
- package/lib/mass/ui/PeakTable.js +49 -0
- package/lib/mass/ui/PeakTable.js.map +1 -0
- package/lib/mass/ui/PeaksPanel.d.ts +31 -0
- package/lib/mass/ui/PeaksPanel.d.ts.map +1 -0
- package/lib/mass/ui/PeaksPanel.js +53 -0
- package/lib/mass/ui/PeaksPanel.js.map +1 -0
- package/lib/mass/ui/SpectraPanel.d.ts +17 -0
- package/lib/mass/ui/SpectraPanel.d.ts.map +1 -0
- package/lib/mass/ui/SpectraPanel.js +76 -0
- package/lib/mass/ui/SpectraPanel.js.map +1 -0
- package/lib/mass/ui/SpectrumRow.d.ts +26 -0
- package/lib/mass/ui/SpectrumRow.d.ts.map +1 -0
- package/lib/mass/ui/SpectrumRow.js +141 -0
- package/lib/mass/ui/SpectrumRow.js.map +1 -0
- package/lib/mass/ui/SpectrumTrace.d.ts +46 -0
- package/lib/mass/ui/SpectrumTrace.d.ts.map +1 -0
- package/lib/mass/ui/SpectrumTrace.js +68 -0
- package/lib/mass/ui/SpectrumTrace.js.map +1 -0
- package/lib/mass/ui/index.d.ts +69 -0
- package/lib/mass/ui/index.d.ts.map +1 -0
- package/lib/mass/ui/index.js +42 -0
- package/lib/mass/ui/index.js.map +1 -0
- package/lib/mass/ui/massActions.d.ts +52 -0
- package/lib/mass/ui/massActions.d.ts.map +1 -0
- package/lib/mass/ui/massActions.js +62 -0
- package/lib/mass/ui/massActions.js.map +1 -0
- package/lib/mass/ui/massChartProps.d.ts +128 -0
- package/lib/mass/ui/massChartProps.d.ts.map +1 -0
- package/lib/mass/ui/massChartProps.js +14 -0
- package/lib/mass/ui/massChartProps.js.map +1 -0
- package/lib/mass/ui/massCommandContext.d.ts +36 -0
- package/lib/mass/ui/massCommandContext.d.ts.map +1 -0
- package/lib/mass/ui/massCommandContext.js +45 -0
- package/lib/mass/ui/massCommandContext.js.map +1 -0
- package/lib/mass/ui/massHostPanels.d.ts +48 -0
- package/lib/mass/ui/massHostPanels.d.ts.map +1 -0
- package/lib/mass/ui/massHostPanels.js +41 -0
- package/lib/mass/ui/massHostPanels.js.map +1 -0
- package/lib/mass/ui/massStateContext.d.ts +26 -0
- package/lib/mass/ui/massStateContext.d.ts.map +1 -0
- package/lib/mass/ui/massStateContext.js +37 -0
- package/lib/mass/ui/massStateContext.js.map +1 -0
- package/lib/mass/ui/useIntensityZoom.d.ts +20 -0
- package/lib/mass/ui/useIntensityZoom.d.ts.map +1 -0
- package/lib/mass/ui/useIntensityZoom.js +42 -0
- package/lib/mass/ui/useIntensityZoom.js.map +1 -0
- package/lib/mass/ui/useMassEditor.d.ts +52 -0
- package/lib/mass/ui/useMassEditor.d.ts.map +1 -0
- package/lib/mass/ui/useMassEditor.js +93 -0
- package/lib/mass/ui/useMassEditor.js.map +1 -0
- package/lib/mass/ui/useMassFiles.d.ts +22 -0
- package/lib/mass/ui/useMassFiles.d.ts.map +1 -0
- package/lib/mass/ui/useMassFiles.js +71 -0
- package/lib/mass/ui/useMassFiles.js.map +1 -0
- package/lib/mass/ui/useMassHandle.d.ts +15 -0
- package/lib/mass/ui/useMassHandle.d.ts.map +1 -0
- package/lib/mass/ui/useMassHandle.js +35 -0
- package/lib/mass/ui/useMassHandle.js.map +1 -0
- package/lib/mass/ui/useMassPointer.d.ts +70 -0
- package/lib/mass/ui/useMassPointer.d.ts.map +1 -0
- package/lib/mass/ui/useMassPointer.js +57 -0
- package/lib/mass/ui/useMassPointer.js.map +1 -0
- package/lib/mass/ui/useMassShortcuts.d.ts +21 -0
- package/lib/mass/ui/useMassShortcuts.d.ts.map +1 -0
- package/lib/mass/ui/useMassShortcuts.js +66 -0
- package/lib/mass/ui/useMassShortcuts.js.map +1 -0
- package/lib/mass/ui/useMassSide.d.ts +27 -0
- package/lib/mass/ui/useMassSide.d.ts.map +1 -0
- package/lib/mass/ui/useMassSide.js +45 -0
- package/lib/mass/ui/useMassSide.js.map +1 -0
- package/lib/mass/ui/useMassZoom.d.ts +92 -0
- package/lib/mass/ui/useMassZoom.d.ts.map +1 -0
- package/lib/mass/ui/useMassZoom.js +65 -0
- package/lib/mass/ui/useMassZoom.js.map +1 -0
- package/lib/mass.d.ts +16 -0
- package/lib/mass.d.ts.map +1 -0
- package/lib/mass.js +16 -0
- package/lib/mass.js.map +1 -0
- package/lib/panel/ui/PanelRail.d.ts.map +1 -1
- package/lib/panel/ui/PanelRail.js +6 -1
- package/lib/panel/ui/PanelRail.js.map +1 -1
- package/lib/slides/ui/slideSanitizeSchema.d.ts +3 -2
- package/lib/slides/ui/slideSanitizeSchema.d.ts.map +1 -1
- package/lib/slides/ui/slideSanitizeSchema.js +82 -2
- package/lib/slides/ui/slideSanitizeSchema.js.map +1 -1
- package/package.json +6 -1
- package/src/about/core/providers.ts +7 -0
- package/src/about/ui/AboutProvidedBy.tsx +49 -0
- package/src/chart/ui/useChartPointer.ts +18 -4
- package/src/credits/core/credits.ts +53 -0
- package/src/download/core/drawingMarkup.ts +18 -1
- package/src/download/core/figurePng.ts +21 -8
- package/src/download/core/figureSvg.ts +5 -2
- package/src/download/core/figureTarget.ts +28 -3
- package/src/download/core/svgBounds.ts +21 -0
- package/src/download/core/svgToPng.ts +3 -4
- package/src/format/core/relativeTime.ts +29 -7
- package/src/host/core/connectHost.ts +77 -120
- package/src/host/core/hostOutputs.ts +197 -0
- package/src/host/core/index.ts +13 -7
- package/src/host/core/irKinds.ts +92 -0
- package/src/host/core/kinds.ts +16 -6
- package/src/host/core/protocol.ts +50 -8
- package/src/host/core/selectInputs.ts +145 -0
- package/src/host/testing/sciPeaks.ts +140 -0
- package/src/host/testing/standInHost.ts +30 -5
- package/src/host/ui/useHostConnection.ts +17 -8
- package/src/host-testing.ts +4 -0
- package/src/ir/core/handPicking.ts +154 -0
- package/src/ir/core/index.ts +14 -0
- package/src/ir/core/irBandState.ts +155 -0
- package/src/ir/core/irCommands.ts +7 -0
- package/src/ir/core/irPeaks.ts +79 -0
- package/src/ir/core/irReducer.ts +27 -34
- package/src/ir/core/irSpectrum.ts +16 -0
- package/src/ir/core/irState.ts +15 -8
- package/src/ir/core/pickBands.ts +46 -39
- package/src/ir/core/ramanBands.ts +2 -2
- package/src/ir/core/spectrumBands.ts +113 -0
- package/src/ir/ui/BandRow.tsx +20 -2
- package/src/ir/ui/BandsPanel.tsx +46 -88
- package/src/ir/ui/BandsToolbar.tsx +152 -0
- package/src/ir/ui/IrCanvas.tsx +22 -11
- package/src/ir/ui/IrChart.tsx +10 -1
- package/src/ir/ui/IrDocumentationDialog.tsx +7 -0
- package/src/ir/ui/IrEditor.tsx +4 -2
- package/src/ir/ui/IrShell.tsx +5 -0
- package/src/ir/ui/IrStatusBar.tsx +4 -1
- package/src/ir/ui/IrToolbar.tsx +14 -5
- package/src/ir/ui/VibrationalEditor.tsx +2 -1
- package/src/ir/ui/irActions.ts +11 -0
- package/src/ir/ui/irChartProps.ts +4 -1
- package/src/ir/ui/useIrEditor.ts +21 -21
- package/src/locales/de.json +63 -0
- package/src/locales/en.json +63 -0
- package/src/locales/es.json +63 -0
- package/src/locales/fr.json +63 -0
- package/src/locales/it.json +63 -0
- package/src/mass/core/analyseSpectrum.ts +191 -0
- package/src/mass/core/ascendingTrace.ts +62 -0
- package/src/mass/core/centroidPeaks.ts +114 -0
- package/src/mass/core/detectMassFormat.ts +113 -0
- package/src/mass/core/downloadSpectra.ts +52 -0
- package/src/mass/core/fromJcamp.ts +151 -0
- package/src/mass/core/fromText.ts +58 -0
- package/src/mass/core/index.ts +194 -0
- package/src/mass/core/jcampTechnique.ts +87 -0
- package/src/mass/core/labelStackBox.ts +75 -0
- package/src/mass/core/labelledPeaks.ts +135 -0
- package/src/mass/core/loadMassSpectra.ts +86 -0
- package/src/mass/core/loadedMassSpectrum.ts +43 -0
- package/src/mass/core/massCommands.ts +156 -0
- package/src/mass/core/massDomain.ts +229 -0
- package/src/mass/core/massEditorApi.ts +68 -0
- package/src/mass/core/massFormat.ts +187 -0
- package/src/mass/core/massMeta.ts +239 -0
- package/src/mass/core/massReducer.ts +232 -0
- package/src/mass/core/massResolution.ts +169 -0
- package/src/mass/core/massSidePanels.ts +27 -0
- package/src/mass/core/massSpectrum.ts +220 -0
- package/src/mass/core/massState.ts +206 -0
- package/src/mass/core/massStateEdits.ts +104 -0
- package/src/mass/core/massSummary.ts +213 -0
- package/src/mass/core/mzDecimalsSetting.ts +52 -0
- package/src/mass/core/nearestPeak.ts +130 -0
- package/src/mass/core/peakLabelLines.ts +112 -0
- package/src/mass/core/peakLabelPlan.ts +246 -0
- package/src/mass/core/peakTable.ts +82 -0
- package/src/mass/core/resolutionOf.ts +100 -0
- package/src/mass/core/scanFilter.ts +119 -0
- package/src/mass/core/spectrumJcamp.ts +186 -0
- package/src/mass/core/toMassSpectrum.ts +126 -0
- package/src/mass/core/traceIcon.ts +105 -0
- package/src/mass/core/writtenResolution.ts +81 -0
- package/src/mass/ui/MassAboutDialog.tsx +89 -0
- package/src/mass/ui/MassCanvas.tsx +170 -0
- package/src/mass/ui/MassChart.tsx +266 -0
- package/src/mass/ui/MassCommandProvider.tsx +34 -0
- package/src/mass/ui/MassCommandTooltip.tsx +36 -0
- package/src/mass/ui/MassDocumentationDialog.tsx +136 -0
- package/src/mass/ui/MassEditor.tsx +130 -0
- package/src/mass/ui/MassHeader.tsx +38 -0
- package/src/mass/ui/MassLogo.tsx +84 -0
- package/src/mass/ui/MassPointerTracker.tsx +72 -0
- package/src/mass/ui/MassShell.tsx +237 -0
- package/src/mass/ui/MassSidePanel.tsx +107 -0
- package/src/mass/ui/MassStateProvider.tsx +32 -0
- package/src/mass/ui/MassStatusBar.tsx +108 -0
- package/src/mass/ui/MassToolbar.tsx +120 -0
- package/src/mass/ui/MetadataPanel.tsx +201 -0
- package/src/mass/ui/MzDecimalsMenu.tsx +86 -0
- package/src/mass/ui/PeakLabels.tsx +242 -0
- package/src/mass/ui/PeakTable.tsx +199 -0
- package/src/mass/ui/PeaksPanel.tsx +182 -0
- package/src/mass/ui/SpectraPanel.tsx +153 -0
- package/src/mass/ui/SpectrumRow.tsx +246 -0
- package/src/mass/ui/SpectrumTrace.tsx +119 -0
- package/src/mass/ui/index.ts +69 -0
- package/src/mass/ui/massActions.ts +109 -0
- package/src/mass/ui/massChartProps.ts +130 -0
- package/src/mass/ui/massCommandContext.tsx +65 -0
- package/src/mass/ui/massHostPanels.ts +71 -0
- package/src/mass/ui/massStateContext.ts +48 -0
- package/src/mass/ui/useIntensityZoom.ts +55 -0
- package/src/mass/ui/useMassEditor.ts +156 -0
- package/src/mass/ui/useMassFiles.ts +91 -0
- package/src/mass/ui/useMassHandle.ts +58 -0
- package/src/mass/ui/useMassPointer.ts +120 -0
- package/src/mass/ui/useMassShortcuts.ts +85 -0
- package/src/mass/ui/useMassSide.ts +63 -0
- package/src/mass/ui/useMassZoom.ts +157 -0
- package/src/mass.ts +16 -0
- package/src/panel/ui/PanelRail.tsx +5 -1
- package/src/slides/ui/slideSanitizeSchema.ts +86 -2
- package/styles/chrome.css +7 -0
- package/styles/slides.css +47 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a spectrum resolves masses finely enough for their decimals to mean
|
|
3
|
+
* anything.
|
|
4
|
+
*
|
|
5
|
+
* A peak table typed out of a low-resolution instrument report holds whole
|
|
6
|
+
* numbers — `163`, `325`, `487` — and writing them as `163.0000` claims four
|
|
7
|
+
* digits of accuracy nobody measured. A high-resolution measurement is the
|
|
8
|
+
* opposite case: `325.1129` and `325.1503` are different ions, and rounding them
|
|
9
|
+
* together loses the whole point of having measured them. Nothing about a single
|
|
10
|
+
* number says which of the two it is, so the answer is read off the spectrum.
|
|
11
|
+
*
|
|
12
|
+
* Three kinds of evidence are read, and the strongest one present decides —
|
|
13
|
+
* `decideResolution` is where they are weighed:
|
|
14
|
+
*
|
|
15
|
+
* 1. **The peaks themselves.** A profile carries the width of every peak, and
|
|
16
|
+
* the resolving power `m / Δm` at half height is what "high resolution" is
|
|
17
|
+
* defined by. This is a measurement, so it is believed over anything a file
|
|
18
|
+
* says about itself.
|
|
19
|
+
* 2. **What the file says the instrument was.** A Thermo scan filter starting
|
|
20
|
+
* `FTMS` is an Orbitrap, one starting `ITMS` an ion trap, and a JCAMP of the
|
|
21
|
+
* old MS dialect writes `##.INSTRUMENT PARAMETERS= LOW RESOLUTION` outright.
|
|
22
|
+
* 3. **How many decimals the masses were written with**, which is all a bare
|
|
23
|
+
* peak table has to say — `writtenResolution.ts`.
|
|
24
|
+
*/
|
|
25
|
+
import { gaussianWidthToFWHM } from 'ml-peak-shape-generator';
|
|
26
|
+
import { xMedian } from 'ml-spectra-processing';
|
|
27
|
+
/**
|
|
28
|
+
* The resolving power from which a spectrum counts as high resolution.
|
|
29
|
+
*
|
|
30
|
+
* Ten thousand at half height is the conventional threshold, and it falls in
|
|
31
|
+
* the gap between the two families of instrument rather than inside either:
|
|
32
|
+
* quadrupoles, ion traps and linear time-of-flights work at a few thousand at
|
|
33
|
+
* most, while reflectron time-of-flights, Orbitraps and FT-ICRs start above it.
|
|
34
|
+
*/
|
|
35
|
+
export const HIGH_RESOLVING_POWER = 10_000;
|
|
36
|
+
/** How many of the tallest peaks the resolving power is the median of. */
|
|
37
|
+
export const MEASURED_PEAKS = 20;
|
|
38
|
+
/** How many decimals an m/z is written with, for each kind of spectrum. */
|
|
39
|
+
export const MZ_DECIMALS = {
|
|
40
|
+
high: 4,
|
|
41
|
+
low: 1,
|
|
42
|
+
nominal: 0,
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The resolving power measured on the peaks of a profile.
|
|
46
|
+
*
|
|
47
|
+
* The median over the tallest peaks rather than over all of them, because a
|
|
48
|
+
* peak a few counts above the noise has a width the noise decided, and rather
|
|
49
|
+
* than the base peak alone, because one peak sitting on an unresolved shoulder
|
|
50
|
+
* would decide the whole spectrum. The width `ml-gsd` reports is the distance
|
|
51
|
+
* between the inflection points, which is converted to the width at half height
|
|
52
|
+
* as a gaussian's is: what a resolving power is quoted against.
|
|
53
|
+
* @param peaks - The peaks the profile was picked into, each with its width.
|
|
54
|
+
* @returns The verdict, `null` when no peak carries a usable width.
|
|
55
|
+
*/
|
|
56
|
+
export function measuredResolution(peaks) {
|
|
57
|
+
const usable = [];
|
|
58
|
+
for (const peak of peaks) {
|
|
59
|
+
if (peak.x > 0 && peak.width > 0 && Number.isFinite(peak.width)) {
|
|
60
|
+
usable.push(peak);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (usable.length === 0)
|
|
64
|
+
return null;
|
|
65
|
+
const tallest = usable
|
|
66
|
+
.toSorted((first, second) => second.y - first.y)
|
|
67
|
+
.slice(0, MEASURED_PEAKS);
|
|
68
|
+
const powers = new Float64Array(tallest.length);
|
|
69
|
+
for (let index = 0; index < tallest.length; index++) {
|
|
70
|
+
const peak = tallest[index];
|
|
71
|
+
powers[index] = peak.x / gaussianWidthToFWHM(peak.width);
|
|
72
|
+
}
|
|
73
|
+
const resolvingPower = xMedian(powers);
|
|
74
|
+
const kind = resolvingPower >= HIGH_RESOLVING_POWER ? 'high' : 'low';
|
|
75
|
+
return {
|
|
76
|
+
kind,
|
|
77
|
+
resolvingPower,
|
|
78
|
+
basis: 'peakWidth',
|
|
79
|
+
decimals: MZ_DECIMALS[kind],
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The resolution the file says the instrument worked at, when it says so.
|
|
84
|
+
*
|
|
85
|
+
* Only the rows that name an instrument are read, and a high verdict is looked
|
|
86
|
+
* for first: an `LTQ-Orbitrap` names an ion trap and an Orbitrap, and the
|
|
87
|
+
* spectrum came out of the Orbitrap. A time-of-flight is deliberately left
|
|
88
|
+
* undecided — a reflectron one is high resolution and a linear one is not, and
|
|
89
|
+
* the name is the same.
|
|
90
|
+
* @param meta - What the file said about the acquisition.
|
|
91
|
+
* @returns The verdict, `null` when the file names no instrument it can be
|
|
92
|
+
* read off.
|
|
93
|
+
*/
|
|
94
|
+
export function statedResolution(meta) {
|
|
95
|
+
if (meta === null)
|
|
96
|
+
return null;
|
|
97
|
+
for (const field of meta.fields) {
|
|
98
|
+
if (!INSTRUMENT_FIELDS.has(field.label))
|
|
99
|
+
continue;
|
|
100
|
+
const kind = HIGH_INSTRUMENT.test(field.value)
|
|
101
|
+
? 'high'
|
|
102
|
+
: LOW_INSTRUMENT.test(field.value)
|
|
103
|
+
? 'low'
|
|
104
|
+
: null;
|
|
105
|
+
if (kind !== null) {
|
|
106
|
+
return {
|
|
107
|
+
kind,
|
|
108
|
+
resolvingPower: null,
|
|
109
|
+
basis: 'instrument',
|
|
110
|
+
decimals: MZ_DECIMALS[kind],
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
/** The acquisition rows that name the instrument, and so its resolution. */
|
|
117
|
+
const INSTRUMENT_FIELDS = new Set([
|
|
118
|
+
'Analyser',
|
|
119
|
+
'Instrument',
|
|
120
|
+
'Instrument parameters',
|
|
121
|
+
]);
|
|
122
|
+
/** The instruments, and the words, that say high resolution. */
|
|
123
|
+
const HIGH_INSTRUMENT = /\bHIGH[\s-]RESOLUTION\b|\bHRMS\b|\bFTMS\b|ORBITRAP|\bFT-?ICR\b|\bEXACTIVE\b|\bEXPLORIS\b/i;
|
|
124
|
+
/** The instruments, and the words, that say a unit-resolution measurement. */
|
|
125
|
+
const LOW_INSTRUMENT = /\bLOW[\s-]RESOLUTION\b|\bITMS\b|\bION[\s-]TRAP\b|\bTRAP\b|QUADRUPOLE/i;
|
|
126
|
+
//# sourceMappingURL=massResolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"massResolution.js","sourceRoot":"","sources":["../../../src/mass/core/massResolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAmChD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE3C,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,WAAW,GAAiD;IACvE,IAAI,EAAE,CAAC;IACP,GAAG,EAAE,CAAC;IACN,OAAO,EAAE,CAAC;CACX,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAA2B;IAE3B,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC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G,CAAC,KAAK,CAAC,KAAK,CAAC;YAAE,SAAS;QAClD,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;YAC5C,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;gBAChC,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC,IAAI,CAAC;QACX,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO;gBACL,IAAI;gBACJ,cAAc,EAAE,IAAI;gBACpB,KAAK,EAAE,YAAY;gBACnB,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC;aAC5B,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,4EAA4E;AAC5E,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,UAAU;IACV,YAAY;IACZ,uBAAuB;CACxB,CAAC,CAAC;AAEH,gEAAgE;AAChE,MAAM,eAAe,GACnB,2FAA2F,CAAC;AAE9F,8EAA8E;AAC9E,MAAM,cAAc,GAClB,uEAAuE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The panels the side of the viewer can hold, in the order their icons stack.
|
|
3
|
+
*
|
|
4
|
+
* One frozen list read by both the activity bar and the panel stack, so a panel
|
|
5
|
+
* switched off and on again comes back where it was rather than at the end.
|
|
6
|
+
*/
|
|
7
|
+
export declare const massSidePanels: readonly [{
|
|
8
|
+
readonly id: "spectra";
|
|
9
|
+
readonly title: "Spectra";
|
|
10
|
+
readonly icon: "timeline-line-chart";
|
|
11
|
+
}, {
|
|
12
|
+
readonly id: "peaks";
|
|
13
|
+
readonly title: "Peaks";
|
|
14
|
+
readonly icon: "th-list";
|
|
15
|
+
}, {
|
|
16
|
+
readonly id: "metadata";
|
|
17
|
+
readonly title: "Acquisition";
|
|
18
|
+
readonly icon: "properties";
|
|
19
|
+
}];
|
|
20
|
+
/** Identity of one of the panels the viewer offers of its own. */
|
|
21
|
+
export type MassSidePanelId = (typeof massSidePanels)[number]['id'];
|
|
22
|
+
/**
|
|
23
|
+
* Identity of any panel the side can hold: one of the viewer's own, or one a
|
|
24
|
+
* host added to them. Still a union with the viewer's own ids, so those keep
|
|
25
|
+
* autocompleting where a plain `string` would swallow them.
|
|
26
|
+
*/
|
|
27
|
+
export type MassPanelId = MassSidePanelId | (string & Record<never, never>);
|
|
28
|
+
//# sourceMappingURL=massSidePanels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"massSidePanels.d.ts","sourceRoot":"","sources":["../../../src/mass/core/massSidePanels.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;EAQzB,CAAC;AAEH,kEAAkE;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAEpE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The panels the side of the viewer can hold, in the order their icons stack.
|
|
3
|
+
*
|
|
4
|
+
* One frozen list read by both the activity bar and the panel stack, so a panel
|
|
5
|
+
* switched off and on again comes back where it was rather than at the end.
|
|
6
|
+
*/
|
|
7
|
+
export const massSidePanels = [
|
|
8
|
+
{ id: 'spectra', title: 'Spectra', icon: 'timeline-line-chart' },
|
|
9
|
+
{ id: 'peaks', title: 'Peaks', icon: 'th-list' },
|
|
10
|
+
{ id: 'metadata', title: 'Acquisition', icon: 'properties' },
|
|
11
|
+
];
|
|
12
|
+
//# sourceMappingURL=massSidePanels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"massSidePanels.js","sourceRoot":"","sources":["../../../src/mass/core/massSidePanels.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAChE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;IAChD,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,EAAE;CAK5D,CAAC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a mass spectrum is once it has been read, whatever it was read from.
|
|
3
|
+
*
|
|
4
|
+
* A file gives one or more acquisitions; each becomes one `MassSpectrum` with
|
|
5
|
+
* two traces of the same measurement — the continuous `profile` as the
|
|
6
|
+
* instrument recorded it, and the `centroid` the peak picking reduced it to.
|
|
7
|
+
* Both are kept because they answer different questions: the profile is what a
|
|
8
|
+
* chemist recognises as a spectrum, and the centroid is what every number
|
|
9
|
+
* downstream is computed from. A centroided file has no profile, and that is
|
|
10
|
+
* the normal case for a peak table pasted out of an instrument report.
|
|
11
|
+
*
|
|
12
|
+
* The arrays are `Float64Array` throughout and are never converted to
|
|
13
|
+
* `number[]`: a profile scan runs to hundreds of thousands of points, a plain
|
|
14
|
+
* array costs two to three times the memory, and any structural freeze or
|
|
15
|
+
* spread walks it element by element while treating a typed array as atomic.
|
|
16
|
+
* They are replaced on a change, never written into, since every consumer holds
|
|
17
|
+
* the same object by reference.
|
|
18
|
+
*
|
|
19
|
+
* The shape is the one the glycan site's mass viewer holds, field for field
|
|
20
|
+
* where the two overlap, so a spectrum that viewer built can be handed to
|
|
21
|
+
* anything here: whatever it carries beyond these fields is simply not read.
|
|
22
|
+
*/
|
|
23
|
+
import type { DataXY } from 'cheminfo-types';
|
|
24
|
+
import type { ChartDomain } from '../../chart/core/chartDomain.ts';
|
|
25
|
+
import type { MassResolution } from './massResolution.ts';
|
|
26
|
+
/**
|
|
27
|
+
* One trace of a measurement: m/z against intensity, x strictly increasing.
|
|
28
|
+
*
|
|
29
|
+
* `DataXY` is the shape every package in this pipeline speaks — `xy-parser`,
|
|
30
|
+
* `ms-spectrum` and `ml-spectra-processing` all take and return it — so
|
|
31
|
+
* declaring a parallel type of our own would buy nothing and cost an adapter at
|
|
32
|
+
* each boundary.
|
|
33
|
+
*/
|
|
34
|
+
export type MassTrace = DataXY<Float64Array>;
|
|
35
|
+
/**
|
|
36
|
+
* The picked peaks of a spectrum, with the charge of each.
|
|
37
|
+
*
|
|
38
|
+
* `charge` is a dense column rather than an array of optional numbers so it
|
|
39
|
+
* costs two bytes a peak and needs no per-peak object: `0` means no charge was
|
|
40
|
+
* established, which is an answer rather than a missing value — a peak belongs
|
|
41
|
+
* to no isotopologue cluster and to no charge ladder. A charge is never read
|
|
42
|
+
* off a single peak, only off the series it belongs to.
|
|
43
|
+
*/
|
|
44
|
+
export interface MassPeaks extends MassTrace {
|
|
45
|
+
/** Charge of each peak, `0` where none was established. Signed. */
|
|
46
|
+
charge: Int16Array;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The formats a spectrum can have been read from.
|
|
50
|
+
*
|
|
51
|
+
* The two this package reads, and `calculated` for a trace nobody measured. Any
|
|
52
|
+
* other name is accepted as well, because a host that read an mzML with a
|
|
53
|
+
* reader of its own hands the spectrum over still knowing what it was read
|
|
54
|
+
* from, and the acquisition table should say so rather than call it text.
|
|
55
|
+
*/
|
|
56
|
+
export type MassFormat = 'jcamp' | 'text' | 'calculated' | (string & Record<never, never>);
|
|
57
|
+
/**
|
|
58
|
+
* Where a spectrum came from, and what the file said about the acquisition.
|
|
59
|
+
*
|
|
60
|
+
* Kept apart from `meta` because these are the facts other code branches on —
|
|
61
|
+
* a calculated trace is never reduced for drawing, an MS2 scan carries a
|
|
62
|
+
* precursor worth showing beside its name — while `meta` is a table to read.
|
|
63
|
+
* The readers of this package leave the acquisition facts out; a host whose
|
|
64
|
+
* reader states them, an mzML's, hands them over here.
|
|
65
|
+
*/
|
|
66
|
+
export interface MassOrigin {
|
|
67
|
+
/** The format it was read from. */
|
|
68
|
+
format: MassFormat;
|
|
69
|
+
/**
|
|
70
|
+
* Name of the file it came from, absent for a paste.
|
|
71
|
+
* @default undefined
|
|
72
|
+
*/
|
|
73
|
+
fileName?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Which acquisition of that file, counted from zero — the block of a JCAMP,
|
|
76
|
+
* or the page of a GC/MS one — absent when the file held only one.
|
|
77
|
+
* @default undefined
|
|
78
|
+
*/
|
|
79
|
+
scanIndex?: number;
|
|
80
|
+
/**
|
|
81
|
+
* MS level: 1 for a survey scan, 2 for a fragmentation scan.
|
|
82
|
+
* @default undefined
|
|
83
|
+
*/
|
|
84
|
+
msLevel?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Polarity the scan was acquired in.
|
|
87
|
+
* @default undefined
|
|
88
|
+
*/
|
|
89
|
+
polarity?: 'positive' | 'negative';
|
|
90
|
+
/**
|
|
91
|
+
* The m/z that was isolated and fragmented, on an MS2 scan.
|
|
92
|
+
* @default undefined
|
|
93
|
+
*/
|
|
94
|
+
precursorMz?: number;
|
|
95
|
+
/**
|
|
96
|
+
* The monoisotopic m/z the instrument named for that precursor, where it
|
|
97
|
+
* named one.
|
|
98
|
+
*
|
|
99
|
+
* Carried beside the precursor rather than instead of it because the two are
|
|
100
|
+
* the same number on nearly every scan that has both, and a different one on
|
|
101
|
+
* a scan whose method offset its isolation window: the precursor is then the
|
|
102
|
+
* centre of the window, since that is what the quadrupole transmitted, and
|
|
103
|
+
* this is the molecule the method was after.
|
|
104
|
+
* @default undefined
|
|
105
|
+
*/
|
|
106
|
+
precursorMonoisotopicMz?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Retention time in minutes, on a scan out of a chromatographic run.
|
|
109
|
+
* @default undefined
|
|
110
|
+
*/
|
|
111
|
+
retentionTime?: number;
|
|
112
|
+
}
|
|
113
|
+
/** One row of the acquisition table. */
|
|
114
|
+
export interface MassMetaField {
|
|
115
|
+
/** How the row is named, in the display order the table fixes. */
|
|
116
|
+
label: string;
|
|
117
|
+
/** The value as the file states it. */
|
|
118
|
+
value: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* What the file says about how the spectrum was acquired.
|
|
122
|
+
*
|
|
123
|
+
* Only ever what it actually says: a field the file leaves blank is left out
|
|
124
|
+
* rather than shown empty, so the table is short and every line in it is a
|
|
125
|
+
* fact. A plain two-column paste carries none of this, which is most pastes,
|
|
126
|
+
* and the panel then shows the file name alone.
|
|
127
|
+
*/
|
|
128
|
+
export interface MassMeta {
|
|
129
|
+
/** The title record, `null` when the file carries none. */
|
|
130
|
+
title: string | null;
|
|
131
|
+
/** The molecular formula the file claims, `null` when it claims none. */
|
|
132
|
+
molecularFormula: string | null;
|
|
133
|
+
/** The fields that are populated, in display order. */
|
|
134
|
+
fields: MassMetaField[];
|
|
135
|
+
/**
|
|
136
|
+
* The instrument's own scan description, kept verbatim. Real instruments
|
|
137
|
+
* leave the structured records empty and put the answer only here, so it is
|
|
138
|
+
* both the fallback the fields are mined from and worth showing as written.
|
|
139
|
+
*/
|
|
140
|
+
conditions: string | null;
|
|
141
|
+
}
|
|
142
|
+
/** One spectrum as the viewer holds it. */
|
|
143
|
+
export interface MassSpectrum {
|
|
144
|
+
/** Identity, stable across edits so a selection survives a rename. */
|
|
145
|
+
id: string;
|
|
146
|
+
/** What the list calls it; editable, and never used as identity. */
|
|
147
|
+
name: string;
|
|
148
|
+
/** The colour both its traces are drawn in. */
|
|
149
|
+
color: string;
|
|
150
|
+
/** The continuous trace, `null` when the file was already centroided. */
|
|
151
|
+
profile: MassTrace | null;
|
|
152
|
+
/** The picked peaks, which every number downstream is computed from. */
|
|
153
|
+
centroid: MassPeaks;
|
|
154
|
+
/** What the file said about the acquisition, `null` when it said nothing. */
|
|
155
|
+
meta: MassMeta | null;
|
|
156
|
+
/** Where it came from. */
|
|
157
|
+
origin: MassOrigin;
|
|
158
|
+
/**
|
|
159
|
+
* Whether the profile is drawn. The viewer draws one trace or the other and
|
|
160
|
+
* never both; `isSpectrumDrawn` is the question to ask about the pair.
|
|
161
|
+
*/
|
|
162
|
+
showProfile: boolean;
|
|
163
|
+
/** Whether the centroid sticks are drawn, under the same rule. */
|
|
164
|
+
showCentroid: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Whether the trace is left out of the automatic domain. A predicted
|
|
167
|
+
* distribution previewed under the pointer must not move the axes, or hovering
|
|
168
|
+
* a candidate would throw away the zoom the user set.
|
|
169
|
+
* @default false
|
|
170
|
+
*/
|
|
171
|
+
excludeFromDomain?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* How finely the spectrum resolves masses, as it was decided when it was read.
|
|
174
|
+
*
|
|
175
|
+
* Left out by a host that built the spectrum itself, and then worked out from
|
|
176
|
+
* the masses as written — see `resolutionOf`.
|
|
177
|
+
* @default undefined
|
|
178
|
+
*/
|
|
179
|
+
resolution?: MassResolution;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* The window the chart is showing, in data units.
|
|
183
|
+
*
|
|
184
|
+
* `ChartDomain` itself, not a type of our own: the arithmetic that moves a
|
|
185
|
+
* window is the shared chart's and speaks that type, and an alias here that
|
|
186
|
+
* merely renamed it would need converting at every call. `x` is in m/z and `y`
|
|
187
|
+
* in intensity.
|
|
188
|
+
*/
|
|
189
|
+
export type MassDomain = ChartDomain;
|
|
190
|
+
/**
|
|
191
|
+
* Whether a spectrum is on the chart at all, by whichever of its traces.
|
|
192
|
+
*
|
|
193
|
+
* A spectrum is drawn as its profile *or* as its sticks and never as both — a
|
|
194
|
+
* centroid standing inside the peak shapes it was picked from reads as a second
|
|
195
|
+
* spectrum laid over the first — so whether it is on screen is a question about
|
|
196
|
+
* the pair and not about either one.
|
|
197
|
+
*
|
|
198
|
+
* This is what everything that *uses* the picked peaks asks: pointing at a peak,
|
|
199
|
+
* labelling one, listing them. All of them read the centroid whether or not the
|
|
200
|
+
* sticks are the trace being drawn, so asking `showCentroid` there would make a
|
|
201
|
+
* spectrum shown as its profile quietly stop answering anything.
|
|
202
|
+
* @param spectrum - The spectrum.
|
|
203
|
+
* @returns Whether either of its traces is drawn.
|
|
204
|
+
*/
|
|
205
|
+
export declare function isSpectrumDrawn(spectrum: MassSpectrum): boolean;
|
|
206
|
+
//# sourceMappingURL=massSpectrum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"massSpectrum.d.ts","sourceRoot":"","sources":["../../../src/mass/core/massSpectrum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAE7C;;;;;;;;GAQG;AACH,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,mEAAmE;IACnE,MAAM,EAAE,UAAU,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GACpB,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAEpE;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,mCAAmC;IACnC,MAAM,EAAE,UAAU,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;O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,MAAM,UAAU,GAAG,WAAW,CAAC;AAErC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAE/D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a mass spectrum is once it has been read, whatever it was read from.
|
|
3
|
+
*
|
|
4
|
+
* A file gives one or more acquisitions; each becomes one `MassSpectrum` with
|
|
5
|
+
* two traces of the same measurement — the continuous `profile` as the
|
|
6
|
+
* instrument recorded it, and the `centroid` the peak picking reduced it to.
|
|
7
|
+
* Both are kept because they answer different questions: the profile is what a
|
|
8
|
+
* chemist recognises as a spectrum, and the centroid is what every number
|
|
9
|
+
* downstream is computed from. A centroided file has no profile, and that is
|
|
10
|
+
* the normal case for a peak table pasted out of an instrument report.
|
|
11
|
+
*
|
|
12
|
+
* The arrays are `Float64Array` throughout and are never converted to
|
|
13
|
+
* `number[]`: a profile scan runs to hundreds of thousands of points, a plain
|
|
14
|
+
* array costs two to three times the memory, and any structural freeze or
|
|
15
|
+
* spread walks it element by element while treating a typed array as atomic.
|
|
16
|
+
* They are replaced on a change, never written into, since every consumer holds
|
|
17
|
+
* the same object by reference.
|
|
18
|
+
*
|
|
19
|
+
* The shape is the one the glycan site's mass viewer holds, field for field
|
|
20
|
+
* where the two overlap, so a spectrum that viewer built can be handed to
|
|
21
|
+
* anything here: whatever it carries beyond these fields is simply not read.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Whether a spectrum is on the chart at all, by whichever of its traces.
|
|
25
|
+
*
|
|
26
|
+
* A spectrum is drawn as its profile *or* as its sticks and never as both — a
|
|
27
|
+
* centroid standing inside the peak shapes it was picked from reads as a second
|
|
28
|
+
* spectrum laid over the first — so whether it is on screen is a question about
|
|
29
|
+
* the pair and not about either one.
|
|
30
|
+
*
|
|
31
|
+
* This is what everything that *uses* the picked peaks asks: pointing at a peak,
|
|
32
|
+
* labelling one, listing them. All of them read the centroid whether or not the
|
|
33
|
+
* sticks are the trace being drawn, so asking `showCentroid` there would make a
|
|
34
|
+
* spectrum shown as its profile quietly stop answering anything.
|
|
35
|
+
* @param spectrum - The spectrum.
|
|
36
|
+
* @returns Whether either of its traces is drawn.
|
|
37
|
+
*/
|
|
38
|
+
export function isSpectrumDrawn(spectrum) {
|
|
39
|
+
return spectrum.showProfile || spectrum.showCentroid;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=massSpectrum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"massSpectrum.js","sourceRoot":"","sources":["../../../src/mass/core/massSpectrum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAqLH;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAAC,QAAsB;IACpD,OAAO,QAAQ,CAAC,WAAW,IAAI,QAAQ,CAAC,YAAY,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything the viewer knows, in the three buckets NMRium splits its own into
|
|
3
|
+
* — the same three the infrared viewer holds, under the same names.
|
|
4
|
+
*
|
|
5
|
+
* The split is the persistence boundary as much as anything: `data` is the
|
|
6
|
+
* document, `view` is where you are in it and lasts as long as the session, and
|
|
7
|
+
* `settings` is the workspace, which is how every spectrum is drawn whichever
|
|
8
|
+
* ones happen to be open.
|
|
9
|
+
*
|
|
10
|
+
* The peaks are in `data`, each spectrum carrying its own centroid: picked once,
|
|
11
|
+
* when the spectrum was read, so nothing about drawing it ever picks again.
|
|
12
|
+
*/
|
|
13
|
+
import type { MassPanelId, MassSidePanelId } from './massSidePanels.ts';
|
|
14
|
+
import type { MassDomain, MassSpectrum } from './massSpectrum.ts';
|
|
15
|
+
import type { MzDecimalsSetting } from './mzDecimalsSetting.ts';
|
|
16
|
+
/** The document: what the files held. */
|
|
17
|
+
export interface MassData {
|
|
18
|
+
/** The spectra, in the order they were loaded. */
|
|
19
|
+
spectra: MassSpectrum[];
|
|
20
|
+
}
|
|
21
|
+
/** What a drag across the chart is for while it is chosen. */
|
|
22
|
+
export type MassTool = 'read' | 'box';
|
|
23
|
+
/** Where you are in the viewer. */
|
|
24
|
+
export interface MassView {
|
|
25
|
+
/** Identity of the spectrum the panels act on, `null` for none. */
|
|
26
|
+
selectedId: string | null;
|
|
27
|
+
/**
|
|
28
|
+
* The window being shown, `null` while the chart is showing what fits.
|
|
29
|
+
*
|
|
30
|
+
* Held here so that a toolbar button and a row of the peak table can zoom —
|
|
31
|
+
* the chart is told a window and reports every window it arrives at, and this
|
|
32
|
+
* is where the answer lives between the two.
|
|
33
|
+
*/
|
|
34
|
+
domain: MassDomain | null;
|
|
35
|
+
/** Which tool a drag across the chart is running. */
|
|
36
|
+
tool: MassTool;
|
|
37
|
+
/**
|
|
38
|
+
* The side panels that are open: the viewer's own and any a host added. An id
|
|
39
|
+
* no panel on offer answers to opens nothing.
|
|
40
|
+
*/
|
|
41
|
+
openPanelIds: MassPanelId[];
|
|
42
|
+
/** Why the last action was refused, `null` as soon as one succeeds. */
|
|
43
|
+
error: string | null;
|
|
44
|
+
}
|
|
45
|
+
/** The workspace: how every spectrum is drawn, whichever ones are open. */
|
|
46
|
+
export interface MassSettings {
|
|
47
|
+
/** Whether the peaks of the selected spectrum are labelled on the chart. */
|
|
48
|
+
showLabels: boolean;
|
|
49
|
+
/** At most how many peaks are labelled at once. */
|
|
50
|
+
labelLimit: number;
|
|
51
|
+
/** Whether a label writes the charge of a peak whose charge was established. */
|
|
52
|
+
showCharges: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* How many decimals the masses on screen are written with: `'auto'` for what
|
|
55
|
+
* the spectra resolve — high-resolution masses or nominal ones — or the
|
|
56
|
+
* number the reader chose.
|
|
57
|
+
*/
|
|
58
|
+
mzDecimals: MzDecimalsSetting;
|
|
59
|
+
}
|
|
60
|
+
/** Everything the viewer knows. */
|
|
61
|
+
export interface MassState {
|
|
62
|
+
/** The spectra that are open. */
|
|
63
|
+
data: MassData;
|
|
64
|
+
/** Where you are in the viewer. */
|
|
65
|
+
view: MassView;
|
|
66
|
+
/** How spectra are drawn. */
|
|
67
|
+
settings: MassSettings;
|
|
68
|
+
}
|
|
69
|
+
/** Part of a state, as a host restoring one supplies it. */
|
|
70
|
+
export interface PartialMassState {
|
|
71
|
+
/** The spectra that were open. */
|
|
72
|
+
data?: MassData;
|
|
73
|
+
/** Where the viewer was left. */
|
|
74
|
+
view?: Partial<MassView>;
|
|
75
|
+
/** The workspace they were drawn in. */
|
|
76
|
+
settings?: Partial<MassSettings>;
|
|
77
|
+
}
|
|
78
|
+
/** The panel the splitter brings back when it is dragged open on nothing. */
|
|
79
|
+
export declare const DEFAULT_SIDE_PANEL: MassSidePanelId;
|
|
80
|
+
/**
|
|
81
|
+
* The panels a fresh viewer opens with: the list, and the peaks of whichever
|
|
82
|
+
* spectrum is selected in it, because a spectrum is read through its peaks.
|
|
83
|
+
*/
|
|
84
|
+
export declare const DEFAULT_SIDE_PANELS: MassSidePanelId[];
|
|
85
|
+
/** How many peaks are labelled to begin with. */
|
|
86
|
+
export declare const DEFAULT_LABEL_LIMIT = 20;
|
|
87
|
+
/** At most how many peaks a setting may ask to have labelled. */
|
|
88
|
+
export declare const MAXIMUM_LABEL_LIMIT = 500;
|
|
89
|
+
/** The workspace a fresh viewer starts from. */
|
|
90
|
+
export declare const DEFAULT_SETTINGS: MassSettings;
|
|
91
|
+
/** What a viewer opens on. */
|
|
92
|
+
export interface CreateMassStateOptions {
|
|
93
|
+
/**
|
|
94
|
+
* The spectra to open on.
|
|
95
|
+
* @default []
|
|
96
|
+
*/
|
|
97
|
+
spectra?: MassSpectrum[];
|
|
98
|
+
/**
|
|
99
|
+
* The workspace to open in.
|
|
100
|
+
* @default DEFAULT_SETTINGS
|
|
101
|
+
*/
|
|
102
|
+
settings?: Partial<MassSettings>;
|
|
103
|
+
/**
|
|
104
|
+
* The panels open to begin with, the viewer's own or a host's.
|
|
105
|
+
* @default DEFAULT_SIDE_PANELS
|
|
106
|
+
*/
|
|
107
|
+
panelIds?: readonly MassPanelId[];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The state a viewer opens with.
|
|
111
|
+
*
|
|
112
|
+
* The panel list is spread rather than stored by reference: a caller's array is
|
|
113
|
+
* the caller's to mutate, and a viewer holding it would find its open panels
|
|
114
|
+
* changing under it.
|
|
115
|
+
* @param options - What it opens on.
|
|
116
|
+
* @returns The state.
|
|
117
|
+
*/
|
|
118
|
+
export declare function createMassState(options?: CreateMassStateOptions): MassState;
|
|
119
|
+
/**
|
|
120
|
+
* Fold a change into the workspace, refusing what no chart survives.
|
|
121
|
+
*
|
|
122
|
+
* A number typed into a field arrives here as `NaN` for every keystroke that is
|
|
123
|
+
* not yet a number — a lone minus sign, an empty box — and a limit of `NaN`
|
|
124
|
+
* silently stops every label being drawn. So the limit is checked, and the
|
|
125
|
+
* current value kept where the new one is unusable rather than the field being
|
|
126
|
+
* fought with while it is being typed in. The decimals are read back the same
|
|
127
|
+
* way, through `readMzDecimalsSetting`, since a stored workspace is no more to
|
|
128
|
+
* be trusted than a half-typed field.
|
|
129
|
+
* @param current - The workspace in force.
|
|
130
|
+
* @param change - What to change about it.
|
|
131
|
+
* @returns The new workspace.
|
|
132
|
+
*/
|
|
133
|
+
export declare function mergeMassSettings(current: MassSettings, change?: Partial<MassSettings>): MassSettings;
|
|
134
|
+
/**
|
|
135
|
+
* Whether a window is one a chart can be built on.
|
|
136
|
+
*
|
|
137
|
+
* Both ends finite and the low one below the high one. A window failing either
|
|
138
|
+
* makes every scale built from it infinite, which the DOM refuses outright — so
|
|
139
|
+
* a handle told to frame a peak it worked out wrongly leaves the chart alone
|
|
140
|
+
* instead of blanking it.
|
|
141
|
+
* @param domain - The window to check.
|
|
142
|
+
* @returns Whether it can be shown.
|
|
143
|
+
*/
|
|
144
|
+
export declare function isMassWindow(domain: MassDomain): boolean;
|
|
145
|
+
//# sourceMappingURL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