nmrium 0.19.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/lib/component/1d/Chart1D.js +3 -3
  2. package/lib/component/1d/ExclusionZoneAnnotation.d.ts +11 -0
  3. package/lib/component/1d/ExclusionZoneAnnotation.js +18 -0
  4. package/lib/component/1d/ExclusionZonesAnnotations.d.ts +3 -0
  5. package/lib/component/1d/ExclusionZonesAnnotations.js +28 -0
  6. package/lib/component/1d/Line.js +11 -23
  7. package/lib/component/1d/Viewer1D.js +36 -5
  8. package/lib/component/1d/ranges/Ranges.js +3 -3
  9. package/lib/component/1d/{BaseLineZones.d.ts → tool/BaseLineZones.d.ts} +0 -0
  10. package/lib/component/1d/{BaseLineZones.js → tool/BaseLineZones.js} +5 -5
  11. package/lib/component/1d/utilities/useIntegralPath.js +9 -10
  12. package/lib/component/2d/Contours.js +12 -11
  13. package/lib/component/2d/Left1DChart.js +7 -9
  14. package/lib/component/2d/Top1DChart.js +7 -7
  15. package/lib/component/2d/tools/slicing/HorizontalSliceChart.js +7 -7
  16. package/lib/component/2d/tools/slicing/VerticalSliceChart.js +7 -9
  17. package/lib/component/EventsTrackers/BrushTracker.js +2 -2
  18. package/lib/component/EventsTrackers/KeysListenerTracker.js +106 -80
  19. package/lib/component/NMRium.d.ts +8 -3
  20. package/lib/component/NMRium.js +36 -33
  21. package/lib/component/elements/NumberInput.d.ts +1 -2
  22. package/lib/component/elements/Tab/Tab.js +1 -0
  23. package/lib/component/header/Header.js +10 -3
  24. package/lib/component/hooks/useActiveSpectrumStyleOptions.d.ts +6 -0
  25. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +15 -0
  26. package/lib/component/hooks/useCheckExperimentalFeature.js +2 -1
  27. package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -0
  28. package/lib/component/hooks/useCheckToolsVisibility.js +6 -0
  29. package/lib/component/hooks/useToolsFunctions.js +2 -1
  30. package/lib/component/hooks/useXYReduce.d.ts +2 -1
  31. package/lib/component/loader/DropZone.js +88 -88
  32. package/lib/component/modal/ModalStyle.js +5 -2
  33. package/lib/component/modal/MoleculeStructureEditorModal.js +3 -2
  34. package/lib/component/modal/MultipleSpectraFiltersModal/index.js +10 -1
  35. package/lib/component/modal/changeSum/ChangeSumModal.js +4 -2
  36. package/lib/component/modal/setting/DisplayTabContent.js +1 -1
  37. package/lib/component/modal/setting/GeneralSettings.js +1 -5
  38. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
  39. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +4 -17
  40. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.d.ts +2 -0
  41. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +35 -0
  42. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +49 -67
  43. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +3 -8
  44. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -23
  45. package/lib/component/panels/Panels.js +10 -0
  46. package/lib/component/panels/PeaksPanel/PeaksPanel.js +0 -3
  47. package/lib/component/panels/PeaksPanel/PeaksPreferences.js +5 -14
  48. package/lib/component/panels/RangesPanel/RangesPanel.js +0 -3
  49. package/lib/component/panels/RangesPanel/RangesPreferences.js +5 -18
  50. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
  51. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +1 -1
  52. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.d.ts +5 -5
  53. package/lib/component/panels/SummaryPanel/SummaryPanel.js +1 -1
  54. package/lib/component/panels/SummaryPanel/Utilities.d.ts +7 -7
  55. package/lib/component/panels/ZonesPanel/ZonesPanel.js +0 -3
  56. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +5 -18
  57. package/lib/component/panels/ZonesPanel/ZonesTable.js +9 -2
  58. package/lib/component/panels/databasePanel/DatabasePanel.js +0 -3
  59. package/lib/component/panels/databasePanel/DatabasePreferences.js +4 -17
  60. package/lib/component/reducer/Reducer.d.ts +11 -27
  61. package/lib/component/reducer/Reducer.js +4 -5
  62. package/lib/component/reducer/actions/CorrelationsActions.d.ts +7 -7
  63. package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
  64. package/lib/component/reducer/actions/FiltersActions.d.ts +3 -1
  65. package/lib/component/reducer/actions/FiltersActions.js +60 -18
  66. package/lib/component/reducer/actions/LoadActions.js +2 -3
  67. package/lib/component/reducer/actions/MoleculeActions.js +2 -2
  68. package/lib/component/reducer/actions/PreferencesActions.js +4 -7
  69. package/lib/component/reducer/actions/RangesActions.js +1 -1
  70. package/lib/component/reducer/actions/ToolsActions.d.ts +1 -3
  71. package/lib/component/reducer/actions/ToolsActions.js +13 -59
  72. package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -0
  73. package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -1
  74. package/lib/component/reducer/helper/getRange.d.ts +6 -1
  75. package/lib/component/reducer/helper/getRange.js +1 -1
  76. package/lib/component/reducer/preferencesReducer.d.ts +2 -0
  77. package/lib/component/reducer/preferencesReducer.js +76 -36
  78. package/lib/component/toolbar/FunctionToolBar.js +9 -15
  79. package/lib/component/toolbar/ToolTypes.js +3 -3
  80. package/lib/component/utility/PathBuilder.d.ts +7 -0
  81. package/lib/component/utility/PathBuilder.js +17 -0
  82. package/lib/component/utility/getSpectraByNucleus.d.ts +3 -0
  83. package/lib/component/utility/getSpectraByNucleus.js +4 -0
  84. package/lib/component/workspaces/Workspace.d.ts +6 -0
  85. package/lib/component/workspaces/Workspace.js +1 -0
  86. package/lib/component/workspaces/basic.d.ts +2 -0
  87. package/lib/component/workspaces/basic.js +45 -0
  88. package/lib/component/workspaces/exercise1D.d.ts +2 -0
  89. package/lib/component/workspaces/exercise1D.js +45 -0
  90. package/lib/component/workspaces/index.d.ts +6 -0
  91. package/lib/component/workspaces/index.js +4 -0
  92. package/lib/component/workspaces/process1D.d.ts +2 -0
  93. package/lib/component/workspaces/process1D.js +43 -0
  94. package/lib/data/Filters.d.ts +2 -1
  95. package/lib/data/Filters.js +2 -1
  96. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -2
  97. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -1
  98. package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +0 -1
  99. package/lib/data/data1d/Spectrum1D/ranges/detectSignal.d.ts +3 -2
  100. package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +23 -15
  101. package/lib/data/data1d/filter1d/exclusionZones.d.ts +16 -0
  102. package/lib/data/data1d/filter1d/exclusionZones.js +28 -0
  103. package/lib/data/migration/MigrationManager.js +3 -0
  104. package/lib/data/types/data1d/ExclusionZone.d.ts +5 -0
  105. package/lib/data/types/data1d/ExclusionZone.js +1 -0
  106. package/lib/versionInfo.js +1 -1
  107. package/lib-cjs/component/1d/Chart1D.js +3 -3
  108. package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +23 -0
  109. package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +52 -0
  110. package/lib-cjs/component/1d/Line.js +11 -23
  111. package/lib-cjs/component/1d/Viewer1D.js +36 -5
  112. package/lib-cjs/component/1d/ranges/Ranges.js +1 -1
  113. package/lib-cjs/component/1d/{BaseLineZones.js → tool/BaseLineZones.js} +5 -5
  114. package/lib-cjs/component/1d/utilities/useIntegralPath.js +9 -10
  115. package/lib-cjs/component/2d/Contours.js +12 -11
  116. package/lib-cjs/component/2d/Left1DChart.js +7 -9
  117. package/lib-cjs/component/2d/Top1DChart.js +7 -7
  118. package/lib-cjs/component/2d/tools/slicing/HorizontalSliceChart.js +7 -7
  119. package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +7 -9
  120. package/lib-cjs/component/EventsTrackers/BrushTracker.js +2 -2
  121. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +106 -80
  122. package/lib-cjs/component/NMRium.js +37 -34
  123. package/lib-cjs/component/elements/Tab/Tab.js +1 -0
  124. package/lib-cjs/component/header/Header.js +10 -3
  125. package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +21 -0
  126. package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -1
  127. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +13 -0
  128. package/lib-cjs/component/hooks/useToolsFunctions.js +2 -1
  129. package/lib-cjs/component/loader/DropZone.js +88 -88
  130. package/lib-cjs/component/modal/ModalStyle.js +5 -2
  131. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +3 -2
  132. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +10 -1
  133. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +4 -2
  134. package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
  135. package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -5
  136. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
  137. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +3 -16
  138. package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +40 -0
  139. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +48 -66
  140. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +3 -8
  141. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -22
  142. package/lib-cjs/component/panels/Panels.js +10 -0
  143. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +0 -3
  144. package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +4 -13
  145. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +0 -3
  146. package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +4 -17
  147. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
  148. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +1 -1
  149. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +0 -3
  150. package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -17
  151. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -1
  152. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +0 -3
  153. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +3 -16
  154. package/lib-cjs/component/reducer/Reducer.js +4 -5
  155. package/lib-cjs/component/reducer/actions/FiltersActions.js +62 -18
  156. package/lib-cjs/component/reducer/actions/LoadActions.js +2 -3
  157. package/lib-cjs/component/reducer/actions/MoleculeActions.js +2 -2
  158. package/lib-cjs/component/reducer/actions/PreferencesActions.js +4 -7
  159. package/lib-cjs/component/reducer/actions/RangesActions.js +1 -1
  160. package/lib-cjs/component/reducer/actions/ToolsActions.js +13 -61
  161. package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -1
  162. package/lib-cjs/component/reducer/helper/getRange.js +1 -1
  163. package/lib-cjs/component/reducer/preferencesReducer.js +75 -35
  164. package/lib-cjs/component/toolbar/FunctionToolBar.js +9 -15
  165. package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
  166. package/lib-cjs/component/utility/PathBuilder.js +21 -0
  167. package/lib-cjs/component/utility/getSpectraByNucleus.js +11 -0
  168. package/lib-cjs/component/workspaces/Workspace.js +2 -0
  169. package/lib-cjs/component/workspaces/basic.js +48 -0
  170. package/lib-cjs/component/workspaces/exercise1D.js +48 -0
  171. package/lib-cjs/component/workspaces/index.js +6 -0
  172. package/lib-cjs/component/workspaces/process1D.js +46 -0
  173. package/lib-cjs/data/Filters.js +3 -1
  174. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +5 -2
  175. package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -1
  176. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +0 -1
  177. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +24 -15
  178. package/lib-cjs/data/data1d/filter1d/exclusionZones.js +34 -0
  179. package/lib-cjs/data/migration/MigrationManager.js +3 -0
  180. package/lib-cjs/data/types/data1d/ExclusionZone.js +2 -0
  181. package/lib-cjs/versionInfo.js +1 -1
  182. package/package.json +28 -29
  183. package/lib/component/1d/ExclusionZone.d.ts +0 -8
  184. package/lib/component/1d/ExclusionZone.js +0 -30
  185. package/lib/component/1d/ExclusionZones.d.ts +0 -2
  186. package/lib/component/1d/ExclusionZones.js +0 -10
  187. package/lib/component/nmriumMode/basic.d.ts +0 -38
  188. package/lib/component/nmriumMode/basic.js +0 -37
  189. package/lib/component/nmriumMode/exercise1D.d.ts +0 -38
  190. package/lib/component/nmriumMode/exercise1D.js +0 -37
  191. package/lib/component/nmriumMode/process1D.d.ts +0 -38
  192. package/lib/component/nmriumMode/process1D.js +0 -37
  193. package/lib-cjs/component/1d/ExclusionZone.js +0 -32
  194. package/lib-cjs/component/1d/ExclusionZones.js +0 -16
  195. package/lib-cjs/component/nmriumMode/basic.js +0 -39
  196. package/lib-cjs/component/nmriumMode/exercise1D.js +0 -39
  197. package/lib-cjs/component/nmriumMode/process1D.js +0 -39
