@zakodium/nmrium-core-plugins-ui 0.1.49 → 0.1.50
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/plugins/spectrum_1d_processings_ui/operators/apodization_tool.d.ts +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_tool.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_tool.js +2 -14
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_tool.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/digital_filter_panel_tool.d.ts +1 -4
- package/lib/plugins/spectrum_1d_processings_ui/operators/digital_filter_panel_tool.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/digital_filter_panel_tool.js +2 -12
- package/lib/plugins/spectrum_1d_processings_ui/operators/digital_filter_panel_tool.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/fft_tool.d.ts +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/fft_tool.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/fft_tool.js +2 -12
- package/lib/plugins/spectrum_1d_processings_ui/operators/fft_tool.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.d.ts +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.js +2 -18
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.d.ts +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.js +2 -12
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.d.ts +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.js +2 -19
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.js.map +1 -1
- package/package.json +4 -4
- package/src/plugins/spectrum_1d_processings_ui/operators/apodization_tool.tsx +3 -19
- package/src/plugins/spectrum_1d_processings_ui/operators/digital_filter_panel_tool.tsx +4 -21
- package/src/plugins/spectrum_1d_processings_ui/operators/fft_tool.tsx +3 -17
- package/src/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.tsx +4 -36
- package/src/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.tsx +3 -17
- package/src/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.tsx +4 -41
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
|
|
2
|
-
export declare function ApodizationTool(props: ProcessingOperatorUIToolProps
|
|
2
|
+
export declare function ApodizationTool(props: ProcessingOperatorUIToolProps): import("react").JSX.Element | null;
|
|
3
3
|
//# sourceMappingURL=apodization_tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apodization_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization_tool.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apodization_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization_tool.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAU3E,wBAAgB,eAAe,CAAC,KAAK,EAAE,6BAA6B,sCAmDnE"}
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useHotkeys } from '@blueprintjs/core';
|
|
3
|
-
import {
|
|
3
|
+
import { isSpectrum1DFid } from '@zakodium/nmrium-core';
|
|
4
4
|
import { SvgNmrApodization } from 'cheminfo-font';
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
7
7
|
import { useEventCallback } from 'usehooks-ts';
|
|
8
|
-
function defaultApodization1DOperation() {
|
|
9
|
-
return {
|
|
10
|
-
operatorId: '@zakodium/nmrium-core-plugins#apodization1D',
|
|
11
|
-
settings: {
|
|
12
|
-
exponential: { apply: true, options: { lineBroadening: 0.3 } },
|
|
13
|
-
},
|
|
14
|
-
options: undefined,
|
|
15
|
-
error: undefined,
|
|
16
|
-
uid: generateID(),
|
|
17
|
-
enabled: true,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
8
|
const NO_SHORTCUTS = [];
|
|
21
9
|
export function ApodizationTool(props) {
|
|
22
10
|
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
@@ -28,7 +16,7 @@ export function ApodizationTool(props) {
|
|
|
28
16
|
// nmrium keyboard listener is also on document
|
|
29
17
|
event.stopImmediatePropagation();
|
|
30
18
|
}
|
|
31
|
-
onTriggerOperation(
|
|
19
|
+
onTriggerOperation();
|
|
32
20
|
});
|
|
33
21
|
const hotkeys = useMemo(() => [
|
|
34
22
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apodization_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization_tool.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"apodization_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization_tool.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,uBA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AAC,kBAAkB,IACjB,KAAK,EAAC,sBAAsB,EAC5B,SAAS,EAAE,CAAC,GAAG,CAAC,EAChB,WAAW,EAAC,qFAAqF,EACjG,IAAI,EAAC,0CAA0C,GAC/C,EAEJ,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,gBAAgB,GACzB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
|
|
2
|
-
declare
|
|
3
|
-
type OperatorId = typeof operatorId;
|
|
4
|
-
export declare function DigitalFilterPanelTool(props: ProcessingOperatorUIToolProps<OperatorId>): import("react").JSX.Element | null;
|
|
5
|
-
export {};
|
|
2
|
+
export declare function DigitalFilterPanelTool(props: ProcessingOperatorUIToolProps): import("react").JSX.Element | null;
|
|
6
3
|
//# sourceMappingURL=digital_filter_panel_tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"digital_filter_panel_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/digital_filter_panel_tool.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"digital_filter_panel_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/digital_filter_panel_tool.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAQ3E,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,6BAA6B,sCA+B1E"}
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { isSpectrum1D } from '@zakodium/nmrium-core';
|
|
3
3
|
import { SvgNmrAddFilter } from 'cheminfo-font';
|
|
4
4
|
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
5
5
|
const operatorId = '@zakodium/nmrium-core-plugins#digitalFilter1D';
|
|
6
|
-
function getDefaultOperation() {
|
|
7
|
-
return {
|
|
8
|
-
operatorId,
|
|
9
|
-
uid: generateID(),
|
|
10
|
-
settings: null,
|
|
11
|
-
options: undefined,
|
|
12
|
-
enabled: true,
|
|
13
|
-
error: undefined,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
6
|
export function DigitalFilterPanelTool(props) {
|
|
17
7
|
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
18
8
|
if (!isSpectrum1D(spectrum))
|
|
@@ -23,7 +13,7 @@ export function DigitalFilterPanelTool(props) {
|
|
|
23
13
|
function triggerOperation() {
|
|
24
14
|
if (isDisabled)
|
|
25
15
|
return;
|
|
26
|
-
onTriggerOperation(
|
|
16
|
+
onTriggerOperation();
|
|
27
17
|
}
|
|
28
18
|
return (_jsx(Toolbar.Item, { id: operatorId, icon: _jsx(SvgNmrAddFilter, {}), tooltip: _jsx(TooltipHelpContent, { title: "Digital filter", description: "Apply digital filter from spectrum info." }), active: isActive, disabled: isDisabled, onClick: triggerOperation }));
|
|
29
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"digital_filter_panel_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/digital_filter_panel_tool.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"digital_filter_panel_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/digital_filter_panel_tool.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,UAAU,GACd,+CAAuF,CAAC;AAE1F,MAAM,UAAU,sBAAsB,CAAC,KAAoC;IACzE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IAEjE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzC,MAAM,QAAQ,GAAG,gBAAgB,KAAK,UAAU,CAAC;IAEjD,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC;IAClD,MAAM,UAAU,GAAG,OAAO,aAAa,KAAK,QAAQ,IAAI,aAAa,IAAI,CAAC,CAAC;IAE3E,SAAS,gBAAgB;QACvB,IAAI,UAAU;YAAE,OAAO;QAEvB,kBAAkB,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,CACL,KAAC,OAAO,CAAC,IAAI,IACX,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,KAAC,eAAe,KAAG,EACzB,OAAO,EACL,KAAC,kBAAkB,IACjB,KAAK,EAAC,gBAAgB,EACtB,WAAW,EAAC,0CAA0C,GACtD,EAEJ,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,gBAAgB,GACzB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
|
|
2
|
-
export declare function FFTTool(props: ProcessingOperatorUIToolProps
|
|
2
|
+
export declare function FFTTool(props: ProcessingOperatorUIToolProps): import("react").JSX.Element | null;
|
|
3
3
|
//# sourceMappingURL=fft_tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fft_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/fft_tool.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fft_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/fft_tool.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAQ3E,wBAAgB,OAAO,CAAC,KAAK,EAAE,6BAA6B,sCAgD3D"}
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useHotkeys } from '@blueprintjs/core';
|
|
3
|
-
import {
|
|
3
|
+
import { isSpectrum1DFid } from '@zakodium/nmrium-core';
|
|
4
4
|
import { SvgNmrFourierTransform } from 'cheminfo-font';
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
7
7
|
import { useEventCallback } from 'usehooks-ts';
|
|
8
|
-
function defaultFFTOperation() {
|
|
9
|
-
return {
|
|
10
|
-
operatorId: '@zakodium/nmrium-core-plugins#fft1D',
|
|
11
|
-
settings: null,
|
|
12
|
-
options: undefined,
|
|
13
|
-
error: undefined,
|
|
14
|
-
uid: generateID(),
|
|
15
|
-
enabled: true,
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
8
|
export function FFTTool(props) {
|
|
19
9
|
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
20
10
|
const isActive = activeOperatorId === '@zakodium/nmrium-core-plugins#fft1D';
|
|
@@ -25,7 +15,7 @@ export function FFTTool(props) {
|
|
|
25
15
|
// nmrium keyboard listener is also on document
|
|
26
16
|
event.stopImmediatePropagation();
|
|
27
17
|
}
|
|
28
|
-
onTriggerOperation(
|
|
18
|
+
onTriggerOperation();
|
|
29
19
|
});
|
|
30
20
|
const hotkeys = useMemo(() => {
|
|
31
21
|
return [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fft_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/fft_tool.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"fft_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/fft_tool.tsx"],"names":[],"mappings":";AACA,OAA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,IACX,EAAE,EAAC,qCAAqC,EACxC,IAAI,EAAE,KAAC,sBAAsB,KAAG,EAChC,OAAO,EACL,KAAC,kBAAkB,IACjB,KAAK,EAAC,mBAAmB,EACzB,SAAS,EAAE,CAAC,GAAG,CAAC,EAChB,WAAW,EAAC,yCAAyC,EACrD,IAAI,EAAC,kCAAkC,GACvC,EAEJ,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,gBAAgB,GACzB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
|
|
2
|
-
export declare function PhaseCorrectionTool(props: ProcessingOperatorUIToolProps
|
|
2
|
+
export declare function PhaseCorrectionTool(props: ProcessingOperatorUIToolProps): import("react").JSX.Element | null;
|
|
3
3
|
//# sourceMappingURL=phase_correction_tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phase_correction_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"phase_correction_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAQ3E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,6BAA6B,sCAmDvE"}
|
|
@@ -1,26 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useHotkeys } from '@blueprintjs/core';
|
|
3
|
-
import { castSpectrum1D,
|
|
3
|
+
import { castSpectrum1D, isSpectrum1DFt } from '@zakodium/nmrium-core';
|
|
4
4
|
import { SvgNmrPhaseCorrection } from 'cheminfo-font';
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
7
7
|
import { useEventCallback } from 'usehooks-ts';
|
|
8
|
-
function getPhaseCorrection1DSettings(spectrum) {
|
|
9
|
-
const { phc0 = 0, phc1 = 0 } = spectrum.info;
|
|
10
|
-
if (phc0 === 0 && phc1 === 0)
|
|
11
|
-
return { mode: 'automatic-compute' };
|
|
12
|
-
return { mode: 'automatic-info' };
|
|
13
|
-
}
|
|
14
|
-
function defaultPhaseCorrectionOperation(spectrum) {
|
|
15
|
-
return {
|
|
16
|
-
operatorId: '@zakodium/nmrium-core-plugins#phaseCorrection1D',
|
|
17
|
-
settings: getPhaseCorrection1DSettings(spectrum),
|
|
18
|
-
options: undefined,
|
|
19
|
-
error: undefined,
|
|
20
|
-
uid: generateID(),
|
|
21
|
-
enabled: true,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
8
|
export function PhaseCorrectionTool(props) {
|
|
25
9
|
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
26
10
|
castSpectrum1D(spectrum);
|
|
@@ -32,7 +16,7 @@ export function PhaseCorrectionTool(props) {
|
|
|
32
16
|
// nmrium keyboard listener is also on document
|
|
33
17
|
event.stopImmediatePropagation();
|
|
34
18
|
}
|
|
35
|
-
onTriggerOperation(
|
|
19
|
+
onTriggerOperation();
|
|
36
20
|
});
|
|
37
21
|
const hotkeys = useMemo(() => {
|
|
38
22
|
return [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phase_correction_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"phase_correction_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,cAAc,E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iDAAiD,EACpD,IAAI,EAAE,KAAC,qBAAqB,KAAG,EAC/B,OAAO,EACL,KAAC,kBAAkB,IACjB,KAAK,EAAC,kBAAkB,EACxB,SAAS,EAAE,CAAC,GAAG,CAAC,EAChB,WAAW,EAAC,gLAAgL,EAC5L,IAAI,EAAC,qCAAqC,GAC1C,EAEJ,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,gBAAgB,GACzB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
|
|
2
|
-
export declare function ShiftXPanelTool(props: ProcessingOperatorUIToolProps
|
|
2
|
+
export declare function ShiftXPanelTool(props: ProcessingOperatorUIToolProps): import("react").JSX.Element | null;
|
|
3
3
|
//# sourceMappingURL=shift_x_panel_tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shift_x_panel_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shift_x_panel_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAI3E,wBAAgB,eAAe,CAAC,KAAK,EAAE,6BAA6B,sCAuBnE"}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { DoubleCaretHorizontalIcon } from '@blueprintjs/icons';
|
|
3
|
-
import {
|
|
3
|
+
import { isSpectrum1DFt } from '@zakodium/nmrium-core';
|
|
4
4
|
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
5
|
-
function defaultShiftXOperation() {
|
|
6
|
-
return {
|
|
7
|
-
operatorId: '@zakodium/nmrium-core-plugins#shiftX1D',
|
|
8
|
-
settings: 0,
|
|
9
|
-
options: undefined,
|
|
10
|
-
error: undefined,
|
|
11
|
-
uid: generateID(),
|
|
12
|
-
enabled: true,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
5
|
export function ShiftXPanelTool(props) {
|
|
16
6
|
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
17
7
|
const isActive = activeOperatorId === '@zakodium/nmrium-core-plugins#shiftX1D';
|
|
18
8
|
const isVisible = isSpectrum1DFt(spectrum);
|
|
19
9
|
if (!isVisible)
|
|
20
10
|
return null;
|
|
21
|
-
return (_jsx(Toolbar.Item, { id: "@zakodium/nmrium-core-plugins#shiftX1D", icon: _jsx(DoubleCaretHorizontalIcon, {}), tooltip: _jsx(TooltipHelpContent, { title: "Shift X", description: "Move your spectrum along x-axis" }), active: isActive, onClick: () => onTriggerOperation(
|
|
11
|
+
return (_jsx(Toolbar.Item, { id: "@zakodium/nmrium-core-plugins#shiftX1D", icon: _jsx(DoubleCaretHorizontalIcon, {}), tooltip: _jsx(TooltipHelpContent, { title: "Shift X", description: "Move your spectrum along x-axis" }), active: isActive, onClick: () => onTriggerOperation() }));
|
|
22
12
|
}
|
|
23
13
|
//# sourceMappingURL=shift_x_panel_tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shift_x_panel_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"shift_x_panel_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,UAAU,eAAe,CAAC,KAAoC;IAClE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IAEjE,MAAM,QAAQ,GACZ,gBAAgB,KAAK,wCAAwC,CAAC;IAEhE,MAAM,SAAS,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC3C,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAE5B,OAAO,CACL,KAAC,OAAO,CAAC,IAAI,IACX,EAAE,EAAC,wCAAwC,EAC3C,IAAI,EAAE,KAAC,yBAAyB,KAAG,EACnC,OAAO,EACL,KAAC,kBAAkB,IACjB,KAAK,EAAC,SAAS,EACf,WAAW,EAAC,iCAAiC,GAC7C,EAEJ,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,EAAE,GACnC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
|
|
2
|
-
export declare function ZeroFillingTool(props: ProcessingOperatorUIToolProps
|
|
2
|
+
export declare function ZeroFillingTool(props: ProcessingOperatorUIToolProps): import("react").JSX.Element | null;
|
|
3
3
|
//# sourceMappingURL=zero_filling_tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zero_filling_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zero_filling_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAQ3E,wBAAgB,eAAe,CAAC,KAAK,EAAE,6BAA6B,sCAkDnE"}
|
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useHotkeys } from '@blueprintjs/core';
|
|
3
|
-
import {
|
|
3
|
+
import { isSpectrum1DFid } from '@zakodium/nmrium-core';
|
|
4
4
|
import { SvgNmrZeroFilling } from 'cheminfo-font';
|
|
5
|
-
import { nextPowerOfTwo } from 'ml-spectra-processing';
|
|
6
5
|
import { useMemo } from 'react';
|
|
7
6
|
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
8
7
|
import { useEventCallback } from 'usehooks-ts';
|
|
9
|
-
function defaultZeroFillingOperation(spectrum) {
|
|
10
|
-
castSpectrum1D(spectrum);
|
|
11
|
-
const zeroFillingSize = getZeroFillingSize(spectrum);
|
|
12
|
-
return {
|
|
13
|
-
operatorId: '@zakodium/nmrium-core-plugins#zeroFilling1D',
|
|
14
|
-
settings: zeroFillingSize,
|
|
15
|
-
options: undefined,
|
|
16
|
-
error: undefined,
|
|
17
|
-
uid: generateID(),
|
|
18
|
-
enabled: true,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
8
|
export function ZeroFillingTool(props) {
|
|
22
9
|
const { onTriggerOperation, spectrum, activeOperatorId } = props;
|
|
23
10
|
const isActive = activeOperatorId === '@zakodium/nmrium-core-plugins#zeroFilling1D';
|
|
@@ -28,7 +15,7 @@ export function ZeroFillingTool(props) {
|
|
|
28
15
|
// nmrium keyboard listener is also on document
|
|
29
16
|
event.stopImmediatePropagation();
|
|
30
17
|
}
|
|
31
|
-
onTriggerOperation(
|
|
18
|
+
onTriggerOperation();
|
|
32
19
|
});
|
|
33
20
|
const hotkeys = useMemo(() => {
|
|
34
21
|
return [
|
|
@@ -45,8 +32,4 @@ export function ZeroFillingTool(props) {
|
|
|
45
32
|
return null;
|
|
46
33
|
return (_jsx(Toolbar.Item, { id: "@zakodium/nmrium-core-plugins#zeroFilling1D", icon: _jsx(SvgNmrZeroFilling, {}), tooltip: _jsx(TooltipHelpContent, { title: "Zero Filling", shortcuts: ['z'], description: "Improve spectrum quality by increasing the number of points. By default, the number of points is twise as many as in the original FID.", link: "https://docs.nmrium.org/help/zero-filling" }), active: isActive, onClick: triggerOperation }));
|
|
47
34
|
}
|
|
48
|
-
function getZeroFillingSize(spectrum) {
|
|
49
|
-
const dataLength = spectrum.data.x.length;
|
|
50
|
-
return nextPowerOfTwo(dataLength) * 2;
|
|
51
|
-
}
|
|
52
35
|
//# sourceMappingURL=zero_filling_tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zero_filling_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"zero_filling_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,UAAU,eAAe,CAAC,KAAoC;IAClE,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAC;IAEjE,MAAM,QAAQ,GACZ,gBAAgB,KAAK,6CAA6C,CAAC;IAErE,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;IAEvE,MAAM,gBAAgB,GAAG,gBAAgB,CACvC,CAAC,KAAiC,EAAE,EAAE;QACpC,IAAI,0BAA0B,IAAI,KAAK,EAAE,CAAC;YACxC,wCAAwC;YACxC,+CAA+C;YAC/C,KAAK,CAAC,wBAAwB,EAAE,CAAC;QACnC,CAAC;QAED,kBAAkB,EAAE,CAAC;IACvB,CAAC,CACF,CAAC;IAEF,MAAM,OAAO,GAAG,OAAO,CAAiB,GAAG,EAAE;QAC3C,OAAO;YACL;gBACE,KAAK,EAAE,GAAG;gBACV,KAAK,EAAE,cAAc;gBACrB,MAAM,EAAE,IAAI;gBACZ,SAAS,EAAE,gBAAgB;aAC5B;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACrC,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAE5B,OAAO,CACL,KAAC,OAAO,CAAC,IAAI,IACX,EAAE,EAAC,6CAA6C,EAChD,IAAI,EAAE,KAAC,iBAAiB,KAAG,EAC3B,OAAO,EACL,KAAC,kBAAkB,IACjB,KAAK,EAAC,cAAc,EACpB,SAAS,EAAE,CAAC,GAAG,CAAC,EAChB,WAAW,EAAC,wIAAwI,EACpJ,IAAI,EAAC,2CAA2C,GAChD,EAEJ,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,gBAAgB,GACzB,CACH,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakodium/nmrium-core-plugins-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.50",
|
|
4
4
|
"license": "CC-BY-NC-SA-4.0",
|
|
5
5
|
"description": "UI related plugins needed for cheminfo/nmrium",
|
|
6
6
|
"keywords": [],
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@emotion/react": "^11.14.0",
|
|
30
30
|
"@emotion/styled": "^11.14.1",
|
|
31
31
|
"@tanstack/react-form": "^1.33.4",
|
|
32
|
-
"@zakodium/nmrium-core": "^0.7.
|
|
33
|
-
"@zakodium/nmrium-core-plugins": "^0.7.
|
|
32
|
+
"@zakodium/nmrium-core": "^0.7.64",
|
|
33
|
+
"@zakodium/nmrium-core-plugins": "^0.7.86",
|
|
34
34
|
"@zakodium/utils": "^0.5.1",
|
|
35
35
|
"cheminfo-font": "^1.27.0",
|
|
36
36
|
"fifo-logger": "^2.0.1",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"volta": {
|
|
52
52
|
"extends": "../../../package.json"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "971ceb7731dac3c86509b7067f431be4282940db"
|
|
55
55
|
}
|
|
@@ -1,32 +1,16 @@
|
|
|
1
1
|
import type { HotkeyConfig } from '@blueprintjs/core';
|
|
2
2
|
import { useHotkeys } from '@blueprintjs/core';
|
|
3
|
-
import type { Spectrum1DProcessingTypeRegistry } from '@zakodium/nmr-types';
|
|
4
3
|
import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
|
|
5
|
-
import {
|
|
4
|
+
import { isSpectrum1DFid } from '@zakodium/nmrium-core';
|
|
6
5
|
import { SvgNmrApodization } from 'cheminfo-font';
|
|
7
6
|
import type { MouseEvent } from 'react';
|
|
8
7
|
import { useMemo } from 'react';
|
|
9
8
|
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
10
9
|
import { useEventCallback } from 'usehooks-ts';
|
|
11
10
|
|
|
12
|
-
function defaultApodization1DOperation(): Spectrum1DProcessingTypeRegistry['@zakodium/nmrium-core-plugins#apodization1D'] {
|
|
13
|
-
return {
|
|
14
|
-
operatorId: '@zakodium/nmrium-core-plugins#apodization1D',
|
|
15
|
-
settings: {
|
|
16
|
-
exponential: { apply: true, options: { lineBroadening: 0.3 } },
|
|
17
|
-
},
|
|
18
|
-
options: undefined,
|
|
19
|
-
error: undefined,
|
|
20
|
-
uid: generateID(),
|
|
21
|
-
enabled: true,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
11
|
const NO_SHORTCUTS: HotkeyConfig[] = [];
|
|
26
12
|
|
|
27
|
-
export function ApodizationTool(
|
|
28
|
-
props: ProcessingOperatorUIToolProps<'@zakodium/nmrium-core-plugins#apodization1D'>,
|
|
29
|
-
) {
|
|
13
|
+
export function ApodizationTool(props: ProcessingOperatorUIToolProps) {
|
|
30
14
|
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
31
15
|
|
|
32
16
|
const isActive =
|
|
@@ -42,7 +26,7 @@ export function ApodizationTool(
|
|
|
42
26
|
event.stopImmediatePropagation();
|
|
43
27
|
}
|
|
44
28
|
|
|
45
|
-
onTriggerOperation(
|
|
29
|
+
onTriggerOperation();
|
|
46
30
|
},
|
|
47
31
|
);
|
|
48
32
|
|
|
@@ -1,30 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ProcessingOperatorId,
|
|
3
|
-
SpectrumProcessingTypeRegistry,
|
|
4
|
-
} from '@zakodium/nmr-types';
|
|
1
|
+
import type { ProcessingOperatorId } from '@zakodium/nmr-types';
|
|
5
2
|
import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
|
|
6
|
-
import {
|
|
3
|
+
import { isSpectrum1D } from '@zakodium/nmrium-core';
|
|
7
4
|
import { SvgNmrAddFilter } from 'cheminfo-font';
|
|
8
5
|
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
9
6
|
|
|
10
7
|
const operatorId =
|
|
11
8
|
'@zakodium/nmrium-core-plugins#digitalFilter1D' as const satisfies ProcessingOperatorId;
|
|
12
|
-
type OperatorId = typeof operatorId;
|
|
13
|
-
|
|
14
|
-
function getDefaultOperation(): SpectrumProcessingTypeRegistry[OperatorId] {
|
|
15
|
-
return {
|
|
16
|
-
operatorId,
|
|
17
|
-
uid: generateID(),
|
|
18
|
-
settings: null,
|
|
19
|
-
options: undefined,
|
|
20
|
-
enabled: true,
|
|
21
|
-
error: undefined,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
9
|
|
|
25
|
-
export function DigitalFilterPanelTool(
|
|
26
|
-
props: ProcessingOperatorUIToolProps<OperatorId>,
|
|
27
|
-
) {
|
|
10
|
+
export function DigitalFilterPanelTool(props: ProcessingOperatorUIToolProps) {
|
|
28
11
|
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
29
12
|
|
|
30
13
|
if (!isSpectrum1D(spectrum)) return null;
|
|
@@ -37,7 +20,7 @@ export function DigitalFilterPanelTool(
|
|
|
37
20
|
function triggerOperation() {
|
|
38
21
|
if (isDisabled) return;
|
|
39
22
|
|
|
40
|
-
onTriggerOperation(
|
|
23
|
+
onTriggerOperation();
|
|
41
24
|
}
|
|
42
25
|
|
|
43
26
|
return (
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
import type { HotkeyConfig } from '@blueprintjs/core';
|
|
2
2
|
import { useHotkeys } from '@blueprintjs/core';
|
|
3
|
-
import type { Spectrum1DProcessingTypeRegistry } from '@zakodium/nmr-types';
|
|
4
3
|
import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
|
|
5
|
-
import {
|
|
4
|
+
import { isSpectrum1DFid } from '@zakodium/nmrium-core';
|
|
6
5
|
import { SvgNmrFourierTransform } from 'cheminfo-font';
|
|
7
6
|
import type { MouseEvent } from 'react';
|
|
8
7
|
import { useMemo } from 'react';
|
|
9
8
|
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
10
9
|
import { useEventCallback } from 'usehooks-ts';
|
|
11
10
|
|
|
12
|
-
function
|
|
13
|
-
return {
|
|
14
|
-
operatorId: '@zakodium/nmrium-core-plugins#fft1D',
|
|
15
|
-
settings: null,
|
|
16
|
-
options: undefined,
|
|
17
|
-
error: undefined,
|
|
18
|
-
uid: generateID(),
|
|
19
|
-
enabled: true,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function FFTTool(
|
|
24
|
-
props: ProcessingOperatorUIToolProps<'@zakodium/nmrium-core-plugins#fft1D'>,
|
|
25
|
-
) {
|
|
11
|
+
export function FFTTool(props: ProcessingOperatorUIToolProps) {
|
|
26
12
|
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
27
13
|
|
|
28
14
|
const isActive = activeOperatorId === '@zakodium/nmrium-core-plugins#fft1D';
|
|
@@ -36,7 +22,7 @@ export function FFTTool(
|
|
|
36
22
|
event.stopImmediatePropagation();
|
|
37
23
|
}
|
|
38
24
|
|
|
39
|
-
onTriggerOperation(
|
|
25
|
+
onTriggerOperation();
|
|
40
26
|
},
|
|
41
27
|
);
|
|
42
28
|
|
|
@@ -1,46 +1,14 @@
|
|
|
1
1
|
import type { HotkeyConfig } from '@blueprintjs/core';
|
|
2
2
|
import { useHotkeys } from '@blueprintjs/core';
|
|
3
|
-
import type {
|
|
4
|
-
import
|
|
5
|
-
ProcessingOperatorUIToolProps,
|
|
6
|
-
Spectrum1D,
|
|
7
|
-
} from '@zakodium/nmrium-core';
|
|
8
|
-
import {
|
|
9
|
-
castSpectrum1D,
|
|
10
|
-
generateID,
|
|
11
|
-
isSpectrum1DFt,
|
|
12
|
-
} from '@zakodium/nmrium-core';
|
|
3
|
+
import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
|
|
4
|
+
import { castSpectrum1D, isSpectrum1DFt } from '@zakodium/nmrium-core';
|
|
13
5
|
import { SvgNmrPhaseCorrection } from 'cheminfo-font';
|
|
14
6
|
import type { MouseEvent } from 'react';
|
|
15
7
|
import { useMemo } from 'react';
|
|
16
8
|
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
17
9
|
import { useEventCallback } from 'usehooks-ts';
|
|
18
10
|
|
|
19
|
-
function
|
|
20
|
-
spectrum: Spectrum1D,
|
|
21
|
-
): Spectrum1DProcessingTypeRegistry['@zakodium/nmrium-core-plugins#phaseCorrection1D']['settings'] {
|
|
22
|
-
const { phc0 = 0, phc1 = 0 } = spectrum.info;
|
|
23
|
-
|
|
24
|
-
if (phc0 === 0 && phc1 === 0) return { mode: 'automatic-compute' };
|
|
25
|
-
return { mode: 'automatic-info' };
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function defaultPhaseCorrectionOperation(
|
|
29
|
-
spectrum: Spectrum1D,
|
|
30
|
-
): Spectrum1DProcessingTypeRegistry['@zakodium/nmrium-core-plugins#phaseCorrection1D'] {
|
|
31
|
-
return {
|
|
32
|
-
operatorId: '@zakodium/nmrium-core-plugins#phaseCorrection1D',
|
|
33
|
-
settings: getPhaseCorrection1DSettings(spectrum),
|
|
34
|
-
options: undefined,
|
|
35
|
-
error: undefined,
|
|
36
|
-
uid: generateID(),
|
|
37
|
-
enabled: true,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function PhaseCorrectionTool(
|
|
42
|
-
props: ProcessingOperatorUIToolProps<'@zakodium/nmrium-core-plugins#phaseCorrection1D'>,
|
|
43
|
-
) {
|
|
11
|
+
export function PhaseCorrectionTool(props: ProcessingOperatorUIToolProps) {
|
|
44
12
|
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
45
13
|
castSpectrum1D(spectrum);
|
|
46
14
|
|
|
@@ -57,7 +25,7 @@ export function PhaseCorrectionTool(
|
|
|
57
25
|
event.stopImmediatePropagation();
|
|
58
26
|
}
|
|
59
27
|
|
|
60
|
-
onTriggerOperation(
|
|
28
|
+
onTriggerOperation();
|
|
61
29
|
},
|
|
62
30
|
);
|
|
63
31
|
|
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
import { DoubleCaretHorizontalIcon } from '@blueprintjs/icons';
|
|
2
|
-
import type { Spectrum1DProcessingTypeRegistry } from '@zakodium/nmr-types';
|
|
3
2
|
import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
|
|
4
|
-
import {
|
|
3
|
+
import { isSpectrum1DFt } from '@zakodium/nmrium-core';
|
|
5
4
|
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
6
5
|
|
|
7
|
-
function
|
|
8
|
-
return {
|
|
9
|
-
operatorId: '@zakodium/nmrium-core-plugins#shiftX1D',
|
|
10
|
-
settings: 0,
|
|
11
|
-
options: undefined,
|
|
12
|
-
error: undefined,
|
|
13
|
-
uid: generateID(),
|
|
14
|
-
enabled: true,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function ShiftXPanelTool(
|
|
19
|
-
props: ProcessingOperatorUIToolProps<'@zakodium/nmrium-core-plugins#shiftX1D'>,
|
|
20
|
-
) {
|
|
6
|
+
export function ShiftXPanelTool(props: ProcessingOperatorUIToolProps) {
|
|
21
7
|
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
22
8
|
|
|
23
9
|
const isActive =
|
|
@@ -37,7 +23,7 @@ export function ShiftXPanelTool(
|
|
|
37
23
|
/>
|
|
38
24
|
}
|
|
39
25
|
active={isActive}
|
|
40
|
-
onClick={() => onTriggerOperation(
|
|
26
|
+
onClick={() => onTriggerOperation()}
|
|
41
27
|
/>
|
|
42
28
|
);
|
|
43
29
|
}
|
|
@@ -1,45 +1,14 @@
|
|
|
1
1
|
import type { HotkeyConfig } from '@blueprintjs/core';
|
|
2
2
|
import { useHotkeys } from '@blueprintjs/core';
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
Spectrum1DProcessingTypeRegistry,
|
|
6
|
-
} from '@zakodium/nmr-types';
|
|
7
|
-
import type {
|
|
8
|
-
ProcessingOperatorUIToolProps,
|
|
9
|
-
Spectrum,
|
|
10
|
-
} from '@zakodium/nmrium-core';
|
|
11
|
-
import {
|
|
12
|
-
castSpectrum1D,
|
|
13
|
-
generateID,
|
|
14
|
-
isSpectrum1DFid,
|
|
15
|
-
} from '@zakodium/nmrium-core';
|
|
3
|
+
import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
|
|
4
|
+
import { isSpectrum1DFid } from '@zakodium/nmrium-core';
|
|
16
5
|
import { SvgNmrZeroFilling } from 'cheminfo-font';
|
|
17
|
-
import { nextPowerOfTwo } from 'ml-spectra-processing';
|
|
18
6
|
import type { MouseEvent } from 'react';
|
|
19
7
|
import { useMemo } from 'react';
|
|
20
8
|
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
21
9
|
import { useEventCallback } from 'usehooks-ts';
|
|
22
10
|
|
|
23
|
-
function
|
|
24
|
-
spectrum: Spectrum,
|
|
25
|
-
): Spectrum1DProcessingTypeRegistry['@zakodium/nmrium-core-plugins#zeroFilling1D'] {
|
|
26
|
-
castSpectrum1D(spectrum);
|
|
27
|
-
|
|
28
|
-
const zeroFillingSize = getZeroFillingSize(spectrum);
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
operatorId: '@zakodium/nmrium-core-plugins#zeroFilling1D',
|
|
32
|
-
settings: zeroFillingSize,
|
|
33
|
-
options: undefined,
|
|
34
|
-
error: undefined,
|
|
35
|
-
uid: generateID(),
|
|
36
|
-
enabled: true,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function ZeroFillingTool(
|
|
41
|
-
props: ProcessingOperatorUIToolProps<'@zakodium/nmrium-core-plugins#zeroFilling1D'>,
|
|
42
|
-
) {
|
|
11
|
+
export function ZeroFillingTool(props: ProcessingOperatorUIToolProps) {
|
|
43
12
|
const { onTriggerOperation, spectrum, activeOperatorId } = props;
|
|
44
13
|
|
|
45
14
|
const isActive =
|
|
@@ -55,7 +24,7 @@ export function ZeroFillingTool(
|
|
|
55
24
|
event.stopImmediatePropagation();
|
|
56
25
|
}
|
|
57
26
|
|
|
58
|
-
onTriggerOperation(
|
|
27
|
+
onTriggerOperation();
|
|
59
28
|
},
|
|
60
29
|
);
|
|
61
30
|
|
|
@@ -90,9 +59,3 @@ export function ZeroFillingTool(
|
|
|
90
59
|
/>
|
|
91
60
|
);
|
|
92
61
|
}
|
|
93
|
-
|
|
94
|
-
function getZeroFillingSize(spectrum: Spectrum1D) {
|
|
95
|
-
const dataLength = spectrum.data.x.length;
|
|
96
|
-
|
|
97
|
-
return nextPowerOfTwo(dataLength) * 2;
|
|
98
|
-
}
|