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
|
@@ -156,6 +156,6 @@ function PredictSpectraModal({ onClose = () => null, molfile, }) {
|
|
|
156
156
|
const approveCheckHandler = useCallback((e) => {
|
|
157
157
|
setApproved(e.target.checked);
|
|
158
158
|
}, []);
|
|
159
|
-
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Prediction of NMR spectrum" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsxs("div", { className: "inner-content", children: [_jsxs(FormikForm, { ref: refForm, initialValues: initValues, validationSchema: predictionFormValidation, onSubmit: submitHandler, children: [_jsx(FormikErrorsSummary, {}), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Name :" }), _jsx(FormikInput, { name: "name", style: { input: { width: '200px', textAlign: 'left' } } })] }), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Spectrometer Frequency :" }), _jsx(FormikSelect, {
|
|
159
|
+
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Prediction of NMR spectrum" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsxs("div", { className: "inner-content", children: [_jsxs(FormikForm, { ref: refForm, initialValues: initValues, validationSchema: predictionFormValidation, onSubmit: submitHandler, children: [_jsx(FormikErrorsSummary, {}), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Name :" }), _jsx(FormikInput, { name: "name", style: { input: { width: '200px', textAlign: 'left' } } })] }), _jsxs("div", { className: "row margin-10", children: [_jsx("span", { className: "custom-label", children: "Spectrometer Frequency :" }), _jsx(FormikSelect, { items: FREQUENCIES, style: { width: 290, height: 30, margin: 0 }, name: "frequency" })] }), _jsx("span", { className: "group-label", children: "1D Options " }), _jsxs("div", { className: "row margin-10 padding-h-10", children: [_jsx(IsotopesViewer, { value: "1H", className: "custom-label" }), _jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "1d.1H.from", type: "number" }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "1d.1H.to", type: "number" }) })] }), _jsxs("div", { className: "row margin-10 padding-h-10", children: [_jsx(IsotopesViewer, { value: "13C", className: "custom-label" }), _jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "1d.13C.from", type: "number" }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "1d.13C.to", type: "number" }) })] }), _jsxs("div", { className: "row margin-10 padding-h-10", children: [_jsx("span", { className: "custom-label", children: "Line Width : " }), _jsx(FormikInput, { name: "1d.lineWidth", type: "number", style: { input: { margin: 0 } } }), _jsx("span", { style: { paddingLeft: '0.4rem' }, children: " Hz " })] }), _jsxs("div", { className: "row margin-10 padding-h-10", children: [_jsx("span", { className: "custom-label", children: "Number of Points : " }), _jsx(FormikSelect, { items: NUMBER_OF_POINTS_1D, name: "1d.nbPoints", style: { width: 290, height: 30, margin: 0 } })] }), _jsx("span", { className: "group-label", children: "2D Options " }), _jsxs("div", { className: "row margin-10 padding-h-10", children: [_jsx("span", { className: "custom-label", children: "Number of Points : " }), _jsx(FormikSelect, { items: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.x", style: { margin: 0, height: 30 } }), _jsx("span", { className: "middle-x", children: " X " }), _jsx(FormikSelect, { items: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.y", style: { margin: 0, height: 30 } })] }), _jsx("div", { className: "row margin-10", children: _jsx("span", { className: "group-label", children: "Spectra " }) }), _jsxs("div", { className: "row margin-10 padding-h-10", style: { justifyContent: 'space-between' }, children: [_jsxs("div", { className: "row", children: [_jsx(FormikCheckBox, { name: "spectra.proton" }), _jsx(IsotopesViewer, { value: "1H", className: "nucleus-label" })] }), _jsxs("div", { className: "row", children: [_jsx(FormikCheckBox, { name: "spectra.carbon" }), _jsx(IsotopesViewer, { value: "13C", className: "nucleus-label" })] }), _jsxs("div", { className: "row", children: [_jsx(FormikCheckBox, { name: "spectra.cosy" }), _jsx(IsotopesViewer, { value: "COSY", className: "nucleus-label" })] }), _jsxs("div", { className: "row", children: [_jsx(FormikCheckBox, { name: "spectra.hsqc" }), _jsx(IsotopesViewer, { value: "HSQC", className: "nucleus-label" })] }), _jsxs("div", { className: "row", children: [_jsx(FormikCheckBox, { name: "spectra.hmbc" }), _jsx(IsotopesViewer, { value: "HMBC", className: "nucleus-label" })] })] })] }), _jsx("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), _jsxs("div", { className: "warning-container", children: [_jsx(CheckBox, { onChange: approveCheckHandler, checked: isApproved }, String(isApproved)), _jsx("p", { children: "I confirm that the chemical structure is not confidential." })] })] }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] }));
|
|
160
160
|
}
|
|
161
161
|
export default PredictSpectraModal;
|
|
@@ -60,7 +60,7 @@ var SumSetOptions;
|
|
|
60
60
|
SumSetOptions["Manual"] = "manual";
|
|
61
61
|
})(SumSetOptions || (SumSetOptions = {}));
|
|
62
62
|
export default function ChangeSumModal({ onSave, onClose, header, sumOptions, }) {
|
|
63
|
-
const { current: { display: {
|
|
63
|
+
const { current: { display: { panels }, }, } = usePreferences();
|
|
64
64
|
const [setOption, setActiveOption] = useState(SumSetOptions.Auto);
|
|
65
65
|
const formRef = useRef(null);
|
|
66
66
|
const handleKeyDown = useCallback((event) => {
|
|
@@ -72,26 +72,24 @@ export default function ChangeSumModal({ onSave, onClose, header, sumOptions, })
|
|
|
72
72
|
setActiveOption(tab.tabid);
|
|
73
73
|
}, []);
|
|
74
74
|
useEffect(() => {
|
|
75
|
-
if (sumOptions?.sumAuto &&
|
|
76
|
-
!general?.hideSetSumFromMolecule &&
|
|
77
|
-
!panels?.structuresPanel?.display) {
|
|
75
|
+
if (sumOptions?.sumAuto && panels?.structuresPanel?.display) {
|
|
78
76
|
setActiveOption(SumSetOptions.Auto);
|
|
79
|
-
const { mf,
|
|
77
|
+
const { mf, moleculeId: id } = sumOptions;
|
|
80
78
|
formRef.current.setValues({
|
|
81
79
|
sum: null,
|
|
82
|
-
molecule:
|
|
80
|
+
molecule: id && mf ? { mf, id } : null,
|
|
83
81
|
});
|
|
84
82
|
}
|
|
85
83
|
else {
|
|
86
84
|
setActiveOption(SumSetOptions.Manual);
|
|
87
85
|
formRef.current.setValues({ sum: sumOptions?.sum || '', molecule: null });
|
|
88
86
|
}
|
|
89
|
-
}, [
|
|
87
|
+
}, [panels?.structuresPanel, sumOptions]);
|
|
90
88
|
const saveHandler = useCallback((values) => {
|
|
91
89
|
switch (setOption) {
|
|
92
90
|
case SumSetOptions.Auto: {
|
|
93
|
-
const { molecule: { mf,
|
|
94
|
-
onSave({ sumAuto: true, mf,
|
|
91
|
+
const { molecule: { mf, id: moleculeId }, } = values;
|
|
92
|
+
onSave({ sumAuto: true, mf, moleculeId });
|
|
95
93
|
break;
|
|
96
94
|
}
|
|
97
95
|
case SumSetOptions.Manual: {
|
|
@@ -120,8 +118,8 @@ export default function ChangeSumModal({ onSave, onClose, header, sumOptions, })
|
|
|
120
118
|
return null;
|
|
121
119
|
}
|
|
122
120
|
}, [setOption]);
|
|
121
|
+
const isStructurePanelVisible = panels?.structuresPanel?.display || false;
|
|
123
122
|
return (
|
|
124
123
|
// <div css={modalContainer}>
|
|
125
|
-
_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: header }), _jsx(CloseButton, { onClick: onClose })] }), _jsx("div", { className: "tab-content", children: _jsx(FormikForm, { ref: formRef, onSubmit: saveHandler, initialValues: { sum: null, molecule: null }, validationSchema: validationSchema, children: _jsxs(Tabs, { activeTab: setOption, onClick: onTabChangeHandler, children: [
|
|
126
|
-
!panels?.structuresPanel?.display && (_jsx(Tab, { tablabel: "Auto", tabid: SumSetOptions.Auto, children: _jsx(SelectMolecule, { name: "molecule" }) })), _jsx(Tab, { tablabel: "Manual", tabid: SumSetOptions.Manual, children: _jsx("div", { className: "manual-container", children: _jsx(FormikInput, { name: "sum", type: "number", placeholder: "Enter the new value", onKeyDown: handleKeyDown }) }) })] }) }) }), _jsx("div", { className: "footer-container", children: _jsx("button", { type: "button", onClick: () => formRef.current.submitForm(), className: "btn", children: "Set" }) })] }));
|
|
124
|
+
_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: header }), _jsx(CloseButton, { onClick: onClose })] }), _jsx("div", { className: "tab-content", children: _jsx(FormikForm, { ref: formRef, onSubmit: saveHandler, initialValues: { sum: null, molecule: null }, validationSchema: validationSchema, children: _jsxs(Tabs, { activeTab: setOption, onClick: onTabChangeHandler, children: [isStructurePanelVisible && (_jsx(Tab, { tablabel: "Auto", tabid: SumSetOptions.Auto, children: _jsx(SelectMolecule, { name: "molecule" }) })), _jsx(Tab, { tablabel: "Manual", tabid: SumSetOptions.Manual, children: _jsx("div", { className: "manual-container", children: _jsx(FormikInput, { name: "sum", type: "number", placeholder: "Enter the new value", onKeyDown: handleKeyDown }) }) })] }) }) }), _jsx("div", { className: "footer-container", children: _jsx("button", { type: "button", onClick: () => formRef.current.submitForm(), className: "btn", children: "Set" }) })] }));
|
|
127
125
|
}
|
|
@@ -41,7 +41,7 @@ const styles = css `
|
|
|
41
41
|
export default function SelectMolecule(props) {
|
|
42
42
|
const [currentIndex, setCurrentIndex] = useState();
|
|
43
43
|
const { setFieldValue, errors, values } = useFormikContext();
|
|
44
|
-
const { molecules, activeTab } = useChartData();
|
|
44
|
+
const { molecules, view: { spectra: { activeTab }, }, } = useChartData();
|
|
45
45
|
const element = getAtom(activeTab);
|
|
46
46
|
const newSum = useMemo(() => {
|
|
47
47
|
return element &&
|
|
@@ -59,7 +59,7 @@ export default function SelectMolecule(props) {
|
|
|
59
59
|
useEffect(() => {
|
|
60
60
|
if (molecules && molecules.length > 0) {
|
|
61
61
|
const index = values[props.name]
|
|
62
|
-
? molecules.findIndex((molecule) => molecule.
|
|
62
|
+
? molecules.findIndex((molecule) => molecule.id === values[props.name].id)
|
|
63
63
|
: -1;
|
|
64
64
|
setValue(index !== -1 ? index : 0);
|
|
65
65
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
+
import { v4 } from '@lukeed/uuid';
|
|
4
5
|
import { useMemo, useCallback, useRef } from 'react';
|
|
5
6
|
import { FaSearchPlus } from 'react-icons/fa';
|
|
6
|
-
import generateID from '../../../data/utilities/generateID';
|
|
7
7
|
import { useChartData } from '../../context/ChartContext';
|
|
8
8
|
import { useDispatch } from '../../context/DispatchContext';
|
|
9
9
|
import Button from '../../elements/Button';
|
|
@@ -51,7 +51,7 @@ const styles = css `
|
|
|
51
51
|
`;
|
|
52
52
|
function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeModal = () => null, onZoomEditRangeModal = () => null, manualRange = false, range: originRange, }) {
|
|
53
53
|
const formRef = useRef(null);
|
|
54
|
-
const { activeTab } = useChartData();
|
|
54
|
+
const { view: { spectra: { activeTab }, }, } = useChartData();
|
|
55
55
|
const dispatch = useDispatch();
|
|
56
56
|
const rangesPreferences = usePanelPreferences('ranges', activeTab);
|
|
57
57
|
const validation = useRangeFormValidation();
|
|
@@ -73,7 +73,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
73
73
|
const getSignals = useCallback((signals) => {
|
|
74
74
|
return signals.map((signal) => {
|
|
75
75
|
return {
|
|
76
|
-
id:
|
|
76
|
+
id: v4(),
|
|
77
77
|
...signal,
|
|
78
78
|
multiplicity: signal.js
|
|
79
79
|
.map((_coupling) => translateMultiplet(_coupling.multiplicity))
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { useFormikContext } from 'formik';
|
|
5
5
|
import lodashGet from 'lodash/get';
|
|
6
|
-
import { memo,
|
|
6
|
+
import { memo, useCallback } from 'react';
|
|
7
7
|
import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
|
|
8
8
|
import { Multiplets } from '../../../../../data/constants/Multiplets';
|
|
9
9
|
import Button from '../../../../elements/Button';
|
|
@@ -41,18 +41,13 @@ function CouplingsTable({ push, remove, onFocus, onBlur, }) {
|
|
|
41
41
|
setFieldValue(name, '');
|
|
42
42
|
}
|
|
43
43
|
}, [setFieldValue]);
|
|
44
|
-
const multipletsList = useMemo(() => {
|
|
45
|
-
return Multiplets.map((multiplet) => ({
|
|
46
|
-
key: multiplet.value,
|
|
47
|
-
...multiplet,
|
|
48
|
-
value: multiplet.label,
|
|
49
|
-
}));
|
|
50
|
-
}, []);
|
|
51
44
|
const couplingsList = lodashGet(values, `signals[${values.activeTab}].js`, []);
|
|
52
45
|
return (_jsxs("div", { children: [_jsxs(Button.Done, { fill: "outline", style: { marginBottom: '10px' }, onClick: () => push({
|
|
53
46
|
multiplicity: translateMultiplet('m'),
|
|
54
47
|
coupling: '',
|
|
55
|
-
}), children: [_jsx(FaPlus, { title: "Add new coupling", style: { display: 'inline-block' } }), _jsx("span", { style: { display: 'inline-block', paddingLeft: '5px' }, children: "Add New Coupling" })] }), _jsx("table", { css: CouplingsTableStyle, children: _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("th", { children: "#" }), _jsx("th", { children: "Multiplicity" }), _jsx("th", { children: "J (Hz)" }), _jsx("th", { children: '' })] }), couplingsList.map((_coupling, i) => (_jsxs("tr", { children: [_jsx("td", { children: i + 1 }), _jsx("td", { children: _jsx(FormikSelect, { className: "selectBox", name: `signals.${values.activeTab}.js.${i}.multiplicity`,
|
|
48
|
+
}), children: [_jsx(FaPlus, { title: "Add new coupling", style: { display: 'inline-block' } }), _jsx("span", { style: { display: 'inline-block', paddingLeft: '5px' }, children: "Add New Coupling" })] }), _jsx("table", { css: CouplingsTableStyle, children: _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("th", { children: "#" }), _jsx("th", { children: "Multiplicity" }), _jsx("th", { children: "J (Hz)" }), _jsx("th", { children: '' })] }), couplingsList.map((_coupling, i) => (_jsxs("tr", { children: [_jsx("td", { children: i + 1 }), _jsx("td", { children: _jsx(FormikSelect, { className: "selectBox", name: `signals.${values.activeTab}.js.${i}.multiplicity`, items: Multiplets, itemValueField: "label", onChange: (value) => {
|
|
49
|
+
multiplicityChangeHandler(value, `signals.${values.activeTab}.js.${i}.coupling`);
|
|
50
|
+
} }) }), _jsx("td", { children: _jsx(FormikInput, { name: `signals.${values.activeTab}.js.${i}.coupling`, type: "number", placeholder: 'J (Hz)', disabled: !hasCouplingConstant(_coupling.multiplicity), onFocus: onFocus, onBlur: onBlur, style: {
|
|
56
51
|
input: {
|
|
57
52
|
width: '100%',
|
|
58
53
|
height: '26px',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { v4 } from '@lukeed/uuid';
|
|
2
3
|
import { Field, useFormikContext } from 'formik';
|
|
3
4
|
import lodashGet from 'lodash/get';
|
|
4
5
|
import { useCallback, useMemo } from 'react';
|
|
5
6
|
import { FaLink, FaPlus, FaTimes } from 'react-icons/fa';
|
|
6
|
-
import generateID from '../../../data/utilities/generateID';
|
|
7
7
|
import Button from '../../elements/Button';
|
|
8
8
|
import FormikCheckBox from '../../elements/formik/FormikCheckBox';
|
|
9
9
|
import FormikInput from '../../elements/formik/FormikInput';
|
|
@@ -41,7 +41,7 @@ function DatabasesTabContent({ currentWorkspace }) {
|
|
|
41
41
|
}, [databases, setFieldValue]);
|
|
42
42
|
const addNewDatabaseHandler = useCallback(() => {
|
|
43
43
|
const newDatabase = {
|
|
44
|
-
key:
|
|
44
|
+
key: v4(),
|
|
45
45
|
label: '',
|
|
46
46
|
url: '',
|
|
47
47
|
enabled: true,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
+
import { v4 } from '@lukeed/uuid';
|
|
4
5
|
import { useFormikContext } from 'formik';
|
|
5
6
|
import lodashGet from 'lodash/get';
|
|
6
7
|
import { Fragment, useCallback, useMemo } from 'react';
|
|
7
8
|
import { FaPlus, FaTimes } from 'react-icons/fa';
|
|
8
|
-
import generateID from '../../../data/utilities/generateID';
|
|
9
9
|
import Button from '../../elements/Button';
|
|
10
10
|
import FormikInput from '../../elements/formik/FormikInput';
|
|
11
11
|
const styles = css `
|
|
@@ -63,7 +63,7 @@ function FormattingTabContent() {
|
|
|
63
63
|
ppm: '0.00',
|
|
64
64
|
hz: '0.00',
|
|
65
65
|
};
|
|
66
|
-
const key =
|
|
66
|
+
const key = v4();
|
|
67
67
|
const newNuclei = { ...nuclei, [key]: newFormat };
|
|
68
68
|
setFieldValue('formatting.nuclei', newNuclei);
|
|
69
69
|
}, [nuclei, setFieldValue]);
|
|
@@ -155,6 +155,6 @@ function GeneralSettings({ onClose }) {
|
|
|
155
155
|
}, [addWorkSpaceHandler, deleteWorkSpaceHandler]);
|
|
156
156
|
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "General Settings" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsxs("div", { className: "workspace-container", children: [_jsx("span", { className: "label", children: "Workspace : " }), _jsx(DropDownButton, { data: workspacesList, renderItem: renderItem, selectedKey: preferences?.workspace.current, onSelect: ChangeWorkspaceHandler }), _jsx(Button.Danger, { fill: "outline", size: "xSmall", onClick: handleReset, style: {
|
|
157
157
|
marginLeft: '10px',
|
|
158
|
-
}, children: "Reset workspace settings" })] }), _jsx("div", { className: "main-content", children: _jsx(FormikForm, { ref: refForm, initialValues: currentWorkspace, validationSchema: validation, onSubmit: submitHandler, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { tablabel: "General", tabid: "general", children: _jsx("div", { className: "inner-content", children: _jsx(GeneralTabContent, {}) }) }), _jsx(Tab, { tablabel: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { tablabel: "
|
|
158
|
+
}, children: "Reset workspace settings" })] }), _jsx("div", { className: "main-content", children: _jsx(FormikForm, { ref: refForm, initialValues: currentWorkspace, validationSchema: validation, onSubmit: submitHandler, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { tablabel: "General", tabid: "general", children: _jsx("div", { className: "inner-content", children: _jsx(GeneralTabContent, {}) }) }), _jsx(Tab, { tablabel: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { tablabel: "Panels", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, {}) }) }), _jsx(Tab, { tablabel: "Tools", tabid: "tools", children: _jsx("div", { className: "inner-content", children: _jsx(ToolsTabContent, {}) }) }), _jsx(Tab, { tablabel: "Databases", tabid: "databases", children: _jsx("div", { className: "inner-content", children: _jsx(DatabasesTabContent, { currentWorkspace: preferences.workspace.current }) }) })] }) }, JSON.stringify(currentWorkspace)) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleClose }) })] }));
|
|
159
159
|
}
|
|
160
160
|
export default GeneralSettings;
|
|
@@ -5,11 +5,11 @@ import ReactTable from '../../elements/ReactTable/ReactTable';
|
|
|
5
5
|
const LIST = [
|
|
6
6
|
{
|
|
7
7
|
label: 'Zoom in',
|
|
8
|
-
name: 'toolBarButtons.
|
|
8
|
+
name: 'toolBarButtons.zoom',
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
label: 'Zoom out',
|
|
12
|
-
name: 'toolBarButtons.
|
|
12
|
+
name: 'toolBarButtons.zoomOut',
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
label: 'Import',
|
|
@@ -33,47 +33,51 @@ const LIST = [
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
label: 'Peak picking',
|
|
36
|
-
name: 'toolBarButtons.
|
|
36
|
+
name: 'toolBarButtons.peakPicking',
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
label: 'Integral',
|
|
40
|
-
name: 'toolBarButtons.
|
|
40
|
+
name: 'toolBarButtons.integral',
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
label: 'Zone Picking',
|
|
44
|
-
name: 'toolBarButtons.
|
|
44
|
+
name: 'toolBarButtons.zonePicking',
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
label: 'Range picking',
|
|
48
|
-
name: 'toolBarButtons.
|
|
48
|
+
name: 'toolBarButtons.rangePicking',
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
label: 'Slicing',
|
|
52
|
-
name: 'toolBarButtons.
|
|
52
|
+
name: 'toolBarButtons.slicing',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: 'Apodization',
|
|
56
|
+
name: 'toolBarButtons.apodization',
|
|
53
57
|
},
|
|
54
58
|
{
|
|
55
59
|
label: 'Zero filling',
|
|
56
|
-
name: 'toolBarButtons.
|
|
60
|
+
name: 'toolBarButtons.zeroFilling',
|
|
57
61
|
},
|
|
58
62
|
{
|
|
59
63
|
label: 'Fourier transform',
|
|
60
|
-
name: 'toolBarButtons.
|
|
64
|
+
name: 'toolBarButtons.fastFourierTransform',
|
|
61
65
|
},
|
|
62
66
|
{
|
|
63
67
|
label: 'Phase correction',
|
|
64
|
-
name: 'toolBarButtons.
|
|
68
|
+
name: 'toolBarButtons.phaseCorrection',
|
|
65
69
|
},
|
|
66
70
|
{
|
|
67
71
|
label: 'Baseline correction',
|
|
68
|
-
name: 'toolBarButtons.
|
|
72
|
+
name: 'toolBarButtons.baselineCorrection',
|
|
69
73
|
},
|
|
70
74
|
{
|
|
71
75
|
label: 'Exclusion zones',
|
|
72
|
-
name: 'toolBarButtons.
|
|
76
|
+
name: 'toolBarButtons.exclusionZones',
|
|
73
77
|
},
|
|
74
78
|
{
|
|
75
79
|
label: 'Multiple spectra analysis',
|
|
76
|
-
name: 'toolBarButtons.
|
|
80
|
+
name: 'toolBarButtons.multipleSpectraAnalysis',
|
|
77
81
|
},
|
|
78
82
|
];
|
|
79
83
|
function ToolsTabContent() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare function WorkspaceItem({ item, onSave, onDelete }: {
|
|
2
2
|
item: any;
|
|
3
3
|
onSave: any;
|
|
4
4
|
onDelete: any;
|
|
5
|
-
})
|
|
5
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default WorkspaceItem;
|
|
@@ -40,7 +40,7 @@ const styles = css `
|
|
|
40
40
|
padding: 5px;
|
|
41
41
|
}
|
|
42
42
|
`;
|
|
43
|
-
|
|
43
|
+
function WorkspaceItem({ item, onSave, onDelete }) {
|
|
44
44
|
const [name, setName] = useState('');
|
|
45
45
|
const addWorkspaceHandler = useCallback((e) => {
|
|
46
46
|
e.stopPropagation();
|
|
@@ -55,5 +55,5 @@ const WorkspaceItem = ({ item, onSave, onDelete }) => {
|
|
|
55
55
|
setName(e.target.value);
|
|
56
56
|
}, []);
|
|
57
57
|
return (_jsx("div", { css: styles, children: item.key === 'new' ? (_jsxs("div", { className: "new-container", children: [_jsx("input", { value: name, placeholder: "Custom workspace", onClick: (e) => e.stopPropagation(), onChange: onTextChange }), _jsx("button", { type: "button", className: "save-button", onClick: addWorkspaceHandler, disabled: !name, children: "save" })] })) : (_jsxs("div", { className: "container", children: [_jsx("span", { children: item.label }), !workspaces[item.key] && (_jsx("button", { type: "button", className: "delete-button", onClick: deleteWorkspaceHandler, children: "Delete" }))] })) }));
|
|
58
|
-
}
|
|
58
|
+
}
|
|
59
59
|
export default WorkspaceItem;
|
|
@@ -110,7 +110,7 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
110
110
|
const MemoizedIntegralPanel = memo(IntegralPanelInner);
|
|
111
111
|
const emptyData = { integrals: {}, info: {} };
|
|
112
112
|
export default function IntegralPanel() {
|
|
113
|
-
const { xDomain, activeTab } = useChartData();
|
|
113
|
+
const { xDomain, view: { spectra: { activeTab }, }, } = useChartData();
|
|
114
114
|
const { integrals, info } = useSpectrum(emptyData);
|
|
115
115
|
return (_jsx(MemoizedIntegralPanel, { ...{
|
|
116
116
|
integrals,
|
|
@@ -59,7 +59,7 @@ function IntegralTable({ activeTab, data }) {
|
|
|
59
59
|
sortType: 'basic',
|
|
60
60
|
resizable: true,
|
|
61
61
|
accessor: (row) => row.kind,
|
|
62
|
-
Cell: ({ row }) => (_jsx(Select, { onChange: (value) => changeIntegralDataHandler(value, row),
|
|
62
|
+
Cell: ({ row }) => (_jsx(Select, { onChange: (value) => changeIntegralDataHandler(value, row), items: SignalKinds, style: selectStyle, defaultValue: row.original.kind })),
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
index: 7,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { StateMoleculeExtended } from '../../../data/molecules/Molecule';
|
|
3
3
|
interface MoleculeHeaderProps {
|
|
4
|
-
currentMolecule:
|
|
5
|
-
molecules:
|
|
4
|
+
currentMolecule: StateMoleculeExtended;
|
|
5
|
+
molecules: StateMoleculeExtended[];
|
|
6
6
|
}
|
|
7
7
|
export default function MoleculeHeader(props: MoleculeHeaderProps): JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -30,9 +30,9 @@ export default function MoleculeHeader(props) {
|
|
|
30
30
|
const number = extractNumber(value);
|
|
31
31
|
return value && !reservedNumbers.includes(Number(number));
|
|
32
32
|
}, [molecules]);
|
|
33
|
-
const saveLabelHandler = useCallback((
|
|
33
|
+
const saveLabelHandler = useCallback((id, event) => {
|
|
34
34
|
const label = event.target.value;
|
|
35
|
-
dispatch({ type: CHANGE_MOLECULE_LABEL, payload: { label,
|
|
35
|
+
dispatch({ type: CHANGE_MOLECULE_LABEL, payload: { label, id } });
|
|
36
36
|
}, [dispatch]);
|
|
37
|
-
return (_jsxs("div", { style: styles.toolbar, children: [_jsxs("div", { style: { display: 'flex' }, children: [_jsx("span", { children: "Label" }), _jsx(EditableColumn, { value: currentMolecule.label, style: styles.labelInput, validate: validateLabel, onSave: (event) => saveLabelHandler(currentMolecule.
|
|
37
|
+
return (_jsxs("div", { style: styles.toolbar, children: [_jsxs("div", { style: { display: 'flex' }, children: [_jsx("span", { children: "Label" }), _jsx(EditableColumn, { value: currentMolecule.label, style: styles.labelInput, validate: validateLabel, onSave: (event) => saveLabelHandler(currentMolecule.id, event) })] }), _jsxs("span", { children: [_jsx(MF, { mf: currentMolecule.mf }), " - ", currentMolecule.mw?.toFixed(2)] })] }));
|
|
38
38
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { ReactElement, CSSProperties } from 'react';
|
|
2
|
+
import { StateMoleculeExtended } from '../../../data/molecules/Molecule';
|
|
3
3
|
import { MoleculeHeaderActionsOptions } from './MoleculePanelHeader';
|
|
4
4
|
interface MoleculePanelProps {
|
|
5
|
-
onMoleculeChange?: (molecule:
|
|
5
|
+
onMoleculeChange?: (molecule: StateMoleculeExtended) => void;
|
|
6
6
|
children?: ReactElement;
|
|
7
7
|
actionsOptions?: MoleculeHeaderActionsOptions;
|
|
8
|
+
emptyTextStyle?: CSSProperties;
|
|
8
9
|
}
|
|
9
|
-
export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, }: MoleculePanelProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, emptyTextStyle, }: MoleculePanelProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import OCL from 'openchemlib/full';
|
|
5
|
-
import { useState, useCallback, useEffect, memo } from 'react';
|
|
5
|
+
import { useState, useCallback, useEffect, memo, } from 'react';
|
|
6
6
|
import { ResponsiveChart } from 'react-d3-utils';
|
|
7
7
|
import OCLnmr from 'react-ocl-nmr';
|
|
8
8
|
import { useChartData } from '../../context/ChartContext';
|
|
@@ -28,6 +28,7 @@ const styles = {
|
|
|
28
28
|
}),
|
|
29
29
|
molecule: css({
|
|
30
30
|
flex: 1,
|
|
31
|
+
minHeight: '100px',
|
|
31
32
|
}),
|
|
32
33
|
slider: css({
|
|
33
34
|
display: 'flex',
|
|
@@ -42,7 +43,7 @@ const styles = {
|
|
|
42
43
|
height: '100%',
|
|
43
44
|
}),
|
|
44
45
|
};
|
|
45
|
-
function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab, displayerMode, onMoleculeChange, actionsOptions, children, }) {
|
|
46
|
+
function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, floatingMolecules, activeTab, displayerMode, onMoleculeChange, actionsOptions, children, emptyTextStyle, }) {
|
|
46
47
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
47
48
|
const [molecules, setMolecules] = useState([]);
|
|
48
49
|
const dispatch = useDispatch();
|
|
@@ -62,17 +63,17 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
|
|
|
62
63
|
onMoleculeChange?.(molecules[currentIndex] || null);
|
|
63
64
|
}, [currentIndex, molecules, onMoleculeChange]);
|
|
64
65
|
const handleReplaceMolecule = useCallback((molecule, molfile) => {
|
|
65
|
-
const {
|
|
66
|
+
const { id, label } = molecule;
|
|
66
67
|
dispatch({
|
|
67
68
|
type: SET_MOLECULE,
|
|
68
|
-
payload: { molfile,
|
|
69
|
+
payload: { molfile, id, label },
|
|
69
70
|
});
|
|
70
71
|
}, [dispatch]);
|
|
71
72
|
const moleculeIndexHandler = useCallback((index) => {
|
|
72
73
|
setCurrentIndex(index);
|
|
73
74
|
}, []);
|
|
74
|
-
return (_jsxs("div", { css: styles.panel, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditor(), onMoleculeIndexChange: moleculeIndexHandler, actionsOptions: actionsOptions }), _jsxs("div", { css: styles.innerPanel, children: [_jsx("div", { css: styles.molecule, children: _jsx(
|
|
75
|
-
|
|
75
|
+
return (_jsxs("div", { css: styles.panel, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, floatingMolecules: floatingMolecules, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditor(), onMoleculeIndexChange: moleculeIndexHandler, actionsOptions: actionsOptions }), _jsxs("div", { css: styles.innerPanel, children: [_jsx("div", { css: styles.molecule, children: _jsx(ResponsiveChart, { children: ({ height, width }) => {
|
|
76
|
+
return (_jsx(NextPrev, { onChange: (slideIndex) => setCurrentIndex(slideIndex), defaultIndex: currentIndex, children: molecules && molecules.length > 0 ? (molecules.map((mol, index) => (_jsxs("div", { css: styles.items, children: [_jsx(MoleculeHeader, { currentMolecule: mol, molecules: molecules }), _jsx("div", { css: styles.slider, className: "mol-svg-container", onDoubleClick: () => openMoleculeEditor(mol), style: {
|
|
76
77
|
backgroundColor: (index + 1) % 2 !== 0 ? '#fafafa' : 'white',
|
|
77
78
|
}, children: _jsx(OCLnmr, { OCL: OCL, id: `molSVG${index}`, width: width, height: height - 60, molfile: mol.molfile || '', setMolfile: (molfile) => handleReplaceMolecule(mol, molfile), setSelectedAtom: handleOnClickAtom, atomHighlightColor: currentDiaIDsToHighlight &&
|
|
78
79
|
currentDiaIDsToHighlight.length > 0
|
|
@@ -80,23 +81,25 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
|
|
|
80
81
|
: '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight &&
|
|
81
82
|
currentDiaIDsToHighlight.length > 0
|
|
82
83
|
? currentDiaIDsToHighlight
|
|
83
|
-
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }) })] }, mol.
|
|
84
|
-
|
|
84
|
+
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }) })] }, mol.id)))) : (_jsx("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditor(), children: _jsx("span", { style: emptyTextStyle, children: "Click to draw molecule" }) })) }));
|
|
85
|
+
} }) }), children] })] }));
|
|
85
86
|
}
|
|
86
87
|
const MemoizedMoleculePanel = memo(MoleculePanelInner);
|
|
87
88
|
const emptyData = { ranges: {}, zones: {} };
|
|
88
|
-
export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, }) {
|
|
89
|
-
const { molecules,
|
|
89
|
+
export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, emptyTextStyle, }) {
|
|
90
|
+
const { molecules, view: { floatingMolecules, spectra: { activeTab }, }, displayerMode, } = useChartData();
|
|
90
91
|
const data = useSpectrum(emptyData);
|
|
91
92
|
const ranges = data?.ranges || {};
|
|
92
93
|
const zones = data?.zones || {};
|
|
93
94
|
return (_jsx(MemoizedMoleculePanel, { ...{
|
|
94
95
|
molecules,
|
|
96
|
+
floatingMolecules,
|
|
95
97
|
displayerMode,
|
|
96
98
|
activeTab,
|
|
97
99
|
ranges,
|
|
98
100
|
zones,
|
|
99
101
|
onMoleculeChange,
|
|
100
102
|
actionsOptions,
|
|
103
|
+
emptyTextStyle,
|
|
101
104
|
}, children: children }));
|
|
102
105
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FloatingMolecules, StateMoleculeExtended } from '../../../data/molecules/Molecule';
|
|
1
2
|
export interface MoleculeHeaderActionsOptions {
|
|
2
3
|
hidePast?: boolean;
|
|
3
4
|
hideAdd?: boolean;
|
|
@@ -7,10 +8,11 @@ export interface MoleculeHeaderActionsOptions {
|
|
|
7
8
|
}
|
|
8
9
|
interface MoleculePanelHeaderProps {
|
|
9
10
|
currentIndex: number;
|
|
10
|
-
molecules: Array<
|
|
11
|
+
molecules: Array<StateMoleculeExtended>;
|
|
12
|
+
floatingMolecules: Array<FloatingMolecules>;
|
|
11
13
|
onMoleculeIndexChange: (index: number) => void;
|
|
12
14
|
onOpenMoleculeEditor: () => void;
|
|
13
15
|
actionsOptions?: MoleculeHeaderActionsOptions;
|
|
14
16
|
}
|
|
15
|
-
export default function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange, onOpenMoleculeEditor, actionsOptions, }: MoleculePanelHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default function MoleculePanelHeader({ currentIndex, molecules, floatingMolecules, onMoleculeIndexChange, onOpenMoleculeEditor, actionsOptions, }: MoleculePanelHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
18
|
export {};
|
|
@@ -8,9 +8,9 @@ import { IoOpenOutline } from 'react-icons/io5';
|
|
|
8
8
|
import { useAssignmentData } from '../../assignment/AssignmentsContext';
|
|
9
9
|
import { useDispatch } from '../../context/DispatchContext';
|
|
10
10
|
import { useGlobal } from '../../context/GlobalContext';
|
|
11
|
+
import ActiveButton from '../../elements/ActiveButton';
|
|
11
12
|
import ButtonToolTip from '../../elements/ButtonToolTip';
|
|
12
13
|
import MenuButton from '../../elements/MenuButton';
|
|
13
|
-
import ToggleButton from '../../elements/ToggleButton';
|
|
14
14
|
import ToolTip from '../../elements/ToolTip/ToolTip';
|
|
15
15
|
import { useAlert } from '../../elements/popup/Alert';
|
|
16
16
|
import { positions, useModal } from '../../elements/popup/Modal';
|
|
@@ -58,7 +58,7 @@ const MOL_EXPORT_MENU = [
|
|
|
58
58
|
label: 'Export as SVG',
|
|
59
59
|
},
|
|
60
60
|
];
|
|
61
|
-
export default function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange = () => null, onOpenMoleculeEditor = () => null, actionsOptions = {}, }) {
|
|
61
|
+
export default function MoleculePanelHeader({ currentIndex, molecules, floatingMolecules, onMoleculeIndexChange = () => null, onOpenMoleculeEditor = () => null, actionsOptions = {}, }) {
|
|
62
62
|
const { rootRef } = useGlobal();
|
|
63
63
|
const alert = useAlert();
|
|
64
64
|
const dispatch = useDispatch();
|
|
@@ -108,11 +108,11 @@ export default function MoleculePanelHeader({ currentIndex, molecules, onMolecul
|
|
|
108
108
|
});
|
|
109
109
|
}, [dispatch]);
|
|
110
110
|
const handleDelete = useCallback(() => {
|
|
111
|
-
if (molecules[currentIndex]?.
|
|
111
|
+
if (molecules[currentIndex]?.id) {
|
|
112
112
|
onMoleculeIndexChange(0);
|
|
113
113
|
dispatch({
|
|
114
114
|
type: DELETE_MOLECULE,
|
|
115
|
-
payload: {
|
|
115
|
+
payload: { id: molecules[currentIndex].id, assignmentData },
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
}, [
|
|
@@ -132,10 +132,10 @@ export default function MoleculePanelHeader({ currentIndex, molecules, onMolecul
|
|
|
132
132
|
const floatMoleculeHandler = useCallback(() => {
|
|
133
133
|
dispatch({
|
|
134
134
|
type: FLOAT_MOLECULE_OVER_SPECTRUM,
|
|
135
|
-
payload: {
|
|
135
|
+
payload: { id: molecules[currentIndex].id },
|
|
136
136
|
});
|
|
137
137
|
}, [currentIndex, dispatch, molecules]);
|
|
138
|
-
return (_jsxs("div", { css: toolbarStyle, children: [!actionsOptions.hideExport && (_jsx(MenuButton, { component: _jsx(FaFileExport, {}), toolTip: "Export As", items: MOL_EXPORT_MENU, onClick: exportHandler })), !actionsOptions.hidePast && (_jsx(ToolTip, { title: "Paste molfile", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handlePaste, children: _jsx(FaPaste, {}) }) })), !actionsOptions.hideAdd && (_jsx(ToolTip, { title: "Add Molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: onOpenMoleculeEditor,
|
|
138
|
+
return (_jsxs("div", { css: toolbarStyle, children: [!actionsOptions.hideExport && (_jsx(MenuButton, { component: _jsx(FaFileExport, {}), toolTip: "Export As", items: MOL_EXPORT_MENU, onClick: exportHandler })), !actionsOptions.hidePast && (_jsx(ToolTip, { title: "Paste molfile", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handlePaste, children: _jsx(FaPaste, {}) }) })), !actionsOptions.hideAdd && (_jsx(ToolTip, { title: "Add Molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: onOpenMoleculeEditor, children: _jsx(FaPlus, {}) }) })), !actionsOptions.hideDelete && (_jsx(ToolTip, { title: "Delete Molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handleDelete, children: _jsx(FaRegTrashAlt, {}) }) })), !actionsOptions.hidePredict && molecules && molecules.length > 0 && (_jsx(ButtonToolTip, { popupTitle: "Predict Spectra", popupPlacement: "left", onClick: openPredictSpectraModal, children: _jsx(SvgNmrFt, {}) })), molecules?.[currentIndex] && (_jsx(ActiveButton, { value: floatingMolecules.find(({ id }) => id === molecules[currentIndex].id)?.visible || false, popupTitle: "Float Molecule", popupPlacement: "left", onClick: floatMoleculeHandler, children: _jsx(IoOpenOutline, {}) }, molecules[currentIndex].id)), _jsxs("p", { children: [molecules &&
|
|
139
139
|
molecules.length > 0 &&
|
|
140
140
|
`${+(currentIndex + 1)} / ${molecules.length}`, ' '] })] }));
|
|
141
141
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Range } from '../../../data/types/data1d';
|
|
2
2
|
import { Zone } from '../../../data/types/data2d';
|
|
3
3
|
import { AssignmentContext, Axis } from '../../assignment/AssignmentsContext';
|
|
4
|
-
interface Atom {
|
|
4
|
+
export interface Atom {
|
|
5
5
|
oclID: string;
|
|
6
6
|
atomLabel: string;
|
|
7
7
|
nbAtoms: number;
|
|
@@ -31,4 +31,3 @@ export declare function findDatumAndSignalIndex(data: (Range | Zone)[], id: stri
|
|
|
31
31
|
export declare function getHighlightsOnHover(assignments: AssignmentContext, oclIDs: any, data: any): string[];
|
|
32
32
|
export declare function getCurrentDiaIDsToHighlight(assignmentData: AssignmentContext): string[];
|
|
33
33
|
export declare function toggleDiaIDs(diaIDs: string[], atomInformation: AtomData): (number | string[])[];
|
|
34
|
-
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import { Atom } from './Utilities';
|
|
1
3
|
export default function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }: {
|
|
2
4
|
displayerMode: any;
|
|
3
5
|
activeTab: any;
|
|
4
6
|
zones: any;
|
|
5
7
|
ranges: any;
|
|
6
8
|
}): {
|
|
7
|
-
handleOnAtomHover: (atom:
|
|
8
|
-
handleOnClickAtom: (atom:
|
|
9
|
+
handleOnAtomHover: (atom: Atom) => void;
|
|
10
|
+
handleOnClickAtom: (atom: Atom, event: MouseEvent) => void;
|
|
9
11
|
currentDiaIDsToHighlight: string[];
|
|
10
|
-
assignedDiaIDsMerged:
|
|
12
|
+
assignedDiaIDsMerged: string[];
|
|
11
13
|
};
|