nmrium 0.31.0 → 0.33.0-pre.1667632695
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/lib/component/1d/Chart1D.js +1 -1
- package/lib/component/1d/FooterBanner.js +17 -10
- package/lib/component/1d/LinesSeries.js +1 -1
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/XAxis.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib/component/1d/{Integral.d.ts → integral/Integral.d.ts} +0 -0
- package/lib/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib/component/1d/integral/IntegralIndicator.d.ts +9 -0
- package/lib/component/1d/integral/IntegralIndicator.js +27 -0
- package/lib/component/1d/{IntegralResizable.d.ts → integral/IntegralResizable.d.ts} +0 -0
- package/lib/component/1d/integral/IntegralResizable.js +69 -0
- package/lib/component/1d/{IntegralsSeries.d.ts → integral/IntegralsSeries.d.ts} +0 -0
- package/lib/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib/component/1d/ranges/Range.js +27 -50
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +2 -2
- package/lib/component/2d/Contours.js +61 -42
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/Left1DChart.js +1 -1
- package/lib/component/2d/Top1DChart.js +1 -1
- package/lib/component/2d/Viewer2D.js +11 -14
- package/lib/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib/component/2d/zones/IndicationLines.js +5 -8
- package/lib/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +6 -6
- package/lib/component/SplitPaneWrapper.js +1 -1
- package/lib/component/assignment/actions/initAssignment.js +17 -17
- package/lib/component/assignment/index.js +2 -2
- package/lib/component/context/PreferencesContext.js +3 -6
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/CheckBoxCell.js +1 -1
- package/lib/component/elements/ContextMenu.js +2 -2
- package/lib/component/elements/EditableColumn.d.ts +3 -1
- package/lib/component/elements/EditableColumn.js +21 -8
- package/lib/component/elements/GroupPane.d.ts +12 -0
- package/lib/component/elements/GroupPane.js +14 -0
- package/lib/component/elements/Input.js +7 -4
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/Label.js +1 -2
- package/lib/component/elements/MolecularFormulaInput.js +2 -0
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -1
- package/lib/component/elements/ReactTable/ReactTable.js +72 -38
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +3 -2
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib/component/elements/accordion/Accordion.js +2 -2
- package/lib/component/elements/draggble/useDraggable.js +1 -3
- package/lib/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
- package/lib/component/elements/formik/FormikColorPicker.js +5 -8
- package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib/component/elements/formik/FormikForm.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput.js +12 -20
- package/lib/component/elements/formik/FormikOnChange.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.js +13 -10
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/elements/formik/FormikSlider.d.ts +2 -4
- package/lib/component/elements/formik/FormikSlider.js +8 -11
- package/lib/component/elements/formik/FormikTextarea.js +1 -1
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib/component/elements/popup/Alert/Provider.js +7 -7
- package/lib/component/elements/popup/Alert/index.d.ts +3 -4
- package/lib/component/elements/popup/Alert/index.js +3 -4
- package/lib/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib/component/elements/popup/Modal/Provider.js +16 -31
- package/lib/component/elements/popup/Modal/index.d.ts +4 -5
- package/lib/component/elements/popup/Modal/index.js +4 -5
- package/lib/component/header/Header.js +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib/component/hooks/useCombinedRefs.js +2 -2
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +9 -6
- package/lib/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib/component/hooks/usePanelPreferences.js +9 -7
- package/lib/component/loader/DropZone.js +10 -2
- package/lib/component/modal/AlignSpectraModal.js +1 -1
- package/lib/component/modal/ExportAsMatrixModal.js +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +2 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib/component/modal/PredictSpectraModal.js +5 -5
- package/lib/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib/component/modal/setting/GeneralSettings.js +11 -14
- package/lib/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -1
- package/lib/component/modal/setting/WorkspaceItem.js +36 -48
- package/lib/component/modal/setting/settingsValidation.d.ts +58 -57
- package/lib/component/modal/setting/settingsValidation.js +14 -12
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib/component/panels/InformationPanel.js +52 -56
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +5 -5
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +3 -26
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +3 -3
- package/lib/component/reducer/Reducer.d.ts +26 -45
- package/lib/component/reducer/Reducer.js +13 -12
- package/lib/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/DomainActions.js +52 -69
- package/lib/component/reducer/actions/FiltersActions.js +15 -6
- package/lib/component/reducer/actions/HistoryActions.js +5 -5
- package/lib/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib/component/reducer/actions/LoadActions.js +12 -0
- package/lib/component/reducer/actions/PeaksActions.js +7 -6
- package/lib/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +28 -24
- package/lib/component/reducer/actions/SpectrumsActions.js +13 -6
- package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +28 -41
- package/lib/component/reducer/actions/ZonesActions.js +11 -10
- package/lib/component/reducer/core/Constants.js +1 -1
- package/lib/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrum.js +4 -0
- package/lib/component/reducer/helper/getSpectrum.js +3 -5
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +1 -1
- package/lib/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib/component/reducer/preferences/actions/setPreferences.js +5 -6
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +2 -2
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -4
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib/component/tool/BrushX.js +3 -3
- package/lib/component/tool/BrushXY.js +5 -5
- package/lib/component/tool/CrossLinePointer.js +3 -3
- package/lib/component/toolbar/BasicToolBar.js +9 -8
- package/lib/component/utility/Evaluate.js +2 -2
- package/lib/component/utility/FileUtility.d.ts +2 -9
- package/lib/component/utility/FileUtility.js +11 -28
- package/lib/component/utility/GroupByInfoKey.d.ts +1 -1
- package/lib/component/utility/GroupByInfoKey.js +11 -13
- package/lib/component/utility/PathBuilder.js +1 -1
- package/lib/component/utility/PreferencesHelper.js +2 -3
- package/lib/component/utility/{Export.d.ts → export.d.ts} +0 -0
- package/lib/component/utility/{Export.js → export.js} +54 -73
- package/lib/component/utility/formatNumber.d.ts +6 -1
- package/lib/component/utility/formatNumber.js +5 -4
- package/lib/component/workspaces/Workspace.d.ts +1 -1
- package/lib/component/workspaces/exercise.js +4 -4
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/Filters.d.ts +16 -18
- package/lib/data/Filters.js +16 -18
- package/lib/data/FiltersManager.js +4 -3
- package/lib/data/PredictionManager.js +8 -10
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/SpectraManager.js +25 -60
- package/lib/data/data1d/MultipleAnalysis.js +74 -70
- package/lib/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +24 -25
- package/lib/data/data1d/Spectrum1D/index.js +24 -25
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib/data/data1d/database.js +45 -28
- package/lib/data/data1d/filter1d/apodization.js +2 -1
- package/lib/data/data1d/filter1d/fft.js +24 -7
- package/lib/data/data1d/filter1d/phaseCorrection.js +11 -5
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +10 -20
- package/lib/data/data2d/Spectrum2D/contours.d.ts +40 -0
- package/lib/data/data2d/Spectrum2D/contours.js +132 -0
- package/lib/data/data2d/Spectrum2D/index.d.ts +10 -11
- package/lib/data/data2d/Spectrum2D/index.js +10 -11
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/index.d.ts +12 -13
- package/lib/data/types/data2d/Data2D.d.ts +2 -0
- package/lib/data/types/data2d/Datum2D.d.ts +0 -1
- package/lib/data/types/data2d/index.d.ts +8 -9
- package/lib/data/utilities/RangeUtilities.js +13 -9
- package/lib/data/utilities/ZoneUtilities.js +17 -13
- package/lib/data/utilities/calculateSanPlot.d.ts +8 -0
- package/lib/data/utilities/calculateSanPlot.js +31 -0
- package/lib/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib/data/utilities/generateChar.js +8 -6
- package/lib/data/utilities/getAtom.js +1 -1
- package/lib/data/utilities/getAtomsFromMF.js +2 -2
- package/lib/data/utilities/getColor.js +3 -3
- package/lib/data/utilities/getSum.js +6 -3
- package/lib/types/NMRiumGeneralPreferences.d.ts +2 -2
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +16 -9
- package/lib-cjs/component/1d/LinesSeries.js +1 -1
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/XAxis.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib-cjs/component/1d/integral/IntegralIndicator.js +31 -0
- package/lib-cjs/component/1d/integral/IntegralResizable.js +74 -0
- package/lib-cjs/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib-cjs/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib-cjs/component/1d/ranges/Range.js +27 -50
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +2 -2
- package/lib-cjs/component/2d/Contours.js +60 -41
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/Left1DChart.js +1 -1
- package/lib-cjs/component/2d/Top1DChart.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +11 -14
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +5 -8
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib-cjs/component/NMRium.js +7 -7
- package/lib-cjs/component/SplitPaneWrapper.js +1 -1
- package/lib-cjs/component/assignment/actions/initAssignment.js +17 -17
- package/lib-cjs/component/assignment/index.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +3 -6
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/CheckBoxCell.js +1 -1
- package/lib-cjs/component/elements/ContextMenu.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +21 -8
- package/lib-cjs/component/elements/GroupPane.js +18 -0
- package/lib-cjs/component/elements/Input.js +7 -4
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/Label.js +1 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +2 -0
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +71 -37
- package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib-cjs/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib-cjs/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -2
- package/lib-cjs/component/elements/draggble/useDraggable.js +1 -3
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +4 -7
- package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib-cjs/component/elements/formik/FormikForm.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +12 -20
- package/lib-cjs/component/elements/formik/FormikOnChange.js +13 -10
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSlider.js +7 -10
- package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
- package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +8 -8
- package/lib-cjs/component/elements/popup/Alert/index.js +5 -5
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +16 -31
- package/lib-cjs/component/elements/popup/Modal/index.js +7 -7
- package/lib-cjs/component/header/Header.js +1 -1
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib-cjs/component/hooks/useCombinedRefs.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +14 -11
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +9 -7
- package/lib-cjs/component/loader/DropZone.js +10 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib-cjs/component/modal/PredictSpectraModal.js +5 -5
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib-cjs/component/modal/setting/GeneralSettings.js +11 -14
- package/lib-cjs/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +37 -49
- package/lib-cjs/component/modal/setting/settingsValidation.js +14 -12
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib-cjs/component/panels/InformationPanel.js +51 -55
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -25
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +3 -3
- package/lib-cjs/component/reducer/Reducer.js +12 -11
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +52 -69
- package/lib-cjs/component/reducer/actions/FiltersActions.js +15 -6
- package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
- package/lib-cjs/component/reducer/actions/PeaksActions.js +7 -6
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib-cjs/component/reducer/actions/RangesActions.js +28 -24
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +12 -5
- package/lib-cjs/component/reducer/actions/ToolsActions.js +28 -41
- package/lib-cjs/component/reducer/actions/ZonesActions.js +11 -10
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib-cjs/component/reducer/helper/getActiveSpectrum.js +8 -0
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -5
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +5 -9
- package/lib-cjs/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib-cjs/component/tool/BrushX.js +3 -3
- package/lib-cjs/component/tool/BrushXY.js +5 -5
- package/lib-cjs/component/tool/CrossLinePointer.js +3 -3
- package/lib-cjs/component/toolbar/BasicToolBar.js +8 -7
- package/lib-cjs/component/utility/Evaluate.js +2 -2
- package/lib-cjs/component/utility/FileUtility.js +11 -29
- package/lib-cjs/component/utility/GroupByInfoKey.js +11 -13
- package/lib-cjs/component/utility/PathBuilder.js +1 -1
- package/lib-cjs/component/utility/PreferencesHelper.js +2 -3
- package/lib-cjs/component/utility/{Export.js → export.js} +78 -74
- package/lib-cjs/component/utility/formatNumber.js +5 -4
- package/lib-cjs/component/workspaces/exercise.js +4 -4
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib-cjs/data/Filters.js +17 -35
- package/lib-cjs/data/FiltersManager.js +4 -3
- package/lib-cjs/data/PredictionManager.js +8 -10
- package/lib-cjs/data/SpectraManager.js +26 -62
- package/lib-cjs/data/data1d/MultipleAnalysis.js +74 -70
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/index.js +25 -25
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib-cjs/data/data1d/database.js +45 -28
- package/lib-cjs/data/data1d/filter1d/apodization.js +2 -1
- package/lib-cjs/data/data1d/filter1d/fft.js +23 -6
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +10 -4
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Processing2D.js +10 -20
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +138 -0
- package/lib-cjs/data/data2d/Spectrum2D/index.js +11 -11
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/RangeUtilities.js +13 -9
- package/lib-cjs/data/utilities/ZoneUtilities.js +17 -13
- package/lib-cjs/data/utilities/calculateSanPlot.js +35 -0
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib-cjs/data/utilities/generateChar.js +8 -6
- package/lib-cjs/data/utilities/getAtom.js +1 -1
- package/lib-cjs/data/utilities/getAtomsFromMF.js +2 -2
- package/lib-cjs/data/utilities/getColor.js +3 -3
- package/lib-cjs/data/utilities/getSum.js +6 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +36 -31
- package/lib/component/1d/IntegralResizable.js +0 -72
- package/lib/component/elements/popup/helpers.d.ts +0 -1
- package/lib/component/elements/popup/helpers.js +0 -9
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.js +0 -8
- package/lib/data/data1d/Data1DManager.d.ts +0 -3
- package/lib/data/data1d/Data1DManager.js +0 -98
- package/lib/data/data1d/filter1d/absolute.d.ts +0 -13
- package/lib/data/data1d/filter1d/absolute.js +0 -26
- package/lib/data/data2d/Data2DManager.d.ts +0 -3
- package/lib/data/data2d/Data2DManager.js +0 -34
- package/lib/data/types/data2d/Contour.d.ts +0 -4
- package/lib/data/types/data2d/Contour.js +0 -1
- package/lib/data/types/data2d/Contours.d.ts +0 -2
- package/lib/data/types/data2d/Contours.js +0 -1
- package/lib-cjs/component/1d/IntegralResizable.js +0 -77
- package/lib-cjs/component/elements/popup/helpers.js +0 -13
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +0 -14
- package/lib-cjs/data/data1d/Data1DManager.js +0 -104
- package/lib-cjs/data/data1d/filter1d/absolute.js +0 -32
- package/lib-cjs/data/data2d/Data2DManager.js +0 -40
- package/lib-cjs/data/types/data2d/Contour.js +0 -2
- package/lib-cjs/data/types/data2d/Contours.js +0 -2
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export { initiateDatum1D, toJSON, autoPeakPicking, optimizePeaks, getShiftX, lookupPeak, checkRangeKind, checkIntegralKind, isSpectrum1D, generateSpectrumFromPublicationString, getReferenceShift, updateIntegralsRelativeValues, updateRangesRelativeValues, changeIntegralsRelative, addRange, changeRangeSignal, detectRanges, detectRange, changeRange, changeRangeRelativeValue, updateXShift, mapRanges, generateSpectrumFromRanges, get1DDataXY, };
|
|
1
|
+
export { generateSpectrumFromPublicationString } from './generateSpectrumFromPublicationString';
|
|
2
|
+
export { get1DDataXY } from './get1DDataXY';
|
|
3
|
+
export { getReferenceShift } from './getReferenceShift';
|
|
4
|
+
export { initiateDatum1D } from './initiateDatum1D';
|
|
5
|
+
export { changeIntegralsRelative } from './integrals/changeIntegralsRelative';
|
|
6
|
+
export { checkIntegralKind } from './integrals/checkIntegralKind';
|
|
7
|
+
export { updateIntegralsRelativeValues } from './integrals/updateIntegralsRelativeValues';
|
|
8
|
+
export { isSpectrum1D } from './isSpectrum1D';
|
|
9
|
+
export { autoPeakPicking } from './peaks/autoPeakPicking';
|
|
10
|
+
export { lookupPeak } from './peaks/lookupPeak';
|
|
11
|
+
export { optimizePeaks } from './peaks/optimizePeaks';
|
|
12
|
+
export { addRange } from './ranges/addRange';
|
|
13
|
+
export { changeRange } from './ranges/changeRange';
|
|
14
|
+
export { changeRangeRelativeValue } from './ranges/changeRangeRelativeValue';
|
|
15
|
+
export { changeRangeSignal } from './ranges/changeRangeSignal';
|
|
16
|
+
export { checkRangeKind } from './ranges/checkRangeKind';
|
|
17
|
+
export { detectRange } from './ranges/detectRange';
|
|
18
|
+
export { detectRanges } from './ranges/detectRanges';
|
|
19
|
+
export { generateSpectrumFromRanges } from './ranges/generateSpectrumFromRanges';
|
|
20
|
+
export { mapRanges } from './ranges/mapRanges';
|
|
21
|
+
export { updateRangesRelativeValues } from './ranges/updateRangesRelativeValues';
|
|
22
|
+
export { getShiftX } from './shift/getShiftX';
|
|
23
|
+
export { updateXShift } from './shift/updateXShift';
|
|
24
|
+
export { toJSON } from './toJSON';
|
|
@@ -19,7 +19,7 @@ export function initiateDatum1D(options, usedColors = {}) {
|
|
|
19
19
|
...options.source,
|
|
20
20
|
};
|
|
21
21
|
datum.display = {
|
|
22
|
-
name: options.display?.name
|
|
22
|
+
name: options.display?.name || v4(),
|
|
23
23
|
...getColor(options, usedColors),
|
|
24
24
|
isVisible: true,
|
|
25
25
|
isPeaksMarkersVisible: true,
|
|
@@ -2,15 +2,16 @@ export function changeIntegralsRelative(datum, newIntegral) {
|
|
|
2
2
|
const index = datum.integrals.values.findIndex((integral) => integral.id === newIntegral.id);
|
|
3
3
|
if (index !== -1) {
|
|
4
4
|
const ratio = datum.integrals.values[index].absolute / newIntegral.value;
|
|
5
|
-
const
|
|
5
|
+
const result = { values: [], sum: 0 };
|
|
6
|
+
for (const [index, integral] of datum.integrals.values.entries()) {
|
|
6
7
|
const newIntegralValue = integral.absolute / ratio;
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
result.sum += newIntegralValue;
|
|
9
|
+
result.values[index] = {
|
|
9
10
|
...integral,
|
|
10
11
|
integral: newIntegralValue,
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
}
|
|
14
|
+
const { values, sum } = result;
|
|
14
15
|
datum.integrals.values = values;
|
|
15
16
|
datum.integrals.options = {
|
|
16
17
|
...datum.integrals.options,
|
|
@@ -4,17 +4,15 @@ export function updateRelatives(data, key, check, forceCalculateIntegral = false
|
|
|
4
4
|
const currentSum = getSum(values, 'absolute', check);
|
|
5
5
|
let factor = 0;
|
|
6
6
|
if (options.sum) {
|
|
7
|
-
if (
|
|
8
|
-
factor = currentSum > 0 ? options.sum / currentSum : 0
|
|
7
|
+
if (options.isSumConstant || forceCalculateIntegral) {
|
|
8
|
+
factor = currentSum > 0 ? options.sum / currentSum : 0;
|
|
9
9
|
}
|
|
10
|
-
else if (
|
|
11
|
-
const item =
|
|
12
|
-
factor =
|
|
13
|
-
(item[key] ? item[key] : options.sum) /
|
|
14
|
-
item.absolute;
|
|
10
|
+
else if (values?.[0]) {
|
|
11
|
+
const item = values[0];
|
|
12
|
+
factor = (item[key] || options.sum) / item.absolute;
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
|
-
data.values =
|
|
15
|
+
data.values = values.map((value) => {
|
|
18
16
|
return {
|
|
19
17
|
...value,
|
|
20
18
|
...(check(value) && {
|
|
@@ -22,7 +20,7 @@ export function updateRelatives(data, key, check, forceCalculateIntegral = false
|
|
|
22
20
|
}),
|
|
23
21
|
};
|
|
24
22
|
});
|
|
25
|
-
if (!
|
|
26
|
-
|
|
23
|
+
if (!options.isSumConstant && !forceCalculateIntegral) {
|
|
24
|
+
options.sum = getSum(values, key, check);
|
|
27
25
|
}
|
|
28
26
|
}
|
|
@@ -10,7 +10,7 @@ export function lookupPeak(data, options) {
|
|
|
10
10
|
const dataRange = data.re.slice(minIndex, maxIndex);
|
|
11
11
|
if (dataRange && dataRange.length > 0) {
|
|
12
12
|
const yValue = max(dataRange);
|
|
13
|
-
const xIndex = dataRange.
|
|
13
|
+
const xIndex = dataRange.indexOf(yValue);
|
|
14
14
|
const xValue = data.x[minIndex + xIndex];
|
|
15
15
|
return { x: xValue, y: yValue, xIndex: minIndex + xIndex };
|
|
16
16
|
}
|
|
@@ -5,8 +5,8 @@ export function optimizePeaks(datum1D, options) {
|
|
|
5
5
|
const { from, to, peaks } = options;
|
|
6
6
|
const { originFrequency: frequency } = datum1D.info;
|
|
7
7
|
let { re, x } = datum1D.data;
|
|
8
|
-
const fromIndex = xFindClosestIndex(
|
|
9
|
-
const ToIndex = xFindClosestIndex(
|
|
8
|
+
const fromIndex = xFindClosestIndex(x, from);
|
|
9
|
+
const ToIndex = xFindClosestIndex(x, to);
|
|
10
10
|
// create deleted peaks object where the key is the id of the peaks that we need to remove
|
|
11
11
|
const ids = {};
|
|
12
12
|
for (const peak of peaks) {
|
|
@@ -7,7 +7,7 @@ import { mapRanges } from './mapRanges';
|
|
|
7
7
|
import { updateRangesRelativeValues } from './updateRangesRelativeValues';
|
|
8
8
|
export function createRangeObj({ from, to, absolute, id, signal, }) {
|
|
9
9
|
return {
|
|
10
|
-
id: id
|
|
10
|
+
id: id || v4(),
|
|
11
11
|
from,
|
|
12
12
|
to,
|
|
13
13
|
absolute,
|
|
@@ -53,7 +53,8 @@ export function addRange(datum, options) {
|
|
|
53
53
|
updateRangesRelativeValues(datum);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
catch (
|
|
56
|
+
catch (error) {
|
|
57
|
+
reportError(error);
|
|
57
58
|
throw new Error('Could not calculate the multiplicity');
|
|
58
59
|
}
|
|
59
60
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { xyIntegration } from 'ml-spectra-processing';
|
|
2
2
|
import { updateRangesRelativeValues } from './updateRangesRelativeValues';
|
|
3
3
|
export function changeRange(datum, range) {
|
|
4
|
-
const { from, to } = range;
|
|
4
|
+
const { from, to, id } = range;
|
|
5
5
|
const { x, re } = datum.data;
|
|
6
|
-
const index = datum.ranges.values.findIndex((i) => i.id ===
|
|
6
|
+
const index = datum.ranges.values.findIndex((i) => i.id === id);
|
|
7
7
|
const absolute = xyIntegration({ x, y: re }, { from, to, reverse: true });
|
|
8
8
|
if (index !== -1) {
|
|
9
9
|
datum.ranges.values[index] = {
|
|
@@ -9,5 +9,39 @@ export declare function initiateRanges(options: Partial<{
|
|
|
9
9
|
sumAuto: boolean;
|
|
10
10
|
};
|
|
11
11
|
} & Ranges & {
|
|
12
|
-
values:
|
|
12
|
+
values: {
|
|
13
|
+
kind: string;
|
|
14
|
+
originFrom: number;
|
|
15
|
+
originTo: number;
|
|
16
|
+
id: string;
|
|
17
|
+
absolute: number;
|
|
18
|
+
signals: {
|
|
19
|
+
originDelta: number;
|
|
20
|
+
peaks?: import("nmr-processing").NMRPeak1D[] | undefined;
|
|
21
|
+
delta: number;
|
|
22
|
+
js?: import("nmr-processing").Jcoupling[] | undefined;
|
|
23
|
+
atoms?: number[] | undefined;
|
|
24
|
+
assignment?: string | undefined;
|
|
25
|
+
multiplicity?: string | undefined;
|
|
26
|
+
diaIDs?: string[] | undefined;
|
|
27
|
+
nbAtoms?: number | undefined;
|
|
28
|
+
integration?: number | undefined;
|
|
29
|
+
statistic?: {
|
|
30
|
+
mean: number;
|
|
31
|
+
sd: number;
|
|
32
|
+
min: number;
|
|
33
|
+
max: number;
|
|
34
|
+
nb: number;
|
|
35
|
+
} | undefined;
|
|
36
|
+
kind: string;
|
|
37
|
+
id: string;
|
|
38
|
+
}[];
|
|
39
|
+
integration: number;
|
|
40
|
+
nbAtoms?: number | undefined;
|
|
41
|
+
from: number;
|
|
42
|
+
to: number;
|
|
43
|
+
multiplicity?: string | undefined;
|
|
44
|
+
diaIDs?: string[] | undefined;
|
|
45
|
+
pubIntegral?: number | undefined;
|
|
46
|
+
}[];
|
|
13
47
|
};
|
|
@@ -1,2 +1,36 @@
|
|
|
1
1
|
import { Datum1D, Range } from '../../../types/data1d';
|
|
2
|
-
export declare function mapRanges(ranges: Range[], datum: Datum1D):
|
|
2
|
+
export declare function mapRanges(ranges: Range[], datum: Datum1D): {
|
|
3
|
+
kind: string;
|
|
4
|
+
originFrom: number;
|
|
5
|
+
originTo: number;
|
|
6
|
+
id: string;
|
|
7
|
+
absolute: number;
|
|
8
|
+
signals: {
|
|
9
|
+
originDelta: number;
|
|
10
|
+
peaks?: import("nmr-processing").NMRPeak1D[] | undefined;
|
|
11
|
+
delta: number;
|
|
12
|
+
js?: import("nmr-processing").Jcoupling[] | undefined;
|
|
13
|
+
atoms?: number[] | undefined;
|
|
14
|
+
assignment?: string | undefined;
|
|
15
|
+
multiplicity?: string | undefined;
|
|
16
|
+
diaIDs?: string[] | undefined;
|
|
17
|
+
nbAtoms?: number | undefined;
|
|
18
|
+
integration?: number | undefined;
|
|
19
|
+
statistic?: {
|
|
20
|
+
mean: number;
|
|
21
|
+
sd: number;
|
|
22
|
+
min: number;
|
|
23
|
+
max: number;
|
|
24
|
+
nb: number;
|
|
25
|
+
} | undefined;
|
|
26
|
+
kind: string;
|
|
27
|
+
id: string;
|
|
28
|
+
}[];
|
|
29
|
+
integration: number;
|
|
30
|
+
nbAtoms?: number | undefined;
|
|
31
|
+
from: number;
|
|
32
|
+
to: number;
|
|
33
|
+
multiplicity?: string | undefined;
|
|
34
|
+
diaIDs?: string[] | undefined;
|
|
35
|
+
pubIntegral?: number | undefined;
|
|
36
|
+
}[];
|
|
@@ -16,9 +16,9 @@ export function mapRanges(ranges, datum) {
|
|
|
16
16
|
const { x, re } = datum.data;
|
|
17
17
|
const shiftX = getShiftX(datum);
|
|
18
18
|
const error = getSpectrumErrorValue(datum);
|
|
19
|
-
return ranges
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
return ranges
|
|
20
|
+
.filter((r) => !checkRange(r, datum, error) || r.id === 'new')
|
|
21
|
+
.map((newRange) => {
|
|
22
22
|
const absolute = xyIntegration({ x, y: re }, { from: newRange.from, to: newRange.to, reverse: true });
|
|
23
23
|
const signals = newRange.signals.map((signal) => {
|
|
24
24
|
const { kind = null, id, ...resSignal } = signal;
|
|
@@ -29,7 +29,7 @@ export function mapRanges(ranges, datum) {
|
|
|
29
29
|
...resSignal,
|
|
30
30
|
};
|
|
31
31
|
});
|
|
32
|
-
|
|
32
|
+
return {
|
|
33
33
|
...newRange,
|
|
34
34
|
kind: signals?.[0].kind || DatumKind.signal,
|
|
35
35
|
originFrom: newRange.from - shiftX,
|
|
@@ -37,7 +37,6 @@ export function mapRanges(ranges, datum) {
|
|
|
37
37
|
id: newRange.id || v4(),
|
|
38
38
|
absolute,
|
|
39
39
|
signals,
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
}, []);
|
|
40
|
+
};
|
|
41
|
+
});
|
|
43
42
|
}
|
|
@@ -23,7 +23,7 @@ function processSearchByStructure(moleculesDB, idCode) {
|
|
|
23
23
|
// https://github.com/cheminfo/openchemlib-utils/blob/ef3a9c30be7efe225a24de04ea9cefc9299674aa/src/db/MoleculesDB.js#L102-L115
|
|
24
24
|
// todo: idCode may be null and the current version of search requires a string or molecule. `|| ''` will become useless in next release of openchemlib-util
|
|
25
25
|
const result = moleculesDB.search(idCode || '');
|
|
26
|
-
return result.map((entry) => entry.data
|
|
26
|
+
return result.map((entry) => entry.data);
|
|
27
27
|
}
|
|
28
28
|
function prepareGetSolvents(data) {
|
|
29
29
|
const result = [];
|
|
@@ -53,9 +53,10 @@ function prepareMoleculesDB(array) {
|
|
|
53
53
|
index: entry.ocl.index,
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
catch (
|
|
56
|
+
catch (error) {
|
|
57
|
+
reportError(error);
|
|
57
58
|
// eslint-disable-next-line no-console
|
|
58
|
-
console.
|
|
59
|
+
console.error(`Could not parse idCode: ${JSON.stringify(entry.ocl)}`);
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
else if (entry.smiles) {
|
|
@@ -63,9 +64,10 @@ function prepareMoleculesDB(array) {
|
|
|
63
64
|
const molecule = OCL.Molecule.fromSmiles(entry.smiles);
|
|
64
65
|
moleculesDB.pushEntry(molecule, entry);
|
|
65
66
|
}
|
|
66
|
-
catch (
|
|
67
|
+
catch (error) {
|
|
68
|
+
reportError(error);
|
|
67
69
|
// eslint-disable-next-line no-console
|
|
68
|
-
console.
|
|
70
|
+
console.error(`Could not parse smiles: ${entry.smiles}`);
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
}
|
|
@@ -78,30 +80,41 @@ function prepareDataBase(array) {
|
|
|
78
80
|
...range,
|
|
79
81
|
}));
|
|
80
82
|
return item;
|
|
81
|
-
}
|
|
83
|
+
});
|
|
82
84
|
}
|
|
83
85
|
export function prepareData(data) {
|
|
84
86
|
const result = [];
|
|
85
87
|
let index = 0;
|
|
86
88
|
for (const item of data) {
|
|
87
89
|
let ids = [];
|
|
88
|
-
const { ranges
|
|
89
|
-
|
|
90
|
-
ids.push(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
90
|
+
const { ranges, ...restItemKeys } = item;
|
|
91
|
+
if (!ranges) {
|
|
92
|
+
ids.push(v4());
|
|
93
|
+
result.push({
|
|
94
|
+
...restItemKeys,
|
|
95
|
+
index,
|
|
96
|
+
id: ids,
|
|
97
|
+
ranges: [],
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
for (const range of ranges) {
|
|
102
|
+
ids.push(range.id || v4());
|
|
103
|
+
const { signals = [], ...restRangKeys } = range;
|
|
104
|
+
for (const signal of signals) {
|
|
105
|
+
const { js = [], ...restSignalKeys } = signal;
|
|
106
|
+
const jsResult = mapJs(js);
|
|
107
|
+
const data = {
|
|
108
|
+
...restItemKeys,
|
|
109
|
+
...restRangKeys,
|
|
110
|
+
...restSignalKeys,
|
|
111
|
+
...jsResult,
|
|
112
|
+
index,
|
|
113
|
+
id: ids,
|
|
114
|
+
ranges,
|
|
115
|
+
};
|
|
116
|
+
result.push(data);
|
|
117
|
+
}
|
|
105
118
|
}
|
|
106
119
|
}
|
|
107
120
|
index++;
|
|
@@ -110,11 +123,15 @@ export function prepareData(data) {
|
|
|
110
123
|
}
|
|
111
124
|
function mapJs(js) {
|
|
112
125
|
if (js && js.length > 0) {
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
126
|
+
const result = {
|
|
127
|
+
coupling: [],
|
|
128
|
+
multiplicity: '',
|
|
129
|
+
};
|
|
130
|
+
for (const { coupling, multiplicity } of js) {
|
|
131
|
+
result.coupling.push(coupling);
|
|
132
|
+
result.multiplicity += multiplicity;
|
|
133
|
+
}
|
|
134
|
+
const { coupling, multiplicity } = result;
|
|
118
135
|
return { multiplicity, coupling: coupling.join(',') };
|
|
119
136
|
}
|
|
120
137
|
else {
|
|
@@ -10,7 +10,8 @@ export function apply(datum1D, options) {
|
|
|
10
10
|
const newData = apodizationFilter(datum1D, options);
|
|
11
11
|
datum1D.data = {
|
|
12
12
|
...datum1D.data,
|
|
13
|
-
|
|
13
|
+
re: newData.re,
|
|
14
|
+
im: newData.im,
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
export function isApplicable(datum1D) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reimFFT, reimPhaseCorrection } from 'ml-spectra-processing';
|
|
1
|
+
import { reimFFT, reimPhaseCorrection, xMean } from 'ml-spectra-processing';
|
|
2
2
|
import { padDataToNextPowerOfTwo } from './utils/padDataToNextPowerOfTwo';
|
|
3
3
|
export const id = 'fft';
|
|
4
4
|
export const name = 'FFT';
|
|
@@ -11,19 +11,22 @@ export function apply(datum1D) {
|
|
|
11
11
|
throw new Error('fft not applicable on this data');
|
|
12
12
|
}
|
|
13
13
|
let digitalFilterApplied = datum1D.filters.some((e) => e.name === 'digitalFilter' && e.flag);
|
|
14
|
-
const
|
|
14
|
+
const data = datum1D.meta.AQ_mod === 1
|
|
15
|
+
? removeDCOffset(datum1D, digitalFilterApplied)
|
|
16
|
+
: { ...datum1D.data };
|
|
15
17
|
if (data.x.length !== data.re.length || data.x.length !== data.im.length) {
|
|
16
18
|
throw new Error('The length of data should be equal');
|
|
17
19
|
}
|
|
18
20
|
else if (!isPowerOfTwo(datum1D.data.x.length)) {
|
|
19
21
|
padDataToNextPowerOfTwo(datum1D, digitalFilterApplied);
|
|
20
22
|
}
|
|
21
|
-
Object.assign(
|
|
23
|
+
Object.assign(data, reimFFT(data, { applyZeroShift: true }));
|
|
22
24
|
if (digitalFilterApplied) {
|
|
23
25
|
let { digitalFilter = 0 } = datum1D.info;
|
|
24
26
|
let ph1 = (digitalFilter - Math.floor(digitalFilter)) * Math.PI * 2;
|
|
25
|
-
Object.assign(
|
|
27
|
+
Object.assign(data, reimPhaseCorrection(data, 0, ph1));
|
|
26
28
|
}
|
|
29
|
+
Object.assign(datum1D.data, data);
|
|
27
30
|
datum1D.data.x = generateXAxis(datum1D);
|
|
28
31
|
datum1D.info = { ...datum1D.info, isFid: false, isFt: true };
|
|
29
32
|
}
|
|
@@ -40,9 +43,9 @@ export function reduce() {
|
|
|
40
43
|
}
|
|
41
44
|
function generateXAxis(datum1D) {
|
|
42
45
|
const info = datum1D.info;
|
|
43
|
-
const baseFrequency = parseFloat(info.baseFrequency);
|
|
44
|
-
const frequencyOffset = parseFloat(info.frequencyOffset);
|
|
45
|
-
const spectralWidth = parseFloat(info.spectralWidth);
|
|
46
|
+
const baseFrequency = Number.parseFloat(info.baseFrequency);
|
|
47
|
+
const frequencyOffset = Number.parseFloat(info.frequencyOffset);
|
|
48
|
+
const spectralWidth = Number.parseFloat(info.spectralWidth);
|
|
46
49
|
const offset = frequencyOffset / baseFrequency;
|
|
47
50
|
let spectralHalfWidth = 0.5 * spectralWidth;
|
|
48
51
|
let nbPoints = datum1D.data.x.length;
|
|
@@ -58,3 +61,17 @@ function generateXAxis(datum1D) {
|
|
|
58
61
|
function isPowerOfTwo(n) {
|
|
59
62
|
return n !== 0 && (n & (n - 1)) === 0;
|
|
60
63
|
}
|
|
64
|
+
function removeDCOffset(datum1D, digitalFilterApplied) {
|
|
65
|
+
let { digitalFilter = 0 } = digitalFilterApplied ? datum1D.info : {};
|
|
66
|
+
const data = { ...datum1D.data };
|
|
67
|
+
const nbPoints = data.re.length;
|
|
68
|
+
const newRe = new Float64Array(data.re);
|
|
69
|
+
const newIm = new Float64Array(data.im);
|
|
70
|
+
const averageRe = xMean(data.re.slice((nbPoints * 0.75) >> 0, nbPoints - digitalFilter));
|
|
71
|
+
const averageIm = xMean(data.im.slice((nbPoints * 0.75) >> 0, nbPoints - digitalFilter));
|
|
72
|
+
for (let i = digitalFilterApplied ? 0 : digitalFilter; i < nbPoints - digitalFilter; i++) {
|
|
73
|
+
newRe[i] -= averageRe;
|
|
74
|
+
newIm[i] -= averageIm;
|
|
75
|
+
}
|
|
76
|
+
return { x: data.x, re: newRe, im: newIm };
|
|
77
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reimPhaseCorrection } from 'ml-spectra-processing';
|
|
1
|
+
import { reimAbsolute, reimPhaseCorrection } from 'ml-spectra-processing';
|
|
2
2
|
export const id = 'phaseCorrection';
|
|
3
3
|
export const name = 'Phase correction';
|
|
4
4
|
/**
|
|
@@ -12,10 +12,16 @@ export function apply(datum1D, options = {}) {
|
|
|
12
12
|
if (!isApplicable(datum1D)) {
|
|
13
13
|
throw new Error('phaseCorrection not applicable on this data');
|
|
14
14
|
}
|
|
15
|
-
let { ph0, ph1 } = options;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
let { ph0, ph1, absolute } = options;
|
|
16
|
+
if (absolute) {
|
|
17
|
+
datum1D.data.re = reimAbsolute(datum1D.data);
|
|
18
|
+
datum1D.data.im = new Float64Array(0);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
ph0 *= Math.PI / 180;
|
|
22
|
+
ph1 *= Math.PI / 180;
|
|
23
|
+
Object.assign(datum1D.data, reimPhaseCorrection(datum1D.data, ph0, ph1));
|
|
24
|
+
}
|
|
19
25
|
}
|
|
20
26
|
export function isApplicable(datum1D) {
|
|
21
27
|
if (datum1D.info.isComplex && !datum1D.info.isFid)
|
|
@@ -16,7 +16,7 @@ export function padDataToNextPowerOfTwo(datum1D, digitalFilterApplied) {
|
|
|
16
16
|
size,
|
|
17
17
|
step: x[1] - x[0],
|
|
18
18
|
});
|
|
19
|
-
datum1D.data = { ...datum1D.data,
|
|
19
|
+
datum1D.data = { ...datum1D.data, re: newRE, im: newIM, x: newX };
|
|
20
20
|
}
|
|
21
21
|
function getPointsToShift(datum1D) {
|
|
22
22
|
let grpdly = datum1D.info?.digitalFilter || 0;
|
|
@@ -36,7 +36,7 @@ export function apply(datum1D, size) {
|
|
|
36
36
|
newRE.set(re.slice(re.length - pointsToShift), size - pointsToShift);
|
|
37
37
|
newIM.set(im.slice(re.length - pointsToShift), size - pointsToShift);
|
|
38
38
|
}
|
|
39
|
-
datum1D.data = { ...datum1D.data,
|
|
39
|
+
datum1D.data = { ...datum1D.data, re: newRE, im: newIM, x: newX };
|
|
40
40
|
}
|
|
41
41
|
export function isApplicable(datum1D) {
|
|
42
42
|
if (datum1D.info.isComplex && datum1D.info.isFid)
|
|
@@ -25,8 +25,8 @@ export default class Processing2D {
|
|
|
25
25
|
wheel(value: any): void;
|
|
26
26
|
shiftWheel(value: any): never[] | undefined;
|
|
27
27
|
drawContours(): {
|
|
28
|
-
positive:
|
|
29
|
-
negative:
|
|
28
|
+
positive: any;
|
|
29
|
+
negative: any;
|
|
30
30
|
};
|
|
31
|
-
getContours(zoomLevel: any, options?: any):
|
|
31
|
+
getContours(zoomLevel: any, options?: any): any;
|
|
32
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Conrec } from 'ml-conrec';
|
|
2
|
-
import {
|
|
2
|
+
import { calculateSanPlot } from '../utilities/calculateSanPlot';
|
|
3
3
|
export const defaultContourOptions = {
|
|
4
4
|
positive: {
|
|
5
5
|
contourLevels: [0, 21],
|
|
@@ -11,18 +11,16 @@ export const defaultContourOptions = {
|
|
|
11
11
|
},
|
|
12
12
|
};
|
|
13
13
|
export default class Processing2D {
|
|
14
|
-
constructor(minMax, options = defaultContourOptions, defaultLevel = {
|
|
15
|
-
positive: 10,
|
|
16
|
-
negative: 10,
|
|
17
|
-
}) {
|
|
14
|
+
constructor(minMax, options = defaultContourOptions, defaultLevel = {}) {
|
|
18
15
|
this.options = options;
|
|
19
|
-
const { positive, negative } = defaultLevel;
|
|
16
|
+
const { positive = 10, negative = 10 } = defaultLevel;
|
|
20
17
|
this.currentLevelPositive = positive;
|
|
21
18
|
this.currentLevelNegative = negative;
|
|
22
19
|
const xs = getRange(minMax.minX, minMax.maxX, minMax.z[0].length);
|
|
23
20
|
const ys = getRange(minMax.minY, minMax.maxY, minMax.z.length);
|
|
24
21
|
this.conrec = new Conrec(minMax.z, { xs, ys, swapAxes: false });
|
|
25
|
-
|
|
22
|
+
const sanResult = calculateSanPlot('2D', minMax);
|
|
23
|
+
this.median = sanResult.positive;
|
|
26
24
|
this.minMax = minMax;
|
|
27
25
|
}
|
|
28
26
|
getLevel() {
|
|
@@ -96,19 +94,11 @@ export default class Processing2D {
|
|
|
96
94
|
if (negative) {
|
|
97
95
|
_range = _range.map((value) => -value);
|
|
98
96
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
timeout,
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
catch (e) {
|
|
108
|
-
// eslint-disable-next-line no-console
|
|
109
|
-
console.log(e);
|
|
110
|
-
throw e;
|
|
111
|
-
}
|
|
97
|
+
const contours = this.conrec.drawContour({
|
|
98
|
+
contourDrawer: 'basic',
|
|
99
|
+
levels: _range,
|
|
100
|
+
timeout,
|
|
101
|
+
});
|
|
112
102
|
return Object.freeze(contours);
|
|
113
103
|
}
|
|
114
104
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Datum2D } from '../../types/data2d';
|
|
2
|
+
interface Level {
|
|
3
|
+
positive: number;
|
|
4
|
+
negative: number;
|
|
5
|
+
}
|
|
6
|
+
interface ContourItem {
|
|
7
|
+
contourLevels: [number, number];
|
|
8
|
+
numberOfLayers: number;
|
|
9
|
+
}
|
|
10
|
+
interface ContourOptions {
|
|
11
|
+
positive: ContourItem;
|
|
12
|
+
negative: ContourItem;
|
|
13
|
+
}
|
|
14
|
+
interface ContoursLevels {
|
|
15
|
+
[key: string]: Level;
|
|
16
|
+
}
|
|
17
|
+
declare const DEFAULT_CONTOURS_OPTIONS: {
|
|
18
|
+
positive: {
|
|
19
|
+
contourLevels: number[];
|
|
20
|
+
numberOfLayers: number;
|
|
21
|
+
};
|
|
22
|
+
negative: {
|
|
23
|
+
contourLevels: number[];
|
|
24
|
+
numberOfLayers: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
declare type LevelSign = keyof Level;
|
|
28
|
+
interface ReturnContoursManager {
|
|
29
|
+
wheel: (value: number, shift: boolean) => Level;
|
|
30
|
+
getLevel: () => Level;
|
|
31
|
+
checkLevel: () => Level;
|
|
32
|
+
}
|
|
33
|
+
declare function getDefaultContoursLevel(options: ContourOptions): Level;
|
|
34
|
+
declare function contoursManager(spectrumID: string, state: ContoursLevels, options: ContourOptions): ReturnContoursManager;
|
|
35
|
+
declare function drawContours(level: number, datum: Datum2D, negative?: boolean): {
|
|
36
|
+
contours: any;
|
|
37
|
+
timeout: boolean;
|
|
38
|
+
};
|
|
39
|
+
export { drawContours, contoursManager, getDefaultContoursLevel, DEFAULT_CONTOURS_OPTIONS, };
|
|
40
|
+
export type { ContoursLevels, ReturnContoursManager, Level, LevelSign };
|