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,139 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { sameChartDomain } from "../../chart/core/chartDomain.js";
|
|
4
|
+
import { MARGIN, plotRect } from "../../chart/core/chartGeometry.js";
|
|
5
|
+
import { Axes } from "../../chart/ui/Axes.js";
|
|
6
|
+
import { AxisGuide } from "../../chart/ui/AxisGuide.js";
|
|
7
|
+
import { SelectionRect } from "../../chart/ui/SelectionRect.js";
|
|
8
|
+
import { chartSurfaceStyle } from "../../chart/ui/chartSurface.js";
|
|
9
|
+
import { useChartSize } from "../../chart/ui/useChartSize.js";
|
|
10
|
+
import { DEFAULT_LABEL_LIMIT } from "../core/massState.js";
|
|
11
|
+
import { mzDecimalsOf } from "../core/resolutionOf.js";
|
|
12
|
+
import { MassPointerTracker } from "./MassPointerTracker.js";
|
|
13
|
+
import { PeakLabels } from "./PeakLabels.js";
|
|
14
|
+
import { SpectrumTrace } from "./SpectrumTrace.js";
|
|
15
|
+
import { useMassPointer } from "./useMassPointer.js";
|
|
16
|
+
import { useMassZoom } from "./useMassZoom.js";
|
|
17
|
+
/**
|
|
18
|
+
* The chart: every layer of a mass spectrum, in one SVG.
|
|
19
|
+
*
|
|
20
|
+
* The axes go under the data, so a grid line is never read as a peak. Only the
|
|
21
|
+
* data band is clipped, so a zoomed trace stops at the plot edge while the
|
|
22
|
+
* labels over the tallest peaks are allowed out over the margin — clip those and
|
|
23
|
+
* the base peak of every spectrum loses its label. The guide, the drag rectangle
|
|
24
|
+
* and the crosshair go over everything, because each answers a question being
|
|
25
|
+
* asked right now.
|
|
26
|
+
*
|
|
27
|
+
* Nothing is held here. The spectra, what is labelled, what is being looked at
|
|
28
|
+
* and the window are all props, and every gesture comes back out as a callback
|
|
29
|
+
* — so one component draws an editor's chart, a report page's single spectrum
|
|
30
|
+
* and a test.
|
|
31
|
+
* @param props - Component props.
|
|
32
|
+
* @returns The chart.
|
|
33
|
+
*/
|
|
34
|
+
export function MassChart(props) {
|
|
35
|
+
const { spectra, labelledId, showLabels = true, labelLimit = DEFAULT_LABEL_LIMIT, showCharges = false, mzDecimals: askedDecimals, annotationLabels, highlightMz = null, onPeakHover, domain = null, onDomainChange, onPlotClick, drag = 'xAxis', answersKeys = true, emphasisedId = null, width, height, children, } = props;
|
|
36
|
+
const [containerRef, measured] = useChartSize();
|
|
37
|
+
const svgRef = useRef(null);
|
|
38
|
+
const plot = useMemo(() => plotRect({
|
|
39
|
+
width: width ?? measured.width,
|
|
40
|
+
height: height ?? measured.height,
|
|
41
|
+
}), [width, height, measured.width, measured.height]);
|
|
42
|
+
// Read back off the plot rather than off the measurement, so a chart briefly
|
|
43
|
+
// laid out at nothing still draws its axes inside a box that holds them.
|
|
44
|
+
const frameWidth = plot.right + MARGIN.right;
|
|
45
|
+
const frameHeight = plot.bottom + MARGIN.bottom;
|
|
46
|
+
// The host's window goes *into* the zoom rather than over it, so a drag is
|
|
47
|
+
// always measured against what is on screen.
|
|
48
|
+
const zoom = useMassZoom({
|
|
49
|
+
spectra,
|
|
50
|
+
svgRef,
|
|
51
|
+
plot,
|
|
52
|
+
domain,
|
|
53
|
+
drag,
|
|
54
|
+
keys: answersKeys,
|
|
55
|
+
...(onPlotClick === undefined
|
|
56
|
+
? {}
|
|
57
|
+
: { onClick: ({ mz, peak }) => onPlotClick(mz, peak) }),
|
|
58
|
+
});
|
|
59
|
+
const { domain: shown, xScale, yScale, selection, handlers } = zoom;
|
|
60
|
+
// A chart holding nothing still builds scales on a placeholder window, and a
|
|
61
|
+
// placeholder reported would become a window the host imposes on whatever is
|
|
62
|
+
// dropped next — drawn entirely off screen.
|
|
63
|
+
const holdsNothing = spectra.length === 0;
|
|
64
|
+
const reported = useRef(shown);
|
|
65
|
+
// Before the browser paints, so a host that stores the window and hands it
|
|
66
|
+
// back does so in the frame the gesture landed in rather than the one after.
|
|
67
|
+
useLayoutEffect(() => {
|
|
68
|
+
if (holdsNothing || sameChartDomain(reported.current, shown))
|
|
69
|
+
return;
|
|
70
|
+
reported.current = shown;
|
|
71
|
+
onDomainChange?.(shown);
|
|
72
|
+
}, [holdsNothing, shown, onDomainChange]);
|
|
73
|
+
const pointer = useMassPointer({
|
|
74
|
+
svgRef,
|
|
75
|
+
plot,
|
|
76
|
+
xScale,
|
|
77
|
+
yScale,
|
|
78
|
+
spectra,
|
|
79
|
+
...(onPeakHover === undefined ? {} : { onPeak: onPeakHover }),
|
|
80
|
+
});
|
|
81
|
+
const labelled = useMemo(() => labelledSpectrum(spectra, labelledId), [spectra, labelledId]);
|
|
82
|
+
const painted = useMemo(() => emphasisedLast(spectra, emphasisedId), [spectra, emphasisedId]);
|
|
83
|
+
// The crosshair reads every drawn spectrum, so it is written to what they
|
|
84
|
+
// resolve together; the labels are of one spectrum, and written to its own.
|
|
85
|
+
const readoutDecimals = useMemo(() => askedDecimals ?? mzDecimalsOf(spectra), [askedDecimals, spectra]);
|
|
86
|
+
const labelDecimals = useMemo(() => askedDecimals ??
|
|
87
|
+
(labelled === null ? readoutDecimals : mzDecimalsOf([labelled])), [askedDecimals, labelled, readoutDecimals]);
|
|
88
|
+
// React's generated id carries the punctuation it keeps its own ids apart
|
|
89
|
+
// with, which a URL fragment is under no obligation to accept.
|
|
90
|
+
const clipId = `mass-plot-${useId().replaceAll(/\W/g, '')}`;
|
|
91
|
+
return (_jsx("div", { ref: containerRef, style: containerStyle, children: _jsxs("svg", { ref: svgRef, role: "img", "aria-label": CHART_LABEL, width: frameWidth, height: frameHeight, viewBox: `0 0 ${frameWidth} ${frameHeight}`, style: chartSurfaceStyle(pointer.position !== null), ...handlers, children: [_jsx("defs", { children: _jsx("clipPath", { id: clipId, children: _jsx("rect", { x: plot.left, y: plot.top, width: plot.width, height: plot.height }) }) }), _jsx(Axes, { plot: plot, xDomain: shown.x, yDomain: shown.y, xScale: xScale, yScale: yScale, xTitle: "m/z", yTitle: "relative intensity (%)" }), _jsxs("g", { clipPath: `url(#${clipId})`, children: [painted.map((spectrum) => (_jsx(SpectrumTrace, { spectrum: spectrum, plot: plot, xScale: xScale, yScale: yScale, strokeWidth: spectrum.id === emphasisedId ? EMPHASISED_WIDTH : undefined }, spectrum.id))), children] }), showLabels && labelled !== null ? (_jsx(PeakLabels, { spectrum: labelled, plot: plot, xScale: xScale, yScale: yScale, limit: labelLimit, showCharges: showCharges, mzDecimals: labelDecimals, ...(annotationLabels === undefined ? {} : { annotationLabels }), color: spectra.length > 1 ? labelled.color : undefined })) : null, _jsx(AxisGuide, { value: highlightMz, plot: plot, xScale: xScale }), _jsx(SelectionRect, { selection: selection, plot: plot }), _jsx(MassPointerTracker, { position: pointer.position, readout: pointer.readout, plot: plot, mzDecimals: readoutDecimals })] }) }));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The one spectrum whose peaks are labelled.
|
|
95
|
+
* @param spectra - What the chart draws.
|
|
96
|
+
* @param labelledId - The identity asked for, `null` for none, absent to let the
|
|
97
|
+
* chart take the first.
|
|
98
|
+
* @returns The spectrum, or `null` when none answers.
|
|
99
|
+
*/
|
|
100
|
+
function labelledSpectrum(spectra, labelledId) {
|
|
101
|
+
if (labelledId === undefined)
|
|
102
|
+
return spectra[0] ?? null;
|
|
103
|
+
if (labelledId === null)
|
|
104
|
+
return null;
|
|
105
|
+
for (const spectrum of spectra) {
|
|
106
|
+
if (spectrum.id === labelledId)
|
|
107
|
+
return spectrum;
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The traces in painting order, with the emphasised one last — last is in
|
|
113
|
+
* front, and in front is what lets a trace crossing a dozen others be followed.
|
|
114
|
+
* @param spectra - The traces, in the order they were opened.
|
|
115
|
+
* @param emphasisedId - Identity of the one to raise, `null` for none.
|
|
116
|
+
* @returns The order to paint in — the array itself when nothing moves.
|
|
117
|
+
*/
|
|
118
|
+
function emphasisedLast(spectra, emphasisedId) {
|
|
119
|
+
if (emphasisedId === null)
|
|
120
|
+
return spectra;
|
|
121
|
+
const at = spectra.findIndex((spectrum) => spectrum.id === emphasisedId);
|
|
122
|
+
if (at === -1 || at === spectra.length - 1)
|
|
123
|
+
return spectra;
|
|
124
|
+
return [
|
|
125
|
+
...spectra.slice(0, at),
|
|
126
|
+
...spectra.slice(at + 1),
|
|
127
|
+
spectra[at],
|
|
128
|
+
];
|
|
129
|
+
}
|
|
130
|
+
/** What the chart is, and what can be done to it, for whoever cannot see it. */
|
|
131
|
+
const CHART_LABEL = 'Mass spectrum. Drag across it to zoom the m/z axis, drag below the baseline to take the intensity axis with it, turn the wheel to scale the intensity, and double click to fit everything again.';
|
|
132
|
+
/**
|
|
133
|
+
* How thick the trace every panel is about is drawn: barely thicker, so it
|
|
134
|
+
* reads as the same kind of thing as the others.
|
|
135
|
+
*/
|
|
136
|
+
const EMPHASISED_WIDTH = 2;
|
|
137
|
+
/** The box the chart is measured against, and fills. */
|
|
138
|
+
const containerStyle = { width: '100%', height: '100%' };
|
|
139
|
+
//# sourceMappingURL=MassChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MassChart.js","sourceRoot":"","sources":["../../../src/mass/ui/MassChart.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAyB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA8B,CAAC;AACzD,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CAAC;IAC3D,OAAO;QACL,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;QACvB,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;QACxB,OAAO,CAAC,EAAE,CAAiB;KAC5B,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,MAAM,WAAW,GACf,kMAAkM,CAAC;AAErM;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B,wDAAwD;AACxD,MAAM,cAAc,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAW,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { MassCommandHandlers } from '../core/massCommands.ts';
|
|
3
|
+
export interface MassCommandProviderProps {
|
|
4
|
+
/** What each command does. */
|
|
5
|
+
handlers: MassCommandHandlers;
|
|
6
|
+
/** The viewer. */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Put the command handlers where the toolbar and the panels can reach them.
|
|
11
|
+
* @param props - Component props.
|
|
12
|
+
* @returns The provider.
|
|
13
|
+
*/
|
|
14
|
+
export declare function MassCommandProvider(props: MassCommandProviderProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=MassCommandProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MassCommandProvider.d.ts","sourceRoot":"","sources":["../../../src/mass/ui/MassCommandProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAKnE,MAAM,WAAW,wBAAwB;IACvC,8BAA8B;IAC9B,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,kBAAkB;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,+BAalE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { massCommandContext } from "./massCommandContext.js";
|
|
4
|
+
/**
|
|
5
|
+
* Put the command handlers where the toolbar and the panels can reach them.
|
|
6
|
+
* @param props - Component props.
|
|
7
|
+
* @returns The provider.
|
|
8
|
+
*/
|
|
9
|
+
export function MassCommandProvider(props) {
|
|
10
|
+
const { handlers, children } = props;
|
|
11
|
+
const value = useMemo(() => ({ handlers, run: (id) => handlers[id]?.() }), [handlers]);
|
|
12
|
+
return (_jsx(massCommandContext.Provider, { value: value, children: children }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=MassCommandProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MassCommandProvider.js","sourceRoot":"","sources":["../../../src/mass/ui/MassCommandProvider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAKhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAA0B,CAAC;AAS9D;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IACjE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAErC,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EACnD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,CACL,KAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACtC,QAAQ,GACmB,CAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MassCommandId } from '../core/massCommands.ts';
|
|
2
|
+
export interface MassCommandTooltipProps {
|
|
3
|
+
/** Which command the tooltip is about. */
|
|
4
|
+
id: MassCommandId;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* One command's tooltip: its title, what it does, and every way to do it.
|
|
8
|
+
*
|
|
9
|
+
* `TooltipHelpContent` from react-science, which is what NMRium's tooltips and
|
|
10
|
+
* the infrared viewer's are, so a page holding these viewers side by side
|
|
11
|
+
* explains itself the same way in all of them.
|
|
12
|
+
* @param props - Component props.
|
|
13
|
+
* @returns The tooltip's content.
|
|
14
|
+
*/
|
|
15
|
+
export declare function MassCommandTooltip(props: MassCommandTooltipProps): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=MassCommandTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MassCommandTooltip.d.ts","sourceRoot":"","sources":["../../../src/mass/ui/MassCommandTooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG1E,MAAM,WAAW,uBAAuB;IACtC,0CAA0C;IAC1C,EAAE,EAAE,aAAa,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,+BAgBhE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TooltipHelpContent } from 'react-science/ui';
|
|
3
|
+
import { massCommands } from "../core/massCommands.js";
|
|
4
|
+
/**
|
|
5
|
+
* One command's tooltip: its title, what it does, and every way to do it.
|
|
6
|
+
*
|
|
7
|
+
* `TooltipHelpContent` from react-science, which is what NMRium's tooltips and
|
|
8
|
+
* the infrared viewer's are, so a page holding these viewers side by side
|
|
9
|
+
* explains itself the same way in all of them.
|
|
10
|
+
* @param props - Component props.
|
|
11
|
+
* @returns The tooltip's content.
|
|
12
|
+
*/
|
|
13
|
+
export function MassCommandTooltip(props) {
|
|
14
|
+
const { id } = props;
|
|
15
|
+
const entry = massCommands[id];
|
|
16
|
+
const shortcuts = entry.shortcut?.label ?? entry.shortcut?.keys;
|
|
17
|
+
return (_jsx(TooltipHelpContent, { title: entry.title, description: entry.description, shortcuts: shortcuts === undefined ? undefined : [...shortcuts], subTitles: entry.gestures?.map((gesture) => ({
|
|
18
|
+
title: gesture.title,
|
|
19
|
+
shortcuts: [...gesture.shortcuts],
|
|
20
|
+
})) }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=MassCommandTooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MassCommandTooltip.js","sourceRoot":"","sources":["../../../src/mass/ui/MassCommandTooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAOvD;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAA8B;IAC/D,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IACrB,MAAM,KAAK,GAAgB,YAAY,CAAC,EAAE,CAAC,CAAC;IAC5C,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;IAEhE,OAAO,CACL,KAAC,kBAAkB,IACjB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,SAAS,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAC/D,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC3C,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,SAAS,EAAE,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;SAClC,CAAC,CAAC,GACH,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface MassDocumentationDialogProps {
|
|
2
|
+
/** Whether the dialog is open. */
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
/** Close it. */
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* How to use the viewer, written in the viewer.
|
|
9
|
+
*
|
|
10
|
+
* In the component rather than on a site, so there is nowhere to leave for and
|
|
11
|
+
* nothing to keep in step: every key in the last section is read out of the
|
|
12
|
+
* same command table the toolbar and the key handler read, so a shortcut cannot
|
|
13
|
+
* be documented as one thing and bound as another.
|
|
14
|
+
* @param props - Component props.
|
|
15
|
+
* @returns The dialog.
|
|
16
|
+
*/
|
|
17
|
+
export declare function MassDocumentationDialog(props: MassDocumentationDialogProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=MassDocumentationDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MassDocumentationDialog.d.ts","sourceRoot":"","sources":["../../../src/mass/ui/MassDocumentationDialog.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,4BAA4B;IAC3C,kCAAkC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,+BAU1E"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DocumentationDialogFrame } from "../../panel/ui/DocumentationDialogFrame.js";
|
|
3
|
+
import { massCommandLabel, massCommands } from "../core/massCommands.js";
|
|
4
|
+
import { HIGH_RESOLVING_POWER } from "../core/massResolution.js";
|
|
5
|
+
/**
|
|
6
|
+
* How to use the viewer, written in the viewer.
|
|
7
|
+
*
|
|
8
|
+
* In the component rather than on a site, so there is nowhere to leave for and
|
|
9
|
+
* nothing to keep in step: every key in the last section is read out of the
|
|
10
|
+
* same command table the toolbar and the key handler read, so a shortcut cannot
|
|
11
|
+
* be documented as one thing and bound as another.
|
|
12
|
+
* @param props - Component props.
|
|
13
|
+
* @returns The dialog.
|
|
14
|
+
*/
|
|
15
|
+
export function MassDocumentationDialog(props) {
|
|
16
|
+
const { isOpen, onClose } = props;
|
|
17
|
+
return (_jsx(DocumentationDialogFrame, { isOpen: isOpen, onClose: onClose, title: "Using the mass spectrum viewer", sections: SECTIONS }));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* One row of the gestures table: a command, its key and what it does.
|
|
21
|
+
* @param props - Component props.
|
|
22
|
+
* @param props.entry - The command, as the table words it.
|
|
23
|
+
* @returns The row.
|
|
24
|
+
*/
|
|
25
|
+
function CommandRow(props) {
|
|
26
|
+
const { entry } = props;
|
|
27
|
+
const keys = entry.shortcut?.label ?? entry.shortcut?.keys ?? [];
|
|
28
|
+
const gestures = (entry.gestures ?? []).flatMap((gesture) => gesture.shortcuts);
|
|
29
|
+
return (_jsxs("tr", { children: [_jsx("th", { style: labelCellStyle, children: entry.title }), _jsx("td", { style: keyCellStyle, children: [...keys, ...gestures].join(' · ') }), _jsx("td", { style: cellStyle, children: entry.description })] }));
|
|
30
|
+
}
|
|
31
|
+
const tableStyle = {
|
|
32
|
+
width: '100%',
|
|
33
|
+
borderCollapse: 'collapse',
|
|
34
|
+
fontSize: 12,
|
|
35
|
+
};
|
|
36
|
+
const cellStyle = { padding: '3px 6px', verticalAlign: 'top' };
|
|
37
|
+
const labelCellStyle = {
|
|
38
|
+
...cellStyle,
|
|
39
|
+
textAlign: 'left',
|
|
40
|
+
whiteSpace: 'nowrap',
|
|
41
|
+
};
|
|
42
|
+
const keyCellStyle = {
|
|
43
|
+
...cellStyle,
|
|
44
|
+
whiteSpace: 'nowrap',
|
|
45
|
+
opacity: 0.7,
|
|
46
|
+
};
|
|
47
|
+
/** What the guide says, in reading order. */
|
|
48
|
+
const SECTIONS = [
|
|
49
|
+
{
|
|
50
|
+
id: 'open',
|
|
51
|
+
title: 'Opening a spectrum',
|
|
52
|
+
body: (_jsxs("p", { children: ["Drop JCAMP-DX files (", _jsx("code", { children: ".jdx" }), ", ", _jsx("code", { children: ".dx" }), ") or two columns of m/z and intensity (", _jsx("code", { children: ".txt" }), ", ", _jsx("code", { children: ".csv" }), ",", ' ', _jsx("code", { children: ".xy" }), ") on the chart, or use ", massCommandLabel('openFiles'), ". A JCAMP holding several blocks, or a GC/MS export holding a page per scan, gives one spectrum per block or page."] })),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'peaks',
|
|
56
|
+
title: 'Profile and centroid',
|
|
57
|
+
body: (_jsx("p", { children: "A continuous profile is peak picked as it is read; a peak table is taken as it stands. Each row of the Spectra panel draws a spectrum as its profile or as its picked peaks, never both. The peaks of the selected spectrum are labelled on the chart: zoom onto a cluster and every line of it is labelled." })),
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'resolution',
|
|
61
|
+
title: 'High or low resolution',
|
|
62
|
+
body: (_jsxs("p", { children: ["A profile is measured: the median resolving power of its tallest peaks, at half height, is high resolution from", ' ', HIGH_RESOLVING_POWER.toLocaleString('en-US'), ". A peak table has no widths, so the instrument its file names decides, and failing that the decimals its masses were written with. Masses are written as high resolution, to four decimals, or as nominal masses, whole. To write them another way, pick the number of decimals in the Peaks panel toolbar; it holds for the chart and the tables alike."] })),
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'keys',
|
|
66
|
+
title: 'Gestures and keys',
|
|
67
|
+
body: (_jsx("table", { style: tableStyle, children: _jsx("tbody", { children: Object.values(massCommands).map((entry) => (_jsx(CommandRow, { entry: entry }, entry.title))) }) })),
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
//# sourceMappingURL=MassDocumentationDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MassDocumentationDialog.js","sourceRoot":"","sources":["../../../src/mass/ui/MassDocumentationDialog.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA6C,CAAC;AAEvF,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AASjE;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAmC;IACzE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAClC,OAAO,CACL,KAAC,wBAAwB,IACvB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,KAAK,EAAC,gCAAgC,EACtC,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,UAAU,CAAC,KAA6B;IAC/C,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC;IACjE,MAAM,QAAQ,GAAG,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,OAAO,CAC7C,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,CAC/B,CAAC;IACF,OAAO,CACL,yBACE,aAAI,KAAK,EAAE,cAAc,YAAG,KAAK,CAAC,KAAK,GAAM,EAC7C,aAAI,KAAK,EAAE,YAAY,YAAG,CAAC,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAM,EAClE,aAAI,KAAK,EAAE,SAAS,YAAG,KAAK,CAAC,WAAW,GAAM,IAC3C,CACN,CA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T;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { Ref } from 'react';
|
|
2
|
+
import type { MassEditorHandle, MassPlotClick } from '../core/massEditorApi.ts';
|
|
3
|
+
import type { MassPanelId } from '../core/massSidePanels.ts';
|
|
4
|
+
import type { MassSpectrum } from '../core/massSpectrum.ts';
|
|
5
|
+
import type { MassSettings } from '../core/massState.ts';
|
|
6
|
+
import type { MassHostPanel } from './massHostPanels.ts';
|
|
7
|
+
export interface MassEditorProps {
|
|
8
|
+
/**
|
|
9
|
+
* The spectra to open on. Read when the viewer opens and never again: what is
|
|
10
|
+
* on the chart belongs to the viewer from then on, so a host re-rendering with
|
|
11
|
+
* another array does not silently replace what somebody is looking at. The
|
|
12
|
+
* `ref` handle is how spectra arrive afterwards.
|
|
13
|
+
* @default []
|
|
14
|
+
*/
|
|
15
|
+
data?: MassSpectrum[];
|
|
16
|
+
/**
|
|
17
|
+
* Called whenever the spectra open change — one loaded, one closed, the chart
|
|
18
|
+
* cleared — with the spectra now open.
|
|
19
|
+
*
|
|
20
|
+
* The document only. A zoom, a selection, a rename and a colour change what is
|
|
21
|
+
* being looked at rather than what is loaded, and a host told about those
|
|
22
|
+
* would be told on every drag of the mouse.
|
|
23
|
+
* @default undefined
|
|
24
|
+
*/
|
|
25
|
+
onChange?: (spectra: MassSpectrum[]) => void;
|
|
26
|
+
/**
|
|
27
|
+
* How the spectra are drawn to begin with: whether the peaks are labelled,
|
|
28
|
+
* how many, and whether their charges are written.
|
|
29
|
+
* @default DEFAULT_SETTINGS
|
|
30
|
+
*/
|
|
31
|
+
settings?: Partial<MassSettings>;
|
|
32
|
+
/**
|
|
33
|
+
* The side panels open to begin with: the viewer's own — `'spectra'`,
|
|
34
|
+
* `'peaks'`, `'metadata'` — or the id of one of `panels`. An id no panel
|
|
35
|
+
* answers to is ignored.
|
|
36
|
+
* @default DEFAULT_SIDE_PANELS
|
|
37
|
+
*/
|
|
38
|
+
defaultPanelIds?: readonly MassPanelId[];
|
|
39
|
+
/**
|
|
40
|
+
* Panels the host adds to the viewer's own — a formula to predict an isotopic
|
|
41
|
+
* pattern from, say. Their icons come first in the activity bar, in the order
|
|
42
|
+
* given, and each then behaves as a built-in panel does.
|
|
43
|
+
* @default []
|
|
44
|
+
*/
|
|
45
|
+
panels?: readonly MassHostPanel[];
|
|
46
|
+
/**
|
|
47
|
+
* The plot was clicked (a press that did not travel, so not a zoom drag), with
|
|
48
|
+
* the m/z it landed at, the picked peak within reach and the spectrum selected
|
|
49
|
+
* at that moment.
|
|
50
|
+
* @default undefined
|
|
51
|
+
*/
|
|
52
|
+
onPlotClick?: (click: MassPlotClick) => void;
|
|
53
|
+
/**
|
|
54
|
+
* The handle a host drives the viewer through: take these spectra, read
|
|
55
|
+
* these files, frame this mass, select that one.
|
|
56
|
+
* @default undefined
|
|
57
|
+
*/
|
|
58
|
+
ref?: Ref<MassEditorHandle>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A mass spectrum viewer: a header across the top, the chart in the middle, the
|
|
62
|
+
* tools down the left, and the panels that interrogate it down the right.
|
|
63
|
+
*
|
|
64
|
+
* The same shape as the infrared viewer, deliberately — a page may well hold
|
|
65
|
+
* both, and a chemist who has learned one should not have to learn the other.
|
|
66
|
+
* Files are dropped on the chart or opened from the toolbar: JCAMP-DX and two
|
|
67
|
+
* columns of text. A profile is peak picked as it is read, every spectrum is
|
|
68
|
+
* judged high or low resolution, and the peaks of the selected one are labelled
|
|
69
|
+
* as the chart is zoomed.
|
|
70
|
+
*
|
|
71
|
+
* It is sealed the way NMRium is sealed: the spectra go in as `data` and come
|
|
72
|
+
* back through `onChange`, and everything else a host wants is a gesture on the
|
|
73
|
+
* `ref` rather than a prop that has to change to be obeyed.
|
|
74
|
+
* @param props - Component props.
|
|
75
|
+
* @returns The viewer.
|
|
76
|
+
*/
|
|
77
|
+
export declare function MassEditor(props: MassEditorProps): import("react").JSX.Element;
|
|
78
|
+
//# sourceMappingURL=MassEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MassEditor.d.ts","sourceRoot":"","sources":["../../../src/mass/ui/MassEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,YAAY,EAAE,CAAC;IACtB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACjC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAClC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C;;;;OAIG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAiChD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { RootLayout } from 'react-science/ui';
|
|
3
|
+
import { MassShell } from "./MassShell.js";
|
|
4
|
+
import { MassStateProvider } from "./MassStateProvider.js";
|
|
5
|
+
import { useMassEditor } from "./useMassEditor.js";
|
|
6
|
+
/**
|
|
7
|
+
* A mass spectrum viewer: a header across the top, the chart in the middle, the
|
|
8
|
+
* tools down the left, and the panels that interrogate it down the right.
|
|
9
|
+
*
|
|
10
|
+
* The same shape as the infrared viewer, deliberately — a page may well hold
|
|
11
|
+
* both, and a chemist who has learned one should not have to learn the other.
|
|
12
|
+
* Files are dropped on the chart or opened from the toolbar: JCAMP-DX and two
|
|
13
|
+
* columns of text. A profile is peak picked as it is read, every spectrum is
|
|
14
|
+
* judged high or low resolution, and the peaks of the selected one are labelled
|
|
15
|
+
* as the chart is zoomed.
|
|
16
|
+
*
|
|
17
|
+
* It is sealed the way NMRium is sealed: the spectra go in as `data` and come
|
|
18
|
+
* back through `onChange`, and everything else a host wants is a gesture on the
|
|
19
|
+
* `ref` rather than a prop that has to change to be obeyed.
|
|
20
|
+
* @param props - Component props.
|
|
21
|
+
* @returns The viewer.
|
|
22
|
+
*/
|
|
23
|
+
export function MassEditor(props) {
|
|
24
|
+
const { data = NO_SPECTRA, onChange, settings, defaultPanelIds, panels = NO_PANELS, onPlotClick, ref, } = props;
|
|
25
|
+
const editor = useMassEditor({
|
|
26
|
+
spectra: data,
|
|
27
|
+
...(settings === undefined ? {} : { settings }),
|
|
28
|
+
...(defaultPanelIds === undefined ? {} : { panelIds: defaultPanelIds }),
|
|
29
|
+
...(onChange === undefined ? {} : { onChange }),
|
|
30
|
+
});
|
|
31
|
+
return (_jsx(MassStateProvider, { editor: editor, children: _jsx(RootLayout, { style: rootLayoutStyle, children: _jsx(MassShell, { handle: ref, panels: panels, ...(onPlotClick === undefined ? {} : { onPlotClick }) }) }) }));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The viewer fills what it is given, and its own children scroll rather than
|
|
35
|
+
* push: a flex column with no `minHeight` grows past its parent instead.
|
|
36
|
+
*/
|
|
37
|
+
const rootLayoutStyle = { minHeight: 0 };
|
|
38
|
+
/** What a viewer opens on when it is handed nothing, kept stable for the memo. */
|
|
39
|
+
const NO_SPECTRA = [];
|
|
40
|
+
/** What a viewer the host adds no panel to offers, kept stable for the memo. */
|
|
41
|
+
const NO_PANELS = [];
|
|
42
|
+
//# sourceMappingURL=MassEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MassEditor.js","sourceRoot":"","sources":["../../../src/mass/ui/MassEditor.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAO9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAwDnD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EACJ,IAAI,GAAG,UAAU,EACjB,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,MAAM,GAAG,SAAS,EAClB,WAAW,EACX,GAAG,GACJ,GAAG,KAAK,CAAC;IAEV,MAAM,MAAM,GAAG,aAAa,CAAC;QAC3B,OAAO,EAAE,IAAI;QACb,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC/C,GAAG,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;QACvE,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;KAChD,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,iBAAiB,IAAC,MAAM,EAAE,MAAM,YAK/B,KAAC,UAAU,IAAC,KAAK,EAAE,eAAe,YAChC,KAAC,SAAS,IACR,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,MAAM,KACV,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,GACtD,GACS,GACK,CACrB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,eAAe,GAAG,EAAE,SAAS,EAAE,CAAC,EAAW,CAAC;AAElD,kFAAkF;AAClF,MAAM,UAAU,GAAmB,EAAE,CAAC;AAEtC,gFAAgF;AAChF,MAAM,SAAS,GAA6B,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bar across the top: the mark on the left, the viewer on the right.
|
|
3
|
+
*
|
|
4
|
+
* Nothing that is done to the spectra is here — that is the rail down the left
|
|
5
|
+
* and the panels down the right — only what is asked of the viewer itself. The
|
|
6
|
+
* mark is the About button, in the corner the infrared viewer puts its own, so
|
|
7
|
+
* a chemist switching between the two looks in one place for what they are in;
|
|
8
|
+
* and help then full screen close the bar, hard against the right edge.
|
|
9
|
+
* @returns The header.
|
|
10
|
+
*/
|
|
11
|
+
export declare function MassHeader(): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=MassHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MassHeader.d.ts","sourceRoot":"","sources":["../../../src/mass/ui/MassHeader.tsx"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,wBAAgB,UAAU,gCAsBzB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Header, Toolbar, useFullscreen } from 'react-science/ui';
|
|
3
|
+
import { MassLogo } from "./MassLogo.js";
|
|
4
|
+
import { useMassCommandProps } from "./massCommandContext.js";
|
|
5
|
+
/**
|
|
6
|
+
* The bar across the top: the mark on the left, the viewer on the right.
|
|
7
|
+
*
|
|
8
|
+
* Nothing that is done to the spectra is here — that is the rail down the left
|
|
9
|
+
* and the panels down the right — only what is asked of the viewer itself. The
|
|
10
|
+
* mark is the About button, in the corner the infrared viewer puts its own, so
|
|
11
|
+
* a chemist switching between the two looks in one place for what they are in;
|
|
12
|
+
* and help then full screen close the bar, hard against the right edge.
|
|
13
|
+
* @returns The header.
|
|
14
|
+
*/
|
|
15
|
+
export function MassHeader() {
|
|
16
|
+
const command = useMassCommandProps();
|
|
17
|
+
const { isFullScreen } = useFullscreen();
|
|
18
|
+
return (_jsxs(Header, { children: [_jsx(Toolbar, { "aria-label": "Mass spectrum viewer", children: _jsx(Toolbar.Item, { icon: _jsx(MassLogo, { size: 16 }), ...command('about') }) }), _jsxs(Toolbar, { "aria-label": "Mass spectrum viewer help", children: [_jsx(Toolbar.Item, { icon: "help", ...command('documentation') }), _jsx(Toolbar.Item, { icon: "fullscreen", active: isFullScreen, ...command('fullScreen') })] })] }));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=MassHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MassHeader.js","sourceRoot":"","sources":["../../../src/mass/ui/MassHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAgB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAA0B,CAAC;AAE/D;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU;IACxB,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IACtC,MAAM,EAAE,YAAY,EAAE,GAAG,aAAa,EAAE,CAAC;IAEzC,OAAO,CACL,MAAC,MAAM,eACL,KAAC,OAAO,kBAAY,sBAAsB,YACxC,KAAC,OAAO,CAAC,IAAI,IAAC,IAAI,EAAE,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,GAAI,KAAM,OAAO,CAAC,OAAO,CAAC,GAAI,GAC5D,EACV,MAAC,OAAO,kBAAY,2BAA2B,aAC7C,KAAC,OAAO,CAAC,IAAI,IAAC,IAAI,EAAC,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,GAAI,EAI1D,KAAC,OAAO,CAAC,IAAI,IACX,IAAI,EAAC,YAAY,EACjB,MAAM,EAAE,YAAY,KAChB,OAAO,CAAC,YAAY,CAAC,GACzB,IACM,IACH,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
export interface MassLogoProps {
|
|
3
|
+
/**
|
|
4
|
+
* Width and height of the mark, in pixels.
|
|
5
|
+
* @default 16
|
|
6
|
+
*/
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The viewer's mark: a labelled spectrum, drawn the way the chart draws one.
|
|
11
|
+
*
|
|
12
|
+
* Three sticks on a baseline with a triangle on the tallest — the same shapes,
|
|
13
|
+
* the same blue and the same orange the chart itself uses, so the mark is a
|
|
14
|
+
* small piece of the tool's output rather than a picture of it. Three sticks is
|
|
15
|
+
* what survives being shrunk to a toolbar icon; a fourth closes the gaps between
|
|
16
|
+
* them and the mark reads as a solid block at 16 pixels.
|
|
17
|
+
* @param props - Component props.
|
|
18
|
+
* @returns The mark, as SVG.
|
|
19
|
+
*/
|
|
20
|
+
export declare function MassLogo(props: MassLogoProps): ReactElement;
|
|
21
|
+
//# sourceMappingURL=MassLogo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MassLogo.d.ts","sourceRoot":"","sources":["../../../src/mass/ui/MassLogo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY,CAkC3D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CHART_COLORS } from "../../chart/core/chartTheme.js";
|
|
3
|
+
import { SPECTRUM_COLORS } from "../../chart/core/spectrumColor.js";
|
|
4
|
+
/**
|
|
5
|
+
* The viewer's mark: a labelled spectrum, drawn the way the chart draws one.
|
|
6
|
+
*
|
|
7
|
+
* Three sticks on a baseline with a triangle on the tallest — the same shapes,
|
|
8
|
+
* the same blue and the same orange the chart itself uses, so the mark is a
|
|
9
|
+
* small piece of the tool's output rather than a picture of it. Three sticks is
|
|
10
|
+
* what survives being shrunk to a toolbar icon; a fourth closes the gaps between
|
|
11
|
+
* them and the mark reads as a solid block at 16 pixels.
|
|
12
|
+
* @param props - Component props.
|
|
13
|
+
* @returns The mark, as SVG.
|
|
14
|
+
*/
|
|
15
|
+
export function MassLogo(props) {
|
|
16
|
+
const { size = 16 } = props;
|
|
17
|
+
return (_jsxs("svg", { width: size, height: size, viewBox: VIEW_BOX, role: "img", "aria-label": "Mass spectrum viewer", children: [_jsx("line", { x1: 2, y1: BASELINE, x2: 30, y2: BASELINE, strokeWidth: BASELINE_WIDTH, style: baselineStyle }), STICKS.map((stick) => (_jsx("line", { x1: stick.x, y1: BASELINE, x2: stick.x, y2: stick.top, strokeWidth: STICK_WIDTH, strokeLinecap: "butt", style: stickStyle }, stick.x))), _jsx("path", { d: MARK, style: markStyle })] }));
|
|
18
|
+
}
|
|
19
|
+
/** Cropped to the ink: a mark carrying its own margin reads as the smaller one. */
|
|
20
|
+
const VIEW_BOX = '1 0 30 29';
|
|
21
|
+
/** Where the sticks stand, in the same units. */
|
|
22
|
+
const BASELINE = 27;
|
|
23
|
+
const BASELINE_WIDTH = 1.4;
|
|
24
|
+
const STICK_WIDTH = 2.6;
|
|
25
|
+
/** The base peak in the middle, with a shoulder either side of it. */
|
|
26
|
+
const STICKS = [
|
|
27
|
+
{ x: 6, top: 15 },
|
|
28
|
+
{ x: 16, top: 7 },
|
|
29
|
+
{ x: 26, top: 19 },
|
|
30
|
+
];
|
|
31
|
+
/** The triangle on the base peak: apex on the tip, body clear of it. */
|
|
32
|
+
const MARK = 'M16 6L12.4 0.6L19.6 0.6Z';
|
|
33
|
+
const baselineStyle = { stroke: CHART_COLORS.axis };
|
|
34
|
+
const stickStyle = { stroke: SPECTRUM_COLORS[0] };
|
|
35
|
+
const markStyle = { fill: CHART_COLORS.highlight };
|
|
36
|
+
//# sourceMappingURL=MassLogo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MassLogo.js","sourceRoot":"","sources":["../../../src/mass/ui/MassLogo.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAUpE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,KAAK,CAAC;IAE5B,OAAO,CACL,eACE,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAC,KAAK,gBACC,sBAAsB,aAEjC,eACE,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,QAAQ,EACZ,EAAE,EAAE,EAAE,EACN,EAAE,EAAE,QAAQ,EACZ,WAAW,EAAE,cAAc,EAC3B,KAAK,EAAE,aAAa,GACpB,EACD,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACrB,eAEE,EAAE,EAAE,KAAK,CAAC,CAAC,EACX,EAAE,EAAE,QAAQ,EACZ,EAAE,EAAE,KAAK,CAAC,CAAC,EACX,EAAE,EAAE,KAAK,CAAC,GAAG,EACb,WAAW,EAAE,WAAW,EACxB,aAAa,EAAC,MAAM,EACpB,KAAK,EAAE,UAAU,IAPZ,KAAK,CAAC,CAAC,CAQZ,CACH,CAAC,EACF,eAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,GAAI,IAC/B,CACP,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,MAAM,QAAQ,GAAG,WAAW,CAAC;AAE7B,iDAAiD;AACjD,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,sEAAsE;AACtE,MAAM,MAAM,GAAG;IACb,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;IACjB,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;IACjB,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;CACV,CAAC;AAEX,wEAAwE;AACxE,MAAM,IAAI,GAAG,0BAA0B,CAAC;AAExC,MAAM,aAAa,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,IAAI,EAAW,CAAC;AAE7D,MAAM,UAAU,GAAG,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,EAAW,CAAC;AAE3D,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,YAAY,CAAC,SAAS,EAAW,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { PlotRect } from '../../chart/core/chartGeometry.ts';
|
|
3
|
+
import type { ChartPoint } from '../../chart/core/svgPoint.ts';
|
|
4
|
+
import type { MassReadout } from './useMassPointer.ts';
|
|
5
|
+
export interface MassPointerTrackerProps {
|
|
6
|
+
/** Where the pointer is, `null` whenever it is off the plot. */
|
|
7
|
+
position: ChartPoint | null;
|
|
8
|
+
/** What the axes read under it, `null` whenever it is off the plot. */
|
|
9
|
+
readout: MassReadout | null;
|
|
10
|
+
/** Where the plot sits inside the SVG. */
|
|
11
|
+
plot: PlotRect;
|
|
12
|
+
/**
|
|
13
|
+
* How many decimals the masses on screen are written with.
|
|
14
|
+
* @default 4
|
|
15
|
+
*/
|
|
16
|
+
mzDecimals?: number;
|
|
17
|
+
/**
|
|
18
|
+
* What one unit of the measured intensity is written as.
|
|
19
|
+
* @default 1
|
|
20
|
+
*/
|
|
21
|
+
intensityScale?: number;
|
|
22
|
+
/**
|
|
23
|
+
* The sign that unit carries, `%` on a derived basis. This number stands on
|
|
24
|
+
* its own with nothing beside it to say what it is, so it takes the sign where
|
|
25
|
+
* the axis would otherwise have carried it.
|
|
26
|
+
* @default ''
|
|
27
|
+
*/
|
|
28
|
+
suffix?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The crosshair, and what the axes say where it stands.
|
|
32
|
+
*
|
|
33
|
+
* Two rules rather than one, because both axes are being read: the vertical one
|
|
34
|
+
* answers *what mass is this*, and the horizontal one answers *how tall is that
|
|
35
|
+
* against this*, which is how a peak is judged against its neighbours without
|
|
36
|
+
* counting grid lines. The picked peak within reach is not written here: the
|
|
37
|
+
* guide on its exact m/z and its lit row in the peak table say which it is, and
|
|
38
|
+
* a readout a line longer than the shared chart places would run off the foot
|
|
39
|
+
* of the plot.
|
|
40
|
+
* @param props - Component props.
|
|
41
|
+
* @returns The crosshair, or nothing while the pointer is off the plot.
|
|
42
|
+
*/
|
|
43
|
+
export declare function MassPointerTracker(props: MassPointerTrackerProps): ReactElement | null;
|
|
44
|
+
//# sourceMappingURL=MassPointerTracker.d.ts.map
|