nmrium 0.32.0 → 0.33.0-pre.1667755480
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/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/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/KeysListenerTracker.js +14 -15
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +6 -6
- 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.js +3 -5
- 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/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 +4 -4
- 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/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/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 +40 -14
- package/lib/component/reducer/Reducer.js +12 -11
- 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 +49 -67
- package/lib/component/reducer/actions/FiltersActions.js +3 -3
- package/lib/component/reducer/actions/HistoryActions.js +5 -5
- package/lib/component/reducer/actions/LoadActions.js +12 -0
- package/lib/component/reducer/actions/PreferencesActions.js +18 -37
- package/lib/component/reducer/actions/RangesActions.js +14 -12
- package/lib/component/reducer/actions/SpectrumsActions.js +10 -4
- package/lib/component/reducer/actions/ToolsActions.js +20 -35
- package/lib/component/reducer/actions/ZonesActions.js +2 -2
- 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/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/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 +1 -1
- 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} +53 -78
- package/lib/component/utility/formatNumber.d.ts +6 -1
- package/lib/component/utility/formatNumber.js +5 -4
- package/lib/data/Filters.d.ts +16 -17
- package/lib/data/Filters.js +16 -17
- 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 +2 -2
- 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 +7 -18
- 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/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/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- 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/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/KeysListenerTracker.js +14 -15
- package/lib-cjs/component/NMRium.js +7 -7
- 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 +3 -5
- 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/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 +4 -4
- 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/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/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 +11 -10
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +49 -67
- package/lib-cjs/component/reducer/actions/FiltersActions.js +3 -3
- package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
- package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +18 -37
- package/lib-cjs/component/reducer/actions/RangesActions.js +14 -12
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +9 -3
- package/lib-cjs/component/reducer/actions/ToolsActions.js +20 -35
- package/lib-cjs/component/reducer/actions/ZonesActions.js +2 -2
- 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/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 +1 -1
- 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} +77 -79
- package/lib-cjs/component/utility/formatNumber.js +5 -4
- package/lib-cjs/data/Filters.js +17 -33
- 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 +2 -2
- 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 +7 -18
- 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/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 +30 -26
- 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/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/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,9 +1,6 @@
|
|
|
1
|
-
import { CURRENT_EXPORT_VERSION } from 'nmr-load-save';
|
|
2
|
-
import { fromJCAMP } from 'nmr-parser';
|
|
1
|
+
import { CURRENT_EXPORT_VERSION, processJcamp } from 'nmr-load-save';
|
|
3
2
|
import { DISPLAYER_MODE } from '../component/reducer/core/Constants';
|
|
4
|
-
import * as Data1DManager from './data1d/Data1DManager';
|
|
5
3
|
import * as Datum1D from './data1d/Spectrum1D';
|
|
6
|
-
import * as Data2DManager from './data2d/Data2DManager';
|
|
7
4
|
import * as Datum2D from './data2d/Spectrum2D';
|
|
8
5
|
import * as Molecule from './molecules/Molecule';
|
|
9
6
|
export var DataExportOptions;
|
|
@@ -11,6 +8,15 @@ export var DataExportOptions;
|
|
|
11
8
|
DataExportOptions["ROW_DATA"] = "ROW_DATA";
|
|
12
9
|
DataExportOptions["DATA_SOURCE"] = "DATA_SOURCE";
|
|
13
10
|
})(DataExportOptions || (DataExportOptions = {}));
|
|
11
|
+
function getData(datum, usedColors) {
|
|
12
|
+
const dimension = datum.info.dimension;
|
|
13
|
+
if (dimension === 1) {
|
|
14
|
+
return Datum1D.initiateDatum1D(datum, usedColors);
|
|
15
|
+
}
|
|
16
|
+
else if (dimension === 2) {
|
|
17
|
+
return Datum2D.initiateDatum2D(datum, usedColors);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
14
20
|
export function addJcampFromURL(spectra, jcampURL, options, usedColors) {
|
|
15
21
|
return fetch(jcampURL)
|
|
16
22
|
.then((response) => response.arrayBuffer())
|
|
@@ -18,65 +24,26 @@ export function addJcampFromURL(spectra, jcampURL, options, usedColors) {
|
|
|
18
24
|
addJcamp(spectra, jcamp, options, usedColors);
|
|
19
25
|
});
|
|
20
26
|
}
|
|
21
|
-
export function addJcamp(
|
|
27
|
+
export function addJcamp(output, jcamp, options, usedColors) {
|
|
22
28
|
options = options || {};
|
|
23
|
-
const
|
|
24
|
-
|
|
29
|
+
const name = options?.display?.name;
|
|
30
|
+
const { spectra: spectraIn } = processJcamp(jcamp, {
|
|
31
|
+
name,
|
|
32
|
+
noContours: true,
|
|
25
33
|
xy: true,
|
|
26
34
|
keepRecordsRegExp: /.*/,
|
|
27
35
|
profiling: true,
|
|
28
36
|
});
|
|
29
|
-
if (
|
|
37
|
+
if (spectraIn.length === 0)
|
|
30
38
|
return;
|
|
31
|
-
// Should be improved when we have a more complex case
|
|
32
|
-
for (let index = 0; index < entries.length; index++) {
|
|
33
|
-
let entry = entries[index];
|
|
34
|
-
const components = entry.dependentVariables?.[0]?.components;
|
|
35
|
-
if (components && (components.length > 0 || components.z)) {
|
|
36
|
-
addJcampSS(spectra, { index, entry }, options, usedColors);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function addJcampSS(spectra, jcampDatum, options, usedColors) {
|
|
41
|
-
const source = options?.source || {};
|
|
42
|
-
if (!('jcampSpectrumIndex' in source) ||
|
|
43
|
-
source.jcampSpectrumIndex === jcampDatum.index) {
|
|
44
|
-
const dimension = jcampDatum.entry.info.dimension;
|
|
45
|
-
if (dimension === 1) {
|
|
46
|
-
spectra.push(Data1DManager.fromParsedJcamp(jcampDatum.entry, options, usedColors, jcampDatum.index));
|
|
47
|
-
}
|
|
48
|
-
if (dimension === 2) {
|
|
49
|
-
// console.log(options, jcampDatum.entry);
|
|
50
|
-
spectra.push(Data2DManager.fromParsedJcamp(jcampDatum.entry, options, usedColors, jcampDatum.index));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function addData(spectra, datum, usedColors) {
|
|
55
|
-
const dimension = datum.info.dimension;
|
|
56
|
-
if (dimension === 1) {
|
|
57
|
-
spectra.push(Datum1D.initiateDatum1D(datum, usedColors));
|
|
58
|
-
}
|
|
59
|
-
if (dimension === 2) {
|
|
60
|
-
spectra.push(Datum2D.initiateDatum2D(datum, usedColors));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
export async function fromJSON(data = [], usedColors = {}) {
|
|
64
39
|
const spectra = [];
|
|
65
|
-
let
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
else if (jcampURL != null) {
|
|
72
|
-
promises.push(addJcampFromURL(spectra, jcampURL, datum, usedColors));
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
addData(spectra, datum, usedColors);
|
|
76
|
-
}
|
|
40
|
+
for (let spectrum of spectraIn) {
|
|
41
|
+
const data = getData(spectrum, usedColors);
|
|
42
|
+
if (!data)
|
|
43
|
+
continue;
|
|
44
|
+
spectra.push(data);
|
|
77
45
|
}
|
|
78
|
-
|
|
79
|
-
return spectra;
|
|
46
|
+
output.push(...spectra);
|
|
80
47
|
}
|
|
81
48
|
export function addJcamps(files, usedColors) {
|
|
82
49
|
const spectra = [];
|
|
@@ -86,7 +53,7 @@ export function addJcamps(files, usedColors) {
|
|
|
86
53
|
name: file.name,
|
|
87
54
|
},
|
|
88
55
|
source: {
|
|
89
|
-
jcampURL: file.jcampURL
|
|
56
|
+
jcampURL: file.jcampURL || null,
|
|
90
57
|
file,
|
|
91
58
|
},
|
|
92
59
|
}, usedColors);
|
|
@@ -94,12 +61,10 @@ export function addJcamps(files, usedColors) {
|
|
|
94
61
|
return spectra;
|
|
95
62
|
}
|
|
96
63
|
function getPreferences(state) {
|
|
97
|
-
const { activeTab, verticalAlign: { align }, } = state;
|
|
64
|
+
const { activeTab, verticalAlign: { align }, displayerMode, } = state;
|
|
98
65
|
return {
|
|
99
66
|
activeTab,
|
|
100
|
-
...(
|
|
101
|
-
? { verticalAlign: align }
|
|
102
|
-
: {}),
|
|
67
|
+
...(displayerMode === DISPLAYER_MODE.DM_1D ? { verticalAlign: align } : {}),
|
|
103
68
|
};
|
|
104
69
|
}
|
|
105
70
|
export function toJSON(state, target, dataExportOption = DataExportOptions.DATA_SOURCE) {
|
|
@@ -14,9 +14,8 @@ export var COLUMNS_VALUES_KEYS;
|
|
|
14
14
|
COLUMNS_VALUES_KEYS["MAX"] = "max";
|
|
15
15
|
})(COLUMNS_VALUES_KEYS || (COLUMNS_VALUES_KEYS = {}));
|
|
16
16
|
function addColumnKey(spectraAnalysis, nucleus, columnProps, columnKey) {
|
|
17
|
-
const key = columnKey
|
|
18
|
-
|
|
19
|
-
: generateChar(spectraAnalysis[nucleus].options.columnIndex).toUpperCase();
|
|
17
|
+
const key = columnKey ||
|
|
18
|
+
generateChar(spectraAnalysis[nucleus].options.columnIndex).toUpperCase();
|
|
20
19
|
spectraAnalysis[nucleus].options.columns[key] = columnProps;
|
|
21
20
|
spectraAnalysis[nucleus].options.columnIndex++;
|
|
22
21
|
return key;
|
|
@@ -29,16 +28,20 @@ export function getValue(colKey, columns, data) {
|
|
|
29
28
|
}
|
|
30
29
|
export function getSpectraAnalysis(spectra, options) {
|
|
31
30
|
const { from, to, nucleus } = options;
|
|
32
|
-
|
|
31
|
+
const result = {
|
|
32
|
+
values: [],
|
|
33
|
+
sum: 0,
|
|
34
|
+
};
|
|
35
|
+
for (const datum of spectra) {
|
|
33
36
|
if (isSpectrum1D(datum) &&
|
|
34
37
|
datum.info.nucleus === nucleus &&
|
|
35
38
|
!datum.info.isFid) {
|
|
36
39
|
const range = detectRange(datum, { from, to });
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
result.sum += range.absolute;
|
|
41
|
+
result.values.push({ SID: datum.id, ...range });
|
|
39
42
|
}
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
42
45
|
}
|
|
43
46
|
function init(spectraAnalysis, nucleus) {
|
|
44
47
|
if (spectraAnalysis[nucleus] === undefined) {
|
|
@@ -60,61 +63,61 @@ export function changeColumnValueKey(spectraAnalysis, nucleus, columnKey, newKey
|
|
|
60
63
|
export function setColumn(spectraAnalysis, nucleus, { columns: inputColumns, code }) {
|
|
61
64
|
init(spectraAnalysis, nucleus);
|
|
62
65
|
spectraAnalysis[nucleus].options.code = code;
|
|
63
|
-
|
|
66
|
+
const columns = Object.fromEntries(Object.values(inputColumns).map((value) => {
|
|
64
67
|
const data = { ...value };
|
|
65
68
|
delete data.tempKey;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
return [value.tempKey, data];
|
|
70
|
+
}));
|
|
71
|
+
spectraAnalysis[nucleus].options.columns = columns;
|
|
69
72
|
const { columns: newColumns } = spectraAnalysis[nucleus].options;
|
|
70
|
-
let data = Object.entries(spectraAnalysis[nucleus].values).
|
|
71
|
-
|
|
73
|
+
let data = Object.fromEntries(Object.entries(spectraAnalysis[nucleus].values).map(([spectraKey, spectra]) => {
|
|
74
|
+
const result = Object.fromEntries(Object.keys(inputColumns)
|
|
75
|
+
.filter((k) => spectra[k])
|
|
76
|
+
.map((key) => {
|
|
72
77
|
const newKey = inputColumns[key].tempKey;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}, {});
|
|
80
|
-
data = Object.entries(data).reduce((acc, spectra) => {
|
|
81
|
-
acc[spectra[0]] = Object.keys(newColumns).reduce((acc, key) => {
|
|
78
|
+
return [newKey, spectra[key]];
|
|
79
|
+
}));
|
|
80
|
+
return [spectraKey, result];
|
|
81
|
+
}));
|
|
82
|
+
const newData = Object.fromEntries(Object.entries(data).map((spectra) => {
|
|
83
|
+
const result = Object.fromEntries(Object.keys(newColumns).map((key) => {
|
|
82
84
|
const isFormula = newColumns[key].type === COLUMNS_TYPES.FORMULA;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
return [
|
|
86
|
+
key,
|
|
87
|
+
isFormula
|
|
88
|
+
? {
|
|
89
|
+
colKey: key,
|
|
90
|
+
value: calculate(newColumns, data[spectra[0]], newColumns[key].formula),
|
|
91
|
+
}
|
|
92
|
+
: { ...spectra[1][key], colKey: key },
|
|
93
|
+
];
|
|
94
|
+
}));
|
|
95
|
+
return [spectra[0], result];
|
|
96
|
+
}));
|
|
97
|
+
data = newData;
|
|
93
98
|
spectraAnalysis[nucleus].values = data;
|
|
94
99
|
}
|
|
95
100
|
function refreshByRow(row, columns) {
|
|
96
|
-
return Object.keys(columns)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
return Object.fromEntries(Object.keys(columns)
|
|
102
|
+
.filter((k) => columns[k].type === COLUMNS_TYPES.FORMULA)
|
|
103
|
+
.map((key) => [
|
|
104
|
+
key,
|
|
105
|
+
{
|
|
106
|
+
colKey: key,
|
|
107
|
+
...row,
|
|
108
|
+
value: calculate(columns, row, columns[key].formula),
|
|
109
|
+
},
|
|
110
|
+
]));
|
|
106
111
|
}
|
|
107
112
|
function refreshCalculation(spectraAnalysis, nucleus) {
|
|
108
113
|
const { columns } = spectraAnalysis[nucleus].options;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
return Object.fromEntries(Object.entries(spectraAnalysis[nucleus].values).map(([id, row]) => [
|
|
115
|
+
id,
|
|
116
|
+
{
|
|
112
117
|
...row,
|
|
113
118
|
...refreshByRow(row, columns),
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
}, {});
|
|
117
|
-
return data;
|
|
119
|
+
},
|
|
120
|
+
]));
|
|
118
121
|
}
|
|
119
122
|
export function analyzeSpectra(spectra, spectraAnalysis, options) {
|
|
120
123
|
const { from, to, nucleus, columnKey = null } = options;
|
|
@@ -133,31 +136,33 @@ export function analyzeSpectra(spectra, spectraAnalysis, options) {
|
|
|
133
136
|
nucleus,
|
|
134
137
|
});
|
|
135
138
|
const prevNucleusData = lodashGet(spectraAnalysis, `${nucleus}.values`, {});
|
|
136
|
-
|
|
137
|
-
const factor = spectraSum > 0 ? sum / spectraSum : 0
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
const data = Object.fromEntries(result.map((row) => {
|
|
140
|
+
const factor = spectraSum > 0 ? sum / spectraSum : 0;
|
|
141
|
+
return [
|
|
142
|
+
row.SID,
|
|
143
|
+
{
|
|
144
|
+
...prevNucleusData[row.SID],
|
|
145
|
+
[colKey]: {
|
|
146
|
+
colKey,
|
|
147
|
+
...row,
|
|
148
|
+
relative: Math.abs(row.absolute) * factor,
|
|
149
|
+
},
|
|
144
150
|
},
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}, {});
|
|
151
|
+
];
|
|
152
|
+
}));
|
|
148
153
|
spectraAnalysis[nucleus].values = data;
|
|
149
154
|
spectraAnalysis[nucleus].values = refreshCalculation(spectraAnalysis, nucleus);
|
|
150
155
|
}
|
|
151
156
|
export function deleteSpectraAnalysis(spectraAnalysis, colKey, nucleus) {
|
|
152
|
-
const result =
|
|
157
|
+
const result = {};
|
|
158
|
+
const analyses = Object.entries(spectraAnalysis[nucleus].values);
|
|
159
|
+
for (const item of analyses) {
|
|
153
160
|
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
154
161
|
delete item[1][colKey];
|
|
155
162
|
if (item[1] && Object.keys(item[1]).length > 0) {
|
|
156
|
-
|
|
157
|
-
return acc;
|
|
163
|
+
result[item[0]] = item[1];
|
|
158
164
|
}
|
|
159
|
-
|
|
160
|
-
}, {});
|
|
165
|
+
}
|
|
161
166
|
const { [colKey]: deletedColumnKey, ...resColumns } = spectraAnalysis[nucleus].options.columns;
|
|
162
167
|
const currentColumns = Object.keys(spectraAnalysis[nucleus].options.columns);
|
|
163
168
|
if (currentColumns.length === 1) {
|
|
@@ -168,7 +173,7 @@ export function deleteSpectraAnalysis(spectraAnalysis, colKey, nucleus) {
|
|
|
168
173
|
spectraAnalysis[nucleus].values = refreshCalculation(spectraAnalysis, nucleus);
|
|
169
174
|
}
|
|
170
175
|
function calculate(columns, data, formula = '') {
|
|
171
|
-
const array = formula.split(
|
|
176
|
+
const array = formula.split(/[%()*+/-]/);
|
|
172
177
|
const variables = [];
|
|
173
178
|
for (const col of array) {
|
|
174
179
|
const column = col.trim();
|
|
@@ -182,9 +187,8 @@ function calculate(columns, data, formula = '') {
|
|
|
182
187
|
// eslint-disable-next-line no-new-func
|
|
183
188
|
result = new Function(...variables, `return ${formula}`)(...params);
|
|
184
189
|
}
|
|
185
|
-
catch (
|
|
186
|
-
|
|
187
|
-
console.error(e);
|
|
190
|
+
catch (error) {
|
|
191
|
+
reportError(error);
|
|
188
192
|
result = new Error(`Invalid Formula ( ${formula} ) `);
|
|
189
193
|
}
|
|
190
194
|
return result;
|
|
@@ -22,7 +22,7 @@ export function getSum(mf, nucleus) {
|
|
|
22
22
|
return defaultSum;
|
|
23
23
|
const atom = getAtom(nucleus);
|
|
24
24
|
const atoms = getAtoms(mf);
|
|
25
|
-
return atoms[atom]
|
|
25
|
+
return atoms[atom] || defaultSum;
|
|
26
26
|
}
|
|
27
27
|
export function setSumOptions(data, params) {
|
|
28
28
|
const { nucleus, options } = params;
|
|
@@ -18,7 +18,7 @@ export default function generateJGraphData(ranges, jGraphTolerance) {
|
|
|
18
18
|
return { signals, jCouplingMax, links };
|
|
19
19
|
}
|
|
20
20
|
function getJsCouplingMax(js) {
|
|
21
|
-
let max =
|
|
21
|
+
let max = Number.NEGATIVE_INFINITY;
|
|
22
22
|
for (const { coupling } of js) {
|
|
23
23
|
max = coupling > max ? coupling : max;
|
|
24
24
|
}
|
|
@@ -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';
|
|
@@ -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
|
};
|