nmrium 0.38.1 → 0.39.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/lib/component/1d/ApodizationLine.js +27 -4
- package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib/component/1d/FooterBanner.js +5 -5
- package/lib/component/1d/SpectraLegends.js +2 -3
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/integral/Integral.d.ts +1 -1
- package/lib/component/1d/integral/IntegralResizable.d.ts +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +2 -1
- package/lib/component/1d/ranges/Range.d.ts +1 -1
- package/lib/component/1d/tool/PeakPointer.js +6 -6
- package/lib/component/1d/tool/XLabelPointer.js +5 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
- package/lib/component/1d-2d/tools/BrushX.js +2 -3
- package/lib/component/1d-2d/tools/BrushXY.js +2 -3
- package/lib/component/1d-2d/tools/CrossLinePointer.js +4 -5
- package/lib/component/2d/Chart2D.js +4 -4
- package/lib/component/2d/FooterBanner.js +5 -5
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +5 -5
- package/lib/component/2d/zones/Signal.d.ts +1 -1
- package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts +20 -12
- package/lib/component/EventsTrackers/BrushTracker.js +35 -22
- package/lib/component/EventsTrackers/KeysListenerTracker.js +90 -67
- package/lib/component/EventsTrackers/MouseTracker.d.ts +6 -2
- package/lib/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib/component/NMRium.d.ts +5 -5
- package/lib/component/NMRium.js +15 -16
- package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
- package/lib/component/context/LoggerContext.js +5 -0
- package/lib/component/context/PreferencesContext.d.ts +10 -8
- package/lib/component/elements/Button.d.ts +13 -11
- package/lib/component/elements/Button.js +16 -25
- package/lib/component/elements/ColorInput.d.ts +0 -1
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/EditableColumn.js +5 -2
- package/lib/component/elements/Input.js +2 -4
- package/lib/component/elements/Label.d.ts +1 -0
- package/lib/component/elements/Label.js +2 -2
- package/lib/component/elements/MolecularFormulaInput.d.ts +2 -2
- package/lib/component/elements/MolecularFormulaInput.js +15 -18
- package/lib/component/elements/NextPrev.d.ts +5 -3
- package/lib/component/elements/NextPrev.js +26 -8
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
- package/lib/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +4 -0
- package/lib/component/elements/formik/FormikColumnFormatField.js +19 -16
- package/lib/component/elements/formik/FormikError.d.ts +8 -0
- package/lib/component/elements/formik/FormikError.js +22 -0
- package/lib/component/elements/formik/FormikInput.js +10 -6
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/header/ApodizationOptionsPanel.js +4 -3
- package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -7
- package/lib/component/header/BaseLineCorrectionPanel.js +5 -2
- package/lib/component/header/PhaseCorrectionPanel.js +5 -2
- package/lib/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectra.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrum.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts +1 -1
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +2 -0
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.js +17 -0
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -2
- package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +3 -2
- package/lib/component/hooks/useExport.js +1 -1
- package/lib/component/hooks/useFilter.d.ts +2 -1
- package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
- package/lib/component/hooks/usePanelPreferences.js +4 -0
- package/lib/component/hooks/useSaveSettings.d.ts +1 -1
- package/lib/component/hooks/useSaveSettings.js +17 -15
- package/lib/component/hooks/useVerticalAlign.d.ts +1 -1
- package/lib/component/loader/DropZone.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
- package/lib/component/modal/LoadJCAMPModal.d.ts +3 -3
- package/lib/component/modal/LoadJCAMPModal.js +56 -74
- package/lib/component/modal/ModalStyle.js +0 -10
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +2 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
- package/lib/component/modal/PredictSpectraModal.d.ts +4 -2
- package/lib/component/modal/PredictSpectraModal.js +53 -105
- package/lib/component/modal/SaveAsModal.d.ts +2 -0
- package/lib/component/modal/SaveAsModal.js +21 -14
- package/lib/component/modal/changeSum/ChangeSumModal.js +25 -38
- package/lib/component/modal/editRange/EditRangeModal.d.ts +7 -6
- package/lib/component/modal/editRange/EditRangeModal.js +33 -13
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -2
- package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib/component/modal/setting/GeneralSettings.js +2 -7
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -15
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +1 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +20 -25
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +6 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +71 -81
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib/component/panels/Panels.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +39 -53
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +7 -22
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +9 -12
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -24
- package/lib/component/panels/databasePanel/DatabasePreferences.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +2 -3
- package/lib/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib/component/panels/header/PanelHeader.d.ts +7 -0
- package/lib/component/panels/header/PanelHeader.js +12 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +9 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +94 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +109 -37
- package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +3 -0
- package/lib/component/panels/predictionPanel/PredictionPreferences.js +24 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.d.ts +2 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +44 -0
- package/lib/component/reducer/Reducer.d.ts +5 -87
- package/lib/component/reducer/Reducer.js +1 -29
- package/lib/component/reducer/actions/DatabaseActions.js +6 -4
- package/lib/component/reducer/actions/DomainActions.js +3 -0
- package/lib/component/reducer/actions/FiltersActions.d.ts +1 -2
- package/lib/component/reducer/actions/FiltersActions.js +47 -52
- package/lib/component/reducer/actions/HistoryActions.d.ts +4 -0
- package/lib/component/reducer/actions/HistoryActions.js +40 -0
- package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
- package/lib/component/reducer/actions/IntegralsActions.js +3 -1
- package/lib/component/reducer/actions/LoadActions.d.ts +1 -2
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +7 -4
- package/lib/component/reducer/actions/MoleculeActions.js +57 -28
- package/lib/component/reducer/actions/PeaksActions.d.ts +1 -2
- package/lib/component/reducer/actions/PeaksActions.js +3 -3
- package/lib/component/reducer/actions/RangesActions.d.ts +4 -5
- package/lib/component/reducer/actions/RangesActions.js +5 -27
- package/lib/component/reducer/actions/SpectrumsActions.js +8 -8
- package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
- package/lib/component/reducer/actions/ToolsActions.js +3 -32
- package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
- package/lib/component/reducer/actions/ZonesActions.js +3 -6
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +8 -0
- package/lib/component/reducer/helper/ZoomHistoryManager.js +35 -0
- package/lib/component/reducer/helper/getActiveSpectra.d.ts +1 -1
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +1 -1
- package/lib/component/reducer/helper/getVerticalAlign.d.ts +1 -1
- package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -3
- package/lib/component/reducer/preferences/utilities/getActiveWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +2 -3
- package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +1 -1
- package/lib/component/toolbar/BasicToolBar.js +6 -11
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/toolbar/ToolTypes.js +1 -1
- package/lib/component/workspaces/assignment.d.ts +1 -1
- package/lib/component/workspaces/basic.d.ts +1 -1
- package/lib/component/workspaces/embedded.d.ts +1 -1
- package/lib/component/workspaces/exercise.d.ts +1 -1
- package/lib/component/workspaces/index.d.ts +6 -6
- package/lib/component/workspaces/prediction.d.ts +1 -1
- package/lib/component/workspaces/prediction.js +193 -0
- package/lib/component/workspaces/process1D.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/PredictionManager.d.ts +3 -1
- package/lib/data/PredictionManager.js +43 -3
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/constants/DefaultApodizationOptions.d.ts +2 -0
- package/lib/data/constants/DefaultApodizationOptions.js +5 -0
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.d.ts +1 -2
- package/lib/data/data1d/Spectrum1D/index.d.ts +1 -5
- package/lib/data/data1d/Spectrum1D/index.js +1 -5
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -24
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +13 -6
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +23 -18
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +37 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +1 -1
- package/lib/data/data1d/database.js +2 -4
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +3 -30
- package/lib/data/data1d/multipleSpectraAnalysis.js +4 -15
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib/data/data2d/Spectrum2D/getSlice.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -1
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +3 -2
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/types/data1d/ComplexData1D.d.ts +2 -2
- package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
- package/lib/data/utilities/FindUtilities.d.ts +2 -1
- package/lib/data/utilities/RangeUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/calculateSanPlot.d.ts +2 -2
- package/lib/types/NMRiumDataReturn.d.ts +1 -3
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +28 -5
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +3 -26
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +5 -28
- package/lib-cjs/component/1d/FooterBanner.js +2 -2
- package/lib-cjs/component/1d/SpectraLegends.js +1 -2
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -3
- package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
- package/lib-cjs/component/1d-2d/tools/BrushX.js +1 -2
- package/lib-cjs/component/1d-2d/tools/BrushXY.js +1 -2
- package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +2 -3
- package/lib-cjs/component/2d/Chart2D.js +4 -4
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +36 -22
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +90 -67
- package/lib-cjs/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib-cjs/component/NMRium.js +12 -13
- package/lib-cjs/component/context/LoggerContext.js +5 -0
- package/lib-cjs/component/elements/Button.js +16 -25
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +5 -2
- package/lib-cjs/component/elements/Input.js +2 -4
- package/lib-cjs/component/elements/Label.js +2 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +14 -16
- package/lib-cjs/component/elements/NextPrev.js +26 -8
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +20 -16
- package/lib-cjs/component/elements/formik/FormikError.js +27 -0
- package/lib-cjs/component/elements/formik/FormikInput.js +10 -6
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +6 -5
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +15 -6
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
- package/lib-cjs/component/header/PhaseCorrectionPanel.js +6 -26
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -25
- package/lib-cjs/component/hooks/useCheckPointsNumberInWindowArea.js +24 -0
- package/lib-cjs/component/hooks/useExport.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +4 -0
- package/lib-cjs/component/hooks/useSaveSettings.js +16 -14
- package/lib-cjs/component/loader/DropZone.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +81 -75
- package/lib-cjs/component/modal/ModalStyle.js +0 -10
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib-cjs/component/modal/PredictSpectraModal.js +53 -126
- package/lib-cjs/component/modal/SaveAsModal.js +22 -14
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +24 -37
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +32 -12
- package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -7
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +6 -14
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +19 -24
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +76 -86
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib-cjs/component/panels/Panels.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +38 -52
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +9 -12
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -24
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +25 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib-cjs/component/panels/header/PanelHeader.js +15 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +122 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +109 -37
- package/lib-cjs/component/panels/predictionPanel/PredictionPreferences.js +29 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +72 -0
- package/lib-cjs/component/reducer/Reducer.js +2 -31
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +6 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +3 -0
- package/lib-cjs/component/reducer/actions/FiltersActions.js +66 -94
- package/lib-cjs/component/reducer/actions/HistoryActions.js +45 -0
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +3 -1
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +58 -32
- package/lib-cjs/component/reducer/actions/PeaksActions.js +3 -3
- package/lib-cjs/component/reducer/actions/RangesActions.js +7 -52
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +10 -33
- package/lib-cjs/component/reducer/actions/ToolsActions.js +26 -32
- package/lib-cjs/component/reducer/actions/ZonesActions.js +6 -32
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +37 -0
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib-cjs/component/toolbar/BasicToolBar.js +5 -10
- package/lib-cjs/component/toolbar/ToolTypes.js +9 -32
- package/lib-cjs/component/workspaces/prediction.js +193 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +21 -44
- package/lib-cjs/data/PredictionManager.js +43 -3
- package/lib-cjs/data/constants/DefaultApodizationOptions.js +8 -0
- package/lib-cjs/data/data1d/Spectrum1D/index.js +7 -11
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -32
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +7 -26
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +3 -4
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +13 -6
- package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +23 -18
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib-cjs/data/data1d/database.js +2 -4
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +5 -16
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -26
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +2 -25
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +29 -29
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +0 -7
- package/lib/component/panels/predictionPanel/PredictionOptions.js +0 -74
- package/lib/component/workspaces/Workspace.d.ts +0 -188
- package/lib/component/workspaces/Workspace.js +0 -1
- package/lib/data/Filters.d.ts +0 -12
- package/lib/data/Filters.js +0 -12
- package/lib/data/FiltersManager.d.ts +0 -30
- package/lib/data/FiltersManager.js +0 -175
- package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.js +0 -6
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -4
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +0 -7
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -9
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +0 -12
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -36
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -6
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -26
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +0 -3
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -45
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -7
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +0 -4
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -78
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -9
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -5
- package/lib/data/data1d/filter1d/apodization.d.ts +0 -27
- package/lib/data/data1d/filter1d/apodization.js +0 -81
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +0 -33
- package/lib/data/data1d/filter1d/baselineCorrection.js +0 -51
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +0 -20
- package/lib/data/data1d/filter1d/digitalFilter.js +0 -44
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +0 -33
- package/lib/data/data1d/filter1d/equallySpaced.js +0 -52
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +0 -15
- package/lib/data/data1d/filter1d/exclusionZones.js +0 -32
- package/lib/data/data1d/filter1d/fft.d.ts +0 -18
- package/lib/data/data1d/filter1d/fft.js +0 -90
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +0 -26
- package/lib/data/data1d/filter1d/phaseCorrection.js +0 -64
- package/lib/data/data1d/filter1d/shiftX.d.ts +0 -20
- package/lib/data/data1d/filter1d/shiftX.js +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.d.ts +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.js +0 -65
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +0 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -35
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +0 -22
- package/lib/data/data1d/filter1d/zeroFilling.js +0 -60
- package/lib/data/data2d/filter2d/shiftX.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftX.js +0 -27
- package/lib/data/data2d/filter2d/shiftY.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftY.js +0 -27
- package/lib/data/types/view-state/PeaksViewState.d.ts +0 -17
- package/lib/data/types/view-state/PeaksViewState.js +0 -1
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -7
- package/lib/types/NMRiumGeneralPreferences.js +0 -1
- package/lib/types/NMRiumPanelPreferences.d.ts +0 -17
- package/lib/types/NMRiumPanelPreferences.js +0 -1
- package/lib/types/NMRiumToolBarPreferences.d.ts +0 -22
- package/lib/types/NMRiumToolBarPreferences.js +0 -1
- package/lib/types/PanelPreferencesType.d.ts +0 -4
- package/lib/types/PanelPreferencesType.js +0 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +0 -102
- package/lib-cjs/component/workspaces/Workspace.js +0 -2
- package/lib-cjs/data/Filters.js +0 -38
- package/lib-cjs/data/FiltersManager.js +0 -206
- package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +0 -33
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -8
- package/lib-cjs/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -40
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -10
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -30
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -49
- package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -11
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -82
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/filter1d/apodization.js +0 -88
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +0 -60
- package/lib-cjs/data/data1d/filter1d/digitalFilter.js +0 -50
- package/lib-cjs/data/data1d/filter1d/equallySpaced.js +0 -61
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +0 -38
- package/lib-cjs/data/data1d/filter1d/fft.js +0 -96
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +0 -70
- package/lib-cjs/data/data1d/filter1d/shiftX.js +0 -32
- package/lib-cjs/data/data1d/filter1d/signalProcessing.js +0 -95
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -39
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +0 -66
- package/lib-cjs/data/data2d/filter2d/shiftX.js +0 -33
- package/lib-cjs/data/data2d/filter2d/shiftY.js +0 -33
- package/lib-cjs/data/types/view-state/PeaksViewState.js +0 -2
- package/lib-cjs/types/NMRiumGeneralPreferences.js +0 -2
- package/lib-cjs/types/NMRiumPanelPreferences.js +0 -2
- package/lib-cjs/types/NMRiumToolBarPreferences.js +0 -2
- package/lib-cjs/types/PanelPreferencesType.js +0 -2
|
@@ -7,6 +7,7 @@ import { DataExportOptions } from '../../data/SpectraManager';
|
|
|
7
7
|
import { useChartData } from '../context/ChartContext';
|
|
8
8
|
import ActionButtons from '../elements/ActionButtons';
|
|
9
9
|
import CloseButton from '../elements/CloseButton';
|
|
10
|
+
import Label from '../elements/Label';
|
|
10
11
|
import FormikCheckBox from '../elements/formik/FormikCheckBox';
|
|
11
12
|
import FormikInput from '../elements/formik/FormikInput';
|
|
12
13
|
import { ModalStyles } from './ModalStyle';
|
|
@@ -15,15 +16,6 @@ const styles = css `
|
|
|
15
16
|
flex: 1;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
.custom-label {
|
|
19
|
-
width: 100px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.name {
|
|
23
|
-
width: 100% !important;
|
|
24
|
-
text-align: left !important;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
19
|
.data-export-group {
|
|
28
20
|
label {
|
|
29
21
|
margin-right: 10px;
|
|
@@ -45,6 +37,20 @@ const INITIAL_VALUE = {
|
|
|
45
37
|
settings: false,
|
|
46
38
|
},
|
|
47
39
|
};
|
|
40
|
+
export const labelStyle = {
|
|
41
|
+
label: {
|
|
42
|
+
flex: 4,
|
|
43
|
+
fontSize: '12px',
|
|
44
|
+
fontWeight: 'bold',
|
|
45
|
+
color: '#232323',
|
|
46
|
+
},
|
|
47
|
+
wrapper: {
|
|
48
|
+
flex: 8,
|
|
49
|
+
display: 'flex',
|
|
50
|
+
justifyContent: 'flex-start',
|
|
51
|
+
},
|
|
52
|
+
container: { padding: '5px 0' },
|
|
53
|
+
};
|
|
48
54
|
function SaveAsModal({ onClose, onSave, name }) {
|
|
49
55
|
const refForm = useRef();
|
|
50
56
|
const { source } = useChartData();
|
|
@@ -55,10 +61,11 @@ function SaveAsModal({ onClose, onSave, name }) {
|
|
|
55
61
|
onSave(values);
|
|
56
62
|
onClose?.();
|
|
57
63
|
}, [onClose, onSave]);
|
|
58
|
-
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Save as ... " }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { innerRef: refForm, initialValues: { ...INITIAL_VALUE, name }, onSubmit: submitHandler, children: _jsxs(_Fragment, { children: [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Save as ... " }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { innerRef: refForm, initialValues: { ...INITIAL_VALUE, name }, onSubmit: submitHandler, children: _jsxs(_Fragment, { children: [_jsx(Label, { style: labelStyle, title: "Name", children: _jsx(FormikInput, { name: "name", className: "name", style: {
|
|
65
|
+
inputWrapper: { width: '100%' },
|
|
66
|
+
input: { padding: '5px', textAlign: 'left' },
|
|
67
|
+
} }) }), _jsx(Label, { style: labelStyle, title: "Compressed", children: _jsx(FormikCheckBox, { name: "compressed" }) }), _jsx(Label, { style: labelStyle, title: "Pretty Format", children: _jsx(FormikCheckBox, { name: "pretty" }) }), _jsx(Label, { style: labelStyle, title: "Include view", children: _jsx(FormikCheckBox, { name: "include.view" }) }), _jsx(Label, { style: labelStyle, title: "Include settings", children: _jsx(FormikCheckBox, { name: "include.settings" }) }), _jsx(Label, { style: labelStyle, title: "Include Data", children: _jsx("div", { style: { display: 'flex', flexDirection: 'column' }, children: _jsxs("div", { className: "data-export-group", children: [_jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.ROW_DATA }), "Raw Data"] }), _jsxs("label", { style: {
|
|
68
|
+
color: source ? 'black' : 'lightgray',
|
|
69
|
+
}, children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.DATA_SOURCE, disabled: !source }), "Data Source"] }), _jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.NO_DATA }), "No Data"] })] }) }) })] }) }) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: () => onClose?.() }) })] }));
|
|
63
70
|
}
|
|
64
71
|
export default SaveAsModal;
|
|
@@ -2,9 +2,10 @@ 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 { Formik } from 'formik';
|
|
5
|
-
import {
|
|
5
|
+
import { useEffect, useRef, useState } from 'react';
|
|
6
6
|
import * as Yup from 'yup';
|
|
7
7
|
import { usePreferences } from '../../context/PreferencesContext';
|
|
8
|
+
import Button from '../../elements/Button';
|
|
8
9
|
import CloseButton from '../../elements/CloseButton';
|
|
9
10
|
import Tab from '../../elements/Tab/Tab';
|
|
10
11
|
import Tabs from '../../elements/Tab/Tabs';
|
|
@@ -43,38 +44,40 @@ const styles = css `
|
|
|
43
44
|
text-align: center;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
.footer-container {
|
|
48
|
-
button {
|
|
49
|
-
width: 20%;
|
|
50
|
-
color: white;
|
|
51
|
-
background-color: gray !important;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
button:hover {
|
|
55
|
-
border: 1px solid gray;
|
|
56
|
-
color: gray;
|
|
57
|
-
background-color: white !important;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
47
|
`;
|
|
61
48
|
var SumSetOptions;
|
|
62
49
|
(function (SumSetOptions) {
|
|
63
50
|
SumSetOptions["Auto"] = "auto";
|
|
64
51
|
SumSetOptions["Manual"] = "manual";
|
|
65
52
|
})(SumSetOptions || (SumSetOptions = {}));
|
|
53
|
+
function getValidationSchema(option) {
|
|
54
|
+
switch (option) {
|
|
55
|
+
case SumSetOptions.Auto: {
|
|
56
|
+
return Yup.object({
|
|
57
|
+
molecule: Yup.object().required(),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
case SumSetOptions.Manual: {
|
|
61
|
+
return Yup.object({
|
|
62
|
+
sum: Yup.number().required(),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
default:
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
66
69
|
export default function ChangeSumModal({ onSave, onClose, header, sumOptions, }) {
|
|
67
70
|
const { current: { display: { panels }, }, } = usePreferences();
|
|
68
71
|
const [setOption, setActiveOption] = useState(SumSetOptions.Auto);
|
|
69
72
|
const formRef = useRef(null);
|
|
70
|
-
|
|
73
|
+
function handleKeyDown(event) {
|
|
71
74
|
if (event.key === 'Enter') {
|
|
72
75
|
formRef.current.submitForm();
|
|
73
76
|
}
|
|
74
|
-
}
|
|
75
|
-
|
|
77
|
+
}
|
|
78
|
+
function onTabChangeHandler(tab) {
|
|
76
79
|
setActiveOption(tab.tabid);
|
|
77
|
-
}
|
|
80
|
+
}
|
|
78
81
|
useEffect(() => {
|
|
79
82
|
if (sumOptions?.sumAuto && panels?.structuresPanel?.display) {
|
|
80
83
|
setActiveOption(SumSetOptions.Auto);
|
|
@@ -89,7 +92,7 @@ export default function ChangeSumModal({ onSave, onClose, header, sumOptions, })
|
|
|
89
92
|
formRef.current.setValues({ sum: sumOptions?.sum || '', molecule: null });
|
|
90
93
|
}
|
|
91
94
|
}, [panels?.structuresPanel, sumOptions]);
|
|
92
|
-
|
|
95
|
+
function saveHandler(values) {
|
|
93
96
|
switch (setOption) {
|
|
94
97
|
case SumSetOptions.Auto: {
|
|
95
98
|
const { molecule: { mf, id: moleculeId }, } = values;
|
|
@@ -105,25 +108,9 @@ export default function ChangeSumModal({ onSave, onClose, header, sumOptions, })
|
|
|
105
108
|
return;
|
|
106
109
|
}
|
|
107
110
|
onClose();
|
|
108
|
-
}
|
|
109
|
-
const validationSchema = useMemo(() => {
|
|
110
|
-
switch (setOption) {
|
|
111
|
-
case SumSetOptions.Auto: {
|
|
112
|
-
return Yup.object({
|
|
113
|
-
molecule: Yup.object().required(),
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
case SumSetOptions.Manual: {
|
|
117
|
-
return Yup.object({
|
|
118
|
-
sum: Yup.number().required(),
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
default:
|
|
122
|
-
return null;
|
|
123
|
-
}
|
|
124
|
-
}, [setOption]);
|
|
111
|
+
}
|
|
125
112
|
const isStructurePanelVisible = panels?.structuresPanel?.display || false;
|
|
126
113
|
return (
|
|
127
114
|
// <div css={modalContainer}>
|
|
128
|
-
_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(Formik, { innerRef: formRef, onSubmit: saveHandler, initialValues: { sum:
|
|
115
|
+
_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(Formik, { innerRef: formRef, onSubmit: saveHandler, initialValues: { sum: '', molecule: null }, validationSchema: getValidationSchema(setOption), children: _jsxs(Tabs, { activeTab: setOption, onClick: onTabChangeHandler, children: [isStructurePanelVisible && (_jsx(Tab, { title: "Auto", tabid: SumSetOptions.Auto, children: _jsx(SelectMolecule, { name: "molecule" }) })), _jsx(Tab, { title: "Manual", tabid: SumSetOptions.Manual, children: _jsx("div", { className: "manual-container", children: _jsx(FormikInput, { name: "sum", type: "number", nullable: true, placeholder: "Enter the new value", onKeyDown: handleKeyDown }) }) })] }) }) }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: () => formRef.current.submitForm(), style: { width: '80px' }, children: "Set" }) })] }));
|
|
129
116
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { Range } from 'nmr-processing';
|
|
1
2
|
interface EditRangeModalProps {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
onSave: (value: any) => Promise<void> | null | void;
|
|
4
|
+
onClose?: () => void;
|
|
5
|
+
onRest: (originalRange: Range) => void;
|
|
6
|
+
onZoom: (value: any) => void;
|
|
7
|
+
rangeId: string;
|
|
7
8
|
}
|
|
8
|
-
declare function EditRangeModal({
|
|
9
|
+
declare function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }: EditRangeModalProps): import("@emotion/react/jsx-runtime").JSX.Element | undefined;
|
|
9
10
|
export default EditRangeModal;
|
|
@@ -4,7 +4,7 @@ import { css } from '@emotion/react';
|
|
|
4
4
|
import { v4 } from '@lukeed/uuid';
|
|
5
5
|
import { Formik } from 'formik';
|
|
6
6
|
import { splitPatterns, translateMultiplet } from 'nmr-processing';
|
|
7
|
-
import { useMemo, useCallback, useRef } from 'react';
|
|
7
|
+
import { useMemo, useCallback, useRef, useEffect } from 'react';
|
|
8
8
|
import { FaSearchPlus } from 'react-icons/fa';
|
|
9
9
|
import { useChartData } from '../../context/ChartContext';
|
|
10
10
|
import { useDispatch } from '../../context/DispatchContext';
|
|
@@ -52,18 +52,36 @@ const styles = css `
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
`;
|
|
55
|
-
function EditRangeModal({
|
|
55
|
+
function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }) {
|
|
56
56
|
const formRef = useRef(null);
|
|
57
57
|
const { view: { spectra: { activeTab }, }, } = useChartData();
|
|
58
58
|
const dispatch = useDispatch();
|
|
59
|
+
const range = useRange(rangeId);
|
|
60
|
+
const originalRangeRef = useRef(range);
|
|
59
61
|
const rangesPreferences = usePanelPreferences('ranges', activeTab);
|
|
60
|
-
const range = useRange(originRange, manualRange);
|
|
61
62
|
const handleOnZoom = useCallback(() => {
|
|
62
|
-
|
|
63
|
-
}, [
|
|
63
|
+
onZoom(range);
|
|
64
|
+
}, [onZoom, range]);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
dispatch({
|
|
67
|
+
type: 'SET_SELECTED_TOOL',
|
|
68
|
+
payload: {
|
|
69
|
+
selectedTool: 'zoom',
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
if (!range) {
|
|
73
|
+
onClose?.();
|
|
74
|
+
}
|
|
75
|
+
}, [activeTab, dispatch, onClose, range]);
|
|
64
76
|
const handleOnClose = useCallback(() => {
|
|
65
|
-
|
|
66
|
-
|
|
77
|
+
dispatch({
|
|
78
|
+
type: 'SET_SELECTED_TOOL',
|
|
79
|
+
payload: {
|
|
80
|
+
selectedTool: 'zoom',
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
onRest(originalRangeRef.current);
|
|
84
|
+
}, [dispatch, onRest]);
|
|
67
85
|
const getCouplings = useCallback((couplings) => couplings
|
|
68
86
|
.filter((coupling) => coupling.coupling !== '')
|
|
69
87
|
.map((coupling) => {
|
|
@@ -88,9 +106,9 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
88
106
|
void (async () => {
|
|
89
107
|
const _range = { ...range };
|
|
90
108
|
_range.signals = getSignals(formValues.signals);
|
|
91
|
-
await
|
|
109
|
+
await onSave(_range);
|
|
92
110
|
})();
|
|
93
|
-
}, [getSignals,
|
|
111
|
+
}, [getSignals, onSave, range]);
|
|
94
112
|
const data = useMemo(() => {
|
|
95
113
|
const signals = range?.signals.map((signal) => {
|
|
96
114
|
// counter within j array to access to right j values
|
|
@@ -114,7 +132,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
114
132
|
return { ...signal, js: couplings };
|
|
115
133
|
});
|
|
116
134
|
return { activeTab: '0', signals };
|
|
117
|
-
}, [range?.signals, rangesPreferences
|
|
135
|
+
}, [range?.signals, rangesPreferences]);
|
|
118
136
|
const changeHandler = useCallback((values) => {
|
|
119
137
|
const signals = getSignals(values.signals);
|
|
120
138
|
if (JSON.stringify(range?.signals, (key, value) => {
|
|
@@ -131,14 +149,16 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
131
149
|
});
|
|
132
150
|
}
|
|
133
151
|
}, [dispatch, getSignals, range]);
|
|
152
|
+
if (!rangesPreferences || !range) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
134
155
|
return (_jsxs("div", { css: styles, children: [_jsxs("div", { className: "header handle", children: [_jsx(Button.Action, { onClick: handleOnZoom, fill: "outline", style: { fontSize: '14' }, color: { base: '#5f5f5f', hover: 'white' }, children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { className: "title", children: ` Range and Signal edition: ${formatNumber(range?.from, rangesPreferences.from.format)} ppm to ${formatNumber(range?.to, rangesPreferences.to.format)} ppm` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), popupTitle: "Save and Exit" }), _jsx(CloseButton, { onClick: handleOnClose })] }), _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: editRangeFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsx(SignalsForm, { range: range, preferences: rangesPreferences }), _jsx(FormikOnChange, { onChange: changeHandler })] }) })] }));
|
|
135
156
|
}
|
|
136
|
-
function useRange(
|
|
157
|
+
function useRange(rangeId) {
|
|
137
158
|
const { ranges } = useSpectrum({
|
|
138
159
|
ranges: { values: [] },
|
|
139
160
|
});
|
|
140
|
-
const
|
|
141
|
-
const index = ranges.values.findIndex((rangeRecord) => rangeRecord.id === id);
|
|
161
|
+
const index = ranges.values.findIndex((rangeRecord) => rangeRecord.id === rangeId);
|
|
142
162
|
return ranges.values[index];
|
|
143
163
|
}
|
|
144
164
|
export default EditRangeModal;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { WorkSpacePanelPreferences } from 'nmr-load-save';
|
|
3
|
+
import { Range } from 'nmr-processing';
|
|
4
4
|
interface SignalsFormProps {
|
|
5
5
|
range: Range;
|
|
6
6
|
preferences: WorkSpacePanelPreferences['ranges'];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
2
3
|
import { Formik } from 'formik';
|
|
3
4
|
import { useState, useMemo, useRef, useEffect } from 'react';
|
|
4
5
|
import { DropZone } from 'react-science/ui';
|
|
@@ -60,7 +61,7 @@ const rowColors = {
|
|
|
60
61
|
};
|
|
61
62
|
const validationSchema = Yup.object({
|
|
62
63
|
source: Yup.string().required(),
|
|
63
|
-
target: Yup.array(Yup.string()).min(1),
|
|
64
|
+
target: Yup.array(Yup.string()).min(1).required(),
|
|
64
65
|
});
|
|
65
66
|
function MetaImportationModal({ onClose, file }) {
|
|
66
67
|
const alert = useAlert();
|
|
@@ -86,7 +87,9 @@ function MetaImportationModal({ onClose, file }) {
|
|
|
86
87
|
};
|
|
87
88
|
}, [file]);
|
|
88
89
|
function handleDrop(files) {
|
|
89
|
-
|
|
90
|
+
if (files[0]) {
|
|
91
|
+
handleParseFile(files[0]);
|
|
92
|
+
}
|
|
90
93
|
}
|
|
91
94
|
const errors = mapErrors(parseResult?.errors || []);
|
|
92
95
|
const metaData = parseResult?.data || [];
|
|
@@ -167,14 +170,21 @@ function MetaImportationModal({ onClose, file }) {
|
|
|
167
170
|
}
|
|
168
171
|
return (_jsxs("div", { css: ModalStyles, style: { overflow: 'hidden' }, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Import Meta Information" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { style: styles.container, children: _jsx("div", { style: { flex: 1, width: '100%' }, children: !parseResult ? (_jsx(DropZone, { fileValidator: fileValidator, color: "gray", emptyText: "Drag and Drop CSV or tab-delimited file (.csv, .txt or .tsv)", onDrop: handleDrop })) : (_jsxs(_Fragment, { children: [_jsxs("div", { style: { height: '130px' }, children: [_jsx(Formik, { innerRef: formRef, initialValues: {
|
|
169
172
|
source: null,
|
|
170
|
-
target:
|
|
173
|
+
target: '',
|
|
171
174
|
}, onSubmit: handleLinkSpectra, validationSchema: validationSchema, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "Source field", style: { label: { width: '100px' } }, children: _jsx(FormikSelect, { name: "source", items: mapColumnToSelectItems(parseResult?.meta.fields || []), style: {
|
|
172
175
|
width: '300px',
|
|
173
|
-
padding: '
|
|
176
|
+
padding: '5px',
|
|
174
177
|
margin: 0,
|
|
175
178
|
} }) }), _jsx(Label, { title: "Target field path", style: {
|
|
176
179
|
label: { width: '100px', padding: '20px 0px' },
|
|
177
|
-
}, children: _jsx(FormikInput, { name: "target", style: {
|
|
180
|
+
}, children: _jsx(FormikInput, { name: "target", style: {
|
|
181
|
+
input: {
|
|
182
|
+
width: '300px',
|
|
183
|
+
textAlign: 'left',
|
|
184
|
+
padding: '5px',
|
|
185
|
+
fontSize: '14px',
|
|
186
|
+
},
|
|
187
|
+
}, placeholder: "Example: info.plus", datalist: datalist, nullable: true, mapOnChangeValue: (key) => paths?.[key] || null, mapValue: (paths) => convertPathArrayToString(paths) }) })] }) }), _jsx(Button.Done, { onClick: () => formRef.current?.submitForm(), children: "Link Spectra" })] }), _jsx("div", { style: { height: 'calc(100% - 160px)' }, children: _jsx(ReactTable, { columns: columns, data: metaData, approxItemHeight: 25, approxColumnWidth: 100, enableVirtualScroll: true, enableColumnsVirtualScroll: true, activeRow: handleActiveRow, rowStyle: handleRowStyle }) })] })) }) }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleImport, disabled: Object.keys(matches).length === 0, children: "Import" }) })] }));
|
|
178
188
|
}
|
|
179
189
|
function fileValidator(file) {
|
|
180
190
|
if (!isMetaFile(file)) {
|
|
@@ -57,12 +57,7 @@ const styles = css `
|
|
|
57
57
|
|
|
58
58
|
.input {
|
|
59
59
|
font-size: 14px;
|
|
60
|
-
|
|
61
|
-
border: 1px solid #ccc;
|
|
62
|
-
padding: 5px;
|
|
63
|
-
width: 100px;
|
|
64
|
-
margin-right: 10px;
|
|
65
|
-
height: initial !important;
|
|
60
|
+
padding: 3px;
|
|
66
61
|
}
|
|
67
62
|
|
|
68
63
|
.close-bt {
|
|
@@ -138,7 +133,7 @@ function GeneralSettingsModal({ height }) {
|
|
|
138
133
|
dispatch({
|
|
139
134
|
type: 'ADD_WORKSPACE',
|
|
140
135
|
payload: {
|
|
141
|
-
|
|
136
|
+
workspaceKey: name,
|
|
142
137
|
data: refForm.current?.values,
|
|
143
138
|
},
|
|
144
139
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { CustomWorkspaces } from 'nmr-load-save';
|
|
1
2
|
import { NMRiumWorkspace } from '../../../NMRium';
|
|
2
|
-
import { CustomWorkspaces } from '../../../workspaces/Workspace';
|
|
3
3
|
interface DatabasesTabContentProps {
|
|
4
4
|
currentWorkspace: NMRiumWorkspace;
|
|
5
5
|
originalWorkspaces: CustomWorkspaces;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Integral } from 'nmr-
|
|
2
|
+
import { Integral } from 'nmr-processing';
|
|
3
3
|
import { IntegralPanelInnerProps } from './IntegralPanel';
|
|
4
4
|
interface IntegralTableProps extends Pick<IntegralPanelInnerProps, 'activeTab'> {
|
|
5
5
|
data: Array<Integral>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Formik } from 'formik';
|
|
3
3
|
import { useCallback, useImperativeHandle, useRef, memo, forwardRef, useMemo, } from 'react';
|
|
4
4
|
import { usePreferences } from '../../context/PreferencesContext';
|
|
5
5
|
import Label from '../../elements/Label';
|
|
6
6
|
import FormikColorInput from '../../elements/formik/FormikColorInput';
|
|
7
|
+
import { formatFieldLabelStyle } from '../../elements/formik/FormikColumnFormatField';
|
|
7
8
|
import FormikNumberInput from '../../elements/formik/FormikNumberInput';
|
|
8
9
|
import useNucleus from '../../hooks/useNucleus';
|
|
9
10
|
import { usePanelPreferencesByNuclei } from '../../hooks/usePanelPreferences';
|
|
@@ -47,19 +48,10 @@ function IntegralsPreferences(props, ref) {
|
|
|
47
48
|
formRef.current.submitForm();
|
|
48
49
|
},
|
|
49
50
|
}));
|
|
50
|
-
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => (_jsxs(_Fragment, { children: [_jsx(FormikColorInput, { name: `nuclei.${n}.color` }), _jsx(Label, { title: "stroke width :", style: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
flex: 2,
|
|
56
|
-
},
|
|
57
|
-
wrapper: {
|
|
58
|
-
flex: 4,
|
|
59
|
-
},
|
|
60
|
-
}, children: _jsx(FormikNumberInput, { name: `nuclei.${n}.strokeWidth`, style: {
|
|
61
|
-
width: '60%',
|
|
62
|
-
textAlign: 'center',
|
|
63
|
-
}, min: 1, max: 9, pattern: "[1-9]+" }) })] })) }, n))) }) }) }));
|
|
51
|
+
return (_jsx(PreferencesContainer, { children: _jsx(Formik, { initialValues: preferencesByNuclei, onSubmit: saveHandler, innerRef: formRef, children: _jsx(_Fragment, { children: nuclei?.map((n) => (_jsx(NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => (_jsxs(_Fragment, { children: [_jsx(Label, { title: "Color", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex', padding: '2px 0' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikColorInput, { name: `nuclei.${n}.color` })] }) }), _jsx(Label, { title: "stroke width :", style: formatFieldLabelStyle, children: _jsxs("div", { style: { display: 'flex', padding: '2px 0' }, children: [_jsx("div", { style: { width: '23px' } }), _jsx(FormikNumberInput, { name: `nuclei.${n}.strokeWidth`, style: {
|
|
52
|
+
width: '60%',
|
|
53
|
+
textAlign: 'center',
|
|
54
|
+
padding: '2px',
|
|
55
|
+
}, min: 1, max: 9, pattern: "[1-9]+" })] }) })] })) }, n))) }) }) }));
|
|
64
56
|
}
|
|
65
57
|
export default memo(forwardRef(IntegralsPreferences));
|
|
@@ -4,13 +4,13 @@ import { MF } from 'react-mf';
|
|
|
4
4
|
import { extractLabelsNumbers, extractNumber, } from '../../../data/molecules/MoleculeManager';
|
|
5
5
|
import { useDispatch } from '../../context/DispatchContext';
|
|
6
6
|
import EditableColumn from '../../elements/EditableColumn';
|
|
7
|
+
import Label from '../../elements/Label';
|
|
7
8
|
const styles = {
|
|
8
9
|
toolbar: {
|
|
9
10
|
display: 'flex',
|
|
10
11
|
borderBottom: '0.55px solid rgb(240, 240, 240)',
|
|
11
12
|
padding: '5px 10px',
|
|
12
13
|
justifyContent: 'space-between',
|
|
13
|
-
height: '35px',
|
|
14
14
|
},
|
|
15
15
|
labelInput: {
|
|
16
16
|
width: '150px',
|
|
@@ -33,5 +33,5 @@ export default function MoleculeHeader(props) {
|
|
|
33
33
|
const label = event.target.value;
|
|
34
34
|
dispatch({ type: 'CHANGE_MOLECULE_LABEL', payload: { label, id } });
|
|
35
35
|
}, [dispatch]);
|
|
36
|
-
return (_jsxs("div", { style: styles.toolbar, children: [
|
|
36
|
+
return (_jsxs("div", { style: styles.toolbar, children: [_jsx(Label, { title: "Label", children: _jsx(EditableColumn, { value: currentMolecule.label, style: styles.labelInput, validate: validateLabel, onSave: (event) => saveLabelHandler(currentMolecule.id, event), textOverFlowEllipses: true }) }), _jsxs("span", { children: [_jsx(MF, { mf: currentMolecule.mf }), " - ", currentMolecule.mw?.toFixed(2)] })] }));
|
|
37
37
|
}
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { StateMoleculeExtended } from '../../../data/molecules/Molecule';
|
|
3
|
-
import { MoleculeHeaderActionsOptions } from './MoleculePanelHeader';
|
|
4
|
-
interface MoleculePanelProps {
|
|
5
|
-
onMoleculeChange?: (molecule: StateMoleculeExtended) => void;
|
|
6
|
-
children?: ReactElement;
|
|
7
|
-
actionsOptions?: MoleculeHeaderActionsOptions;
|
|
8
|
-
emptyTextStyle?: CSSProperties;
|
|
9
|
-
}
|
|
10
|
-
export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, emptyTextStyle, }: MoleculePanelProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
1
|
+
export default function MoleculePanel(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -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,
|
|
5
|
+
import { useState, 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';
|
|
@@ -42,7 +42,8 @@ const styles = {
|
|
|
42
42
|
height: '100%',
|
|
43
43
|
}),
|
|
44
44
|
};
|
|
45
|
-
function MoleculePanelInner(
|
|
45
|
+
function MoleculePanelInner(props) {
|
|
46
|
+
const { zones, ranges, molecules: moleculesProp, moleculesView, activeTab, displayerMode, } = props;
|
|
46
47
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
47
48
|
const [molecules, setMolecules] = useState([]);
|
|
48
49
|
const dispatch = useDispatch();
|
|
@@ -58,34 +59,31 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, molecules
|
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
61
|
}, [molecules.length, moleculesProp]);
|
|
61
|
-
|
|
62
|
-
onMoleculeChange?.(molecules[currentIndex] || null);
|
|
63
|
-
}, [currentIndex, molecules, onMoleculeChange]);
|
|
64
|
-
const handleReplaceMolecule = useCallback((molecule, molfile) => {
|
|
62
|
+
function handleReplaceMolecule(molecule, molfile) {
|
|
65
63
|
const { id, label } = molecule;
|
|
66
64
|
dispatch({
|
|
67
65
|
type: 'SET_MOLECULE',
|
|
68
66
|
payload: { molfile, id, label },
|
|
69
67
|
});
|
|
70
|
-
}
|
|
71
|
-
|
|
68
|
+
}
|
|
69
|
+
function moleculeIndexHandler(index) {
|
|
72
70
|
setCurrentIndex(index);
|
|
73
|
-
}
|
|
74
|
-
return (_jsxs("div", { css: styles.panel, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, moleculesView: moleculesView, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditor(), onMoleculeIndexChange: moleculeIndexHandler
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
71
|
+
}
|
|
72
|
+
return (_jsxs("div", { css: styles.panel, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, moleculesView: moleculesView, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditor(), onMoleculeIndexChange: moleculeIndexHandler }), _jsx("div", { css: styles.innerPanel, children: _jsx("div", { css: styles.molecule, children: _jsx(ResponsiveChart, { children: ({ height, width }) => {
|
|
73
|
+
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: {
|
|
74
|
+
backgroundColor: (index + 1) % 2 !== 0 ? '#fafafa' : 'white',
|
|
75
|
+
}, 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 &&
|
|
76
|
+
currentDiaIDsToHighlight.length > 0
|
|
77
|
+
? 'red'
|
|
78
|
+
: '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight &&
|
|
79
|
+
currentDiaIDsToHighlight.length > 0
|
|
80
|
+
? currentDiaIDsToHighlight
|
|
81
|
+
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover, showAtomNumber: moleculesView?.[mol.id]?.showAtomNumber || false }) })] }, mol.id)))) : (_jsx("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditor(), children: _jsx("span", { children: "Click to draw molecule" }) })) }));
|
|
82
|
+
} }) }) })] }));
|
|
85
83
|
}
|
|
86
84
|
const MemoizedMoleculePanel = memo(MoleculePanelInner);
|
|
87
85
|
const emptyData = { ranges: {}, zones: {} };
|
|
88
|
-
export default function MoleculePanel(
|
|
86
|
+
export default function MoleculePanel() {
|
|
89
87
|
const { molecules, view: { molecules: moleculesView, spectra: { activeTab }, }, displayerMode, } = useChartData();
|
|
90
88
|
const data = useSpectrum(emptyData);
|
|
91
89
|
const ranges = data?.ranges || {};
|
|
@@ -95,8 +93,5 @@ export default function MoleculePanel({ onMoleculeChange, children, actionsOptio
|
|
|
95
93
|
displayerMode,
|
|
96
94
|
activeTab,
|
|
97
95
|
ranges,
|
|
98
|
-
zones
|
|
99
|
-
onMoleculeChange,
|
|
100
|
-
actionsOptions,
|
|
101
|
-
emptyTextStyle, children: children }));
|
|
96
|
+
zones }));
|
|
102
97
|
}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { MoleculesView, StateMoleculeExtended } from '../../../data/molecules/Molecule';
|
|
2
|
-
export interface MoleculeHeaderActionsOptions {
|
|
3
|
-
hidePast?: boolean;
|
|
4
|
-
hideAdd?: boolean;
|
|
5
|
-
hideExport?: boolean;
|
|
6
|
-
hideDelete?: boolean;
|
|
7
|
-
hidePredict?: boolean;
|
|
8
|
-
showAboutPredict?: boolean;
|
|
9
|
-
}
|
|
10
3
|
interface MoleculePanelHeaderProps {
|
|
11
4
|
currentIndex: number;
|
|
12
5
|
molecules: Array<StateMoleculeExtended>;
|
|
13
6
|
moleculesView: MoleculesView;
|
|
14
|
-
onMoleculeIndexChange
|
|
7
|
+
onMoleculeIndexChange?: (index: number) => void;
|
|
15
8
|
onOpenMoleculeEditor: () => void;
|
|
16
|
-
|
|
9
|
+
renderSource?: 'moleculePanel' | 'predictionPanel';
|
|
10
|
+
onClickPreferences?: () => void;
|
|
11
|
+
children?: ReactNode;
|
|
17
12
|
}
|
|
18
|
-
export default function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMoleculeIndexChange, onOpenMoleculeEditor,
|
|
13
|
+
export default function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMoleculeIndexChange, onOpenMoleculeEditor, renderSource, onClickPreferences, children, }: MoleculePanelHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
19
14
|
export {};
|