nmrium 0.32.0 → 0.33.0-pre.1667755480
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/Chart1D.js +1 -1
- package/lib/component/1d/LinesSeries.js +1 -1
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/XAxis.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib/component/1d/{Integral.d.ts → integral/Integral.d.ts} +0 -0
- package/lib/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib/component/1d/integral/IntegralIndicator.d.ts +9 -0
- package/lib/component/1d/integral/IntegralIndicator.js +27 -0
- package/lib/component/1d/{IntegralResizable.d.ts → integral/IntegralResizable.d.ts} +0 -0
- package/lib/component/1d/integral/IntegralResizable.js +69 -0
- package/lib/component/1d/{IntegralsSeries.d.ts → integral/IntegralsSeries.d.ts} +0 -0
- package/lib/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib/component/1d/ranges/Range.js +27 -50
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +2 -2
- package/lib/component/2d/Contours.js +61 -42
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/Viewer2D.js +11 -14
- package/lib/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib/component/2d/zones/IndicationLines.js +5 -8
- package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +6 -6
- package/lib/component/assignment/actions/initAssignment.js +17 -17
- package/lib/component/assignment/index.js +2 -2
- package/lib/component/context/PreferencesContext.js +3 -6
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/CheckBoxCell.js +1 -1
- package/lib/component/elements/ContextMenu.js +2 -2
- package/lib/component/elements/EditableColumn.js +3 -5
- package/lib/component/elements/GroupPane.d.ts +12 -0
- package/lib/component/elements/GroupPane.js +14 -0
- package/lib/component/elements/Input.js +7 -4
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/Label.js +1 -2
- package/lib/component/elements/MolecularFormulaInput.js +2 -0
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -1
- package/lib/component/elements/ReactTable/ReactTable.js +72 -38
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +3 -2
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib/component/elements/accordion/Accordion.js +2 -2
- package/lib/component/elements/draggble/useDraggable.js +1 -3
- package/lib/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
- package/lib/component/elements/formik/FormikColorPicker.js +5 -8
- package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib/component/elements/formik/FormikForm.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput.js +12 -20
- package/lib/component/elements/formik/FormikOnChange.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.js +13 -10
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/elements/formik/FormikSlider.d.ts +2 -4
- package/lib/component/elements/formik/FormikSlider.js +8 -11
- package/lib/component/elements/formik/FormikTextarea.js +1 -1
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib/component/elements/popup/Alert/Provider.js +7 -7
- package/lib/component/elements/popup/Alert/index.d.ts +3 -4
- package/lib/component/elements/popup/Alert/index.js +3 -4
- package/lib/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib/component/elements/popup/Modal/Provider.js +16 -31
- package/lib/component/elements/popup/Modal/index.d.ts +4 -5
- package/lib/component/elements/popup/Modal/index.js +4 -5
- package/lib/component/header/Header.js +1 -1
- package/lib/component/hooks/useCombinedRefs.js +2 -2
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +9 -6
- package/lib/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib/component/hooks/usePanelPreferences.js +9 -7
- package/lib/component/loader/DropZone.js +4 -4
- package/lib/component/modal/AlignSpectraModal.js +1 -1
- package/lib/component/modal/ExportAsMatrixModal.js +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +2 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib/component/modal/PredictSpectraModal.js +5 -5
- package/lib/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib/component/modal/setting/GeneralSettings.js +11 -14
- package/lib/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -1
- package/lib/component/modal/setting/WorkspaceItem.js +36 -48
- package/lib/component/modal/setting/settingsValidation.d.ts +58 -57
- package/lib/component/modal/setting/settingsValidation.js +14 -12
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib/component/panels/InformationPanel.js +52 -56
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +5 -5
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +3 -3
- package/lib/component/reducer/Reducer.d.ts +40 -14
- package/lib/component/reducer/Reducer.js +12 -11
- package/lib/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/DomainActions.js +49 -67
- package/lib/component/reducer/actions/FiltersActions.js +3 -3
- package/lib/component/reducer/actions/HistoryActions.js +5 -5
- package/lib/component/reducer/actions/LoadActions.js +12 -0
- package/lib/component/reducer/actions/PreferencesActions.js +18 -37
- package/lib/component/reducer/actions/RangesActions.js +14 -12
- package/lib/component/reducer/actions/SpectrumsActions.js +10 -4
- package/lib/component/reducer/actions/ToolsActions.js +20 -35
- package/lib/component/reducer/actions/ZonesActions.js +2 -2
- package/lib/component/reducer/core/Constants.js +1 -1
- package/lib/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib/component/reducer/helper/getSpectrum.js +3 -5
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +1 -1
- package/lib/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib/component/reducer/preferences/actions/setPreferences.js +5 -6
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -4
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib/component/tool/BrushX.js +3 -3
- package/lib/component/tool/BrushXY.js +5 -5
- package/lib/component/tool/CrossLinePointer.js +3 -3
- package/lib/component/toolbar/BasicToolBar.js +1 -1
- package/lib/component/utility/Evaluate.js +2 -2
- package/lib/component/utility/FileUtility.d.ts +2 -9
- package/lib/component/utility/FileUtility.js +11 -28
- package/lib/component/utility/GroupByInfoKey.d.ts +1 -1
- package/lib/component/utility/GroupByInfoKey.js +11 -13
- package/lib/component/utility/PathBuilder.js +1 -1
- package/lib/component/utility/PreferencesHelper.js +2 -3
- package/lib/component/utility/{Export.d.ts → export.d.ts} +0 -0
- package/lib/component/utility/{Export.js → export.js} +53 -78
- package/lib/component/utility/formatNumber.d.ts +6 -1
- package/lib/component/utility/formatNumber.js +5 -4
- package/lib/data/Filters.d.ts +16 -17
- package/lib/data/Filters.js +16 -17
- package/lib/data/FiltersManager.js +4 -3
- package/lib/data/PredictionManager.js +8 -10
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/SpectraManager.js +25 -60
- package/lib/data/data1d/MultipleAnalysis.js +74 -70
- package/lib/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +24 -25
- package/lib/data/data1d/Spectrum1D/index.js +24 -25
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib/data/data1d/database.js +45 -28
- package/lib/data/data1d/filter1d/apodization.js +2 -1
- package/lib/data/data1d/filter1d/fft.js +24 -7
- package/lib/data/data1d/filter1d/phaseCorrection.js +2 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +7 -18
- package/lib/data/data2d/Spectrum2D/contours.d.ts +40 -0
- package/lib/data/data2d/Spectrum2D/contours.js +132 -0
- package/lib/data/data2d/Spectrum2D/index.d.ts +10 -11
- package/lib/data/data2d/Spectrum2D/index.js +10 -11
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/index.d.ts +12 -13
- package/lib/data/types/data2d/Data2D.d.ts +2 -0
- package/lib/data/types/data2d/Datum2D.d.ts +0 -1
- package/lib/data/types/data2d/index.d.ts +8 -9
- package/lib/data/utilities/RangeUtilities.js +13 -9
- package/lib/data/utilities/ZoneUtilities.js +17 -13
- package/lib/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib/data/utilities/generateChar.js +8 -6
- package/lib/data/utilities/getAtom.js +1 -1
- package/lib/data/utilities/getAtomsFromMF.js +2 -2
- package/lib/data/utilities/getColor.js +3 -3
- package/lib/data/utilities/getSum.js +6 -3
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- package/lib-cjs/component/1d/LinesSeries.js +1 -1
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/XAxis.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib-cjs/component/1d/integral/IntegralIndicator.js +31 -0
- package/lib-cjs/component/1d/integral/IntegralResizable.js +74 -0
- package/lib-cjs/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib-cjs/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib-cjs/component/1d/ranges/Range.js +27 -50
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +2 -2
- package/lib-cjs/component/2d/Contours.js +60 -41
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/Viewer2D.js +11 -14
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +5 -8
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib-cjs/component/NMRium.js +7 -7
- package/lib-cjs/component/assignment/actions/initAssignment.js +17 -17
- package/lib-cjs/component/assignment/index.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +3 -6
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/CheckBoxCell.js +1 -1
- package/lib-cjs/component/elements/ContextMenu.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +3 -5
- package/lib-cjs/component/elements/GroupPane.js +18 -0
- package/lib-cjs/component/elements/Input.js +7 -4
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/Label.js +1 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +2 -0
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +71 -37
- package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib-cjs/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib-cjs/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -2
- package/lib-cjs/component/elements/draggble/useDraggable.js +1 -3
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +4 -7
- package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib-cjs/component/elements/formik/FormikForm.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +12 -20
- package/lib-cjs/component/elements/formik/FormikOnChange.js +13 -10
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSlider.js +7 -10
- package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
- package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +8 -8
- package/lib-cjs/component/elements/popup/Alert/index.js +5 -5
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +16 -31
- package/lib-cjs/component/elements/popup/Modal/index.js +7 -7
- package/lib-cjs/component/header/Header.js +1 -1
- package/lib-cjs/component/hooks/useCombinedRefs.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +14 -11
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +9 -7
- package/lib-cjs/component/loader/DropZone.js +4 -4
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib-cjs/component/modal/PredictSpectraModal.js +5 -5
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib-cjs/component/modal/setting/GeneralSettings.js +11 -14
- package/lib-cjs/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +37 -49
- package/lib-cjs/component/modal/setting/settingsValidation.js +14 -12
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib-cjs/component/panels/InformationPanel.js +51 -55
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +3 -3
- package/lib-cjs/component/reducer/Reducer.js +11 -10
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +49 -67
- package/lib-cjs/component/reducer/actions/FiltersActions.js +3 -3
- package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
- package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +18 -37
- package/lib-cjs/component/reducer/actions/RangesActions.js +14 -12
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +9 -3
- package/lib-cjs/component/reducer/actions/ToolsActions.js +20 -35
- package/lib-cjs/component/reducer/actions/ZonesActions.js +2 -2
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -5
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +5 -9
- package/lib-cjs/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib-cjs/component/tool/BrushX.js +3 -3
- package/lib-cjs/component/tool/BrushXY.js +5 -5
- package/lib-cjs/component/tool/CrossLinePointer.js +3 -3
- package/lib-cjs/component/toolbar/BasicToolBar.js +1 -1
- package/lib-cjs/component/utility/Evaluate.js +2 -2
- package/lib-cjs/component/utility/FileUtility.js +11 -29
- package/lib-cjs/component/utility/GroupByInfoKey.js +11 -13
- package/lib-cjs/component/utility/PathBuilder.js +1 -1
- package/lib-cjs/component/utility/PreferencesHelper.js +2 -3
- package/lib-cjs/component/utility/{Export.js → export.js} +77 -79
- package/lib-cjs/component/utility/formatNumber.js +5 -4
- package/lib-cjs/data/Filters.js +17 -33
- package/lib-cjs/data/FiltersManager.js +4 -3
- package/lib-cjs/data/PredictionManager.js +8 -10
- package/lib-cjs/data/SpectraManager.js +26 -62
- package/lib-cjs/data/data1d/MultipleAnalysis.js +74 -70
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/index.js +25 -25
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib-cjs/data/data1d/database.js +45 -28
- package/lib-cjs/data/data1d/filter1d/apodization.js +2 -1
- package/lib-cjs/data/data1d/filter1d/fft.js +23 -6
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +2 -2
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Processing2D.js +7 -18
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +138 -0
- package/lib-cjs/data/data2d/Spectrum2D/index.js +11 -11
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/RangeUtilities.js +13 -9
- package/lib-cjs/data/utilities/ZoneUtilities.js +17 -13
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib-cjs/data/utilities/generateChar.js +8 -6
- package/lib-cjs/data/utilities/getAtom.js +1 -1
- package/lib-cjs/data/utilities/getAtomsFromMF.js +2 -2
- package/lib-cjs/data/utilities/getColor.js +3 -3
- package/lib-cjs/data/utilities/getSum.js +6 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +30 -26
- package/lib/component/1d/IntegralResizable.js +0 -72
- package/lib/component/elements/popup/helpers.d.ts +0 -1
- package/lib/component/elements/popup/helpers.js +0 -9
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.js +0 -8
- package/lib/data/data1d/Data1DManager.d.ts +0 -3
- package/lib/data/data1d/Data1DManager.js +0 -98
- package/lib/data/data2d/Data2DManager.d.ts +0 -3
- package/lib/data/data2d/Data2DManager.js +0 -34
- package/lib/data/types/data2d/Contour.d.ts +0 -4
- package/lib/data/types/data2d/Contour.js +0 -1
- package/lib/data/types/data2d/Contours.d.ts +0 -2
- package/lib/data/types/data2d/Contours.js +0 -1
- package/lib-cjs/component/1d/IntegralResizable.js +0 -77
- package/lib-cjs/component/elements/popup/helpers.js +0 -13
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +0 -14
- package/lib-cjs/data/data1d/Data1DManager.js +0 -104
- package/lib-cjs/data/data2d/Data2DManager.js +0 -40
- package/lib-cjs/data/types/data2d/Contour.js +0 -2
- package/lib-cjs/data/types/data2d/Contours.js +0 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import cloneDeep from 'lodash/cloneDeep';
|
|
2
1
|
import groupByInfoKey from '../../utility/GroupByInfoKey';
|
|
3
2
|
import nucleusToString from '../../utility/nucleusToString';
|
|
4
3
|
import { DEFAULT_YAXIS_SHIFT_VALUE, DISPLAYER_MODE } from '../core/Constants';
|
|
@@ -54,18 +53,14 @@ function changeSpectrumVerticalAlignment(draft, options) {
|
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
function setKeyPreferencesHandler(draft, keyCode) {
|
|
57
|
-
const { data, zoom, xDomain, xDomains, yDomain, yDomains, originDomain, margin, displayerMode, view, } = draft;
|
|
56
|
+
const { data, zoom, xDomain, xDomains, yDomain, yDomains, originDomain, margin, displayerMode, view, keysPreferences, } = draft;
|
|
57
|
+
const { spectra: { activeTab }, } = view;
|
|
58
58
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
59
|
-
if (
|
|
59
|
+
if (activeTab) {
|
|
60
60
|
const groupByNucleus = groupByInfoKey('nucleus');
|
|
61
61
|
const spectrumsGroupsList = groupByNucleus(data);
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
acc[datum.id] = datum.processingController.getLevel();
|
|
65
|
-
return acc;
|
|
66
|
-
}, {})
|
|
67
|
-
: null;
|
|
68
|
-
draft.keysPreferences[keyCode] = {
|
|
62
|
+
const spectra = spectrumsGroupsList[activeTab];
|
|
63
|
+
keysPreferences[keyCode] = {
|
|
69
64
|
activeSpectrum,
|
|
70
65
|
displayerMode,
|
|
71
66
|
view,
|
|
@@ -75,29 +70,25 @@ function setKeyPreferencesHandler(draft, keyCode) {
|
|
|
75
70
|
yDomain,
|
|
76
71
|
yDomains,
|
|
77
72
|
originDomain,
|
|
78
|
-
level,
|
|
79
73
|
margin,
|
|
80
|
-
data:
|
|
81
|
-
acc[datum.id] = {
|
|
82
|
-
display: {
|
|
83
|
-
color: datum.display.color,
|
|
84
|
-
isVisible: datum.display.isVisible,
|
|
85
|
-
isPeaksMarkersVisible: datum.display.isPeaksMarkersVisible,
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
return acc;
|
|
89
|
-
}, {}),
|
|
74
|
+
data: spectra,
|
|
90
75
|
};
|
|
91
76
|
}
|
|
92
77
|
}
|
|
78
|
+
function setSpectraDisplayPreferences(draft, preferences) {
|
|
79
|
+
for (const [index, datum] of draft.data.entries()) {
|
|
80
|
+
if (nucleusToString(datum.info.nucleus) === preferences.activeTab) {
|
|
81
|
+
draft.data[index].display = {
|
|
82
|
+
...datum.display,
|
|
83
|
+
...preferences.data[datum.id].display,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
93
88
|
function applyKeyPreferencesHandler(draft, keyCode) {
|
|
94
89
|
const preferences = draft.keysPreferences[keyCode];
|
|
95
90
|
if (preferences) {
|
|
96
|
-
draft
|
|
97
|
-
if (nucleusToString(datum.info.nucleus) === preferences.activeTab) {
|
|
98
|
-
draft.data[index].display = Object.assign(cloneDeep(datum.display), preferences.data[datum.id].display);
|
|
99
|
-
}
|
|
100
|
-
});
|
|
91
|
+
setSpectraDisplayPreferences(draft, preferences);
|
|
101
92
|
draft.view = preferences.view;
|
|
102
93
|
draft.displayerMode = preferences.displayerMode;
|
|
103
94
|
draft.margin = preferences.margin;
|
|
@@ -107,17 +98,7 @@ function applyKeyPreferencesHandler(draft, keyCode) {
|
|
|
107
98
|
draft.yDomain = preferences.yDomain;
|
|
108
99
|
draft.originDomain = preferences.originDomain;
|
|
109
100
|
draft.yDomains = preferences.yDomains;
|
|
110
|
-
if (draft.displayerMode
|
|
111
|
-
for (const datumID of Object.keys(preferences.level)) {
|
|
112
|
-
const { levelPositive, levelNegative } = preferences.level[datumID];
|
|
113
|
-
const index = draft.data.findIndex((datum) => datum.id === datumID);
|
|
114
|
-
const processController = draft.data[index]
|
|
115
|
-
.processingController;
|
|
116
|
-
processController.setLevel(levelPositive, levelNegative);
|
|
117
|
-
draft.contours[datumID] = processController.drawContours();
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
101
|
+
if (draft.displayerMode !== DISPLAYER_MODE.DM_2D) {
|
|
121
102
|
draft.zoom = preferences.zoom;
|
|
122
103
|
}
|
|
123
104
|
}
|
|
@@ -15,15 +15,15 @@ import { handleUpdateCorrelations } from './CorrelationsActions';
|
|
|
15
15
|
import { setDomain, setIntegralsYDomain } from './DomainActions';
|
|
16
16
|
import { resetSelectedTool } from './ToolsActions';
|
|
17
17
|
function handleAutoRangesDetection(draft, options) {
|
|
18
|
-
const { data, xDomain, molecules, view: { spectra: { activeTab: nucleus }, }, } = draft;
|
|
18
|
+
const { data, xDomain, molecules, view: { spectra: { activeTab: nucleus }, ranges, }, } = draft;
|
|
19
19
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
20
20
|
if (activeSpectrum?.id) {
|
|
21
21
|
const { index, id } = activeSpectrum;
|
|
22
22
|
const datum = data[index];
|
|
23
23
|
// add range intial state
|
|
24
|
-
const range =
|
|
24
|
+
const range = ranges.find((r) => r.spectrumID === id);
|
|
25
25
|
if (!range) {
|
|
26
|
-
|
|
26
|
+
ranges.push({
|
|
27
27
|
spectrumID: id,
|
|
28
28
|
...rangeStateInit,
|
|
29
29
|
});
|
|
@@ -231,20 +231,20 @@ function handleChangeRangeSum(draft, options) {
|
|
|
231
231
|
function addNewRange(draft, props) {
|
|
232
232
|
const { startX, endX, id } = props;
|
|
233
233
|
const range = getRange(draft, { startX, endX });
|
|
234
|
-
const { view: { spectra: { activeTab: nucleus }, }, molecules, } = draft;
|
|
234
|
+
const { data, view: { spectra: { activeTab: nucleus }, ranges, }, molecules, } = draft;
|
|
235
235
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
236
236
|
if (activeSpectrum?.id) {
|
|
237
237
|
const { index } = activeSpectrum;
|
|
238
238
|
const [from, to] = range;
|
|
239
239
|
// add range intial state
|
|
240
|
-
const rangeState =
|
|
240
|
+
const rangeState = ranges.find((r) => r.spectrumID === activeSpectrum.id);
|
|
241
241
|
if (!rangeState) {
|
|
242
|
-
|
|
242
|
+
ranges.push({
|
|
243
243
|
spectrumID: activeSpectrum.id,
|
|
244
244
|
...rangeStateInit,
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
|
-
addRange(
|
|
247
|
+
addRange(data[index], {
|
|
248
248
|
from,
|
|
249
249
|
to,
|
|
250
250
|
id,
|
|
@@ -252,7 +252,7 @@ function addNewRange(draft, props) {
|
|
|
252
252
|
molecules,
|
|
253
253
|
});
|
|
254
254
|
handleOnChangeRangesData(draft);
|
|
255
|
-
setIntegralsYDomain(draft,
|
|
255
|
+
setIntegralsYDomain(draft, data[index]);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
function handleAddRange(draft, action) {
|
|
@@ -269,15 +269,17 @@ function handleAddRange(draft, action) {
|
|
|
269
269
|
}
|
|
270
270
|
function handleChangeRangeRelativeValue(draft, action) {
|
|
271
271
|
const data = action.payload.data;
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
273
|
+
if (activeSpectrum?.id) {
|
|
274
|
+
const { index } = activeSpectrum;
|
|
274
275
|
changeRangeRelativeValue(draft.data[index], data);
|
|
275
276
|
}
|
|
276
277
|
}
|
|
277
278
|
function handleChangeRangeSignalValue(draft, action) {
|
|
278
279
|
const { rangeID, signalID, value } = action.payload;
|
|
279
|
-
|
|
280
|
-
|
|
280
|
+
const activeSpectrum = getActiveSpectrum(draft);
|
|
281
|
+
if (activeSpectrum?.id) {
|
|
282
|
+
const { index } = activeSpectrum;
|
|
281
283
|
const shift = changeRangeSignal(draft.data[index], {
|
|
282
284
|
rangeID,
|
|
283
285
|
signalID,
|
|
@@ -2,7 +2,8 @@ import { original } from 'immer';
|
|
|
2
2
|
import * as Filters from '../../../data/Filters';
|
|
3
3
|
import { applyFilter } from '../../../data/FiltersManager';
|
|
4
4
|
import { generateSpectrumFromPublicationString, getReferenceShift, } from '../../../data/data1d/Spectrum1D';
|
|
5
|
-
import { getMissingProjection } from '../../../data/data2d/Spectrum2D';
|
|
5
|
+
import { getMissingProjection, isSpectrum2D, } from '../../../data/data2d/Spectrum2D';
|
|
6
|
+
import { contoursManager } from '../../../data/data2d/Spectrum2D/contours';
|
|
6
7
|
import { options } from '../../toolbar/ToolTypes';
|
|
7
8
|
import groupByInfoKey from '../../utility/GroupByInfoKey';
|
|
8
9
|
import { setZoom } from '../helper/Zoom1DManager';
|
|
@@ -115,10 +116,15 @@ function handleChangeActiveSpectrum(draft, activeSpectrum) {
|
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
function changeSpectrumSetting(draft, { id, display }) {
|
|
118
|
-
const
|
|
119
|
-
const index = state.data.findIndex((d) => d.id === id);
|
|
119
|
+
const index = draft.data.findIndex((d) => d.id === id);
|
|
120
120
|
if (index !== -1) {
|
|
121
|
-
draft.data[index]
|
|
121
|
+
const spectrum = draft.data[index];
|
|
122
|
+
spectrum.display = display;
|
|
123
|
+
if (isSpectrum2D(spectrum)) {
|
|
124
|
+
const contoursLevels = draft.view.zoom.levels;
|
|
125
|
+
const { checkLevel } = contoursManager(spectrum.id, contoursLevels, spectrum.display.contourOptions);
|
|
126
|
+
contoursLevels[spectrum.id] = checkLevel();
|
|
127
|
+
}
|
|
122
128
|
}
|
|
123
129
|
}
|
|
124
130
|
function handleChangeSpectrumColor(draft, { id, color, key }) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { v4 } from '@lukeed/uuid';
|
|
2
2
|
import { original } from 'immer';
|
|
3
3
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
4
|
+
import { contoursManager } from '../../../data/data2d/Spectrum2D/contours';
|
|
4
5
|
import { getYScale, getXScale } from '../../1d/utilities/scale';
|
|
5
6
|
import { LAYOUT } from '../../2d/utilities/DimensionLayout';
|
|
6
7
|
import { get2DYScale } from '../../2d/utilities/scale';
|
|
@@ -12,6 +13,7 @@ import { setZoom, wheelZoom, ZoomType } from '../helper/Zoom1DManager';
|
|
|
12
13
|
import zoomHistoryManager from '../helper/ZoomHistoryManager';
|
|
13
14
|
import { getActiveSpectrum } from '../helper/getActiveSpectrum';
|
|
14
15
|
import { getActiveSpectrumOrFail } from '../helper/getActiveSpectrumOrFail';
|
|
16
|
+
import { getSpectrum } from '../helper/getSpectrum';
|
|
15
17
|
import { setDomain, setIntegralsYDomain, setMode, } from './DomainActions';
|
|
16
18
|
import { calculateBaseLineCorrection, resetSpectrumByFilter, setFilterChanges, } from './FiltersActions';
|
|
17
19
|
import { changeSpectrumVerticalAlignment } from './PreferencesActions';
|
|
@@ -174,7 +176,7 @@ function getSpectrumID(draft, index) {
|
|
|
174
176
|
}
|
|
175
177
|
function handleZoom(draft, action) {
|
|
176
178
|
const { event, trackID, selectedTool } = action;
|
|
177
|
-
const { view: { ranges: rangeState }, displayerMode, } = draft;
|
|
179
|
+
const { view: { ranges: rangeState }, displayerMode, yDomains, integralsYDomains, } = draft;
|
|
178
180
|
const activeSpectrum = getActiveSpectrum(draft);
|
|
179
181
|
const { showRangesIntegrals } = rangeState.find((r) => r.spectrumID === activeSpectrum?.id) ||
|
|
180
182
|
rangeStateInit;
|
|
@@ -183,26 +185,26 @@ function handleZoom(draft, action) {
|
|
|
183
185
|
if (index !== null) {
|
|
184
186
|
const id = getSpectrumID(draft, index);
|
|
185
187
|
if (id) {
|
|
186
|
-
const domain =
|
|
187
|
-
|
|
188
|
+
const domain = yDomains[id];
|
|
189
|
+
yDomains[id] = wheelZoom(event, domain);
|
|
188
190
|
}
|
|
189
191
|
}
|
|
190
192
|
}
|
|
191
193
|
else if (activeSpectrum?.id) {
|
|
192
194
|
if ((showRangesIntegrals || selectedTool === options.integral.id) &&
|
|
193
195
|
event.shiftKey) {
|
|
194
|
-
const domain =
|
|
195
|
-
|
|
196
|
+
const domain = integralsYDomains[activeSpectrum?.id];
|
|
197
|
+
integralsYDomains[activeSpectrum?.id] = wheelZoom(event, domain);
|
|
196
198
|
}
|
|
197
199
|
else {
|
|
198
|
-
const domain =
|
|
199
|
-
|
|
200
|
+
const domain = yDomains[activeSpectrum?.id];
|
|
201
|
+
yDomains[activeSpectrum?.id] = wheelZoom(event, domain);
|
|
200
202
|
}
|
|
201
203
|
}
|
|
202
204
|
else {
|
|
203
|
-
for (const key of Object.keys(
|
|
204
|
-
const domain =
|
|
205
|
-
|
|
205
|
+
for (const key of Object.keys(yDomains)) {
|
|
206
|
+
const domain = yDomains[key];
|
|
207
|
+
yDomains[key] = wheelZoom(event, domain);
|
|
206
208
|
}
|
|
207
209
|
}
|
|
208
210
|
}
|
|
@@ -275,15 +277,6 @@ function setMargin(draft) {
|
|
|
275
277
|
draft.margin = MARGIN['1D'];
|
|
276
278
|
}
|
|
277
279
|
}
|
|
278
|
-
function processing2DData(draft, data) {
|
|
279
|
-
if (draft.displayerMode === DISPLAYER_MODE.DM_2D) {
|
|
280
|
-
let _data = {};
|
|
281
|
-
for (const datum of data[draft.view.spectra.activeTab]) {
|
|
282
|
-
_data[datum.id] = datum.processingController.drawContours();
|
|
283
|
-
}
|
|
284
|
-
draft.contours = _data;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
280
|
function setDisplayerMode(draft, data) {
|
|
288
281
|
draft.displayerMode =
|
|
289
282
|
data && data.some((d) => d.info.dimension === 2)
|
|
@@ -354,7 +347,6 @@ function setActiveTab(draft, options) {
|
|
|
354
347
|
const currentTab = !tab || !tabs.includes(tab || '') ? tabs[0] : tab;
|
|
355
348
|
setTab(draft, dataGroupByNucleus, currentTab, refreshActiveTab);
|
|
356
349
|
resetTool(draft);
|
|
357
|
-
processing2DData(draft, dataGroupByNucleus);
|
|
358
350
|
setDomain(draft, domainOptions);
|
|
359
351
|
setIntegralsYDomain(draft, dataGroupByNucleus[currentTab]);
|
|
360
352
|
const zoomHistory = zoomHistoryManager(draft.zoom.history, draft.view.spectra.activeTab);
|
|
@@ -371,25 +363,18 @@ function handelSetActiveTab(draft, tab) {
|
|
|
371
363
|
}
|
|
372
364
|
}
|
|
373
365
|
function levelChangeHandler(draft, { deltaY, shiftKey }) {
|
|
374
|
-
const activeSpectrum =
|
|
366
|
+
const activeSpectrum = getSpectrum(draft);
|
|
375
367
|
try {
|
|
376
368
|
if (activeSpectrum?.id) {
|
|
377
|
-
const {
|
|
378
|
-
const
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
processingController.shiftWheel(deltaY);
|
|
382
|
-
}
|
|
383
|
-
else {
|
|
384
|
-
processingController.wheel(deltaY);
|
|
385
|
-
}
|
|
386
|
-
const contours = Object.freeze(processingController.drawContours());
|
|
387
|
-
draft.contours[id] = contours;
|
|
369
|
+
const { levels } = draft.view.zoom;
|
|
370
|
+
const contourOptions = activeSpectrum.display.contourOptions;
|
|
371
|
+
const zoom = contoursManager(activeSpectrum.id, levels, contourOptions);
|
|
372
|
+
levels[activeSpectrum.id] = zoom.wheel(deltaY, shiftKey);
|
|
388
373
|
}
|
|
389
374
|
}
|
|
390
|
-
catch (
|
|
391
|
-
//
|
|
392
|
-
|
|
375
|
+
catch (error) {
|
|
376
|
+
// TODO: handle error.
|
|
377
|
+
reportError(error);
|
|
393
378
|
}
|
|
394
379
|
}
|
|
395
380
|
function setSpectraSameTopHandler(draft) {
|
|
@@ -200,9 +200,9 @@ function handleSaveEditedZone(draft, action) {
|
|
|
200
200
|
const zoneIndex = getZoneIndex(state, index, editedRowData.id);
|
|
201
201
|
draft.data[index].zones.values[zoneIndex] = editedRowData;
|
|
202
202
|
if (editedRowData.signals) {
|
|
203
|
-
editedRowData.signals
|
|
203
|
+
for (const signal of editedRowData.signals) {
|
|
204
204
|
setPathLength(draft.correlations.values, signal.id, signal.j?.pathLength);
|
|
205
|
-
}
|
|
205
|
+
}
|
|
206
206
|
}
|
|
207
207
|
handleOnChangeZonesData(draft);
|
|
208
208
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
function getClosestNumber(array = [], goal = 0) {
|
|
2
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
2
3
|
const closest = array.reduce((prev, curr) => {
|
|
3
4
|
return Math.abs(curr - goal) < Math.abs(prev - goal) ? curr : prev;
|
|
4
|
-
});
|
|
5
|
+
}, Number.POSITIVE_INFINITY);
|
|
5
6
|
return closest;
|
|
6
7
|
}
|
|
7
8
|
export default getClosestNumber;
|
|
@@ -14,12 +14,12 @@ function wheelZoom(event, domain, zoomOptions = {}) {
|
|
|
14
14
|
return [min * ratio, max * ratio];
|
|
15
15
|
}
|
|
16
16
|
function setZoom(draft, options = {}) {
|
|
17
|
-
const { height, margin } = draft;
|
|
18
|
-
const activeSpectrum =
|
|
17
|
+
const { height, margin, view, originDomain, yDomains } = draft;
|
|
18
|
+
const activeSpectrum = view.spectra.activeSpectra[view.spectra.activeTab];
|
|
19
19
|
const { scale = 1, spectrumID = null } = options;
|
|
20
20
|
if (activeSpectrum === null && spectrumID === null) {
|
|
21
|
-
const { shareYDomain, yDomain, yDomains } =
|
|
22
|
-
draft.yDomains = Object.keys(
|
|
21
|
+
const { shareYDomain, yDomain, yDomains } = originDomain;
|
|
22
|
+
draft.yDomains = Object.fromEntries(Object.keys(yDomains).map((id) => {
|
|
23
23
|
const _scale = scaleLinear(shareYDomain ? yDomain : yDomains[id], [
|
|
24
24
|
height - margin.bottom,
|
|
25
25
|
margin.top,
|
|
@@ -28,18 +28,19 @@ function setZoom(draft, options = {}) {
|
|
|
28
28
|
const maxPoint = Math.max(Math.abs(max), Math.abs(min));
|
|
29
29
|
const scalePoint = maxPoint === max ? 0 : min;
|
|
30
30
|
const t = zoomIdentity
|
|
31
|
-
.translate(0, Math.sign(scalePoint) >= 0
|
|
31
|
+
.translate(0, Math.sign(scalePoint) >= 0
|
|
32
|
+
? _scale(scalePoint)
|
|
33
|
+
: _scale(scalePoint))
|
|
32
34
|
.scale(scale)
|
|
33
35
|
.translate(0, -_scale(0));
|
|
34
36
|
const newYDomain = t.rescaleY(_scale).domain();
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}, {});
|
|
37
|
+
return [id, newYDomain];
|
|
38
|
+
}));
|
|
38
39
|
}
|
|
39
40
|
else {
|
|
40
41
|
const spectrumId = spectrumID || activeSpectrum?.id;
|
|
41
42
|
if (spectrumId) {
|
|
42
|
-
const _scale = scaleLinear(
|
|
43
|
+
const _scale = scaleLinear(originDomain.yDomains[spectrumId], [
|
|
43
44
|
height - margin.bottom,
|
|
44
45
|
margin.top,
|
|
45
46
|
]);
|
|
@@ -49,7 +50,7 @@ function setZoom(draft, options = {}) {
|
|
|
49
50
|
.translate(0, -_scale(0));
|
|
50
51
|
const yDomain = t.rescaleY(_scale).domain();
|
|
51
52
|
draft.yDomains = {
|
|
52
|
-
...
|
|
53
|
+
...yDomains,
|
|
53
54
|
[spectrumId]: yDomain,
|
|
54
55
|
};
|
|
55
56
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export function getSpectrum(state, value) {
|
|
2
2
|
const activeSpectrum = state.view.spectra.activeSpectra[state.view.spectra.activeTab];
|
|
3
|
-
if (value === undefined) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return state.data[index];
|
|
7
|
-
}
|
|
3
|
+
if (value === undefined && activeSpectrum?.id) {
|
|
4
|
+
const index = activeSpectrum.index;
|
|
5
|
+
return state.data[index];
|
|
8
6
|
}
|
|
9
7
|
if (typeof value === 'number') {
|
|
10
8
|
return state.data[value] || undefined;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { max } from 'd3';
|
|
2
2
|
export function getStrongestPeak(draft) {
|
|
3
|
-
const { data } = draft;
|
|
4
3
|
const activeSpectrum = draft.view.spectra.activeSpectra[draft.view.spectra.activeTab];
|
|
5
4
|
if (activeSpectrum) {
|
|
6
|
-
const activeData = data[activeSpectrum?.index].data;
|
|
5
|
+
const activeData = draft.data[activeSpectrum?.index].data;
|
|
7
6
|
const strongestPeakValue = max(activeData.re);
|
|
8
|
-
const index = activeData.re.
|
|
7
|
+
const index = activeData.re.indexOf(strongestPeakValue);
|
|
9
8
|
return {
|
|
10
9
|
xValue: activeData.x[index],
|
|
11
10
|
yValue: strongestPeakValue,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { original } from 'immer';
|
|
2
1
|
import { getLocalStorage, storeData } from '../../../utility/LocalStorage';
|
|
3
2
|
import { filterObject } from '../utilities/filterObject';
|
|
4
3
|
export function removeWorkspace(draft, action) {
|
|
@@ -7,14 +6,8 @@ export function removeWorkspace(draft, action) {
|
|
|
7
6
|
draft.workspace.current = 'default';
|
|
8
7
|
}
|
|
9
8
|
let localData = getLocalStorage('nmr-general-settings');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
acc[key] = storedWorkspaces[key];
|
|
14
|
-
}
|
|
15
|
-
return acc;
|
|
16
|
-
}, {});
|
|
17
|
-
draft.workspaces = workspaces;
|
|
18
|
-
localData.workspaces = filterObject(workspaces);
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
10
|
+
delete draft.workspaces[workspace];
|
|
11
|
+
localData.workspaces = filterObject(draft.workspaces);
|
|
19
12
|
storeData('nmr-general-settings', JSON.stringify(localData));
|
|
20
13
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import lodashMerge from 'lodash/merge';
|
|
2
1
|
import { getLocalStorage, storeData } from '../../../utility/LocalStorage';
|
|
3
2
|
import { getActiveWorkspace } from '../utilities/getActiveWorkspace';
|
|
4
3
|
import { mapNucleiFormatting } from '../utilities/mapNucleiFormatting';
|
|
5
4
|
export function setPreferences(draft, action) {
|
|
6
5
|
if (action.payload) {
|
|
7
|
-
let
|
|
8
|
-
let { general, formatting, display, databases } = action.payload;
|
|
6
|
+
let { general = {}, formatting, display, databases } = action.payload;
|
|
9
7
|
formatting = mapNucleiFormatting(formatting);
|
|
10
8
|
let localData = getLocalStorage('nmr-general-settings');
|
|
11
9
|
localData.currentWorkspace = draft.workspace.current;
|
|
@@ -20,12 +18,13 @@ export function setPreferences(draft, action) {
|
|
|
20
18
|
},
|
|
21
19
|
};
|
|
22
20
|
storeData('nmr-general-settings', JSON.stringify(localData));
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
22
|
+
draft.workspaces[draft.workspace.current] = {
|
|
23
|
+
...currentWorkspacePreferences,
|
|
25
24
|
general,
|
|
26
25
|
formatting,
|
|
27
26
|
databases,
|
|
28
27
|
display,
|
|
29
|
-
}
|
|
28
|
+
};
|
|
30
29
|
}
|
|
31
30
|
}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
import { Formatting } from '../../../workspaces/Workspace';
|
|
2
|
-
export declare function mapNucleiFormatting(formatting: Formatting):
|
|
3
|
-
panels: Partial<import("../../../workspaces/Workspace").PanelsPreferences>;
|
|
4
|
-
nuclei: {};
|
|
5
|
-
};
|
|
2
|
+
export declare function mapNucleiFormatting(formatting: Formatting): Formatting;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export function mapNucleiFormatting(formatting) {
|
|
2
2
|
const { nuclei, ...res } = formatting;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
return {
|
|
4
|
+
nuclei: Object.fromEntries(Object.keys(nuclei).map((key) => [
|
|
5
|
+
nuclei[key].name.trim().toLowerCase(),
|
|
6
|
+
nuclei[key],
|
|
7
|
+
])),
|
|
8
|
+
...res,
|
|
9
|
+
};
|
|
8
10
|
}
|
|
@@ -11,7 +11,7 @@ const styles = {
|
|
|
11
11
|
left: '0px',
|
|
12
12
|
},
|
|
13
13
|
};
|
|
14
|
-
const allowTools = [
|
|
14
|
+
const allowTools = new Set([
|
|
15
15
|
options.zoom.id,
|
|
16
16
|
options.zeroFilling.id,
|
|
17
17
|
options.peakPicking.id,
|
|
@@ -20,11 +20,11 @@ const allowTools = [
|
|
|
20
20
|
options.baselineCorrection.id,
|
|
21
21
|
options.rangePicking.id,
|
|
22
22
|
options.exclusionZones.id,
|
|
23
|
-
];
|
|
23
|
+
]);
|
|
24
24
|
export default function BrushX() {
|
|
25
25
|
const { width, height, toolOptions: { selectedTool }, } = useChartData();
|
|
26
26
|
const { startX, endX, step } = useContext(BrushContext);
|
|
27
|
-
if (!allowTools.
|
|
27
|
+
if (!allowTools.has(selectedTool) || step !== 'brushing')
|
|
28
28
|
return null;
|
|
29
29
|
const scale = (endX - startX) / width;
|
|
30
30
|
return (_jsx("div", { style: {
|
|
@@ -12,7 +12,7 @@ const styles = {
|
|
|
12
12
|
zoom: '100%',
|
|
13
13
|
},
|
|
14
14
|
};
|
|
15
|
-
const allowTools = [
|
|
15
|
+
const allowTools = new Set([
|
|
16
16
|
options.zoom.id,
|
|
17
17
|
options.apodization.id,
|
|
18
18
|
options.zeroFilling.id,
|
|
@@ -27,7 +27,7 @@ const allowTools = [
|
|
|
27
27
|
options.multipleSpectraAnalysis.id,
|
|
28
28
|
options.exclusionZones.id,
|
|
29
29
|
options.databaseRangesSelection.id,
|
|
30
|
-
];
|
|
30
|
+
]);
|
|
31
31
|
export const BRUSH_TYPE = {
|
|
32
32
|
X: 1,
|
|
33
33
|
Y: 2,
|
|
@@ -40,7 +40,7 @@ const defaultDimensionBorder = {
|
|
|
40
40
|
export default function BrushXY({ brushType = BRUSH_TYPE.XY, dimensionBorder = defaultDimensionBorder, width: widthProps, height: heightProps, }) {
|
|
41
41
|
let { width, height, toolOptions: { selectedTool }, } = useChartData();
|
|
42
42
|
let { startX, endX, startY, endY, step } = useContext(BrushContext);
|
|
43
|
-
if (!allowTools.
|
|
43
|
+
if (!allowTools.has(selectedTool) ||
|
|
44
44
|
step !== 'brushing' ||
|
|
45
45
|
!dimensionBorder ||
|
|
46
46
|
(dimensionBorder.startX && startX < dimensionBorder.startX) ||
|
|
@@ -55,8 +55,8 @@ export default function BrushXY({ brushType = BRUSH_TYPE.XY, dimensionBorder = d
|
|
|
55
55
|
: endY < dimensionBorder.startY))) {
|
|
56
56
|
return null;
|
|
57
57
|
}
|
|
58
|
-
width = widthProps
|
|
59
|
-
height = heightProps
|
|
58
|
+
width = widthProps || width;
|
|
59
|
+
height = heightProps || height;
|
|
60
60
|
endX =
|
|
61
61
|
dimensionBorder.endX && endX > dimensionBorder.endX
|
|
62
62
|
? dimensionBorder.endX
|
|
@@ -13,7 +13,7 @@ const styles = {
|
|
|
13
13
|
willChange: 'transform',
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
|
-
const allowTools = [
|
|
16
|
+
const allowTools = new Set([
|
|
17
17
|
options.zoom.id,
|
|
18
18
|
options.apodization.id,
|
|
19
19
|
options.equalizer.id,
|
|
@@ -26,12 +26,12 @@ const allowTools = [
|
|
|
26
26
|
options.multipleSpectraAnalysis.id,
|
|
27
27
|
options.exclusionZones.id,
|
|
28
28
|
options.databaseRangesSelection.id,
|
|
29
|
-
];
|
|
29
|
+
]);
|
|
30
30
|
function CrossLinePointer() {
|
|
31
31
|
const { height, width, margin, toolOptions: { selectedTool }, } = useChartData();
|
|
32
32
|
let position = useContext(MouseContext);
|
|
33
33
|
const brushState = useContext(BrushContext);
|
|
34
|
-
if (!allowTools.
|
|
34
|
+
if (!allowTools.has(selectedTool) ||
|
|
35
35
|
brushState.step === 'brushing' ||
|
|
36
36
|
!position ||
|
|
37
37
|
position.x > width - margin.right ||
|
|
@@ -124,7 +124,7 @@ function BasicToolBarInner({ info, verticalAlign, ftCounter, fidCounter, activeS
|
|
|
124
124
|
void saveAsPNGHandler();
|
|
125
125
|
break;
|
|
126
126
|
case 'json':
|
|
127
|
-
|
|
127
|
+
saveAsJSONHandler();
|
|
128
128
|
break;
|
|
129
129
|
case 'advance_save':
|
|
130
130
|
void saveAsHandler();
|
|
@@ -13,7 +13,7 @@ export declare const FILES_SIGNATURES: {
|
|
|
13
13
|
};
|
|
14
14
|
declare function getFileSignature(fileArrayBuffer: any): string;
|
|
15
15
|
declare function loadFile(file: any, options?: {
|
|
16
|
-
asBuffer
|
|
16
|
+
asBuffer?: boolean;
|
|
17
17
|
}): Promise<string | ArrayBuffer>;
|
|
18
18
|
declare function getFileExtension(name: any): any;
|
|
19
19
|
declare function getFileName(name: any): any;
|
|
@@ -31,11 +31,4 @@ declare function extractFileMetaFromPath(path: any): {
|
|
|
31
31
|
declare function loadFiles<T = unknown>(acceptedFiles: any, options?: {
|
|
32
32
|
asBuffer?: boolean;
|
|
33
33
|
}): Promise<T[]>;
|
|
34
|
-
|
|
35
|
-
asBuffer?: boolean;
|
|
36
|
-
}): Promise<{
|
|
37
|
-
binary: any;
|
|
38
|
-
name: string;
|
|
39
|
-
extension: string;
|
|
40
|
-
}[]>;
|
|
41
|
-
export { loadFiles, loadFilesFromZip, loadFile, getFileExtension, getFileName, extractFileMetaFromPath, getFileSignature, };
|
|
34
|
+
export { loadFiles, loadFile, getFileExtension, getFileName, extractFileMetaFromPath, getFileSignature, };
|