nmrium 0.34.0 → 0.35.0-pre.1683280699
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/LinesSeries.js +4 -5
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +5 -7
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +142 -160
- package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +4 -4
- package/lib/component/1d/ranges/AssignmentActionsButtons.d.ts +11 -0
- package/lib/component/1d/ranges/AssignmentActionsButtons.js +11 -0
- package/lib/component/1d/ranges/Range.d.ts +3 -10
- package/lib/component/1d/ranges/Range.js +32 -45
- package/lib/component/1d/ranges/Ranges.js +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -2
- package/lib/component/2d/1d-tracer/Left1DChart.d.ts +2 -2
- package/lib/component/2d/1d-tracer/Top1DChart.d.ts +2 -2
- package/lib/component/2d/Chart2D.d.ts +2 -2
- package/lib/component/2d/ft/Contours.js +13 -13
- package/lib/component/2d/ft/FTContainer.d.ts +2 -2
- package/lib/component/2d/zones/Signal.d.ts +1 -1
- package/lib/component/2d/zones/Signal.js +1 -2
- package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
- package/lib/component/2d/zones/SignalCrosshair.js +0 -1
- package/lib/component/2d/zones/Zone.d.ts +2 -2
- package/lib/component/NMRium.d.ts +2 -5
- package/lib/component/NMRium.js +10 -2
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -2
- package/lib/component/assignment/actions/removeAssignment.js +2 -2
- package/lib/component/context/PreferencesContext.d.ts +10 -21
- package/lib/component/context/PreferencesContext.js +4 -7
- package/lib/component/elements/Button.d.ts +4 -2
- package/lib/component/elements/Button.js +26 -15
- package/lib/component/elements/Input.js +38 -46
- package/lib/component/elements/NumberInput.d.ts +4 -12
- package/lib/component/elements/NumberInput.js +10 -40
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -4
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +3 -2
- package/lib/component/elements/ReactTable/ReactTable.d.ts +7 -6
- package/lib/component/elements/ReactTable/ReactTable.js +3 -12
- package/lib/component/elements/ReactTable/Style.js +0 -8
- package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
- package/lib/component/elements/formik/FormikNumberInput.js +13 -3
- package/lib/component/header/ApodizationOptionsPanel.js +2 -12
- package/lib/component/header/AutoPeakPickingOptionPanel.js +11 -15
- package/lib/component/header/BaseLineCorrectionPanel.js +2 -12
- package/lib/component/header/Header.js +2 -2
- package/lib/component/header/PhaseCorrectionPanel.d.ts +2 -0
- package/lib/component/header/{ManualPhaseCorrectionPanel.js → PhaseCorrectionPanel.js} +23 -22
- package/lib/component/header/RangesPickingOptionPanel.js +17 -28
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -2
- package/lib/component/header/Zones2DOptionPanel.js +16 -23
- package/lib/component/highlight/index.d.ts +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -2
- package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +2 -3
- package/lib/component/hooks/useFilter.d.ts +1 -1
- package/lib/component/hooks/useSpectraPerNucleus.d.ts +2 -3
- package/lib/component/hooks/useSpectrum.d.ts +2 -3
- package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
- package/lib/component/modal/ExportAsJcampModal.d.ts +8 -0
- package/lib/component/modal/ExportAsJcampModal.js +62 -0
- package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +1 -1
- package/lib/component/modal/editZone/EditPathLengthFormik.js +11 -14
- package/lib/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +1 -1
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.d.ts +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +3 -3
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +2 -3
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/PanelNoData.d.ts +6 -0
- package/lib/component/panels/PanelNoData.js +24 -0
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +4 -4
- package/lib/component/panels/RangesPanel/RangesPanel.js +12 -7
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +4 -5
- package/lib/component/panels/RangesPanel/RangesTable.js +4 -14
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +5 -4
- package/lib/component/panels/RangesPanel/RangesTableRow.js +15 -11
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +6 -5
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +37 -33
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.d.ts +4 -0
- package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.js +8 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +6 -11
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraTable.d.ts +3 -4
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +65 -17
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.d.ts +3 -4
- package/lib/component/panels/SpectrumsPanel/base/SpectrumName.d.ts +2 -3
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +0 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +11 -8
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +4 -5
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +1 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js +3 -13
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js +77 -7
- package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +17 -9
- package/lib/component/panels/filtersPanel/FiltersTable.js +16 -30
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib/component/panels/header/PreferencesHeader.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +0 -1
- package/lib/component/reducer/Reducer.d.ts +4 -960
- package/lib/component/reducer/Reducer.js +3 -7
- package/lib/component/reducer/actions/AssignmentsActions.js +2 -4
- package/lib/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +5 -6
- package/lib/component/reducer/actions/DomainActions.js +17 -11
- package/lib/component/reducer/actions/FiltersActions.d.ts +14 -19
- package/lib/component/reducer/actions/FiltersActions.js +257 -152
- package/lib/component/reducer/actions/LoadActions.d.ts +2 -3
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/PeaksActions.d.ts +1 -1
- package/lib/component/reducer/actions/PeaksActions.js +6 -2
- package/lib/component/reducer/actions/PreferencesActions.js +3 -0
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +19 -11
- package/lib/component/reducer/actions/SpectrumsActions.js +15 -13
- package/lib/component/reducer/actions/ToolsActions.d.ts +6 -2
- package/lib/component/reducer/actions/ToolsActions.js +41 -38
- package/lib/component/reducer/actions/ZonesActions.d.ts +1 -1
- package/lib/component/reducer/actions/ZonesActions.js +7 -3
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.js +6 -3
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -4843
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -4
- package/lib/component/reducer/types/Types.d.ts +0 -2
- package/lib/component/reducer/types/Types.js +0 -2
- package/lib/component/toolbar/BasicToolBar.js +3 -3
- package/lib/component/toolbar/FunctionToolBar.js +2 -2
- package/lib/component/toolbar/ToolTypes.d.ts +1 -2
- package/lib/component/toolbar/ToolTypes.js +13 -13
- package/lib/component/utility/getSpectraByNucleus.d.ts +2 -3
- package/lib/component/utility/getSpectraObjectPaths.d.ts +2 -3
- package/lib/component/workspaces/Workspace.d.ts +1 -0
- package/lib/component/workspaces/assignment.js +1 -1
- package/lib/component/workspaces/basic.js +1 -1
- package/lib/component/workspaces/embedded.js +1 -1
- package/lib/component/workspaces/exercise.js +1 -1
- package/lib/component/workspaces/prediction.js +1 -1
- package/lib/component/workspaces/process1D.js +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/Filters.d.ts +0 -4
- package/lib/data/Filters.js +0 -4
- package/lib/data/FiltersManager.d.ts +17 -5
- package/lib/data/FiltersManager.js +21 -14
- package/lib/data/PredictionManager.d.ts +2 -3
- package/lib/data/SpectraManager.d.ts +11 -0
- package/lib/data/SpectraManager.js +47 -5
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -2
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.js +3 -3
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +16 -17
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +7 -7
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +3 -4
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +2 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.js +10 -0
- package/lib/data/data1d/Spectrum1D/isSpectrum1D.d.ts +2 -3
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -5
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +7 -7
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +5 -5
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +8 -9
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +13 -7
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +13 -7
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +9 -9
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +6 -5
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +10 -9
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +6 -6
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.d.ts +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +2 -2
- package/lib/data/data1d/filter1d/apodization.d.ts +8 -6
- package/lib/data/data1d/filter1d/apodization.js +4 -0
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +6 -4
- package/lib/data/data1d/filter1d/baselineCorrection.js +4 -0
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +7 -6
- package/lib/data/data1d/filter1d/digitalFilter.js +15 -11
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +5 -5
- package/lib/data/data1d/filter1d/equallySpaced.js +10 -10
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +7 -5
- package/lib/data/data1d/filter1d/exclusionZones.js +13 -9
- package/lib/data/data1d/filter1d/fft.d.ts +6 -4
- package/lib/data/data1d/filter1d/fft.js +27 -23
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +6 -5
- package/lib/data/data1d/filter1d/phaseCorrection.js +22 -17
- package/lib/data/data1d/filter1d/shiftX.d.ts +5 -3
- package/lib/data/data1d/filter1d/shiftX.js +7 -3
- package/lib/data/data1d/filter1d/signalProcessing.d.ts +7 -5
- package/lib/data/data1d/filter1d/signalProcessing.js +15 -11
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +2 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +6 -6
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +7 -6
- package/lib/data/data1d/filter1d/zeroFilling.js +15 -11
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +4 -5
- package/lib/data/data2d/Spectrum2D/contours.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/contours.js +5 -4
- package/lib/data/data2d/Spectrum2D/get2DColor.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/get2DSpectrumErrorValue.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/get2DSpectrumErrorValue.js +2 -2
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +2 -3
- package/lib/data/data2d/Spectrum2D/getShift.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/getShift.js +3 -3
- package/lib/data/data2d/Spectrum2D/getSlice.d.ts +4 -4
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/isSpectrum2D.d.ts +2 -3
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +4 -10
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +6 -12
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.js +2 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +6 -12
- package/lib/data/data2d/Spectrum2D/zones/mapZones.js +1 -0
- package/lib/data/data2d/Spectrum2D/zones/updateZones.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/updateZones.js +2 -2
- package/lib/data/data2d/filter2d/shiftX.d.ts +6 -4
- package/lib/data/data2d/filter2d/shiftX.js +10 -6
- package/lib/data/data2d/filter2d/shiftY.d.ts +5 -3
- package/lib/data/data2d/filter2d/shiftY.js +5 -1
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.js +2 -2
- package/lib/data/parseMeta/linkMetaWithSpectra.d.ts +2 -3
- package/lib/data/types/common/Info.d.ts +1 -0
- package/lib/data/types/data1d/ComplexData1D.d.ts +1 -1
- package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
- package/lib/data/types/data1d/index.d.ts +0 -11
- package/lib/data/types/data2d/index.d.ts +0 -7
- package/lib/data/utilities/FindUtilities.d.ts +7 -9
- package/lib/data/utilities/RangeUtilities.d.ts +7 -2
- package/lib/data/utilities/RangeUtilities.js +9 -16
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.js +6 -6
- package/lib/data/utilities/calculateSanPlot.d.ts +2 -3
- package/lib/data/utilities/convertSpectraListToObject.d.ts +2 -3
- package/lib/data/utilities/generateColor.d.ts +1 -1
- package/lib/types/NMRiumDataReturn.d.ts +2 -3
- package/lib/types/NMRiumToolBarPreferences.d.ts +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/LinesSeries.js +4 -5
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +144 -160
- package/lib-cjs/component/1d/ranges/AssignmentActionsButtons.js +18 -0
- package/lib-cjs/component/1d/ranges/Range.js +31 -44
- package/lib-cjs/component/1d/ranges/Ranges.js +1 -1
- package/lib-cjs/component/2d/ft/Contours.js +13 -13
- package/lib-cjs/component/2d/zones/Signal.js +1 -2
- package/lib-cjs/component/2d/zones/SignalCrosshair.js +0 -1
- package/lib-cjs/component/NMRium.js +10 -2
- package/lib-cjs/component/assignment/actions/removeAssignment.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +4 -7
- package/lib-cjs/component/elements/Button.js +26 -15
- package/lib-cjs/component/elements/Input.js +37 -45
- package/lib-cjs/component/elements/NumberInput.js +8 -38
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +3 -2
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +3 -12
- package/lib-cjs/component/elements/ReactTable/Style.js +0 -8
- package/lib-cjs/component/elements/formik/FormikNumberInput.js +13 -3
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +1 -11
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +33 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +1 -11
- package/lib-cjs/component/header/Header.js +2 -2
- package/lib-cjs/component/header/{ManualPhaseCorrectionPanel.js → PhaseCorrectionPanel.js} +24 -23
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +38 -26
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +0 -1
- package/lib-cjs/component/header/Zones2DOptionPanel.js +37 -21
- package/lib-cjs/component/modal/ExportAsJcampModal.js +67 -0
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +11 -14
- package/lib-cjs/component/modal/editZone/EditZoneModal.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/ToolsTabContent.js +1 -1
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +3 -3
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
- package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib-cjs/component/panels/PanelNoData.js +28 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +4 -4
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +12 -7
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +4 -14
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +15 -10
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +36 -32
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.js +12 -0
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +6 -11
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +63 -15
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +0 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +11 -8
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -12
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +76 -6
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +15 -7
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +16 -30
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib-cjs/component/panels/header/PreferencesHeader.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +0 -1
- package/lib-cjs/component/reducer/Reducer.js +3 -7
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +2 -4
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib-cjs/component/reducer/actions/DomainActions.js +17 -11
- package/lib-cjs/component/reducer/actions/FiltersActions.js +257 -153
- package/lib-cjs/component/reducer/actions/LoadActions.js +1 -1
- package/lib-cjs/component/reducer/actions/PeaksActions.js +6 -2
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +3 -0
- package/lib-cjs/component/reducer/actions/RangesActions.js +19 -11
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +13 -11
- package/lib-cjs/component/reducer/actions/ToolsActions.js +38 -35
- package/lib-cjs/component/reducer/actions/ZonesActions.js +7 -3
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +6 -3
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -4
- package/lib-cjs/component/reducer/types/Types.js +2 -4
- package/lib-cjs/component/toolbar/BasicToolBar.js +3 -3
- package/lib-cjs/component/toolbar/FunctionToolBar.js +2 -2
- package/lib-cjs/component/toolbar/ToolTypes.js +13 -13
- package/lib-cjs/component/workspaces/assignment.js +1 -1
- package/lib-cjs/component/workspaces/basic.js +1 -1
- package/lib-cjs/component/workspaces/embedded.js +1 -1
- package/lib-cjs/component/workspaces/exercise.js +1 -1
- package/lib-cjs/component/workspaces/prediction.js +1 -1
- package/lib-cjs/component/workspaces/process1D.js +1 -1
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib-cjs/data/Filters.js +1 -5
- package/lib-cjs/data/FiltersManager.js +22 -14
- package/lib-cjs/data/SpectraManager.js +48 -5
- package/lib-cjs/data/data1d/Spectrum1D/get1DDataXY.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +16 -17
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/isRangeAssigned.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +13 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +13 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +9 -9
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeSignal.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +6 -6
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +7 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +2 -2
- package/lib-cjs/data/data1d/filter1d/apodization.js +5 -1
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +5 -1
- package/lib-cjs/data/data1d/filter1d/digitalFilter.js +16 -12
- package/lib-cjs/data/data1d/filter1d/equallySpaced.js +10 -10
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +14 -10
- package/lib-cjs/data/data1d/filter1d/fft.js +27 -23
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +23 -18
- package/lib-cjs/data/data1d/filter1d/shiftX.js +8 -4
- package/lib-cjs/data/data1d/filter1d/signalProcessing.js +16 -12
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +6 -6
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +16 -12
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +5 -4
- package/lib-cjs/data/data2d/Spectrum2D/get2DSpectrumErrorValue.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -3
- package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/initiateZones.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/zones/isZoneExists.js +3 -3
- package/lib-cjs/data/data2d/Spectrum2D/zones/mapZones.js +1 -0
- package/lib-cjs/data/data2d/Spectrum2D/zones/updateZones.js +2 -2
- package/lib-cjs/data/data2d/filter2d/shiftX.js +11 -7
- package/lib-cjs/data/data2d/filter2d/shiftY.js +6 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +2 -2
- package/lib-cjs/data/utilities/RangeUtilities.js +9 -16
- package/lib-cjs/data/utilities/ZoneUtilities.js +6 -6
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +37 -36
- package/lib/component/header/ManualPhaseCorrectionPanel.d.ts +0 -2
- package/lib/data/data1d/filter1d/centerMean.d.ts +0 -13
- package/lib/data/data1d/filter1d/centerMean.js +0 -37
- package/lib/data/data1d/filter1d/fromTo.d.ts +0 -13
- package/lib/data/data1d/filter1d/fromTo.js +0 -31
- package/lib/data/data1d/filter1d/pareto.d.ts +0 -13
- package/lib/data/data1d/filter1d/pareto.js +0 -29
- package/lib/data/data1d/filter1d/standardDeviation.d.ts +0 -13
- package/lib/data/data1d/filter1d/standardDeviation.js +0 -37
- package/lib/data/types/data1d/Data1D.d.ts +0 -5
- package/lib/data/types/data1d/Data1D.js +0 -1
- package/lib/data/types/data1d/Datum1D.d.ts +0 -23
- package/lib/data/types/data1d/Datum1D.js +0 -1
- package/lib/data/types/data1d/Display1D.d.ts +0 -5
- package/lib/data/types/data1d/Display1D.js +0 -1
- package/lib/data/types/data1d/Info1D.d.ts +0 -8
- package/lib/data/types/data1d/Info1D.js +0 -1
- package/lib/data/types/data1d/Integral.d.ts +0 -10
- package/lib/data/types/data1d/Integral.js +0 -1
- package/lib/data/types/data1d/Integrals.d.ts +0 -6
- package/lib/data/types/data1d/Integrals.js +0 -1
- package/lib/data/types/data1d/Peak.d.ts +0 -5
- package/lib/data/types/data1d/Peak.js +0 -1
- package/lib/data/types/data1d/Peaks.d.ts +0 -5
- package/lib/data/types/data1d/Peaks.js +0 -1
- package/lib/data/types/data1d/Range.d.ts +0 -11
- package/lib/data/types/data1d/Range.js +0 -1
- package/lib/data/types/data1d/Ranges.d.ts +0 -6
- package/lib/data/types/data1d/Ranges.js +0 -1
- package/lib/data/types/data1d/Signal1D.d.ts +0 -5
- package/lib/data/types/data1d/Signal1D.js +0 -1
- package/lib/data/types/data1d/SumOptions.d.ts +0 -7
- package/lib/data/types/data1d/SumOptions.js +0 -1
- package/lib/data/types/data2d/Data2D.d.ts +0 -20
- package/lib/data/types/data2d/Data2D.js +0 -1
- package/lib/data/types/data2d/Datum2D.d.ts +0 -19
- package/lib/data/types/data2d/Datum2D.js +0 -1
- package/lib/data/types/data2d/Display2D.d.ts +0 -11
- package/lib/data/types/data2d/Display2D.js +0 -1
- package/lib/data/types/data2d/Info2D.d.ts +0 -5
- package/lib/data/types/data2d/Info2D.js +0 -1
- package/lib/data/types/data2d/Signal2D.d.ts +0 -7
- package/lib/data/types/data2d/Signal2D.js +0 -1
- package/lib/data/types/data2d/Signal2DAxisData.d.ts +0 -4
- package/lib/data/types/data2d/Signal2DAxisData.js +0 -1
- package/lib/data/types/data2d/Zone.d.ts +0 -9
- package/lib/data/types/data2d/Zone.js +0 -1
- package/lib/data/types/data2d/Zone2DAxisData.d.ts +0 -6
- package/lib/data/types/data2d/Zone2DAxisData.js +0 -1
- package/lib/data/types/data2d/Zones.d.ts +0 -7
- package/lib/data/types/data2d/Zones.js +0 -1
- package/lib-cjs/data/data1d/filter1d/centerMean.js +0 -43
- package/lib-cjs/data/data1d/filter1d/fromTo.js +0 -37
- package/lib-cjs/data/data1d/filter1d/pareto.js +0 -35
- package/lib-cjs/data/data1d/filter1d/standardDeviation.js +0 -43
- package/lib-cjs/data/types/data1d/Data1D.js +0 -2
- package/lib-cjs/data/types/data1d/Datum1D.js +0 -2
- package/lib-cjs/data/types/data1d/Display1D.js +0 -2
- package/lib-cjs/data/types/data1d/Info1D.js +0 -2
- package/lib-cjs/data/types/data1d/Integral.js +0 -2
- package/lib-cjs/data/types/data1d/Integrals.js +0 -2
- package/lib-cjs/data/types/data1d/Peak.js +0 -2
- package/lib-cjs/data/types/data1d/Peaks.js +0 -2
- package/lib-cjs/data/types/data1d/Range.js +0 -2
- package/lib-cjs/data/types/data1d/Ranges.js +0 -2
- package/lib-cjs/data/types/data1d/Signal1D.js +0 -2
- package/lib-cjs/data/types/data1d/SumOptions.js +0 -2
- package/lib-cjs/data/types/data2d/Data2D.js +0 -2
- package/lib-cjs/data/types/data2d/Datum2D.js +0 -2
- package/lib-cjs/data/types/data2d/Display2D.js +0 -2
- package/lib-cjs/data/types/data2d/Info2D.js +0 -2
- package/lib-cjs/data/types/data2d/Signal2D.js +0 -2
- package/lib-cjs/data/types/data2d/Signal2DAxisData.js +0 -2
- package/lib-cjs/data/types/data2d/Zone.js +0 -2
- package/lib-cjs/data/types/data2d/Zone2DAxisData.js +0 -2
- package/lib-cjs/data/types/data2d/Zones.js +0 -2
|
@@ -2,7 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import lodashGet from 'lodash/get';
|
|
5
|
-
import { useMemo, useCallback
|
|
5
|
+
import { useMemo, useCallback } from 'react';
|
|
6
|
+
import { DropdownMenu } from 'react-science/ui';
|
|
6
7
|
import { useAssignment, useAssignmentData, } from '../../assignment/AssignmentsContext';
|
|
7
8
|
import { filterForIDsWithAssignment } from '../../assignment/utilities/filterForIDsWithAssignment';
|
|
8
9
|
import { HighlightEventSource, useHighlight, useHighlightData, } from '../../highlight';
|
|
@@ -21,7 +22,18 @@ const HighlightedRowStyle = css `
|
|
|
21
22
|
const ConstantlyHighlightedRowStyle = css `
|
|
22
23
|
background-color: #f5f5dc;
|
|
23
24
|
`;
|
|
24
|
-
|
|
25
|
+
export const AssignmentColumnCssStyle = css `
|
|
26
|
+
.remove-assignment {
|
|
27
|
+
visibility: hidden;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:hover {
|
|
31
|
+
.remove-assignment {
|
|
32
|
+
visibility: visible;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
function RangesTableRow({ rowData, onUnlink, onContextMenuSelect, contextMenu = [], preferences, info, }) {
|
|
25
37
|
const assignmentData = useAssignmentData();
|
|
26
38
|
const assignmentRange = useAssignment(rowData.id);
|
|
27
39
|
const highlightRange = useHighlight([assignmentRange.id].concat(assignmentRange.assigned?.x || []).concat(filterForIDsWithAssignment(assignmentData, rowData.signals.map((_signal) => _signal.id))), { type: HighlightEventSource.RANGE });
|
|
@@ -29,8 +41,6 @@ function RangesTableRow({ rowData, onUnlink, onContextMenu, preferences, info, }
|
|
|
29
41
|
const assignmentSignal = useAssignment(rowData.tableMetaInfo.id);
|
|
30
42
|
const highlightSignal = useHighlight([assignmentSignal.id].concat(assignmentSignal.assigned?.x || []), { type: HighlightEventSource.SIGNAL });
|
|
31
43
|
const highlightData = useHighlightData();
|
|
32
|
-
const [unlinkRangeButtonVisibility, showUnlinkRangeButton] = useState(false);
|
|
33
|
-
const [unlinkSignalButtonVisibility, showUnlinkSignalButton] = useState(false);
|
|
34
44
|
const rowSpanTags = useMemo(() => {
|
|
35
45
|
return {
|
|
36
46
|
rowSpan: rowData.tableMetaInfo.rowSpan,
|
|
@@ -47,19 +57,13 @@ function RangesTableRow({ rowData, onUnlink, onContextMenu, preferences, info, }
|
|
|
47
57
|
if (isOnRangeLevel !== undefined) {
|
|
48
58
|
if (isOnRangeLevel) {
|
|
49
59
|
onUnlink(rowData);
|
|
50
|
-
showUnlinkRangeButton(false);
|
|
51
60
|
assignmentRange.removeAll('x');
|
|
52
61
|
}
|
|
53
62
|
else {
|
|
54
63
|
onUnlink(rowData, lodashGet(rowData, 'tableMetaInfo.signalIndex', undefined));
|
|
55
|
-
showUnlinkSignalButton(false);
|
|
56
64
|
assignmentSignal.removeAll('x');
|
|
57
65
|
}
|
|
58
66
|
}
|
|
59
|
-
else {
|
|
60
|
-
showUnlinkRangeButton(false);
|
|
61
|
-
showUnlinkSignalButton(false);
|
|
62
|
-
}
|
|
63
67
|
}, [assignmentRange, assignmentSignal, onUnlink, rowData]);
|
|
64
68
|
const linkHandler = useCallback((e, assignment) => {
|
|
65
69
|
e.stopPropagation();
|
|
@@ -108,6 +112,6 @@ function RangesTableRow({ rowData, onUnlink, onContextMenu, preferences, info, }
|
|
|
108
112
|
? ConstantlyHighlightedRowStyle
|
|
109
113
|
: null;
|
|
110
114
|
}, [assignmentRange.isActive, highlightRange.isActive, rowData]);
|
|
111
|
-
return (_jsxs("
|
|
115
|
+
return (_jsxs(DropdownMenu, { trigger: "contextMenu", options: contextMenu, onSelect: (selected) => onContextMenuSelect?.(selected, rowData), as: "tr", css: trCss, children: [_jsx("td", { ...rowSpanTags, ...onHoverRange, children: rowData.tableMetaInfo.rowIndex + 1 }), preferences.from.show && (_jsx(RangeColumn, { value: rowData.from, rowSpanTags: rowSpanTags, onHover: onHoverRange, format: preferences.from.format })), preferences.to.show && (_jsx(RangeColumn, { value: rowData.to, rowSpanTags: rowSpanTags, onHover: onHoverRange, format: preferences.to.format })), preferences.deltaPPM.show && (_jsx(SignalDeltaColumn, { row: rowData, rowSpanTags: rowSpanTags, onHover: onHoverSignal, format: preferences.deltaPPM.format })), preferences.deltaHz.show && (_jsx(SignalDeltaHzColumn, { row: rowData, rowSpanTags: rowSpanTags, onHover: onHoverSignal, format: preferences.deltaHz.format, info: info })), preferences.relative.show && (_jsx(RelativeColumn, { row: rowData, rowSpanTags: rowSpanTags, onHover: onHoverRange, format: preferences.relative.format })), preferences.absolute.show && (_jsx(AbsoluteColumn, { row: rowData, rowSpanTags: rowSpanTags, onHover: onHoverRange, format: preferences.absolute.format })), _jsx("td", { ...onHoverSignal, children: lodashGet(rowData, 'tableMetaInfo.signal.multiplicity', '') }), preferences.coupling.show && (_jsx(CouplingColumn, { row: rowData, onHover: onHoverSignal, format: preferences.coupling.format })), _jsx(SignalAssignmentsColumn, { row: rowData, assignment: assignmentSignal, highlight: highlightSignal, onHover: onHoverSignal, onLink: linkHandler, onUnlink: unlinkHandler }), _jsx(RangeAssignmentsColumn, { row: rowData, assignment: assignmentRange, highlight: highlightRangeAssignmentsColumn, onHover: onHoverRangeAssignmentsColumn, onLink: linkHandler, onUnlink: unlinkHandler, rowSpanTags: rowSpanTags, highlightData: highlightData }), _jsx(ActionsColumn, { row: rowData, onHoverSignal: onHoverSignal, onHoverRange: onHoverRange, rowSpanTags: rowSpanTags, showKind: preferences.showKind })] }));
|
|
112
116
|
}
|
|
113
117
|
export default RangesTableRow;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
1
2
|
/// <reference types="react" />
|
|
2
3
|
import { AssignmentsData } from '../../../assignment/AssignmentsContext';
|
|
3
4
|
import { RangeColumnProps } from '../RangesTableRow';
|
|
4
|
-
interface
|
|
5
|
+
interface RemoveAssignmentsButtonProps {
|
|
6
|
+
onUnlink?: (element: any, b: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
interface RangAssignmentColumnProps extends Omit<RangeColumnProps, 'format'>, RemoveAssignmentsButtonProps {
|
|
5
9
|
assignment: AssignmentsData;
|
|
6
10
|
highlight: {
|
|
7
11
|
isActive: boolean;
|
|
8
12
|
};
|
|
9
|
-
onUnlinkVisibilityChange?: (element: any) => void;
|
|
10
|
-
unlinkVisibility: boolean;
|
|
11
13
|
onLink?: (a: any, b: any) => void;
|
|
12
|
-
onUnlink?: (element: any, b: boolean) => void;
|
|
13
14
|
highlightData: any;
|
|
14
15
|
}
|
|
15
|
-
declare function RangeAssignmentsColumn({ row, assignment, highlight,
|
|
16
|
+
declare function RangeAssignmentsColumn({ row, assignment, highlight, onLink, onUnlink, rowSpanTags, onHover, highlightData, }: RangAssignmentColumnProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
17
|
declare const _default: import("react").MemoExoticComponent<typeof RangeAssignmentsColumn>;
|
|
17
18
|
export default _default;
|
|
@@ -1,38 +1,42 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { memo } from 'react';
|
|
4
4
|
import { HighlightEventSource } from '../../../highlight';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { AssignmentColumnCssStyle } from '../RangesTableRow';
|
|
6
|
+
import { RemoveAssignmentsButton } from './RemoveAssignmentsButton';
|
|
7
|
+
const columnStyle = {
|
|
8
|
+
padding: 0,
|
|
9
|
+
textAlign: 'center',
|
|
10
|
+
verticalAlign: 'middle',
|
|
8
11
|
};
|
|
9
|
-
function
|
|
12
|
+
function getStyle(flag, isCompletelyAssigned) {
|
|
13
|
+
if (flag) {
|
|
14
|
+
return {
|
|
15
|
+
color: 'red',
|
|
16
|
+
fontWeight: 'bold',
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
else if (isCompletelyAssigned) {
|
|
20
|
+
return { color: 'green', fontWeight: 'bold' };
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return { color: 'black', fontWeight: 'normal' };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function RangeAssignmentsColumn({ row, assignment, highlight, onLink, onUnlink, rowSpanTags, onHover, highlightData, }) {
|
|
10
27
|
const diaIDs = row.diaIDs || [];
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
: { color: 'black', fontWeight: 'normal' };
|
|
26
|
-
}, [
|
|
27
|
-
assignment.isActive,
|
|
28
|
-
assignment.isOver,
|
|
29
|
-
highlight.isActive,
|
|
30
|
-
highlightData.highlight.sourceData?.type,
|
|
31
|
-
]);
|
|
32
|
-
return (_jsx("td", { ...rowSpanTags, style: { padding: '0', ...rowSpanTags.style }, ...onHover, ...{ onClick: (e) => onLink?.(e, assignment) }, children: row.nbAtoms !== undefined && row.nbAtoms > 0 ? (row.diaIDs && row.diaIDs.length > 0 ? (_jsxs("div", { onMouseEnter: () => visibilityChangeHandler(true), onMouseLeave: () => visibilityChangeHandler(false), children: [row.nbAtoms, " ", ' ( ', _jsx("span", { style: spanCss, children: diaIDs.length }), ' ) ', _jsx("sup", { children: _jsx("button", { type: "button", style: {
|
|
33
|
-
visibility: unlinkVisibility ? 'visible' : 'hidden',
|
|
34
|
-
padding: 0,
|
|
35
|
-
margin: 0,
|
|
36
|
-
}, onClick: (e) => onUnlink?.(e, true), children: _jsx(FaMinusCircle, { color: "red" }) }) })] })) : assignment.isActive ? (_jsxs("div", { children: [`${row.nbAtoms} (`, _jsx("span", { style: spanStyle, children: "0" }), ')'] })) : (row.nbAtoms)) : assignment.isActive ? (_jsxs("div", { children: ['0 (', _jsx("span", { style: spanStyle, children: "0" }), ')'] })) : ('') }));
|
|
28
|
+
const flag = assignment.isActive ||
|
|
29
|
+
assignment.isOver ||
|
|
30
|
+
(highlight.isActive &&
|
|
31
|
+
highlightData.highlight.sourceData?.type !== HighlightEventSource.SIGNAL);
|
|
32
|
+
const isCompletelyAssigned = Math.round(row.integration) === row?.nbAtoms;
|
|
33
|
+
let totalNumberOfAtoms = row?.nbAtoms || 0;
|
|
34
|
+
for (const signal of row?.signals || []) {
|
|
35
|
+
totalNumberOfAtoms += signal?.nbAtoms || 0;
|
|
36
|
+
}
|
|
37
|
+
return (_jsx("td", { ...rowSpanTags, style: {
|
|
38
|
+
...columnStyle,
|
|
39
|
+
...rowSpanTags.style,
|
|
40
|
+
}, ...onHover, ...{ onClick: (e) => onLink?.(e, assignment) }, css: !assignment.isActive && AssignmentColumnCssStyle, children: (totalNumberOfAtoms > 0 || assignment.isActive) && (_jsxs(_Fragment, { children: [totalNumberOfAtoms, " ", ' ( ', _jsx("span", { style: getStyle(flag, isCompletelyAssigned), children: diaIDs?.length || 0 }), ' ) ', _jsx(RemoveAssignmentsButton, { onClick: (e) => onUnlink?.(e, true) })] })) }));
|
|
37
41
|
}
|
|
38
42
|
export default memo(RangeAssignmentsColumn);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FaMinusCircle } from 'react-icons/fa';
|
|
3
|
+
export function RemoveAssignmentsButton({ onClick }) {
|
|
4
|
+
return (_jsx("sup", { className: "remove-assignment", children: _jsx("button", { type: "button", style: {
|
|
5
|
+
padding: 0,
|
|
6
|
+
margin: 0,
|
|
7
|
+
}, onClick: onClick, children: _jsx(FaMinusCircle, { color: "red" }) }) }));
|
|
8
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
1
2
|
import { MouseEvent } from 'react';
|
|
2
3
|
import { AssignmentsData } from '../../../assignment/AssignmentsContext';
|
|
3
4
|
import { OnHoverEvent, BaseRangeColumnProps } from '../RangesTableRow';
|
|
@@ -6,11 +7,9 @@ interface SignalAssignmentsColumnProps extends Omit<BaseRangeColumnProps, 'forma
|
|
|
6
7
|
highlight: {
|
|
7
8
|
isActive: boolean;
|
|
8
9
|
};
|
|
9
|
-
onUnlinkVisibilityChange?: (element: any) => void;
|
|
10
|
-
unlinkVisibility: boolean;
|
|
11
10
|
onLink?: (a: MouseEvent, b: AssignmentsData) => void;
|
|
12
11
|
onUnlink?: (element: MouseEvent, b: boolean) => void;
|
|
13
12
|
}
|
|
14
|
-
declare function SignalAssignmentsColumn({ row, onHover, assignment, highlight,
|
|
13
|
+
declare function SignalAssignmentsColumn({ row, onHover, assignment, highlight, onLink, onUnlink, }: SignalAssignmentsColumnProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
14
|
declare const _default: import("react").MemoExoticComponent<typeof SignalAssignmentsColumn>;
|
|
16
15
|
export default _default;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
2
3
|
import lodashGet from 'lodash/get';
|
|
3
4
|
import { memo } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
|
|
5
|
+
import { AssignmentColumnCssStyle, } from '../RangesTableRow';
|
|
6
|
+
import { RemoveAssignmentsButton } from './RemoveAssignmentsButton';
|
|
7
|
+
function SignalAssignmentsColumn({ row, onHover, assignment, highlight, onLink, onUnlink, }) {
|
|
6
8
|
const diaIDs = lodashGet(row, 'tableMetaInfo.signal.diaIDs', []);
|
|
7
9
|
const tdCss = assignment.isActive || highlight.isActive
|
|
8
10
|
? {
|
|
@@ -10,16 +12,9 @@ function SignalAssignmentsColumn({ row, onHover, assignment, highlight, onUnlink
|
|
|
10
12
|
fontWeight: 'bold',
|
|
11
13
|
}
|
|
12
14
|
: {};
|
|
13
|
-
function visibilityChangeHandler(flag) {
|
|
14
|
-
onUnlinkVisibilityChange?.(flag);
|
|
15
|
-
}
|
|
16
15
|
function assignHandler(e) {
|
|
17
16
|
onLink?.(e, assignment);
|
|
18
17
|
}
|
|
19
|
-
return (_jsx("td", { ...onHover, onClick: assignHandler, style: { padding: '0', ...tdCss },
|
|
20
|
-
visibility: unlinkVisibility ? 'visible' : 'hidden',
|
|
21
|
-
padding: 0,
|
|
22
|
-
margin: 0,
|
|
23
|
-
}, onClick: (e) => onUnlink?.(e, false), children: _jsx(FaMinusCircle, { color: "red" }) }) })] })) : assignment.isActive ? ('0') : ('') }));
|
|
18
|
+
return (_jsx("td", { ...onHover, onClick: assignHandler, style: { padding: '0', ...tdCss }, css: !assignment.isActive && AssignmentColumnCssStyle, children: (diaIDs?.length > 0 || assignment.isActive) && (_jsxs(_Fragment, { children: [_jsx("span", { children: diaIDs?.length || 0 }), _jsx(RemoveAssignmentsButton, { onClick: (e) => onUnlink?.(e, false) })] })) }));
|
|
24
19
|
}
|
|
25
20
|
export default memo(SignalAssignmentsColumn);
|
|
@@ -80,7 +80,7 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
|
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
const hasActiveSpectra = activeSpectra && activeSpectra?.length > 0;
|
|
83
|
-
return (_jsxs(DefaultPanelHeader, { onDelete: handleDelete, counter: spectra?.length, deleteToolTip: "Delete selected spectra", disableDelete: !hasActiveSpectra, showSettingButton: true, onSettingClick: onSettingClick, children: [_jsx(Button.BarButton, { toolTip: "Hide selected spectra", onClick: hideAllSpectrumsHandler, tooltipOrientation: "horizontal", disabled: !hasActiveSpectra, children: _jsx(FaEyeSlash, {}) }), _jsx(Button.BarButton, { onClick: showAllSpectrumsHandler, toolTip: "Show selected spectra", tooltipOrientation: "horizontal", disabled: !hasActiveSpectra, children: _jsx(FaEye, {}) }), displayerMode === DISPLAYER_MODE.DM_2D && activeSpectrum?.info.isFt && (_jsx(Button.BarButton, { toolTip: "Add missing projection", tooltipOrientation: "horizontal", onClick: addMissingProjectionHandler, children: _jsx(FaCreativeCommonsSamplingPlus, {}) })), displayerMode === DISPLAYER_MODE.DM_1D && spectra.length > 1 && (_jsxs(_Fragment, { children: [_jsx(Button.BarButton, { tooltipOrientation: "horizontal", toolTip: "Reset
|
|
83
|
+
return (_jsxs(DefaultPanelHeader, { onDelete: handleDelete, counter: spectra?.length, deleteToolTip: "Delete selected spectra", disableDelete: !hasActiveSpectra, showSettingButton: true, onSettingClick: onSettingClick, children: [_jsx(Button.BarButton, { toolTip: "Hide selected spectra", onClick: hideAllSpectrumsHandler, tooltipOrientation: "horizontal", disabled: !hasActiveSpectra, children: _jsx(FaEyeSlash, {}) }), _jsx(Button.BarButton, { onClick: showAllSpectrumsHandler, toolTip: "Show selected spectra", tooltipOrientation: "horizontal", disabled: !hasActiveSpectra, children: _jsx(FaEye, {}) }), displayerMode === DISPLAYER_MODE.DM_2D && activeSpectrum?.info.isFt && (_jsx(Button.BarButton, { toolTip: "Add missing projection", tooltipOrientation: "horizontal", onClick: addMissingProjectionHandler, children: _jsx(FaCreativeCommonsSamplingPlus, {}) })), displayerMode === DISPLAYER_MODE.DM_1D && spectra.length > 1 && (_jsxs(_Fragment, { children: [_jsx(Button.BarButton, { tooltipOrientation: "horizontal", toolTip: "Reset scale", onClick: resetScaleHandler, children: _jsx(SvgNmrResetScale, {}) }), _jsx(Button.BarButton, { tooltipOrientation: "horizontal", toolTip: "Same top", onClick: setSameTopHandler, children: _jsx(SvgNmrSameTop, {}) })] })), _jsx(SpectraAutomaticPickingButton, {}), _jsx(Button.BarButton, { tooltipOrientation: "horizontal", toolTip: "Recolor spectra", onClick: recolorSpectraHandler, children: _jsx(IoColorPaletteOutline, {}) })] }));
|
|
84
84
|
}
|
|
85
85
|
const MemoizedSpectraPanelHeader = memo(SpectraPanelHeaderInner);
|
|
86
86
|
export default function SpectrumsTabs({ onSettingClick, }) {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { Datum2D } from '../../../data/types/data2d';
|
|
2
|
+
import { Spectrum } from 'nmr-load-save';
|
|
4
3
|
import { ActiveSpectrum } from '../../reducer/Reducer';
|
|
5
4
|
import { OnChangeVisibilityEvent } from './base/ShowHideSpectrumButton';
|
|
6
5
|
interface SpectraTableProps extends OnChangeVisibilityEvent {
|
|
7
6
|
data: any;
|
|
8
7
|
activeSpectra: ActiveSpectrum[] | null;
|
|
9
|
-
onOpenSettingModal: (event: Event, data:
|
|
10
|
-
onChangeActiveSpectrum: (event: Event, data:
|
|
8
|
+
onOpenSettingModal: (event: Event, data: Spectrum) => void;
|
|
9
|
+
onChangeActiveSpectrum: (event: Event, data: Spectrum) => void;
|
|
11
10
|
nucleus: string;
|
|
12
11
|
}
|
|
13
12
|
export declare function SpectraTable(props: SpectraTableProps): JSX.Element;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import lodashGet from 'lodash/get';
|
|
3
|
-
import { useMemo } from 'react';
|
|
3
|
+
import { useMemo, useCallback, useState } from 'react';
|
|
4
|
+
import { FaCopy, FaRegTrashAlt, FaFileExport } from 'react-icons/fa';
|
|
4
5
|
import { IoColorPaletteOutline } from 'react-icons/io5';
|
|
5
6
|
import { DropdownMenu } from 'react-science/ui';
|
|
6
7
|
import { useDispatch } from '../../context/DispatchContext';
|
|
7
8
|
import ReactTable from '../../elements/ReactTable/ReactTable';
|
|
8
9
|
import { useAlert } from '../../elements/popup/Alert';
|
|
9
10
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
11
|
+
import ExportAsJcampModal from '../../modal/ExportAsJcampModal';
|
|
10
12
|
import { DELETE_SPECTRA, ORDER_SPECTRA, RECOLOR_SPECTRA_COLOR, } from '../../reducer/types/Types';
|
|
11
13
|
import { copyTextToClipboard } from '../../utility/export';
|
|
12
14
|
import ColorIndicator from './base/ColorIndicator';
|
|
@@ -38,12 +40,48 @@ const options = [
|
|
|
38
40
|
icon: _jsx(IoColorPaletteOutline, {}),
|
|
39
41
|
},
|
|
40
42
|
];
|
|
43
|
+
var SpectraContextMenuOptionsKeys;
|
|
44
|
+
(function (SpectraContextMenuOptionsKeys) {
|
|
45
|
+
SpectraContextMenuOptionsKeys["CopyToClipboard"] = "CopyToClipboard";
|
|
46
|
+
SpectraContextMenuOptionsKeys["Delete"] = "Delete";
|
|
47
|
+
SpectraContextMenuOptionsKeys["ExportAsJcamp"] = "ExportAsJcamp";
|
|
48
|
+
})(SpectraContextMenuOptionsKeys || (SpectraContextMenuOptionsKeys = {}));
|
|
49
|
+
const Spectra2DContextMenuOptions = [
|
|
50
|
+
{
|
|
51
|
+
label: 'Copy to Clipboard',
|
|
52
|
+
type: 'option',
|
|
53
|
+
icon: _jsx(FaCopy, {}),
|
|
54
|
+
data: { id: SpectraContextMenuOptionsKeys.CopyToClipboard },
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: 'Delete',
|
|
58
|
+
type: 'option',
|
|
59
|
+
icon: _jsx(FaRegTrashAlt, {}),
|
|
60
|
+
data: { id: SpectraContextMenuOptionsKeys.Delete },
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: 'Export as jcamp',
|
|
64
|
+
type: 'option',
|
|
65
|
+
icon: _jsx(FaFileExport, {}),
|
|
66
|
+
data: { id: SpectraContextMenuOptionsKeys.ExportAsJcamp },
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
const Spectra1DContextMenuOptions = [
|
|
70
|
+
...Spectra2DContextMenuOptions,
|
|
71
|
+
{
|
|
72
|
+
label: 'Export as jcamp',
|
|
73
|
+
type: 'option',
|
|
74
|
+
icon: _jsx(FaFileExport, {}),
|
|
75
|
+
data: { id: SpectraContextMenuOptionsKeys.ExportAsJcamp },
|
|
76
|
+
},
|
|
77
|
+
];
|
|
41
78
|
export function SpectraTable(props) {
|
|
42
79
|
const { data, activeSpectra, onChangeVisibility, onOpenSettingModal, onChangeActiveSpectrum, nucleus, } = props;
|
|
43
80
|
const alert = useAlert();
|
|
44
81
|
const dispatch = useDispatch();
|
|
45
82
|
const spectraPreferences = usePanelPreferences('spectra', nucleus);
|
|
46
83
|
const activeSpectraObj = getActiveSpectraAsObject(activeSpectra);
|
|
84
|
+
const [exportedSpectrum, setExportedSpectrum] = useState();
|
|
47
85
|
const COLUMNS = useMemo(() => ({
|
|
48
86
|
visible: {
|
|
49
87
|
id: 'hide-show-spectrum',
|
|
@@ -89,12 +127,12 @@ export function SpectraTable(props) {
|
|
|
89
127
|
},
|
|
90
128
|
},
|
|
91
129
|
}), [onChangeVisibility, onOpenSettingModal]);
|
|
92
|
-
const
|
|
93
|
-
{
|
|
94
|
-
|
|
95
|
-
|
|
130
|
+
const selectContextMenuHandler = useCallback((option, spectrum) => {
|
|
131
|
+
const { id } = option.data;
|
|
132
|
+
switch (id) {
|
|
133
|
+
case SpectraContextMenuOptionsKeys.CopyToClipboard: {
|
|
96
134
|
void (async () => {
|
|
97
|
-
const { data, info } =
|
|
135
|
+
const { data, info } = spectrum;
|
|
98
136
|
const success = await copyTextToClipboard(JSON.stringify({ data, info }, (_, value) => ArrayBuffer.isView(value) ? Array.from(value) : value, 2));
|
|
99
137
|
if (success) {
|
|
100
138
|
alert.success('Data copied to clipboard');
|
|
@@ -103,17 +141,23 @@ export function SpectraTable(props) {
|
|
|
103
141
|
alert.error('Copy to clipboard failed');
|
|
104
142
|
}
|
|
105
143
|
})();
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
label: 'Delete',
|
|
110
|
-
onClick: (spectrumData) => {
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
case SpectraContextMenuOptionsKeys.Delete: {
|
|
111
147
|
setTimeout(() => {
|
|
112
|
-
dispatch({ type: DELETE_SPECTRA, id:
|
|
148
|
+
dispatch({ type: DELETE_SPECTRA, id: spectrum.id });
|
|
113
149
|
}, 0);
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
case SpectraContextMenuOptionsKeys.ExportAsJcamp: {
|
|
153
|
+
setExportedSpectrum(spectrum);
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
default: {
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}, [alert, dispatch]);
|
|
117
161
|
function handleActiveRow(row) {
|
|
118
162
|
return activeSpectraObj?.[row?.original.id] || false;
|
|
119
163
|
}
|
|
@@ -163,7 +207,11 @@ export function SpectraTable(props) {
|
|
|
163
207
|
activated: { opacity: 1 },
|
|
164
208
|
};
|
|
165
209
|
}
|
|
166
|
-
return (_jsx(ReactTable, { rowStyle: handleRowStyle, activeRow: handleActiveRow, data: data, columns: tableColumns, onClick: (e, data) => onChangeActiveSpectrum(e, data.original), enableVirtualScroll: true, approxItemHeight: 26,
|
|
210
|
+
return (_jsxs(_Fragment, { children: [_jsx(ReactTable, { rowStyle: handleRowStyle, activeRow: handleActiveRow, data: data, columns: tableColumns, onClick: (e, data) => onChangeActiveSpectrum(e, data.original), enableVirtualScroll: true, approxItemHeight: 26, contextMenu: data.info && data.info.dimension === 1
|
|
211
|
+
? Spectra1DContextMenuOptions
|
|
212
|
+
: Spectra2DContextMenuOptions, onContextMenuSelect: selectContextMenuHandler, onSortEnd: handleSortEnd, style: { 'table td': { paddingTop: 0, paddingBottom: 0 } } }), exportedSpectrum && (_jsx(ExportAsJcampModal, { spectrum: exportedSpectrum, closeDialog: () => {
|
|
213
|
+
setExportedSpectrum(null);
|
|
214
|
+
} }))] }));
|
|
167
215
|
}
|
|
168
216
|
const ColumnHeader = ({ label, col, }) => {
|
|
169
217
|
const dispatch = useDispatch();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Display1D } from '
|
|
3
|
-
import { Display2D } from '../../../../data/types/data2d';
|
|
2
|
+
import { Display1D, Display2D } from 'nmr-load-save';
|
|
4
3
|
interface ColorIndicatorProps {
|
|
5
4
|
onClick: (e: any) => void;
|
|
6
5
|
display: Display1D | Display2D;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { Datum2D } from '../../../../data/types/data2d';
|
|
2
|
+
import { Spectrum } from 'nmr-load-save';
|
|
4
3
|
type VisibleKey = 'isVisible' | 'isPositiveVisible' | 'isNegativeVisible';
|
|
5
4
|
export interface OnChangeVisibilityEvent {
|
|
6
|
-
onChangeVisibility: (data:
|
|
5
|
+
onChangeVisibility: (data: Spectrum, is: VisibleKey) => void;
|
|
7
6
|
}
|
|
8
7
|
interface ShowHideSpectrumButtonProps extends OnChangeVisibilityEvent {
|
|
9
|
-
data:
|
|
8
|
+
data: Spectrum;
|
|
10
9
|
}
|
|
11
10
|
export default function ShowHideSpectrumButton({ data, onChangeVisibility, }: ShowHideSpectrumButtonProps): JSX.Element;
|
|
12
11
|
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { Datum2D } from '../../../../data/types/data2d';
|
|
2
|
+
import { Spectrum } from 'nmr-load-save';
|
|
4
3
|
interface SpectrumNameProps {
|
|
5
|
-
data:
|
|
4
|
+
data: Spectrum;
|
|
6
5
|
}
|
|
7
6
|
export declare function SpectrumName(props: SpectrumNameProps): JSX.Element;
|
|
8
7
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Data1D } from '
|
|
2
|
-
|
|
3
|
-
export declare function processSnapPlot<T extends '1D' | '2D'>(dimension: T, data: T extends '1D' ? Data1D : MinMaxContent, yLogBase: number): {
|
|
1
|
+
import { Data1D, Data2DFt } from 'nmr-load-save';
|
|
2
|
+
export declare function processSnapPlot<T extends '1D' | '2D'>(dimension: T, data: T extends '1D' ? Data1D : Data2DFt['rr'], yLogBase: number): {
|
|
4
3
|
sanPlot: any;
|
|
5
4
|
lines: any;
|
|
6
5
|
};
|
|
@@ -125,13 +125,6 @@ function AdditionalColumnField({ rowCorrelation, columnCorrelation, commonLinks,
|
|
|
125
125
|
? 'blue'
|
|
126
126
|
: 'black',
|
|
127
127
|
}, children: getAbbreviation(commonLink) }), i < commonLinks.length - 1 && _jsx("label", { children: "/" })] }, commonLink.id))), [commonLinks]);
|
|
128
|
-
const title = useMemo(() => {
|
|
129
|
-
return [
|
|
130
|
-
...new Set(commonLinks.link.map((link) => {
|
|
131
|
-
return link.experimentType.toUpperCase();
|
|
132
|
-
})),
|
|
133
|
-
].join('/');
|
|
134
|
-
}, [commonLinks]);
|
|
135
128
|
const isInViewRow = useInView({ correlation: rowCorrelation });
|
|
136
129
|
const isInViewColumn = useInView({ correlation: columnCorrelation });
|
|
137
130
|
return (_jsxs("td", { onContextMenu: (e) => {
|
|
@@ -144,6 +137,16 @@ function AdditionalColumnField({ rowCorrelation, columnCorrelation, commonLinks,
|
|
|
144
137
|
: isInViewColumn || isInViewRow
|
|
145
138
|
? '#f5f5dc'
|
|
146
139
|
: 'inherit',
|
|
147
|
-
}, title:
|
|
140
|
+
}, title: getTitle(commonLinks), onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, children: [contentLabel, _jsx(ContextMenu, { ref: contextRef, context: contextMenu })] }));
|
|
141
|
+
}
|
|
142
|
+
function getTitle(commonLinks) {
|
|
143
|
+
if (commonLinks?.length === 0) {
|
|
144
|
+
return '';
|
|
145
|
+
}
|
|
146
|
+
return [
|
|
147
|
+
...new Set(commonLinks?.link.map((link) => {
|
|
148
|
+
return link.experimentType.toUpperCase();
|
|
149
|
+
})),
|
|
150
|
+
].join('/');
|
|
148
151
|
}
|
|
149
152
|
export default AdditionalColumnField;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Correlation, Link } from 'nmr-correlation';
|
|
2
|
-
import {
|
|
3
|
-
import { Spectra } from '../../../NMRium';
|
|
2
|
+
import { Spectrum2D, Spectrum } from 'nmr-load-save';
|
|
4
3
|
import { ActiveSpectrum } from '../../../reducer/Reducer';
|
|
5
4
|
declare function getAtomType(nucleus: string): string;
|
|
6
5
|
declare function getLabelColor(correlationData: any, correlation: any): string | null;
|
|
7
|
-
declare function findSignalMatch1D(spectrum:
|
|
8
|
-
declare function findSignalMatch2D(spectrum:
|
|
6
|
+
declare function findSignalMatch1D(spectrum: Spectrum2D, link: Link, factor: number, xDomain0: number, xDomain1: number): boolean;
|
|
7
|
+
declare function findSignalMatch2D(spectrum: Spectrum2D, link: Link, factor: number, xDomain0: number, xDomain1: number, yDomain0: number, yDomain1: number): boolean;
|
|
9
8
|
declare function getAbbreviation(link: Link): string;
|
|
10
9
|
declare function buildNewLink1D(link: any): Link;
|
|
11
10
|
declare function buildNewLink2D(link: Link, axis: 'x' | 'y'): Link;
|
|
@@ -25,5 +24,5 @@ declare function getEditedCorrelations({ correlationDim1, correlationDim2, selec
|
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
26
|
declare function convertValuesString(valuesString: string, key: 'protonsCount' | 'hybridization'): number[];
|
|
28
|
-
declare function isInView(spectraData:
|
|
27
|
+
declare function isInView(spectraData: Spectrum[], activeTab: string, activeSpectrum: ActiveSpectrum | null, xDomain: number[], yDomain: number[], displayerMode: string, correlation: Correlation): boolean;
|
|
29
28
|
export { buildNewLink1D, buildNewLink2D, cloneCorrelationAndEditLink, convertValuesString, findSignalMatch1D, findSignalMatch2D, getAbbreviation, getAtomType, getEditedCorrelations, getLabelColor, isInView, };
|
|
@@ -141,7 +141,7 @@ function ZonesPanelInner({ zones, activeTab, xDomain, yDomain, experiment, showZ
|
|
|
141
141
|
position: relative;
|
|
142
142
|
}
|
|
143
143
|
`,
|
|
144
|
-
], children: [!isFlipped && (_jsxs(DefaultPanelHeader, { counter: zones.values ? zones.values.length : 0, onDelete: handleDeleteAll, deleteToolTip: "Delete All Zones", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all zones' : 'Hide zones out of view', filterIsActive: filterIsActive, counterFiltered: tableData?.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: [_jsx(ToolTip, { title: `Remove all
|
|
144
|
+
], children: [!isFlipped && (_jsxs(DefaultPanelHeader, { counter: zones.values ? zones.values.length : 0, onDelete: handleDeleteAll, deleteToolTip: "Delete All Zones", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all zones' : 'Hide zones out of view', filterIsActive: filterIsActive, counterFiltered: tableData?.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: [_jsx(ToolTip, { title: `Remove all assignments`, popupPlacement: "right", children: _jsx("button", { className: "remove-assignments-btn", type: "button", onClick: handleOnRemoveAssignments, disabled: !zones.values || zones.values.length === 0, children: _jsx(FaUnlink, {}) }) }), _jsx(ActiveButton, { popupTitle: "Show/Hide zones", popupPlacement: "right", value: showZones, onClick: handleSetShowZones, children: _jsx("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "z" }) }), _jsx(ActiveButton, { popupTitle: "Show/Hide signals", popupPlacement: "right", value: showSignals, onClick: handleSetShowSignals, children: _jsx("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "s" }) }), _jsx(ActiveButton, { popupTitle: "Show/Hide peaks", popupPlacement: "right", value: showPeaks, onClick: handleSetShowPeaks, children: _jsx("span", { style: { fontSize: '12px', pointerEvents: 'none' }, children: "p" }) })] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx("div", { className: "table-container", children: tableData && tableData.length > 0 ? (_jsx(ZonesTable, { tableData: tableData, onUnlink: unlinkZoneHandler, nuclei: activeTab && activeTab.split(',').length === 2
|
|
145
145
|
? activeTab.split(',')
|
|
146
146
|
: ['?', '?'], experiment: experiment })) : (_jsx(NoTableData, {})) })) : (_jsx(ZonesPreferences, { ref: settingRef })) })] }));
|
|
147
147
|
}
|
|
@@ -7,9 +7,8 @@ interface ZonesTableProps {
|
|
|
7
7
|
id: number;
|
|
8
8
|
}>;
|
|
9
9
|
onUnlink: (zoneData: any, isOnZoneLevel: any, signalIndex: any, axis: any) => void;
|
|
10
|
-
context?: any;
|
|
11
10
|
nuclei: string[];
|
|
12
11
|
experiment: string;
|
|
13
12
|
}
|
|
14
|
-
declare function ZonesTable({ tableData, onUnlink,
|
|
13
|
+
declare function ZonesTable({ tableData, onUnlink, nuclei, experiment, }: ZonesTableProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
14
|
export default ZonesTable;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { useMemo
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
5
|
import { FaLink } from 'react-icons/fa';
|
|
6
|
-
import checkModifierKeyActivated from '../../../data/utilities/checkModifierKeyActivated';
|
|
7
|
-
import ContextMenu from '../../elements/ContextMenu';
|
|
8
6
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
9
7
|
import useTableSortBy from '../../hooks/useTableSortBy';
|
|
10
8
|
import ZonesTableRow from './ZonesTableRow';
|
|
@@ -60,14 +58,7 @@ const tableStyle = css `
|
|
|
60
58
|
top: 21px;
|
|
61
59
|
}
|
|
62
60
|
`;
|
|
63
|
-
function ZonesTable({ tableData, onUnlink,
|
|
64
|
-
const contextRef = useRef(null);
|
|
65
|
-
const contextMenuHandler = useCallback((e, rowData) => {
|
|
66
|
-
if (!checkModifierKeyActivated(e)) {
|
|
67
|
-
e.preventDefault();
|
|
68
|
-
contextRef.current.handleContextMenu(e, rowData);
|
|
69
|
-
}
|
|
70
|
-
}, [contextRef]);
|
|
61
|
+
function ZonesTable({ tableData, onUnlink, nuclei, experiment, }) {
|
|
71
62
|
const data = useMemo(() => {
|
|
72
63
|
const data = [];
|
|
73
64
|
for (const [i, zone] of tableData.entries()) {
|
|
@@ -121,8 +112,7 @@ function ZonesTable({ tableData, onUnlink, context, nuclei, experiment, }) {
|
|
|
121
112
|
const { items: sortedData, isSortedDesc, onSort } = useTableSortBy(data);
|
|
122
113
|
const { deltaPPM: deltaX } = usePanelPreferences('zones', nuclei[0]);
|
|
123
114
|
const { deltaPPM: deltaY } = usePanelPreferences('zones', nuclei[1]);
|
|
124
|
-
|
|
125
|
-
return (_jsxs("div", { children: [_jsxs("table", { css: tableStyle, children: [_jsxs("thead", { children: [_jsxs("tr", { children: [_jsx("th", { rowSpan: 2, children: "#" }), _jsx("th", { colSpan: 2, children: "\u03B4 (ppm)" }), _jsx("th", { colSpan: 2, children: _jsx(FaLink, {}) }), _jsx("th", { colSpan: 2, children: "\u03A3" }), _jsx("th", { rowSpan: 2, children: "Kind" }), _jsx("th", { rowSpan: 2, children: '' })] }), _jsxs("tr", { children: [_jsx("th", { id: "tableMetaInfo.signal.x.delta", ...onSort, children: _jsxs(SurroundedText, { text: "F2", children: [nuclei[0], ' ', isSortedDesc('tableMetaInfo.signal.x.delta').content] }) }), _jsx("th", { id: "tableMetaInfo.signal.y.delta", ...onSort, children: _jsxs(SurroundedText, { text: "F1", children: [nuclei[1], ' ', isSortedDesc('tableMetaInfo.signal.y.delta').content] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F2", children: nuclei[0] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F1", children: nuclei[1] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F2", children: nuclei[0] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F1", children: nuclei[1] }) })] })] }), _jsx("tbody", { children: rows })] }), _jsx(ContextMenu, { ref: contextRef, context: context })] }));
|
|
115
|
+
return (_jsx("div", { children: _jsxs("table", { css: tableStyle, children: [_jsxs("thead", { children: [_jsxs("tr", { children: [_jsx("th", { rowSpan: 2, children: "#" }), _jsx("th", { colSpan: 2, children: "\u03B4 (ppm)" }), _jsx("th", { colSpan: 2, children: _jsx(FaLink, {}) }), _jsx("th", { colSpan: 2, children: "\u03A3" }), _jsx("th", { rowSpan: 2, children: "Kind" }), _jsx("th", { rowSpan: 2, children: '' })] }), _jsxs("tr", { children: [_jsx("th", { id: "tableMetaInfo.signal.x.delta", ...onSort, children: _jsxs(SurroundedText, { text: "F2", children: [nuclei[0], ' ', isSortedDesc('tableMetaInfo.signal.x.delta').content] }) }), _jsx("th", { id: "tableMetaInfo.signal.y.delta", ...onSort, children: _jsxs(SurroundedText, { text: "F1", children: [nuclei[1], ' ', isSortedDesc('tableMetaInfo.signal.y.delta').content] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F2", children: nuclei[0] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F1", children: nuclei[1] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F2", children: nuclei[0] }) }), _jsx("th", { children: _jsx(SurroundedText, { text: "F1", children: nuclei[1] }) })] })] }), _jsx("tbody", { children: sortedData.map((rowData, index) => (_jsx(ZonesTableRow, { rowIndex: index, rowData: rowData, onUnlink: onUnlink, format: { x: deltaX.format, y: deltaY.format } }, `${rowData.tableMetaInfo.id}`))) })] }) }));
|
|
126
116
|
}
|
|
127
117
|
function SurroundedText(props) {
|
|
128
118
|
return (_jsxs(_Fragment, { children: [_jsx("div", { style: {
|