nmrium 0.50.0 → 0.51.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/README.md +7 -7
- package/lib/component/1d/Chart1D.js +1 -1
- package/lib/component/1d/LinesSeries.js +2 -2
- package/lib/component/1d/Viewer1D.js +6 -11
- package/lib/component/1d/database/DatabaseSpectrum.js +3 -3
- package/lib/component/2d/1d-tracer/HorizontalSliceChart.js +6 -2
- package/lib/component/2d/1d-tracer/VerticalSliceChart.js +8 -1
- package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraceWithMouse.js +2 -21
- package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.js +1 -1
- package/lib/component/2d/1d-tracer/phase-correction-traces/SpectraPhaseTraces.d.ts +1 -1
- package/lib/component/2d/1d-tracer/phase-correction-traces/SpectraPhaseTraces.js +6 -17
- package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.d.ts +6 -10
- package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js +62 -13
- package/lib/component/2d/1d-tracer/phase-correction-traces/useActivePhaseTraces.d.ts +1 -0
- package/lib/component/2d/1d-tracer/phase-correction-traces/useActivePhaseTraces.js +2 -1
- package/lib/component/2d/Viewer2D.js +16 -15
- package/lib/component/2d/ft/Contours.js +6 -3
- package/lib/component/2d/utilities/scale.d.ts +2 -1
- package/lib/component/2d/utilities/scale.js +12 -2
- package/lib/component/EventsTrackers/BrushTracker.d.ts +5 -3
- package/lib/component/EventsTrackers/BrushTracker.js +2 -2
- package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +29 -15
- package/lib/component/context/ToasterContext.d.ts +13 -0
- package/lib/component/context/ToasterContext.js +34 -0
- package/lib/component/elements/CloseButton.d.ts +2 -2
- package/lib/component/elements/CloseButton.js +1 -1
- package/lib/component/elements/CounterLabel.d.ts +3 -3
- package/lib/component/elements/CounterLabel.js +3 -3
- package/lib/component/elements/PreferencesButton.d.ts +2 -2
- package/lib/component/elements/PreferencesButton.js +2 -4
- package/lib/component/elements/SaveButton.d.ts +2 -2
- package/lib/component/elements/SaveButton.js +1 -1
- package/lib/component/elements/Select.js +2 -2
- package/lib/component/elements/ToolBarButton.d.ts +1 -8
- package/lib/component/elements/ToolBarButton.js +2 -11
- package/lib/component/elements/ToolbarPopoverItem.d.ts +11 -0
- package/lib/component/elements/ToolbarPopoverItem.js +10 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.js +6 -3
- package/lib/component/header/Header.d.ts +1 -11
- package/lib/component/header/Header.js +5 -6
- package/lib/component/header/PhaseCorrectionPanel.js +24 -33
- package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.d.ts +1 -1
- package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.js +96 -42
- package/lib/component/header/RangesPickingOptionPanel.js +6 -3
- package/lib/component/hooks/useDialogToggle.d.ts +5 -0
- package/lib/component/hooks/useDialogToggle.js +16 -0
- package/lib/component/hooks/useExport.d.ts +9 -1
- package/lib/component/hooks/useExport.js +34 -36
- package/lib/component/hooks/useSaveSettings.js +6 -3
- package/lib/component/hooks/useToolsFunctions.js +6 -4
- package/lib/component/loader/DropZone.js +14 -14
- package/lib/component/main/InnerNMRium.js +5 -9
- package/lib/component/main/InnerNMRiumContents.d.ts +0 -2
- package/lib/component/main/InnerNMRiumContents.js +5 -3
- package/lib/component/main/NMRium.js +2 -2
- package/lib/component/modal/AboutPredictionModal.js +1 -1
- package/lib/component/modal/CopyClipboardModal.js +1 -1
- package/lib/component/modal/EditPeakShapeModal.js +1 -1
- package/lib/component/modal/ExportAsJcampModal.js +15 -15
- package/lib/component/modal/ImportPublicationStringModal.js +5 -3
- package/lib/component/modal/LoadJCAMPModal.js +6 -4
- package/lib/component/modal/PredictSpectraModal.js +11 -9
- package/lib/component/modal/SaveAsModal.d.ts +3 -4
- package/lib/component/modal/SaveAsModal.js +27 -27
- package/lib/component/modal/aboutUs/AboutUsModal.js +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +2 -2
- package/lib/component/modal/editRange/forms/components/DeltaInput.d.ts +2 -3
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -3
- package/lib/component/modal/editRange/forms/components/InfoBlock.d.ts +1 -0
- package/lib/component/modal/editRange/forms/components/{SignalFormInfo.js → InfoBlock.js} +2 -2
- package/lib/component/modal/editRange/forms/components/NewSignalTab.d.ts +5 -0
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js +85 -0
- package/lib/component/modal/editRange/forms/components/SignalTab.d.ts +7 -0
- package/lib/component/modal/editRange/forms/components/SignalTab.js +24 -0
- package/lib/component/modal/editRange/forms/components/SignalsContent.d.ts +8 -0
- package/lib/component/modal/editRange/forms/components/SignalsContent.js +57 -0
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.d.ts +5 -0
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +133 -0
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.d.ts +5 -0
- package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +141 -0
- package/lib/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.d.ts +7 -4
- package/lib/component/modal/metaImportation/MetaImportationModal.js +23 -13
- package/lib/component/modal/metaImportation/utils/mapColumnToSelectItems.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +7 -4
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +16 -2
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -4
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +20 -6
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +16 -3
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +14 -10
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +6 -4
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +48 -14
- package/lib/component/panels/RangesPanel/RangesHeader.js +73 -13
- package/lib/component/panels/RangesPanel/RangesPanel.js +4 -4
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +49 -8
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +11 -5
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +1 -1
- package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +28 -18
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +28 -4
- package/lib/component/panels/databasePanel/DatabasePanel.js +37 -19
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.d.ts +3 -3
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +4 -4
- package/lib/component/panels/filtersPanel/FilterPanel.js +6 -4
- package/lib/component/panels/filtersPanel/FiltersTable.js +27 -23
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +10 -6
- package/lib/component/panels/header/DefaultPanelHeader.js +26 -10
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +6 -4
- package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +2 -2
- package/lib/component/panels/multipleAnalysisPanel/AnalysisChart.js +3 -3
- package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +36 -7
- package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +4 -2
- package/lib/component/panels/predictionPanel/PredictionPanel.js +7 -5
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +5 -1
- package/lib/component/reducer/Reducer.d.ts +2 -2
- package/lib/component/reducer/Reducer.js +23 -16
- package/lib/component/reducer/actions/FiltersActions.d.ts +11 -4
- package/lib/component/reducer/actions/FiltersActions.js +243 -91
- package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
- package/lib/component/reducer/actions/IntegralsActions.js +2 -2
- package/lib/component/reducer/actions/MoleculeActions.js +0 -1
- package/lib/component/reducer/actions/RangesActions.js +16 -6
- package/lib/component/reducer/actions/ToolsActions.d.ts +3 -3
- package/lib/component/reducer/actions/ToolsActions.js +75 -14
- package/lib/component/reducer/helper/Zoom1DManager.d.ts +4 -3
- package/lib/component/reducer/helper/Zoom1DManager.js +4 -4
- package/lib/component/reducer/helper/ZoomHistoryManager.js +1 -5
- package/lib/component/reducer/helper/findStrongestPeak.d.ts +6 -0
- package/lib/component/reducer/helper/findStrongestPeak.js +13 -0
- package/lib/component/reducer/helper/getTwoDimensionPhaseCorrectionOptions.d.ts +2 -1
- package/lib/component/reducer/helper/getTwoDimensionPhaseCorrectionOptions.js +7 -1
- package/lib/component/toolbar/ToolBar.js +241 -8
- package/lib/component/toolbar/toolbarMenu.d.ts +4 -0
- package/lib/component/toolbar/toolbarMenu.js +77 -0
- package/lib/component/utility/Events.d.ts +11 -0
- package/lib/component/utility/Events.js +22 -0
- package/lib/component/utility/booleanToString.d.ts +6 -0
- package/lib/component/utility/booleanToString.js +4 -0
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +0 -33
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -15
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -4
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +6 -4
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +13 -3
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +6 -0
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts +13 -3
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +78 -18
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +2 -2
- package/lib/data/data1d/spectrumSimulation.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/contours.js +3 -3
- package/lib/data/data2d/Spectrum2D/getMissingProjection.js +2 -2
- package/lib/data/data2d/Spectrum2D/getSlice.js +3 -3
- package/lib/data/getDefaultMatrixFilters.js +2 -2
- package/lib/data/matrixGeneration.js +1 -1
- package/lib/data/utilities/calculateSanPlot.d.ts +1 -6
- package/lib/versionInfo.js +1 -1
- package/package.json +31 -30
- package/lib/component/elements/DeleteButton.d.ts +0 -6
- package/lib/component/elements/DeleteButton.js +0 -8
- package/lib/component/elements/DropdownMenu.d.ts +0 -9
- package/lib/component/elements/DropdownMenu.js +0 -7
- package/lib/component/elements/FilterButton.d.ts +0 -6
- package/lib/component/elements/FilterButton.js +0 -8
- package/lib/component/elements/popup/Alert/AlertBlock.d.ts +0 -8
- package/lib/component/elements/popup/Alert/AlertBlock.js +0 -30
- package/lib/component/elements/popup/Alert/Context.d.ts +0 -27
- package/lib/component/elements/popup/Alert/Context.js +0 -10
- package/lib/component/elements/popup/Alert/ProgressIndicator.d.ts +0 -1
- package/lib/component/elements/popup/Alert/ProgressIndicator.js +0 -33
- package/lib/component/elements/popup/Alert/Provider.d.ts +0 -19
- package/lib/component/elements/popup/Alert/Provider.js +0 -127
- package/lib/component/elements/popup/Alert/index.d.ts +0 -3
- package/lib/component/elements/popup/Alert/index.js +0 -3
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +0 -10
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +0 -81
- package/lib/component/modal/editRange/forms/components/CouplingsTable.d.ts +0 -13
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +0 -63
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.d.ts +0 -1
- package/lib/component/modal/editRange/forms/components/SignalFormTab.d.ts +0 -8
- package/lib/component/modal/editRange/forms/components/SignalFormTab.js +0 -18
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +0 -10
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +0 -114
- package/lib/component/modal/metaImportation/index.d.ts +0 -2
- package/lib/component/modal/metaImportation/index.js +0 -17
- package/lib/component/panels/PeaksPanel/PeaksToggleActions.d.ts +0 -12
- package/lib/component/panels/PeaksPanel/PeaksToggleActions.js +0 -7
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +0 -7
- package/lib/component/reducer/helper/getStrongestPeak.js +0 -15
- package/lib/component/toolbar/BasicToolBar.d.ts +0 -1
- package/lib/component/toolbar/BasicToolBar.js +0 -165
- package/lib/component/toolbar/FunctionToolBar.d.ts +0 -3
- package/lib/component/toolbar/FunctionToolBar.js +0 -148
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { SvgNmrPeaks, SvgNmrPeaksTopLabels } from 'cheminfo-font';
|
|
3
|
-
import { Toolbar } from 'react-science/ui';
|
|
4
|
-
export function PeaksToggleActions(props) {
|
|
5
|
-
const { disabled, togglePeaks, togglePeaksId, toggleDisplayingMode, toggleDisplayingModeId, onShowToggle, onDisplayingModeToggle, } = props;
|
|
6
|
-
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { id: togglePeaksId, disabled: disabled, icon: _jsx(SvgNmrPeaks, {}), title: `${togglePeaks ? 'Hide' : 'Show'} peaks`, onClick: onShowToggle, active: togglePeaks }), _jsx(Toolbar.Item, { id: toggleDisplayingModeId, disabled: disabled, icon: _jsx(SvgNmrPeaksTopLabels, {}), title: toggleDisplayingMode === 'spread' ? 'Single Mode' : 'Spread mode', onClick: onDisplayingModeToggle, active: toggleDisplayingMode === 'spread' })] }));
|
|
7
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { max } from 'd3';
|
|
2
|
-
import { getActiveSpectrum } from './getActiveSpectrum';
|
|
3
|
-
export function getStrongestPeak(draft) {
|
|
4
|
-
const activeSpectrum = getActiveSpectrum(draft);
|
|
5
|
-
if (activeSpectrum) {
|
|
6
|
-
const activeData = draft.data[activeSpectrum?.index].data;
|
|
7
|
-
const strongestPeakValue = max(activeData.re);
|
|
8
|
-
const index = activeData.re.indexOf(strongestPeakValue);
|
|
9
|
-
return {
|
|
10
|
-
xValue: activeData.x[index],
|
|
11
|
-
yValue: strongestPeakValue,
|
|
12
|
-
index,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function BasicToolBar(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { SvgNmrRealImag, SvgNmrOverlay3, SvgNmrOverlay3Aligned, SvgNmrAlignBottom, SvgNmrAlignCenter, } from 'cheminfo-font';
|
|
3
|
-
import { memo } from 'react';
|
|
4
|
-
import { FaDownload, FaFileDownload, FaFileImage, FaCopy, FaFileExport, FaFile, FaFileImport, } from 'react-icons/fa';
|
|
5
|
-
import { Toolbar, useOnOff } from 'react-science/ui';
|
|
6
|
-
import { useChartData } from '../context/ChartContext';
|
|
7
|
-
import { useLoader } from '../context/LoaderContext';
|
|
8
|
-
import { DropdownMenu } from '../elements/DropdownMenu';
|
|
9
|
-
import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature';
|
|
10
|
-
import { useCheckToolsVisibility } from '../hooks/useCheckToolsVisibility';
|
|
11
|
-
import useDatumWithSpectraStatistics from '../hooks/useDatumWithSpectraStatistics';
|
|
12
|
-
import useExport from '../hooks/useExport';
|
|
13
|
-
import useToolsFunctions from '../hooks/useToolsFunctions';
|
|
14
|
-
import { useVerticalAlign } from '../hooks/useVerticalAlign';
|
|
15
|
-
import ImportPublicationStringModal from '../modal/ImportPublicationStringModal';
|
|
16
|
-
import { LoadJCAMPModal } from '../modal/LoadJCAMPModal';
|
|
17
|
-
import { useMetaInformationImportationModal } from '../modal/metaImportation';
|
|
18
|
-
import { options } from './ToolTypes';
|
|
19
|
-
const IMPORT_MENU = [
|
|
20
|
-
{
|
|
21
|
-
icon: _jsx(FaFile, {}),
|
|
22
|
-
text: 'Import from file system (Press Ctrl + O)',
|
|
23
|
-
data: {
|
|
24
|
-
id: 'importFile',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
icon: _jsx(FaFile, {}),
|
|
29
|
-
text: 'Add JCAMP-DX from URL',
|
|
30
|
-
data: {
|
|
31
|
-
id: 'importJDX',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
icon: _jsx(FaFile, {}),
|
|
36
|
-
text: 'Generate spectrum from publication string',
|
|
37
|
-
data: {
|
|
38
|
-
id: 'importPublicationString',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
icon: _jsx(FaFile, {}),
|
|
43
|
-
text: 'Import meta information',
|
|
44
|
-
data: {
|
|
45
|
-
id: 'importMetaInformation',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
];
|
|
49
|
-
const EXPORT_MENU = [
|
|
50
|
-
{
|
|
51
|
-
icon: _jsx(FaDownload, {}),
|
|
52
|
-
text: 'Export as SVG',
|
|
53
|
-
data: {
|
|
54
|
-
id: 'svg',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
icon: _jsx(FaFileImage, {}),
|
|
59
|
-
text: 'Export as PNG',
|
|
60
|
-
data: {
|
|
61
|
-
id: 'png',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
icon: _jsx(FaFileDownload, {}),
|
|
66
|
-
text: 'Save data ( Press Ctrl + S )',
|
|
67
|
-
data: {
|
|
68
|
-
id: 'json',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
icon: _jsx(FaFileDownload, {}),
|
|
73
|
-
text: 'Save data as ( Press Ctrl + Shift + S )',
|
|
74
|
-
data: {
|
|
75
|
-
id: 'advance_save',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
icon: _jsx(FaFileDownload, {}),
|
|
80
|
-
text: 'Save NMRE data',
|
|
81
|
-
data: {
|
|
82
|
-
id: 'nmre',
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
icon: _jsx(FaCopy, {}),
|
|
87
|
-
text: 'Copy image to Clipboard ( Press Ctrl + C )',
|
|
88
|
-
data: {
|
|
89
|
-
id: 'copy',
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
];
|
|
93
|
-
function BasicToolBarInner({ verticalAlign, ftCounter, fidCounter, }) {
|
|
94
|
-
const openLoader = useLoader();
|
|
95
|
-
const openMetaInformationModal = useMetaInformationImportationModal();
|
|
96
|
-
const isExperimentalFeature = useCheckExperimentalFeature();
|
|
97
|
-
const isButtonVisible = useCheckToolsVisibility();
|
|
98
|
-
const [isLoadJCAMPModalOpened, openLoadJCAMPModal, closeLoadJCAMPModal] = useOnOff(false);
|
|
99
|
-
const [isPublicationStringModalOpened, openPublicationStringModal, closePublicationStringModal,] = useOnOff(false);
|
|
100
|
-
const importMenu = isExperimentalFeature
|
|
101
|
-
? IMPORT_MENU
|
|
102
|
-
: IMPORT_MENU.filter((item) => item.id !== 'importPublicationString');
|
|
103
|
-
const exportMenu = isExperimentalFeature
|
|
104
|
-
? EXPORT_MENU
|
|
105
|
-
: EXPORT_MENU.filter((item) => item.id !== 'nmre');
|
|
106
|
-
const { isRealSpectrumShown, changeSpectrumViewHandler, changeDisplayViewModeHandler, alignSpectrumsVerticallyHandler, } = useToolsFunctions();
|
|
107
|
-
const { saveAsSVGHandler, saveAsPNGHandler, saveAsJSONHandler, saveToClipboardHandler, saveAsHandler, } = useExport();
|
|
108
|
-
function importHandler(data) {
|
|
109
|
-
switch (data?.id) {
|
|
110
|
-
case 'importFile':
|
|
111
|
-
openLoader();
|
|
112
|
-
break;
|
|
113
|
-
case 'importJDX':
|
|
114
|
-
openLoadJCAMPModal();
|
|
115
|
-
break;
|
|
116
|
-
case 'importPublicationString':
|
|
117
|
-
openPublicationStringModal();
|
|
118
|
-
break;
|
|
119
|
-
case 'importMetaInformation':
|
|
120
|
-
openMetaInformationModal();
|
|
121
|
-
break;
|
|
122
|
-
default:
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
function exportHandler(data) {
|
|
126
|
-
switch (data?.id) {
|
|
127
|
-
case 'svg':
|
|
128
|
-
void saveAsSVGHandler();
|
|
129
|
-
break;
|
|
130
|
-
case 'png':
|
|
131
|
-
void saveAsPNGHandler();
|
|
132
|
-
break;
|
|
133
|
-
case 'json':
|
|
134
|
-
saveAsJSONHandler();
|
|
135
|
-
break;
|
|
136
|
-
case 'advance_save':
|
|
137
|
-
void saveAsHandler();
|
|
138
|
-
break;
|
|
139
|
-
case 'copy':
|
|
140
|
-
void saveToClipboardHandler();
|
|
141
|
-
break;
|
|
142
|
-
default:
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return (_jsxs(_Fragment, { children: [_jsx(LoadJCAMPModal, { isOpen: isLoadJCAMPModalOpened, onCloseDialog: closeLoadJCAMPModal }), _jsx(ImportPublicationStringModal, { isOpen: isPublicationStringModalOpened, onClose: closePublicationStringModal }), isButtonVisible('import') && (_jsx(DropdownMenu, { placement: "right-start", onSelect: (data) => {
|
|
147
|
-
importHandler(data);
|
|
148
|
-
}, targetTagName: "div", targetProps: { style: { flex: 'none' } }, options: importMenu, children: _jsx(Toolbar.Item, { id: options.import.id, title: options.import.label, icon: _jsx(FaFileImport, {}) }) })), isButtonVisible('exportAs') && (_jsx(DropdownMenu, { onSelect: (data) => {
|
|
149
|
-
exportHandler(data);
|
|
150
|
-
}, placement: "right-start", targetTagName: "div", targetProps: { style: { flex: 'none' } }, options: exportMenu, children: _jsx(Toolbar.Item, { id: options.exportAs.id, title: options.exportAs.label, icon: _jsx(FaFileExport, {}) }) })), isButtonVisible('spectraStackAlignments') && ftCounter > 1 && (_jsx(Toolbar.Item, { id: "spectra-alignment", className: "cheminfo", title: "Spectra alignment ( Press s )", onClick: changeDisplayViewModeHandler, icon: verticalAlign === 'stack' ? (_jsx(SvgNmrOverlay3Aligned, {})) : (_jsx(SvgNmrOverlay3, {})) })), isButtonVisible('realImaginary') && (_jsx(Toolbar.Item, { id: "display", title: isRealSpectrumShown ? 'Display real ' : 'Display imaginary', onClick: changeSpectrumViewHandler, className: "cheminfo", icon: _jsx(SvgNmrRealImag, {}) })), isButtonVisible('spectraCenterAlignments') &&
|
|
151
|
-
(ftCounter > 0 || fidCounter > 0) && (_jsx(Toolbar.Item, { id: "baseline-position", title: verticalAlign === 'bottom'
|
|
152
|
-
? 'Baseline center ( Press c )'
|
|
153
|
-
: 'Baseline bottom ( Press c )', onClick: alignSpectrumsVerticallyHandler, className: "cheminfo", icon: _jsx(_Fragment, { children: verticalAlign === 'bottom' ? (_jsx(SvgNmrAlignCenter, {})) : (_jsx(SvgNmrAlignBottom, {})) }) }))] }));
|
|
154
|
-
}
|
|
155
|
-
const MemoizedBasicToolBar = memo(BasicToolBarInner);
|
|
156
|
-
export default function BasicToolBar() {
|
|
157
|
-
const { displayerMode, view: { spectra: { activeTab }, }, } = useChartData();
|
|
158
|
-
const verticalAlign = useVerticalAlign();
|
|
159
|
-
const { fidCounter, ftCounter } = useDatumWithSpectraStatistics();
|
|
160
|
-
return (_jsx(MemoizedBasicToolBar, { fidCounter,
|
|
161
|
-
ftCounter,
|
|
162
|
-
verticalAlign,
|
|
163
|
-
displayerMode,
|
|
164
|
-
activeTab }));
|
|
165
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { SvgNmrApodization, SvgNmrBaselineCorrection, SvgNmrFourierTransform, SvgNmrIntegrate, SvgNmrMultipleAnalysis, SvgNmrPeakPicking, SvgNmrPhaseCorrection, SvgNmrRangePicking, SvgNmrZeroFilling, } from 'cheminfo-font';
|
|
3
|
-
import { useState, useEffect, useCallback, memo } from 'react';
|
|
4
|
-
import { FaSearchPlus, FaExpand, FaDiceFour } from 'react-icons/fa';
|
|
5
|
-
import { PiKnifeBold } from 'react-icons/pi';
|
|
6
|
-
import { Toolbar } from 'react-science/ui';
|
|
7
|
-
import { useChartData } from '../context/ChartContext';
|
|
8
|
-
import { useDispatch } from '../context/DispatchContext';
|
|
9
|
-
import { useCheckToolsVisibility, } from '../hooks/useCheckToolsVisibility';
|
|
10
|
-
import useDatumWithSpectraStatistics from '../hooks/useDatumWithSpectraStatistics';
|
|
11
|
-
import useToolsFunctions from '../hooks/useToolsFunctions';
|
|
12
|
-
import { options } from './ToolTypes';
|
|
13
|
-
function FunctionToolBarInner({ defaultValue, ftCounter, }) {
|
|
14
|
-
const [option, setOption] = useState('');
|
|
15
|
-
const isButtonVisible = useCheckToolsVisibility();
|
|
16
|
-
const dispatch = useDispatch();
|
|
17
|
-
const { handleChangeOption, handleFullZoomOut } = useToolsFunctions();
|
|
18
|
-
const handleChange = useCallback((selectedOption) => {
|
|
19
|
-
setOption(selectedOption);
|
|
20
|
-
handleChangeOption(selectedOption);
|
|
21
|
-
}, [handleChangeOption]);
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
setOption(defaultValue);
|
|
24
|
-
}, [defaultValue]);
|
|
25
|
-
const handleOnFFTFilter = useCallback(() => {
|
|
26
|
-
dispatch({
|
|
27
|
-
type: 'APPLY_FFT_FILTER',
|
|
28
|
-
});
|
|
29
|
-
}, [dispatch]);
|
|
30
|
-
const handleFFtDimension1Filter = useCallback(() => {
|
|
31
|
-
dispatch({
|
|
32
|
-
type: 'APPLY_FFT_DIMENSION_1_FILTER',
|
|
33
|
-
});
|
|
34
|
-
}, [dispatch]);
|
|
35
|
-
const handleFFtDimension2Filter = useCallback(() => {
|
|
36
|
-
dispatch({
|
|
37
|
-
type: 'APPLY_FFT_DIMENSION_2_FILTER',
|
|
38
|
-
});
|
|
39
|
-
}, [dispatch]);
|
|
40
|
-
const toolItems = [
|
|
41
|
-
{
|
|
42
|
-
id: 'zoom',
|
|
43
|
-
label: options.zoom.label,
|
|
44
|
-
icon: _jsx(FaSearchPlus, {}),
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: 'zoomOut',
|
|
48
|
-
label: 'Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )',
|
|
49
|
-
onClick: handleFullZoomOut,
|
|
50
|
-
icon: _jsx(FaExpand, {}),
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
id: 'peakPicking',
|
|
54
|
-
label: `${options.peakPicking.label} ( Press p )`,
|
|
55
|
-
icon: _jsx(SvgNmrPeakPicking, {}),
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
id: 'integral',
|
|
59
|
-
label: `${options.integral.label} ( Press i )`,
|
|
60
|
-
icon: _jsx(SvgNmrIntegrate, {}),
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: 'zonePicking',
|
|
64
|
-
label: `${options.zonePicking.label} ( Press r )`,
|
|
65
|
-
icon: _jsx(FaDiceFour, {}),
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
id: 'slicing',
|
|
69
|
-
label: options.slicing.label,
|
|
70
|
-
icon: _jsx(PiKnifeBold, {}),
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
id: 'rangePicking',
|
|
74
|
-
label: `${options.rangePicking.label} ( Press r )`,
|
|
75
|
-
icon: _jsx(SvgNmrRangePicking, {}),
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
id: 'multipleSpectraAnalysis',
|
|
79
|
-
label: options.multipleSpectraAnalysis.label,
|
|
80
|
-
icon: _jsx(SvgNmrMultipleAnalysis, {}),
|
|
81
|
-
checkOptions: { checkSpectrumType: false },
|
|
82
|
-
condition: ftCounter > 1,
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
id: 'apodization',
|
|
86
|
-
label: `${options.apodization.label} (Press a)`,
|
|
87
|
-
icon: _jsx(SvgNmrApodization, {}),
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
id: 'zeroFilling',
|
|
91
|
-
label: `${options.zeroFilling.label} ( Press z )`,
|
|
92
|
-
icon: _jsx(SvgNmrZeroFilling, {}),
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
id: 'phaseCorrection',
|
|
96
|
-
label: `${options.phaseCorrection.label} ( Press a )`,
|
|
97
|
-
icon: _jsx(SvgNmrPhaseCorrection, {}),
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: 'phaseCorrectionTwoDimensions',
|
|
101
|
-
label: `${options.phaseCorrectionTwoDimensions.label} ( Press a )`,
|
|
102
|
-
icon: _jsx(SvgNmrPhaseCorrection, {}),
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
id: 'baselineCorrection',
|
|
106
|
-
label: `${options.baselineCorrection.label} ( Press b )`,
|
|
107
|
-
icon: _jsx(SvgNmrBaselineCorrection, {}),
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
id: 'exclusionZones',
|
|
111
|
-
label: `${options.exclusionZones.label} ( Press e )`,
|
|
112
|
-
icon: _jsx(SvgNmrMultipleAnalysis, {}),
|
|
113
|
-
checkOptions: { checkSpectrumType: false },
|
|
114
|
-
condition: ftCounter > 0,
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
id: 'fft',
|
|
118
|
-
label: `${options.fft.label} ( Press t )`,
|
|
119
|
-
onClick: handleOnFFTFilter,
|
|
120
|
-
icon: _jsx(SvgNmrFourierTransform, {}),
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
id: 'fftDimension1',
|
|
124
|
-
label: options.fftDimension1.label,
|
|
125
|
-
onClick: handleFFtDimension1Filter,
|
|
126
|
-
icon: _jsx(SvgNmrFourierTransform, {}),
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
id: 'fftDimension2',
|
|
130
|
-
label: options.fftDimension2.label,
|
|
131
|
-
onClick: handleFFtDimension2Filter,
|
|
132
|
-
icon: _jsx(SvgNmrFourierTransform, {}),
|
|
133
|
-
},
|
|
134
|
-
];
|
|
135
|
-
return (_jsx(_Fragment, { children: toolItems.map((item) => {
|
|
136
|
-
const { id, icon, label, checkOptions, onClick, condition } = item;
|
|
137
|
-
return (isButtonVisible(id, checkOptions) &&
|
|
138
|
-
(condition === undefined || condition) && (_jsx(Toolbar.Item, { onClick: onClick || (() => handleChange(id)), title: label, id: id, active: option === id, icon: icon }, id)));
|
|
139
|
-
}) }));
|
|
140
|
-
}
|
|
141
|
-
const MemoizedFunctionToolBar = memo(FunctionToolBarInner);
|
|
142
|
-
export default function FunctionToolBar({ defaultValue = options.zoom.id, }) {
|
|
143
|
-
const { displayerMode } = useChartData();
|
|
144
|
-
const data = useDatumWithSpectraStatistics();
|
|
145
|
-
return (_jsx(MemoizedFunctionToolBar, { ...data,
|
|
146
|
-
displayerMode,
|
|
147
|
-
defaultValue }));
|
|
148
|
-
}
|