@@ -66,7 +66,7 @@ exports.options = {
66
66
  },
67
67
  rangesPicking: {
68
68
  id: 'rangesPicking',
69
- label: 'Ranges Picking ( Press r )',
69
+ label: 'Ranges Picking',
70
70
  hasOptionPanel: true,
71
71
  isFilter: false,
72
72
  },
@@ -78,13 +78,13 @@ exports.options = {
78
78
  },
79
79
  phaseCorrection: {
80
80
  id: Filters.phaseCorrection.id,
81
- label: `${Filters.phaseCorrection.name} ( Press a )`,
81
+ label: Filters.phaseCorrection.name,
82
82
  hasOptionPanel: true,
83
83
  isFilter: true,
84
84
  },
85
85
  baseLineCorrection: {
86
86
  id: 'baseLineCorrection',
87
- label: 'baseline correction ( Press b )',
87
+ label: 'baseline correction',
88
88
  hasOptionPanel: true,
89
89
  isFilter: true,
90
90
  },
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PathBuilder = void 0;
4
+ class PathBuilder {
5
+ constructor() {
6
+ this.array = [];
7
+ }
8
+ moveTo(x, y) {
9
+ this.array.push(`M ${x} ${y}`);
10
+ }
11
+ lineTo(x, y) {
12
+ this.array.push(`L ${x} ${y}`);
13
+ }
14
+ closePath() {
15
+ this.array.push('Z');
16
+ }
17
+ toString() {
18
+ return this.array.join(' ');
19
+ }
20
+ }
21
+ exports.PathBuilder = PathBuilder;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getSpectraByNucleus = void 0;
7
+ const nucleusToString_1 = __importDefault(require("./nucleusToString"));
8
+ function getSpectraByNucleus(nucleus, data) {
9
+ return data.filter((spectrum) => (0, nucleusToString_1.default)(spectrum.info.nucleus) === nucleus);
10
+ }
11
+ exports.getSpectraByNucleus = getSpectraByNucleus;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.basic = void 0;
4
+ exports.basic = {
5
+ version: 1,
6
+ label: 'Default Mode',
7
+ display: {
8
+ general: {
9
+ disableMultipletAnalysis: false,
10
+ hideSetSumFromMolecule: false,
11
+ hideGeneralSettings: false,
12
+ hideExperimentalFeatures: false,
13
+ },
14
+ panels: {
15
+ hideSpectraPanel: false,
16
+ hideInformationPanel: false,
17
+ hidePeaksPanel: false,
18
+ hideIntegralsPanel: false,
19
+ hideRangesPanel: false,
20
+ hideStructuresPanel: false,
21
+ hideFiltersPanel: false,
22
+ hideZonesPanel: false,
23
+ hideSummaryPanel: false,
24
+ hideMultipleSpectraAnalysisPanel: false,
25
+ hideDatabasePanel: false,
26
+ },
27
+ toolBarButtons: {
28
+ hideZoomTool: false,
29
+ hideZoomOutTool: false,
30
+ hideImport: false,
31
+ hideExportAs: false,
32
+ hideSpectraStackAlignments: false,
33
+ hideSpectraCenterAlignments: false,
34
+ hideRealImaginary: false,
35
+ hidePeakTool: false,
36
+ hideIntegralTool: false,
37
+ hideZonePickingTool: false,
38
+ hideSlicingTool: false,
39
+ hideAutoRangesTool: false,
40
+ hideZeroFillingTool: false,
41
+ hidePhaseCorrectionTool: false,
42
+ hideBaseLineCorrectionTool: false,
43
+ hideFFTTool: false,
44
+ hideMultipleSpectraAnalysisTool: false,
45
+ hideExclusionZonesTool: false,
46
+ },
47
+ },
48
+ };
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.exercise1D = void 0;
4
+ exports.exercise1D = {
5
+ version: 1,
6
+ label: 'Exercise 1D Mode',
7
+ display: {
8
+ general: {
9
+ disableMultipletAnalysis: true,
10
+ hideSetSumFromMolecule: true,
11
+ hideGeneralSettings: true,
12
+ hideExperimentalFeatures: true,
13
+ },
14
+ panels: {
15
+ hideSpectraPanel: false,
16
+ hideInformationPanel: true,
17
+ hidePeaksPanel: true,
18
+ hideIntegralsPanel: false,
19
+ hideRangesPanel: true,
20
+ hideStructuresPanel: true,
21
+ hideFiltersPanel: true,
22
+ hideZonesPanel: true,
23
+ hideSummaryPanel: true,
24
+ hideMultipleSpectraAnalysisPanel: true,
25
+ hideDatabasePanel: true,
26
+ },
27
+ toolBarButtons: {
28
+ hideZoomTool: false,
29
+ hideZoomOutTool: false,
30
+ hideImport: true,
31
+ hideExportAs: true,
32
+ hideSpectraStackAlignments: false,
33
+ hideSpectraCenterAlignments: false,
34
+ hideRealImaginary: true,
35
+ hidePeakTool: false,
36
+ hideIntegralTool: false,
37
+ hideZonePickingTool: true,
38
+ hideSlicingTool: true,
39
+ hideAutoRangesTool: true,
40
+ hideZeroFillingTool: true,
41
+ hidePhaseCorrectionTool: true,
42
+ hideBaseLineCorrectionTool: true,
43
+ hideFFTTool: true,
44
+ hideMultipleSpectraAnalysisTool: true,
45
+ hideExclusionZonesTool: true,
46
+ },
47
+ },
48
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const basic_1 = require("./basic");
4
+ const exercise1D_1 = require("./exercise1D");
5
+ const process1D_1 = require("./process1D");
6
+ exports.default = { exercise1D: exercise1D_1.exercise1D, basic: basic_1.basic, process1D: process1D_1.process1D };
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.process1D = void 0;
4
+ exports.process1D = {
5
+ version: 1,
6
+ label: 'Process 1D Mode',
7
+ display: {
8
+ general: {
9
+ disableMultipletAnalysis: true,
10
+ hideSetSumFromMolecule: false,
11
+ hideGeneralSettings: false,
12
+ hideExperimentalFeatures: false,
13
+ },
14
+ panels: {
15
+ hideSpectraPanel: false,
16
+ hideInformationPanel: false,
17
+ hidePeaksPanel: false,
18
+ hideIntegralsPanel: false,
19
+ hideRangesPanel: true,
20
+ hideStructuresPanel: false,
21
+ hideFiltersPanel: false,
22
+ hideZonesPanel: true,
23
+ hideSummaryPanel: true,
24
+ hideMultipleSpectraAnalysisPanel: true,
25
+ hideDatabasePanel: false,
26
+ },
27
+ toolBarButtons: {
28
+ hideZoomTool: false,
29
+ hideZoomOutTool: false,
30
+ hideImport: true,
31
+ hideExportAs: true,
32
+ hideSpectraStackAlignments: false,
33
+ hideSpectraCenterAlignments: false,
34
+ hideRealImaginary: false,
35
+ hidePeakTool: false,
36
+ hideIntegralTool: false,
37
+ hideAutoRangesTool: true,
38
+ hideZeroFillingTool: false,
39
+ hidePhaseCorrectionTool: false,
40
+ hideBaseLineCorrectionTool: false,
41
+ hideFFTTool: false,
42
+ hideMultipleSpectraAnalysisTool: true,
43
+ hideExclusionZonesTool: true,
44
+ },
45
+ },
46
+ };
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.shift2DY = exports.shift2DX = exports.pareto = exports.centerMean = exports.standardDeviation = exports.equallySpaced = exports.fromTo = exports.digitalFilter = exports.zeroFilling = exports.shiftX = exports.autoPhaseCorrection = exports.phaseCorrection = exports.fft = exports.lineBroadening = exports.baselineCorrection = exports.absolute = void 0;
22
+ exports.shift2DY = exports.shift2DX = exports.exclusionZones = exports.pareto = exports.centerMean = exports.standardDeviation = exports.equallySpaced = exports.fromTo = exports.digitalFilter = exports.zeroFilling = exports.shiftX = exports.autoPhaseCorrection = exports.phaseCorrection = exports.fft = exports.lineBroadening = exports.baselineCorrection = exports.absolute = void 0;
23
23
  const absolute = __importStar(require("./data1d/filter1d/absolute"));
24
24
  exports.absolute = absolute;
25
25
  const autoPhaseCorrection = __importStar(require("./data1d/filter1d/autoPhaseCorrection"));
@@ -32,6 +32,8 @@ const digitalFilter = __importStar(require("./data1d/filter1d/digitalFilter"));
32
32
  exports.digitalFilter = digitalFilter;
33
33
  const equallySpaced = __importStar(require("./data1d/filter1d/equallySpaced"));
34
34
  exports.equallySpaced = equallySpaced;
35
+ const exclusionZones = __importStar(require("./data1d/filter1d/exclusionZones"));
36
+ exports.exclusionZones = exclusionZones;
35
37
  const fft = __importStar(require("./data1d/filter1d/fft"));
36
38
  exports.fft = fft;
37
39
  const fromTo = __importStar(require("./data1d/filter1d/fromTo"));
@@ -15,14 +15,17 @@ function addRange(datum, options) {
15
15
  const { from, to, molecules, nucleus } = options;
16
16
  const { x, re } = datum.data;
17
17
  const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from, to, reverse: true });
