nmrium 0.31.0 → 0.33.0-pre.1667632695
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/Chart1D.js +1 -1
- package/lib/component/1d/FooterBanner.js +17 -10
- package/lib/component/1d/LinesSeries.js +1 -1
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/XAxis.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib/component/1d/{Integral.d.ts → integral/Integral.d.ts} +0 -0
- package/lib/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib/component/1d/integral/IntegralIndicator.d.ts +9 -0
- package/lib/component/1d/integral/IntegralIndicator.js +27 -0
- package/lib/component/1d/{IntegralResizable.d.ts → integral/IntegralResizable.d.ts} +0 -0
- package/lib/component/1d/integral/IntegralResizable.js +69 -0
- package/lib/component/1d/{IntegralsSeries.d.ts → integral/IntegralsSeries.d.ts} +0 -0
- package/lib/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib/component/1d/ranges/Range.js +27 -50
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +2 -2
- package/lib/component/2d/Contours.js +61 -42
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/Left1DChart.js +1 -1
- package/lib/component/2d/Top1DChart.js +1 -1
- package/lib/component/2d/Viewer2D.js +11 -14
- package/lib/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib/component/2d/zones/IndicationLines.js +5 -8
- package/lib/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +6 -6
- package/lib/component/SplitPaneWrapper.js +1 -1
- package/lib/component/assignment/actions/initAssignment.js +17 -17
- package/lib/component/assignment/index.js +2 -2
- package/lib/component/context/PreferencesContext.js +3 -6
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/CheckBoxCell.js +1 -1
- package/lib/component/elements/ContextMenu.js +2 -2
- package/lib/component/elements/EditableColumn.d.ts +3 -1
- package/lib/component/elements/EditableColumn.js +21 -8
- package/lib/component/elements/GroupPane.d.ts +12 -0
- package/lib/component/elements/GroupPane.js +14 -0
- package/lib/component/elements/Input.js +7 -4
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/Label.js +1 -2
- package/lib/component/elements/MolecularFormulaInput.js +2 -0
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -1
- package/lib/component/elements/ReactTable/ReactTable.js +72 -38
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +3 -2
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib/component/elements/accordion/Accordion.js +2 -2
- package/lib/component/elements/draggble/useDraggable.js +1 -3
- package/lib/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
- package/lib/component/elements/formik/FormikColorPicker.js +5 -8
- package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib/component/elements/formik/FormikForm.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput.js +12 -20
- package/lib/component/elements/formik/FormikOnChange.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.js +13 -10
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/elements/formik/FormikSlider.d.ts +2 -4
- package/lib/component/elements/formik/FormikSlider.js +8 -11
- package/lib/component/elements/formik/FormikTextarea.js +1 -1
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib/component/elements/popup/Alert/Provider.js +7 -7
- package/lib/component/elements/popup/Alert/index.d.ts +3 -4
- package/lib/component/elements/popup/Alert/index.js +3 -4
- package/lib/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib/component/elements/popup/Modal/Provider.js +16 -31
- package/lib/component/elements/popup/Modal/index.d.ts +4 -5
- package/lib/component/elements/popup/Modal/index.js +4 -5
- package/lib/component/header/Header.js +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib/component/hooks/useCombinedRefs.js +2 -2
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +9 -6
- package/lib/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib/component/hooks/usePanelPreferences.js +9 -7
- package/lib/component/loader/DropZone.js +10 -2
- package/lib/component/modal/AlignSpectraModal.js +1 -1
- package/lib/component/modal/ExportAsMatrixModal.js +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +2 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib/component/modal/PredictSpectraModal.js +5 -5
- package/lib/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib/component/modal/setting/GeneralSettings.js +11 -14
- package/lib/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -1
- package/lib/component/modal/setting/WorkspaceItem.js +36 -48
- package/lib/component/modal/setting/settingsValidation.d.ts +58 -57
- package/lib/component/modal/setting/settingsValidation.js +14 -12
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib/component/panels/InformationPanel.js +52 -56
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +5 -5
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +3 -26
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +3 -3
- package/lib/component/reducer/Reducer.d.ts +26 -45
- package/lib/component/reducer/Reducer.js +13 -12
- package/lib/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/DomainActions.js +52 -69
- package/lib/component/reducer/actions/FiltersActions.js +15 -6
- package/lib/component/reducer/actions/HistoryActions.js +5 -5
- package/lib/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib/component/reducer/actions/LoadActions.js +12 -0
- package/lib/component/reducer/actions/PeaksActions.js +7 -6
- package/lib/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +28 -24
- package/lib/component/reducer/actions/SpectrumsActions.js +13 -6
- package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +28 -41
- package/lib/component/reducer/actions/ZonesActions.js +11 -10
- package/lib/component/reducer/core/Constants.js +1 -1
- package/lib/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrum.js +4 -0
- package/lib/component/reducer/helper/getSpectrum.js +3 -5
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +1 -1
- package/lib/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib/component/reducer/preferences/actions/setPreferences.js +5 -6
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +2 -2
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -4
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib/component/tool/BrushX.js +3 -3
- package/lib/component/tool/BrushXY.js +5 -5
- package/lib/component/tool/CrossLinePointer.js +3 -3
- package/lib/component/toolbar/BasicToolBar.js +9 -8
- package/lib/component/utility/Evaluate.js +2 -2
- package/lib/component/utility/FileUtility.d.ts +2 -9
- package/lib/component/utility/FileUtility.js +11 -28
- package/lib/component/utility/GroupByInfoKey.d.ts +1 -1
- package/lib/component/utility/GroupByInfoKey.js +11 -13
- package/lib/component/utility/PathBuilder.js +1 -1
- package/lib/component/utility/PreferencesHelper.js +2 -3
- package/lib/component/utility/{Export.d.ts → export.d.ts} +0 -0
- package/lib/component/utility/{Export.js → export.js} +54 -73
- package/lib/component/utility/formatNumber.d.ts +6 -1
- package/lib/component/utility/formatNumber.js +5 -4
- package/lib/component/workspaces/Workspace.d.ts +1 -1
- package/lib/component/workspaces/exercise.js +4 -4
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/Filters.d.ts +16 -18
- package/lib/data/Filters.js +16 -18
- package/lib/data/FiltersManager.js +4 -3
- package/lib/data/PredictionManager.js +8 -10
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/SpectraManager.js +25 -60
- package/lib/data/data1d/MultipleAnalysis.js +74 -70
- package/lib/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +24 -25
- package/lib/data/data1d/Spectrum1D/index.js +24 -25
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib/data/data1d/database.js +45 -28
- package/lib/data/data1d/filter1d/apodization.js +2 -1
- package/lib/data/data1d/filter1d/fft.js +24 -7
- package/lib/data/data1d/filter1d/phaseCorrection.js +11 -5
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +10 -20
- package/lib/data/data2d/Spectrum2D/contours.d.ts +40 -0
- package/lib/data/data2d/Spectrum2D/contours.js +132 -0
- package/lib/data/data2d/Spectrum2D/index.d.ts +10 -11
- package/lib/data/data2d/Spectrum2D/index.js +10 -11
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/index.d.ts +12 -13
- package/lib/data/types/data2d/Data2D.d.ts +2 -0
- package/lib/data/types/data2d/Datum2D.d.ts +0 -1
- package/lib/data/types/data2d/index.d.ts +8 -9
- package/lib/data/utilities/RangeUtilities.js +13 -9
- package/lib/data/utilities/ZoneUtilities.js +17 -13
- package/lib/data/utilities/calculateSanPlot.d.ts +8 -0
- package/lib/data/utilities/calculateSanPlot.js +31 -0
- package/lib/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib/data/utilities/generateChar.js +8 -6
- package/lib/data/utilities/getAtom.js +1 -1
- package/lib/data/utilities/getAtomsFromMF.js +2 -2
- package/lib/data/utilities/getColor.js +3 -3
- package/lib/data/utilities/getSum.js +6 -3
- package/lib/types/NMRiumGeneralPreferences.d.ts +2 -2
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +16 -9
- package/lib-cjs/component/1d/LinesSeries.js +1 -1
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/XAxis.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib-cjs/component/1d/integral/IntegralIndicator.js +31 -0
- package/lib-cjs/component/1d/integral/IntegralResizable.js +74 -0
- package/lib-cjs/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib-cjs/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib-cjs/component/1d/ranges/Range.js +27 -50
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +2 -2
- package/lib-cjs/component/2d/Contours.js +60 -41
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/Left1DChart.js +1 -1
- package/lib-cjs/component/2d/Top1DChart.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +11 -14
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +5 -8
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib-cjs/component/NMRium.js +7 -7
- package/lib-cjs/component/SplitPaneWrapper.js +1 -1
- package/lib-cjs/component/assignment/actions/initAssignment.js +17 -17
- package/lib-cjs/component/assignment/index.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +3 -6
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/CheckBoxCell.js +1 -1
- package/lib-cjs/component/elements/ContextMenu.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +21 -8
- package/lib-cjs/component/elements/GroupPane.js +18 -0
- package/lib-cjs/component/elements/Input.js +7 -4
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/Label.js +1 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +2 -0
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +71 -37
- package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib-cjs/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib-cjs/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -2
- package/lib-cjs/component/elements/draggble/useDraggable.js +1 -3
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +4 -7
- package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib-cjs/component/elements/formik/FormikForm.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +12 -20
- package/lib-cjs/component/elements/formik/FormikOnChange.js +13 -10
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSlider.js +7 -10
- package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
- package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +8 -8
- package/lib-cjs/component/elements/popup/Alert/index.js +5 -5
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +16 -31
- package/lib-cjs/component/elements/popup/Modal/index.js +7 -7
- package/lib-cjs/component/header/Header.js +1 -1
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib-cjs/component/hooks/useCombinedRefs.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +14 -11
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +9 -7
- package/lib-cjs/component/loader/DropZone.js +10 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib-cjs/component/modal/PredictSpectraModal.js +5 -5
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib-cjs/component/modal/setting/GeneralSettings.js +11 -14
- package/lib-cjs/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +37 -49
- package/lib-cjs/component/modal/setting/settingsValidation.js +14 -12
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib-cjs/component/panels/InformationPanel.js +51 -55
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -25
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +3 -3
- package/lib-cjs/component/reducer/Reducer.js +12 -11
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +52 -69
- package/lib-cjs/component/reducer/actions/FiltersActions.js +15 -6
- package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
- package/lib-cjs/component/reducer/actions/PeaksActions.js +7 -6
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib-cjs/component/reducer/actions/RangesActions.js +28 -24
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +12 -5
- package/lib-cjs/component/reducer/actions/ToolsActions.js +28 -41
- package/lib-cjs/component/reducer/actions/ZonesActions.js +11 -10
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib-cjs/component/reducer/helper/getActiveSpectrum.js +8 -0
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -5
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +5 -9
- package/lib-cjs/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib-cjs/component/tool/BrushX.js +3 -3
- package/lib-cjs/component/tool/BrushXY.js +5 -5
- package/lib-cjs/component/tool/CrossLinePointer.js +3 -3
- package/lib-cjs/component/toolbar/BasicToolBar.js +8 -7
- package/lib-cjs/component/utility/Evaluate.js +2 -2
- package/lib-cjs/component/utility/FileUtility.js +11 -29
- package/lib-cjs/component/utility/GroupByInfoKey.js +11 -13
- package/lib-cjs/component/utility/PathBuilder.js +1 -1
- package/lib-cjs/component/utility/PreferencesHelper.js +2 -3
- package/lib-cjs/component/utility/{Export.js → export.js} +78 -74
- package/lib-cjs/component/utility/formatNumber.js +5 -4
- package/lib-cjs/component/workspaces/exercise.js +4 -4
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib-cjs/data/Filters.js +17 -35
- package/lib-cjs/data/FiltersManager.js +4 -3
- package/lib-cjs/data/PredictionManager.js +8 -10
- package/lib-cjs/data/SpectraManager.js +26 -62
- package/lib-cjs/data/data1d/MultipleAnalysis.js +74 -70
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/index.js +25 -25
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib-cjs/data/data1d/database.js +45 -28
- package/lib-cjs/data/data1d/filter1d/apodization.js +2 -1
- package/lib-cjs/data/data1d/filter1d/fft.js +23 -6
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +10 -4
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Processing2D.js +10 -20
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +138 -0
- package/lib-cjs/data/data2d/Spectrum2D/index.js +11 -11
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/RangeUtilities.js +13 -9
- package/lib-cjs/data/utilities/ZoneUtilities.js +17 -13
- package/lib-cjs/data/utilities/calculateSanPlot.js +35 -0
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib-cjs/data/utilities/generateChar.js +8 -6
- package/lib-cjs/data/utilities/getAtom.js +1 -1
- package/lib-cjs/data/utilities/getAtomsFromMF.js +2 -2
- package/lib-cjs/data/utilities/getColor.js +3 -3
- package/lib-cjs/data/utilities/getSum.js +6 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +36 -31
- package/lib/component/1d/IntegralResizable.js +0 -72
- package/lib/component/elements/popup/helpers.d.ts +0 -1
- package/lib/component/elements/popup/helpers.js +0 -9
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.js +0 -8
- package/lib/data/data1d/Data1DManager.d.ts +0 -3
- package/lib/data/data1d/Data1DManager.js +0 -98
- package/lib/data/data1d/filter1d/absolute.d.ts +0 -13
- package/lib/data/data1d/filter1d/absolute.js +0 -26
- package/lib/data/data2d/Data2DManager.d.ts +0 -3
- package/lib/data/data2d/Data2DManager.js +0 -34
- package/lib/data/types/data2d/Contour.d.ts +0 -4
- package/lib/data/types/data2d/Contour.js +0 -1
- package/lib/data/types/data2d/Contours.d.ts +0 -2
- package/lib/data/types/data2d/Contours.js +0 -1
- package/lib-cjs/component/1d/IntegralResizable.js +0 -77
- package/lib-cjs/component/elements/popup/helpers.js +0 -13
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +0 -14
- package/lib-cjs/data/data1d/Data1DManager.js +0 -104
- package/lib-cjs/data/data1d/filter1d/absolute.js +0 -32
- package/lib-cjs/data/data2d/Data2DManager.js +0 -40
- package/lib-cjs/data/types/data2d/Contour.js +0 -2
- package/lib-cjs/data/types/data2d/Contours.js +0 -2
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
interface FormatOptions {
|
|
2
|
+
prefix?: string;
|
|
3
|
+
suffix?: string;
|
|
4
|
+
defaultFormat?: string;
|
|
5
|
+
}
|
|
6
|
+
declare function formatNumber(value: string | number, format: string | undefined, options?: FormatOptions): string;
|
|
2
7
|
declare function getNumberOfDecimals(value: number | string): number;
|
|
3
8
|
export { formatNumber, getNumberOfDecimals };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import numeral from 'numeral';
|
|
2
|
-
function formatNumber(value, format,
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
function formatNumber(value, format, options = {}) {
|
|
3
|
+
const { prefix = '', suffix = '', defaultFormat = '0.00' } = options;
|
|
4
|
+
return typeof value === 'number' || !Number.isNaN(Number(value))
|
|
5
|
+
? prefix + numeral(value).format(format || defaultFormat) + suffix
|
|
5
6
|
: value;
|
|
6
7
|
}
|
|
7
8
|
function getNumberOfDecimals(value) {
|
|
8
9
|
value = String(value).trim();
|
|
9
10
|
const lastIndex = value.lastIndexOf('.');
|
|
10
|
-
return lastIndex > 0 ? value.
|
|
11
|
+
return lastIndex > 0 ? value.slice(lastIndex).split('').length - 1 : 0;
|
|
11
12
|
}
|
|
12
13
|
export { formatNumber, getNumberOfDecimals };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const exercise = {
|
|
2
|
-
version:
|
|
2
|
+
version: 2,
|
|
3
3
|
label: 'Exercise',
|
|
4
4
|
display: {
|
|
5
5
|
general: {
|
|
@@ -10,17 +10,17 @@ export const exercise = {
|
|
|
10
10
|
integralsPanel: { display: true },
|
|
11
11
|
},
|
|
12
12
|
toolBarButtons: {
|
|
13
|
-
|
|
13
|
+
zoom: true,
|
|
14
|
+
zoomOut: true,
|
|
14
15
|
apodization: true,
|
|
15
16
|
zeroFilling: true,
|
|
16
17
|
fastFourierTransform: true,
|
|
17
18
|
phaseCorrection: true,
|
|
18
19
|
baselineCorrection: true,
|
|
20
|
+
peakPicking: true,
|
|
19
21
|
integral: true,
|
|
20
22
|
spectraCenterAlignments: true,
|
|
21
23
|
spectraStackAlignments: true,
|
|
22
|
-
zoomOut: true,
|
|
23
|
-
zoom: true,
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
};
|
package/lib/data/Filters.d.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import * as shift2DY from './data2d/filter2d/shiftY';
|
|
18
|
-
export { absolute, baselineCorrection, apodization, fft, phaseCorrection, autoPhaseCorrection, shiftX, zeroFilling, digitalFilter, fromTo, equallySpaced, standardDeviation, centerMean, pareto, exclusionZones, shift2DX, shift2DY, };
|
|
1
|
+
export * as apodization from './data1d/filter1d/apodization';
|
|
2
|
+
export * as autoPhaseCorrection from './data1d/filter1d/autoPhaseCorrection';
|
|
3
|
+
export * as baselineCorrection from './data1d/filter1d/baselineCorrection';
|
|
4
|
+
export * as centerMean from './data1d/filter1d/centerMean';
|
|
5
|
+
export * as digitalFilter from './data1d/filter1d/digitalFilter';
|
|
6
|
+
export * as equallySpaced from './data1d/filter1d/equallySpaced';
|
|
7
|
+
export * as exclusionZones from './data1d/filter1d/exclusionZones';
|
|
8
|
+
export * as fft from './data1d/filter1d/fft';
|
|
9
|
+
export * as fromTo from './data1d/filter1d/fromTo';
|
|
10
|
+
export * as pareto from './data1d/filter1d/pareto';
|
|
11
|
+
export * as phaseCorrection from './data1d/filter1d/phaseCorrection';
|
|
12
|
+
export * as shiftX from './data1d/filter1d/shiftX';
|
|
13
|
+
export * as standardDeviation from './data1d/filter1d/standardDeviation';
|
|
14
|
+
export * as zeroFilling from './data1d/filter1d/zeroFilling';
|
|
15
|
+
export * as shift2DX from './data2d/filter2d/shiftX';
|
|
16
|
+
export * as shift2DY from './data2d/filter2d/shiftY';
|
package/lib/data/Filters.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import * as shift2DY from './data2d/filter2d/shiftY';
|
|
18
|
-
export { absolute, baselineCorrection, apodization, fft, phaseCorrection, autoPhaseCorrection, shiftX, zeroFilling, digitalFilter, fromTo, equallySpaced, standardDeviation, centerMean, pareto, exclusionZones, shift2DX, shift2DY, };
|
|
1
|
+
export * as apodization from './data1d/filter1d/apodization';
|
|
2
|
+
export * as autoPhaseCorrection from './data1d/filter1d/autoPhaseCorrection';
|
|
3
|
+
export * as baselineCorrection from './data1d/filter1d/baselineCorrection';
|
|
4
|
+
export * as centerMean from './data1d/filter1d/centerMean';
|
|
5
|
+
export * as digitalFilter from './data1d/filter1d/digitalFilter';
|
|
6
|
+
export * as equallySpaced from './data1d/filter1d/equallySpaced';
|
|
7
|
+
export * as exclusionZones from './data1d/filter1d/exclusionZones';
|
|
8
|
+
export * as fft from './data1d/filter1d/fft';
|
|
9
|
+
export * as fromTo from './data1d/filter1d/fromTo';
|
|
10
|
+
export * as pareto from './data1d/filter1d/pareto';
|
|
11
|
+
export * as phaseCorrection from './data1d/filter1d/phaseCorrection';
|
|
12
|
+
export * as shiftX from './data1d/filter1d/shiftX';
|
|
13
|
+
export * as standardDeviation from './data1d/filter1d/standardDeviation';
|
|
14
|
+
export * as zeroFilling from './data1d/filter1d/zeroFilling';
|
|
15
|
+
export * as shift2DX from './data2d/filter2d/shiftX';
|
|
16
|
+
export * as shift2DY from './data2d/filter2d/shiftY';
|
|
@@ -14,6 +14,7 @@ function applyFilter(datum, filters = []) {
|
|
|
14
14
|
};
|
|
15
15
|
const previousFilter = lookupForFilter(datum, filter.name);
|
|
16
16
|
if (previousFilter) {
|
|
17
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
17
18
|
const reduceResult = Filters[filter.name].reduce(previousFilter.value, filterOption.value);
|
|
18
19
|
if (reduceResult.once) {
|
|
19
20
|
if (!isReduced) {
|
|
@@ -60,7 +61,7 @@ function lookupForFilter(datum, filterName) {
|
|
|
60
61
|
return datum.filters.find((f) => f.name === filterName);
|
|
61
62
|
}
|
|
62
63
|
function reapplyFilters(datum, filters = null) {
|
|
63
|
-
const _filters = filters
|
|
64
|
+
const _filters = filters || datum.filters;
|
|
64
65
|
enableFilter(datum, null, null, _filters);
|
|
65
66
|
}
|
|
66
67
|
// id filter id
|
|
@@ -69,11 +70,11 @@ function enableFilter(datum, id, checked, filters = null) {
|
|
|
69
70
|
if (id) {
|
|
70
71
|
datum.filters = datum.filters.map((filter) => {
|
|
71
72
|
return { ...filter, flag: filter.id === id ? checked : filter.flag };
|
|
72
|
-
}
|
|
73
|
+
});
|
|
73
74
|
}
|
|
74
75
|
datum.data = { ...datum.data, ...datum.originalData };
|
|
75
76
|
datum.info = { ...datum.info, ...datum.originalInfo };
|
|
76
|
-
const _filters = filters
|
|
77
|
+
const _filters = filters || datum.filters;
|
|
77
78
|
for (let filterIndex in _filters) {
|
|
78
79
|
const filter = datum.filters[filterIndex];
|
|
79
80
|
datum.filters[filterIndex] = {
|
|
@@ -115,27 +115,25 @@ function generated1DSpectrum(params) {
|
|
|
115
115
|
return datum;
|
|
116
116
|
}
|
|
117
117
|
function mapZones(zones) {
|
|
118
|
-
return zones.
|
|
118
|
+
return zones.map((zone) => {
|
|
119
119
|
const { signals, ...resZone } = zone;
|
|
120
|
-
const newSignals = signals.
|
|
120
|
+
const newSignals = signals.map((signal) => {
|
|
121
121
|
const { x, y, id, ...resSignal } = signal;
|
|
122
|
-
|
|
122
|
+
return {
|
|
123
123
|
id: id || v4(),
|
|
124
124
|
kind: 'signal',
|
|
125
125
|
x: { ...x, originDelta: x.delta || 0 },
|
|
126
126
|
y: { ...y, originDelta: y.delta || 0 },
|
|
127
127
|
...resSignal,
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
zonesAcc.push({
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
return {
|
|
132
131
|
id: v4(),
|
|
133
132
|
...resZone,
|
|
134
133
|
signals: newSignals,
|
|
135
134
|
kind: DatumKind.signal,
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
}, []);
|
|
135
|
+
};
|
|
136
|
+
});
|
|
139
137
|
}
|
|
140
138
|
function generated2DSpectrum(params) {
|
|
141
139
|
const { spectrum, inputOptions, experiment, color } = params;
|
|
@@ -6,8 +6,7 @@ export declare enum DataExportOptions {
|
|
|
6
6
|
}
|
|
7
7
|
export declare type DataExportOptionsType = keyof typeof DataExportOptions;
|
|
8
8
|
export declare function addJcampFromURL(spectra: any, jcampURL: any, options: any, usedColors: any): Promise<void>;
|
|
9
|
-
export declare function addJcamp(
|
|
10
|
-
export declare function fromJSON(data?: any[], usedColors?: any): Promise<any[]>;
|
|
9
|
+
export declare function addJcamp(output: any, jcamp: any, options: any, usedColors: any): void;
|
|
11
10
|
export declare function addJcamps(files: any, usedColors: any): never[];
|
|
12
11
|
/**
|
|
13
12
|
*
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { CURRENT_EXPORT_VERSION } from 'nmr-load-save';
|
|
2
|
-
import { fromJCAMP } from 'nmr-parser';
|
|
1
|
+
import { CURRENT_EXPORT_VERSION, processJcamp } from 'nmr-load-save';
|
|
3
2
|
import { DISPLAYER_MODE } from '../component/reducer/core/Constants';
|
|
4
|
-
import * as Data1DManager from './data1d/Data1DManager';
|
|
5
3
|
import * as Datum1D from './data1d/Spectrum1D';
|
|
6
|
-
import * as Data2DManager from './data2d/Data2DManager';
|
|
7
4
|
import * as Datum2D from './data2d/Spectrum2D';
|
|
8
5
|
import * as Molecule from './molecules/Molecule';
|
|
9
6
|
export var DataExportOptions;
|
|
@@ -11,6 +8,15 @@ export var DataExportOptions;
|
|
|
11
8
|
DataExportOptions["ROW_DATA"] = "ROW_DATA";
|
|
12
9
|
DataExportOptions["DATA_SOURCE"] = "DATA_SOURCE";
|
|
13
10
|
})(DataExportOptions || (DataExportOptions = {}));
|
|
11
|
+
function getData(datum, usedColors) {
|
|
12
|
+
const dimension = datum.info.dimension;
|
|
13
|
+
if (dimension === 1) {
|
|
14
|
+
return Datum1D.initiateDatum1D(datum, usedColors);
|
|
15
|
+
}
|
|
16
|
+
else if (dimension === 2) {
|
|
17
|
+
return Datum2D.initiateDatum2D(datum, usedColors);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
14
20
|
export function addJcampFromURL(spectra, jcampURL, options, usedColors) {
|
|
15
21
|
return fetch(jcampURL)
|
|
16
22
|
.then((response) => response.arrayBuffer())
|
|
@@ -18,65 +24,26 @@ export function addJcampFromURL(spectra, jcampURL, options, usedColors) {
|
|
|
18
24
|
addJcamp(spectra, jcamp, options, usedColors);
|
|
19
25
|
});
|
|
20
26
|
}
|
|
21
|
-
export function addJcamp(
|
|
27
|
+
export function addJcamp(output, jcamp, options, usedColors) {
|
|
22
28
|
options = options || {};
|
|
23
|
-
const
|
|
24
|
-
|
|
29
|
+
const name = options?.display?.name;
|
|
30
|
+
const { spectra: spectraIn } = processJcamp(jcamp, {
|
|
31
|
+
name,
|
|
32
|
+
noContours: true,
|
|
25
33
|
xy: true,
|
|
26
34
|
keepRecordsRegExp: /.*/,
|
|
27
35
|
profiling: true,
|
|
28
36
|
});
|
|
29
|
-
if (
|
|
37
|
+
if (spectraIn.length === 0)
|
|
30
38
|
return;
|
|
31
|
-
// Should be improved when we have a more complex case
|
|
32
|
-
for (let index = 0; index < entries.length; index++) {
|
|
33
|
-
let entry = entries[index];
|
|
34
|
-
const components = entry.dependentVariables?.[0]?.components;
|
|
35
|
-
if (components && (components.length > 0 || components.z)) {
|
|
36
|
-
addJcampSS(spectra, { index, entry }, options, usedColors);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function addJcampSS(spectra, jcampDatum, options, usedColors) {
|
|
41
|
-
const source = options?.source || {};
|
|
42
|
-
if (!('jcampSpectrumIndex' in source) ||
|
|
43
|
-
source.jcampSpectrumIndex === jcampDatum.index) {
|
|
44
|
-
const dimension = jcampDatum.entry.info.dimension;
|
|
45
|
-
if (dimension === 1) {
|
|
46
|
-
spectra.push(Data1DManager.fromParsedJcamp(jcampDatum.entry, options, usedColors, jcampDatum.index));
|
|
47
|
-
}
|
|
48
|
-
if (dimension === 2) {
|
|
49
|
-
// console.log(options, jcampDatum.entry);
|
|
50
|
-
spectra.push(Data2DManager.fromParsedJcamp(jcampDatum.entry, options, usedColors, jcampDatum.index));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function addData(spectra, datum, usedColors) {
|
|
55
|
-
const dimension = datum.info.dimension;
|
|
56
|
-
if (dimension === 1) {
|
|
57
|
-
spectra.push(Datum1D.initiateDatum1D(datum, usedColors));
|
|
58
|
-
}
|
|
59
|
-
if (dimension === 2) {
|
|
60
|
-
spectra.push(Datum2D.initiateDatum2D(datum, usedColors));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
export async function fromJSON(data = [], usedColors = {}) {
|
|
64
39
|
const spectra = [];
|
|
65
|
-
let
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
else if (jcampURL != null) {
|
|
72
|
-
promises.push(addJcampFromURL(spectra, jcampURL, datum, usedColors));
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
addData(spectra, datum, usedColors);
|
|
76
|
-
}
|
|
40
|
+
for (let spectrum of spectraIn) {
|
|
41
|
+
const data = getData(spectrum, usedColors);
|
|
42
|
+
if (!data)
|
|
43
|
+
continue;
|
|
44
|
+
spectra.push(data);
|
|
77
45
|
}
|
|
78
|
-
|
|
79
|
-
return spectra;
|
|
46
|
+
output.push(...spectra);
|
|
80
47
|
}
|
|
81
48
|
export function addJcamps(files, usedColors) {
|
|
82
49
|
const spectra = [];
|
|
@@ -86,7 +53,7 @@ export function addJcamps(files, usedColors) {
|
|
|
86
53
|
name: file.name,
|
|
87
54
|
},
|
|
88
55
|
source: {
|
|
89
|
-
jcampURL: file.jcampURL
|
|
56
|
+
jcampURL: file.jcampURL || null,
|
|
90
57
|
file,
|
|
91
58
|
},
|
|
92
59
|
}, usedColors);
|
|
@@ -94,12 +61,10 @@ export function addJcamps(files, usedColors) {
|
|
|
94
61
|
return spectra;
|
|
95
62
|
}
|
|
96
63
|
function getPreferences(state) {
|
|
97
|
-
const { activeTab, verticalAlign: { align }, } = state;
|
|
64
|
+
const { activeTab, verticalAlign: { align }, displayerMode, } = state;
|
|
98
65
|
return {
|
|
99
66
|
activeTab,
|
|
100
|
-
...(
|
|
101
|
-
? { verticalAlign: align }
|
|
102
|
-
: {}),
|
|
67
|
+
...(displayerMode === DISPLAYER_MODE.DM_1D ? { verticalAlign: align } : {}),
|
|
103
68
|
};
|
|
104
69
|
}
|
|
105
70
|
export function toJSON(state, target, dataExportOption = DataExportOptions.DATA_SOURCE) {
|
|
@@ -14,9 +14,8 @@ export var COLUMNS_VALUES_KEYS;
|
|
|
14
14
|
COLUMNS_VALUES_KEYS["MAX"] = "max";
|
|
15
15
|
})(COLUMNS_VALUES_KEYS || (COLUMNS_VALUES_KEYS = {}));
|
|
16
16
|
function addColumnKey(spectraAnalysis, nucleus, columnProps, columnKey) {
|
|
17
|
-
const key = columnKey
|
|
18
|
-
|
|
19
|
-
: generateChar(spectraAnalysis[nucleus].options.columnIndex).toUpperCase();
|
|
17
|
+
const key = columnKey ||
|
|
18
|
+
generateChar(spectraAnalysis[nucleus].options.columnIndex).toUpperCase();
|
|
20
19
|
spectraAnalysis[nucleus].options.columns[key] = columnProps;
|
|
21
20
|
spectraAnalysis[nucleus].options.columnIndex++;
|
|
22
21
|
return key;
|
|
@@ -29,16 +28,20 @@ export function getValue(colKey, columns, data) {
|
|
|
29
28
|
}
|
|
30
29
|
export function getSpectraAnalysis(spectra, options) {
|
|
31
30
|
const { from, to, nucleus } = options;
|
|
32
|
-
|
|
31
|
+
const result = {
|
|
32
|
+
values: [],
|
|
33
|
+
sum: 0,
|
|
34
|
+
};
|
|
35
|
+
for (const datum of spectra) {
|
|
33
36
|
if (isSpectrum1D(datum) &&
|
|
34
37
|
datum.info.nucleus === nucleus &&
|
|
35
38
|
!datum.info.isFid) {
|
|
36
39
|
const range = detectRange(datum, { from, to });
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
result.sum += range.absolute;
|
|
41
|
+
result.values.push({ SID: datum.id, ...range });
|
|
39
42
|
}
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
42
45
|
}
|
|
43
46
|
function init(spectraAnalysis, nucleus) {
|
|
44
47
|
if (spectraAnalysis[nucleus] === undefined) {
|
|
@@ -60,61 +63,61 @@ export function changeColumnValueKey(spectraAnalysis, nucleus, columnKey, newKey
|
|
|
60
63
|
export function setColumn(spectraAnalysis, nucleus, { columns: inputColumns, code }) {
|
|
61
64
|
init(spectraAnalysis, nucleus);
|
|
62
65
|
spectraAnalysis[nucleus].options.code = code;
|
|
63
|
-
|
|
66
|
+
const columns = Object.fromEntries(Object.values(inputColumns).map((value) => {
|
|
64
67
|
const data = { ...value };
|
|
65
68
|
delete data.tempKey;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
return [value.tempKey, data];
|
|
70
|
+
}));
|
|
71
|
+
spectraAnalysis[nucleus].options.columns = columns;
|
|
69
72
|
const { columns: newColumns } = spectraAnalysis[nucleus].options;
|
|
70
|
-
let data = Object.entries(spectraAnalysis[nucleus].values).
|
|
71
|
-
|
|
73
|
+
let data = Object.fromEntries(Object.entries(spectraAnalysis[nucleus].values).map(([spectraKey, spectra]) => {
|
|
74
|
+
const result = Object.fromEntries(Object.keys(inputColumns)
|
|
75
|
+
.filter((k) => spectra[k])
|
|
76
|
+
.map((key) => {
|
|
72
77
|
const newKey = inputColumns[key].tempKey;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}, {});
|
|
80
|
-
data = Object.entries(data).reduce((acc, spectra) => {
|
|
81
|
-
acc[spectra[0]] = Object.keys(newColumns).reduce((acc, key) => {
|
|
78
|
+
return [newKey, spectra[key]];
|
|
79
|
+
}));
|
|
80
|
+
return [spectraKey, result];
|
|
81
|
+
}));
|
|
82
|
+
const newData = Object.fromEntries(Object.entries(data).map((spectra) => {
|
|
83
|
+
const result = Object.fromEntries(Object.keys(newColumns).map((key) => {
|
|
82
84
|
const isFormula = newColumns[key].type === COLUMNS_TYPES.FORMULA;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
return [
|
|
86
|
+
key,
|
|
87
|
+
isFormula
|
|
88
|
+
? {
|
|
89
|
+
colKey: key,
|
|
90
|
+
value: calculate(newColumns, data[spectra[0]], newColumns[key].formula),
|
|
91
|
+
}
|
|
92
|
+
: { ...spectra[1][key], colKey: key },
|
|
93
|
+
];
|
|
94
|
+
}));
|
|
95
|
+
return [spectra[0], result];
|
|
96
|
+
}));
|
|
97
|
+
data = newData;
|
|
93
98
|
spectraAnalysis[nucleus].values = data;
|
|
94
99
|
}
|
|
95
100
|
function refreshByRow(row, columns) {
|
|
96
|
-
return Object.keys(columns)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
return Object.fromEntries(Object.keys(columns)
|
|
102
|
+
.filter((k) => columns[k].type === COLUMNS_TYPES.FORMULA)
|
|
103
|
+
.map((key) => [
|
|
104
|
+
key,
|
|
105
|
+
{
|
|
106
|
+
colKey: key,
|
|
107
|
+
...row,
|
|
108
|
+
value: calculate(columns, row, columns[key].formula),
|
|
109
|
+
},
|
|
110
|
+
]));
|
|
106
111
|
}
|
|
107
112
|
function refreshCalculation(spectraAnalysis, nucleus) {
|
|
108
113
|
const { columns } = spectraAnalysis[nucleus].options;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
return Object.fromEntries(Object.entries(spectraAnalysis[nucleus].values).map(([id, row]) => [
|
|
115
|
+
id,
|
|
116
|
+
{
|
|
112
117
|
...row,
|
|
113
118
|
...refreshByRow(row, columns),
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
}, {});
|
|
117
|
-
return data;
|
|
119
|
+
},
|
|
120
|
+
]));
|
|
118
121
|
}
|
|
119
122
|
export function analyzeSpectra(spectra, spectraAnalysis, options) {
|
|
120
123
|
const { from, to, nucleus, columnKey = null } = options;
|
|
@@ -133,31 +136,33 @@ export function analyzeSpectra(spectra, spectraAnalysis, options) {
|
|
|
133
136
|
nucleus,
|
|
134
137
|
});
|
|
135
138
|
const prevNucleusData = lodashGet(spectraAnalysis, `${nucleus}.values`, {});
|
|
136
|
-
|
|
137
|
-
const factor = spectraSum > 0 ? sum / spectraSum : 0
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
const data = Object.fromEntries(result.map((row) => {
|
|
140
|
+
const factor = spectraSum > 0 ? sum / spectraSum : 0;
|
|
141
|
+
return [
|
|
142
|
+
row.SID,
|
|
143
|
+
{
|
|
144
|
+
...prevNucleusData[row.SID],
|
|
145
|
+
[colKey]: {
|
|
146
|
+
colKey,
|
|
147
|
+
...row,
|
|
148
|
+
relative: Math.abs(row.absolute) * factor,
|
|
149
|
+
},
|
|
144
150
|
},
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}, {});
|
|
151
|
+
];
|
|
152
|
+
}));
|
|
148
153
|
spectraAnalysis[nucleus].values = data;
|
|
149
154
|
spectraAnalysis[nucleus].values = refreshCalculation(spectraAnalysis, nucleus);
|
|
150
155
|
}
|
|
151
156
|
export function deleteSpectraAnalysis(spectraAnalysis, colKey, nucleus) {
|
|
152
|
-
const result =
|
|
157
|
+
const result = {};
|
|
158
|
+
const analyses = Object.entries(spectraAnalysis[nucleus].values);
|
|
159
|
+
for (const item of analyses) {
|
|
153
160
|
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
154
161
|
delete item[1][colKey];
|
|
155
162
|
if (item[1] && Object.keys(item[1]).length > 0) {
|
|
156
|
-
|
|
157
|
-
return acc;
|
|
163
|
+
result[item[0]] = item[1];
|
|
158
164
|
}
|
|
159
|
-
|
|
160
|
-
}, {});
|
|
165
|
+
}
|
|
161
166
|
const { [colKey]: deletedColumnKey, ...resColumns } = spectraAnalysis[nucleus].options.columns;
|
|
162
167
|
const currentColumns = Object.keys(spectraAnalysis[nucleus].options.columns);
|
|
163
168
|
if (currentColumns.length === 1) {
|
|
@@ -168,7 +173,7 @@ export function deleteSpectraAnalysis(spectraAnalysis, colKey, nucleus) {
|
|
|
168
173
|
spectraAnalysis[nucleus].values = refreshCalculation(spectraAnalysis, nucleus);
|
|
169
174
|
}
|
|
170
175
|
function calculate(columns, data, formula = '') {
|
|
171
|
-
const array = formula.split(
|
|
176
|
+
const array = formula.split(/[%()*+/-]/);
|
|
172
177
|
const variables = [];
|
|
173
178
|
for (const col of array) {
|
|
174
179
|
const column = col.trim();
|
|
@@ -182,9 +187,8 @@ function calculate(columns, data, formula = '') {
|
|
|
182
187
|
// eslint-disable-next-line no-new-func
|
|
183
188
|
result = new Function(...variables, `return ${formula}`)(...params);
|
|
184
189
|
}
|
|
185
|
-
catch (
|
|
186
|
-
|
|
187
|
-
console.error(e);
|
|
190
|
+
catch (error) {
|
|
191
|
+
reportError(error);
|
|
188
192
|
result = new Error(`Invalid Formula ( ${formula} ) `);
|
|
189
193
|
}
|
|
190
194
|
return result;
|
|
@@ -22,7 +22,7 @@ export function getSum(mf, nucleus) {
|
|
|
22
22
|
return defaultSum;
|
|
23
23
|
const atom = getAtom(nucleus);
|
|
24
24
|
const atoms = getAtoms(mf);
|
|
25
|
-
return atoms[atom]
|
|
25
|
+
return atoms[atom] || defaultSum;
|
|
26
26
|
}
|
|
27
27
|
export function setSumOptions(data, params) {
|
|
28
28
|
const { nucleus, options } = params;
|
|
@@ -18,7 +18,7 @@ export default function generateJGraphData(ranges, jGraphTolerance) {
|
|
|
18
18
|
return { signals, jCouplingMax, links };
|
|
19
19
|
}
|
|
20
20
|
function getJsCouplingMax(js) {
|
|
21
|
-
let max =
|
|
21
|
+
let max = Number.NEGATIVE_INFINITY;
|
|
22
22
|
for (const { coupling } of js) {
|
|
23
23
|
max = coupling > max ? coupling : max;
|
|
24
24
|
}
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export { initiateDatum1D, toJSON, autoPeakPicking, optimizePeaks, getShiftX, lookupPeak, checkRangeKind, checkIntegralKind, isSpectrum1D, generateSpectrumFromPublicationString, getReferenceShift, updateIntegralsRelativeValues, updateRangesRelativeValues, changeIntegralsRelative, addRange, changeRangeSignal, detectRanges, detectRange, changeRange, changeRangeRelativeValue, updateXShift, mapRanges, generateSpectrumFromRanges, get1DDataXY, };
|
|
1
|
+
export { generateSpectrumFromPublicationString } from './generateSpectrumFromPublicationString';
|
|
2
|
+
export { get1DDataXY } from './get1DDataXY';
|
|
3
|
+
export { getReferenceShift } from './getReferenceShift';
|
|
4
|
+
export { initiateDatum1D } from './initiateDatum1D';
|
|
5
|
+
export { changeIntegralsRelative } from './integrals/changeIntegralsRelative';
|
|
6
|
+
export { checkIntegralKind } from './integrals/checkIntegralKind';
|
|
7
|
+
export { updateIntegralsRelativeValues } from './integrals/updateIntegralsRelativeValues';
|
|
8
|
+
export { isSpectrum1D } from './isSpectrum1D';
|
|
9
|
+
export { autoPeakPicking } from './peaks/autoPeakPicking';
|
|
10
|
+
export { lookupPeak } from './peaks/lookupPeak';
|
|
11
|
+
export { optimizePeaks } from './peaks/optimizePeaks';
|
|
12
|
+
export { addRange } from './ranges/addRange';
|
|
13
|
+
export { changeRange } from './ranges/changeRange';
|
|
14
|
+
export { changeRangeRelativeValue } from './ranges/changeRangeRelativeValue';
|
|
15
|
+
export { changeRangeSignal } from './ranges/changeRangeSignal';
|
|
16
|
+
export { checkRangeKind } from './ranges/checkRangeKind';
|
|
17
|
+
export { detectRange } from './ranges/detectRange';
|
|
18
|
+
export { detectRanges } from './ranges/detectRanges';
|
|
19
|
+
export { generateSpectrumFromRanges } from './ranges/generateSpectrumFromRanges';
|
|
20
|
+
export { mapRanges } from './ranges/mapRanges';
|
|
21
|
+
export { updateRangesRelativeValues } from './ranges/updateRangesRelativeValues';
|
|
22
|
+
export { getShiftX } from './shift/getShiftX';
|
|
23
|
+
export { updateXShift } from './shift/updateXShift';
|
|
24
|
+
export { toJSON } from './toJSON';
|