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
|
@@ -8,8 +8,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const debounce_1 = __importDefault(require("lodash/debounce"));
|
|
9
9
|
const map_1 = __importDefault(require("lodash/map"));
|
|
10
10
|
const react_1 = require("react");
|
|
11
|
+
const MouseButtons = {
|
|
12
|
+
0: 'main',
|
|
13
|
+
2: 'secondary',
|
|
14
|
+
};
|
|
11
15
|
const initialState = {
|
|
12
16
|
step: 'initial',
|
|
17
|
+
mouseButton: 'unknown',
|
|
13
18
|
shiftKey: false,
|
|
14
19
|
altKey: false,
|
|
15
20
|
startX: 0,
|
|
@@ -33,18 +38,21 @@ function useBrushTracker() {
|
|
|
33
38
|
return (0, react_1.useContext)(exports.BrushContext);
|
|
34
39
|
}
|
|
35
40
|
exports.useBrushTracker = useBrushTracker;
|
|
36
|
-
function BrushTracker({ children, className, style, onBrush
|
|
41
|
+
function BrushTracker({ children, className, style, onBrushEnd, onBrush, onZoom = () => null, onDoubleClick = () => null, onClick = () => null, noPropagation, }) {
|
|
37
42
|
const [state, dispatch] = (0, react_1.useReducer)(reducer, initialState);
|
|
38
43
|
const [mouseDownTime, setMouseDownTime] = (0, react_1.useState)(0);
|
|
39
44
|
const debounceClickEventsRef = (0, react_1.useRef)([]);
|
|
45
|
+
const lastPointRef = (0, react_1.useRef)(0);
|
|
40
46
|
const mouseDownHandler = (0, react_1.useCallback)((event) => {
|
|
41
|
-
|
|
47
|
+
//check that the right or left mouse button pressed
|
|
48
|
+
if ([0, 2].includes(event.button)) {
|
|
42
49
|
if (noPropagation) {
|
|
43
50
|
event.stopPropagation();
|
|
44
51
|
}
|
|
45
52
|
dispatch({
|
|
46
53
|
type: 'DOWN',
|
|
47
54
|
payload: {
|
|
55
|
+
mouseButton: MouseButtons[event.button],
|
|
48
56
|
shiftKey: event.shiftKey,
|
|
49
57
|
altKey: event.altKey,
|
|
50
58
|
screenX: event.screenX,
|
|
@@ -107,13 +115,19 @@ function BrushTracker({ children, className, style, onBrush = () => null, onZoom
|
|
|
107
115
|
}, [onZoom]);
|
|
108
116
|
(0, react_1.useEffect)(() => {
|
|
109
117
|
const { step, startX, endX, startY, endY } = state;
|
|
110
|
-
|
|
111
|
-
|
|
118
|
+
const point = Math.hypot(endX - startX, endY - startY);
|
|
119
|
+
if ((step === 'end' || step === 'brushing') &&
|
|
120
|
+
lastPointRef.current !== point) {
|
|
121
|
+
onBrush?.(state);
|
|
122
|
+
lastPointRef.current = point;
|
|
123
|
+
}
|
|
124
|
+
if (step === 'end' && point > 5) {
|
|
125
|
+
onBrushEnd?.(state);
|
|
112
126
|
dispatch({
|
|
113
127
|
type: 'DONE',
|
|
114
128
|
});
|
|
115
129
|
}
|
|
116
|
-
}, [onBrush, state]);
|
|
130
|
+
}, [onBrush, onBrushEnd, state]);
|
|
117
131
|
return ((0, jsx_runtime_1.jsx)(exports.BrushContext.Provider, { value: state, children: (0, jsx_runtime_1.jsx)("div", { className: className, style: style, onMouseDown: mouseDownHandler, onClick: clickHandler, onWheel: handleMouseWheel, onMouseEnter: () => {
|
|
118
132
|
// disable page scrolling once the mouse over the Displayer
|
|
119
133
|
window.addEventListener('wheel', stopPageScrolling, {
|
|
@@ -137,13 +151,14 @@ function reducer(state, action) {
|
|
|
137
151
|
return state;
|
|
138
152
|
case 'DOWN':
|
|
139
153
|
if (state.step === 'initial' || state.step === 'end') {
|
|
140
|
-
const { shiftKey, altKey, screenX, screenY, clientX, clientY, boundingRect, } = action.payload;
|
|
154
|
+
const { shiftKey, altKey, mouseButton, screenX, screenY, clientX, clientY, boundingRect, } = action.payload;
|
|
141
155
|
const x = clientX - boundingRect.x;
|
|
142
156
|
const y = clientY - boundingRect.y;
|
|
143
157
|
return {
|
|
144
158
|
...state,
|
|
145
159
|
shiftKey,
|
|
146
160
|
altKey,
|
|
161
|
+
mouseButton,
|
|
147
162
|
startX: x,
|
|
148
163
|
startY: y,
|
|
149
164
|
startScreenX: screenX,
|
|
@@ -66,7 +66,7 @@ const viewerContainerStyle = (0, react_1.css) `
|
|
|
66
66
|
border: 0.55px #e6e6e6 solid;
|
|
67
67
|
display: flex;
|
|
68
68
|
flex: 1;
|
|
69
|
-
flex-direction:
|
|
69
|
+
flex-direction: column;
|
|
70
70
|
height: 100%;
|
|
71
71
|
margin-left: -1px;
|
|
72
72
|
`;
|
|
@@ -227,28 +227,41 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
|
|
|
227
227
|
rootRef: rootRef.current,
|
|
228
228
|
elementsWrapperRef: elementsWrapperRef.current,
|
|
229
229
|
viewerRef: viewerRef.current,
|
|
230
|
-
}, children: (0, jsx_runtime_1.jsx)(PreferencesContext_1.PreferencesProvider, { value: preferencesState, children: (0, jsx_runtime_1.jsx)("div", { ref: mainDivRef, style: { height: '100%', position: 'relative' }, children: (0, jsx_runtime_1.jsx)(LoggerContext_1.LoggerProvider, { children: (0, jsx_runtime_1.jsx)(Alert_1.AlertProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(DispatchContext_1.DispatchProvider, { value: dispatch, children: (0, jsx_runtime_1.jsx)(ChartContext_1.ChartDataProvider, { value: state, children: (0, jsx_runtime_1.jsx)(Modal_1.ModalProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(highlight_1.HighlightProvider, { children: (0, jsx_runtime_1.jsx)(assignment_1.AssignmentProvider, { spectraData: spectraData, children: (0, jsx_runtime_1.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
230
|
+
}, children: (0, jsx_runtime_1.jsx)(PreferencesContext_1.PreferencesProvider, { value: preferencesState, children: (0, jsx_runtime_1.jsx)("div", { ref: mainDivRef, style: { height: '100%', position: 'relative' }, children: (0, jsx_runtime_1.jsx)(LoggerContext_1.LoggerProvider, { children: (0, jsx_runtime_1.jsx)(Alert_1.AlertProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(DispatchContext_1.DispatchProvider, { value: dispatch, children: (0, jsx_runtime_1.jsx)(ChartContext_1.ChartDataProvider, { value: state, children: (0, jsx_runtime_1.jsx)(Modal_1.ModalProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(highlight_1.HighlightProvider, { children: (0, jsx_runtime_1.jsx)(assignment_1.AssignmentProvider, { spectraData: spectraData, children: (0, jsx_runtime_1.jsxs)(SpinnerContext_1.SpinnerProvider, { value: getSpinner, children: [(0, jsx_runtime_1.jsx)(StateError, {}), (0, jsx_runtime_1.jsx)("div", { className: "nmrium-container", ref: rootRef, css: containerStyles, onContextMenu: preventContextMenuHandler, style: { height: '100%', width: '100%' }, children: (0, jsx_runtime_1.jsx)(DropZone_1.default, { children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
231
|
+
display: 'flex',
|
|
232
|
+
flexDirection: 'column',
|
|
233
|
+
backgroundColor: 'white',
|
|
234
|
+
width: '100%',
|
|
235
|
+
}, children: [(0, jsx_runtime_1.jsx)(Header_1.default, { isFullscreen: isFullscreen, onMaximize: toggle }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
236
|
+
display: 'flex',
|
|
237
|
+
flexDirection: 'row',
|
|
238
|
+
height: '100%',
|
|
239
|
+
}, children: [(0, jsx_runtime_1.jsx)(ToolBar_1.default, {}), (0, jsx_runtime_1.jsxs)(SplitPaneWrapper_1.SplitPaneWrapper, { children: [(0, jsx_runtime_1.jsxs)("div", { css: viewerContainerStyle, children: [(0, jsx_runtime_1.jsx)(KeysListenerTracker_1.default, {}), (0, jsx_runtime_1.jsxs)("div", { id: "nmrium-viewer", "data-test-id": "viewer", ref: viewerRef, style: {
|
|
240
|
+
width: '100%',
|
|
241
|
+
height: '100%',
|
|
242
|
+
position: 'relative',
|
|
243
|
+
}, children: [(0, jsx_runtime_1.jsx)(FloatMoleculeStructures_1.default, {}), displayerMode ===
|
|
244
|
+
Constants_1.DISPLAYER_MODE.DM_1D ? ((0, jsx_runtime_1.jsx)(Viewer1D_1.default, { emptyText: emptyText })) : ((0, jsx_runtime_1.jsx)(Viewer2D_1.default, { emptyText: emptyText }))] })] }), (0, jsx_runtime_1.jsx)(Panels_1.default, {})] }), (0, jsx_runtime_1.jsx)("div", { ref: elementsWrapperRef, id: "main-wrapper", style: {
|
|
245
|
+
position: 'absolute',
|
|
246
|
+
pointerEvents: 'none',
|
|
247
|
+
zIndex: 2,
|
|
248
|
+
left: 0,
|
|
249
|
+
right: 0,
|
|
250
|
+
top: 0,
|
|
251
|
+
bottom: 0,
|
|
252
|
+
} }, String(isFullscreen))] })] }) }) })] }) }) }) }) }) }) }) }) }) }) }));
|
|
253
253
|
}
|
|
254
254
|
exports.default = (0, react_2.memo)(NMRium);
|
|
255
|
+
/**
|
|
256
|
+
* Alert user in UI when state have errorAction (error from reducer)
|
|
257
|
+
*/
|
|
258
|
+
function StateError() {
|
|
259
|
+
const { errorAction } = (0, ChartContext_1.useChartData)();
|
|
260
|
+
const { logger } = (0, LoggerContext_1.useLogger)();
|
|
261
|
+
(0, react_2.useEffect)(() => {
|
|
262
|
+
if (!errorAction)
|
|
263
|
+
return;
|
|
264
|
+
logger.error(errorAction);
|
|
265
|
+
}, [errorAction, logger]);
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
function setActiveAssignment(state, action) {
|
|
4
|
-
|
|
4
|
+
const { id, axis } = action.payload;
|
|
5
5
|
const isActive = state.activated?.id === id;
|
|
6
6
|
return {
|
|
7
7
|
...state,
|
|
@@ -130,6 +130,7 @@ const Input = (0, react_1.forwardRef)((props, ref) => {
|
|
|
130
130
|
onClear?.();
|
|
131
131
|
}
|
|
132
132
|
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
133
|
+
...(renderIcon || (canClear && { padding: '0 5px' })),
|
|
133
134
|
...styles.inputWrapper,
|
|
134
135
|
...style?.inputWrapper,
|
|
135
136
|
}, className: `input ${className || ''}`, children: [renderIcon?.(), (0, jsx_runtime_1.jsx)("input", { ...otherProps, ref: combinedRef, name: name, style: {
|
|
@@ -38,7 +38,7 @@ function InputRange(props, ref) {
|
|
|
38
38
|
}));
|
|
39
39
|
const mouseDownCallback = (0, react_1.useCallback)((event) => {
|
|
40
40
|
function mouseMoveCallback(event) {
|
|
41
|
-
|
|
41
|
+
const diff = event.clientX - previousPosition.current;
|
|
42
42
|
previousPosition.current = event.clientX;
|
|
43
43
|
if (event.buttons === 1) {
|
|
44
44
|
const step = diff / (event.shiftKey ? 10 : 1);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Scroller = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const ScrollContext = (0, react_1.createContext)('');
|
|
7
|
+
const ScrollProvider = ScrollContext.Provider;
|
|
8
|
+
function useScrollKey() {
|
|
9
|
+
const context = (0, react_1.useContext)(ScrollContext);
|
|
10
|
+
if (!context) {
|
|
11
|
+
throw new Error('Scroller context was not found');
|
|
12
|
+
}
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
function Scroller(props) {
|
|
16
|
+
const { scrollTo, children } = props;
|
|
17
|
+
const isAllScrollItem = react_1.Children.toArray(children).some((child) => (0, react_1.isValidElement)(child) && child.type === ScrollerElement);
|
|
18
|
+
if (!isAllScrollItem && react_1.Children.count(children) > 0) {
|
|
19
|
+
throw new Error("one of the children should be of type <Scroller.Item elementKey='...' > children </Scroller.Item>");
|
|
20
|
+
}
|
|
21
|
+
return (0, jsx_runtime_1.jsxs)(ScrollProvider, { value: scrollTo, children: [" ", children, " "] });
|
|
22
|
+
}
|
|
23
|
+
exports.Scroller = Scroller;
|
|
24
|
+
function ScrollerElement(props) {
|
|
25
|
+
const { children, elementKey } = props;
|
|
26
|
+
const scrollToKey = useScrollKey();
|
|
27
|
+
const ref = (0, react_1.useRef)(null);
|
|
28
|
+
(0, react_1.useEffect)(() => {
|
|
29
|
+
if (ref.current && elementKey === scrollToKey) {
|
|
30
|
+
ref.current.scrollIntoView({ behavior: 'smooth' });
|
|
31
|
+
}
|
|
32
|
+
}, [elementKey, scrollToKey]);
|
|
33
|
+
return (0, jsx_runtime_1.jsx)("div", { ref: ref, children: children });
|
|
34
|
+
}
|
|
35
|
+
Scroller.Item = ScrollerElement;
|
|
@@ -10,7 +10,9 @@ const styles = {
|
|
|
10
10
|
position: absolute;
|
|
11
11
|
height: auto;
|
|
12
12
|
z-index: 99999999999999;
|
|
13
|
-
box-shadow:
|
|
13
|
+
box-shadow:
|
|
14
|
+
0 19px 38px rgb(0 0 0 / 30%),
|
|
15
|
+
0 15px 12px rgb(0 0 0 / 22%);
|
|
14
16
|
border-radius: 10px;
|
|
15
17
|
margin-bottom: 20px;
|
|
16
18
|
overflow: hidden;
|
|
@@ -3,28 +3,34 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
|
+
/** @jsxImportSource @emotion/react */
|
|
8
|
+
const react_1 = require("@emotion/react");
|
|
7
9
|
const fa_1 = require("react-icons/fa");
|
|
8
10
|
const options_1 = require("../options");
|
|
9
11
|
const ProgressIndicator_1 = __importDefault(require("./ProgressIndicator"));
|
|
12
|
+
const style = (0, react_1.css) `
|
|
13
|
+
padding: 25px;
|
|
14
|
+
border-radius: 10px;
|
|
15
|
+
pointer-events: all;
|
|
16
|
+
min-height: 60px;
|
|
17
|
+
position: relative;
|
|
18
|
+
|
|
19
|
+
> button {
|
|
20
|
+
position: absolute;
|
|
21
|
+
right: 5px;
|
|
22
|
+
top: 5px;
|
|
23
|
+
border: none;
|
|
24
|
+
background-color: transparent;
|
|
25
|
+
color: white;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
10
28
|
function AlertBlock(props) {
|
|
11
29
|
const { offset, alert, onClose } = props;
|
|
12
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: style, style: {
|
|
13
31
|
margin: offset,
|
|
14
|
-
padding: '25px',
|
|
15
|
-
borderRadius: '10px',
|
|
16
|
-
pointerEvents: 'all',
|
|
17
32
|
backgroundColor: alert.options.backgroundColor,
|
|
18
33
|
color: alert.options.color,
|
|
19
|
-
|
|
20
|
-
position: 'relative',
|
|
21
|
-
}, children: [(0, jsx_runtime_1.jsx)("button", { style: {
|
|
22
|
-
position: 'absolute',
|
|
23
|
-
right: '5px',
|
|
24
|
-
top: '5px',
|
|
25
|
-
border: 'none',
|
|
26
|
-
backgroundColor: 'transparent',
|
|
27
|
-
color: 'white',
|
|
28
|
-
}, type: "button", onClick: onClose, children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }), (0, jsx_runtime_1.jsx)("span", { children: alert.message }), alert.options.type === options_1.types.PROGRESS_INDICATOR && (0, jsx_runtime_1.jsx)(ProgressIndicator_1.default, {})] }, alert.id));
|
|
34
|
+
}, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClose, children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) }), (0, jsx_runtime_1.jsx)("span", { children: alert.message }), alert.options.type === options_1.types.PROGRESS_INDICATOR && (0, jsx_runtime_1.jsx)(ProgressIndicator_1.default, {})] }, alert.id));
|
|
29
35
|
}
|
|
30
36
|
exports.default = AlertBlock;
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useAlert = exports.AlertProvider = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const AlertContext = (0, react_1.createContext)(
|
|
5
|
+
const AlertContext = (0, react_1.createContext)(null);
|
|
6
6
|
exports.AlertProvider = AlertContext.Provider;
|
|
7
7
|
function useAlert() {
|
|
8
|
-
|
|
8
|
+
const context = (0, react_1.useContext)(AlertContext);
|
|
9
|
+
if (!context) {
|
|
10
|
+
throw new Error('useAlert should be mount into an AlertProvider');
|
|
11
|
+
}
|
|
12
|
+
return context;
|
|
9
13
|
}
|
|
10
14
|
exports.useAlert = useAlert;
|
|
@@ -57,10 +57,10 @@ function Provider({ children, wrapperRef = null, offset = '5px', position = opti
|
|
|
57
57
|
id,
|
|
58
58
|
message,
|
|
59
59
|
options: alertOptions,
|
|
60
|
+
close: () => remove(alert),
|
|
60
61
|
};
|
|
61
|
-
alert.close = () => remove(alert);
|
|
62
62
|
if (alert.options.timeout) {
|
|
63
|
-
const timerId = setTimeout(() => {
|
|
63
|
+
const timerId = window.setTimeout(() => {
|
|
64
64
|
remove(alert);
|
|
65
65
|
timersId.current.splice(timersId.current.indexOf(timerId), 1);
|
|
66
66
|
}, alert.options.timeout);
|
|
@@ -124,7 +124,9 @@ function Provider({ children, style, offset = '0px', position = options_1.positi
|
|
|
124
124
|
.rnd-container {
|
|
125
125
|
box-sizing: initial;
|
|
126
126
|
background-color: #fff;
|
|
127
|
-
box-shadow:
|
|
127
|
+
box-shadow:
|
|
128
|
+
0 0 0 0,
|
|
129
|
+
0 8px 16px rgb(0 0 0 / 30%);
|
|
128
130
|
border-radius: 5px;
|
|
129
131
|
}
|
|
130
132
|
`;
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const nmr_processing_1 = require("nmr-processing");
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
+
const ui_1 = require("react-science/ui");
|
|
9
10
|
const generateNumbersPowerOfX_1 = __importDefault(require("../../data/utilities/generateNumbersPowerOfX"));
|
|
10
11
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
11
12
|
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
12
|
-
const CheckBox_1 = __importDefault(require("../elements/CheckBox"));
|
|
13
13
|
const Label_1 = __importDefault(require("../elements/Label"));
|
|
14
14
|
const Select_1 = __importDefault(require("../elements/Select"));
|
|
15
15
|
const useFilter_1 = require("../hooks/useFilter");
|
|
@@ -55,19 +55,14 @@ function ZeroFillingOptionsInnerPanel(props) {
|
|
|
55
55
|
}
|
|
56
56
|
function handleChangeSizeHandler(value) {
|
|
57
57
|
setSize(value);
|
|
58
|
-
dispatchLiveChanges(value);
|
|
59
58
|
}
|
|
60
59
|
(0, react_1.useEffect)(() => {
|
|
61
60
|
if (livePreview && size) {
|
|
62
61
|
dispatchLiveChanges(size);
|
|
63
62
|
}
|
|
64
63
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
-
}, []);
|
|
66
|
-
|
|
67
|
-
const checked = event.target.checked;
|
|
68
|
-
setLivePreview(checked);
|
|
69
|
-
}
|
|
70
|
-
return ((0, jsx_runtime_1.jsxs)(HeaderContainer_1.HeaderContainer, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Size: ", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(Select_1.default, { items: Sizes, style: { marginLeft: 10, marginRight: 10 }, value: size, onChange: handleChangeSizeHandler }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Live preview ", htmlFor: "livePreview", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(CheckBox_1.default, { name: "livePreview", defaultChecked: true, onChange: checkChangeHandler }) }), (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
|
|
64
|
+
}, [size, livePreview]);
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)(HeaderContainer_1.HeaderContainer, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Size: ", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(Select_1.default, { items: Sizes, style: { marginLeft: 10, marginRight: 10 }, value: size, onChange: handleChangeSizeHandler }) }), (0, jsx_runtime_1.jsx)(ui_1.Checkbox, { label: "Live preview", checked: livePreview, onChange: setLivePreview }), (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
|
|
71
66
|
}
|
|
72
67
|
const MemoizedZeroFillingOptionsPanel = (0, react_1.memo)(ZeroFillingOptionsInnerPanel);
|
|
73
68
|
function ZeroFillingOptionsPanel() {
|
|
@@ -16,7 +16,7 @@ function useCheckToolsVisibility() {
|
|
|
16
16
|
const spectrum = (0, useSpectrum_1.default)(null);
|
|
17
17
|
return (0, react_1.useCallback)((toolKey, checkOptions = {}) => {
|
|
18
18
|
const { checkMode = true, checkSpectrumType = true, extraInfoCheckParameters, } = checkOptions;
|
|
19
|
-
|
|
19
|
+
const flag = (0, get_1.default)(preferences.current, `display.toolBarButtons.${toolKey}`, false);
|
|
20
20
|
const { spectraOptions, mode } = ToolTypes_1.options[toolKey];
|
|
21
21
|
const modeFlag = !checkMode || (checkMode && (!mode || displayerMode === mode));
|
|
22
22
|
const spectrumCheckFlag = !checkSpectrumType ||
|
|
@@ -38,7 +38,7 @@ function checkSpectrum(spectrum, options) {
|
|
|
38
38
|
let innerConditionFlag = true;
|
|
39
39
|
if (option.active) {
|
|
40
40
|
if (spectrum) {
|
|
41
|
-
for (
|
|
41
|
+
for (const { key, value } of option.info || []) {
|
|
42
42
|
if (spectrum.info[key] !== value) {
|
|
43
43
|
innerConditionFlag = false;
|
|
44
44
|
}
|
|
@@ -46,7 +46,8 @@ function useExport() {
|
|
|
46
46
|
setTimeout(() => {
|
|
47
47
|
void handle();
|
|
48
48
|
}, 0);
|
|
49
|
-
})
|
|
49
|
+
})
|
|
50
|
+
.catch(reportError);
|
|
50
51
|
}, [alert, preferencesState, state]);
|
|
51
52
|
const saveAsSVGHandler = (0, react_1.useCallback)(async () => {
|
|
52
53
|
if (state.data.length > 0 && rootRef) {
|
|
@@ -28,7 +28,7 @@ function getDefaultPreferences(panelKey, nucleus) {
|
|
|
28
28
|
case 'multipleSpectraAnalysis':
|
|
29
29
|
return (0, panelsPreferencesDefaultValues_1.getMultipleSpectraAnalysisDefaultValues)(nucleus);
|
|
30
30
|
case 'prediction':
|
|
31
|
-
return PredictionManager_1.
|
|
31
|
+
return (0, PredictionManager_1.getDefaultPredictionOptions)();
|
|
32
32
|
default:
|
|
33
33
|
return {};
|
|
34
34
|
}
|
|
@@ -56,17 +56,15 @@ function useSaveSettings() {
|
|
|
56
56
|
const { dispatch, current } = (0, PreferencesContext_1.usePreferences)();
|
|
57
57
|
const formRef = (0, react_1.useRef)(null);
|
|
58
58
|
function addNewWorkspace({ workspaceName }) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
alert.success('Preferences saved successfully');
|
|
69
|
-
}
|
|
59
|
+
dispatch({
|
|
60
|
+
type: 'ADD_WORKSPACE',
|
|
61
|
+
payload: {
|
|
62
|
+
workspaceKey: workspaceName,
|
|
63
|
+
data: settingsRef.current,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
closeDialog();
|
|
67
|
+
alert.success('Preferences saved successfully');
|
|
70
68
|
}
|
|
71
69
|
return {
|
|
72
70
|
saveSettings: (values) => {
|
|
@@ -49,6 +49,6 @@ const styles = (0, react_1.css) `
|
|
|
49
49
|
`;
|
|
50
50
|
function AboutPredictionModal() {
|
|
51
51
|
const [isOpenDialog, openDialog, closeDialog] = (0, ui_1.useOnOff)(false);
|
|
52
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: openDialog, tooltipOrientation: "horizontal", toolTip: "About Prediction", children: (0, jsx_runtime_1.jsx)(fa_1.FaInfo, {}) }), (0, jsx_runtime_1.jsx)(ui_1.Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, children: (0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)(ui_1.Modal.Header, { children: (0, jsx_runtime_1.jsx)("div", { className: "header", children: (0, jsx_runtime_1.jsx)("span", { children: "About Prediction" }) }) }), (0, jsx_runtime_1.jsx)(ui_1.Modal.Body, { children: (0, jsx_runtime_1.jsxs)("div", { className: "content", children: [(0, jsx_runtime_1.jsx)("p", { children: "If you are using our tools please cite us:" }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsxs)("li", { children: ["Banfi
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: openDialog, tooltipOrientation: "horizontal", toolTip: "About Prediction", children: (0, jsx_runtime_1.jsx)(fa_1.FaInfo, {}) }), (0, jsx_runtime_1.jsx)(ui_1.Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, children: (0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)(ui_1.Modal.Header, { children: (0, jsx_runtime_1.jsx)("div", { className: "header", children: (0, jsx_runtime_1.jsx)("span", { children: "About Prediction" }) }) }), (0, jsx_runtime_1.jsx)(ui_1.Modal.Body, { children: (0, jsx_runtime_1.jsxs)("div", { className: "content", children: [(0, jsx_runtime_1.jsx)("p", { children: "If you are using our tools please cite us:" }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsxs)("li", { children: ["Damiano Banfi and Luc Patiny", ' ', (0, jsx_runtime_1.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" }), ' ', (0, jsx_runtime_1.jsx)("i", { children: "Chimia" }), ", ", (0, jsx_runtime_1.jsx)("b", { children: "2008" }), ", 62(4), 280-281."] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', (0, jsx_runtime_1.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" }), ' ', (0, jsx_runtime_1.jsx)("i", { children: "Journal of Magnetic Resonance" }), " ", (0, jsx_runtime_1.jsx)("b", { children: "2011" }), ", 209(2), 123-130."] })] }), (0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.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:"] }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsxs)("li", { children: ["Yuri Binev, Maria M. B. Marques and Jo\u00E3o Aires-de-Sousa", ' ', (0, jsx_runtime_1.jsxs)("a", { href: "http://dx.doi.org/10.1021/ci700172n", target: "_blank", rel: "noreferrer", children: ["Prediction of ", (0, jsx_runtime_1.jsx)("sup", { children: "1" }), "H NMR coupling constants with associative neural networks trained for chemical shifts"] }), ' ', (0, jsx_runtime_1.jsx)("i", { children: "J. Chem. Inf. Model." }), " ", (0, jsx_runtime_1.jsx)("b", { children: "2007" }), ", 47(6), 2089-2097."] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Jo\u00E3o Aires-de-Sousa, Markus C. Hemmer and Johann Gasteiger", ' ', (0, jsx_runtime_1.jsxs)("a", { href: "http://dx.doi.org/10.1021/ac010737m", target: "_blank", rel: "noreferrer", children: ["Prediction of ", (0, jsx_runtime_1.jsx)("sup", { children: "1" }), "H NMR Chemical Shifts Using Neural Networks"] }), ", ", (0, jsx_runtime_1.jsx)("i", { children: "Analytical Chemistry" }), ", ", (0, jsx_runtime_1.jsx)("b", { children: "2002" }), ", 74(1), 80-90."] })] }), (0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsx)("sup", { children: "13" }), "C NMR prediction was possible thanks to NMRshiftDB:"] }), (0, jsx_runtime_1.jsx)("ul", { children: (0, jsx_runtime_1.jsxs)("li", { children: ["Steinbeck, Christoph, Stefan Krause, and Stefan Kuhn", ' ', (0, jsx_runtime_1.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" }), ' ', (0, jsx_runtime_1.jsx)("i", { children: "Journal of chemical information and computer sciences" }), ",", ' ', (0, jsx_runtime_1.jsx)("b", { children: "2003" }), ", 43(6): 1733-1739."] }) })] }) })] }) })] }));
|
|
53
53
|
}
|
|
54
54
|
exports.default = AboutPredictionModal;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
|
+
/** @jsxImportSource @emotion/react */
|
|
8
|
+
const react_1 = require("@emotion/react");
|
|
9
|
+
const fa_1 = require("react-icons/fa");
|
|
10
|
+
const ui_1 = require("react-science/ui");
|
|
11
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
12
|
+
const styles = (0, react_1.css) `
|
|
13
|
+
width: 600px;
|
|
14
|
+
|
|
15
|
+
.content {
|
|
16
|
+
padding: 2em;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
ul {
|
|
20
|
+
list-style-type: disc;
|
|
21
|
+
margin-left: 25px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
p,
|
|
25
|
+
li {
|
|
26
|
+
user-select: text;
|
|
27
|
+
font-size: 1.1em;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
a {
|
|
31
|
+
color: #00bcd4;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
a:hover,
|
|
35
|
+
a:focus {
|
|
36
|
+
text-decoration: underline;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.header span {
|
|
40
|
+
color: #464646;
|
|
41
|
+
font-size: 15px;
|
|
42
|
+
flex: 1;
|
|
43
|
+
user-select: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
p {
|
|
47
|
+
padding: 0.8em 0;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
function AboutSpectrumSimulationModal() {
|
|
51
|
+
const [isOpenDialog, openDialog, closeDialog] = (0, ui_1.useOnOff)(false);
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: openDialog, tooltipOrientation: "horizontal", toolTip: "About Prediction", children: (0, jsx_runtime_1.jsx)(fa_1.FaInfo, {}) }), (0, jsx_runtime_1.jsx)(ui_1.Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, children: (0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)(ui_1.Modal.Header, { children: (0, jsx_runtime_1.jsx)("div", { className: "header", children: (0, jsx_runtime_1.jsx)("span", { children: "About spectrum simulation" }) }) }), (0, jsx_runtime_1.jsx)(ui_1.Modal.Body, { children: (0, jsx_runtime_1.jsxs)("div", { className: "content", children: [(0, jsx_runtime_1.jsx)("p", { children: "If you are using our tools please cite us:" }), (0, jsx_runtime_1.jsx)("ul", { children: (0, jsx_runtime_1.jsxs)("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', (0, jsx_runtime_1.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" }), ' ', (0, jsx_runtime_1.jsx)("i", { children: "Journal of Magnetic Resonance" }), " ", (0, jsx_runtime_1.jsx)("b", { children: "2011" }), ", 209(2), 123-130."] }) })] }) })] }) })] }));
|
|
53
|
+
}
|
|
54
|
+
exports.default = AboutSpectrumSimulationModal;
|
|
@@ -16,6 +16,16 @@ const Select_1 = __importDefault(require("../elements/Select"));
|
|
|
16
16
|
const FormikInput_1 = __importDefault(require("../elements/formik/FormikInput"));
|
|
17
17
|
const Events_1 = __importDefault(require("../utility/Events"));
|
|
18
18
|
const ModalStyle_1 = require("./ModalStyle");
|
|
19
|
+
const labelStyle = {
|
|
20
|
+
label: { flex: 4, fontWeight: '500' },
|
|
21
|
+
wrapper: { flex: 8, display: 'flex', alignItems: 'center' },
|
|
22
|
+
container: { padding: '5px 0' },
|
|
23
|
+
};
|
|
24
|
+
const inputStyle = {
|
|
25
|
+
input: {
|
|
26
|
+
padding: '5px',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
19
29
|
const baseList = [{ key: 1, value: 'manual', label: 'Manual' }];
|
|
20
30
|
function AlignSpectraModal({ onClose = () => null, nucleus, }) {
|
|
21
31
|
const refForm = (0, react_1.useRef)();
|
|
@@ -55,6 +65,6 @@ function AlignSpectraModal({ onClose = () => null, nucleus, }) {
|
|
|
55
65
|
...resValues,
|
|
56
66
|
});
|
|
57
67
|
}, [nucleus]);
|
|
58
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Spectra calibration" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", style: { flex: 1 }, children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { innerRef: refForm, initialValues: { from: -1, to: 1, nbPeaks: 1, targetX: 0 }, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Spectra calibration" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", style: { flex: 1 }, children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { innerRef: refForm, initialValues: { from: -1, to: 1, nbPeaks: 1, targetX: 0 }, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Options", style: labelStyle, children: (0, jsx_runtime_1.jsx)(Select_1.default, { items: List, style: { width: '100%', height: 30 }, onChange: optionChangeHandler }) }), (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "Range", style: labelStyle, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "from", type: "number", style: inputStyle }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "to", type: "number", style: inputStyle }) })] }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Number of Peaks", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "nbPeaks", type: "number", style: inputStyle }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Target PPM", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "targetX", type: "number", style: inputStyle }) })] }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleSave, children: "Done" }) })] }));
|
|
59
69
|
}
|
|
60
70
|
exports.default = AlignSpectraModal;
|
|
@@ -156,7 +156,8 @@ function MultipletAnalysisModal({ data, activeSpectrum, scaleX, startX, endX, on
|
|
|
156
156
|
return (
|
|
157
157
|
// eslint-disable-next-line react/no-array-index-key
|
|
158
158
|
(0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsxs)(react_plot_1.Plot, { width: 400, height: 200, svgStyle: { overflow: 'visible' }, seriesViewportStyle: { stroke: 'black' }, children: [(0, jsx_runtime_1.jsx)(react_plot_1.LineSeries, { data: (0, ml_spectra_processing_1.xyToXYObject)(d.multiplet) }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { id: "y", position: "left", tickPosition: "inner", displayPrimaryGridLines: true, hiddenTicks: true, paddingStart: 0.1, paddingEnd: 0.1 }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { id: "x", position: "bottom", tickPosition: "inner", displayPrimaryGridLines: true })] }), (0, jsx_runtime_1.jsx)("div", { className: "multiplicity", children: (0, jsx_runtime_1.jsx)("p", { children: analysisData.js[index]
|
|
159
|
-
? `${analysisData.js[index]
|
|
159
|
+
? `${analysisData.js[index]
|
|
160
|
+
?.multiplicity}: ${analysisData.js[index]?.coupling.toFixed(3)} Hz`
|
|
160
161
|
: '' }) }), (0, jsx_runtime_1.jsxs)(react_plot_1.Plot, { width: 400, height: 200, seriesViewportStyle: { stroke: 'black' }, children: [(0, jsx_runtime_1.jsx)(react_plot_1.LineSeries, { data: (0, ml_spectra_processing_1.xyToXYObject)(d.errorFunction), lineStyle: { strokeWidth: 1 } }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { id: "y", position: "left", tickPosition: "inner", displayPrimaryGridLines: true, hiddenTicks: true, paddingStart: 0.1, paddingEnd: 0.1 }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { id: "x", position: "bottom", tickPosition: "inner", displayPrimaryGridLines: true })] })] }, index));
|
|
161
162
|
}) })] }));
|
|
162
163
|
}
|