18
- const signals = (0, detectSignal_1.default)(x, re, from, to, datum.info.originFrequency);
18
+ // detectSignal use the advance multiplet-analysis that can crash if too many points
19
+ const signal = (0, detectSignal_1.default)(x, re, from, to, datum.info.originFrequency);
20
+ if (!signal)
21
+ return;
19
22
  try {
20
23
  const range = {
21
24
  id: (0, generateID_1.default)(),
22
25
  from,
23
26
  to,
24
27
  absolute,
25
- signals: [{ id: (0, generateID_1.default)(), ...signals }],
28
+ signals: [{ id: (0, generateID_1.default)(), ...signal }],
26
29
  kind: SignalsKinds_1.DatumKind.signal,
27
30
  integration: 0,
28
31
  };
@@ -32,12 +32,17 @@ function autoRangesDetection(datum1D, options = {}) {
32
32
  re = re.slice(windowFromIndex, windowToIndex);
33
33
  }
34
34
  if (originFrequency) {
35
- let ws = Math.max(Math.round(1 / originFrequency / (x[1] - x[0])), 5);
35
+ // we calculate the number of points per Hz
36
+ let pointsPerHz = 1 / originFrequency / (x[1] - x[0]);
37
+ // we can consider a peak with of 0.5 Hz for the windowSize
38
+ let ws = Math.max(Math.round(pointsPerHz / 2), 5);
36
39
  peakPickingOptions.sgOptions = {
37
40
  windowSize: ws - (ws % 2) + 1,
38
41
  polynomial: 3,
39
42
  };
40
43
  }
44
+ peakPickingOptions.smoothY = undefined;
45
+ peakPickingOptions.sgOptions = undefined;
41
46
  const ranges = (0, nmr_processing_1.xyAutoRangesPicking)({ x, y: re }, {
42
47
  peakPicking: peakPickingOptions,
43
48
  ranges: rangesOptions,
@@ -11,7 +11,6 @@ function detectRange(datum, options) {
11
11
  const { from, to } = options;
12
12
  const { x, re: y } = datum.data;
13
13
  const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y }, { from, to, reverse: true });
14
- // @ts-expect-error Types will be fixed in ml-spectra-processing.
15
14
  const min = (0, ml_spectra_processing_1.xyMinYPoint)({ x, y }, { from, to }).y;
16
15
  const max = (0, ml_spectra_processing_1.xyMaxYPoint)({ x, y }, { from, to }).y;
17
16
  const shiftX = (0, getShiftX_1.getShiftX)(datum);
@@ -1,26 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_LENGTH = void 0;
3
4
  const ml_spectra_processing_1 = require("ml-spectra-processing");
4
5
  const multiplet_analysis_1 = require("multiplet-analysis");
6
+ exports.MAX_LENGTH = 2048;
5
7
  function detectSignal(x, re, from, to, frequency) {
6
8
  const { fromIndex, toIndex } = (0, ml_spectra_processing_1.xGetFromToIndex)(x, {
7
9
  from: from,
8
10
  to: to,
9
11
  });
10
- const data = {
11
- x: x.slice(fromIndex, toIndex),
12
- y: re.slice(fromIndex, toIndex),
13
- };
14
- const result = (0, multiplet_analysis_1.analyseMultiplet)(data, {
15
- frequency: frequency,
16
- takeBestPartMultiplet: true,
17
- symmetrizeEachStep: true,
18
- });
19
- return {
20
- multiplicity: result.js.map((j) => j.multiplicity).join(''),
21
- kind: 'signal',
22
- delta: result.chemShift,
23
- js: result.js,
24
- };
12
+ if (toIndex - fromIndex <= exports.MAX_LENGTH) {
13
+ const data = {
14
+ x: x.subarray(fromIndex, toIndex),
15
+ y: re.subarray(fromIndex, toIndex),
16
+ };
17
+ const result = (0, multiplet_analysis_1.analyseMultiplet)(data, {
18
+ frequency: frequency,
19
+ takeBestPartMultiplet: true,
20
+ symmetrizeEachStep: true,
21
+ });
22
+ if (result && result.chemShift === undefined)
23
+ return;
24
+ return {
25
+ multiplicity: result.js.map((j) => j.multiplicity).join(''),
26
+ kind: 'signal',
27
+ delta: result.chemShift,
28
+ js: result.js,
29
+ };
30
+ }
31
+ else {
32
+ throw new Error(`length of signal should not exceed ${exports.MAX_LENGTH} points`);
33
+ }
25
34
  }
26
35
  exports.default = detectSignal;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reduce = exports.isApplicable = exports.apply = exports.name = exports.id = void 0;
4
+ const ml_spectra_processing_1 = require("ml-spectra-processing");
5
+ exports.id = 'exclusionZones';
6
+ exports.name = 'Exclusion Zones';
7
+ /**
8
+ *
9
+ * @param {Datum1d} datum1d
10
+ */
11
+ function apply(datum1D, zones = []) {
12
+ if (!isApplicable(datum1D)) {
13
+ throw new Error('Exclusion Zones filter not applicable on this data');
14
+ }
15
+ const { x, re, im } = datum1D.data;
16
+ datum1D.data.re = (0, ml_spectra_processing_1.xySetYValue)({ x, y: re }, { zones }).y;
17
+ datum1D.data.im = (im
18
+ ? (0, ml_spectra_processing_1.xySetYValue)({ x, y: re }, { zones })
19
+ : im);
20
+ }
21
+ exports.apply = apply;
22
+ function isApplicable(datum1D) {
23
+ if (datum1D.info.isComplex && datum1D.info.isFt)
24
+ return true;
25
+ return false;
26
+ }
27
+ exports.isApplicable = isApplicable;
28
+ function reduce(previousValue, newValue) {
29
+ return {
30
+ once: true,
31
+ reduce: (0, ml_spectra_processing_1.zonesNormalize)(previousValue.concat(newValue)),
32
+ };
33
+ }
34
+ exports.reduce = reduce;
@@ -16,6 +16,9 @@ function migrate(data) {
16
16
  migrateToVersion2_1.default,
17
17
  ];
18
18
  let index = data?.version || 0;
19
+ if (index > exports.CURRENT_EXPORT_VERSION) {
20
+ throw new Error('This file can not be imported using the current NMRium version, Please move to the new one !!! ');
21
+ }
19
22
  return migrationPipe(migrationsFuncs.slice(index))(data);
20
23
  }
21
24
  exports.migrate = migrate;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = { version: 'v0.19.1' };
3
+ exports.default = { version: 'v0.21.0' };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nmrium",
3
3
  "description": "React component to display and process nuclear magnetic resonance (NMR) spectra.",
4
- "version": "0.19.1",
4
+ "version": "0.21.0",
5
5
  "license": "MIT",
6
6
  "main": "lib-cjs/component/NMRium.js",
7
7
  "module": "lib/component/NMRium.js",
@@ -14,10 +14,10 @@
14
14
  "build": "vite build --outDir build",
15
15
  "build-no-minify": "cross-env NO_MINIFY=true npm run build",
16
16
  "build-with-profiling": "cross-env WITH_PROFILING=true npm run build",
17
- "check-types": "tsc --noEmit",
17
+ "check-types": "tsc --project tsconfig.esm.json",
18
18
  "compile": "tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json",
19
19
  "clean-lib": "rimraf lib lib-cjs",
20
- "dev": "vite --host localhost --strictPort --open",
20
+ "dev": "vite --host localhost --port 3000 --strictPort --open",
21
21
  "eslint": "eslint . --cache",
22
22
  "eslint-fix": "npm run eslint -- --fix",
23
23
  "install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
@@ -38,17 +38,17 @@
38
38
  "url": "git+https://github.com/cheminfo/nmrium.git"
39
39
  },
