nmrium 0.40.1 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/FooterBanner.js +5 -4
- package/lib/component/1d/Viewer1D.js +121 -104
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +1 -1
- package/lib/component/1d/jCouplingGraph/JGraphContext.d.ts +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
- package/lib/component/1d/multiplicityTree/TreeColors.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/TreeColors.js +1 -6
- package/lib/component/1d/multiplicityTree/TreeNodes.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.js +7 -4
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +1 -3
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
- package/lib/component/1d-2d/components/SpectrumInfoBlock.js +4 -1
- package/lib/component/1d-2d/tools/BrushXY.js +10 -7
- package/lib/component/1d-2d/tools/CrossLinePointer.js +1 -1
- package/lib/component/2d/FooterBanner.js +3 -2
- package/lib/component/2d/Viewer2D.js +51 -29
- package/lib/component/2d/XAxis.js +1 -1
- package/lib/component/2d/YAxis.js +1 -1
- package/lib/component/2d/utilities/SliceScale.d.ts +2 -2
- package/lib/component/2d/utilities/scale.d.ts +5 -5
- package/lib/component/2d/zones/Signal.js +1 -2
- package/lib/component/EventsTrackers/BrushTracker.d.ts +4 -1
- package/lib/component/EventsTrackers/BrushTracker.js +21 -6
- package/lib/component/NMRium.d.ts +2 -2
- package/lib/component/NMRium.js +39 -26
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
- package/lib/component/assignment/actions/setActiveAssignment.js +1 -1
- package/lib/component/elements/Input.js +1 -0
- package/lib/component/elements/InputRange.js +1 -1
- package/lib/component/elements/MenuButton.d.ts +1 -1
- package/lib/component/elements/MoleculeSelection.d.ts +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +1 -1
- package/lib/component/elements/Scroller.d.ts +15 -0
- package/lib/component/elements/Scroller.js +31 -0
- package/lib/component/elements/Tab/DeleteButton.d.ts +1 -1
- package/lib/component/elements/ToolbarMenu.d.ts +1 -1
- package/lib/component/elements/accordion/Accordion.d.ts +1 -1
- package/lib/component/elements/draggable/SVGDraggable.d.ts +1 -1
- package/lib/component/elements/draggable/useDraggable.d.ts +1 -1
- package/lib/component/elements/dropDownButton/DropDownButton.d.ts +1 -1
- package/lib/component/elements/dropDownButton/DropDownList.js +3 -1
- package/lib/component/elements/formik/SelectBox.d.ts +1 -1
- package/lib/component/elements/popup/Alert/AlertBlock.d.ts +3 -2
- package/lib/component/elements/popup/Alert/AlertBlock.js +21 -15
- package/lib/component/elements/popup/Alert/Context.d.ts +26 -2
- package/lib/component/elements/popup/Alert/Context.js +6 -2
- package/lib/component/elements/popup/Alert/Provider.d.ts +4 -3
- package/lib/component/elements/popup/Alert/Provider.js +3 -3
- package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +1 -1
- package/lib/component/elements/popup/Modal/Provider.js +3 -1
- package/lib/component/elements/popup/options.d.ts +22 -19
- package/lib/component/elements/resizer/Resizer.d.ts +2 -2
- package/lib/component/elements/toggle/ToggleButton.d.ts +2 -2
- package/lib/component/elements/toggle/ToggleButton.js +1 -1
- package/lib/component/header/ZeroFillingOptionsPanel.js +3 -8
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +2 -2
- package/lib/component/hooks/useExport.js +2 -1
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +1 -1
- package/lib/component/hooks/usePanelPreferences.js +2 -2
- package/lib/component/hooks/useSaveSettings.js +9 -11
- package/lib/component/hooks/useXScale.d.ts +1 -1
- package/lib/component/hooks/useXYReduce.d.ts +2 -2
- package/lib/component/modal/AboutPredictionModal.js +1 -1
- package/lib/component/modal/AboutSpectrumSimulationModal.d.ts +2 -0
- package/lib/component/modal/AboutSpectrumSimulationModal.js +49 -0
- package/lib/component/modal/AlignSpectraModal.js +11 -1
- package/lib/component/modal/MultipletAnalysisModal.js +2 -1
- package/lib/component/modal/PredictSpectraModal.d.ts +1 -2
- package/lib/component/modal/PredictSpectraModal.js +25 -28
- package/lib/component/modal/changeSum/ChangeSumModal.js +1 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +1 -1
- package/lib/component/modal/editZone/SignalsForm.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib/component/modal/setting/settings-tabs/DisplayTabContent.js +4 -0
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +9 -2
- package/lib/component/modal/setting/settingsValidation.js +2 -2
- 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/IntegralTable.js +4 -7
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +3 -5
- package/lib/component/panels/Panels.js +13 -0
- package/lib/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPreferences.js +4 -3
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +3 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +2 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +34 -27
- package/lib/component/panels/databasePanel/DatabaseTable.js +1 -1
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/extra/utilities/UseToggleStatus.js +1 -1
- package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +3 -2
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +2 -2
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.d.ts +1 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +88 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.d.ts +11 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +37 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.d.ts +4 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +25 -0
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.d.ts +5 -0
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +60 -0
- package/lib/component/reducer/Reducer.d.ts +13 -12
- package/lib/component/reducer/Reducer.js +253 -239
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +1 -1
- package/lib/component/reducer/actions/AssignmentsActions.js +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +2 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +7 -2
- package/lib/component/reducer/actions/DomainActions.js +30 -1
- package/lib/component/reducer/actions/FiltersActions.js +4 -4
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +8 -2
- package/lib/component/reducer/actions/MoleculeActions.js +58 -3
- package/lib/component/reducer/actions/SpectrumsActions.d.ts +8 -2
- package/lib/component/reducer/actions/SpectrumsActions.js +43 -4
- package/lib/component/reducer/actions/ToolsActions.js +2 -2
- package/lib/component/reducer/actions/ZonesActions.js +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +4 -6
- package/lib/component/reducer/preferences/actions/addWorkspace.js +19 -15
- package/lib/component/reducer/preferences/actions/setActiveWorkspace.js +1 -1
- package/lib/component/reducer/preferences/actions/setPreferences.js +3 -4
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.js +5 -1
- package/lib/component/reducer/preferences/utilities/flatObject.js +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts +4 -4
- package/lib/component/utility/PathBuilder.js +11 -0
- package/lib/component/utility/export.js +9 -9
- package/lib/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib/component/utility/getUniqueNuclei.js +1 -1
- package/lib/component/utility/jpathToArray.js +1 -1
- package/lib/component/workspaces/index.d.ts +1 -0
- package/lib/component/workspaces/index.js +2 -0
- package/lib/component/workspaces/simulation.d.ts +2 -0
- package/lib/component/workspaces/simulation.js +68 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +9 -5
- package/lib/data/PredictionManager.d.ts +8 -7
- package/lib/data/PredictionManager.js +95 -22
- package/lib/data/SpectraManager.js +1 -1
- package/lib/data/constants/DefaultPathLengths.d.ts +1 -3
- package/lib/data/constants/SignalsKinds.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +3 -3
- package/lib/data/data1d/Spectrum1D/getReferenceShift.js +5 -4
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +12 -13
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +10 -9
- package/lib/data/data1d/database.d.ts +9 -7
- package/lib/data/data1d/database.js +13 -6
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
- package/lib/data/data1d/multipleSpectraAnalysis.js +1 -1
- package/lib/data/data1d/spectrumSimulation.d.ts +14 -0
- package/lib/data/data1d/spectrumSimulation.js +53 -0
- package/lib/data/data2d/Spectrum2D/contours.d.ts +8 -4
- package/lib/data/data2d/Spectrum2D/contours.js +7 -1
- package/lib/data/data2d/Spectrum2D/getMissingProjection.js +6 -6
- package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib/data/data2d/Spectrum2D/getSlice.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +5 -5
- package/lib/data/getDefaultMatrixFilters.d.ts +2 -2
- package/lib/data/matrixGeneration.js +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +2 -1
- package/lib/data/molecules/MoleculeManager.js +21 -7
- package/lib/data/parseMeta/linkMetaWithSpectra.js +2 -1
- package/lib/data/types/data1d/MatrixOptions.d.ts +2 -2
- package/lib/data/utilities/FindUtilities.js +4 -4
- package/lib/data/utilities/RangeUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/calculateSanPlot.js +3 -3
- package/lib/data/utilities/generateNumbersPowerOfX.js +1 -1
- package/lib/utils/clipboard/clipboard.d.ts +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +5 -4
- package/lib-cjs/component/1d/Viewer1D.js +120 -103
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +1 -1
- package/lib-cjs/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/TreeColors.js +1 -6
- package/lib-cjs/component/1d/tool/BaseLineZones.js +6 -3
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +1 -3
- package/lib-cjs/component/1d-2d/components/SpectrumInfoBlock.js +4 -1
- package/lib-cjs/component/1d-2d/tools/BrushXY.js +10 -7
- package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +1 -1
- package/lib-cjs/component/2d/FooterBanner.js +3 -2
- package/lib-cjs/component/2d/Viewer2D.js +50 -28
- package/lib-cjs/component/2d/XAxis.js +1 -1
- package/lib-cjs/component/2d/YAxis.js +1 -1
- package/lib-cjs/component/2d/zones/Signal.js +1 -2
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +21 -6
- package/lib-cjs/component/NMRium.js +37 -24
- package/lib-cjs/component/assignment/actions/setActiveAssignment.js +1 -1
- package/lib-cjs/component/elements/Input.js +1 -0
- package/lib-cjs/component/elements/InputRange.js +1 -1
- package/lib-cjs/component/elements/Scroller.js +35 -0
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +3 -1
- package/lib-cjs/component/elements/popup/Alert/AlertBlock.js +21 -15
- package/lib-cjs/component/elements/popup/Alert/Context.js +6 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +2 -2
- package/lib-cjs/component/elements/popup/Modal/Provider.js +3 -1
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -8
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +2 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +1 -1
- package/lib-cjs/component/hooks/useSaveSettings.js +9 -11
- package/lib-cjs/component/modal/AboutPredictionModal.js +1 -1
- package/lib-cjs/component/modal/AboutSpectrumSimulationModal.js +54 -0
- package/lib-cjs/component/modal/AlignSpectraModal.js +11 -1
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +2 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +24 -27
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/DisplayTabContent.js +4 -0
- package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +9 -2
- package/lib-cjs/component/modal/setting/settingsValidation.js +2 -2
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +4 -7
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +3 -5
- package/lib-cjs/component/panels/Panels.js +13 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPreferences.js +3 -2
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +34 -27
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +1 -1
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/extra/utilities/UseToggleStatus.js +1 -1
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +3 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -1
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +94 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +42 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +31 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpinSystemTable.js +67 -0
- package/lib-cjs/component/reducer/Reducer.js +253 -239
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +1 -1
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +2 -1
- package/lib-cjs/component/reducer/actions/DomainActions.js +31 -1
- package/lib-cjs/component/reducer/actions/FiltersActions.js +4 -4
- package/lib-cjs/component/reducer/actions/LoadActions.js +1 -1
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +62 -3
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +43 -3
- package/lib-cjs/component/reducer/actions/ToolsActions.js +2 -2
- package/lib-cjs/component/reducer/actions/ZonesActions.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +19 -15
- package/lib-cjs/component/reducer/preferences/actions/setActiveWorkspace.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +3 -4
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +5 -1
- package/lib-cjs/component/reducer/preferences/utilities/flatObject.js +1 -1
- package/lib-cjs/component/utility/PathBuilder.js +11 -0
- package/lib-cjs/component/utility/export.js +9 -9
- package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib-cjs/component/utility/getUniqueNuclei.js +1 -1
- package/lib-cjs/component/utility/jpathToArray.js +1 -1
- package/lib-cjs/component/workspaces/index.js +2 -0
- package/lib-cjs/component/workspaces/simulation.js +71 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +9 -5
- package/lib-cjs/data/PredictionManager.js +96 -22
- package/lib-cjs/data/SpectraManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/getReferenceShift.js +5 -4
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +12 -13
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +10 -9
- package/lib-cjs/data/data1d/database.js +13 -6
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +1 -1
- package/lib-cjs/data/data1d/spectrumSimulation.js +58 -0
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +7 -1
- package/lib-cjs/data/data2d/Spectrum2D/getMissingProjection.js +6 -6
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/getSlice.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +5 -5
- package/lib-cjs/data/matrixGeneration.js +1 -1
- package/lib-cjs/data/molecules/MoleculeManager.js +23 -8
- package/lib-cjs/data/parseMeta/linkMetaWithSpectra.js +2 -1
- package/lib-cjs/data/utilities/FindUtilities.js +4 -4
- package/lib-cjs/data/utilities/calculateSanPlot.js +3 -3
- package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +1 -1
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +21 -20
|
@@ -119,7 +119,9 @@ function Provider({ children, style, offset = '0px', position = positions.MIDDLE
|
|
|
119
119
|
.rnd-container {
|
|
120
120
|
box-sizing: initial;
|
|
121
121
|
background-color: #fff;
|
|
122
|
-
box-shadow:
|
|
122
|
+
box-shadow:
|
|
123
|
+
0 0 0 0,
|
|
124
|
+
0 8px 16px rgb(0 0 0 / 30%);
|
|
123
125
|
border-radius: 5px;
|
|
124
126
|
}
|
|
125
127
|
`;
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
export declare const positions: {
|
|
2
|
-
TOP_LEFT:
|
|
3
|
-
TOP_CENTER:
|
|
4
|
-
TOP_RIGHT:
|
|
5
|
-
MIDDLE_LEFT:
|
|
6
|
-
MIDDLE:
|
|
7
|
-
MIDDLE_RIGHT:
|
|
8
|
-
BOTTOM_LEFT:
|
|
9
|
-
BOTTOM_CENTER:
|
|
10
|
-
BOTTOM_RIGHT:
|
|
2
|
+
readonly TOP_LEFT: "top left";
|
|
3
|
+
readonly TOP_CENTER: "top center";
|
|
4
|
+
readonly TOP_RIGHT: "top right";
|
|
5
|
+
readonly MIDDLE_LEFT: "middle left";
|
|
6
|
+
readonly MIDDLE: "middle";
|
|
7
|
+
readonly MIDDLE_RIGHT: "middle right";
|
|
8
|
+
readonly BOTTOM_LEFT: "bottom left";
|
|
9
|
+
readonly BOTTOM_CENTER: "bottom center";
|
|
10
|
+
readonly BOTTOM_RIGHT: "bottom right";
|
|
11
11
|
};
|
|
12
|
+
export type Position = (typeof positions)[keyof typeof positions];
|
|
12
13
|
export declare const types: {
|
|
13
|
-
INFO:
|
|
14
|
-
SUCCESS:
|
|
15
|
-
ERROR:
|
|
16
|
-
PROGRESS_INDICATOR:
|
|
14
|
+
readonly INFO: "info";
|
|
15
|
+
readonly SUCCESS: "success";
|
|
16
|
+
readonly ERROR: "error";
|
|
17
|
+
readonly PROGRESS_INDICATOR: "progress_indicator";
|
|
17
18
|
};
|
|
19
|
+
export type Type = (typeof types)[keyof typeof types];
|
|
18
20
|
export declare const transitions: {
|
|
19
|
-
FADE:
|
|
20
|
-
SCALE:
|
|
21
|
-
SLIDE_RIGHT:
|
|
22
|
-
SLIDE_LEFT:
|
|
23
|
-
SLIDE_TOP:
|
|
24
|
-
SLIDE_BOTTOM:
|
|
21
|
+
readonly FADE: "fade";
|
|
22
|
+
readonly SCALE: "scale";
|
|
23
|
+
readonly SLIDE_RIGHT: "slide_right";
|
|
24
|
+
readonly SLIDE_LEFT: "slide_left";
|
|
25
|
+
readonly SLIDE_TOP: "slide_top";
|
|
26
|
+
readonly SLIDE_BOTTOM: "slide_bottom";
|
|
25
27
|
};
|
|
28
|
+
export type Transition = (typeof transitions)[keyof typeof transitions];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
export interface Position {
|
|
3
3
|
x1: number;
|
|
4
4
|
x2: number;
|
|
5
5
|
}
|
|
6
|
-
type ChildType =
|
|
6
|
+
type ChildType = React.ReactElement[] | React.ReactElement | boolean | null;
|
|
7
7
|
export interface ResizerProps {
|
|
8
8
|
children?: ChildType | ((position: Position, isActive: boolean) => ChildType);
|
|
9
9
|
initialPosition?: Position;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ReactElement
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
2
|
interface ToggleButtonProps {
|
|
3
3
|
isActive?: boolean;
|
|
4
4
|
value?: any;
|
|
5
5
|
onChange?: (value: any) => null;
|
|
6
|
-
children: ReactElement
|
|
6
|
+
children: ReactElement;
|
|
7
7
|
isVisible?: boolean;
|
|
8
8
|
}
|
|
9
9
|
export default function ToggleButton(props: ToggleButtonProps & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useState, useEffect
|
|
2
|
+
import { useCallback, useState, useEffect } from 'react';
|
|
3
3
|
import { Toolbar } from 'react-science/ui';
|
|
4
4
|
export default function ToggleButton(props) {
|
|
5
5
|
const { children, value = null, isActive = false, onChange = () => null, isVisible = true, id, title, } = props;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Filters } from 'nmr-processing';
|
|
3
3
|
import { useEffect, useState, memo } from 'react';
|
|
4
|
+
import { Checkbox } from 'react-science/ui';
|
|
4
5
|
import generateNumbersPowerOfX from '../../data/utilities/generateNumbersPowerOfX';
|
|
5
6
|
import { useDispatch } from '../context/DispatchContext';
|
|
6
7
|
import ActionButtons from '../elements/ActionButtons';
|
|
7
|
-
import CheckBox from '../elements/CheckBox';
|
|
8
8
|
import Label from '../elements/Label';
|
|
9
9
|
import Select from '../elements/Select';
|
|
10
10
|
import { useFilter } from '../hooks/useFilter';
|
|
@@ -50,19 +50,14 @@ function ZeroFillingOptionsInnerPanel(props) {
|
|
|
50
50
|
}
|
|
51
51
|
function handleChangeSizeHandler(value) {
|
|
52
52
|
setSize(value);
|
|
53
|
-
dispatchLiveChanges(value);
|
|
54
53
|
}
|
|
55
54
|
useEffect(() => {
|
|
56
55
|
if (livePreview && size) {
|
|
57
56
|
dispatchLiveChanges(size);
|
|
58
57
|
}
|
|
59
58
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
60
|
-
}, []);
|
|
61
|
-
|
|
62
|
-
const checked = event.target.checked;
|
|
63
|
-
setLivePreview(checked);
|
|
64
|
-
}
|
|
65
|
-
return (_jsxs(HeaderContainer, { children: [_jsx(Label, { title: "Size: ", style: headerLabelStyle, children: _jsx(Select, { items: Sizes, style: { marginLeft: 10, marginRight: 10 }, value: size, onChange: handleChangeSizeHandler }) }), _jsx(Label, { title: "Live preview ", htmlFor: "livePreview", style: headerLabelStyle, children: _jsx(CheckBox, { name: "livePreview", defaultChecked: true, onChange: checkChangeHandler }) }), _jsx(ActionButtons, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
|
|
59
|
+
}, [size, livePreview]);
|
|
60
|
+
return (_jsxs(HeaderContainer, { children: [_jsx(Label, { title: "Size: ", style: headerLabelStyle, children: _jsx(Select, { items: Sizes, style: { marginLeft: 10, marginRight: 10 }, value: size, onChange: handleChangeSizeHandler }) }), _jsx(Checkbox, { label: "Live preview", checked: livePreview, onChange: setLivePreview }), _jsx(ActionButtons, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
|
|
66
61
|
}
|
|
67
62
|
const MemoizedZeroFillingOptionsPanel = memo(ZeroFillingOptionsInnerPanel);
|
|
68
63
|
export default function ZeroFillingOptionsPanel() {
|
|
@@ -53,7 +53,7 @@ export declare function useHighlightData(): HighlightContextProps;
|
|
|
53
53
|
* @param {Array<string | number>} highlights
|
|
54
54
|
* @param {SourceData = null} sourceData
|
|
55
55
|
*/
|
|
56
|
-
export declare function useHighlight(highlights:
|
|
56
|
+
export declare function useHighlight(highlights: Array<string | number>, sourceData?: SourceData | null): {
|
|
57
57
|
isActive: boolean;
|
|
58
58
|
defaultActiveStyle: CSSProperties;
|
|
59
59
|
onHover: {
|
|
@@ -10,7 +10,7 @@ export function useCheckToolsVisibility() {
|
|
|
10
10
|
const spectrum = useSpectrum(null);
|
|
11
11
|
return useCallback((toolKey, checkOptions = {}) => {
|
|
12
12
|
const { checkMode = true, checkSpectrumType = true, extraInfoCheckParameters, } = checkOptions;
|
|
13
|
-
|
|
13
|
+
const flag = lodashGet(preferences.current, `display.toolBarButtons.${toolKey}`, false);
|
|
14
14
|
const { spectraOptions, mode } = options[toolKey];
|
|
15
15
|
const modeFlag = !checkMode || (checkMode && (!mode || displayerMode === mode));
|
|
16
16
|
const spectrumCheckFlag = !checkSpectrumType ||
|
|
@@ -31,7 +31,7 @@ function checkSpectrum(spectrum, options) {
|
|
|
31
31
|
let innerConditionFlag = true;
|
|
32
32
|
if (option.active) {
|
|
33
33
|
if (spectrum) {
|
|
34
|
-
for (
|
|
34
|
+
for (const { key, value } of option.info || []) {
|
|
35
35
|
if (spectrum.info[key] !== value) {
|
|
36
36
|
innerConditionFlag = false;
|
|
37
37
|
}
|
|
@@ -41,7 +41,8 @@ export default function useExport() {
|
|
|
41
41
|
setTimeout(() => {
|
|
42
42
|
void handle();
|
|
43
43
|
}, 0);
|
|
44
|
-
})
|
|
44
|
+
})
|
|
45
|
+
.catch(reportError);
|
|
45
46
|
}, [alert, preferencesState, state]);
|
|
46
47
|
const saveAsSVGHandler = useCallback(async () => {
|
|
47
48
|
if (state.data.length > 0 && rootRef) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type ReturnFunction = (value?: number | string, formatKey?: string, prefix?: string, suffix?: string) => string;
|
|
2
|
-
export declare function useFormatNumberByNucleus(nucleus?:
|
|
2
|
+
export declare function useFormatNumberByNucleus(nucleus?: string[]): ReturnFunction[];
|
|
3
3
|
export declare function useFormatNumberByNucleus(nucleus?: string): ReturnFunction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import has from 'lodash/has';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { getDefaultPredictionOptions } from '../../data/PredictionManager';
|
|
4
4
|
import { usePreferences } from '../context/PreferencesContext';
|
|
5
5
|
import { getIntegralDefaultValues, getPeaksDefaultValues, getZoneDefaultValues, getRangeDefaultValues, databaseDefaultValues, getMultipleSpectraAnalysisDefaultValues, getSpectraDefaultValues, } from '../reducer/preferences/panelsPreferencesDefaultValues';
|
|
6
6
|
import { getValue } from '../utility/LocalStorage';
|
|
@@ -22,7 +22,7 @@ function getDefaultPreferences(panelKey, nucleus) {
|
|
|
22
22
|
case 'multipleSpectraAnalysis':
|
|
23
23
|
return getMultipleSpectraAnalysisDefaultValues(nucleus);
|
|
24
24
|
case 'prediction':
|
|
25
|
-
return
|
|
25
|
+
return getDefaultPredictionOptions();
|
|
26
26
|
default:
|
|
27
27
|
return {};
|
|
28
28
|
}
|
|
@@ -27,17 +27,15 @@ export function useSaveSettings() {
|
|
|
27
27
|
const { dispatch, current } = usePreferences();
|
|
28
28
|
const formRef = useRef(null);
|
|
29
29
|
function addNewWorkspace({ workspaceName }) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
alert.success('Preferences saved successfully');
|
|
40
|
-
}
|
|
30
|
+
dispatch({
|
|
31
|
+
type: 'ADD_WORKSPACE',
|
|
32
|
+
payload: {
|
|
33
|
+
workspaceKey: workspaceName,
|
|
34
|
+
data: settingsRef.current,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
closeDialog();
|
|
38
|
+
alert.success('Preferences saved successfully');
|
|
41
39
|
}
|
|
42
40
|
return {
|
|
43
41
|
saveSettings: (values) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ScaleLinear } from 'd3';
|
|
2
|
-
export declare function useXScale(): ScaleLinear<any, any
|
|
2
|
+
export declare function useXScale(): ScaleLinear<any, any>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataXY
|
|
1
|
+
import { DataXY } from 'cheminfo-types';
|
|
2
2
|
export declare enum XYReducerDomainAxis {
|
|
3
3
|
XAxis = "XAxis",
|
|
4
4
|
YAxis = "YAxis"
|
|
@@ -7,5 +7,5 @@ type XYReducerDomainAxisType = keyof typeof XYReducerDomainAxis;
|
|
|
7
7
|
export default function useXYReduce(domainAxis: XYReducerDomainAxisType): (data: {
|
|
8
8
|
x: Float64Array;
|
|
9
9
|
y: Float64Array;
|
|
10
|
-
}) => DataXY
|
|
10
|
+
}) => DataXY;
|
|
11
11
|
export {};
|
|
@@ -44,6 +44,6 @@ const styles = css `
|
|
|
44
44
|
`;
|
|
45
45
|
function AboutPredictionModal() {
|
|
46
46
|
const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
|
|
47
|
-
return (_jsxs(_Fragment, { children: [_jsx(Button.BarButton, { onClick: openDialog, tooltipOrientation: "horizontal", toolTip: "About Prediction", children: _jsx(FaInfo, {}) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, children: _jsxs("div", { css: styles, children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header", children: _jsx("span", { children: "About Prediction" }) }) }), _jsx(Modal.Body, { children: _jsxs("div", { className: "content", children: [_jsx("p", { children: "If you are using our tools please cite us:" }), _jsxs("ul", { children: [_jsxs("li", { children: ["Banfi
|
|
47
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button.BarButton, { onClick: openDialog, tooltipOrientation: "horizontal", toolTip: "About Prediction", children: _jsx(FaInfo, {}) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, children: _jsxs("div", { css: styles, children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header", children: _jsx("span", { children: "About Prediction" }) }) }), _jsx(Modal.Body, { children: _jsxs("div", { className: "content", children: [_jsx("p", { children: "If you are using our tools please cite us:" }), _jsxs("ul", { children: [_jsxs("li", { children: ["Damiano Banfi and Luc Patiny", ' ', _jsx("a", { href: "http://dx.doi.org/10.2533/chimia.2008.280", target: "_blank", rel: "noreferrer", children: "www.nmrdb.org: Resurrecting and processing NMR spectra on-line" }), ' ', _jsx("i", { children: "Chimia" }), ", ", _jsx("b", { children: "2008" }), ", 62(4), 280-281."] }), _jsxs("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', _jsx("a", { href: "http://dx.doi.org/10.1016/j.jmr.2010.12.008", target: "_blank", rel: "noreferrer", children: "Fast and Accurate Algorithm for the Simulation of NMR spectra of Large Spin Systems" }), ' ', _jsx("i", { children: "Journal of Magnetic Resonance" }), " ", _jsx("b", { children: "2011" }), ", 209(2), 123-130."] })] }), _jsxs("p", { children: [_jsx("sup", { children: "1" }), "H NMR prediction is possible thanks to the tool of the FCT-Universidade NOVA de Lisboa developed by Yuri Binev and Joao Aires-de-Sousa:"] }), _jsxs("ul", { children: [_jsxs("li", { children: ["Yuri Binev, Maria M. B. Marques and Jo\u00E3o Aires-de-Sousa", ' ', _jsxs("a", { href: "http://dx.doi.org/10.1021/ci700172n", target: "_blank", rel: "noreferrer", children: ["Prediction of ", _jsx("sup", { children: "1" }), "H NMR coupling constants with associative neural networks trained for chemical shifts"] }), ' ', _jsx("i", { children: "J. Chem. Inf. Model." }), " ", _jsx("b", { children: "2007" }), ", 47(6), 2089-2097."] }), _jsxs("li", { children: ["Jo\u00E3o Aires-de-Sousa, Markus C. Hemmer and Johann Gasteiger", ' ', _jsxs("a", { href: "http://dx.doi.org/10.1021/ac010737m", target: "_blank", rel: "noreferrer", children: ["Prediction of ", _jsx("sup", { children: "1" }), "H NMR Chemical Shifts Using Neural Networks"] }), ", ", _jsx("i", { children: "Analytical Chemistry" }), ", ", _jsx("b", { children: "2002" }), ", 74(1), 80-90."] })] }), _jsxs("p", { children: [_jsx("sup", { children: "13" }), "C NMR prediction was possible thanks to NMRshiftDB:"] }), _jsx("ul", { children: _jsxs("li", { children: ["Steinbeck, Christoph, Stefan Krause, and Stefan Kuhn", ' ', _jsx("a", { href: "http://dx.doi.org/10.1021/ci0341363", target: "_blank", rel: "noreferrer", children: "NMRShiftDB Constructing a Free Chemical Information System with Open-Source Components" }), ' ', _jsx("i", { children: "Journal of chemical information and computer sciences" }), ",", ' ', _jsx("b", { children: "2003" }), ", 43(6): 1733-1739."] }) })] }) })] }) })] }));
|
|
48
48
|
}
|
|
49
49
|
export default AboutPredictionModal;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { FaInfo } from 'react-icons/fa';
|
|
5
|
+
import { Modal, useOnOff } from 'react-science/ui';
|
|
6
|
+
import Button from '../elements/Button';
|
|
7
|
+
const styles = css `
|
|
8
|
+
width: 600px;
|
|
9
|
+
|
|
10
|
+
.content {
|
|
11
|
+
padding: 2em;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
ul {
|
|
15
|
+
list-style-type: disc;
|
|
16
|
+
margin-left: 25px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
p,
|
|
20
|
+
li {
|
|
21
|
+
user-select: text;
|
|
22
|
+
font-size: 1.1em;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
a {
|
|
26
|
+
color: #00bcd4;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
a:hover,
|
|
30
|
+
a:focus {
|
|
31
|
+
text-decoration: underline;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.header span {
|
|
35
|
+
color: #464646;
|
|
36
|
+
font-size: 15px;
|
|
37
|
+
flex: 1;
|
|
38
|
+
user-select: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
p {
|
|
42
|
+
padding: 0.8em 0;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
function AboutSpectrumSimulationModal() {
|
|
46
|
+
const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
|
|
47
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button.BarButton, { onClick: openDialog, tooltipOrientation: "horizontal", toolTip: "About Prediction", children: _jsx(FaInfo, {}) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, children: _jsxs("div", { css: styles, children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header", children: _jsx("span", { children: "About spectrum simulation" }) }) }), _jsx(Modal.Body, { children: _jsxs("div", { className: "content", children: [_jsx("p", { children: "If you are using our tools please cite us:" }), _jsx("ul", { children: _jsxs("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', _jsx("a", { href: "http://dx.doi.org/10.1016/j.jmr.2010.12.008", target: "_blank", rel: "noreferrer", children: "Fast and Accurate Algorithm for the Simulation of NMR spectra of Large Spin Systems" }), ' ', _jsx("i", { children: "Journal of Magnetic Resonance" }), " ", _jsx("b", { children: "2011" }), ", 209(2), 123-130."] }) })] }) })] }) })] }));
|
|
48
|
+
}
|
|
49
|
+
export default AboutSpectrumSimulationModal;
|
|
@@ -11,6 +11,16 @@ import Select from '../elements/Select';
|
|
|
11
11
|
import FormikInput from '../elements/formik/FormikInput';
|
|
12
12
|
import Events from '../utility/Events';
|
|
13
13
|
import { ModalStyles } from './ModalStyle';
|
|
14
|
+
const labelStyle = {
|
|
15
|
+
label: { flex: 4, fontWeight: '500' },
|
|
16
|
+
wrapper: { flex: 8, display: 'flex', alignItems: 'center' },
|
|
17
|
+
container: { padding: '5px 0' },
|
|
18
|
+
};
|
|
19
|
+
const inputStyle = {
|
|
20
|
+
input: {
|
|
21
|
+
padding: '5px',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
14
24
|
const baseList = [{ key: 1, value: 'manual', label: 'Manual' }];
|
|
15
25
|
function AlignSpectraModal({ onClose = () => null, nucleus, }) {
|
|
16
26
|
const refForm = useRef();
|
|
@@ -50,6 +60,6 @@ function AlignSpectraModal({ onClose = () => null, nucleus, }) {
|
|
|
50
60
|
...resValues,
|
|
51
61
|
});
|
|
52
62
|
}, [nucleus]);
|
|
53
|
-
return (_jsxs("div", { css: ModalStyles, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Spectra calibration" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", style: { flex: 1 }, children: _jsx(Formik, { innerRef: refForm, initialValues: { from: -1, to: 1, nbPeaks: 1, targetX: 0 }, onSubmit: submitHandler, children: _jsxs(_Fragment, { children: [
|
|
63
|
+
return (_jsxs("div", { css: ModalStyles, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Spectra calibration" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", style: { flex: 1 }, children: _jsx(Formik, { innerRef: refForm, initialValues: { from: -1, to: 1, nbPeaks: 1, targetX: 0 }, onSubmit: submitHandler, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "Options", style: labelStyle, children: _jsx(Select, { items: List, style: { width: '100%', height: 30 }, onChange: optionChangeHandler }) }), _jsxs(Label, { title: "Range", style: labelStyle, children: [_jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "from", type: "number", style: inputStyle }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "to", type: "number", style: inputStyle }) })] }), _jsx(Label, { title: "Number of Peaks", style: labelStyle, children: _jsx(FormikInput, { name: "nbPeaks", type: "number", style: inputStyle }) }), _jsx(Label, { title: "Target PPM", style: labelStyle, children: _jsx(FormikInput, { name: "targetX", type: "number", style: inputStyle }) })] }) }) }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, children: "Done" }) })] }));
|
|
54
64
|
}
|
|
55
65
|
export default AlignSpectraModal;
|
|
@@ -151,7 +151,8 @@ export default function MultipletAnalysisModal({ data, activeSpectrum, scaleX, s
|
|
|
151
151
|
return (
|
|
152
152
|
// eslint-disable-next-line react/no-array-index-key
|
|
153
153
|
_jsxs("div", { className: "row", children: [_jsxs(Plot, { width: 400, height: 200, svgStyle: { overflow: 'visible' }, seriesViewportStyle: { stroke: 'black' }, children: [_jsx(LineSeries, { data: xyToXYObject(d.multiplet) }), _jsx(Axis, { id: "y", position: "left", tickPosition: "inner", displayPrimaryGridLines: true, hiddenTicks: true, paddingStart: 0.1, paddingEnd: 0.1 }), _jsx(Axis, { id: "x", position: "bottom", tickPosition: "inner", displayPrimaryGridLines: true })] }), _jsx("div", { className: "multiplicity", children: _jsx("p", { children: analysisData.js[index]
|
|
154
|
-
? `${analysisData.js[index]
|
|
154
|
+
? `${analysisData.js[index]
|
|
155
|
+
?.multiplicity}: ${analysisData.js[index]?.coupling.toFixed(3)} Hz`
|
|
155
156
|
: '' }) }), _jsxs(Plot, { width: 400, height: 200, seriesViewportStyle: { stroke: 'black' }, children: [_jsx(LineSeries, { data: xyToXYObject(d.errorFunction), lineStyle: { strokeWidth: 1 } }), _jsx(Axis, { id: "y", position: "left", tickPosition: "inner", displayPrimaryGridLines: true, hiddenTicks: true, paddingStart: 0.1, paddingEnd: 0.1 }), _jsx(Axis, { id: "x", position: "bottom", tickPosition: "inner", displayPrimaryGridLines: true })] })] }, index));
|
|
156
157
|
}) })] }));
|
|
157
158
|
}
|
|
@@ -3,6 +3,5 @@ interface PredictSpectraModalProps {
|
|
|
3
3
|
onClose?: (element?: string) => void;
|
|
4
4
|
molecule: StateMoleculeExtended;
|
|
5
5
|
}
|
|
6
|
-
declare function PredictSpectraModal({ onClose, molecule, }: PredictSpectraModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare function usePredictSpectraModal(): (molecule: StateMoleculeExtended) => void;
|
|
6
|
+
export declare function PredictSpectraModal({ onClose, molecule, }: PredictSpectraModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
7
|
export default PredictSpectraModal;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
+
import { SvgNmrFt } from 'cheminfo-font';
|
|
4
5
|
import { useCallback, useRef, useState, useMemo } from 'react';
|
|
5
|
-
import {
|
|
6
|
+
import { Checkbox, Modal, useOnOff } from 'react-science/ui';
|
|
7
|
+
import { getDefaultPredictionOptions, predictSpectra, } from '../../data/PredictionManager';
|
|
6
8
|
import { useChartData } from '../context/ChartContext';
|
|
7
9
|
import { useDispatch } from '../context/DispatchContext';
|
|
8
10
|
import { useLogger } from '../context/LoggerContext';
|
|
9
11
|
import Button from '../elements/Button';
|
|
10
|
-
import CheckBox from '../elements/CheckBox';
|
|
11
|
-
import CloseButton from '../elements/CloseButton';
|
|
12
12
|
import { useAlert } from '../elements/popup/Alert';
|
|
13
|
-
import { useModal } from '../elements/popup/Modal';
|
|
14
|
-
import { positions } from '../elements/popup/options';
|
|
15
13
|
import PredictionPreferences from '../panels/predictionPanel/PredictionOptionsPanel';
|
|
16
14
|
import { useStateWithLocalStorage } from '../utility/LocalStorage';
|
|
17
15
|
import { ModalStyles } from './ModalStyle';
|
|
@@ -36,24 +34,30 @@ const styles = css `
|
|
|
36
34
|
margin: 5px 5px 5px 0;
|
|
37
35
|
}
|
|
38
36
|
}
|
|
37
|
+
|
|
38
|
+
.header {
|
|
39
|
+
padding: 0;
|
|
40
|
+
margin: 0 30%;
|
|
41
|
+
width: 40%;
|
|
42
|
+
}
|
|
39
43
|
`;
|
|
40
|
-
function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
44
|
+
export function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
45
|
+
const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
|
|
41
46
|
const refForm = useRef();
|
|
42
47
|
const dispatch = useDispatch();
|
|
43
48
|
const alert = useAlert();
|
|
44
|
-
const [isApproved, setApproved] = useState(false);
|
|
45
49
|
const [predictionPreferences, setPredictionPreferences] = useStateWithLocalStorage('nmrium-prediction-preferences');
|
|
50
|
+
const { isApproved: isAgree = false, ...options } = predictionPreferences;
|
|
51
|
+
const [isApproved, setApproved] = useState(isAgree);
|
|
46
52
|
const { toolOptions: { data: { predictionIndex }, }, } = useChartData();
|
|
47
53
|
const handleSave = useCallback(() => {
|
|
48
54
|
refForm.current.submitForm();
|
|
49
55
|
}, []);
|
|
50
56
|
const initValues = useMemo(() => {
|
|
51
|
-
|
|
52
|
-
setApproved(isAgree);
|
|
53
|
-
return Object.assign(defaultPredictionOptions, options, {
|
|
57
|
+
return Object.assign(getDefaultPredictionOptions(), options, {
|
|
54
58
|
name: `Prediction ${predictionIndex + 1}`,
|
|
55
59
|
});
|
|
56
|
-
}, [
|
|
60
|
+
}, [options, predictionIndex]);
|
|
57
61
|
const { logger } = useLogger();
|
|
58
62
|
const submitHandler = useCallback((values) => {
|
|
59
63
|
void (async () => {
|
|
@@ -66,12 +70,15 @@ function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
|
66
70
|
predictedSpectra.push(key);
|
|
67
71
|
}
|
|
68
72
|
}
|
|
73
|
+
onClose();
|
|
74
|
+
closeDialog();
|
|
69
75
|
const hideLoading = await alert.showLoading(`Predict ${predictedSpectra.join(',')} in progress`);
|
|
70
76
|
try {
|
|
71
|
-
const data = await predictSpectra(molfile
|
|
77
|
+
const data = await predictSpectra(molfile);
|
|
72
78
|
dispatch({
|
|
73
79
|
type: 'PREDICT_SPECTRA',
|
|
74
80
|
payload: {
|
|
81
|
+
logger,
|
|
75
82
|
predictedSpectra: data.spectra,
|
|
76
83
|
options: values,
|
|
77
84
|
molecule,
|
|
@@ -83,7 +90,6 @@ function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
|
83
90
|
}
|
|
84
91
|
finally {
|
|
85
92
|
hideLoading();
|
|
86
|
-
onClose();
|
|
87
93
|
}
|
|
88
94
|
}
|
|
89
95
|
})();
|
|
@@ -95,20 +101,11 @@ function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
|
95
101
|
onClose,
|
|
96
102
|
logger,
|
|
97
103
|
setPredictionPreferences,
|
|
104
|
+
closeDialog,
|
|
98
105
|
]);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
export function usePredictSpectraModal() {
|
|
105
|
-
const modal = useModal();
|
|
106
|
-
return (molecule) => {
|
|
107
|
-
modal.show(_jsx(PredictSpectraModal, { molecule: molecule }), {
|
|
108
|
-
position: positions.TOP_CENTER,
|
|
109
|
-
enableResizing: true,
|
|
110
|
-
width: 600,
|
|
111
|
-
});
|
|
112
|
-
};
|
|
106
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button.BarButton, { color: { base: '#4e4e4e', hover: '#4e4e4e' }, onClick: openDialog, toolTip: "Predict spectra", tooltipOrientation: "horizontal", children: _jsx(SvgNmrFt, {}) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: () => {
|
|
107
|
+
onClose();
|
|
108
|
+
closeDialog();
|
|
109
|
+
}, width: 600, maxWidth: 1000, children: _jsxs("div", { css: [ModalStyles, styles], children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header handle", children: _jsx("span", { children: "Prediction of NMR spectrum" }) }) }), _jsxs("div", { className: "inner-content", children: [_jsx(PredictionPreferences, { onSubmit: submitHandler, options: initValues, ref: refForm }), _jsx("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), _jsx("div", { className: "warning-container", children: _jsx(Checkbox, { onChange: setApproved, checked: isApproved, label: "I confirm that the chemical structure is not confidential." }, String(isApproved)) })] }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] }) })] }));
|
|
113
110
|
}
|
|
114
111
|
export default PredictSpectraModal;
|
|
@@ -89,7 +89,7 @@ export default function ChangeSumModal({ onSave, onClose, header, sumOptions, })
|
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
91
91
|
setActiveOption(SumSetOptions.Manual);
|
|
92
|
-
formRef.current.setValues({ sum: sumOptions?.sum
|
|
92
|
+
formRef.current.setValues({ sum: sumOptions?.sum ?? '', molecule: null });
|
|
93
93
|
}
|
|
94
94
|
}, [panels?.structuresPanel, sumOptions]);
|
|
95
95
|
function saveHandler(values) {
|
|
@@ -91,7 +91,7 @@ function SignalsForm({ range, preferences }) {
|
|
|
91
91
|
: 'addSignalTab');
|
|
92
92
|
}, [setFieldValue, values.signals.length]);
|
|
93
93
|
const tabContainsErrors = useCallback((i) => {
|
|
94
|
-
return !!
|
|
94
|
+
return !!errors?.signals?.[i];
|
|
95
95
|
}, [errors]);
|
|
96
96
|
const signalFormTabs = useMemo(() => {
|
|
97
97
|
const signalTabs = values.signals.length > 0
|
|
@@ -25,7 +25,7 @@ const tabStyles = css `
|
|
|
25
25
|
function SignalsForm() {
|
|
26
26
|
const { values, setFieldValue, errors, } = useFormikContext();
|
|
27
27
|
const tabContainsErrors = useCallback((i) => {
|
|
28
|
-
return !!
|
|
28
|
+
return !!errors?.signals?.[i];
|
|
29
29
|
}, [errors]);
|
|
30
30
|
const signalFormTabs = useMemo(() => {
|
|
31
31
|
const signalTabs = values.signals.length > 0
|
|
@@ -115,7 +115,7 @@ function MetaImportationModal({ onClose, file }) {
|
|
|
115
115
|
return columns;
|
|
116
116
|
}, [parseResult?.meta.fields]);
|
|
117
117
|
function handleLinkSpectra(fields) {
|
|
118
|
-
|
|
118
|
+
const { source, target } = fields;
|
|
119
119
|
if (data && parseResult) {
|
|
120
120
|
try {
|
|
121
121
|
const { compareResult, matches } = linkMetaWithSpectra({
|
|
@@ -53,7 +53,7 @@ function FormattingTabContent() {
|
|
|
53
53
|
const { values, setFieldValue } = useFormikContext();
|
|
54
54
|
const nuclei = lodashGet(values, 'formatting.nuclei', {});
|
|
55
55
|
function deleteHandler(key) {
|
|
56
|
-
|
|
56
|
+
const _nuclei = {};
|
|
57
57
|
for (const nucleus in nuclei) {
|
|
58
58
|
if (nucleus !== key) {
|
|
59
59
|
_nuclei[nucleus] = nuclei[nucleus];
|
|
@@ -64,6 +64,13 @@ function InfoBlockTabContent() {
|
|
|
64
64
|
return (_jsx(FormikInput, { name: `infoBlock.fields.${row.index}.jpath`, style: { input: styles.input }, mapOnChangeValue: (key) => paths?.[key] || null, mapValue: (paths) => convertPathArrayToString(paths), datalist: datalist }));
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
Header: 'Format',
|
|
69
|
+
style: { padding: 0, ...styles.column },
|
|
70
|
+
Cell: ({ row }) => {
|
|
71
|
+
return (_jsx(FormikInput, { name: `infoBlock.fields.${row.index}.format`, style: { input: styles.input } }));
|
|
72
|
+
},
|
|
73
|
+
},
|
|
67
74
|
{
|
|
68
75
|
Header: 'Visible',
|
|
69
76
|
style: { width: '30px', ...styles.column },
|
|
@@ -71,11 +78,11 @@ function InfoBlockTabContent() {
|
|
|
71
78
|
},
|
|
72
79
|
{
|
|
73
80
|
Header: '',
|
|
74
|
-
style: { width: '
|
|
81
|
+
style: { width: '70px', ...styles.column },
|
|
75
82
|
id: 'add-button',
|
|
76
83
|
Cell: ({ data, row }) => {
|
|
77
84
|
const record = row.original;
|
|
78
|
-
return (_jsxs("div", { style: { display: 'flex' }, children: [_jsx(Button.Done, { fill: "outline", onClick: () => addHandler(data, row.index + 1), children: _jsx(FaPlus, {}) }), !record?.name && (_jsx(Button.Danger, { fill: "outline", onClick: () => deleteHandler(data, row.index), children: _jsx(FaTimes, {}) }))] }));
|
|
85
|
+
return (_jsxs("div", { style: { display: 'flex', justifyContent: 'space-around' }, children: [_jsx(Button.Done, { fill: "outline", onClick: () => addHandler(data, row.index + 1), children: _jsx(FaPlus, {}) }), !record?.name && (_jsx(Button.Danger, { fill: "outline", onClick: () => deleteHandler(data, row.index), children: _jsx(FaTimes, {}) }))] }));
|
|
79
86
|
},
|
|
80
87
|
},
|
|
81
88
|
], [addHandler, datalist, deleteHandler, paths]);
|
|
@@ -13,7 +13,7 @@ const formattingValidation = (obj) => object().shape({
|
|
|
13
13
|
nuclei: object()
|
|
14
14
|
.shape(formattingElementValidation(obj))
|
|
15
15
|
.test('Unique', 'Nuclei need te be unique', function check(nuclei) {
|
|
16
|
-
|
|
16
|
+
const nucleusFrequencies = {};
|
|
17
17
|
for (const key of Object.keys(nuclei)) {
|
|
18
18
|
const _key = nuclei[key].name?.toLowerCase() || '';
|
|
19
19
|
if (_key) {
|
|
@@ -30,7 +30,7 @@ const formattingValidation = (obj) => object().shape({
|
|
|
30
30
|
for (const key in nucleusFrequencies) {
|
|
31
31
|
const { value, fields } = nucleusFrequencies[key];
|
|
32
32
|
if (value > 1) {
|
|
33
|
-
for (
|
|
33
|
+
for (const field of fields) {
|
|
34
34
|
errors.push(new ValidationError(`${key} nucleus must te be unique`, nuclei[key].name, `${this.path}.${field}.name`));
|
|
35
35
|
}
|
|
36
36
|
}
|