nmrium 0.24.1 → 0.27.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/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 +21 -16
- package/lib/component/1d/IntegralsSeries.js +3 -3
- package/lib/component/1d/Line.d.ts +2 -2
- package/lib/component/1d/PeakAnnotation.js +5 -4
- 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 +58 -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 +36 -32
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +5 -5
- package/lib/component/1d/ranges/Range.d.ts +2 -1
- package/lib/component/1d/ranges/Range.js +38 -39
- package/lib/component/1d/ranges/Ranges.js +6 -3
- package/lib/component/1d/tool/XLabelPointer.js +1 -1
- package/lib/component/2d/Chart2D.js +2 -1
- package/lib/component/2d/Contours.js +4 -1
- package/lib/component/2d/FooterBanner.js +1 -1
- 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/Signal.js +8 -8
- package/lib/component/2d/zones/Zone.js +3 -3
- package/lib/component/EventsTrackers/KeysListenerTracker.js +11 -5
- package/lib/component/NMRium.d.ts +5 -1
- package/lib/component/NMRium.js +28 -32
- 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 +15 -3
- package/lib/component/context/GlobalContext.js +1 -1
- package/lib/component/context/PreferencesContext.d.ts +15 -12
- package/lib/component/context/PreferencesContext.js +1 -1
- package/lib/component/elements/ActionButtons.d.ts +10 -0
- package/lib/component/elements/ActionButtons.js +14 -0
- package/lib/component/elements/Button.d.ts +30 -5
- package/lib/component/elements/Button.js +151 -4
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/ContextMenu.d.ts +8 -3
- package/lib/component/elements/ContextMenu.js +6 -6
- 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/ReactTable/Elements/ReactTableRow.d.ts +5 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +38 -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/ToggleButton.d.ts +2 -1
- package/lib/component/elements/ToggleButton.js +2 -2
- package/lib/component/elements/ToolTip/ToolTip.js +3 -2
- package/lib/component/elements/draggble/SVGDraggable.d.ts +17 -0
- package/lib/component/elements/draggble/SVGDraggable.js +33 -0
- package/lib/component/elements/draggble/useDraggable.d.ts +22 -0
- 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/popup/Alert/Provider.js +1 -1
- package/lib/component/elements/resizer/DivResizer.d.ts +2 -0
- package/lib/component/elements/resizer/DivResizer.js +62 -0
- package/lib/component/elements/resizer/Resizer.d.ts +20 -0
- package/lib/component/elements/resizer/Resizer.js +12 -0
- package/lib/component/elements/resizer/SVGResizer.d.ts +2 -0
- package/lib/component/elements/resizer/SVGResizer.js +42 -0
- package/lib/component/elements/resizer/useResizer.d.ts +11 -0
- package/lib/component/elements/resizer/useResizer.js +65 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.js +4 -15
- package/lib/component/header/BaseLineCorrectionPanel.js +2 -9
- package/lib/component/header/ManualPhaseCorrectionPanel.js +2 -9
- package/lib/component/header/RangesPickingOptionPanel.js +3 -16
- package/lib/component/header/ZeroFillingOptionsPanel.js +2 -9
- package/lib/component/header/Zones2DOptionPanel.js +3 -14
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +11 -9
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +3 -0
- package/lib/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +1 -10
- 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 +1 -0
- package/lib/component/loader/SpinnerContext.d.ts +3 -3
- package/lib/component/loader/SpinnerContext.js +2 -2
- package/lib/component/modal/AlignSpectraModal.js +2 -1
- package/lib/component/modal/ExportAsMatrixModal.js +2 -1
- package/lib/component/modal/ImportPublicationStringModal.js +2 -1
- package/lib/component/modal/LoadJCAMPModal.js +7 -6
- package/lib/component/modal/ModalStyle.js +4 -26
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -4
- package/lib/component/modal/MoleculeStructureEditorModal.js +24 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +2 -1
- package/lib/component/modal/PredictSpectraModal.js +2 -7
- package/lib/component/modal/SaveAsModal.d.ts +1 -1
- package/lib/component/modal/SaveAsModal.js +2 -1
- package/lib/component/modal/editRange/EditRangeModal.js +6 -5
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +2 -0
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +3 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +12 -9
- package/lib/component/modal/setting/DatabasesTabContent.d.ts +6 -0
- package/lib/component/modal/setting/DatabasesTabContent.js +75 -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 +4 -1
- package/lib/component/modal/setting/settingsValidation.d.ts +56 -0
- package/lib/component/modal/setting/settingsValidation.js +46 -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 +2 -5
- 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 +12 -23
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +21 -7
- 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/MultipleSpectraAnalysisTable.js +1 -1
- package/lib/component/panels/Panels.js +2 -3
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +3 -3
- 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 +16 -10
- package/lib/component/panels/RangesPanel/RangesPanel.js +5 -11
- 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.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +5 -18
- 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/CorrelationTableRow.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- 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 +1 -1
- 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.js +73 -40
- package/lib/component/panels/databasePanel/DatabasePreferences.js +10 -42
- package/lib/component/panels/databasePanel/DatabaseTable.js +23 -11
- package/lib/component/panels/databasePanel/useDatabases.d.ts +5 -0
- package/lib/component/panels/databasePanel/useDatabases.js +10 -0
- 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 +3 -3
- 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/SpectraAutomaticPickingButton.d.ts +2 -0
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +30 -0
- package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -18
- package/lib/component/reducer/Reducer.d.ts +360 -45
- package/lib/component/reducer/Reducer.js +9 -2
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +9 -0
- package/lib/component/reducer/actions/AssignmentsActions.js +18 -0
- 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 +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +1 -1
- 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} +132 -15
- 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 +3 -0
- package/lib/component/reducer/types/Types.js +3 -0
- 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 +43 -0
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +15 -0
- package/lib/component/tool/FloatMoleculeStructures/index.js +28 -0
- package/lib/component/utility/Export.d.ts +3 -3
- package/lib/component/utility/Export.js +16 -9
- package/lib/component/utility/PathBuilder.js +2 -1
- package/lib/component/utility/formatNumber.d.ts +3 -0
- package/lib/component/utility/formatNumber.js +10 -0
- package/lib/component/utility/getUniqueNuclei.d.ts +1 -0
- package/lib/component/utility/getUniqueNuclei.js +10 -0
- package/lib/component/workspaces/Workspace.d.ts +74 -5
- package/lib/component/workspaces/basic.js +17 -10
- package/lib/component/workspaces/embedded.d.ts +2 -0
- package/lib/component/workspaces/embedded.js +32 -0
- package/lib/component/workspaces/exercise.js +2 -0
- 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 +2 -0
- package/lib/data/SpectraManager.js +23 -15
- package/lib/data/data1d/Data1DManager.d.ts +1 -1
- package/lib/data/data1d/Data1DManager.js +6 -1
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.js +10 -0
- package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -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 +9 -15
- package/lib/data/data1d/database.js +15 -20
- 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 +1 -1
- 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/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 +3 -3
- package/lib/data/molecules/Molecule.js +7 -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/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +3 -2
- 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 +20 -15
- package/lib-cjs/component/1d/IntegralsSeries.js +3 -3
- package/lib-cjs/component/1d/PeakAnnotation.js +5 -4
- package/lib-cjs/component/1d/database/DatabaseElements.js +23 -0
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +60 -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 +35 -31
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +6 -6
- package/lib-cjs/component/1d/ranges/Range.js +40 -41
- package/lib-cjs/component/1d/ranges/Ranges.js +6 -3
- 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 +4 -1
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- 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 +12 -6
- package/lib-cjs/component/NMRium.js +27 -31
- 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/ActionButtons.js +20 -0
- package/lib-cjs/component/elements/Button.js +150 -4
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/ContextMenu.js +6 -6
- package/lib-cjs/component/elements/EditableColumn.js +27 -20
- package/lib-cjs/component/elements/Input.js +18 -5
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +42 -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/ToggleButton.js +2 -2
- package/lib-cjs/component/elements/ToolTip/ToolTip.js +3 -2
- 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/popup/Alert/Provider.js +1 -1
- package/lib-cjs/component/elements/resizer/DivResizer.js +68 -0
- package/lib-cjs/component/elements/resizer/Resizer.js +18 -0
- package/lib-cjs/component/elements/resizer/SVGResizer.js +48 -0
- package/lib-cjs/component/elements/resizer/useResizer.js +71 -0
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +3 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +2 -9
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +2 -9
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +2 -15
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -9
- package/lib-cjs/component/header/Zones2DOptionPanel.js +2 -13
- package/lib-cjs/component/hooks/useExport.js +11 -9
- package/lib-cjs/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +2 -12
- 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 +1 -0
- package/lib-cjs/component/loader/SpinnerContext.js +2 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +2 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -1
- package/lib-cjs/component/modal/ImportPublicationStringModal.js +2 -1
- package/lib-cjs/component/modal/LoadJCAMPModal.js +7 -6
- package/lib-cjs/component/modal/ModalStyle.js +4 -26
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +29 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +2 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +2 -7
- package/lib-cjs/component/modal/SaveAsModal.js +2 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +6 -5
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +12 -9
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +80 -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 +4 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +72 -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 +2 -5
- 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 +12 -23
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +21 -7
- 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/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/Panels.js +2 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -4
- 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 +17 -11
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +6 -12
- 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 +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -16
- 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/CorrelationTableRow.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
- 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 +2 -2
- 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 +72 -39
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +10 -42
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +22 -10
- package/lib-cjs/component/panels/databasePanel/useDatabases.js +14 -0
- package/lib-cjs/component/panels/extra/placeholder/NoTableData.js +2 -2
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +3 -3
- 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/SpectraAutomaticPickingButton.js +37 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -18
- package/lib-cjs/component/reducer/Reducer.js +9 -2
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +21 -0
- 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 +1 -1
- package/lib-cjs/component/reducer/actions/ToolsActions.js +1 -1
- 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 +6 -3
- package/lib-cjs/component/tool/FloatMoleculeStructures/ActionsButton.js +13 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +50 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +36 -0
- package/lib-cjs/component/utility/Export.js +16 -9
- package/lib-cjs/component/utility/PathBuilder.js +2 -1
- package/lib-cjs/component/utility/formatNumber.js +17 -0
- package/lib-cjs/component/utility/getUniqueNuclei.js +14 -0
- package/lib-cjs/component/workspaces/basic.js +17 -10
- package/lib-cjs/component/workspaces/embedded.js +35 -0
- package/lib-cjs/component/workspaces/exercise.js +2 -0
- 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 +2 -0
- package/lib-cjs/data/SpectraManager.js +23 -15
- package/lib-cjs/data/data1d/Data1DManager.js +6 -1
- package/lib-cjs/data/data1d/Spectrum1D/convertDataToFloat64Array.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
- package/lib-cjs/data/data1d/Spectrum1D/toJSON.js +1 -0
- package/lib-cjs/data/data1d/database.js +15 -21
- 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 +1 -1
- 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/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 +7 -1
- package/lib-cjs/data/molecules/MoleculeManager.js +37 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +49 -48
- package/lib/component/1d/Resizable.d.ts +0 -12
- package/lib/component/1d/Resizable.js +0 -105
- 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/Resizable.js +0 -110
- package/lib-cjs/component/panels/extra/preferences/defaultValues.js +0 -61
- package/lib-cjs/component/reducer/preferencesReducer.js +0 -279
|
@@ -4,15 +4,14 @@ import { css } from '@emotion/react';
|
|
|
4
4
|
import OCL from 'openchemlib/full';
|
|
5
5
|
import { useState, useCallback, useEffect, memo } from 'react';
|
|
6
6
|
import { ResponsiveChart } from 'react-d3-utils';
|
|
7
|
-
import { MF } from 'react-mf';
|
|
8
7
|
import OCLnmr from 'react-ocl-nmr';
|
|
9
8
|
import { useChartData } from '../../context/ChartContext';
|
|
10
9
|
import { useDispatch } from '../../context/DispatchContext';
|
|
11
10
|
import NextPrev from '../../elements/NextPrev';
|
|
12
|
-
import { positions, useModal } from '../../elements/popup/Modal';
|
|
13
11
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
14
|
-
import
|
|
12
|
+
import { useMoleculeEditor } from '../../modal/MoleculeStructureEditorModal';
|
|
15
13
|
import { SET_MOLECULE } from '../../reducer/types/Types';
|
|
14
|
+
import MoleculeHeader from './MoleculeHeader';
|
|
16
15
|
import MoleculePanelHeader from './MoleculePanelHeader';
|
|
17
16
|
import useAtomAssignment from './useAtomAssignment';
|
|
18
17
|
const styles = {
|
|
@@ -34,13 +33,6 @@ const styles = {
|
|
|
34
33
|
display: 'flex',
|
|
35
34
|
flex: '1',
|
|
36
35
|
}),
|
|
37
|
-
toolbar: css({
|
|
38
|
-
display: 'flex',
|
|
39
|
-
borderBottom: '0.55px solid rgb(240, 240, 240)',
|
|
40
|
-
padding: '0px 10px',
|
|
41
|
-
justifyContent: 'end',
|
|
42
|
-
height: 22,
|
|
43
|
-
}),
|
|
44
36
|
slider: css({
|
|
45
37
|
display: 'flex',
|
|
46
38
|
flexDirection: 'column',
|
|
@@ -61,7 +53,7 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
|
|
|
61
53
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
62
54
|
const [molecules, setMolecules] = useState([]);
|
|
63
55
|
const dispatch = useDispatch();
|
|
64
|
-
const
|
|
56
|
+
const openMoleculeEditor = useMoleculeEditor();
|
|
65
57
|
const { currentDiaIDsToHighlight, handleOnAtomHover, handleOnClickAtom, assignedDiaIDsMerged, } = useAtomAssignment({ zones, ranges, activeTab, displayerMode });
|
|
66
58
|
useEffect(() => {
|
|
67
59
|
if (moleculesProp) {
|
|
@@ -76,30 +68,27 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
|
|
|
76
68
|
useEffect(() => {
|
|
77
69
|
onMoleculeChange?.(molecules[currentIndex] || null);
|
|
78
70
|
}, [currentIndex, molecules, onMoleculeChange]);
|
|
79
|
-
const handleReplaceMolecule = useCallback((
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
position: positions.TOP_CENTER,
|
|
85
|
-
width: 700,
|
|
86
|
-
height: 500,
|
|
71
|
+
const handleReplaceMolecule = useCallback((molecule, molfile) => {
|
|
72
|
+
const { key, label, isFloat } = molecule;
|
|
73
|
+
dispatch({
|
|
74
|
+
type: SET_MOLECULE,
|
|
75
|
+
payload: { molfile, key, label, isFloat },
|
|
87
76
|
});
|
|
88
|
-
}, [
|
|
77
|
+
}, [dispatch]);
|
|
89
78
|
const moleculeIndexHandler = useCallback((index) => {
|
|
90
79
|
setCurrentIndex(index);
|
|
91
80
|
}, []);
|
|
92
|
-
return (_jsxs("div", { css: styles.panel, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () =>
|
|
81
|
+
return (_jsxs("div", { css: styles.panel, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditor(), onMoleculeIndexChange: moleculeIndexHandler, actionsOptions: actionsOptions }), _jsxs("div", { css: styles.innerPanel, children: [_jsx("div", { css: styles.molecule, children: _jsx(NextPrev, { onChange: (slideIndex) => setCurrentIndex(slideIndex), defaultIndex: currentIndex, children: molecules && molecules.length > 0 ? (molecules.map((mol, index) => (_jsxs("div", { css: styles.items, children: [_jsx(MoleculeHeader, { currentMolecule: mol, molecules: molecules }), _jsx("div", { css: styles.slider, className: "mol-svg-container", onDoubleClick: () => openMoleculeEditor(mol), style: {
|
|
93
82
|
backgroundColor: (index + 1) % 2 !== 0 ? '#fafafa' : 'white',
|
|
94
83
|
}, children: _jsx(ResponsiveChart, { children: ({ height, width }) => {
|
|
95
|
-
return (_jsx(OCLnmr, { OCL: OCL, id: `molSVG${index}`, width: width, height: height, molfile: mol.molfile || '', setMolfile: (molfile) => handleReplaceMolecule(mol
|
|
84
|
+
return (_jsx(OCLnmr, { OCL: OCL, id: `molSVG${index}`, width: width, height: height, molfile: mol.molfile || '', setMolfile: (molfile) => handleReplaceMolecule(mol, molfile), setSelectedAtom: handleOnClickAtom, atomHighlightColor: currentDiaIDsToHighlight &&
|
|
96
85
|
currentDiaIDsToHighlight.length > 0
|
|
97
86
|
? 'red'
|
|
98
87
|
: '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight &&
|
|
99
88
|
currentDiaIDsToHighlight.length > 0
|
|
100
89
|
? currentDiaIDsToHighlight
|
|
101
90
|
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }));
|
|
102
|
-
} }) })] }, mol.key)))) : (_jsx("div", { css: styles.slider, style: { height: '100%' }, onClick: () =>
|
|
91
|
+
} }) })] }, mol.key)))) : (_jsx("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditor(), children: _jsx("span", { children: "Click to draw molecule" }) })) }) }), children] })] }));
|
|
103
92
|
}
|
|
104
93
|
const MemoizedMoleculePanel = memo(MoleculePanelInner);
|
|
105
94
|
const emptyData = { ranges: {}, zones: {} };
|
|
@@ -4,15 +4,18 @@ import { css } from '@emotion/react';
|
|
|
4
4
|
import { SvgNmrFt } from 'cheminfo-font';
|
|
5
5
|
import { useCallback } from 'react';
|
|
6
6
|
import { FaCopy, FaDownload, FaFileExport, FaFileImage, FaPaste, FaPlus, FaRegTrashAlt, } from 'react-icons/fa';
|
|
7
|
-
import {
|
|
7
|
+
import { IoOpenOutline } from 'react-icons/io5';
|
|
8
|
+
import { useAssignmentData } from '../../assignment/AssignmentsContext';
|
|
8
9
|
import { useDispatch } from '../../context/DispatchContext';
|
|
10
|
+
import { useGlobal } from '../../context/GlobalContext';
|
|
9
11
|
import ButtonToolTip from '../../elements/ButtonToolTip';
|
|
10
12
|
import MenuButton from '../../elements/MenuButton';
|
|
13
|
+
import ToggleButton from '../../elements/ToggleButton';
|
|
11
14
|
import ToolTip from '../../elements/ToolTip/ToolTip';
|
|
12
15
|
import { useAlert } from '../../elements/popup/Alert';
|
|
13
16
|
import { positions, useModal } from '../../elements/popup/Modal';
|
|
14
17
|
import PredictSpectraModal from '../../modal/PredictSpectraModal';
|
|
15
|
-
import { ADD_MOLECULE, DELETE_MOLECULE } from '../../reducer/types/Types';
|
|
18
|
+
import { ADD_MOLECULE, DELETE_MOLECULE, FLOAT_MOLECULE_OVER_SPECTRUM, } from '../../reducer/types/Types';
|
|
16
19
|
import { copyPNGToClipboard, copyTextToClipboard, exportAsSVG, } from '../../utility/Export';
|
|
17
20
|
const toolbarStyle = css `
|
|
18
21
|
display: flex;
|
|
@@ -56,17 +59,22 @@ const MOL_EXPORT_MENU = [
|
|
|
56
59
|
},
|
|
57
60
|
];
|
|
58
61
|
export default function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange = () => null, onOpenMoleculeEditor = () => null, actionsOptions = {}, }) {
|
|
62
|
+
const { rootRef } = useGlobal();
|
|
59
63
|
const alert = useAlert();
|
|
60
64
|
const dispatch = useDispatch();
|
|
61
65
|
const modal = useModal();
|
|
62
66
|
const assignmentData = useAssignmentData();
|
|
63
67
|
const saveAsSVGHandler = useCallback(() => {
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
if (!rootRef)
|
|
69
|
+
return;
|
|
70
|
+
exportAsSVG(rootRef, `molSVG${currentIndex}`, 'molFile');
|
|
71
|
+
}, [rootRef, currentIndex]);
|
|
66
72
|
const saveAsPNGHandler = useCallback(() => {
|
|
67
|
-
|
|
73
|
+
if (!rootRef)
|
|
74
|
+
return;
|
|
75
|
+
copyPNGToClipboard(rootRef, `molSVG${currentIndex}`);
|
|
68
76
|
alert.success('MOL copied as PNG to clipboard');
|
|
69
|
-
}, [alert, currentIndex]);
|
|
77
|
+
}, [rootRef, alert, currentIndex]);
|
|
70
78
|
const saveAsMolHandler = useCallback(() => {
|
|
71
79
|
if (molecules[currentIndex]) {
|
|
72
80
|
void copyTextToClipboard(molecules[currentIndex].molfile).then((flag) => {
|
|
@@ -121,7 +129,13 @@ export default function MoleculePanelHeader({ currentIndex, molecules, onMolecul
|
|
|
121
129
|
width: 600,
|
|
122
130
|
});
|
|
123
131
|
}, [modal, molecules, currentIndex]);
|
|
124
|
-
|
|
132
|
+
const floatMoleculeHandler = useCallback(() => {
|
|
133
|
+
dispatch({
|
|
134
|
+
type: FLOAT_MOLECULE_OVER_SPECTRUM,
|
|
135
|
+
payload: { key: molecules[currentIndex].key },
|
|
136
|
+
});
|
|
137
|
+
}, [currentIndex, dispatch, molecules]);
|
|
138
|
+
return (_jsxs("div", { css: toolbarStyle, children: [!actionsOptions.hideExport && (_jsx(MenuButton, { component: _jsx(FaFileExport, {}), toolTip: "Export As", items: MOL_EXPORT_MENU, onClick: exportHandler })), !actionsOptions.hidePast && (_jsx(ToolTip, { title: "Paste molfile", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handlePaste, children: _jsx(FaPaste, {}) }) })), !actionsOptions.hideAdd && (_jsx(ToolTip, { title: "Add Molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: onOpenMoleculeEditor, "data-test-id": "panel-structures-button-add", children: _jsx(FaPlus, {}) }) })), !actionsOptions.hideDelete && (_jsx(ToolTip, { title: "Delete Molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handleDelete, children: _jsx(FaRegTrashAlt, {}) }) })), !actionsOptions.hidePredict && molecules && molecules.length > 0 && (_jsx(ButtonToolTip, { popupTitle: "Predict Spectra", popupPlacement: "left", onClick: openPredictSpectraModal, children: _jsx(SvgNmrFt, {}) })), molecules?.[currentIndex] && (_jsx(ToggleButton, { defaultValue: molecules[currentIndex].isFloat, popupTitle: "Float Molecule", popupPlacement: "left", onClick: floatMoleculeHandler, children: _jsx(IoOpenOutline, {}) }, molecules[currentIndex].isFloat)), _jsxs("p", { children: [molecules &&
|
|
125
139
|
molecules.length > 0 &&
|
|
126
140
|
`${+(currentIndex + 1)} / ${molecules.length}`, ' '] })] }));
|
|
127
141
|
}
|
|
@@ -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: 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,
|
|
@@ -4,9 +4,9 @@ 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
9
|
import Eval from '../../utility/Evaluate';
|
|
9
|
-
import { useFormatNumberByNucleus } from '../../utility/FormatNumber';
|
|
10
10
|
import NoTableData from '../extra/placeholder/NoTableData';
|
|
11
11
|
import ColumnHeader from './ColumnHeader';
|
|
12
12
|
function MultipleSpectraAnalysisTable({ data, activeTab, }) {
|
|
@@ -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',
|