nmrium 0.38.0 → 0.38.2
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/database/DatabaseSpectrum.js +2 -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/MouseTracker.d.ts +6 -2
- package/lib/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib/component/NMRium.d.ts +4 -5
- package/lib/component/NMRium.js +11 -14
- package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
- package/lib/component/context/PreferencesContext.d.ts +6 -6
- 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/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 +1 -1
- 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 +35 -66
- 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 +43 -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/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 +1 -6
- 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/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/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 +11 -28
- 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 +107 -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 -25
- 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/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 +2 -2
- package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
- package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
- package/lib/component/reducer/actions/ZonesActions.js +1 -2
- 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/panelsPreferencesDefaultValues.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- 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 +2 -1
- package/lib/data/PredictionManager.js +16 -2
- 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/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 +2 -1
- 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/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/database/DatabaseSpectrum.js +2 -1
- 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/MouseTracker.js +4 -1
- package/lib-cjs/component/NMRium.js +8 -11
- 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/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 +1 -1
- package/lib-cjs/component/loader/DropZone.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +60 -67
- 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 +43 -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/forms/components/DeltaInput.js +2 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -6
- 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/RangesPanel/RangesHeader.js +38 -52
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
- 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 +11 -28
- 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 +107 -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 -27
- 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/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 +4 -27
- package/lib-cjs/component/reducer/actions/ZonesActions.js +4 -28
- 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 +16 -2
- 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/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 +25 -25
- 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
|
@@ -183,7 +183,7 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
183
183
|
}
|
|
184
184
|
}, children: [(0, nmr_correlation_1.getLabel)(correlations, correlation), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { ref: contextRef, context: contextMenu })] }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: (0, nmr_correlation_1.getCorrelationDelta)(correlation)
|
|
185
185
|
? (0, nmr_correlation_1.getCorrelationDelta)(correlation)?.toFixed(2)
|
|
186
|
-
: '' }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler })) : ((0, jsx_runtime_1.jsx)("
|
|
186
|
+
: '' }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler })) : ((0, jsx_runtime_1.jsx)("span", { style: equivalenceCellStyle, children: correlation.equivalence })) }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount') })) : ('') }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps,
|
|
187
187
|
style: { ...tableDataProps.style, borderRight: '1px solid' }, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.hybridization
|
|
188
188
|
.map((hybrid) => `sp${hybrid}`)
|
|
189
189
|
.join(','), style: correlation.edited.hybridization ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'hybridization') })) : ('') }), additionalColumnFields] }));
|
|
@@ -7,6 +7,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const nmr_load_save_1 = require("nmr-load-save");
|
|
10
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
10
11
|
const full_1 = __importDefault(require("openchemlib/full"));
|
|
11
12
|
const react_2 = require("react");
|
|
12
13
|
const bs_1 = require("react-icons/bs");
|
|
@@ -40,24 +41,6 @@ const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader
|
|
|
40
41
|
const DatabasePreferences_1 = __importDefault(require("./DatabasePreferences"));
|
|
41
42
|
const DatabaseStructureSearchModal_1 = require("./DatabaseStructureSearchModal");
|
|
42
43
|
const DatabaseTable_1 = __importDefault(require("./DatabaseTable"));
|
|
43
|
-
const style = (0, react_1.css) `
|
|
44
|
-
.header {
|
|
45
|
-
height: 30px;
|
|
46
|
-
padding: 2px 0 2px 5px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.input-container {
|
|
50
|
-
width: 100%;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.search-input {
|
|
54
|
-
width: 100% !important;
|
|
55
|
-
border-radius: 5px;
|
|
56
|
-
border: 0.55px solid gray;
|
|
57
|
-
padding: 0 5px;
|
|
58
|
-
outline: none;
|
|
59
|
-
}
|
|
60
|
-
`;
|
|
61
44
|
const emptyKeywords = {
|
|
62
45
|
solvent: '-1',
|
|
63
46
|
searchKeywords: '',
|
|
@@ -156,8 +139,7 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
156
139
|
baseURL: url,
|
|
157
140
|
})));
|
|
158
141
|
}
|
|
159
|
-
catch
|
|
160
|
-
reportError(error);
|
|
142
|
+
catch {
|
|
161
143
|
alert.error(`Failed to load ${url}`);
|
|
162
144
|
}
|
|
163
145
|
finally {
|
|
@@ -193,14 +175,15 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
193
175
|
return (0, database_1.prepareData)(result.data);
|
|
194
176
|
}, [result.data]);
|
|
195
177
|
const resurrectHandler = (0, react_2.useCallback)((rowData) => {
|
|
196
|
-
|
|
178
|
+
let { index, baseURL, jcampURL: jcampRelativeURL } = rowData;
|
|
197
179
|
const { ranges, solvent, names = [] } = result.data[index];
|
|
198
180
|
if (jcampRelativeURL) {
|
|
181
|
+
const url = new URL(jcampRelativeURL, baseURL);
|
|
199
182
|
setTimeout(async () => {
|
|
200
183
|
const hideLoading = await alert.showLoading(`load jcamp in progress...`);
|
|
201
184
|
try {
|
|
202
185
|
const { data } = await (0, nmr_load_save_1.readFromWebSource)({
|
|
203
|
-
entries: [{ baseURL, relativePath:
|
|
186
|
+
entries: [{ baseURL: url.origin, relativePath: url.pathname }],
|
|
204
187
|
});
|
|
205
188
|
const spectrum = data?.spectra?.[0] || null;
|
|
206
189
|
if (spectrum && (0, Spectrum1D_1.isSpectrum1D)(spectrum)) {
|
|
@@ -270,7 +253,6 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
270
253
|
};
|
|
271
254
|
return ((0, jsx_runtime_1.jsxs)("div", { css: [
|
|
272
255
|
BasicPanelStyle_1.tablePanelStyle,
|
|
273
|
-
style,
|
|
274
256
|
isFlipped &&
|
|
275
257
|
(0, react_1.css) `
|
|
276
258
|
.table-container {
|
|
@@ -280,11 +262,11 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
280
262
|
}
|
|
281
263
|
}
|
|
282
264
|
`,
|
|
283
|
-
], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { showSettingButton: true, onSettingClick: settingsPanelHandler, canDelete: false,
|
|
265
|
+
], children: [!isFlipped && ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { showSettingButton: true, onSettingClick: settingsPanelHandler, canDelete: false, children: [(0, jsx_runtime_1.jsx)(ToggleButton_1.default, { defaultValue: selectedTool === ToolTypes_1.options.databaseRangesSelection.id, popupTitle: "Filter by select ranges", popupPlacement: "right", onClick: enableFilterHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaICursor, { style: {
|
|
284
266
|
pointerEvents: 'none',
|
|
285
267
|
fontSize: '12px',
|
|
286
268
|
transform: 'rotate(90deg)',
|
|
287
|
-
} }) }, `${selectedTool}`), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 2 }, items: databases, itemTextField: "label", itemValueField: "key", onChange: handleChangeDatabase, placeholder: "Select database", defaultValue: defaultDatabase }), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 1 }, items: result.solvents, placeholder: "Solvent", onChange: handleSearch, value: keywords.solvent }), (0, jsx_runtime_1.jsx)(Input_1.default, { value: keywords.searchKeywords, renderIcon: () => (0, jsx_runtime_1.jsx)(io5_1.IoSearchOutline, {}), style: { inputWrapper: { flex: 3 } }, className: "search-input", type: "text", debounceTime: 250, placeholder: "Search for parameter...", onChange: handleSearch, onClear: clearHandler, canClear: true }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", onClick: openSearchByStructure, style: { marginLeft: '5px' }, children: !idCode ? ((0, jsx_runtime_1.jsx)(bs_1.BsHexagon, { style: {
|
|
269
|
+
} }) }, `${selectedTool}`), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 2, marginLeft: '5px' }, items: databases, itemTextField: "label", itemValueField: "key", onChange: handleChangeDatabase, placeholder: "Select database", defaultValue: defaultDatabase }), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 1, margin: '0px 5px' }, items: result.solvents, placeholder: "Solvent", onChange: handleSearch, value: keywords.solvent }), (0, jsx_runtime_1.jsx)(Input_1.default, { value: keywords.searchKeywords, renderIcon: () => (0, jsx_runtime_1.jsx)(io5_1.IoSearchOutline, {}), style: { inputWrapper: { flex: 3 } }, className: "search-input", type: "text", debounceTime: 250, placeholder: "Search for parameter...", onChange: handleSearch, onClear: clearHandler, canClear: true }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", onClick: openSearchByStructure, style: { marginLeft: '5px' }, children: !idCode ? ((0, jsx_runtime_1.jsx)(bs_1.BsHexagon, { style: {
|
|
288
270
|
fontSize: '14px',
|
|
289
271
|
} })) : ((0, jsx_runtime_1.jsx)(bs_1.BsHexagonFill, { style: {
|
|
290
272
|
fontSize: '14px',
|
|
@@ -315,10 +297,11 @@ function mapSolventsToSelect(solvents) {
|
|
|
315
297
|
return result;
|
|
316
298
|
}
|
|
317
299
|
async function saveJcampAsJson(rowData, filteredData) {
|
|
318
|
-
const { index, baseURL, jcampURL
|
|
300
|
+
const { index, baseURL, jcampURL, names, ocl = {}, smiles } = rowData;
|
|
319
301
|
const { ranges } = filteredData.data[index];
|
|
302
|
+
const url = new URL(jcampURL, baseURL);
|
|
320
303
|
const { data: { spectra, source } = { source: {}, spectra: [] }, version } = await (0, nmr_load_save_1.readFromWebSource)({
|
|
321
|
-
entries: [{ baseURL, relativePath:
|
|
304
|
+
entries: [{ baseURL: url.origin, relativePath: url.pathname }],
|
|
322
305
|
});
|
|
323
306
|
let molfile = '';
|
|
324
307
|
let molecule = null;
|
|
@@ -341,7 +324,7 @@ async function saveJcampAsJson(rowData, filteredData) {
|
|
|
341
324
|
...spectrum,
|
|
342
325
|
ranges: {
|
|
343
326
|
options: { sum: sum || 100 },
|
|
344
|
-
values: (0,
|
|
327
|
+
values: (0, nmr_processing_1.mapRanges)(ranges, spectrum),
|
|
345
328
|
},
|
|
346
329
|
});
|
|
347
330
|
}
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
@@ -9,7 +32,7 @@ const react_1 = require("react");
|
|
|
9
32
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
10
33
|
const Label_1 = __importDefault(require("../../elements/Label"));
|
|
11
34
|
const FormikColorInput_1 = __importDefault(require("../../elements/formik/FormikColorInput"));
|
|
12
|
-
const FormikColumnFormatField_1 =
|
|
35
|
+
const FormikColumnFormatField_1 = __importStar(require("../../elements/formik/FormikColumnFormatField"));
|
|
13
36
|
const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
|
|
14
37
|
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
15
38
|
const PreferencesContainer_1 = require("../extra/preferences/PreferencesContainer");
|
|
@@ -32,6 +55,6 @@ function DatabasePreferences(props, ref) {
|
|
|
32
55
|
formRef.current.submitForm();
|
|
33
56
|
},
|
|
34
57
|
}));
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: {}, onSubmit: saveHandler, innerRef: formRef, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(PreferencesGroup_1.PreferencesGroup, { children: [(0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Preview jcamp", checkControllerName: "previewJcamp", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: "color" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Margin bottom (px) :", style:
|
|
58
|
+
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: {}, onSubmit: saveHandler, innerRef: formRef, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(PreferencesGroup_1.PreferencesGroup, { children: [(0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Preview jcamp", checkControllerName: "previewJcamp", hideFormatField: true }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Color", style: FormikColumnFormatField_1.formatFieldLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: "color" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Margin bottom (px) :", style: FormikColumnFormatField_1.formatFieldLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "marginBottom", type: "number", style: FormikColumnFormatField_1.formatFieldInputStyle }) })] }), (0, jsx_runtime_1.jsxs)(PreferencesGroup_1.PreferencesGroup, { header: "Table Preferences", children: [(0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Structure", checkControllerName: "showSmiles", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Solvent", checkControllerName: "showSolvent", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Names", checkControllerName: "showNames", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Range", checkControllerName: "range.show", formatControllerName: "range.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "\u03B4 (ppm)", checkControllerName: "delta.show", formatControllerName: "delta.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Assignment", checkControllerName: "showAssignment", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "J (Hz)", checkControllerName: "coupling.show", formatControllerName: "coupling.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Multiplicity", checkControllerName: "showMultiplicity", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Save as nmrium", checkControllerName: "allowSaveAsNMRium", hideFormatField: true })] })] }) }) }));
|
|
36
59
|
}
|
|
37
60
|
exports.default = (0, react_1.forwardRef)(DatabasePreferences);
|
|
@@ -3,37 +3,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("
|
|
7
|
-
/** @jsxImportSource @emotion/react */
|
|
8
|
-
const react_1 = require("@emotion/react");
|
|
9
|
-
const react_2 = require("react");
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
10
7
|
const fa_1 = require("react-icons/fa");
|
|
11
8
|
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
12
9
|
const ToggleButton_1 = __importDefault(require("../../elements/ToggleButton"));
|
|
13
10
|
const ToolTip_1 = __importDefault(require("../../elements/ToolTip/ToolTip"));
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
line-height: 22px;
|
|
30
|
-
padding: 0 10px;
|
|
31
|
-
white-space: nowrap;
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
11
|
+
const PanelHeader_1 = __importDefault(require("./PanelHeader"));
|
|
12
|
+
const styles = {
|
|
13
|
+
leftContainer: {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
flexDirection: 'row',
|
|
16
|
+
flex: 1,
|
|
17
|
+
},
|
|
18
|
+
counterLabel: {
|
|
19
|
+
margin: 0,
|
|
20
|
+
textAlign: 'right',
|
|
21
|
+
lineHeight: '22px',
|
|
22
|
+
padding: '0 10px',
|
|
23
|
+
whiteSpace: 'nowrap',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
34
26
|
function DefaultPanelHeader({ counter, onDelete = () => null, deleteToolTip = 'Delete', onFilter = () => null, filterToolTip = '', filterIsActive = false, counterFiltered = 0, children, onSettingClick = () => null, showSettingButton = false, canDelete = true, disableDelete = false, style = {}, className = '', renderRightButtons, }) {
|
|
35
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { style, className, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.leftContainer, children: [canDelete && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'red' }, onClick: onDelete, disabled: counter === 0 || disableDelete, toolTip: deleteToolTip, tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) })), filterToolTip ? ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: filterToolTip, popupPlacement: "right", onClick: onFilter, defaultValue: filterIsActive, children: (0, jsx_runtime_1.jsx)(fa_1.FaFilter, { style: { pointerEvents: 'none', fontSize: '12px' } }) })) : null, children] }), renderRightButtons?.(), counter !== undefined && ((0, jsx_runtime_1.jsxs)("p", { style: styles.counterLabel, children: ["[", ' ', filterIsActive && counterFiltered !== undefined
|
|
36
28
|
? `${counterFiltered}/${counter}`
|
|
37
29
|
: counter, ' ', "]"] })), showSettingButton && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Preferences", popupPlacement: "left", children: (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onSettingClick, children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) }) }))] }));
|
|
38
30
|
}
|
|
39
|
-
exports.default =
|
|
31
|
+
exports.default = DefaultPanelHeader;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const containerStyle = {
|
|
5
|
+
display: 'flex',
|
|
6
|
+
flexDirection: 'row',
|
|
7
|
+
borderBottom: '0.55px solid rgb(240 240 240)',
|
|
8
|
+
padding: '2px 5px',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
};
|
|
11
|
+
function PanelHeader(props) {
|
|
12
|
+
const { style = {}, children } = props;
|
|
13
|
+
return (0, jsx_runtime_1.jsxs)("div", { style: { ...containerStyle, ...style }, children: [children, " "] });
|
|
14
|
+
}
|
|
15
|
+
exports.default = PanelHeader;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
|
+
const formik_1 = require("formik");
|
|
31
|
+
const react_1 = require("react");
|
|
32
|
+
const Yup = __importStar(require("yup"));
|
|
33
|
+
const PredictionManager_1 = require("../../../data/PredictionManager");
|
|
34
|
+
const generateNumbersPowerOfX_1 = __importDefault(require("../../../data/utilities/generateNumbersPowerOfX"));
|
|
35
|
+
const GroupPane_1 = require("../../elements/GroupPane");
|
|
36
|
+
const IsotopesViewer_1 = __importDefault(require("../../elements/IsotopesViewer"));
|
|
37
|
+
const Label_1 = __importDefault(require("../../elements/Label"));
|
|
38
|
+
const FormikCheckBox_1 = __importDefault(require("../../elements/formik/FormikCheckBox"));
|
|
39
|
+
const FormikErrorsSummary_1 = __importDefault(require("../../elements/formik/FormikErrorsSummary"));
|
|
40
|
+
const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
|
|
41
|
+
const FormikSelect_1 = __importDefault(require("../../elements/formik/FormikSelect"));
|
|
42
|
+
const NUMBER_OF_POINTS_1D = (0, generateNumbersPowerOfX_1.default)(12, 19);
|
|
43
|
+
const NUMBER_OF_POINTS_2D = (0, generateNumbersPowerOfX_1.default)(10, 10, {
|
|
44
|
+
format: (value) => value,
|
|
45
|
+
});
|
|
46
|
+
const predictionFormValidation = Yup.object().shape({
|
|
47
|
+
name: Yup.string().label('Name'),
|
|
48
|
+
frequency: Yup.number().integer().required().label('Frequency'),
|
|
49
|
+
'1d': Yup.object({
|
|
50
|
+
'1H': Yup.object({
|
|
51
|
+
from: Yup.number().required().label("1H ' From ' "),
|
|
52
|
+
to: Yup.number().required().label("1H ' To ' "),
|
|
53
|
+
}),
|
|
54
|
+
'13C': Yup.object().shape({
|
|
55
|
+
from: Yup.number().required().label("13C ' From ' "),
|
|
56
|
+
to: Yup.number().required().label("13C ' To ' "),
|
|
57
|
+
}),
|
|
58
|
+
lineWidth: Yup.number().integer().min(1).required().label('Line Width'),
|
|
59
|
+
nbPoints: Yup.number().integer().required().label('1D Number Of Points'),
|
|
60
|
+
}),
|
|
61
|
+
'2d': Yup.object({
|
|
62
|
+
nbPoints: Yup.object({
|
|
63
|
+
x: Yup.number().integer().required().label('2D Number Of Points'),
|
|
64
|
+
y: Yup.number().integer().required().label('2D Number Of Points'),
|
|
65
|
+
}),
|
|
66
|
+
}),
|
|
67
|
+
spectra: Yup.object({
|
|
68
|
+
proton: Yup.boolean(),
|
|
69
|
+
carbon: Yup.boolean(),
|
|
70
|
+
cosy: Yup.boolean(),
|
|
71
|
+
hsqc: Yup.boolean(),
|
|
72
|
+
hmbc: Yup.boolean(),
|
|
73
|
+
}).test('check-options', 'You must check one of the options to start prediction', (obj) => {
|
|
74
|
+
if (Object.values(obj).includes(true)) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}),
|
|
79
|
+
});
|
|
80
|
+
const labelStyle = {
|
|
81
|
+
label: { flex: 4, fontWeight: '500' },
|
|
82
|
+
wrapper: { flex: 8, display: 'flex', alignItems: 'center' },
|
|
83
|
+
container: { padding: '5px 0' },
|
|
84
|
+
};
|
|
85
|
+
const inputStyle = {
|
|
86
|
+
input: {
|
|
87
|
+
padding: '5px',
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
const styles = {
|
|
91
|
+
select: {
|
|
92
|
+
width: '100%',
|
|
93
|
+
minWidth: '100px',
|
|
94
|
+
maxWidth: '280px',
|
|
95
|
+
height: 30,
|
|
96
|
+
margin: 0,
|
|
97
|
+
},
|
|
98
|
+
groupHeader: {
|
|
99
|
+
borderBottom: '1px solid #efefef',
|
|
100
|
+
paddingBottom: '5px',
|
|
101
|
+
fontWeight: '600',
|
|
102
|
+
color: '#005d9e',
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
function PredictionOptionsPanel(props, ref) {
|
|
106
|
+
const { options, onSubmit, hideName = false } = props;
|
|
107
|
+
return ((0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: options, validationSchema: predictionFormValidation, enableReinitialize: true, onSubmit: onSubmit, innerRef: ref, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(FormikErrorsSummary_1.default, {}), !hideName && ((0, jsx_runtime_1.jsx)(Label_1.default, { title: "Name", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "name", style: inputStyle }) })), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Frequency", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: PredictionManager_1.FREQUENCIES, style: styles.select, name: "frequency" }) }), (0, jsx_runtime_1.jsxs)(GroupPane_1.GroupPane, { text: "1D Options", style: {
|
|
108
|
+
header: styles.groupHeader,
|
|
109
|
+
}, children: [(0, jsx_runtime_1.jsxs)(Label_1.default, { title: "1H", renderTitle: (title) => ((0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: title, className: "custom-label" })), style: labelStyle, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.from", type: "number", style: inputStyle }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.1H.to", type: "number", style: inputStyle }) })] }), (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "13C", renderTitle: (title) => ((0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: title, className: "custom-label" })), style: labelStyle, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.from", type: "number", style: inputStyle }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.13C.to", type: "number", style: inputStyle }) })] }), (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "Line Width", style: labelStyle, children: [(0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "1d.lineWidth", type: "number", style: inputStyle }), (0, jsx_runtime_1.jsx)("span", { style: { paddingLeft: '0.4rem' }, children: " Hz " })] }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Number of Points", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: NUMBER_OF_POINTS_1D, name: "1d.nbPoints", style: styles.select }) })] }), (0, jsx_runtime_1.jsx)(GroupPane_1.GroupPane, { text: "2D Options", style: {
|
|
110
|
+
header: styles.groupHeader,
|
|
111
|
+
}, children: (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "Number of Points", style: labelStyle, children: [(0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.x", style: { margin: 0, height: 30 } }), (0, jsx_runtime_1.jsx)("span", { style: { padding: '0 10px' }, children: " X " }), (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: NUMBER_OF_POINTS_2D, name: "2d.nbPoints.y", style: { margin: 0, height: 30 } })] }) }), (0, jsx_runtime_1.jsx)(GroupPane_1.GroupPane, { text: "Spectra", style: {
|
|
112
|
+
header: styles.groupHeader,
|
|
113
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-around' }, children: [(0, jsx_runtime_1.jsx)(IsotopesOption, { title: "1H", name: "spectra.proton" }), (0, jsx_runtime_1.jsx)(IsotopesOption, { title: "13C", name: "spectra.carbon" }), (0, jsx_runtime_1.jsx)(IsotopesOption, { title: "COSY", name: "spectra.cosy" }), (0, jsx_runtime_1.jsx)(IsotopesOption, { title: "HSQC", name: "spectra.hsqc" }), (0, jsx_runtime_1.jsx)(IsotopesOption, { title: "HMBC", name: "spectra.hmbc" })] }) })] }) }));
|
|
114
|
+
}
|
|
115
|
+
function IsotopesOption(props) {
|
|
116
|
+
const { name, title } = props;
|
|
117
|
+
return ((0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: name, style: {
|
|
118
|
+
checkbox: { display: 'flex' },
|
|
119
|
+
container: { flexDirection: 'row-reverse', padding: '0 5px' },
|
|
120
|
+
}, renderLabel: () => ((0, jsx_runtime_1.jsx)("label", { htmlFor: name, children: (0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { value: title, style: { padding: '0 5px' } }) })) }));
|
|
121
|
+
}
|
|
122
|
+
exports.default = (0, react_1.forwardRef)(PredictionOptionsPanel);
|
|
@@ -3,55 +3,125 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
+
const react_d3_utils_1 = require("react-d3-utils");
|
|
9
|
+
const full_1 = require("react-ocl/full");
|
|
8
10
|
const ui_1 = require("react-science/ui");
|
|
11
|
+
const PredictionManager_1 = require("../../../data/PredictionManager");
|
|
9
12
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
10
13
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
14
|
+
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
15
|
+
const NextPrev_1 = __importDefault(require("../../elements/NextPrev"));
|
|
11
16
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
18
|
+
const MoleculeStructureEditorModal_1 = require("../../modal/MoleculeStructureEditorModal");
|
|
19
|
+
const MoleculeHeader_1 = __importDefault(require("../MoleculesPanel/MoleculeHeader"));
|
|
20
|
+
const MoleculePanelHeader_1 = __importDefault(require("../MoleculesPanel/MoleculePanelHeader"));
|
|
21
|
+
const BasicPanelStyle_1 = require("../extra/BasicPanelStyle");
|
|
22
|
+
const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader"));
|
|
23
|
+
const PredictionPreferences_1 = __importDefault(require("./PredictionPreferences"));
|
|
24
|
+
const PredictionSimpleOptions_1 = __importDefault(require("./PredictionSimpleOptions"));
|
|
25
|
+
const styles = {
|
|
26
|
+
flexColumnContainer: {
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexDirection: 'column',
|
|
29
|
+
flex: 1,
|
|
30
|
+
},
|
|
31
|
+
slider: {
|
|
32
|
+
overflow: 'hidden auto',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
function PredictionPanel() {
|
|
36
|
+
const { molecules, view: { molecules: moleculesView, predictions }, } = (0, ChartContext_1.useChartData)();
|
|
21
37
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
22
38
|
const alert = (0, Alert_1.useAlert)();
|
|
23
|
-
const
|
|
39
|
+
const [currentIndex, setCurrentIndex] = (0, react_1.useState)(0);
|
|
40
|
+
const [molfile, setMolfile] = (0, react_1.useState)(null);
|
|
41
|
+
const [isFlipped, setFlipStatus] = (0, react_1.useState)(false);
|
|
42
|
+
const settingRef = (0, react_1.useRef)();
|
|
43
|
+
const { item: spectraPanelState, utils: { toggle: openSpectraPanel }, } = (0, ui_1.useAccordionContext)('Spectra');
|
|
44
|
+
const predictionPreferences = (0, usePanelPreferences_1.usePanelPreferences)('prediction');
|
|
45
|
+
const openMoleculeEditor = (0, MoleculeStructureEditorModal_1.useMoleculeEditor)(true);
|
|
46
|
+
const refreshSlider = (0, react_1.useRef)(false);
|
|
47
|
+
(0, react_1.useEffect)(() => {
|
|
48
|
+
if (Array.isArray(molecules) &&
|
|
49
|
+
molecules.length > 0 &&
|
|
50
|
+
refreshSlider.current) {
|
|
51
|
+
const newIndex = molecules.length - 1;
|
|
52
|
+
setCurrentIndex(newIndex);
|
|
53
|
+
setMolfile(molecules[newIndex].molfile);
|
|
54
|
+
refreshSlider.current = false;
|
|
55
|
+
}
|
|
56
|
+
}, [molecules]);
|
|
57
|
+
function changeHandler(molfile, molecule) {
|
|
58
|
+
const atoms = molecule.getAllAtoms();
|
|
59
|
+
if (atoms === 0) {
|
|
60
|
+
setMolfile(null);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
setMolfile(molfile);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function predictHandler(action) {
|
|
67
|
+
refreshSlider.current = action === 'add';
|
|
24
68
|
void (async () => {
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
69
|
+
if (molfile) {
|
|
70
|
+
const predictedSpectra = [];
|
|
71
|
+
for (const [key, value] of Object.entries(predictionPreferences.spectra)) {
|
|
72
|
+
if (value) {
|
|
73
|
+
predictedSpectra.push(key);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const hideLoading = await alert.showLoading(`Predict ${predictedSpectra.join(',')} in progress`);
|
|
77
|
+
try {
|
|
78
|
+
const data = await (0, PredictionManager_1.predictSpectra)(molfile);
|
|
79
|
+
dispatch({
|
|
80
|
+
type: 'PREDICT_SPECTRA',
|
|
81
|
+
payload: {
|
|
82
|
+
predictedSpectra: data.spectra,
|
|
83
|
+
options: predictionPreferences,
|
|
84
|
+
molecule: { ...molecules[currentIndex], molfile },
|
|
85
|
+
action,
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
if (!spectraPanelState?.isOpen) {
|
|
89
|
+
openSpectraPanel();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
alert.error(error.message);
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
hideLoading();
|
|
37
97
|
}
|
|
38
|
-
hideLoading();
|
|
39
98
|
}
|
|
40
99
|
else {
|
|
41
100
|
alert.error('No Molecule selected');
|
|
42
101
|
}
|
|
43
102
|
})();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
103
|
+
}
|
|
104
|
+
function settingsPanelHandler() {
|
|
105
|
+
setFlipStatus(!isFlipped);
|
|
106
|
+
}
|
|
107
|
+
function saveSettingHandler() {
|
|
108
|
+
settingRef.current.saveSetting();
|
|
109
|
+
setFlipStatus(false);
|
|
110
|
+
}
|
|
111
|
+
const isPredictedBefore = !!(molecules[currentIndex]?.id && predictions[molecules[currentIndex].id]);
|
|
112
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: BasicPanelStyle_1.tablePanelStyle, children: [isFlipped && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler }), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: (0, jsx_runtime_1.jsx)(PredictionPreferences_1.default, { ref: settingRef }) })] })), !isFlipped && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(MoleculePanelHeader_1.default, { currentIndex: currentIndex, moleculesView: moleculesView, molecules: molecules, renderSource: "predictionPanel", onClickPreferences: settingsPanelHandler, onOpenMoleculeEditor: () => openMoleculeEditor(), children: (0, jsx_runtime_1.jsx)(PredictionSimpleOptions_1.default, {}) }), (0, jsx_runtime_1.jsxs)("div", { style: styles.flexColumnContainer, children: [(0, jsx_runtime_1.jsx)("div", { style: { flex: 1 }, children: (0, jsx_runtime_1.jsx)(react_d3_utils_1.ResponsiveChart, { children: ({ height, width }) => {
|
|
113
|
+
return ((0, jsx_runtime_1.jsx)(NextPrev_1.default, { onChange: (slideIndex) => {
|
|
114
|
+
setCurrentIndex(slideIndex);
|
|
115
|
+
setMolfile(molecules[slideIndex].molfile);
|
|
116
|
+
}, defaultIndex: currentIndex, style: {
|
|
117
|
+
arrowContainer: {
|
|
118
|
+
top: '40px',
|
|
119
|
+
padding: '0 10px 0 55px',
|
|
120
|
+
},
|
|
121
|
+
}, children: molecules && molecules.length > 0 ? (molecules.map((mol, molIndex) => ((0, jsx_runtime_1.jsxs)("div", { style: styles.flexColumnContainer, children: [(0, jsx_runtime_1.jsx)(MoleculeHeader_1.default, { currentMolecule: mol, molecules: molecules }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
122
|
+
...styles.slider,
|
|
123
|
+
height: height - 31,
|
|
124
|
+
}, children: molIndex === currentIndex && ((0, jsx_runtime_1.jsx)(full_1.StructureEditor, { width: width, initialMolfile: mol.molfile, svgMenu: true, fragment: false, onChange: changeHandler })) })] }, mol.id)))) : ((0, jsx_runtime_1.jsx)(full_1.StructureEditor, { width: width, height: height, svgMenu: true, fragment: false, onChange: changeHandler })) }));
|
|
125
|
+
} }) }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', padding: '5px' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: () => predictHandler('save'), disabled: !molfile, children: isPredictedBefore ? 'Replace prediction' : 'Predict spectra' }), isPredictedBefore && ((0, jsx_runtime_1.jsx)(Button_1.default.Action, { style: { marginLeft: '5px' }, onClick: () => predictHandler('add'), children: "Add prediction" }))] })] })] }))] }));
|
|
56
126
|
}
|
|
57
|
-
exports.default =
|
|
127
|
+
exports.default = PredictionPanel;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
9
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
10
|
+
const PreferencesContainer_1 = require("../extra/preferences/PreferencesContainer");
|
|
11
|
+
const PredictionOptionsPanel_1 = __importDefault(require("./PredictionOptionsPanel"));
|
|
12
|
+
function PredictionPreferences(props, ref) {
|
|
13
|
+
const formRef = (0, react_1.useRef)(null);
|
|
14
|
+
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
15
|
+
const predictionPreferences = (0, usePanelPreferences_1.usePanelPreferences)('prediction');
|
|
16
|
+
const saveHandler = (0, react_1.useCallback)((values) => {
|
|
17
|
+
preferences.dispatch({
|
|
18
|
+
type: 'SET_PANELS_PREFERENCES',
|
|
19
|
+
payload: { key: 'prediction', value: values },
|
|
20
|
+
});
|
|
21
|
+
}, [preferences]);
|
|
22
|
+
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
23
|
+
saveSetting: () => {
|
|
24
|
+
formRef.current.submitForm();
|
|
25
|
+
},
|
|
26
|
+
}), []);
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { style: { backgroundColor: 'white' }, children: (0, jsx_runtime_1.jsx)(PredictionOptionsPanel_1.default, { onSubmit: saveHandler, options: predictionPreferences, ref: formRef, hideName: true }) }));
|
|
28
|
+
}
|
|
29
|
+
exports.default = (0, react_1.forwardRef)(PredictionPreferences);
|