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
|
@@ -59,13 +59,14 @@ export function fromCSD(result, options = {}, usedColors = {}) {
|
|
|
59
59
|
}, usedColors);
|
|
60
60
|
return datum1D;
|
|
61
61
|
}
|
|
62
|
-
export function fromParsedJcamp(parsedJcamp, options, usedColors) {
|
|
62
|
+
export function fromParsedJcamp(parsedJcamp, options, usedColors, jcampSpectrumIndex) {
|
|
63
63
|
const { dependentVariables, info, meta } = parsedJcamp;
|
|
64
64
|
let data = getData(dependentVariables[0].components);
|
|
65
65
|
if (Array.isArray(info.nucleus))
|
|
66
66
|
info.nucleus = info.nucleus[0];
|
|
67
67
|
const datum1D = initiateDatum1D({
|
|
68
68
|
...options,
|
|
69
|
+
source: { ...options.source, jcampSpectrumIndex },
|
|
69
70
|
info,
|
|
70
71
|
meta,
|
|
71
72
|
data,
|
|
@@ -10,6 +10,7 @@ export declare function toJSON(datum1D: Datum1D, dataExportOption: DataExportOpt
|
|
|
10
10
|
meta: any;
|
|
11
11
|
source: {
|
|
12
12
|
jcampURL: null;
|
|
13
|
+
jcampSpectrumIndex?: undefined;
|
|
13
14
|
};
|
|
14
15
|
id: string;
|
|
15
16
|
display: import("../../types/data1d").Display1D;
|
|
@@ -20,6 +21,7 @@ export declare function toJSON(datum1D: Datum1D, dataExportOption: DataExportOpt
|
|
|
20
21
|
filters: import("../../FiltersManager").Filter[];
|
|
21
22
|
source: {
|
|
22
23
|
jcampURL: string;
|
|
24
|
+
jcampSpectrumIndex: number;
|
|
23
25
|
};
|
|
24
26
|
id: string;
|
|
25
27
|
display: import("../../types/data1d").Display1D;
|
|
@@ -9,8 +9,5 @@ export declare function apply(datum1D: Datum1D, zones?: never[]): void;
|
|
|
9
9
|
export declare function isApplicable(datum1D: Datum1D): boolean;
|
|
10
10
|
export declare function reduce(previousValue: any, newValue: any): {
|
|
11
11
|
once: boolean;
|
|
12
|
-
reduce:
|
|
13
|
-
from: number;
|
|
14
|
-
to: number;
|
|
15
|
-
}[];
|
|
12
|
+
reduce: import("cheminfo-types").FromTo[];
|
|
16
13
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare function fromParsedJcamp(parsedJcamp: any, options: any, usedColors: any): import("../types/data2d").Datum2D;
|
|
1
|
+
export declare function fromParsedJcamp(parsedJcamp: any, options: any, usedColors: any, jcampSpectrumIndex: number): import("../types/data2d").Datum2D;
|
|
2
2
|
export declare function fromBruker(result: any, options?: {}, usedColors?: {}): import("../types/data2d").Datum2D;
|
|
3
3
|
export declare function fromCSD(result: any, options?: {}, usedColors?: {}): import("../types/data2d").Datum2D;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { initiateDatum2D } from './Spectrum2D';
|
|
2
|
-
export function fromParsedJcamp(parsedJcamp, options, usedColors) {
|
|
2
|
+
export function fromParsedJcamp(parsedJcamp, options, usedColors, jcampSpectrumIndex) {
|
|
3
3
|
const { dependentVariables, info, meta } = parsedJcamp;
|
|
4
4
|
let data = dependentVariables[0].components;
|
|
5
5
|
const ob = initiateDatum2D({
|
|
6
6
|
...options,
|
|
7
|
+
source: { ...options?.source, jcampSpectrumIndex },
|
|
7
8
|
info,
|
|
8
9
|
meta,
|
|
9
10
|
data,
|
|
@@ -43,7 +43,7 @@ export function initiateDatum2D(options, usedColors = {}) {
|
|
|
43
43
|
}
|
|
44
44
|
function getColor(options, usedColors) {
|
|
45
45
|
let color = { positiveColor: 'red', negativeColor: 'blue' };
|
|
46
|
-
if (options?.display
|
|
46
|
+
if (options?.display?.negativeColor === undefined ||
|
|
47
47
|
options?.display?.positiveColor === undefined) {
|
|
48
48
|
color = get2DColor(options.info.experiment, usedColors['2d'] || []);
|
|
49
49
|
}
|
|
@@ -9,6 +9,7 @@ export declare function toJSON(datum: Datum2D, dataExportOption: DataExportOptio
|
|
|
9
9
|
meta: any;
|
|
10
10
|
source: {
|
|
11
11
|
jcampURL: null;
|
|
12
|
+
jcampSpectrumIndex?: undefined;
|
|
12
13
|
};
|
|
13
14
|
id: string;
|
|
14
15
|
} | {
|
|
@@ -17,6 +18,7 @@ export declare function toJSON(datum: Datum2D, dataExportOption: DataExportOptio
|
|
|
17
18
|
display: import("../../types/data2d").Display2D;
|
|
18
19
|
source: {
|
|
19
20
|
jcampURL: string;
|
|
21
|
+
jcampSpectrumIndex: number;
|
|
20
22
|
};
|
|
21
23
|
id: string;
|
|
22
24
|
};
|
package/lib/versionInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default { version: 'v0.
|
|
1
|
+
export default { version: 'v0.26.0' };
|
|
@@ -10,9 +10,9 @@ const react_2 = require("react");
|
|
|
10
10
|
const ChartContext_1 = require("../context/ChartContext");
|
|
11
11
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
12
12
|
const ScaleContext_1 = require("../context/ScaleContext");
|
|
13
|
+
const Resizer_1 = __importDefault(require("../elements/resizer/Resizer"));
|
|
13
14
|
const index_1 = require("../highlight/index");
|
|
14
15
|
const Types_1 = require("../reducer/types/Types");
|
|
15
|
-
const Resizable_1 = __importDefault(require("./Resizable"));
|
|
16
16
|
const stylesOnHover = (0, react_1.css) `
|
|
17
17
|
pointer-events: bounding-box;
|
|
18
18
|
@-moz-document url-prefix() {
|
|
@@ -41,31 +41,31 @@ function IntegralResizable({ integralData }) {
|
|
|
41
41
|
const { height, margin } = (0, ChartContext_1.useChartData)();
|
|
42
42
|
const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
|
|
43
43
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
44
|
-
const
|
|
44
|
+
const { id, from, to, integral } = integralData;
|
|
45
45
|
const highlight = (0, index_1.useHighlight)([id], {
|
|
46
46
|
type: index_1.HighlightedSource.INTEGRAL,
|
|
47
47
|
extra: { id },
|
|
48
48
|
});
|
|
49
|
-
(0, react_2.
|
|
50
|
-
setIntegral(integralData);
|
|
51
|
-
}, [integralData]);
|
|
52
|
-
const handleOnStopResizing = (0, react_2.useCallback)((resized) => {
|
|
49
|
+
const handleOnStopResizing = (0, react_2.useCallback)((position) => {
|
|
53
50
|
dispatch({
|
|
54
51
|
type: Types_1.RESIZE_INTEGRAL,
|
|
55
|
-
payload: {
|
|
52
|
+
payload: {
|
|
53
|
+
data: {
|
|
54
|
+
...integralData,
|
|
55
|
+
from: scaleX().invert(position.x2),
|
|
56
|
+
to: scaleX().invert(position.x1),
|
|
57
|
+
},
|
|
58
|
+
},
|
|
56
59
|
});
|
|
57
|
-
}, [dispatch, integralData]);
|
|
60
|
+
}, [dispatch, integralData, scaleX]);
|
|
58
61
|
const handleOnEnterNotation = (0, react_2.useCallback)(() => {
|
|
59
62
|
highlight.show();
|
|
60
63
|
}, [highlight]);
|
|
61
64
|
const handleOnMouseLeaveNotation = (0, react_2.useCallback)(() => {
|
|
62
65
|
highlight.hide();
|
|
63
66
|
}, [highlight]);
|
|
64
|
-
const dragHandler = (0, react_2.useCallback)((boundary) => {
|
|
65
|
-
setIntegral((integral) => ({ ...integral, ...boundary }));
|
|
66
|
-
}, []);
|
|
67
67
|
const x0 = from ? scaleX()(from) : 0;
|
|
68
68
|
const x1 = to ? scaleX()(to) : 0;
|
|
69
|
-
return ((0, jsx_runtime_1.
|
|
69
|
+
return ((0, jsx_runtime_1.jsx)("g", { css: highlight.isActive ? stylesHighlighted : stylesOnHover, onMouseEnter: handleOnEnterNotation, onMouseLeave: handleOnMouseLeaveNotation, children: (0, jsx_runtime_1.jsx)(Resizer_1.default, { tag: "svg", initialPosition: { x1: x1, x2: x0 }, onEnd: handleOnStopResizing, children: (x1, x2) => ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("rect", { x: "0", y: "0", width: x2 - x1, height: height - margin.bottom, className: "highlight", "data-no-export": "true" }), (0, jsx_runtime_1.jsx)("text", { x: 0, y: height - margin.bottom + 30, fill: "black", style: { fontSize: '12px', fontWeight: 'bold' }, children: integral !== undefined ? integral.toFixed(2) : '' })] })) }) }));
|
|
70
70
|
}
|
|
71
71
|
exports.default = IntegralResizable;
|
|
@@ -10,37 +10,33 @@ const react_2 = require("react");
|
|
|
10
10
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
11
11
|
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
12
12
|
const DeleteButton_1 = __importDefault(require("../../elements/DeleteButton"));
|
|
13
|
+
const Resizer_1 = __importDefault(require("../../elements/resizer/Resizer"));
|
|
13
14
|
const highlight_1 = require("../../highlight");
|
|
14
15
|
const Types_1 = require("../../reducer/types/Types");
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@-moz-document url-prefix() {
|
|
19
|
-
pointer-events: fill;
|
|
20
|
-
}
|
|
21
|
-
user-select: 'none';
|
|
22
|
-
-webkit-user-select: none; /* Chrome all / Safari all */
|
|
23
|
-
-moz-user-select: none; /* Firefox all */
|
|
16
|
+
const styles = {
|
|
17
|
+
common: (0, react_1.css) `
|
|
18
|
+
pointer-events: bounding-box;
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
20
|
+
@-moz-document url-prefix() {
|
|
21
|
+
pointer-events: fill;
|
|
22
|
+
}
|
|
23
|
+
`,
|
|
24
|
+
hover: (0, react_1.css) `
|
|
25
|
+
.delete-button {
|
|
26
|
+
visibility: hidden;
|
|
27
|
+
}
|
|
28
|
+
`,
|
|
29
|
+
Highlighted: (0, react_1.css) `
|
|
30
|
+
.range-area {
|
|
31
|
+
height: 100%;
|
|
32
|
+
fill: #ff6f0057;
|
|
33
|
+
}
|
|
34
|
+
.delete-button {
|
|
35
|
+
visibility: visible;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
`,
|
|
39
|
+
};
|
|
44
40
|
function AnalysisRange({ rangeData, columnKey }) {
|
|
45
41
|
const { from, to } = rangeData;
|
|
46
42
|
const highlight = (0, highlight_1.useHighlight)([columnKey]);
|
|
@@ -49,12 +45,15 @@ function AnalysisRange({ rangeData, columnKey }) {
|
|
|
49
45
|
const deleteHandler = (0, react_2.useCallback)(() => {
|
|
50
46
|
dispatch({ type: Types_1.DELETE_ANALYZE_SPECTRA_RANGE, colKey: columnKey });
|
|
51
47
|
}, [columnKey, dispatch]);
|
|
52
|
-
const
|
|
48
|
+
const resizeEndHandler = (0, react_2.useCallback)((resized) => {
|
|
53
49
|
dispatch({
|
|
54
50
|
type: Types_1.RESIZE_ANALYZE_SPECTRA_RANGE,
|
|
55
51
|
payload: { ...rangeData, ...resized, columnKey },
|
|
56
52
|
});
|
|
57
53
|
}, [columnKey, dispatch, rangeData]);
|
|
58
|
-
return ((0, jsx_runtime_1.
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)("g", { ...highlight.onHover, css: [
|
|
55
|
+
styles.common,
|
|
56
|
+
highlight.isActive ? styles.Highlighted : styles.hover,
|
|
57
|
+
], children: (0, jsx_runtime_1.jsx)(Resizer_1.default, { tag: "svg", onEnd: resizeEndHandler, initialPosition: { x2: scaleX()(from), x1: scaleX()(to) }, children: (x1, x2) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,25)`, children: [(0, jsx_runtime_1.jsx)("rect", { x: "0", width: x2 - x1, height: "6", className: "range-area", fill: "green" }), (0, jsx_runtime_1.jsx)("text", { textAnchor: "middle", x: (x2 - x1) / 2, y: "-5", fontSize: "12", fill: "red", fontWeight: "bolder", fillOpacity: highlight.isActive ? 1 : 0.6, children: columnKey })] }), (0, jsx_runtime_1.jsx)(DeleteButton_1.default, { x: -20, y: 10, onDelete: deleteHandler })] })) }) }));
|
|
59
58
|
}
|
|
60
59
|
exports.default = AnalysisRange;
|
|
@@ -7,7 +7,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
9
|
const react_1 = require("react");
|
|
10
|
-
const
|
|
10
|
+
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
11
11
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
12
12
|
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
13
13
|
const highlight_1 = require("../../highlight");
|
|
@@ -23,7 +23,7 @@ const styles = {
|
|
|
23
23
|
strokeWidth: 1,
|
|
24
24
|
};
|
|
25
25
|
function extractID(assignment) {
|
|
26
|
-
return [assignment.id].concat(assignment.assigned
|
|
26
|
+
return [assignment.id].concat(assignment.assigned?.x || []);
|
|
27
27
|
}
|
|
28
28
|
function MultiplicityTree({ rangeFrom, rangeTo, signal, labelOptions = {
|
|
29
29
|
distance: 10,
|
|
@@ -31,7 +31,7 @@ function MultiplicityTree({ rangeFrom, rangeTo, signal, labelOptions = {
|
|
|
31
31
|
}, }) {
|
|
32
32
|
const { scaleX, scaleY } = (0, ScaleContext_1.useScaleChecked)();
|
|
33
33
|
const { data: spectraData, activeSpectrum, toolOptions: { selectedTool }, width, } = (0, ChartContext_1.useChartData)();
|
|
34
|
-
const assignment = (0,
|
|
34
|
+
const assignment = (0, AssignmentsContext_1.useAssignment)(signal.id);
|
|
35
35
|
const highlight = (0, highlight_1.useHighlight)(extractID(assignment), {
|
|
36
36
|
type: highlight_1.HighlightedSource.SIGNAL,
|
|
37
37
|
extra: extractID(assignment),
|
|
@@ -174,11 +174,11 @@ function MultiplicityTree({ rangeFrom, rangeTo, signal, labelOptions = {
|
|
|
174
174
|
? { ...styles, opacity: 1, strokeWidth: 1.5 }
|
|
175
175
|
: styles, ...{
|
|
176
176
|
onMouseEnter: () => {
|
|
177
|
-
assignment.
|
|
177
|
+
assignment.show('x');
|
|
178
178
|
highlight.show();
|
|
179
179
|
},
|
|
180
180
|
onMouseLeave: () => {
|
|
181
|
-
assignment.
|
|
181
|
+
assignment.hide();
|
|
182
182
|
highlight.hide();
|
|
183
183
|
},
|
|
184
184
|
}, ...{
|
|
@@ -189,7 +189,7 @@ function MultiplicityTree({ rangeFrom, rangeTo, signal, labelOptions = {
|
|
|
189
189
|
: (e) => {
|
|
190
190
|
if (e.shiftKey) {
|
|
191
191
|
e.stopPropagation();
|
|
192
|
-
assignment.
|
|
192
|
+
assignment.setActive('x');
|
|
193
193
|
}
|
|
194
194
|
},
|
|
195
195
|
}, children: multiplicityTree }));
|
|
@@ -8,13 +8,14 @@ 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 RangeUtilities_1 = require("../../../data/utilities/RangeUtilities");
|
|
11
|
-
const
|
|
11
|
+
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
12
|
+
const filterForIDsWithAssignment_1 = require("../../assignment/utilities/filterForIDsWithAssignment");
|
|
12
13
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
13
14
|
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
15
|
+
const Resizer_1 = __importDefault(require("../../elements/resizer/Resizer"));
|
|
14
16
|
const highlight_1 = require("../../highlight");
|
|
15
17
|
const Types_1 = require("../../reducer/types/Types");
|
|
16
18
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
17
|
-
const Resizable_1 = __importDefault(require("../Resizable"));
|
|
18
19
|
const MultiplicityTree_1 = __importDefault(require("../multiplicityTree/MultiplicityTree"));
|
|
19
20
|
const TempMultiplicityTree_1 = __importDefault(require("../multiplicityTree/TempMultiplicityTree"));
|
|
20
21
|
const stylesOnHover = (0, react_1.css) `
|
|
@@ -46,24 +47,14 @@ const stylesHighlighted = (0, react_1.css) `
|
|
|
46
47
|
}
|
|
47
48
|
`;
|
|
48
49
|
function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode, }) {
|
|
49
|
-
const { id, from
|
|
50
|
-
const assignmentData = (0,
|
|
51
|
-
const assignmentRange = (0,
|
|
52
|
-
const highlightRange = (0, highlight_1.useHighlight)([assignmentRange.id].concat(assignmentRange.assigned
|
|
53
|
-
const [rangeBoundary, setRangeBoundary] = (0, react_2.useState)({
|
|
54
|
-
from: rangeFrom,
|
|
55
|
-
to: rangeTo,
|
|
56
|
-
});
|
|
50
|
+
const { id, from, to, integration, signals } = rangeData;
|
|
51
|
+
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
52
|
+
const assignmentRange = (0, AssignmentsContext_1.useAssignment)(id);
|
|
53
|
+
const highlightRange = (0, highlight_1.useHighlight)([assignmentRange.id].concat(assignmentRange.assigned?.x || []).concat((0, filterForIDsWithAssignment_1.filterForIDsWithAssignment)(assignmentData, signals.map((_signal) => _signal.id))), { type: highlight_1.HighlightedSource.RANGE, extra: { id } });
|
|
57
54
|
const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
|
|
58
55
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
59
56
|
const [reduceOpacity, setReduceOpacity] = (0, react_2.useState)(false);
|
|
60
57
|
const [isBlockedByEditing, setIsBlockedByEditing] = (0, react_2.useState)(false);
|
|
61
|
-
(0, react_2.useEffect)(() => {
|
|
62
|
-
setRangeBoundary({
|
|
63
|
-
from: rangeFrom,
|
|
64
|
-
to: rangeTo,
|
|
65
|
-
});
|
|
66
|
-
}, [rangeFrom, rangeTo]);
|
|
67
58
|
(0, react_2.useEffect)(() => {
|
|
68
59
|
if (selectedTool && selectedTool === ToolTypes_1.options.editRange.id) {
|
|
69
60
|
setIsBlockedByEditing(true);
|
|
@@ -75,44 +66,44 @@ function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode,
|
|
|
75
66
|
(0, react_2.useEffect)(() => {
|
|
76
67
|
setReduceOpacity(!(0, RangeUtilities_1.checkRangeKind)(rangeData));
|
|
77
68
|
}, [rangeData]);
|
|
78
|
-
const handleOnStopResizing = (0, react_2.useCallback)((
|
|
69
|
+
const handleOnStopResizing = (0, react_2.useCallback)((position) => {
|
|
79
70
|
dispatch({
|
|
80
71
|
type: Types_1.RESIZE_RANGE,
|
|
81
|
-
data: {
|
|
72
|
+
data: {
|
|
73
|
+
...rangeData,
|
|
74
|
+
from: scaleX().invert(position.x2),
|
|
75
|
+
to: scaleX().invert(position.x1),
|
|
76
|
+
},
|
|
82
77
|
});
|
|
83
|
-
}, [dispatch, rangeData]);
|
|
78
|
+
}, [dispatch, rangeData, scaleX]);
|
|
84
79
|
const mouseEnterHandler = (0, react_2.useCallback)(() => {
|
|
85
|
-
assignmentRange.
|
|
80
|
+
assignmentRange.show('x');
|
|
86
81
|
highlightRange.show();
|
|
87
82
|
}, [assignmentRange, highlightRange]);
|
|
88
83
|
const mouseLeaveHandler = (0, react_2.useCallback)(() => {
|
|
89
|
-
assignmentRange.
|
|
84
|
+
assignmentRange.hide();
|
|
90
85
|
highlightRange.hide();
|
|
91
86
|
}, [assignmentRange, highlightRange]);
|
|
92
87
|
const assignHandler = (0, react_2.useCallback)((e) => {
|
|
93
88
|
if (selectedTool === ToolTypes_1.options.rangesPicking.id &&
|
|
94
89
|
e.shiftKey &&
|
|
95
90
|
!isBlockedByEditing) {
|
|
96
|
-
assignmentRange.
|
|
91
|
+
assignmentRange.setActive('x');
|
|
97
92
|
}
|
|
98
93
|
}, [assignmentRange, isBlockedByEditing, selectedTool]);
|
|
99
|
-
const dragHandler = (0, react_2.useCallback)((boundary) => {
|
|
100
|
-
setRangeBoundary((range) => ({ ...range, ...boundary }));
|
|
101
|
-
}, []);
|
|
102
|
-
const { from, to } = rangeBoundary;
|
|
103
94
|
return ((0, jsx_runtime_1.jsxs)("g", { "data-test-id": "range", style: { outline: 'none' }, css: isBlockedByEditing ||
|
|
104
95
|
highlightRange.isActive ||
|
|
105
96
|
assignmentRange.isActive
|
|
106
97
|
? stylesHighlighted
|
|
107
|
-
: stylesOnHover, onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, onClick: assignHandler, children: [(0, jsx_runtime_1.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
98
|
+
: stylesOnHover, onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, onClick: assignHandler, children: [(0, jsx_runtime_1.jsx)(Resizer_1.default, { tag: "svg", initialPosition: { x1: scaleX()(to), x2: scaleX()(from) }, onEnd: handleOnStopResizing, children: (x1, x2) => ((0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,10)`, children: [(0, jsx_runtime_1.jsx)("rect", { "data-no-export": "true", x: "0", width: x2 - x1, height: "6", className: "range-area", fill: "green", fillOpacity: !reduceOpacity ||
|
|
99
|
+
highlightRange.isActive ||
|
|
100
|
+
assignmentRange.isActive
|
|
101
|
+
? 1
|
|
102
|
+
: 0.4 }), (0, jsx_runtime_1.jsx)("text", { textAnchor: "middle", x: (x2 - x1) / 2, y: "20", fontSize: "10", fill: "red", fillOpacity: !reduceOpacity ||
|
|
103
|
+
highlightRange.isActive ||
|
|
104
|
+
assignmentRange.isActive
|
|
105
|
+
? 1
|
|
106
|
+
: 0.6, children: integration !== undefined ? integration.toFixed(2) : '' })] })) }), startEditMode ? ((0, jsx_runtime_1.jsx)(TempMultiplicityTree_1.default, {})) : (showMultiplicityTrees &&
|
|
116
107
|
signals &&
|
|
117
108
|
signals.length > 0 &&
|
|
118
109
|
signals.map((_signal) => ((0, jsx_runtime_1.jsx)(MultiplicityTree_1.default, { rangeFrom: from, rangeTo: to, signal: _signal }, _signal.id))))] }, id));
|
|
@@ -7,7 +7,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const Concatenation_1 = require("../../../data/utilities/Concatenation");
|
|
10
|
-
const
|
|
10
|
+
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
11
11
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
12
12
|
const highlight_1 = require("../../highlight");
|
|
13
13
|
const scale_1 = require("../utilities/scale");
|
|
@@ -19,7 +19,7 @@ const Signal = (0, react_1.memo)(({ signal, isVisible }) => {
|
|
|
19
19
|
const buildIDs = (0, react_1.useCallback)((id) => {
|
|
20
20
|
return [id].concat((0, Concatenation_1.buildID)(id, 'X'), (0, Concatenation_1.buildID)(id, 'Y'));
|
|
21
21
|
}, []);
|
|
22
|
-
const assignment = (0,
|
|
22
|
+
const assignment = (0, AssignmentsContext_1.useAssignment)(signal.id);
|
|
23
23
|
const highlight = (0, highlight_1.useHighlight)(buildIDs(assignment.id));
|
|
24
24
|
const highlightData = (0, highlight_1.useHighlightData)();
|
|
25
25
|
const [isHighlighted, setIsHighlighted] = (0, react_1.useState)(false);
|
|
@@ -39,13 +39,13 @@ const Signal = (0, react_1.memo)(({ signal, isVisible }) => {
|
|
|
39
39
|
]);
|
|
40
40
|
if (!signal)
|
|
41
41
|
return null;
|
|
42
|
-
return ((0, jsx_runtime_1.jsxs)("g", { className: "zone-signal", onMouseEnter: () => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)("g", { className: "zone-signal", children: [isVisible.signals && ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)(SignalCrosshair_1.default, { signal: signal }), (0, jsx_runtime_1.jsx)("circle", { onMouseEnter: () => {
|
|
43
|
+
assignment.show();
|
|
44
|
+
highlight.show();
|
|
45
|
+
}, onMouseLeave: () => {
|
|
46
|
+
assignment.hide();
|
|
47
|
+
highlight.hide();
|
|
48
|
+
}, cx: scaleX(signal.x.delta || 0), cy: scaleY(signal.y.delta || 0), r: isHighlighted ? 6 : 4, fill: isHighlighted ? 'green' : 'darkgreen' }, signal.id)] })), (0, jsx_runtime_1.jsx)("g", { className: "zone-signal-peak", style: { pointerEvents: 'none' }, children: isVisible.peaks &&
|
|
49
49
|
signal.peaks &&
|
|
50
50
|
signal.peaks.map((peak, i) => ((0, jsx_runtime_1.jsx)("circle", { cx: scaleX(peak.x), cy: scaleY(peak.y), r: 2, fill: "black" }, `${signal.id + i}`))) })] }));
|
|
51
51
|
});
|
|
@@ -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 ZoneUtilities_1 = require("../../../data/utilities/ZoneUtilities");
|
|
11
|
-
const
|
|
11
|
+
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
12
12
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
13
13
|
const highlight_1 = require("../../highlight");
|
|
14
14
|
const scale_1 = require("../utilities/scale");
|
|
@@ -42,7 +42,7 @@ const stylesHighlighted = (0, react_1.css) `
|
|
|
42
42
|
`;
|
|
43
43
|
const Zone = ({ zoneData, isVisible }) => {
|
|
44
44
|
const { x, y, id, signals } = zoneData;
|
|
45
|
-
const assignmentZone = (0,
|
|
45
|
+
const assignmentZone = (0, AssignmentsContext_1.useAssignment)(id);
|
|
46
46
|
const highlightZone = (0, highlight_1.useHighlight)([assignmentZone.id], {
|
|
47
47
|
type: highlight_1.HighlightedSource.ZONE,
|
|
48
48
|
extra: { id: assignmentZone.id },
|
|
@@ -59,10 +59,10 @@ const Zone = ({ zoneData, isVisible }) => {
|
|
|
59
59
|
return ((0, jsx_runtime_1.jsxs)("g", { css: highlightZone.isActive || assignmentZone.isActive
|
|
60
60
|
? stylesHighlighted
|
|
61
61
|
: stylesOnHover, onMouseEnter: () => {
|
|
62
|
-
assignmentZone.
|
|
62
|
+
assignmentZone.show();
|
|
63
63
|
highlightZone.show();
|
|
64
64
|
}, onMouseLeave: () => {
|
|
65
|
-
assignmentZone.
|
|
65
|
+
assignmentZone.hide();
|
|
66
66
|
highlightZone.hide();
|
|
67
67
|
}, children: [isVisible.zones && ((0, jsx_runtime_1.jsx)("g", { transform: `translate(${scaleX(x2)},${scaleY(y1)})`, children: (0, jsx_runtime_1.jsx)("rect", { x: "0", width: scaleX(x1) - scaleX(x2), height: scaleY(y2) - scaleY(y1), className: "Integral-area", fill: "#0000000f", stroke: reduceOpacity ? '#343a40' : 'darkgreen', strokeWidth: reduceOpacity ? '0' : '1' }) })), signals.map((_signal, i) => ((0, jsx_runtime_1.jsx)(Signal_1.default, { signal: _signal, isVisible: isVisible }, `${id + i}`)))] }, id));
|
|
68
68
|
};
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const checkModifierKeyActivated_1 = __importDefault(require("../../data/utilities/checkModifierKeyActivated"));
|
|
8
|
-
const
|
|
8
|
+
const AssignmentsContext_1 = require("../assignment/AssignmentsContext");
|
|
9
9
|
const ChartContext_1 = require("../context/ChartContext");
|
|
10
10
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
11
11
|
const LoaderContext_1 = require("../context/LoaderContext");
|
|
@@ -24,7 +24,7 @@ function KeysListenerTracker() {
|
|
|
24
24
|
const { handleChangeOption, handleFullZoomOut, alignSpectrumsVerticallyHandler, changeDisplayViewModeHandler, } = (0, useToolsFunctions_1.default)();
|
|
25
25
|
const { saveToClipboardHandler, saveAsJSONHandler, saveAsHandler } = (0, useExport_1.default)();
|
|
26
26
|
const { highlight, remove } = (0, index_1.useHighlightData)();
|
|
27
|
-
const assignmentData = (0,
|
|
27
|
+
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
28
28
|
const allow1DTool = (0, react_1.useMemo)(() => {
|
|
29
29
|
return displayerMode === Constants_1.DISPLAYER_MODE.DM_1D && data && data.length > 0;
|
|
30
30
|
}, [data, displayerMode]);
|
|
@@ -77,7 +77,6 @@ const containerStyles = (0, react_1.css) `
|
|
|
77
77
|
|
|
78
78
|
button {
|
|
79
79
|
cursor: pointer;
|
|
80
|
-
color: black;
|
|
81
80
|
&:disabled {
|
|
82
81
|
cursor: default;
|
|
83
82
|
}
|
|
@@ -104,25 +103,6 @@ const containerStyles = (0, react_1.css) `
|
|
|
104
103
|
.SplitPane {
|
|
105
104
|
height: 100%;
|
|
106
105
|
}
|
|
107
|
-
|
|
108
|
-
.Resizer.vertical:after {
|
|
109
|
-
content: '\\22EE';
|
|
110
|
-
top: 50%;
|
|
111
|
-
color: black;
|
|
112
|
-
position: absolute;
|
|
113
|
-
font-size: 14px;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.Resizer.vertical {
|
|
117
|
-
padding: 2px;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.Resizer.vertical:hover {
|
|
121
|
-
background-color: #dfdfdf !important;
|
|
122
|
-
border-left: 0.55px #bbbbbb;
|
|
123
|
-
solid;
|
|
124
|
-
border-right: 0.55px #bbbbbb solid;
|
|
125
|
-
}
|
|
126
106
|
`;
|
|
127
107
|
const defaultPreferences = {};
|
|
128
108
|
const defaultData = {
|
|
@@ -133,7 +113,7 @@ function NMRium(props) {
|
|
|
133
113
|
}
|
|
134
114
|
function InnerNMRium({ data: dataProp = defaultData, workspace, preferences = defaultPreferences, getSpinner = SpinnerContext_1.defaultGetSpinner, onDataChange, emptyText, }) {
|
|
135
115
|
const rootRef = (0, react_2.useRef)(null);
|
|
136
|
-
const
|
|
116
|
+
const elementsWrapperRef = (0, react_2.useRef)(null);
|
|
137
117
|
const [show, toggle] = (0, react_use_1.useToggle)(false);
|
|
138
118
|
const isFullscreen = (0, react_use_1.useFullscreen)(rootRef, show, {
|
|
139
119
|
onClose: () => {
|
|
@@ -175,16 +155,29 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, preferences = de
|
|
|
175
155
|
e.preventDefault();
|
|
176
156
|
}
|
|
177
157
|
}, []);
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
158
|
+
const mainDivRef = (0, react_2.useRef)(null);
|
|
159
|
+
(0, react_2.useEffect)(() => {
|
|
160
|
+
const div = mainDivRef.current;
|
|
161
|
+
if (!div) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
function mouseEnterHandler() {
|
|
165
|
+
dispatchMiddleWare({ type: Types_1.SET_MOUSE_OVER_DISPLAYER, payload: true });
|
|
166
|
+
}
|
|
167
|
+
function mouseLeaveHandler() {
|
|
168
|
+
dispatchMiddleWare({ type: Types_1.SET_MOUSE_OVER_DISPLAYER, payload: false });
|
|
169
|
+
}
|
|
170
|
+
div.addEventListener('mouseenter', mouseEnterHandler);
|
|
171
|
+
div.addEventListener('mouseleave', mouseLeaveHandler);
|
|
172
|
+
return () => {
|
|
173
|
+
div.removeEventListener('mouseenter', mouseEnterHandler);
|
|
174
|
+
div.removeEventListener('mouseleave', mouseLeaveHandler);
|
|
175
|
+
};
|
|
183
176
|
}, [dispatchMiddleWare]);
|
|
184
177
|
return ((0, jsx_runtime_1.jsx)(GlobalContext_1.GlobalProvider, { value: {
|
|
185
178
|
rootRef: rootRef.current,
|
|
186
|
-
|
|
187
|
-
}, children: (0, jsx_runtime_1.jsx)(PreferencesContext_1.PreferencesProvider, { value: preferencesState, children: (0, jsx_runtime_1.jsx)("div", {
|
|
179
|
+
elementsWrapperRef: elementsWrapperRef.current,
|
|
180
|
+
}, children: (0, jsx_runtime_1.jsx)(PreferencesContext_1.PreferencesProvider, { value: preferencesState, children: (0, jsx_runtime_1.jsx)("div", { ref: mainDivRef, style: { height: '100%', position: 'relative' }, children: (0, jsx_runtime_1.jsx)(Alert_1.AlertProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(DispatchContext_1.DispatchProvider, { value: dispatchMiddleWare, children: (0, jsx_runtime_1.jsx)(ChartContext_1.ChartDataProvider, { value: state, children: (0, jsx_runtime_1.jsx)(Modal_1.ModalProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(highlight_1.HighlightProvider, { children: (0, jsx_runtime_1.jsx)(assignment_1.AssignmentProvider, { spectraData: spectraData, children: (0, jsx_runtime_1.jsx)(SpinnerContext_1.SpinnerProvider, { value: getSpinner, children: (0, jsx_runtime_1.jsx)("div", { className: "nmrium-container", ref: rootRef, css: containerStyles, onContextMenu: preventContextMenuHandler, style: { height: '100%', width: '100%' }, children: (0, jsx_runtime_1.jsx)(DropZone_1.default, { children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
188
181
|
display: 'flex',
|
|
189
182
|
flexDirection: 'column',
|
|
190
183
|
backgroundColor: 'white',
|
|
@@ -197,7 +190,7 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, preferences = de
|
|
|
197
190
|
width: '100%',
|
|
198
191
|
height: '100%',
|
|
199
192
|
}, children: displayerMode ===
|
|
200
|
-
Constants_1.DISPLAYER_MODE.DM_1D ? ((0, jsx_runtime_1.jsx)(Viewer1D_1.default, { emptyText: emptyText })) : ((0, jsx_runtime_1.jsx)(Viewer2D_1.default, { emptyText: emptyText })) })] }), (0, jsx_runtime_1.jsx)(Panels_1.default, {})] }), (0, jsx_runtime_1.jsx)("div", { ref:
|
|
193
|
+
Constants_1.DISPLAYER_MODE.DM_1D ? ((0, jsx_runtime_1.jsx)(Viewer1D_1.default, { emptyText: emptyText })) : ((0, jsx_runtime_1.jsx)(Viewer2D_1.default, { emptyText: emptyText })) })] }), (0, jsx_runtime_1.jsx)(Panels_1.default, {})] }), (0, jsx_runtime_1.jsx)("div", { ref: elementsWrapperRef, id: "main-wrapper", style: {
|
|
201
194
|
position: 'absolute',
|
|
202
195
|
pointerEvents: 'none',
|
|
203
196
|
zIndex: 0,
|