nmrium 0.20.1 → 0.22.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/ExclusionZonesAnnotations.js +1 -2
- package/lib/component/1d/Integral.js +1 -6
- package/lib/component/1d/Viewer1D.js +4 -4
- package/lib/component/1d/ranges/RangeIntegral.js +2 -6
- package/lib/component/1d/utilities/scale.d.ts +1 -1
- package/lib/component/1d/utilities/scale.js +7 -6
- package/lib/component/2d/Viewer2D.js +5 -5
- package/lib/component/EventsTrackers/KeysListenerTracker.js +98 -81
- package/lib/component/NMRium.d.ts +9 -2
- package/lib/component/NMRium.js +9 -9
- package/lib/component/elements/EditableColumn.d.ts +1 -1
- package/lib/component/elements/NumberInput.d.ts +1 -2
- package/lib/component/elements/Tab/Tab.js +1 -0
- package/lib/component/header/Header.js +13 -10
- package/lib/component/hooks/useCheckExperimentalFeature.js +2 -1
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -0
- package/lib/component/hooks/useCheckToolsVisibility.js +6 -0
- package/lib/component/{1d/utilities → hooks}/useIntegralPath.d.ts +0 -0
- package/lib/component/hooks/useIntegralPath.js +53 -0
- package/lib/component/hooks/useToolsFunctions.js +6 -6
- package/lib/component/hooks/useXScale.d.ts +2 -0
- package/lib/component/hooks/useXScale.js +7 -0
- package/lib/component/loader/DropZone.js +88 -88
- package/lib/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
- package/lib/component/modal/editZone/EditPathLengthFormik.d.ts +5 -0
- package/lib/component/modal/editZone/EditPathLengthFormik.js +72 -0
- package/lib/component/modal/editZone/EditZoneModal.d.ts +8 -0
- package/lib/component/modal/editZone/EditZoneModal.js +96 -0
- package/lib/component/modal/editZone/SignalFormTab.d.ts +6 -0
- package/lib/component/modal/editZone/SignalFormTab.js +6 -0
- package/lib/component/modal/editZone/SignalsForm.d.ts +2 -0
- package/lib/component/modal/editZone/SignalsForm.js +62 -0
- package/lib/component/modal/editZone/validation/EditZoneValidation.d.ts +534 -0
- package/lib/component/modal/editZone/validation/EditZoneValidation.js +17 -0
- package/lib/component/modal/editZone/validation/isDefaultPathLength.d.ts +3 -0
- package/lib/component/modal/editZone/validation/isDefaultPathLength.js +7 -0
- package/lib/component/modal/setting/ControllersTabContent.js +1 -1
- package/lib/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.d.ts +1 -2
- package/lib/component/modal/setting/GeneralSettings.js +13 -9
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.d.ts +2 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +13 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +7 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +38 -0
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +4 -17
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +1 -1
- package/lib/component/panels/Panels.d.ts +1 -1
- package/lib/component/panels/Panels.js +10 -14
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +0 -3
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +5 -14
- package/lib/component/panels/RangesPanel/RangesPanel.js +2 -5
- package/lib/component/panels/RangesPanel/RangesPreferences.js +5 -18
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +7 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.d.ts +1 -6
- package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -7
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +4 -5
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +21 -25
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +24 -30
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +8 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +89 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.d.ts +6 -6
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +40 -43
- package/lib/component/panels/SummaryPanel/utilities/IsInView.d.ts +6 -0
- package/lib/component/panels/SummaryPanel/utilities/IsInView.js +16 -0
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +29 -0
- package/lib/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +155 -19
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +1 -0
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +26 -3
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +12 -7
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +5 -18
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +3 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js +5 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js +0 -3
- package/lib/component/panels/databasePanel/DatabasePreferences.js +4 -17
- package/lib/component/reducer/IgnoreActions.js +2 -1
- package/lib/component/reducer/Reducer.d.ts +20 -34
- package/lib/component/reducer/Reducer.js +7 -8
- package/lib/component/reducer/actions/CorrelationsActions.d.ts +7 -7
- package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +3 -1
- package/lib/component/reducer/actions/DomainActions.js +20 -1
- package/lib/component/reducer/actions/IntegralsActions.js +2 -0
- package/lib/component/reducer/actions/LoadActions.js +22 -1
- package/lib/component/reducer/actions/PreferencesActions.js +0 -2
- package/lib/component/reducer/actions/RangesActions.js +3 -1
- package/lib/component/reducer/actions/SpectrumsActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +43 -56
- package/lib/component/reducer/actions/ZonesActions.d.ts +3 -1
- package/lib/component/reducer/actions/ZonesActions.js +33 -2
- package/lib/component/reducer/helper/Zoom1DManager.d.ts +17 -21
- package/lib/component/reducer/helper/Zoom1DManager.js +53 -69
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -0
- package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib/component/reducer/preferencesReducer.d.ts +3 -8
- package/lib/component/reducer/preferencesReducer.js +87 -37
- package/lib/component/reducer/types/Types.d.ts +3 -1
- package/lib/component/reducer/types/Types.js +3 -1
- package/lib/component/toolbar/FunctionToolBar.js +7 -10
- package/lib/component/toolbar/ToolTypes.js +3 -3
- package/lib/component/workspaces/Workspace.d.ts +6 -0
- package/lib/component/workspaces/Workspace.js +1 -0
- package/lib/component/workspaces/basic.d.ts +2 -0
- package/lib/component/workspaces/basic.js +45 -0
- package/lib/component/workspaces/exercise1D.d.ts +2 -0
- package/lib/component/workspaces/exercise1D.js +45 -0
- package/lib/component/workspaces/index.d.ts +6 -0
- package/lib/component/workspaces/index.js +4 -0
- package/lib/component/workspaces/process1D.d.ts +2 -0
- package/lib/component/workspaces/process1D.js +43 -0
- package/lib/data/constants/DefaultPathLengths.d.ts +6 -0
- package/lib/data/constants/DefaultPathLengths.js +8 -0
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +4 -0
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +7 -19
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +11 -0
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +11 -0
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +9 -0
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +7 -0
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +29 -0
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +13 -0
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +14 -0
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
- package/lib/data/migration/MigrationManager.js +3 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib-cjs/component/1d/Integral.js +1 -6
- package/lib-cjs/component/1d/Viewer1D.js +4 -4
- package/lib-cjs/component/1d/ranges/RangeIntegral.js +2 -6
- package/lib-cjs/component/1d/utilities/scale.js +7 -6
- package/lib-cjs/component/2d/Viewer2D.js +4 -4
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +98 -81
- package/lib-cjs/component/NMRium.js +10 -10
- package/lib-cjs/component/elements/Tab/Tab.js +1 -0
- package/lib-cjs/component/header/Header.js +13 -10
- package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -1
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +13 -0
- package/lib-cjs/component/hooks/useIntegralPath.js +56 -0
- package/lib-cjs/component/hooks/useToolsFunctions.js +6 -6
- package/lib-cjs/component/hooks/useXScale.js +11 -0
- package/lib-cjs/component/loader/DropZone.js +88 -88
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
- package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +77 -0
- package/lib-cjs/component/modal/editZone/EditZoneModal.js +101 -0
- package/lib-cjs/component/modal/editZone/SignalFormTab.js +11 -0
- package/lib-cjs/component/modal/editZone/SignalsForm.js +67 -0
- package/lib-cjs/component/modal/editZone/validation/EditZoneValidation.js +38 -0
- package/lib-cjs/component/modal/editZone/validation/isDefaultPathLength.js +12 -0
- package/lib-cjs/component/modal/setting/ControllersTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +12 -8
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +18 -0
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +43 -0
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +3 -16
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +1 -1
- package/lib-cjs/component/panels/Panels.js +11 -15
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +0 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +4 -13
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +4 -17
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +7 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -8
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +4 -5
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +21 -25
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +43 -30
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +94 -0
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +38 -41
- package/lib-cjs/component/panels/SummaryPanel/utilities/IsInView.js +18 -0
- package/lib-cjs/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +157 -19
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +24 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +12 -7
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -17
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +5 -2
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +0 -3
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +3 -16
- package/lib-cjs/component/reducer/IgnoreActions.js +2 -1
- package/lib-cjs/component/reducer/Reducer.js +7 -8
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +2 -2
- package/lib-cjs/component/reducer/actions/DomainActions.js +21 -1
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +2 -0
- package/lib-cjs/component/reducer/actions/LoadActions.js +22 -1
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +0 -2
- package/lib-cjs/component/reducer/actions/RangesActions.js +2 -0
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +2 -2
- package/lib-cjs/component/reducer/actions/ToolsActions.js +50 -63
- package/lib-cjs/component/reducer/actions/ZonesActions.js +35 -2
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +55 -73
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib-cjs/component/reducer/preferencesReducer.js +87 -37
- package/lib-cjs/component/reducer/types/Types.js +6 -4
- package/lib-cjs/component/toolbar/FunctionToolBar.js +7 -10
- package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
- package/lib-cjs/component/workspaces/Workspace.js +2 -0
- package/lib-cjs/component/workspaces/basic.js +48 -0
- package/lib-cjs/component/workspaces/exercise1D.js +48 -0
- package/lib-cjs/component/workspaces/index.js +6 -0
- package/lib-cjs/component/workspaces/process1D.js +46 -0
- package/lib-cjs/data/constants/DefaultPathLengths.js +10 -0
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +8 -0
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +7 -19
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +18 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +36 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +21 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
- package/lib-cjs/data/migration/MigrationManager.js +3 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +15 -16
- package/lib/component/1d/utilities/useIntegralPath.js +0 -63
- package/lib/component/nmriumMode/basic.d.ts +0 -38
- package/lib/component/nmriumMode/basic.js +0 -37
- package/lib/component/nmriumMode/exercise1D.d.ts +0 -38
- package/lib/component/nmriumMode/exercise1D.js +0 -37
- package/lib/component/nmriumMode/process1D.d.ts +0 -38
- package/lib/component/nmriumMode/process1D.js +0 -37
- package/lib/component/panels/SummaryPanel/Utilities.d.ts +0 -25
- package/lib/component/reducer/actions/Zoom.d.ts +0 -16
- package/lib/component/reducer/actions/Zoom.js +0 -92
- package/lib-cjs/component/1d/utilities/useIntegralPath.js +0 -66
- package/lib-cjs/component/nmriumMode/basic.js +0 -39
- package/lib-cjs/component/nmriumMode/exercise1D.js +0 -39
- package/lib-cjs/component/nmriumMode/process1D.js +0 -39
- package/lib-cjs/component/reducer/actions/Zoom.js +0 -116
|
@@ -10,19 +10,13 @@ const Concatenation_1 = require("../../../../data/utilities/Concatenation");
|
|
|
10
10
|
const FindUtilities_1 = require("../../../../data/utilities/FindUtilities");
|
|
11
11
|
const ContextMenu_1 = __importDefault(require("../../../elements/ContextMenu"));
|
|
12
12
|
const EditableColumn_1 = __importDefault(require("../../../elements/EditableColumn"));
|
|
13
|
-
const Select_1 = __importDefault(require("../../../elements/Select"));
|
|
14
13
|
const Modal_1 = require("../../../elements/popup/Modal");
|
|
15
14
|
const highlight_1 = require("../../../highlight");
|
|
15
|
+
const IsInView_1 = __importDefault(require("../utilities/IsInView"));
|
|
16
|
+
const Utilities_1 = require("../utilities/Utilities");
|
|
16
17
|
const AdditionalColumnField_1 = __importDefault(require("./AdditionalColumnField"));
|
|
17
|
-
const Constants_1 = require("./Constants");
|
|
18
18
|
const EditLinkModal_1 = __importDefault(require("./editLink/EditLinkModal"));
|
|
19
|
-
|
|
20
|
-
marginLeft: 2,
|
|
21
|
-
marginRight: 2,
|
|
22
|
-
border: 'none',
|
|
23
|
-
height: '20px',
|
|
24
|
-
};
|
|
25
|
-
function CorrelationTableRow({ additionalColumnData, correlations, correlation, styleRow, styleLabel, onSaveEditEquivalences, onChangeHybridization, onSaveEditProtonsCount, onEditCorrelationTableCellHandler, spectraData, }) {
|
|
19
|
+
function CorrelationTableRow({ additionalColumnData, correlations, correlation, styleRow, styleLabel, onSaveEditEquivalences, onSaveEditNumericValues, onEditCorrelationTableCellHandler, spectraData, }) {
|
|
26
20
|
const contextRef = (0, react_1.useRef)();
|
|
27
21
|
const modal = (0, Modal_1.useModal)();
|
|
28
22
|
const highlightIDsRow = (0, react_1.useMemo)(() => {
|
|
@@ -46,9 +40,13 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
46
40
|
const onSaveEquivalencesHandler = (0, react_1.useCallback)((e) => {
|
|
47
41
|
onSaveEditEquivalences(correlation, e.target.value);
|
|
48
42
|
}, [correlation, onSaveEditEquivalences]);
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
const onSaveEditNumericValuesHandler = (0, react_1.useCallback)((e, key) => {
|
|
44
|
+
onSaveEditNumericValues({
|
|
45
|
+
correlation,
|
|
46
|
+
values: (0, Utilities_1.convertValuesString)(e.target.value, key),
|
|
47
|
+
key,
|
|
48
|
+
});
|
|
49
|
+
}, [correlation, onSaveEditNumericValues]);
|
|
52
50
|
const additionalColumnFields = (0, react_1.useMemo)(() => {
|
|
53
51
|
return additionalColumnData.map((_correlation) => {
|
|
54
52
|
const commonLinks = [];
|
|
@@ -80,9 +78,6 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
80
78
|
onEditCorrelationTableCellHandler,
|
|
81
79
|
spectraData,
|
|
82
80
|
]);
|
|
83
|
-
const onChangeHybridizationHandler = (0, react_1.useCallback)((value) => {
|
|
84
|
-
onChangeHybridization(correlation, value);
|
|
85
|
-
}, [correlation, onChangeHybridization]);
|
|
86
81
|
const equivalenceCellStyle = (0, react_1.useMemo)(() => {
|
|
87
82
|
return correlation.edited.equivalence
|
|
88
83
|
? { color: 'blue' }
|
|
@@ -98,11 +93,16 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
98
93
|
event.currentTarget.blur();
|
|
99
94
|
highlightRow.hide();
|
|
100
95
|
}, [highlightRow]);
|
|
96
|
+
const isInView = (0, IsInView_1.default)({ correlation });
|
|
101
97
|
const tableDataProps = (0, react_1.useMemo)(() => {
|
|
102
98
|
return {
|
|
103
99
|
style: {
|
|
104
100
|
...styleRow,
|
|
105
|
-
backgroundColor: highlightRow.isActive
|
|
101
|
+
backgroundColor: highlightRow.isActive
|
|
102
|
+
? '#ff6f0057'
|
|
103
|
+
: isInView
|
|
104
|
+
? '#f5f5dc'
|
|
105
|
+
: 'inherit',
|
|
106
106
|
},
|
|
107
107
|
title: correlation.pseudo === false &&
|
|
108
108
|
correlation.link
|
|
@@ -122,6 +122,7 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
122
122
|
correlation.link,
|
|
123
123
|
correlation.pseudo,
|
|
124
124
|
highlightRow.isActive,
|
|
125
|
+
isInView,
|
|
125
126
|
mouseEnterHandler,
|
|
126
127
|
mouseLeaveHandler,
|
|
127
128
|
styleRow,
|
|
@@ -185,16 +186,11 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
|
|
|
185
186
|
}
|
|
186
187
|
}, children: [(0, nmr_correlation_1.getLabel)(correlations, correlation), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { ref: contextRef, context: contextMenu }, void 0)] }, void 0), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: (0, nmr_correlation_1.getCorrelationDelta)(correlation)
|
|
187
188
|
? (0, nmr_correlation_1.getCorrelationDelta)(correlation)?.toFixed(2)
|
|
188
|
-
: '' }, void 0), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.pseudo === false ? (correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler }, void 0)) : ((0, jsx_runtime_1.jsx)("text", { style: equivalenceCellStyle, children: correlation.equivalence }, void 0))) : ('') }, void 0), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave:
|
|
189
|
+
: '' }, void 0), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.pseudo === false ? (correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler }, void 0)) : ((0, jsx_runtime_1.jsx)("text", { style: equivalenceCellStyle, children: correlation.equivalence }, void 0))) : ('') }, void 0), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount') }, void 0)) : ('') }, void 0), (0, jsx_runtime_1.jsx)("td", { title: t, ...{
|
|
189
190
|
...otherTableDataProps,
|
|
190
191
|
style: { ...tableDataProps.style, borderRight: '1px solid' },
|
|
191
|
-
}, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
backgroundColor: correlation.edited.hybridization
|
|
195
|
-
? 'inherit'
|
|
196
|
-
: styleRow.backgroundColor,
|
|
197
|
-
width: '50px',
|
|
198
|
-
} }, void 0)) : ('') }, void 0), additionalColumnFields] }, void 0));
|
|
192
|
+
}, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.hybridization
|
|
193
|
+
.map((hybrid) => `sp${hybrid}`)
|
|
194
|
+
.join(','), style: correlation.edited.hybridization ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'hybridization') }, void 0)) : ('') }, void 0), additionalColumnFields] }, void 0));
|
|
199
195
|
}
|
|
200
196
|
exports.default = CorrelationTableRow;
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
23
|
};
|
|
@@ -9,20 +28,21 @@ const react_1 = require("@emotion/react");
|
|
|
9
28
|
const nmr_correlation_1 = require("nmr-correlation");
|
|
10
29
|
const react_2 = require("react");
|
|
11
30
|
const CloseButton_1 = __importDefault(require("../../../../elements/CloseButton"));
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
31
|
+
const Tab_1 = __importDefault(require("../../../../elements/Tab/Tab"));
|
|
32
|
+
const Tabs_1 = __importStar(require("../../../../elements/Tab/Tabs"));
|
|
33
|
+
const Utilities_1 = require("../../utilities/Utilities");
|
|
15
34
|
const Confirmation_1 = __importDefault(require("./Confirmation"));
|
|
35
|
+
const EditPathLength_1 = __importDefault(require("./EditPathLength"));
|
|
16
36
|
const MoveLink_1 = __importDefault(require("./MoveLink"));
|
|
17
37
|
const modalContainer = (0, react_1.css) `
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
height: 230px;
|
|
38
|
+
width: 490px;
|
|
39
|
+
height: 220px;
|
|
21
40
|
padding: 5px;
|
|
22
41
|
|
|
23
42
|
button:focus {
|
|
24
43
|
outline: none;
|
|
25
44
|
}
|
|
45
|
+
|
|
26
46
|
.header {
|
|
27
47
|
height: 24px;
|
|
28
48
|
border-bottom: 1px solid #f0f0f0;
|
|
@@ -66,14 +86,15 @@ const modalContainer = (0, react_1.css) `
|
|
|
66
86
|
background-color: gray;
|
|
67
87
|
}
|
|
68
88
|
|
|
69
|
-
.
|
|
70
|
-
margin-top: 10px;
|
|
89
|
+
.tabs-container {
|
|
71
90
|
width: 100%;
|
|
72
|
-
|
|
91
|
+
flex: 1;
|
|
92
|
+
overflow: auto;
|
|
93
|
+
border: none;
|
|
73
94
|
}
|
|
74
95
|
`;
|
|
75
96
|
function EditLinkModal({ correlationDim1, correlationDim2, link, correlations, onClose, onEdit, }) {
|
|
76
|
-
const [
|
|
97
|
+
const [activeTab, setActiveTab] = (0, react_2.useState)('move');
|
|
77
98
|
const getLinkLabel = (0, react_2.useCallback)(() => {
|
|
78
99
|
const linkDim = (0, nmr_correlation_1.getLinkDim)(link);
|
|
79
100
|
if (linkDim === 1) {
|
|
@@ -84,38 +105,30 @@ function EditLinkModal({ correlationDim1, correlationDim2, link, correlations, o
|
|
|
84
105
|
}
|
|
85
106
|
return '';
|
|
86
107
|
}, [correlationDim1.label.origin, link, correlationDim2]);
|
|
87
|
-
const handleOnEdit = (0, react_2.useCallback)((action,
|
|
108
|
+
const handleOnEdit = (0, react_2.useCallback)((action, selectedCorrelationIdDim1, selectedCorrelationIdDim2, editedLink) => {
|
|
88
109
|
const { editedCorrelations, buildCorrelationDataOptions } = (0, Utilities_1.getEditedCorrelations)({
|
|
89
110
|
correlationDim1,
|
|
90
111
|
correlationDim2,
|
|
91
|
-
|
|
92
|
-
|
|
112
|
+
selectedCorrelationIdDim1,
|
|
113
|
+
selectedCorrelationIdDim2,
|
|
93
114
|
action,
|
|
94
|
-
link,
|
|
115
|
+
link: editedLink || link,
|
|
95
116
|
correlations,
|
|
96
117
|
});
|
|
97
|
-
onEdit(editedCorrelations, action, link, buildCorrelationDataOptions);
|
|
118
|
+
onEdit(editedCorrelations, action, editedLink || link, buildCorrelationDataOptions);
|
|
98
119
|
onClose?.();
|
|
99
120
|
}, [correlationDim1, correlationDim2, correlations, link, onClose, onEdit]);
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return ((0, jsx_runtime_1.jsx)(MoveLink_1.default, { correlationDim1: correlationDim1, correlationDim2: correlationDim2, link: link, correlations: correlations, onEdit: handleOnEdit }, void 0));
|
|
106
|
-
case 'unmove':
|
|
107
|
-
return ((0, jsx_runtime_1.jsx)(Confirmation_1.default, { description: "Movement of signal to its original place.", onConfirm: () => handleOnEdit('unmove', correlationDim1.id, correlationDim2.id) }, void 0));
|
|
108
|
-
default:
|
|
109
|
-
return null;
|
|
110
|
-
}
|
|
111
|
-
}, [
|
|
121
|
+
const tabsContainer = (0, react_2.useMemo)(() => ((0, jsx_runtime_1.jsx)("div", { className: "tabs-container", children: (0, jsx_runtime_1.jsxs)(Tabs_1.default, { position: Tabs_1.PositionsEnum.TOP, activeTab: activeTab, onClick: (tab) => setActiveTab(tab.tabid), children: [(0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Move", tabid: 'move', children: (0, jsx_runtime_1.jsx)(MoveLink_1.default, { correlationDim1: correlationDim1, correlationDim2: correlationDim2, link: link, correlations: correlations, onEdit: (correlationIdDim1, correlationIdDim2) => handleOnEdit('move', correlationIdDim1, correlationIdDim2) }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Unmove", tabid: "unmove", children: (0, jsx_runtime_1.jsx)(Confirmation_1.default, { description: "Movement of signal to its original place.", onConfirm: () => handleOnEdit('unmove', correlationDim1.id, correlationDim2.id) }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Remove", tabid: 'remove', children: (0, jsx_runtime_1.jsx)(Confirmation_1.default, { description: "Deletion of signal.", onConfirm: () => handleOnEdit('remove', undefined, undefined) }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "J Coupling", tabid: 'setPathLength', children: (0, jsx_runtime_1.jsx)(EditPathLength_1.default, { signal: link.signal, experimentType: link.experimentType, onEdit: (editedSignal) => {
|
|
122
|
+
const editedLink = { ...link, signal: editedSignal };
|
|
123
|
+
handleOnEdit('setPathLength', correlationDim1, correlationDim2, editedLink);
|
|
124
|
+
} }, void 0) }, void 0)] }, void 0) }, void 0)), [
|
|
125
|
+
activeTab,
|
|
112
126
|
correlationDim1,
|
|
113
127
|
correlationDim2,
|
|
114
128
|
correlations,
|
|
115
|
-
link,
|
|
116
129
|
handleOnEdit,
|
|
117
|
-
|
|
130
|
+
link,
|
|
118
131
|
]);
|
|
119
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: modalContainer, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose }, void 0), (0, jsx_runtime_1.jsx)("p", { className: "header-info", children: `${link.experimentType.toUpperCase()} signal at ${getLinkLabel()}` }, void 0)] }, void 0),
|
|
132
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: modalContainer, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose }, void 0), (0, jsx_runtime_1.jsx)("p", { className: "header-info", children: `${link.experimentType.toUpperCase()} signal at ${getLinkLabel()}` }, void 0)] }, void 0), tabsContainer] }, void 0));
|
|
120
133
|
}
|
|
121
134
|
exports.default = EditLinkModal;
|
|
@@ -0,0 +1,94 @@
|
|
|
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 react_2 = require("react");
|
|
10
|
+
const DefaultPathLengths_1 = __importDefault(require("../../../../../data/constants/DefaultPathLengths"));
|
|
11
|
+
const Button_1 = __importDefault(require("../../../../elements/Button"));
|
|
12
|
+
const Input_1 = __importDefault(require("../../../../elements/Input"));
|
|
13
|
+
const Label_1 = __importDefault(require("../../../../elements/Label"));
|
|
14
|
+
const editPathLengthsStyles = (0, react_1.css) `
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
margin-top: 10px;
|
|
18
|
+
text-align: center;
|
|
19
|
+
|
|
20
|
+
.input-container {
|
|
21
|
+
width: 100%;
|
|
22
|
+
margin-top: 5px;
|
|
23
|
+
text-align: center;
|
|
24
|
+
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
button {
|
|
32
|
+
flex: 2;
|
|
33
|
+
padding: 5px;
|
|
34
|
+
border: 1px solid gray;
|
|
35
|
+
border-radius: 5px;
|
|
36
|
+
height: 30px;
|
|
37
|
+
margin: 0 auto;
|
|
38
|
+
margin-top: 15px;
|
|
39
|
+
display: block;
|
|
40
|
+
width: 60px;
|
|
41
|
+
|
|
42
|
+
color: white;
|
|
43
|
+
background-color: gray;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.warning {
|
|
47
|
+
margin-top: 5px;
|
|
48
|
+
color: red;
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
function EditPathLength({ signal, experimentType, onEdit }) {
|
|
52
|
+
const [from, setFrom] = (0, react_2.useState)(signal.j?.pathLength !== undefined
|
|
53
|
+
? signal.j.pathLength.from
|
|
54
|
+
: DefaultPathLengths_1.default[experimentType]?.from || 0);
|
|
55
|
+
const [to, setTo] = (0, react_2.useState)(signal.j?.pathLength !== undefined
|
|
56
|
+
? signal.j.pathLength.to
|
|
57
|
+
: DefaultPathLengths_1.default[experimentType]?.to || 0);
|
|
58
|
+
const [isError, setIsError] = (0, react_2.useState)(false);
|
|
59
|
+
const handleOnEdit = (0, react_2.useCallback)(() => {
|
|
60
|
+
const pathLength = {
|
|
61
|
+
from,
|
|
62
|
+
to,
|
|
63
|
+
};
|
|
64
|
+
const editedSignal = {
|
|
65
|
+
...signal,
|
|
66
|
+
j: {
|
|
67
|
+
...signal.j,
|
|
68
|
+
pathLength,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
onEdit(editedSignal);
|
|
72
|
+
}, [to, from, onEdit, signal]);
|
|
73
|
+
(0, react_2.useEffect)(() => {
|
|
74
|
+
setIsError(from <= 0 || from > to);
|
|
75
|
+
}, [to, from]);
|
|
76
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: editPathLengthsStyles, children: [(0, jsx_runtime_1.jsx)("p", { children: "Setting of the minimum and maximum path length (J coupling)." }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "input-container", children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Min:", style: {
|
|
77
|
+
label: {
|
|
78
|
+
marginRight: '5px',
|
|
79
|
+
fontSize: '14px',
|
|
80
|
+
fontWeight: 'normal',
|
|
81
|
+
},
|
|
82
|
+
}, children: (0, jsx_runtime_1.jsx)(Input_1.default, { type: "number", value: from, onChange: (e) => {
|
|
83
|
+
setFrom(Number(e.target.value));
|
|
84
|
+
}, style: { input: { color: isError ? 'red' : 'black' } } }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Max:", style: {
|
|
85
|
+
label: {
|
|
86
|
+
marginRight: '5px',
|
|
87
|
+
fontSize: '14px',
|
|
88
|
+
fontWeight: 'normal',
|
|
89
|
+
},
|
|
90
|
+
}, children: (0, jsx_runtime_1.jsx)(Input_1.default, { type: "number", value: to, onChange: (e) => {
|
|
91
|
+
setTo(Number(e.target.value));
|
|
92
|
+
} }, void 0) }, void 0)] }, void 0), isError ? ((0, jsx_runtime_1.jsxs)("p", { className: "warning", children: ["Minimum must not be 0 or higher than the maximum value.", ' '] }, void 0)) : ((0, jsx_runtime_1.jsx)(Button_1.default, { type: "button", onClick: handleOnEdit, disabled: isError, children: "Set" }, void 0))] }, void 0));
|
|
93
|
+
}
|
|
94
|
+
exports.default = EditPathLength;
|
|
@@ -80,6 +80,6 @@ function MoveLink({ correlationDim1, correlationDim2, link, correlations, onEdit
|
|
|
80
80
|
border: '1px solid grey',
|
|
81
81
|
} }, void 0));
|
|
82
82
|
}, [correlationDim1, correlationDim2, correlations, link.atomType]);
|
|
83
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: moveLinkStyles, children: [(0, jsx_runtime_1.jsx)("p", { children: "Move of signals on either one or both axes." }, void 0), (0, jsx_runtime_1.jsx)("p", { children: "\"New\" means to separate into a new row or column." }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "selection-container", children: [getSelection(correlationDim1, 0), correlationDim2 && getSelection(correlationDim2, 1)] }, void 0), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => onEdit(
|
|
83
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: moveLinkStyles, children: [(0, jsx_runtime_1.jsx)("p", { children: "Move of signals on either one or both axes." }, void 0), (0, jsx_runtime_1.jsx)("p", { children: "\"New\" means to separate into a new row or column." }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "selection-container", children: [getSelection(correlationDim1, 0), correlationDim2 && getSelection(correlationDim2, 1)] }, void 0), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => onEdit(selectedCorrelationIdDim1, selectedCorrelationIdDim2), children: "Move" }, void 0)] }, void 0));
|
|
84
84
|
}
|
|
85
85
|
exports.default = MoveLink;
|
|
@@ -23,7 +23,7 @@ const CorrelationTable_1 = __importDefault(require("./CorrelationTable/Correlati
|
|
|
23
23
|
const Overview_1 = __importDefault(require("./Overview"));
|
|
24
24
|
const SetMolecularFormulaModal_1 = __importDefault(require("./SetMolecularFormulaModal"));
|
|
25
25
|
const SetShiftTolerancesModal_1 = __importDefault(require("./SetShiftTolerancesModal"));
|
|
26
|
-
const Utilities_1 = require("./Utilities");
|
|
26
|
+
const Utilities_1 = require("./utilities/Utilities");
|
|
27
27
|
const panelStyle = (0, react_1.css) `
|
|
28
28
|
display: flex;
|
|
29
29
|
flex-direction: column;
|
|
@@ -197,51 +197,20 @@ function SummaryPanel() {
|
|
|
197
197
|
correlation: {
|
|
198
198
|
...correlation,
|
|
199
199
|
equivalence: value,
|
|
200
|
-
edited: { ...correlation.edited, equivalence:
|
|
200
|
+
edited: { ...correlation.edited, equivalence: value !== 1 },
|
|
201
201
|
},
|
|
202
202
|
},
|
|
203
203
|
});
|
|
204
204
|
}, [dispatch]);
|
|
205
|
-
const
|
|
206
|
-
let values;
|
|
207
|
-
if (/^(?:[0-9],{0,1})+$/g.test(valuesString)) {
|
|
208
|
-
// allow digits followed by optional comma only
|
|
209
|
-
values = valuesString
|
|
210
|
-
.split(',')
|
|
211
|
-
.filter((char) => char.length > 0)
|
|
212
|
-
.map((char) => Number(char));
|
|
213
|
-
}
|
|
214
|
-
else if (valuesString.trim().length === 0) {
|
|
215
|
-
// set values to default
|
|
216
|
-
values = [];
|
|
217
|
-
}
|
|
218
|
-
if (values) {
|
|
219
|
-
// ignore not supported text input
|
|
220
|
-
dispatch({
|
|
221
|
-
type: Types_1.SET_CORRELATION,
|
|
222
|
-
payload: {
|
|
223
|
-
id: correlation.id,
|
|
224
|
-
correlation: {
|
|
225
|
-
...correlation,
|
|
226
|
-
protonsCount: values,
|
|
227
|
-
edited: { ...correlation.edited, protonsCount: true },
|
|
228
|
-
},
|
|
229
|
-
options: {
|
|
230
|
-
skipDataUpdate: true,
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
}, [dispatch]);
|
|
236
|
-
const changeHybridizationSaveHandler = (0, react_2.useCallback)((correlation, value) => {
|
|
205
|
+
const editNumericValuesSaveHandler = (0, react_2.useCallback)(({ correlation, values, key, }) => {
|
|
237
206
|
dispatch({
|
|
238
207
|
type: Types_1.SET_CORRELATION,
|
|
239
208
|
payload: {
|
|
240
209
|
id: correlation.id,
|
|
241
210
|
correlation: {
|
|
242
211
|
...correlation,
|
|
243
|
-
|
|
244
|
-
edited: { ...correlation.edited,
|
|
212
|
+
[key]: values,
|
|
213
|
+
edited: { ...correlation.edited, [key]: true },
|
|
245
214
|
},
|
|
246
215
|
options: {
|
|
247
216
|
skipDataUpdate: true,
|
|
@@ -299,20 +268,48 @@ function SummaryPanel() {
|
|
|
299
268
|
});
|
|
300
269
|
}
|
|
301
270
|
}, [assignmentData, dispatch, spectraData]);
|
|
271
|
+
const changeSignalPathLengthHandler = (0, react_2.useCallback)((link) => {
|
|
272
|
+
const linkDim = (0, nmr_correlation_1.getLinkDim)(link);
|
|
273
|
+
if (linkDim === 2) {
|
|
274
|
+
const spectrum = (0, FindUtilities_1.findSpectrum)(spectraData, link.experimentID, false);
|
|
275
|
+
const zone = (0, FindUtilities_1.findZone)(spectrum, link.signal.id);
|
|
276
|
+
const signal = (0, FindUtilities_1.findSignal2D)(spectrum, link.signal.id);
|
|
277
|
+
dispatch({
|
|
278
|
+
type: Types_1.SET_2D_SIGNAL_PATH_LENGTH,
|
|
279
|
+
payload: {
|
|
280
|
+
spectrum,
|
|
281
|
+
zone,
|
|
282
|
+
signal,
|
|
283
|
+
pathLength: link.signal.j?.pathLength,
|
|
284
|
+
},
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}, [dispatch, spectraData]);
|
|
302
288
|
const editCorrelationTableCellHandler = (0, react_2.useCallback)((editedCorrelations, action, link, options) => {
|
|
303
289
|
if (action === 'add' ||
|
|
304
290
|
action === 'move' ||
|
|
305
291
|
action === 'remove' ||
|
|
306
|
-
action === 'unmove'
|
|
307
|
-
|
|
308
|
-
|
|
292
|
+
action === 'unmove' ||
|
|
293
|
+
action === 'setPathLength') {
|
|
294
|
+
if (link && link.pseudo === false) {
|
|
295
|
+
if (action === 'remove') {
|
|
296
|
+
deleteSignalHandler(link);
|
|
297
|
+
}
|
|
298
|
+
else if (action === 'setPathLength') {
|
|
299
|
+
changeSignalPathLengthHandler(link);
|
|
300
|
+
}
|
|
309
301
|
}
|
|
310
302
|
setCorrelationsHandler(editedCorrelations, options);
|
|
311
303
|
}
|
|
312
304
|
else if (action === 'removeAll') {
|
|
313
305
|
deleteCorrelationHandler(editedCorrelations[0]);
|
|
314
306
|
}
|
|
315
|
-
}, [
|
|
307
|
+
}, [
|
|
308
|
+
changeSignalPathLengthHandler,
|
|
309
|
+
deleteCorrelationHandler,
|
|
310
|
+
deleteSignalHandler,
|
|
311
|
+
setCorrelationsHandler,
|
|
312
|
+
]);
|
|
316
313
|
const handleOnFilter = (0, react_2.useCallback)(() => {
|
|
317
314
|
setFilterIsActive(!filterIsActive);
|
|
318
315
|
}, [filterIsActive]);
|
|
@@ -331,6 +328,6 @@ function SummaryPanel() {
|
|
|
331
328
|
width: '70px',
|
|
332
329
|
height: '18px',
|
|
333
330
|
border: '1px solid grey',
|
|
334
|
-
} }, void 0)] }, void 0) }, void 0)] }, void 0)] }, void 0), (0, jsx_runtime_1.jsx)(CorrelationTable_1.default, { correlationsData: correlationsData, filteredCorrelationsData: filteredCorrelationsData, additionalColumnData: additionalColumnData, editEquivalencesSaveHandler: editEquivalencesSaveHandler,
|
|
331
|
+
} }, void 0)] }, void 0) }, void 0)] }, void 0)] }, void 0), (0, jsx_runtime_1.jsx)(CorrelationTable_1.default, { correlationsData: correlationsData, filteredCorrelationsData: filteredCorrelationsData, additionalColumnData: additionalColumnData, editEquivalencesSaveHandler: editEquivalencesSaveHandler, onSaveEditNumericValues: editNumericValuesSaveHandler, onEditCorrelationTableCellHandler: editCorrelationTableCellHandler, showProtonsAsRows: showProtonsAsRows, spectraData: spectraData }, void 0)] }, void 0));
|
|
335
332
|
}
|
|
336
333
|
exports.default = (0, react_2.memo)(SummaryPanel);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const ChartContext_1 = require("../../../context/ChartContext");
|
|
5
|
+
const Utilities_1 = require("./Utilities");
|
|
6
|
+
function IsInView({ correlation }) {
|
|
7
|
+
const { data: spectraData, xDomain, yDomain, displayerMode, activeTab, activeSpectrum, } = (0, ChartContext_1.useChartData)();
|
|
8
|
+
return (0, react_1.useMemo)(() => (0, Utilities_1.isInView)(spectraData, activeTab, activeSpectrum, xDomain, yDomain, displayerMode, correlation), [
|
|
9
|
+
activeSpectrum,
|
|
10
|
+
activeTab,
|
|
11
|
+
correlation,
|
|
12
|
+
displayerMode,
|
|
13
|
+
spectraData,
|
|
14
|
+
xDomain,
|
|
15
|
+
yDomain,
|
|
16
|
+
]);
|
|
17
|
+
}
|
|
18
|
+
exports.default = IsInView;
|