nmrium 0.40.1 → 0.42.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.
- package/lib/component/1d/FooterBanner.js +5 -4
- package/lib/component/1d/Viewer1D.js +121 -104
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +1 -1
- package/lib/component/1d/jCouplingGraph/JGraphContext.d.ts +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
- package/lib/component/1d/multiplicityTree/TreeColors.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/TreeColors.js +1 -6
- package/lib/component/1d/multiplicityTree/TreeNodes.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.js +7 -4
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +1 -3
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
- package/lib/component/1d-2d/components/SpectrumInfoBlock.js +4 -1
- package/lib/component/1d-2d/tools/BrushXY.js +10 -7
- package/lib/component/1d-2d/tools/CrossLinePointer.js +1 -1
- package/lib/component/2d/FooterBanner.js +3 -2
- package/lib/component/2d/Viewer2D.js +51 -29
- package/lib/component/2d/XAxis.js +1 -1
- package/lib/component/2d/YAxis.js +1 -1
- package/lib/component/2d/utilities/SliceScale.d.ts +2 -2
- package/lib/component/2d/utilities/scale.d.ts +5 -5
- package/lib/component/2d/zones/Signal.js +1 -2
- package/lib/component/EventsTrackers/BrushTracker.d.ts +4 -1
- package/lib/component/EventsTrackers/BrushTracker.js +21 -6
- package/lib/component/NMRium.d.ts +2 -2
- package/lib/component/NMRium.js +39 -26
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
- package/lib/component/assignment/actions/setActiveAssignment.js +1 -1
- package/lib/component/elements/Input.js +1 -0
- package/lib/component/elements/InputRange.js +1 -1
- package/lib/component/elements/MenuButton.d.ts +1 -1
- package/lib/component/elements/MoleculeSelection.d.ts +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +1 -1
- package/lib/component/elements/Scroller.d.ts +15 -0
- package/lib/component/elements/Scroller.js +31 -0
- package/lib/component/elements/Tab/DeleteButton.d.ts +1 -1
- package/lib/component/elements/ToolbarMenu.d.ts +1 -1
- package/lib/component/elements/accordion/Accordion.d.ts +1 -1
- package/lib/component/elements/draggable/SVGDraggable.d.ts +1 -1
- package/lib/component/elements/draggable/useDraggable.d.ts +1 -1
- package/lib/component/elements/dropDownButton/DropDownButton.d.ts +1 -1
- package/lib/component/elements/dropDownButton/DropDownList.js +3 -1
- package/lib/component/elements/formik/SelectBox.d.ts +1 -1
- package/lib/component/elements/popup/Alert/AlertBlock.d.ts +3 -2
- package/lib/component/elements/popup/Alert/AlertBlock.js +21 -15
- package/lib/component/elements/popup/Alert/Context.d.ts +26 -2
- package/lib/component/elements/popup/Alert/Context.js +6 -2
- package/lib/component/elements/popup/Alert/Provider.d.ts +4 -3
- package/lib/component/elements/popup/Alert/Provider.js +3 -3
- package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +1 -1
- package/lib/component/elements/popup/Modal/Provider.js +3 -1
- package/lib/component/elements/popup/options.d.ts +22 -19
- package/lib/component/elements/resizer/Resizer.d.ts +2 -2
- package/lib/component/elements/toggle/ToggleButton.d.ts +2 -2
- package/lib/component/elements/toggle/ToggleButton.js +1 -1
- package/lib/component/header/ZeroFillingOptionsPanel.js +3 -8
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +2 -2
- package/lib/component/hooks/useExport.js +2 -1
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +1 -1
- package/lib/component/hooks/usePanelPreferences.js +2 -2
- package/lib/component/hooks/useSaveSettings.js +9 -11
- package/lib/component/hooks/useXScale.d.ts +1 -1
- package/lib/component/hooks/useXYReduce.d.ts +2 -2
- package/lib/component/modal/AboutPredictionModal.js +1 -1
- package/lib/component/modal/AboutSpectrumSimulationModal.d.ts +2 -0
- package/lib/component/modal/AboutSpectrumSimulationModal.js +49 -0
- package/lib/component/modal/AlignSpectraModal.js +11 -1
- package/lib/component/modal/MultipletAnalysisModal.js +2 -1
- package/lib/component/modal/PredictSpectraModal.d.ts +1 -2
- package/lib/component/modal/PredictSpectraModal.js +25 -28
- package/lib/component/modal/changeSum/ChangeSumModal.js +1 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +1 -1
- package/lib/component/modal/editZone/SignalsForm.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib/component/modal/setting/settings-tabs/DisplayTabContent.js +4 -0
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +9 -2
- package/lib/component/modal/setting/settingsValidation.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +4 -7
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +3 -5
- package/lib/component/panels/Panels.js +13 -0
- package/lib/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPreferences.js +4 -3
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +3 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +2 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +34 -27
- package/lib/component/panels/databasePanel/DatabaseTable.js +1 -1
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/extra/utilities/UseToggleStatus.js +1 -1
- package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +3 -2
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +2 -2
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.d.ts +1 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +88 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.d.ts +11 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +37 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.d.ts +4 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +25 -0
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.d.ts +5 -0
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +60 -0
- package/lib/component/reducer/Reducer.d.ts +13 -12
- package/lib/component/reducer/Reducer.js +253 -239
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +1 -1
- package/lib/component/reducer/actions/AssignmentsActions.js +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +2 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +7 -2
- package/lib/component/reducer/actions/DomainActions.js +30 -1
- package/lib/component/reducer/actions/FiltersActions.js +4 -4
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +8 -2
- package/lib/component/reducer/actions/MoleculeActions.js +58 -3
- package/lib/component/reducer/actions/SpectrumsActions.d.ts +8 -2
- package/lib/component/reducer/actions/SpectrumsActions.js +43 -4
- package/lib/component/reducer/actions/ToolsActions.js +2 -2
- package/lib/component/reducer/actions/ZonesActions.js +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +4 -6
- package/lib/component/reducer/preferences/actions/addWorkspace.js +19 -15
- package/lib/component/reducer/preferences/actions/setActiveWorkspace.js +1 -1
- package/lib/component/reducer/preferences/actions/setPreferences.js +3 -4
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.js +5 -1
- package/lib/component/reducer/preferences/utilities/flatObject.js +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts +4 -4
- package/lib/component/utility/PathBuilder.js +11 -0
- package/lib/component/utility/export.js +9 -9
- package/lib/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib/component/utility/getUniqueNuclei.js +1 -1
- package/lib/component/utility/jpathToArray.js +1 -1
- package/lib/component/workspaces/index.d.ts +1 -0
- package/lib/component/workspaces/index.js +2 -0
- package/lib/component/workspaces/simulation.d.ts +2 -0
- package/lib/component/workspaces/simulation.js +68 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +9 -5
- package/lib/data/PredictionManager.d.ts +8 -7
- package/lib/data/PredictionManager.js +95 -22
- package/lib/data/SpectraManager.js +1 -1
- package/lib/data/constants/DefaultPathLengths.d.ts +1 -3
- package/lib/data/constants/SignalsKinds.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +3 -3
- package/lib/data/data1d/Spectrum1D/getReferenceShift.js +5 -4
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +12 -13
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +10 -9
- package/lib/data/data1d/database.d.ts +9 -7
- package/lib/data/data1d/database.js +13 -6
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
- package/lib/data/data1d/multipleSpectraAnalysis.js +1 -1
- package/lib/data/data1d/spectrumSimulation.d.ts +14 -0
- package/lib/data/data1d/spectrumSimulation.js +53 -0
- package/lib/data/data2d/Spectrum2D/contours.d.ts +8 -4
- package/lib/data/data2d/Spectrum2D/contours.js +7 -1
- package/lib/data/data2d/Spectrum2D/getMissingProjection.js +6 -6
- package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib/data/data2d/Spectrum2D/getSlice.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +5 -5
- package/lib/data/getDefaultMatrixFilters.d.ts +2 -2
- package/lib/data/matrixGeneration.js +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +2 -1
- package/lib/data/molecules/MoleculeManager.js +21 -7
- package/lib/data/parseMeta/linkMetaWithSpectra.js +2 -1
- package/lib/data/types/data1d/MatrixOptions.d.ts +2 -2
- package/lib/data/utilities/FindUtilities.js +4 -4
- package/lib/data/utilities/RangeUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/calculateSanPlot.js +3 -3
- package/lib/data/utilities/generateNumbersPowerOfX.js +1 -1
- package/lib/utils/clipboard/clipboard.d.ts +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +5 -4
- package/lib-cjs/component/1d/Viewer1D.js +120 -103
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +1 -1
- package/lib-cjs/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/TreeColors.js +1 -6
- package/lib-cjs/component/1d/tool/BaseLineZones.js +6 -3
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +1 -3
- package/lib-cjs/component/1d-2d/components/SpectrumInfoBlock.js +4 -1
- package/lib-cjs/component/1d-2d/tools/BrushXY.js +10 -7
- package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +1 -1
- package/lib-cjs/component/2d/FooterBanner.js +3 -2
- package/lib-cjs/component/2d/Viewer2D.js +50 -28
- package/lib-cjs/component/2d/XAxis.js +1 -1
- package/lib-cjs/component/2d/YAxis.js +1 -1
- package/lib-cjs/component/2d/zones/Signal.js +1 -2
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +21 -6
- package/lib-cjs/component/NMRium.js +37 -24
- package/lib-cjs/component/assignment/actions/setActiveAssignment.js +1 -1
- package/lib-cjs/component/elements/Input.js +1 -0
- package/lib-cjs/component/elements/InputRange.js +1 -1
- package/lib-cjs/component/elements/Scroller.js +35 -0
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +3 -1
- package/lib-cjs/component/elements/popup/Alert/AlertBlock.js +21 -15
- package/lib-cjs/component/elements/popup/Alert/Context.js +6 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +2 -2
- package/lib-cjs/component/elements/popup/Modal/Provider.js +3 -1
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -8
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +2 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +1 -1
- package/lib-cjs/component/hooks/useSaveSettings.js +9 -11
- package/lib-cjs/component/modal/AboutPredictionModal.js +1 -1
- package/lib-cjs/component/modal/AboutSpectrumSimulationModal.js +54 -0
- package/lib-cjs/component/modal/AlignSpectraModal.js +11 -1
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +2 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +24 -27
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/DisplayTabContent.js +4 -0
- package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +9 -2
- package/lib-cjs/component/modal/setting/settingsValidation.js +2 -2
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +4 -7
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +3 -5
- package/lib-cjs/component/panels/Panels.js +13 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPreferences.js +3 -2
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +34 -27
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +1 -1
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/extra/utilities/UseToggleStatus.js +1 -1
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +3 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -1
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +94 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +42 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +31 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpinSystemTable.js +67 -0
- package/lib-cjs/component/reducer/Reducer.js +253 -239
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +1 -1
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +2 -1
- package/lib-cjs/component/reducer/actions/DomainActions.js +31 -1
- package/lib-cjs/component/reducer/actions/FiltersActions.js +4 -4
- package/lib-cjs/component/reducer/actions/LoadActions.js +1 -1
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +62 -3
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +43 -3
- package/lib-cjs/component/reducer/actions/ToolsActions.js +2 -2
- package/lib-cjs/component/reducer/actions/ZonesActions.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +19 -15
- package/lib-cjs/component/reducer/preferences/actions/setActiveWorkspace.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +3 -4
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +5 -1
- package/lib-cjs/component/reducer/preferences/utilities/flatObject.js +1 -1
- package/lib-cjs/component/utility/PathBuilder.js +11 -0
- package/lib-cjs/component/utility/export.js +9 -9
- package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib-cjs/component/utility/getUniqueNuclei.js +1 -1
- package/lib-cjs/component/utility/jpathToArray.js +1 -1
- package/lib-cjs/component/workspaces/index.js +2 -0
- package/lib-cjs/component/workspaces/simulation.js +71 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +9 -5
- package/lib-cjs/data/PredictionManager.js +96 -22
- package/lib-cjs/data/SpectraManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/getReferenceShift.js +5 -4
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +12 -13
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +10 -9
- package/lib-cjs/data/data1d/database.js +13 -6
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +1 -1
- package/lib-cjs/data/data1d/spectrumSimulation.js +58 -0
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +7 -1
- package/lib-cjs/data/data2d/Spectrum2D/getMissingProjection.js +6 -6
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/getSlice.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +5 -5
- package/lib-cjs/data/matrixGeneration.js +1 -1
- package/lib-cjs/data/molecules/MoleculeManager.js +23 -8
- package/lib-cjs/data/parseMeta/linkMetaWithSpectra.js +2 -1
- package/lib-cjs/data/utilities/FindUtilities.js +4 -4
- package/lib-cjs/data/utilities/calculateSanPlot.js +3 -3
- package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +1 -1
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +21 -20
|
@@ -11,9 +11,7 @@ interface ContourOptions {
|
|
|
11
11
|
positive: ContourItem;
|
|
12
12
|
negative: ContourItem;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
[key: string]: Level;
|
|
16
|
-
}
|
|
14
|
+
type ContoursLevels = Record<string, Level>;
|
|
17
15
|
declare const DEFAULT_CONTOURS_OPTIONS: {
|
|
18
16
|
positive: {
|
|
19
17
|
contourLevels: number[];
|
|
@@ -32,6 +30,12 @@ interface ReturnContoursManager {
|
|
|
32
30
|
}
|
|
33
31
|
declare function getDefaultContoursLevel(options: ContourOptions): Level;
|
|
34
32
|
declare function contoursManager(spectrumID: string, state: ContoursLevels, options: ContourOptions): ReturnContoursManager;
|
|
35
|
-
declare function drawContours(level: number, spectrum: Spectrum2D, negative?: boolean, quadrant?: string): import("ml-conrec").DrawContourResult<"basic"
|
|
33
|
+
declare function drawContours(level: number, spectrum: Spectrum2D, negative?: boolean, quadrant?: string): import("ml-conrec").DrawContourResult<"basic"> | {
|
|
34
|
+
contours: {
|
|
35
|
+
zValue: any;
|
|
36
|
+
lines: never[];
|
|
37
|
+
}[];
|
|
38
|
+
timeout: boolean;
|
|
39
|
+
};
|
|
36
40
|
export { drawContours, contoursManager, getDefaultContoursLevel, DEFAULT_CONTOURS_OPTIONS, };
|
|
37
41
|
export type { ContoursLevels, ReturnContoursManager, Level, LevelSign };
|
|
@@ -33,7 +33,7 @@ function contoursManager(spectrumID, state, options) {
|
|
|
33
33
|
return { wheel, getLevel, checkLevel };
|
|
34
34
|
}
|
|
35
35
|
function prepareWheel(value, options) {
|
|
36
|
-
|
|
36
|
+
const { shiftKey, currentLevel, contourOptions } = options;
|
|
37
37
|
const sign = Math.sign(value);
|
|
38
38
|
const positiveBoundary = contourOptions.positive.contourLevels;
|
|
39
39
|
const negativeBoundary = contourOptions.negative.contourLevels;
|
|
@@ -123,6 +123,12 @@ function getContours(zoomLevel, options) {
|
|
|
123
123
|
if (negative) {
|
|
124
124
|
_range = _range.map((value) => -value);
|
|
125
125
|
}
|
|
126
|
+
if (_range.every((r) => r === 0)) {
|
|
127
|
+
return {
|
|
128
|
+
contours: _range.map((r) => ({ zValue: r, lines: [] })),
|
|
129
|
+
timeout: false,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
126
132
|
return conrec.drawContour({
|
|
127
133
|
contourDrawer: 'basic',
|
|
128
134
|
levels: _range,
|
|
@@ -8,16 +8,16 @@ export function getMissingProjection(datum, nucleus, datumInfo, usedColors) {
|
|
|
8
8
|
// temporary because nucleus was undefined;
|
|
9
9
|
if (index === -1)
|
|
10
10
|
index = 0;
|
|
11
|
-
|
|
11
|
+
const info = {
|
|
12
12
|
nucleus: datumInfo.nucleus[index],
|
|
13
13
|
isFid: false,
|
|
14
14
|
isComplex: false,
|
|
15
15
|
dimension: 1,
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const from = index === 0 ? datum.minX : datum.minY;
|
|
18
|
+
const to = index === 0 ? datum.maxX : datum.maxY;
|
|
19
|
+
const nbPoints = index === 0 ? datum.z[0].length : datum.z.length;
|
|
20
|
+
const projection = new Float64Array(nbPoints);
|
|
21
21
|
if (index === 1) {
|
|
22
22
|
for (let i = 0; i < datum.z.length; i++) {
|
|
23
23
|
for (let j = 0; j < datum.z[0].length; j++) {
|
|
@@ -32,7 +32,7 @@ export function getMissingProjection(datum, nucleus, datumInfo, usedColors) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
const data = {
|
|
36
36
|
x: zoneToX({ from, to }, nbPoints),
|
|
37
37
|
re: projection,
|
|
38
38
|
};
|
|
@@ -13,26 +13,26 @@ export function getSlice(spectrum, position) {
|
|
|
13
13
|
return;
|
|
14
14
|
if (yIndex < 0 || yIndex >= data.z.length)
|
|
15
15
|
return;
|
|
16
|
-
|
|
16
|
+
const infoX = {
|
|
17
17
|
nucleus: info.nucleus[0],
|
|
18
18
|
isFid: false,
|
|
19
19
|
isComplex: false,
|
|
20
20
|
dimension: 1,
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
const dataX = {
|
|
23
23
|
x: zoneToX({ from: data.minX, to: data.maxX }, data.z[0].length),
|
|
24
24
|
re: new Float64Array(data.z[0].length),
|
|
25
25
|
};
|
|
26
26
|
for (let i = 0; i < data.z[0].length; i++) {
|
|
27
27
|
dataX.re[i] += data.z[yIndex][i];
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
const infoY = {
|
|
30
30
|
nucleus: info.nucleus[1],
|
|
31
31
|
isFid: false,
|
|
32
32
|
isComplex: false,
|
|
33
33
|
dimension: 1,
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
const dataY = {
|
|
36
36
|
x: zoneToX({ from: data.minY, to: data.maxY }, data.z.length),
|
|
37
37
|
re: new Float64Array(data.z.length),
|
|
38
38
|
};
|
|
@@ -28,7 +28,7 @@ export function getDetectionZones(spectrum, options) {
|
|
|
28
28
|
function autoZonesDetection(data, options) {
|
|
29
29
|
const { clean, tolerances, thresholdFactor, maxPercentCutOff, convolutionByFFT, info: { nucleus: nuclei, originFrequency }, } = options;
|
|
30
30
|
const { enhanceSymmetry = nuclei[0] === nuclei[1] } = options;
|
|
31
|
-
|
|
31
|
+
const zones = xyzAutoZonesPicking(data, {
|
|
32
32
|
nuclei,
|
|
33
33
|
tolerances,
|
|
34
34
|
observedFrequencies: originFrequency,
|
|
@@ -54,7 +54,7 @@ function getSubMatrix(datum, selectedZone) {
|
|
|
54
54
|
[xIndexFrom, xIndexTo] = [xIndexTo, xIndexFrom];
|
|
55
55
|
if (yIndexFrom > yIndexTo)
|
|
56
56
|
[yIndexFrom, yIndexTo] = [yIndexTo, yIndexFrom];
|
|
57
|
-
|
|
57
|
+
const dataMatrix = {
|
|
58
58
|
z: [],
|
|
59
59
|
maxX: data.minX + xIndexTo * xStep,
|
|
60
60
|
minX: data.minX + xIndexFrom * xStep,
|
|
@@ -63,14 +63,14 @@ function getSubMatrix(datum, selectedZone) {
|
|
|
63
63
|
};
|
|
64
64
|
let maxZ = Number.MIN_SAFE_INTEGER;
|
|
65
65
|
let minZ = Number.MAX_SAFE_INTEGER;
|
|
66
|
-
|
|
66
|
+
const nbXPoints = xIndexTo - xIndexFrom + 1;
|
|
67
67
|
for (let j = yIndexFrom; j < yIndexTo; j++) {
|
|
68
|
-
|
|
68
|
+
const row = new Float32Array(nbXPoints);
|
|
69
69
|
let xIndex = xIndexFrom;
|
|
70
70
|
for (let i = 0; i < nbXPoints; i++) {
|
|
71
71
|
row[i] = data.z[j][xIndex++];
|
|
72
72
|
}
|
|
73
|
-
for (
|
|
73
|
+
for (const rowValue of row) {
|
|
74
74
|
if (maxZ < rowValue)
|
|
75
75
|
maxZ = rowValue;
|
|
76
76
|
if (minZ > rowValue)
|
|
@@ -5,10 +5,10 @@ interface FilterOptionsInfo {
|
|
|
5
5
|
description: string;
|
|
6
6
|
}
|
|
7
7
|
type FiltersObjectRecord = Record<string, FilterOptionsInfo>;
|
|
8
|
-
export type MatrixFilters = {
|
|
8
|
+
export type MatrixFilters = Array<{
|
|
9
9
|
name: FilterXYType['name'];
|
|
10
10
|
options: FiltersObjectRecord;
|
|
11
|
-
}
|
|
11
|
+
}>;
|
|
12
12
|
export declare function getDefaultMatrixFilters(): {
|
|
13
13
|
name: "fromTo" | "centerMean" | "centerMedian" | "normed" | "divideBySD" | "rescale" | "paretoNormalization" | "airPLSBaseline" | "iterativePolynomialBaseline" | "rollingAverageBaseline" | "rollingBallBaseline" | "rollingMedianBaseline" | "firstDerivative" | "secondDerivative" | "thirdDerivative" | "savitzkyGolay" | "ensureGrowing" | "equallySpaced" | "filterX" | "calibrateX" | "xFunction" | "yFunction";
|
|
14
14
|
options: FiltersObjectRecord;
|
|
@@ -13,7 +13,7 @@ function isLeave(fieldOptions) {
|
|
|
13
13
|
function flattenFields(filterName, data, properties, keysPath, parentObject, level) {
|
|
14
14
|
for (const fieldKey in data) {
|
|
15
15
|
let _keysPath = [];
|
|
16
|
-
|
|
16
|
+
const _keysPathObject = parentObject || null;
|
|
17
17
|
let _level = level || 0;
|
|
18
18
|
if (keysPath) {
|
|
19
19
|
_keysPath = _keysPath.concat(keysPath);
|
|
@@ -3,5 +3,6 @@ export declare function fromJSON(mols: StateMolecule[], reservedMolecules?: Stat
|
|
|
3
3
|
export declare function addMolfile(molecules: StateMoleculeExtended[], molfile: string): void;
|
|
4
4
|
export declare function setMolfile(molecules: StateMoleculeExtended[], currentMolecule: StateMolecule): void;
|
|
5
5
|
export declare function extractNumber(value: string): string | null;
|
|
6
|
-
export declare function extractLabelsNumbers(molecules: Pick<StateMolecule, 'label'
|
|
6
|
+
export declare function extractLabelsNumbers(molecules: Array<Pick<StateMolecule, 'label'>>): number[];
|
|
7
7
|
export declare function getLabelNumber(reserveNumbers: number[]): number;
|
|
8
|
+
export declare function getMolecules(text: string): Promise<import("nmr-load-save").StateMolecule[]>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { fileCollectionFromFiles } from 'filelist-utils';
|
|
2
|
+
import { read } from 'nmr-load-save';
|
|
1
3
|
import { Molecule as OCLMolecule } from 'openchemlib/full';
|
|
2
4
|
import { initMolecule } from './Molecule';
|
|
3
5
|
export function fromJSON(mols, reservedMolecules = []) {
|
|
@@ -6,7 +8,7 @@ export function fromJSON(mols, reservedMolecules = []) {
|
|
|
6
8
|
for (const mol of mols) {
|
|
7
9
|
const molecule = OCLMolecule.fromMolfile(mol.molfile);
|
|
8
10
|
const fragments = molecule.getFragments();
|
|
9
|
-
for (
|
|
11
|
+
for (const fragment of fragments) {
|
|
10
12
|
molecules.push(initMolecule({
|
|
11
13
|
molfile: fragment.toMolfileV3(),
|
|
12
14
|
label: mol.label || `P${getLabelNumber(reservedNumbers)}`,
|
|
@@ -21,8 +23,8 @@ export function addMolfile(molecules, molfile) {
|
|
|
21
23
|
// try to parse molfile
|
|
22
24
|
// this will throw if the molecule can not be parsed !
|
|
23
25
|
const molecule = OCLMolecule.fromMolfile(molfile);
|
|
24
|
-
|
|
25
|
-
for (
|
|
26
|
+
const fragments = molecule.getFragments();
|
|
27
|
+
for (const fragment of fragments) {
|
|
26
28
|
molecules.push(initMolecule({
|
|
27
29
|
molfile: fragment.toMolfileV3(),
|
|
28
30
|
label: `P${getLabelNumber(reservedNumbers)}`,
|
|
@@ -35,11 +37,11 @@ export function setMolfile(molecules, currentMolecule) {
|
|
|
35
37
|
const reservedNumbers = extractLabelsNumbers(molecules);
|
|
36
38
|
// try to parse molfile
|
|
37
39
|
// this will throw if the molecule can not be parsed !
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
const molecule = OCLMolecule.fromMolfile(molfile);
|
|
41
|
+
const fragments = molecule.getFragments();
|
|
40
42
|
if (fragments.length > 1) {
|
|
41
43
|
molecules = molecules.filter((m) => m.id !== id);
|
|
42
|
-
for (
|
|
44
|
+
for (const fragment of fragments) {
|
|
43
45
|
molecules.push(initMolecule({
|
|
44
46
|
molfile: fragment.toMolfileV3(),
|
|
45
47
|
label: `P${getLabelNumber(reservedNumbers)}`,
|
|
@@ -53,7 +55,7 @@ export function setMolfile(molecules, currentMolecule) {
|
|
|
53
55
|
id,
|
|
54
56
|
label,
|
|
55
57
|
});
|
|
56
|
-
|
|
58
|
+
const molIndex = molecules.findIndex((m) => m.id === id);
|
|
57
59
|
molecules.splice(molIndex, 1, _mol);
|
|
58
60
|
}
|
|
59
61
|
// we will split if we have many fragments
|
|
@@ -80,3 +82,15 @@ export function getLabelNumber(reserveNumbers) {
|
|
|
80
82
|
}
|
|
81
83
|
return 1;
|
|
82
84
|
}
|
|
85
|
+
export async function getMolecules(text) {
|
|
86
|
+
let extension = 'smi';
|
|
87
|
+
if (/v[23]000/i.test(text)) {
|
|
88
|
+
extension = 'sdf';
|
|
89
|
+
}
|
|
90
|
+
const file = new File([text], `file.${extension}`, {
|
|
91
|
+
type: 'text/plain',
|
|
92
|
+
});
|
|
93
|
+
const collection = await fileCollectionFromFiles([file]);
|
|
94
|
+
const { nmriumState: { data }, } = await read(collection);
|
|
95
|
+
return data?.molecules || [];
|
|
96
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import lodashGet from 'lodash/get';
|
|
2
2
|
import { prepareKey } from './prepareKey';
|
|
3
3
|
function linkMetaWithSpectra(options) {
|
|
4
|
-
|
|
4
|
+
const { autolink = false, parseMetaFileResult, spectra } = options;
|
|
5
|
+
let { source, target } = options;
|
|
5
6
|
const targetValues = {};
|
|
6
7
|
const { data, meta: { fields = [] }, } = parseMetaFileResult;
|
|
7
8
|
if (!autolink) {
|
|
@@ -6,7 +6,7 @@ function findSpectrum(spectraData, spectrumID, checkIsVisible) {
|
|
|
6
6
|
return spectrum;
|
|
7
7
|
}
|
|
8
8
|
function findSignal1D(spectrum, signalID) {
|
|
9
|
-
for (
|
|
9
|
+
for (const range of spectrum.ranges.values) {
|
|
10
10
|
const signalIndex = range.signals.findIndex((_signal) => _signal.id === signalID);
|
|
11
11
|
if (signalIndex >= 0) {
|
|
12
12
|
return range.signals[signalIndex];
|
|
@@ -14,7 +14,7 @@ function findSignal1D(spectrum, signalID) {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
function findSignal2D(spectrum, signalID) {
|
|
17
|
-
for (
|
|
17
|
+
for (const zone of spectrum.zones.values) {
|
|
18
18
|
const signalIndex = zone.signals.findIndex((_signal) => _signal.id === signalID);
|
|
19
19
|
if (signalIndex >= 0) {
|
|
20
20
|
return zone.signals[signalIndex];
|
|
@@ -22,7 +22,7 @@ function findSignal2D(spectrum, signalID) {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
function findRange(spectrum, signalID) {
|
|
25
|
-
for (
|
|
25
|
+
for (const range of spectrum.ranges.values) {
|
|
26
26
|
const signalIndex = range.signals.findIndex((_signal) => _signal.id === signalID);
|
|
27
27
|
if (signalIndex >= 0) {
|
|
28
28
|
return range;
|
|
@@ -30,7 +30,7 @@ function findRange(spectrum, signalID) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
function findZone(spectrum, signalID) {
|
|
33
|
-
for (
|
|
33
|
+
for (const zone of spectrum.zones.values) {
|
|
34
34
|
const signalIndex = zone.signals.findIndex((_signal) => _signal.id === signalID);
|
|
35
35
|
if (signalIndex >= 0) {
|
|
36
36
|
return zone;
|
|
@@ -19,5 +19,5 @@ export declare function unlink(range: Range, options?: UnlinkOptions): Range;
|
|
|
19
19
|
export declare function addDefaultSignal(range: any): void;
|
|
20
20
|
export declare function checkRangeKind(range: any): boolean;
|
|
21
21
|
export declare function checkSignalKinds(range: any, kinds: any): boolean;
|
|
22
|
-
export declare function unlinkInAssignmentData(assignmentData: any, ranges: Partial<Range
|
|
22
|
+
export declare function unlinkInAssignmentData(assignmentData: any, ranges: Array<Partial<Range>>): void;
|
|
23
23
|
export {};
|
|
@@ -6,4 +6,4 @@ export declare function resetDiaIDs(zone: Zone, axis: string): Zone;
|
|
|
6
6
|
export declare function checkZoneKind(zone: Zone): boolean;
|
|
7
7
|
export declare function checkSignalKinds(zone: Zone, kinds: string[]): boolean;
|
|
8
8
|
export declare function unlink(zone: Zone, isOnZoneLevel?: boolean, signalIndex?: number, axis?: string): Zone;
|
|
9
|
-
export declare function unlinkInAssignmentData(assignmentData: any, zones: Partial<Zone
|
|
9
|
+
export declare function unlinkInAssignmentData(assignmentData: any, zones: Array<Partial<Zone>>, axis?: string): void;
|
|
@@ -16,9 +16,9 @@ function prepare1DData(data) {
|
|
|
16
16
|
return array;
|
|
17
17
|
}
|
|
18
18
|
function prepare2DData(data) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const cols = data.z[0].length;
|
|
20
|
+
const rows = data.z.length;
|
|
21
|
+
const jump = Math.floor((cols * rows) / 204800) || 1;
|
|
22
22
|
const array = new Float64Array(((cols * rows) / jump) >> 0);
|
|
23
23
|
let index = 0;
|
|
24
24
|
for (let r = 0; r < rows; r += 1) {
|
|
@@ -5,7 +5,7 @@ export interface ClipboardItemInterface {
|
|
|
5
5
|
readonly presentationStyle?: PresentationStyle;
|
|
6
6
|
readonly lastModified?: number;
|
|
7
7
|
readonly delayed?: boolean;
|
|
8
|
-
readonly types:
|
|
8
|
+
readonly types: readonly string[];
|
|
9
9
|
getType(type: string): Promise<Blob>;
|
|
10
10
|
}
|
|
11
11
|
export declare function write(data: ClipboardItemInterface[]): Promise<void>;
|
package/lib/versionInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default { version: 'v0.
|
|
1
|
+
export default { version: 'v0.42.0' };
|
|
@@ -81,8 +81,8 @@ const styles = (0, react_1.css) `
|
|
|
81
81
|
}
|
|
82
82
|
`;
|
|
83
83
|
function FooterBannerInner({ margin, width, height, activeSpectrum, spectrum, activeTab, }) {
|
|
84
|
-
|
|
85
|
-
const { startX, endX, step } = (0, BrushTracker_1.useBrushTracker)();
|
|
84
|
+
const position = (0, MouseTracker_1.useMouseTracker)();
|
|
85
|
+
const { startX, endX, step, mouseButton } = (0, BrushTracker_1.useBrushTracker)();
|
|
86
86
|
const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
|
|
87
87
|
const format = (0, useFormatNumberByNucleus_1.useFormatNumberByNucleus)(activeTab);
|
|
88
88
|
if (!position ||
|
|
@@ -107,8 +107,9 @@ function FooterBannerInner({ margin, width, height, activeSpectrum, spectrum, ac
|
|
|
107
107
|
}
|
|
108
108
|
return 1;
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
const isBrushing = step === 'brushing' && mouseButton === 'main';
|
|
111
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)(bs_1.BsCursor, {}), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { className: "label", children: " \uD835\uDEC5: " }), (0, jsx_runtime_1.jsx)("span", { className: "value", children: format(scaleX().invert(position.x)) }), (0, jsx_runtime_1.jsx)("span", { className: "unit", children: "ppm" }), activeSpectrum && spectrum?.info?.originFrequency && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("span", { className: "value", children: ["\u00A0(", format(scaleX().invert(position.x) * spectrum?.info?.originFrequency, 'hz')] }), (0, jsx_runtime_1.jsx)("span", { className: "unit", children: "Hz" }), (0, jsx_runtime_1.jsx)("span", { className: "value", children: ") " }), (0, jsx_runtime_1.jsxs)("span", { className: "small-width-none", children: [(0, jsx_runtime_1.jsx)("span", { children: "," }), (0, jsx_runtime_1.jsx)("span", { className: "label", children: " Index: " }), (0, jsx_runtime_1.jsx)("span", { className: "value", children: getXIndex(position.x) })] })] }))] }), isBrushing && ((0, jsx_runtime_1.jsxs)("div", { className: "flex-row small-width-none", children: [(0, jsx_runtime_1.jsx)("span", { className: "label", children: " \u0394ppm: " }), (0, jsx_runtime_1.jsx)("span", { className: "value", children: (scaleX().invert(startX) - scaleX().invert(endX)).toPrecision(6) })] })), activeSpectrum && ((0, jsx_runtime_1.jsxs)("div", { className: " flex-row small-width-none", children: [spectrum?.info?.originFrequency && isBrushing && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { className: "label", children: " \u0394Hz: " }), (0, jsx_runtime_1.jsx)("span", { className: "value", children: ((scaleX().invert(startX) - scaleX().invert(endX)) *
|
|
112
|
+
spectrum?.info?.originFrequency).toPrecision(5) })] })), isBrushing && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { className: "label", children: " ratio :" }), (0, jsx_runtime_1.jsxs)("span", { className: "value", children: [((getYValue(startX) / (getYValue(endX) || Number.MIN_VALUE)) *
|
|
112
113
|
100).toFixed(2), "%"] })] }))] })), activeSpectrum && ((0, jsx_runtime_1.jsxs)("div", { className: "flex-row small-width-none", children: [(0, jsx_runtime_1.jsx)("div", { className: "separator" }), (0, jsx_runtime_1.jsx)(io5_1.IoPulseSharp, {}), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { className: "label", children: "Intensity: " }), (0, jsx_runtime_1.jsx)("span", { className: "value y-value", children: format(getYValue(position.x)) })] })] }))] }));
|
|
113
114
|
}
|
|
114
115
|
const MemoizedFooterBanner = (0, react_2.memo)(FooterBannerInner);
|