@zakodium/nmrium-core-plugins-ui 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -0
- package/lib/plugins/index.d.ts +18 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/plugins/index.js +24 -0
- package/lib/plugins/index.js.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/index.d.ts +2 -0
- package/lib/plugins/spectrum_1d_processings_ui/index.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/index.js +2 -0
- package/lib/plugins/spectrum_1d_processings_ui/index.js.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.d.ts +2 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.js +9 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.js.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_expand.d.ts +3 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_expand.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_expand.js +83 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_expand.js.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/digital_filter.d.ts +2 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/digital_filter.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/digital_filter.js +10 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/digital_filter.js.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/fft.d.ts +2 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/fft.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/fft.js +6 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/fft.js.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/index.d.ts +3 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/index.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/index.js +15 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/index.js.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction.d.ts +2 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction.js +13 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction.js.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x.d.ts +2 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x.js +6 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x.js.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling.d.ts +2 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling.js +37 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling.js.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/spectrum_1d_processings_ui_plugin.d.ts +2 -0
- package/lib/plugins/spectrum_1d_processings_ui/spectrum_1d_processings_ui_plugin.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/spectrum_1d_processings_ui_plugin.js +12 -0
- package/lib/plugins/spectrum_1d_processings_ui/spectrum_1d_processings_ui_plugin.js.map +1 -0
- package/lib/plugins/spectrum_2d_processings_ui/index.d.ts +2 -0
- package/lib/plugins/spectrum_2d_processings_ui/index.d.ts.map +1 -0
- package/lib/plugins/spectrum_2d_processings_ui/index.js +2 -0
- package/lib/plugins/spectrum_2d_processings_ui/index.js.map +1 -0
- package/lib/plugins/spectrum_2d_processings_ui/operators/index.d.ts +3 -0
- package/lib/plugins/spectrum_2d_processings_ui/operators/index.d.ts.map +1 -0
- package/lib/plugins/spectrum_2d_processings_ui/operators/index.js +2 -0
- package/lib/plugins/spectrum_2d_processings_ui/operators/index.js.map +1 -0
- package/lib/plugins/spectrum_2d_processings_ui/spectrum_1d_processings_ui_plugin.d.ts +2 -0
- package/lib/plugins/spectrum_2d_processings_ui/spectrum_1d_processings_ui_plugin.d.ts.map +1 -0
- package/lib/plugins/spectrum_2d_processings_ui/spectrum_1d_processings_ui_plugin.js +12 -0
- package/lib/plugins/spectrum_2d_processings_ui/spectrum_1d_processings_ui_plugin.js.map +1 -0
- package/package.json +44 -0
- package/src/index.ts +13 -0
- package/src/plugins/index.ts +28 -0
- package/src/plugins/spectrum_1d_processings_ui/index.ts +1 -0
- package/src/plugins/spectrum_1d_processings_ui/operators/apodization.ts +10 -0
- package/src/plugins/spectrum_1d_processings_ui/operators/apodization_expand.tsx +225 -0
- package/src/plugins/spectrum_1d_processings_ui/operators/digital_filter.tsx +11 -0
- package/src/plugins/spectrum_1d_processings_ui/operators/fft.tsx +6 -0
- package/src/plugins/spectrum_1d_processings_ui/operators/index.ts +17 -0
- package/src/plugins/spectrum_1d_processings_ui/operators/phase_correction.tsx +33 -0
- package/src/plugins/spectrum_1d_processings_ui/operators/shift_x.tsx +6 -0
- package/src/plugins/spectrum_1d_processings_ui/operators/zero_filling.tsx +58 -0
- package/src/plugins/spectrum_1d_processings_ui/spectrum_1d_processings_ui_plugin.ts +13 -0
- package/src/plugins/spectrum_2d_processings_ui/index.ts +1 -0
- package/src/plugins/spectrum_2d_processings_ui/operators/index.ts +3 -0
- package/src/plugins/spectrum_2d_processings_ui/spectrum_1d_processings_ui_plugin.ts +13 -0
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @zakodium/nmrium-core-plugins-ui
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@zakodium/nmrium-core-plugins-ui)
|
|
4
|
+
[](https://www.npmjs.com/package/@zakodium/nmrium-core-plugins-ui)
|
|
5
|
+
|
|
6
|
+
UI related plugins needed for cheminfo/nmrium.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```console
|
|
11
|
+
npm install @zakodium/nmrium-core-plugins-ui
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
import init from '@zakodium/nmrium-core-plugins-ui';
|
|
18
|
+
|
|
19
|
+
// includes recommended plugins from `@zakodium/nmrium-core-plugins`
|
|
20
|
+
const core = init();
|
|
21
|
+
// result is ...
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
[MIT](./LICENSE)
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAInD,cAAc,oBAAoB,CAAC;AAEnC,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,cAKpD"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NMRiumCore } from '@zakodium/nmrium-core';
|
|
2
|
+
import { recommended } from "./plugins/index.js";
|
|
3
|
+
export * from "./plugins/index.js";
|
|
4
|
+
export default function init(plugins) {
|
|
5
|
+
const core = new NMRiumCore();
|
|
6
|
+
core.registerPlugins(recommended(core, plugins));
|
|
7
|
+
return core;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,cAAc,oBAAoB,CAAC;AAEnC,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,OAAwB;IACnD,MAAM,IAAI,GAAG,IAAI,UAAU,EAAE,CAAC;IAC9B,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAEjD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NMRiumCore, NMRiumPlugin } from '@zakodium/nmrium-core';
|
|
2
|
+
export * from './spectrum_1d_processings_ui/index.ts';
|
|
3
|
+
export * from './spectrum_2d_processings_ui/index.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Only recommended ui plugins from this package
|
|
6
|
+
*
|
|
7
|
+
* @param plugins
|
|
8
|
+
*/
|
|
9
|
+
export declare function recommendedUIOnly(plugins?: NMRiumPlugin[]): NMRiumPlugin[];
|
|
10
|
+
/**
|
|
11
|
+
* Recommended plugins:
|
|
12
|
+
* - recommended from `@zakodium/nmrium-core-plugins`
|
|
13
|
+
* - recommendedUIOnly from `@zakodium/nmrium-core-plugins-ui`
|
|
14
|
+
* @param core
|
|
15
|
+
* @param plugins
|
|
16
|
+
*/
|
|
17
|
+
export declare function recommended(core: NMRiumCore, plugins?: NMRiumPlugin[]): NMRiumPlugin[];
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAMtE,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,YAAY,EAAO,kBAE7D;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,GAAE,YAAY,EAAO,kBAEzE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { recommended as recommendedPlugins } from '@zakodium/nmrium-core-plugins';
|
|
2
|
+
import { spectrum1DProcessingsUI } from "./spectrum_1d_processings_ui/index.js";
|
|
3
|
+
import { spectrum2DProcessingsUI } from "./spectrum_2d_processings_ui/index.js";
|
|
4
|
+
export * from "./spectrum_1d_processings_ui/index.js";
|
|
5
|
+
export * from "./spectrum_2d_processings_ui/index.js";
|
|
6
|
+
/**
|
|
7
|
+
* Only recommended ui plugins from this package
|
|
8
|
+
*
|
|
9
|
+
* @param plugins
|
|
10
|
+
*/
|
|
11
|
+
export function recommendedUIOnly(plugins = []) {
|
|
12
|
+
return [spectrum1DProcessingsUI(), spectrum2DProcessingsUI()].concat(plugins);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Recommended plugins:
|
|
16
|
+
* - recommended from `@zakodium/nmrium-core-plugins`
|
|
17
|
+
* - recommendedUIOnly from `@zakodium/nmrium-core-plugins-ui`
|
|
18
|
+
* @param core
|
|
19
|
+
* @param plugins
|
|
20
|
+
*/
|
|
21
|
+
export function recommended(core, plugins = []) {
|
|
22
|
+
return recommendedPlugins(core, recommendedUIOnly(plugins));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AAEtD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAA0B,EAAE;IAC5D,OAAO,CAAC,uBAAuB,EAAE,EAAE,uBAAuB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAChF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,IAAgB,EAAE,UAA0B,EAAE;IACxE,OAAO,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/spectrum_1d_processings_ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/spectrum_1d_processings_ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apodization.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,qGAKxB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
2
|
+
import { ApodizationExpanded } from "./apodization_expand.js";
|
|
3
|
+
export const apodization1D = defineProcessingOperatorUI({
|
|
4
|
+
id: '@zakodium/nmrium-core-plugins#apodization1D',
|
|
5
|
+
name: 'Apodization / Window',
|
|
6
|
+
isEditable: true,
|
|
7
|
+
Expanded: ApodizationExpanded,
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=apodization.js.map
|
|
@@ -0,0 +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,yBAA0B,CAAC;AAE/D,MAAM,CAAC,MAAM,aAAa,GAAG,0BAA0B,CAAC;IACtD,EAAE,EAAE,6CAA6C;IACjD,IAAI,EAAE,sBAAsB;IAC5B,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,mBAAmB;CAC9B,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ProcessingOperatorUIExpandedProps } from '@zakodium/nmrium-core';
|
|
2
|
+
export declare function ApodizationExpanded(props: ProcessingOperatorUIExpandedProps<'@zakodium/nmrium-core-plugins#apodization1D'>): import("react").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=apodization_expand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apodization_expand.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization_expand.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAI/E,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iCAAiC,CAAC,6CAA6C,CAAC,+BA2NxF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { assert, cast } from '@zakodium/utils';
|
|
3
|
+
import { AppForm, useForm } from 'react-science/ui';
|
|
4
|
+
export function ApodizationExpanded(props) {
|
|
5
|
+
const { operation, onChange, core, children } = props;
|
|
6
|
+
cast(operation.operatorId);
|
|
7
|
+
const operator = core.getOperator(operation.operatorId);
|
|
8
|
+
assert(operator, () => `Operator ${operation.operatorId} related to operation ${JSON.stringify(operation)} is missing`);
|
|
9
|
+
const validator = operator.schemaSettings;
|
|
10
|
+
const form = useForm({
|
|
11
|
+
defaultValues: operation.settings,
|
|
12
|
+
validators: { onDynamic: validator, onSubmit: validator },
|
|
13
|
+
onSubmit: ({ value }) => {
|
|
14
|
+
if (!onChange)
|
|
15
|
+
return;
|
|
16
|
+
const newOperation = { ...operation, settings: validator.parse(value) };
|
|
17
|
+
onChange(newOperation);
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
const { AppField, SubmitButton } = form;
|
|
21
|
+
return (_jsxs(AppForm, { form: form, layout: "inline", children: [children?.(_jsx(SubmitButton, { variant: "outlined", size: "small", intent: "success", children: "Apply" })), _jsx(AppField, { name: "exponential.apply", listeners: {
|
|
22
|
+
onChange: ({ value, fieldApi }) => {
|
|
23
|
+
if (!value)
|
|
24
|
+
return;
|
|
25
|
+
const { exponential } = fieldApi.form.state.values;
|
|
26
|
+
const lineBroadening = exponential?.options?.lineBroadening;
|
|
27
|
+
if (typeof lineBroadening === 'number')
|
|
28
|
+
return;
|
|
29
|
+
fieldApi.form.setFieldValue('exponential.options.lineBroadening', 1, { dontRunListeners: true });
|
|
30
|
+
},
|
|
31
|
+
}, children: ({ Checkbox, state }) => (_jsxs(_Fragment, { children: [_jsx(Checkbox, { label: "Exponential" }), state.value && (_jsx(AppField, { name: "exponential.options.lineBroadening", children: ({ NumericInput }) => (_jsx(NumericInput, { label: "Line broadening", minorStepSize: 0.01, step: 0.1, majorStepSize: 1 })) }))] })) }), _jsx(AppField, { name: "gaussian.apply", listeners: {
|
|
32
|
+
onChange: ({ value, fieldApi }) => {
|
|
33
|
+
if (!value)
|
|
34
|
+
return;
|
|
35
|
+
const { gaussian } = fieldApi.form.state.values;
|
|
36
|
+
const lineBroadening = gaussian?.options?.lineBroadening;
|
|
37
|
+
const lineBroadeningCenter = gaussian?.options?.lineBroadeningCenter;
|
|
38
|
+
if (typeof lineBroadening !== 'number') {
|
|
39
|
+
fieldApi.form.setFieldValue('gaussian.options.lineBroadening', 0.3, { dontRunListeners: true });
|
|
40
|
+
}
|
|
41
|
+
if (typeof lineBroadeningCenter !== 'number') {
|
|
42
|
+
fieldApi.form.setFieldValue('gaussian.options.lineBroadeningCenter', 0, { dontRunListeners: true });
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
}, children: ({ Checkbox, state }) => (_jsxs(_Fragment, { children: [_jsx(Checkbox, { label: "Gaussian" }), state.value && (_jsxs(_Fragment, { children: [_jsx(AppField, { name: "gaussian.options.lineBroadening", children: ({ NumericInput }) => (_jsx(NumericInput, { label: "Line broadening", minorStepSize: 0.01, step: 0.1, majorStepSize: 1 })) }), _jsx(AppField, { name: "gaussian.options.lineBroadeningCenter", children: ({ NumericInput }) => (_jsx(NumericInput, { label: "Center", helpText: "keep it in [0 - 1] range", min: 0, max: 1, minorStepSize: 0.001, step: 0.01, majorStepSize: 0.1 })) })] }))] })) }), _jsx(AppField, { name: "sineBell.apply", listeners: {
|
|
46
|
+
onChange: ({ value, fieldApi }) => {
|
|
47
|
+
if (!value)
|
|
48
|
+
return;
|
|
49
|
+
const { sineBell } = fieldApi.form.state.values;
|
|
50
|
+
const offset = sineBell?.options?.offset;
|
|
51
|
+
if (typeof offset === 'number')
|
|
52
|
+
return;
|
|
53
|
+
fieldApi.form.setFieldValue('sineBell.options.offset', 0, {
|
|
54
|
+
dontRunListeners: true,
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
}, children: ({ Checkbox, state }) => (_jsxs(_Fragment, { children: [_jsx(Checkbox, { label: "Sine Bell" }), state.value && (_jsx(AppField, { name: "sineBell.options.offset", children: ({ NumericInput }) => _jsx(NumericInput, { label: "Offset" }) }))] })) }), _jsx(AppField, { name: "sineSquare.apply", listeners: {
|
|
58
|
+
onChange: ({ value, fieldApi }) => {
|
|
59
|
+
if (!value)
|
|
60
|
+
return;
|
|
61
|
+
const { sineSquare } = fieldApi.form.state.values;
|
|
62
|
+
const offset = sineSquare?.options?.offset;
|
|
63
|
+
if (typeof offset === 'number')
|
|
64
|
+
return;
|
|
65
|
+
fieldApi.form.setFieldValue('sineSquare.options.offset', 0, {
|
|
66
|
+
dontRunListeners: true,
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
}, children: ({ Checkbox, state }) => (_jsxs(_Fragment, { children: [_jsx(Checkbox, { label: "Sine Square" }), state.value && (_jsx(AppField, { name: "sineSquare.options.offset", children: ({ NumericInput }) => _jsx(NumericInput, { label: "Offset" }) }))] })) }), _jsx(AppField, { name: "traf.apply", listeners: {
|
|
70
|
+
onChange: ({ value, fieldApi }) => {
|
|
71
|
+
if (!value)
|
|
72
|
+
return;
|
|
73
|
+
const { traf } = fieldApi.form.state.values;
|
|
74
|
+
const lineBroadening = traf?.options?.lineBroadening;
|
|
75
|
+
if (typeof lineBroadening === 'number')
|
|
76
|
+
return;
|
|
77
|
+
fieldApi.form.setFieldValue('traf.options.lineBroadening', 0.3, {
|
|
78
|
+
dontRunListeners: true,
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
}, children: ({ Checkbox, state }) => (_jsxs(_Fragment, { children: [_jsx(Checkbox, { label: "Traf" }), state.value && (_jsx(AppField, { name: "traf.options.lineBroadening", children: ({ NumericInput }) => (_jsx(NumericInput, { label: "Line broadening", minorStepSize: 0.01, step: 0.1, majorStepSize: 1 })) }))] })) })] }));
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=apodization_expand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apodization_expand.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/apodization_expand.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC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um_1d_processings_ui/operators/digital_filter.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,uGAM1B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
2
|
+
const formatter = new Intl.NumberFormat('en-US');
|
|
3
|
+
export const digitalFilter1D = defineProcessingOperatorUI({
|
|
4
|
+
id: '@zakodium/nmrium-core-plugins#digitalFilter1D',
|
|
5
|
+
name: 'Digital filter',
|
|
6
|
+
Expanded(props) {
|
|
7
|
+
return `Value: ${formatter.format(props.operation.settings)}`;
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=digital_filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digital_filter.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/digital_filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AAEjD,MAAM,CAAC,MAAM,eAAe,GAAG,0BAA0B,CAAC;IACxD,EAAE,EAAE,+CAA+C;IACnD,IAAI,EAAE,gBAAgB;IACtB,QAAQ,CAAC,KAAK;QACZ,OAAO,UAAU,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;IAChE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fft.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/fft.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,6FAGhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fft.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/fft.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,CAAC,MAAM,KAAK,GAAG,0BAA0B,CAAC;IAC9C,EAAE,EAAE,qCAAqC;IACzC,IAAI,EAAE,KAAK;CACZ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AASlE,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAOxD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { apodization1D } from "./apodization.js";
|
|
2
|
+
import { digitalFilter1D } from "./digital_filter.js";
|
|
3
|
+
import { fft1D } from "./fft.js";
|
|
4
|
+
import { phaseCorrection1D } from "./phase_correction.js";
|
|
5
|
+
import { shiftX1D } from "./shift_x.js";
|
|
6
|
+
import { zeroFilling1D } from "./zero_filling.js";
|
|
7
|
+
export const operatorsUI = [
|
|
8
|
+
digitalFilter1D,
|
|
9
|
+
apodization1D,
|
|
10
|
+
zeroFilling1D,
|
|
11
|
+
fft1D,
|
|
12
|
+
shiftX1D,
|
|
13
|
+
phaseCorrection1D,
|
|
14
|
+
];
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAW,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAwB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAoB,CAAC;AAEnD,MAAM,CAAC,MAAM,WAAW,GAAqC;IAC3D,eAAe;IACf,aAAa;IACb,aAAa;IACb,KAAK;IACL,QAAQ;IACR,iBAAiB;CAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase_correction.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,yGA8B5B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
3
|
+
export const phaseCorrection1D = defineProcessingOperatorUI({
|
|
4
|
+
id: '@zakodium/nmrium-core-plugins#phaseCorrection1D',
|
|
5
|
+
name: 'Phase correction',
|
|
6
|
+
isEditable: true,
|
|
7
|
+
Expanded: (props) => {
|
|
8
|
+
const { operation } = props;
|
|
9
|
+
const { settings } = operation;
|
|
10
|
+
return (_jsxs(_Fragment, { children: [_jsxs("label", { children: ["Algorithm:", _jsxs("select", { children: [_jsx("option", { value: "automatic", children: "Automatic" }), _jsx("option", { value: "manual", selected: true, children: "Manual" })] })] }), _jsxs("label", { children: ["PH0:", _jsx("input", { type: "number", value: settings.ph0 })] }), _jsxs("label", { children: ["PH1:", _jsx("input", { type: "number", value: settings.ph1 })] })] }));
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=phase_correction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase_correction.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,CAAC,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;IAC1D,EAAE,EAAE,iDAAiD;IACrD,IAAI,EAAE,kBAAkB;IACxB,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;QAClB,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;QAC5B,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;QAE/B,OAAO,CACL,8BACE,0CAEE,6BACE,iBAAQ,KAAK,EAAC,WAAW,0BAAmB,EAC5C,iBAAQ,KAAK,EAAC,QAAQ,EAAC,QAAQ,6BAEtB,IACF,IACH,EACR,oCAEE,gBAAO,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,GAAI,IACtC,EACR,oCAEE,gBAAO,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,GAAI,IACtC,IACP,CACJ,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shift_x.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,gGAGnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shift_x.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,CAAC,MAAM,QAAQ,GAAG,0BAA0B,CAAC;IACjD,EAAE,EAAE,wCAAwC;IAC5C,IAAI,EAAE,SAAS;CAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zero_filling.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling.tsx"],"names":[],"mappings":"AAwBA,eAAO,MAAM,aAAa,qGAiCxB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
const options = [
|
|
5
|
+
{ label: '256', value: 2 ** 8 },
|
|
6
|
+
{ label: '512', value: 2 ** 9 },
|
|
7
|
+
{ label: '1K', value: 2 ** 10 },
|
|
8
|
+
{ label: '2K', value: 2 ** 11 },
|
|
9
|
+
{ label: '4K', value: 2 ** 12 },
|
|
10
|
+
{ label: '8K', value: 2 ** 13 },
|
|
11
|
+
{ label: '16K', value: 2 ** 14 },
|
|
12
|
+
{ label: '32K', value: 2 ** 15 },
|
|
13
|
+
{ label: '64K', value: 2 ** 16 },
|
|
14
|
+
{ label: '128K', value: 2 ** 17 },
|
|
15
|
+
{ label: '256K', value: 2 ** 18 },
|
|
16
|
+
{ label: '512K', value: 2 ** 19 },
|
|
17
|
+
{ label: '1M', value: 2 ** 20 },
|
|
18
|
+
{ label: '2M', value: 2 ** 21 },
|
|
19
|
+
];
|
|
20
|
+
export const zeroFilling1D = defineProcessingOperatorUI({
|
|
21
|
+
id: '@zakodium/nmrium-core-plugins#zeroFilling1D',
|
|
22
|
+
name: 'Zero filling',
|
|
23
|
+
isEditable: true,
|
|
24
|
+
Expanded(props) {
|
|
25
|
+
const { operation } = props;
|
|
26
|
+
const { settings } = operation;
|
|
27
|
+
const validOptions = useMemo(() => {
|
|
28
|
+
if (options.some((o) => o.value === settings))
|
|
29
|
+
return options;
|
|
30
|
+
return options
|
|
31
|
+
.concat({ label: String(settings), value: settings })
|
|
32
|
+
.toSorted((a, b) => a.value - b.value);
|
|
33
|
+
}, [settings]);
|
|
34
|
+
return (_jsxs(_Fragment, { children: ["Size:", ' ', _jsx("select", { children: validOptions.map((o) => (_jsx("option", { value: o.value, selected: o.value === settings, children: o.label }, o.value))) })] }));
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=zero_filling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zero_filling.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAMhC,MAAM,OAAO,GAAa;IACxB,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAC/B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAChC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAChC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAChC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IACjC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IACjC,EAAE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AC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spectrum_1d_processings_ui_plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/spectrum_1d_processings_ui/spectrum_1d_processings_ui_plugin.ts"],"names":[],"mappings":"AAIA,wBAAgB,uBAAuB,iDAQtC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineNMRiumPlugin } from '@zakodium/nmrium-core';
|
|
2
|
+
import { operatorsUI } from "./operators/index.js";
|
|
3
|
+
export function spectrum1DProcessingsUI() {
|
|
4
|
+
return defineNMRiumPlugin({
|
|
5
|
+
id: '@zakodium/nmrium-core-plugins-ui#Spectrum1DProcessingsUIPlugin',
|
|
6
|
+
version: 1,
|
|
7
|
+
shouldSerialize: false,
|
|
8
|
+
migrations: [],
|
|
9
|
+
operatorsUI,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=spectrum_1d_processings_ui_plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spectrum_1d_processings_ui_plugin.js","sourceRoot":"","sources":["../../../src/plugins/spectrum_1d_processings_ui/spectrum_1d_processings_ui_plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,UAAU,uBAAuB;IACrC,OAAO,kBAAkB,CAAC;QACxB,EAAE,EAAE,gEAAgE;QACpE,OAAO,EAAE,CAAC;QACV,eAAe,EAAE,KAAK;QACtB,UAAU,EAAE,EAAE;QACd,WAAW;KACZ,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/spectrum_2d_processings_ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/spectrum_2d_processings_ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_2d_processings_ui/operators/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_2d_processings_ui/operators/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAqC,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spectrum_1d_processings_ui_plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/spectrum_2d_processings_ui/spectrum_1d_processings_ui_plugin.ts"],"names":[],"mappings":"AAIA,wBAAgB,uBAAuB,iDAQtC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineNMRiumPlugin } from '@zakodium/nmrium-core';
|
|
2
|
+
import { operatorsUI } from "./operators/index.js";
|
|
3
|
+
export function spectrum2DProcessingsUI() {
|
|
4
|
+
return defineNMRiumPlugin({
|
|
5
|
+
id: '@zakodium/nmrium-core-plugins-ui#Spectrum2DProcessingsUIPlugin',
|
|
6
|
+
version: 1,
|
|
7
|
+
shouldSerialize: false,
|
|
8
|
+
migrations: [],
|
|
9
|
+
operatorsUI,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=spectrum_1d_processings_ui_plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spectrum_1d_processings_ui_plugin.js","sourceRoot":"","sources":["../../../src/plugins/spectrum_2d_processings_ui/spectrum_1d_processings_ui_plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,UAAU,uBAAuB;IACrC,OAAO,kBAAkB,CAAC;QACxB,EAAE,EAAE,gEAAgE;QACpE,OAAO,EAAE,CAAC;QACV,eAAe,EAAE,KAAK;QACtB,UAAU,EAAE,EAAE;QACd,WAAW;KACZ,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zakodium/nmrium-core-plugins-ui",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"license": "CC-BY-NC-SA-4.0",
|
|
5
|
+
"description": "UI related plugins needed for cheminfo/nmrium",
|
|
6
|
+
"keywords": [],
|
|
7
|
+
"author": "Zakodium Sàrl",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"nmrium-internal": "./src/index.ts",
|
|
12
|
+
"default": "./lib/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"lib",
|
|
17
|
+
"src"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"clean": "rimraf coverage dist lib-internal types",
|
|
21
|
+
"prepack": "yarn clean && yarn tsc",
|
|
22
|
+
"test": "yarn g:test-only && yarn g:check-types && yarn g:eslint && yarn g:prettier",
|
|
23
|
+
"tsc": "tsc --project tsconfig.build.json"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@blueprintjs/core": "^6.16.0",
|
|
27
|
+
"@blueprintjs/icons": "^6.11.0",
|
|
28
|
+
"@blueprintjs/select": "^6.3.0",
|
|
29
|
+
"@zakodium/nmrium-core": "^0.7.35",
|
|
30
|
+
"@zakodium/nmrium-core-plugins": "^0.7.45",
|
|
31
|
+
"fifo-logger": "^2.0.1",
|
|
32
|
+
"react": "^18.3.1",
|
|
33
|
+
"react-dom": "^18.3.1",
|
|
34
|
+
"react-science": "^20.3.1",
|
|
35
|
+
"zod": "^4.4.3"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/react": "^18.3.28",
|
|
39
|
+
"@types/react-dom": "^18.3.7",
|
|
40
|
+
"rimraf": "^6.1.3",
|
|
41
|
+
"typescript": "~6.0.3",
|
|
42
|
+
"vitest": "^4.1.9"
|
|
43
|
+
}
|
|
44
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NMRiumPlugin } from '@zakodium/nmrium-core';
|
|
2
|
+
import { NMRiumCore } from '@zakodium/nmrium-core';
|
|
3
|
+
|
|
4
|
+
import { recommended } from './plugins/index.ts';
|
|
5
|
+
|
|
6
|
+
export * from './plugins/index.ts';
|
|
7
|
+
|
|
8
|
+
export default function init(plugins?: NMRiumPlugin[]) {
|
|
9
|
+
const core = new NMRiumCore();
|
|
10
|
+
core.registerPlugins(recommended(core, plugins));
|
|
11
|
+
|
|
12
|
+
return core;
|
|
13
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { NMRiumCore, NMRiumPlugin } from '@zakodium/nmrium-core';
|
|
2
|
+
import { recommended as recommendedPlugins } from '@zakodium/nmrium-core-plugins';
|
|
3
|
+
|
|
4
|
+
import { spectrum1DProcessingsUI } from './spectrum_1d_processings_ui/index.ts';
|
|
5
|
+
import { spectrum2DProcessingsUI } from './spectrum_2d_processings_ui/index.ts';
|
|
6
|
+
|
|
7
|
+
export * from './spectrum_1d_processings_ui/index.ts';
|
|
8
|
+
export * from './spectrum_2d_processings_ui/index.ts';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Only recommended ui plugins from this package
|
|
12
|
+
*
|
|
13
|
+
* @param plugins
|
|
14
|
+
*/
|
|
15
|
+
export function recommendedUIOnly(plugins: NMRiumPlugin[] = []) {
|
|
16
|
+
return [spectrum1DProcessingsUI(), spectrum2DProcessingsUI()].concat(plugins);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Recommended plugins:
|
|
21
|
+
* - recommended from `@zakodium/nmrium-core-plugins`
|
|
22
|
+
* - recommendedUIOnly from `@zakodium/nmrium-core-plugins-ui`
|
|
23
|
+
* @param core
|
|
24
|
+
* @param plugins
|
|
25
|
+
*/
|
|
26
|
+
export function recommended(core: NMRiumCore, plugins: NMRiumPlugin[] = []) {
|
|
27
|
+
return recommendedPlugins(core, recommendedUIOnly(plugins));
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { spectrum1DProcessingsUI } from './spectrum_1d_processings_ui_plugin.ts';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
2
|
+
|
|
3
|
+
import { ApodizationExpanded } from './apodization_expand.tsx';
|
|
4
|
+
|
|
5
|
+
export const apodization1D = defineProcessingOperatorUI({
|
|
6
|
+
id: '@zakodium/nmrium-core-plugins#apodization1D',
|
|
7
|
+
name: 'Apodization / Window',
|
|
8
|
+
isEditable: true,
|
|
9
|
+
Expanded: ApodizationExpanded,
|
|
10
|
+
});
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import type { ProcessingOperatorUIExpandedProps } from '@zakodium/nmrium-core';
|
|
2
|
+
import { assert, cast } from '@zakodium/utils';
|
|
3
|
+
import { AppForm, useForm } from 'react-science/ui';
|
|
4
|
+
|
|
5
|
+
export function ApodizationExpanded(
|
|
6
|
+
props: ProcessingOperatorUIExpandedProps<'@zakodium/nmrium-core-plugins#apodization1D'>,
|
|
7
|
+
) {
|
|
8
|
+
const { operation, onChange, core, children } = props;
|
|
9
|
+
cast<'@zakodium/nmrium-core-plugins#apodization1D'>(operation.operatorId);
|
|
10
|
+
const operator = core.getOperator(operation.operatorId);
|
|
11
|
+
assert(
|
|
12
|
+
operator,
|
|
13
|
+
() =>
|
|
14
|
+
`Operator ${operation.operatorId} related to operation ${JSON.stringify(operation)} is missing`,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const validator = operator.schemaSettings;
|
|
18
|
+
const form = useForm({
|
|
19
|
+
defaultValues: operation.settings,
|
|
20
|
+
validators: { onDynamic: validator, onSubmit: validator },
|
|
21
|
+
onSubmit: ({ value }) => {
|
|
22
|
+
if (!onChange) return;
|
|
23
|
+
|
|
24
|
+
const newOperation = { ...operation, settings: validator.parse(value) };
|
|
25
|
+
onChange(newOperation);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const { AppField, SubmitButton } = form;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<AppForm form={form} layout="inline">
|
|
32
|
+
{children?.(
|
|
33
|
+
<SubmitButton variant="outlined" size="small" intent="success">
|
|
34
|
+
Apply
|
|
35
|
+
</SubmitButton>,
|
|
36
|
+
)}
|
|
37
|
+
|
|
38
|
+
<AppField
|
|
39
|
+
name="exponential.apply"
|
|
40
|
+
listeners={{
|
|
41
|
+
onChange: ({ value, fieldApi }) => {
|
|
42
|
+
if (!value) return;
|
|
43
|
+
const { exponential } = fieldApi.form.state.values;
|
|
44
|
+
const lineBroadening = exponential?.options?.lineBroadening;
|
|
45
|
+
if (typeof lineBroadening === 'number') return;
|
|
46
|
+
|
|
47
|
+
fieldApi.form.setFieldValue(
|
|
48
|
+
'exponential.options.lineBroadening',
|
|
49
|
+
1,
|
|
50
|
+
{ dontRunListeners: true },
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
{({ Checkbox, state }) => (
|
|
56
|
+
<>
|
|
57
|
+
<Checkbox label="Exponential" />
|
|
58
|
+
{state.value && (
|
|
59
|
+
<AppField name="exponential.options.lineBroadening">
|
|
60
|
+
{({ NumericInput }) => (
|
|
61
|
+
<NumericInput
|
|
62
|
+
label="Line broadening"
|
|
63
|
+
minorStepSize={0.01}
|
|
64
|
+
step={0.1}
|
|
65
|
+
majorStepSize={1}
|
|
66
|
+
/>
|
|
67
|
+
)}
|
|
68
|
+
</AppField>
|
|
69
|
+
)}
|
|
70
|
+
</>
|
|
71
|
+
)}
|
|
72
|
+
</AppField>
|
|
73
|
+
|
|
74
|
+
<AppField
|
|
75
|
+
name="gaussian.apply"
|
|
76
|
+
listeners={{
|
|
77
|
+
onChange: ({ value, fieldApi }) => {
|
|
78
|
+
if (!value) return;
|
|
79
|
+
const { gaussian } = fieldApi.form.state.values;
|
|
80
|
+
const lineBroadening = gaussian?.options?.lineBroadening;
|
|
81
|
+
const lineBroadeningCenter =
|
|
82
|
+
gaussian?.options?.lineBroadeningCenter;
|
|
83
|
+
|
|
84
|
+
if (typeof lineBroadening !== 'number') {
|
|
85
|
+
fieldApi.form.setFieldValue(
|
|
86
|
+
'gaussian.options.lineBroadening',
|
|
87
|
+
0.3,
|
|
88
|
+
{ dontRunListeners: true },
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (typeof lineBroadeningCenter !== 'number') {
|
|
93
|
+
fieldApi.form.setFieldValue(
|
|
94
|
+
'gaussian.options.lineBroadeningCenter',
|
|
95
|
+
0,
|
|
96
|
+
{ dontRunListeners: true },
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
{({ Checkbox, state }) => (
|
|
103
|
+
<>
|
|
104
|
+
<Checkbox label="Gaussian" />
|
|
105
|
+
{state.value && (
|
|
106
|
+
<>
|
|
107
|
+
<AppField name="gaussian.options.lineBroadening">
|
|
108
|
+
{({ NumericInput }) => (
|
|
109
|
+
<NumericInput
|
|
110
|
+
label="Line broadening"
|
|
111
|
+
minorStepSize={0.01}
|
|
112
|
+
step={0.1}
|
|
113
|
+
majorStepSize={1}
|
|
114
|
+
/>
|
|
115
|
+
)}
|
|
116
|
+
</AppField>
|
|
117
|
+
<AppField name="gaussian.options.lineBroadeningCenter">
|
|
118
|
+
{({ NumericInput }) => (
|
|
119
|
+
<NumericInput
|
|
120
|
+
label="Center"
|
|
121
|
+
helpText="keep it in [0 - 1] range"
|
|
122
|
+
min={0}
|
|
123
|
+
max={1}
|
|
124
|
+
minorStepSize={0.001}
|
|
125
|
+
step={0.01}
|
|
126
|
+
majorStepSize={0.1}
|
|
127
|
+
/>
|
|
128
|
+
)}
|
|
129
|
+
</AppField>
|
|
130
|
+
</>
|
|
131
|
+
)}
|
|
132
|
+
</>
|
|
133
|
+
)}
|
|
134
|
+
</AppField>
|
|
135
|
+
|
|
136
|
+
<AppField
|
|
137
|
+
name="sineBell.apply"
|
|
138
|
+
listeners={{
|
|
139
|
+
onChange: ({ value, fieldApi }) => {
|
|
140
|
+
if (!value) return;
|
|
141
|
+
const { sineBell } = fieldApi.form.state.values;
|
|
142
|
+
const offset = sineBell?.options?.offset;
|
|
143
|
+
if (typeof offset === 'number') return;
|
|
144
|
+
|
|
145
|
+
fieldApi.form.setFieldValue('sineBell.options.offset', 0, {
|
|
146
|
+
dontRunListeners: true,
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
}}
|
|
150
|
+
>
|
|
151
|
+
{({ Checkbox, state }) => (
|
|
152
|
+
<>
|
|
153
|
+
<Checkbox label="Sine Bell" />
|
|
154
|
+
{state.value && (
|
|
155
|
+
<AppField name="sineBell.options.offset">
|
|
156
|
+
{({ NumericInput }) => <NumericInput label="Offset" />}
|
|
157
|
+
</AppField>
|
|
158
|
+
)}
|
|
159
|
+
</>
|
|
160
|
+
)}
|
|
161
|
+
</AppField>
|
|
162
|
+
|
|
163
|
+
<AppField
|
|
164
|
+
name="sineSquare.apply"
|
|
165
|
+
listeners={{
|
|
166
|
+
onChange: ({ value, fieldApi }) => {
|
|
167
|
+
if (!value) return;
|
|
168
|
+
const { sineSquare } = fieldApi.form.state.values;
|
|
169
|
+
const offset = sineSquare?.options?.offset;
|
|
170
|
+
if (typeof offset === 'number') return;
|
|
171
|
+
|
|
172
|
+
fieldApi.form.setFieldValue('sineSquare.options.offset', 0, {
|
|
173
|
+
dontRunListeners: true,
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
}}
|
|
177
|
+
>
|
|
178
|
+
{({ Checkbox, state }) => (
|
|
179
|
+
<>
|
|
180
|
+
<Checkbox label="Sine Square" />
|
|
181
|
+
{state.value && (
|
|
182
|
+
<AppField name="sineSquare.options.offset">
|
|
183
|
+
{({ NumericInput }) => <NumericInput label="Offset" />}
|
|
184
|
+
</AppField>
|
|
185
|
+
)}
|
|
186
|
+
</>
|
|
187
|
+
)}
|
|
188
|
+
</AppField>
|
|
189
|
+
|
|
190
|
+
<AppField
|
|
191
|
+
name="traf.apply"
|
|
192
|
+
listeners={{
|
|
193
|
+
onChange: ({ value, fieldApi }) => {
|
|
194
|
+
if (!value) return;
|
|
195
|
+
const { traf } = fieldApi.form.state.values;
|
|
196
|
+
const lineBroadening = traf?.options?.lineBroadening;
|
|
197
|
+
if (typeof lineBroadening === 'number') return;
|
|
198
|
+
|
|
199
|
+
fieldApi.form.setFieldValue('traf.options.lineBroadening', 0.3, {
|
|
200
|
+
dontRunListeners: true,
|
|
201
|
+
});
|
|
202
|
+
},
|
|
203
|
+
}}
|
|
204
|
+
>
|
|
205
|
+
{({ Checkbox, state }) => (
|
|
206
|
+
<>
|
|
207
|
+
<Checkbox label="Traf" />
|
|
208
|
+
{state.value && (
|
|
209
|
+
<AppField name="traf.options.lineBroadening">
|
|
210
|
+
{({ NumericInput }) => (
|
|
211
|
+
<NumericInput
|
|
212
|
+
label="Line broadening"
|
|
213
|
+
minorStepSize={0.01}
|
|
214
|
+
step={0.1}
|
|
215
|
+
majorStepSize={1}
|
|
216
|
+
/>
|
|
217
|
+
)}
|
|
218
|
+
</AppField>
|
|
219
|
+
)}
|
|
220
|
+
</>
|
|
221
|
+
)}
|
|
222
|
+
</AppField>
|
|
223
|
+
</AppForm>
|
|
224
|
+
);
|
|
225
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
2
|
+
|
|
3
|
+
const formatter = new Intl.NumberFormat('en-US');
|
|
4
|
+
|
|
5
|
+
export const digitalFilter1D = defineProcessingOperatorUI({
|
|
6
|
+
id: '@zakodium/nmrium-core-plugins#digitalFilter1D',
|
|
7
|
+
name: 'Digital filter',
|
|
8
|
+
Expanded(props) {
|
|
9
|
+
return `Value: ${formatter.format(props.operation.settings)}`;
|
|
10
|
+
},
|
|
11
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
2
|
+
|
|
3
|
+
import { apodization1D } from './apodization.ts';
|
|
4
|
+
import { digitalFilter1D } from './digital_filter.tsx';
|
|
5
|
+
import { fft1D } from './fft.tsx';
|
|
6
|
+
import { phaseCorrection1D } from './phase_correction.tsx';
|
|
7
|
+
import { shiftX1D } from './shift_x.tsx';
|
|
8
|
+
import { zeroFilling1D } from './zero_filling.tsx';
|
|
9
|
+
|
|
10
|
+
export const operatorsUI: Array<ProcessingOperatorUI<any>> = [
|
|
11
|
+
digitalFilter1D,
|
|
12
|
+
apodization1D,
|
|
13
|
+
zeroFilling1D,
|
|
14
|
+
fft1D,
|
|
15
|
+
shiftX1D,
|
|
16
|
+
phaseCorrection1D,
|
|
17
|
+
];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
2
|
+
|
|
3
|
+
export const phaseCorrection1D = defineProcessingOperatorUI({
|
|
4
|
+
id: '@zakodium/nmrium-core-plugins#phaseCorrection1D',
|
|
5
|
+
name: 'Phase correction',
|
|
6
|
+
isEditable: true,
|
|
7
|
+
Expanded: (props) => {
|
|
8
|
+
const { operation } = props;
|
|
9
|
+
const { settings } = operation;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<>
|
|
13
|
+
<label>
|
|
14
|
+
Algorithm:
|
|
15
|
+
<select>
|
|
16
|
+
<option value="automatic">Automatic</option>
|
|
17
|
+
<option value="manual" selected>
|
|
18
|
+
Manual
|
|
19
|
+
</option>
|
|
20
|
+
</select>
|
|
21
|
+
</label>
|
|
22
|
+
<label>
|
|
23
|
+
PH0:
|
|
24
|
+
<input type="number" value={settings.ph0} />
|
|
25
|
+
</label>
|
|
26
|
+
<label>
|
|
27
|
+
PH1:
|
|
28
|
+
<input type="number" value={settings.ph1} />
|
|
29
|
+
</label>
|
|
30
|
+
</>
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
interface Option {
|
|
5
|
+
label: string;
|
|
6
|
+
value: number;
|
|
7
|
+
}
|
|
8
|
+
const options: Option[] = [
|
|
9
|
+
{ label: '256', value: 2 ** 8 },
|
|
10
|
+
{ label: '512', value: 2 ** 9 },
|
|
11
|
+
{ label: '1K', value: 2 ** 10 },
|
|
12
|
+
{ label: '2K', value: 2 ** 11 },
|
|
13
|
+
{ label: '4K', value: 2 ** 12 },
|
|
14
|
+
{ label: '8K', value: 2 ** 13 },
|
|
15
|
+
{ label: '16K', value: 2 ** 14 },
|
|
16
|
+
{ label: '32K', value: 2 ** 15 },
|
|
17
|
+
{ label: '64K', value: 2 ** 16 },
|
|
18
|
+
{ label: '128K', value: 2 ** 17 },
|
|
19
|
+
{ label: '256K', value: 2 ** 18 },
|
|
20
|
+
{ label: '512K', value: 2 ** 19 },
|
|
21
|
+
{ label: '1M', value: 2 ** 20 },
|
|
22
|
+
{ label: '2M', value: 2 ** 21 },
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
export const zeroFilling1D = defineProcessingOperatorUI({
|
|
26
|
+
id: '@zakodium/nmrium-core-plugins#zeroFilling1D',
|
|
27
|
+
name: 'Zero filling',
|
|
28
|
+
isEditable: true,
|
|
29
|
+
Expanded(props) {
|
|
30
|
+
const { operation } = props;
|
|
31
|
+
const { settings } = operation;
|
|
32
|
+
|
|
33
|
+
const validOptions = useMemo(() => {
|
|
34
|
+
if (options.some((o) => o.value === settings)) return options;
|
|
35
|
+
|
|
36
|
+
return options
|
|
37
|
+
.concat({ label: String(settings), value: settings })
|
|
38
|
+
.toSorted((a, b) => a.value - b.value);
|
|
39
|
+
}, [settings]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
Size:{' '}
|
|
44
|
+
<select>
|
|
45
|
+
{validOptions.map((o) => (
|
|
46
|
+
<option
|
|
47
|
+
key={o.value}
|
|
48
|
+
value={o.value}
|
|
49
|
+
selected={o.value === settings}
|
|
50
|
+
>
|
|
51
|
+
{o.label}
|
|
52
|
+
</option>
|
|
53
|
+
))}
|
|
54
|
+
</select>
|
|
55
|
+
</>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineNMRiumPlugin } from '@zakodium/nmrium-core';
|
|
2
|
+
|
|
3
|
+
import { operatorsUI } from './operators/index.ts';
|
|
4
|
+
|
|
5
|
+
export function spectrum1DProcessingsUI() {
|
|
6
|
+
return defineNMRiumPlugin({
|
|
7
|
+
id: '@zakodium/nmrium-core-plugins-ui#Spectrum1DProcessingsUIPlugin',
|
|
8
|
+
version: 1,
|
|
9
|
+
shouldSerialize: false,
|
|
10
|
+
migrations: [],
|
|
11
|
+
operatorsUI,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { spectrum2DProcessingsUI } from './spectrum_1d_processings_ui_plugin.ts';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineNMRiumPlugin } from '@zakodium/nmrium-core';
|
|
2
|
+
|
|
3
|
+
import { operatorsUI } from './operators/index.ts';
|
|
4
|
+
|
|
5
|
+
export function spectrum2DProcessingsUI() {
|
|
6
|
+
return defineNMRiumPlugin({
|
|
7
|
+
id: '@zakodium/nmrium-core-plugins-ui#Spectrum2DProcessingsUIPlugin',
|
|
8
|
+
version: 1,
|
|
9
|
+
shouldSerialize: false,
|
|
10
|
+
migrations: [],
|
|
11
|
+
operatorsUI,
|
|
12
|
+
});
|
|
13
|
+
}
|