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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SpectrumSimulationOptions } from '../../../data/data1d/spectrumSimulation';
|
|
3
|
+
export interface SpectrumSimulationPreferencesRefProps {
|
|
4
|
+
saveSetting: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface SpectrumSimulationPreferencesProps {
|
|
7
|
+
options: SpectrumSimulationOptions;
|
|
8
|
+
onSave: (options: SpectrumSimulationOptions) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: import("react").ForwardRefExoticComponent<SpectrumSimulationPreferencesProps & import("react").RefAttributes<unknown>>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Formik } from 'formik';
|
|
3
|
+
import { forwardRef, useImperativeHandle, useRef } from 'react';
|
|
4
|
+
import { FREQUENCIES } from '../../../data/PredictionManager';
|
|
5
|
+
import generateNumbersPowerOfX from '../../../data/utilities/generateNumbersPowerOfX';
|
|
6
|
+
import Label from '../../elements/Label';
|
|
7
|
+
import FormikInput from '../../elements/formik/FormikInput';
|
|
8
|
+
import FormikSelect from '../../elements/formik/FormikSelect';
|
|
9
|
+
import { PreferencesContainer } from '../extra/preferences/PreferencesContainer';
|
|
10
|
+
const SIMULATION_NUMBER_OF_POINTS = generateNumbersPowerOfX(12, 19);
|
|
11
|
+
const selectStyles = {
|
|
12
|
+
width: '100%',
|
|
13
|
+
minWidth: '50px',
|
|
14
|
+
maxWidth: '280px',
|
|
15
|
+
height: 30,
|
|
16
|
+
margin: 0,
|
|
17
|
+
};
|
|
18
|
+
const labelStyle = {
|
|
19
|
+
label: { flex: 3, fontWeight: '500' },
|
|
20
|
+
wrapper: { flex: 9, display: 'flex', alignItems: 'center' },
|
|
21
|
+
container: { padding: '5px' },
|
|
22
|
+
};
|
|
23
|
+
const inputStyle = {
|
|
24
|
+
input: {
|
|
25
|
+
padding: '5px',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
function SpectrumSimulationPreferences({ options, onSave }, ref) {
|
|
29
|
+
const formRef = useRef(null);
|
|
30
|
+
useImperativeHandle(ref, () => ({
|
|
31
|
+
saveSetting: () => {
|
|
32
|
+
void formRef.current?.submitForm();
|
|
33
|
+
},
|
|
34
|
+
}), []);
|
|
35
|
+
return (_jsx(PreferencesContainer, { style: { backgroundColor: 'white' }, children: _jsx(Formik, { initialValues: options, onSubmit: onSave, innerRef: formRef, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "Frequency", style: labelStyle, children: _jsx(FormikSelect, { items: FREQUENCIES, style: selectStyles, name: "options.frequency" }) }), _jsx(Label, { title: "Number of Points", style: labelStyle, children: _jsx(FormikSelect, { items: SIMULATION_NUMBER_OF_POINTS, name: "options.nbPoints", style: selectStyles }) }), _jsxs(Label, { title: "Range", style: labelStyle, children: [_jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "options.from", type: "number", style: inputStyle }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "options.to", type: "number", style: inputStyle }) })] }), _jsxs(Label, { title: "Line Width", style: labelStyle, children: [_jsx(FormikInput, { name: "options.lineWidth", type: "number", style: inputStyle }), _jsx("span", { style: { paddingLeft: '0.4rem' }, children: " Hz " })] })] }) }) }));
|
|
36
|
+
}
|
|
37
|
+
export default forwardRef(SpectrumSimulationPreferences);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FREQUENCIES } from '../../../data/PredictionManager';
|
|
3
|
+
import { getSpinSystems } from '../../../data/data1d/spectrumSimulation';
|
|
4
|
+
import Label from '../../elements/Label';
|
|
5
|
+
import Select from '../../elements/Select';
|
|
6
|
+
import FormikNumberInput from '../../elements/formik/FormikNumberInput';
|
|
7
|
+
import FormikSelect from '../../elements/formik/FormikSelect';
|
|
8
|
+
const SPIN_SYSTEMS = getSpinSystems().map((key) => ({
|
|
9
|
+
label: key,
|
|
10
|
+
value: key,
|
|
11
|
+
}));
|
|
12
|
+
const labelStyle = {
|
|
13
|
+
label: { fontSize: '10px' },
|
|
14
|
+
wrapper: { display: 'flex', alignItems: 'center', height: '100%' },
|
|
15
|
+
container: { padding: '0 5px', height: '100%' },
|
|
16
|
+
};
|
|
17
|
+
const selectStyles = { width: '100%', minWidth: '75px', fontSize: '10px' };
|
|
18
|
+
export default function SpectrumSimulationSimpleOptions({ onSpinSystemChange, spinSystem, }) {
|
|
19
|
+
return (_jsxs("div", { style: {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
justifyContent: 'flex-end',
|
|
22
|
+
flex: '1',
|
|
23
|
+
padding: '0 10px',
|
|
24
|
+
}, children: [_jsx(Label, { title: "Spin system", style: labelStyle, children: _jsx(Select, { items: SPIN_SYSTEMS, style: selectStyles, onChange: onSpinSystemChange, value: spinSystem }) }), _jsx(Label, { title: "Frequency", style: labelStyle, children: _jsx(FormikSelect, { items: FREQUENCIES, style: selectStyles, name: "options.frequency" }) }), _jsxs(Label, { title: "Line Width", style: labelStyle, children: [_jsx(FormikNumberInput, { name: "options.lineWidth", type: "number", style: { margin: 0, width: '40px' } }), _jsx("span", { style: { padding: '0 5px' }, children: "Hz" })] })] }));
|
|
25
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useFormikContext } from 'formik';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import ReactTable from '../../elements/ReactTable/ReactTable';
|
|
5
|
+
import addCustomColumn from '../../elements/ReactTable/utility/addCustomColumn';
|
|
6
|
+
import FormikInput from '../../elements/formik/FormikInput';
|
|
7
|
+
const cellStyle = {
|
|
8
|
+
padding: '1px',
|
|
9
|
+
border: 'none',
|
|
10
|
+
borderWidth: 0,
|
|
11
|
+
};
|
|
12
|
+
const inputStyle = {
|
|
13
|
+
input: {
|
|
14
|
+
padding: '5px',
|
|
15
|
+
},
|
|
16
|
+
inputWrapper: {
|
|
17
|
+
borderRadius: 0,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export function SpinSystemTable(props) {
|
|
21
|
+
const { spinSystem } = props;
|
|
22
|
+
const { values: { data }, } = useFormikContext();
|
|
23
|
+
const tableColumns = useMemo(() => {
|
|
24
|
+
const columns = [
|
|
25
|
+
{
|
|
26
|
+
id: 'rowLabel',
|
|
27
|
+
Header: '',
|
|
28
|
+
accessor: (_, index) => spinSystem.at(index),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
Header: 'Delta',
|
|
32
|
+
style: cellStyle,
|
|
33
|
+
Cell: ({ row }) => (_jsx(FormikInput, { name: `data.${row.index}.0`, style: inputStyle, value: row.original[0] || 0, type: "number" })),
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
let i = 0;
|
|
37
|
+
for (const label of spinSystem.slice(0, -1)) {
|
|
38
|
+
const columnIndex = i + 1;
|
|
39
|
+
addCustomColumn(columns, {
|
|
40
|
+
id: label,
|
|
41
|
+
index: i,
|
|
42
|
+
style: cellStyle,
|
|
43
|
+
Cell: function cellRender({ row }) {
|
|
44
|
+
const val = row.original?.[columnIndex] ?? null;
|
|
45
|
+
if (val !== null) {
|
|
46
|
+
return (_jsx(FormikInput, { name: `data.${row.index}.${columnIndex}`, style: inputStyle, type: "number" }));
|
|
47
|
+
}
|
|
48
|
+
return _jsx("div", {});
|
|
49
|
+
},
|
|
50
|
+
Header: () => (_jsxs("span", { children: ["J", _jsxs("sub", { children: [label, "-"] }), "(Hz)"] })),
|
|
51
|
+
});
|
|
52
|
+
i++;
|
|
53
|
+
}
|
|
54
|
+
return columns;
|
|
55
|
+
}, [spinSystem]);
|
|
56
|
+
if (!spinSystem) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return _jsx(ReactTable, { columns: tableColumns, data: data });
|
|
60
|
+
}
|
|
@@ -57,34 +57,34 @@ export interface State {
|
|
|
57
57
|
* value change when zooming in/out
|
|
58
58
|
* @default []
|
|
59
59
|
*/
|
|
60
|
-
xDomain:
|
|
60
|
+
xDomain: number[];
|
|
61
61
|
/**
|
|
62
62
|
* Y axis domain
|
|
63
63
|
* value change when vertical scale change for all spectra
|
|
64
64
|
* @default []
|
|
65
65
|
*/
|
|
66
|
-
yDomain:
|
|
66
|
+
yDomain: number[];
|
|
67
67
|
/**
|
|
68
68
|
* Y axis domain per spectrum
|
|
69
69
|
* value change when vertical scale change for the selected spectrum
|
|
70
70
|
* @default {}
|
|
71
71
|
*/
|
|
72
|
-
yDomains: Record<string,
|
|
72
|
+
yDomains: Record<string, number[]>;
|
|
73
73
|
/**
|
|
74
74
|
* X axis domain per spectrum
|
|
75
75
|
* value change when zooming in/out for the selected spectrum
|
|
76
76
|
* @default {}
|
|
77
77
|
*/
|
|
78
|
-
xDomains: Record<string,
|
|
78
|
+
xDomains: Record<string, number[]>;
|
|
79
79
|
/**
|
|
80
80
|
* Domain for X and Y axis once it calculated and it change in one case when we load new spectra
|
|
81
81
|
* @default {}
|
|
82
82
|
*/
|
|
83
83
|
originDomain: {
|
|
84
|
-
xDomain:
|
|
85
|
-
yDomain:
|
|
86
|
-
xDomains: Record<string,
|
|
87
|
-
yDomains: Record<string,
|
|
84
|
+
xDomain: number[];
|
|
85
|
+
yDomain: number[];
|
|
86
|
+
xDomains: Record<string, number[]>;
|
|
87
|
+
yDomains: Record<string, number[]>;
|
|
88
88
|
shareYDomain: boolean;
|
|
89
89
|
};
|
|
90
90
|
/**
|
|
@@ -92,7 +92,7 @@ export interface State {
|
|
|
92
92
|
* value change when vertical scale change for the integrals
|
|
93
93
|
* @default {}
|
|
94
94
|
*/
|
|
95
|
-
integralsYDomains: Record<string,
|
|
95
|
+
integralsYDomains: Record<string, number[]>;
|
|
96
96
|
/**
|
|
97
97
|
* plot chart area width
|
|
98
98
|
* @default 0
|
|
@@ -117,7 +117,7 @@ export interface State {
|
|
|
117
117
|
* molecules
|
|
118
118
|
* @default []
|
|
119
119
|
*/
|
|
120
|
-
molecules:
|
|
120
|
+
molecules: StateMoleculeExtended[];
|
|
121
121
|
/**
|
|
122
122
|
* View related information
|
|
123
123
|
* @default { floatingMolecules: [], ranges: [], zones: [] };
|
|
@@ -127,9 +127,9 @@ export interface State {
|
|
|
127
127
|
* @todo for undo /redo features
|
|
128
128
|
*/
|
|
129
129
|
history: Partial<{
|
|
130
|
-
past:
|
|
130
|
+
past: any[];
|
|
131
131
|
present: any;
|
|
132
|
-
future:
|
|
132
|
+
future: any[];
|
|
133
133
|
hasUndo: boolean;
|
|
134
134
|
hasRedo: boolean;
|
|
135
135
|
}>;
|
|
@@ -221,6 +221,7 @@ export interface State {
|
|
|
221
221
|
};
|
|
222
222
|
};
|
|
223
223
|
usedColors: UsedColors;
|
|
224
|
+
errorAction?: any;
|
|
224
225
|
}
|
|
225
226
|
export declare function initState(state: State): State;
|
|
226
227
|
export declare const spectrumReducer: Reducer<State, Action>;
|