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
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.validation = void 0;
|
|
27
|
+
const Yup = __importStar(require("yup"));
|
|
28
|
+
const formattingElementValidation = (obj) => Object.keys(obj.formatting.nuclei).reduce((validate, key) => {
|
|
29
|
+
validate[key] = Yup.object().shape({
|
|
30
|
+
name: Yup.string().trim().required('Nucleus is a required field'),
|
|
31
|
+
ppm: Yup.string().trim().required('PPM format is a required field'),
|
|
32
|
+
hz: Yup.string().trim().required('Hz format is a required field'),
|
|
33
|
+
});
|
|
34
|
+
return validate;
|
|
35
|
+
}, {});
|
|
36
|
+
const formattingValidation = (obj) => Yup.object().shape({
|
|
37
|
+
nuclei: Yup.object()
|
|
38
|
+
.shape(formattingElementValidation(obj))
|
|
39
|
+
.test('Unique', 'Nuclei need te be unique', function check(nuclei) {
|
|
40
|
+
let nucleusFrequencies = {};
|
|
41
|
+
for (const key of Object.keys(nuclei)) {
|
|
42
|
+
const _key = nuclei[key].name?.toLowerCase() || '';
|
|
43
|
+
if (_key) {
|
|
44
|
+
if (nucleusFrequencies[_key]) {
|
|
45
|
+
++nucleusFrequencies[_key].value;
|
|
46
|
+
nucleusFrequencies[_key].fields.push(key);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
nucleusFrequencies[_key] = { value: 1, fields: [key] };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const errors = Object.keys(nucleusFrequencies).reduce((errorList, key) => {
|
|
54
|
+
const { value, fields } = nucleusFrequencies[key];
|
|
55
|
+
if (value > 1) {
|
|
56
|
+
for (let field of fields) {
|
|
57
|
+
errorList.push(new Yup.ValidationError(`${key} nucleus must te be unique`, nuclei[key].name, `${this.path}.${field}.name`));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return errorList;
|
|
61
|
+
}, []);
|
|
62
|
+
return new Yup.ValidationError(errors);
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
65
|
+
const databasesValidation = Yup.array().of(Yup.object().shape({
|
|
66
|
+
label: Yup.string().trim().required('Label is a required field'),
|
|
67
|
+
url: Yup.string().trim().url().required('URL is a required field'),
|
|
68
|
+
}));
|
|
69
|
+
exports.validation = Yup.lazy((obj) => Yup.object().shape({
|
|
70
|
+
formatting: formattingValidation(obj),
|
|
71
|
+
databases: databasesValidation,
|
|
72
|
+
}));
|
|
@@ -6,13 +6,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const cheminfo_font_1 = require("cheminfo-font");
|
|
9
|
-
const
|
|
9
|
+
const fa_1 = require("react-icons/fa");
|
|
10
10
|
const ButtonToolTip_1 = __importDefault(require("../../elements/ButtonToolTip"));
|
|
11
11
|
const BasicPanelStyle_1 = require("../extra/BasicPanelStyle");
|
|
12
12
|
const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
|
|
13
|
+
const SpectraAutomaticPickingButton_1 = require("../header/SpectraAutomaticPickingButton");
|
|
14
|
+
const AutomaticAssignmentTable_1 = __importDefault(require("./AutomaticAssignmentTable"));
|
|
15
|
+
const useAutoAssignments_1 = require("./useAutoAssignments");
|
|
13
16
|
function AutomaticAssignment() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: BasicPanelStyle_1.tablePanelStyle, children: [(0, jsx_runtime_1.jsx)(DefaultPanelHeader_1.default, { showSettingButton: false, canDelete: false, children: (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "automatic assignment", onClick: automaticAssignmentHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrAssignment2, { style: { fontSize: '18px' } }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "inner-container" })] }));
|
|
17
|
+
const { getAssignments, assignments, restAssignments } = (0, useAutoAssignments_1.useAutoAssignments)();
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: BasicPanelStyle_1.tablePanelStyle, children: [(0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { showSettingButton: false, canDelete: false, children: [(0, jsx_runtime_1.jsx)(SpectraAutomaticPickingButton_1.SpectraAutomaticPickingButton, {}), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "automatic assignment", onClick: getAssignments, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrAssignment2, { style: { fontSize: '18px' } }) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "reset assignment", onClick: restAssignments, children: (0, jsx_runtime_1.jsx)(fa_1.FaBolt, {}) })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: (0, jsx_runtime_1.jsx)(AutomaticAssignmentTable_1.default, { data: assignments }) })] }));
|
|
17
19
|
}
|
|
18
20
|
exports.default = AutomaticAssignment;
|
|
@@ -6,15 +6,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const cheminfo_font_1 = require("cheminfo-font");
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
+
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
9
10
|
const ReactTable_1 = __importDefault(require("../../elements/ReactTable/ReactTable"));
|
|
11
|
+
const Types_1 = require("../../reducer/types/Types");
|
|
10
12
|
const NoTableData_1 = __importDefault(require("../extra/placeholder/NoTableData"));
|
|
11
|
-
function
|
|
13
|
+
function AutomaticAssignmentTable({ data }) {
|
|
14
|
+
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
12
15
|
const assignHandler = (0, react_1.useCallback)((e, row) => {
|
|
13
16
|
e.preventDefault();
|
|
14
17
|
e.stopPropagation();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
const assignments = row.original.assignment;
|
|
19
|
+
dispatch({
|
|
20
|
+
type: Types_1.SET_AUTOMATIC_ASSIGNMENTS,
|
|
21
|
+
payload: { assignments },
|
|
22
|
+
});
|
|
23
|
+
}, [dispatch]);
|
|
18
24
|
const COLUMNS = (0, react_1.useMemo)(() => [
|
|
19
25
|
{
|
|
20
26
|
index: 1,
|
|
@@ -25,6 +31,7 @@ function PeaksTable({ data }) {
|
|
|
25
31
|
{
|
|
26
32
|
index: 2,
|
|
27
33
|
Header: 'Score',
|
|
34
|
+
accessor: 'score',
|
|
28
35
|
},
|
|
29
36
|
{
|
|
30
37
|
index: 3,
|
|
@@ -38,6 +45,6 @@ function PeaksTable({ data }) {
|
|
|
38
45
|
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "assign-button", onClick: (e) => assignHandler(e, row), children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrAssignment, {}) })),
|
|
39
46
|
},
|
|
40
47
|
], [assignHandler]);
|
|
41
|
-
return data && data.length > 0 ? ((0, jsx_runtime_1.jsx)(ReactTable_1.default, { data: data, columns: COLUMNS })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, {}));
|
|
48
|
+
return data && data.length > 0 ? ((0, jsx_runtime_1.jsx)(ReactTable_1.default, { data: data, columns: COLUMNS, onClick: assignHandler, highlightActiveRow: true })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, {}));
|
|
42
49
|
}
|
|
43
|
-
exports.default = (0, react_1.memo)(
|
|
50
|
+
exports.default = (0, react_1.memo)(AutomaticAssignmentTable);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useAutoAssignments = void 0;
|
|
7
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
8
|
+
const full_1 = __importDefault(require("openchemlib/full"));
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const ChartContext_1 = require("../../context/ChartContext");
|
|
11
|
+
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
12
|
+
const Alert_1 = require("../../elements/popup/Alert");
|
|
13
|
+
const Types_1 = require("../../reducer/types/Types");
|
|
14
|
+
function mapSpectra(data) {
|
|
15
|
+
return data.reduce((acc, spectrum) => {
|
|
16
|
+
const { id, info } = spectrum;
|
|
17
|
+
const dimension = spectrum.info.dimension;
|
|
18
|
+
if (dimension === 1) {
|
|
19
|
+
const ranges = spectrum.ranges.values;
|
|
20
|
+
acc.push({ id, info, ranges });
|
|
21
|
+
}
|
|
22
|
+
else if (dimension === 2) {
|
|
23
|
+
const zones = spectrum.zones.values;
|
|
24
|
+
acc.push({ id, info, zones });
|
|
25
|
+
}
|
|
26
|
+
return acc;
|
|
27
|
+
}, []);
|
|
28
|
+
}
|
|
29
|
+
function useAutoAssignments() {
|
|
30
|
+
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
31
|
+
const { data, molecules } = (0, ChartContext_1.useChartData)();
|
|
32
|
+
const originData = (0, react_1.useRef)();
|
|
33
|
+
const alert = (0, Alert_1.useAlert)();
|
|
34
|
+
const [assignments, setAssignments] = (0, react_1.useState)([]);
|
|
35
|
+
const restAssignments = (0, react_1.useCallback)(() => {
|
|
36
|
+
dispatch({
|
|
37
|
+
type: Types_1.SET_AUTOMATIC_ASSIGNMENTS,
|
|
38
|
+
payload: { assignments: originData.current },
|
|
39
|
+
});
|
|
40
|
+
}, [dispatch]);
|
|
41
|
+
const getAssignments = (0, react_1.useCallback)(() => {
|
|
42
|
+
void (async () => {
|
|
43
|
+
const hideLoading = await alert.showLoading('Auto Assignments');
|
|
44
|
+
const molecule = full_1.default.Molecule.fromMolfile(molecules[0]?.molfile || '');
|
|
45
|
+
const spectra = mapSpectra(data);
|
|
46
|
+
if (!originData.current) {
|
|
47
|
+
originData.current = spectra;
|
|
48
|
+
}
|
|
49
|
+
const result = await (0, nmr_processing_1.getAssignments)({
|
|
50
|
+
spectra,
|
|
51
|
+
molecule,
|
|
52
|
+
}, { minScore: 0 });
|
|
53
|
+
if (result[0]?.assignment) {
|
|
54
|
+
dispatch({
|
|
55
|
+
type: Types_1.SET_AUTOMATIC_ASSIGNMENTS,
|
|
56
|
+
payload: { assignments: result[0].assignment },
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
alert.error('Could not assign molecule, please check that all the ranges are defined correctly');
|
|
61
|
+
}
|
|
62
|
+
setAssignments(result);
|
|
63
|
+
hideLoading();
|
|
64
|
+
})();
|
|
65
|
+
}, [alert, data, dispatch, molecules]);
|
|
66
|
+
return (0, react_1.useMemo)(() => ({
|
|
67
|
+
getAssignments,
|
|
68
|
+
assignments,
|
|
69
|
+
restAssignments,
|
|
70
|
+
}), [assignments, getAssignments, restAssignments]);
|
|
71
|
+
}
|
|
72
|
+
exports.useAutoAssignments = useAutoAssignments;
|
|
@@ -12,7 +12,6 @@ const react_2 = require("react");
|
|
|
12
12
|
const im_1 = require("react-icons/im");
|
|
13
13
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
14
14
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
15
|
-
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
16
15
|
const ToggleButton_1 = __importDefault(require("../../elements/ToggleButton"));
|
|
17
16
|
const ToolTip_1 = __importDefault(require("../../elements/ToolTip/ToolTip"));
|
|
18
17
|
const Modal_1 = require("../../elements/popup/Modal");
|
|
@@ -39,7 +38,7 @@ const style = (0, react_1.css) `
|
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
`;
|
|
42
|
-
function IntegralPanelInner({ integrals, info, activeTab, xDomain,
|
|
41
|
+
function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
43
42
|
const [filterIsActive, setFilterIsActive] = (0, react_2.useState)(false);
|
|
44
43
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
45
44
|
const modal = (0, Modal_1.useModal)();
|
|
@@ -113,18 +112,16 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, preferences,
|
|
|
113
112
|
? 'Show all integrals'
|
|
114
113
|
: 'Hide integrals out of view', filterIsActive: filterIsActive, counterFiltered: filteredData.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: [(0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: currentSum
|
|
115
114
|
? `Change Integrals Sum (${Number(currentSum).toFixed(2)})`
|
|
116
|
-
: 'Change Integrals Sum', popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { className: "fix-integral-toggle-btn", popupTitle: "fix integral values", popupPlacement: "right", onClick: toggleConstantSumHandler, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(IntegralTable_1.default, { data: filteredData, activeTab: activeTab
|
|
115
|
+
: 'Change Integrals Sum', popupPlacement: "right", children: (0, jsx_runtime_1.jsx)("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { className: "fix-integral-toggle-btn", popupTitle: "fix integral values", popupPlacement: "right", onClick: toggleConstantSumHandler, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)(IntegralTable_1.default, { data: filteredData, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(IntegralsPreferences_1.default, { ref: settingRef })) })] }) }));
|
|
117
116
|
}
|
|
118
117
|
const MemoizedIntegralPanel = (0, react_2.memo)(IntegralPanelInner);
|
|
119
118
|
const emptyData = { integrals: {}, info: {} };
|
|
120
119
|
function IntegralPanel() {
|
|
121
120
|
const { xDomain, activeTab } = (0, ChartContext_1.useChartData)();
|
|
122
|
-
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
123
121
|
const { integrals, info } = (0, useSpectrum_1.default)(emptyData);
|
|
124
122
|
return ((0, jsx_runtime_1.jsx)(MemoizedIntegralPanel, { ...{
|
|
125
123
|
integrals,
|
|
126
124
|
info,
|
|
127
|
-
preferences: preferences.current,
|
|
128
125
|
xDomain,
|
|
129
126
|
activeTab,
|
|
130
127
|
} }));
|
|
@@ -14,13 +14,12 @@ const EditableColumn_1 = __importDefault(require("../../elements/EditableColumn"
|
|
|
14
14
|
const ReactTable_1 = __importDefault(require("../../elements/ReactTable/ReactTable"));
|
|
15
15
|
const addCustomColumn_1 = __importDefault(require("../../elements/ReactTable/utility/addCustomColumn"));
|
|
16
16
|
const Select_1 = __importDefault(require("../../elements/Select"));
|
|
17
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
17
18
|
const Types_1 = require("../../reducer/types/Types");
|
|
18
|
-
const
|
|
19
|
-
const LocalStorage_1 = require("../../utility/LocalStorage");
|
|
19
|
+
const formatNumber_1 = require("../../utility/formatNumber");
|
|
20
20
|
const NoTableData_1 = __importDefault(require("../extra/placeholder/NoTableData"));
|
|
21
|
-
const defaultValues_1 = require("../extra/preferences/defaultValues");
|
|
22
21
|
const selectStyle = { marginLeft: 10, marginRight: 10, border: 'none' };
|
|
23
|
-
function IntegralTable({ activeTab, data
|
|
22
|
+
function IntegralTable({ activeTab, data }) {
|
|
24
23
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
25
24
|
const deleteIntegralHandler = (0, react_1.useCallback)((e, row) => {
|
|
26
25
|
e.preventDefault();
|
|
@@ -81,16 +80,16 @@ function IntegralTable({ activeTab, data, preferences }) {
|
|
|
81
80
|
payload: { data },
|
|
82
81
|
});
|
|
83
82
|
}, [dispatch]);
|
|
84
|
-
const integralsPreferences = (0,
|
|
83
|
+
const integralsPreferences = (0, usePanelPreferences_1.usePanelPreferences)('integrals', activeTab);
|
|
85
84
|
const COLUMNS = (0, react_1.useMemo)(() => [
|
|
86
85
|
{
|
|
87
|
-
showWhen: '
|
|
86
|
+
showWhen: 'absolute.show',
|
|
88
87
|
index: 4,
|
|
89
88
|
Header: 'Absolute',
|
|
90
|
-
accessor: (row) => (0,
|
|
89
|
+
accessor: (row) => (0, formatNumber_1.formatNumber)(row.absolute, integralsPreferences.absolute.format),
|
|
91
90
|
},
|
|
92
91
|
{
|
|
93
|
-
showWhen: '
|
|
92
|
+
showWhen: 'relative.show',
|
|
94
93
|
index: 5,
|
|
95
94
|
id: 'relative',
|
|
96
95
|
Header: () => {
|
|
@@ -98,10 +97,10 @@ function IntegralTable({ activeTab, data, preferences }) {
|
|
|
98
97
|
return (0, jsx_runtime_1.jsx)("span", { children: `Relative ${n}` });
|
|
99
98
|
},
|
|
100
99
|
accessor: (row) => {
|
|
101
|
-
return (0,
|
|
100
|
+
return (0, formatNumber_1.formatNumber)(row.integral, integralsPreferences.relative.format);
|
|
102
101
|
},
|
|
103
102
|
Cell: ({ row }) => {
|
|
104
|
-
const value = (0,
|
|
103
|
+
const value = (0, formatNumber_1.formatNumber)(row.original.integral, integralsPreferences.relative.format);
|
|
105
104
|
const flag = (0, Spectrum1D_1.checkIntegralKind)(row.original);
|
|
106
105
|
const integral = flag ? value : `[ ${value} ]`;
|
|
107
106
|
return ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: integral, onSave: (event) => saveRelativeHandler(event, row.original), type: "number" }));
|
|
@@ -112,7 +111,7 @@ function IntegralTable({ activeTab, data, preferences }) {
|
|
|
112
111
|
let columns = [...initialColumns];
|
|
113
112
|
for (const col of COLUMNS) {
|
|
114
113
|
const { showWhen, ...colParams } = col;
|
|
115
|
-
if (integralsPreferences
|
|
114
|
+
if ((0, get_1.default)(integralsPreferences, showWhen)) {
|
|
116
115
|
(0, addCustomColumn_1.default)(columns, colParams);
|
|
117
116
|
}
|
|
118
117
|
}
|
|
@@ -5,82 +5,40 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
const react_mf_1 = require("react-mf");
|
|
9
8
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
10
9
|
const FormikColorInput_1 = __importDefault(require("../../elements/formik/FormikColorInput"));
|
|
11
|
-
const FormikColumnFormatField_1 = __importDefault(require("../../elements/formik/FormikColumnFormatField"));
|
|
12
10
|
const FormikForm_1 = __importDefault(require("../../elements/formik/FormikForm"));
|
|
13
11
|
const FormikNumberInput_1 = __importDefault(require("../../elements/formik/FormikNumberInput"));
|
|
14
12
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
15
13
|
const useNucleus_1 = __importDefault(require("../../hooks/useNucleus"));
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
padding: 10,
|
|
21
|
-
backgroundColor: '#f1f1f1',
|
|
22
|
-
height: '100%',
|
|
23
|
-
overflowY: 'auto',
|
|
24
|
-
},
|
|
25
|
-
groupContainer: {
|
|
26
|
-
padding: '5px',
|
|
27
|
-
borderRadius: '5px',
|
|
28
|
-
margin: '10px 0px',
|
|
29
|
-
backgroundColor: 'white',
|
|
30
|
-
},
|
|
31
|
-
row: {
|
|
32
|
-
display: 'flex',
|
|
33
|
-
margin: '5px 0px',
|
|
34
|
-
},
|
|
35
|
-
header: {
|
|
36
|
-
borderBottom: '1px solid #e8e8e8',
|
|
37
|
-
paddingBottom: '5px',
|
|
38
|
-
fontWeight: 'bold',
|
|
39
|
-
color: '#4a4a4a',
|
|
40
|
-
},
|
|
41
|
-
inputLabel: {
|
|
42
|
-
flex: 2,
|
|
43
|
-
fontSize: '11px',
|
|
44
|
-
fontWeight: 'bold',
|
|
45
|
-
color: '#232323',
|
|
46
|
-
},
|
|
47
|
-
input: {
|
|
48
|
-
width: '30%',
|
|
49
|
-
textAlign: 'center',
|
|
50
|
-
},
|
|
51
|
-
};
|
|
14
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
15
|
+
const getUniqueNuclei_1 = require("../../utility/getUniqueNuclei");
|
|
16
|
+
const NucleusPreferences_1 = require("../extra/preferences/NucleusPreferences");
|
|
17
|
+
const PreferencesContainer_1 = require("../extra/preferences/PreferencesContainer");
|
|
52
18
|
const formatFields = [
|
|
53
19
|
{
|
|
54
20
|
id: 1,
|
|
55
21
|
label: 'Absolute :',
|
|
56
|
-
|
|
57
|
-
|
|
22
|
+
checkControllerName: 'absolute.show',
|
|
23
|
+
formatControllerName: 'absolute.format',
|
|
58
24
|
},
|
|
59
25
|
{
|
|
60
26
|
id: 2,
|
|
61
27
|
label: 'Relative :',
|
|
62
|
-
|
|
63
|
-
|
|
28
|
+
checkControllerName: 'relative.show',
|
|
29
|
+
formatControllerName: 'relative.format',
|
|
64
30
|
},
|
|
65
31
|
];
|
|
66
|
-
function
|
|
32
|
+
function IntegralsPreferences(props, ref) {
|
|
67
33
|
const alert = (0, Alert_1.useAlert)();
|
|
34
|
+
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
35
|
+
const nucleus = (0, useNucleus_1.default)();
|
|
36
|
+
const nuclei = (0, react_1.useMemo)(() => (0, getUniqueNuclei_1.getUniqueNuclei)(nucleus), [nucleus]);
|
|
37
|
+
const preferencesByNuclei = (0, usePanelPreferences_1.usePanelPreferencesByNuclei)('integrals', nuclei);
|
|
68
38
|
const formRef = (0, react_1.useRef)();
|
|
69
|
-
const updateValues = (0, react_1.useCallback)(() => {
|
|
70
|
-
if (nucleus) {
|
|
71
|
-
const { color, strokeWidth, ...restProps } = defaultValues_1.integralDefaultValues;
|
|
72
|
-
const integralPreferences = (0, LocalStorage_1.getValue)(preferences.current, `formatting.panels.integrals`);
|
|
73
|
-
let defaultValues = nucleus.reduce((acc, nucleusLabel) => {
|
|
74
|
-
acc[nucleusLabel] = restProps;
|
|
75
|
-
return acc;
|
|
76
|
-
}, {});
|
|
77
|
-
defaultValues = Object.assign(defaultValues, { color, strokeWidth });
|
|
78
|
-
formRef.current.setValues(integralPreferences ? integralPreferences : defaultValues);
|
|
79
|
-
}
|
|
80
|
-
}, [nucleus, preferences]);
|
|
81
39
|
(0, react_1.useEffect)(() => {
|
|
82
|
-
|
|
83
|
-
}, [
|
|
40
|
+
formRef.current.setValues(preferencesByNuclei);
|
|
41
|
+
}, [preferencesByNuclei]);
|
|
84
42
|
const saveHandler = (0, react_1.useCallback)((values) => {
|
|
85
43
|
preferences.dispatch({
|
|
86
44
|
type: 'SET_PANELS_PREFERENCES',
|
|
@@ -88,28 +46,22 @@ function IntegralsPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
|
88
46
|
});
|
|
89
47
|
alert.success('Integrals preferences saved successfully');
|
|
90
48
|
}, [alert, preferences]);
|
|
91
|
-
(0, react_1.useImperativeHandle)(
|
|
49
|
+
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
92
50
|
saveSetting: () => {
|
|
93
51
|
formRef.current.submitForm();
|
|
94
52
|
},
|
|
95
53
|
}));
|
|
96
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
97
|
-
label: {
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { onSubmit: saveHandler, ref: formRef, children: nuclei?.map((n) => ((0, jsx_runtime_1.jsx)(NucleusPreferences_1.NucleusPreferences, { nucleus: n, fields: formatFields, renderTop: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: `nuclei.${n}.color` }), (0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: `nuclei.${n}.strokeWidth`, label: "stroke width :", style: {
|
|
55
|
+
label: {
|
|
56
|
+
fontSize: '11px',
|
|
57
|
+
fontWeight: 'bold',
|
|
58
|
+
color: '#232323',
|
|
59
|
+
},
|
|
98
60
|
input: {
|
|
99
61
|
width: '60%',
|
|
100
62
|
textAlign: 'center',
|
|
101
63
|
borderRadius: '5px',
|
|
102
64
|
},
|
|
103
|
-
}, min: 1, max: 9, pattern: "[1-9]+" })] })
|
|
104
|
-
}
|
|
105
|
-
const MemoizedIntegralsPreferences = (0, react_1.memo)(IntegralsPreferencesInner);
|
|
106
|
-
// TODO: remove this hacky use of ref.
|
|
107
|
-
function IntegralsPreferences(props, ref) {
|
|
108
|
-
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
109
|
-
const nucleus = (0, useNucleus_1.default)();
|
|
110
|
-
return ((0, jsx_runtime_1.jsx)(MemoizedIntegralsPreferences, { innerRef: ref, ...{
|
|
111
|
-
nucleus,
|
|
112
|
-
preferences,
|
|
113
|
-
} }));
|
|
65
|
+
}, min: 1, max: 9, pattern: "[1-9]+" })] })) }, n))) }) }));
|
|
114
66
|
}
|
|
115
|
-
exports.default = (0, react_1.forwardRef)(IntegralsPreferences);
|
|
67
|
+
exports.default = (0, react_1.memo)((0, react_1.forwardRef)(IntegralsPreferences));
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const react_mf_1 = require("react-mf");
|
|
9
|
+
const MoleculeManager_1 = require("../../../data/molecules/MoleculeManager");
|
|
10
|
+
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
11
|
+
const EditableColumn_1 = __importDefault(require("../../elements/EditableColumn"));
|
|
12
|
+
const Types_1 = require("../../reducer/types/Types");
|
|
13
|
+
const styles = {
|
|
14
|
+
toolbar: {
|
|
15
|
+
display: 'flex',
|
|
16
|
+
borderBottom: '0.55px solid rgb(240, 240, 240)',
|
|
17
|
+
padding: '5px 10px',
|
|
18
|
+
justifyContent: 'space-between',
|
|
19
|
+
height: '35px',
|
|
20
|
+
},
|
|
21
|
+
labelInput: {
|
|
22
|
+
width: '150px',
|
|
23
|
+
border: '1px solid #f4f4f4',
|
|
24
|
+
borderRadius: '5px',
|
|
25
|
+
cursor: 'pointer',
|
|
26
|
+
textAlign: 'center',
|
|
27
|
+
marginLeft: '5px',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
function MoleculeHeader(props) {
|
|
31
|
+
const { currentMolecule, molecules } = props;
|
|
32
|
+
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
33
|
+
const validateLabel = (0, react_1.useCallback)((value) => {
|
|
34
|
+
const reservedNumbers = (0, MoleculeManager_1.extractLabelsNumbers)(molecules);
|
|
35
|
+
const number = (0, MoleculeManager_1.extractNumber)(value);
|
|
36
|
+
return value && !reservedNumbers.includes(Number(number));
|
|
37
|
+
}, [molecules]);
|
|
38
|
+
const saveLabelHandler = (0, react_1.useCallback)((key, event) => {
|
|
39
|
+
const label = event.target.value;
|
|
40
|
+
dispatch({ type: Types_1.CHANGE_MOLECULE_LABEL, payload: { label, key } });
|
|
41
|
+
}, [dispatch]);
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.toolbar, children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)("span", { children: "Label" }), (0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: currentMolecule.label, style: styles.labelInput, validate: validateLabel, onSave: (event) => saveLabelHandler(currentMolecule.key, event) })] }), (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)(react_mf_1.MF, { mf: currentMolecule.mf }), " - ", currentMolecule.mw?.toFixed(2)] })] }));
|
|
43
|
+
}
|
|
44
|
+
exports.default = MoleculeHeader;
|
|
@@ -9,15 +9,14 @@ const react_1 = require("@emotion/react");
|
|
|
9
9
|
const full_1 = __importDefault(require("openchemlib/full"));
|
|
10
10
|
const react_2 = require("react");
|
|
11
11
|
const react_d3_utils_1 = require("react-d3-utils");
|
|
12
|
-
const react_mf_1 = require("react-mf");
|
|
13
12
|
const react_ocl_nmr_1 = __importDefault(require("react-ocl-nmr"));
|
|
14
13
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
15
14
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
16
15
|
const NextPrev_1 = __importDefault(require("../../elements/NextPrev"));
|
|
17
|
-
const Modal_1 = require("../../elements/popup/Modal");
|
|
18
16
|
const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
|
|
19
|
-
const MoleculeStructureEditorModal_1 =
|
|
17
|
+
const MoleculeStructureEditorModal_1 = require("../../modal/MoleculeStructureEditorModal");
|
|
20
18
|
const Types_1 = require("../../reducer/types/Types");
|
|
19
|
+
const MoleculeHeader_1 = __importDefault(require("./MoleculeHeader"));
|
|
21
20
|
const MoleculePanelHeader_1 = __importDefault(require("./MoleculePanelHeader"));
|
|
22
21
|
const useAtomAssignment_1 = __importDefault(require("./useAtomAssignment"));
|
|
23
22
|
const styles = {
|
|
@@ -39,13 +38,6 @@ const styles = {
|
|
|
39
38
|
display: 'flex',
|
|
40
39
|
flex: '1',
|
|
41
40
|
}),
|
|
42
|
-
toolbar: (0, react_1.css)({
|
|
43
|
-
display: 'flex',
|
|
44
|
-
borderBottom: '0.55px solid rgb(240, 240, 240)',
|
|
45
|
-
padding: '0px 10px',
|
|
46
|
-
justifyContent: 'end',
|
|
47
|
-
height: 22,
|
|
48
|
-
}),
|
|
49
41
|
slider: (0, react_1.css)({
|
|
50
42
|
display: 'flex',
|
|
51
43
|
flexDirection: 'column',
|
|
@@ -66,7 +58,7 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
|
|
|
66
58
|
const [currentIndex, setCurrentIndex] = (0, react_2.useState)(0);
|
|
67
59
|
const [molecules, setMolecules] = (0, react_2.useState)([]);
|
|
68
60
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
69
|
-
const
|
|
61
|
+
const openMoleculeEditor = (0, MoleculeStructureEditorModal_1.useMoleculeEditor)();
|
|
70
62
|
const { currentDiaIDsToHighlight, handleOnAtomHover, handleOnClickAtom, assignedDiaIDsMerged, } = (0, useAtomAssignment_1.default)({ zones, ranges, activeTab, displayerMode });
|
|
71
63
|
(0, react_2.useEffect)(() => {
|
|
72
64
|
if (moleculesProp) {
|
|
@@ -81,30 +73,27 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
|
|
|
81
73
|
(0, react_2.useEffect)(() => {
|
|
82
74
|
onMoleculeChange?.(molecules[currentIndex] || null);
|
|
83
75
|
}, [currentIndex, molecules, onMoleculeChange]);
|
|
84
|
-
const handleReplaceMolecule = (0, react_2.useCallback)((
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
position: Modal_1.positions.TOP_CENTER,
|
|
90
|
-
width: 700,
|
|
91
|
-
height: 500,
|
|
76
|
+
const handleReplaceMolecule = (0, react_2.useCallback)((molecule, molfile) => {
|
|
77
|
+
const { key, label, isFloat } = molecule;
|
|
78
|
+
dispatch({
|
|
79
|
+
type: Types_1.SET_MOLECULE,
|
|
80
|
+
payload: { molfile, key, label, isFloat },
|
|
92
81
|
});
|
|
93
|
-
}, [
|
|
82
|
+
}, [dispatch]);
|
|
94
83
|
const moleculeIndexHandler = (0, react_2.useCallback)((index) => {
|
|
95
84
|
setCurrentIndex(index);
|
|
96
85
|
}, []);
|
|
97
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: styles.panel, children: [(0, jsx_runtime_1.jsx)(MoleculePanelHeader_1.default, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () =>
|
|
86
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: styles.panel, children: [(0, jsx_runtime_1.jsx)(MoleculePanelHeader_1.default, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditor(), onMoleculeIndexChange: moleculeIndexHandler, actionsOptions: actionsOptions }), (0, jsx_runtime_1.jsxs)("div", { css: styles.innerPanel, children: [(0, jsx_runtime_1.jsx)("div", { css: styles.molecule, children: (0, jsx_runtime_1.jsx)(NextPrev_1.default, { onChange: (slideIndex) => setCurrentIndex(slideIndex), defaultIndex: currentIndex, children: molecules && molecules.length > 0 ? (molecules.map((mol, index) => ((0, jsx_runtime_1.jsxs)("div", { css: styles.items, children: [(0, jsx_runtime_1.jsx)(MoleculeHeader_1.default, { currentMolecule: mol, molecules: molecules }), (0, jsx_runtime_1.jsx)("div", { css: styles.slider, className: "mol-svg-container", onDoubleClick: () => openMoleculeEditor(mol), style: {
|
|
98
87
|
backgroundColor: (index + 1) % 2 !== 0 ? '#fafafa' : 'white',
|
|
99
88
|
}, children: (0, jsx_runtime_1.jsx)(react_d3_utils_1.ResponsiveChart, { children: ({ height, width }) => {
|
|
100
|
-
return ((0, jsx_runtime_1.jsx)(react_ocl_nmr_1.default, { OCL: full_1.default, id: `molSVG${index}`, width: width, height: height, molfile: mol.molfile || '', setMolfile: (molfile) => handleReplaceMolecule(mol
|
|
89
|
+
return ((0, jsx_runtime_1.jsx)(react_ocl_nmr_1.default, { OCL: full_1.default, id: `molSVG${index}`, width: width, height: height, molfile: mol.molfile || '', setMolfile: (molfile) => handleReplaceMolecule(mol, molfile), setSelectedAtom: handleOnClickAtom, atomHighlightColor: currentDiaIDsToHighlight &&
|
|
101
90
|
currentDiaIDsToHighlight.length > 0
|
|
102
91
|
? 'red'
|
|
103
92
|
: '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight &&
|
|
104
93
|
currentDiaIDsToHighlight.length > 0
|
|
105
94
|
? currentDiaIDsToHighlight
|
|
106
95
|
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }));
|
|
107
|
-
} }) })] }, mol.key)))) : ((0, jsx_runtime_1.jsx)("div", { css: styles.slider, style: { height: '100%' }, onClick: () =>
|
|
96
|
+
} }) })] }, mol.key)))) : ((0, jsx_runtime_1.jsx)("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditor(), children: (0, jsx_runtime_1.jsx)("span", { children: "Click to draw molecule" }) })) }) }), children] })] }));
|
|
108
97
|
}
|
|
109
98
|
const MemoizedMoleculePanel = (0, react_2.memo)(MoleculePanelInner);
|
|
110
99
|
const emptyData = { ranges: {}, zones: {} };
|