nmrium 0.27.0 → 0.30.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/README.md +12 -2
- package/lib/component/1d/ApodizationLine.d.ts +3 -0
- package/lib/component/1d/ApodizationLine.js +47 -0
- package/lib/component/1d/Chart1D.js +4 -2
- package/lib/component/1d/ExclusionZoneAnnotation.d.ts +1 -1
- package/lib/component/1d/ExclusionZoneAnnotation.js +14 -7
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib/component/1d/IntegralResizable.js +5 -4
- package/lib/component/1d/IntegralsSeries.js +2 -6
- package/lib/component/1d/LinesSeries.js +6 -6
- package/lib/component/1d/SpectraTracker.js +2 -2
- package/lib/component/1d/Viewer1D.js +8 -13
- package/lib/component/1d/database/DatabaseElements.js +2 -2
- package/lib/component/1d/database/DatabaseSpectrum.js +33 -28
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +11 -9
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +16 -14
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +3 -4
- package/lib/component/1d/{PeakAnnotation.d.ts → peaks/PeakAnnotation.d.ts} +1 -2
- package/lib/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +10 -11
- package/lib/component/1d/{PeakAnnotations.d.ts → peaks/PeakAnnotations.d.ts} +0 -0
- package/lib/component/1d/peaks/PeakAnnotations.js +26 -0
- package/lib/component/1d/peaks/PeaksShapes.d.ts +3 -0
- package/lib/component/1d/peaks/PeaksShapes.js +35 -0
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +13 -0
- package/lib/component/1d/peaks/usePeakShapesPath.js +45 -0
- package/lib/component/1d/ranges/Range.d.ts +1 -2
- package/lib/component/1d/ranges/Range.js +7 -8
- package/lib/component/1d/ranges/Ranges.js +3 -4
- package/lib/component/1d/tool/BaseLineZones.js +3 -6
- package/lib/component/1d/tool/VerticalIndicator.js +1 -1
- package/lib/component/2d/Contours.js +9 -13
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/SignalDeltaLine.js +1 -1
- package/lib/component/2d/Viewer2D.js +3 -3
- package/lib/component/2d/YAxis.js +2 -2
- package/lib/component/2d/zones/IndicationLines.js +2 -3
- package/lib/component/2d/zones/Signal.d.ts +3 -2
- package/lib/component/2d/zones/Signal.js +3 -3
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/2d/zones/Zone.js +4 -4
- package/lib/component/EventsTrackers/KeysListenerTracker.js +132 -75
- package/lib/component/NMRium.d.ts +14 -49
- package/lib/component/NMRium.js +14 -6
- package/lib/component/SplitPaneWrapper.js +2 -2
- package/lib/component/assignment/AssignmentsContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.js +3 -3
- package/lib/component/context/PreferencesContext.d.ts +3 -45
- package/lib/component/elements/ActiveButton.d.ts +17 -0
- package/lib/component/elements/ActiveButton.js +28 -0
- package/lib/component/elements/Button.d.ts +6 -6
- package/lib/component/elements/Button.js +6 -6
- package/lib/component/elements/ButtonToolTip.js +1 -1
- package/lib/component/elements/CheckBox.d.ts +2 -6
- package/lib/component/elements/CheckBox.js +4 -6
- package/lib/component/elements/CheckBoxCell.d.ts +3 -0
- package/lib/component/elements/CheckBoxCell.js +8 -0
- package/lib/component/elements/Input.d.ts +5 -4
- package/lib/component/elements/Input.js +1 -1
- package/lib/component/elements/Label.d.ts +8 -6
- package/lib/component/elements/Label.js +3 -3
- package/lib/component/elements/Logo.js +1 -1
- package/lib/component/elements/MoleculeSelection.d.ts +2 -2
- package/lib/component/elements/MoleculeSelection.js +1 -1
- package/lib/component/elements/NextPrev.js +1 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +3 -2
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
- package/lib/component/elements/Select.d.ts +7 -11
- package/lib/component/elements/Select.js +6 -8
- package/lib/component/elements/Tab/Tab.js +1 -1
- package/lib/component/elements/Tab/Tabs.js +2 -1
- package/lib/component/elements/Table/Table.d.ts +1 -2
- package/lib/component/elements/Table/Table.js +2 -2
- package/lib/component/elements/ToggleButton.d.ts +1 -2
- package/lib/component/elements/ToggleButton.js +5 -4
- package/lib/component/elements/accordion/Accordion.js +2 -6
- package/lib/component/elements/accordion/AccordionItem.js +2 -2
- package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
- package/lib/component/elements/formik/FormikCheckBox.js +4 -2
- package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.d.ts +3 -2
- package/lib/component/elements/formik/FormikOnChange.js +11 -5
- package/lib/component/elements/formik/Input.js +1 -1
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib/component/elements/popup/Modal/Modal.js +1 -1
- package/lib/component/elements/popup/Modal/ModalContent.js +1 -1
- package/lib/component/elements/resizer/DivResizer.js +3 -3
- package/lib/component/elements/resizer/Resizer.d.ts +1 -0
- package/lib/component/elements/resizer/SVGResizer.js +3 -3
- package/lib/component/elements/toggle/ToggleButtonGroup.js +2 -2
- package/lib/component/header/ApodizationOptionsPanel.d.ts +2 -0
- package/lib/component/header/ApodizationOptionsPanel.js +81 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +2 -1
- package/lib/component/header/AutoPeakPickingOptionPanel.js +40 -36
- package/lib/component/header/BaseLineCorrectionPanel.d.ts +1 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +89 -53
- package/lib/component/header/Header.js +7 -4
- package/lib/component/header/HeaderContainer.d.ts +7 -0
- package/lib/component/header/HeaderContainer.js +10 -0
- package/lib/component/header/ManualPhaseCorrectionPanel.js +27 -29
- package/lib/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib/component/header/ZeroFillingOptionsPanel.js +49 -46
- package/lib/component/header/Zones2DOptionPanel.js +11 -13
- package/lib/component/highlight/index.d.ts +27 -10
- package/lib/component/highlight/index.js +19 -17
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +11 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +32 -1
- package/lib/component/hooks/useExport.js +2 -2
- package/lib/component/hooks/useFilter.d.ts +1 -0
- package/lib/component/hooks/useFilter.js +7 -0
- package/lib/component/hooks/useFormatNumberByNucleus.js +3 -4
- package/lib/component/hooks/useToolsFunctions.js +1 -1
- package/lib/component/loader/DropZone.js +9 -3
- package/lib/component/loader/NoData.d.ts +3 -2
- package/lib/component/loader/NoData.js +31 -30
- package/lib/component/modal/AlignSpectraModal.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +9 -0
- package/lib/component/modal/EditPeakShapeModal.js +85 -0
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js +4 -5
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib/component/modal/PredictSpectraModal.js +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib/component/modal/editRange/EditRangeModal.d.ts +3 -3
- package/lib/component/modal/editRange/EditRangeModal.js +51 -56
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +9 -22
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +15 -58
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.d.ts +2 -0
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +34 -0
- package/lib/component/modal/editRange/forms/components/SignalFormTab.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/SignalFormTab.js +11 -14
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +18 -29
- package/lib/component/modal/editZone/SignalsForm.js +1 -1
- package/lib/component/modal/setting/DatabasesTabContent.d.ts +2 -1
- package/lib/component/modal/setting/DatabasesTabContent.js +29 -31
- package/lib/component/modal/setting/DisplayTabContent.d.ts +1 -5
- package/lib/component/modal/setting/DisplayTabContent.js +6 -15
- package/lib/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib/component/modal/setting/GeneralSettings.js +19 -12
- package/lib/component/modal/setting/GeneralTabContent.d.ts +3 -0
- package/lib/component/modal/setting/{ControllersTabContent.js → GeneralTabContent.js} +3 -3
- package/lib/component/modal/setting/ToolsTabContent.d.ts +3 -0
- package/lib/component/modal/setting/ToolsTabContent.js +100 -0
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -2
- package/lib/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib/component/modal/setting/settingsValidation.d.ts +150 -42
- package/lib/component/modal/setting/settingsValidation.js +6 -4
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +13 -15
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +5 -4
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +17 -21
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +4 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +5 -3
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +13 -5
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/Panels.js +10 -7
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +47 -22
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib/component/panels/PeaksPanel/PeaksTable.js +44 -13
- package/lib/component/panels/RangesPanel/RangesHeader.js +13 -4
- package/lib/component/panels/RangesPanel/RangesPanel.js +19 -19
- package/lib/component/panels/RangesPanel/RangesTableRow.js +4 -4
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +3 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +3 -3
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +4 -4
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +48 -30
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -3
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +5 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -7
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +7 -10
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
- package/lib/component/panels/SummaryPanel/utilities/{IsInView.d.ts → useInView.d.ts} +2 -2
- package/lib/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +13 -13
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +4 -0
- package/lib/component/panels/databasePanel/DatabasePanel.js +80 -34
- package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.d.ts +7 -0
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js +8 -0
- package/lib/component/panels/databasePanel/DatabaseTable.js +17 -12
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +2 -4
- package/lib/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.js +3 -14
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +2 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib/component/reducer/IgnoreActions.js +4 -0
- package/lib/component/reducer/Reducer.d.ts +45 -72
- package/lib/component/reducer/Reducer.js +38 -13
- package/lib/component/reducer/actions/DatabaseActions.d.ts +3 -2
- package/lib/component/reducer/actions/DatabaseActions.js +21 -3
- package/lib/component/reducer/actions/DomainActions.js +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts +14 -7
- package/lib/component/reducer/actions/FiltersActions.js +192 -32
- package/lib/component/reducer/actions/IntegralsActions.js +2 -2
- package/lib/component/reducer/actions/MoleculeActions.js +27 -14
- package/lib/component/reducer/actions/PeaksActions.d.ts +4 -1
- package/lib/component/reducer/actions/PeaksActions.js +38 -5
- package/lib/component/reducer/actions/PreferencesActions.js +32 -20
- package/lib/component/reducer/actions/RangesActions.d.ts +2 -2
- package/lib/component/reducer/actions/RangesActions.js +45 -11
- package/lib/component/reducer/actions/SpectrumsActions.js +7 -10
- package/lib/component/reducer/actions/ToolsActions.js +34 -84
- package/lib/component/reducer/helper/getSpectrum.d.ts +5 -0
- package/lib/component/reducer/helper/getSpectrum.js +14 -0
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +7 -0
- package/lib/component/reducer/helper/getStrongestPeak.js +14 -0
- package/lib/component/reducer/preferences/actions/addWorkspace.js +4 -4
- package/lib/component/reducer/preferences/actions/initPreferences.js +5 -5
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +1 -1
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +1 -1
- package/lib/component/reducer/preferences/actions/setPreferences.js +13 -16
- package/lib/component/reducer/preferences/actions/setWorkspace.js +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +7 -4
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +46 -67
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -4
- package/lib/component/reducer/preferences/{utilites → utilities}/checkKeysExists.d.ts +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/checkKeysExists.js +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/filterObject.d.ts +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/filterObject.js +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/flatObject.d.ts +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/flatObject.js +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/getActiveWorkspace.d.ts +2 -1
- package/lib/component/reducer/preferences/{utilites → utilities}/getActiveWorkspace.js +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/getPreferencesByWorkspace.d.ts +2 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.js +6 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/mapNucleiFormatting.d.ts +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/mapNucleiFormatting.js +0 -0
- package/lib/component/reducer/types/Types.d.ts +10 -1
- package/lib/component/reducer/types/Types.js +10 -1
- package/lib/component/tool/BrushX.js +2 -2
- package/lib/component/tool/BrushXY.js +5 -4
- package/lib/component/tool/CrossLinePointer.js +6 -5
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +2 -2
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +12 -3
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +3 -2
- package/lib/component/tool/FloatMoleculeStructures/index.js +13 -6
- package/lib/component/toolbar/BasicToolBar.js +3 -9
- package/lib/component/toolbar/FunctionToolBar.js +11 -27
- package/lib/component/toolbar/ToolTypes.d.ts +7 -1
- package/lib/component/toolbar/ToolTypes.js +122 -12
- package/lib/component/utility/Evaluate.js +1 -0
- package/lib/component/utility/Export.d.ts +7 -1
- package/lib/component/utility/Export.js +3 -3
- package/lib/component/utility/formatNumber.d.ts +1 -1
- package/lib/component/utility/formatNumber.js +4 -2
- package/lib/component/utility/isGoogleDocument.d.ts +1 -0
- package/lib/component/utility/isGoogleDocument.js +3 -0
- package/lib/component/utility/nmredataToNmrium.js +1 -2
- package/lib/component/utility/nmriumToNmredata.d.ts +2 -2
- package/lib/component/utility/nmriumToNmredata.js +2 -2
- package/lib/component/utility/util/nmredata/addSource.js +2 -2
- package/lib/component/utility/util/nmredata/addZones.js +3 -3
- package/lib/component/workspaces/Workspace.d.ts +22 -10
- package/lib/component/workspaces/basic.d.ts +2 -2
- package/lib/component/workspaces/basic.js +19 -32
- package/lib/component/workspaces/embedded.d.ts +2 -2
- package/lib/component/workspaces/embedded.js +21 -13
- package/lib/component/workspaces/exercise.d.ts +2 -2
- package/lib/component/workspaces/exercise.js +5 -36
- package/lib/component/workspaces/index.d.ts +5 -5
- package/lib/component/workspaces/prediction.d.ts +2 -2
- package/lib/component/workspaces/prediction.js +21 -17
- package/lib/component/workspaces/process1D.d.ts +2 -2
- package/lib/component/workspaces/process1D.js +21 -26
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts +2 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +70 -0
- package/lib/constants.js +1 -1
- package/lib/data/Filters.d.ts +2 -2
- package/lib/data/Filters.js +2 -2
- package/lib/data/FiltersManager.js +4 -4
- package/lib/data/PredictionManager.d.ts +0 -1
- package/lib/data/PredictionManager.js +22 -24
- package/lib/data/SpectraManager.d.ts +5 -12
- package/lib/data/SpectraManager.js +14 -29
- package/lib/data/constants/SignalsKinds.d.ts +0 -1
- package/lib/data/constants/SignalsKinds.js +0 -8
- package/lib/data/data1d/Data1DManager.js +13 -6
- package/lib/data/data1d/MultipleAnalysis.js +1 -0
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +5 -5
- package/lib/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +10 -12
- package/lib/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/index.js +2 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +14 -15
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -3
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -16
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +8 -0
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +24 -0
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +36 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +39 -16
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +4 -4
- package/lib/data/data1d/database.d.ts +5 -3
- package/lib/data/data1d/database.js +48 -7
- package/lib/data/data1d/filter1d/apodization.d.ts +25 -0
- package/lib/data/data1d/filter1d/apodization.js +63 -0
- package/lib/data/data1d/filter1d/autoPhaseCorrection.js +1 -1
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +24 -7
- package/lib/data/data1d/filter1d/baselineCorrection.js +10 -17
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.d.ts +9 -0
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.js +24 -0
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +4 -3
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +17 -13
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -3
- package/lib/data/migration/MigrationManager.d.ts +1 -1
- package/lib/data/migration/MigrationManager.js +3 -1
- package/lib/data/migration/migrateToVersion3.d.ts +1 -0
- package/lib/data/migration/migrateToVersion3.js +55 -0
- package/lib/data/molecules/Molecule.d.ts +15 -7
- package/lib/data/molecules/Molecule.js +5 -6
- package/lib/data/molecules/MoleculeManager.d.ts +4 -4
- package/lib/data/molecules/MoleculeManager.js +5 -5
- package/lib/data/types/data1d/SumOptions.d.ts +1 -1
- package/lib/data/utilities/FindUtilities.js +1 -3
- package/lib/data/utilities/RangeUtilities.js +5 -6
- package/lib/data/utilities/ZoneUtilities.js +1 -1
- package/lib/data/utilities/generateNumbersPowerOfX.d.ts +0 -1
- package/lib/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib/data/utilities/getSum.js +1 -3
- package/lib/data/utilities/isInRange.d.ts +7 -0
- package/lib/data/utilities/isInRange.js +4 -0
- package/lib/data/utilities/isMolFileEmpty.d.ts +1 -0
- package/lib/data/utilities/isMolFileEmpty.js +6 -0
- package/lib/types/NMRiumDataReturn.d.ts +15 -0
- package/lib/types/NMRiumDataReturn.js +1 -0
- package/lib/types/NMRiumGeneralPreferences.d.ts +8 -0
- package/lib/types/NMRiumGeneralPreferences.js +1 -0
- package/lib/types/NMRiumPanelPreferences.d.ts +16 -0
- package/lib/types/NMRiumPanelPreferences.js +1 -0
- package/lib/types/NMRiumToolBarPreferences.d.ts +21 -0
- package/lib/types/NMRiumToolBarPreferences.js +1 -0
- package/lib/types/PanelPreferencesType.d.ts +1 -7
- package/lib/types/Preferences.d.ts +5 -0
- package/lib/types/Preferences.js +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +75 -0
- package/lib-cjs/component/1d/Chart1D.js +4 -2
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +15 -8
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib-cjs/component/1d/IntegralResizable.js +4 -3
- package/lib-cjs/component/1d/IntegralsSeries.js +2 -6
- package/lib-cjs/component/1d/LinesSeries.js +5 -5
- package/lib-cjs/component/1d/SpectraTracker.js +2 -2
- package/lib-cjs/component/1d/Viewer1D.js +8 -13
- package/lib-cjs/component/1d/database/DatabaseElements.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +34 -26
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +10 -8
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +15 -13
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +1 -2
- package/lib-cjs/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +10 -11
- package/lib-cjs/component/1d/peaks/PeakAnnotations.js +31 -0
- package/lib-cjs/component/1d/peaks/PeaksShapes.js +40 -0
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +49 -0
- package/lib-cjs/component/1d/ranges/Range.js +6 -7
- package/lib-cjs/component/1d/ranges/Ranges.js +3 -4
- package/lib-cjs/component/1d/tool/BaseLineZones.js +3 -6
- package/lib-cjs/component/1d/tool/VerticalIndicator.js +1 -1
- package/lib-cjs/component/2d/Contours.js +9 -13
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/SignalDeltaLine.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +3 -3
- package/lib-cjs/component/2d/YAxis.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +2 -3
- package/lib-cjs/component/2d/zones/Signal.js +3 -3
- package/lib-cjs/component/2d/zones/Zone.js +3 -3
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +130 -73
- package/lib-cjs/component/NMRium.js +13 -5
- package/lib-cjs/component/SplitPaneWrapper.js +2 -2
- package/lib-cjs/component/context/GlobalContext.js +4 -4
- package/lib-cjs/component/elements/ActiveButton.js +33 -0
- package/lib-cjs/component/elements/Button.js +6 -6
- package/lib-cjs/component/elements/ButtonToolTip.js +1 -1
- package/lib-cjs/component/elements/CheckBox.js +3 -5
- package/lib-cjs/component/elements/CheckBoxCell.js +15 -0
- package/lib-cjs/component/elements/Input.js +1 -1
- package/lib-cjs/component/elements/Label.js +3 -3
- package/lib-cjs/component/elements/Logo.js +1 -1
- package/lib-cjs/component/elements/MoleculeSelection.js +1 -1
- package/lib-cjs/component/elements/NextPrev.js +1 -1
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +2 -1
- package/lib-cjs/component/elements/Select.js +6 -8
- package/lib-cjs/component/elements/Tab/Tab.js +1 -1
- package/lib-cjs/component/elements/Tab/Tabs.js +2 -1
- package/lib-cjs/component/elements/Table/Table.js +2 -2
- package/lib-cjs/component/elements/ToggleButton.js +5 -4
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -6
- package/lib-cjs/component/elements/accordion/AccordionItem.js +2 -2
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +4 -2
- package/lib-cjs/component/elements/formik/FormikOnChange.js +10 -4
- package/lib-cjs/component/elements/formik/Input.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/Modal.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +1 -1
- package/lib-cjs/component/elements/resizer/DivResizer.js +3 -3
- package/lib-cjs/component/elements/resizer/SVGResizer.js +2 -2
- package/lib-cjs/component/elements/toggle/ToggleButtonGroup.js +2 -2
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +110 -0
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +39 -35
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +87 -50
- package/lib-cjs/component/header/Header.js +7 -4
- package/lib-cjs/component/header/HeaderContainer.js +14 -0
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +26 -28
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +70 -44
- package/lib-cjs/component/header/Zones2DOptionPanel.js +11 -13
- package/lib-cjs/component/highlight/index.js +20 -18
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +32 -1
- package/lib-cjs/component/hooks/useExport.js +2 -2
- package/lib-cjs/component/hooks/useFilter.js +14 -0
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +2 -3
- package/lib-cjs/component/hooks/useToolsFunctions.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +9 -3
- package/lib-cjs/component/loader/NoData.js +31 -30
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
- package/lib-cjs/component/modal/EditPeakShapeModal.js +113 -0
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +4 -5
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +49 -54
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +9 -22
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +14 -57
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +38 -0
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormTab.js +13 -16
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +18 -29
- package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +32 -34
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +6 -15
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/GeneralSettings.js +19 -12
- package/lib-cjs/component/modal/setting/{ControllersTabContent.js → GeneralTabContent.js} +3 -3
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +105 -0
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib-cjs/component/modal/setting/settingsValidation.js +6 -4
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +12 -14
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +16 -20
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +12 -4
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
- package/lib-cjs/component/panels/Panels.js +10 -7
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +45 -20
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +42 -11
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +11 -2
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +18 -18
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +47 -29
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +3 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +5 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -7
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +7 -10
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
- package/lib-cjs/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +12 -12
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +78 -32
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabaseStructureSearchModal.js +15 -0
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +16 -11
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +2 -4
- package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +3 -14
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib-cjs/component/reducer/IgnoreActions.js +4 -0
- package/lib-cjs/component/reducer/Reducer.js +38 -16
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +22 -3
- package/lib-cjs/component/reducer/actions/DomainActions.js +1 -1
- package/lib-cjs/component/reducer/actions/FiltersActions.js +198 -32
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +2 -2
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +27 -14
- package/lib-cjs/component/reducer/actions/PeaksActions.js +40 -4
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +30 -18
- package/lib-cjs/component/reducer/actions/RangesActions.js +46 -12
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +5 -8
- package/lib-cjs/component/reducer/actions/ToolsActions.js +31 -104
- package/lib-cjs/component/reducer/helper/getSpectrum.js +18 -0
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +18 -0
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +4 -7
- package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +5 -5
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/setPanelsPreferences.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +16 -16
- package/lib-cjs/component/reducer/preferences/actions/setWorkspace.js +1 -1
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +7 -4
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -4
- package/lib-cjs/component/reducer/preferences/{utilites → utilities}/checkKeysExists.js +0 -0
- package/lib-cjs/component/reducer/preferences/{utilites → utilities}/filterObject.js +0 -0
- package/lib-cjs/component/reducer/preferences/{utilites → utilities}/flatObject.js +0 -0
- package/lib-cjs/component/reducer/preferences/{utilites → utilities}/getActiveWorkspace.js +0 -0
- package/lib-cjs/component/reducer/preferences/{utilites → utilities}/getPreferencesByWorkspace.js +3 -1
- package/lib-cjs/component/reducer/preferences/{utilites → utilities}/mapNucleiFormatting.js +0 -0
- package/lib-cjs/component/reducer/types/Types.js +13 -4
- package/lib-cjs/component/tool/BrushX.js +2 -2
- package/lib-cjs/component/tool/BrushXY.js +5 -4
- package/lib-cjs/component/tool/CrossLinePointer.js +6 -5
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +11 -2
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +13 -6
- package/lib-cjs/component/toolbar/BasicToolBar.js +3 -9
- package/lib-cjs/component/toolbar/FunctionToolBar.js +10 -26
- package/lib-cjs/component/toolbar/ToolTypes.js +122 -12
- package/lib-cjs/component/utility/Evaluate.js +1 -0
- package/lib-cjs/component/utility/Export.js +4 -3
- package/lib-cjs/component/utility/formatNumber.js +3 -1
- package/lib-cjs/component/utility/isGoogleDocument.js +7 -0
- package/lib-cjs/component/utility/nmredataToNmrium.js +1 -2
- package/lib-cjs/component/utility/util/nmredata/addSource.js +2 -2
- package/lib-cjs/component/utility/util/nmredata/addZones.js +3 -6
- package/lib-cjs/component/workspaces/basic.js +19 -32
- package/lib-cjs/component/workspaces/embedded.js +21 -13
- package/lib-cjs/component/workspaces/exercise.js +5 -36
- package/lib-cjs/component/workspaces/prediction.js +21 -17
- package/lib-cjs/component/workspaces/process1D.js +21 -26
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +73 -0
- package/lib-cjs/constants.js +1 -1
- package/lib-cjs/data/Filters.js +3 -3
- package/lib-cjs/data/FiltersManager.js +4 -7
- package/lib-cjs/data/PredictionManager.js +22 -24
- package/lib-cjs/data/SpectraManager.js +14 -29
- package/lib-cjs/data/constants/SignalsKinds.js +0 -8
- package/lib-cjs/data/data1d/Data1DManager.js +13 -6
- package/lib-cjs/data/data1d/MultipleAnalysis.js +1 -0
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib-cjs/data/data1d/Spectrum1D/convertDataToFloat64Array.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +10 -15
- package/lib-cjs/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/index.js +3 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +14 -15
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -3
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -19
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +28 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +41 -17
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +1 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -5
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +4 -7
- package/lib-cjs/data/data1d/database.js +49 -8
- package/lib-cjs/data/data1d/filter1d/apodization.js +70 -0
- package/lib-cjs/data/data1d/filter1d/autoPhaseCorrection.js +1 -1
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +11 -18
- package/lib-cjs/data/data1d/filter1d/zeroFillingAndApodization.js +30 -0
- package/lib-cjs/data/data2d/Processing2D.js +4 -3
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +17 -16
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +3 -6
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -6
- package/lib-cjs/data/migration/MigrationManager.js +3 -1
- package/lib-cjs/data/migration/migrateToVersion3.js +58 -0
- package/lib-cjs/data/molecules/Molecule.js +5 -6
- package/lib-cjs/data/molecules/MoleculeManager.js +5 -5
- package/lib-cjs/data/utilities/FindUtilities.js +1 -3
- package/lib-cjs/data/utilities/RangeUtilities.js +8 -6
- package/lib-cjs/data/utilities/ZoneUtilities.js +1 -1
- package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib-cjs/data/utilities/getSum.js +1 -3
- package/lib-cjs/data/utilities/isInRange.js +7 -0
- package/lib-cjs/data/utilities/isMolFileEmpty.js +10 -0
- package/lib-cjs/types/NMRiumDataReturn.js +2 -0
- package/lib-cjs/types/NMRiumGeneralPreferences.js +2 -0
- package/lib-cjs/types/NMRiumPanelPreferences.js +2 -0
- package/lib-cjs/types/NMRiumToolBarPreferences.js +2 -0
- package/lib-cjs/types/Preferences.js +2 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +48 -46
- package/lib/component/1d/PeakAnnotations.js +0 -43
- package/lib/component/1d/multiplicityTree/TempMultiplicityTree.d.ts +0 -2
- package/lib/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -14
- package/lib/component/modal/setting/ControllersTabContent.d.ts +0 -3
- package/lib/component/panels/databasePanel/useDatabases.d.ts +0 -5
- package/lib/component/panels/databasePanel/useDatabases.js +0 -10
- package/lib/component/reducer/preferences/actions/resetPreferences.d.ts +0 -3
- package/lib/component/reducer/preferences/actions/resetPreferences.js +0 -14
- package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +0 -4
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +0 -14
- package/lib/data/data1d/filter1d/lineBroadening.js +0 -57
- package/lib/data/utilities/generateID.d.ts +0 -1
- package/lib/data/utilities/generateID.js +0 -9
- package/lib-cjs/component/1d/PeakAnnotations.js +0 -48
- package/lib-cjs/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -20
- package/lib-cjs/component/panels/databasePanel/useDatabases.js +0 -14
- package/lib-cjs/component/reducer/preferences/actions/resetPreferences.js +0 -18
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +0 -63
- package/lib-cjs/data/utilities/generateID.js +0 -12
|
@@ -90,7 +90,7 @@ const accordionItems = [
|
|
|
90
90
|
mode: null,
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
|
-
title: '
|
|
93
|
+
title: 'Chemical structures',
|
|
94
94
|
component: (0, jsx_runtime_1.jsx)(MoleculePanel_1.default, {}),
|
|
95
95
|
hidePreferenceKey: 'structuresPanel',
|
|
96
96
|
mode: null,
|
|
@@ -118,14 +118,18 @@ exports.TOOLS_PANELS_ACCORDION = {
|
|
|
118
118
|
null: 'Spectra',
|
|
119
119
|
peakPicking: 'Peaks',
|
|
120
120
|
integral: 'Integrals',
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
rangePicking: 'Ranges',
|
|
122
|
+
zonePicking: 'Zones',
|
|
123
123
|
multipleSpectraAnalysis: 'Multiple Spectra Analysis',
|
|
124
124
|
};
|
|
125
125
|
function usePanelPreferences() {
|
|
126
126
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
127
127
|
return (0, react_1.useCallback)((item) => {
|
|
128
|
-
|
|
128
|
+
const defaultValue = {
|
|
129
|
+
display: false,
|
|
130
|
+
open: false,
|
|
131
|
+
};
|
|
132
|
+
return (0, get_1.default)(preferences.current, `display.panels.${item.hidePreferenceKey}`, defaultValue);
|
|
129
133
|
}, [preferences]);
|
|
130
134
|
}
|
|
131
135
|
function PanelsInner({ displayerMode: displayedMode }) {
|
|
@@ -133,15 +137,14 @@ function PanelsInner({ displayerMode: displayedMode }) {
|
|
|
133
137
|
const isExperimental = (0, useCheckExperimentalFeature_1.default)();
|
|
134
138
|
const check = (0, react_1.useCallback)((item) => {
|
|
135
139
|
const panelOptions = getPanelPreferences(item);
|
|
136
|
-
return ((panelOptions?.
|
|
137
|
-
panelOptions?.display === true &&
|
|
140
|
+
return ((panelOptions?.display &&
|
|
138
141
|
item.isExperimental === undefined &&
|
|
139
142
|
(item.mode == null || item.mode === displayedMode)) ||
|
|
140
143
|
(item.isExperimental && isExperimental));
|
|
141
144
|
}, [displayedMode, getPanelPreferences, isExperimental]);
|
|
142
145
|
const isOpened = (0, react_1.useCallback)((item) => {
|
|
143
146
|
const panelOptions = getPanelPreferences(item);
|
|
144
|
-
return panelOptions?.
|
|
147
|
+
return panelOptions?.display && panelOptions?.open;
|
|
145
148
|
}, [getPanelPreferences]);
|
|
146
149
|
return ((0, jsx_runtime_1.jsx)("div", { style: { width: '100%', height: '100%', flex: '1 1 0%' }, children: (0, jsx_runtime_1.jsx)(analysis_ui_components_1.Accordion, { children: accordionItems.map((item) => {
|
|
147
150
|
return (check(item) && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Accordion.Item, { title: item.title, defaultOpened: isOpened(item), children: item.component }, item.title)));
|
|
@@ -6,11 +6,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
|
+
const cheminfo_font_1 = require("cheminfo-font");
|
|
10
|
+
const Peaks_1 = __importDefault(require("cheminfo-font/lib-react-cjs/lib-react-tsx/nmr/Peaks"));
|
|
9
11
|
const react_2 = require("react");
|
|
12
|
+
const fa_1 = require("react-icons/fa");
|
|
13
|
+
const isInRange_1 = __importDefault(require("../../../data/utilities/isInRange"));
|
|
10
14
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
11
15
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
12
16
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
17
|
+
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
18
|
+
const ToggleButton_1 = __importDefault(require("../../elements/ToggleButton"));
|
|
19
|
+
const Alert_1 = require("../../elements/popup/Alert");
|
|
13
20
|
const Modal_1 = require("../../elements/popup/Modal");
|
|
21
|
+
const useCheckExperimentalFeature_1 = __importDefault(require("../../hooks/useCheckExperimentalFeature"));
|
|
14
22
|
const useFormatNumberByNucleus_1 = require("../../hooks/useFormatNumberByNucleus");
|
|
15
23
|
const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
|
|
16
24
|
const Types_1 = require("../../reducer/types/Types");
|
|
@@ -19,12 +27,14 @@ const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHead
|
|
|
19
27
|
const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader"));
|
|
20
28
|
const PeaksPreferences_1 = __importDefault(require("./PeaksPreferences"));
|
|
21
29
|
const PeaksTable_1 = __importDefault(require("./PeaksTable"));
|
|
22
|
-
function PeaksPanelInner({ peaks, info, xDomain, activeTab, }) {
|
|
30
|
+
function PeaksPanelInner({ peaks, info, xDomain, activeTab, peaksOptions, }) {
|
|
23
31
|
const [filterIsActive, setFilterIsActive] = (0, react_2.useState)(false);
|
|
24
32
|
const [isFlipped, setFlipStatus] = (0, react_2.useState)(false);
|
|
25
33
|
const format = (0, useFormatNumberByNucleus_1.useFormatNumberByNucleus)(info.nucleus);
|
|
26
34
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
27
35
|
const modal = (0, Modal_1.useModal)();
|
|
36
|
+
const alert = (0, Alert_1.useAlert)();
|
|
37
|
+
const isExperimental = (0, useCheckExperimentalFeature_1.default)();
|
|
28
38
|
const settingRef = (0, react_2.useRef)();
|
|
29
39
|
const yesHandler = (0, react_2.useCallback)(() => {
|
|
30
40
|
dispatch({ type: Types_1.DELETE_PEAK_NOTATION, data: null });
|
|
@@ -46,33 +56,41 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, }) {
|
|
|
46
56
|
setFilterIsActive(!filterIsActive);
|
|
47
57
|
}, [filterIsActive]);
|
|
48
58
|
const filteredPeaks = (0, react_2.useMemo)(() => {
|
|
49
|
-
function isInRange(value) {
|
|
50
|
-
const factor = 100000;
|
|
51
|
-
return (value * factor >= xDomain[0] * factor &&
|
|
52
|
-
value * factor <= xDomain[1] * factor);
|
|
53
|
-
}
|
|
54
59
|
if (peaks?.values) {
|
|
60
|
+
const [from, to] = xDomain;
|
|
55
61
|
const _peaks = filterIsActive
|
|
56
|
-
? peaks.values.filter((peak) =>
|
|
62
|
+
? peaks.values.filter((peak) => (0, isInRange_1.default)(peak.x, { from, to }))
|
|
57
63
|
: peaks.values;
|
|
58
64
|
return _peaks
|
|
59
65
|
.map((peak) => {
|
|
60
|
-
const
|
|
66
|
+
const { x, y, width, ...peakProperties } = peak;
|
|
67
|
+
const value = Number(format(x));
|
|
61
68
|
return {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
peakWidth: peak.width ? peak.width : '',
|
|
69
|
-
isConstantlyHighlighted: isInRange(value),
|
|
69
|
+
...peakProperties,
|
|
70
|
+
x,
|
|
71
|
+
xHz: info?.originFrequency ? value * info.originFrequency : '',
|
|
72
|
+
y,
|
|
73
|
+
width: width ? width : '',
|
|
74
|
+
isConstantlyHighlighted: (0, isInRange_1.default)(value, { from, to }),
|
|
70
75
|
};
|
|
71
76
|
})
|
|
72
|
-
.sort((prev, next) => prev.
|
|
77
|
+
.sort((prev, next) => prev.x - next.x);
|
|
73
78
|
}
|
|
74
79
|
return [];
|
|
75
80
|
}, [filterIsActive, format, info, peaks, xDomain]);
|
|
81
|
+
const optimizePeaksHandler = () => {
|
|
82
|
+
const [from, to] = xDomain;
|
|
83
|
+
const filterPeaks = peaks.values.filter((peak) => (0, isInRange_1.default)(peak.x, { from, to }));
|
|
84
|
+
if (filterPeaks.length <= 4) {
|
|
85
|
+
dispatch({ type: Types_1.OPTIMIZE_PEAKS, payload: { peaks: filterPeaks } });
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
alert.error('optimization can be done on no more than 4 peaks');
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const togglePeaksShapesHandler = (key) => {
|
|
92
|
+
dispatch({ type: Types_1.TOGGLE_PEAKS_SHAPES, payload: { key } });
|
|
93
|
+
};
|
|
76
94
|
return ((0, jsx_runtime_1.jsxs)("div", { css: [
|
|
77
95
|
BasicPanelStyle_1.tablePanelStyle,
|
|
78
96
|
isFlipped &&
|
|
@@ -84,14 +102,21 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, }) {
|
|
|
84
102
|
}
|
|
85
103
|
}
|
|
86
104
|
`,
|
|
87
|
-
], children: [!isFlipped && ((0, jsx_runtime_1.jsx)(DefaultPanelHeader_1.default, { counter: peaks?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Peaks", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all peaks' : 'Hide peaks out of view', filterIsActive: filterIsActive, counterFiltered: filteredPeaks.length, showSettingButton: true, onSettingClick: settingsPanelHandler
|
|
105
|
+
], children: [!isFlipped && ((0, jsx_runtime_1.jsx)(DefaultPanelHeader_1.default, { counter: peaks?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Peaks", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all peaks' : 'Hide peaks out of view', filterIsActive: filterIsActive, counterFiltered: filteredPeaks.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: isExperimental && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ToggleButton_1.default, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksOptions.showPeaksShapes
|
|
106
|
+
? 'Hide peaks shapes'
|
|
107
|
+
: 'Show peaks shapes', popupPlacement: "right", onClick: () => togglePeaksShapesHandler('showPeaksShapes'), disabled: !peaks?.values || peaks.values.length === 0, children: (0, jsx_runtime_1.jsx)(Peaks_1.default, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { style: { marginLeft: '2px', marginRight: '2px' }, popupTitle: peaksOptions.showPeaksSum
|
|
108
|
+
? 'Hide peaks sum'
|
|
109
|
+
: 'Show peaks sum', popupPlacement: "right", onClick: () => togglePeaksShapesHandler('showPeaksSum'), disabled: !peaks?.values || peaks.values.length === 0, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrFt, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", onClick: optimizePeaksHandler, style: { width: '24px', padding: 0 }, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
110
|
+
display: 'flex',
|
|
111
|
+
justifyContent: 'center',
|
|
112
|
+
}, children: (0, jsx_runtime_1.jsx)(fa_1.FaThinkPeaks, {}) }) })] })) })), 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)(PeaksTable_1.default, { data: filteredPeaks, activeTab: activeTab })) : ((0, jsx_runtime_1.jsx)(PeaksPreferences_1.default, { ref: settingRef })) })] }));
|
|
88
113
|
}
|
|
89
114
|
const MemoizedPeaksPanel = (0, react_2.memo)(PeaksPanelInner);
|
|
90
115
|
const emptyData = { peaks: null, info: {} };
|
|
91
116
|
function PeaksPanel() {
|
|
92
|
-
const { xDomain, activeTab } = (0, ChartContext_1.useChartData)();
|
|
117
|
+
const { xDomain, activeTab, toolOptions: { data: { peaksOptions }, }, } = (0, ChartContext_1.useChartData)();
|
|
93
118
|
const { peaks, info } = (0, useSpectrum_1.default)(emptyData);
|
|
94
119
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
95
|
-
return ((0, jsx_runtime_1.jsx)(MemoizedPeaksPanel, { ...{ peaks, info, xDomain, activeTab, preferences } }));
|
|
120
|
+
return ((0, jsx_runtime_1.jsx)(MemoizedPeaksPanel, { ...{ peaks, info, xDomain, activeTab, preferences, peaksOptions } }));
|
|
96
121
|
}
|
|
97
122
|
exports.default = PeaksPanel;
|
|
@@ -44,6 +44,23 @@ const formatFields = [
|
|
|
44
44
|
checkControllerName: 'intensity.show',
|
|
45
45
|
formatControllerName: 'intensity.format',
|
|
46
46
|
},
|
|
47
|
+
{
|
|
48
|
+
id: 6,
|
|
49
|
+
label: 'kind :',
|
|
50
|
+
checkControllerName: 'fwhm.show',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 7,
|
|
54
|
+
label: 'fwhm :',
|
|
55
|
+
checkControllerName: 'fwhm.show',
|
|
56
|
+
formatControllerName: 'fwhm.format',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 8,
|
|
60
|
+
label: 'mu :',
|
|
61
|
+
checkControllerName: 'mu.show',
|
|
62
|
+
formatControllerName: 'mu.format',
|
|
63
|
+
},
|
|
47
64
|
];
|
|
48
65
|
function PeaksPreferences(props, ref) {
|
|
49
66
|
const alert = (0, Alert_1.useAlert)();
|
|
@@ -11,12 +11,17 @@ const DispatchContext_1 = require("../../context/DispatchContext");
|
|
|
11
11
|
const EditableColumn_1 = __importDefault(require("../../elements/EditableColumn"));
|
|
12
12
|
const ReactTable_1 = __importDefault(require("../../elements/ReactTable/ReactTable"));
|
|
13
13
|
const addCustomColumn_1 = __importDefault(require("../../elements/ReactTable/utility/addCustomColumn"));
|
|
14
|
+
const Modal_1 = require("../../elements/popup/Modal");
|
|
15
|
+
const options_1 = require("../../elements/popup/options");
|
|
14
16
|
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
17
|
+
const EditPeakShapeModal_1 = __importDefault(require("../../modal/EditPeakShapeModal"));
|
|
15
18
|
const Types_1 = require("../../reducer/types/Types");
|
|
16
19
|
const formatNumber_1 = require("../../utility/formatNumber");
|
|
17
20
|
const NoTableData_1 = __importDefault(require("../extra/placeholder/NoTableData"));
|
|
18
21
|
function PeaksTable({ activeTab, data }) {
|
|
19
22
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
23
|
+
const modal = (0, Modal_1.useModal)();
|
|
24
|
+
const peaksPreferences = (0, usePanelPreferences_1.usePanelPreferences)('peaks', activeTab);
|
|
20
25
|
const deletePeakHandler = (0, react_1.useCallback)((e, row) => {
|
|
21
26
|
e.preventDefault();
|
|
22
27
|
e.stopPropagation();
|
|
@@ -26,7 +31,15 @@ function PeaksTable({ activeTab, data }) {
|
|
|
26
31
|
data: { id: params.id, xIndex: params.xIndex },
|
|
27
32
|
});
|
|
28
33
|
}, [dispatch]);
|
|
29
|
-
const
|
|
34
|
+
const editPeakHandler = (0, react_1.useCallback)((e, row) => {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
e.stopPropagation();
|
|
37
|
+
modal.show((0, jsx_runtime_1.jsx)(EditPeakShapeModal_1.default, { peak: row.original, peaksPreferences: peaksPreferences }), {
|
|
38
|
+
position: options_1.positions.MIDDLE_RIGHT,
|
|
39
|
+
transition: options_1.transitions.SCALE,
|
|
40
|
+
isBackgroundBlur: false,
|
|
41
|
+
});
|
|
42
|
+
}, [modal, peaksPreferences]);
|
|
30
43
|
const saveDeltaPPMRefsHandler = (0, react_1.useCallback)((event, row) => {
|
|
31
44
|
const shiftValue = parseFloat(event.target.value) - parseFloat(row.value);
|
|
32
45
|
dispatch({ type: Types_1.SHIFT_SPECTRUM, shiftValue });
|
|
@@ -43,27 +56,45 @@ function PeaksTable({ activeTab, data }) {
|
|
|
43
56
|
showWhen: 'deltaPPM.show',
|
|
44
57
|
index: 3,
|
|
45
58
|
Header: 'δ (ppm)',
|
|
46
|
-
accessor: (row) => (0, formatNumber_1.formatNumber)(row.
|
|
47
|
-
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: (0, formatNumber_1.formatNumber)(row.original.
|
|
59
|
+
accessor: (row) => (0, formatNumber_1.formatNumber)(row.x, peaksPreferences.deltaPPM.format),
|
|
60
|
+
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: (0, formatNumber_1.formatNumber)(row.original.x, peaksPreferences.deltaPPM.format), onSave: (event) => saveDeltaPPMRefsHandler(event, row.original), type: "number" })),
|
|
48
61
|
},
|
|
49
62
|
{
|
|
50
63
|
showWhen: 'deltaHz.show',
|
|
51
64
|
index: 4,
|
|
52
65
|
Header: 'δ (Hz)',
|
|
53
|
-
accessor: (row) => (0, formatNumber_1.formatNumber)(row.
|
|
66
|
+
accessor: (row) => (0, formatNumber_1.formatNumber)(row.xHz, peaksPreferences.deltaHz.format),
|
|
54
67
|
},
|
|
55
68
|
{
|
|
56
69
|
showWhen: 'intensity.show',
|
|
57
70
|
index: 5,
|
|
58
71
|
Header: 'Intensity',
|
|
59
72
|
style: { maxWidth: '80px' },
|
|
60
|
-
accessor: (row) => (0, formatNumber_1.formatNumber)(row.
|
|
73
|
+
accessor: (row) => (0, formatNumber_1.formatNumber)(row.y, peaksPreferences.intensity.format),
|
|
61
74
|
},
|
|
62
75
|
{
|
|
63
76
|
showWhen: 'peakWidth.show',
|
|
64
77
|
index: 6,
|
|
65
78
|
Header: 'Width (Hz)',
|
|
66
|
-
accessor: (row) => (0, formatNumber_1.formatNumber)(row.
|
|
79
|
+
accessor: (row) => (0, formatNumber_1.formatNumber)(row.width, peaksPreferences.peakWidth.format),
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
showWhen: 'showKind',
|
|
83
|
+
index: 7,
|
|
84
|
+
Header: 'Kind',
|
|
85
|
+
accessor: 'shape.kind',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
showWhen: 'fwhm.show',
|
|
89
|
+
index: 8,
|
|
90
|
+
Header: 'fwhm',
|
|
91
|
+
accessor: (row) => (0, formatNumber_1.formatNumber)(row.shape?.fwhm, peaksPreferences.fwhm.format),
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
showWhen: 'mu.show',
|
|
95
|
+
index: 9,
|
|
96
|
+
Header: 'mu',
|
|
97
|
+
accessor: (row) => (0, formatNumber_1.formatNumber)(row.shape?.mu, peaksPreferences.mu.format),
|
|
67
98
|
},
|
|
68
99
|
], [peaksPreferences, saveDeltaPPMRefsHandler]);
|
|
69
100
|
const initialColumns = (0, react_1.useMemo)(() => [
|
|
@@ -72,13 +103,13 @@ function PeaksTable({ activeTab, data }) {
|
|
|
72
103
|
Header: '',
|
|
73
104
|
style: {
|
|
74
105
|
width: '1%',
|
|
75
|
-
maxWidth: '
|
|
76
|
-
minWidth: '
|
|
106
|
+
maxWidth: '48px',
|
|
107
|
+
minWidth: '48px',
|
|
77
108
|
},
|
|
78
|
-
id: '
|
|
79
|
-
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "delete-button", onClick: (e) => deletePeakHandler(e, row), children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) })),
|
|
109
|
+
id: 'actions',
|
|
110
|
+
Cell: ({ row }) => ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-around' }, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", className: "edit-button", onClick: (e) => editPeakHandler(e, row), children: (0, jsx_runtime_1.jsx)(fa_1.FaEdit, {}) }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "delete-button", onClick: (e) => deletePeakHandler(e, row), children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) })] })),
|
|
80
111
|
},
|
|
81
|
-
], [deletePeakHandler]);
|
|
112
|
+
], [deletePeakHandler, editPeakHandler]);
|
|
82
113
|
const tableColumns = (0, react_1.useMemo)(() => {
|
|
83
114
|
let columns = [...initialColumns];
|
|
84
115
|
for (const col of COLUMNS) {
|
|
@@ -25,6 +25,7 @@ const Types_1 = require("../../reducer/types/Types");
|
|
|
25
25
|
const Export_1 = require("../../utility/Export");
|
|
26
26
|
const formatNumber_1 = require("../../utility/formatNumber");
|
|
27
27
|
const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
|
|
28
|
+
const useEditRangeModal_1 = __importDefault(require("./hooks/useEditRangeModal"));
|
|
28
29
|
const style = (0, react_1.css) `
|
|
29
30
|
.btn {
|
|
30
31
|
background-color: transparent;
|
|
@@ -130,10 +131,18 @@ function RangesHeader({ ranges, info, onUnlink, onFilterActivated, onSettingClic
|
|
|
130
131
|
payload: flag,
|
|
131
132
|
});
|
|
132
133
|
}, [dispatch]);
|
|
134
|
+
const { editRange } = (0, useEditRangeModal_1.default)();
|
|
135
|
+
const addRangeHandler = (0, react_2.useCallback)(() => {
|
|
136
|
+
dispatch({
|
|
137
|
+
type: Types_1.ADD_RANGE,
|
|
138
|
+
payload: { id: 'new' },
|
|
139
|
+
});
|
|
140
|
+
editRange(true);
|
|
141
|
+
}, [dispatch, editRange]);
|
|
133
142
|
return ((0, jsx_runtime_1.jsx)("div", { css: style, children: (0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { counter: ranges?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Ranges", onFilter: onFilterActivated, filterToolTip: isFilterActive ? 'Show all ranges' : 'Hide ranges out of view', filterIsActive: isFilterActive, counterFiltered: filterCounter, showSettingButton: true, onSettingClick: onSettingClick, children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Preview publication string", popupPlacement: "right", onClick: saveAsHTMLHandler, className: "btn preview-publication-icon", children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: currentSum
|
|
134
143
|
? `Change Ranges Sum (${Number(currentSum).toFixed(2)})`
|
|
135
|
-
: 'Change Ranges Sum', popupPlacement: "right", onClick: showChangeRangesSumModal, className: "btn icon", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Remove all Assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !ranges || !ranges.values || ranges.values.length === 0, className: "btn icon", children: (0, jsx_runtime_1.jsx)(fa_1.FaUnlink, {}) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, {
|
|
144
|
+
: 'Change Ranges Sum', popupPlacement: "right", onClick: showChangeRangesSumModal, className: "btn icon", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Remove all Assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !ranges || !ranges.values || ranges.values.length === 0, className: "btn icon", children: (0, jsx_runtime_1.jsx)(fa_1.FaUnlink, {}) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: showMultiplicityTrees
|
|
136
145
|
? 'Hide Multiplicity Trees in Spectrum'
|
|
137
|
-
: 'Show Multiplicity Trees in Spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, defaultValue: showRangesIntegrals, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { className: "icon", popupTitle: "fix integral values", popupPlacement: "right", onClick: changeSumConstantFlagHandler, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) })] }) }));
|
|
146
|
+
: 'Show Multiplicity Trees in Spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, defaultValue: showRangesIntegrals, disabled: !ranges || !ranges.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { className: "icon", popupTitle: "fix integral values", popupPlacement: "right", onClick: changeSumConstantFlagHandler, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Add range", popupPlacement: "right", onClick: addRangeHandler, className: "btn icon", children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) })] }) }));
|
|
138
147
|
}
|
|
139
148
|
exports.default = RangesHeader;
|
|
@@ -103,24 +103,24 @@ function RangesTablePanelInner({ ranges, data, info, xDomain, preferences, activ
|
|
|
103
103
|
settingRef.current.saveSetting();
|
|
104
104
|
setFlipStatus(false);
|
|
105
105
|
}, []);
|
|
106
|
-
return ((0, jsx_runtime_1.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
106
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: [
|
|
107
|
+
BasicPanelStyle_1.tablePanelStyle,
|
|
108
|
+
isFlipped &&
|
|
109
|
+
(0, react_1.css) `
|
|
110
|
+
th {
|
|
111
|
+
position: relative;
|
|
112
|
+
}
|
|
113
|
+
`,
|
|
114
|
+
], children: [!isFlipped && ((0, jsx_runtime_1.jsx)(RangesHeader_1.default, { ...{
|
|
115
|
+
ranges,
|
|
116
|
+
info,
|
|
117
|
+
activeTab,
|
|
118
|
+
molecules,
|
|
119
|
+
showRangesIntegrals,
|
|
120
|
+
showMultiplicityTrees,
|
|
121
|
+
showJGraph,
|
|
122
|
+
isFilterActive,
|
|
123
|
+
}, onUnlink: unlinkRangeHandler, onFilterActivated: filterHandler, onSettingClick: settingsPanelHandler, filterCounter: rangesData.length })), 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)("div", { className: "table-container", children: rangesData && rangesData.length > 0 ? ((0, jsx_runtime_1.jsx)(RangesTable_1.default, { activeTab: activeTab, tableData: rangesData, onUnlink: unlinkRangeHandler, context: contextMenu, preferences: preferences, info: info })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, {})) })) : ((0, jsx_runtime_1.jsx)(RangesPreferences_1.default, { ref: settingRef })) })] }));
|
|
124
124
|
}
|
|
125
125
|
const MemoizedRangesTablePanel = (0, react_2.memo)(RangesTablePanelInner);
|
|
126
126
|
const emptyData = { ranges: {}, data: {}, info: {} };
|
|
@@ -30,10 +30,10 @@ const ConstantlyHighlightedRowStyle = (0, react_1.css) `
|
|
|
30
30
|
function RangesTableRow({ rowData, onUnlink, onContextMenu, preferences, info, }) {
|
|
31
31
|
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
32
32
|
const assignmentRange = (0, AssignmentsContext_1.useAssignment)(rowData.id);
|
|
33
|
-
const highlightRange = (0, highlight_1.useHighlight)([assignmentRange.id].concat(assignmentRange.assigned?.x || []).concat((0, filterForIDsWithAssignment_1.filterForIDsWithAssignment)(assignmentData, rowData.signals.map((_signal) => _signal.id))), { type: highlight_1.
|
|
34
|
-
const highlightRangeAssignmentsColumn = (0, highlight_1.useHighlight)(assignmentRange.assigned?.x || [], { type: highlight_1.
|
|
33
|
+
const highlightRange = (0, highlight_1.useHighlight)([assignmentRange.id].concat(assignmentRange.assigned?.x || []).concat((0, filterForIDsWithAssignment_1.filterForIDsWithAssignment)(assignmentData, rowData.signals.map((_signal) => _signal.id))), { type: highlight_1.HighlightEventSource.RANGE });
|
|
34
|
+
const highlightRangeAssignmentsColumn = (0, highlight_1.useHighlight)(assignmentRange.assigned?.x || [], { type: highlight_1.HighlightEventSource.RANGE });
|
|
35
35
|
const assignmentSignal = (0, AssignmentsContext_1.useAssignment)(rowData.tableMetaInfo.id);
|
|
36
|
-
const highlightSignal = (0, highlight_1.useHighlight)([assignmentSignal.id].concat(assignmentSignal.assigned?.x || []), { type: highlight_1.
|
|
36
|
+
const highlightSignal = (0, highlight_1.useHighlight)([assignmentSignal.id].concat(assignmentSignal.assigned?.x || []), { type: highlight_1.HighlightEventSource.SIGNAL });
|
|
37
37
|
const highlightData = (0, highlight_1.useHighlightData)();
|
|
38
38
|
const [unlinkRangeButtonVisibility, showUnlinkRangeButton] = (0, react_2.useState)(false);
|
|
39
39
|
const [unlinkSignalButtonVisibility, showUnlinkSignalButton] = (0, react_2.useState)(false);
|
|
@@ -33,6 +33,6 @@ const selectBoxStyle = {
|
|
|
33
33
|
};
|
|
34
34
|
function ActionsColumn({ rowData, onHoverSignal, rowSpanTags, showKind, }) {
|
|
35
35
|
const { editRange, deleteRange, changeRangeSignalKind, zoomRange } = (0, useEditRangeModal_1.default)(rowData);
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Fragment, { children: [showKind && ((0, jsx_runtime_1.jsx)("td", { ...onHoverSignal, children: (0, jsx_runtime_1.jsx)(Select_1.default, { onChange: changeRangeSignalKind,
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Fragment, { children: [showKind && ((0, jsx_runtime_1.jsx)("td", { ...onHoverSignal, children: (0, jsx_runtime_1.jsx)(Select_1.default, { onChange: changeRangeSignalKind, items: SignalsKinds_1.SignalKinds, defaultValue: rowData.tableMetaInfo.signal.kind, style: selectBoxStyle }) })), (0, jsx_runtime_1.jsxs)("td", { ...rowSpanTags, css: styles, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", className: "delete-button", onClick: () => deleteRange(), children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "zoom-button", onClick: () => zoomRange(), children: (0, jsx_runtime_1.jsx)(fa_1.FaSearchPlus, { title: "Zoom to range in spectrum" }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "edit-button", onClick: () => editRange(), children: (0, jsx_runtime_1.jsx)(fa_1.FaEdit, { color: "blue" }) })] })] }));
|
|
37
37
|
}
|
|
38
38
|
exports.default = ActionsColumn;
|
|
@@ -23,7 +23,8 @@ function RangeAssignmentsColumn({ rowData, assignment, highlight, onUnlinkVisibi
|
|
|
23
23
|
const flag = assignment.isActive ||
|
|
24
24
|
assignment.isOver ||
|
|
25
25
|
(highlight.isActive &&
|
|
26
|
-
highlightData.highlight.sourceData?.type !==
|
|
26
|
+
highlightData.highlight.sourceData?.type !==
|
|
27
|
+
highlight_1.HighlightEventSource.SIGNAL);
|
|
27
28
|
return flag
|
|
28
29
|
? {
|
|
29
30
|
color: 'red',
|
|
@@ -16,30 +16,39 @@ function useEditRangeModal(range) {
|
|
|
16
16
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
17
17
|
const modal = (0, Modal_1.useModal)();
|
|
18
18
|
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
19
|
-
const zoomRange = (0, react_1.useCallback)(() => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
const zoomRange = (0, react_1.useCallback)((modalRange) => {
|
|
20
|
+
const _range = modalRange ? modalRange : range;
|
|
21
|
+
if (_range) {
|
|
22
|
+
const { from, to } = _range;
|
|
23
|
+
const margin = Math.abs(from - to);
|
|
24
|
+
dispatch({
|
|
25
|
+
type: Types_1.SET_X_DOMAIN,
|
|
26
|
+
xDomain: [from - margin, to + margin],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}, [dispatch, range]);
|
|
30
|
+
const deleteRange = (0, react_1.useCallback)((id, resetSelectTool = false) => {
|
|
31
|
+
if (range || id) {
|
|
32
|
+
dispatch({
|
|
33
|
+
type: Types_1.DELETE_RANGE,
|
|
34
|
+
payload: {
|
|
35
|
+
data: { id: id ? id : range?.id, assignmentData },
|
|
36
|
+
resetSelectTool,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}, [assignmentData, dispatch, range]);
|
|
34
41
|
const changeRangeSignalKind = (0, react_1.useCallback)((value) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
if (range) {
|
|
43
|
+
dispatch({
|
|
44
|
+
type: Types_1.CHANGE_RANGE_SIGNAL_KIND,
|
|
45
|
+
payload: {
|
|
46
|
+
data: { rowData: range, value },
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}
|
|
41
50
|
}, [dispatch, range]);
|
|
42
|
-
const saveEditRangeHandler = (0, react_1.useCallback)((editedRowData) => {
|
|
51
|
+
const saveEditRangeHandler = (0, react_1.useCallback)((editedRowData, automaticCloseModal = true) => {
|
|
43
52
|
dispatch({
|
|
44
53
|
type: Types_1.SAVE_EDITED_RANGE,
|
|
45
54
|
payload: {
|
|
@@ -47,21 +56,30 @@ function useEditRangeModal(range) {
|
|
|
47
56
|
assignmentData,
|
|
48
57
|
},
|
|
49
58
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
59
|
+
if (automaticCloseModal) {
|
|
60
|
+
modal.close();
|
|
61
|
+
}
|
|
62
|
+
}, [assignmentData, dispatch, modal]);
|
|
63
|
+
const closeEditRangeHandler = (0, react_1.useCallback)((range, originalRange) => {
|
|
64
|
+
if (range.id === 'new') {
|
|
65
|
+
deleteRange(range.id, true);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
saveEditRangeHandler(originalRange, false);
|
|
69
|
+
}
|
|
53
70
|
modal.close();
|
|
54
|
-
}, [
|
|
55
|
-
const editRange = (0, react_1.useCallback)(() => {
|
|
71
|
+
}, [deleteRange, modal, saveEditRangeHandler]);
|
|
72
|
+
const editRange = (0, react_1.useCallback)((isManual = false) => {
|
|
56
73
|
dispatch({
|
|
57
74
|
type: Types_1.SET_SELECTED_TOOL,
|
|
58
|
-
payload: { selectedTool: ToolTypes_1.options.editRange.id
|
|
75
|
+
payload: { selectedTool: ToolTypes_1.options.editRange.id },
|
|
59
76
|
});
|
|
60
|
-
modal.show((0, jsx_runtime_1.jsx)(EditRangeModal_1.default, { onCloseEditRangeModal: closeEditRangeHandler, onSaveEditRangeModal: saveEditRangeHandler, onZoomEditRangeModal: zoomRange, range: range }), {
|
|
77
|
+
modal.show((0, jsx_runtime_1.jsx)(EditRangeModal_1.default, { onCloseEditRangeModal: closeEditRangeHandler, onSaveEditRangeModal: saveEditRangeHandler, onZoomEditRangeModal: zoomRange, range: isManual ? {} : range, manualRange: isManual }), {
|
|
61
78
|
position: options_1.positions.MIDDLE_RIGHT,
|
|
62
79
|
transition: options_1.transitions.SCALE,
|
|
63
80
|
isBackgroundBlur: false,
|
|
64
81
|
});
|
|
82
|
+
zoomRange();
|
|
65
83
|
}, [
|
|
66
84
|
closeEditRangeHandler,
|
|
67
85
|
dispatch,
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const uuid_1 = require("@lukeed/uuid");
|
|
6
4
|
const react_1 = require("react");
|
|
7
|
-
const generateID_1 = __importDefault(require("../../../../data/utilities/generateID"));
|
|
8
5
|
function useMapRanges(data) {
|
|
9
6
|
return (0, react_1.useMemo)(() => {
|
|
10
7
|
const _rangesData = [];
|
|
11
8
|
data.forEach((range, i) => {
|
|
12
9
|
if (range.signals.length === 1) {
|
|
13
10
|
_rangesData.push({
|
|
14
|
-
rowKey: (0,
|
|
11
|
+
rowKey: (0, uuid_1.v4)(),
|
|
15
12
|
...range,
|
|
16
13
|
tableMetaInfo: {
|
|
17
14
|
...range.tableMetaInfo,
|
|
@@ -38,7 +35,7 @@ function useMapRanges(data) {
|
|
|
38
35
|
hide = true;
|
|
39
36
|
}
|
|
40
37
|
_rangesData.push({
|
|
41
|
-
rowKey: (0,
|
|
38
|
+
rowKey: (0, uuid_1.v4)(),
|
|
42
39
|
...range,
|
|
43
40
|
tableMetaInfo: {
|
|
44
41
|
...range.tableMetaInfo,
|
|
@@ -50,7 +50,7 @@ function SpectrumListItem({ activeSpectrum, markersVisible, data, onChangeVisibi
|
|
|
50
50
|
}
|
|
51
51
|
return value;
|
|
52
52
|
};
|
|
53
|
-
const activated = activeSpectrum
|
|
53
|
+
const activated = !activeSpectrum || activeSpectrum?.id === data.id;
|
|
54
54
|
const { color, name, positiveColor, negativeColor } = data.display;
|
|
55
55
|
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
56
56
|
...styles.row,
|
|
@@ -29,7 +29,7 @@ function SpectrumsTabsInner({ data, activeSpectrum, activeTab, onTabChange, }) {
|
|
|
29
29
|
if (data) {
|
|
30
30
|
const visibleMarkers = data.reduce((acc, datum) => {
|
|
31
31
|
if (datum.info.dimension === 1 &&
|
|
32
|
-
datum.display.isPeaksMarkersVisible
|
|
32
|
+
datum.display.isPeaksMarkersVisible) {
|
|
33
33
|
acc.push({ id: datum.id });
|
|
34
34
|
}
|
|
35
35
|
return acc;
|
|
@@ -7,12 +7,12 @@ function ColorIndicator1D({ color, activated }) {
|
|
|
7
7
|
backgroundColor: color,
|
|
8
8
|
height: '12px',
|
|
9
9
|
width: '12px',
|
|
10
|
-
opacity: activated ? 1 : 0.
|
|
10
|
+
opacity: activated ? 1 : 0.2,
|
|
11
11
|
display: 'inline-block',
|
|
12
12
|
} }));
|
|
13
13
|
}
|
|
14
14
|
function ColorIndicator2D({ positiveColor, negativeColor, activated, }) {
|
|
15
|
-
return ((0, jsx_runtime_1.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", opacity: activated ? 1 : 0.
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", opacity: activated ? 1 : 0.2, children: (0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("path", { d: "M0,0H12L0,12Z", fill: positiveColor, strokeWidth: "0" }), (0, jsx_runtime_1.jsx)("path", { d: "M12,12H0L12,0Z", fill: negativeColor, strokeWidth: "0" })] }) }));
|
|
16
16
|
}
|
|
17
17
|
function ColorIndicator(props) {
|
|
18
18
|
const { style, onClick = () => null, activated } = props;
|
|
@@ -4,13 +4,16 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
4
4
|
const cheminfo_font_1 = require("cheminfo-font");
|
|
5
5
|
function ShowHideMarkersButton({ data, onChangeMarkersVisibility, markersVisible, style, }) {
|
|
6
6
|
const isMarkerVisible = (id) => {
|
|
7
|
-
return markersVisible.findIndex((v) => v.id === id) !== -1
|
|
7
|
+
return markersVisible.findIndex((v) => v.id === id) !== -1;
|
|
8
8
|
};
|
|
9
|
+
if (data.peaks && data.peaks.values.length === 0) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
9
12
|
return ((0, jsx_runtime_1.jsx)("button", { style: {
|
|
10
13
|
...style,
|
|
11
14
|
opacity: isMarkerVisible(data.id) && data.peaks && data.peaks.values.length > 0
|
|
12
15
|
? 1
|
|
13
16
|
: 0.1,
|
|
14
|
-
}, type: "button", onClick: () => onChangeMarkersVisibility(data),
|
|
17
|
+
}, type: "button", onClick: () => onChangeMarkersVisibility(data), children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPeaks, {}) }));
|
|
15
18
|
}
|
|
16
19
|
exports.default = ShowHideMarkersButton;
|