@zakodium/nmrium-core-plugins-ui 0.1.50 → 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.
Files changed (20) hide show
  1. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.d.ts.map +1 -1
  2. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.hook.d.ts +1 -0
  3. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.hook.d.ts.map +1 -1
  4. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.js +2 -0
  5. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.js.map +1 -1
  6. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_chart_svg.d.ts +3 -0
  7. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_chart_svg.d.ts.map +1 -0
  8. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_chart_svg.js +43 -0
  9. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_chart_svg.js.map +1 -0
  10. package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction.hook.d.ts +1 -0
  11. package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction.hook.d.ts.map +1 -1
  12. package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x.hook.d.ts +1 -0
  13. package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x.hook.d.ts.map +1 -1
  14. package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling.hook.d.ts +1 -0
  15. package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling.hook.d.ts.map +1 -1
  16. package/lib/plugins/spectrum_1d_processings_ui/utils/horizontal_app_form.d.ts +2 -0
  17. package/lib/plugins/spectrum_1d_processings_ui/utils/horizontal_app_form.d.ts.map +1 -1
  18. package/package.json +6 -5
  19. package/src/plugins/spectrum_1d_processings_ui/operators/apodization.ts +2 -0
  20. package/src/plugins/spectrum_1d_processings_ui/operators/apodization_chart_svg.tsx +77 -0
@@ -1 +1 @@
1
- {"version":3,"file":"apodization.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,qGASxB,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqC5F"}
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;CAC1B,CAAC,CAAC"}
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"}
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkFhG"}
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"}
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CvF"}
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"}
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmD5F"}
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"}
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoB7B,CAAC"}
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.50",
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.64",
33
- "@zakodium/nmrium-core-plugins": "^0.7.86",
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.0.1",
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": "971ceb7731dac3c86509b7067f431be4282940db"
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
+ }