nmrium 0.24.0 → 0.26.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/IntegralResizable.js +13 -13
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +30 -31
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +5 -5
- package/lib/component/1d/ranges/Range.js +24 -33
- package/lib/component/2d/zones/Signal.js +8 -8
- package/lib/component/2d/zones/Zone.js +3 -3
- package/lib/component/EventsTrackers/KeysListenerTracker.js +1 -1
- package/lib/component/NMRium.js +22 -29
- package/lib/component/assignment/AssignmentsContext.d.ts +35 -0
- package/lib/component/assignment/AssignmentsContext.js +83 -0
- package/lib/component/assignment/AssignmentsReducer.d.ts +32 -0
- package/lib/component/assignment/AssignmentsReducer.js +39 -0
- package/lib/component/assignment/actions/initAssignment.d.ts +5 -0
- package/lib/component/assignment/actions/initAssignment.js +62 -0
- package/lib/component/assignment/actions/removeAssignment.d.ts +16 -0
- package/lib/component/assignment/actions/removeAssignment.js +24 -0
- package/lib/component/assignment/actions/setActiveAssignment.d.ts +10 -0
- package/lib/component/assignment/actions/setActiveAssignment.js +8 -0
- package/lib/component/assignment/actions/toggleAssignment.d.ts +7 -0
- package/lib/component/assignment/actions/toggleAssignment.js +44 -0
- package/lib/component/assignment/index.d.ts +0 -18
- package/lib/component/assignment/index.js +12 -266
- package/lib/component/assignment/utilities/filterForIDsWithAssignment.d.ts +2 -0
- package/lib/component/assignment/utilities/filterForIDsWithAssignment.js +3 -0
- package/lib/component/context/GlobalContext.d.ts +12 -3
- package/lib/component/context/GlobalContext.js +1 -1
- package/lib/component/elements/ActionButtons.d.ts +10 -0
- package/lib/component/elements/ActionButtons.js +14 -0
- package/lib/component/elements/Button.d.ts +30 -5
- package/lib/component/elements/Button.js +151 -4
- package/lib/component/elements/ContextMenu.js +6 -6
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +5 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +38 -10
- package/lib/component/elements/ReactTable/ReactTable.d.ts +3 -1
- package/lib/component/elements/ReactTable/ReactTable.js +7 -2
- package/lib/component/elements/ReactTable/Style.d.ts +1 -3
- package/lib/component/elements/ReactTable/Style.js +1 -7
- package/lib/component/elements/ToolTip/ToolTip.js +3 -2
- package/lib/component/elements/resizer/DivResizer.d.ts +2 -0
- package/lib/component/elements/resizer/DivResizer.js +107 -0
- package/lib/component/elements/resizer/Resizer.d.ts +18 -0
- package/lib/component/elements/resizer/Resizer.js +12 -0
- package/lib/component/elements/resizer/SVGResizer.d.ts +2 -0
- package/lib/component/elements/resizer/SVGResizer.js +71 -0
- package/lib/component/elements/resizer/useDraggable.d.ts +19 -0
- package/lib/component/elements/resizer/useDraggable.js +52 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.js +4 -15
- package/lib/component/header/BaseLineCorrectionPanel.js +2 -9
- package/lib/component/header/ManualPhaseCorrectionPanel.js +2 -9
- package/lib/component/header/RangesPickingOptionPanel.js +3 -16
- package/lib/component/header/ZeroFillingOptionsPanel.js +2 -9
- package/lib/component/header/Zones2DOptionPanel.js +3 -14
- package/lib/component/hooks/useExport.js +11 -9
- package/lib/component/loader/DropZone.js +1 -0
- package/lib/component/modal/AlignSpectraModal.js +2 -1
- package/lib/component/modal/ExportAsMatrixModal.js +2 -1
- package/lib/component/modal/ImportPublicationStringModal.js +2 -1
- package/lib/component/modal/LoadJCAMPModal.js +7 -6
- package/lib/component/modal/ModalStyle.js +4 -26
- package/lib/component/modal/MoleculeStructureEditorModal.js +2 -1
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +2 -1
- package/lib/component/modal/PredictSpectraModal.js +2 -7
- package/lib/component/modal/SaveAsModal.d.ts +1 -1
- package/lib/component/modal/SaveAsModal.js +2 -1
- package/lib/component/modal/setting/FormattingTabContent.js +17 -11
- package/lib/component/modal/setting/GeneralSettings.js +3 -1
- package/lib/component/modal/setting/settingsValidation.d.ts +8 -0
- package/lib/component/modal/setting/settingsValidation.js +40 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +6 -4
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +4 -3
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +13 -6
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.d.ts +10 -0
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +60 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +11 -5
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +20 -11
- package/lib/component/panels/MoleculesPanel/Utilities.js +50 -68
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +2 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +55 -60
- package/lib/component/panels/RangesPanel/RangesHeader.js +2 -2
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +12 -11
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +16 -9
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -3
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +5 -18
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +5 -7
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +4 -8
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +5 -9
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +4 -4
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +4 -8
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +2 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +20 -20
- package/lib/component/panels/header/SpectraAutomaticPickingButton.d.ts +2 -0
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +30 -0
- package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -18
- package/lib/component/reducer/Reducer.d.ts +2 -0
- package/lib/component/reducer/Reducer.js +4 -1
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +9 -0
- package/lib/component/reducer/actions/AssignmentsActions.js +18 -0
- package/lib/component/reducer/actions/LoadActions.d.ts +1 -1
- package/lib/component/reducer/actions/LoadActions.js +10 -5
- package/lib/component/reducer/preferencesReducer.d.ts +1 -8
- package/lib/component/reducer/preferencesReducer.js +16 -16
- package/lib/component/reducer/types/Types.d.ts +1 -0
- package/lib/component/reducer/types/Types.js +1 -0
- package/lib/component/utility/Export.d.ts +3 -3
- package/lib/component/utility/Export.js +10 -9
- package/lib/component/utility/FormatNumber.js +1 -1
- package/lib/component/workspaces/Workspace.d.ts +2 -4
- package/lib/component/workspaces/basic.js +8 -9
- package/lib/data/SpectraManager.js +23 -15
- package/lib/data/data1d/Data1DManager.d.ts +1 -1
- package/lib/data/data1d/Data1DManager.js +2 -1
- package/lib/data/data1d/Spectrum1D/toJSON.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/toJSON.js +1 -0
- package/lib/data/data1d/database.d.ts +1 -2
- package/lib/data/data1d/database.js +1 -1
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +1 -4
- package/lib/data/data2d/Data2DManager.d.ts +1 -1
- package/lib/data/data2d/Data2DManager.js +2 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/toJSON.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/toJSON.js +1 -0
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data2d/Signal2DAxisData.d.ts +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/IntegralResizable.js +12 -12
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +29 -30
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +6 -6
- package/lib-cjs/component/1d/ranges/Range.js +26 -35
- package/lib-cjs/component/2d/zones/Signal.js +9 -9
- package/lib-cjs/component/2d/zones/Zone.js +4 -4
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +2 -2
- package/lib-cjs/component/NMRium.js +22 -29
- package/lib-cjs/component/assignment/AssignmentsContext.js +88 -0
- package/lib-cjs/component/assignment/AssignmentsReducer.js +45 -0
- package/lib-cjs/component/assignment/actions/initAssignment.js +65 -0
- package/lib-cjs/component/assignment/actions/removeAssignment.js +29 -0
- package/lib-cjs/component/assignment/actions/setActiveAssignment.js +11 -0
- package/lib-cjs/component/assignment/actions/toggleAssignment.js +47 -0
- package/lib-cjs/component/assignment/index.js +15 -269
- package/lib-cjs/component/assignment/utilities/filterForIDsWithAssignment.js +7 -0
- package/lib-cjs/component/context/GlobalContext.js +1 -1
- package/lib-cjs/component/elements/ActionButtons.js +20 -0
- package/lib-cjs/component/elements/Button.js +150 -4
- package/lib-cjs/component/elements/ContextMenu.js +6 -6
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +42 -14
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +7 -2
- package/lib-cjs/component/elements/ReactTable/Style.js +1 -9
- package/lib-cjs/component/elements/ToolTip/ToolTip.js +3 -2
- package/lib-cjs/component/elements/resizer/DivResizer.js +113 -0
- package/lib-cjs/component/elements/resizer/Resizer.js +18 -0
- package/lib-cjs/component/elements/resizer/SVGResizer.js +77 -0
- package/lib-cjs/component/elements/resizer/useDraggable.js +55 -0
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +3 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +2 -9
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +2 -9
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +2 -15
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -9
- package/lib-cjs/component/header/Zones2DOptionPanel.js +2 -13
- package/lib-cjs/component/hooks/useExport.js +11 -9
- package/lib-cjs/component/loader/DropZone.js +1 -0
- package/lib-cjs/component/modal/AlignSpectraModal.js +2 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -1
- package/lib-cjs/component/modal/ImportPublicationStringModal.js +2 -1
- package/lib-cjs/component/modal/LoadJCAMPModal.js +7 -6
- package/lib-cjs/component/modal/ModalStyle.js +4 -26
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +5 -1
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +2 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +2 -7
- package/lib-cjs/component/modal/SaveAsModal.js +2 -1
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +17 -11
- package/lib-cjs/component/modal/setting/GeneralSettings.js +3 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +66 -0
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +6 -4
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +13 -6
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +67 -0
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +12 -6
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +50 -68
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +55 -60
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +15 -14
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -16
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +4 -4
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +21 -21
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +37 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -18
- package/lib-cjs/component/reducer/Reducer.js +4 -1
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +21 -0
- package/lib-cjs/component/reducer/actions/LoadActions.js +9 -4
- package/lib-cjs/component/reducer/preferencesReducer.js +16 -16
- package/lib-cjs/component/reducer/types/Types.js +2 -1
- package/lib-cjs/component/utility/Export.js +10 -9
- package/lib-cjs/component/utility/FormatNumber.js +1 -1
- package/lib-cjs/component/workspaces/basic.js +8 -9
- package/lib-cjs/data/SpectraManager.js +23 -15
- package/lib-cjs/data/data1d/Data1DManager.js +2 -1
- package/lib-cjs/data/data1d/Spectrum1D/toJSON.js +1 -0
- package/lib-cjs/data/data2d/Data2DManager.js +2 -1
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/toJSON.js +1 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +25 -26
- package/lib/component/1d/Resizable.d.ts +0 -12
- package/lib/component/1d/Resizable.js +0 -105
- package/lib-cjs/component/1d/Resizable.js +0 -110
|
@@ -6,35 +6,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const Concatenation_1 = require("../../../data/utilities/Concatenation");
|
|
8
8
|
const checkModifierKeyActivated_1 = __importDefault(require("../../../data/utilities/checkModifierKeyActivated"));
|
|
9
|
-
const
|
|
9
|
+
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
10
|
+
const filterForIDsWithAssignment_1 = require("../../assignment/utilities/filterForIDsWithAssignment");
|
|
10
11
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
11
12
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
12
13
|
const highlight_1 = require("../../highlight");
|
|
13
14
|
const Constants_1 = require("../../reducer/core/Constants");
|
|
14
15
|
const Types_1 = require("../../reducer/types/Types");
|
|
15
16
|
const Utilities_1 = require("./Utilities");
|
|
16
|
-
function useAtomAssignment({ displayerMode, activeTab, zones, ranges, }) {
|
|
17
|
+
function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }) {
|
|
17
18
|
const alert = (0, Alert_1.useAlert)();
|
|
18
19
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
19
20
|
const highlightData = (0, highlight_1.useHighlightData)();
|
|
20
|
-
const
|
|
21
|
-
const activeAssignment = (0,
|
|
22
|
-
?
|
|
21
|
+
const assignments = (0, AssignmentsContext_1.useAssignmentData)();
|
|
22
|
+
const activeAssignment = (0, AssignmentsContext_1.useAssignment)(assignments.data.activated
|
|
23
|
+
? assignments.data.activated.id
|
|
23
24
|
: Concatenation_1.ConcatenationString);
|
|
24
25
|
const [onAtomHoverHighlights, setOnAtomHoverHighlights] = (0, react_1.useState)([]);
|
|
25
26
|
const [onAtomHoverAction, setOnAtomHoverAction] = (0, react_1.useState)(null);
|
|
26
|
-
const [elements, setElements] = (0, react_1.useState)([]);
|
|
27
|
-
(0, react_1.useEffect)(() => {
|
|
28
|
-
if (activeTab) {
|
|
29
|
-
const split = activeTab.split(',');
|
|
30
|
-
if (split.length === 1) {
|
|
31
|
-
setElements([activeTab.replace(/[0-9]/g, '')]);
|
|
32
|
-
}
|
|
33
|
-
else if (split.length === 2) {
|
|
34
|
-
setElements(split.map((nucleus) => nucleus.replace(/[0-9]/g, '')));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}, [activeTab]);
|
|
38
27
|
(0, react_1.useEffect)(() => {
|
|
39
28
|
if (onAtomHoverAction) {
|
|
40
29
|
if (onAtomHoverAction === 'show') {
|
|
@@ -68,23 +57,24 @@ function useAtomAssignment({ displayerMode, activeTab, zones, ranges, }) {
|
|
|
68
57
|
}, [displayerMode, ranges, zones]);
|
|
69
58
|
const assignedDiaIDs = (0, react_1.useMemo)(() => {
|
|
70
59
|
const assignedDiaID = { x: [], y: [] };
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
60
|
+
const assignment = assignments.data.assignments;
|
|
61
|
+
for (let id in assignment) {
|
|
62
|
+
if (assignment[id].x) {
|
|
63
|
+
assignedDiaID.x.push(...assignment[id].x);
|
|
74
64
|
}
|
|
75
|
-
if (
|
|
76
|
-
assignedDiaID.y.push(...
|
|
65
|
+
if (assignment[id].y) {
|
|
66
|
+
assignedDiaID.y.push(...assignment[id].y);
|
|
77
67
|
}
|
|
78
68
|
}
|
|
79
69
|
// with its structure it's prepared for showing assigned IDs per axis
|
|
80
70
|
return assignedDiaID;
|
|
81
|
-
}, [
|
|
71
|
+
}, [assignments.data]);
|
|
82
72
|
// used for atom highlighting for now, until we would like to highlight atoms per axis separately
|
|
83
73
|
const assignedDiaIDsMerged = (0, react_1.useMemo)(() => assignedDiaIDs.x.concat(assignedDiaIDs.y), [assignedDiaIDs.x, assignedDiaIDs.y]);
|
|
84
74
|
const currentDiaIDsToHighlight = (0, react_1.useMemo)(() => {
|
|
85
75
|
let highlights = [];
|
|
86
76
|
highlightData.highlight.highlighted.forEach((highlightID) => {
|
|
87
|
-
const temp =
|
|
77
|
+
const temp = assignments.data.assignments[highlightID];
|
|
88
78
|
if (temp) {
|
|
89
79
|
const { datum } = (0, Utilities_1.findDatumAndSignalIndex)(data, highlightID);
|
|
90
80
|
const type = highlightData.highlight.sourceData?.type;
|
|
@@ -92,56 +82,51 @@ function useAtomAssignment({ displayerMode, activeTab, zones, ranges, }) {
|
|
|
92
82
|
(type === highlight_1.HighlightedSource.ZONE || type === highlight_1.HighlightedSource.RANGE)) {
|
|
93
83
|
// we are on range/zone level only, so add the belonging signal IDs to highlight too
|
|
94
84
|
highlights = highlights.concat(datum.signals
|
|
95
|
-
.map((signal) => (0,
|
|
96
|
-
0
|
|
85
|
+
.map((signal) => (0, filterForIDsWithAssignment_1.filterForIDsWithAssignment)(assignments, [signal.id]).length > 0
|
|
97
86
|
? signal.diaIDs
|
|
98
87
|
: [])
|
|
99
88
|
.flat());
|
|
100
89
|
}
|
|
101
90
|
}
|
|
102
91
|
});
|
|
103
|
-
return (0, Utilities_1.getCurrentDiaIDsToHighlight)(
|
|
104
|
-
}, [
|
|
92
|
+
return (0, Utilities_1.getCurrentDiaIDsToHighlight)(assignments).concat(highlights);
|
|
93
|
+
}, [
|
|
94
|
+
assignments,
|
|
95
|
+
data,
|
|
96
|
+
highlightData.highlight.highlighted,
|
|
97
|
+
highlightData.highlight.sourceData?.type,
|
|
98
|
+
]);
|
|
105
99
|
const toggleAssignment = (0, react_1.useCallback)((diaID, atomInformation) => {
|
|
106
100
|
// a previous version of the code prevented to assign many time the same atom
|
|
107
101
|
// see revision cc13abc18f77b6787b923e3c4edaef51750d9e90
|
|
108
102
|
return (0, Utilities_1.toggleDiaIDs)(diaID, atomInformation);
|
|
109
103
|
}, []);
|
|
110
104
|
const handleOnClickAtom = (0, react_1.useCallback)((atom, event) => {
|
|
111
|
-
if (!(0, checkModifierKeyActivated_1.default)(event)) {
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
if (!(0, checkModifierKeyActivated_1.default)(event) && activeAssignment.activated) {
|
|
106
|
+
const { axis, id } = activeAssignment.activated;
|
|
107
|
+
if (id && axis) {
|
|
108
|
+
const atomInformation = (0, Utilities_1.extractFromAtom)(atom, nucleus, axis);
|
|
114
109
|
if (atomInformation.nbAtoms > 0) {
|
|
115
110
|
// save assignment in assignment hook
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
111
|
+
const dimension = displayerMode === Constants_1.DISPLAYER_MODE.DM_1D ? '1D' : '2D';
|
|
112
|
+
activeAssignment.toggle(atomInformation.oclIDs, dimension);
|
|
113
|
+
// console.log(activeAssignment);
|
|
119
114
|
// save assignment (diaIDs) in range/zone data
|
|
120
115
|
const { datum, signalIndex } = (0, Utilities_1.findDatumAndSignalIndex)(data, activeAssignment.id);
|
|
121
116
|
if (datum) {
|
|
122
117
|
// determine the level of setting the diaIDs array (range vs. signal level) and save there
|
|
123
|
-
let
|
|
124
|
-
let nbAtoms = 0;
|
|
118
|
+
// let nbAtoms = 0;
|
|
125
119
|
// on range/zone level
|
|
126
|
-
if (
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
[_diaID, nbAtoms] = toggleAssignment(datum[activeAssignment.activeAxis].diaIDs || [], atomInformation);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
else if (datum.signals?.[signalIndex]) {
|
|
135
|
-
// on signal level
|
|
136
|
-
if (displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
|
|
137
|
-
[_diaID, nbAtoms] = toggleAssignment(datum.signals[signalIndex].diaIDs || [], atomInformation);
|
|
120
|
+
if (displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
|
|
121
|
+
const range = datum;
|
|
122
|
+
let _diaIDs = [];
|
|
123
|
+
if (signalIndex === undefined) {
|
|
124
|
+
_diaIDs = range?.diaIDs || [];
|
|
138
125
|
}
|
|
139
|
-
else
|
|
140
|
-
|
|
141
|
-
.diaIDs || [], atomInformation);
|
|
126
|
+
else {
|
|
127
|
+
_diaIDs = range?.signals[signalIndex]?.diaIDs || [];
|
|
142
128
|
}
|
|
143
|
-
|
|
144
|
-
if (displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
|
|
129
|
+
const [_diaID, nbAtoms] = toggleAssignment(_diaIDs, atomInformation);
|
|
145
130
|
dispatch({
|
|
146
131
|
type: Types_1.SET_DIAID_RANGE,
|
|
147
132
|
payload: {
|
|
@@ -152,20 +137,29 @@ function useAtomAssignment({ displayerMode, activeTab, zones, ranges, }) {
|
|
|
152
137
|
},
|
|
153
138
|
});
|
|
154
139
|
}
|
|
155
|
-
else
|
|
140
|
+
else {
|
|
141
|
+
const zone = datum;
|
|
142
|
+
let _diaIDs = [];
|
|
143
|
+
if (signalIndex === undefined) {
|
|
144
|
+
_diaIDs = zone[axis]?.diaIDs || [];
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
_diaIDs = zone?.signals[signalIndex][axis]?.diaIDs || [];
|
|
148
|
+
}
|
|
149
|
+
const [_diaID, nbAtoms] = toggleAssignment(_diaIDs, atomInformation);
|
|
156
150
|
dispatch({
|
|
157
151
|
type: Types_1.SET_DIAID_ZONE,
|
|
158
152
|
payload: {
|
|
159
153
|
nbAtoms,
|
|
160
154
|
zoneData: datum,
|
|
161
155
|
diaIDs: _diaID,
|
|
162
|
-
axis:
|
|
156
|
+
axis: axis,
|
|
163
157
|
signalIndex,
|
|
164
158
|
},
|
|
165
159
|
});
|
|
166
160
|
}
|
|
167
161
|
}
|
|
168
|
-
activeAssignment.
|
|
162
|
+
activeAssignment.setActive(axis);
|
|
169
163
|
}
|
|
170
164
|
else {
|
|
171
165
|
alert.info('Not assigned! Different atom type or no attached hydrogens found!');
|
|
@@ -178,15 +172,15 @@ function useAtomAssignment({ displayerMode, activeTab, zones, ranges, }) {
|
|
|
178
172
|
data,
|
|
179
173
|
dispatch,
|
|
180
174
|
displayerMode,
|
|
181
|
-
|
|
175
|
+
nucleus,
|
|
182
176
|
toggleAssignment,
|
|
183
177
|
]);
|
|
184
178
|
const handleOnAtomHover = (0, react_1.useCallback)((atom) => {
|
|
185
|
-
const oclIDs = (0, Utilities_1.extractFromAtom)(atom,
|
|
179
|
+
const { oclIDs } = (0, Utilities_1.extractFromAtom)(atom, nucleus);
|
|
186
180
|
// on enter the atom
|
|
187
181
|
if (oclIDs.length > 0) {
|
|
188
182
|
// set all IDs to highlight when hovering over an atom from assignment data
|
|
189
|
-
const highlights = (0, Utilities_1.getHighlightsOnHover)(
|
|
183
|
+
const highlights = (0, Utilities_1.getHighlightsOnHover)(assignments, oclIDs, data);
|
|
190
184
|
setOnAtomHoverHighlights(highlights);
|
|
191
185
|
setOnAtomHoverAction('show');
|
|
192
186
|
}
|
|
@@ -194,7 +188,8 @@ function useAtomAssignment({ displayerMode, activeTab, zones, ranges, }) {
|
|
|
194
188
|
// on leave the atom
|
|
195
189
|
setOnAtomHoverAction('hide');
|
|
196
190
|
}
|
|
197
|
-
|
|
191
|
+
// }
|
|
192
|
+
}, [assignments, data, nucleus]);
|
|
198
193
|
return {
|
|
199
194
|
handleOnAtomHover,
|
|
200
195
|
handleOnClickAtom,
|
|
@@ -12,7 +12,7 @@ const nmr_processing_1 = require("nmr-processing");
|
|
|
12
12
|
const react_2 = require("react");
|
|
13
13
|
const fa_1 = require("react-icons/fa");
|
|
14
14
|
const im_1 = require("react-icons/im");
|
|
15
|
-
const
|
|
15
|
+
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
16
16
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
17
17
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
18
18
|
const ButtonToolTip_1 = __importDefault(require("../../elements/ButtonToolTip"));
|
|
@@ -48,7 +48,7 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
|
|
|
48
48
|
const modal = (0, Modal_1.useModal)();
|
|
49
49
|
const alert = (0, Alert_1.useAlert)();
|
|
50
50
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
51
|
-
const assignmentData = (0,
|
|
51
|
+
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
52
52
|
const currentSum = (0, get_1.default)(ranges, 'options.sum', null);
|
|
53
53
|
const changeRangesSumHandler = (0, react_2.useCallback)((value) => {
|
|
54
54
|
dispatch({ type: Types_1.CHANGE_RANGE_SUM, value });
|
|
@@ -107,7 +107,7 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
|
|
|
107
107
|
}, [alert]);
|
|
108
108
|
const saveAsHTMLHandler = (0, react_2.useCallback)(() => {
|
|
109
109
|
const { originFrequency: observedFrequency, nucleus } = info;
|
|
110
|
-
const format = (0, get_1.default)(preferences.current, `formatting.
|
|
110
|
+
const format = (0, get_1.default)(preferences.current, `formatting.nuclei[${nucleus.toLowerCase()}]`, '0.0');
|
|
111
111
|
const nbDecimalDelta = (0, FormatNumber_1.getNumberOfDecimals)(format.ppm);
|
|
112
112
|
const nbDecimalJ = (0, FormatNumber_1.getNumberOfDecimals)(format.hz);
|
|
113
113
|
const result = (0, nmr_processing_1.rangesToACS)(ranges.values, {
|
|
@@ -9,7 +9,7 @@ const react_1 = require("@emotion/react");
|
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
11
11
|
const react_2 = require("react");
|
|
12
|
-
const
|
|
12
|
+
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
13
13
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
14
14
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
15
15
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
@@ -26,7 +26,7 @@ const RangesPreferences_1 = __importDefault(require("./RangesPreferences"));
|
|
|
26
26
|
const RangesTable_1 = __importDefault(require("./RangesTable"));
|
|
27
27
|
function RangesTablePanelInner({ ranges, data, info, xDomain, preferences, activeTab, molecules, showMultiplicityTrees, showJGraph, showRangesIntegrals, }) {
|
|
28
28
|
const [isFilterActive, setFilterIsActive] = (0, react_2.useState)(false);
|
|
29
|
-
const assignmentData = (0,
|
|
29
|
+
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
30
30
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
31
31
|
const alert = (0, Alert_1.useAlert)();
|
|
32
32
|
const [isFlipped, setFlipStatus] = (0, react_2.useState)(false);
|
|
@@ -8,7 +8,8 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const react_2 = require("react");
|
|
11
|
-
const
|
|
11
|
+
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
12
|
+
const filterForIDsWithAssignment_1 = require("../../assignment/utilities/filterForIDsWithAssignment");
|
|
12
13
|
const highlight_1 = require("../../highlight");
|
|
13
14
|
const ColumnsHelper_1 = require("../extra/preferences/ColumnsHelper");
|
|
14
15
|
const AbsoluteColumn_1 = __importDefault(require("./TableColumns/AbsoluteColumn"));
|
|
@@ -27,12 +28,12 @@ const ConstantlyHighlightedRowStyle = (0, react_1.css) `
|
|
|
27
28
|
background-color: #f5f5dc;
|
|
28
29
|
`;
|
|
29
30
|
function RangesTableRow({ rowData, onUnlink, onContextMenu, preferences, }) {
|
|
30
|
-
const assignmentData = (0,
|
|
31
|
-
const assignmentRange = (0,
|
|
32
|
-
const highlightRange = (0, highlight_1.useHighlight)([assignmentRange.id].concat(assignmentRange.assigned
|
|
33
|
-
const highlightRangeAssignmentsColumn = (0, highlight_1.useHighlight)(assignmentRange.assigned
|
|
34
|
-
const assignmentSignal = (0,
|
|
35
|
-
const highlightSignal = (0, highlight_1.useHighlight)([assignmentSignal.id].concat(assignmentSignal.assigned
|
|
31
|
+
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
32
|
+
const assignmentRange = (0, AssignmentsContext_1.useAssignment)(rowData.id);
|
|
33
|
+
const highlightRange = (0, highlight_1.useHighlight)([assignmentRange.id].concat(assignmentRange.assigned?.x || []).concat((0, filterForIDsWithAssignment_1.filterForIDsWithAssignment)(assignmentData, rowData.signals.map((_signal) => _signal.id))), { type: highlight_1.HighlightedSource.RANGE });
|
|
34
|
+
const highlightRangeAssignmentsColumn = (0, highlight_1.useHighlight)(assignmentRange.assigned?.x || [], { type: highlight_1.HighlightedSource.RANGE });
|
|
35
|
+
const assignmentSignal = (0, AssignmentsContext_1.useAssignment)(rowData.tableMetaInfo.id);
|
|
36
|
+
const highlightSignal = (0, highlight_1.useHighlight)([assignmentSignal.id].concat(assignmentSignal.assigned?.x || []), { type: highlight_1.HighlightedSource.SIGNAL });
|
|
36
37
|
const highlightData = (0, highlight_1.useHighlightData)();
|
|
37
38
|
const [unlinkRangeButtonVisibility, showUnlinkRangeButton] = (0, react_2.useState)(false);
|
|
38
39
|
const [unlinkSignalButtonVisibility, showUnlinkSignalButton] = (0, react_2.useState)(false);
|
|
@@ -69,16 +70,16 @@ function RangesTableRow({ rowData, onUnlink, onContextMenu, preferences, }) {
|
|
|
69
70
|
}, [assignmentRange, assignmentSignal, onUnlink, rowData]);
|
|
70
71
|
const linkHandler = (0, react_2.useCallback)((e, assignment) => {
|
|
71
72
|
e.stopPropagation();
|
|
72
|
-
assignment.
|
|
73
|
+
assignment.setActive('x');
|
|
73
74
|
}, []);
|
|
74
75
|
const onHoverRange = (0, react_2.useMemo)(() => {
|
|
75
76
|
return {
|
|
76
77
|
onMouseEnter: () => {
|
|
77
|
-
assignmentRange.
|
|
78
|
+
assignmentRange.show('x');
|
|
78
79
|
highlightRange.show();
|
|
79
80
|
},
|
|
80
81
|
onMouseLeave: () => {
|
|
81
|
-
assignmentRange.
|
|
82
|
+
assignmentRange.hide();
|
|
82
83
|
highlightRange.hide();
|
|
83
84
|
},
|
|
84
85
|
};
|
|
@@ -86,11 +87,11 @@ function RangesTableRow({ rowData, onUnlink, onContextMenu, preferences, }) {
|
|
|
86
87
|
const onHoverRangeAssignmentsColumn = (0, react_2.useMemo)(() => {
|
|
87
88
|
return {
|
|
88
89
|
onMouseEnter: () => {
|
|
89
|
-
assignmentRange.
|
|
90
|
+
assignmentRange.show('x');
|
|
90
91
|
highlightRangeAssignmentsColumn.show();
|
|
91
92
|
},
|
|
92
93
|
onMouseLeave: () => {
|
|
93
|
-
assignmentRange.
|
|
94
|
+
assignmentRange.hide();
|
|
94
95
|
highlightRangeAssignmentsColumn.hide();
|
|
95
96
|
},
|
|
96
97
|
};
|
|
@@ -98,11 +99,11 @@ function RangesTableRow({ rowData, onUnlink, onContextMenu, preferences, }) {
|
|
|
98
99
|
const onHoverSignal = (0, react_2.useMemo)(() => {
|
|
99
100
|
return {
|
|
100
101
|
onMouseEnter: () => {
|
|
101
|
-
assignmentSignal.
|
|
102
|
+
assignmentSignal.show('x');
|
|
102
103
|
highlightSignal.show();
|
|
103
104
|
},
|
|
104
105
|
onMouseLeave: () => {
|
|
105
|
-
assignmentSignal.
|
|
106
|
+
assignmentSignal.hide();
|
|
106
107
|
highlightSignal.hide();
|
|
107
108
|
},
|
|
108
109
|
};
|
|
@@ -21,7 +21,7 @@ function RangeAssignmentsColumn({ rowData, assignment, highlight, onUnlinkVisibi
|
|
|
21
21
|
}, [onUnlinkVisibilityChange]);
|
|
22
22
|
const spanCss = (0, react_1.useMemo)(() => {
|
|
23
23
|
const flag = assignment.isActive ||
|
|
24
|
-
assignment.
|
|
24
|
+
assignment.isOver ||
|
|
25
25
|
(highlight.isActive &&
|
|
26
26
|
highlightData.highlight.sourceData?.type !== highlight_1.HighlightedSource.SIGNAL);
|
|
27
27
|
return flag
|
|
@@ -32,7 +32,7 @@ function RangeAssignmentsColumn({ rowData, assignment, highlight, onUnlinkVisibi
|
|
|
32
32
|
: { color: 'black', fontWeight: 'normal' };
|
|
33
33
|
}, [
|
|
34
34
|
assignment.isActive,
|
|
35
|
-
assignment.
|
|
35
|
+
assignment.isOver,
|
|
36
36
|
highlight.isActive,
|
|
37
37
|
highlightData.highlight.sourceData?.type,
|
|
38
38
|
]);
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
const
|
|
8
|
+
const AssignmentsContext_1 = require("../../../assignment/AssignmentsContext");
|
|
9
9
|
const DispatchContext_1 = require("../../../context/DispatchContext");
|
|
10
10
|
const Modal_1 = require("../../../elements/popup/Modal");
|
|
11
11
|
const options_1 = require("../../../elements/popup/options");
|
|
@@ -15,7 +15,7 @@ const ToolTypes_1 = require("../../../toolbar/ToolTypes");
|
|
|
15
15
|
function useEditRangeModal(range) {
|
|
16
16
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
17
17
|
const modal = (0, Modal_1.useModal)();
|
|
18
|
-
const assignmentData = (0,
|
|
18
|
+
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
19
19
|
const zoomRange = (0, react_1.useCallback)(() => {
|
|
20
20
|
const margin = Math.abs(range.from - range.to);
|
|
21
21
|
dispatch({
|
|
@@ -12,11 +12,11 @@ const DispatchContext_1 = require("../../context/DispatchContext");
|
|
|
12
12
|
const ButtonToolTip_1 = __importDefault(require("../../elements/ButtonToolTip"));
|
|
13
13
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
14
14
|
const Modal_1 = require("../../elements/popup/Modal");
|
|
15
|
-
const useCheckToolsVisibility_1 = require("../../hooks/useCheckToolsVisibility");
|
|
16
15
|
const Constants_1 = require("../../reducer/core/Constants");
|
|
17
16
|
const Types_1 = require("../../reducer/types/Types");
|
|
18
17
|
const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
|
|
19
|
-
|
|
18
|
+
const SpectraAutomaticPickingButton_1 = require("../header/SpectraAutomaticPickingButton");
|
|
19
|
+
function SpectraPanelHeaderInner({ data, activeSpectrum, activeTab, displayerMode, spectrums, }) {
|
|
20
20
|
const modal = (0, Modal_1.useModal)();
|
|
21
21
|
const alert = (0, Alert_1.useAlert)();
|
|
22
22
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
@@ -70,30 +70,17 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeTab, displayerMod
|
|
|
70
70
|
const resetScaleHandler = (0, react_1.useCallback)(() => {
|
|
71
71
|
dispatch({ type: Types_1.RESET_SPECTRA_SCALE });
|
|
72
72
|
}, [dispatch]);
|
|
73
|
-
|
|
74
|
-
void (async () => {
|
|
75
|
-
const hideLoading = await alert.showLoading('Automatic Ranges/Zones detection for all spectra in progress');
|
|
76
|
-
setTimeout(() => {
|
|
77
|
-
dispatch({ type: Types_1.AUTO_RANGES_SPECTRA_PICKING });
|
|
78
|
-
dispatch({ type: Types_1.AUTO_ZONES_SPECTRA_PICKING });
|
|
79
|
-
hideLoading();
|
|
80
|
-
}, 0);
|
|
81
|
-
})();
|
|
82
|
-
}, [dispatch, alert]);
|
|
83
|
-
return ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { onDelete: handleDelete, counter: spectrums?.length, deleteToolTip: "Delete all spectra", children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Hide all spectra", onClick: hideAllSpectrumsHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaEyeSlash, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Show all spectra", onClick: showAllSpectrumsHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaEye, {}) }), activeSpectrum && activeTab && activeTab.split(',').length > 1 && ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Add missing projection", onClick: addMissingProjectionHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaCreativeCommonsSamplingPlus, {}) })), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D && spectrums.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Reset Scale", onClick: resetScaleHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrResetScale, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Same Top", onClick: setSameTopHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSameTop, {}) })] })), data && data.length > 0 && isAutomaticPickingVisible && ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Automatic Ranges/Zones picking for all spectra", onClick: automaticPickingHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrRangePicking, {}) }))] }));
|
|
73
|
+
return ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { onDelete: handleDelete, counter: spectrums?.length, deleteToolTip: "Delete all spectra", children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Hide all spectra", onClick: hideAllSpectrumsHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaEyeSlash, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Show all spectra", onClick: showAllSpectrumsHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaEye, {}) }), activeSpectrum && activeTab && activeTab.split(',').length > 1 && ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Add missing projection", onClick: addMissingProjectionHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaCreativeCommonsSamplingPlus, {}) })), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D && spectrums.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Reset Scale", onClick: resetScaleHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrResetScale, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Same Top", onClick: setSameTopHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSameTop, {}) })] })), (0, jsx_runtime_1.jsx)(SpectraAutomaticPickingButton_1.SpectraAutomaticPickingButton, {})] }));
|
|
84
74
|
}
|
|
85
75
|
const MemoizedSpectraPanelHeader = (0, react_1.memo)(SpectraPanelHeaderInner);
|
|
86
76
|
function SpectrumsTabs({ spectrums }) {
|
|
87
77
|
const { data, activeSpectrum, activeTab, displayerMode } = (0, ChartContext_1.useChartData)();
|
|
88
|
-
const isToolVisible = (0, useCheckToolsVisibility_1.useCheckToolsVisibility)();
|
|
89
|
-
const isAutomaticPickingVisible = isToolVisible('autoRangesTool');
|
|
90
78
|
return ((0, jsx_runtime_1.jsx)(MemoizedSpectraPanelHeader, { ...{
|
|
91
79
|
data,
|
|
92
80
|
activeSpectrum,
|
|
93
81
|
activeTab,
|
|
94
82
|
displayerMode,
|
|
95
83
|
spectrums,
|
|
96
|
-
isAutomaticPickingVisible,
|
|
97
84
|
} }));
|
|
98
85
|
}
|
|
99
86
|
exports.default = SpectrumsTabs;
|
|
@@ -10,7 +10,7 @@ const nmr_correlation_1 = require("nmr-correlation");
|
|
|
10
10
|
const react_2 = require("react");
|
|
11
11
|
const fa_1 = require("react-icons/fa");
|
|
12
12
|
const FindUtilities_1 = require("../../../data/utilities/FindUtilities");
|
|
13
|
-
const
|
|
13
|
+
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
14
14
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
15
15
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
16
16
|
const Select_1 = __importDefault(require("../../elements/Select"));
|
|
@@ -61,7 +61,7 @@ function SummaryPanel() {
|
|
|
61
61
|
const { molecules, correlations: correlationsData, data: spectraData, xDomain, yDomain, displayerMode, activeTab, } = (0, ChartContext_1.useChartData)();
|
|
62
62
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
63
63
|
const modal = (0, Modal_1.useModal)();
|
|
64
|
-
const assignmentData = (0,
|
|
64
|
+
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
65
65
|
const [additionalColumnData, setAdditionalColumnData] = (0, react_2.useState)([]);
|
|
66
66
|
const [selectedAdditionalColumnsAtomType, setSelectedAdditionalColumnsAtomType,] = (0, react_2.useState)('H');
|
|
67
67
|
const [showProtonsAsRows, setShowProtonsAsRows] = (0, react_2.useState)(false);
|
|
@@ -7,7 +7,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const fa_1 = require("react-icons/fa");
|
|
9
9
|
const SignalsKinds_1 = require("../../../../data/constants/SignalsKinds");
|
|
10
|
-
const
|
|
10
|
+
const AssignmentsContext_1 = require("../../../assignment/AssignmentsContext");
|
|
11
11
|
const DispatchContext_1 = require("../../../context/DispatchContext");
|
|
12
12
|
const Select_1 = __importDefault(require("../../../elements/Select"));
|
|
13
13
|
const Modal_1 = require("../../../elements/popup/Modal");
|
|
@@ -22,7 +22,7 @@ const selectBoxStyle = {
|
|
|
22
22
|
};
|
|
23
23
|
function ActionsColumn({ rowData, rowSpanTags }) {
|
|
24
24
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
25
|
-
const assignmentData = (0,
|
|
25
|
+
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
26
26
|
const modal = (0, Modal_1.useModal)();
|
|
27
27
|
const changeSignalKindHandler = (0, react_1.useCallback)((value) => {
|
|
28
28
|
dispatch({
|
|
@@ -8,7 +8,7 @@ const get_1 = __importDefault(require("lodash/get"));
|
|
|
8
8
|
const fa_1 = require("react-icons/fa");
|
|
9
9
|
function SignalAssignmentsColumn({ rowData, assignment, highlight, onHover, onClick, onUnlink, axis, showUnlinkButton, setShowUnlinkButton, }) {
|
|
10
10
|
return ((0, jsx_runtime_1.jsx)("td", { ...onHover, ...{ onClick: (e) => onClick(e, assignment, axis) }, style: highlight.isActive ||
|
|
11
|
-
(assignment.isActive && assignment.
|
|
11
|
+
(assignment.isActive && assignment.activated?.axis === axis)
|
|
12
12
|
? {
|
|
13
13
|
color: 'red',
|
|
14
14
|
fontWeight: 'bold',
|
|
@@ -18,6 +18,6 @@ function SignalAssignmentsColumn({ rowData, assignment, highlight, onHover, onCl
|
|
|
18
18
|
visibility: showUnlinkButton ? 'visible' : 'hidden',
|
|
19
19
|
padding: 0,
|
|
20
20
|
margin: 0,
|
|
21
|
-
}, onClick: (e) => onUnlink(e, false, axis), children: (0, jsx_runtime_1.jsx)(fa_1.FaMinusCircle, { color: "red" }) }) })] })) : assignment.isActive && assignment.
|
|
21
|
+
}, onClick: (e) => onUnlink(e, false, axis), children: (0, jsx_runtime_1.jsx)(fa_1.FaMinusCircle, { color: "red" }) }) })] })) : assignment.isActive && assignment.activated?.axis === axis ? ('0') : ('') }));
|
|
22
22
|
}
|
|
23
23
|
exports.default = SignalAssignmentsColumn;
|
|
@@ -7,6 +7,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const SignalAssignmentsColumn_1 = __importDefault(require("./SignalAssignmentsColumn"));
|
|
9
9
|
function SignalAssignmentsColumns({ rowData, assignmentSignal, onHoverSignalX, onHoverSignalY, showUnlinkButtonSignalX, showUnlinkButtonSignalY, setShowUnlinkButtonSignalX, setShowUnlinkButtonSignalY, onClick, onUnlink, highlightSignalX, highlightSignalY, }) {
|
|
10
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SignalAssignmentsColumn_1.default, { rowData: rowData, assignment: assignmentSignal, highlight: highlightSignalX, onHover: onHoverSignalX, onClick: onClick, onUnlink: onUnlink, axis:
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SignalAssignmentsColumn_1.default, { rowData: rowData, assignment: assignmentSignal, highlight: highlightSignalX, onHover: onHoverSignalX, onClick: onClick, onUnlink: onUnlink, axis: "x", showUnlinkButton: showUnlinkButtonSignalX, setShowUnlinkButton: setShowUnlinkButtonSignalX }), (0, jsx_runtime_1.jsx)(SignalAssignmentsColumn_1.default, { rowData: rowData, assignment: assignmentSignal, highlight: highlightSignalY, onHover: onHoverSignalY, onClick: onClick, onUnlink: onUnlink, axis: "y", showUnlinkButton: showUnlinkButtonSignalY, setShowUnlinkButton: setShowUnlinkButtonSignalY })] }));
|
|
11
11
|
}
|
|
12
12
|
exports.default = SignalAssignmentsColumns;
|
|
@@ -7,8 +7,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const fa_1 = require("react-icons/fa");
|
|
9
9
|
function ZoneAssignmentColumn({ rowData, assignment, highlight, onHover, onClick, onUnlink, axis, showUnlinkButton, setShowUnlinkButton, rowSpanTags, }) {
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, ...{ onClick: (e) => onClick(e, assignment, axis) }, children: (0, get_1.default)(rowData, `${axis}.nbAtoms`, 0) > 0 ? ((0, get_1.default)(rowData, `${axis}.diaIDs`, 0).length > 0 ? ((0, jsx_runtime_1.jsxs)("div", { onMouseEnter: () => setShowUnlinkButton(true), onMouseLeave: () => setShowUnlinkButton(false), children: [rowData[axis].nbAtoms, " ", `(`, (0, jsx_runtime_1.jsx)("span", { style: (assignment.isActive && assignment.
|
|
11
|
-
(assignment.
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, ...onHover, ...{ onClick: (e) => onClick(e, assignment, axis) }, children: (0, get_1.default)(rowData, `${axis}.nbAtoms`, 0) > 0 ? ((0, get_1.default)(rowData, `${axis}.diaIDs`, 0).length > 0 ? ((0, jsx_runtime_1.jsxs)("div", { onMouseEnter: () => setShowUnlinkButton(true), onMouseLeave: () => setShowUnlinkButton(false), children: [rowData[axis].nbAtoms, " ", `(`, (0, jsx_runtime_1.jsx)("span", { style: (assignment.isActive && assignment.activated?.axis === axis) ||
|
|
11
|
+
(assignment.isOver && assignment.highlighted?.axis === axis) ||
|
|
12
12
|
highlight.isActive
|
|
13
13
|
? {
|
|
14
14
|
color: 'red',
|
|
@@ -18,9 +18,9 @@ function ZoneAssignmentColumn({ rowData, assignment, highlight, onHover, onClick
|
|
|
18
18
|
visibility: showUnlinkButton ? 'visible' : 'hidden',
|
|
19
19
|
padding: 0,
|
|
20
20
|
margin: 0,
|
|
21
|
-
}, onClick: (e) => onUnlink(e, true, axis), children: (0, jsx_runtime_1.jsx)(fa_1.FaMinusCircle, { color: "red" }) }) })] })) : assignment.isActive && assignment.
|
|
21
|
+
}, onClick: (e) => onUnlink(e, true, axis), children: (0, jsx_runtime_1.jsx)(fa_1.FaMinusCircle, { color: "red" }) }) })] })) : assignment.isActive && assignment.activated?.axis === axis ? ((0, jsx_runtime_1.jsxs)("div", { children: [`${(0, get_1.default)(rowData, `${axis}.nbAtoms`, '')} (`, (0, jsx_runtime_1.jsx)("span", { style: {
|
|
22
22
|
color: 'red',
|
|
23
23
|
fontWeight: 'bold',
|
|
24
|
-
}, children: "0" }), ')'] })) : (rowData[axis].nbAtoms)) : assignment.isActive && assignment.
|
|
24
|
+
}, children: "0" }), ')'] })) : (rowData[axis].nbAtoms)) : assignment.isActive && assignment.activated?.axis === axis ? ((0, jsx_runtime_1.jsxs)("div", { children: ['0 (', (0, jsx_runtime_1.jsx)("span", { style: { color: 'red', fontWeight: 'bold' }, children: "0" }), ')'] })) : ('') }));
|
|
25
25
|
}
|
|
26
26
|
exports.default = ZoneAssignmentColumn;
|
|
@@ -8,7 +8,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const react_2 = require("react");
|
|
10
10
|
const fa_1 = require("react-icons/fa");
|
|
11
|
-
const
|
|
11
|
+
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
12
12
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
13
13
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
14
14
|
const ToggleButton_1 = __importDefault(require("../../elements/ToggleButton"));
|
|
@@ -46,7 +46,7 @@ const style = (0, react_1.css) `
|
|
|
46
46
|
`;
|
|
47
47
|
function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, experiment }) {
|
|
48
48
|
const [filterIsActive, setFilterIsActive] = (0, react_2.useState)(false);
|
|
49
|
-
const assignmentData = (0,
|
|
49
|
+
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
50
50
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
51
51
|
const modal = (0, Modal_1.useModal)();
|
|
52
52
|
const [isFlipped, setFlipStatus] = (0, react_2.useState)(false);
|