nmrium 0.32.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/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
|
@@ -20,9 +20,8 @@ var COLUMNS_VALUES_KEYS;
|
|
|
20
20
|
COLUMNS_VALUES_KEYS["MAX"] = "max";
|
|
21
21
|
})(COLUMNS_VALUES_KEYS = exports.COLUMNS_VALUES_KEYS || (exports.COLUMNS_VALUES_KEYS = {}));
|
|
22
22
|
function addColumnKey(spectraAnalysis, nucleus, columnProps, columnKey) {
|
|
23
|
-
const key = columnKey
|
|
24
|
-
|
|
25
|
-
: (0, generateChar_1.default)(spectraAnalysis[nucleus].options.columnIndex).toUpperCase();
|
|
23
|
+
const key = columnKey ||
|
|
24
|
+
(0, generateChar_1.default)(spectraAnalysis[nucleus].options.columnIndex).toUpperCase();
|
|
26
25
|
spectraAnalysis[nucleus].options.columns[key] = columnProps;
|
|
27
26
|
spectraAnalysis[nucleus].options.columnIndex++;
|
|
28
27
|
return key;
|
|
@@ -37,16 +36,20 @@ function getValue(colKey, columns, data) {
|
|
|
37
36
|
exports.getValue = getValue;
|
|
38
37
|
function getSpectraAnalysis(spectra, options) {
|
|
39
38
|
const { from, to, nucleus } = options;
|
|
40
|
-
|
|
39
|
+
const result = {
|
|
40
|
+
values: [],
|
|
41
|
+
sum: 0,
|
|
42
|
+
};
|
|
43
|
+
for (const datum of spectra) {
|
|
41
44
|
if ((0, Spectrum1D_1.isSpectrum1D)(datum) &&
|
|
42
45
|
datum.info.nucleus === nucleus &&
|
|
43
46
|
!datum.info.isFid) {
|
|
44
47
|
const range = (0, Spectrum1D_1.detectRange)(datum, { from, to });
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
result.sum += range.absolute;
|
|
49
|
+
result.values.push({ SID: datum.id, ...range });
|
|
47
50
|
}
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
50
53
|
}
|
|
51
54
|
exports.getSpectraAnalysis = getSpectraAnalysis;
|
|
52
55
|
function init(spectraAnalysis, nucleus) {
|
|
@@ -70,62 +73,62 @@ exports.changeColumnValueKey = changeColumnValueKey;
|
|
|
70
73
|
function setColumn(spectraAnalysis, nucleus, { columns: inputColumns, code }) {
|
|
71
74
|
init(spectraAnalysis, nucleus);
|
|
72
75
|
spectraAnalysis[nucleus].options.code = code;
|
|
73
|
-
|
|
76
|
+
const columns = Object.fromEntries(Object.values(inputColumns).map((value) => {
|
|
74
77
|
const data = { ...value };
|
|
75
78
|
delete data.tempKey;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
return [value.tempKey, data];
|
|
80
|
+
}));
|
|
81
|
+
spectraAnalysis[nucleus].options.columns = columns;
|
|
79
82
|
const { columns: newColumns } = spectraAnalysis[nucleus].options;
|
|
80
|
-
let data = Object.entries(spectraAnalysis[nucleus].values).
|
|
81
|
-
|
|
83
|
+
let data = Object.fromEntries(Object.entries(spectraAnalysis[nucleus].values).map(([spectraKey, spectra]) => {
|
|
84
|
+
const result = Object.fromEntries(Object.keys(inputColumns)
|
|
85
|
+
.filter((k) => spectra[k])
|
|
86
|
+
.map((key) => {
|
|
82
87
|
const newKey = inputColumns[key].tempKey;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, {});
|
|
90
|
-
data = Object.entries(data).reduce((acc, spectra) => {
|
|
91
|
-
acc[spectra[0]] = Object.keys(newColumns).reduce((acc, key) => {
|
|
88
|
+
return [newKey, spectra[key]];
|
|
89
|
+
}));
|
|
90
|
+
return [spectraKey, result];
|
|
91
|
+
}));
|
|
92
|
+
const newData = Object.fromEntries(Object.entries(data).map((spectra) => {
|
|
93
|
+
const result = Object.fromEntries(Object.keys(newColumns).map((key) => {
|
|
92
94
|
const isFormula = newColumns[key].type === COLUMNS_TYPES.FORMULA;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
return [
|
|
96
|
+
key,
|
|
97
|
+
isFormula
|
|
98
|
+
? {
|
|
99
|
+
colKey: key,
|
|
100
|
+
value: calculate(newColumns, data[spectra[0]], newColumns[key].formula),
|
|
101
|
+
}
|
|
102
|
+
: { ...spectra[1][key], colKey: key },
|
|
103
|
+
];
|
|
104
|
+
}));
|
|
105
|
+
return [spectra[0], result];
|
|
106
|
+
}));
|
|
107
|
+
data = newData;
|
|
103
108
|
spectraAnalysis[nucleus].values = data;
|
|
104
109
|
}
|
|
105
110
|
exports.setColumn = setColumn;
|
|
106
111
|
function refreshByRow(row, columns) {
|
|
107
|
-
return Object.keys(columns)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
return Object.fromEntries(Object.keys(columns)
|
|
113
|
+
.filter((k) => columns[k].type === COLUMNS_TYPES.FORMULA)
|
|
114
|
+
.map((key) => [
|
|
115
|
+
key,
|
|
116
|
+
{
|
|
117
|
+
colKey: key,
|
|
118
|
+
...row,
|
|
119
|
+
value: calculate(columns, row, columns[key].formula),
|
|
120
|
+
},
|
|
121
|
+
]));
|
|
117
122
|
}
|
|
118
123
|
function refreshCalculation(spectraAnalysis, nucleus) {
|
|
119
124
|
const { columns } = spectraAnalysis[nucleus].options;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
return Object.fromEntries(Object.entries(spectraAnalysis[nucleus].values).map(([id, row]) => [
|
|
126
|
+
id,
|
|
127
|
+
{
|
|
123
128
|
...row,
|
|
124
129
|
...refreshByRow(row, columns),
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
}, {});
|
|
128
|
-
return data;
|
|
130
|
+
},
|
|
131
|
+
]));
|
|
129
132
|
}
|
|
130
133
|
function analyzeSpectra(spectra, spectraAnalysis, options) {
|
|
131
134
|
const { from, to, nucleus, columnKey = null } = options;
|
|
@@ -144,32 +147,34 @@ function analyzeSpectra(spectra, spectraAnalysis, options) {
|
|
|
144
147
|
nucleus,
|
|
145
148
|
});
|
|
146
149
|
const prevNucleusData = (0, get_1.default)(spectraAnalysis, `${nucleus}.values`, {});
|
|
147
|
-
|
|
148
|
-
const factor = spectraSum > 0 ? sum / spectraSum : 0
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
const data = Object.fromEntries(result.map((row) => {
|
|
151
|
+
const factor = spectraSum > 0 ? sum / spectraSum : 0;
|
|
152
|
+
return [
|
|
153
|
+
row.SID,
|
|
154
|
+
{
|
|
155
|
+
...prevNucleusData[row.SID],
|
|
156
|
+
[colKey]: {
|
|
157
|
+
colKey,
|
|
158
|
+
...row,
|
|
159
|
+
relative: Math.abs(row.absolute) * factor,
|
|
160
|
+
},
|
|
155
161
|
},
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}, {});
|
|
162
|
+
];
|
|
163
|
+
}));
|
|
159
164
|
spectraAnalysis[nucleus].values = data;
|
|
160
165
|
spectraAnalysis[nucleus].values = refreshCalculation(spectraAnalysis, nucleus);
|
|
161
166
|
}
|
|
162
167
|
exports.analyzeSpectra = analyzeSpectra;
|
|
163
168
|
function deleteSpectraAnalysis(spectraAnalysis, colKey, nucleus) {
|
|
164
|
-
const result =
|
|
169
|
+
const result = {};
|
|
170
|
+
const analyses = Object.entries(spectraAnalysis[nucleus].values);
|
|
171
|
+
for (const item of analyses) {
|
|
165
172
|
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
166
173
|
delete item[1][colKey];
|
|
167
174
|
if (item[1] && Object.keys(item[1]).length > 0) {
|
|
168
|
-
|
|
169
|
-
return acc;
|
|
175
|
+
result[item[0]] = item[1];
|
|
170
176
|
}
|
|
171
|
-
|
|
172
|
-
}, {});
|
|
177
|
+
}
|
|
173
178
|
const { [colKey]: deletedColumnKey, ...resColumns } = spectraAnalysis[nucleus].options.columns;
|
|
174
179
|
const currentColumns = Object.keys(spectraAnalysis[nucleus].options.columns);
|
|
175
180
|
if (currentColumns.length === 1) {
|
|
@@ -181,7 +186,7 @@ function deleteSpectraAnalysis(spectraAnalysis, colKey, nucleus) {
|
|
|
181
186
|
}
|
|
182
187
|
exports.deleteSpectraAnalysis = deleteSpectraAnalysis;
|
|
183
188
|
function calculate(columns, data, formula = '') {
|
|
184
|
-
const array = formula.split(
|
|
189
|
+
const array = formula.split(/[%()*+/-]/);
|
|
185
190
|
const variables = [];
|
|
186
191
|
for (const col of array) {
|
|
187
192
|
const column = col.trim();
|
|
@@ -195,9 +200,8 @@ function calculate(columns, data, formula = '') {
|
|
|
195
200
|
// eslint-disable-next-line no-new-func
|
|
196
201
|
result = new Function(...variables, `return ${formula}`)(...params);
|
|
197
202
|
}
|
|
198
|
-
catch (
|
|
199
|
-
|
|
200
|
-
console.error(e);
|
|
203
|
+
catch (error) {
|
|
204
|
+
reportError(error);
|
|
201
205
|
result = new Error(`Invalid Formula ( ${formula} ) `);
|
|
202
206
|
}
|
|
203
207
|
return result;
|
|
@@ -29,7 +29,7 @@ function getSum(mf, nucleus) {
|
|
|
29
29
|
return defaultSum;
|
|
30
30
|
const atom = (0, getAtom_1.default)(nucleus);
|
|
31
31
|
const atoms = getAtoms(mf);
|
|
32
|
-
return atoms[atom]
|
|
32
|
+
return atoms[atom] || defaultSum;
|
|
33
33
|
}
|
|
34
34
|
exports.getSum = getSum;
|
|
35
35
|
function setSumOptions(data, params) {
|
|
@@ -21,7 +21,7 @@ function generateJGraphData(ranges, jGraphTolerance) {
|
|
|
21
21
|
}
|
|
22
22
|
exports.default = generateJGraphData;
|
|
23
23
|
function getJsCouplingMax(js) {
|
|
24
|
-
let max =
|
|
24
|
+
let max = Number.NEGATIVE_INFINITY;
|
|
25
25
|
for (const { coupling } of js) {
|
|
26
26
|
max = coupling > max ? coupling : max;
|
|
27
27
|
}
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
3
|
+
exports.toJSON = exports.updateXShift = exports.getShiftX = exports.updateRangesRelativeValues = exports.mapRanges = exports.generateSpectrumFromRanges = exports.detectRanges = exports.detectRange = exports.checkRangeKind = exports.changeRangeSignal = exports.changeRangeRelativeValue = exports.changeRange = exports.addRange = exports.optimizePeaks = exports.lookupPeak = exports.autoPeakPicking = exports.isSpectrum1D = exports.updateIntegralsRelativeValues = exports.checkIntegralKind = exports.changeIntegralsRelative = exports.initiateDatum1D = exports.getReferenceShift = exports.get1DDataXY = exports.generateSpectrumFromPublicationString = void 0;
|
|
4
|
+
var generateSpectrumFromPublicationString_1 = require("./generateSpectrumFromPublicationString");
|
|
5
5
|
Object.defineProperty(exports, "generateSpectrumFromPublicationString", { enumerable: true, get: function () { return generateSpectrumFromPublicationString_1.generateSpectrumFromPublicationString; } });
|
|
6
|
-
|
|
6
|
+
var get1DDataXY_1 = require("./get1DDataXY");
|
|
7
7
|
Object.defineProperty(exports, "get1DDataXY", { enumerable: true, get: function () { return get1DDataXY_1.get1DDataXY; } });
|
|
8
|
-
|
|
8
|
+
var getReferenceShift_1 = require("./getReferenceShift");
|
|
9
9
|
Object.defineProperty(exports, "getReferenceShift", { enumerable: true, get: function () { return getReferenceShift_1.getReferenceShift; } });
|
|
10
|
-
|
|
10
|
+
var initiateDatum1D_1 = require("./initiateDatum1D");
|
|
11
11
|
Object.defineProperty(exports, "initiateDatum1D", { enumerable: true, get: function () { return initiateDatum1D_1.initiateDatum1D; } });
|
|
12
|
-
|
|
12
|
+
var changeIntegralsRelative_1 = require("./integrals/changeIntegralsRelative");
|
|
13
13
|
Object.defineProperty(exports, "changeIntegralsRelative", { enumerable: true, get: function () { return changeIntegralsRelative_1.changeIntegralsRelative; } });
|
|
14
|
-
|
|
14
|
+
var checkIntegralKind_1 = require("./integrals/checkIntegralKind");
|
|
15
15
|
Object.defineProperty(exports, "checkIntegralKind", { enumerable: true, get: function () { return checkIntegralKind_1.checkIntegralKind; } });
|
|
16
|
-
|
|
16
|
+
var updateIntegralsRelativeValues_1 = require("./integrals/updateIntegralsRelativeValues");
|
|
17
17
|
Object.defineProperty(exports, "updateIntegralsRelativeValues", { enumerable: true, get: function () { return updateIntegralsRelativeValues_1.updateIntegralsRelativeValues; } });
|
|
18
|
-
|
|
18
|
+
var isSpectrum1D_1 = require("./isSpectrum1D");
|
|
19
19
|
Object.defineProperty(exports, "isSpectrum1D", { enumerable: true, get: function () { return isSpectrum1D_1.isSpectrum1D; } });
|
|
20
|
-
|
|
20
|
+
var autoPeakPicking_1 = require("./peaks/autoPeakPicking");
|
|
21
21
|
Object.defineProperty(exports, "autoPeakPicking", { enumerable: true, get: function () { return autoPeakPicking_1.autoPeakPicking; } });
|
|
22
|
-
|
|
22
|
+
var lookupPeak_1 = require("./peaks/lookupPeak");
|
|
23
23
|
Object.defineProperty(exports, "lookupPeak", { enumerable: true, get: function () { return lookupPeak_1.lookupPeak; } });
|
|
24
|
-
|
|
24
|
+
var optimizePeaks_1 = require("./peaks/optimizePeaks");
|
|
25
25
|
Object.defineProperty(exports, "optimizePeaks", { enumerable: true, get: function () { return optimizePeaks_1.optimizePeaks; } });
|
|
26
|
-
|
|
26
|
+
var addRange_1 = require("./ranges/addRange");
|
|
27
27
|
Object.defineProperty(exports, "addRange", { enumerable: true, get: function () { return addRange_1.addRange; } });
|
|
28
|
-
|
|
28
|
+
var changeRange_1 = require("./ranges/changeRange");
|
|
29
29
|
Object.defineProperty(exports, "changeRange", { enumerable: true, get: function () { return changeRange_1.changeRange; } });
|
|
30
|
-
|
|
30
|
+
var changeRangeRelativeValue_1 = require("./ranges/changeRangeRelativeValue");
|
|
31
31
|
Object.defineProperty(exports, "changeRangeRelativeValue", { enumerable: true, get: function () { return changeRangeRelativeValue_1.changeRangeRelativeValue; } });
|
|
32
|
-
|
|
32
|
+
var changeRangeSignal_1 = require("./ranges/changeRangeSignal");
|
|
33
33
|
Object.defineProperty(exports, "changeRangeSignal", { enumerable: true, get: function () { return changeRangeSignal_1.changeRangeSignal; } });
|
|
34
|
-
|
|
34
|
+
var checkRangeKind_1 = require("./ranges/checkRangeKind");
|
|
35
35
|
Object.defineProperty(exports, "checkRangeKind", { enumerable: true, get: function () { return checkRangeKind_1.checkRangeKind; } });
|
|
36
|
-
|
|
36
|
+
var detectRange_1 = require("./ranges/detectRange");
|
|
37
37
|
Object.defineProperty(exports, "detectRange", { enumerable: true, get: function () { return detectRange_1.detectRange; } });
|
|
38
|
-
|
|
38
|
+
var detectRanges_1 = require("./ranges/detectRanges");
|
|
39
39
|
Object.defineProperty(exports, "detectRanges", { enumerable: true, get: function () { return detectRanges_1.detectRanges; } });
|
|
40
|
-
|
|
40
|
+
var generateSpectrumFromRanges_1 = require("./ranges/generateSpectrumFromRanges");
|
|
41
41
|
Object.defineProperty(exports, "generateSpectrumFromRanges", { enumerable: true, get: function () { return generateSpectrumFromRanges_1.generateSpectrumFromRanges; } });
|
|
42
|
-
|
|
42
|
+
var mapRanges_1 = require("./ranges/mapRanges");
|
|
43
43
|
Object.defineProperty(exports, "mapRanges", { enumerable: true, get: function () { return mapRanges_1.mapRanges; } });
|
|
44
|
-
|
|
44
|
+
var updateRangesRelativeValues_1 = require("./ranges/updateRangesRelativeValues");
|
|
45
45
|
Object.defineProperty(exports, "updateRangesRelativeValues", { enumerable: true, get: function () { return updateRangesRelativeValues_1.updateRangesRelativeValues; } });
|
|
46
|
-
|
|
46
|
+
var getShiftX_1 = require("./shift/getShiftX");
|
|
47
47
|
Object.defineProperty(exports, "getShiftX", { enumerable: true, get: function () { return getShiftX_1.getShiftX; } });
|
|
48
|
-
|
|
48
|
+
var updateXShift_1 = require("./shift/updateXShift");
|
|
49
49
|
Object.defineProperty(exports, "updateXShift", { enumerable: true, get: function () { return updateXShift_1.updateXShift; } });
|
|
50
|
-
|
|
50
|
+
var toJSON_1 = require("./toJSON");
|
|
51
51
|
Object.defineProperty(exports, "toJSON", { enumerable: true, get: function () { return toJSON_1.toJSON; } });
|
|
@@ -48,7 +48,7 @@ function initiateDatum1D(options, usedColors = {}) {
|
|
|
48
48
|
...options.source,
|
|
49
49
|
};
|
|
50
50
|
datum.display = {
|
|
51
|
-
name: options.display?.name
|
|
51
|
+
name: options.display?.name || (0, uuid_1.v4)(),
|
|
52
52
|
...getColor(options, usedColors),
|
|
53
53
|
isVisible: true,
|
|
54
54
|
isPeaksMarkersVisible: true,
|
|
@@ -5,15 +5,16 @@ function changeIntegralsRelative(datum, newIntegral) {
|
|
|
5
5
|
const index = datum.integrals.values.findIndex((integral) => integral.id === newIntegral.id);
|
|
6
6
|
if (index !== -1) {
|
|
7
7
|
const ratio = datum.integrals.values[index].absolute / newIntegral.value;
|
|
8
|
-
const
|
|
8
|
+
const result = { values: [], sum: 0 };
|
|
9
|
+
for (const [index, integral] of datum.integrals.values.entries()) {
|
|
9
10
|
const newIntegralValue = integral.absolute / ratio;
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
result.sum += newIntegralValue;
|
|
12
|
+
result.values[index] = {
|
|
12
13
|
...integral,
|
|
13
14
|
integral: newIntegralValue,
|
|
14
15
|
};
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
}
|
|
17
|
+
const { values, sum } = result;
|
|
17
18
|
datum.integrals.values = values;
|
|
18
19
|
datum.integrals.options = {
|
|
19
20
|
...datum.integrals.options,
|
|
@@ -7,17 +7,15 @@ function updateRelatives(data, key, check, forceCalculateIntegral = false) {
|
|
|
7
7
|
const currentSum = (0, getSum_1.getSum)(values, 'absolute', check);
|
|
8
8
|
let factor = 0;
|
|
9
9
|
if (options.sum) {
|
|
10
|
-
if (
|
|
11
|
-
factor = currentSum > 0 ? options.sum / currentSum : 0
|
|
10
|
+
if (options.isSumConstant || forceCalculateIntegral) {
|
|
11
|
+
factor = currentSum > 0 ? options.sum / currentSum : 0;
|
|
12
12
|
}
|
|
13
|
-
else if (
|
|
14
|
-
const item =
|
|
15
|
-
factor =
|
|
16
|
-
(item[key] ? item[key] : options.sum) /
|
|
17
|
-
item.absolute;
|
|
13
|
+
else if (values?.[0]) {
|
|
14
|
+
const item = values[0];
|
|
15
|
+
factor = (item[key] || options.sum) / item.absolute;
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
|
-
data.values =
|
|
18
|
+
data.values = values.map((value) => {
|
|
21
19
|
return {
|
|
22
20
|
...value,
|
|
23
21
|
...(check(value) && {
|
|
@@ -25,8 +23,8 @@ function updateRelatives(data, key, check, forceCalculateIntegral = false) {
|
|
|
25
23
|
}),
|
|
26
24
|
};
|
|
27
25
|
});
|
|
28
|
-
if (!
|
|
29
|
-
|
|
26
|
+
if (!options.isSumConstant && !forceCalculateIntegral) {
|
|
27
|
+
options.sum = (0, getSum_1.getSum)(values, key, check);
|
|
30
28
|
}
|
|
31
29
|
}
|
|
32
30
|
exports.updateRelatives = updateRelatives;
|
|
@@ -16,7 +16,7 @@ function lookupPeak(data, options) {
|
|
|
16
16
|
const dataRange = data.re.slice(minIndex, maxIndex);
|
|
17
17
|
if (dataRange && dataRange.length > 0) {
|
|
18
18
|
const yValue = (0, ml_array_max_1.default)(dataRange);
|
|
19
|
-
const xIndex = dataRange.
|
|
19
|
+
const xIndex = dataRange.indexOf(yValue);
|
|
20
20
|
const xValue = data.x[minIndex + xIndex];
|
|
21
21
|
return { x: xValue, y: yValue, xIndex: minIndex + xIndex };
|
|
22
22
|
}
|
|
@@ -8,8 +8,8 @@ function optimizePeaks(datum1D, options) {
|
|
|
8
8
|
const { from, to, peaks } = options;
|
|
9
9
|
const { originFrequency: frequency } = datum1D.info;
|
|
10
10
|
let { re, x } = datum1D.data;
|
|
11
|
-
const fromIndex = (0, ml_spectra_processing_1.xFindClosestIndex)(
|
|
12
|
-
const ToIndex = (0, ml_spectra_processing_1.xFindClosestIndex)(
|
|
11
|
+
const fromIndex = (0, ml_spectra_processing_1.xFindClosestIndex)(x, from);
|
|
12
|
+
const ToIndex = (0, ml_spectra_processing_1.xFindClosestIndex)(x, to);
|
|
13
13
|
// create deleted peaks object where the key is the id of the peaks that we need to remove
|
|
14
14
|
const ids = {};
|
|
15
15
|
for (const peak of peaks) {
|
|
@@ -13,7 +13,7 @@ const mapRanges_1 = require("./mapRanges");
|
|
|
13
13
|
const updateRangesRelativeValues_1 = require("./updateRangesRelativeValues");
|
|
14
14
|
function createRangeObj({ from, to, absolute, id, signal, }) {
|
|
15
15
|
return {
|
|
16
|
-
id: id
|
|
16
|
+
id: id || (0, uuid_1.v4)(),
|
|
17
17
|
from,
|
|
18
18
|
to,
|
|
19
19
|
absolute,
|
|
@@ -60,7 +60,8 @@ function addRange(datum, options) {
|
|
|
60
60
|
(0, updateRangesRelativeValues_1.updateRangesRelativeValues)(datum);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
catch (
|
|
63
|
+
catch (error) {
|
|
64
|
+
reportError(error);
|
|
64
65
|
throw new Error('Could not calculate the multiplicity');
|
|
65
66
|
}
|
|
66
67
|
}
|
|
@@ -4,9 +4,9 @@ exports.changeRange = void 0;
|
|
|
4
4
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
5
5
|
const updateRangesRelativeValues_1 = require("./updateRangesRelativeValues");
|
|
6
6
|
function changeRange(datum, range) {
|
|
7
|
-
const { from, to } = range;
|
|
7
|
+
const { from, to, id } = range;
|
|
8
8
|
const { x, re } = datum.data;
|
|
9
|
-
const index = datum.ranges.values.findIndex((i) => i.id ===
|
|
9
|
+
const index = datum.ranges.values.findIndex((i) => i.id === id);
|
|
10
10
|
const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from, to, reverse: true });
|
|
11
11
|
if (index !== -1) {
|
|
12
12
|
datum.ranges.values[index] = {
|
|
@@ -19,9 +19,9 @@ function mapRanges(ranges, datum) {
|
|
|
19
19
|
const { x, re } = datum.data;
|
|
20
20
|
const shiftX = (0, getShiftX_1.getShiftX)(datum);
|
|
21
21
|
const error = (0, getSpectrumErrorValue_1.getSpectrumErrorValue)(datum);
|
|
22
|
-
return ranges
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
return ranges
|
|
23
|
+
.filter((r) => !checkRange(r, datum, error) || r.id === 'new')
|
|
24
|
+
.map((newRange) => {
|
|
25
25
|
const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from: newRange.from, to: newRange.to, reverse: true });
|
|
26
26
|
const signals = newRange.signals.map((signal) => {
|
|
27
27
|
const { kind = null, id, ...resSignal } = signal;
|
|
@@ -32,7 +32,7 @@ function mapRanges(ranges, datum) {
|
|
|
32
32
|
...resSignal,
|
|
33
33
|
};
|
|
34
34
|
});
|
|
35
|
-
|
|
35
|
+
return {
|
|
36
36
|
...newRange,
|
|
37
37
|
kind: signals?.[0].kind || SignalsKinds_1.DatumKind.signal,
|
|
38
38
|
originFrom: newRange.from - shiftX,
|
|
@@ -40,8 +40,7 @@ function mapRanges(ranges, datum) {
|
|
|
40
40
|
id: newRange.id || (0, uuid_1.v4)(),
|
|
41
41
|
absolute,
|
|
42
42
|
signals,
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
}, []);
|
|
43
|
+
};
|
|
44
|
+
});
|
|
46
45
|
}
|
|
47
46
|
exports.mapRanges = mapRanges;
|
|
@@ -30,7 +30,7 @@ function processSearchByStructure(moleculesDB, idCode) {
|
|
|
30
30
|
// https://github.com/cheminfo/openchemlib-utils/blob/ef3a9c30be7efe225a24de04ea9cefc9299674aa/src/db/MoleculesDB.js#L102-L115
|
|
31
31
|
// 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
|
|
32
32
|
const result = moleculesDB.search(idCode || '');
|
|
33
|
-
return result.map((entry) => entry.data
|
|
33
|
+
return result.map((entry) => entry.data);
|
|
34
34
|
}
|
|
35
35
|
function prepareGetSolvents(data) {
|
|
36
36
|
const result = [];
|
|
@@ -60,9 +60,10 @@ function prepareMoleculesDB(array) {
|
|
|
60
60
|
index: entry.ocl.index,
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
catch (
|
|
63
|
+
catch (error) {
|
|
64
|
+
reportError(error);
|
|
64
65
|
// eslint-disable-next-line no-console
|
|
65
|
-
console.
|
|
66
|
+
console.error(`Could not parse idCode: ${JSON.stringify(entry.ocl)}`);
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
else if (entry.smiles) {
|
|
@@ -70,9 +71,10 @@ function prepareMoleculesDB(array) {
|
|
|
70
71
|
const molecule = full_1.default.Molecule.fromSmiles(entry.smiles);
|
|
71
72
|
moleculesDB.pushEntry(molecule, entry);
|
|
72
73
|
}
|
|
73
|
-
catch (
|
|
74
|
+
catch (error) {
|
|
75
|
+
reportError(error);
|
|
74
76
|
// eslint-disable-next-line no-console
|
|
75
|
-
console.
|
|
77
|
+
console.error(`Could not parse smiles: ${entry.smiles}`);
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
}
|
|
@@ -85,30 +87,41 @@ function prepareDataBase(array) {
|
|
|
85
87
|
...range,
|
|
86
88
|
}));
|
|
87
89
|
return item;
|
|
88
|
-
}
|
|
90
|
+
});
|
|
89
91
|
}
|
|
90
92
|
function prepareData(data) {
|
|
91
93
|
const result = [];
|
|
92
94
|
let index = 0;
|
|
93
95
|
for (const item of data) {
|
|
94
96
|
let ids = [];
|
|
95
|
-
const { ranges
|
|
96
|
-
|
|
97
|
-
ids.push(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
97
|
+
const { ranges, ...restItemKeys } = item;
|
|
98
|
+
if (!ranges) {
|
|
99
|
+
ids.push((0, uuid_1.v4)());
|
|
100
|
+
result.push({
|
|
101
|
+
...restItemKeys,
|
|
102
|
+
index,
|
|
103
|
+
id: ids,
|
|
104
|
+
ranges: [],
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
for (const range of ranges) {
|
|
109
|
+
ids.push(range.id || (0, uuid_1.v4)());
|
|
110
|
+
const { signals = [], ...restRangKeys } = range;
|
|
111
|
+
for (const signal of signals) {
|
|
112
|
+
const { js = [], ...restSignalKeys } = signal;
|
|
113
|
+
const jsResult = mapJs(js);
|
|
114
|
+
const data = {
|
|
115
|
+
...restItemKeys,
|
|
116
|
+
...restRangKeys,
|
|
117
|
+
...restSignalKeys,
|
|
118
|
+
...jsResult,
|
|
119
|
+
index,
|
|
120
|
+
id: ids,
|
|
121
|
+
ranges,
|
|
122
|
+
};
|
|
123
|
+
result.push(data);
|
|
124
|
+
}
|
|
112
125
|
}
|
|
113
126
|
}
|
|
114
127
|
index++;
|
|
@@ -118,11 +131,15 @@ function prepareData(data) {
|
|
|
118
131
|
exports.prepareData = prepareData;
|
|
119
132
|
function mapJs(js) {
|
|
120
133
|
if (js && js.length > 0) {
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
134
|
+
const result = {
|
|
135
|
+
coupling: [],
|
|
136
|
+
multiplicity: '',
|
|
137
|
+
};
|
|
138
|
+
for (const { coupling, multiplicity } of js) {
|
|
139
|
+
result.coupling.push(coupling);
|
|
140
|
+
result.multiplicity += multiplicity;
|
|
141
|
+
}
|
|
142
|
+
const { coupling, multiplicity } = result;
|
|
126
143
|
return { multiplicity, coupling: coupling.join(',') };
|
|
127
144
|
}
|
|
128
145
|
else {
|