nmrium 0.32.0 → 0.33.0-pre.1667632695
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/Chart1D.js +1 -1
- package/lib/component/1d/LinesSeries.js +1 -1
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/XAxis.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib/component/1d/{Integral.d.ts → integral/Integral.d.ts} +0 -0
- package/lib/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib/component/1d/integral/IntegralIndicator.d.ts +9 -0
- package/lib/component/1d/integral/IntegralIndicator.js +27 -0
- package/lib/component/1d/{IntegralResizable.d.ts → integral/IntegralResizable.d.ts} +0 -0
- package/lib/component/1d/integral/IntegralResizable.js +69 -0
- package/lib/component/1d/{IntegralsSeries.d.ts → integral/IntegralsSeries.d.ts} +0 -0
- package/lib/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib/component/1d/ranges/Range.js +27 -50
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +2 -2
- package/lib/component/2d/Contours.js +61 -42
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/Viewer2D.js +11 -14
- package/lib/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib/component/2d/zones/IndicationLines.js +5 -8
- package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +6 -6
- package/lib/component/assignment/actions/initAssignment.js +17 -17
- package/lib/component/assignment/index.js +2 -2
- package/lib/component/context/PreferencesContext.js +3 -6
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/CheckBoxCell.js +1 -1
- package/lib/component/elements/ContextMenu.js +2 -2
- package/lib/component/elements/EditableColumn.js +3 -5
- package/lib/component/elements/GroupPane.d.ts +12 -0
- package/lib/component/elements/GroupPane.js +14 -0
- package/lib/component/elements/Input.js +7 -4
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/Label.js +1 -2
- package/lib/component/elements/MolecularFormulaInput.js +2 -0
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -1
- package/lib/component/elements/ReactTable/ReactTable.js +72 -38
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +3 -2
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib/component/elements/accordion/Accordion.js +2 -2
- package/lib/component/elements/draggble/useDraggable.js +1 -3
- package/lib/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
- package/lib/component/elements/formik/FormikColorPicker.js +5 -8
- package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib/component/elements/formik/FormikForm.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput.js +12 -20
- package/lib/component/elements/formik/FormikOnChange.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.js +13 -10
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/elements/formik/FormikSlider.d.ts +2 -4
- package/lib/component/elements/formik/FormikSlider.js +8 -11
- package/lib/component/elements/formik/FormikTextarea.js +1 -1
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib/component/elements/popup/Alert/Provider.js +7 -7
- package/lib/component/elements/popup/Alert/index.d.ts +3 -4
- package/lib/component/elements/popup/Alert/index.js +3 -4
- package/lib/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib/component/elements/popup/Modal/Provider.js +16 -31
- package/lib/component/elements/popup/Modal/index.d.ts +4 -5
- package/lib/component/elements/popup/Modal/index.js +4 -5
- package/lib/component/header/Header.js +1 -1
- package/lib/component/hooks/useCombinedRefs.js +2 -2
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +9 -6
- package/lib/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib/component/hooks/usePanelPreferences.js +9 -7
- package/lib/component/loader/DropZone.js +4 -4
- package/lib/component/modal/AlignSpectraModal.js +1 -1
- package/lib/component/modal/ExportAsMatrixModal.js +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +2 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib/component/modal/PredictSpectraModal.js +5 -5
- package/lib/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib/component/modal/setting/GeneralSettings.js +11 -14
- package/lib/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -1
- package/lib/component/modal/setting/WorkspaceItem.js +36 -48
- package/lib/component/modal/setting/settingsValidation.d.ts +58 -57
- package/lib/component/modal/setting/settingsValidation.js +14 -12
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib/component/panels/InformationPanel.js +52 -56
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +5 -5
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +3 -3
- package/lib/component/reducer/Reducer.d.ts +40 -14
- package/lib/component/reducer/Reducer.js +12 -11
- package/lib/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/DomainActions.js +49 -67
- package/lib/component/reducer/actions/FiltersActions.js +3 -3
- package/lib/component/reducer/actions/HistoryActions.js +5 -5
- package/lib/component/reducer/actions/LoadActions.js +12 -0
- package/lib/component/reducer/actions/PreferencesActions.js +18 -37
- package/lib/component/reducer/actions/RangesActions.js +14 -12
- package/lib/component/reducer/actions/SpectrumsActions.js +10 -4
- package/lib/component/reducer/actions/ToolsActions.js +20 -35
- package/lib/component/reducer/actions/ZonesActions.js +2 -2
- package/lib/component/reducer/core/Constants.js +1 -1
- package/lib/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib/component/reducer/helper/getSpectrum.js +3 -5
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +1 -1
- package/lib/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib/component/reducer/preferences/actions/setPreferences.js +5 -6
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -4
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib/component/tool/BrushX.js +3 -3
- package/lib/component/tool/BrushXY.js +5 -5
- package/lib/component/tool/CrossLinePointer.js +3 -3
- package/lib/component/toolbar/BasicToolBar.js +1 -1
- package/lib/component/utility/Evaluate.js +2 -2
- package/lib/component/utility/FileUtility.d.ts +2 -9
- package/lib/component/utility/FileUtility.js +11 -28
- package/lib/component/utility/GroupByInfoKey.d.ts +1 -1
- package/lib/component/utility/GroupByInfoKey.js +11 -13
- package/lib/component/utility/PathBuilder.js +1 -1
- package/lib/component/utility/PreferencesHelper.js +2 -3
- package/lib/component/utility/{Export.d.ts → export.d.ts} +0 -0
- package/lib/component/utility/{Export.js → export.js} +53 -78
- package/lib/component/utility/formatNumber.d.ts +6 -1
- package/lib/component/utility/formatNumber.js +5 -4
- package/lib/data/Filters.d.ts +16 -17
- package/lib/data/Filters.js +16 -17
- package/lib/data/FiltersManager.js +4 -3
- package/lib/data/PredictionManager.js +8 -10
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/SpectraManager.js +25 -60
- package/lib/data/data1d/MultipleAnalysis.js +74 -70
- package/lib/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +24 -25
- package/lib/data/data1d/Spectrum1D/index.js +24 -25
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib/data/data1d/database.js +45 -28
- package/lib/data/data1d/filter1d/apodization.js +2 -1
- package/lib/data/data1d/filter1d/fft.js +24 -7
- package/lib/data/data1d/filter1d/phaseCorrection.js +2 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +7 -18
- package/lib/data/data2d/Spectrum2D/contours.d.ts +40 -0
- package/lib/data/data2d/Spectrum2D/contours.js +132 -0
- package/lib/data/data2d/Spectrum2D/index.d.ts +10 -11
- package/lib/data/data2d/Spectrum2D/index.js +10 -11
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/index.d.ts +12 -13
- package/lib/data/types/data2d/Data2D.d.ts +2 -0
- package/lib/data/types/data2d/Datum2D.d.ts +0 -1
- package/lib/data/types/data2d/index.d.ts +8 -9
- package/lib/data/utilities/RangeUtilities.js +13 -9
- package/lib/data/utilities/ZoneUtilities.js +17 -13
- package/lib/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib/data/utilities/generateChar.js +8 -6
- package/lib/data/utilities/getAtom.js +1 -1
- package/lib/data/utilities/getAtomsFromMF.js +2 -2
- package/lib/data/utilities/getColor.js +3 -3
- package/lib/data/utilities/getSum.js +6 -3
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- package/lib-cjs/component/1d/LinesSeries.js +1 -1
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/XAxis.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib-cjs/component/1d/integral/IntegralIndicator.js +31 -0
- package/lib-cjs/component/1d/integral/IntegralResizable.js +74 -0
- package/lib-cjs/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib-cjs/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib-cjs/component/1d/ranges/Range.js +27 -50
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +2 -2
- package/lib-cjs/component/2d/Contours.js +60 -41
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/Viewer2D.js +11 -14
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +5 -8
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib-cjs/component/NMRium.js +7 -7
- package/lib-cjs/component/assignment/actions/initAssignment.js +17 -17
- package/lib-cjs/component/assignment/index.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +3 -6
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/CheckBoxCell.js +1 -1
- package/lib-cjs/component/elements/ContextMenu.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +3 -5
- package/lib-cjs/component/elements/GroupPane.js +18 -0
- package/lib-cjs/component/elements/Input.js +7 -4
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/Label.js +1 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +2 -0
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +71 -37
- package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib-cjs/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib-cjs/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -2
- package/lib-cjs/component/elements/draggble/useDraggable.js +1 -3
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +4 -7
- package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib-cjs/component/elements/formik/FormikForm.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +12 -20
- package/lib-cjs/component/elements/formik/FormikOnChange.js +13 -10
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSlider.js +7 -10
- package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
- package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +8 -8
- package/lib-cjs/component/elements/popup/Alert/index.js +5 -5
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +16 -31
- package/lib-cjs/component/elements/popup/Modal/index.js +7 -7
- package/lib-cjs/component/header/Header.js +1 -1
- package/lib-cjs/component/hooks/useCombinedRefs.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +14 -11
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +9 -7
- package/lib-cjs/component/loader/DropZone.js +4 -4
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib-cjs/component/modal/PredictSpectraModal.js +5 -5
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib-cjs/component/modal/setting/GeneralSettings.js +11 -14
- package/lib-cjs/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +37 -49
- package/lib-cjs/component/modal/setting/settingsValidation.js +14 -12
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib-cjs/component/panels/InformationPanel.js +51 -55
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +3 -3
- package/lib-cjs/component/reducer/Reducer.js +11 -10
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +49 -67
- package/lib-cjs/component/reducer/actions/FiltersActions.js +3 -3
- package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
- package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +18 -37
- package/lib-cjs/component/reducer/actions/RangesActions.js +14 -12
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +9 -3
- package/lib-cjs/component/reducer/actions/ToolsActions.js +20 -35
- package/lib-cjs/component/reducer/actions/ZonesActions.js +2 -2
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -5
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +5 -9
- package/lib-cjs/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib-cjs/component/tool/BrushX.js +3 -3
- package/lib-cjs/component/tool/BrushXY.js +5 -5
- package/lib-cjs/component/tool/CrossLinePointer.js +3 -3
- package/lib-cjs/component/toolbar/BasicToolBar.js +1 -1
- package/lib-cjs/component/utility/Evaluate.js +2 -2
- package/lib-cjs/component/utility/FileUtility.js +11 -29
- package/lib-cjs/component/utility/GroupByInfoKey.js +11 -13
- package/lib-cjs/component/utility/PathBuilder.js +1 -1
- package/lib-cjs/component/utility/PreferencesHelper.js +2 -3
- package/lib-cjs/component/utility/{Export.js → export.js} +77 -79
- package/lib-cjs/component/utility/formatNumber.js +5 -4
- package/lib-cjs/data/Filters.js +17 -33
- package/lib-cjs/data/FiltersManager.js +4 -3
- package/lib-cjs/data/PredictionManager.js +8 -10
- package/lib-cjs/data/SpectraManager.js +26 -62
- package/lib-cjs/data/data1d/MultipleAnalysis.js +74 -70
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/index.js +25 -25
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib-cjs/data/data1d/database.js +45 -28
- package/lib-cjs/data/data1d/filter1d/apodization.js +2 -1
- package/lib-cjs/data/data1d/filter1d/fft.js +23 -6
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +2 -2
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Processing2D.js +7 -18
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +138 -0
- package/lib-cjs/data/data2d/Spectrum2D/index.js +11 -11
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/RangeUtilities.js +13 -9
- package/lib-cjs/data/utilities/ZoneUtilities.js +17 -13
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib-cjs/data/utilities/generateChar.js +8 -6
- package/lib-cjs/data/utilities/getAtom.js +1 -1
- package/lib-cjs/data/utilities/getAtomsFromMF.js +2 -2
- package/lib-cjs/data/utilities/getColor.js +3 -3
- package/lib-cjs/data/utilities/getSum.js +6 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +30 -26
- package/lib/component/1d/IntegralResizable.js +0 -72
- package/lib/component/elements/popup/helpers.d.ts +0 -1
- package/lib/component/elements/popup/helpers.js +0 -9
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.js +0 -8
- package/lib/data/data1d/Data1DManager.d.ts +0 -3
- package/lib/data/data1d/Data1DManager.js +0 -98
- package/lib/data/data2d/Data2DManager.d.ts +0 -3
- package/lib/data/data2d/Data2DManager.js +0 -34
- package/lib/data/types/data2d/Contour.d.ts +0 -4
- package/lib/data/types/data2d/Contour.js +0 -1
- package/lib/data/types/data2d/Contours.d.ts +0 -2
- package/lib/data/types/data2d/Contours.js +0 -1
- package/lib-cjs/component/1d/IntegralResizable.js +0 -77
- package/lib-cjs/component/elements/popup/helpers.js +0 -13
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +0 -14
- package/lib-cjs/data/data1d/Data1DManager.js +0 -104
- package/lib-cjs/data/data2d/Data2DManager.js +0 -40
- package/lib-cjs/data/types/data2d/Contour.js +0 -2
- package/lib-cjs/data/types/data2d/Contours.js +0 -2
|
@@ -35,7 +35,9 @@ const databaseTableColumns = (databasePreferences) => [
|
|
|
35
35
|
Header: 'From - To',
|
|
36
36
|
accessor: (row) => {
|
|
37
37
|
const rangeFormat = databasePreferences.range.format;
|
|
38
|
-
return
|
|
38
|
+
return row?.from && row?.to
|
|
39
|
+
? `${formatNumber(row.from, rangeFormat)} - ${formatNumber(row.to, rangeFormat)}`
|
|
40
|
+
: '';
|
|
39
41
|
},
|
|
40
42
|
enableRowSpan: true,
|
|
41
43
|
},
|
|
@@ -43,7 +45,18 @@ const databaseTableColumns = (databasePreferences) => [
|
|
|
43
45
|
showWhen: 'delta.show',
|
|
44
46
|
index: 3,
|
|
45
47
|
Header: 'δ (ppm)',
|
|
46
|
-
|
|
48
|
+
style: overFlowStyle,
|
|
49
|
+
accessor: (row) => {
|
|
50
|
+
if (typeof row.delta === 'string' && !row?.delta) {
|
|
51
|
+
return row.delta
|
|
52
|
+
.split(',')
|
|
53
|
+
.map((value) => formatNumber(value, databasePreferences.delta.format))
|
|
54
|
+
.join(',');
|
|
55
|
+
}
|
|
56
|
+
return row?.delta
|
|
57
|
+
? formatNumber(row.delta, databasePreferences.delta.format)
|
|
58
|
+
: '';
|
|
59
|
+
},
|
|
47
60
|
},
|
|
48
61
|
{
|
|
49
62
|
showWhen: 'showAssignment',
|
|
@@ -61,7 +74,9 @@ const databaseTableColumns = (databasePreferences) => [
|
|
|
61
74
|
showWhen: 'coupling.show',
|
|
62
75
|
index: 6,
|
|
63
76
|
Header: 'J (Hz)',
|
|
64
|
-
accessor: (row) =>
|
|
77
|
+
accessor: (row) => row?.coupling
|
|
78
|
+
? formatNumber(row.coupling, databasePreferences.coupling.format)
|
|
79
|
+
: '',
|
|
65
80
|
style: {
|
|
66
81
|
width: '60px',
|
|
67
82
|
minWidth: '60px',
|
|
@@ -103,7 +118,7 @@ const databaseTableColumns = (databasePreferences) => [
|
|
|
103
118
|
},
|
|
104
119
|
},
|
|
105
120
|
];
|
|
106
|
-
function DatabaseTable({ data, onAdd }) {
|
|
121
|
+
function DatabaseTable({ data, onAdd, totalCount }) {
|
|
107
122
|
const databasePreferences = usePanelPreferences('database');
|
|
108
123
|
const initialColumns = useMemo(() => [
|
|
109
124
|
{
|
|
@@ -128,6 +143,6 @@ function DatabaseTable({ data, onAdd }) {
|
|
|
128
143
|
}
|
|
129
144
|
return columns.sort((object1, object2) => object1.index - object2.index);
|
|
130
145
|
}, [databasePreferences, initialColumns]);
|
|
131
|
-
return (_jsx(ReactTable, { data: data, columns: tableColumns, highlightedSource: HighlightEventSource.DATABASE, groupKey: "index", approxItemHeight:
|
|
146
|
+
return (_jsx(ReactTable, { data: data, columns: tableColumns, highlightedSource: HighlightEventSource.DATABASE, groupKey: "index", approxItemHeight: 23.5, enableVirtualScroll: true, totalCount: totalCount }));
|
|
132
147
|
}
|
|
133
148
|
export default memo(DatabaseTable);
|
|
@@ -29,10 +29,13 @@ export default class ColumnsHelper {
|
|
|
29
29
|
: this.defaultPreference[formatKey];
|
|
30
30
|
const { formatPrefix = '', formatSuffix = '', showPrefixSuffixCallback = () => true, } = options;
|
|
31
31
|
if (showPrefixSuffixCallback(row)) {
|
|
32
|
-
return formatNumber(row.original[columnKey], format,
|
|
32
|
+
return formatNumber(row.original[columnKey], format, {
|
|
33
|
+
prefix: formatPrefix,
|
|
34
|
+
suffix: formatSuffix,
|
|
35
|
+
});
|
|
33
36
|
}
|
|
34
37
|
else {
|
|
35
|
-
return formatNumber(row.original[columnKey], format
|
|
38
|
+
return formatNumber(row.original[columnKey], format);
|
|
36
39
|
}
|
|
37
40
|
});
|
|
38
41
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare function getMultiplicityNumber(string: any): number | null;
|
|
2
2
|
declare function checkMultiplet(multiplet: any, rejected?: Array<any>): boolean | undefined;
|
|
3
|
-
declare function checkMultiplicity(multiplicity: any, rejected?: Array<string>):
|
|
3
|
+
declare function checkMultiplicity(multiplicity: any, rejected?: Array<string>): any;
|
|
4
4
|
declare function translateMultiplet(multiplet: any): string | undefined;
|
|
5
|
-
declare function hasCouplingConstant(multiplet: any):
|
|
5
|
+
declare function hasCouplingConstant(multiplet: any): any;
|
|
6
6
|
declare function getPascal(n: any, spin: any): any[];
|
|
7
7
|
export { checkMultiplet, checkMultiplicity, getMultiplicityNumber, getPascal, hasCouplingConstant, translateMultiplet, };
|
|
@@ -18,9 +18,9 @@ function checkMultiplicity(multiplicity, rejected = []) {
|
|
|
18
18
|
if (multiplicity === undefined || multiplicity.length === 0) {
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
|
-
return
|
|
21
|
+
return multiplicity
|
|
22
22
|
.split('')
|
|
23
|
-
.
|
|
23
|
+
.every((_multiplet) => checkMultiplet(_multiplet, rejected));
|
|
24
24
|
}
|
|
25
25
|
function translateMultiplet(multiplet) {
|
|
26
26
|
return multiplet.length === 1
|
|
@@ -90,7 +90,7 @@ function FiltersTableInner({ filters, spectraCounter, selectedTool, activeFilter
|
|
|
90
90
|
}, [activeFilterID, selectedTool]);
|
|
91
91
|
const filtersTableRow = useMemo(() => {
|
|
92
92
|
return filters?.map((d, index) => {
|
|
93
|
-
return (_jsxs(TableRow, { className: getStyle(d, index), children: [_jsx(TableCell, { align: "center", size: 2, onClick: () => filterSnapShotHandler(d.id), children: d.label }), _jsx(TableCell, { align: "left", size: 3, children: _jsx("div", { onClick: (e) => e.stopPropagation(), children: _jsx(ObjectInspector, { data: d.error
|
|
93
|
+
return (_jsxs(TableRow, { className: getStyle(d, index), children: [_jsx(TableCell, { align: "center", size: 2, onClick: () => filterSnapShotHandler(d.id), children: d.label }), _jsx(TableCell, { align: "left", size: 3, children: _jsx("div", { onClick: (e) => e.stopPropagation(), children: _jsx(ObjectInspector, { data: d.error || d.value }) }) }), _jsxs(TableCell, { align: "center", vAlign: "center", size: 1, children: [_jsx(CheckBox, { checked: d.flag, onChange: (event) => handelFilterCheck(d.id, event.target.checked) }), d.isDeleteAllow && (_jsx("button", { className: "btn", type: "button", onClick: () => handelDeleteFilter(d), children: _jsx(FaRegTrashAlt, {}) }))] })] }, d.id));
|
|
94
94
|
});
|
|
95
95
|
}, [
|
|
96
96
|
filterSnapShotHandler,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as types from './types/Types';
|
|
2
|
-
const ignoreActions = [
|
|
2
|
+
const ignoreActions = new Set([
|
|
3
3
|
types.APPLY_KEY_PREFERENCES,
|
|
4
4
|
types.BRUSH_END,
|
|
5
5
|
types.RESET_DOMAIN,
|
|
@@ -34,9 +34,9 @@ const ignoreActions = [
|
|
|
34
34
|
types.SHOW_MULTIPLICTY_TREES,
|
|
35
35
|
types.SHOW_RANGES_INTEGRALS,
|
|
36
36
|
types.CHANGE_FLOAT_MOLECULE_POSITION,
|
|
37
|
-
];
|
|
37
|
+
]);
|
|
38
38
|
function checkActionType(type) {
|
|
39
|
-
if (!ignoreActions.
|
|
39
|
+
if (!ignoreActions.has(type))
|
|
40
40
|
return true;
|
|
41
41
|
return false;
|
|
42
42
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CorrelationData } from 'nmr-correlation';
|
|
2
2
|
import { SpectraAnalysis } from '../../data/data1d/MultipleAnalysis';
|
|
3
3
|
import { ApodizationOptions } from '../../data/data1d/filter1d/apodization';
|
|
4
|
+
import { ContoursLevels } from '../../data/data2d/Spectrum2D/contours';
|
|
4
5
|
import { FloatingMolecules, StateMoleculeExtended } from '../../data/molecules/Molecule';
|
|
5
|
-
import { Contours } from '../../data/types/data2d/Contours';
|
|
6
6
|
import { UsedColors } from '../../types/UsedColors';
|
|
7
7
|
import { Spectra } from '../NMRium';
|
|
8
8
|
import { DISPLAYER_MODE } from './core/Constants';
|
|
@@ -68,6 +68,9 @@ export interface ViewState {
|
|
|
68
68
|
*/
|
|
69
69
|
activeTab: string;
|
|
70
70
|
};
|
|
71
|
+
zoom: {
|
|
72
|
+
levels: ContoursLevels;
|
|
73
|
+
};
|
|
71
74
|
}
|
|
72
75
|
export declare const rangeStateInit: {
|
|
73
76
|
showMultiplicityTrees: boolean;
|
|
@@ -102,10 +105,6 @@ export interface State {
|
|
|
102
105
|
* spectra list (1d and 2d)
|
|
103
106
|
*/
|
|
104
107
|
data: Spectra;
|
|
105
|
-
/**
|
|
106
|
-
* calculated contours for 2d spectra
|
|
107
|
-
*/
|
|
108
|
-
contours: Contours;
|
|
109
108
|
/**
|
|
110
109
|
* snapshot of the spectra data once phase correction activated
|
|
111
110
|
*
|
|
@@ -306,9 +305,20 @@ export declare const spectrumReducer: (base: {
|
|
|
306
305
|
readonly data: readonly ({
|
|
307
306
|
readonly id: string;
|
|
308
307
|
readonly source: {
|
|
308
|
+
readonly jcamp: string;
|
|
309
309
|
readonly jcampURL: string;
|
|
310
310
|
readonly jcampSpectrumIndex: number;
|
|
311
|
-
readonly file:
|
|
311
|
+
readonly file: {
|
|
312
|
+
readonly lastModified: number;
|
|
313
|
+
readonly name: string;
|
|
314
|
+
readonly webkitRelativePath: string;
|
|
315
|
+
readonly size: number;
|
|
316
|
+
readonly type: string;
|
|
317
|
+
readonly arrayBuffer: () => Promise<ArrayBuffer>;
|
|
318
|
+
readonly slice: (start?: number | undefined, end?: number | undefined, contentType?: string | undefined) => Blob;
|
|
319
|
+
readonly stream: () => ReadableStream<Uint8Array>;
|
|
320
|
+
readonly text: () => Promise<string>;
|
|
321
|
+
};
|
|
312
322
|
};
|
|
313
323
|
readonly display: {
|
|
314
324
|
readonly name: string;
|
|
@@ -784,9 +794,20 @@ export declare const spectrumReducer: (base: {
|
|
|
784
794
|
} | {
|
|
785
795
|
readonly id: string;
|
|
786
796
|
readonly source: {
|
|
797
|
+
readonly jcamp: string;
|
|
787
798
|
readonly jcampURL: string;
|
|
788
799
|
readonly jcampSpectrumIndex: number;
|
|
789
|
-
readonly file:
|
|
800
|
+
readonly file: {
|
|
801
|
+
readonly lastModified: number;
|
|
802
|
+
readonly name: string;
|
|
803
|
+
readonly webkitRelativePath: string;
|
|
804
|
+
readonly size: number;
|
|
805
|
+
readonly type: string;
|
|
806
|
+
readonly arrayBuffer: () => Promise<ArrayBuffer>;
|
|
807
|
+
readonly slice: (start?: number | undefined, end?: number | undefined, contentType?: string | undefined) => Blob;
|
|
808
|
+
readonly stream: () => ReadableStream<Uint8Array>;
|
|
809
|
+
readonly text: () => Promise<string>;
|
|
810
|
+
};
|
|
790
811
|
};
|
|
791
812
|
readonly display: {
|
|
792
813
|
readonly name: string;
|
|
@@ -827,15 +848,19 @@ export declare const spectrumReducer: (base: {
|
|
|
827
848
|
readonly z: readonly (readonly number[])[];
|
|
828
849
|
readonly minX: number;
|
|
829
850
|
readonly minY: number;
|
|
851
|
+
readonly minZ: number;
|
|
830
852
|
readonly maxX: number;
|
|
831
853
|
readonly maxY: number;
|
|
854
|
+
readonly maxZ: number;
|
|
832
855
|
};
|
|
833
856
|
readonly originalData?: {
|
|
834
857
|
readonly z: readonly (readonly number[])[];
|
|
835
858
|
readonly minX: number;
|
|
836
859
|
readonly minY: number;
|
|
860
|
+
readonly minZ: number;
|
|
837
861
|
readonly maxX: number;
|
|
838
862
|
readonly maxY: number;
|
|
863
|
+
readonly maxZ: number;
|
|
839
864
|
} | undefined;
|
|
840
865
|
readonly zones: {
|
|
841
866
|
readonly values: readonly {
|
|
@@ -902,14 +927,7 @@ export declare const spectrumReducer: (base: {
|
|
|
902
927
|
readonly flag: boolean;
|
|
903
928
|
readonly value: any;
|
|
904
929
|
}[];
|
|
905
|
-
readonly processingController: any;
|
|
906
930
|
})[];
|
|
907
|
-
readonly contours: {
|
|
908
|
-
readonly [x: string]: {
|
|
909
|
-
readonly negative: readonly (readonly number[])[];
|
|
910
|
-
readonly positive: readonly (readonly number[])[];
|
|
911
|
-
};
|
|
912
|
-
};
|
|
913
931
|
readonly tempData: any;
|
|
914
932
|
readonly xDomain: readonly number[];
|
|
915
933
|
readonly yDomain: readonly number[];
|
|
@@ -984,6 +1002,14 @@ export declare const spectrumReducer: (base: {
|
|
|
984
1002
|
};
|
|
985
1003
|
readonly activeTab: string;
|
|
986
1004
|
};
|
|
1005
|
+
readonly zoom: {
|
|
1006
|
+
readonly levels: {
|
|
1007
|
+
readonly [x: string]: {
|
|
1008
|
+
readonly positive: number;
|
|
1009
|
+
readonly negative: number;
|
|
1010
|
+
};
|
|
1011
|
+
};
|
|
1012
|
+
};
|
|
987
1013
|
};
|
|
988
1014
|
readonly verticalAlign: {
|
|
989
1015
|
readonly align: VerticalAlignment;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { v4 } from '@lukeed/uuid';
|
|
2
2
|
import { produce } from 'immer';
|
|
3
3
|
import { buildCorrelationData } from 'nmr-correlation';
|
|
4
|
-
import { read as readDropFiles,
|
|
4
|
+
import { read as readDropFiles, readNMRiumObject } from 'nmr-load-save';
|
|
5
5
|
import { predictSpectra } from '../../data/PredictionManager';
|
|
6
|
-
import * as SpectraManager from '../../data/SpectraManager';
|
|
7
6
|
import { useChartData } from '../context/ChartContext';
|
|
8
7
|
import { DefaultTolerance } from '../panels/SummaryPanel/CorrelationTable/Constants';
|
|
9
8
|
import { options } from '../toolbar/ToolTypes';
|
|
@@ -41,7 +40,6 @@ export const zoneStateInit = {
|
|
|
41
40
|
export const getInitialState = () => ({
|
|
42
41
|
actionType: '',
|
|
43
42
|
data: [],
|
|
44
|
-
contours: {},
|
|
45
43
|
tempData: null,
|
|
46
44
|
xDomain: [],
|
|
47
45
|
yDomain: [],
|
|
@@ -60,7 +58,7 @@ export const getInitialState = () => ({
|
|
|
60
58
|
margin: {
|
|
61
59
|
top: 10,
|
|
62
60
|
right: 20,
|
|
63
|
-
bottom:
|
|
61
|
+
bottom: 50,
|
|
64
62
|
left: 0,
|
|
65
63
|
},
|
|
66
64
|
mode: 'RTL',
|
|
@@ -70,6 +68,9 @@ export const getInitialState = () => ({
|
|
|
70
68
|
ranges: [],
|
|
71
69
|
zones: [],
|
|
72
70
|
spectra: { activeSpectra: {}, activeTab: '' },
|
|
71
|
+
zoom: {
|
|
72
|
+
levels: {},
|
|
73
|
+
},
|
|
73
74
|
},
|
|
74
75
|
verticalAlign: {
|
|
75
76
|
align: 'bottom',
|
|
@@ -131,14 +132,14 @@ export function initState(state) {
|
|
|
131
132
|
};
|
|
132
133
|
}
|
|
133
134
|
export function dispatchMiddleware(dispatch) {
|
|
134
|
-
|
|
135
|
+
let usedColors = { '1d': [], '2d': [] };
|
|
135
136
|
return (action) => {
|
|
136
137
|
switch (action.type) {
|
|
137
138
|
case types.INITIATE: {
|
|
138
139
|
if (action.payload) {
|
|
139
|
-
|
|
140
|
-
void
|
|
141
|
-
action.payload = {
|
|
140
|
+
usedColors = { '1d': [], '2d': [] };
|
|
141
|
+
void readNMRiumObject(action.payload).then((data) => {
|
|
142
|
+
action.payload = { ...data, usedColors };
|
|
142
143
|
dispatch(action);
|
|
143
144
|
});
|
|
144
145
|
}
|
|
@@ -147,14 +148,14 @@ export function dispatchMiddleware(dispatch) {
|
|
|
147
148
|
case types.LOAD_DROP_FILES: {
|
|
148
149
|
const { fileCollection } = action;
|
|
149
150
|
action.usedColors = usedColors;
|
|
150
|
-
readDropFiles(fileCollection
|
|
151
|
+
readDropFiles(fileCollection)
|
|
151
152
|
.then((data) => {
|
|
152
153
|
action.data = data;
|
|
153
154
|
dispatch(action);
|
|
154
155
|
})
|
|
155
|
-
.catch((
|
|
156
|
+
.catch((error) => {
|
|
156
157
|
dispatch({ type: types.SET_LOADING_FLAG, isLoading: false });
|
|
157
|
-
reportError(
|
|
158
|
+
reportError(error);
|
|
158
159
|
});
|
|
159
160
|
break;
|
|
160
161
|
}
|
|
@@ -51,9 +51,9 @@ function handleSetCorrelations(draft, payload) {
|
|
|
51
51
|
const { correlations, options } = payload;
|
|
52
52
|
const state = original(draft);
|
|
53
53
|
let correlationsData = lodashCloneDeep(state.correlations);
|
|
54
|
-
|
|
54
|
+
for (const correlation of correlations) {
|
|
55
55
|
correlationsData = setCorrelation(correlationsData, correlation.id, correlation);
|
|
56
|
-
}
|
|
56
|
+
}
|
|
57
57
|
draft.correlations = correlationsData;
|
|
58
58
|
if (options) {
|
|
59
59
|
draft.correlations = {
|
|
@@ -66,7 +66,7 @@ function handleSetCorrelations(draft, payload) {
|
|
|
66
66
|
function handleDeleteCorrelation(draft, payload) {
|
|
67
67
|
const { correlation, assignmentData } = payload;
|
|
68
68
|
// delete all signals linked to the correlation
|
|
69
|
-
correlation.
|
|
69
|
+
for (const link of correlation.links) {
|
|
70
70
|
const spectrum = findSpectrum(draft.data, link.experimentID, false);
|
|
71
71
|
if (spectrum) {
|
|
72
72
|
if (spectrum.info.dimension === 1) {
|
|
@@ -94,6 +94,6 @@ function handleDeleteCorrelation(draft, payload) {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
}
|
|
97
|
+
}
|
|
98
98
|
}
|
|
99
99
|
export { handleDeleteCorrelation, handleSetCorrelation, handleSetCorrelations, handleSetMF, handleSetTolerance, handleUpdateCorrelations, };
|
|
@@ -4,8 +4,8 @@ import { State } from '../Reducer';
|
|
|
4
4
|
declare function getDomain(draft: Draft<State>): {
|
|
5
5
|
xDomain: [number, number] | [undefined, undefined];
|
|
6
6
|
yDomain: [number, number] | [undefined, undefined];
|
|
7
|
-
yDomains:
|
|
8
|
-
xDomains:
|
|
7
|
+
yDomains: Record<string, number[]>;
|
|
8
|
+
xDomains: Record<string, number[]>;
|
|
9
9
|
};
|
|
10
10
|
export interface SetDomainOptions {
|
|
11
11
|
yDomain?: {
|
|
@@ -24,33 +24,26 @@ function getActiveData(draft) {
|
|
|
24
24
|
function getDomain(draft) {
|
|
25
25
|
let xArray = [];
|
|
26
26
|
let yArray = [];
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const yDomains = {};
|
|
28
|
+
const xDomains = {};
|
|
29
29
|
const data = getActiveData(draft);
|
|
30
30
|
try {
|
|
31
|
-
|
|
32
|
-
const { display, data } = d;
|
|
31
|
+
for (const d of data) {
|
|
32
|
+
const { display, data, id } = d;
|
|
33
|
+
const { y } = get1DDataXY(d);
|
|
34
|
+
const _extent = extent(y);
|
|
33
35
|
const domain = [data.x[0], data.x[data.x.length - 1]];
|
|
34
|
-
|
|
36
|
+
yDomains[id] = _extent;
|
|
37
|
+
xDomains[id] = domain;
|
|
35
38
|
if (display.isVisible) {
|
|
36
|
-
|
|
39
|
+
xArray = xArray.concat(domain);
|
|
40
|
+
yArray = yArray.concat(_extent);
|
|
37
41
|
}
|
|
38
|
-
|
|
39
|
-
}, []);
|
|
40
|
-
yArray = data.reduce((acc, d) => {
|
|
41
|
-
const { display } = d;
|
|
42
|
-
const data = get1DDataXY(d);
|
|
43
|
-
const _extent = extent(data.y);
|
|
44
|
-
yDomains[d.id] = _extent;
|
|
45
|
-
if (display.isVisible) {
|
|
46
|
-
acc = acc.concat(_extent);
|
|
47
|
-
}
|
|
48
|
-
return acc;
|
|
49
|
-
}, []);
|
|
42
|
+
}
|
|
50
43
|
}
|
|
51
|
-
catch (
|
|
52
|
-
//
|
|
53
|
-
|
|
44
|
+
catch (error) {
|
|
45
|
+
// TODO: handle error.
|
|
46
|
+
reportError(error);
|
|
54
47
|
}
|
|
55
48
|
return {
|
|
56
49
|
xDomain: extent(xArray),
|
|
@@ -62,54 +55,44 @@ function getDomain(draft) {
|
|
|
62
55
|
function get2DDomain(state) {
|
|
63
56
|
let xArray = [];
|
|
64
57
|
let yArray = [];
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
const yDomains = {};
|
|
59
|
+
const xDomains = {};
|
|
67
60
|
const { view: { spectra: { activeSpectra, activeTab }, }, data, } = state;
|
|
68
61
|
const nucleus = activeTab.split(',');
|
|
69
62
|
try {
|
|
70
|
-
xArray = data.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
datum.info.nucleus?.join(',') === activeTab &&
|
|
81
|
-
datum.info.isFt) {
|
|
82
|
-
acc = acc.concat([datum.data.minY, datum.data.maxY]);
|
|
83
|
-
}
|
|
84
|
-
return acc;
|
|
85
|
-
}, []);
|
|
63
|
+
xArray = data.filter((datum) => isSpectrum2D(datum) &&
|
|
64
|
+
datum.info.nucleus?.join(',') === activeTab &&
|
|
65
|
+
datum.info.isFt).flatMap((datum) => {
|
|
66
|
+
return [datum.data.minX, datum.data.maxX];
|
|
67
|
+
});
|
|
68
|
+
yArray = data.filter((d) => isSpectrum2D(d) &&
|
|
69
|
+
d.info.nucleus?.join(',') === activeTab &&
|
|
70
|
+
d.info.isFt).flatMap((datum) => {
|
|
71
|
+
return [datum.data.minY, datum.data.maxY];
|
|
72
|
+
});
|
|
86
73
|
}
|
|
87
|
-
catch (
|
|
88
|
-
//
|
|
89
|
-
|
|
74
|
+
catch (error) {
|
|
75
|
+
// TODO: handle error
|
|
76
|
+
reportError(error);
|
|
90
77
|
}
|
|
91
|
-
const spectrumsIDs = nucleus.map((n) => activeSpectra[n]?.id);
|
|
92
|
-
const filteredData = data
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
78
|
+
const spectrumsIDs = new Set(nucleus.map((n) => activeSpectra[n]?.id));
|
|
79
|
+
const filteredData = data
|
|
80
|
+
.filter((d) => spectrumsIDs.has(d.id) && d.info.dimension === 1)
|
|
81
|
+
.map((datum) => {
|
|
82
|
+
return datum;
|
|
83
|
+
});
|
|
97
84
|
try {
|
|
98
|
-
|
|
99
|
-
const { x } = d.data;
|
|
85
|
+
for (const d of filteredData) {
|
|
86
|
+
const { x, re } = d.data;
|
|
100
87
|
const domain = [x[0], x[x.length - 1]];
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const _extent = extent(d.data.re);
|
|
106
|
-
acc[d.id] = _extent;
|
|
107
|
-
return acc;
|
|
108
|
-
}, {});
|
|
88
|
+
xDomains[d.id] = domain;
|
|
89
|
+
const _extent = extent(re);
|
|
90
|
+
yDomains[d.id] = _extent;
|
|
91
|
+
}
|
|
109
92
|
}
|
|
110
|
-
catch (
|
|
111
|
-
//
|
|
112
|
-
|
|
93
|
+
catch (error) {
|
|
94
|
+
// TODO: handle error.
|
|
95
|
+
reportError(error);
|
|
113
96
|
}
|
|
114
97
|
return {
|
|
115
98
|
xDomain: extent(xArray),
|
|
@@ -134,10 +117,9 @@ function setDomain(draft, options) {
|
|
|
134
117
|
if (yDomain.isChanged) {
|
|
135
118
|
draft.yDomain = domain.yDomain;
|
|
136
119
|
if (draft.displayerMode === DISPLAYER_MODE.DM_1D && yDomain.isShared) {
|
|
137
|
-
draft.yDomains = Object.keys(domain.yDomains).
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}, {});
|
|
120
|
+
draft.yDomains = Object.fromEntries(Object.keys(domain.yDomains).map((key) => {
|
|
121
|
+
return [key, domain.yDomain];
|
|
122
|
+
}));
|
|
141
123
|
}
|
|
142
124
|
else {
|
|
143
125
|
draft.yDomains = domain.yDomains;
|
|
@@ -188,8 +170,8 @@ function handelResetDomain(draft) {
|
|
|
188
170
|
draft.yDomains = yDomains;
|
|
189
171
|
}
|
|
190
172
|
function setMode(draft) {
|
|
191
|
-
const
|
|
173
|
+
const datum_ = draft.data.find((datum) => draft.xDomains[datum.id] &&
|
|
192
174
|
nucleusToString(datum.info.nucleus) === draft.view.spectra.activeTab);
|
|
193
|
-
draft.mode =
|
|
175
|
+
draft.mode = datum_?.info.isFid ? 'LTR' : 'RTL';
|
|
194
176
|
}
|
|
195
177
|
export { getDomain, setOriginalDomain, setXDomain, setYDomain, handelResetDomain, setDomain, setMode, setIntegralsYDomain, };
|
|
@@ -214,7 +214,7 @@ function deleteSpectraFilter(draft, actions) {
|
|
|
214
214
|
for (const datum of draft.data) {
|
|
215
215
|
if (nucleusToString(datum?.info?.nucleus) === draft.view.spectra.activeTab) {
|
|
216
216
|
const filtersResult = datum.filters?.filter((filter) => filter.name === filterType) || [];
|
|
217
|
-
|
|
217
|
+
for (const filter of filtersResult) {
|
|
218
218
|
FiltersManager.deleteFilter(datum, filter.id);
|
|
219
219
|
if (datum.info?.dimension === 1) {
|
|
220
220
|
updateXShift(datum);
|
|
@@ -222,7 +222,7 @@ function deleteSpectraFilter(draft, actions) {
|
|
|
222
222
|
else if (datum.info?.dimension === 2) {
|
|
223
223
|
update2dShift(datum);
|
|
224
224
|
}
|
|
225
|
-
}
|
|
225
|
+
}
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
resetSelectedTool(draft);
|
|
@@ -270,7 +270,7 @@ function resetSpectrumByFilter(draft, options) {
|
|
|
270
270
|
let filters = [];
|
|
271
271
|
if (filterIndex !== -1) {
|
|
272
272
|
filters = datum.filters.slice(0, rollback ? filterIndex : filterIndex + 1);
|
|
273
|
-
if (filters.length
|
|
273
|
+
if (filters.length > 0) {
|
|
274
274
|
draft.toolOptions.data.activeFilterID =
|
|
275
275
|
datum.filters[rollback ? filterIndex - 1 : filterIndex]?.id;
|
|
276
276
|
}
|
|
@@ -2,10 +2,10 @@ import { setDomain, getDomain } from './DomainActions';
|
|
|
2
2
|
function handleHistoryUndo(draft) {
|
|
3
3
|
const { past, present, future } = draft.history;
|
|
4
4
|
const previous = past[past.length - 1];
|
|
5
|
-
const newPast = past.slice(0,
|
|
5
|
+
const newPast = past.slice(0, -1);
|
|
6
6
|
const newfuture = [present, ...future];
|
|
7
|
-
const hasRedo = newfuture.length
|
|
8
|
-
const hasUndo = past.length
|
|
7
|
+
const hasRedo = newfuture.length > 0;
|
|
8
|
+
const hasUndo = past.length > 0;
|
|
9
9
|
const domain = getDomain(draft.data);
|
|
10
10
|
const history = {
|
|
11
11
|
past: newPast,
|
|
@@ -20,13 +20,13 @@ function handleHistoryUndo(draft) {
|
|
|
20
20
|
draft.history = history;
|
|
21
21
|
}
|
|
22
22
|
function handleHistoryRedo(draft) {
|
|
23
|
-
const { history } = draft;
|
|
23
|
+
const { history, data } = draft;
|
|
24
24
|
const newPresent = history.future.shift();
|
|
25
25
|
history.past.push(history.present);
|
|
26
26
|
history.present = newPresent;
|
|
27
27
|
history.hasUndo = true;
|
|
28
28
|
history.hasRedo = history.future.length > 0;
|
|
29
|
-
setDomain(
|
|
29
|
+
setDomain(data);
|
|
30
30
|
}
|
|
31
31
|
function handleHistoryReset(draft, action) {
|
|
32
32
|
draft.history = {
|
|
@@ -72,6 +72,18 @@ function setPreferences(draft, data) {
|
|
|
72
72
|
}
|
|
73
73
|
function initiate(draft, action) {
|
|
74
74
|
const state = getInitialState();
|
|
75
|
+
const { spectra, usedColors } = action.payload;
|
|
76
|
+
const newSpectra = [];
|
|
77
|
+
for (let spectrum of spectra) {
|
|
78
|
+
const { info } = spectrum;
|
|
79
|
+
if (info.dimension === 1) {
|
|
80
|
+
newSpectra.push(initiateDatum1D(spectrum, usedColors));
|
|
81
|
+
}
|
|
82
|
+
else if (info.dimension === 2) {
|
|
83
|
+
newSpectra.push(initiateDatum2D(spectrum, usedColors));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
action.payload.spectra = newSpectra;
|
|
75
87
|
setData(state, action.payload);
|
|
76
88
|
const preferences = action.payload?.preferences || {};
|
|
77
89
|
setActiveTab(state, { tab: preferences?.activeTab || '' });
|