nmrium 0.27.0 → 0.28.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/ExclusionZonesAnnotations.js +1 -1
- package/lib/component/1d/IntegralsSeries.js +2 -6
- package/lib/component/1d/PeakAnnotation.js +2 -2
- package/lib/component/1d/PeakAnnotations.js +2 -4
- package/lib/component/1d/SpectraTracker.js +2 -2
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +28 -26
- package/lib/component/1d/ranges/Range.d.ts +1 -2
- package/lib/component/1d/ranges/Range.js +3 -4
- package/lib/component/1d/ranges/Ranges.js +3 -4
- package/lib/component/1d/tool/BaseLineZones.js +3 -6
- package/lib/component/1d/tool/VerticalIndicator.js +1 -1
- package/lib/component/2d/Contours.js +1 -5
- package/lib/component/2d/SignalDeltaLine.js +1 -1
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/YAxis.js +2 -2
- package/lib/component/2d/zones/IndicationLines.js +2 -3
- package/lib/component/EventsTrackers/KeysListenerTracker.js +59 -41
- package/lib/component/NMRium.d.ts +14 -49
- package/lib/component/NMRium.js +14 -6
- package/lib/component/SplitPaneWrapper.js +2 -2
- package/lib/component/context/PreferencesContext.d.ts +3 -43
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/Logo.js +1 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -0
- package/lib/component/elements/Tab/Tabs.js +2 -1
- package/lib/component/elements/ToggleButton.js +2 -2
- package/lib/component/elements/accordion/Accordion.js +2 -6
- package/lib/component/elements/formik/Input.js +1 -1
- package/lib/component/elements/popup/Modal/Modal.js +1 -1
- package/lib/component/elements/popup/Modal/ModalContent.js +1 -1
- package/lib/component/elements/toggle/ToggleButtonGroup.js +2 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +7 -4
- package/lib/component/header/Header.js +2 -2
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +2 -1
- package/lib/component/hooks/useExport.js +2 -2
- package/lib/component/hooks/useFormatNumberByNucleus.js +3 -4
- package/lib/component/loader/DropZone.js +8 -2
- package/lib/component/loader/NoData.d.ts +3 -2
- package/lib/component/loader/NoData.js +31 -30
- package/lib/component/modal/MoleculeStructureEditorModal.js +2 -2
- package/lib/component/modal/editRange/EditRangeModal.d.ts +3 -3
- package/lib/component/modal/editRange/EditRangeModal.js +49 -54
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +9 -22
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +12 -50
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.d.ts +2 -0
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +34 -0
- package/lib/component/modal/editRange/forms/components/SignalFormTab.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/SignalFormTab.js +11 -14
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +18 -29
- package/lib/component/modal/editZone/SignalsForm.js +1 -1
- package/lib/component/modal/setting/DatabasesTabContent.d.ts +2 -1
- package/lib/component/modal/setting/DatabasesTabContent.js +28 -30
- package/lib/component/modal/setting/settingsValidation.d.ts +150 -42
- package/lib/component/modal/setting/settingsValidation.js +6 -4
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +13 -15
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +8 -15
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/Panels.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +12 -3
- package/lib/component/panels/RangesPanel/RangesPanel.js +19 -19
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +4 -4
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +48 -30
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -3
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -8
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
- package/lib/component/panels/SummaryPanel/utilities/{IsInView.d.ts → useInView.d.ts} +2 -2
- package/lib/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +13 -13
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +4 -0
- package/lib/component/panels/databasePanel/DatabasePanel.js +80 -26
- package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.d.ts +7 -0
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js +8 -0
- package/lib/component/panels/databasePanel/DatabaseTable.js +14 -9
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +2 -4
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -3
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib/component/reducer/Reducer.d.ts +8 -66
- package/lib/component/reducer/Reducer.js +13 -8
- package/lib/component/reducer/actions/DatabaseActions.d.ts +3 -2
- package/lib/component/reducer/actions/DatabaseActions.js +21 -3
- package/lib/component/reducer/actions/DomainActions.js +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts +2 -1
- package/lib/component/reducer/actions/FiltersActions.js +25 -4
- package/lib/component/reducer/actions/PreferencesActions.js +32 -20
- package/lib/component/reducer/actions/RangesActions.d.ts +2 -2
- package/lib/component/reducer/actions/RangesActions.js +45 -11
- package/lib/component/reducer/actions/SpectrumsActions.js +6 -9
- package/lib/component/reducer/actions/ToolsActions.js +66 -53
- package/lib/component/reducer/helper/getSpectrum.d.ts +5 -0
- package/lib/component/reducer/helper/getSpectrum.js +14 -0
- package/lib/component/reducer/preferences/actions/initPreferences.js +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +4 -4
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +23 -10
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib/component/reducer/types/Types.d.ts +3 -1
- package/lib/component/reducer/types/Types.js +3 -1
- package/lib/component/tool/BrushX.js +1 -1
- package/lib/component/tool/BrushXY.js +1 -1
- package/lib/component/tool/CrossLinePointer.js +1 -1
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +4 -3
- package/lib/component/toolbar/BasicToolBar.js +0 -1
- package/lib/component/toolbar/FunctionToolBar.js +9 -13
- package/lib/component/toolbar/ToolTypes.d.ts +1 -1
- package/lib/component/toolbar/ToolTypes.js +3 -3
- package/lib/component/utility/Export.d.ts +7 -1
- package/lib/component/utility/Export.js +3 -3
- package/lib/component/utility/formatNumber.d.ts +1 -1
- package/lib/component/utility/formatNumber.js +4 -2
- package/lib/component/utility/isGoogleDocument.d.ts +1 -0
- package/lib/component/utility/isGoogleDocument.js +3 -0
- package/lib/component/utility/nmredataToNmrium.js +1 -2
- package/lib/component/utility/nmriumToNmredata.d.ts +2 -2
- package/lib/component/utility/nmriumToNmredata.js +2 -2
- package/lib/component/utility/util/nmredata/addSource.js +2 -2
- package/lib/component/workspaces/Workspace.d.ts +9 -4
- package/lib/component/workspaces/basic.js +15 -8
- package/lib/component/workspaces/exercise.js +2 -2
- package/lib/component/workspaces/process1D.js +1 -1
- package/lib/data/FiltersManager.js +1 -1
- package/lib/data/PredictionManager.js +7 -9
- package/lib/data/SpectraManager.d.ts +4 -12
- package/lib/data/SpectraManager.js +14 -23
- package/lib/data/data1d/Data1DManager.js +8 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +8 -10
- package/lib/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +36 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +38 -15
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -1
- package/lib/data/data1d/database.d.ts +5 -3
- package/lib/data/data1d/database.js +54 -4
- package/lib/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib/data/data2d/Processing2D.js +1 -1
- package/lib/data/molecules/Molecule.d.ts +4 -5
- package/lib/data/molecules/Molecule.js +3 -1
- package/lib/data/utilities/FindUtilities.js +1 -3
- package/lib/data/utilities/RangeUtilities.js +5 -6
- package/lib/data/utilities/ZoneUtilities.js +1 -1
- package/lib/data/utilities/getSum.js +1 -3
- package/lib/data/utilities/isMolFileEmpty.d.ts +1 -0
- package/lib/data/utilities/isMolFileEmpty.js +6 -0
- package/lib/types/NMRiumDataReturn.d.ts +15 -0
- package/lib/types/NMRiumDataReturn.js +1 -0
- package/lib/types/NMRiumGeneralPreferences.d.ts +10 -0
- package/lib/types/NMRiumGeneralPreferences.js +1 -0
- package/lib/types/NMRiumPanelPreferences.d.ts +16 -0
- package/lib/types/NMRiumPanelPreferences.js +1 -0
- package/lib/types/NMRiumToolBarPreferences.d.ts +20 -0
- package/lib/types/NMRiumToolBarPreferences.js +1 -0
- package/lib/types/Preferences.d.ts +5 -0
- package/lib/types/Preferences.js +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib-cjs/component/1d/IntegralsSeries.js +2 -6
- package/lib-cjs/component/1d/PeakAnnotation.js +2 -2
- package/lib-cjs/component/1d/PeakAnnotations.js +2 -4
- package/lib-cjs/component/1d/SpectraTracker.js +2 -2
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +30 -25
- package/lib-cjs/component/1d/ranges/Range.js +3 -4
- package/lib-cjs/component/1d/ranges/Ranges.js +3 -4
- package/lib-cjs/component/1d/tool/BaseLineZones.js +3 -6
- package/lib-cjs/component/1d/tool/VerticalIndicator.js +1 -1
- package/lib-cjs/component/2d/Contours.js +1 -5
- package/lib-cjs/component/2d/SignalDeltaLine.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +1 -1
- package/lib-cjs/component/2d/YAxis.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +2 -3
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +59 -41
- package/lib-cjs/component/NMRium.js +13 -5
- package/lib-cjs/component/SplitPaneWrapper.js +2 -2
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/Logo.js +1 -1
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -0
- package/lib-cjs/component/elements/Tab/Tabs.js +2 -1
- package/lib-cjs/component/elements/ToggleButton.js +2 -2
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -6
- package/lib-cjs/component/elements/formik/Input.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/Modal.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +1 -1
- package/lib-cjs/component/elements/toggle/ToggleButtonGroup.js +2 -2
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
- package/lib-cjs/component/header/Header.js +2 -2
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +2 -1
- package/lib-cjs/component/hooks/useExport.js +2 -2
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +2 -3
- package/lib-cjs/component/loader/DropZone.js +8 -2
- package/lib-cjs/component/loader/NoData.js +31 -30
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +2 -2
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +47 -52
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +9 -22
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +12 -50
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +38 -0
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormTab.js +13 -16
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +18 -29
- package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +31 -33
- package/lib-cjs/component/modal/setting/settingsValidation.js +6 -4
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +12 -14
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +8 -15
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
- package/lib-cjs/component/panels/Panels.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +10 -1
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +18 -18
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +47 -29
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +6 -8
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
- package/lib-cjs/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +12 -12
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +78 -24
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabaseStructureSearchModal.js +15 -0
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +14 -9
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +2 -4
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -3
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib-cjs/component/reducer/Reducer.js +13 -8
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +22 -3
- package/lib-cjs/component/reducer/actions/DomainActions.js +1 -1
- package/lib-cjs/component/reducer/actions/FiltersActions.js +26 -4
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +30 -18
- package/lib-cjs/component/reducer/actions/RangesActions.js +46 -12
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +4 -7
- package/lib-cjs/component/reducer/actions/ToolsActions.js +63 -73
- package/lib-cjs/component/reducer/helper/getSpectrum.js +18 -0
- package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +1 -1
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +4 -4
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib-cjs/component/reducer/types/Types.js +5 -3
- package/lib-cjs/component/tool/BrushX.js +1 -1
- package/lib-cjs/component/tool/BrushXY.js +1 -1
- package/lib-cjs/component/tool/CrossLinePointer.js +1 -1
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +3 -2
- package/lib-cjs/component/toolbar/BasicToolBar.js +0 -1
- package/lib-cjs/component/toolbar/FunctionToolBar.js +9 -13
- package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
- package/lib-cjs/component/utility/Export.js +4 -3
- package/lib-cjs/component/utility/formatNumber.js +3 -1
- package/lib-cjs/component/utility/isGoogleDocument.js +7 -0
- package/lib-cjs/component/utility/nmredataToNmrium.js +1 -2
- package/lib-cjs/component/utility/util/nmredata/addSource.js +2 -2
- package/lib-cjs/component/workspaces/basic.js +15 -8
- package/lib-cjs/component/workspaces/exercise.js +2 -2
- package/lib-cjs/component/workspaces/process1D.js +1 -1
- package/lib-cjs/data/FiltersManager.js +1 -1
- package/lib-cjs/data/PredictionManager.js +7 -9
- package/lib-cjs/data/SpectraManager.js +14 -23
- package/lib-cjs/data/data1d/Data1DManager.js +8 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +40 -16
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -1
- package/lib-cjs/data/data1d/database.js +55 -5
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib-cjs/data/data2d/Processing2D.js +1 -1
- package/lib-cjs/data/molecules/Molecule.js +3 -1
- package/lib-cjs/data/utilities/FindUtilities.js +1 -3
- package/lib-cjs/data/utilities/RangeUtilities.js +8 -6
- package/lib-cjs/data/utilities/ZoneUtilities.js +1 -1
- package/lib-cjs/data/utilities/getSum.js +1 -3
- package/lib-cjs/data/utilities/isMolFileEmpty.js +10 -0
- package/lib-cjs/types/NMRiumDataReturn.js +2 -0
- package/lib-cjs/types/NMRiumGeneralPreferences.js +2 -0
- package/lib-cjs/types/NMRiumPanelPreferences.js +2 -0
- package/lib-cjs/types/NMRiumToolBarPreferences.js +2 -0
- package/lib-cjs/types/Preferences.js +2 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +31 -31
- package/lib/component/1d/multiplicityTree/TempMultiplicityTree.d.ts +0 -2
- package/lib/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -14
- package/lib/component/panels/databasePanel/useDatabases.d.ts +0 -5
- package/lib/component/panels/databasePanel/useDatabases.js +0 -10
- package/lib-cjs/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -20
- package/lib-cjs/component/panels/databasePanel/useDatabases.js +0 -14
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
interface
|
|
1
|
+
export interface MoleculeObject {
|
|
2
2
|
key: string;
|
|
3
3
|
molfile: string;
|
|
4
4
|
isFloat: boolean;
|
|
5
5
|
label: string;
|
|
6
6
|
}
|
|
7
|
-
export interface Molecule extends
|
|
7
|
+
export interface Molecule extends MoleculeObject {
|
|
8
8
|
mf: string;
|
|
9
9
|
em: number;
|
|
10
10
|
mw: number;
|
|
11
11
|
svg: string;
|
|
12
12
|
atoms: Record<string, number>;
|
|
13
13
|
}
|
|
14
|
-
export declare function initMolecule(options?: Partial<
|
|
15
|
-
export declare function toJSON(molecule: Molecule):
|
|
16
|
-
export {};
|
|
14
|
+
export declare function initMolecule(options?: Partial<MoleculeObject>): Molecule;
|
|
15
|
+
export declare function toJSON(molecule: Molecule): MoleculeObject;
|
|
@@ -21,9 +21,11 @@ export function initMolecule(options = {}) {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
export function toJSON(molecule) {
|
|
24
|
-
const { molfile, label } = molecule;
|
|
24
|
+
const { molfile, label, isFloat, key } = molecule;
|
|
25
25
|
return {
|
|
26
26
|
molfile,
|
|
27
27
|
label,
|
|
28
|
+
isFloat,
|
|
29
|
+
key,
|
|
28
30
|
};
|
|
29
31
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
function findSpectrum(spectraData, spectrumID, checkIsVisible) {
|
|
2
2
|
const spectrum = spectraData.find((_spectrum) => _spectrum.id === spectrumID);
|
|
3
|
-
if (spectrum &&
|
|
4
|
-
checkIsVisible === true &&
|
|
5
|
-
spectrum.display.isVisible === false) {
|
|
3
|
+
if (spectrum && checkIsVisible && !spectrum.display.isVisible) {
|
|
6
4
|
return undefined;
|
|
7
5
|
}
|
|
8
6
|
return spectrum;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import omit from 'lodash/omit';
|
|
1
2
|
import { DatumKind } from '../constants/SignalsKinds';
|
|
2
3
|
export function getDiaIDs(range) {
|
|
3
4
|
return [].concat(range.diaIDs || [], range.signals
|
|
@@ -19,13 +20,11 @@ export function setNbAtoms(range, signalIndex) {
|
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
export function resetDiaIDs(range) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
range.signals.
|
|
25
|
-
|
|
26
|
-
delete _signal.nbAtoms;
|
|
23
|
+
const deletedKeys = ['diaIDs', 'nbAtoms'];
|
|
24
|
+
range = omit(range, deletedKeys);
|
|
25
|
+
range.signals = range.signals.map((signal) => {
|
|
26
|
+
return omit(signal, deletedKeys);
|
|
27
27
|
});
|
|
28
|
-
delete range.nbAtoms;
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
30
|
*
|
|
@@ -32,7 +32,7 @@ export function checkSignalKinds(zone, kinds) {
|
|
|
32
32
|
}
|
|
33
33
|
export function unlink(zone, isOnZoneLevel, signalIndex, axis) {
|
|
34
34
|
if (isOnZoneLevel !== undefined && axis !== undefined) {
|
|
35
|
-
if (isOnZoneLevel
|
|
35
|
+
if (isOnZoneLevel) {
|
|
36
36
|
delete zone[axis].diaIDs;
|
|
37
37
|
delete zone[axis].nbAtoms;
|
|
38
38
|
}
|
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export function getSum(values, key, check = null) {
|
|
9
9
|
return values.reduce((sum, current) => {
|
|
10
|
-
return check
|
|
11
|
-
? (sum += Math.abs(current[key]))
|
|
12
|
-
: sum;
|
|
10
|
+
return check?.(current) ? (sum += Math.abs(current[key])) : sum;
|
|
13
11
|
}, 0);
|
|
14
12
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isMolFileEmpty(molFile: string): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CorrelationData } from 'nmr-correlation';
|
|
2
|
+
import { SpectraAnalysis } from '../data/data1d/MultipleAnalysis';
|
|
3
|
+
import { Molecule } from '../data/molecules/Molecule';
|
|
4
|
+
import { Datum1D } from '../data/types/data1d';
|
|
5
|
+
import { Datum2D } from '../data/types/data2d';
|
|
6
|
+
import { Preferences } from './Preferences';
|
|
7
|
+
export interface NMRiumDataReturn {
|
|
8
|
+
actionType?: string;
|
|
9
|
+
version: number;
|
|
10
|
+
spectra: (Datum1D | Datum2D)[];
|
|
11
|
+
molecules: Molecule[];
|
|
12
|
+
correlations: CorrelationData;
|
|
13
|
+
preferences: Preferences;
|
|
14
|
+
multipleAnalysis: SpectraAnalysis;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InitialSeparation } from 'analysis-ui-components/lib-esm/components/SplitPane';
|
|
2
|
+
import { PanelPreferencesType } from './PanelPreferencesType';
|
|
3
|
+
export interface NMRiumGeneralPreferences {
|
|
4
|
+
disableMultipletAnalysis: boolean;
|
|
5
|
+
hideSetSumFromMolecule: boolean;
|
|
6
|
+
hideGeneralSettings: boolean;
|
|
7
|
+
experimentalFeatures: PanelPreferencesType;
|
|
8
|
+
hidePanelOnLoad: boolean;
|
|
9
|
+
initialPanelWidth?: InitialSeparation;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PanelPreferencesType } from './PanelPreferencesType';
|
|
2
|
+
export interface NMRiumPanelPreferences {
|
|
3
|
+
spectraPanel: PanelPreferencesType;
|
|
4
|
+
informationPanel: PanelPreferencesType;
|
|
5
|
+
peaksPanel: PanelPreferencesType;
|
|
6
|
+
integralsPanel: PanelPreferencesType;
|
|
7
|
+
rangesPanel: PanelPreferencesType;
|
|
8
|
+
structuresPanel: PanelPreferencesType;
|
|
9
|
+
filtersPanel: PanelPreferencesType;
|
|
10
|
+
zonesPanel: PanelPreferencesType;
|
|
11
|
+
summaryPanel: PanelPreferencesType;
|
|
12
|
+
multipleSpectraAnalysisPanel: PanelPreferencesType;
|
|
13
|
+
databasePanel: PanelPreferencesType;
|
|
14
|
+
predictionPanel: PanelPreferencesType;
|
|
15
|
+
automaticAssignmentPanel: PanelPreferencesType;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface NMRiumToolBarPreferences {
|
|
2
|
+
zoomTool: boolean;
|
|
3
|
+
zoomOutTool: boolean;
|
|
4
|
+
import: boolean;
|
|
5
|
+
exportAs: boolean;
|
|
6
|
+
spectraStackAlignments: boolean;
|
|
7
|
+
spectraCenterAlignments: boolean;
|
|
8
|
+
realImaginary: boolean;
|
|
9
|
+
peakTool: boolean;
|
|
10
|
+
integralTool: boolean;
|
|
11
|
+
zonePickingTool: boolean;
|
|
12
|
+
slicingTool: boolean;
|
|
13
|
+
rangePickingTool: boolean;
|
|
14
|
+
zeroFillingTool: boolean;
|
|
15
|
+
phaseCorrectionTool: boolean;
|
|
16
|
+
baselineCorrectionTool: boolean;
|
|
17
|
+
FFTTool: boolean;
|
|
18
|
+
multipleSpectraAnalysisTool: boolean;
|
|
19
|
+
exclusionZonesTool: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/versionInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default { version: 'v0.
|
|
1
|
+
export default { version: 'v0.28.0' };
|
|
@@ -36,7 +36,7 @@ const ExclusionZoneAnnotation_1 = __importDefault(require("./ExclusionZoneAnnota
|
|
|
36
36
|
const getVerticalShift_1 = __importDefault(require("./utilities/getVerticalShift"));
|
|
37
37
|
function ExclusionZonesAnnotationsInner({ displayerKey, xDomains, spectra, verticalAlign, }) {
|
|
38
38
|
return ((0, jsx_runtime_1.jsx)("g", { className: "spectrum-exclusion-zones-group", clipPath: `url(#${displayerKey}clip-chart-1d)`, children: spectra
|
|
39
|
-
.filter((d) => d.display.isVisible
|
|
39
|
+
.filter((d) => d.display.isVisible && xDomains[d.id])
|
|
40
40
|
.map((d, index) => getExclusionZones(d).map((zone) => {
|
|
41
41
|
return ((0, jsx_runtime_1.jsx)(ExclusionZoneAnnotation_1.default, { spectrumID: d.id, vAlign: (0, getVerticalShift_1.default)(verticalAlign, { index }), zone: zone, color: d.display.color }, zone.id));
|
|
42
42
|
})) }));
|
|
@@ -12,15 +12,11 @@ function IntegralsSeries() {
|
|
|
12
12
|
const { xDomains, activeSpectrum, data, displayerKey, activeTab: nucleus, } = (0, ChartContext_1.useChartData)();
|
|
13
13
|
const Integrals = (0, react_1.useMemo)(() => {
|
|
14
14
|
const isActive = (id) => {
|
|
15
|
-
return activeSpectrum === null
|
|
16
|
-
? true
|
|
17
|
-
: id === activeSpectrum.id
|
|
18
|
-
? true
|
|
19
|
-
: false;
|
|
15
|
+
return activeSpectrum === null ? true : id === activeSpectrum.id;
|
|
20
16
|
};
|
|
21
17
|
return ((0, jsx_runtime_1.jsx)("g", { className: "integrals", children: data?.[0] &&
|
|
22
18
|
data
|
|
23
|
-
.filter((d) => d.display.isVisible
|
|
19
|
+
.filter((d) => d.display.isVisible && xDomains[d.id])
|
|
24
20
|
.filter(Spectrum1D_1.isSpectrum1D)
|
|
25
21
|
.map((spectrum) => spectrum.integrals.values.map((integral) => ((0, jsx_runtime_1.jsx)(Integral_1.default, { nucleus: nucleus, integral: integral, isActive: isActive(spectrum.id) }, integral.id)))) }));
|
|
26
22
|
}, [activeSpectrum, data, nucleus, xDomains]);
|
|
@@ -78,7 +78,7 @@ value, color, isActive, nucleus, }) {
|
|
|
78
78
|
id,
|
|
79
79
|
value: newValue,
|
|
80
80
|
oldValue: value,
|
|
81
|
-
shiftValue
|
|
81
|
+
shiftValue,
|
|
82
82
|
});
|
|
83
83
|
event.currentTarget.blur();
|
|
84
84
|
setIsSelected(false);
|
|
@@ -117,7 +117,7 @@ value, color, isActive, nucleus, }) {
|
|
|
117
117
|
border: isSelected ? `1px solid ${color}` : `0`,
|
|
118
118
|
opacity: isActive ? 1 : 0.2,
|
|
119
119
|
userSelect: 'none',
|
|
120
|
-
color
|
|
120
|
+
color,
|
|
121
121
|
}, value: oldValue, onKeyDown: handleKeyDown, onChange: handleChange, type: "number", disabled: !isActive }) }) })] }));
|
|
122
122
|
}
|
|
123
123
|
exports.default = PeakAnnotation;
|
|
@@ -32,15 +32,13 @@ function PeakAnnotations() {
|
|
|
32
32
|
};
|
|
33
33
|
return (data &&
|
|
34
34
|
reSortData()
|
|
35
|
-
.filter((d) => d.display.isVisible
|
|
35
|
+
.filter((d) => d.display.isVisible && xDomains[d.id])
|
|
36
36
|
.filter(Spectrum1D_1.isSpectrum1D)
|
|
37
37
|
.map((d) => {
|
|
38
38
|
return (d.peaks?.values &&
|
|
39
39
|
d.display.isPeaksMarkersVisible && ((0, jsx_runtime_1.jsx)("g", { transform: `translate(0,-${getVerticalAlign(d.id)})`, children: d.peaks.values.map(({ x, y, id }) => ((0, jsx_runtime_1.jsx)(PeakAnnotation_1.default, { x: scaleX()(x), y: scaleY(d.id)(y) - 5, sign: Math.sign(y), id: id, value: x, color: "#730000", nucleus: d.info.nucleus, isActive: activeSpectrum == null
|
|
40
40
|
? false
|
|
41
|
-
: activeSpectrum.id === d.id
|
|
42
|
-
? true
|
|
43
|
-
: false }, id))) }, d.id)));
|
|
41
|
+
: activeSpectrum.id === d.id }, id))) }, d.id)));
|
|
44
42
|
}));
|
|
45
43
|
}, [data, verticalAlign, activeSpectrum, xDomains, scaleX, scaleY]);
|
|
46
44
|
return ((0, jsx_runtime_1.jsx)("g", { className: "peaks", clipPath: `url(#${displayerKey}clip-chart-1d)`, children: Peaks }));
|
|
@@ -45,10 +45,10 @@ function YTracker({ datum }) {
|
|
|
45
45
|
}
|
|
46
46
|
function SpectraTracker() {
|
|
47
47
|
const { data, activeTab, xDomains } = (0, ChartContext_1.useChartData)();
|
|
48
|
-
const [isVisible,
|
|
48
|
+
const [isVisible, toggleVisibility] = (0, react_1.useState)(false);
|
|
49
49
|
(0, react_1.useEffect)(() => {
|
|
50
50
|
function handler(flag) {
|
|
51
|
-
|
|
51
|
+
toggleVisibility(flag);
|
|
52
52
|
}
|
|
53
53
|
Events_1.default.on('showYSpectraTrackers', handler);
|
|
54
54
|
return () => {
|
|
@@ -162,7 +162,7 @@ function Viewer1D({ emptyText = undefined }) {
|
|
|
162
162
|
...brushData,
|
|
163
163
|
});
|
|
164
164
|
break;
|
|
165
|
-
case ToolTypes_1.options.
|
|
165
|
+
case ToolTypes_1.options.baselineCorrection.id:
|
|
166
166
|
dispatch({
|
|
167
167
|
type: Types_1.ADD_BASE_LINE_ZONE,
|
|
168
168
|
zone: { from: brushData.startX, to: brushData.endX },
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const throttle_1 = __importDefault(require("lodash/throttle"));
|
|
4
8
|
const react_1 = require("react");
|
|
5
9
|
const SpectraManager_1 = require("../../../data/SpectraManager");
|
|
6
10
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
@@ -22,36 +26,37 @@ function DatabaseSpectrum() {
|
|
|
22
26
|
const { jcampURL: jcampRelativeURL, baseURL } = highlight?.sourceData?.extra || [];
|
|
23
27
|
const getSpinner = (0, react_1.useContext)(SpinnerContext_1.spinnerContext);
|
|
24
28
|
const scaleY = (0, react_1.useCallback)(() => (0, scale_1.getYScale)({
|
|
25
|
-
height
|
|
29
|
+
height,
|
|
26
30
|
margin: { top: margin.top, bottom: margin.bottom + marginBottom },
|
|
27
31
|
verticalAlign,
|
|
28
32
|
yDomain,
|
|
29
33
|
}), [height, margin, marginBottom, verticalAlign, yDomain]);
|
|
30
|
-
(0, react_1.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
setPath(path);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
catch (e) {
|
|
51
|
-
alert.error('Failed to Load spectrum');
|
|
34
|
+
const loadSpectrum = (0, react_1.useRef)((0, throttle_1.default)(async (baseURL, jcampRelativeURL) => {
|
|
35
|
+
try {
|
|
36
|
+
setLoading(true);
|
|
37
|
+
const jcampURL = new URL(jcampRelativeURL, baseURL);
|
|
38
|
+
const result = await (0, FileUtility_1.loadFile)(jcampURL);
|
|
39
|
+
const spectra = [];
|
|
40
|
+
(0, SpectraManager_1.addJcamp)(spectra, result, {}, {});
|
|
41
|
+
setLoading(false);
|
|
42
|
+
const spectrum = spectra?.[0] || null;
|
|
43
|
+
if (spectrum) {
|
|
44
|
+
const { x, re: y } = spectrum.data;
|
|
45
|
+
let path = `M ${scaleX()(x[0])} ${scaleY()(y[0])} `;
|
|
46
|
+
path += x.slice(1).reduce((accumulator, point, i) => {
|
|
47
|
+
accumulator += ` L ${scaleX()(point)} ${scaleY()(y[i + 1])}`;
|
|
48
|
+
return accumulator;
|
|
49
|
+
}, '');
|
|
50
|
+
setPath(path);
|
|
52
51
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
alert.error('Failed to Load spectrum');
|
|
55
|
+
}
|
|
56
|
+
}, 250));
|
|
57
|
+
(0, react_1.useEffect)(() => {
|
|
58
|
+
void loadSpectrum.current(baseURL, jcampRelativeURL);
|
|
59
|
+
}, [baseURL, jcampRelativeURL, loadSpectrum]);
|
|
55
60
|
if (highlight.sourceData?.type !== highlight_1.HighlightedSource.DATABASE) {
|
|
56
61
|
return null;
|
|
57
62
|
}
|
|
@@ -19,7 +19,6 @@ const Types_1 = require("../../reducer/types/Types");
|
|
|
19
19
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
20
20
|
const formatNumber_1 = require("../../utility/formatNumber");
|
|
21
21
|
const MultiplicityTree_1 = __importDefault(require("../multiplicityTree/MultiplicityTree"));
|
|
22
|
-
const TempMultiplicityTree_1 = __importDefault(require("../multiplicityTree/TempMultiplicityTree"));
|
|
23
22
|
const stylesOnHover = (0, react_1.css) `
|
|
24
23
|
pointer-events: bounding-box;
|
|
25
24
|
@-moz-document url-prefix() {
|
|
@@ -48,7 +47,7 @@ const stylesHighlighted = (0, react_1.css) `
|
|
|
48
47
|
cursor: pointer;
|
|
49
48
|
}
|
|
50
49
|
`;
|
|
51
|
-
function Range({ rangeData, showMultiplicityTrees, selectedTool,
|
|
50
|
+
function Range({ rangeData, showMultiplicityTrees, selectedTool, relativeFormat, }) {
|
|
52
51
|
const { viewerRef } = (0, GlobalContext_1.useGlobal)();
|
|
53
52
|
const { id, integration, signals } = rangeData;
|
|
54
53
|
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
@@ -111,9 +110,9 @@ function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode,
|
|
|
111
110
|
? 1
|
|
112
111
|
: 0.6, children: integration !== undefined
|
|
113
112
|
? (0, formatNumber_1.formatNumber)(integration, relativeFormat)
|
|
114
|
-
: '' })] })) }, `${id}_${to}_${from}`),
|
|
113
|
+
: '' })] })) }, `${id}_${to}_${from}`), showMultiplicityTrees &&
|
|
115
114
|
signals &&
|
|
116
115
|
signals.length > 0 &&
|
|
117
|
-
signals.map((_signal) => ((0, jsx_runtime_1.jsx)(MultiplicityTree_1.default, { rangeFrom: rangeData.from, rangeTo: rangeData.to, signal: _signal }, _signal.id)))
|
|
116
|
+
signals.map((_signal) => ((0, jsx_runtime_1.jsx)(MultiplicityTree_1.default, { rangeFrom: rangeData.from, rangeTo: rangeData.to, signal: _signal }, _signal.id)))] }, id));
|
|
118
117
|
}
|
|
119
118
|
exports.default = Range;
|
|
@@ -10,13 +10,13 @@ const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
|
10
10
|
const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
|
|
11
11
|
const Range_1 = __importDefault(require("./Range"));
|
|
12
12
|
const RangeIntegral_1 = __importDefault(require("./RangeIntegral"));
|
|
13
|
-
function RangesInner({ ranges, displayerKey, selectedTool,
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, children: ranges?.values?.map((range) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Range_1.default, { rangeData: range, selectedTool: selectedTool, showMultiplicityTrees: showMultiplicityTrees,
|
|
13
|
+
function RangesInner({ ranges, displayerKey, selectedTool, showMultiplicityTrees, showRangesIntegrals, relativeFormat, }) {
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, children: ranges?.values?.map((range) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Range_1.default, { rangeData: range, selectedTool: selectedTool, showMultiplicityTrees: showMultiplicityTrees, relativeFormat: relativeFormat }), showRangesIntegrals && (0, jsx_runtime_1.jsx)(RangeIntegral_1.default, { range: range })] }, range.id))) }));
|
|
15
15
|
}
|
|
16
16
|
const MemoizedRanges = (0, react_1.memo)(RangesInner);
|
|
17
17
|
const empyData = { ranges: {} };
|
|
18
18
|
function Ranges() {
|
|
19
|
-
const { displayerKey, toolOptions: { selectedTool, data: {
|
|
19
|
+
const { displayerKey, toolOptions: { selectedTool, data: { showMultiplicityTrees, showRangesIntegrals }, }, activeTab, } = (0, ChartContext_1.useChartData)();
|
|
20
20
|
const { ranges } = (0, useSpectrum_1.default)(empyData);
|
|
21
21
|
const rangesPreferences = (0, usePanelPreferences_1.usePanelPreferences)('ranges', activeTab);
|
|
22
22
|
return ((0, jsx_runtime_1.jsx)(MemoizedRanges, { ...{
|
|
@@ -25,7 +25,6 @@ function Ranges() {
|
|
|
25
25
|
showRangesIntegrals,
|
|
26
26
|
selectedTool,
|
|
27
27
|
displayerKey,
|
|
28
|
-
editRangeID: tempRange?.id || '',
|
|
29
28
|
relativeFormat: rangesPreferences.relative.format,
|
|
30
29
|
} }));
|
|
31
30
|
}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
|
-
const react_2 = require("react");
|
|
10
9
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
11
10
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
12
11
|
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
@@ -35,12 +34,10 @@ function BaseLineZones() {
|
|
|
35
34
|
const { toolOptions } = (0, ChartContext_1.useChartData)();
|
|
36
35
|
const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
|
|
37
36
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
38
|
-
const deleteRangeHandler = (
|
|
37
|
+
const deleteRangeHandler = (id) => {
|
|
39
38
|
dispatch({ type: Types_1.DELETE_BASE_LINE_ZONE, id });
|
|
40
|
-
}
|
|
41
|
-
const baseLineZones =
|
|
42
|
-
return toolOptions.data.baseLineZones;
|
|
43
|
-
}, [toolOptions]);
|
|
39
|
+
};
|
|
40
|
+
const baseLineZones = toolOptions.data.baselineCorrection.zones;
|
|
44
41
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: baseLineZones.length > 0 && ((0, jsx_runtime_1.jsx)("g", { children: baseLineZones.map((zone) => ((0, jsx_runtime_1.jsxs)("g", { transform: `translate(${scaleX()(zone.to)},0)`, css: styles, children: [(0, jsx_runtime_1.jsx)(DeleteButton_1.default, { x: -20, y: 10, onDelete: () => deleteRangeHandler(zone.id) }), (0, jsx_runtime_1.jsx)("rect", { x: "0", width: `${scaleX()(zone.from) - scaleX()(zone.to)}`, className: "zone-area" })] }, zone.id))) })) }));
|
|
45
42
|
}
|
|
46
43
|
exports.default = BaseLineZones;
|
|
@@ -16,11 +16,7 @@ function ContoursPaths({ id: spectrumID, sign, color, datum, }) {
|
|
|
16
16
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
17
17
|
const { xShift, yShift } = (0, Spectrum2D_1.getShift)(datum);
|
|
18
18
|
const isActive = (0, react_1.useMemo)(() => {
|
|
19
|
-
return activeSpectrum === null
|
|
20
|
-
? true
|
|
21
|
-
: spectrumID === activeSpectrum.id
|
|
22
|
-
? true
|
|
23
|
-
: false;
|
|
19
|
+
return activeSpectrum === null ? true : spectrumID === activeSpectrum.id;
|
|
24
20
|
}, [activeSpectrum, spectrumID]);
|
|
25
21
|
function buildContourPath(data) {
|
|
26
22
|
const _scaleX = (0, scale_1.get2DXScale)({ margin, width, xDomain });
|
|
@@ -16,7 +16,7 @@ function SignalDeltaLine({ delta, axis, show }) {
|
|
|
16
16
|
const scaleX = (0, scale_1.get2DXScale)({ margin, width, xDomain });
|
|
17
17
|
const scaleY = (0, scale_1.get2DYScale)({ margin, height, yDomain });
|
|
18
18
|
const line = (0, react_2.useMemo)(() => {
|
|
19
|
-
return show
|
|
19
|
+
return show ? (axis === 'X' ? ((0, jsx_runtime_1.jsx)("line", { css: lineStyle, x1: scaleX(delta), x2: scaleX(delta), y1: scaleY(yDomain[0]), y2: scaleY(yDomain[1]) }, `signalLine_${delta}_X`)) : axis === 'Y' ? ((0, jsx_runtime_1.jsx)("line", { css: lineStyle, x1: scaleX(xDomain[0]), x2: scaleX(xDomain[1]), y1: scaleY(delta), y2: scaleY(delta) }, `signalLine_${delta}_Y`)) : null) : null;
|
|
20
20
|
}, [axis, delta, scaleX, scaleY, show, xDomain, yDomain]);
|
|
21
21
|
return (0, jsx_runtime_1.jsx)("g", { children: line });
|
|
22
22
|
}
|
|
@@ -129,7 +129,7 @@ function Viewer2D({ emptyText = undefined }) {
|
|
|
129
129
|
}
|
|
130
130
|
}, [selectedTool]);
|
|
131
131
|
if (!isVisible) {
|
|
132
|
-
return ((0, jsx_runtime_1.jsx)(NoData_1.default, { emptyText: "
|
|
132
|
+
return ((0, jsx_runtime_1.jsx)(NoData_1.default, { emptyText: "2D FID spectra can not be displayed yet", canOpenLoader: false, style: { outline: 'none' } }));
|
|
133
133
|
}
|
|
134
134
|
return ((0, jsx_runtime_1.jsx)(react_d3_utils_1.ResponsiveChart, { children: ({ width, height }) => ((0, jsx_runtime_1.jsxs)(ViewerResponsiveWrapper, { width: width, height: height, children: [(0, jsx_runtime_1.jsx)(Spinner_1.default, { isLoading: isLoading, emptyText: emptyText }), data && data.length > 0 && ((0, jsx_runtime_1.jsx)(BrushTracker_1.BrushTracker, { onBrush: handelBrushEnd, onDoubleClick: handelOnDoubleClick, onClick: mouseClick, onZoom: handleZoom, style: {
|
|
135
135
|
width: '100%',
|
|
@@ -63,6 +63,6 @@ function YAxis(props) {
|
|
|
63
63
|
if (!width || !height) {
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)("g", { className: "y", css: axisStyles, transform: `translate(${width - marginProps.right})`, ref: refAxis, children: (0, jsx_runtime_1.jsx)("text", { fill: "#000", x: -marginProps.top, y: -(marginProps.right - 5), dy: "0.71em", transform: "rotate(-90)", textAnchor: "end", children: label }) }));
|
|
67
67
|
}
|
|
68
68
|
exports.default = (0, react_2.memo)(YAxis);
|
|
@@ -22,8 +22,7 @@ function IndicationLines({ axis, show }) {
|
|
|
22
22
|
const nucleus = axis === 'X' ? split[0] : axis === 'Y' ? split[1] : null;
|
|
23
23
|
if (nucleus !== null) {
|
|
24
24
|
const ranges = data
|
|
25
|
-
.filter((_datum) => _datum.display.isVisible ===
|
|
26
|
-
_datum.info.nucleus === nucleus)
|
|
25
|
+
.filter((_datum) => _datum.display.isVisible && _datum.info.nucleus === nucleus)
|
|
27
26
|
.filter(Spectrum1D_1.isSpectrum1D)
|
|
28
27
|
.map((_datum) => _datum.ranges.values)
|
|
29
28
|
.flat();
|
|
@@ -39,7 +38,7 @@ function IndicationLines({ axis, show }) {
|
|
|
39
38
|
}
|
|
40
39
|
}, [activeTab, axis, data, displayerMode]);
|
|
41
40
|
const indicationLines = (0, react_2.useMemo)(() => {
|
|
42
|
-
if (show
|
|
41
|
+
if (show && deltas1D.length > 0) {
|
|
43
42
|
const lines = deltas1D.map((_delta, i) => {
|
|
44
43
|
return axis === 'X' ? ((0, jsx_runtime_1.jsx)("line", { css: lineStyle, x1: scaleX(_delta), x2: scaleX(_delta), y1: scaleY(yDomain[0]), y2: scaleY(yDomain[1]) }, `indicationLine${axis}${i}`)) : axis === 'Y' ? ((0, jsx_runtime_1.jsx)("line", { css: lineStyle, x1: scaleX(xDomain[0]), x2: scaleX(xDomain[1]), y1: scaleY(_delta), y2: scaleY(_delta) }, `indicationLine${axis}${i}`)) : null;
|
|
45
44
|
});
|