nmrium 0.19.0 → 0.20.2

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 (126) 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 +12 -3
  19. package/lib/component/NMRium.d.ts +1 -1
  20. package/lib/component/NMRium.js +28 -25
  21. package/lib/component/elements/NumberInput.d.ts +1 -2
  22. package/lib/component/elements/Tab/Tab.js +1 -0
  23. package/lib/component/hooks/useActiveSpectrumStyleOptions.d.ts +6 -0
  24. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +15 -0
  25. package/lib/component/hooks/useXYReduce.d.ts +2 -1
  26. package/lib/component/loader/DropZone.js +1 -1
  27. package/lib/component/modal/ModalStyle.js +5 -2
  28. package/lib/component/modal/MoleculeStructureEditorModal.js +3 -2
  29. package/lib/component/modal/MultipleSpectraFiltersModal/index.js +10 -1
  30. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.d.ts +2 -0
  31. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +35 -0
  32. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +49 -51
  33. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +3 -8
  34. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -23
  35. package/lib/component/panels/Panels.js +10 -0
  36. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +1 -1
  37. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.d.ts +5 -5
  38. package/lib/component/panels/SummaryPanel/SummaryPanel.js +1 -1
  39. package/lib/component/panels/SummaryPanel/Utilities.d.ts +7 -7
  40. package/lib/component/panels/ZonesPanel/ZonesTable.js +9 -2
  41. package/lib/component/reducer/Reducer.d.ts +11 -27
  42. package/lib/component/reducer/Reducer.js +4 -5
  43. package/lib/component/reducer/actions/CorrelationsActions.d.ts +7 -7
  44. package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
  45. package/lib/component/reducer/actions/FiltersActions.d.ts +3 -1
  46. package/lib/component/reducer/actions/FiltersActions.js +60 -18
  47. package/lib/component/reducer/actions/LoadActions.js +2 -3
  48. package/lib/component/reducer/actions/MoleculeActions.js +2 -2
  49. package/lib/component/reducer/actions/PreferencesActions.js +4 -7
  50. package/lib/component/reducer/actions/RangesActions.js +1 -1
  51. package/lib/component/reducer/actions/ToolsActions.d.ts +1 -3
  52. package/lib/component/reducer/actions/ToolsActions.js +1 -30
  53. package/lib/component/reducer/helper/getRange.d.ts +6 -1
  54. package/lib/component/reducer/helper/getRange.js +1 -1
  55. package/lib/component/toolbar/FunctionToolBar.js +2 -5
  56. package/lib/component/utility/PathBuilder.d.ts +7 -0
  57. package/lib/component/utility/PathBuilder.js +17 -0
  58. package/lib/component/utility/getSpectraByNucleus.d.ts +3 -0
  59. package/lib/component/utility/getSpectraByNucleus.js +4 -0
  60. package/lib/data/Filters.d.ts +2 -1
  61. package/lib/data/Filters.js +2 -1
  62. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -2
  63. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -1
  64. package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +0 -1
  65. package/lib/data/data1d/Spectrum1D/ranges/detectSignal.d.ts +3 -2
  66. package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +23 -15
  67. package/lib/data/data1d/filter1d/exclusionZones.d.ts +16 -0
  68. package/lib/data/data1d/filter1d/exclusionZones.js +28 -0
  69. package/lib/data/types/data1d/ExclusionZone.d.ts +5 -0
  70. package/lib/data/types/data1d/ExclusionZone.js +1 -0
  71. package/lib/versionInfo.js +1 -1
  72. package/lib-cjs/component/1d/Chart1D.js +3 -3
  73. package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +23 -0
  74. package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +52 -0
  75. package/lib-cjs/component/1d/Line.js +11 -23
  76. package/lib-cjs/component/1d/Viewer1D.js +36 -5
  77. package/lib-cjs/component/1d/ranges/Ranges.js +1 -1
  78. package/lib-cjs/component/1d/{BaseLineZones.js → tool/BaseLineZones.js} +5 -5
  79. package/lib-cjs/component/1d/utilities/useIntegralPath.js +9 -10
  80. package/lib-cjs/component/2d/Contours.js +12 -11
  81. package/lib-cjs/component/2d/Left1DChart.js +7 -9
  82. package/lib-cjs/component/2d/Top1DChart.js +7 -7
  83. package/lib-cjs/component/2d/tools/slicing/HorizontalSliceChart.js +7 -7
  84. package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +7 -9
  85. package/lib-cjs/component/EventsTrackers/BrushTracker.js +2 -2
  86. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +12 -3
  87. package/lib-cjs/component/NMRium.js +28 -25
  88. package/lib-cjs/component/elements/Tab/Tab.js +1 -0
  89. package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +21 -0
  90. package/lib-cjs/component/loader/DropZone.js +1 -1
  91. package/lib-cjs/component/modal/ModalStyle.js +5 -2
  92. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +3 -2
  93. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +10 -1
  94. package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +40 -0
  95. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +49 -51
  96. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +3 -8
  97. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -22
  98. package/lib-cjs/component/panels/Panels.js +10 -0
  99. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +1 -1
  100. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -1
  101. package/lib-cjs/component/reducer/Reducer.js +4 -5
  102. package/lib-cjs/component/reducer/actions/FiltersActions.js +62 -18
  103. package/lib-cjs/component/reducer/actions/LoadActions.js +2 -3
  104. package/lib-cjs/component/reducer/actions/MoleculeActions.js +2 -2
  105. package/lib-cjs/component/reducer/actions/PreferencesActions.js +4 -7
  106. package/lib-cjs/component/reducer/actions/RangesActions.js +1 -1
  107. package/lib-cjs/component/reducer/actions/ToolsActions.js +1 -32
  108. package/lib-cjs/component/reducer/helper/getRange.js +1 -1
  109. package/lib-cjs/component/toolbar/FunctionToolBar.js +2 -5
  110. package/lib-cjs/component/utility/PathBuilder.js +21 -0
  111. package/lib-cjs/component/utility/getSpectraByNucleus.js +11 -0
  112. package/lib-cjs/data/Filters.js +3 -1
  113. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +5 -2
  114. package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -1
  115. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +0 -1
  116. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +24 -15
  117. package/lib-cjs/data/data1d/filter1d/exclusionZones.js +34 -0
  118. package/lib-cjs/data/types/data1d/ExclusionZone.js +2 -0
  119. package/lib-cjs/versionInfo.js +1 -1
  120. package/package.json +28 -29
  121. package/lib/component/1d/ExclusionZone.d.ts +0 -8
  122. package/lib/component/1d/ExclusionZone.js +0 -30
  123. package/lib/component/1d/ExclusionZones.d.ts +0 -2
  124. package/lib/component/1d/ExclusionZones.js +0 -10
  125. package/lib-cjs/component/1d/ExclusionZone.js +0 -32
  126. package/lib-cjs/component/1d/ExclusionZones.js +0 -16
