@zakodium/nmrium-core-plugins-ui 0.1.49 → 0.1.51
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.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.hook.d.ts +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.hook.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.js +2 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_chart_svg.d.ts +3 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_chart_svg.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_chart_svg.js +43 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_chart_svg.js.map +1 -0
- 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.hook.d.ts +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction.hook.d.ts.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.hook.d.ts +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x.hook.d.ts.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.hook.d.ts +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling.hook.d.ts.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/lib/plugins/spectrum_1d_processings_ui/utils/horizontal_app_form.d.ts +2 -0
- package/lib/plugins/spectrum_1d_processings_ui/utils/horizontal_app_form.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/plugins/spectrum_1d_processings_ui/operators/apodization.ts +2 -0
- package/src/plugins/spectrum_1d_processings_ui/operators/apodization_chart_svg.tsx +77 -0
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apodization.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apodization.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,qGAUxB,CAAC"}
|
|
@@ -392,6 +392,7 @@ export declare function useApodizationForm(props: ProcessingOperatorUISettingsFo
|
|
|
392
392
|
readonly ColorPicker: typeof import("react-science/ui")._ColorPicker;
|
|
393
393
|
readonly RadioGroup: typeof import("react-science/ui")._RadioGroup;
|
|
394
394
|
readonly DraggableNumericInput: typeof import("react-science/ui")._DraggableNumericInput;
|
|
395
|
+
readonly TextArea: typeof import("react-science/ui")._TextArea;
|
|
395
396
|
}, {
|
|
396
397
|
readonly SubmitButton: typeof import("react-science/ui")._SubmitButton;
|
|
397
398
|
readonly ResetButton: typeof import("react-science/ui")._ResetButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apodization.hook.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization.hook.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAC;AAkBnF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,qCAAqC,CAAC,6CAA6C,CAAC
|
|
1
|
+
{"version":3,"file":"apodization.hook.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization.hook.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAC;AAkBnF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,qCAAqC,CAAC,6CAA6C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqC5F"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
2
|
+
import { ApodizationChartSVG } from "./apodization_chart_svg.js";
|
|
2
3
|
import { ApodizationExpanded } from "./apodization_expanded.js";
|
|
3
4
|
import { ApodizationTool } from "./apodization_tool.js";
|
|
4
5
|
import { ApodizationTopBar } from "./apodization_topbar.js";
|
|
@@ -11,5 +12,6 @@ export const apodization1D = defineProcessingOperatorUI({
|
|
|
11
12
|
Expanded: ApodizationExpanded,
|
|
12
13
|
Tool: ApodizationTool,
|
|
13
14
|
TopBar: ApodizationTopBar,
|
|
15
|
+
ChartSVG: ApodizationChartSVG,
|
|
14
16
|
});
|
|
15
17
|
//# sourceMappingURL=apodization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apodization.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA4B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAA0B,CAAC;AAE7D,MAAM,CAAC,MAAM,aAAa,GAAG,0BAA0B,CAAC;IACtD,EAAE,EAAE,6CAA6C;IACjD,IAAI,EAAE,sBAAsB;IAC5B,UAAU,EAAE,IAAI;IAChB,cAAc,EAAE,IAAI;IACpB,uBAAuB,EAAE,KAAK;IAC9B,QAAQ,EAAE,mBAAmB;IAC7B,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,iBAAiB;
|
|
1
|
+
{"version":3,"file":"apodization.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA6B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA4B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAA0B,CAAC;AAE7D,MAAM,CAAC,MAAM,aAAa,GAAG,0BAA0B,CAAC;IACtD,EAAE,EAAE,6CAA6C;IACjD,IAAI,EAAE,sBAAsB;IAC5B,UAAU,EAAE,IAAI;IAChB,cAAc,EAAE,IAAI;IACpB,uBAAuB,EAAE,KAAK;IAC9B,QAAQ,EAAE,mBAAmB;IAC7B,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,iBAAiB;IACzB,QAAQ,EAAE,mBAAmB;CAC9B,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ProcessingOperatorUIChartSVGProps } from '@zakodium/nmrium-core';
|
|
2
|
+
export declare function ApodizationChartSVG(props: ProcessingOperatorUIChartSVGProps<'@zakodium/nmrium-core-plugins#apodization1D'>): import("react").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=apodization_chart_svg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apodization_chart_svg.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization_chart_svg.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAS/E,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iCAAiC,CAAC,6CAA6C,CAAC,+BAwBxF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { castSpectrum1D } from '@zakodium/nmrium-core';
|
|
3
|
+
import { assertDefined } from '@zakodium/utils';
|
|
4
|
+
import { xyReduce } from 'ml-spectra-processing';
|
|
5
|
+
import { createApodizationWindowData } from 'nmr-processing';
|
|
6
|
+
import { useMemo } from 'react';
|
|
7
|
+
import { SVGPathBuilder } from 'react-science/ui';
|
|
8
|
+
export function ApodizationChartSVG(props) {
|
|
9
|
+
const { spectrum, operation, width, scaleX, scaleY, indicatorLineColor } = props;
|
|
10
|
+
castSpectrum1D(spectrum);
|
|
11
|
+
const { x } = spectrum.data;
|
|
12
|
+
const path = useApodizationPath({
|
|
13
|
+
x,
|
|
14
|
+
width,
|
|
15
|
+
scaleX,
|
|
16
|
+
scaleY,
|
|
17
|
+
shapes: operation.settings,
|
|
18
|
+
});
|
|
19
|
+
return (_jsx("path", { "data-testid": "@zakodium/nmrium-core-plugins#apodization1D#indicator", stroke: indicatorLineColor, fill: "none", strokeWidth: "2", d: path.toString() }));
|
|
20
|
+
}
|
|
21
|
+
function useApodizationPath(props) {
|
|
22
|
+
const { x, width, scaleX, scaleY, shapes } = props;
|
|
23
|
+
return useMemo(() => {
|
|
24
|
+
const builder = new SVGPathBuilder();
|
|
25
|
+
const from = x.at(-1);
|
|
26
|
+
const to = x[0];
|
|
27
|
+
assertDefined(from);
|
|
28
|
+
assertDefined(to);
|
|
29
|
+
const length = x.length;
|
|
30
|
+
const dw = (from - to) / (length - 1);
|
|
31
|
+
const y = createApodizationWindowData({
|
|
32
|
+
windowOptions: { dw, length },
|
|
33
|
+
shapes,
|
|
34
|
+
});
|
|
35
|
+
const pathPoints = xyReduce({ x, y }, { from, to, nbPoints: width * 4, optimize: true });
|
|
36
|
+
builder.moveTo(scaleX(pathPoints.x[0]), scaleY(pathPoints.y[0]));
|
|
37
|
+
for (let i = 1; i < pathPoints.x.length; i++) {
|
|
38
|
+
builder.lineTo(scaleX(pathPoints.x[i]), scaleY(pathPoints.y[i]));
|
|
39
|
+
}
|
|
40
|
+
return builder;
|
|
41
|
+
}, [x, shapes, width, scaleX, scaleY]);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=apodization_chart_svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apodization_chart_svg.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization_chart_svg.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,UAAU,mBAAmB,CACjC,KAAuF;IAEvF,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,GACtE,KAAK,CAAC;IACR,cAAc,CAAC,QAAQ,CAAC,CAAC;IACzB,MAAM,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC;IAE5B,MAAM,IAAI,GAAG,kBAAkB,CAAC;QAC9B,CAAC;QACD,KAAK;QACL,MAAM;QACN,MAAM;QACN,MAAM,EAAE,SAAS,CAAC,QAAQ;KAC3B,CAAC,CAAC;IAEH,OAAO,CACL,8BACc,uDAAuD,EACnE,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAC,MAAM,EACX,WAAW,EAAC,GAAG,EACf,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,GAClB,CACH,CAAC;AACJ,CAAC;AAUD,SAAS,kBAAkB,CAAC,KAA8B;IACxD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEnD,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;QAErC,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACtB,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAChB,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,aAAa,CAAC,EAAE,CAAC,CAAC;QAElB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACxB,MAAM,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAEtC,MAAM,CAAC,GAAG,2BAA2B,CAAC;YACpC,aAAa,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YAC7B,MAAM;SACP,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,QAAQ,CACzB,EAAE,CAAC,EAAE,CAAC,EAAE,EACR,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAClD,CAAC;QAEF,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACjE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnE,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -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,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,YAAY,GAAmB,EAAE,CAAC;AAExC,MAAM,UAAU,eAAe,CAAC,KAAoC;IAClE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,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,CACrB,GAAG,EAAE,CAAC;QACJ;YACE,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,gBAAgB;SAC5B;KACF,EACD,CAAC,gBAAgB,CAAC,CACnB,CAAC;IACF,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IAE/C,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,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,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,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,OAAO,CAAC,KAAoC;IAC1D,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IAEjE,MAAM,QAAQ,GAAG,gBAAgB,KAAK,qCAAqC,CAAC;IAC5E,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,mBAAmB;gBAC1B,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,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"}
|
|
@@ -129,6 +129,7 @@ export declare function usePhaseCorrectionForm(props: ProcessingOperatorUISettin
|
|
|
129
129
|
readonly ColorPicker: typeof import("react-science/ui")._ColorPicker;
|
|
130
130
|
readonly RadioGroup: typeof import("react-science/ui")._RadioGroup;
|
|
131
131
|
readonly DraggableNumericInput: typeof import("react-science/ui")._DraggableNumericInput;
|
|
132
|
+
readonly TextArea: typeof import("react-science/ui")._TextArea;
|
|
132
133
|
}, {
|
|
133
134
|
readonly SubmitButton: typeof import("react-science/ui")._SubmitButton;
|
|
134
135
|
readonly ResetButton: typeof import("react-science/ui")._ResetButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phase_correction.hook.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction.hook.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAC;AA6BnF,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,qCAAqC,CAAC,iDAAiD,CAAC
|
|
1
|
+
{"version":3,"file":"phase_correction.hook.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction.hook.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAC;AA6BnF,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,qCAAqC,CAAC,iDAAiD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkFhG"}
|
|
@@ -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,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,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,mBAAmB,CAAC,KAAoC;IACtE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IACjE,cAAc,CAAC,QAAQ,CAAC,CAAC;IAEzB,MAAM,QAAQ,GACZ,gBAAgB,KAAK,iDAAiD,CAAC;IAEzE,MAAM,SAAS,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;IAEtE,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,kBAAkB;gBACzB,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,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"}
|
|
@@ -31,6 +31,7 @@ export declare function useShiftXForm(props: ProcessingOperatorUISettingsFormPro
|
|
|
31
31
|
readonly ColorPicker: typeof import("react-science/ui")._ColorPicker;
|
|
32
32
|
readonly RadioGroup: typeof import("react-science/ui")._RadioGroup;
|
|
33
33
|
readonly DraggableNumericInput: typeof import("react-science/ui")._DraggableNumericInput;
|
|
34
|
+
readonly TextArea: typeof import("react-science/ui")._TextArea;
|
|
34
35
|
}, {
|
|
35
36
|
readonly SubmitButton: typeof import("react-science/ui")._SubmitButton;
|
|
36
37
|
readonly ResetButton: typeof import("react-science/ui")._ResetButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shift_x.hook.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x.hook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAC;AAGnF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAgB,aAAa,CAC3B,KAAK,EAAE,qCAAqC,CAAC,wCAAwC,CAAC
|
|
1
|
+
{"version":3,"file":"shift_x.hook.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x.hook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAC;AAGnF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAgB,aAAa,CAC3B,KAAK,EAAE,qCAAqC,CAAC,wCAAwC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CvF"}
|
|
@@ -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"}
|
|
@@ -32,6 +32,7 @@ export declare function useZeroFillingForm(props: ProcessingOperatorUISettingsFo
|
|
|
32
32
|
readonly ColorPicker: typeof import("react-science/ui")._ColorPicker;
|
|
33
33
|
readonly RadioGroup: typeof import("react-science/ui")._RadioGroup;
|
|
34
34
|
readonly DraggableNumericInput: typeof import("react-science/ui")._DraggableNumericInput;
|
|
35
|
+
readonly TextArea: typeof import("react-science/ui")._TextArea;
|
|
35
36
|
}, {
|
|
36
37
|
readonly SubmitButton: typeof import("react-science/ui")._SubmitButton;
|
|
37
38
|
readonly ResetButton: typeof import("react-science/ui")._ResetButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zero_filling.hook.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling.hook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAC;AAGnF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,qCAAqC,CAAC,6CAA6C,CAAC
|
|
1
|
+
{"version":3,"file":"zero_filling.hook.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling.hook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAC;AAGnF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,qCAAqC,CAAC,6CAA6C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmD5F"}
|
|
@@ -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"}
|
|
@@ -8,6 +8,7 @@ export declare const HorizontalAppForm: import("@emotion/styled").StyledComponen
|
|
|
8
8
|
readonly ColorPicker: typeof import("react-science/ui").ColorPicker;
|
|
9
9
|
readonly RadioGroup: typeof import("react-science/ui").RadioGroup;
|
|
10
10
|
readonly DraggableNumericInput: typeof import("react-science/ui").DraggableNumericInput;
|
|
11
|
+
readonly TextArea: typeof import("react-science/ui").TextArea;
|
|
11
12
|
}, {
|
|
12
13
|
readonly SubmitButton: typeof import("react-science/ui").SubmitButton;
|
|
13
14
|
readonly ResetButton: typeof import("react-science/ui").ResetButton;
|
|
@@ -23,6 +24,7 @@ export declare const HorizontalAppForm: import("@emotion/styled").StyledComponen
|
|
|
23
24
|
readonly ColorPicker: typeof import("react-science/ui").ColorPicker;
|
|
24
25
|
readonly RadioGroup: typeof import("react-science/ui").RadioGroup;
|
|
25
26
|
readonly DraggableNumericInput: typeof import("react-science/ui").DraggableNumericInput;
|
|
27
|
+
readonly TextArea: typeof import("react-science/ui").TextArea;
|
|
26
28
|
}, {
|
|
27
29
|
readonly SubmitButton: typeof import("react-science/ui").SubmitButton;
|
|
28
30
|
readonly ResetButton: typeof import("react-science/ui").ResetButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"horizontal_app_form.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/utils/horizontal_app_form.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"horizontal_app_form.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/utils/horizontal_app_form.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoB7B,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.51",
|
|
4
4
|
"license": "CC-BY-NC-SA-4.0",
|
|
5
5
|
"description": "UI related plugins needed for cheminfo/nmrium",
|
|
6
6
|
"keywords": [],
|
|
@@ -29,15 +29,16 @@
|
|
|
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.65",
|
|
33
|
+
"@zakodium/nmrium-core-plugins": "^0.7.87",
|
|
34
34
|
"@zakodium/utils": "^0.5.1",
|
|
35
35
|
"cheminfo-font": "^1.27.0",
|
|
36
36
|
"fifo-logger": "^2.0.1",
|
|
37
37
|
"ml-spectra-processing": "^14.33.0",
|
|
38
|
+
"nmr-processing": "^22.23.6",
|
|
38
39
|
"react": "^18.3.1",
|
|
39
40
|
"react-dom": "^18.3.1",
|
|
40
|
-
"react-science": "^23.
|
|
41
|
+
"react-science": "^23.1.1",
|
|
41
42
|
"usehooks-ts": "^3.1.1",
|
|
42
43
|
"zod": "^4.4.3"
|
|
43
44
|
},
|
|
@@ -51,5 +52,5 @@
|
|
|
51
52
|
"volta": {
|
|
52
53
|
"extends": "../../../package.json"
|
|
53
54
|
},
|
|
54
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "dbf4ebe256de67a8767921eaeb8ce1982a23fb80"
|
|
55
56
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
2
2
|
|
|
3
|
+
import { ApodizationChartSVG } from './apodization_chart_svg.tsx';
|
|
3
4
|
import { ApodizationExpanded } from './apodization_expanded.tsx';
|
|
4
5
|
import { ApodizationTool } from './apodization_tool.tsx';
|
|
5
6
|
import { ApodizationTopBar } from './apodization_topbar.tsx';
|
|
@@ -13,4 +14,5 @@ export const apodization1D = defineProcessingOperatorUI({
|
|
|
13
14
|
Expanded: ApodizationExpanded,
|
|
14
15
|
Tool: ApodizationTool,
|
|
15
16
|
TopBar: ApodizationTopBar,
|
|
17
|
+
ChartSVG: ApodizationChartSVG,
|
|
16
18
|
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Shapes } from '@zakodium/nmr-types';
|
|
2
|
+
import type { ProcessingOperatorUIChartSVGProps } from '@zakodium/nmrium-core';
|
|
3
|
+
import { castSpectrum1D } from '@zakodium/nmrium-core';
|
|
4
|
+
import { assertDefined } from '@zakodium/utils';
|
|
5
|
+
import type { ScaleLinear } from 'd3-scale';
|
|
6
|
+
import { xyReduce } from 'ml-spectra-processing';
|
|
7
|
+
import { createApodizationWindowData } from 'nmr-processing';
|
|
8
|
+
import { useMemo } from 'react';
|
|
9
|
+
import { SVGPathBuilder } from 'react-science/ui';
|
|
10
|
+
|
|
11
|
+
export function ApodizationChartSVG(
|
|
12
|
+
props: ProcessingOperatorUIChartSVGProps<'@zakodium/nmrium-core-plugins#apodization1D'>,
|
|
13
|
+
) {
|
|
14
|
+
const { spectrum, operation, width, scaleX, scaleY, indicatorLineColor } =
|
|
15
|
+
props;
|
|
16
|
+
castSpectrum1D(spectrum);
|
|
17
|
+
const { x } = spectrum.data;
|
|
18
|
+
|
|
19
|
+
const path = useApodizationPath({
|
|
20
|
+
x,
|
|
21
|
+
width,
|
|
22
|
+
scaleX,
|
|
23
|
+
scaleY,
|
|
24
|
+
shapes: operation.settings,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<path
|
|
29
|
+
data-testid="@zakodium/nmrium-core-plugins#apodization1D#indicator"
|
|
30
|
+
stroke={indicatorLineColor}
|
|
31
|
+
fill="none"
|
|
32
|
+
strokeWidth="2"
|
|
33
|
+
d={path.toString()}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface UseApodizationPathProps {
|
|
39
|
+
x: Float64Array;
|
|
40
|
+
width: number;
|
|
41
|
+
scaleX: ScaleLinear<number, number>;
|
|
42
|
+
scaleY: ScaleLinear<number, number>;
|
|
43
|
+
shapes: Shapes;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function useApodizationPath(props: UseApodizationPathProps) {
|
|
47
|
+
const { x, width, scaleX, scaleY, shapes } = props;
|
|
48
|
+
|
|
49
|
+
return useMemo(() => {
|
|
50
|
+
const builder = new SVGPathBuilder();
|
|
51
|
+
|
|
52
|
+
const from = x.at(-1);
|
|
53
|
+
const to = x[0];
|
|
54
|
+
assertDefined(from);
|
|
55
|
+
assertDefined(to);
|
|
56
|
+
|
|
57
|
+
const length = x.length;
|
|
58
|
+
const dw = (from - to) / (length - 1);
|
|
59
|
+
|
|
60
|
+
const y = createApodizationWindowData({
|
|
61
|
+
windowOptions: { dw, length },
|
|
62
|
+
shapes,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const pathPoints = xyReduce(
|
|
66
|
+
{ x, y },
|
|
67
|
+
{ from, to, nbPoints: width * 4, optimize: true },
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
builder.moveTo(scaleX(pathPoints.x[0]), scaleY(pathPoints.y[0]));
|
|
71
|
+
for (let i = 1; i < pathPoints.x.length; i++) {
|
|
72
|
+
builder.lineTo(scaleX(pathPoints.x[i]), scaleY(pathPoints.y[i]));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return builder;
|
|
76
|
+
}, [x, shapes, width, scaleX, scaleY]);
|
|
77
|
+
}
|
|
@@ -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
|
-
}
|