40
40
  "volta": {
41
- "node": "16.13.2"
41
+ "node": "16.14.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": ">=16.0.0",
45
45
  "react-dom": ">=16.0.0"
46
46
  },
47
47
  "dependencies": {
48
- "@emotion/react": "^11.7.1",
49
- "analysis-ui-components": "^0.9.2",
48
+ "@emotion/react": "^11.8.1",
49
+ "analysis-ui-components": "^0.10.3",
50
50
  "cheminfo-font": "^1.8.1",
51
- "cheminfo-types": "^0.9.1",
51
+ "cheminfo-types": "^1.1.0",
52
52
  "d3": "^7.3.0",
53
53
  "eventemitter3": "^4.0.7",
54
54
  "file-saver": "^2.0.5",
@@ -56,7 +56,7 @@
56
56
  "immer": "^9.0.12",
57
57
  "jszip": "^3.7.1",
58
58
  "lodash": "^4.17.21",
59
- "mf-parser": "^1.4.0",
59
+ "mf-parser": "^1.4.4",
60
60
  "ml-airpls": "^1.0.0",
61
61
  "ml-array-max": "^1.2.4",
62
62
  "ml-array-mean": "^1.1.6",
@@ -64,29 +64,29 @@
64
64
  "ml-array-xy-equally-spaced": "^1.2.1",
65
65
  "ml-baseline-correction-regression": "^1.0.0",
66
66
  "ml-conrec": "^3.2.1",
67
- "ml-gsd": "^9.1.0",
68
- "ml-spectra-processing": "^8.1.0",
67
+ "ml-gsd": "^10.1.2",
68
+ "ml-spectra-processing": "^11.0.0",
69
69
  "ml-stat": "^1.3.3",
70
70
  "multiplet-analysis": "^2.0.0",
71
- "nmr-correlation": "^2.2.0",
72
- "nmr-parser": "^1.7.2",
73
- "nmr-processing": "^6.0.4",
71
+ "nmr-correlation": "^2.2.5",
72
+ "nmr-parser": "^1.7.3",
73
+ "nmr-processing": "^7.0.1",
74
74
  "nmredata": "^0.6.1",
75
75
  "numeral": "^2.0.6",
76
76
  "openchemlib": "^7.4.3",
77
- "openchemlib-utils": "^1.8.0",
78
- "re-resizable": "^6.9.1",
77
+ "openchemlib-utils": "^1.9.0",
78
+ "re-resizable": "^6.9.2",
79
79
  "react-color": "2.17.2",
80
- "react-d3-utils": "^0.4.0",
80
+ "react-d3-utils": "^0.5.0",
81
81
  "react-draggable": "^4.4.4",
82
- "react-dropzone": "^11.5.1",
82
+ "react-dropzone": "^12.0.4",
83
83
  "react-error-boundary": "^3.1.4",
84
84
  "react-icons": "^4.3.1",
85
85
  "react-inspector": "^5.1.1",
86
86
  "react-mf": "^2.0.1",
87
- "react-ocl": "^4.3.3",
87
+ "react-ocl": "^4.3.4",
88
88
  "react-ocl-nmr": "^1.1.0",
89
- "react-plot": "^0.14.0",
89
+ "react-plot": "^0.16.0",
90
90
  "react-rnd": "^10.3.5",
91
91
  "react-slider": "^1.3.1",
92
92
  "react-table": "^7.7.0",
@@ -99,30 +99,29 @@
99
99
  "@babel/plugin-transform-modules-commonjs": "^7.16.8",
100
100
  "@babel/preset-react": "^7.16.7",
101
101
  "@babel/preset-typescript": "^7.16.7",
102
- "@playwright/test": "^1.18.0",
102
+ "@playwright/test": "^1.19.2",
103
103
  "@simbathesailor/use-what-changed": "^2.0.0",
104
104
  "@types/d3": "^7.1.0",
105
- "@types/jest": "^27.4.0",
106
- "@types/node": "^17.0.10",
107
- "@types/react": "^17.0.38",
105
+ "@types/jest": "^27.4.1",
106
+ "@types/node": "^17.0.21",
107
+ "@types/react": "^17.0.39",
108
108
  "@types/react-dom": "^17.0.11",
109
109
  "@types/react-router-dom": "^5.3.3",
110
- "@vitejs/plugin-react": "^1.1.4",
110
+ "@vitejs/plugin-react": "^1.2.0",
111
111
  "@zakodium/eslint-config": "^5.1.0",
112
112
  "cross-env": "^7.0.3",
113
- "eslint": "^8.7.0",
114
- "jest": "^27.4.7",
113
+ "eslint": "^8.10.0",
114
+ "jest": "^27.5.1",
115
115
  "modern-normalize": "^1.1.0",
116
116
  "prettier": "^2.5.1",
117
- "rc-menu": "^9.3.1",
117
+ "rc-menu": "^9.3.2",
118
118
  "react": "^17.0.2",
119
119
  "react-dom": "^17.0.2",
120
120
  "react-router-dom": "^5.3.0",
121
- "reactstrap": "^8.10.1",
122
121
  "rimraf": "^3.0.2",
123
122
  "rollup-plugin-analyzer": "^4.0.0",
124
123
  "serve": "^13.0.2",
125
124
  "typescript": "~4.5.5",
126
- "vite": "^2.7.13"
125
+ "vite": "^2.8.4"
127
126
  }
