nmrium 0.38.0 → 0.38.2
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/ApodizationLine.js +27 -4
- package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib/component/1d/FooterBanner.js +5 -5
- package/lib/component/1d/SpectraLegends.js +2 -3
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/integral/Integral.d.ts +1 -1
- package/lib/component/1d/integral/IntegralResizable.d.ts +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -1
- 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 +2 -1
- package/lib/component/1d/ranges/Range.d.ts +1 -1
- package/lib/component/1d/tool/PeakPointer.js +6 -6
- package/lib/component/1d/tool/XLabelPointer.js +5 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
- package/lib/component/1d-2d/tools/BrushX.js +2 -3
- package/lib/component/1d-2d/tools/BrushXY.js +2 -3
- package/lib/component/1d-2d/tools/CrossLinePointer.js +4 -5
- package/lib/component/2d/Chart2D.js +4 -4
- package/lib/component/2d/FooterBanner.js +5 -5
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +5 -5
- package/lib/component/2d/zones/Signal.d.ts +1 -1
- package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts +20 -12
- package/lib/component/EventsTrackers/BrushTracker.js +35 -22
- package/lib/component/EventsTrackers/MouseTracker.d.ts +6 -2
- package/lib/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib/component/NMRium.d.ts +4 -5
- package/lib/component/NMRium.js +11 -14
- package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
- package/lib/component/context/PreferencesContext.d.ts +6 -6
- package/lib/component/elements/Button.d.ts +13 -11
- package/lib/component/elements/Button.js +16 -25
- package/lib/component/elements/ColorInput.d.ts +0 -1
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/EditableColumn.js +5 -2
- package/lib/component/elements/Input.js +2 -4
- package/lib/component/elements/Label.d.ts +1 -0
- package/lib/component/elements/Label.js +2 -2
- package/lib/component/elements/MolecularFormulaInput.d.ts +2 -2
- package/lib/component/elements/MolecularFormulaInput.js +15 -18
- package/lib/component/elements/NextPrev.d.ts +5 -3
- package/lib/component/elements/NextPrev.js +26 -8
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
- package/lib/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +4 -0
- package/lib/component/elements/formik/FormikColumnFormatField.js +19 -16
- package/lib/component/elements/formik/FormikInput.js +10 -6
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/header/ApodizationOptionsPanel.js +4 -3
- package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -7
- package/lib/component/header/BaseLineCorrectionPanel.js +5 -2
- package/lib/component/header/PhaseCorrectionPanel.js +5 -2
- package/lib/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectra.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrum.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts +1 -1
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +2 -0
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.js +17 -0
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -2
- package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +3 -2
- package/lib/component/hooks/useExport.js +1 -1
- package/lib/component/hooks/useFilter.d.ts +2 -1
- package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
- package/lib/component/hooks/usePanelPreferences.js +4 -0
- package/lib/component/hooks/useSaveSettings.d.ts +1 -1
- package/lib/component/hooks/useSaveSettings.js +1 -1
- package/lib/component/hooks/useVerticalAlign.d.ts +1 -1
- package/lib/component/loader/DropZone.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
- package/lib/component/modal/LoadJCAMPModal.d.ts +3 -3
- package/lib/component/modal/LoadJCAMPModal.js +35 -66
- package/lib/component/modal/ModalStyle.js +0 -10
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +2 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
- package/lib/component/modal/PredictSpectraModal.d.ts +4 -2
- package/lib/component/modal/PredictSpectraModal.js +43 -105
- package/lib/component/modal/SaveAsModal.d.ts +2 -0
- package/lib/component/modal/SaveAsModal.js +21 -14
- package/lib/component/modal/changeSum/ChangeSumModal.js +25 -38
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -2
- package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib/component/modal/setting/GeneralSettings.js +1 -6
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -15
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +1 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +20 -25
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +6 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +71 -81
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +39 -53
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +7 -22
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
- 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/SpectraTable.js +5 -1
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +11 -28
- package/lib/component/panels/databasePanel/DatabasePreferences.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +2 -3
- package/lib/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib/component/panels/header/PanelHeader.d.ts +7 -0
- package/lib/component/panels/header/PanelHeader.js +12 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +9 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +94 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +107 -37
- package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +3 -0
- package/lib/component/panels/predictionPanel/PredictionPreferences.js +24 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.d.ts +2 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +44 -0
- package/lib/component/reducer/Reducer.d.ts +5 -87
- package/lib/component/reducer/Reducer.js +1 -25
- package/lib/component/reducer/actions/FiltersActions.d.ts +1 -2
- package/lib/component/reducer/actions/FiltersActions.js +47 -52
- package/lib/component/reducer/actions/HistoryActions.d.ts +4 -0
- package/lib/component/reducer/actions/HistoryActions.js +40 -0
- package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
- package/lib/component/reducer/actions/LoadActions.d.ts +1 -2
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +7 -4
- package/lib/component/reducer/actions/MoleculeActions.js +57 -28
- package/lib/component/reducer/actions/PeaksActions.d.ts +1 -2
- package/lib/component/reducer/actions/PeaksActions.js +3 -3
- package/lib/component/reducer/actions/RangesActions.d.ts +4 -5
- package/lib/component/reducer/actions/RangesActions.js +5 -27
- package/lib/component/reducer/actions/SpectrumsActions.js +2 -2
- package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
- package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
- package/lib/component/reducer/actions/ZonesActions.js +1 -2
- package/lib/component/reducer/helper/getActiveSpectra.d.ts +1 -1
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +1 -1
- package/lib/component/reducer/helper/getVerticalAlign.d.ts +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getActiveWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +2 -3
- package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +1 -1
- package/lib/component/toolbar/BasicToolBar.js +6 -11
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/toolbar/ToolTypes.js +1 -1
- package/lib/component/workspaces/assignment.d.ts +1 -1
- package/lib/component/workspaces/basic.d.ts +1 -1
- package/lib/component/workspaces/embedded.d.ts +1 -1
- package/lib/component/workspaces/exercise.d.ts +1 -1
- package/lib/component/workspaces/index.d.ts +6 -6
- package/lib/component/workspaces/prediction.d.ts +1 -1
- package/lib/component/workspaces/prediction.js +193 -0
- package/lib/component/workspaces/process1D.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/PredictionManager.d.ts +2 -1
- package/lib/data/PredictionManager.js +16 -2
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/constants/DefaultApodizationOptions.d.ts +2 -0
- package/lib/data/constants/DefaultApodizationOptions.js +5 -0
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +1 -5
- package/lib/data/data1d/Spectrum1D/index.js +1 -5
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -24
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +37 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +1 -1
- package/lib/data/data1d/database.js +2 -4
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +3 -30
- package/lib/data/data1d/multipleSpectraAnalysis.js +4 -15
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib/data/data2d/Spectrum2D/getSlice.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -1
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +3 -2
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/types/data1d/ComplexData1D.d.ts +2 -2
- package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
- package/lib/data/utilities/FindUtilities.d.ts +2 -1
- package/lib/data/utilities/RangeUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/calculateSanPlot.d.ts +2 -2
- package/lib/types/NMRiumDataReturn.d.ts +1 -3
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +28 -5
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +3 -26
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +5 -28
- package/lib-cjs/component/1d/FooterBanner.js +2 -2
- package/lib-cjs/component/1d/SpectraLegends.js +1 -2
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -3
- package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
- package/lib-cjs/component/1d-2d/tools/BrushX.js +1 -2
- package/lib-cjs/component/1d-2d/tools/BrushXY.js +1 -2
- package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +2 -3
- package/lib-cjs/component/2d/Chart2D.js +4 -4
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +36 -22
- package/lib-cjs/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib-cjs/component/NMRium.js +8 -11
- package/lib-cjs/component/elements/Button.js +16 -25
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +5 -2
- package/lib-cjs/component/elements/Input.js +2 -4
- package/lib-cjs/component/elements/Label.js +2 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +14 -16
- package/lib-cjs/component/elements/NextPrev.js +26 -8
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +20 -16
- package/lib-cjs/component/elements/formik/FormikInput.js +10 -6
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +6 -5
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +15 -6
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
- package/lib-cjs/component/header/PhaseCorrectionPanel.js +6 -26
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -25
- package/lib-cjs/component/hooks/useCheckPointsNumberInWindowArea.js +24 -0
- package/lib-cjs/component/hooks/useExport.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +4 -0
- package/lib-cjs/component/hooks/useSaveSettings.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +60 -67
- package/lib-cjs/component/modal/ModalStyle.js +0 -10
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib-cjs/component/modal/PredictSpectraModal.js +43 -126
- package/lib-cjs/component/modal/SaveAsModal.js +22 -14
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +24 -37
- package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -6
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +6 -14
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +19 -24
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +76 -86
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +38 -52
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +11 -28
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +25 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib-cjs/component/panels/header/PanelHeader.js +15 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +122 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +107 -37
- package/lib-cjs/component/panels/predictionPanel/PredictionPreferences.js +29 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +72 -0
- package/lib-cjs/component/reducer/Reducer.js +2 -27
- package/lib-cjs/component/reducer/actions/FiltersActions.js +66 -94
- package/lib-cjs/component/reducer/actions/HistoryActions.js +45 -0
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +58 -32
- package/lib-cjs/component/reducer/actions/PeaksActions.js +3 -3
- package/lib-cjs/component/reducer/actions/RangesActions.js +7 -52
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +4 -27
- package/lib-cjs/component/reducer/actions/ZonesActions.js +4 -28
- package/lib-cjs/component/toolbar/BasicToolBar.js +5 -10
- package/lib-cjs/component/toolbar/ToolTypes.js +9 -32
- package/lib-cjs/component/workspaces/prediction.js +193 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +21 -44
- package/lib-cjs/data/PredictionManager.js +16 -2
- package/lib-cjs/data/constants/DefaultApodizationOptions.js +8 -0
- package/lib-cjs/data/data1d/Spectrum1D/index.js +7 -11
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -32
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +7 -26
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +3 -4
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib-cjs/data/data1d/database.js +2 -4
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +5 -16
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -26
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +2 -25
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +25 -25
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +0 -7
- package/lib/component/panels/predictionPanel/PredictionOptions.js +0 -74
- package/lib/component/workspaces/Workspace.d.ts +0 -188
- package/lib/component/workspaces/Workspace.js +0 -1
- package/lib/data/Filters.d.ts +0 -12
- package/lib/data/Filters.js +0 -12
- package/lib/data/FiltersManager.d.ts +0 -30
- package/lib/data/FiltersManager.js +0 -175
- package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.js +0 -6
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -4
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +0 -7
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -9
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +0 -12
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -36
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -6
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -26
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +0 -3
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -45
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -7
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +0 -4
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -78
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -9
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -5
- package/lib/data/data1d/filter1d/apodization.d.ts +0 -27
- package/lib/data/data1d/filter1d/apodization.js +0 -81
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +0 -33
- package/lib/data/data1d/filter1d/baselineCorrection.js +0 -51
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +0 -20
- package/lib/data/data1d/filter1d/digitalFilter.js +0 -44
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +0 -33
- package/lib/data/data1d/filter1d/equallySpaced.js +0 -52
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +0 -15
- package/lib/data/data1d/filter1d/exclusionZones.js +0 -32
- package/lib/data/data1d/filter1d/fft.d.ts +0 -18
- package/lib/data/data1d/filter1d/fft.js +0 -90
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +0 -26
- package/lib/data/data1d/filter1d/phaseCorrection.js +0 -64
- package/lib/data/data1d/filter1d/shiftX.d.ts +0 -20
- package/lib/data/data1d/filter1d/shiftX.js +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.d.ts +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.js +0 -65
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +0 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -35
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +0 -22
- package/lib/data/data1d/filter1d/zeroFilling.js +0 -60
- package/lib/data/data2d/filter2d/shiftX.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftX.js +0 -27
- package/lib/data/data2d/filter2d/shiftY.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftY.js +0 -27
- package/lib/data/types/view-state/PeaksViewState.d.ts +0 -17
- package/lib/data/types/view-state/PeaksViewState.js +0 -1
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -7
- package/lib/types/NMRiumGeneralPreferences.js +0 -1
- package/lib/types/NMRiumPanelPreferences.d.ts +0 -17
- package/lib/types/NMRiumPanelPreferences.js +0 -1
- package/lib/types/NMRiumToolBarPreferences.d.ts +0 -22
- package/lib/types/NMRiumToolBarPreferences.js +0 -1
- package/lib/types/PanelPreferencesType.d.ts +0 -4
- package/lib/types/PanelPreferencesType.js +0 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +0 -102
- package/lib-cjs/component/workspaces/Workspace.js +0 -2
- package/lib-cjs/data/Filters.js +0 -38
- package/lib-cjs/data/FiltersManager.js +0 -206
- package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +0 -33
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -8
- package/lib-cjs/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -40
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -10
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -30
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -49
- package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -11
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -82
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/filter1d/apodization.js +0 -88
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +0 -60
- package/lib-cjs/data/data1d/filter1d/digitalFilter.js +0 -50
- package/lib-cjs/data/data1d/filter1d/equallySpaced.js +0 -61
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +0 -38
- package/lib-cjs/data/data1d/filter1d/fft.js +0 -96
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +0 -70
- package/lib-cjs/data/data1d/filter1d/shiftX.js +0 -32
- package/lib-cjs/data/data1d/filter1d/signalProcessing.js +0 -95
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -39
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +0 -66
- package/lib-cjs/data/data2d/filter2d/shiftX.js +0 -33
- package/lib-cjs/data/data2d/filter2d/shiftY.js +0 -33
- package/lib-cjs/data/types/view-state/PeaksViewState.js +0 -2
- package/lib-cjs/types/NMRiumGeneralPreferences.js +0 -2
- package/lib-cjs/types/NMRiumPanelPreferences.js +0 -2
- package/lib-cjs/types/NMRiumToolBarPreferences.js +0 -2
- package/lib-cjs/types/PanelPreferencesType.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import { Filters, apodization } from 'nmr-processing';
|
|
3
|
+
import { defaultApodizationOptions } from '../../data/constants/DefaultApodizationOptions';
|
|
4
4
|
import { useChartData } from '../context/ChartContext';
|
|
5
5
|
import { useScaleChecked } from '../context/ScaleContext';
|
|
6
6
|
import { useActiveSpectrum } from '../hooks/useActiveSpectrum';
|
|
@@ -32,8 +32,31 @@ function ApodizationLine() {
|
|
|
32
32
|
}
|
|
33
33
|
const paths = () => {
|
|
34
34
|
const pathBuilder = new PathBuilder();
|
|
35
|
-
const {
|
|
36
|
-
const
|
|
35
|
+
const { re, im = [], x } = spectrum.data;
|
|
36
|
+
const { lineBroadening, gaussBroadening, lineBroadeningCenter } = apodizationOptions || defaultApodizationOptions;
|
|
37
|
+
const length = re.length;
|
|
38
|
+
const dw = (x[length - 1] - x[0]) / (length - 1);
|
|
39
|
+
const { windowData: y } = apodization({ re, im }, {
|
|
40
|
+
apply: false,
|
|
41
|
+
compose: {
|
|
42
|
+
length,
|
|
43
|
+
shapes: [
|
|
44
|
+
{
|
|
45
|
+
start: 0,
|
|
46
|
+
shape: {
|
|
47
|
+
kind: 'lorentzToGauss',
|
|
48
|
+
options: {
|
|
49
|
+
length,
|
|
50
|
+
dw,
|
|
51
|
+
exponentialHz: gaussBroadening > 0 ? lineBroadening : -lineBroadening,
|
|
52
|
+
gaussianHz: gaussBroadening,
|
|
53
|
+
center: lineBroadeningCenter,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
});
|
|
37
60
|
if (x && y) {
|
|
38
61
|
const pathPoints = xyReduce({ x, y });
|
|
39
62
|
pathBuilder.moveTo(scaleX()(pathPoints.x[0]), scaleY(pathPoints.y[0]));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
+
import { Filters } from 'nmr-processing';
|
|
4
5
|
import { memo } from 'react';
|
|
5
|
-
import * as Filters from '../../data/Filters';
|
|
6
6
|
import { useScaleChecked } from '../context/ScaleContext';
|
|
7
7
|
import { HighlightEventSource, useHighlight } from '../highlight';
|
|
8
8
|
import useActiveSpectrumStyleOptions from '../hooks/useActiveSpectrumStyleOptions';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Filters } from 'nmr-processing';
|
|
2
3
|
import { memo } from 'react';
|
|
3
|
-
import * as Filters from '../../data/Filters';
|
|
4
4
|
import { useChartData } from '../context/ChartContext';
|
|
5
5
|
import { useScale } from '../context/ScaleContext';
|
|
6
6
|
import useSpectraByActiveNucleus from '../hooks/useSpectraPerNucleus';
|
|
@@ -2,12 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/reac
|
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
5
|
-
import {
|
|
5
|
+
import { memo } from 'react';
|
|
6
6
|
import { BsCursor } from 'react-icons/bs';
|
|
7
7
|
import { IoPulseSharp } from 'react-icons/io5';
|
|
8
8
|
import { get1DDataXY } from '../../data/data1d/Spectrum1D/get1DDataXY';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { useBrushTracker } from '../EventsTrackers/BrushTracker';
|
|
10
|
+
import { useMouseTracker } from '../EventsTrackers/MouseTracker';
|
|
11
11
|
import { useChartData } from '../context/ChartContext';
|
|
12
12
|
import { useScaleChecked } from '../context/ScaleContext';
|
|
13
13
|
import { useActiveSpectrum } from '../hooks/useActiveSpectrum';
|
|
@@ -76,8 +76,8 @@ const styles = css `
|
|
|
76
76
|
}
|
|
77
77
|
`;
|
|
78
78
|
function FooterBannerInner({ margin, width, height, activeSpectrum, spectrum, activeTab, }) {
|
|
79
|
-
let position =
|
|
80
|
-
const { startX, endX, step } =
|
|
79
|
+
let position = useMouseTracker();
|
|
80
|
+
const { startX, endX, step } = useBrushTracker();
|
|
81
81
|
const { scaleX } = useScaleChecked();
|
|
82
82
|
const format = useFormatNumberByNucleus(activeTab);
|
|
83
83
|
if (!position ||
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import lodashGet from 'lodash/get';
|
|
3
3
|
import { xFindClosestIndex } from 'ml-spectra-processing';
|
|
4
|
-
import { useContext } from 'react';
|
|
5
4
|
import { get1DDataXY } from '../../data/data1d/Spectrum1D/get1DDataXY';
|
|
6
|
-
import {
|
|
5
|
+
import { useMouseTracker } from '../EventsTrackers/MouseTracker';
|
|
7
6
|
import { useChartData } from '../context/ChartContext';
|
|
8
7
|
import { useScale } from '../context/ScaleContext';
|
|
9
8
|
import { SVGGroup } from '../elements/SVGGroup';
|
|
@@ -21,7 +20,7 @@ const styles = {
|
|
|
21
20
|
};
|
|
22
21
|
function YTracker({ datum }) {
|
|
23
22
|
const { scaleX } = useScale();
|
|
24
|
-
const position =
|
|
23
|
+
const position = useMouseTracker();
|
|
25
24
|
if (!scaleX || !position) {
|
|
26
25
|
return null;
|
|
27
26
|
}
|
|
@@ -6,7 +6,7 @@ import { MAX_LENGTH } from '../../data/data1d/Spectrum1D/ranges/detectSignal';
|
|
|
6
6
|
import BrushXY, { BRUSH_TYPE } from '../1d-2d/tools/BrushXY';
|
|
7
7
|
import CrossLinePointer from '../1d-2d/tools/CrossLinePointer';
|
|
8
8
|
import { ViewerResponsiveWrapper } from '../2d/Viewer2D';
|
|
9
|
-
import { BrushTracker } from '../EventsTrackers/BrushTracker';
|
|
9
|
+
import { BrushTracker, } from '../EventsTrackers/BrushTracker';
|
|
10
10
|
import { MouseTracker } from '../EventsTrackers/MouseTracker';
|
|
11
11
|
import { useChartData } from '../context/ChartContext';
|
|
12
12
|
import { useDispatch } from '../context/DispatchContext';
|
|
@@ -31,8 +31,9 @@ function DatabaseSpectrum() {
|
|
|
31
31
|
const loadSpectrum = useRef(throttle(async (baseURL, jcampRelativeURL) => {
|
|
32
32
|
try {
|
|
33
33
|
setLoading(true);
|
|
34
|
+
const url = new URL(jcampRelativeURL, baseURL);
|
|
34
35
|
const { data } = await readFromWebSource({
|
|
35
|
-
entries: [{ relativePath:
|
|
36
|
+
entries: [{ relativePath: url.pathname, baseURL: url.origin }],
|
|
36
37
|
});
|
|
37
38
|
setLoading(false);
|
|
38
39
|
const spectrum = data?.spectra?.[0] || null;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from 'react';
|
|
3
|
-
import { COLUMNS_TYPES, } from '../../../data/data1d/multipleSpectraAnalysis';
|
|
4
3
|
import { useChartData } from '../../context/ChartContext';
|
|
5
4
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
6
5
|
import AnalysisRange from './AnalysisRange';
|
|
6
|
+
import { AnalysisColumnsTypes } from 'nmr-load-save';
|
|
7
7
|
function MultiAnalysisRangesInner({ columns, displayerKey, activeTab, }) {
|
|
8
|
-
const ranges = Object.keys(columns).filter((key) => columns[key].type !==
|
|
8
|
+
const ranges = Object.keys(columns).filter((key) => columns[key].type !== AnalysisColumnsTypes.FORMULA);
|
|
9
9
|
if (!ranges || ranges.length === 0) {
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Signal1D } from 'nmr-
|
|
1
|
+
import { Signal1D } from 'nmr-processing';
|
|
2
2
|
declare function createTreeNodes(signal: Signal1D, spectrumData: any): (multiplicityIndex: any, jIndices: any, treeNodesData: any, startX: any) => any;
|
|
3
3
|
export default createTreeNodes;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import max from 'ml-array-max';
|
|
3
|
-
import {
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
4
|
import { get1DDataXY } from '../../../data/data1d/Spectrum1D/get1DDataXY';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useBrushTracker } from '../../EventsTrackers/BrushTracker';
|
|
6
|
+
import { useMouseTracker } from '../../EventsTrackers/MouseTracker';
|
|
7
7
|
import { useChartData } from '../../context/ChartContext';
|
|
8
8
|
import { useScaleChecked } from '../../context/ScaleContext';
|
|
9
9
|
import { useActiveSpectrum } from '../../hooks/useActiveSpectrum';
|
|
@@ -19,8 +19,8 @@ function PeakPointer() {
|
|
|
19
19
|
const { height, width, margin, data, mode, toolOptions: { selectedTool }, } = useChartData();
|
|
20
20
|
const { scaleX, scaleY, shiftY } = useScaleChecked();
|
|
21
21
|
const activeSpectrum = useActiveSpectrum();
|
|
22
|
-
let position =
|
|
23
|
-
const brushState =
|
|
22
|
+
let position = useMouseTracker();
|
|
23
|
+
const brushState = useBrushTracker();
|
|
24
24
|
const [closePeakPosition, setPosition] = useState();
|
|
25
25
|
useEffect(() => {
|
|
26
26
|
const getClosePeak = (xShift, mouseCoordinates) => {
|
|
@@ -73,7 +73,7 @@ function PeakPointer() {
|
|
|
73
73
|
brushState.step === 'brushing' ||
|
|
74
74
|
!position ||
|
|
75
75
|
position.y < margin.top ||
|
|
76
|
-
position.
|
|
76
|
+
position.x < margin.left ||
|
|
77
77
|
position.x > width - margin.right ||
|
|
78
78
|
position.y > height - margin.bottom) {
|
|
79
79
|
return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useCallback, useMemo } from 'react';
|
|
3
|
+
import { useBrushTracker } from '../../EventsTrackers/BrushTracker';
|
|
4
|
+
import { useMouseTracker } from '../../EventsTrackers/MouseTracker';
|
|
5
5
|
import { useChartData } from '../../context/ChartContext';
|
|
6
6
|
import { useScaleChecked } from '../../context/ScaleContext';
|
|
7
7
|
import { useActiveSpectrum } from '../../hooks/useActiveSpectrum';
|
|
@@ -20,8 +20,8 @@ function XLabelPointer() {
|
|
|
20
20
|
const { height, width, margin, data } = useChartData();
|
|
21
21
|
const activeSpectrum = useActiveSpectrum();
|
|
22
22
|
const { scaleX } = useScaleChecked();
|
|
23
|
-
const position =
|
|
24
|
-
const brushState =
|
|
23
|
+
const position = useMouseTracker();
|
|
24
|
+
const brushState = useBrushTracker();
|
|
25
25
|
const activeSpectrumData = useMemo(() => {
|
|
26
26
|
const spectrumData = activeSpectrum
|
|
27
27
|
? data.find((d) => d.id === activeSpectrum.id)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ranges, Zones } from 'nmr-
|
|
1
|
+
import { Ranges, Zones } from 'nmr-processing';
|
|
2
2
|
import { MoleculeView, StateMoleculeExtended } from '../../../../data/molecules/Molecule';
|
|
3
3
|
import { DISPLAYER_MODE } from '../../../reducer/core/Constants';
|
|
4
4
|
interface DraggableStructureProps {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Zones, Ranges } from 'nmr-
|
|
1
|
+
import { Zones, Ranges } from 'nmr-processing';
|
|
2
2
|
import { MoleculesView, StateMoleculeExtended } from '../../../../data/molecules/Molecule';
|
|
3
3
|
import { DISPLAYER_MODE } from '../../../reducer/core/Constants';
|
|
4
4
|
interface FloatMoleculeStructuresProps {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { BrushContext } from '../../EventsTrackers/BrushTracker';
|
|
2
|
+
import { useBrushTracker } from '../../EventsTrackers/BrushTracker';
|
|
4
3
|
import { useChartData } from '../../context/ChartContext';
|
|
5
4
|
import { options } from '../../toolbar/ToolTypes';
|
|
6
5
|
const styles = {
|
|
@@ -23,7 +22,7 @@ const allowTools = new Set([
|
|
|
23
22
|
]);
|
|
24
23
|
export default function BrushX() {
|
|
25
24
|
const { width, height, toolOptions: { selectedTool }, } = useChartData();
|
|
26
|
-
const { startX, endX, step } =
|
|
25
|
+
const { startX, endX, step } = useBrushTracker();
|
|
27
26
|
if (!allowTools.has(selectedTool) || step !== 'brushing')
|
|
28
27
|
return null;
|
|
29
28
|
const scale = (endX - startX) / width;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { BrushContext } from '../../EventsTrackers/BrushTracker';
|
|
2
|
+
import { useBrushTracker } from '../../EventsTrackers/BrushTracker';
|
|
4
3
|
import { useChartData } from '../../context/ChartContext';
|
|
5
4
|
import { options } from '../../toolbar/ToolTypes';
|
|
6
5
|
const styles = {
|
|
@@ -40,7 +39,7 @@ const defaultDimensionBorder = {
|
|
|
40
39
|
};
|
|
41
40
|
export default function BrushXY({ brushType = BRUSH_TYPE.XY, dimensionBorder = defaultDimensionBorder, width: widthProps, height: heightProps, }) {
|
|
42
41
|
let { width, height, toolOptions: { selectedTool }, } = useChartData();
|
|
43
|
-
let { startX, endX, startY, endY, step } =
|
|
42
|
+
let { startX, endX, startY, endY, step } = useBrushTracker();
|
|
44
43
|
if (!allowTools.has(selectedTool) ||
|
|
45
44
|
step !== 'brushing' ||
|
|
46
45
|
!dimensionBorder ||
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { MouseContext } from '../../EventsTrackers/MouseTracker';
|
|
2
|
+
import { useBrushTracker } from '../../EventsTrackers/BrushTracker';
|
|
3
|
+
import { useMouseTracker } from '../../EventsTrackers/MouseTracker';
|
|
5
4
|
import { useChartData } from '../../context/ChartContext';
|
|
6
5
|
import { options } from '../../toolbar/ToolTypes';
|
|
7
6
|
const styles = {
|
|
@@ -30,8 +29,8 @@ const allowTools = new Set([
|
|
|
30
29
|
]);
|
|
31
30
|
function CrossLinePointer() {
|
|
32
31
|
const { height, width, margin, toolOptions: { selectedTool }, } = useChartData();
|
|
33
|
-
let position =
|
|
34
|
-
const brushState =
|
|
32
|
+
let position = useMouseTracker();
|
|
33
|
+
const brushState = useBrushTracker();
|
|
35
34
|
if (!allowTools.has(selectedTool) ||
|
|
36
35
|
brushState.step === 'brushing' ||
|
|
37
36
|
!position ||
|
|
@@ -9,12 +9,12 @@ import { FidContainer } from './fid/FidContainer';
|
|
|
9
9
|
import { FTContainer } from './ft/FTContainer';
|
|
10
10
|
import IndicationLines from './zones/IndicationLines';
|
|
11
11
|
import Zones from './zones/Zones';
|
|
12
|
-
function chart2DInner({ spectra, width, height, margin, displayerKey,
|
|
13
|
-
return (_jsxs("svg", { viewBox: `0 0 ${width} ${height}`, width: width, height: height, id: "nmrSVG", shapeRendering:
|
|
12
|
+
function chart2DInner({ spectra, width, height, margin, displayerKey, SpectraRendering, }) {
|
|
13
|
+
return (_jsxs("svg", { viewBox: `0 0 ${width} ${height}`, width: width, height: height, id: "nmrSVG", shapeRendering: SpectraRendering, children: [_jsx("defs", { children: _jsx("clipPath", { id: `${displayerKey}clip-chart-2d`, children: _jsx("rect", { width: width - margin.left - margin.right, height: height - margin.top - margin.bottom, x: margin.left, y: margin.top }) }) }), _jsx("rect", { width: width - margin.left - margin.right, height: height - margin.top - margin.bottom, x: margin.left, y: margin.top, stroke: "black", strokeWidth: "1", fill: "transparent" }), _jsx(FTContainer, { spectra: spectra }), _jsx(FidContainer, {}), _jsx(Zones, {}), _jsx(IndicationLines, { axis: "X", show: true }), _jsx(IndicationLines, { axis: "Y", show: true }), _jsx(SpectrumInfoBlock, {}), _jsxs("g", { className: "container", style: { pointerEvents: 'none' }, children: [_jsx(XAxis, {}), _jsx(YAxis, {})] })] }));
|
|
14
14
|
}
|
|
15
15
|
const MemoizedChart2D = memo(chart2DInner);
|
|
16
16
|
export default function Chart2D({ spectra }) {
|
|
17
17
|
const { width, height, margin, displayerKey } = useChartData();
|
|
18
|
-
const { current: { general: {
|
|
19
|
-
return (_jsx(MemoizedChart2D, { spectra, width, height, margin, displayerKey,
|
|
18
|
+
const { current: { general: { SpectraRendering }, }, } = usePreferences();
|
|
19
|
+
return (_jsx(MemoizedChart2D, { spectra, width, height, margin, displayerKey, SpectraRendering }));
|
|
20
20
|
}
|
|
@@ -2,11 +2,11 @@ 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 { xFindClosestIndex } from 'ml-spectra-processing';
|
|
5
|
-
import {
|
|
5
|
+
import { useMemo, Fragment } from 'react';
|
|
6
6
|
import { MF } from 'react-mf';
|
|
7
7
|
import { get1DDataXY } from '../../data/data1d/Spectrum1D/get1DDataXY';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useBrushTracker } from '../EventsTrackers/BrushTracker';
|
|
9
|
+
import { useMouseTracker } from '../EventsTrackers/MouseTracker';
|
|
10
10
|
import { useChartData } from '../context/ChartContext';
|
|
11
11
|
import { useActiveSpectrum } from '../hooks/useActiveSpectrum';
|
|
12
12
|
import { useFormatNumberByNucleus } from '../hooks/useFormatNumberByNucleus';
|
|
@@ -55,8 +55,8 @@ const styles = css `
|
|
|
55
55
|
}
|
|
56
56
|
`;
|
|
57
57
|
function FooterBanner({ layout, data1D }) {
|
|
58
|
-
const position =
|
|
59
|
-
const { startX, endX, startY, endY, step } =
|
|
58
|
+
const position = useMouseTracker();
|
|
59
|
+
const { startX, endX, startY, endY, step } = useBrushTracker();
|
|
60
60
|
const { margin, width, height, xDomain, yDomain, yDomains, view: { spectra: { activeTab }, }, data, toolOptions: { selectedTool }, } = useChartData();
|
|
61
61
|
const activeSpectrum = useActiveSpectrum();
|
|
62
62
|
const trackID = position &&
|
|
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useMemo } from 'react';
|
|
|
3
3
|
import { ResponsiveChart } from 'react-d3-utils';
|
|
4
4
|
import BrushXY, { BRUSH_TYPE } from '../1d-2d/tools/BrushXY';
|
|
5
5
|
import CrossLinePointer from '../1d-2d/tools/CrossLinePointer';
|
|
6
|
-
import { BrushTracker } from '../EventsTrackers/BrushTracker';
|
|
6
|
+
import { BrushTracker, } from '../EventsTrackers/BrushTracker';
|
|
7
7
|
import { MouseTracker } from '../EventsTrackers/MouseTracker';
|
|
8
8
|
import { useChartData } from '../context/ChartContext';
|
|
9
9
|
import { useDispatch } from '../context/DispatchContext';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useBrushTracker } from '../../EventsTrackers/BrushTracker';
|
|
4
|
+
import { useMouseTracker } from '../../EventsTrackers/MouseTracker';
|
|
5
5
|
import { useChartData } from '../../context/ChartContext';
|
|
6
6
|
import { useActiveSpectrum } from '../../hooks/useActiveSpectrum';
|
|
7
7
|
import { useFormatNumberByNucleus } from '../../hooks/useFormatNumberByNucleus';
|
|
@@ -22,8 +22,8 @@ const style = {
|
|
|
22
22
|
textAlign: 'right',
|
|
23
23
|
};
|
|
24
24
|
function XYLabelPointer({ layout, data1D }) {
|
|
25
|
-
const position =
|
|
26
|
-
const { step } =
|
|
25
|
+
const position = useMouseTracker();
|
|
26
|
+
const { step } = useBrushTracker();
|
|
27
27
|
const { margin, width, height, xDomain, yDomain, yDomains, view: { spectra: { activeTab }, }, } = useChartData();
|
|
28
28
|
const activeSpectrum = useActiveSpectrum();
|
|
29
29
|
const trackID = position &&
|
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
start: null;
|
|
6
|
-
end: null;
|
|
7
|
-
};
|
|
2
|
+
type Step = 'initial' | 'start' | 'end' | 'brushing';
|
|
3
|
+
interface BrushTrackerContext {
|
|
4
|
+
step: Step;
|
|
8
5
|
startX: number;
|
|
9
6
|
endX: number;
|
|
10
7
|
startY: number;
|
|
11
8
|
endY: number;
|
|
12
|
-
|
|
9
|
+
shiftKey: boolean;
|
|
10
|
+
altKey: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const BrushContext: import("react").Context<BrushTrackerContext>;
|
|
13
|
+
export declare function useBrushTracker(): BrushTrackerContext;
|
|
14
|
+
interface Position {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}
|
|
18
|
+
export type OnClick = (element: React.MouseEvent & Position) => void;
|
|
19
|
+
export type { OnClick as OnDoubleClick };
|
|
20
|
+
export type OnZoom = (event: Pick<React.WheelEvent, 'deltaY' | 'shiftKey' | 'deltaMode'> & Position) => void;
|
|
21
|
+
export type OnBrush = (state: BrushTrackerContext) => void;
|
|
13
22
|
interface BrushTrackerProps {
|
|
14
23
|
children: ReactNode;
|
|
15
24
|
className?: string;
|
|
16
25
|
style?: CSSProperties;
|
|
17
|
-
onBrush?:
|
|
18
|
-
onZoom?:
|
|
19
|
-
onDoubleClick?:
|
|
20
|
-
onClick?:
|
|
26
|
+
onBrush?: OnBrush;
|
|
27
|
+
onZoom?: OnZoom;
|
|
28
|
+
onDoubleClick?: OnClick;
|
|
29
|
+
onClick?: OnClick;
|
|
21
30
|
noPropagation?: boolean;
|
|
22
31
|
}
|
|
23
32
|
export declare function BrushTracker({ children, className, style, onBrush, onZoom, onDoubleClick, onClick, noPropagation, }: BrushTrackerProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export {};
|
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import lodashDebounce from 'lodash/debounce';
|
|
3
3
|
import lodashMap from 'lodash/map';
|
|
4
|
-
import { createContext, useCallback, useEffect, useReducer, useRef, useState, } from 'react';
|
|
4
|
+
import { createContext, useCallback, useEffect, useReducer, useRef, useState, useContext, } from 'react';
|
|
5
5
|
const initialState = {
|
|
6
6
|
step: 'initial',
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
end: null,
|
|
10
|
-
},
|
|
7
|
+
shiftKey: false,
|
|
8
|
+
altKey: false,
|
|
11
9
|
startX: 0,
|
|
12
10
|
endX: 0,
|
|
13
11
|
startY: 0,
|
|
14
12
|
endY: 0,
|
|
13
|
+
startScreenX: 0,
|
|
14
|
+
startScreenY: 0,
|
|
15
|
+
startClientX: 0,
|
|
16
|
+
startClientY: 0,
|
|
17
|
+
boundingRect: null,
|
|
15
18
|
};
|
|
16
19
|
function stopPageScrolling(event) {
|
|
17
20
|
event.preventDefault();
|
|
18
21
|
}
|
|
19
22
|
export const BrushContext = createContext(initialState);
|
|
23
|
+
export function useBrushTracker() {
|
|
24
|
+
if (!BrushContext) {
|
|
25
|
+
throw new Error('Brush context was not found');
|
|
26
|
+
}
|
|
27
|
+
return useContext(BrushContext);
|
|
28
|
+
}
|
|
20
29
|
export function BrushTracker({ children, className, style, onBrush = () => null, onZoom = () => null, onDoubleClick = () => null, onClick = () => null, noPropagation, }) {
|
|
21
30
|
const [state, dispatch] = useReducer(reducer, initialState);
|
|
22
31
|
const [mouseDownTime, setMouseDownTime] = useState(0);
|
|
@@ -28,23 +37,27 @@ export function BrushTracker({ children, className, style, onBrush = () => null,
|
|
|
28
37
|
}
|
|
29
38
|
dispatch({
|
|
30
39
|
type: 'DOWN',
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
payload: {
|
|
41
|
+
shiftKey: event.shiftKey,
|
|
42
|
+
altKey: event.altKey,
|
|
43
|
+
screenX: event.screenX,
|
|
44
|
+
screenY: event.screenY,
|
|
45
|
+
clientX: event.clientX,
|
|
46
|
+
clientY: event.clientY,
|
|
47
|
+
boundingRect: event.currentTarget.getBoundingClientRect(),
|
|
48
|
+
},
|
|
38
49
|
});
|
|
39
50
|
setMouseDownTime(event.timeStamp);
|
|
40
51
|
}
|
|
41
52
|
function moveCallback(event) {
|
|
42
53
|
dispatch({
|
|
43
54
|
type: 'MOVE',
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
payload: {
|
|
56
|
+
screenX: event.screenX,
|
|
57
|
+
screenY: event.screenY,
|
|
58
|
+
clientX: event.clientX,
|
|
59
|
+
clientY: event.clientY,
|
|
60
|
+
},
|
|
48
61
|
});
|
|
49
62
|
}
|
|
50
63
|
function mouseUpCallback() {
|
|
@@ -59,7 +72,6 @@ export function BrushTracker({ children, className, style, onBrush = () => null,
|
|
|
59
72
|
return false;
|
|
60
73
|
}, [noPropagation]);
|
|
61
74
|
const clickHandler = useCallback((e) => {
|
|
62
|
-
e.persist();
|
|
63
75
|
const timeStamp = e.timeStamp;
|
|
64
76
|
const boundingRect = e.currentTarget.getBoundingClientRect();
|
|
65
77
|
const x = e.clientX - boundingRect.x;
|
|
@@ -117,7 +129,7 @@ function reducer(state, action) {
|
|
|
117
129
|
return state;
|
|
118
130
|
case 'DOWN':
|
|
119
131
|
if (state.step === 'initial' || state.step === 'end') {
|
|
120
|
-
const { screenX, screenY, clientX, clientY, boundingRect,
|
|
132
|
+
const { shiftKey, altKey, screenX, screenY, clientX, clientY, boundingRect, } = action.payload;
|
|
121
133
|
const x = clientX - boundingRect.x;
|
|
122
134
|
const y = clientY - boundingRect.y;
|
|
123
135
|
return {
|
|
@@ -137,12 +149,13 @@ function reducer(state, action) {
|
|
|
137
149
|
return state;
|
|
138
150
|
case 'MOVE':
|
|
139
151
|
if (state.step === 'start' || state.step === 'brushing') {
|
|
140
|
-
const { clientX, clientY } = action;
|
|
152
|
+
const { clientX, clientY } = action.payload;
|
|
153
|
+
const { x = 0, y = 0 } = state.boundingRect || {};
|
|
141
154
|
return {
|
|
142
155
|
...state,
|
|
143
156
|
step: 'brushing',
|
|
144
|
-
endX: clientX -
|
|
145
|
-
endY: clientY -
|
|
157
|
+
endX: clientX - x,
|
|
158
|
+
endY: clientY - y,
|
|
146
159
|
};
|
|
147
160
|
}
|
|
148
161
|
return state;
|
|
@@ -153,7 +166,7 @@ function reducer(state, action) {
|
|
|
153
166
|
step: 'initial',
|
|
154
167
|
};
|
|
155
168
|
}
|
|
156
|
-
|
|
169
|
+
return state;
|
|
157
170
|
default:
|
|
158
171
|
return state;
|
|
159
172
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
interface MouseTrackerData {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const MouseContext: import("react").Context<MouseTrackerData | null>;
|
|
7
|
+
export declare function useMouseTracker(): MouseTrackerData | null;
|
|
4
8
|
interface MouseTrackerProps {
|
|
5
9
|
children: ReactNode;
|
|
6
10
|
className?: string;
|