nmrium 0.25.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/Chart1D.js +3 -2
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib/component/1d/FooterBanner.js +1 -1
- package/lib/component/1d/Integral.d.ts +2 -1
- package/lib/component/1d/Integral.js +5 -12
- package/lib/component/1d/IntegralResizable.d.ts +2 -1
- package/lib/component/1d/IntegralResizable.js +10 -5
- package/lib/component/1d/IntegralsSeries.js +5 -9
- package/lib/component/1d/Line.d.ts +2 -2
- package/lib/component/1d/PeakAnnotation.js +7 -6
- 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/DatabaseElements.d.ts +3 -0
- package/lib/component/1d/database/DatabaseElements.js +18 -0
- package/lib/component/1d/database/DatabaseSpectrum.d.ts +3 -0
- package/lib/component/1d/database/DatabaseSpectrum.js +60 -0
- package/lib/component/1d/{ResurrectedDatabaseRanges.d.ts → database/ResurrectedDatabaseRanges.d.ts} +0 -0
- package/lib/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
- package/lib/component/1d/jCouplingGraph/JGraph.js +4 -10
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +10 -5
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +5 -5
- package/lib/component/1d/ranges/Range.d.ts +2 -2
- package/lib/component/1d/ranges/Range.js +23 -15
- package/lib/component/1d/ranges/Ranges.js +6 -4
- package/lib/component/1d/tool/BaseLineZones.js +3 -6
- package/lib/component/1d/tool/VerticalIndicator.js +1 -1
- package/lib/component/1d/tool/XLabelPointer.js +1 -1
- package/lib/component/2d/Chart2D.js +2 -1
- package/lib/component/2d/Contours.js +5 -6
- package/lib/component/2d/FooterBanner.js +1 -1
- 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/tools/XYLabelPointer.js +1 -1
- package/lib/component/2d/tools/slicing/HorizontalSliceChart.d.ts +2 -2
- package/lib/component/2d/tools/slicing/SliceScale.d.ts +1 -1
- package/lib/component/2d/tools/slicing/VerticalSliceChart.d.ts +2 -2
- package/lib/component/2d/zones/IndicationLines.js +2 -3
- package/lib/component/2d/zones/Signal.js +8 -8
- package/lib/component/2d/zones/Zone.js +3 -3
- package/lib/component/EventsTrackers/KeysListenerTracker.js +70 -46
- package/lib/component/NMRium.d.ts +15 -46
- package/lib/component/NMRium.js +20 -9
- package/lib/component/SplitPaneWrapper.d.ts +4 -0
- package/lib/component/SplitPaneWrapper.js +8 -0
- package/lib/component/assignment/AssignmentsContext.d.ts +35 -0
- package/lib/component/assignment/AssignmentsContext.js +83 -0
- package/lib/component/assignment/AssignmentsReducer.d.ts +32 -0
- package/lib/component/assignment/AssignmentsReducer.js +39 -0
- package/lib/component/assignment/actions/initAssignment.d.ts +5 -0
- package/lib/component/assignment/actions/initAssignment.js +62 -0
- package/lib/component/assignment/actions/removeAssignment.d.ts +16 -0
- package/lib/component/assignment/actions/removeAssignment.js +24 -0
- package/lib/component/assignment/actions/setActiveAssignment.d.ts +10 -0
- package/lib/component/assignment/actions/setActiveAssignment.js +8 -0
- package/lib/component/assignment/actions/toggleAssignment.d.ts +7 -0
- package/lib/component/assignment/actions/toggleAssignment.js +44 -0
- package/lib/component/assignment/index.d.ts +0 -18
- package/lib/component/assignment/index.js +12 -266
- package/lib/component/assignment/utilities/filterForIDsWithAssignment.d.ts +2 -0
- package/lib/component/assignment/utilities/filterForIDsWithAssignment.js +3 -0
- package/lib/component/context/GlobalContext.d.ts +3 -0
- package/lib/component/context/GlobalContext.js +1 -1
- package/lib/component/context/PreferencesContext.d.ts +15 -52
- package/lib/component/context/PreferencesContext.js +1 -1
- package/lib/component/elements/Button.js +4 -3
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/ContextMenu.d.ts +8 -3
- package/lib/component/elements/EditableColumn.d.ts +3 -2
- package/lib/component/elements/EditableColumn.js +27 -20
- package/lib/component/elements/Input.d.ts +9 -1
- package/lib/component/elements/Input.js +18 -5
- package/lib/component/elements/Logo.js +1 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +5 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +39 -10
- package/lib/component/elements/ReactTable/ReactTable.d.ts +3 -1
- package/lib/component/elements/ReactTable/ReactTable.js +7 -2
- package/lib/component/elements/ReactTable/Style.d.ts +1 -3
- package/lib/component/elements/ReactTable/Style.js +1 -7
- package/lib/component/elements/Select.d.ts +1 -0
- package/lib/component/elements/Select.js +21 -15
- package/lib/component/elements/Tab/Tabs.js +2 -1
- package/lib/component/elements/ToggleButton.d.ts +2 -1
- package/lib/component/elements/ToggleButton.js +4 -4
- package/lib/component/elements/accordion/Accordion.js +2 -6
- package/lib/component/elements/draggble/SVGDraggable.d.ts +17 -0
- package/lib/component/elements/draggble/SVGDraggable.js +33 -0
- package/lib/component/elements/{resizer → draggble}/useDraggable.d.ts +9 -6
- package/lib/component/elements/draggble/useDraggable.js +70 -0
- package/lib/component/elements/formik/FormikColorPicker.d.ts +1 -0
- package/lib/component/elements/formik/FormikColorPicker.js +10 -7
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +5 -4
- package/lib/component/elements/formik/FormikColumnFormatField.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +1 -0
- package/lib/component/elements/formik/FormikInput.js +6 -3
- package/lib/component/elements/formik/FormikSlider.d.ts +1 -0
- package/lib/component/elements/formik/FormikSlider.js +6 -3
- package/lib/component/elements/formik/Input.js +1 -1
- package/lib/component/elements/popup/Alert/Provider.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/resizer/DivResizer.js +17 -62
- package/lib/component/elements/resizer/Resizer.d.ts +3 -1
- package/lib/component/elements/resizer/SVGResizer.js +24 -53
- package/lib/component/elements/resizer/useResizer.d.ts +11 -0
- package/lib/component/elements/resizer/useResizer.js +65 -0
- package/lib/component/elements/toggle/ToggleButtonGroup.js +2 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +8 -5
- 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.d.ts +1 -1
- package/lib/component/hooks/useExport.js +2 -2
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +3 -0
- package/lib/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +4 -14
- package/lib/component/hooks/usePanelPreferences.d.ts +7 -0
- package/lib/component/hooks/usePanelPreferences.js +54 -0
- package/lib/component/hooks/useXYReduce.d.ts +2 -2
- package/lib/component/loader/DefaultSpinnerComponent.d.ts +3 -1
- package/lib/component/loader/DefaultSpinnerComponent.js +2 -2
- 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/loader/SpinnerContext.d.ts +3 -3
- package/lib/component/loader/SpinnerContext.js +2 -2
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -4
- package/lib/component/modal/MoleculeStructureEditorModal.js +24 -3
- package/lib/component/modal/editRange/EditRangeModal.d.ts +3 -3
- package/lib/component/modal/editRange/EditRangeModal.js +52 -56
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +2 -0
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +11 -27
- 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 +5 -2
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +29 -37
- package/lib/component/modal/editZone/SignalsForm.js +1 -1
- package/lib/component/modal/setting/DatabasesTabContent.d.ts +7 -0
- package/lib/component/modal/setting/DatabasesTabContent.js +73 -0
- package/lib/component/modal/setting/DisplayTabContent.js +11 -7
- package/lib/component/modal/setting/FormattingTabContent.js +20 -14
- package/lib/component/modal/setting/GeneralSettings.js +3 -1
- package/lib/component/modal/setting/settingsValidation.d.ts +164 -0
- package/lib/component/modal/setting/settingsValidation.js +48 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +6 -4
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +4 -3
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +13 -6
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.d.ts +10 -0
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +65 -0
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +0 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +14 -19
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -11
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +26 -74
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +8 -0
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +38 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +17 -35
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +11 -3
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +31 -11
- package/lib/component/panels/MoleculesPanel/Utilities.js +61 -68
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +2 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +55 -60
- 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 +3 -3
- package/lib/component/panels/Panels.js +3 -4
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -4
- package/lib/component/panels/PeaksPanel/PeaksPreferences.d.ts +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +29 -82
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +18 -25
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts +2 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +28 -13
- package/lib/component/panels/RangesPanel/RangesPanel.js +23 -29
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +55 -66
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +11 -6
- package/lib/component/panels/RangesPanel/RangesTable.js +3 -7
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +5 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.js +15 -14
- package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts +2 -1
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.d.ts +2 -1
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +16 -9
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +13 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +14 -0
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +4 -4
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +49 -31
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +5 -18
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -3
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.d.ts +18 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.js +18 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +7 -68
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +7 -68
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +6 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +51 -0
- 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 +3 -3
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +7 -9
- 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 +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +5 -7
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +4 -8
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +5 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +5 -9
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +4 -4
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +4 -8
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +14 -14
- package/lib/component/panels/ZonesPanel/ZonesPreferences.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +20 -84
- package/lib/component/panels/ZonesPanel/ZonesTable.js +4 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +7 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +22 -22
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +4 -0
- package/lib/component/panels/databasePanel/DatabasePanel.js +129 -42
- package/lib/component/panels/databasePanel/DatabasePreferences.js +10 -42
- 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 +37 -20
- package/lib/component/panels/extra/placeholder/NoTableData.d.ts +3 -1
- package/lib/component/panels/extra/placeholder/NoTableData.js +2 -2
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -7
- package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts +13 -0
- package/lib/component/panels/extra/preferences/NucleusPreferences.js +22 -0
- package/lib/component/panels/extra/preferences/PreferencesContainer.d.ts +6 -0
- package/lib/component/panels/extra/preferences/PreferencesContainer.js +10 -0
- package/lib/component/panels/extra/preferences/PreferencesGroup.d.ts +7 -0
- package/lib/component/panels/extra/preferences/PreferencesGroup.js +21 -0
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -3
- package/lib/component/panels/header/SpectraAutomaticPickingButton.d.ts +2 -0
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +30 -0
- package/lib/component/reducer/Reducer.d.ts +352 -95
- package/lib/component/reducer/Reducer.js +22 -10
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +9 -0
- package/lib/component/reducer/actions/AssignmentsActions.js +18 -0
- 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/LoadActions.d.ts +1 -1
- package/lib/component/reducer/actions/LoadActions.js +11 -6
- package/lib/component/reducer/actions/MoleculeActions.d.ts +4 -2
- package/lib/component/reducer/actions/MoleculeActions.js +15 -3
- 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 +67 -54
- 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/addWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/addWorkspace.js +19 -0
- package/lib/component/reducer/preferences/actions/initPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/initPreferences.js +60 -0
- package/lib/component/reducer/preferences/actions/removeWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +20 -0
- package/lib/component/reducer/preferences/actions/resetPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/resetPreferences.js +14 -0
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +13 -0
- package/lib/component/reducer/preferences/actions/setPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setPreferences.js +34 -0
- package/lib/component/reducer/preferences/actions/setWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setWorkspace.js +8 -0
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +7 -0
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +55 -0
- package/lib/component/reducer/{preferencesReducer.d.ts → preferences/preferencesReducer.d.ts} +147 -17
- package/lib/component/reducer/preferences/preferencesReducer.js +80 -0
- package/lib/component/reducer/preferences/utilites/checkKeysExists.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/checkKeysExists.js +14 -0
- package/lib/component/reducer/preferences/utilites/filterObject.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/filterObject.js +7 -0
- package/lib/component/reducer/preferences/utilites/flatObject.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/flatObject.js +9 -0
- package/lib/component/reducer/preferences/utilites/getActiveWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/utilites/getActiveWorkspace.js +3 -0
- package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.d.ts +2 -0
- package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +4 -0
- package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.d.ts +5 -0
- package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.js +8 -0
- package/lib/component/reducer/types/Types.d.ts +6 -1
- package/lib/component/reducer/types/Types.js +6 -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/ActionsButton.d.ts +4 -0
- package/lib/component/tool/FloatMoleculeStructures/ActionsButton.js +7 -0
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +14 -0
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +44 -0
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +15 -0
- package/lib/component/tool/FloatMoleculeStructures/index.js +28 -0
- 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 +9 -3
- package/lib/component/utility/PathBuilder.js +2 -1
- package/lib/component/utility/formatNumber.d.ts +3 -0
- package/lib/component/utility/formatNumber.js +12 -0
- package/lib/component/utility/getUniqueNuclei.d.ts +1 -0
- package/lib/component/utility/getUniqueNuclei.js +10 -0
- 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 +79 -5
- package/lib/component/workspaces/basic.js +25 -11
- package/lib/component/workspaces/embedded.d.ts +2 -0
- package/lib/component/workspaces/embedded.js +32 -0
- package/lib/component/workspaces/exercise.js +4 -2
- package/lib/component/workspaces/index.d.ts +1 -0
- package/lib/component/workspaces/index.js +2 -1
- package/lib/component/workspaces/prediction.js +2 -0
- package/lib/component/workspaces/process1D.js +3 -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 +37 -38
- package/lib/data/data1d/Data1DManager.d.ts +1 -1
- package/lib/data/data1d/Data1DManager.js +14 -2
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.js +10 -0
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +8 -10
- package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -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/peaks/mapPeaks.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/generateSpectrumFromRanges.js +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -1
- package/lib/data/data1d/Spectrum1D/toJSON.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/toJSON.js +1 -0
- package/lib/data/data1d/database.d.ts +11 -15
- package/lib/data/data1d/database.js +67 -22
- package/lib/data/data1d/filter1d/absolute.d.ts +3 -2
- package/lib/data/data1d/filter1d/autoPhaseCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/centerMean.d.ts +3 -2
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +3 -2
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +3 -2
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +1 -4
- package/lib/data/data1d/filter1d/exclusionZones.js +4 -4
- package/lib/data/data1d/filter1d/fft.d.ts +3 -2
- package/lib/data/data1d/filter1d/fft.js +2 -2
- package/lib/data/data1d/filter1d/fromTo.d.ts +3 -2
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +3 -2
- package/lib/data/data1d/filter1d/lineBroadening.js +2 -2
- package/lib/data/data1d/filter1d/pareto.d.ts +3 -2
- package/lib/data/data1d/filter1d/pareto.js +2 -2
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/shiftX.d.ts +2 -1
- package/lib/data/data1d/filter1d/standardDeviation.d.ts +3 -2
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +3 -2
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Data2DManager.d.ts +1 -1
- package/lib/data/data2d/Data2DManager.js +6 -1
- package/lib/data/data2d/Processing2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/toJSON.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/toJSON.js +1 -0
- package/lib/data/data2d/filter2d/shiftX.d.ts +4 -3
- package/lib/data/data2d/filter2d/shiftX.js +2 -2
- package/lib/data/data2d/filter2d/shiftY.d.ts +4 -3
- package/lib/data/data2d/filter2d/shiftY.js +2 -2
- package/lib/data/molecules/Molecule.d.ts +6 -7
- package/lib/data/molecules/Molecule.js +9 -1
- package/lib/data/molecules/MoleculeManager.d.ts +4 -1
- package/lib/data/molecules/MoleculeManager.js +33 -2
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/Data1D.d.ts +3 -3
- package/lib/data/types/data1d/Info1D.d.ts +1 -0
- package/lib/data/types/data2d/Signal2DAxisData.d.ts +1 -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/Chart1D.js +3 -2
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +2 -2
- package/lib-cjs/component/1d/Integral.js +5 -12
- package/lib-cjs/component/1d/IntegralResizable.js +10 -5
- package/lib-cjs/component/1d/IntegralsSeries.js +5 -9
- package/lib-cjs/component/1d/PeakAnnotation.js +7 -6
- 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/DatabaseElements.js +23 -0
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +65 -0
- package/lib-cjs/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
- package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +4 -10
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +10 -5
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +6 -6
- package/lib-cjs/component/1d/ranges/Range.js +25 -17
- package/lib-cjs/component/1d/ranges/Ranges.js +6 -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/1d/tool/XLabelPointer.js +2 -2
- package/lib-cjs/component/2d/Chart2D.js +2 -1
- package/lib-cjs/component/2d/Contours.js +5 -6
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- 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/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/zones/IndicationLines.js +2 -3
- package/lib-cjs/component/2d/zones/Signal.js +9 -9
- package/lib-cjs/component/2d/zones/Zone.js +4 -4
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +71 -47
- package/lib-cjs/component/NMRium.js +18 -7
- package/lib-cjs/component/SplitPaneWrapper.js +12 -0
- package/lib-cjs/component/assignment/AssignmentsContext.js +88 -0
- package/lib-cjs/component/assignment/AssignmentsReducer.js +45 -0
- package/lib-cjs/component/assignment/actions/initAssignment.js +65 -0
- package/lib-cjs/component/assignment/actions/removeAssignment.js +29 -0
- package/lib-cjs/component/assignment/actions/setActiveAssignment.js +11 -0
- package/lib-cjs/component/assignment/actions/toggleAssignment.js +47 -0
- package/lib-cjs/component/assignment/index.js +15 -269
- package/lib-cjs/component/assignment/utilities/filterForIDsWithAssignment.js +7 -0
- package/lib-cjs/component/context/GlobalContext.js +1 -1
- package/lib-cjs/component/context/PreferencesContext.js +1 -1
- package/lib-cjs/component/elements/Button.js +4 -3
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +27 -20
- package/lib-cjs/component/elements/Input.js +18 -5
- package/lib-cjs/component/elements/Logo.js +1 -1
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +43 -14
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +7 -2
- package/lib-cjs/component/elements/ReactTable/Style.js +1 -9
- package/lib-cjs/component/elements/Select.js +20 -14
- package/lib-cjs/component/elements/Tab/Tabs.js +2 -1
- package/lib-cjs/component/elements/ToggleButton.js +4 -4
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -6
- package/lib-cjs/component/elements/draggble/SVGDraggable.js +39 -0
- package/lib-cjs/component/elements/draggble/useDraggable.js +73 -0
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +10 -7
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +6 -3
- package/lib-cjs/component/elements/formik/FormikSlider.js +6 -3
- package/lib-cjs/component/elements/formik/Input.js +1 -1
- package/lib-cjs/component/elements/popup/Alert/Provider.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/resizer/DivResizer.js +17 -62
- package/lib-cjs/component/elements/resizer/SVGResizer.js +24 -53
- package/lib-cjs/component/elements/resizer/useResizer.js +71 -0
- package/lib-cjs/component/elements/toggle/ToggleButtonGroup.js +2 -2
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +7 -4
- 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/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +4 -15
- package/lib-cjs/component/hooks/usePanelPreferences.js +62 -0
- package/lib-cjs/component/loader/DefaultSpinnerComponent.js +2 -2
- package/lib-cjs/component/loader/DropZone.js +8 -2
- package/lib-cjs/component/loader/NoData.js +31 -30
- package/lib-cjs/component/loader/SpinnerContext.js +2 -2
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +26 -3
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +50 -54
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +11 -27
- 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 +29 -37
- package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +78 -0
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +11 -7
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +19 -13
- package/lib-cjs/component/modal/setting/GeneralSettings.js +3 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +74 -0
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +6 -4
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +13 -6
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +72 -0
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +13 -18
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -11
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +24 -72
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +44 -0
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +17 -35
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +11 -3
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +61 -68
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +55 -60
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/Panels.js +3 -4
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +5 -5
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +27 -80
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +18 -48
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +27 -12
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +23 -29
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +53 -64
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +3 -7
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +18 -17
- package/lib-cjs/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +16 -0
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +49 -31
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -16
- 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/SpectrumsPanel/base/setting/PlotChart.js +21 -0
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +10 -68
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +10 -68
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +55 -0
- 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 +3 -3
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +8 -10
- 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 +3 -3
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +4 -4
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +14 -14
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +18 -82
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +4 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +23 -23
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +128 -41
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +10 -42
- package/lib-cjs/component/panels/databasePanel/DatabaseStructureSearchModal.js +15 -0
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +36 -19
- package/lib-cjs/component/panels/extra/placeholder/NoTableData.js +2 -2
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -7
- package/lib-cjs/component/panels/extra/preferences/NucleusPreferences.js +29 -0
- package/lib-cjs/component/panels/extra/preferences/PreferencesContainer.js +14 -0
- package/lib-cjs/component/panels/extra/preferences/PreferencesGroup.js +25 -0
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -3
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +37 -0
- package/lib-cjs/component/reducer/Reducer.js +22 -10
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +21 -0
- 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/LoadActions.js +10 -5
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +17 -3
- 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 +64 -74
- package/lib-cjs/component/reducer/helper/getSpectrum.js +18 -0
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +26 -0
- package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +67 -0
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +24 -0
- package/lib-cjs/component/reducer/preferences/actions/resetPreferences.js +18 -0
- package/lib-cjs/component/reducer/preferences/actions/setPanelsPreferences.js +17 -0
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +38 -0
- package/lib-cjs/component/reducer/preferences/actions/setWorkspace.js +12 -0
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +62 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +87 -0
- package/lib-cjs/component/reducer/preferences/utilites/checkKeysExists.js +18 -0
- package/lib-cjs/component/reducer/preferences/utilites/filterObject.js +11 -0
- package/lib-cjs/component/reducer/preferences/utilites/flatObject.js +13 -0
- package/lib-cjs/component/reducer/preferences/utilites/getActiveWorkspace.js +7 -0
- package/lib-cjs/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +11 -0
- package/lib-cjs/component/reducer/preferences/utilites/mapNucleiFormatting.js +12 -0
- package/lib-cjs/component/reducer/types/Types.js +9 -4
- 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/ActionsButton.js +13 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +51 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +36 -0
- 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 +10 -3
- package/lib-cjs/component/utility/PathBuilder.js +2 -1
- package/lib-cjs/component/utility/formatNumber.js +19 -0
- package/lib-cjs/component/utility/getUniqueNuclei.js +14 -0
- 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 +25 -11
- package/lib-cjs/component/workspaces/embedded.js +35 -0
- package/lib-cjs/component/workspaces/exercise.js +4 -2
- package/lib-cjs/component/workspaces/index.js +2 -1
- package/lib-cjs/component/workspaces/prediction.js +2 -0
- package/lib-cjs/component/workspaces/process1D.js +3 -1
- package/lib-cjs/data/FiltersManager.js +1 -1
- package/lib-cjs/data/PredictionManager.js +7 -9
- package/lib-cjs/data/SpectraManager.js +37 -38
- package/lib-cjs/data/data1d/Data1DManager.js +14 -2
- package/lib-cjs/data/data1d/Spectrum1D/convertDataToFloat64Array.js +14 -0
- 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/initiateDatum1D.js +2 -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/peaks/mapPeaks.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/generateSpectrumFromRanges.js +2 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/toJSON.js +1 -0
- package/lib-cjs/data/data1d/database.js +67 -23
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +4 -4
- package/lib-cjs/data/data1d/filter1d/fft.js +2 -2
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +2 -2
- package/lib-cjs/data/data1d/filter1d/pareto.js +2 -2
- package/lib-cjs/data/data1d/filter1d/shiftX.js +2 -2
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Data2DManager.js +6 -1
- package/lib-cjs/data/data2d/Processing2D.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/toJSON.js +1 -0
- package/lib-cjs/data/data2d/filter2d/shiftX.js +4 -4
- package/lib-cjs/data/data2d/filter2d/shiftY.js +4 -4
- package/lib-cjs/data/molecules/Molecule.js +9 -1
- package/lib-cjs/data/molecules/MoleculeManager.js +37 -3
- 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 +53 -51
- package/lib/component/1d/multiplicityTree/TempMultiplicityTree.d.ts +0 -2
- package/lib/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -14
- package/lib/component/elements/resizer/useDraggable.js +0 -52
- package/lib/component/panels/extra/preferences/defaultValues.d.ts +0 -54
- package/lib/component/panels/extra/preferences/defaultValues.js +0 -54
- package/lib/component/reducer/preferencesReducer.js +0 -272
- package/lib/component/utility/FormatNumber.d.ts +0 -6
- package/lib-cjs/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -20
- package/lib-cjs/component/elements/resizer/useDraggable.js +0 -55
- package/lib-cjs/component/panels/extra/preferences/defaultValues.js +0 -61
- package/lib-cjs/component/reducer/preferencesReducer.js +0 -279
|
@@ -1,14 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Range } from '../../../data/types/data1d';
|
|
2
|
+
import { Zone } from '../../../data/types/data2d';
|
|
3
|
+
import { AssignmentContext, Axis } from '../../assignment/AssignmentsContext';
|
|
4
|
+
interface Atom {
|
|
5
|
+
oclID: string;
|
|
6
|
+
atomLabel: string;
|
|
6
7
|
nbAtoms: number;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
nbHydrogens: number;
|
|
9
|
+
hydrogenOCLIDs: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface AtomData {
|
|
12
|
+
oclIDs: string[];
|
|
13
|
+
nbAtoms: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns the OCL id(s) and number of atoms of an atom when hovering over
|
|
17
|
+
* or clicking on it. This is depending on an optional given axis.
|
|
18
|
+
* In case of an heavy atom with bonded hydrogens the OCL id(s)
|
|
19
|
+
* and number of these hydrogens are added as well.
|
|
20
|
+
*
|
|
21
|
+
* @param {Atom} atom - atom returned by OCLnmr component
|
|
22
|
+
* @param {string} activeTab - active tab
|
|
23
|
+
* @param {Axis} axis - current axis
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
export declare function extractFromAtom(atom: Atom, activeTab: string, axis?: Axis | null): AtomData;
|
|
27
|
+
export declare function findDatumAndSignalIndex(data: (Range | Zone)[], id: string): {
|
|
28
|
+
datum: Zone | Range | undefined;
|
|
10
29
|
signalIndex: any;
|
|
11
30
|
};
|
|
12
|
-
export declare function getHighlightsOnHover(
|
|
13
|
-
export declare function getCurrentDiaIDsToHighlight(assignmentData:
|
|
14
|
-
export declare function toggleDiaIDs(
|
|
31
|
+
export declare function getHighlightsOnHover(assignments: AssignmentContext, oclIDs: any, data: any): string[];
|
|
32
|
+
export declare function getCurrentDiaIDsToHighlight(assignmentData: AssignmentContext): string[];
|
|
33
|
+
export declare function toggleDiaIDs(diaIDs: string[], atomInformation: AtomData): (number | string[])[];
|
|
34
|
+
export {};
|
|
@@ -1,110 +1,103 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
function getElements(activeTab) {
|
|
2
|
+
const nuclei = activeTab.split(',');
|
|
3
|
+
return nuclei.map((nucleus) => nucleus.replace(/[0-9]/g, ''));
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Returns the OCL id(s) and number of atoms of an atom when hovering over
|
|
7
|
+
* or clicking on it. This is depending on an optional given axis.
|
|
8
|
+
* In case of an heavy atom with bonded hydrogens the OCL id(s)
|
|
9
|
+
* and number of these hydrogens are added as well.
|
|
10
|
+
*
|
|
11
|
+
* @param {Atom} atom - atom returned by OCLnmr component
|
|
12
|
+
* @param {string} activeTab - active tab
|
|
13
|
+
* @param {Axis} axis - current axis
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export function extractFromAtom(atom, activeTab, axis) {
|
|
17
|
+
const elements = getElements(activeTab);
|
|
3
18
|
if (elements.length > 0 && Object.keys(atom).length > 0) {
|
|
4
|
-
const dim =
|
|
5
|
-
|
|
6
|
-
|
|
19
|
+
const dim = axis === 'x' ? 0 : axis === 'y' ? 1 : null;
|
|
20
|
+
switch (dim !== null && elements[dim]) {
|
|
21
|
+
case atom.atomLabel: {
|
|
7
22
|
// take always oclID if atom type is same as element of activeTab)
|
|
8
23
|
return { oclIDs: [atom.oclID], nbAtoms: atom.nbAtoms };
|
|
9
24
|
}
|
|
10
|
-
|
|
25
|
+
case 'H': {
|
|
11
26
|
// if we are in proton spectrum and use then the IDs of attached hydrogens of an atom
|
|
12
27
|
return {
|
|
13
28
|
oclIDs: atom.hydrogenOCLIDs,
|
|
14
29
|
nbAtoms: atom.nbAtoms * atom.nbHydrogens,
|
|
15
30
|
};
|
|
16
31
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
32
|
+
default:
|
|
33
|
+
return {
|
|
34
|
+
oclIDs: [atom.oclID].concat(atom.hydrogenOCLIDs),
|
|
35
|
+
nbAtoms: atom.nbAtoms + atom.nbAtoms * atom.nbHydrogens,
|
|
36
|
+
};
|
|
23
37
|
}
|
|
24
38
|
}
|
|
25
39
|
return { oclIDs: [], nbAtoms: 0 };
|
|
26
40
|
}
|
|
27
|
-
export function findDatumAndSignalIndex(
|
|
41
|
+
export function findDatumAndSignalIndex(data, id) {
|
|
28
42
|
// if datum could be found then the id is on range/zone level
|
|
29
|
-
let datum =
|
|
43
|
+
let datum = data.find((_datum) => _datum.id === id);
|
|
30
44
|
let signalIndex;
|
|
31
45
|
if (!datum) {
|
|
32
46
|
// figure out the datum via id
|
|
33
|
-
for (const
|
|
34
|
-
signalIndex =
|
|
47
|
+
for (const record of data) {
|
|
48
|
+
signalIndex = record.signals.findIndex((signal) => signal.id === id);
|
|
35
49
|
if (signalIndex >= 0) {
|
|
36
|
-
datum =
|
|
50
|
+
datum = record;
|
|
37
51
|
break;
|
|
38
52
|
}
|
|
39
53
|
}
|
|
40
54
|
}
|
|
41
55
|
return { datum, signalIndex };
|
|
42
56
|
}
|
|
43
|
-
export function getHighlightsOnHover(
|
|
57
|
+
export function getHighlightsOnHover(assignments, oclIDs, data) {
|
|
44
58
|
// set all IDs to highlight when hovering over an atom from assignment data
|
|
45
59
|
let highlights = [];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
datum = result.datum;
|
|
60
|
-
signalIndex = result.signalIndex;
|
|
61
|
-
stop = true;
|
|
62
|
-
}
|
|
63
|
-
if (datum) {
|
|
64
|
-
highlights.push(datum.id);
|
|
65
|
-
if (signalIndex !== undefined) {
|
|
66
|
-
highlights.push(datum.signals[signalIndex].id);
|
|
60
|
+
const assignmentsByKey = assignments.data.assignments;
|
|
61
|
+
for (const key in assignmentsByKey) {
|
|
62
|
+
const assignments = assignmentsByKey[key];
|
|
63
|
+
for (const axis in assignments) {
|
|
64
|
+
if (assignments[axis]?.some((oclKey) => oclIDs.includes(oclKey))) {
|
|
65
|
+
highlights = highlights.concat(assignments[axis]);
|
|
66
|
+
const { datum, signalIndex } = findDatumAndSignalIndex(data, key);
|
|
67
|
+
if (datum) {
|
|
68
|
+
highlights.push(datum.id);
|
|
69
|
+
if (signalIndex !== undefined) {
|
|
70
|
+
highlights.push(datum.signals[signalIndex].id);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
67
73
|
}
|
|
68
74
|
}
|
|
69
|
-
if (stop) {
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
75
|
}
|
|
73
76
|
return highlights;
|
|
74
77
|
}
|
|
75
|
-
export function getCurrentDiaIDsToHighlight(assignmentData
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
: displayerMode === DISPLAYER_MODE.DM_2D
|
|
86
|
-
? axisOnHover
|
|
87
|
-
? axisOnHover === 'x'
|
|
88
|
-
? assignmentOnHover.x || []
|
|
89
|
-
: axisOnHover === 'y'
|
|
90
|
-
? assignmentOnHover.y || []
|
|
91
|
-
: (assignmentOnHover.x || []).concat(assignmentOnHover.y || [])
|
|
92
|
-
: (assignmentOnHover.x || []).concat(assignmentOnHover.y || [])
|
|
93
|
-
: []
|
|
94
|
-
: [];
|
|
78
|
+
export function getCurrentDiaIDsToHighlight(assignmentData) {
|
|
79
|
+
const { highlighted, assignments } = assignmentData.data;
|
|
80
|
+
const assignment = highlighted ? assignments[highlighted.id] : null;
|
|
81
|
+
const axisHover = highlighted ? highlighted.axis : null;
|
|
82
|
+
if (axisHover && assignment && assignment[axisHover]) {
|
|
83
|
+
return assignment[axisHover];
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
return (assignment?.x || []).concat(assignment?.y || []);
|
|
87
|
+
}
|
|
95
88
|
}
|
|
96
|
-
export function toggleDiaIDs(
|
|
97
|
-
let
|
|
89
|
+
export function toggleDiaIDs(diaIDs, atomInformation) {
|
|
90
|
+
let _diaIDs = diaIDs ? diaIDs.slice() : [];
|
|
98
91
|
const { nbAtoms, oclIDs } = atomInformation;
|
|
99
92
|
let tempNbAtoms = nbAtoms;
|
|
100
93
|
oclIDs.forEach((_oclID) => {
|
|
101
|
-
if (
|
|
94
|
+
if (_diaIDs.includes(_oclID)) {
|
|
102
95
|
tempNbAtoms *= -1;
|
|
103
|
-
|
|
96
|
+
_diaIDs = _diaIDs.filter((_id) => _id !== _oclID);
|
|
104
97
|
}
|
|
105
98
|
else {
|
|
106
|
-
|
|
99
|
+
_diaIDs.push(_oclID);
|
|
107
100
|
}
|
|
108
101
|
});
|
|
109
|
-
return [
|
|
102
|
+
return [_diaIDs, tempNbAtoms];
|
|
110
103
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function useAtomAssignment({ displayerMode, activeTab, zones, ranges, }: {
|
|
1
|
+
export default function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }: {
|
|
2
2
|
displayerMode: any;
|
|
3
3
|
activeTab: any;
|
|
4
4
|
zones: any;
|
|
@@ -6,6 +6,6 @@ export default function useAtomAssignment({ displayerMode, activeTab, zones, ran
|
|
|
6
6
|
}): {
|
|
7
7
|
handleOnAtomHover: (atom: any) => void;
|
|
8
8
|
handleOnClickAtom: (atom: any, event: any) => void;
|
|
9
|
-
currentDiaIDsToHighlight:
|
|
9
|
+
currentDiaIDsToHighlight: string[];
|
|
10
10
|
assignedDiaIDsMerged: any[];
|
|
11
11
|
};
|
|
@@ -1,35 +1,24 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import { ConcatenationString } from '../../../data/utilities/Concatenation';
|
|
3
3
|
import checkModifierKeyActivated from '../../../data/utilities/checkModifierKeyActivated';
|
|
4
|
-
import {
|
|
4
|
+
import { useAssignment, useAssignmentData, } from '../../assignment/AssignmentsContext';
|
|
5
|
+
import { filterForIDsWithAssignment } from '../../assignment/utilities/filterForIDsWithAssignment';
|
|
5
6
|
import { useDispatch } from '../../context/DispatchContext';
|
|
6
7
|
import { useAlert } from '../../elements/popup/Alert';
|
|
7
8
|
import { HighlightedSource, useHighlightData } from '../../highlight';
|
|
8
9
|
import { DISPLAYER_MODE } from '../../reducer/core/Constants';
|
|
9
10
|
import { SET_DIAID_RANGE, SET_DIAID_ZONE } from '../../reducer/types/Types';
|
|
10
11
|
import { extractFromAtom, findDatumAndSignalIndex, getCurrentDiaIDsToHighlight, getHighlightsOnHover, toggleDiaIDs, } from './Utilities';
|
|
11
|
-
export default function useAtomAssignment({ displayerMode, activeTab, zones, ranges, }) {
|
|
12
|
+
export default function useAtomAssignment({ displayerMode, activeTab: nucleus, zones, ranges, }) {
|
|
12
13
|
const alert = useAlert();
|
|
13
14
|
const dispatch = useDispatch();
|
|
14
15
|
const highlightData = useHighlightData();
|
|
15
|
-
const
|
|
16
|
-
const activeAssignment = useAssignment(
|
|
17
|
-
?
|
|
16
|
+
const assignments = useAssignmentData();
|
|
17
|
+
const activeAssignment = useAssignment(assignments.data.activated
|
|
18
|
+
? assignments.data.activated.id
|
|
18
19
|
: ConcatenationString);
|
|
19
20
|
const [onAtomHoverHighlights, setOnAtomHoverHighlights] = useState([]);
|
|
20
21
|
const [onAtomHoverAction, setOnAtomHoverAction] = useState(null);
|
|
21
|
-
const [elements, setElements] = useState([]);
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (activeTab) {
|
|
24
|
-
const split = activeTab.split(',');
|
|
25
|
-
if (split.length === 1) {
|
|
26
|
-
setElements([activeTab.replace(/[0-9]/g, '')]);
|
|
27
|
-
}
|
|
28
|
-
else if (split.length === 2) {
|
|
29
|
-
setElements(split.map((nucleus) => nucleus.replace(/[0-9]/g, '')));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}, [activeTab]);
|
|
33
22
|
useEffect(() => {
|
|
34
23
|
if (onAtomHoverAction) {
|
|
35
24
|
if (onAtomHoverAction === 'show') {
|
|
@@ -63,23 +52,24 @@ export default function useAtomAssignment({ displayerMode, activeTab, zones, ran
|
|
|
63
52
|
}, [displayerMode, ranges, zones]);
|
|
64
53
|
const assignedDiaIDs = useMemo(() => {
|
|
65
54
|
const assignedDiaID = { x: [], y: [] };
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
const assignment = assignments.data.assignments;
|
|
56
|
+
for (let id in assignment) {
|
|
57
|
+
if (assignment[id].x) {
|
|
58
|
+
assignedDiaID.x.push(...assignment[id].x);
|
|
69
59
|
}
|
|
70
|
-
if (
|
|
71
|
-
assignedDiaID.y.push(...
|
|
60
|
+
if (assignment[id].y) {
|
|
61
|
+
assignedDiaID.y.push(...assignment[id].y);
|
|
72
62
|
}
|
|
73
63
|
}
|
|
74
64
|
// with its structure it's prepared for showing assigned IDs per axis
|
|
75
65
|
return assignedDiaID;
|
|
76
|
-
}, [
|
|
66
|
+
}, [assignments.data]);
|
|
77
67
|
// used for atom highlighting for now, until we would like to highlight atoms per axis separately
|
|
78
68
|
const assignedDiaIDsMerged = useMemo(() => assignedDiaIDs.x.concat(assignedDiaIDs.y), [assignedDiaIDs.x, assignedDiaIDs.y]);
|
|
79
69
|
const currentDiaIDsToHighlight = useMemo(() => {
|
|
80
70
|
let highlights = [];
|
|
81
71
|
highlightData.highlight.highlighted.forEach((highlightID) => {
|
|
82
|
-
const temp =
|
|
72
|
+
const temp = assignments.data.assignments[highlightID];
|
|
83
73
|
if (temp) {
|
|
84
74
|
const { datum } = findDatumAndSignalIndex(data, highlightID);
|
|
85
75
|
const type = highlightData.highlight.sourceData?.type;
|
|
@@ -87,56 +77,51 @@ export default function useAtomAssignment({ displayerMode, activeTab, zones, ran
|
|
|
87
77
|
(type === HighlightedSource.ZONE || type === HighlightedSource.RANGE)) {
|
|
88
78
|
// we are on range/zone level only, so add the belonging signal IDs to highlight too
|
|
89
79
|
highlights = highlights.concat(datum.signals
|
|
90
|
-
.map((signal) => filterForIDsWithAssignment(
|
|
91
|
-
0
|
|
80
|
+
.map((signal) => filterForIDsWithAssignment(assignments, [signal.id]).length > 0
|
|
92
81
|
? signal.diaIDs
|
|
93
82
|
: [])
|
|
94
83
|
.flat());
|
|
95
84
|
}
|
|
96
85
|
}
|
|
97
86
|
});
|
|
98
|
-
return getCurrentDiaIDsToHighlight(
|
|
99
|
-
}, [
|
|
87
|
+
return getCurrentDiaIDsToHighlight(assignments).concat(highlights);
|
|
88
|
+
}, [
|
|
89
|
+
assignments,
|
|
90
|
+
data,
|
|
91
|
+
highlightData.highlight.highlighted,
|
|
92
|
+
highlightData.highlight.sourceData?.type,
|
|
93
|
+
]);
|
|
100
94
|
const toggleAssignment = useCallback((diaID, atomInformation) => {
|
|
101
95
|
// a previous version of the code prevented to assign many time the same atom
|
|
102
96
|
// see revision cc13abc18f77b6787b923e3c4edaef51750d9e90
|
|
103
97
|
return toggleDiaIDs(diaID, atomInformation);
|
|
104
98
|
}, []);
|
|
105
99
|
const handleOnClickAtom = useCallback((atom, event) => {
|
|
106
|
-
if (!checkModifierKeyActivated(event)) {
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
if (!checkModifierKeyActivated(event) && activeAssignment.activated) {
|
|
101
|
+
const { axis, id } = activeAssignment.activated;
|
|
102
|
+
if (id && axis) {
|
|
103
|
+
const atomInformation = extractFromAtom(atom, nucleus, axis);
|
|
109
104
|
if (atomInformation.nbAtoms > 0) {
|
|
110
105
|
// save assignment in assignment hook
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
const dimension = displayerMode === DISPLAYER_MODE.DM_1D ? '1D' : '2D';
|
|
107
|
+
activeAssignment.toggle(atomInformation.oclIDs, dimension);
|
|
108
|
+
// console.log(activeAssignment);
|
|
114
109
|
// save assignment (diaIDs) in range/zone data
|
|
115
110
|
const { datum, signalIndex } = findDatumAndSignalIndex(data, activeAssignment.id);
|
|
116
111
|
if (datum) {
|
|
117
112
|
// determine the level of setting the diaIDs array (range vs. signal level) and save there
|
|
118
|
-
let
|
|
119
|
-
let nbAtoms = 0;
|
|
113
|
+
// let nbAtoms = 0;
|
|
120
114
|
// on range/zone level
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
[_diaID, nbAtoms] = toggleAssignment(datum[activeAssignment.activeAxis].diaIDs || [], atomInformation);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
else if (datum.signals?.[signalIndex]) {
|
|
130
|
-
// on signal level
|
|
131
|
-
if (displayerMode === DISPLAYER_MODE.DM_1D) {
|
|
132
|
-
[_diaID, nbAtoms] = toggleAssignment(datum.signals[signalIndex].diaIDs || [], atomInformation);
|
|
115
|
+
if (displayerMode === DISPLAYER_MODE.DM_1D) {
|
|
116
|
+
const range = datum;
|
|
117
|
+
let _diaIDs = [];
|
|
118
|
+
if (signalIndex === undefined) {
|
|
119
|
+
_diaIDs = range?.diaIDs || [];
|
|
133
120
|
}
|
|
134
|
-
else
|
|
135
|
-
|
|
136
|
-
.diaIDs || [], atomInformation);
|
|
121
|
+
else {
|
|
122
|
+
_diaIDs = range?.signals[signalIndex]?.diaIDs || [];
|
|
137
123
|
}
|
|
138
|
-
|
|
139
|
-
if (displayerMode === DISPLAYER_MODE.DM_1D) {
|
|
124
|
+
const [_diaID, nbAtoms] = toggleAssignment(_diaIDs, atomInformation);
|
|
140
125
|
dispatch({
|
|
141
126
|
type: SET_DIAID_RANGE,
|
|
142
127
|
payload: {
|
|
@@ -147,20 +132,29 @@ export default function useAtomAssignment({ displayerMode, activeTab, zones, ran
|
|
|
147
132
|
},
|
|
148
133
|
});
|
|
149
134
|
}
|
|
150
|
-
else
|
|
135
|
+
else {
|
|
136
|
+
const zone = datum;
|
|
137
|
+
let _diaIDs = [];
|
|
138
|
+
if (signalIndex === undefined) {
|
|
139
|
+
_diaIDs = zone[axis]?.diaIDs || [];
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
_diaIDs = zone?.signals[signalIndex][axis]?.diaIDs || [];
|
|
143
|
+
}
|
|
144
|
+
const [_diaID, nbAtoms] = toggleAssignment(_diaIDs, atomInformation);
|
|
151
145
|
dispatch({
|
|
152
146
|
type: SET_DIAID_ZONE,
|
|
153
147
|
payload: {
|
|
154
148
|
nbAtoms,
|
|
155
149
|
zoneData: datum,
|
|
156
150
|
diaIDs: _diaID,
|
|
157
|
-
axis
|
|
151
|
+
axis,
|
|
158
152
|
signalIndex,
|
|
159
153
|
},
|
|
160
154
|
});
|
|
161
155
|
}
|
|
162
156
|
}
|
|
163
|
-
activeAssignment.
|
|
157
|
+
activeAssignment.setActive(axis);
|
|
164
158
|
}
|
|
165
159
|
else {
|
|
166
160
|
alert.info('Not assigned! Different atom type or no attached hydrogens found!');
|
|
@@ -173,15 +167,15 @@ export default function useAtomAssignment({ displayerMode, activeTab, zones, ran
|
|
|
173
167
|
data,
|
|
174
168
|
dispatch,
|
|
175
169
|
displayerMode,
|
|
176
|
-
|
|
170
|
+
nucleus,
|
|
177
171
|
toggleAssignment,
|
|
178
172
|
]);
|
|
179
173
|
const handleOnAtomHover = useCallback((atom) => {
|
|
180
|
-
const oclIDs = extractFromAtom(atom,
|
|
174
|
+
const { oclIDs } = extractFromAtom(atom, nucleus);
|
|
181
175
|
// on enter the atom
|
|
182
176
|
if (oclIDs.length > 0) {
|
|
183
177
|
// set all IDs to highlight when hovering over an atom from assignment data
|
|
184
|
-
const highlights = getHighlightsOnHover(
|
|
178
|
+
const highlights = getHighlightsOnHover(assignments, oclIDs, data);
|
|
185
179
|
setOnAtomHoverHighlights(highlights);
|
|
186
180
|
setOnAtomHoverAction('show');
|
|
187
181
|
}
|
|
@@ -189,7 +183,8 @@ export default function useAtomAssignment({ displayerMode, activeTab, zones, ran
|
|
|
189
183
|
// on leave the atom
|
|
190
184
|
setOnAtomHoverAction('hide');
|
|
191
185
|
}
|
|
192
|
-
|
|
186
|
+
// }
|
|
187
|
+
}, [assignments, data, nucleus]);
|
|
193
188
|
return {
|
|
194
189
|
handleOnAtomHover,
|
|
195
190
|
handleOnClickAtom,
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { useFormikContext } from 'formik';
|
|
4
4
|
import { memo, useEffect, useState } from 'react';
|
|
5
|
-
import
|
|
5
|
+
import evaluate from '../../utility/Evaluate';
|
|
6
6
|
const initCode = `function run(data) {
|
|
7
7
|
|
|
8
8
|
return JSON.stringify(data,undefined, 2);
|
|
@@ -14,7 +14,7 @@ function MultipleAnalysisCodeEditor({ data }) {
|
|
|
14
14
|
const [code, setCode] = useState(values.code ? values.code : initCode);
|
|
15
15
|
const [result, setResult] = useState('');
|
|
16
16
|
useEffect(() => {
|
|
17
|
-
const evalResult =
|
|
17
|
+
const evalResult = evaluate(code, data);
|
|
18
18
|
if (evalResult instanceof Error) {
|
|
19
19
|
setResult(evalResult.message);
|
|
20
20
|
}
|
|
@@ -4,16 +4,16 @@ import { useMemo, memo, useCallback, Fragment } from 'react';
|
|
|
4
4
|
import { useDispatch } from '../../context/DispatchContext';
|
|
5
5
|
import ReactTable from '../../elements/ReactTable/ReactTable';
|
|
6
6
|
import addCustomColumn from '../../elements/ReactTable/utility/addCustomColumn';
|
|
7
|
+
import { useFormatNumberByNucleus } from '../../hooks/useFormatNumberByNucleus';
|
|
7
8
|
import { FILTER_SPECTRA_COLUMN } from '../../reducer/types/Types';
|
|
8
|
-
import
|
|
9
|
-
import { useFormatNumberByNucleus } from '../../utility/FormatNumber';
|
|
9
|
+
import evaluate from '../../utility/Evaluate';
|
|
10
10
|
import NoTableData from '../extra/placeholder/NoTableData';
|
|
11
11
|
import ColumnHeader from './ColumnHeader';
|
|
12
12
|
function MultipleSpectraAnalysisTable({ data, activeTab, }) {
|
|
13
13
|
const format = useFormatNumberByNucleus(activeTab);
|
|
14
14
|
const codeEvaluation = useMemo(() => {
|
|
15
15
|
const code = lodashGet(data, 'code', '');
|
|
16
|
-
return
|
|
16
|
+
return evaluate(code, data);
|
|
17
17
|
}, [data]);
|
|
18
18
|
const dispatch = useDispatch();
|
|
19
19
|
const columnFilterHandler = useCallback((columnKey, valueKey) => {
|
|
@@ -90,7 +90,7 @@ const accordionItems = [
|
|
|
90
90
|
mode: null,
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
|
-
title: '
|
|
93
|
+
title: 'Databases',
|
|
94
94
|
component: _jsx(DatabasePanel, {}),
|
|
95
95
|
hidePreferenceKey: 'databasePanel',
|
|
96
96
|
mode: null,
|
|
@@ -98,9 +98,8 @@ const accordionItems = [
|
|
|
98
98
|
{
|
|
99
99
|
title: 'Automatic Assignment',
|
|
100
100
|
component: _jsx(AutomaticAssignment, {}),
|
|
101
|
-
hidePreferenceKey: '',
|
|
101
|
+
hidePreferenceKey: 'automaticAssignmentPanel',
|
|
102
102
|
mode: null,
|
|
103
|
-
isExperimental: true,
|
|
104
103
|
},
|
|
105
104
|
{
|
|
106
105
|
title: 'Prediction',
|
|
@@ -129,7 +128,7 @@ function PanelsInner({ displayerMode: displayedMode }) {
|
|
|
129
128
|
const check = useCallback((item) => {
|
|
130
129
|
const panelOptions = getPanelPreferences(item);
|
|
131
130
|
return ((panelOptions?.hidden !== true &&
|
|
132
|
-
panelOptions?.display
|
|
131
|
+
panelOptions?.display &&
|
|
133
132
|
item.isExperimental === undefined &&
|
|
134
133
|
(item.mode == null || item.mode === displayedMode)) ||
|
|
135
134
|
(item.isExperimental && isExperimental));
|
|
@@ -6,15 +6,15 @@ import { useChartData } from '../../context/ChartContext';
|
|
|
6
6
|
import { useDispatch } from '../../context/DispatchContext';
|
|
7
7
|
import { usePreferences } from '../../context/PreferencesContext';
|
|
8
8
|
import { useModal } from '../../elements/popup/Modal';
|
|
9
|
+
import { useFormatNumberByNucleus } from '../../hooks/useFormatNumberByNucleus';
|
|
9
10
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
10
11
|
import { DELETE_PEAK_NOTATION } from '../../reducer/types/Types';
|
|
11
|
-
import { useFormatNumberByNucleus } from '../../utility/FormatNumber';
|
|
12
12
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
13
13
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
14
14
|
import PreferencesHeader from '../header/PreferencesHeader';
|
|
15
15
|
import PeaksPreferences from './PeaksPreferences';
|
|
16
16
|
import PeaksTable from './PeaksTable';
|
|
17
|
-
function PeaksPanelInner({ peaks, info, xDomain, activeTab,
|
|
17
|
+
function PeaksPanelInner({ peaks, info, xDomain, activeTab, }) {
|
|
18
18
|
const [filterIsActive, setFilterIsActive] = useState(false);
|
|
19
19
|
const [isFlipped, setFlipStatus] = useState(false);
|
|
20
20
|
const format = useFormatNumberByNucleus(info.nucleus);
|
|
@@ -54,7 +54,7 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, preferences, }) {
|
|
|
54
54
|
.map((peak) => {
|
|
55
55
|
const value = Number(format(peak.x));
|
|
56
56
|
return {
|
|
57
|
-
value
|
|
57
|
+
value,
|
|
58
58
|
valueHz: info?.originFrequency
|
|
59
59
|
? Number(value) * info.originFrequency
|
|
60
60
|
: '',
|
|
@@ -79,7 +79,7 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, preferences, }) {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
`,
|
|
82
|
-
], children: [!isFlipped && (_jsx(DefaultPanelHeader, { counter: peaks?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Peaks", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all peaks' : 'Hide peaks out of view', filterIsActive: filterIsActive, counterFiltered: filteredPeaks.length, showSettingButton: true, onSettingClick: settingsPanelHandler })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(PeaksTable, { data: filteredPeaks, activeTab: activeTab
|
|
82
|
+
], children: [!isFlipped && (_jsx(DefaultPanelHeader, { counter: peaks?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Peaks", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all peaks' : 'Hide peaks out of view', filterIsActive: filterIsActive, counterFiltered: filteredPeaks.length, showSettingButton: true, onSettingClick: settingsPanelHandler })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(PeaksTable, { data: filteredPeaks, activeTab: activeTab })) : (_jsx(PeaksPreferences, { ref: settingRef })) })] }));
|
|
83
83
|
}
|
|
84
84
|
const MemoizedPeaksPanel = memo(PeaksPanelInner);
|
|
85
85
|
const emptyData = { peaks: null, info: {} };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const _default: import("react").ForwardRefExoticComponent<Pick<any, string | number | symbol> & import("react").RefAttributes<unknown
|
|
2
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<any, string | number | symbol> & import("react").RefAttributes<unknown>>>;
|
|
3
3
|
export default _default;
|