128
127
  }
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { ExclusionZoneState } from '../reducer/Reducer';
3
- interface ExclusionZoneProps {
4
- zone: ExclusionZoneState;
5
- }
6
- declare function ExclusionZone({ zone }: ExclusionZoneProps): import("@emotion/react/jsx-runtime").JSX.Element;
7
- declare const _default: import("react").MemoExoticComponent<typeof ExclusionZone>;
8
- export default _default;
@@ -1,30 +0,0 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- /** @jsxImportSource @emotion/react */
3
- import { css } from '@emotion/react';
4
- import { memo } from 'react';
5
- import { useScaleChecked } from '../context/ScaleContext';
6
- import { HighlightedSource, useHighlight } from '../highlight';
7
- const styles = css `
8
- pointer-events: bounding-box;
9
- user-select: 'none';
10
- -webkit-user-select: none; /* Chrome all / Safari all */
11
- -moz-user-select: none; /* Firefox all */
12
-
13
- .zone-area {
14
- height: 100%;
15
- fill: #dddddd;
16
- cursor: pointer;
17
- }
18
- .zone-area.active {
19
- fill: #ff6f0057;
20
- }
21
- `;
22
- function ExclusionZone({ zone }) {
23
- const { scaleX } = useScaleChecked();
24
- const highlight = useHighlight([zone.id], {
25
- type: HighlightedSource.EXCLUSION_ZONE,
26
- extra: { id: zone.id },
27
- });
28
- return (_jsx("g", { transform: `translate(${scaleX()(zone.to)},0)`, css: styles, ...highlight.onHover, children: _jsx("rect", { x: "0", width: `${scaleX()(zone.from) - scaleX()(zone.to)}`, className: `zone-area ${highlight.isActive ? 'active' : ''}` }, void 0) }, zone.id));
29
- }
30
- export default memo(ExclusionZone);
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function ExclusionZones(): JSX.Element | null;
@@ -1,10 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useChartData } from '../context/ChartContext';
3
- import ExclusionZone from './ExclusionZone';
4
- export default function ExclusionZones() {
5
- const { toolOptions: { data: { exclusionZones }, }, activeTab, } = useChartData();
6
- const exclusionZonesForNucleus = exclusionZones[activeTab];
7
- if (!exclusionZonesForNucleus)
8
- return null;
9
- return (_jsx("g", { className: "exclusionZones", children: exclusionZonesForNucleus.map((zone) => (_jsx(ExclusionZone, { zone: zone }, zone.id))) }, void 0));
10
- }
@@ -1,38 +0,0 @@
1
- declare const _default: {
2
- general: {
3
- disableMultipletAnalysis: boolean;
4
- hideSetSumFromMolecule: boolean;
5
- };
6
- panels: {
7
- hideSpectraPanel: boolean;
8
- hideInformationPanel: boolean;
9
- hidePeaksPanel: boolean;
10
- hideIntegralsPanel: boolean;
11
- hideRangesPanel: boolean;
12
- hideStructuresPanel: boolean;
13
- hideFiltersPanel: boolean;
14
- hideZonesPanel: boolean;
15
- hideSummaryPanel: boolean;
16
- hideMultipleSpectraAnalysisPanel: boolean;
17
- hideDatabasePanel: boolean;
18
- };
19
- toolBarButtons: {
20
- hideZoomTool: boolean;
21
- hideZoomOutTool: boolean;
22
- hideImport: boolean;
23
- hideExportAs: boolean;
24
- hideSpectraStackAlignments: boolean;
25
- hideSpectraCenterAlignments: boolean;
26
- hideRealImaginary: boolean;
27
- hidePeakTool: boolean;
28
- hideIntegralTool: boolean;
29
- hideAutoRangesTool: boolean;
30
- hideZeroFillingTool: boolean;
31
- hidePhaseCorrectionTool: boolean;
32
- hideBaseLineCorrectionTool: boolean;
33
- hideFFTTool: boolean;
34
- hideMultipleSpectraAnalysisTool: boolean;
35
- };
36
- hideExperimentalFeatures: boolean;
37
- };
38
- export default _default;