nmrium 0.20.1 → 0.22.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 (238) hide show
  1. package/lib/component/1d/ExclusionZonesAnnotations.js +1 -2
  2. package/lib/component/1d/Integral.js +1 -6
  3. package/lib/component/1d/Viewer1D.js +4 -4
  4. package/lib/component/1d/ranges/RangeIntegral.js +2 -6
  5. package/lib/component/1d/utilities/scale.d.ts +1 -1
  6. package/lib/component/1d/utilities/scale.js +7 -6
  7. package/lib/component/2d/Viewer2D.js +5 -5
  8. package/lib/component/EventsTrackers/KeysListenerTracker.js +98 -81
  9. package/lib/component/NMRium.d.ts +9 -2
  10. package/lib/component/NMRium.js +9 -9
  11. package/lib/component/elements/EditableColumn.d.ts +1 -1
  12. package/lib/component/elements/NumberInput.d.ts +1 -2
  13. package/lib/component/elements/Tab/Tab.js +1 -0
  14. package/lib/component/header/Header.js +13 -10
  15. package/lib/component/hooks/useCheckExperimentalFeature.js +2 -1
  16. package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -0
  17. package/lib/component/hooks/useCheckToolsVisibility.js +6 -0
  18. package/lib/component/{1d/utilities → hooks}/useIntegralPath.d.ts +0 -0
  19. package/lib/component/hooks/useIntegralPath.js +53 -0
  20. package/lib/component/hooks/useToolsFunctions.js +6 -6
  21. package/lib/component/hooks/useXScale.d.ts +2 -0
  22. package/lib/component/hooks/useXScale.js +7 -0
  23. package/lib/component/loader/DropZone.js +88 -88
  24. package/lib/component/modal/changeSum/ChangeSumModal.js +4 -2
  25. package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
  26. package/lib/component/modal/editZone/EditPathLengthFormik.d.ts +5 -0
  27. package/lib/component/modal/editZone/EditPathLengthFormik.js +72 -0
  28. package/lib/component/modal/editZone/EditZoneModal.d.ts +8 -0
  29. package/lib/component/modal/editZone/EditZoneModal.js +96 -0
  30. package/lib/component/modal/editZone/SignalFormTab.d.ts +6 -0
  31. package/lib/component/modal/editZone/SignalFormTab.js +6 -0
  32. package/lib/component/modal/editZone/SignalsForm.d.ts +2 -0
  33. package/lib/component/modal/editZone/SignalsForm.js +62 -0
  34. package/lib/component/modal/editZone/validation/EditZoneValidation.d.ts +534 -0
  35. package/lib/component/modal/editZone/validation/EditZoneValidation.js +17 -0
  36. package/lib/component/modal/editZone/validation/isDefaultPathLength.d.ts +3 -0
  37. package/lib/component/modal/editZone/validation/isDefaultPathLength.js +7 -0
  38. package/lib/component/modal/setting/ControllersTabContent.js +1 -1
  39. package/lib/component/modal/setting/DisplayTabContent.js +1 -1
  40. package/lib/component/modal/setting/GeneralSettings.d.ts +1 -2
  41. package/lib/component/modal/setting/GeneralSettings.js +13 -9
  42. package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.d.ts +2 -0
  43. package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +13 -0
  44. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +7 -0
  45. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +38 -0
  46. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
  47. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +4 -17
  48. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +1 -1
  49. package/lib/component/panels/Panels.d.ts +1 -1
  50. package/lib/component/panels/Panels.js +10 -14
  51. package/lib/component/panels/PeaksPanel/PeaksPanel.js +0 -3
  52. package/lib/component/panels/PeaksPanel/PeaksPreferences.js +5 -14
  53. package/lib/component/panels/RangesPanel/RangesPanel.js +2 -5
  54. package/lib/component/panels/RangesPanel/RangesPreferences.js +5 -18
  55. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
  56. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -2
  57. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +7 -2
  58. package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.d.ts +1 -6
  59. package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -7
  60. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.d.ts +2 -3
  61. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +4 -5
  62. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.d.ts +2 -3
  63. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +21 -25
  64. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +24 -30
  65. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +8 -0
  66. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +89 -0
  67. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.d.ts +6 -6
  68. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
  69. package/lib/component/panels/SummaryPanel/SummaryPanel.js +40 -43
  70. package/lib/component/panels/SummaryPanel/utilities/IsInView.d.ts +6 -0
  71. package/lib/component/panels/SummaryPanel/utilities/IsInView.js +16 -0
  72. package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +29 -0
  73. package/lib/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +155 -19
  74. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +1 -0
  75. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +26 -3
  76. package/lib/component/panels/ZonesPanel/ZonesPanel.js +12 -7
  77. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +5 -18
  78. package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +3 -2
  79. package/lib/component/panels/ZonesPanel/ZonesTable.js +5 -2
  80. package/lib/component/panels/databasePanel/DatabasePanel.js +0 -3
  81. package/lib/component/panels/databasePanel/DatabasePreferences.js +4 -17
  82. package/lib/component/reducer/IgnoreActions.js +2 -1
  83. package/lib/component/reducer/Reducer.d.ts +20 -34
  84. package/lib/component/reducer/Reducer.js +7 -8
  85. package/lib/component/reducer/actions/CorrelationsActions.d.ts +7 -7
  86. package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
  87. package/lib/component/reducer/actions/DatabaseActions.js +1 -1
  88. package/lib/component/reducer/actions/DomainActions.d.ts +3 -1
  89. package/lib/component/reducer/actions/DomainActions.js +20 -1
  90. package/lib/component/reducer/actions/IntegralsActions.js +2 -0
  91. package/lib/component/reducer/actions/LoadActions.js +22 -1
  92. package/lib/component/reducer/actions/PreferencesActions.js +0 -2
  93. package/lib/component/reducer/actions/RangesActions.js +3 -1
  94. package/lib/component/reducer/actions/SpectrumsActions.js +1 -1
  95. package/lib/component/reducer/actions/ToolsActions.js +43 -56
  96. package/lib/component/reducer/actions/ZonesActions.d.ts +3 -1
  97. package/lib/component/reducer/actions/ZonesActions.js +33 -2
  98. package/lib/component/reducer/helper/Zoom1DManager.d.ts +17 -21
  99. package/lib/component/reducer/helper/Zoom1DManager.js +53 -69
  100. package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -0
  101. package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -1
  102. package/lib/component/reducer/preferencesReducer.d.ts +3 -8
  103. package/lib/component/reducer/preferencesReducer.js +87 -37
  104. package/lib/component/reducer/types/Types.d.ts +3 -1
  105. package/lib/component/reducer/types/Types.js +3 -1
  106. package/lib/component/toolbar/FunctionToolBar.js +7 -10
  107. package/lib/component/toolbar/ToolTypes.js +3 -3
  108. package/lib/component/workspaces/Workspace.d.ts +6 -0
  109. package/lib/component/workspaces/Workspace.js +1 -0
  110. package/lib/component/workspaces/basic.d.ts +2 -0
  111. package/lib/component/workspaces/basic.js +45 -0
  112. package/lib/component/workspaces/exercise1D.d.ts +2 -0
  113. package/lib/component/workspaces/exercise1D.js +45 -0
  114. package/lib/component/workspaces/index.d.ts +6 -0
  115. package/lib/component/workspaces/index.js +4 -0
  116. package/lib/component/workspaces/process1D.d.ts +2 -0
  117. package/lib/component/workspaces/process1D.js +43 -0
  118. package/lib/data/constants/DefaultPathLengths.d.ts +6 -0
  119. package/lib/data/constants/DefaultPathLengths.js +8 -0
  120. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +2 -0
  121. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +4 -0
  122. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +7 -19
  123. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +11 -0
  124. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +11 -0
  125. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
  126. package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +9 -0
  127. package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +7 -0
  128. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +2 -0
  129. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +29 -0
  130. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +13 -0
  131. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +14 -0
  132. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
  133. package/lib/data/migration/MigrationManager.js +3 -0
  134. package/lib/versionInfo.js +1 -1
  135. package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -2
  136. package/lib-cjs/component/1d/Integral.js +1 -6
  137. package/lib-cjs/component/1d/Viewer1D.js +4 -4
  138. package/lib-cjs/component/1d/ranges/RangeIntegral.js +2 -6
  139. package/lib-cjs/component/1d/utilities/scale.js +7 -6
  140. package/lib-cjs/component/2d/Viewer2D.js +4 -4
  141. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +98 -81
  142. package/lib-cjs/component/NMRium.js +10 -10
  143. package/lib-cjs/component/elements/Tab/Tab.js +1 -0
  144. package/lib-cjs/component/header/Header.js +13 -10
  145. package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -1
  146. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +13 -0
  147. package/lib-cjs/component/hooks/useIntegralPath.js +56 -0
  148. package/lib-cjs/component/hooks/useToolsFunctions.js +6 -6
  149. package/lib-cjs/component/hooks/useXScale.js +11 -0
  150. package/lib-cjs/component/loader/DropZone.js +88 -88
  151. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +4 -2
  152. package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
  153. package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +77 -0
  154. package/lib-cjs/component/modal/editZone/EditZoneModal.js +101 -0
  155. package/lib-cjs/component/modal/editZone/SignalFormTab.js +11 -0
  156. package/lib-cjs/component/modal/editZone/SignalsForm.js +67 -0
  157. package/lib-cjs/component/modal/editZone/validation/EditZoneValidation.js +38 -0
  158. package/lib-cjs/component/modal/editZone/validation/isDefaultPathLength.js +12 -0
  159. package/lib-cjs/component/modal/setting/ControllersTabContent.js +1 -1
  160. package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
  161. package/lib-cjs/component/modal/setting/GeneralSettings.js +12 -8
  162. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +18 -0
  163. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +43 -0
  164. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
  165. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +3 -16
  166. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +1 -1
  167. package/lib-cjs/component/panels/Panels.js +11 -15
  168. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +0 -3
  169. package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +4 -13
  170. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -5
  171. package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +4 -17
  172. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
  173. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -2
  174. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +7 -2
  175. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -8
  176. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +4 -5
  177. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +21 -25
  178. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +43 -30
  179. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +94 -0
  180. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
  181. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +38 -41
  182. package/lib-cjs/component/panels/SummaryPanel/utilities/IsInView.js +18 -0
  183. package/lib-cjs/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +157 -19
  184. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +24 -1
  185. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +12 -7
  186. package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -17
  187. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +5 -2
  188. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +0 -3
  189. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +3 -16
  190. package/lib-cjs/component/reducer/IgnoreActions.js +2 -1
  191. package/lib-cjs/component/reducer/Reducer.js +7 -8
  192. package/lib-cjs/component/reducer/actions/DatabaseActions.js +2 -2
  193. package/lib-cjs/component/reducer/actions/DomainActions.js +21 -1
  194. package/lib-cjs/component/reducer/actions/IntegralsActions.js +2 -0
  195. package/lib-cjs/component/reducer/actions/LoadActions.js +22 -1
  196. package/lib-cjs/component/reducer/actions/PreferencesActions.js +0 -2
  197. package/lib-cjs/component/reducer/actions/RangesActions.js +2 -0
  198. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +2 -2
  199. package/lib-cjs/component/reducer/actions/ToolsActions.js +50 -63
  200. package/lib-cjs/component/reducer/actions/ZonesActions.js +35 -2
  201. package/lib-cjs/component/reducer/helper/Zoom1DManager.js +55 -73
  202. package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -1
  203. package/lib-cjs/component/reducer/preferencesReducer.js +87 -37
  204. package/lib-cjs/component/reducer/types/Types.js +6 -4
  205. package/lib-cjs/component/toolbar/FunctionToolBar.js +7 -10
  206. package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
  207. package/lib-cjs/component/workspaces/Workspace.js +2 -0
  208. package/lib-cjs/component/workspaces/basic.js +48 -0
  209. package/lib-cjs/component/workspaces/exercise1D.js +48 -0
  210. package/lib-cjs/component/workspaces/index.js +6 -0
  211. package/lib-cjs/component/workspaces/process1D.js +46 -0
  212. package/lib-cjs/data/constants/DefaultPathLengths.js +10 -0
  213. package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +8 -0
  214. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +7 -19
  215. package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +18 -0
  216. package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
  217. package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +14 -0
  218. package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +36 -0
  219. package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +21 -0
  220. package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
  221. package/lib-cjs/data/migration/MigrationManager.js +3 -0
  222. package/lib-cjs/versionInfo.js +1 -1
  223. package/package.json +15 -16
  224. package/lib/component/1d/utilities/useIntegralPath.js +0 -63
  225. package/lib/component/nmriumMode/basic.d.ts +0 -38
  226. package/lib/component/nmriumMode/basic.js +0 -37
  227. package/lib/component/nmriumMode/exercise1D.d.ts +0 -38
  228. package/lib/component/nmriumMode/exercise1D.js +0 -37
  229. package/lib/component/nmriumMode/process1D.d.ts +0 -38
  230. package/lib/component/nmriumMode/process1D.js +0 -37
  231. package/lib/component/panels/SummaryPanel/Utilities.d.ts +0 -25
  232. package/lib/component/reducer/actions/Zoom.d.ts +0 -16
  233. package/lib/component/reducer/actions/Zoom.js +0 -92
  234. package/lib-cjs/component/1d/utilities/useIntegralPath.js +0 -66
  235. package/lib-cjs/component/nmriumMode/basic.js +0 -39
  236. package/lib-cjs/component/nmriumMode/exercise1D.js +0 -39
  237. package/lib-cjs/component/nmriumMode/process1D.js +0 -39
  238. package/lib-cjs/component/reducer/actions/Zoom.js +0 -116
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const ml_spectra_processing_1 = require("ml-spectra-processing");
4
- const react_1 = require("react");
5
- const ChartContext_1 = require("../../context/ChartContext");
6
- const ScaleContext_1 = require("../../context/ScaleContext");
7
- const PathBuilder_1 = require("../../utility/PathBuilder");
8
- const scale_1 = require("./scale");
9
- function useIntegralPath(integralOptions) {
10
- const { xDomain, height, yDomain, margin, verticalAlign, data, activeSpectrum, zoom, } = (0, ChartContext_1.useChartData)();
11
- const { scaleX } = (0, ScaleContext_1.useScale)();
12
- const scaleY = (0, react_1.useMemo)(() => {
13
- const scale = zoom.integral.scales[activeSpectrum?.id || ''];
14
- const scaledYDomain = (0, scale_1.reScaleY)(scale === undefined ? 1 : scale < 0.1 ? 0.05 : scale, {
15
- domain: [yDomain[0], yDomain[1] / 20],
16
- height,
17
- margin,
18
- });
19
- return (0, scale_1.getYScale)({
20
- height,
21
- margin,
22
- verticalAlign,
23
- yDomain: scaledYDomain,
24
- });
25
- }, [
26
- activeSpectrum?.id,
27
- height,
28
- margin,
29
- verticalAlign,
30
- yDomain,
31
- zoom.integral.scales,
32
- ]);
33
- const integral = (0, react_1.useMemo)(() => {
34
- if (activeSpectrum) {
35
- const { x, re } = data[activeSpectrum?.index].data;
36
- const { from, to } = integralOptions;
37
- return (0, ml_spectra_processing_1.xyIntegral)({ x, y: re }, {
38
- from,
39
- to,
40
- reverse: true,
41
- });
42
- }
43
- return { x: [], y: [] };
44
- }, [activeSpectrum, data, integralOptions]);
45
- const paths = (0, react_1.useMemo)(() => {
46
- if (integral && scaleX) {
47
- const xySeries = (0, ml_spectra_processing_1.xyReduce)(integral, {
48
- from: xDomain[0],
49
- to: xDomain[1],
50
- nbPoints: 200,
51
- optimize: true,
52
- });
53
- const pathBuilder = new PathBuilder_1.PathBuilder();
54
- pathBuilder.moveTo(scaleX()(xySeries.x[0]), scaleY(xySeries.y[0]));
55
- for (let i = 1; i < xySeries.x.length; i++) {
56
- pathBuilder.lineTo(scaleX()(xySeries.x[i]), scaleY(xySeries.y[i]));
57
- }
58
- return pathBuilder.toString();
59
- }
60
- else {
61
- return '';
62
- }
63
- }, [integral, scaleX, scaleY, xDomain]);
64
- return paths;
65
- }
66
- exports.default = useIntegralPath;
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- general: {
5
- disableMultipletAnalysis: false,
6
- hideSetSumFromMolecule: false,
7
- },
8
- panels: {
9
- hideSpectraPanel: false,
10
- hideInformationPanel: false,
11
- hidePeaksPanel: false,
12
- hideIntegralsPanel: false,
13
- hideRangesPanel: false,
14
- hideStructuresPanel: false,
15
- hideFiltersPanel: false,
16
- hideZonesPanel: false,
17
- hideSummaryPanel: true,
18
- hideMultipleSpectraAnalysisPanel: true,
19
- hideDatabasePanel: false,
20
- },
21
- toolBarButtons: {
22
- hideZoomTool: false,
23
- hideZoomOutTool: false,
24
- hideImport: false,
25
- hideExportAs: false,
26
- hideSpectraStackAlignments: false,
27
- hideSpectraCenterAlignments: false,
28
- hideRealImaginary: false,
29
- hidePeakTool: false,
30
- hideIntegralTool: false,
31
- hideAutoRangesTool: false,
32
- hideZeroFillingTool: false,
33
- hidePhaseCorrectionTool: false,
34
- hideBaseLineCorrectionTool: false,
35
- hideFFTTool: false,
36
- hideMultipleSpectraAnalysisTool: false,
37
- },
38
- hideExperimentalFeatures: true,
39
- };
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- general: {
5
- disableMultipletAnalysis: true,
6
- hideSetSumFromMolecule: false,
7
- },
8
- panels: {
9
- hideSpectraPanel: false,
10
- hideInformationPanel: false,
11
- hidePeaksPanel: false,
12
- hideIntegralsPanel: false,
13
- hideRangesPanel: true,
14
- hideStructuresPanel: false,
15
- hideFiltersPanel: true,
16
- hideZonesPanel: true,
17
- hideSummaryPanel: true,
18
- hideMultipleSpectraAnalysisPanel: true,
19
- hideDatabasePanel: false,
20
- },
21
- toolBarButtons: {
22
- hideZoomTool: false,
23
- hideZoomOutTool: false,
24
- hideImport: true,
25
- hideExportAs: true,
26
- hideSpectraStackAlignments: false,
27
- hideSpectraCenterAlignments: false,
28
- hideRealImaginary: true,
29
- hidePeakTool: false,
30
- hideIntegralTool: false,
31
- hideAutoRangesTool: true,
32
- hideZeroFillingTool: true,
33
- hidePhaseCorrectionTool: true,
34
- hideBaseLineCorrectionTool: true,
35
- hideFFTTool: true,
36
- hideMultipleSpectraAnalysisTool: true,
37
- hideExclusionZonesTool: true,
38
- },
39
- };
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- general: {
5
- disableMultipletAnalysis: true,
6
- hideSetSumFromMolecule: false,
7
- },
8
- panels: {
9
- hideSpectraPanel: false,
10
- hideInformationPanel: false,
11
- hidePeaksPanel: false,
12
- hideIntegralsPanel: false,
13
- hideRangesPanel: true,
14
- hideStructuresPanel: false,
15
- hideFiltersPanel: false,
16
- hideZonesPanel: true,
17
- hideSummaryPanel: true,
18
- hideMultipleSpectraAnalysisPanel: true,
19
- hideDatabasePanel: false,
20
- },
21
- toolBarButtons: {
22
- hideZoomTool: false,
23
- hideZoomOutTool: false,
24
- hideImport: true,
25
- hideExportAs: true,
26
- hideSpectraStackAlignments: false,
27
- hideSpectraCenterAlignments: false,
28
- hideRealImaginary: false,
29
- hidePeakTool: false,
30
- hideIntegralTool: false,
31
- hideAutoRangesTool: true,
32
- hideZeroFillingTool: false,
33
- hidePhaseCorrectionTool: false,
34
- hideBaseLineCorrectionTool: false,
35
- hideFFTTool: false,
36
- hideMultipleSpectraAnalysisTool: true,
37
- hideExclusionZonesTool: true,
38
- },
39
- };
@@ -1,116 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.setZoom1D = exports.setZoom = exports.wheel = exports.ZoomType = void 0;
23
- const d3_1 = require("d3");
24
- const Zoom1DManager_1 = __importStar(require("../helper/Zoom1DManager"));
25
- exports.ZoomType = {
26
- HORIZONTAL: 'HORIZONTAL',
27
- VERTICAL: 'VERTICAL',
28
- STEP_HORIZONTAL: 'STEP_HORIZONTAL',
29
- FULL: 'FULL',
30
- };
31
- function wheel(deltaY, deltaMode, draft, id = null) {
32
- if (draft.activeSpectrum?.id || id) {
33
- (0, Zoom1DManager_1.default)(draft.zoom.spectra).wheel(deltaY, id || draft.activeSpectrum?.id);
34
- }
35
- else {
36
- const zoomManager = (0, Zoom1DManager_1.default)(draft.zoom.spectra);
37
- draft.data.forEach((datum) => {
38
- if (datum.info.dimension === 1 &&
39
- draft.activeTab === datum.info.nucleus) {
40
- zoomManager.wheel(deltaY, datum.id);
41
- }
42
- });
43
- }
44
- }
45
- exports.wheel = wheel;
46
- function setZoom(draft, options = {}) {
47
- const { height, margin, activeSpectrum } = draft;
48
- const { scale = null, spectrumID = null } = options;
49
- if (scale && !spectrumID) {
50
- (0, Zoom1DManager_1.setAllScales)(draft.zoom.spectra, scale);
51
- }
52
- const zoomManager = (0, Zoom1DManager_1.default)(draft.zoom.spectra);
53
- if (activeSpectrum === null && spectrumID === null) {
54
- const { shareYDomain, yDomain, yDomains } = draft.originDomain;
55
- draft.yDomains = Object.keys(draft.yDomains).reduce((acc, id) => {
56
- const scale = zoomManager.getScale(id);
57
- const _scale = (0, d3_1.scaleLinear)(shareYDomain ? yDomain : yDomains[id], [
58
- height - margin.bottom,
59
- margin.top,
60
- ]);
61
- const [min, max] = shareYDomain ? yDomain : yDomains[id];
62
- const maxPoint = Math.max(Math.abs(max), Math.abs(min));
63
- const scalePoint = maxPoint === max ? 0 : min;
64
- const t = d3_1.zoomIdentity
65
- .translate(0, Math.sign(scalePoint) >= 0 ? _scale(scalePoint) : _scale(scalePoint))
66
- .scale(scale)
67
- .translate(0, -_scale(0));
68
- const newYDomain = t.rescaleY(_scale).domain();
69
- acc[id] = newYDomain;
70
- return acc;
71
- }, {});
72
- }
73
- else {
74
- const spectrumId = spectrumID || activeSpectrum?.id;
75
- if (spectrumId) {
76
- if (scale) {
77
- zoomManager.setScale(scale, spectrumId);
78
- }
79
- const scaleFactor = scale ? scale : zoomManager.getScale(spectrumId);
80
- const _scale = (0, d3_1.scaleLinear)(draft.originDomain.yDomains[spectrumId], [
81
- height - margin.bottom,
82
- margin.top,
83
- ]);
84
- const t = d3_1.zoomIdentity
85
- .translate(0, _scale(0))
86
- .scale(scaleFactor)
87
- .translate(0, -_scale(0));
88
- const yDomain = t.rescaleY(_scale).domain();
89
- draft.yDomains = {
90
- ...draft.yDomains,
91
- [spectrumId]: yDomain,
92
- };
93
- }
94
- }
95
- }
96
- exports.setZoom = setZoom;
97
- function setZoom1D(draft, height, margin, index, defaultScale) {
98
- const { originDomain, tabActiveSpectrum, activeTab } = draft;
99
- const { id } = tabActiveSpectrum[activeTab.split(',')[index]];
100
- const { setScale, getScale } = (0, Zoom1DManager_1.default)(draft.zoom.spectra);
101
- if (defaultScale) {
102
- setScale(defaultScale, id);
103
- }
104
- const scale = getScale(id);
105
- const _scale = (0, d3_1.scaleLinear)(originDomain.yDomains[id], [
106
- height - margin,
107
- margin,
108
- ]);
109
- const t = d3_1.zoomIdentity
110
- .translate(0, _scale(0))
111
- .scale(scale)
112
- .translate(0, -_scale(0));
113
- let yDomain = t.rescaleY(_scale).domain();
114
- draft.yDomains[id] = yDomain;
115
- }
116
- exports.setZoom1D = setZoom1D;