@@ -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,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
4
- /** @jsxImportSource @emotion/react */
5
- const react_1 = require("@emotion/react");
6
- const react_2 = require("react");
7
- const ScaleContext_1 = require("../context/ScaleContext");
8
- const highlight_1 = require("../highlight");
9
- const styles = (0, react_1.css) `
10
- pointer-events: bounding-box;
11
- user-select: 'none';
12
- -webkit-user-select: none; /* Chrome all / Safari all */
13
- -moz-user-select: none; /* Firefox all */
14
-
15
- .zone-area {
16
- height: 100%;
17
- fill: #dddddd;
18
- cursor: pointer;
19
- }
20
- .zone-area.active {
21
- fill: #ff6f0057;
22
- }
23
- `;
24
- function ExclusionZone({ zone }) {
25
- const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
26
- const highlight = (0, highlight_1.useHighlight)([zone.id], {
27
- type: highlight_1.HighlightedSource.EXCLUSION_ZONE,
28
- extra: { id: zone.id },
29
- });
30
- return ((0, jsx_runtime_1.jsx)("g", { transform: `translate(${scaleX()(zone.to)},0)`, css: styles, ...highlight.onHover, children: (0, jsx_runtime_1.jsx)("rect", { x: "0", width: `${scaleX()(zone.from) - scaleX()(zone.to)}`, className: `zone-area ${highlight.isActive ? 'active' : ''}` }, void 0) }, zone.id));
31
- }
32
- exports.default = (0, react_2.memo)(ExclusionZone);
@@ -1,16 +0,0 @@
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
- const jsx_runtime_1 = require("react/jsx-runtime");
7
- const ChartContext_1 = require("../context/ChartContext");
8
- const ExclusionZone_1 = __importDefault(require("./ExclusionZone"));
9
- function ExclusionZones() {
10
- const { toolOptions: { data: { exclusionZones }, }, activeTab, } = (0, ChartContext_1.useChartData)();
11
- const exclusionZonesForNucleus = exclusionZones[activeTab];
12
- if (!exclusionZonesForNucleus)
13
- return null;
14
- return ((0, jsx_runtime_1.jsx)("g", { className: "exclusionZones", children: exclusionZonesForNucleus.map((zone) => ((0, jsx_runtime_1.jsx)(ExclusionZone_1.default, { zone: zone }, zone.id))) }, void 0));
15
- }
16
- exports.default = ExclusionZones;