nmrium 0.29.0 → 0.30.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 +47 -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/IntegralResizable.js +5 -4
- package/lib/component/1d/LinesSeries.js +6 -6
- package/lib/component/1d/Viewer1D.js +7 -12
- 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/multiAnalysis/AnalysisRange.js +16 -14
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +3 -4
- 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 +26 -0
- package/lib/component/1d/peaks/PeaksShapes.d.ts +3 -0
- package/lib/component/1d/peaks/PeaksShapes.js +35 -0
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +13 -0
- package/lib/component/1d/peaks/usePeakShapesPath.js +45 -0
- package/lib/component/1d/ranges/Range.js +4 -4
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/Viewer2D.js +2 -2
- 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/EventsTrackers/KeysListenerTracker.js +91 -52
- 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/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 +49 -46
- 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/useCheckToolsVisibility.d.ts +10 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib/component/hooks/useFilter.d.ts +1 -0
- package/lib/component/hooks/useFilter.js +7 -0
- package/lib/component/hooks/useToolsFunctions.js +1 -1
- package/lib/component/loader/DropZone.js +1 -1
- 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 +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +2 -2
- 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 +13 -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/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/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.js +1 -1
- 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/SpectrumListItem.js +1 -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 +1 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +4 -12
- 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 +4 -0
- package/lib/component/reducer/Reducer.d.ts +37 -6
- package/lib/component/reducer/Reducer.js +25 -5
- package/lib/component/reducer/actions/FiltersActions.d.ts +13 -7
- package/lib/component/reducer/actions/FiltersActions.js +165 -29
- package/lib/component/reducer/actions/IntegralsActions.js +2 -2
- package/lib/component/reducer/actions/MoleculeActions.js +27 -14
- package/lib/component/reducer/actions/PeaksActions.d.ts +4 -1
- package/lib/component/reducer/actions/PeaksActions.js +38 -5
- package/lib/component/reducer/actions/RangesActions.js +2 -2
- package/lib/component/reducer/actions/SpectrumsActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +9 -72
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +7 -0
- package/lib/component/reducer/helper/getStrongestPeak.js +14 -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 +7 -0
- package/lib/component/reducer/types/Types.js +7 -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 +2 -2
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +14 -6
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +3 -2
- package/lib/component/tool/FloatMoleculeStructures/index.js +13 -6
- package/lib/component/toolbar/BasicToolBar.js +3 -8
- package/lib/component/toolbar/FunctionToolBar.js +11 -23
- package/lib/component/toolbar/ToolTypes.d.ts +7 -1
- package/lib/component/toolbar/ToolTypes.js +119 -9
- package/lib/component/utility/util/nmredata/addZones.js +3 -3
- 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 +4 -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 -1
- package/lib/data/SpectraManager.js +2 -8
- 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 +4 -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 +1 -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/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/migration/MigrationManager.d.ts +1 -1
- package/lib/data/migration/MigrationManager.js +3 -1
- package/lib/data/migration/migrateToVersion3.d.ts +1 -0
- package/lib/data/migration/migrateToVersion3.js +55 -0
- package/lib/data/molecules/Molecule.d.ts +15 -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 +75 -0
- package/lib-cjs/component/1d/Chart1D.js +4 -2
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +15 -8
- package/lib-cjs/component/1d/IntegralResizable.js +4 -3
- package/lib-cjs/component/1d/LinesSeries.js +5 -5
- package/lib-cjs/component/1d/Viewer1D.js +7 -12
- 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/multiAnalysis/AnalysisRange.js +15 -13
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +1 -2
- package/lib-cjs/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib-cjs/component/1d/peaks/PeakAnnotations.js +31 -0
- package/lib-cjs/component/1d/peaks/PeaksShapes.js +40 -0
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +49 -0
- package/lib-cjs/component/1d/ranges/Range.js +3 -3
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/Viewer2D.js +2 -2
- package/lib-cjs/component/2d/zones/Signal.js +3 -3
- package/lib-cjs/component/2d/zones/Zone.js +3 -3
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +89 -50
- 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/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 +70 -44
- package/lib-cjs/component/header/Zones2DOptionPanel.js +11 -13
- package/lib-cjs/component/highlight/index.js +20 -18
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib-cjs/component/hooks/useFilter.js +14 -0
- package/lib-cjs/component/hooks/useToolsFunctions.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +1 -1
- 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 +1 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +2 -2
- 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 +13 -13
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +2 -2
- 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/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 +1 -1
- 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/SpectrumListItem.js +1 -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 +1 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +4 -12
- 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 +4 -0
- package/lib-cjs/component/reducer/Reducer.js +25 -8
- package/lib-cjs/component/reducer/actions/FiltersActions.js +170 -29
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +2 -2
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +27 -14
- package/lib-cjs/component/reducer/actions/PeaksActions.js +40 -4
- package/lib-cjs/component/reducer/actions/RangesActions.js +2 -2
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +1 -1
- package/lib-cjs/component/reducer/actions/ToolsActions.js +8 -71
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +18 -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 +10 -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 +12 -4
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +13 -6
- package/lib-cjs/component/toolbar/BasicToolBar.js +3 -8
- package/lib-cjs/component/toolbar/FunctionToolBar.js +10 -22
- package/lib-cjs/component/toolbar/ToolTypes.js +119 -9
- package/lib-cjs/component/utility/util/nmredata/addZones.js +3 -6
- 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 +4 -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 +2 -8
- 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 +4 -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 +1 -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/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/migration/MigrationManager.js +3 -1
- package/lib-cjs/data/migration/migrateToVersion3.js +58 -0
- 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 +32 -31
- package/lib/component/1d/PeakAnnotations.js +0 -41
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +0 -14
- package/lib/data/data1d/filter1d/lineBroadening.js +0 -57
- 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/data/data1d/filter1d/lineBroadening.js +0 -63
- package/lib-cjs/data/utilities/generateID.js +0 -12
|
@@ -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,47 @@ 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
53
|
},
|
|
54
54
|
{
|
|
55
55
|
label: 'Zero filling',
|
|
56
|
-
name: 'toolBarButtons.
|
|
56
|
+
name: 'toolBarButtons.zeroFilling',
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
label: 'Fourier transform',
|
|
60
|
-
name: 'toolBarButtons.
|
|
60
|
+
name: 'toolBarButtons.fastFourierTransform',
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
label: 'Phase correction',
|
|
64
|
-
name: 'toolBarButtons.
|
|
64
|
+
name: 'toolBarButtons.phaseCorrection',
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
label: 'Baseline correction',
|
|
68
|
-
name: 'toolBarButtons.
|
|
68
|
+
name: 'toolBarButtons.baselineCorrection',
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
label: 'Exclusion zones',
|
|
72
|
-
name: 'toolBarButtons.
|
|
72
|
+
name: 'toolBarButtons.exclusionZones',
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
label: 'Multiple spectra analysis',
|
|
76
|
-
name: 'toolBarButtons.
|
|
76
|
+
name: 'toolBarButtons.multipleSpectraAnalysis',
|
|
77
77
|
},
|
|
78
78
|
];
|
|
79
79
|
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;
|
|
@@ -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, displayerMode, activeTab } = useChartData();
|
|
89
|
+
export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, emptyTextStyle, }) {
|
|
90
|
+
const { molecules, view: { floatingMolecules }, displayerMode, activeTab, } = 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
|
};
|
|
@@ -5,7 +5,7 @@ import { useAssignment, useAssignmentData, } from '../../assignment/AssignmentsC
|
|
|
5
5
|
import { filterForIDsWithAssignment } from '../../assignment/utilities/filterForIDsWithAssignment';
|
|
6
6
|
import { useDispatch } from '../../context/DispatchContext';
|
|
7
7
|
import { useAlert } from '../../elements/popup/Alert';
|
|
8
|
-
import {
|
|
8
|
+
import { HighlightEventSource, useHighlightData } from '../../highlight';
|
|
9
9
|
import { DISPLAYER_MODE } from '../../reducer/core/Constants';
|
|
10
10
|
import { SET_DIAID_RANGE, SET_DIAID_ZONE } from '../../reducer/types/Types';
|
|
11
11
|
import { extractFromAtom, findDatumAndSignalIndex, getCurrentDiaIDsToHighlight, getHighlightsOnHover, toggleDiaIDs, } from './Utilities';
|
|
@@ -24,7 +24,10 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
|
|
|
24
24
|
if (onAtomHoverAction === 'show') {
|
|
25
25
|
highlightData.dispatch({
|
|
26
26
|
type: 'SHOW',
|
|
27
|
-
payload: {
|
|
27
|
+
payload: {
|
|
28
|
+
convertedHighlights: onAtomHoverHighlights,
|
|
29
|
+
sourceData: { type: HighlightEventSource.ATOM },
|
|
30
|
+
},
|
|
28
31
|
});
|
|
29
32
|
}
|
|
30
33
|
else if (onAtomHoverAction === 'hide') {
|
|
@@ -51,7 +54,10 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
|
|
|
51
54
|
return [];
|
|
52
55
|
}, [displayerMode, ranges, zones]);
|
|
53
56
|
const assignedDiaIDs = useMemo(() => {
|
|
54
|
-
const assignedDiaID = {
|
|
57
|
+
const assignedDiaID = {
|
|
58
|
+
x: [],
|
|
59
|
+
y: [],
|
|
60
|
+
};
|
|
55
61
|
const assignment = assignments.data.assignments;
|
|
56
62
|
for (let id in assignment) {
|
|
57
63
|
if (assignment[id].x) {
|
|
@@ -74,7 +80,9 @@ export default function useAtomAssignment({ displayerMode, activeTab: nucleus, z
|
|
|
74
80
|
const { datum } = findDatumAndSignalIndex(data, highlightID);
|
|
75
81
|
const type = highlightData.highlight.sourceData?.type;
|
|
76
82
|
if (datum &&
|
|
77
|
-
(type ===
|
|
83
|
+
(type === HighlightEventSource.ZONE ||
|
|
84
|
+
type === HighlightEventSource.RANGE ||
|
|
85
|
+
type === HighlightEventSource.ATOM)) {
|
|
78
86
|
// we are on range/zone level only, so add the belonging signal IDs to highlight too
|
|
79
87
|
highlights = highlights.concat(datum.signals
|
|
80
88
|
.map((signal) => filterForIDsWithAssignment(assignments, [signal.id]).length > 0
|
|
@@ -84,7 +84,7 @@ const accordionItems = [
|
|
|
84
84
|
mode: null,
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
title: '
|
|
87
|
+
title: 'Chemical structures',
|
|
88
88
|
component: _jsx(MoleculePanel, {}),
|
|
89
89
|
hidePreferenceKey: 'structuresPanel',
|
|
90
90
|
mode: null,
|
|
@@ -112,8 +112,8 @@ export const TOOLS_PANELS_ACCORDION = {
|
|
|
112
112
|
null: 'Spectra',
|
|
113
113
|
peakPicking: 'Peaks',
|
|
114
114
|
integral: 'Integrals',
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
rangePicking: 'Ranges',
|
|
116
|
+
zonePicking: 'Zones',
|
|
117
117
|
multipleSpectraAnalysis: 'Multiple Spectra Analysis',
|
|
118
118
|
};
|
|
119
119
|
function usePanelPreferences() {
|
|
@@ -1,25 +1,35 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
+
import { SvgNmrFt } from 'cheminfo-font';
|
|
5
|
+
import SvgPeaks from 'cheminfo-font/lib-react-cjs/lib-react-tsx/nmr/Peaks';
|
|
4
6
|
import { useCallback, useMemo, useState, useRef, memo } from 'react';
|
|
7
|
+
import { FaThinkPeaks } from 'react-icons/fa';
|
|
8
|
+
import isInRange from '../../../data/utilities/isInRange';
|
|
5
9
|
import { useChartData } from '../../context/ChartContext';
|
|
6
10
|
import { useDispatch } from '../../context/DispatchContext';
|
|
7
11
|
import { usePreferences } from '../../context/PreferencesContext';
|
|
12
|
+
import Button from '../../elements/Button';
|
|
13
|
+
import ToggleButton from '../../elements/ToggleButton';
|
|
14
|
+
import { useAlert } from '../../elements/popup/Alert';
|
|
8
15
|
import { useModal } from '../../elements/popup/Modal';
|
|
16
|
+
import useCheckExperimentalFeature from '../../hooks/useCheckExperimentalFeature';
|
|
9
17
|
import { useFormatNumberByNucleus } from '../../hooks/useFormatNumberByNucleus';
|
|
10
18
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
11
|
-
import { DELETE_PEAK_NOTATION } from '../../reducer/types/Types';
|
|
19
|
+
import { DELETE_PEAK_NOTATION, OPTIMIZE_PEAKS, TOGGLE_PEAKS_SHAPES, } from '../../reducer/types/Types';
|
|
12
20
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
13
21
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
14
22
|
import PreferencesHeader from '../header/PreferencesHeader';
|
|
15
23
|
import PeaksPreferences from './PeaksPreferences';
|
|
16
24
|
import PeaksTable from './PeaksTable';
|
|
17
|
-
function PeaksPanelInner({ peaks, info, xDomain, activeTab, }) {
|
|
25
|
+
function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksOptions, }) {
|
|
18
26
|
const [filterIsActive, setFilterIsActive] = useState(false);
|
|
19
27
|
const [isFlipped, setFlipStatus] = useState(false);
|
|
20
28
|
const format = useFormatNumberByNucleus(info.nucleus);
|
|
21
29
|
const dispatch = useDispatch();
|
|
22
30
|
const modal = useModal();
|
|
31
|
+
const alert = useAlert();
|
|
32
|
+
const isExperimental = useCheckExperimentalFeature();
|
|
23
33
|
const settingRef = useRef();
|
|
24
34
|
const yesHandler = useCallback(() => {
|
|
25
35
|
dispatch({ type: DELETE_PEAK_NOTATION, data: null });
|
|
@@ -41,33 +51,41 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, }) {
|
|
|
41
51
|
setFilterIsActive(!filterIsActive);
|
|
42
52
|
}, [filterIsActive]);
|
|
43
53
|
const filteredPeaks = useMemo(() => {
|
|
44
|
-
function isInRange(value) {
|
|
45
|
-
const factor = 100000;
|
|
46
|
-
return (value * factor >= xDomain[0] * factor &&
|
|
47
|
-
value * factor <= xDomain[1] * factor);
|
|
48
|
-
}
|
|
49
54
|
if (peaks?.values) {
|
|
55
|
+
const [from, to] = xDomain;
|
|
50
56
|
const _peaks = filterIsActive
|
|
51
|
-
? peaks.values.filter((peak) => isInRange(peak.x))
|
|
57
|
+
? peaks.values.filter((peak) => isInRange(peak.x, { from, to }))
|
|
52
58
|
: peaks.values;
|
|
53
59
|
return _peaks
|
|
54
60
|
.map((peak) => {
|
|
55
|
-
const
|
|
61
|
+
const { x, y, width, ...peakProperties } = peak;
|
|
62
|
+
const value = Number(format(x));
|
|
56
63
|
return {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
peakWidth: peak.width ? peak.width : '',
|
|
64
|
-
isConstantlyHighlighted: isInRange(value),
|
|
64
|
+
...peakProperties,
|
|
65
|
+
x,
|
|
66
|
+
xHz: info?.originFrequency ? value * info.originFrequency : '',
|
|
67
|
+
y,
|
|
68
|
+
width: width ? width : '',
|
|
69
|
+
isConstantlyHighlighted: isInRange(value, { from, to }),
|
|
65
70
|
};
|
|
66
71
|
})
|
|
67
|
-
.sort((prev, next) => prev.
|
|
72
|
+
.sort((prev, next) => prev.x - next.x);
|
|
68
73
|
}
|
|
69
74
|
return [];
|
|
70
75
|
}, [filterIsActive, format, info, peaks, xDomain]);
|
|
76
|
+
const optimizePeaksHandler = () => {
|
|
77
|
+
const [from, to] = xDomain;
|
|
78
|
+
const filterPeaks = peaks.values.filter((peak) => isInRange(peak.x, { from, to }));
|
|
79
|
+
if (filterPeaks.length <= 4) {
|
|
80
|
+
dispatch({ type: OPTIMIZE_PEAKS, payload: { peaks: filterPeaks } });
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
alert.error('optimization can be done on no more than 4 peaks');
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const togglePeaksShapesHandler = (key) => {
|
|
87
|
+
dispatch({ type: TOGGLE_PEAKS_SHAPES, payload: { key } });
|
|
88
|
+
};
|
|
71
89
|
return (_jsxs("div", { css: [
|
|
72
90
|
tablePanelStyle,
|
|
73
91
|
isFlipped &&
|
|
@@ -79,13 +97,20 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, }) {
|
|
|
79
97
|
}
|
|
80
98
|
}
|
|
81
99
|
`,
|
|
82
|
-
], children: [!isFlipped && (_jsx(DefaultPanelHeader, { counter: peaks?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Peaks", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all peaks' : 'Hide peaks out of view', filterIsActive: filterIsActive, counterFiltered: filteredPeaks.length, showSettingButton: true, onSettingClick: settingsPanelHandler
|
|
100
|
+
], children: [!isFlipped && (_jsx(DefaultPanelHeader, { counter: peaks?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Peaks", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all peaks' : 'Hide peaks out of view', filterIsActive: filterIsActive, counterFiltered: filteredPeaks.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: isExperimental && (_jsxs(_Fragment, { children: [_jsx(ToggleButton, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksOptions.showPeaksShapes
|
|
101
|
+
? 'Hide peaks shapes'
|
|
102
|
+
: 'Show peaks shapes', popupPlacement: "right", onClick: () => togglePeaksShapesHandler('showPeaksShapes'), disabled: !peaks?.values || peaks.values.length === 0, children: _jsx(SvgPeaks, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ToggleButton, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksOptions.showPeaksSum
|
|
103
|
+
? 'Hide peaks sum'
|
|
104
|
+
: 'Show peaks sum', popupPlacement: "right", onClick: () => togglePeaksShapesHandler('showPeaksSum'), disabled: !peaks?.values || peaks.values.length === 0, children: _jsx(SvgNmrFt, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(Button.Done, { fill: "clear", onClick: optimizePeaksHandler, style: { width: '24px', padding: 0 }, children: _jsx("div", { style: {
|
|
105
|
+
display: 'flex',
|
|
106
|
+
justifyContent: 'center',
|
|
107
|
+
}, children: _jsx(FaThinkPeaks, {}) }) })] })) })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(PeaksTable, { data: filteredPeaks, activeTab: activeTab })) : (_jsx(PeaksPreferences, { ref: settingRef })) })] }));
|
|
83
108
|
}
|
|
84
109
|
const MemoizedPeaksPanel = memo(PeaksPanelInner);
|
|
85
110
|
const emptyData = { peaks: null, info: {} };
|
|
86
111
|
export default function PeaksPanel() {
|
|
87
|
-
const { xDomain, activeTab } = useChartData();
|
|
112
|
+
const { xDomain, activeTab, toolOptions: { data: { peaksOptions }, }, } = useChartData();
|
|
88
113
|
const { peaks, info } = useSpectrum(emptyData);
|
|
89
114
|
const preferences = usePreferences();
|
|
90
|
-
return (_jsx(MemoizedPeaksPanel, { ...{ peaks, info, xDomain, activeTab, preferences } }));
|
|
115
|
+
return (_jsx(MemoizedPeaksPanel, { ...{ peaks, info, xDomain, activeTab, preferences, peaksOptions } }));
|
|
91
116
|
}
|
|
@@ -39,6 +39,23 @@ const formatFields = [
|
|
|
39
39
|
checkControllerName: 'intensity.show',
|
|
40
40
|
formatControllerName: 'intensity.format',
|
|
41
41
|
},
|
|
42
|
+
{
|
|
43
|
+
id: 6,
|
|
44
|
+
label: 'kind :',
|
|
45
|
+
checkControllerName: 'fwhm.show',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 7,
|
|
49
|
+
label: 'fwhm :',
|
|
50
|
+
checkControllerName: 'fwhm.show',
|
|
51
|
+
formatControllerName: 'fwhm.format',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 8,
|
|
55
|
+
label: 'mu :',
|
|
56
|
+
checkControllerName: 'mu.show',
|
|
57
|
+
formatControllerName: 'mu.format',
|
|
58
|
+
},
|
|
42
59
|
];
|
|
43
60
|
function PeaksPreferences(props, ref) {
|
|
44
61
|
const alert = useAlert();
|