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
|
@@ -14,8 +14,8 @@ const Tabs_1 = __importDefault(require("../../elements/Tab/Tabs"));
|
|
|
14
14
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
15
15
|
const Reducer_1 = require("../../reducer/Reducer");
|
|
16
16
|
const Types_1 = require("../../reducer/types/Types");
|
|
17
|
-
const Export_1 = require("../../utility/Export");
|
|
18
17
|
const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey"));
|
|
18
|
+
const export_1 = require("../../utility/export");
|
|
19
19
|
const SpectrumListItem_1 = __importDefault(require("./SpectrumListItem"));
|
|
20
20
|
const SpectrumSetting_1 = __importDefault(require("./base/setting/SpectrumSetting"));
|
|
21
21
|
function SpectrumsTabsInner({ data, activeSpectrum, activeTab, onTabChange, }) {
|
|
@@ -28,13 +28,13 @@ function SpectrumsTabsInner({ data, activeSpectrum, activeTab, onTabChange, }) {
|
|
|
28
28
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
29
29
|
(0, react_1.useEffect)(() => {
|
|
30
30
|
if (data) {
|
|
31
|
-
const visibleMarkers =
|
|
31
|
+
const visibleMarkers = [];
|
|
32
|
+
for (const datum of data) {
|
|
32
33
|
if (datum.info.dimension === 1 &&
|
|
33
34
|
datum.display.isPeaksMarkersVisible) {
|
|
34
|
-
|
|
35
|
+
visibleMarkers.push({ id: datum.id });
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
}, []);
|
|
37
|
+
}
|
|
38
38
|
setMarkersVisible(visibleMarkers);
|
|
39
39
|
}
|
|
40
40
|
}, [data, dispatch]);
|
|
@@ -75,7 +75,7 @@ function SpectrumsTabsInner({ data, activeSpectrum, activeTab, onTabChange, }) {
|
|
|
75
75
|
onClick: (spectrumData) => {
|
|
76
76
|
void (async () => {
|
|
77
77
|
const { x, y, info } = spectrumData;
|
|
78
|
-
const success = await (0,
|
|
78
|
+
const success = await (0, export_1.copyTextToClipboard)(JSON.stringify({ x, y, info }, undefined, 2));
|
|
79
79
|
if (success) {
|
|
80
80
|
alert.success('Data copied to clipboard');
|
|
81
81
|
}
|
|
@@ -15,7 +15,7 @@ function ColorIndicator2D({ positiveColor, negativeColor, activated, }) {
|
|
|
15
15
|
return ((0, jsx_runtime_1.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", opacity: activated ? 1 : 0.2, children: (0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("path", { d: "M0,0H12L0,12Z", fill: positiveColor, strokeWidth: "0" }), (0, jsx_runtime_1.jsx)("path", { d: "M12,12H0L12,0Z", fill: negativeColor, strokeWidth: "0" })] }) }));
|
|
16
16
|
}
|
|
17
17
|
function ColorIndicator(props) {
|
|
18
|
-
const { style, onClick = () => null, activated } = props;
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)("button", { style: style, type: "button", onClick: onClick, children:
|
|
18
|
+
const { style, onClick = () => null, activated, dimension, color } = props;
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)("button", { style: style, type: "button", onClick: onClick, children: dimension === 2 ? ((0, jsx_runtime_1.jsx)(ColorIndicator2D, { ...color, activated: activated })) : ((0, jsx_runtime_1.jsx)(ColorIndicator1D, { activated: activated, ...color })) }));
|
|
20
20
|
}
|
|
21
21
|
exports.default = (0, react_1.memo)(ColorIndicator);
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const FormikColorPicker_1 = __importDefault(require("../../../../elements/formik/FormikColorPicker"));
|
|
8
8
|
const FormikForm_1 = __importDefault(require("../../../../elements/formik/FormikForm"));
|
|
9
|
+
const FormikOnChange_1 = __importDefault(require("../../../../elements/formik/FormikOnChange"));
|
|
9
10
|
const Spectrum1DHistogram_1 = __importDefault(require("./Spectrum1DHistogram"));
|
|
10
11
|
function Spectrum1DSetting({ data: SpectrumData, onSubmit, }) {
|
|
11
|
-
return ((0, jsx_runtime_1.
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)(FormikForm_1.default, { initialValues: SpectrumData.display, onSubmit: onSubmit, children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', gap: '1.25rem' }, children: [(0, jsx_runtime_1.jsx)("div", { style: { display: 'block', position: 'relative' }, children: (0, jsx_runtime_1.jsx)(FormikColorPicker_1.default, { name: "color" }) }), (0, jsx_runtime_1.jsx)(Spectrum1DHistogram_1.default, { color: "red", data: SpectrumData.data })] }), (0, jsx_runtime_1.jsx)(FormikOnChange_1.default, { onChange: onSubmit })] }));
|
|
12
13
|
}
|
|
13
14
|
exports.default = Spectrum1DSetting;
|
|
@@ -9,6 +9,7 @@ const react_1 = require("@emotion/react");
|
|
|
9
9
|
const FormikColorPicker_1 = __importDefault(require("../../../../elements/formik/FormikColorPicker"));
|
|
10
10
|
const FormikForm_1 = __importDefault(require("../../../../elements/formik/FormikForm"));
|
|
11
11
|
const FormikInput_1 = __importDefault(require("../../../../elements/formik/FormikInput"));
|
|
12
|
+
const FormikOnChange_1 = __importDefault(require("../../../../elements/formik/FormikOnChange"));
|
|
12
13
|
const FormikSlider_1 = __importDefault(require("../../../../elements/formik/FormikSlider"));
|
|
13
14
|
const Spectrum2DHistogram_1 = __importDefault(require("./Spectrum2DHistogram"));
|
|
14
15
|
const style = (color) => (0, react_1.css) `
|
|
@@ -19,6 +20,6 @@ const style = (color) => (0, react_1.css) `
|
|
|
19
20
|
`;
|
|
20
21
|
function Spectrum2DSetting({ data: SpectrumData, onSubmit, }) {
|
|
21
22
|
const { positiveColor, negativeColor } = SpectrumData.display;
|
|
22
|
-
return ((0, jsx_runtime_1.
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(FormikForm_1.default, { initialValues: SpectrumData.display, children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { css: style(positiveColor), children: [(0, jsx_runtime_1.jsx)("span", { style: { padding: '0 10px' }, children: "Positive" }), (0, jsx_runtime_1.jsx)(FormikColorPicker_1.default, { name: "positiveColor" }), (0, jsx_runtime_1.jsxs)("div", { style: { padding: '5px' }, children: [(0, jsx_runtime_1.jsx)("span", { className: "label", children: "contour Levels [ min - max ]" }), (0, jsx_runtime_1.jsx)(FormikSlider_1.default, { name: "contourOptions.positive.contourLevels", debounceTime: 100 }), (0, jsx_runtime_1.jsx)("span", { className: "label", children: "number of Layers " }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "contourOptions.positive.numberOfLayers", type: "number", debounceTime: 250 })] })] }), (0, jsx_runtime_1.jsxs)("div", { css: style(negativeColor), children: [(0, jsx_runtime_1.jsx)("span", { style: { padding: '0 10px' }, children: "Negative" }), (0, jsx_runtime_1.jsx)(FormikColorPicker_1.default, { name: "negativeColor" }), (0, jsx_runtime_1.jsxs)("div", { style: { padding: '5px' }, children: [(0, jsx_runtime_1.jsx)("span", { className: "label", children: "contour Levels [ min - max ]" }), (0, jsx_runtime_1.jsx)(FormikSlider_1.default, { name: "contourOptions.negative.contourLevels", debounceTime: 100 }), (0, jsx_runtime_1.jsx)("span", { className: "label", children: "number of Layers " }), (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "contourOptions.negative.numberOfLayers", type: "number", debounceTime: 250 })] })] }), (0, jsx_runtime_1.jsx)(Spectrum2DHistogram_1.default, { data: SpectrumData.data })] }), (0, jsx_runtime_1.jsx)(FormikOnChange_1.default, { onChange: onSubmit })] }));
|
|
23
24
|
}
|
|
24
25
|
exports.default = Spectrum2DSetting;
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processSnapPlot = void 0;
|
|
4
4
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
5
|
+
const calculateSanPlot_1 = require("../../../../../data/utilities/calculateSanPlot");
|
|
5
6
|
function processSnapPlot(dimension, data, yLogBase) {
|
|
6
|
-
const
|
|
7
|
-
? prepare1DData(data)
|
|
8
|
-
: prepare2DData(data);
|
|
9
|
-
const sanResult = (0, ml_spectra_processing_1.xNoiseSanPlot)(input);
|
|
7
|
+
const sanResult = (0, calculateSanPlot_1.calculateSanPlot)(dimension, data);
|
|
10
8
|
const sanPlot = {};
|
|
11
9
|
const lines = {};
|
|
12
10
|
for (let plotKey in sanResult.sanplot) {
|
|
@@ -21,27 +19,6 @@ function processSnapPlot(dimension, data, yLogBase) {
|
|
|
21
19
|
return { sanPlot, lines };
|
|
22
20
|
}
|
|
23
21
|
exports.processSnapPlot = processSnapPlot;
|
|
24
|
-
function prepare1DData(data) {
|
|
25
|
-
const length = data.re.length;
|
|
26
|
-
const jump = Math.floor(length / 307200) || 1;
|
|
27
|
-
const array = new Float64Array((length / jump) >> 0);
|
|
28
|
-
let index = 0;
|
|
29
|
-
for (let i = 0; i < array.length; i += jump) {
|
|
30
|
-
array[index++] = data.re[i];
|
|
31
|
-
}
|
|
32
|
-
return array;
|
|
33
|
-
}
|
|
34
|
-
function prepare2DData(data) {
|
|
35
|
-
let cols = data.z[0].length;
|
|
36
|
-
let rows = data.z.length;
|
|
37
|
-
let jump = Math.floor((cols * rows) / 204800) || 1;
|
|
38
|
-
const array = new Float64Array(((cols * rows) / jump) >> 0);
|
|
39
|
-
let index = 0;
|
|
40
|
-
for (let i = 0; i < array.length; i += jump) {
|
|
41
|
-
array[index++] = data.z[(i / rows) >> 0][i % rows];
|
|
42
|
-
}
|
|
43
|
-
return array;
|
|
44
|
-
}
|
|
45
22
|
function getLine(value, data, options) {
|
|
46
23
|
const { log10, abs } = Math;
|
|
47
24
|
const { yLogBase } = options;
|
|
@@ -19,18 +19,17 @@ function AdditionalColumnField({ rowCorrelation, columnCorrelation, commonLinks,
|
|
|
19
19
|
const contextRef = (0, react_1.useRef)();
|
|
20
20
|
const modal = (0, Modal_1.useModal)();
|
|
21
21
|
const highlightIDsCommonLinks = (0, react_1.useMemo)(() => {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
return commonLinks.flatMap((link) => {
|
|
23
|
+
const ids = [];
|
|
24
24
|
if (link.pseudo === false) {
|
|
25
|
-
ids.push(link.signal.id);
|
|
26
|
-
ids.push((0, Concatenation_1.buildID)(link.signal.id, 'Crosshair'));
|
|
25
|
+
ids.push(link.signal.id, (0, Concatenation_1.buildID)(link.signal.id, 'Crosshair'));
|
|
27
26
|
const _id = (0, FindUtilities_1.findRangeOrZoneID)(spectraData, link.experimentID, link.signal.id, true);
|
|
28
27
|
if (_id) {
|
|
29
28
|
ids.push(_id);
|
|
30
29
|
}
|
|
31
30
|
}
|
|
31
|
+
return ids;
|
|
32
32
|
});
|
|
33
|
-
return ids;
|
|
34
33
|
}, [commonLinks, spectraData]);
|
|
35
34
|
const highlightCommonLinks = (0, highlight_1.useHighlight)(highlightIDsCommonLinks);
|
|
36
35
|
const mouseEnterHandler = (0, react_1.useCallback)((event) => {
|
|
@@ -82,8 +81,7 @@ function AdditionalColumnField({ rowCorrelation, columnCorrelation, commonLinks,
|
|
|
82
81
|
}, [columnCorrelation, onEdit, rowCorrelation]);
|
|
83
82
|
const contextMenu = (0, react_1.useMemo)(() => {
|
|
84
83
|
// allow the edition of correlations
|
|
85
|
-
const commonLinksMenu = commonLinks
|
|
86
|
-
.map((commonLink) => {
|
|
84
|
+
const commonLinksMenu = commonLinks.flatMap((commonLink) => {
|
|
87
85
|
const commonLinkContextMenuLabel = `${(0, Utilities_1.getAbbreviation)(commonLink)} (${commonLink.signal.x ? commonLink.signal.x.delta.toFixed(2) : '?'}, ${commonLink.signal.y ? commonLink.signal.y.delta.toFixed(2) : '?'})${commonLink.edited?.moved === true ? '[MOVED]' : ''}`;
|
|
88
86
|
return commonLink.pseudo === false
|
|
89
87
|
? [
|
|
@@ -99,8 +97,7 @@ function AdditionalColumnField({ rowCorrelation, columnCorrelation, commonLinks,
|
|
|
99
97
|
},
|
|
100
98
|
]
|
|
101
99
|
: [];
|
|
102
|
-
})
|
|
103
|
-
.flat();
|
|
100
|
+
});
|
|
104
101
|
// allow addition or removal of a pseudo HSQC link between pseudo heavy atom and proton
|
|
105
102
|
const commonPseudoLinkHSQC = commonLinks.find((commonLink) => commonLink.pseudo === true && commonLink.experimentType === 'hsqc');
|
|
106
103
|
if (rowCorrelation.pseudo === true) {
|
|
@@ -133,14 +130,13 @@ function AdditionalColumnField({ rowCorrelation, columnCorrelation, commonLinks,
|
|
|
133
130
|
? 'blue'
|
|
134
131
|
: 'black',
|
|
135
132
|
}, children: (0, Utilities_1.getAbbreviation)(commonLink) }), i < commonLinks.length - 1 && (0, jsx_runtime_1.jsx)("label", { children: "/" })] }, commonLink.id))), [commonLinks]);
|
|
136
|
-
const title = (0, react_1.useMemo)(() =>
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}, [])
|
|
143
|
-
.join('/'), [commonLinks]);
|
|
133
|
+
const title = (0, react_1.useMemo)(() => {
|
|
134
|
+
return [
|
|
135
|
+
...new Set(commonLinks.link.map((link) => {
|
|
136
|
+
return link.experimentType.toUpperCase();
|
|
137
|
+
})),
|
|
138
|
+
].join('/');
|
|
139
|
+
}, [commonLinks]);
|
|
144
140
|
const isInViewRow = (0, useInView_1.default)({ correlation: rowCorrelation });
|
|
145
141
|
const isInViewColumn = (0, useInView_1.default)({ correlation: columnCorrelation });
|
|
146
142
|
return ((0, jsx_runtime_1.jsxs)("td", { onContextMenu: (e) => {
|
|
@@ -22,18 +22,17 @@ function AdditionalColumnHeader({ spectraData, correlationsData, correlation, on
|
|
|
22
22
|
if (correlation.pseudo === true) {
|
|
23
23
|
return [];
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
return correlation.link.flatMap((link) => {
|
|
26
|
+
const ids = [];
|
|
27
27
|
if (link.pseudo === false) {
|
|
28
|
-
ids.push(link.signal.id);
|
|
29
|
-
ids.push((0, Concatenation_1.buildID)(link.signal.id, 'Crosshair_X'));
|
|
28
|
+
ids.push(link.signal.id, (0, Concatenation_1.buildID)(link.signal.id, 'Crosshair_X'));
|
|
30
29
|
const _id = (0, FindUtilities_1.findRangeOrZoneID)(spectraData, link.experimentID, link.signal.id, true);
|
|
31
30
|
if (_id) {
|
|
32
31
|
ids.push(_id);
|
|
33
32
|
}
|
|
34
33
|
}
|
|
34
|
+
return ids;
|
|
35
35
|
});
|
|
36
|
-
return ids;
|
|
37
36
|
}, [correlation, spectraData]);
|
|
38
37
|
const highlightAdditionalColumn = (0, highlight_1.useHighlight)(highlightIDsAdditionalColumn);
|
|
39
38
|
const mouseEnterHandler = (0, react_1.useCallback)((event) => {
|
|
@@ -46,26 +45,26 @@ function AdditionalColumnHeader({ spectraData, correlationsData, correlation, on
|
|
|
46
45
|
}, [highlightAdditionalColumn]);
|
|
47
46
|
const isInView = (0, useInView_1.default)({ correlation });
|
|
48
47
|
const tableHeaderProps = (0, react_1.useMemo)(() => {
|
|
48
|
+
const title = [
|
|
49
|
+
...new Set(correlation.link
|
|
50
|
+
.map((link) => {
|
|
51
|
+
if (link.pseudo === false) {
|
|
52
|
+
return link.experimentType.toUpperCase();
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
})
|
|
56
|
+
.sort()),
|
|
57
|
+
].join('/');
|
|
49
58
|
return {
|
|
50
59
|
style: {
|
|
51
|
-
|
|
60
|
+
color: (0, Utilities_1.getLabelColor)(correlationsData, correlation) || undefined,
|
|
52
61
|
backgroundColor: highlightAdditionalColumn.isActive
|
|
53
62
|
? '#ff6f0057'
|
|
54
63
|
: isInView
|
|
55
64
|
? '#f5f5dc'
|
|
56
65
|
: 'inherit',
|
|
57
66
|
},
|
|
58
|
-
title: correlation.pseudo === false &&
|
|
59
|
-
correlation.link
|
|
60
|
-
.reduce((arr, link) => {
|
|
61
|
-
if (link.pseudo === false &&
|
|
62
|
-
!arr.includes(link.experimentType.toUpperCase())) {
|
|
63
|
-
arr.push(link.experimentType.toUpperCase());
|
|
64
|
-
}
|
|
65
|
-
return arr;
|
|
66
|
-
}, [])
|
|
67
|
-
.sort()
|
|
68
|
-
.join('/'),
|
|
67
|
+
title: correlation.pseudo === false && title,
|
|
69
68
|
onMouseEnter: mouseEnterHandler,
|
|
70
69
|
onMouseLeave: mouseLeaveHandler,
|
|
71
70
|
};
|
|
@@ -23,18 +23,17 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
23
23
|
if (correlation.pseudo === true) {
|
|
24
24
|
return [];
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
return correlation.link.flatMap((link) => {
|
|
27
|
+
const ids = [];
|
|
28
28
|
if (link.pseudo === false) {
|
|
29
|
-
ids.push(link.signal.id);
|
|
30
|
-
ids.push((0, Concatenation_1.buildID)(link.signal.id, 'Crosshair_Y'));
|
|
29
|
+
ids.push(link.signal.id, (0, Concatenation_1.buildID)(link.signal.id, 'Crosshair_Y'));
|
|
31
30
|
const _id = (0, FindUtilities_1.findRangeOrZoneID)(spectraData, link.experimentID, link.signal.id, true);
|
|
32
31
|
if (_id) {
|
|
33
32
|
ids.push(_id);
|
|
34
33
|
}
|
|
35
34
|
}
|
|
35
|
+
return ids;
|
|
36
36
|
});
|
|
37
|
-
return ids;
|
|
38
37
|
}, [correlation, spectraData]);
|
|
39
38
|
const highlightRow = (0, highlight_1.useHighlight)(highlightIDsRow);
|
|
40
39
|
const onSaveEquivalencesHandler = (0, react_1.useCallback)((e) => {
|
|
@@ -50,8 +49,8 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
50
49
|
const additionalColumnFields = (0, react_1.useMemo)(() => {
|
|
51
50
|
return additionalColumnData.map((_correlation) => {
|
|
52
51
|
const commonLinks = [];
|
|
53
|
-
correlation.link
|
|
54
|
-
_correlation.link
|
|
52
|
+
for (const link of correlation.link) {
|
|
53
|
+
for (const _link of _correlation.link) {
|
|
55
54
|
if (link.axis !== _link.axis &&
|
|
56
55
|
link.experimentID === _link.experimentID &&
|
|
57
56
|
link.signal.id === _link.signal.id &&
|
|
@@ -67,8 +66,8 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
67
66
|
id: `${_link.id}_${link.id}`,
|
|
68
67
|
}));
|
|
69
68
|
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
72
71
|
return ((0, jsx_runtime_1.jsx)(AdditionalColumnField_1.default, { rowCorrelation: correlation, columnCorrelation: _correlation, commonLinks: commonLinks, correlations: correlations, spectraData: spectraData, onEdit: onEditCorrelationTableCellHandler }, `addColData_${correlation.id}_${_correlation.id}`));
|
|
73
72
|
});
|
|
74
73
|
}, [
|
|
@@ -95,6 +94,16 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
95
94
|
}, [highlightRow]);
|
|
96
95
|
const isInView = (0, useInView_1.default)({ correlation });
|
|
97
96
|
const tableDataProps = (0, react_1.useMemo)(() => {
|
|
97
|
+
const title = [
|
|
98
|
+
...new Set(correlation.link
|
|
99
|
+
.map((link) => {
|
|
100
|
+
if (link.pseudo === false) {
|
|
101
|
+
return link.experimentType.toUpperCase();
|
|
102
|
+
}
|
|
103
|
+
return undefined;
|
|
104
|
+
})
|
|
105
|
+
.sort()),
|
|
106
|
+
].join('/');
|
|
98
107
|
return {
|
|
99
108
|
style: {
|
|
100
109
|
...styleRow,
|
|
@@ -104,17 +113,7 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
104
113
|
? '#f5f5dc'
|
|
105
114
|
: 'inherit',
|
|
106
115
|
},
|
|
107
|
-
title: correlation.pseudo === false &&
|
|
108
|
-
correlation.link
|
|
109
|
-
.reduce((arr, link) => {
|
|
110
|
-
if (link.pseudo === false &&
|
|
111
|
-
!arr.includes(link.experimentType.toUpperCase())) {
|
|
112
|
-
arr.push(link.experimentType.toUpperCase());
|
|
113
|
-
}
|
|
114
|
-
return arr;
|
|
115
|
-
}, [])
|
|
116
|
-
.sort()
|
|
117
|
-
.join('/'),
|
|
116
|
+
title: correlation.pseudo === false && title,
|
|
118
117
|
onMouseEnter: mouseEnterHandler,
|
|
119
118
|
onMouseLeave: mouseLeaveHandler,
|
|
120
119
|
};
|
|
@@ -176,7 +175,7 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
176
175
|
contextRef.current.handleContextMenu(e);
|
|
177
176
|
}, [contextRef]);
|
|
178
177
|
const { title, ...otherTableDataProps } = tableDataProps;
|
|
179
|
-
const t =
|
|
178
|
+
const t = title || '';
|
|
180
179
|
return ((0, jsx_runtime_1.jsxs)("tr", { style: styleRow, children: [(0, jsx_runtime_1.jsxs)("td", { title: t, ...{
|
|
181
180
|
...otherTableDataProps,
|
|
182
181
|
style: { ...tableDataProps.style, styleLabel },
|
|
@@ -40,24 +40,24 @@ const moveLinkStyles = (0, react_1.css) `
|
|
|
40
40
|
background-color: gray;
|
|
41
41
|
}
|
|
42
42
|
`;
|
|
43
|
+
function getCorrelationLabel(correlation) {
|
|
44
|
+
const delta = (0, nmr_correlation_1.getCorrelationDelta)(correlation);
|
|
45
|
+
return `${delta ? delta.toFixed(2) : '?'}`;
|
|
46
|
+
}
|
|
43
47
|
function MoveLink({ correlationDim1, correlationDim2, link, correlations, onEdit, }) {
|
|
44
48
|
const [selectedCorrelationIdDim1, setSelectedCorrelationIdDim1] = (0, react_2.useState)(correlationDim1.id);
|
|
45
49
|
const [selectedCorrelationIdDim2, setSelectedCorrelationIdDim2] = (0, react_2.useState)(correlationDim2?.id || undefined);
|
|
46
|
-
function getCorrelationLabel(correlation) {
|
|
47
|
-
const delta = (0, nmr_correlation_1.getCorrelationDelta)(correlation);
|
|
48
|
-
return `${delta ? delta.toFixed(2) : '?'}`;
|
|
49
|
-
}
|
|
50
50
|
const getSelection = (0, react_2.useCallback)((correlation, dim) => {
|
|
51
|
-
const selectionData =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
const selectionData = [];
|
|
52
|
+
for (const correlation of correlations) {
|
|
53
|
+
if (correlation.pseudo === false &&
|
|
54
|
+
correlation.atomType === link.atomType[dim]) {
|
|
55
|
+
selectionData.push({
|
|
56
|
+
value: correlation.id,
|
|
57
|
+
label: `${correlation.label.origin}: ${getCorrelationLabel(correlation)}`,
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
}, []);
|
|
60
|
+
}
|
|
61
61
|
selectionData.push({
|
|
62
62
|
key: 'new',
|
|
63
63
|
value: 'new',
|
|
@@ -80,11 +80,7 @@ function SetShiftToleranceModal({ onClose, onSave, previousTolerance, }) {
|
|
|
80
80
|
(0, react_2.useEffect)(() => {
|
|
81
81
|
if (previousTolerance) {
|
|
82
82
|
setTolerance(previousTolerance);
|
|
83
|
-
|
|
84
|
-
Object.keys(previousTolerance).forEach((atomType) => {
|
|
85
|
-
_isValid[atomType] = true;
|
|
86
|
-
});
|
|
87
|
-
setIsValid(_isValid);
|
|
83
|
+
setIsValid(Object.fromEntries(Object.keys(previousTolerance).map((atomType) => [atomType, true])));
|
|
88
84
|
}
|
|
89
85
|
else {
|
|
90
86
|
setTolerance(undefined);
|
|
@@ -59,26 +59,36 @@ function findSignalMatch2D(spectrum, link, factor, xDomain0, xDomain1, yDomain0,
|
|
|
59
59
|
exports.findSignalMatch2D = findSignalMatch2D;
|
|
60
60
|
function getAbbreviation(link) {
|
|
61
61
|
let abbreviation = 'X';
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
62
|
+
switch (link.experimentType) {
|
|
63
|
+
case 'hsqc':
|
|
64
|
+
case 'hmqc': {
|
|
65
|
+
abbreviation =
|
|
66
|
+
!link.signal || link.signal.sign === 0
|
|
67
|
+
? 'S'
|
|
68
|
+
: `S${link.signal.sign === 1 ? '+' : '-'}`;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
case 'hmbc':
|
|
72
|
+
case 'cosy':
|
|
73
|
+
case 'tocsy': {
|
|
74
|
+
abbreviation = 'M';
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
case 'noesy':
|
|
78
|
+
case 'roesy': {
|
|
79
|
+
abbreviation = 'NOE';
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case 'inadequate': {
|
|
83
|
+
abbreviation = 'I';
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
case 'adequate': {
|
|
87
|
+
abbreviation = 'A';
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
// TODO: handle default?
|
|
91
|
+
// No default
|
|
82
92
|
}
|
|
83
93
|
const pathLength = link.signal.j?.pathLength;
|
|
84
94
|
if (pathLength) {
|
|
@@ -137,89 +147,90 @@ function getEditedCorrelations({ correlationDim1, correlationDim2, selectedCorre
|
|
|
137
147
|
const linkDim = (0, nmr_correlation_1.getLinkDim)(link);
|
|
138
148
|
const editedCorrelations = [];
|
|
139
149
|
const buildCorrelationDataOptions = {};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
150
|
+
switch (action) {
|
|
151
|
+
case 'move': {
|
|
152
|
+
if (linkDim === 1) {
|
|
153
|
+
// modify current cell correlation
|
|
154
|
+
const _correlationDim1 = cloneCorrelationAndEditLink(correlationDim1, link, 'x', 'remove');
|
|
155
|
+
// modify selected correlation
|
|
156
|
+
let newCorrelationDim1;
|
|
157
|
+
if (selectedCorrelationDim1) {
|
|
158
|
+
newCorrelationDim1 = cloneCorrelationAndEditLink(hasChangedDim1 ? selectedCorrelationDim1 : _correlationDim1, link, 'x', 'add');
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
newCorrelationDim1 = (0, nmr_correlation_1.buildCorrelation)({
|
|
162
|
+
atomType: correlationDim1.atomType,
|
|
163
|
+
link: [buildNewLink1D(link)],
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
editedCorrelations.push(_correlationDim1, newCorrelationDim1);
|
|
167
|
+
buildCorrelationDataOptions.skipDataUpdate = true;
|
|
148
168
|
}
|
|
149
|
-
else {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
169
|
+
else if (linkDim === 2) {
|
|
170
|
+
// modify current cell correlations
|
|
171
|
+
const _correlationDim1 = cloneCorrelationAndEditLink(correlationDim1, link, 'x', 'remove');
|
|
172
|
+
editedCorrelations.push(_correlationDim1);
|
|
173
|
+
const _correlationDim2 = cloneCorrelationAndEditLink(correlationDim2, link, 'y', 'remove');
|
|
174
|
+
editedCorrelations.push(_correlationDim2);
|
|
175
|
+
// modify selected correlations
|
|
176
|
+
if (selectedCorrelationDim1 && selectedCorrelationDim2) {
|
|
177
|
+
editedCorrelations.push(cloneCorrelationAndEditLink(hasChangedDim1 ? selectedCorrelationDim1 : _correlationDim1, link, 'x', 'add'), cloneCorrelationAndEditLink(hasChangedDim2 ? selectedCorrelationDim2 : _correlationDim2, link, 'y', 'add'));
|
|
178
|
+
}
|
|
179
|
+
else if (selectedCorrelationDim1 &&
|
|
180
|
+
selectedCorrelationIdDim2 === 'new') {
|
|
181
|
+
editedCorrelations.push(cloneCorrelationAndEditLink(hasChangedDim1 ? selectedCorrelationDim1 : _correlationDim1, link, 'x', 'add'), (0, nmr_correlation_1.buildCorrelation)({
|
|
182
|
+
atomType: correlationDim2.atomType,
|
|
183
|
+
link: [buildNewLink2D(link, 'y')],
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
else if (selectedCorrelationIdDim1 === 'new' &&
|
|
187
|
+
selectedCorrelationDim2) {
|
|
188
|
+
editedCorrelations.push((0, nmr_correlation_1.buildCorrelation)({
|
|
189
|
+
atomType: correlationDim1.atomType,
|
|
190
|
+
link: [buildNewLink2D(link, 'x')],
|
|
191
|
+
}), cloneCorrelationAndEditLink(hasChangedDim2 ? selectedCorrelationDim2 : _correlationDim2, link, 'y', 'add'));
|
|
192
|
+
}
|
|
193
|
+
else if (selectedCorrelationIdDim1 === 'new' &&
|
|
194
|
+
selectedCorrelationIdDim2 === 'new') {
|
|
195
|
+
editedCorrelations.push((0, nmr_correlation_1.buildCorrelation)({
|
|
196
|
+
atomType: correlationDim1.atomType,
|
|
197
|
+
link: [buildNewLink2D(link, 'x')],
|
|
198
|
+
}), (0, nmr_correlation_1.buildCorrelation)({
|
|
199
|
+
atomType: correlationDim2.atomType,
|
|
200
|
+
link: [buildNewLink2D(link, 'y')],
|
|
201
|
+
}));
|
|
202
|
+
}
|
|
203
|
+
buildCorrelationDataOptions.skipDataUpdate = true;
|
|
154
204
|
}
|
|
155
|
-
|
|
156
|
-
buildCorrelationDataOptions.skipDataUpdate = true;
|
|
205
|
+
break;
|
|
157
206
|
}
|
|
158
|
-
|
|
159
|
-
// modify current cell correlations
|
|
207
|
+
case 'remove': {
|
|
160
208
|
const _correlationDim1 = cloneCorrelationAndEditLink(correlationDim1, link, 'x', 'remove');
|
|
161
209
|
editedCorrelations.push(_correlationDim1);
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if (selectedCorrelationDim1 && selectedCorrelationDim2) {
|
|
166
|
-
editedCorrelations.push(cloneCorrelationAndEditLink(hasChangedDim1 ? selectedCorrelationDim1 : _correlationDim1, link, 'x', 'add'));
|
|
167
|
-
editedCorrelations.push(cloneCorrelationAndEditLink(hasChangedDim2 ? selectedCorrelationDim2 : _correlationDim2, link, 'y', 'add'));
|
|
210
|
+
if ((0, nmr_correlation_1.getLinkDim)(link) === 2) {
|
|
211
|
+
const _correlationDim2 = cloneCorrelationAndEditLink(correlationDim2, link, 'y', 'remove');
|
|
212
|
+
editedCorrelations.push(_correlationDim2);
|
|
168
213
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
case 'unmove': {
|
|
217
|
+
if (linkDim === 1) {
|
|
218
|
+
if (selectedCorrelationDim1) {
|
|
219
|
+
editedCorrelations.push(cloneCorrelationAndEditLink(selectedCorrelationDim1, link, 'x', 'unmove'));
|
|
220
|
+
}
|
|
176
221
|
}
|
|
177
|
-
else if (
|
|
222
|
+
else if (linkDim === 2 &&
|
|
223
|
+
selectedCorrelationDim1 &&
|
|
178
224
|
selectedCorrelationDim2) {
|
|
179
|
-
editedCorrelations.push((
|
|
180
|
-
atomType: correlationDim1.atomType,
|
|
181
|
-
link: [buildNewLink2D(link, 'x')],
|
|
182
|
-
}));
|
|
183
|
-
editedCorrelations.push(cloneCorrelationAndEditLink(hasChangedDim2 ? selectedCorrelationDim2 : _correlationDim2, link, 'y', 'add'));
|
|
184
|
-
}
|
|
185
|
-
else if (selectedCorrelationIdDim1 === 'new' &&
|
|
186
|
-
selectedCorrelationIdDim2 === 'new') {
|
|
187
|
-
editedCorrelations.push((0, nmr_correlation_1.buildCorrelation)({
|
|
188
|
-
atomType: correlationDim1.atomType,
|
|
189
|
-
link: [buildNewLink2D(link, 'x')],
|
|
190
|
-
}));
|
|
191
|
-
editedCorrelations.push((0, nmr_correlation_1.buildCorrelation)({
|
|
192
|
-
atomType: correlationDim2.atomType,
|
|
193
|
-
link: [buildNewLink2D(link, 'y')],
|
|
194
|
-
}));
|
|
225
|
+
editedCorrelations.push(cloneCorrelationAndEditLink(selectedCorrelationDim1, link, 'x', 'unmove'), cloneCorrelationAndEditLink(selectedCorrelationDim2, link, 'y', 'unmove'));
|
|
195
226
|
}
|
|
196
|
-
|
|
227
|
+
break;
|
|
197
228
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
editedCorrelations.push(_correlationDim1);
|
|
202
|
-
if ((0, nmr_correlation_1.getLinkDim)(link) === 2) {
|
|
203
|
-
const _correlationDim2 = cloneCorrelationAndEditLink(correlationDim2, link, 'y', 'remove');
|
|
204
|
-
editedCorrelations.push(_correlationDim2);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
else if (action === 'unmove') {
|
|
208
|
-
if (linkDim === 1) {
|
|
209
|
-
if (selectedCorrelationDim1) {
|
|
210
|
-
editedCorrelations.push(cloneCorrelationAndEditLink(selectedCorrelationDim1, link, 'x', 'unmove'));
|
|
211
|
-
}
|
|
229
|
+
case 'setPathLength': {
|
|
230
|
+
editedCorrelations.push(cloneCorrelationAndSetPathLength(correlationDim1, link, 'x'), cloneCorrelationAndSetPathLength(correlationDim2, link, 'y'));
|
|
231
|
+
break;
|
|
212
232
|
}
|
|
213
|
-
|
|
214
|
-
if (selectedCorrelationDim1 && selectedCorrelationDim2) {
|
|
215
|
-
editedCorrelations.push(cloneCorrelationAndEditLink(selectedCorrelationDim1, link, 'x', 'unmove'));
|
|
216
|
-
editedCorrelations.push(cloneCorrelationAndEditLink(selectedCorrelationDim2, link, 'y', 'unmove'));
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
else if (action === 'setPathLength') {
|
|
221
|
-
editedCorrelations.push(cloneCorrelationAndSetPathLength(correlationDim1, link, 'x'));
|
|
222
|
-
editedCorrelations.push(cloneCorrelationAndSetPathLength(correlationDim2, link, 'y'));
|
|
233
|
+
// No default
|
|
223
234
|
}
|
|
224
235
|
return { editedCorrelations, buildCorrelationDataOptions };
|
|
225
236
|
}
|
|
@@ -262,13 +273,13 @@ function convertValuesString(valuesString, key) {
|
|
|
262
273
|
.join(',');
|
|
263
274
|
valuesString = valuesString.replaceAll('sp', '');
|
|
264
275
|
let values = [];
|
|
265
|
-
const regex = /^(
|
|
276
|
+
const regex = /^(?:\d,{0,1})+$/g;
|
|
266
277
|
if (regex.test(valuesString)) {
|
|
267
278
|
// allow digits followed by optional comma only
|
|
268
279
|
values = valuesString
|
|
269
280
|
.split(',')
|
|
270
281
|
.filter((char) => char.length > 0)
|
|
271
|
-
.map(
|
|
282
|
+
.map(Number);
|
|
272
283
|
}
|
|
273
284
|
// allow key specific values only
|
|
274
285
|
// protonsCount: [0, 1, 2, 3, ...], hybridization: [1, 2, 3]
|