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
|
@@ -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 {};
|
|
@@ -1,93 +1,90 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
2
|
-
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import { css } from '@emotion/react';
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
2
|
import { SvgNmrFt } from 'cheminfo-font';
|
|
5
3
|
import { Molecule as OCLMolecule } from 'openchemlib/full';
|
|
6
4
|
import { useCallback } from 'react';
|
|
7
|
-
import { FaCopy, FaDownload, FaFileExport, FaFileImage, FaPaste, FaPlus, FaRegTrashAlt, } from 'react-icons/fa';
|
|
5
|
+
import { FaCog, FaCopy, FaDownload, FaFileExport, FaFileImage, FaPaste, FaPlus, FaRegTrashAlt, } from 'react-icons/fa';
|
|
8
6
|
import { IoOpenOutline } from 'react-icons/io5';
|
|
7
|
+
import { DropdownMenu } from 'react-science/ui';
|
|
9
8
|
import { useAssignmentData } from '../../assignment/AssignmentsContext';
|
|
10
9
|
import { useDispatch } from '../../context/DispatchContext';
|
|
11
10
|
import { useGlobal } from '../../context/GlobalContext';
|
|
12
11
|
import ActiveButton from '../../elements/ActiveButton';
|
|
13
|
-
import
|
|
14
|
-
import MenuButton from '../../elements/MenuButton';
|
|
15
|
-
import ToolTip from '../../elements/ToolTip/ToolTip';
|
|
12
|
+
import Button from '../../elements/Button';
|
|
16
13
|
import { useAlert } from '../../elements/popup/Alert';
|
|
17
|
-
import { positions, useModal } from '../../elements/popup/Modal';
|
|
18
14
|
import AboutPredictionModal from '../../modal/AboutPredictionModal';
|
|
19
|
-
import
|
|
15
|
+
import { usePredictSpectraModal } from '../../modal/PredictSpectraModal';
|
|
20
16
|
import { copyPNGToClipboard, copyTextToClipboard, exportAsSVG, } from '../../utility/export';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
line-height: 22px;
|
|
42
|
-
padding: 0 10px;
|
|
43
|
-
}
|
|
44
|
-
`;
|
|
45
|
-
const atomLabelStyle = {
|
|
46
|
-
width: '14px',
|
|
47
|
-
height: '14px',
|
|
48
|
-
padding: 0,
|
|
49
|
-
margin: 0,
|
|
50
|
-
textAlign: 'center',
|
|
51
|
-
lineHeight: 1,
|
|
17
|
+
import PanelHeader from '../header/PanelHeader';
|
|
18
|
+
const styles = {
|
|
19
|
+
counter: {
|
|
20
|
+
margin: 0,
|
|
21
|
+
textAlign: 'right',
|
|
22
|
+
lineHeight: '22px',
|
|
23
|
+
padding: '0 10px',
|
|
24
|
+
whiteSpace: 'nowrap',
|
|
25
|
+
},
|
|
26
|
+
atomLabel: {
|
|
27
|
+
width: '14px',
|
|
28
|
+
height: '14px',
|
|
29
|
+
padding: 0,
|
|
30
|
+
margin: 0,
|
|
31
|
+
textAlign: 'center',
|
|
32
|
+
lineHeight: 1,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
const LabelWrapper = ({ children }) => {
|
|
36
|
+
return _jsx("p", { style: { padding: '0.4em' }, children: children });
|
|
52
37
|
};
|
|
53
38
|
const MOL_EXPORT_MENU = [
|
|
54
39
|
{
|
|
55
|
-
|
|
40
|
+
type: 'option',
|
|
56
41
|
icon: _jsx(FaCopy, {}),
|
|
57
|
-
label:
|
|
42
|
+
label: _jsx(LabelWrapper, { children: "Copy as molfile V3" }),
|
|
43
|
+
data: {
|
|
44
|
+
id: 'molfileV3',
|
|
45
|
+
},
|
|
58
46
|
},
|
|
59
47
|
{
|
|
60
|
-
|
|
48
|
+
type: 'option',
|
|
61
49
|
icon: _jsx(FaCopy, {}),
|
|
62
|
-
label:
|
|
50
|
+
label: _jsx(LabelWrapper, { children: "Copy as molfile V2" }),
|
|
51
|
+
data: {
|
|
52
|
+
id: 'molfileV2',
|
|
53
|
+
},
|
|
63
54
|
},
|
|
64
55
|
{
|
|
65
|
-
|
|
56
|
+
type: 'option',
|
|
66
57
|
icon: _jsx(FaFileImage, {}),
|
|
67
|
-
label:
|
|
58
|
+
label: _jsx(LabelWrapper, { children: "Copy as PNG" }),
|
|
59
|
+
data: {
|
|
60
|
+
id: 'png',
|
|
61
|
+
},
|
|
68
62
|
},
|
|
69
63
|
{
|
|
70
|
-
|
|
64
|
+
type: 'option',
|
|
71
65
|
icon: _jsx(FaDownload, {}),
|
|
72
|
-
label:
|
|
66
|
+
label: _jsx(LabelWrapper, { children: "Export as SVG" }),
|
|
67
|
+
data: {
|
|
68
|
+
id: 'svg',
|
|
69
|
+
},
|
|
73
70
|
},
|
|
74
71
|
];
|
|
75
|
-
export default function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMoleculeIndexChange
|
|
72
|
+
export default function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMoleculeIndexChange, onOpenMoleculeEditor, renderSource = 'moleculePanel', onClickPreferences, children, }) {
|
|
76
73
|
const { rootRef } = useGlobal();
|
|
77
74
|
const alert = useAlert();
|
|
78
75
|
const dispatch = useDispatch();
|
|
79
|
-
const modal = useModal();
|
|
80
76
|
const assignmentData = useAssignmentData();
|
|
81
77
|
const moleculeKey = molecules?.[currentIndex]?.id;
|
|
78
|
+
const openPredictSpectraModal = usePredictSpectraModal();
|
|
82
79
|
const saveAsSVGHandler = useCallback(() => {
|
|
83
80
|
if (!rootRef)
|
|
84
81
|
return;
|
|
85
|
-
exportAsSVG(rootRef, `molSVG${currentIndex}`, 'molFile');
|
|
82
|
+
exportAsSVG(rootRef, `molSVG${currentIndex} `, 'molFile');
|
|
86
83
|
}, [rootRef, currentIndex]);
|
|
87
84
|
const saveAsPNGHandler = useCallback(() => {
|
|
88
85
|
if (!rootRef)
|
|
89
86
|
return;
|
|
90
|
-
copyPNGToClipboard(rootRef, `molSVG${currentIndex}`);
|
|
87
|
+
copyPNGToClipboard(rootRef, `molSVG${currentIndex} `);
|
|
91
88
|
alert.success('MOL copied as PNG to clipboard');
|
|
92
89
|
}, [rootRef, alert, currentIndex]);
|
|
93
90
|
const saveAsMolHandler = useCallback((molfile) => {
|
|
@@ -100,26 +97,26 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
|
|
|
100
97
|
}
|
|
101
98
|
});
|
|
102
99
|
}, [alert]);
|
|
103
|
-
const exportHandler = useCallback((
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
const exportHandler = useCallback((selected) => {
|
|
101
|
+
const molecule = molecules?.[currentIndex];
|
|
102
|
+
if (molecule) {
|
|
103
|
+
switch (selected?.data.id) {
|
|
104
|
+
case 'molfileV3':
|
|
105
|
+
saveAsMolHandler(molecule.molfile);
|
|
106
|
+
break;
|
|
107
|
+
case 'molfileV2': {
|
|
108
|
+
saveAsMolHandler(OCLMolecule.fromMolfile(molecule.molfile).toMolfile());
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case 'png':
|
|
112
|
+
saveAsPNGHandler();
|
|
113
|
+
break;
|
|
114
|
+
case 'svg':
|
|
115
|
+
saveAsSVGHandler();
|
|
116
|
+
break;
|
|
117
|
+
default:
|
|
118
|
+
break;
|
|
109
119
|
}
|
|
110
|
-
case 'molfileV2': {
|
|
111
|
-
const molfile = molecules?.[currentIndex].molfile || '';
|
|
112
|
-
saveAsMolHandler(OCLMolecule.fromMolfile(molfile).toMolfile());
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
case 'png':
|
|
116
|
-
saveAsPNGHandler();
|
|
117
|
-
break;
|
|
118
|
-
case 'svg':
|
|
119
|
-
saveAsSVGHandler();
|
|
120
|
-
break;
|
|
121
|
-
default:
|
|
122
|
-
break;
|
|
123
120
|
}
|
|
124
121
|
}, [
|
|
125
122
|
currentIndex,
|
|
@@ -135,7 +132,7 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
|
|
|
135
132
|
}, [dispatch]);
|
|
136
133
|
const handleDelete = useCallback(() => {
|
|
137
134
|
if (molecules[currentIndex]?.id) {
|
|
138
|
-
onMoleculeIndexChange(0);
|
|
135
|
+
onMoleculeIndexChange?.(0);
|
|
139
136
|
dispatch({
|
|
140
137
|
type: 'DELETE_MOLECULE',
|
|
141
138
|
payload: { id: molecules[currentIndex].id, assignmentData },
|
|
@@ -148,13 +145,6 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
|
|
|
148
145
|
dispatch,
|
|
149
146
|
assignmentData,
|
|
150
147
|
]);
|
|
151
|
-
const openPredictSpectraModal = useCallback(() => {
|
|
152
|
-
modal.show(_jsx(PredictSpectraModal, { molfile: molecules[currentIndex] }), {
|
|
153
|
-
position: positions.TOP_CENTER,
|
|
154
|
-
enableResizing: true,
|
|
155
|
-
width: 600,
|
|
156
|
-
});
|
|
157
|
-
}, [modal, molecules, currentIndex]);
|
|
158
148
|
function floatMoleculeHandler() {
|
|
159
149
|
dispatch({
|
|
160
150
|
type: 'FLOAT_MOLECULE_OVER_SPECTRUM',
|
|
@@ -168,7 +158,7 @@ export default function MoleculePanelHeader({ currentIndex, molecules, molecules
|
|
|
168
158
|
});
|
|
169
159
|
}
|
|
170
160
|
const hasMolecules = molecules && molecules.length > 0;
|
|
171
|
-
return (_jsxs(
|
|
161
|
+
return (_jsxs(PanelHeader, { children: [renderSource === 'predictionPanel' && _jsx(AboutPredictionModal, {}), renderSource === 'moleculePanel' && (_jsx(DropdownMenu, { trigger: "click", options: MOL_EXPORT_MENU, onSelect: exportHandler, children: _jsx(Button.BarButton, { as: "div", disabled: !hasMolecules, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Export As", tooltipOrientation: "horizontal", children: _jsx(FaFileExport, {}) }) })), _jsx(Button.BarButton, { onClick: handlePaste, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Paste molfile", tooltipOrientation: "horizontal", children: _jsx(FaPaste, {}) }), _jsx(Button.BarButton, { onClick: onOpenMoleculeEditor, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Add molecule", tooltipOrientation: "horizontal", children: _jsx(FaPlus, {}) }), renderSource === 'moleculePanel' && (_jsxs(_Fragment, { children: [_jsx(Button.BarButton, { onClick: handleDelete, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Delete molecule", tooltipOrientation: "horizontal", disabled: !hasMolecules, children: _jsx(FaRegTrashAlt, {}) }), hasMolecules && (_jsx(Button.BarButton, { color: { base: '#4e4e4e', hover: '#4e4e4e' }, onClick: () => openPredictSpectraModal(molecules[currentIndex]), toolTip: "Predict spectra", tooltipOrientation: "horizontal", children: _jsx(SvgNmrFt, {}) }))] })), _jsx(ActiveButton, { value: moleculesView?.[moleculeKey]?.floating.visible || false, popupTitle: "Float molecule", popupPlacement: "left", onClick: floatMoleculeHandler, disabled: !hasMolecules, children: _jsx(IoOpenOutline, {}) }), _jsx(ActiveButton, { style: { marginLeft: '2px' }, value: moleculesView?.[moleculeKey]?.showAtomNumber || false, popupTitle: "Show atom number", popupPlacement: "left", onClick: showAtomNumbersHandler, disabled: !hasMolecules, children: _jsx("p", { style: styles.atomLabel, children: "#" }) }), _jsx("div", { style: { flex: 1 }, children: children }), _jsxs("p", { style: styles.counter, children: [molecules &&
|
|
172
162
|
molecules.length > 0 &&
|
|
173
|
-
`${+(currentIndex + 1)} / ${molecules.length}`, ' '] })] }));
|
|
163
|
+
`${+(currentIndex + 1)} / ${molecules.length}`, ' '] }), onClickPreferences && (_jsx(Button.BarButton, { color: { base: 'black', hover: 'black' }, onClick: onClickPreferences, toolTip: "Preferences", tooltipOrientation: "vertical", children: _jsx(FaCog, {}) }))] }));
|
|
174
164
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
function getElements(activeTab) {
|
|
2
|
+
if (!activeTab)
|
|
3
|
+
return;
|
|
2
4
|
const nuclei = activeTab.split(',');
|
|
3
5
|
return nuclei.map((nucleus) => nucleus.replaceAll(/\d/g, ''));
|
|
4
6
|
}
|
|
@@ -15,7 +17,7 @@ function getElements(activeTab) {
|
|
|
15
17
|
*/
|
|
16
18
|
export function extractFromAtom(atom, activeTab, axis) {
|
|
17
19
|
const elements = getElements(activeTab);
|
|
18
|
-
if (elements.length > 0 && Object.keys(atom).length > 0) {
|
|
20
|
+
if (elements && elements.length > 0 && Object.keys(atom).length > 0) {
|
|
19
21
|
const dim = axis === 'x' ? 0 : axis === 'y' ? 1 : null;
|
|
20
22
|
switch (dim !== null && elements[dim]) {
|
|
21
23
|
case atom.atomLabel: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { AnalysisColumnsTypes, AnalisisColumnsValuesKeys } from 'nmr-load-save';
|
|
3
3
|
import DeleteButton from '../../../elements/Tab/DeleteButton';
|
|
4
4
|
import DropDownButton from '../../../elements/dropDownButton/DropDownButton';
|
|
5
5
|
import { useHighlight } from '../../../highlight/index';
|
|
@@ -37,10 +37,10 @@ const styles = {
|
|
|
37
37
|
},
|
|
38
38
|
};
|
|
39
39
|
const columnsFilters = [
|
|
40
|
-
{ key:
|
|
41
|
-
{ key:
|
|
42
|
-
{ key:
|
|
43
|
-
{ key:
|
|
40
|
+
{ key: AnalisisColumnsValuesKeys.RELATIVE, label: 'Relative' },
|
|
41
|
+
{ key: AnalisisColumnsValuesKeys.ABSOLUTE, label: 'Absolute' },
|
|
42
|
+
{ key: AnalisisColumnsValuesKeys.MIN, label: 'Min Intensity' },
|
|
43
|
+
{ key: AnalisisColumnsValuesKeys.MAX, label: 'Max Intensity' },
|
|
44
44
|
];
|
|
45
45
|
function AnalysisColumnHeader({ columnKey, rangeLabel, data, onColumnFilter, onDelete, }) {
|
|
46
46
|
const highlight = useHighlight([columnKey]);
|
|
@@ -48,6 +48,6 @@ function AnalysisColumnHeader({ columnKey, rangeLabel, data, onColumnFilter, onD
|
|
|
48
48
|
e.stopPropagation();
|
|
49
49
|
onDelete();
|
|
50
50
|
}
|
|
51
|
-
return (_jsxs("div", { style: { ...styles.container, ...highlight.defaultActiveStyle }, ...highlight.onHover, children: [_jsxs("div", { style: styles.innerContainer, children: [data.type ===
|
|
51
|
+
return (_jsxs("div", { style: { ...styles.container, ...highlight.defaultActiveStyle }, ...highlight.onHover, children: [_jsxs("div", { style: styles.innerContainer, children: [data.type === AnalysisColumnsTypes.NORMAL && (_jsx("div", { style: styles.dropdownContainer, children: _jsx(DropDownButton, { data: columnsFilters, formatSelectedValue: (item) => item.label.slice(0, 3), selectedKey: data.valueKey, onSelect: onColumnFilter }) })), _jsxs("div", { style: styles.labelContainer, children: [_jsxs("span", { style: styles.label, children: [" ", columnKey] }), _jsx("span", { style: styles.label, children: rangeLabel })] })] }), _jsx(DeleteButton, { onDelete: deleteHandler, style: styles.deleteButton })] }));
|
|
52
52
|
}
|
|
53
53
|
export default AnalysisColumnHeader;
|
package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js
CHANGED
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useFormikContext } from 'formik';
|
|
3
3
|
import { useMemo, useCallback } from 'react';
|
|
4
4
|
import { FaPlus, FaTimes } from 'react-icons/fa';
|
|
5
|
-
import { COLUMNS_TYPES } from '../../../../data/data1d/multipleSpectraAnalysis';
|
|
6
5
|
import Button from '../../../elements/Button';
|
|
7
6
|
import ReactTable from '../../../elements/ReactTable/ReactTable';
|
|
8
7
|
import FormikInput from '../../../elements/formik/FormikInput';
|
|
8
|
+
import { AnalysisColumnsTypes } from 'nmr-load-save';
|
|
9
9
|
const inputStyle = { input: { width: '100%', fontSize: '1.15em' } };
|
|
10
10
|
export function AnalysisTablePreferences() {
|
|
11
11
|
const { values: { analysisOptions: { columns }, }, setFieldValue, } = useFormikContext();
|
|
@@ -37,7 +37,7 @@ export function AnalysisTablePreferences() {
|
|
|
37
37
|
{
|
|
38
38
|
Header: 'Value',
|
|
39
39
|
Cell: ({ row }) => {
|
|
40
|
-
const isFormulaColumn = row.original.type ===
|
|
40
|
+
const isFormulaColumn = row.original.type === AnalysisColumnsTypes.FORMULA;
|
|
41
41
|
return (_jsx(FormikInput, { disabled: !isFormulaColumn, name: `analysisOptions.columns.${row.index}.formula`, style: inputStyle }));
|
|
42
42
|
},
|
|
43
43
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Formik } from 'formik';
|
|
3
|
+
import { AnalysisColumnsTypes, } from 'nmr-load-save';
|
|
3
4
|
import { forwardRef, useImperativeHandle, useRef } from 'react';
|
|
4
5
|
import * as Yup from 'yup';
|
|
5
|
-
import { COLUMNS_TYPES, } from '../../../../data/data1d/multipleSpectraAnalysis';
|
|
6
6
|
import { usePreferences } from '../../../context/PreferencesContext';
|
|
7
7
|
import { GroupPane } from '../../../elements/GroupPane';
|
|
8
8
|
import Label from '../../../elements/Label';
|
|
@@ -93,7 +93,7 @@ function columnSchema(columns) {
|
|
|
93
93
|
formula: Yup.string().test('required', 'Pease enter formula field', function checkRequired() {
|
|
94
94
|
const errors = [];
|
|
95
95
|
for (const column of columns) {
|
|
96
|
-
if (column?.type ===
|
|
96
|
+
if (column?.type === AnalysisColumnsTypes.FORMULA &&
|
|
97
97
|
(!column.formula || column.formula === '')) {
|
|
98
98
|
errors.push(new Yup.ValidationError(`${column.tempKey} formula value is required`, column.formula, this.path));
|
|
99
99
|
}
|
|
@@ -4,8 +4,7 @@ import { css } from '@emotion/react';
|
|
|
4
4
|
import { SvgNmrIntegrate, SvgNmrSum } from 'cheminfo-font';
|
|
5
5
|
import lodashGet from 'lodash/get';
|
|
6
6
|
import { rangesToACS } from 'nmr-processing';
|
|
7
|
-
import {
|
|
8
|
-
import { FaFileExport, FaUnlink, FaSitemap, FaChartBar, FaPlus, } from 'react-icons/fa';
|
|
7
|
+
import { FaFileExport, FaUnlink, FaSitemap, FaChartBar } from 'react-icons/fa';
|
|
9
8
|
import { ImLink } from 'react-icons/im';
|
|
10
9
|
import { useAssignmentData } from '../../assignment/AssignmentsContext';
|
|
11
10
|
import { useDispatch } from '../../context/DispatchContext';
|
|
@@ -19,7 +18,6 @@ import ChangeSumModal from '../../modal/changeSum/ChangeSumModal';
|
|
|
19
18
|
import { copyHTMLToClipboard } from '../../utility/export';
|
|
20
19
|
import { getNumberOfDecimals } from '../../utility/formatNumber';
|
|
21
20
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
22
|
-
import useEditRangeModal from './hooks/useEditRangeModal';
|
|
23
21
|
const style = css `
|
|
24
22
|
.btn {
|
|
25
23
|
background-color: transparent;
|
|
@@ -45,25 +43,25 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
|
|
|
45
43
|
const assignmentData = useAssignmentData();
|
|
46
44
|
const currentSum = lodashGet(ranges, 'options.sum', null);
|
|
47
45
|
const rangesPreferences = usePanelPreferences('ranges', activeTab);
|
|
48
|
-
|
|
46
|
+
function changeRangesSumHandler(options) {
|
|
49
47
|
dispatch({ type: 'CHANGE_RANGE_SUM', payload: { options } });
|
|
50
48
|
modal.close();
|
|
51
|
-
}
|
|
52
|
-
|
|
49
|
+
}
|
|
50
|
+
function showChangeRangesSumModal() {
|
|
53
51
|
modal.show(_jsx(ChangeSumModal, { onClose: () => modal.close(), onSave: changeRangesSumHandler, header: currentSum
|
|
54
52
|
? `Set new Ranges Sum (Current: ${Number(currentSum).toFixed(2)})`
|
|
55
53
|
: 'Set new Ranges Sum', sumOptions: ranges?.options }));
|
|
56
|
-
}
|
|
57
|
-
|
|
54
|
+
}
|
|
55
|
+
function removeAssignments() {
|
|
58
56
|
onUnlink();
|
|
59
|
-
}
|
|
60
|
-
|
|
57
|
+
}
|
|
58
|
+
function handleOnRemoveAssignments() {
|
|
61
59
|
modal.showConfirmDialog({
|
|
62
60
|
message: 'All assignments will be removed. Are you sure?',
|
|
63
61
|
buttons: [{ text: 'Yes', handler: removeAssignments }, { text: 'No' }],
|
|
64
62
|
});
|
|
65
|
-
}
|
|
66
|
-
|
|
63
|
+
}
|
|
64
|
+
function handleDeleteAll() {
|
|
67
65
|
modal.showConfirmDialog({
|
|
68
66
|
message: 'All ranges will be deleted. Are You sure?',
|
|
69
67
|
buttons: [
|
|
@@ -79,17 +77,17 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
|
|
|
79
77
|
{ text: 'No' },
|
|
80
78
|
],
|
|
81
79
|
});
|
|
82
|
-
}
|
|
83
|
-
|
|
80
|
+
}
|
|
81
|
+
function handleSetShowMultiplicityTrees() {
|
|
84
82
|
dispatch({ type: 'SHOW_MULTIPLICITY_TREES', payload: { id } });
|
|
85
|
-
}
|
|
86
|
-
|
|
83
|
+
}
|
|
84
|
+
function handleShowIntegrals() {
|
|
87
85
|
dispatch({ type: 'SHOW_RANGES_INTEGRALS', payload: { id } });
|
|
88
|
-
}
|
|
89
|
-
|
|
86
|
+
}
|
|
87
|
+
function handleShowJGraph() {
|
|
90
88
|
dispatch({ type: 'SHOW_J_GRAPH', payload: { id } });
|
|
91
|
-
}
|
|
92
|
-
|
|
89
|
+
}
|
|
90
|
+
function saveToClipboardHandler(value) {
|
|
93
91
|
void (async () => {
|
|
94
92
|
const success = await copyHTMLToClipboard(value);
|
|
95
93
|
if (success) {
|
|
@@ -99,43 +97,31 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
|
|
|
99
97
|
alert.error('copy to clipboard failed');
|
|
100
98
|
}
|
|
101
99
|
})();
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
rangesPreferences?.deltaHz?.format,
|
|
119
|
-
rangesPreferences?.deltaPPM?.format,
|
|
120
|
-
saveToClipboardHandler,
|
|
121
|
-
]);
|
|
122
|
-
const changeSumConstantFlagHandler = useCallback(() => {
|
|
100
|
+
}
|
|
101
|
+
function saveAsHTMLHandler() {
|
|
102
|
+
if (Array.isArray(ranges?.values) && ranges.values.length > 0) {
|
|
103
|
+
const { originFrequency: observedFrequency, nucleus } = info;
|
|
104
|
+
const nbDecimalDelta = getNumberOfDecimals(rangesPreferences.deltaPPM.format);
|
|
105
|
+
const nbDecimalJ = getNumberOfDecimals(rangesPreferences.deltaHz.format);
|
|
106
|
+
const result = rangesToACS(ranges.values, {
|
|
107
|
+
nucleus,
|
|
108
|
+
nbDecimalDelta,
|
|
109
|
+
nbDecimalJ,
|
|
110
|
+
observedFrequency, //400
|
|
111
|
+
});
|
|
112
|
+
modal.show(_jsx(CopyClipboardModal, { text: result, onCopyClick: saveToClipboardHandler, onClose: () => modal.close() }), {});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function changeSumConstantFlagHandler() {
|
|
123
116
|
dispatch({
|
|
124
117
|
type: 'CHANGE_RANGES_SUM_FLAG',
|
|
125
118
|
});
|
|
126
|
-
}
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
dispatch({
|
|
130
|
-
type: 'ADD_RANGE',
|
|
131
|
-
payload: {},
|
|
132
|
-
});
|
|
133
|
-
editRange(true);
|
|
134
|
-
}, [dispatch, editRange]);
|
|
135
|
-
return (_jsx("div", { css: style, children: _jsxs(DefaultPanelHeader, { counter: ranges?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Ranges", onFilter: onFilterActivated, filterToolTip: isFilterActive ? 'Show all ranges' : 'Hide ranges out of view', filterIsActive: isFilterActive, counterFiltered: filterCounter, showSettingButton: true, onSettingClick: onSettingClick, children: [_jsx(Button, { popupTitle: "Preview publication string", popupPlacement: "right", onClick: saveAsHTMLHandler, className: "btn preview-publication-icon", children: _jsx(FaFileExport, {}) }), _jsx(Button, { popupTitle: currentSum
|
|
119
|
+
}
|
|
120
|
+
const hasRanges = Array.isArray(ranges?.values) && ranges.values.length > 0;
|
|
121
|
+
return (_jsx("div", { css: style, children: _jsxs(DefaultPanelHeader, { counter: ranges?.values?.length || 0, onDelete: handleDeleteAll, deleteToolTip: "Delete All Ranges", onFilter: onFilterActivated, filterToolTip: isFilterActive ? 'Show all ranges' : 'Hide ranges out of view', filterIsActive: isFilterActive, counterFiltered: filterCounter, showSettingButton: true, onSettingClick: onSettingClick, children: [_jsx(Button, { popupTitle: "Preview publication string", popupPlacement: "right", onClick: saveAsHTMLHandler, className: "btn preview-publication-icon", disabled: !hasRanges, children: _jsx(FaFileExport, {}) }), _jsx(Button, { popupTitle: currentSum
|
|
136
122
|
? `Change ranges sum (${Number(currentSum).toFixed(2)})`
|
|
137
|
-
: 'Change ranges sum', popupPlacement: "right", onClick: showChangeRangesSumModal, className: "btn icon", children: _jsx(SvgNmrSum, {}) }), _jsx(Button, { popupTitle: "Remove all assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !
|
|
123
|
+
: 'Change ranges sum', popupPlacement: "right", onClick: showChangeRangesSumModal, className: "btn icon", children: _jsx(SvgNmrSum, {}) }), _jsx(Button, { popupTitle: "Remove all assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !hasRanges, className: "btn icon", children: _jsx(FaUnlink, {}) }), _jsx(ActiveButton, { popupTitle: showMultiplicityTrees
|
|
138
124
|
? 'Hide multiplicity trees in spectrum'
|
|
139
|
-
: 'Show multiplicity trees in spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, value: showMultiplicityTrees, disabled: !
|
|
125
|
+
: 'Show multiplicity trees in spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, value: showMultiplicityTrees, disabled: !hasRanges, children: _jsx(FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, value: showJGraph, disabled: !hasRanges, children: _jsx(FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, value: showRangesIntegrals, disabled: !hasRanges, children: _jsx(SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), _jsx(ActiveButton, { className: "icon", popupTitle: "Fix integral values", popupPlacement: "right", onClick: changeSumConstantFlagHandler, value: ranges?.options?.isSumConstant, children: _jsx(ImLink, {}) })] }) }));
|
|
140
126
|
}
|
|
141
127
|
export default RangesHeader;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const _default: import("react").
|
|
2
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<unknown>>;
|
|
3
3
|
export default _default;
|