nmrium 0.31.0 → 0.33.0-pre.1667632695
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/Chart1D.js +1 -1
- package/lib/component/1d/FooterBanner.js +17 -10
- package/lib/component/1d/LinesSeries.js +1 -1
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/XAxis.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib/component/1d/{Integral.d.ts → integral/Integral.d.ts} +0 -0
- package/lib/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib/component/1d/integral/IntegralIndicator.d.ts +9 -0
- package/lib/component/1d/integral/IntegralIndicator.js +27 -0
- package/lib/component/1d/{IntegralResizable.d.ts → integral/IntegralResizable.d.ts} +0 -0
- package/lib/component/1d/integral/IntegralResizable.js +69 -0
- package/lib/component/1d/{IntegralsSeries.d.ts → integral/IntegralsSeries.d.ts} +0 -0
- package/lib/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib/component/1d/ranges/Range.js +27 -50
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +2 -2
- package/lib/component/2d/Contours.js +61 -42
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/Left1DChart.js +1 -1
- package/lib/component/2d/Top1DChart.js +1 -1
- package/lib/component/2d/Viewer2D.js +11 -14
- package/lib/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib/component/2d/zones/IndicationLines.js +5 -8
- package/lib/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +6 -6
- package/lib/component/SplitPaneWrapper.js +1 -1
- package/lib/component/assignment/actions/initAssignment.js +17 -17
- package/lib/component/assignment/index.js +2 -2
- package/lib/component/context/PreferencesContext.js +3 -6
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/CheckBoxCell.js +1 -1
- package/lib/component/elements/ContextMenu.js +2 -2
- package/lib/component/elements/EditableColumn.d.ts +3 -1
- package/lib/component/elements/EditableColumn.js +21 -8
- package/lib/component/elements/GroupPane.d.ts +12 -0
- package/lib/component/elements/GroupPane.js +14 -0
- package/lib/component/elements/Input.js +7 -4
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/Label.js +1 -2
- package/lib/component/elements/MolecularFormulaInput.js +2 -0
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -1
- package/lib/component/elements/ReactTable/ReactTable.js +72 -38
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +3 -2
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib/component/elements/accordion/Accordion.js +2 -2
- package/lib/component/elements/draggble/useDraggable.js +1 -3
- package/lib/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
- package/lib/component/elements/formik/FormikColorPicker.js +5 -8
- package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib/component/elements/formik/FormikForm.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput.js +12 -20
- package/lib/component/elements/formik/FormikOnChange.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.js +13 -10
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/elements/formik/FormikSlider.d.ts +2 -4
- package/lib/component/elements/formik/FormikSlider.js +8 -11
- package/lib/component/elements/formik/FormikTextarea.js +1 -1
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib/component/elements/popup/Alert/Provider.js +7 -7
- package/lib/component/elements/popup/Alert/index.d.ts +3 -4
- package/lib/component/elements/popup/Alert/index.js +3 -4
- package/lib/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib/component/elements/popup/Modal/Provider.js +16 -31
- package/lib/component/elements/popup/Modal/index.d.ts +4 -5
- package/lib/component/elements/popup/Modal/index.js +4 -5
- package/lib/component/header/Header.js +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib/component/hooks/useCombinedRefs.js +2 -2
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +9 -6
- package/lib/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib/component/hooks/usePanelPreferences.js +9 -7
- package/lib/component/loader/DropZone.js +10 -2
- package/lib/component/modal/AlignSpectraModal.js +1 -1
- package/lib/component/modal/ExportAsMatrixModal.js +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +2 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib/component/modal/PredictSpectraModal.js +5 -5
- package/lib/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib/component/modal/setting/GeneralSettings.js +11 -14
- package/lib/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -1
- package/lib/component/modal/setting/WorkspaceItem.js +36 -48
- package/lib/component/modal/setting/settingsValidation.d.ts +58 -57
- package/lib/component/modal/setting/settingsValidation.js +14 -12
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib/component/panels/InformationPanel.js +52 -56
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +5 -5
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +3 -26
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +3 -3
- package/lib/component/reducer/Reducer.d.ts +26 -45
- package/lib/component/reducer/Reducer.js +13 -12
- package/lib/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/DomainActions.js +52 -69
- package/lib/component/reducer/actions/FiltersActions.js +15 -6
- package/lib/component/reducer/actions/HistoryActions.js +5 -5
- package/lib/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib/component/reducer/actions/LoadActions.js +12 -0
- package/lib/component/reducer/actions/PeaksActions.js +7 -6
- package/lib/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +28 -24
- package/lib/component/reducer/actions/SpectrumsActions.js +13 -6
- package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +28 -41
- package/lib/component/reducer/actions/ZonesActions.js +11 -10
- package/lib/component/reducer/core/Constants.js +1 -1
- package/lib/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrum.js +4 -0
- package/lib/component/reducer/helper/getSpectrum.js +3 -5
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +1 -1
- package/lib/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib/component/reducer/preferences/actions/setPreferences.js +5 -6
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +2 -2
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -4
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib/component/tool/BrushX.js +3 -3
- package/lib/component/tool/BrushXY.js +5 -5
- package/lib/component/tool/CrossLinePointer.js +3 -3
- package/lib/component/toolbar/BasicToolBar.js +9 -8
- package/lib/component/utility/Evaluate.js +2 -2
- package/lib/component/utility/FileUtility.d.ts +2 -9
- package/lib/component/utility/FileUtility.js +11 -28
- package/lib/component/utility/GroupByInfoKey.d.ts +1 -1
- package/lib/component/utility/GroupByInfoKey.js +11 -13
- package/lib/component/utility/PathBuilder.js +1 -1
- package/lib/component/utility/PreferencesHelper.js +2 -3
- package/lib/component/utility/{Export.d.ts → export.d.ts} +0 -0
- package/lib/component/utility/{Export.js → export.js} +54 -73
- package/lib/component/utility/formatNumber.d.ts +6 -1
- package/lib/component/utility/formatNumber.js +5 -4
- package/lib/component/workspaces/Workspace.d.ts +1 -1
- package/lib/component/workspaces/exercise.js +4 -4
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/Filters.d.ts +16 -18
- package/lib/data/Filters.js +16 -18
- package/lib/data/FiltersManager.js +4 -3
- package/lib/data/PredictionManager.js +8 -10
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/SpectraManager.js +25 -60
- package/lib/data/data1d/MultipleAnalysis.js +74 -70
- package/lib/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +24 -25
- package/lib/data/data1d/Spectrum1D/index.js +24 -25
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib/data/data1d/database.js +45 -28
- package/lib/data/data1d/filter1d/apodization.js +2 -1
- package/lib/data/data1d/filter1d/fft.js +24 -7
- package/lib/data/data1d/filter1d/phaseCorrection.js +11 -5
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +10 -20
- package/lib/data/data2d/Spectrum2D/contours.d.ts +40 -0
- package/lib/data/data2d/Spectrum2D/contours.js +132 -0
- package/lib/data/data2d/Spectrum2D/index.d.ts +10 -11
- package/lib/data/data2d/Spectrum2D/index.js +10 -11
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/index.d.ts +12 -13
- package/lib/data/types/data2d/Data2D.d.ts +2 -0
- package/lib/data/types/data2d/Datum2D.d.ts +0 -1
- package/lib/data/types/data2d/index.d.ts +8 -9
- package/lib/data/utilities/RangeUtilities.js +13 -9
- package/lib/data/utilities/ZoneUtilities.js +17 -13
- package/lib/data/utilities/calculateSanPlot.d.ts +8 -0
- package/lib/data/utilities/calculateSanPlot.js +31 -0
- package/lib/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib/data/utilities/generateChar.js +8 -6
- package/lib/data/utilities/getAtom.js +1 -1
- package/lib/data/utilities/getAtomsFromMF.js +2 -2
- package/lib/data/utilities/getColor.js +3 -3
- package/lib/data/utilities/getSum.js +6 -3
- package/lib/types/NMRiumGeneralPreferences.d.ts +2 -2
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +16 -9
- package/lib-cjs/component/1d/LinesSeries.js +1 -1
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/XAxis.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib-cjs/component/1d/integral/IntegralIndicator.js +31 -0
- package/lib-cjs/component/1d/integral/IntegralResizable.js +74 -0
- package/lib-cjs/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib-cjs/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib-cjs/component/1d/ranges/Range.js +27 -50
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +2 -2
- package/lib-cjs/component/2d/Contours.js +60 -41
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/Left1DChart.js +1 -1
- package/lib-cjs/component/2d/Top1DChart.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +11 -14
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +5 -8
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib-cjs/component/NMRium.js +7 -7
- package/lib-cjs/component/SplitPaneWrapper.js +1 -1
- package/lib-cjs/component/assignment/actions/initAssignment.js +17 -17
- package/lib-cjs/component/assignment/index.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +3 -6
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/CheckBoxCell.js +1 -1
- package/lib-cjs/component/elements/ContextMenu.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +21 -8
- package/lib-cjs/component/elements/GroupPane.js +18 -0
- package/lib-cjs/component/elements/Input.js +7 -4
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/Label.js +1 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +2 -0
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +71 -37
- package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib-cjs/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib-cjs/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -2
- package/lib-cjs/component/elements/draggble/useDraggable.js +1 -3
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +4 -7
- package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib-cjs/component/elements/formik/FormikForm.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +12 -20
- package/lib-cjs/component/elements/formik/FormikOnChange.js +13 -10
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSlider.js +7 -10
- package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
- package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +8 -8
- package/lib-cjs/component/elements/popup/Alert/index.js +5 -5
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +16 -31
- package/lib-cjs/component/elements/popup/Modal/index.js +7 -7
- package/lib-cjs/component/header/Header.js +1 -1
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib-cjs/component/hooks/useCombinedRefs.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +14 -11
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +9 -7
- package/lib-cjs/component/loader/DropZone.js +10 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib-cjs/component/modal/PredictSpectraModal.js +5 -5
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib-cjs/component/modal/setting/GeneralSettings.js +11 -14
- package/lib-cjs/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +37 -49
- package/lib-cjs/component/modal/setting/settingsValidation.js +14 -12
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib-cjs/component/panels/InformationPanel.js +51 -55
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -25
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +3 -3
- package/lib-cjs/component/reducer/Reducer.js +12 -11
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +52 -69
- package/lib-cjs/component/reducer/actions/FiltersActions.js +15 -6
- package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
- package/lib-cjs/component/reducer/actions/PeaksActions.js +7 -6
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib-cjs/component/reducer/actions/RangesActions.js +28 -24
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +12 -5
- package/lib-cjs/component/reducer/actions/ToolsActions.js +28 -41
- package/lib-cjs/component/reducer/actions/ZonesActions.js +11 -10
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib-cjs/component/reducer/helper/getActiveSpectrum.js +8 -0
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -5
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +5 -9
- package/lib-cjs/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib-cjs/component/tool/BrushX.js +3 -3
- package/lib-cjs/component/tool/BrushXY.js +5 -5
- package/lib-cjs/component/tool/CrossLinePointer.js +3 -3
- package/lib-cjs/component/toolbar/BasicToolBar.js +8 -7
- package/lib-cjs/component/utility/Evaluate.js +2 -2
- package/lib-cjs/component/utility/FileUtility.js +11 -29
- package/lib-cjs/component/utility/GroupByInfoKey.js +11 -13
- package/lib-cjs/component/utility/PathBuilder.js +1 -1
- package/lib-cjs/component/utility/PreferencesHelper.js +2 -3
- package/lib-cjs/component/utility/{Export.js → export.js} +78 -74
- package/lib-cjs/component/utility/formatNumber.js +5 -4
- package/lib-cjs/component/workspaces/exercise.js +4 -4
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib-cjs/data/Filters.js +17 -35
- package/lib-cjs/data/FiltersManager.js +4 -3
- package/lib-cjs/data/PredictionManager.js +8 -10
- package/lib-cjs/data/SpectraManager.js +26 -62
- package/lib-cjs/data/data1d/MultipleAnalysis.js +74 -70
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/index.js +25 -25
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib-cjs/data/data1d/database.js +45 -28
- package/lib-cjs/data/data1d/filter1d/apodization.js +2 -1
- package/lib-cjs/data/data1d/filter1d/fft.js +23 -6
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +10 -4
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Processing2D.js +10 -20
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +138 -0
- package/lib-cjs/data/data2d/Spectrum2D/index.js +11 -11
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/RangeUtilities.js +13 -9
- package/lib-cjs/data/utilities/ZoneUtilities.js +17 -13
- package/lib-cjs/data/utilities/calculateSanPlot.js +35 -0
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib-cjs/data/utilities/generateChar.js +8 -6
- package/lib-cjs/data/utilities/getAtom.js +1 -1
- package/lib-cjs/data/utilities/getAtomsFromMF.js +2 -2
- package/lib-cjs/data/utilities/getColor.js +3 -3
- package/lib-cjs/data/utilities/getSum.js +6 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +36 -31
- package/lib/component/1d/IntegralResizable.js +0 -72
- package/lib/component/elements/popup/helpers.d.ts +0 -1
- package/lib/component/elements/popup/helpers.js +0 -9
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.js +0 -8
- package/lib/data/data1d/Data1DManager.d.ts +0 -3
- package/lib/data/data1d/Data1DManager.js +0 -98
- package/lib/data/data1d/filter1d/absolute.d.ts +0 -13
- package/lib/data/data1d/filter1d/absolute.js +0 -26
- package/lib/data/data2d/Data2DManager.d.ts +0 -3
- package/lib/data/data2d/Data2DManager.js +0 -34
- package/lib/data/types/data2d/Contour.d.ts +0 -4
- package/lib/data/types/data2d/Contour.js +0 -1
- package/lib/data/types/data2d/Contours.d.ts +0 -2
- package/lib/data/types/data2d/Contours.js +0 -1
- package/lib-cjs/component/1d/IntegralResizable.js +0 -77
- package/lib-cjs/component/elements/popup/helpers.js +0 -13
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +0 -14
- package/lib-cjs/data/data1d/Data1DManager.js +0 -104
- package/lib-cjs/data/data1d/filter1d/absolute.js +0 -32
- package/lib-cjs/data/data2d/Data2DManager.js +0 -40
- package/lib-cjs/data/types/data2d/Contour.js +0 -2
- package/lib-cjs/data/types/data2d/Contours.js +0 -2
|
@@ -67,10 +67,10 @@ function ZonesTable({ tableData, onUnlink, context, nuclei, experiment, }) {
|
|
|
67
67
|
}
|
|
68
68
|
}, [contextRef]);
|
|
69
69
|
const data = (0, react_2.useMemo)(() => {
|
|
70
|
-
const
|
|
71
|
-
tableData.
|
|
70
|
+
const data = [];
|
|
71
|
+
for (const [i, zone] of tableData.entries()) {
|
|
72
72
|
if (zone.signals.length === 1) {
|
|
73
|
-
|
|
73
|
+
data.push({
|
|
74
74
|
...zone,
|
|
75
75
|
tableMetaInfo: {
|
|
76
76
|
...zone.tableMetaInfo,
|
|
@@ -84,7 +84,7 @@ function ZonesTable({ tableData, onUnlink, context, nuclei, experiment, }) {
|
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
else if (zone.signals.length > 1) {
|
|
87
|
-
zone.signals.
|
|
87
|
+
for (const [j, signal] of zone.signals.entries()) {
|
|
88
88
|
let hide = false;
|
|
89
89
|
let rowSpan = null;
|
|
90
90
|
if (j < zone.signals.length - 1) {
|
|
@@ -98,7 +98,7 @@ function ZonesTable({ tableData, onUnlink, context, nuclei, experiment, }) {
|
|
|
98
98
|
else {
|
|
99
99
|
hide = true;
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
data.push({
|
|
102
102
|
...zone,
|
|
103
103
|
tableMetaInfo: {
|
|
104
104
|
...zone.tableMetaInfo,
|
|
@@ -111,10 +111,10 @@ function ZonesTable({ tableData, onUnlink, context, nuclei, experiment, }) {
|
|
|
111
111
|
experiment,
|
|
112
112
|
},
|
|
113
113
|
});
|
|
114
|
-
}
|
|
114
|
+
}
|
|
115
115
|
}
|
|
116
|
-
}
|
|
117
|
-
return
|
|
116
|
+
}
|
|
117
|
+
return data;
|
|
118
118
|
}, [experiment, nuclei, tableData]);
|
|
119
119
|
const { items: sortedData, isSortedDesc, onSort } = (0, useTableSortBy_1.default)(data);
|
|
120
120
|
const { deltaPPM: deltaX } = (0, usePanelPreferences_1.usePanelPreferences)('zones', nuclei[0]);
|
|
@@ -148,7 +148,8 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
148
148
|
baseURL: url,
|
|
149
149
|
})));
|
|
150
150
|
}
|
|
151
|
-
catch (
|
|
151
|
+
catch (error) {
|
|
152
|
+
reportError(error);
|
|
152
153
|
alert.error(`Failed to load ${url}`);
|
|
153
154
|
}
|
|
154
155
|
finally {
|
|
@@ -197,7 +198,7 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
197
198
|
payload: { file: result, ranges, jcampURL },
|
|
198
199
|
});
|
|
199
200
|
}
|
|
200
|
-
catch
|
|
201
|
+
catch {
|
|
201
202
|
alert.error(`Failed to load Jcamp`);
|
|
202
203
|
}
|
|
203
204
|
finally {
|
|
@@ -255,7 +256,7 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
255
256
|
fontSize: '14px',
|
|
256
257
|
} })) : ((0, jsx_runtime_1.jsx)(bs_1.BsHexagonFill, { style: {
|
|
257
258
|
fontSize: '14px',
|
|
258
|
-
} })) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? (tableData && tableData.length > 0 ? ((0, jsx_runtime_1.jsx)(DatabaseTable_1.default, { data: tableData, onAdd: resurrectHandler })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, { text: databases && databases?.length > 0
|
|
259
|
+
} })) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? (tableData && tableData.length > 0 ? ((0, jsx_runtime_1.jsx)(DatabaseTable_1.default, { data: tableData, totalCount: result.data.length, onAdd: resurrectHandler })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, { text: databases && databases?.length > 0
|
|
259
260
|
? 'Please select a database'
|
|
260
261
|
: 'Please add databases URL in the general preferences' }))) : ((0, jsx_runtime_1.jsx)(DatabasePreferences_1.default, { ref: settingRef })) })] }));
|
|
261
262
|
}
|
|
@@ -276,7 +277,7 @@ function mapSolventsToSelect(solvents) {
|
|
|
276
277
|
label: key,
|
|
277
278
|
value: key,
|
|
278
279
|
};
|
|
279
|
-
}
|
|
280
|
+
});
|
|
280
281
|
result.unshift({ label: 'All', value: '-1' });
|
|
281
282
|
return result;
|
|
282
283
|
}
|
|
@@ -40,7 +40,9 @@ const databaseTableColumns = (databasePreferences) => [
|
|
|
40
40
|
Header: 'From - To',
|
|
41
41
|
accessor: (row) => {
|
|
42
42
|
const rangeFormat = databasePreferences.range.format;
|
|
43
|
-
return
|
|
43
|
+
return row?.from && row?.to
|
|
44
|
+
? `${(0, formatNumber_1.formatNumber)(row.from, rangeFormat)} - ${(0, formatNumber_1.formatNumber)(row.to, rangeFormat)}`
|
|
45
|
+
: '';
|
|
44
46
|
},
|
|
45
47
|
enableRowSpan: true,
|
|
46
48
|
},
|
|
@@ -48,7 +50,18 @@ const databaseTableColumns = (databasePreferences) => [
|
|
|
48
50
|
showWhen: 'delta.show',
|
|
49
51
|
index: 3,
|
|
50
52
|
Header: 'δ (ppm)',
|
|
51
|
-
|
|
53
|
+
style: overFlowStyle,
|
|
54
|
+
accessor: (row) => {
|
|
55
|
+
if (typeof row.delta === 'string' && !row?.delta) {
|
|
56
|
+
return row.delta
|
|
57
|
+
.split(',')
|
|
58
|
+
.map((value) => (0, formatNumber_1.formatNumber)(value, databasePreferences.delta.format))
|
|
59
|
+
.join(',');
|
|
60
|
+
}
|
|
61
|
+
return row?.delta
|
|
62
|
+
? (0, formatNumber_1.formatNumber)(row.delta, databasePreferences.delta.format)
|
|
63
|
+
: '';
|
|
64
|
+
},
|
|
52
65
|
},
|
|
53
66
|
{
|
|
54
67
|
showWhen: 'showAssignment',
|
|
@@ -66,7 +79,9 @@ const databaseTableColumns = (databasePreferences) => [
|
|
|
66
79
|
showWhen: 'coupling.show',
|
|
67
80
|
index: 6,
|
|
68
81
|
Header: 'J (Hz)',
|
|
69
|
-
accessor: (row) =>
|
|
82
|
+
accessor: (row) => row?.coupling
|
|
83
|
+
? (0, formatNumber_1.formatNumber)(row.coupling, databasePreferences.coupling.format)
|
|
84
|
+
: '',
|
|
70
85
|
style: {
|
|
71
86
|
width: '60px',
|
|
72
87
|
minWidth: '60px',
|
|
@@ -108,7 +123,7 @@ const databaseTableColumns = (databasePreferences) => [
|
|
|
108
123
|
},
|
|
109
124
|
},
|
|
110
125
|
];
|
|
111
|
-
function DatabaseTable({ data, onAdd }) {
|
|
126
|
+
function DatabaseTable({ data, onAdd, totalCount }) {
|
|
112
127
|
const databasePreferences = (0, usePanelPreferences_1.usePanelPreferences)('database');
|
|
113
128
|
const initialColumns = (0, react_1.useMemo)(() => [
|
|
114
129
|
{
|
|
@@ -133,6 +148,6 @@ function DatabaseTable({ data, onAdd }) {
|
|
|
133
148
|
}
|
|
134
149
|
return columns.sort((object1, object2) => object1.index - object2.index);
|
|
135
150
|
}, [databasePreferences, initialColumns]);
|
|
136
|
-
return ((0, jsx_runtime_1.jsx)(ReactTable_1.default, { data: data, columns: tableColumns, highlightedSource: highlight_1.HighlightEventSource.DATABASE, groupKey: "index", approxItemHeight:
|
|
151
|
+
return ((0, jsx_runtime_1.jsx)(ReactTable_1.default, { data: data, columns: tableColumns, highlightedSource: highlight_1.HighlightEventSource.DATABASE, groupKey: "index", approxItemHeight: 23.5, enableVirtualScroll: true, totalCount: totalCount }));
|
|
137
152
|
}
|
|
138
153
|
exports.default = (0, react_1.memo)(DatabaseTable);
|
|
@@ -35,10 +35,13 @@ class ColumnsHelper {
|
|
|
35
35
|
: this.defaultPreference[formatKey];
|
|
36
36
|
const { formatPrefix = '', formatSuffix = '', showPrefixSuffixCallback = () => true, } = options;
|
|
37
37
|
if (showPrefixSuffixCallback(row)) {
|
|
38
|
-
return (0, formatNumber_1.formatNumber)(row.original[columnKey], format,
|
|
38
|
+
return (0, formatNumber_1.formatNumber)(row.original[columnKey], format, {
|
|
39
|
+
prefix: formatPrefix,
|
|
40
|
+
suffix: formatSuffix,
|
|
41
|
+
});
|
|
39
42
|
}
|
|
40
43
|
else {
|
|
41
|
-
return (0, formatNumber_1.formatNumber)(row.original[columnKey], format
|
|
44
|
+
return (0, formatNumber_1.formatNumber)(row.original[columnKey], format);
|
|
42
45
|
}
|
|
43
46
|
});
|
|
44
47
|
}
|
|
@@ -23,9 +23,9 @@ function checkMultiplicity(multiplicity, rejected = []) {
|
|
|
23
23
|
if (multiplicity === undefined || multiplicity.length === 0) {
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
26
|
-
return
|
|
26
|
+
return multiplicity
|
|
27
27
|
.split('')
|
|
28
|
-
.
|
|
28
|
+
.every((_multiplet) => checkMultiplet(_multiplet, rejected));
|
|
29
29
|
}
|
|
30
30
|
exports.checkMultiplicity = checkMultiplicity;
|
|
31
31
|
function translateMultiplet(multiplet) {
|
|
@@ -95,7 +95,7 @@ function FiltersTableInner({ filters, spectraCounter, selectedTool, activeFilter
|
|
|
95
95
|
}, [activeFilterID, selectedTool]);
|
|
96
96
|
const filtersTableRow = (0, react_1.useMemo)(() => {
|
|
97
97
|
return filters?.map((d, index) => {
|
|
98
|
-
return ((0, jsx_runtime_1.jsxs)(TableRow_1.default, { className: getStyle(d, index), children: [(0, jsx_runtime_1.jsx)(TableCell_1.default, { align: "center", size: 2, onClick: () => filterSnapShotHandler(d.id), children: d.label }), (0, jsx_runtime_1.jsx)(TableCell_1.default, { align: "left", size: 3, children: (0, jsx_runtime_1.jsx)("div", { onClick: (e) => e.stopPropagation(), children: (0, jsx_runtime_1.jsx)(react_inspector_1.ObjectInspector, { data: d.error
|
|
98
|
+
return ((0, jsx_runtime_1.jsxs)(TableRow_1.default, { className: getStyle(d, index), children: [(0, jsx_runtime_1.jsx)(TableCell_1.default, { align: "center", size: 2, onClick: () => filterSnapShotHandler(d.id), children: d.label }), (0, jsx_runtime_1.jsx)(TableCell_1.default, { align: "left", size: 3, children: (0, jsx_runtime_1.jsx)("div", { onClick: (e) => e.stopPropagation(), children: (0, jsx_runtime_1.jsx)(react_inspector_1.ObjectInspector, { data: d.error || d.value }) }) }), (0, jsx_runtime_1.jsxs)(TableCell_1.default, { align: "center", vAlign: "center", size: 1, children: [(0, jsx_runtime_1.jsx)(CheckBox_1.default, { checked: d.flag, onChange: (event) => handelFilterCheck(d.id, event.target.checked) }), d.isDeleteAllow && ((0, jsx_runtime_1.jsx)("button", { className: "btn", type: "button", onClick: () => handelDeleteFilter(d), children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }))] })] }, d.id));
|
|
99
99
|
});
|
|
100
100
|
}, [
|
|
101
101
|
filterSnapShotHandler,
|
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const types = __importStar(require("./types/Types"));
|
|
27
|
-
const ignoreActions = [
|
|
27
|
+
const ignoreActions = new Set([
|
|
28
28
|
types.APPLY_KEY_PREFERENCES,
|
|
29
29
|
types.BRUSH_END,
|
|
30
30
|
types.RESET_DOMAIN,
|
|
@@ -59,9 +59,9 @@ const ignoreActions = [
|
|
|
59
59
|
types.SHOW_MULTIPLICTY_TREES,
|
|
60
60
|
types.SHOW_RANGES_INTEGRALS,
|
|
61
61
|
types.CHANGE_FLOAT_MOLECULE_POSITION,
|
|
62
|
-
];
|
|
62
|
+
]);
|
|
63
63
|
function checkActionType(type) {
|
|
64
|
-
if (!ignoreActions.
|
|
64
|
+
if (!ignoreActions.has(type))
|
|
65
65
|
return true;
|
|
66
66
|
return false;
|
|
67
67
|
}
|
|
@@ -29,7 +29,6 @@ const immer_1 = require("immer");
|
|
|
29
29
|
const nmr_correlation_1 = require("nmr-correlation");
|
|
30
30
|
const nmr_load_save_1 = require("nmr-load-save");
|
|
31
31
|
const PredictionManager_1 = require("../../data/PredictionManager");
|
|
32
|
-
const SpectraManager = __importStar(require("../../data/SpectraManager"));
|
|
33
32
|
const ChartContext_1 = require("../context/ChartContext");
|
|
34
33
|
const Constants_1 = require("../panels/SummaryPanel/CorrelationTable/Constants");
|
|
35
34
|
const ToolTypes_1 = require("../toolbar/ToolTypes");
|
|
@@ -67,7 +66,6 @@ exports.zoneStateInit = {
|
|
|
67
66
|
const getInitialState = () => ({
|
|
68
67
|
actionType: '',
|
|
69
68
|
data: [],
|
|
70
|
-
contours: {},
|
|
71
69
|
tempData: null,
|
|
72
70
|
xDomain: [],
|
|
73
71
|
yDomain: [],
|
|
@@ -86,7 +84,7 @@ const getInitialState = () => ({
|
|
|
86
84
|
margin: {
|
|
87
85
|
top: 10,
|
|
88
86
|
right: 20,
|
|
89
|
-
bottom:
|
|
87
|
+
bottom: 50,
|
|
90
88
|
left: 0,
|
|
91
89
|
},
|
|
92
90
|
mode: 'RTL',
|
|
@@ -96,6 +94,9 @@ const getInitialState = () => ({
|
|
|
96
94
|
ranges: [],
|
|
97
95
|
zones: [],
|
|
98
96
|
spectra: { activeSpectra: {}, activeTab: '' },
|
|
97
|
+
zoom: {
|
|
98
|
+
levels: {},
|
|
99
|
+
},
|
|
99
100
|
},
|
|
100
101
|
verticalAlign: {
|
|
101
102
|
align: 'bottom',
|
|
@@ -160,30 +161,30 @@ function initState(state) {
|
|
|
160
161
|
}
|
|
161
162
|
exports.initState = initState;
|
|
162
163
|
function dispatchMiddleware(dispatch) {
|
|
163
|
-
|
|
164
|
+
let usedColors = { '1d': [], '2d': [] };
|
|
164
165
|
return (action) => {
|
|
165
166
|
switch (action.type) {
|
|
166
167
|
case types.INITIATE: {
|
|
167
168
|
if (action.payload) {
|
|
168
|
-
|
|
169
|
-
void
|
|
170
|
-
action.payload = {
|
|
169
|
+
usedColors = { '1d': [], '2d': [] };
|
|
170
|
+
void (0, nmr_load_save_1.readNMRiumObject)(action.payload).then((data) => {
|
|
171
|
+
action.payload = { ...data, usedColors };
|
|
171
172
|
dispatch(action);
|
|
172
173
|
});
|
|
173
174
|
}
|
|
174
175
|
break;
|
|
175
176
|
}
|
|
176
177
|
case types.LOAD_DROP_FILES: {
|
|
177
|
-
const {
|
|
178
|
+
const { fileCollection } = action;
|
|
178
179
|
action.usedColors = usedColors;
|
|
179
|
-
(0, nmr_load_save_1.read)(
|
|
180
|
+
(0, nmr_load_save_1.read)(fileCollection)
|
|
180
181
|
.then((data) => {
|
|
181
182
|
action.data = data;
|
|
182
183
|
dispatch(action);
|
|
183
184
|
})
|
|
184
|
-
.catch((
|
|
185
|
+
.catch((error) => {
|
|
185
186
|
dispatch({ type: types.SET_LOADING_FLAG, isLoading: false });
|
|
186
|
-
reportError(
|
|
187
|
+
reportError(error);
|
|
187
188
|
});
|
|
188
189
|
break;
|
|
189
190
|
}
|
|
@@ -61,9 +61,9 @@ function handleSetCorrelations(draft, payload) {
|
|
|
61
61
|
const { correlations, options } = payload;
|
|
62
62
|
const state = (0, immer_1.original)(draft);
|
|
63
63
|
let correlationsData = (0, cloneDeep_1.default)(state.correlations);
|
|
64
|
-
|
|
64
|
+
for (const correlation of correlations) {
|
|
65
65
|
correlationsData = (0, nmr_correlation_1.setCorrelation)(correlationsData, correlation.id, correlation);
|
|
66
|
-
}
|
|
66
|
+
}
|
|
67
67
|
draft.correlations = correlationsData;
|
|
68
68
|
if (options) {
|
|
69
69
|
draft.correlations = {
|
|
@@ -77,7 +77,7 @@ exports.handleSetCorrelations = handleSetCorrelations;
|
|
|
77
77
|
function handleDeleteCorrelation(draft, payload) {
|
|
78
78
|
const { correlation, assignmentData } = payload;
|
|
79
79
|
// delete all signals linked to the correlation
|
|
80
|
-
correlation.
|
|
80
|
+
for (const link of correlation.links) {
|
|
81
81
|
const spectrum = (0, FindUtilities_1.findSpectrum)(draft.data, link.experimentID, false);
|
|
82
82
|
if (spectrum) {
|
|
83
83
|
if (spectrum.info.dimension === 1) {
|
|
@@ -105,6 +105,6 @@ function handleDeleteCorrelation(draft, payload) {
|
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
}
|
|
108
|
+
}
|
|
109
109
|
}
|
|
110
110
|
exports.handleDeleteCorrelation = handleDeleteCorrelation;
|
|
@@ -9,12 +9,13 @@ const get1DDataXY_1 = require("../../../data/data1d/Spectrum1D/get1DDataXY");
|
|
|
9
9
|
const Spectrum2D_1 = require("../../../data/data2d/Spectrum2D");
|
|
10
10
|
const nucleusToString_1 = __importDefault(require("../../utility/nucleusToString"));
|
|
11
11
|
const Constants_1 = require("../core/Constants");
|
|
12
|
+
const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
|
|
12
13
|
function getActiveData(draft) {
|
|
13
14
|
let data = draft.data.filter((datum) => (0, nucleusToString_1.default)(datum.info.nucleus) === draft.view.spectra.activeTab &&
|
|
14
15
|
datum.info.dimension === 1);
|
|
15
16
|
// todo: refactor this
|
|
16
|
-
const activeSpectrum =
|
|
17
|
-
if (activeSpectrum) {
|
|
17
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
18
|
+
if (activeSpectrum?.id) {
|
|
18
19
|
const activeSpectrumIndex = data.findIndex((datum) => datum.id === activeSpectrum?.id);
|
|
19
20
|
if (activeSpectrumIndex !== -1) {
|
|
20
21
|
const isFid = data[activeSpectrumIndex].info.isFid || false;
|
|
@@ -29,33 +30,26 @@ function getActiveData(draft) {
|
|
|
29
30
|
function getDomain(draft) {
|
|
30
31
|
let xArray = [];
|
|
31
32
|
let yArray = [];
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
const yDomains = {};
|
|
34
|
+
const xDomains = {};
|
|
34
35
|
const data = getActiveData(draft);
|
|
35
36
|
try {
|
|
36
|
-
|
|
37
|
-
const { display, data } = d;
|
|
37
|
+
for (const d of data) {
|
|
38
|
+
const { display, data, id } = d;
|
|
39
|
+
const { y } = (0, get1DDataXY_1.get1DDataXY)(d);
|
|
40
|
+
const _extent = (0, d3_1.extent)(y);
|
|
38
41
|
const domain = [data.x[0], data.x[data.x.length - 1]];
|
|
39
|
-
|
|
42
|
+
yDomains[id] = _extent;
|
|
43
|
+
xDomains[id] = domain;
|
|
40
44
|
if (display.isVisible) {
|
|
41
|
-
|
|
45
|
+
xArray = xArray.concat(domain);
|
|
46
|
+
yArray = yArray.concat(_extent);
|
|
42
47
|
}
|
|
43
|
-
|
|
44
|
-
}, []);
|
|
45
|
-
yArray = data.reduce((acc, d) => {
|
|
46
|
-
const { display } = d;
|
|
47
|
-
const data = (0, get1DDataXY_1.get1DDataXY)(d);
|
|
48
|
-
const _extent = (0, d3_1.extent)(data.y);
|
|
49
|
-
yDomains[d.id] = _extent;
|
|
50
|
-
if (display.isVisible) {
|
|
51
|
-
acc = acc.concat(_extent);
|
|
52
|
-
}
|
|
53
|
-
return acc;
|
|
54
|
-
}, []);
|
|
48
|
+
}
|
|
55
49
|
}
|
|
56
|
-
catch (
|
|
57
|
-
//
|
|
58
|
-
|
|
50
|
+
catch (error) {
|
|
51
|
+
// TODO: handle error.
|
|
52
|
+
reportError(error);
|
|
59
53
|
}
|
|
60
54
|
return {
|
|
61
55
|
xDomain: (0, d3_1.extent)(xArray),
|
|
@@ -68,54 +62,44 @@ exports.getDomain = getDomain;
|
|
|
68
62
|
function get2DDomain(state) {
|
|
69
63
|
let xArray = [];
|
|
70
64
|
let yArray = [];
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
const yDomains = {};
|
|
66
|
+
const xDomains = {};
|
|
73
67
|
const { view: { spectra: { activeSpectra, activeTab }, }, data, } = state;
|
|
74
68
|
const nucleus = activeTab.split(',');
|
|
75
69
|
try {
|
|
76
|
-
xArray = data.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
datum.info.nucleus?.join(',') === activeTab &&
|
|
87
|
-
datum.info.isFt) {
|
|
88
|
-
acc = acc.concat([datum.data.minY, datum.data.maxY]);
|
|
89
|
-
}
|
|
90
|
-
return acc;
|
|
91
|
-
}, []);
|
|
70
|
+
xArray = data.filter((datum) => (0, Spectrum2D_1.isSpectrum2D)(datum) &&
|
|
71
|
+
datum.info.nucleus?.join(',') === activeTab &&
|
|
72
|
+
datum.info.isFt).flatMap((datum) => {
|
|
73
|
+
return [datum.data.minX, datum.data.maxX];
|
|
74
|
+
});
|
|
75
|
+
yArray = data.filter((d) => (0, Spectrum2D_1.isSpectrum2D)(d) &&
|
|
76
|
+
d.info.nucleus?.join(',') === activeTab &&
|
|
77
|
+
d.info.isFt).flatMap((datum) => {
|
|
78
|
+
return [datum.data.minY, datum.data.maxY];
|
|
79
|
+
});
|
|
92
80
|
}
|
|
93
|
-
catch (
|
|
94
|
-
//
|
|
95
|
-
|
|
81
|
+
catch (error) {
|
|
82
|
+
// TODO: handle error
|
|
83
|
+
reportError(error);
|
|
96
84
|
}
|
|
97
|
-
const spectrumsIDs = nucleus.map((n) => activeSpectra[n]?.id);
|
|
98
|
-
const filteredData = data
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
85
|
+
const spectrumsIDs = new Set(nucleus.map((n) => activeSpectra[n]?.id));
|
|
86
|
+
const filteredData = data
|
|
87
|
+
.filter((d) => spectrumsIDs.has(d.id) && d.info.dimension === 1)
|
|
88
|
+
.map((datum) => {
|
|
89
|
+
return datum;
|
|
90
|
+
});
|
|
103
91
|
try {
|
|
104
|
-
|
|
105
|
-
const { x } = d.data;
|
|
92
|
+
for (const d of filteredData) {
|
|
93
|
+
const { x, re } = d.data;
|
|
106
94
|
const domain = [x[0], x[x.length - 1]];
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const _extent = (0, d3_1.extent)(d.data.re);
|
|
112
|
-
acc[d.id] = _extent;
|
|
113
|
-
return acc;
|
|
114
|
-
}, {});
|
|
95
|
+
xDomains[d.id] = domain;
|
|
96
|
+
const _extent = (0, d3_1.extent)(re);
|
|
97
|
+
yDomains[d.id] = _extent;
|
|
98
|
+
}
|
|
115
99
|
}
|
|
116
|
-
catch (
|
|
117
|
-
//
|
|
118
|
-
|
|
100
|
+
catch (error) {
|
|
101
|
+
// TODO: handle error.
|
|
102
|
+
reportError(error);
|
|
119
103
|
}
|
|
120
104
|
return {
|
|
121
105
|
xDomain: (0, d3_1.extent)(xArray),
|
|
@@ -140,10 +124,9 @@ function setDomain(draft, options) {
|
|
|
140
124
|
if (yDomain.isChanged) {
|
|
141
125
|
draft.yDomain = domain.yDomain;
|
|
142
126
|
if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D && yDomain.isShared) {
|
|
143
|
-
draft.yDomains = Object.keys(domain.yDomains).
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}, {});
|
|
127
|
+
draft.yDomains = Object.fromEntries(Object.keys(domain.yDomains).map((key) => {
|
|
128
|
+
return [key, domain.yDomain];
|
|
129
|
+
}));
|
|
147
130
|
}
|
|
148
131
|
else {
|
|
149
132
|
draft.yDomains = domain.yDomains;
|
|
@@ -200,8 +183,8 @@ function handelResetDomain(draft) {
|
|
|
200
183
|
}
|
|
201
184
|
exports.handelResetDomain = handelResetDomain;
|
|
202
185
|
function setMode(draft) {
|
|
203
|
-
const
|
|
186
|
+
const datum_ = draft.data.find((datum) => draft.xDomains[datum.id] &&
|
|
204
187
|
(0, nucleusToString_1.default)(datum.info.nucleus) === draft.view.spectra.activeTab);
|
|
205
|
-
draft.mode =
|
|
188
|
+
draft.mode = datum_?.info.isFid ? 'LTR' : 'RTL';
|
|
206
189
|
}
|
|
207
190
|
exports.setMode = setMode;
|
|
@@ -137,7 +137,10 @@ function applyManualPhaseCorrectionFilter(draft, filterOptions) {
|
|
|
137
137
|
const { index } = activeSpectrum;
|
|
138
138
|
const { ph0, ph1 } = filterOptions;
|
|
139
139
|
FiltersManager.applyFilter(draft.data[index], [
|
|
140
|
-
{
|
|
140
|
+
{
|
|
141
|
+
name: Filters.phaseCorrection.id,
|
|
142
|
+
options: { ph0, ph1, absolute: false },
|
|
143
|
+
},
|
|
141
144
|
]);
|
|
142
145
|
(0, ToolsActions_1.resetSelectedTool)(draft);
|
|
143
146
|
draft.tempData = null;
|
|
@@ -148,7 +151,10 @@ function applyAbsoluteFilter(draft) {
|
|
|
148
151
|
const activeSpectrum = (0, getActiveSpectrumOrFail_1.getActiveSpectrumOrFail)(draft);
|
|
149
152
|
const { index } = activeSpectrum;
|
|
150
153
|
FiltersManager.applyFilter(draft.data[index], [
|
|
151
|
-
{
|
|
154
|
+
{
|
|
155
|
+
name: Filters.phaseCorrection.id,
|
|
156
|
+
options: { absolute: true, ph0: 0, ph1: 0 },
|
|
157
|
+
},
|
|
152
158
|
]);
|
|
153
159
|
(0, ToolsActions_1.resetSelectedTool)(draft);
|
|
154
160
|
draft.tempData = null;
|
|
@@ -160,7 +166,10 @@ function applyAutoPhaseCorrectionFilter(draft) {
|
|
|
160
166
|
const { index } = activeSpectrum;
|
|
161
167
|
const { ph0, ph1 } = (0, autoPhaseCorrection_1.apply)(draft.data[index]);
|
|
162
168
|
FiltersManager.applyFilter(draft.data[index], [
|
|
163
|
-
{
|
|
169
|
+
{
|
|
170
|
+
name: Filters.phaseCorrection.id,
|
|
171
|
+
options: { ph0, ph1, absolute: false },
|
|
172
|
+
},
|
|
164
173
|
]);
|
|
165
174
|
(0, ToolsActions_1.resetSelectedTool)(draft);
|
|
166
175
|
draft.tempData = null;
|
|
@@ -247,7 +256,7 @@ function deleteSpectraFilter(draft, actions) {
|
|
|
247
256
|
for (const datum of draft.data) {
|
|
248
257
|
if ((0, nucleusToString_1.default)(datum?.info?.nucleus) === draft.view.spectra.activeTab) {
|
|
249
258
|
const filtersResult = datum.filters?.filter((filter) => filter.name === filterType) || [];
|
|
250
|
-
|
|
259
|
+
for (const filter of filtersResult) {
|
|
251
260
|
FiltersManager.deleteFilter(datum, filter.id);
|
|
252
261
|
if (datum.info?.dimension === 1) {
|
|
253
262
|
(0, Spectrum1D_1.updateXShift)(datum);
|
|
@@ -255,7 +264,7 @@ function deleteSpectraFilter(draft, actions) {
|
|
|
255
264
|
else if (datum.info?.dimension === 2) {
|
|
256
265
|
(0, Spectrum2D_1.updateShift)(datum);
|
|
257
266
|
}
|
|
258
|
-
}
|
|
267
|
+
}
|
|
259
268
|
}
|
|
260
269
|
}
|
|
261
270
|
(0, ToolsActions_1.resetSelectedTool)(draft);
|
|
@@ -305,7 +314,7 @@ function resetSpectrumByFilter(draft, options) {
|
|
|
305
314
|
let filters = [];
|
|
306
315
|
if (filterIndex !== -1) {
|
|
307
316
|
filters = datum.filters.slice(0, rollback ? filterIndex : filterIndex + 1);
|
|
308
|
-
if (filters.length
|
|
317
|
+
if (filters.length > 0) {
|
|
309
318
|
draft.toolOptions.data.activeFilterID =
|
|
310
319
|
datum.filters[rollback ? filterIndex - 1 : filterIndex]?.id;
|
|
311
320
|
}
|
|
@@ -5,10 +5,10 @@ const DomainActions_1 = require("./DomainActions");
|
|
|
5
5
|
function handleHistoryUndo(draft) {
|
|
6
6
|
const { past, present, future } = draft.history;
|
|
7
7
|
const previous = past[past.length - 1];
|
|
8
|
-
const newPast = past.slice(0,
|
|
8
|
+
const newPast = past.slice(0, -1);
|
|
9
9
|
const newfuture = [present, ...future];
|
|
10
|
-
const hasRedo = newfuture.length
|
|
11
|
-
const hasUndo = past.length
|
|
10
|
+
const hasRedo = newfuture.length > 0;
|
|
11
|
+
const hasUndo = past.length > 0;
|
|
12
12
|
const domain = (0, DomainActions_1.getDomain)(draft.data);
|
|
13
13
|
const history = {
|
|
14
14
|
past: newPast,
|
|
@@ -24,13 +24,13 @@ function handleHistoryUndo(draft) {
|
|
|
24
24
|
}
|
|
25
25
|
exports.handleHistoryUndo = handleHistoryUndo;
|
|
26
26
|
function handleHistoryRedo(draft) {
|
|
27
|
-
const { history } = draft;
|
|
27
|
+
const { history, data } = draft;
|
|
28
28
|
const newPresent = history.future.shift();
|
|
29
29
|
history.past.push(history.present);
|
|
30
30
|
history.present = newPresent;
|
|
31
31
|
history.hasUndo = true;
|
|
32
32
|
history.hasRedo = history.future.length > 0;
|
|
33
|
-
(0, DomainActions_1.setDomain)(
|
|
33
|
+
(0, DomainActions_1.setDomain)(data);
|
|
34
34
|
}
|
|
35
35
|
exports.handleHistoryRedo = handleHistoryRedo;
|
|
36
36
|
function handleHistoryReset(draft, action) {
|
|
@@ -9,11 +9,12 @@ const immer_1 = require("immer");
|
|
|
9
9
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
10
10
|
const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
|
|
11
11
|
const SumManager_1 = require("../../../data/data1d/Spectrum1D/SumManager");
|
|
12
|
+
const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
|
|
12
13
|
const getRange_1 = __importDefault(require("../helper/getRange"));
|
|
13
14
|
const DomainActions_1 = require("./DomainActions");
|
|
14
15
|
function handleChangeIntegralSum(draft, options) {
|
|
15
16
|
const { data, view: { spectra: { activeTab: nucleus }, }, } = draft;
|
|
16
|
-
const activeSpectrum =
|
|
17
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
17
18
|
if (activeSpectrum?.id) {
|
|
18
19
|
const { index } = activeSpectrum;
|
|
19
20
|
const datum = data[index];
|
|
@@ -25,7 +26,7 @@ exports.handleChangeIntegralSum = handleChangeIntegralSum;
|
|
|
25
26
|
function addIntegral(draft, action) {
|
|
26
27
|
const { startX, endX } = action;
|
|
27
28
|
const { data, molecules, view: { spectra: { activeTab: nucleus }, }, } = draft;
|
|
28
|
-
const activeSpectrum =
|
|
29
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
29
30
|
const [from, to] = (0, getRange_1.default)(draft, { startX, endX });
|
|
30
31
|
if (activeSpectrum?.id) {
|
|
31
32
|
const datum = data[activeSpectrum.index];
|
|
@@ -51,7 +52,7 @@ function addIntegral(draft, action) {
|
|
|
51
52
|
}
|
|
52
53
|
exports.addIntegral = addIntegral;
|
|
53
54
|
function deleteIntegral(draft, action) {
|
|
54
|
-
const activeSpectrum =
|
|
55
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
55
56
|
if (activeSpectrum) {
|
|
56
57
|
const state = (0, immer_1.original)(draft);
|
|
57
58
|
const { index } = activeSpectrum;
|
|
@@ -69,7 +70,7 @@ function deleteIntegral(draft, action) {
|
|
|
69
70
|
}
|
|
70
71
|
exports.deleteIntegral = deleteIntegral;
|
|
71
72
|
function changeIntegral(draft, action) {
|
|
72
|
-
const activeSpectrum =
|
|
73
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
73
74
|
const state = (0, immer_1.original)(draft);
|
|
74
75
|
const integral = action.payload.data;
|
|
75
76
|
if (activeSpectrum?.id) {
|
|
@@ -91,7 +92,7 @@ function changeIntegral(draft, action) {
|
|
|
91
92
|
}
|
|
92
93
|
exports.changeIntegral = changeIntegral;
|
|
93
94
|
function handleChangeIntegralsRelativeValue(draft, action) {
|
|
94
|
-
const activeSpectrum =
|
|
95
|
+
const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
|
|
95
96
|
const data = action.payload.data;
|
|
96
97
|
if (activeSpectrum?.id) {
|
|
97
98
|
const { index } = activeSpectrum;
|
|
@@ -99,6 +99,18 @@ function setPreferences(draft, data) {
|
|
|
99
99
|
}
|
|
100
100
|
function initiate(draft, action) {
|
|
101
101
|
const state = (0, Reducer_1.getInitialState)();
|
|
102
|
+
const { spectra, usedColors } = action.payload;
|
|
103
|
+
const newSpectra = [];
|
|
104
|
+
for (let spectrum of spectra) {
|
|
105
|
+
const { info } = spectrum;
|
|
106
|
+
if (info.dimension === 1) {
|
|
107
|
+
newSpectra.push((0, Spectrum1D_1.initiateDatum1D)(spectrum, usedColors));
|
|
108
|
+
}
|
|
109
|
+
else if (info.dimension === 2) {
|
|
110
|
+
newSpectra.push((0, Spectrum2D_1.initiateDatum2D)(spectrum, usedColors));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
action.payload.spectra = newSpectra;
|
|
102
114
|
setData(state, action.payload);
|
|
103
115
|
const preferences = action.payload?.preferences || {};
|
|
104
116
|
(0, ToolsActions_1.setActiveTab)(state, { tab: preferences?.activeTab || '' });
|