nmrium 0.29.0 → 0.31.0
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/README.md +12 -2
- package/lib/component/1d/ApodizationLine.d.ts +3 -0
- package/lib/component/1d/ApodizationLine.js +49 -0
- package/lib/component/1d/Chart1D.js +4 -2
- package/lib/component/1d/ExclusionZoneAnnotation.d.ts +1 -1
- package/lib/component/1d/ExclusionZoneAnnotation.js +14 -7
- package/lib/component/1d/FooterBanner.js +3 -1
- package/lib/component/1d/IntegralResizable.js +5 -4
- package/lib/component/1d/IntegralsSeries.js +3 -1
- package/lib/component/1d/LinesSeries.js +7 -5
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +10 -13
- package/lib/component/1d/database/DatabaseElements.js +2 -2
- package/lib/component/1d/database/DatabaseSpectrum.js +3 -3
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +3 -3
- package/lib/component/1d/jCouplingGraph/JGraph.js +5 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +16 -14
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +6 -5
- package/lib/component/1d/{PeakAnnotation.d.ts → peaks/PeakAnnotation.d.ts} +1 -2
- package/lib/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib/component/1d/{PeakAnnotations.d.ts → peaks/PeakAnnotations.d.ts} +0 -0
- package/lib/component/1d/peaks/PeakAnnotations.js +28 -0
- package/lib/component/1d/peaks/PeaksShapes.d.ts +3 -0
- package/lib/component/1d/peaks/PeaksShapes.js +37 -0
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +13 -0
- package/lib/component/1d/peaks/usePeakShapesPath.js +49 -0
- package/lib/component/1d/ranges/Range.js +4 -4
- package/lib/component/1d/ranges/Ranges.js +8 -2
- package/lib/component/1d/tool/PeakPointer.js +3 -1
- package/lib/component/1d/tool/XLabelPointer.js +3 -1
- package/lib/component/2d/Contours.js +3 -1
- package/lib/component/2d/FooterBanner.js +5 -3
- package/lib/component/2d/Viewer2D.js +6 -6
- package/lib/component/2d/XAxis.js +2 -2
- package/lib/component/2d/YAxis.js +2 -2
- package/lib/component/2d/tools/XYLabelPointer.js +3 -1
- package/lib/component/2d/tools/slicing/SlicingView.js +3 -1
- package/lib/component/2d/zones/IndicationLines.js +1 -1
- package/lib/component/2d/zones/Signal.d.ts +3 -2
- package/lib/component/2d/zones/Signal.js +3 -3
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/2d/zones/Zone.js +4 -4
- package/lib/component/2d/zones/Zones.js +14 -19
- package/lib/component/EventsTrackers/KeysListenerTracker.js +91 -52
- package/lib/component/NMRium.d.ts +2 -0
- package/lib/component/NMRium.js +14 -3
- package/lib/component/assignment/AssignmentsContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.js +3 -3
- package/lib/component/elements/ActiveButton.d.ts +17 -0
- package/lib/component/elements/ActiveButton.js +28 -0
- package/lib/component/elements/Button.d.ts +6 -6
- package/lib/component/elements/Button.js +5 -5
- package/lib/component/elements/ButtonToolTip.js +1 -1
- package/lib/component/elements/CheckBox.d.ts +2 -6
- package/lib/component/elements/CheckBox.js +4 -6
- package/lib/component/elements/Input.d.ts +5 -4
- package/lib/component/elements/Input.js +1 -1
- package/lib/component/elements/Label.d.ts +8 -6
- package/lib/component/elements/Label.js +3 -3
- package/lib/component/elements/MoleculeSelection.d.ts +2 -2
- package/lib/component/elements/MoleculeSelection.js +1 -1
- package/lib/component/elements/NextPrev.js +1 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
- package/lib/component/elements/Select.d.ts +7 -11
- package/lib/component/elements/Select.js +6 -8
- package/lib/component/elements/Tab/Tab.js +1 -1
- package/lib/component/elements/Table/Table.d.ts +1 -2
- package/lib/component/elements/Table/Table.js +2 -2
- package/lib/component/elements/ToggleButton.d.ts +1 -2
- package/lib/component/elements/ToggleButton.js +3 -2
- package/lib/component/elements/accordion/AccordionItem.js +2 -2
- package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.d.ts +3 -2
- package/lib/component/elements/formik/FormikOnChange.js +11 -5
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib/component/elements/popup/Modal/Provider.d.ts +3 -3
- package/lib/component/elements/popup/Modal/Provider.js +8 -11
- package/lib/component/elements/resizer/DivResizer.js +3 -3
- package/lib/component/elements/resizer/Resizer.d.ts +1 -0
- package/lib/component/elements/resizer/SVGResizer.js +3 -3
- package/lib/component/header/ApodizationOptionsPanel.d.ts +2 -0
- package/lib/component/header/ApodizationOptionsPanel.js +81 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +2 -1
- package/lib/component/header/AutoPeakPickingOptionPanel.js +40 -36
- package/lib/component/header/BaseLineCorrectionPanel.d.ts +1 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +84 -52
- package/lib/component/header/Header.js +5 -2
- package/lib/component/header/HeaderContainer.d.ts +7 -0
- package/lib/component/header/HeaderContainer.js +10 -0
- package/lib/component/header/ManualPhaseCorrectionPanel.js +27 -29
- package/lib/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib/component/header/ZeroFillingOptionsPanel.js +52 -47
- package/lib/component/header/Zones2DOptionPanel.js +11 -13
- package/lib/component/highlight/index.d.ts +27 -10
- package/lib/component/highlight/index.js +19 -17
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +10 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib/component/hooks/useDatumWithSpectraStatistics.js +3 -1
- package/lib/component/hooks/useExport.d.ts +0 -1
- package/lib/component/hooks/useExport.js +1 -17
- package/lib/component/hooks/useFilter.d.ts +1 -0
- package/lib/component/hooks/useFilter.js +7 -0
- package/lib/component/hooks/useIntegralPath.js +5 -2
- package/lib/component/hooks/useNucleus.js +4 -4
- package/lib/component/hooks/useSpectraPerNucleus.js +1 -1
- package/lib/component/hooks/useSpectrum.js +3 -1
- package/lib/component/hooks/useToolsFunctions.js +1 -1
- package/lib/component/loader/DropZone.js +8 -148
- package/lib/component/modal/AlignSpectraModal.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +9 -0
- package/lib/component/modal/EditPeakShapeModal.js +85 -0
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js +2 -3
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib/component/modal/PredictSpectraModal.js +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib/component/modal/changeSum/SelectMolecule.js +2 -2
- package/lib/component/modal/editRange/EditRangeModal.js +3 -3
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +4 -9
- package/lib/component/modal/setting/DatabasesTabContent.js +2 -2
- package/lib/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib/component/modal/setting/GeneralSettings.js +1 -1
- package/lib/component/modal/setting/ToolsTabContent.js +17 -13
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -2
- package/lib/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +5 -4
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +13 -10
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +4 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +5 -3
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +12 -4
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/Panels.js +3 -3
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +47 -22
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib/component/panels/PeaksPanel/PeaksTable.js +44 -13
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts +2 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +10 -9
- package/lib/component/panels/RangesPanel/RangesPanel.js +7 -3
- package/lib/component/panels/RangesPanel/RangesTableRow.js +4 -4
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +3 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +3 -3
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -1
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib/component/panels/SummaryPanel/utilities/useInView.js +3 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +19 -10
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -13
- package/lib/component/panels/databasePanel/DatabaseTable.js +3 -3
- package/lib/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.js +3 -12
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +2 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib/component/reducer/IgnoreActions.js +5 -0
- package/lib/component/reducer/Reducer.d.ts +141 -51
- package/lib/component/reducer/Reducer.js +69 -45
- package/lib/component/reducer/actions/DomainActions.d.ts +1 -1
- package/lib/component/reducer/actions/DomainActions.js +11 -9
- package/lib/component/reducer/actions/FiltersActions.d.ts +13 -7
- package/lib/component/reducer/actions/FiltersActions.js +326 -204
- package/lib/component/reducer/actions/IntegralsActions.js +15 -10
- package/lib/component/reducer/actions/LoadActions.d.ts +2 -5
- package/lib/component/reducer/actions/LoadActions.js +19 -34
- package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -1
- package/lib/component/reducer/actions/MoleculeActions.js +48 -19
- package/lib/component/reducer/actions/PeaksActions.d.ts +4 -1
- package/lib/component/reducer/actions/PeaksActions.js +52 -13
- package/lib/component/reducer/actions/PreferencesActions.js +8 -10
- package/lib/component/reducer/actions/RangesActions.d.ts +3 -3
- package/lib/component/reducer/actions/RangesActions.js +87 -29
- package/lib/component/reducer/actions/SpectraAnalysisAction.js +5 -5
- package/lib/component/reducer/actions/SpectrumsActions.js +14 -11
- package/lib/component/reducer/actions/ToolsActions.js +47 -95
- package/lib/component/reducer/actions/ZonesActions.d.ts +4 -1
- package/lib/component/reducer/actions/ZonesActions.js +68 -17
- package/lib/component/reducer/helper/Zoom1DManager.js +2 -1
- package/lib/component/reducer/helper/getActiveSpectrumOrFail.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrumOrFail.js +6 -0
- package/lib/component/reducer/helper/getSpectrum.js +3 -2
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +7 -0
- package/lib/component/reducer/helper/getStrongestPeak.js +15 -0
- package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +23 -15
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib/component/reducer/types/Types.d.ts +12 -0
- package/lib/component/reducer/types/Types.js +12 -0
- package/lib/component/tool/BrushX.js +1 -1
- package/lib/component/tool/BrushXY.js +4 -3
- package/lib/component/tool/CrossLinePointer.js +5 -4
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +8 -2
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +22 -7
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +3 -2
- package/lib/component/tool/FloatMoleculeStructures/index.js +19 -6
- package/lib/component/toolbar/BasicToolBar.js +7 -14
- package/lib/component/toolbar/FunctionToolBar.js +13 -23
- package/lib/component/toolbar/ToolTypes.d.ts +7 -1
- package/lib/component/toolbar/ToolTypes.js +119 -9
- package/lib/component/utility/assert.d.ts +1 -0
- package/lib/component/utility/assert.js +5 -0
- package/lib/component/workspaces/Workspace.d.ts +4 -1
- package/lib/component/workspaces/basic.js +12 -11
- package/lib/component/workspaces/embedded.js +14 -13
- package/lib/component/workspaces/exercise.js +10 -6
- package/lib/component/workspaces/prediction.js +14 -13
- package/lib/component/workspaces/process1D.js +20 -19
- package/lib/component/workspaces/workspaceDefaultProperties.js +14 -15
- package/lib/constants.js +1 -1
- package/lib/data/Filters.d.ts +2 -2
- package/lib/data/Filters.js +2 -2
- package/lib/data/FiltersManager.js +3 -3
- package/lib/data/PredictionManager.d.ts +0 -1
- package/lib/data/PredictionManager.js +15 -15
- package/lib/data/SpectraManager.d.ts +2 -5
- package/lib/data/SpectraManager.js +4 -95
- package/lib/data/constants/SignalsKinds.d.ts +0 -1
- package/lib/data/constants/SignalsKinds.js +0 -8
- package/lib/data/data1d/Data1DManager.js +5 -5
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +5 -5
- package/lib/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +2 -2
- package/lib/data/data1d/Spectrum1D/index.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/index.js +2 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -2
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -16
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +8 -0
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +24 -0
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +2 -0
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -3
- package/lib/data/data1d/database.js +4 -6
- package/lib/data/data1d/filter1d/apodization.d.ts +25 -0
- package/lib/data/data1d/filter1d/apodization.js +63 -0
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +24 -7
- package/lib/data/data1d/filter1d/baselineCorrection.js +10 -17
- package/lib/data/data1d/filter1d/fft.js +11 -0
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +2 -0
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +35 -0
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.d.ts +9 -0
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.js +24 -0
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +3 -2
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +1 -1
- package/lib/data/molecules/Molecule.d.ts +20 -6
- package/lib/data/molecules/Molecule.js +5 -8
- package/lib/data/molecules/MoleculeManager.d.ts +4 -4
- package/lib/data/molecules/MoleculeManager.js +5 -5
- package/lib/data/types/data1d/SumOptions.d.ts +1 -1
- package/lib/data/utilities/generateNumbersPowerOfX.d.ts +0 -1
- package/lib/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib/data/utilities/isInRange.d.ts +7 -0
- package/lib/data/utilities/isInRange.js +4 -0
- package/lib/types/NMRiumDataReturn.d.ts +2 -2
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -2
- package/lib/types/NMRiumToolBarPreferences.d.ts +14 -13
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +77 -0
- package/lib-cjs/component/1d/Chart1D.js +4 -2
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +15 -8
- package/lib-cjs/component/1d/FooterBanner.js +3 -1
- package/lib-cjs/component/1d/IntegralResizable.js +4 -3
- package/lib-cjs/component/1d/IntegralsSeries.js +3 -1
- package/lib-cjs/component/1d/LinesSeries.js +6 -4
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +10 -13
- package/lib-cjs/component/1d/database/DatabaseElements.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -2
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +5 -1
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +15 -13
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -3
- package/lib-cjs/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib-cjs/component/1d/peaks/PeakAnnotations.js +33 -0
- package/lib-cjs/component/1d/peaks/PeaksShapes.js +42 -0
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +53 -0
- package/lib-cjs/component/1d/ranges/Range.js +3 -3
- package/lib-cjs/component/1d/ranges/Ranges.js +7 -1
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -1
- package/lib-cjs/component/1d/tool/XLabelPointer.js +3 -1
- package/lib-cjs/component/2d/Contours.js +3 -1
- package/lib-cjs/component/2d/FooterBanner.js +5 -3
- package/lib-cjs/component/2d/Viewer2D.js +6 -6
- package/lib-cjs/component/2d/XAxis.js +2 -2
- package/lib-cjs/component/2d/YAxis.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +3 -1
- package/lib-cjs/component/2d/tools/slicing/SlicingView.js +3 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +1 -1
- package/lib-cjs/component/2d/zones/Signal.js +3 -3
- package/lib-cjs/component/2d/zones/Zone.js +3 -3
- package/lib-cjs/component/2d/zones/Zones.js +13 -18
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +89 -50
- package/lib-cjs/component/NMRium.js +14 -3
- package/lib-cjs/component/context/GlobalContext.js +4 -4
- package/lib-cjs/component/elements/ActiveButton.js +33 -0
- package/lib-cjs/component/elements/Button.js +5 -5
- package/lib-cjs/component/elements/ButtonToolTip.js +1 -1
- package/lib-cjs/component/elements/CheckBox.js +3 -5
- package/lib-cjs/component/elements/Input.js +1 -1
- package/lib-cjs/component/elements/Label.js +3 -3
- package/lib-cjs/component/elements/MoleculeSelection.js +1 -1
- package/lib-cjs/component/elements/NextPrev.js +1 -1
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/Select.js +6 -8
- package/lib-cjs/component/elements/Tab/Tab.js +1 -1
- package/lib-cjs/component/elements/Table/Table.js +2 -2
- package/lib-cjs/component/elements/ToggleButton.js +3 -2
- package/lib-cjs/component/elements/accordion/AccordionItem.js +2 -2
- package/lib-cjs/component/elements/formik/FormikOnChange.js +10 -4
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +8 -11
- package/lib-cjs/component/elements/resizer/DivResizer.js +3 -3
- package/lib-cjs/component/elements/resizer/SVGResizer.js +2 -2
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +110 -0
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +39 -35
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +82 -49
- package/lib-cjs/component/header/Header.js +5 -2
- package/lib-cjs/component/header/HeaderContainer.js +14 -0
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +26 -28
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +73 -45
- package/lib-cjs/component/header/Zones2DOptionPanel.js +11 -13
- package/lib-cjs/component/highlight/index.js +20 -18
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib-cjs/component/hooks/useDatumWithSpectraStatistics.js +3 -1
- package/lib-cjs/component/hooks/useExport.js +0 -16
- package/lib-cjs/component/hooks/useFilter.js +14 -0
- package/lib-cjs/component/hooks/useIntegralPath.js +5 -2
- package/lib-cjs/component/hooks/useNucleus.js +4 -4
- package/lib-cjs/component/hooks/useSpectraPerNucleus.js +1 -1
- package/lib-cjs/component/hooks/useSpectrum.js +3 -1
- package/lib-cjs/component/hooks/useToolsFunctions.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +7 -150
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
- package/lib-cjs/component/modal/EditPeakShapeModal.js +113 -0
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +2 -3
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib-cjs/component/modal/changeSum/SelectMolecule.js +2 -2
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -3
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +3 -8
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +17 -13
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +1 -1
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -9
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +11 -3
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib-cjs/component/panels/Panels.js +3 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +45 -20
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +42 -11
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +10 -9
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +7 -3
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +3 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib-cjs/component/panels/SummaryPanel/utilities/useInView.js +3 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +18 -9
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -13
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +3 -12
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib-cjs/component/reducer/IgnoreActions.js +5 -0
- package/lib-cjs/component/reducer/Reducer.js +72 -50
- package/lib-cjs/component/reducer/actions/DomainActions.js +11 -9
- package/lib-cjs/component/reducer/actions/FiltersActions.js +332 -205
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +15 -10
- package/lib-cjs/component/reducer/actions/LoadActions.js +18 -36
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +49 -19
- package/lib-cjs/component/reducer/actions/PeaksActions.js +54 -12
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +8 -10
- package/lib-cjs/component/reducer/actions/RangesActions.js +87 -29
- package/lib-cjs/component/reducer/actions/SpectraAnalysisAction.js +5 -5
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +14 -11
- package/lib-cjs/component/reducer/actions/ToolsActions.js +46 -94
- package/lib-cjs/component/reducer/actions/ZonesActions.js +71 -17
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -1
- package/lib-cjs/component/reducer/helper/getActiveSpectrumOrFail.js +10 -0
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -2
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +19 -0
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -5
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib-cjs/component/reducer/types/Types.js +15 -3
- package/lib-cjs/component/tool/BrushX.js +1 -1
- package/lib-cjs/component/tool/BrushXY.js +4 -3
- package/lib-cjs/component/tool/CrossLinePointer.js +5 -4
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +21 -6
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +19 -6
- package/lib-cjs/component/toolbar/BasicToolBar.js +7 -14
- package/lib-cjs/component/toolbar/FunctionToolBar.js +12 -22
- package/lib-cjs/component/toolbar/ToolTypes.js +119 -9
- package/lib-cjs/component/utility/assert.js +9 -0
- package/lib-cjs/component/workspaces/basic.js +12 -11
- package/lib-cjs/component/workspaces/embedded.js +14 -13
- package/lib-cjs/component/workspaces/exercise.js +10 -6
- package/lib-cjs/component/workspaces/prediction.js +14 -13
- package/lib-cjs/component/workspaces/process1D.js +20 -19
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +14 -15
- package/lib-cjs/constants.js +1 -1
- package/lib-cjs/data/Filters.js +3 -3
- package/lib-cjs/data/FiltersManager.js +3 -6
- package/lib-cjs/data/PredictionManager.js +15 -15
- package/lib-cjs/data/SpectraManager.js +5 -100
- package/lib-cjs/data/constants/SignalsKinds.js +0 -8
- package/lib-cjs/data/data1d/Data1DManager.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +2 -5
- package/lib-cjs/data/data1d/Spectrum1D/index.js +3 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -19
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +28 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +2 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -5
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -6
- package/lib-cjs/data/data1d/database.js +4 -6
- package/lib-cjs/data/data1d/filter1d/apodization.js +70 -0
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +11 -18
- package/lib-cjs/data/data1d/filter1d/fft.js +11 -0
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +39 -0
- package/lib-cjs/data/data1d/filter1d/zeroFillingAndApodization.js +30 -0
- package/lib-cjs/data/data2d/Processing2D.js +3 -2
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -6
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +3 -6
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -6
- package/lib-cjs/data/molecules/Molecule.js +5 -8
- package/lib-cjs/data/molecules/MoleculeManager.js +5 -5
- package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib-cjs/data/utilities/isInRange.js +7 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +36 -35
- package/lib/component/1d/PeakAnnotations.js +0 -41
- package/lib/component/utility/nmredataToNmrium.d.ts +0 -4
- package/lib/component/utility/nmredataToNmrium.js +0 -66
- package/lib/component/utility/nmriumToNmredata.d.ts +0 -2
- package/lib/component/utility/nmriumToNmredata.js +0 -80
- package/lib/component/utility/util/nmredata/addRanges.d.ts +0 -1
- package/lib/component/utility/util/nmredata/addRanges.js +0 -52
- package/lib/component/utility/util/nmredata/addSource.d.ts +0 -6
- package/lib/component/utility/util/nmredata/addSource.js +0 -54
- package/lib/component/utility/util/nmredata/addZones.d.ts +0 -1
- package/lib/component/utility/util/nmredata/addZones.js +0 -41
- package/lib/component/utility/util/nmredata/flat2DSignals.d.ts +0 -1
- package/lib/component/utility/util/nmredata/flat2DSignals.js +0 -7
- package/lib/component/utility/util/nmredata/get1DSignals.d.ts +0 -10
- package/lib/component/utility/util/nmredata/get1DSignals.js +0 -96
- package/lib/component/utility/util/nmredata/get2DSignals.d.ts +0 -8
- package/lib/component/utility/util/nmredata/get2DSignals.js +0 -59
- package/lib/component/utility/util/nmredata/getCouplingObserved.d.ts +0 -1
- package/lib/component/utility/util/nmredata/getCouplingObserved.js +0 -11
- package/lib/component/utility/util/nmredata/getLabels.d.ts +0 -9
- package/lib/component/utility/util/nmredata/getLabels.js +0 -66
- package/lib/component/utility/util/nmredata/getToFix.d.ts +0 -1
- package/lib/component/utility/util/nmredata/getToFix.js +0 -19
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +0 -14
- package/lib/data/data1d/filter1d/lineBroadening.js +0 -57
- package/lib/data/migration/MigrationManager.d.ts +0 -2
- package/lib/data/migration/MigrationManager.js +0 -17
- package/lib/data/migration/changeKeys.d.ts +0 -1
- package/lib/data/migration/changeKeys.js +0 -9
- package/lib/data/migration/migrateToVersion1.d.ts +0 -11
- package/lib/data/migration/migrateToVersion1.js +0 -32
- package/lib/data/migration/migrateToVersion2.d.ts +0 -1
- package/lib/data/migration/migrateToVersion2.js +0 -111
- package/lib/data/utilities/generateID.d.ts +0 -1
- package/lib/data/utilities/generateID.js +0 -9
- package/lib-cjs/component/1d/PeakAnnotations.js +0 -46
- package/lib-cjs/component/utility/nmredataToNmrium.js +0 -73
- package/lib-cjs/component/utility/nmriumToNmredata.js +0 -87
- package/lib-cjs/component/utility/util/nmredata/addRanges.js +0 -56
- package/lib-cjs/component/utility/util/nmredata/addSource.js +0 -61
- package/lib-cjs/component/utility/util/nmredata/addZones.js +0 -48
- package/lib-cjs/component/utility/util/nmredata/flat2DSignals.js +0 -11
- package/lib-cjs/component/utility/util/nmredata/get1DSignals.js +0 -100
- package/lib-cjs/component/utility/util/nmredata/get2DSignals.js +0 -63
- package/lib-cjs/component/utility/util/nmredata/getCouplingObserved.js +0 -15
- package/lib-cjs/component/utility/util/nmredata/getLabels.js +0 -70
- package/lib-cjs/component/utility/util/nmredata/getToFix.js +0 -23
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +0 -63
- package/lib-cjs/data/migration/MigrationManager.js +0 -24
- package/lib-cjs/data/migration/changeKeys.js +0 -13
- package/lib-cjs/data/migration/migrateToVersion1.js +0 -35
- package/lib-cjs/data/migration/migrateToVersion2.js +0 -114
- package/lib-cjs/data/utilities/generateID.js +0 -12
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Datum1D } from '../../types/data1d/Datum1D';
|
|
2
|
-
export declare const id = "lineBroadening";
|
|
3
|
-
export declare const name = "Line broadening";
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @param {Datum1d} datum1d
|
|
7
|
-
* @param {Object} [value]
|
|
8
|
-
*/
|
|
9
|
-
export declare function apply(datum1D: Datum1D, value: any): void;
|
|
10
|
-
export declare function isApplicable(datum1D: Datum1D): boolean;
|
|
11
|
-
export declare function reduce(previousValue: any, newValue: any): {
|
|
12
|
-
once: boolean;
|
|
13
|
-
reduce: any;
|
|
14
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
export const id = 'lineBroadening';
|
|
2
|
-
export const name = 'Line broadening';
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param {Datum1d} datum1d
|
|
6
|
-
* @param {Object} [value]
|
|
7
|
-
*/
|
|
8
|
-
export function apply(datum1D, value) {
|
|
9
|
-
if (!isApplicable(datum1D)) {
|
|
10
|
-
throw new Error('lineBroadening not applicable on this data');
|
|
11
|
-
}
|
|
12
|
-
let grpdly = datum1D.info?.digitalFilter || 0;
|
|
13
|
-
let pointsToShift;
|
|
14
|
-
if (grpdly > 0) {
|
|
15
|
-
pointsToShift = Math.floor(grpdly);
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
pointsToShift = 0;
|
|
19
|
-
}
|
|
20
|
-
const re = datum1D.data.re;
|
|
21
|
-
const im = datum1D.data.im;
|
|
22
|
-
const t = datum1D.data.x;
|
|
23
|
-
const length = re.length;
|
|
24
|
-
const newRE = new Float64Array(length); // I don't think we need a new array... here
|
|
25
|
-
const newIM = new Float64Array(length);
|
|
26
|
-
//if (value !== 0) {// is it OK to skip this line if "value" is zero?
|
|
27
|
-
//please check this test of zero is correct !== or != ...
|
|
28
|
-
const dw = (t[length - 1] - t[0]) / (length - 1); //REPLACE CONSTANT with calculated value... : for this we need AQ or DW to set it right...
|
|
29
|
-
// convert line broadening in Hz into exponential coefficient:
|
|
30
|
-
const em = -value * Math.exp(1);
|
|
31
|
-
const coefExp = Math.exp(em * dw);
|
|
32
|
-
let curFactor = Math.exp(em * t[0]); // in case does not start at zero
|
|
33
|
-
for (let i = 0; i < length - pointsToShift; i++) {
|
|
34
|
-
newRE[i] = re[i] * curFactor;
|
|
35
|
-
newIM[i] = im[i] * curFactor;
|
|
36
|
-
curFactor = curFactor * coefExp;
|
|
37
|
-
}
|
|
38
|
-
curFactor = Math.exp(em * t[0]);
|
|
39
|
-
for (let i = length; i > length - pointsToShift; i--) {
|
|
40
|
-
newRE[i] = re[i] * curFactor;
|
|
41
|
-
newIM[i] = im[i] * curFactor;
|
|
42
|
-
curFactor = curFactor * coefExp;
|
|
43
|
-
}
|
|
44
|
-
datum1D.data = { ...datum1D.data, ...{ re: newRE, im: newIM } };
|
|
45
|
-
//}
|
|
46
|
-
}
|
|
47
|
-
export function isApplicable(datum1D) {
|
|
48
|
-
if (datum1D.info.isComplex && datum1D.info.isFid)
|
|
49
|
-
return true;
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
export function reduce(previousValue, newValue) {
|
|
53
|
-
return {
|
|
54
|
-
once: true,
|
|
55
|
-
reduce: newValue,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import migrateToVersion1 from './migrateToVersion1';
|
|
2
|
-
import migrateToVersion2 from './migrateToVersion2';
|
|
3
|
-
export const CURRENT_EXPORT_VERSION = 2;
|
|
4
|
-
function migrationPipe(functions) {
|
|
5
|
-
return (input) => functions.reduce((input, func) => func(input), input);
|
|
6
|
-
}
|
|
7
|
-
export function migrate(data) {
|
|
8
|
-
let migrationsFuncs = [
|
|
9
|
-
migrateToVersion1,
|
|
10
|
-
migrateToVersion2,
|
|
11
|
-
];
|
|
12
|
-
let index = data?.version || 0;
|
|
13
|
-
if (index > CURRENT_EXPORT_VERSION) {
|
|
14
|
-
throw new Error('This file can not be imported using the current NMRium version, Please move to the new one !!! ');
|
|
15
|
-
}
|
|
16
|
-
return migrationPipe(migrationsFuncs.slice(index))(data);
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function changeKeys(data: any, changedKeys: any): any;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* changes from version 0 to version 1:
|
|
3
|
-
* all change done on objects keys naming
|
|
4
|
-
* j => js
|
|
5
|
-
* signal => signals
|
|
6
|
-
* integral => integration
|
|
7
|
-
* peak => peaks
|
|
8
|
-
* diaID => diaIDs
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
export default function migrateToVersion1(data: any): any;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { changeKeys } from './changeKeys';
|
|
2
|
-
/**
|
|
3
|
-
* changes from version 0 to version 1:
|
|
4
|
-
* all change done on objects keys naming
|
|
5
|
-
* j => js
|
|
6
|
-
* signal => signals
|
|
7
|
-
* integral => integration
|
|
8
|
-
* peak => peaks
|
|
9
|
-
* diaID => diaIDs
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export default function migrateToVersion1(data) {
|
|
13
|
-
if (data?.version === 1)
|
|
14
|
-
return data;
|
|
15
|
-
const newData = { ...data, version: 1 };
|
|
16
|
-
const changedKeys = {
|
|
17
|
-
j: 'js',
|
|
18
|
-
signal: 'signals',
|
|
19
|
-
integral: 'integration',
|
|
20
|
-
peak: 'peaks',
|
|
21
|
-
diaID: 'diaIDs',
|
|
22
|
-
};
|
|
23
|
-
for (const spectrum of newData.spectra) {
|
|
24
|
-
if (spectrum.ranges) {
|
|
25
|
-
spectrum.ranges = changeKeys(spectrum.ranges, changedKeys);
|
|
26
|
-
}
|
|
27
|
-
else if (spectrum.zones) {
|
|
28
|
-
spectrum.zones = changeKeys(spectrum.zones, changedKeys);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return newData;
|
|
32
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function migrateToVersion2(data: any): any;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { changeKeys } from './changeKeys';
|
|
2
|
-
/*
|
|
3
|
-
* changes from version 1 to version 2:
|
|
4
|
-
1- peaks :
|
|
5
|
-
delta => x , originDelta => originalX, intensity => y,
|
|
6
|
-
paths:
|
|
7
|
-
- peak
|
|
8
|
-
|
|
9
|
-
2- range/signals :
|
|
10
|
-
atomIDs => atoms , intensity => y,
|
|
11
|
-
|
|
12
|
-
paths:
|
|
13
|
-
- range > signals
|
|
14
|
-
- range > signals > js
|
|
15
|
-
- range > signals > peaks
|
|
16
|
-
|
|
17
|
-
3- zone/signals :
|
|
18
|
-
we have two cases the
|
|
19
|
-
a)
|
|
20
|
-
get out the inner object fromTo:{from,to} => {from,to}
|
|
21
|
-
paths:
|
|
22
|
-
- zone > signals > x
|
|
23
|
-
- zone > signals > y
|
|
24
|
-
b)
|
|
25
|
-
{ fromTo,deltaX,resolutionX,nucleusX,deltaY,resolutionY,nucleusY,shiftX,shiftY} =>
|
|
26
|
-
{
|
|
27
|
-
x: {
|
|
28
|
-
from: fromTo[0].from,
|
|
29
|
-
to: fromTo[0].to,
|
|
30
|
-
delta: deltaX,
|
|
31
|
-
resolution: resolutionX,
|
|
32
|
-
nucleus: nucleusX,
|
|
33
|
-
},
|
|
34
|
-
y: {
|
|
35
|
-
from: fromTo[1].from,
|
|
36
|
-
to: fromTo[1].to,
|
|
37
|
-
delta: deltaY,
|
|
38
|
-
resolution: resolutionY,
|
|
39
|
-
nucleus: nucleusY,
|
|
40
|
-
},
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
paths:
|
|
44
|
-
-zone>signals
|
|
45
|
-
*/
|
|
46
|
-
export default function migrateToVersion2(data) {
|
|
47
|
-
if (data?.version === 2)
|
|
48
|
-
return data;
|
|
49
|
-
const newData = { ...data, version: 2 };
|
|
50
|
-
const changedKeys = {
|
|
51
|
-
peaks: {
|
|
52
|
-
delta: 'x',
|
|
53
|
-
originDelta: 'originalX',
|
|
54
|
-
intensity: 'y',
|
|
55
|
-
},
|
|
56
|
-
ranges: {
|
|
57
|
-
atomIDs: 'atoms',
|
|
58
|
-
intensity: 'y', // signal > peaks
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
for (const spectrum of newData.spectra) {
|
|
62
|
-
if (spectrum.peaks) {
|
|
63
|
-
spectrum.peaks = changeKeys(spectrum.peaks, changedKeys.peaks);
|
|
64
|
-
}
|
|
65
|
-
else if (spectrum.ranges) {
|
|
66
|
-
spectrum.ranges = changeKeys(spectrum.ranges, changedKeys.ranges);
|
|
67
|
-
}
|
|
68
|
-
else if (spectrum.zones) {
|
|
69
|
-
spectrum.zones.values = mapZones(spectrum.zones.values);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return newData;
|
|
73
|
-
}
|
|
74
|
-
function mapZones(zones) {
|
|
75
|
-
return zones.map((zone) => {
|
|
76
|
-
if (zone.signals) {
|
|
77
|
-
zone.signals = zone.signals.map((signal) => {
|
|
78
|
-
if (signal.x && signal.y) {
|
|
79
|
-
const { x: { fromTo: fromToX, ...resX }, y: { fromTo: fromToY, ...resY }, } = signal;
|
|
80
|
-
signal = {
|
|
81
|
-
...signal,
|
|
82
|
-
x: { ...resX, ...fromToX },
|
|
83
|
-
y: { ...resY, ...fromToY },
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
const { fromTo, deltaX, resolutionX, nucleusX, deltaY, resolutionY, nucleusY, shiftX, shiftY, ...resSignal } = signal;
|
|
88
|
-
signal = {
|
|
89
|
-
...resSignal,
|
|
90
|
-
x: {
|
|
91
|
-
from: fromTo[0].from,
|
|
92
|
-
to: fromTo[0].to,
|
|
93
|
-
delta: deltaX,
|
|
94
|
-
resolution: resolutionX,
|
|
95
|
-
nucleus: nucleusX,
|
|
96
|
-
},
|
|
97
|
-
y: {
|
|
98
|
-
from: fromTo[1].from,
|
|
99
|
-
to: fromTo[1].to,
|
|
100
|
-
delta: deltaY,
|
|
101
|
-
resolution: resolutionY,
|
|
102
|
-
nucleus: nucleusY,
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
return signal;
|
|
107
|
-
}, []);
|
|
108
|
-
}
|
|
109
|
-
return zone;
|
|
110
|
-
}, []);
|
|
111
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function generateID(): string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const BASE62 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
2
|
-
const LENGTH = 8;
|
|
3
|
-
export default function generateID() {
|
|
4
|
-
let id = '';
|
|
5
|
-
for (let i = 0; i < LENGTH; i++) {
|
|
6
|
-
id += BASE62.charAt(Math.floor(Math.random() * 62));
|
|
7
|
-
}
|
|
8
|
-
return id;
|
|
9
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const Spectrum1D_1 = require("../../data/data1d/Spectrum1D");
|
|
9
|
-
const ChartContext_1 = require("../context/ChartContext");
|
|
10
|
-
const ScaleContext_1 = require("../context/ScaleContext");
|
|
11
|
-
const PeakAnnotation_1 = __importDefault(require("./PeakAnnotation"));
|
|
12
|
-
const getVerticalShift_1 = __importDefault(require("./utilities/getVerticalShift"));
|
|
13
|
-
function PeakAnnotations() {
|
|
14
|
-
const { data, activeSpectrum, verticalAlign, displayerKey, xDomains } = (0, ChartContext_1.useChartData)();
|
|
15
|
-
const { scaleX, scaleY } = (0, ScaleContext_1.useScaleChecked)();
|
|
16
|
-
const Peaks = (0, react_1.useMemo)(() => {
|
|
17
|
-
const getVerticalAlign = (id) => {
|
|
18
|
-
const index = data.findIndex((d) => d.id === id);
|
|
19
|
-
return (0, getVerticalShift_1.default)(verticalAlign, { index });
|
|
20
|
-
};
|
|
21
|
-
const reSortData = () => {
|
|
22
|
-
const _data = [...data];
|
|
23
|
-
return activeSpectrum
|
|
24
|
-
? _data.sort((x, y) => {
|
|
25
|
-
return x.id === activeSpectrum.id
|
|
26
|
-
? 1
|
|
27
|
-
: y.id === activeSpectrum.id
|
|
28
|
-
? -1
|
|
29
|
-
: 0;
|
|
30
|
-
})
|
|
31
|
-
: _data;
|
|
32
|
-
};
|
|
33
|
-
return (data &&
|
|
34
|
-
reSortData()
|
|
35
|
-
.filter((d) => d.display.isVisible && xDomains[d.id])
|
|
36
|
-
.filter(Spectrum1D_1.isSpectrum1D)
|
|
37
|
-
.map((d) => {
|
|
38
|
-
return (d.peaks?.values &&
|
|
39
|
-
d.display.isPeaksMarkersVisible && ((0, jsx_runtime_1.jsx)("g", { transform: `translate(0,-${getVerticalAlign(d.id)})`, children: d.peaks.values.map(({ x, y, id }) => ((0, jsx_runtime_1.jsx)(PeakAnnotation_1.default, { x: scaleX()(x), y: scaleY(d.id)(y) - 5, sign: Math.sign(y), id: id, value: x, color: "#730000", nucleus: d.info.nucleus, isActive: activeSpectrum == null
|
|
40
|
-
? false
|
|
41
|
-
: activeSpectrum.id === d.id }, id))) }, d.id)));
|
|
42
|
-
}));
|
|
43
|
-
}, [data, verticalAlign, activeSpectrum, xDomains, scaleX, scaleY]);
|
|
44
|
-
return ((0, jsx_runtime_1.jsx)("g", { className: "peaks", clipPath: `url(#${displayerKey}clip-chart-1d)`, children: Peaks }));
|
|
45
|
-
}
|
|
46
|
-
exports.default = PeakAnnotations;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.nmredataToNmrium = void 0;
|
|
7
|
-
const jszip_1 = __importDefault(require("jszip"));
|
|
8
|
-
const nmredata_1 = require("nmredata");
|
|
9
|
-
const SpectraManager_1 = require("../../data/SpectraManager");
|
|
10
|
-
const addRanges_1 = require("./util/nmredata/addRanges");
|
|
11
|
-
const addZones_1 = require("./util/nmredata/addZones");
|
|
12
|
-
async function nmredataToNmrium(file, usedColors) {
|
|
13
|
-
const jszip = new jszip_1.default();
|
|
14
|
-
const zip = await jszip.loadAsync(file.binary);
|
|
15
|
-
const sdfFiles = await getSDF(zip.files);
|
|
16
|
-
const jsonData = await nmredata_1.NmrRecord.toJSON({
|
|
17
|
-
sdf: sdfFiles[0],
|
|
18
|
-
zipFiles: zip.files,
|
|
19
|
-
});
|
|
20
|
-
let { spectra, molecules = [] } = jsonData;
|
|
21
|
-
let nmrium = {
|
|
22
|
-
spectra: [],
|
|
23
|
-
molecules,
|
|
24
|
-
};
|
|
25
|
-
for (const data of spectra) {
|
|
26
|
-
const { file, jcampURL } = data.source;
|
|
27
|
-
let spectrum = (await getSpectra(file, { jcampURL }, usedColors)) || [];
|
|
28
|
-
for (const spectrumData of spectrum) {
|
|
29
|
-
const { info } = spectrumData;
|
|
30
|
-
if (info.isFid)
|
|
31
|
-
continue;
|
|
32
|
-
if (info.dimension > 1) {
|
|
33
|
-
(0, addZones_1.addZones)(data.signals, spectrumData);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
(0, addRanges_1.addRanges)(data.signals, spectrumData);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
nmrium.spectra.push(...spectrum);
|
|
40
|
-
}
|
|
41
|
-
return nmrium;
|
|
42
|
-
}
|
|
43
|
-
exports.nmredataToNmrium = nmredataToNmrium;
|
|
44
|
-
async function getSpectra(file, options = {}, usedColors = {}) {
|
|
45
|
-
const { xy = true, noContours = true, keepOriginal = true, jcampURL, } = options;
|
|
46
|
-
switch (file.extension) {
|
|
47
|
-
case 'jdx':
|
|
48
|
-
case 'dx':
|
|
49
|
-
return (0, SpectraManager_1.addJcamps)([file], usedColors);
|
|
50
|
-
case 'zip':
|
|
51
|
-
return (0, SpectraManager_1.addBruker)({ xy, noContours, keepOriginal }, file.binary, usedColors);
|
|
52
|
-
default:
|
|
53
|
-
if (!jcampURL) {
|
|
54
|
-
throw new Error('file extension is not supported');
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
async function getSDF(zipFiles) {
|
|
59
|
-
let result = [];
|
|
60
|
-
for (const file in zipFiles) {
|
|
61
|
-
const pathFile = file.split('/');
|
|
62
|
-
if (/^[^.].+sdf$/.exec(pathFile[pathFile.length - 1])) {
|
|
63
|
-
const filename = pathFile[pathFile.length - 1].replace(/\.sdf/, '');
|
|
64
|
-
const root = pathFile.slice(0, pathFile.length - 1).join('/');
|
|
65
|
-
const sdf = await zipFiles[file].async('string');
|
|
66
|
-
let parserResult = (0, nmredata_1.parseSDF)(`${sdf}`, { mixedEOL: true });
|
|
67
|
-
parserResult.filename = filename;
|
|
68
|
-
parserResult.root = root !== '' ? `${root}/` : '';
|
|
69
|
-
result.push(parserResult);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.nmriumToNmredata = void 0;
|
|
7
|
-
const jszip_1 = __importDefault(require("jszip"));
|
|
8
|
-
const openchemlib_utils_1 = require("openchemlib-utils");
|
|
9
|
-
const full_1 = require("openchemlib/full");
|
|
10
|
-
const get1DSignals_1 = require("./util/nmredata/get1DSignals");
|
|
11
|
-
const get2DSignals_1 = require("./util/nmredata/get2DSignals");
|
|
12
|
-
const getLabels_1 = require("./util/nmredata/getLabels");
|
|
13
|
-
const tags = {
|
|
14
|
-
solvent: 'SOLVENT',
|
|
15
|
-
temperature: 'TEMPERATURE',
|
|
16
|
-
assignment: 'ASSIGNMENT',
|
|
17
|
-
j: 'J',
|
|
18
|
-
signals: 'SIGNALS',
|
|
19
|
-
id: 'ID',
|
|
20
|
-
};
|
|
21
|
-
async function nmriumToNmredata(state, options = {}) {
|
|
22
|
-
const { data, // it would be changed depending of the final location
|
|
23
|
-
molecules, } = state || {
|
|
24
|
-
data: [],
|
|
25
|
-
molecules: [],
|
|
26
|
-
};
|
|
27
|
-
let nmrRecord = new jszip_1.default();
|
|
28
|
-
for (const molecule of molecules) {
|
|
29
|
-
await addNMReDATA(data, nmrRecord, {
|
|
30
|
-
...options,
|
|
31
|
-
molecule,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
if (!molecules.length)
|
|
35
|
-
await addNMReDATA(data, nmrRecord, options);
|
|
36
|
-
return nmrRecord;
|
|
37
|
-
}
|
|
38
|
-
exports.nmriumToNmredata = nmriumToNmredata;
|
|
39
|
-
async function addNMReDATA(data, nmrRecord, options = {}) {
|
|
40
|
-
let { id, prefix = '\n> <NMREDATA_', filename = 'nmredata', molecule, } = options;
|
|
41
|
-
let sdfResult = '';
|
|
42
|
-
let groupedDiaIDs;
|
|
43
|
-
if (molecule) {
|
|
44
|
-
molecule = full_1.Molecule.fromMolfile(molecule.molfile);
|
|
45
|
-
sdfResult += molecule.toMolfile();
|
|
46
|
-
molecule.addImplicitHydrogens();
|
|
47
|
-
groupedDiaIDs = (0, openchemlib_utils_1.getGroupedDiastereotopicAtomIDs)(molecule);
|
|
48
|
-
}
|
|
49
|
-
let labels = molecule
|
|
50
|
-
? (0, getLabels_1.getLabels)(data, { groupedDiaIDs, molecule })
|
|
51
|
-
: { byDiaID: undefined, byAssignNumber: undefined };
|
|
52
|
-
sdfResult += `${prefix}VERSION>\n1.1\\\n`;
|
|
53
|
-
sdfResult += putTag(data, 'temperature', { prefix });
|
|
54
|
-
sdfResult += putTag(data, 'solvent', { prefix });
|
|
55
|
-
if (id)
|
|
56
|
-
sdfResult += `${prefix + tags.id}>\nid\\\n`;
|
|
57
|
-
sdfResult += formatAssignments(labels.byDiaID, { prefix });
|
|
58
|
-
sdfResult += await (0, get1DSignals_1.get1DSignals)(data, nmrRecord, { prefix, labels });
|
|
59
|
-
sdfResult += await (0, get2DSignals_1.get2DSignals)(data, nmrRecord, { prefix, labels });
|
|
60
|
-
sdfResult += '\n$$$$\n';
|
|
61
|
-
nmrRecord.file(`${filename}.sdf`, sdfResult);
|
|
62
|
-
}
|
|
63
|
-
function formatAssignments(labels, options) {
|
|
64
|
-
if (!labels)
|
|
65
|
-
return '';
|
|
66
|
-
const { prefix } = options;
|
|
67
|
-
let str = `${prefix + tags.assignment}>\n`;
|
|
68
|
-
for (let l in labels) {
|
|
69
|
-
let atoms = labels[l].atoms;
|
|
70
|
-
str += `${labels[l].label}, ${labels[l].shift}`; // change to add label
|
|
71
|
-
for (let atom of atoms)
|
|
72
|
-
str += `, ${atom}`;
|
|
73
|
-
str += '\\\n';
|
|
74
|
-
}
|
|
75
|
-
return str;
|
|
76
|
-
}
|
|
77
|
-
function putTag(spectra, tag, options = { prefix: '' }) {
|
|
78
|
-
const { prefix } = options;
|
|
79
|
-
let str = '';
|
|
80
|
-
for (let spectrum of spectra) {
|
|
81
|
-
if (spectrum.info[tag]) {
|
|
82
|
-
str += `${prefix + tags[tag]}>\n${String(spectrum.info[tag])}\\\n`;
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return str;
|
|
87
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addRanges = void 0;
|
|
4
|
-
const Spectrum1D_1 = require("../../../../data/data1d/Spectrum1D");
|
|
5
|
-
function addRanges(signals, datum) {
|
|
6
|
-
let ranges = [];
|
|
7
|
-
const { baseFrequency: frequency = 500 } = datum;
|
|
8
|
-
for (const signal of signals) {
|
|
9
|
-
const { jCoupling: js, delta, diaIDs = [], multiplicity, integration, } = signal;
|
|
10
|
-
const fromTo = computeFromTo({ delta, js, frequency });
|
|
11
|
-
if (js && multiplicity) {
|
|
12
|
-
if (js.length === multiplicity.length) {
|
|
13
|
-
js.sort((a, b) => b - a);
|
|
14
|
-
for (let i = 0; i < js.length; i++) {
|
|
15
|
-
js[i].multiplicity = multiplicity[i];
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
ranges.push({
|
|
20
|
-
...fromTo,
|
|
21
|
-
integration,
|
|
22
|
-
signals: [
|
|
23
|
-
{
|
|
24
|
-
js,
|
|
25
|
-
delta,
|
|
26
|
-
diaIDs,
|
|
27
|
-
multiplicity,
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
datum.ranges.values = (0, Spectrum1D_1.mapRanges)(joinRanges(ranges), datum);
|
|
33
|
-
}
|
|
34
|
-
exports.addRanges = addRanges;
|
|
35
|
-
function computeFromTo(options = {}) {
|
|
36
|
-
const { delta, js: couplings = [], frequency } = options;
|
|
37
|
-
let width = 0.5;
|
|
38
|
-
for (let j of couplings) {
|
|
39
|
-
width += j.coupling;
|
|
40
|
-
}
|
|
41
|
-
width /= frequency;
|
|
42
|
-
return { from: delta - width, to: delta + width };
|
|
43
|
-
}
|
|
44
|
-
function joinRanges(ranges) {
|
|
45
|
-
ranges.sort((a, b) => a.from - b.from);
|
|
46
|
-
for (let i = 0; i < ranges.length - 1; i++) {
|
|
47
|
-
if (ranges[i].to > ranges[i + 1].from) {
|
|
48
|
-
ranges[i].to = Math.max(ranges[i + 1].to, ranges[i].to);
|
|
49
|
-
ranges[i].signals = ranges[i].signals.concat(ranges[i + 1].signals);
|
|
50
|
-
ranges[i].integration += ranges[i + 1].integration;
|
|
51
|
-
ranges.splice(i + 1, 1);
|
|
52
|
-
i--;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return ranges;
|
|
56
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.addSource = void 0;
|
|
7
|
-
const jszip_1 = __importDefault(require("jszip"));
|
|
8
|
-
const jszip = new jszip_1.default();
|
|
9
|
-
async function addSource(nmrRecord, options = {}) {
|
|
10
|
-
const { spectrum, source } = options;
|
|
11
|
-
const { file = {}, jcampURL } = source;
|
|
12
|
-
let tag = '';
|
|
13
|
-
const dimension = `${spectrum.info.dimension}d`;
|
|
14
|
-
switch (file.extension) {
|
|
15
|
-
case 'jdx':
|
|
16
|
-
case 'dx':
|
|
17
|
-
tag += `\nJcamp_Location=file:jcamp/${dimension}/${spectrum.display.name}\\`;
|
|
18
|
-
nmrRecord.file(`jcamp/${dimension}/${spectrum.display.name}`, file.binary);
|
|
19
|
-
break;
|
|
20
|
-
case 'zip':
|
|
21
|
-
if (!file.binary)
|
|
22
|
-
return;
|
|
23
|
-
void jszip.loadAsync(file.binary).then(async (zip) => {
|
|
24
|
-
for (const file in zip.files) {
|
|
25
|
-
if (file.endsWith('/'))
|
|
26
|
-
continue;
|
|
27
|
-
nmrRecord.file(`Bruker/${file}`, await zip.file(file)?.async('arraybuffer'));
|
|
28
|
-
}
|
|
29
|
-
tag += `\nSpectrum_Location=file:Bruker/${getPathFromZip(zip)}\\`;
|
|
30
|
-
});
|
|
31
|
-
break;
|
|
32
|
-
default:
|
|
33
|
-
if (!jcampURL)
|
|
34
|
-
break;
|
|
35
|
-
await fetch(jcampURL).then(async (jcamp) => {
|
|
36
|
-
if (!jcamp)
|
|
37
|
-
return;
|
|
38
|
-
let name = jcampURL.split('/').slice(-1);
|
|
39
|
-
const path = `jcamp/${dimension}/${name}`;
|
|
40
|
-
tag += `\nJcamp_Location=file:${path}\\`;
|
|
41
|
-
nmrRecord.file(path, await jcamp.arrayBuffer());
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
return tag;
|
|
45
|
-
}
|
|
46
|
-
exports.addSource = addSource;
|
|
47
|
-
function getPathFromZip(zip) {
|
|
48
|
-
let files = zip.filter((relativePath) => {
|
|
49
|
-
if (relativePath.match('__MACOSX'))
|
|
50
|
-
return false;
|
|
51
|
-
if (relativePath.endsWith('fid') ||
|
|
52
|
-
relativePath.endsWith('1r') ||
|
|
53
|
-
relativePath.endsWith('ser') ||
|
|
54
|
-
relativePath.endsWith('2rr')) {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
});
|
|
59
|
-
const index = files.findIndex((file) => file.name.endsWith('1r') || file.name.endsWith('2rr'));
|
|
60
|
-
return index > -1 ? files[index].name : files[0].name;
|
|
61
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.addZones = void 0;
|
|
7
|
-
const Spectrum2D_1 = require("../../../../data/data2d/Spectrum2D");
|
|
8
|
-
const generateID_1 = __importDefault(require("../../../../data/utilities/generateID"));
|
|
9
|
-
const axisLabels = ['y', 'x'];
|
|
10
|
-
function addZones(signals, datum) {
|
|
11
|
-
let zones = [];
|
|
12
|
-
const shift = (0, Spectrum2D_1.getShift)(datum);
|
|
13
|
-
const { baseFrequency } = datum.info;
|
|
14
|
-
const frequency = { x: baseFrequency[0], y: baseFrequency[1] };
|
|
15
|
-
for (const signal of signals) {
|
|
16
|
-
let zone = { x: {}, y: {}, id: (0, generateID_1.default)(), kind: 'signal' };
|
|
17
|
-
let signalFormated = { id: (0, generateID_1.default)(), kind: 'signal', peaks: [] };
|
|
18
|
-
let width = { x: 10, y: 10 };
|
|
19
|
-
for (let axis of axisLabels) {
|
|
20
|
-
let { coupling = [], delta, diaIDs = [] } = signal[axis];
|
|
21
|
-
for (let j of coupling) {
|
|
22
|
-
width[axis] += j.coupling;
|
|
23
|
-
}
|
|
24
|
-
if (signal.activeCoupling) {
|
|
25
|
-
const { activeCoupling = [] } = signal;
|
|
26
|
-
for (let j of activeCoupling) {
|
|
27
|
-
width[axis] += j.coupling;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
width[axis] /= frequency[axis];
|
|
31
|
-
zone[axis] = {
|
|
32
|
-
from: delta - width[axis],
|
|
33
|
-
to: delta + width[axis],
|
|
34
|
-
};
|
|
35
|
-
signalFormated[axis] = {
|
|
36
|
-
delta,
|
|
37
|
-
diaIDs,
|
|
38
|
-
originDelta: delta - shift[`${axis}Shift`],
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
zones.push({
|
|
42
|
-
...zone,
|
|
43
|
-
signals: [signalFormated],
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
datum.zones.values = zones;
|
|
47
|
-
}
|
|
48
|
-
exports.addZones = addZones;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.flat2DSignals = void 0;
|
|
4
|
-
function flat2DSignals(signals) {
|
|
5
|
-
let flattedSignal = [];
|
|
6
|
-
for (const { x, y } of signals) {
|
|
7
|
-
flattedSignal.push(x, y);
|
|
8
|
-
}
|
|
9
|
-
return flattedSignal;
|
|
10
|
-
}
|
|
11
|
-
exports.flat2DSignals = flat2DSignals;
|