nmrium 0.37.0 → 0.38.1
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/FooterBanner.js +1 -1
- package/lib/component/1d/Viewer1D.js +26 -21
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/integral/Integral.d.ts +2 -6
- package/lib/component/1d/integral/IntegralResizable.d.ts +2 -6
- package/lib/component/1d/integral/IntegralResizable.js +2 -3
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -2
- package/lib/component/1d/ranges/Range.js +9 -8
- package/lib/component/1d/ranges/Ranges.js +5 -7
- package/lib/component/1d/tool/BaseLineZones.js +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
- package/lib/component/2d/1d-tracer/Left1DChart.js +1 -1
- package/lib/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
- package/lib/component/2d/Chart2D.js +1 -1
- package/lib/component/2d/Viewer2D.js +10 -9
- package/lib/component/2d/fid/FidCanvas.js +4 -6
- package/lib/component/2d/ft/Contours.js +1 -1
- package/lib/component/2d/utilities/DimensionLayout.d.ts +9 -24
- package/lib/component/2d/utilities/scale.d.ts +2 -1
- package/lib/component/2d/utilities/scale.js +1 -1
- package/lib/component/2d/zones/Zones.js +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +28 -21
- package/lib/component/NMRium.js +15 -7
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
- package/lib/component/context/DispatchContext.d.ts +23 -3
- package/lib/component/context/DispatchContext.js +1 -1
- package/lib/component/context/LoggerContext.js +1 -1
- package/lib/component/elements/Button.js +7 -9
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorInput.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.js +1 -1
- package/lib/component/elements/formik/FormikColumnFormatField.js +1 -1
- package/lib/component/elements/formik/FormikInput.js +1 -1
- package/lib/component/elements/formik/FormikSelect.js +2 -2
- package/lib/component/elements/formik/FormikSlider.js +1 -1
- package/lib/component/elements/formik/FormikTextarea.js +2 -2
- package/lib/component/header/ApodizationOptionsPanel.js +4 -5
- package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +4 -5
- package/lib/component/header/Header.js +4 -6
- package/lib/component/header/PhaseCorrectionPanel.js +7 -8
- package/lib/component/header/RangesPickingOptionPanel.js +1 -2
- package/lib/component/header/ZeroFillingOptionsPanel.js +3 -11
- package/lib/component/header/Zones2DOptionPanel.js +5 -6
- package/lib/component/hooks/useExport.js +1 -0
- package/lib/component/hooks/useToolsFunctions.js +8 -10
- package/lib/component/loader/DropZone.js +4 -5
- package/lib/component/loader/NoData.js +1 -1
- package/lib/component/modal/AlignSpectraModal.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.js +1 -2
- package/lib/component/modal/ImportPublicationStringModal.js +1 -2
- package/lib/component/modal/LoadJCAMPModal.js +2 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js +24 -19
- package/lib/component/modal/PredictSpectraModal.d.ts +1 -1
- package/lib/component/modal/PredictSpectraModal.js +24 -21
- package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +3 -4
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +2 -3
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
- package/lib/component/panels/InformationPanel.js +6 -6
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -10
- package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
- package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +5 -6
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +4 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +2 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/Panels.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -5
- package/lib/component/panels/RangesPanel/RangesHeader.js +12 -15
- package/lib/component/panels/RangesPanel/RangesPanel.js +24 -29
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -34
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +2 -13
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +15 -18
- package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -51
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +16 -0
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +52 -0
- package/lib/component/panels/databasePanel/DatabasePanel.js +15 -11
- package/lib/component/panels/filtersPanel/FilterPanel.js +1 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +8 -9
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
- package/lib/component/panels/predictionPanel/PredictionPanel.js +4 -5
- package/lib/component/reducer/IgnoreActions.d.ts +2 -1
- package/lib/component/reducer/IgnoreActions.js +35 -32
- package/lib/component/reducer/Reducer.d.ts +8 -5
- package/lib/component/reducer/Reducer.js +202 -220
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +7 -6
- package/lib/component/reducer/actions/AssignmentsActions.js +2 -2
- package/lib/component/reducer/actions/CorrelationsActions.d.ts +21 -13
- package/lib/component/reducer/actions/CorrelationsActions.js +25 -20
- package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -2
- package/lib/component/reducer/actions/DatabaseActions.js +5 -2
- package/lib/component/reducer/actions/DimensionsActions.d.ts +8 -3
- package/lib/component/reducer/actions/DimensionsActions.js +3 -5
- package/lib/component/reducer/actions/DomainActions.d.ts +11 -5
- package/lib/component/reducer/actions/DomainActions.js +13 -19
- package/lib/component/reducer/actions/FiltersActions.d.ts +70 -23
- package/lib/component/reducer/actions/FiltersActions.js +250 -255
- package/lib/component/reducer/actions/GlobalActions.d.ts +7 -2
- package/lib/component/reducer/actions/GlobalActions.js +3 -3
- package/lib/component/reducer/actions/IntegralsActions.d.ts +28 -7
- package/lib/component/reducer/actions/IntegralsActions.js +16 -15
- package/lib/component/reducer/actions/LoadActions.d.ts +23 -5
- package/lib/component/reducer/actions/LoadActions.js +52 -52
- package/lib/component/reducer/actions/MoleculeActions.d.ts +38 -9
- package/lib/component/reducer/actions/MoleculeActions.js +27 -18
- package/lib/component/reducer/actions/PeaksActions.d.ts +39 -8
- package/lib/component/reducer/actions/PeaksActions.js +19 -11
- package/lib/component/reducer/actions/PreferencesActions.d.ts +8 -3
- package/lib/component/reducer/actions/PreferencesActions.js +5 -3
- package/lib/component/reducer/actions/RangesActions.d.ts +85 -18
- package/lib/component/reducer/actions/RangesActions.js +80 -65
- package/lib/component/reducer/actions/SpectraAnalysisAction.d.ts +7 -1
- package/lib/component/reducer/actions/SpectrumsActions.d.ts +57 -24
- package/lib/component/reducer/actions/SpectrumsActions.js +69 -60
- package/lib/component/reducer/actions/ToolsActions.d.ts +59 -21
- package/lib/component/reducer/actions/ToolsActions.js +54 -32
- package/lib/component/reducer/actions/ZonesActions.d.ts +79 -15
- package/lib/component/reducer/actions/ZonesActions.js +68 -49
- package/lib/component/reducer/helper/Zoom1DManager.d.ts +6 -5
- package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -2
- package/lib/component/reducer/helper/get2DRange.d.ts +7 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/types/ActionType.d.ts +6 -0
- package/lib/component/reducer/types/ActionType.js +1 -0
- package/lib/component/toolbar/BasicToolBar.js +6 -9
- package/lib/component/toolbar/FunctionToolBar.js +4 -9
- package/lib/component/toolbar/ToolBar.js +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/utility/Events.d.ts +4 -4
- package/lib/component/utility/Events.js +2 -2
- package/lib/component/utility/GroupByInfoKey.js +1 -1
- package/lib/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib/data/PredictionManager.d.ts +7 -9
- package/lib/data/PredictionManager.js +3 -3
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +2 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +5 -3
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -35
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +2 -35
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +7 -10
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +5 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +2 -0
- package/lib/data/matrixGeneration.js +4 -2
- package/lib/data/molecules/Molecule.d.ts +3 -3
- package/lib/data/molecules/MoleculeManager.d.ts +5 -5
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/utilities/generateColor.js +1 -1
- package/lib/data/utilities/isNumber.d.ts +1 -0
- package/lib/data/utilities/isNumber.js +3 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +25 -20
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/integral/IntegralResizable.js +2 -3
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -2
- package/lib-cjs/component/1d/ranges/Range.js +9 -8
- package/lib-cjs/component/1d/ranges/Ranges.js +5 -7
- package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -2
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
- package/lib-cjs/component/2d/1d-tracer/Left1DChart.js +1 -1
- package/lib-cjs/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/Chart2D.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +10 -9
- package/lib-cjs/component/2d/fid/FidCanvas.js +4 -6
- package/lib-cjs/component/2d/ft/Contours.js +1 -1
- package/lib-cjs/component/2d/utilities/scale.js +1 -1
- package/lib-cjs/component/2d/zones/Zones.js +1 -1
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +28 -21
- package/lib-cjs/component/NMRium.js +15 -7
- package/lib-cjs/component/context/DispatchContext.js +1 -1
- package/lib-cjs/component/context/LoggerContext.js +1 -1
- package/lib-cjs/component/elements/Button.js +7 -9
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +1 -2
- package/lib-cjs/component/elements/Tab/Tabs.js +1 -1
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +1 -1
- package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSelect.js +2 -2
- package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
- package/lib-cjs/component/elements/formik/FormikTextarea.js +2 -2
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +3 -4
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +1 -2
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +4 -5
- package/lib-cjs/component/header/Header.js +4 -6
- package/lib-cjs/component/header/PhaseCorrectionPanel.js +7 -8
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +1 -2
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -11
- package/lib-cjs/component/header/Zones2DOptionPanel.js +5 -6
- package/lib-cjs/component/highlight/index.js +1 -1
- package/lib-cjs/component/hooks/useExport.js +1 -0
- package/lib-cjs/component/hooks/useTableSortBy.js +1 -1
- package/lib-cjs/component/hooks/useToolsFunctions.js +8 -10
- package/lib-cjs/component/hooks/useXYReduce.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +4 -5
- package/lib-cjs/component/loader/NoData.js +1 -1
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
- package/lib-cjs/component/modal/EditPeakShapeModal.js +1 -2
- package/lib-cjs/component/modal/ImportPublicationStringModal.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -3
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -19
- package/lib-cjs/component/modal/PredictSpectraModal.js +24 -21
- package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -4
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +2 -3
- package/lib-cjs/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
- package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
- package/lib-cjs/component/panels/InformationPanel.js +6 -6
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -10
- package/lib-cjs/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
- package/lib-cjs/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
- package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +5 -6
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/Panels.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -5
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +4 -5
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +12 -15
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +24 -29
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +39 -34
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +15 -18
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -51
- package/lib-cjs/component/panels/ZonesPanel/hooks/useMapZones.js +56 -0
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +14 -10
- package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +8 -9
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +4 -5
- package/lib-cjs/component/reducer/IgnoreActions.js +35 -55
- package/lib-cjs/component/reducer/Reducer.js +202 -220
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +3 -3
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +23 -18
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +4 -1
- package/lib-cjs/component/reducer/actions/DimensionsActions.js +3 -6
- package/lib-cjs/component/reducer/actions/DomainActions.js +15 -23
- package/lib-cjs/component/reducer/actions/FiltersActions.js +267 -272
- package/lib-cjs/component/reducer/actions/GlobalActions.js +4 -4
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +19 -18
- package/lib-cjs/component/reducer/actions/LoadActions.js +55 -55
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +31 -22
- package/lib-cjs/component/reducer/actions/PeaksActions.js +23 -15
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +7 -5
- package/lib-cjs/component/reducer/actions/RangesActions.js +81 -64
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +77 -67
- package/lib-cjs/component/reducer/actions/ToolsActions.js +54 -31
- package/lib-cjs/component/reducer/actions/ZonesActions.js +73 -52
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -2
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -2
- package/lib-cjs/component/reducer/types/ActionType.js +2 -0
- package/lib-cjs/component/toolbar/BasicToolBar.js +6 -9
- package/lib-cjs/component/toolbar/FunctionToolBar.js +4 -9
- package/lib-cjs/component/toolbar/ToolBar.js +1 -1
- package/lib-cjs/component/utility/GroupByInfoKey.js +1 -1
- package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib-cjs/data/PredictionManager.js +3 -3
- package/lib-cjs/data/SpectraManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
- package/lib-cjs/data/matrixGeneration.js +4 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/generateColor.js +1 -1
- package/lib-cjs/data/utilities/isNumber.js +7 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +24 -23
- package/lib/component/reducer/actions/HistoryActions.d.ts +0 -4
- package/lib/component/reducer/actions/HistoryActions.js +0 -40
- package/lib/component/reducer/types/HistoryTypes.d.ts +0 -4
- package/lib/component/reducer/types/HistoryTypes.js +0 -4
- package/lib/component/reducer/types/Types.d.ts +0 -132
- package/lib/component/reducer/types/Types.js +0 -126
- package/lib/component/toolbar/HistoryToolBar.d.ts +0 -8
- package/lib/component/toolbar/HistoryToolBar.js +0 -30
- package/lib/data/utilities/isMolFileEmpty.d.ts +0 -1
- package/lib/data/utilities/isMolFileEmpty.js +0 -6
- package/lib-cjs/component/reducer/actions/HistoryActions.js +0 -45
- package/lib-cjs/component/reducer/types/HistoryTypes.js +0 -7
- package/lib-cjs/component/reducer/types/Types.js +0 -131
- package/lib-cjs/component/toolbar/HistoryToolBar.js +0 -35
- package/lib-cjs/data/utilities/isMolFileEmpty.js +0 -10
|
@@ -111,5 +111,5 @@ export default function FooterBanner() {
|
|
|
111
111
|
const { margin, width, height, view: { spectra: { activeTab }, }, } = useChartData();
|
|
112
112
|
const activeSpectrum = useActiveSpectrum();
|
|
113
113
|
const spectrum = useSpectrum(null);
|
|
114
|
-
return (_jsx(MemoizedFooterBanner, {
|
|
114
|
+
return (_jsx(MemoizedFooterBanner, { margin, width, height, activeSpectrum, spectrum, activeTab }));
|
|
115
115
|
}
|
|
@@ -18,10 +18,9 @@ import { useActiveSpectrum } from '../hooks/useActiveSpectrum';
|
|
|
18
18
|
import { useVerticalAlign } from '../hooks/useVerticalAlign';
|
|
19
19
|
import Spinner from '../loader/Spinner';
|
|
20
20
|
import MultipletAnalysisModal from '../modal/MultipletAnalysisModal';
|
|
21
|
-
import {
|
|
21
|
+
import { ZOOM_TYPES } from '../reducer/helper/Zoom1DManager';
|
|
22
22
|
import getRange from '../reducer/helper/getRange';
|
|
23
23
|
import scaleReducer, { scaleInitialState, SET_SCALE, } from '../reducer/scaleReducer';
|
|
24
|
-
import { ADD_INTEGRAL, ADD_PEAKS, ADD_BASE_LINE_ZONE, BRUSH_END, FULL_ZOOM_OUT, SET_ZOOM, ADD_PEAK, SET_VERTICAL_INDICATOR_X_POSITION, ADD_RANGE, ADD_EXCLUSION_ZONE, } from '../reducer/types/Types';
|
|
25
24
|
import { options } from '../toolbar/ToolTypes';
|
|
26
25
|
import Events from '../utility/Events';
|
|
27
26
|
import Chart1D from './Chart1D';
|
|
@@ -97,8 +96,8 @@ function Viewer1D({ emptyText = undefined }) {
|
|
|
97
96
|
switch (selectedTool) {
|
|
98
97
|
case options.integral.id:
|
|
99
98
|
dispatch({
|
|
100
|
-
type: ADD_INTEGRAL,
|
|
101
|
-
|
|
99
|
+
type: 'ADD_INTEGRAL',
|
|
100
|
+
payload: brushData,
|
|
102
101
|
});
|
|
103
102
|
break;
|
|
104
103
|
case options.rangePicking.id: {
|
|
@@ -112,10 +111,8 @@ function Viewer1D({ emptyText = undefined }) {
|
|
|
112
111
|
const { fromIndex, toIndex } = xGetFromToIndex(x, { from, to });
|
|
113
112
|
if (toIndex - fromIndex <= MAX_LENGTH) {
|
|
114
113
|
dispatch({
|
|
115
|
-
type: ADD_RANGE,
|
|
116
|
-
payload:
|
|
117
|
-
...brushData,
|
|
118
|
-
},
|
|
114
|
+
type: 'ADD_RANGE',
|
|
115
|
+
payload: brushData,
|
|
119
116
|
});
|
|
120
117
|
}
|
|
121
118
|
else {
|
|
@@ -140,20 +137,23 @@ function Viewer1D({ emptyText = undefined }) {
|
|
|
140
137
|
break;
|
|
141
138
|
case options.peakPicking.id:
|
|
142
139
|
dispatch({
|
|
143
|
-
type: ADD_PEAKS,
|
|
144
|
-
|
|
140
|
+
type: 'ADD_PEAKS',
|
|
141
|
+
payload: brushData,
|
|
145
142
|
});
|
|
146
143
|
break;
|
|
147
144
|
case options.baselineCorrection.id:
|
|
148
145
|
dispatch({
|
|
149
|
-
type: ADD_BASE_LINE_ZONE,
|
|
150
|
-
|
|
146
|
+
type: 'ADD_BASE_LINE_ZONE',
|
|
147
|
+
payload: {
|
|
148
|
+
startX: brushData.startX,
|
|
149
|
+
endX: brushData.endX,
|
|
150
|
+
},
|
|
151
151
|
});
|
|
152
152
|
break;
|
|
153
153
|
case options.exclusionZones.id:
|
|
154
154
|
dispatch({
|
|
155
|
-
type: ADD_EXCLUSION_ZONE,
|
|
156
|
-
payload: {
|
|
155
|
+
type: 'ADD_EXCLUSION_ZONE',
|
|
156
|
+
payload: { startX: brushData.startX, endX: brushData.endX },
|
|
157
157
|
});
|
|
158
158
|
break;
|
|
159
159
|
case options.matrixGenerationExclusionZones.id: {
|
|
@@ -180,7 +180,7 @@ function Viewer1D({ emptyText = undefined }) {
|
|
|
180
180
|
switch (selectedTool) {
|
|
181
181
|
default:
|
|
182
182
|
if (selectedTool != null) {
|
|
183
|
-
dispatch({ type: BRUSH_END,
|
|
183
|
+
dispatch({ type: 'BRUSH_END', payload: brushData });
|
|
184
184
|
}
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
@@ -199,10 +199,13 @@ function Viewer1D({ emptyText = undefined }) {
|
|
|
199
199
|
alert,
|
|
200
200
|
]);
|
|
201
201
|
const handelOnDoubleClick = useCallback(() => {
|
|
202
|
-
dispatch({
|
|
202
|
+
dispatch({
|
|
203
|
+
type: 'FULL_ZOOM_OUT',
|
|
204
|
+
payload: { zoomType: ZOOM_TYPES.STEP_HORIZONTAL },
|
|
205
|
+
});
|
|
203
206
|
}, [dispatch]);
|
|
204
207
|
const handleZoom = useCallback((event) => {
|
|
205
|
-
dispatch({ type: SET_ZOOM, event, selectedTool });
|
|
208
|
+
dispatch({ type: 'SET_ZOOM', payload: { event, selectedTool } });
|
|
206
209
|
}, [dispatch, selectedTool]);
|
|
207
210
|
const mouseClick = useCallback((position) => {
|
|
208
211
|
const propagateEvent = () => {
|
|
@@ -218,8 +221,8 @@ function Viewer1D({ emptyText = undefined }) {
|
|
|
218
221
|
switch (selectedTool) {
|
|
219
222
|
case options.peakPicking.id:
|
|
220
223
|
dispatch({
|
|
221
|
-
type: ADD_PEAK,
|
|
222
|
-
|
|
224
|
+
type: 'ADD_PEAK',
|
|
225
|
+
payload: position,
|
|
223
226
|
});
|
|
224
227
|
break;
|
|
225
228
|
case options.editRange.id:
|
|
@@ -233,8 +236,10 @@ function Viewer1D({ emptyText = undefined }) {
|
|
|
233
236
|
switch (selectedTool) {
|
|
234
237
|
case options.phaseCorrection.id:
|
|
235
238
|
dispatch({
|
|
236
|
-
type: SET_VERTICAL_INDICATOR_X_POSITION,
|
|
237
|
-
|
|
239
|
+
type: 'SET_VERTICAL_INDICATOR_X_POSITION',
|
|
240
|
+
payload: {
|
|
241
|
+
position: position.x,
|
|
242
|
+
},
|
|
238
243
|
});
|
|
239
244
|
break;
|
|
240
245
|
default:
|
|
@@ -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,10 +1,6 @@
|
|
|
1
|
+
import { Integral } from 'nmr-load-save';
|
|
1
2
|
interface IntegralResizableProps {
|
|
2
|
-
integralData:
|
|
3
|
-
id: string;
|
|
4
|
-
from: number;
|
|
5
|
-
to: number;
|
|
6
|
-
integral?: number;
|
|
7
|
-
};
|
|
3
|
+
integralData: Integral;
|
|
8
4
|
integralFormat: string;
|
|
9
5
|
}
|
|
10
6
|
declare function IntegralResizable({ integralData, integralFormat, }: IntegralResizableProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -7,7 +7,6 @@ import { useGlobal } from '../../context/GlobalContext';
|
|
|
7
7
|
import { useScaleChecked } from '../../context/ScaleContext';
|
|
8
8
|
import Resizer from '../../elements/resizer/Resizer';
|
|
9
9
|
import { HighlightEventSource, useHighlight } from '../../highlight/index';
|
|
10
|
-
import { RESIZE_INTEGRAL } from '../../reducer/types/Types';
|
|
11
10
|
import { options } from '../../toolbar/ToolTypes';
|
|
12
11
|
import { IntegralIndicator } from './IntegralIndicator';
|
|
13
12
|
const stylesOnHover = css `
|
|
@@ -50,9 +49,9 @@ function IntegralResizable({ integralData, integralFormat, }) {
|
|
|
50
49
|
});
|
|
51
50
|
function handleOnStopResizing(position) {
|
|
52
51
|
dispatch({
|
|
53
|
-
type: RESIZE_INTEGRAL,
|
|
52
|
+
type: 'RESIZE_INTEGRAL',
|
|
54
53
|
payload: {
|
|
55
|
-
|
|
54
|
+
integral: {
|
|
56
55
|
...integralData,
|
|
57
56
|
from: scaleX().invert(position.x2),
|
|
58
57
|
to: scaleX().invert(position.x1),
|
|
@@ -16,5 +16,5 @@ export default function MultiAnalysisRanges() {
|
|
|
16
16
|
const { view: { spectra: { activeTab }, }, displayerKey, } = useChartData();
|
|
17
17
|
const multipleSpectraAnalysis = usePanelPreferences('multipleSpectraAnalysis', activeTab);
|
|
18
18
|
const columns = multipleSpectraAnalysis.analysisOptions.columns;
|
|
19
|
-
return (_jsx(MemoizedMultiAnalysisRanges, {
|
|
19
|
+
return (_jsx(MemoizedMultiAnalysisRanges, { columns, displayerKey, activeTab }));
|
|
20
20
|
}
|
|
@@ -53,15 +53,13 @@ function InnerMultiplicityTree({ labelOptions, onUnlink, data, width: widthProp,
|
|
|
53
53
|
onUnlink(index);
|
|
54
54
|
}
|
|
55
55
|
const isHighlighted = highlight.isActive || assignment.isActive;
|
|
56
|
-
return (_jsxs("g", { style: isHighlighted ? { ...styles, opacity: 1, strokeWidth: 1.5 } : styles,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
highlight.hide();
|
|
64
|
-
},
|
|
56
|
+
return (_jsxs("g", { style: isHighlighted ? { ...styles, opacity: 1, strokeWidth: 1.5 } : styles, onMouseEnter: () => {
|
|
57
|
+
assignment.show('x');
|
|
58
|
+
highlight.show();
|
|
59
|
+
},
|
|
60
|
+
onMouseLeave: () => {
|
|
61
|
+
assignment.hide();
|
|
62
|
+
highlight.hide();
|
|
65
63
|
}, pointerEvents: "bounding-box", ...(!assignment.isActive && { css: cssStyle }), children: [drawTree(data, { scaleX, labelOptions, showLabels }), _jsx("rect", { x: startX - BOX_PADDING, y: startY - BOX_PADDING, width: width + BOX_PADDING * 2, height: height + BOX_PADDING * 2, fill: isHighlighted ? '#ff6f0057' : 'transparent', "data-no-export": "true" }), _jsx(AssignmentActionsButtons, { className: "signal-target", isActive: !!(assignment.isActive || signal?.diaIDs), y: startY, x: scaleX()(signal.delta) - 30, onAssign: assignHandler, onUnAssign: unAssignHandler, borderRadius: 16 })] }));
|
|
66
64
|
}
|
|
67
65
|
export function MultiplicityTree(props) {
|
|
@@ -5,7 +5,6 @@ import { useRef, useState, useCallback, useLayoutEffect, useEffect, useMemo, } f
|
|
|
5
5
|
import { useDispatch } from '../../context/DispatchContext';
|
|
6
6
|
import { HighlightEventSource, useHighlight } from '../../highlight';
|
|
7
7
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
8
|
-
import { SHIFT_SPECTRUM } from '../../reducer/types/Types';
|
|
9
8
|
import { formatNumber } from '../../utility/formatNumber';
|
|
10
9
|
const styles = css `
|
|
11
10
|
input {
|
|
@@ -53,7 +52,7 @@ value, color, nucleus, }) {
|
|
|
53
52
|
extra: { id },
|
|
54
53
|
});
|
|
55
54
|
const dispatch = useDispatch();
|
|
56
|
-
const handleOnPeakChange = useCallback((e) => dispatch({ type: SHIFT_SPECTRUM,
|
|
55
|
+
const handleOnPeakChange = useCallback((e) => dispatch({ type: 'SHIFT_SPECTRUM', payload: { shift: e.shiftValue } }), [dispatch]);
|
|
57
56
|
useLayoutEffect(() => {
|
|
58
57
|
const textBox = refText.current?.getBBox();
|
|
59
58
|
setContainerSize({
|
|
@@ -10,7 +10,6 @@ import { useGlobal } from '../../context/GlobalContext';
|
|
|
10
10
|
import { useScaleChecked } from '../../context/ScaleContext';
|
|
11
11
|
import Resizer from '../../elements/resizer/Resizer';
|
|
12
12
|
import { HighlightEventSource, useHighlight } from '../../highlight';
|
|
13
|
-
import { RESIZE_RANGE, UNLINK_RANGE } from '../../reducer/types/Types';
|
|
14
13
|
import { options } from '../../toolbar/ToolTypes';
|
|
15
14
|
import { IntegralIndicator } from '../integral/IntegralIndicator';
|
|
16
15
|
import { MultiplicityTree } from '../multiplicityTree/MultiplicityTree';
|
|
@@ -37,11 +36,13 @@ function Range({ range, showMultiplicityTrees, selectedTool, relativeFormat, })
|
|
|
37
36
|
const isBlockedByEditing = selectedTool && selectedTool === options.editRange.id;
|
|
38
37
|
function handleOnStopResizing(position) {
|
|
39
38
|
dispatch({
|
|
40
|
-
type: RESIZE_RANGE,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
type: 'RESIZE_RANGE',
|
|
40
|
+
payload: {
|
|
41
|
+
range: {
|
|
42
|
+
...range,
|
|
43
|
+
from: scaleX().invert(position.x2),
|
|
44
|
+
to: scaleX().invert(position.x1),
|
|
45
|
+
},
|
|
45
46
|
},
|
|
46
47
|
});
|
|
47
48
|
}
|
|
@@ -55,9 +56,9 @@ function Range({ range, showMultiplicityTrees, selectedTool, relativeFormat, })
|
|
|
55
56
|
}
|
|
56
57
|
function unAssignHandler(signalIndex = -1) {
|
|
57
58
|
dispatch({
|
|
58
|
-
type: UNLINK_RANGE,
|
|
59
|
+
type: 'UNLINK_RANGE',
|
|
59
60
|
payload: {
|
|
60
|
-
|
|
61
|
+
range,
|
|
61
62
|
assignmentData,
|
|
62
63
|
signalIndex,
|
|
63
64
|
},
|
|
@@ -23,11 +23,9 @@ export default function Ranges() {
|
|
|
23
23
|
if (!spectrum?.display?.isVisible) {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
-
return (_jsx(MemoizedRanges, { ranges: spectrum.ranges,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
relativeFormat: rangesPreferences.relative.format,
|
|
32
|
-
} }));
|
|
26
|
+
return (_jsx(MemoizedRanges, { ranges: spectrum.ranges, showMultiplicityTrees,
|
|
27
|
+
showRangesIntegrals,
|
|
28
|
+
selectedTool,
|
|
29
|
+
displayerKey,
|
|
30
|
+
relativeFormat: rangesPreferences.relative.format }));
|
|
33
31
|
}
|
|
@@ -5,7 +5,6 @@ import { useChartData } from '../../context/ChartContext';
|
|
|
5
5
|
import { useDispatch } from '../../context/DispatchContext';
|
|
6
6
|
import { useScaleChecked } from '../../context/ScaleContext';
|
|
7
7
|
import DeleteButton from '../../elements/DeleteButton';
|
|
8
|
-
import { DELETE_BASE_LINE_ZONE } from '../../reducer/types/Types';
|
|
9
8
|
const styles = css `
|
|
10
9
|
pointer-events: bounding-box;
|
|
11
10
|
user-select: 'none';
|
|
@@ -31,7 +30,7 @@ function BaseLineZones() {
|
|
|
31
30
|
const { scaleX } = useScaleChecked();
|
|
32
31
|
const dispatch = useDispatch();
|
|
33
32
|
const deleteRangeHandler = (id) => {
|
|
34
|
-
dispatch({ type: DELETE_BASE_LINE_ZONE, id });
|
|
33
|
+
dispatch({ type: 'DELETE_BASE_LINE_ZONE', payload: { id } });
|
|
35
34
|
};
|
|
36
35
|
const baseLineZones = toolOptions.data.baselineCorrection.zones;
|
|
37
36
|
return (_jsx(_Fragment, { children: baseLineZones.length > 0 && (_jsx("g", { children: baseLineZones.map((zone) => (_jsxs("g", { transform: `translate(${scaleX()(zone.to)},0)`, css: styles, children: [_jsx(DeleteButton, { x: -20, y: 10, onDelete: () => deleteRangeHandler(zone.id) }), _jsx("rect", { x: "0", width: `${scaleX()(zone.from) - scaleX()(zone.to)}`, className: "zone-area" })] }, zone.id))) })) }));
|
|
@@ -9,7 +9,6 @@ import { useDispatch } from '../../../context/DispatchContext';
|
|
|
9
9
|
import { useGlobal } from '../../../context/GlobalContext';
|
|
10
10
|
import { useMoleculeEditor } from '../../../modal/MoleculeStructureEditorModal';
|
|
11
11
|
import useAtomAssignment from '../../../panels/MoleculesPanel/useAtomAssignment';
|
|
12
|
-
import { CHANGE_FLOAT_MOLECULE_POSITION, FLOAT_MOLECULE_OVER_SPECTRUM, SET_MOLECULE, } from '../../../reducer/types/Types';
|
|
13
12
|
import ActionsButton from './ActionsButton';
|
|
14
13
|
const style = css `
|
|
15
14
|
border: 1px solid transparent;
|
|
@@ -40,7 +39,7 @@ export function DraggableStructure(props) {
|
|
|
40
39
|
const { currentDiaIDsToHighlight, handleOnAtomHover, handleOnClickAtom, assignedDiaIDsMerged, } = useAtomAssignment({ zones, ranges, activeTab, displayerMode });
|
|
41
40
|
function floatMoleculeHandler() {
|
|
42
41
|
dispatch({
|
|
43
|
-
type: FLOAT_MOLECULE_OVER_SPECTRUM,
|
|
42
|
+
type: 'FLOAT_MOLECULE_OVER_SPECTRUM',
|
|
44
43
|
payload: { id: molecule.id },
|
|
45
44
|
});
|
|
46
45
|
}
|
|
@@ -52,8 +51,8 @@ export function DraggableStructure(props) {
|
|
|
52
51
|
bounding.height += height;
|
|
53
52
|
}
|
|
54
53
|
dispatch({
|
|
55
|
-
type: CHANGE_FLOAT_MOLECULE_POSITION,
|
|
56
|
-
payload: { id: molecule.id, bounding },
|
|
54
|
+
type: 'CHANGE_FLOAT_MOLECULE_POSITION',
|
|
55
|
+
payload: { id: molecule.id, bounding: bounding },
|
|
57
56
|
});
|
|
58
57
|
}
|
|
59
58
|
if (!viewerRef)
|
|
@@ -65,7 +64,7 @@ export function DraggableStructure(props) {
|
|
|
65
64
|
? currentDiaIDsToHighlight
|
|
66
65
|
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover, setMolfile: (molfile) => {
|
|
67
66
|
dispatch({
|
|
68
|
-
type: SET_MOLECULE,
|
|
67
|
+
type: 'SET_MOLECULE',
|
|
69
68
|
payload: {
|
|
70
69
|
molfile,
|
|
71
70
|
id: molecule.id,
|
|
@@ -14,15 +14,13 @@ export function FloatMoleculeStructuresInner(props) {
|
|
|
14
14
|
.map(([id, moleculeView], index) => {
|
|
15
15
|
const molecule = molecules.find((m) => m.id === id);
|
|
16
16
|
assert(molecule !== undefined, 'molecule should be defined');
|
|
17
|
-
return (_jsx(DraggableStructure, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
index,
|
|
25
|
-
} }, id));
|
|
17
|
+
return (_jsx(DraggableStructure, { zones,
|
|
18
|
+
ranges,
|
|
19
|
+
activeTab,
|
|
20
|
+
displayerMode,
|
|
21
|
+
moleculeView,
|
|
22
|
+
molecule,
|
|
23
|
+
index }, id));
|
|
26
24
|
}) }));
|
|
27
25
|
}
|
|
28
26
|
const MemoizedFloatMoleculeStructures = memo(FloatMoleculeStructuresInner);
|
|
@@ -32,12 +30,10 @@ export default function FloatMoleculeStructures() {
|
|
|
32
30
|
const data = useSpectrum(emptyData);
|
|
33
31
|
const ranges = data?.ranges || {};
|
|
34
32
|
const zones = data?.zones || {};
|
|
35
|
-
return (_jsx(MemoizedFloatMoleculeStructures, {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
zones,
|
|
42
|
-
} }));
|
|
33
|
+
return (_jsx(MemoizedFloatMoleculeStructures, { moleculesView,
|
|
34
|
+
molecules,
|
|
35
|
+
displayerMode,
|
|
36
|
+
activeTab,
|
|
37
|
+
ranges,
|
|
38
|
+
zones }));
|
|
43
39
|
}
|
|
@@ -19,7 +19,7 @@ function Left1DChart({ margin: marginValue = 10, data: spectrum, }) {
|
|
|
19
19
|
const { x, re: y } = spectrum.data;
|
|
20
20
|
const pathPoints = xyReduce({ x, y });
|
|
21
21
|
const pathBuilder = new PathBuilder();
|
|
22
|
-
pathBuilder.moveTo(scaleY(pathPoints.y
|
|
22
|
+
pathBuilder.moveTo(scaleY(pathPoints.y.at(-1)), scaleX(pathPoints.x.at(-1)));
|
|
23
23
|
for (let i = pathPoints.x.length - 2; i >= 0; i--) {
|
|
24
24
|
pathBuilder.lineTo(scaleY(pathPoints.y[i]), scaleX(pathPoints.x[i]));
|
|
25
25
|
}
|
|
@@ -16,7 +16,7 @@ function VerticalSliceChart({ margin: marginValue = 10, data, reverseScale = fal
|
|
|
16
16
|
const scaleY = getYScale(height, y, marginValue);
|
|
17
17
|
const pathPoints = xyReduce({ x, y });
|
|
18
18
|
const pathBuilder = new PathBuilder();
|
|
19
|
-
pathBuilder.moveTo(scaleY(pathPoints.y
|
|
19
|
+
pathBuilder.moveTo(scaleY(pathPoints.y.at(-1)), scaleX(pathPoints.x.at(-1)));
|
|
20
20
|
for (let i = pathPoints.x.length - 2; i >= 0; i--) {
|
|
21
21
|
pathBuilder.lineTo(scaleY(pathPoints.y[i]), scaleX(pathPoints.x[i]));
|
|
22
22
|
}
|
|
@@ -16,5 +16,5 @@ const MemoizedChart2D = memo(chart2DInner);
|
|
|
16
16
|
export default function Chart2D({ spectra }) {
|
|
17
17
|
const { width, height, margin, displayerKey } = useChartData();
|
|
18
18
|
const { current: { general: { spectraRendering }, }, } = usePreferences();
|
|
19
|
-
return (_jsx(MemoizedChart2D, {
|
|
19
|
+
return (_jsx(MemoizedChart2D, { spectra, width, height, margin, displayerKey, spectraRendering }));
|
|
20
20
|
}
|
|
@@ -8,7 +8,6 @@ import { MouseTracker } from '../EventsTrackers/MouseTracker';
|
|
|
8
8
|
import { useChartData } from '../context/ChartContext';
|
|
9
9
|
import { useDispatch } from '../context/DispatchContext';
|
|
10
10
|
import Spinner from '../loader/Spinner';
|
|
11
|
-
import { BRUSH_END, FULL_ZOOM_OUT, SET_DIMENSIONS, SET_2D_LEVEL, SET_ZOOM, ADD_2D_ZONE, } from '../reducer/types/Types';
|
|
12
11
|
import { options } from '../toolbar/ToolTypes';
|
|
13
12
|
import { assert } from '../utility/assert';
|
|
14
13
|
import Chart2D from './Chart2D';
|
|
@@ -46,7 +45,7 @@ function Viewer2D({ emptyText = undefined }) {
|
|
|
46
45
|
else if (brushData.shiftKey) {
|
|
47
46
|
switch (selectedTool) {
|
|
48
47
|
case options.zonePicking.id:
|
|
49
|
-
dispatch({ type: ADD_2D_ZONE,
|
|
48
|
+
dispatch({ type: 'ADD_2D_ZONE', payload: brushData });
|
|
50
49
|
break;
|
|
51
50
|
default:
|
|
52
51
|
break;
|
|
@@ -57,9 +56,11 @@ function Viewer2D({ emptyText = undefined }) {
|
|
|
57
56
|
default:
|
|
58
57
|
if (selectedTool != null) {
|
|
59
58
|
return dispatch({
|
|
60
|
-
type: BRUSH_END,
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
type: 'BRUSH_END',
|
|
60
|
+
payload: {
|
|
61
|
+
...brushData,
|
|
62
|
+
trackID: getLayoutID(DIMENSION, brushData),
|
|
63
|
+
},
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
}
|
|
@@ -70,7 +71,7 @@ function Viewer2D({ emptyText = undefined }) {
|
|
|
70
71
|
const { x: startX, y: startY } = e;
|
|
71
72
|
const trackID = getLayoutID(DIMENSION, { startX, startY });
|
|
72
73
|
if (trackID) {
|
|
73
|
-
dispatch({ type: FULL_ZOOM_OUT, trackID });
|
|
74
|
+
dispatch({ type: 'FULL_ZOOM_OUT', payload: { trackID } });
|
|
74
75
|
}
|
|
75
76
|
}, [DIMENSION, dispatch]);
|
|
76
77
|
const handleZoom = (event) => {
|
|
@@ -78,10 +79,10 @@ function Viewer2D({ emptyText = undefined }) {
|
|
|
78
79
|
const trackID = getLayoutID(DIMENSION, { startX, startY });
|
|
79
80
|
if (trackID) {
|
|
80
81
|
if (trackID === 'CENTER_2D') {
|
|
81
|
-
dispatch({ type: SET_2D_LEVEL,
|
|
82
|
+
dispatch({ type: 'SET_2D_LEVEL', payload: event });
|
|
82
83
|
}
|
|
83
84
|
else {
|
|
84
|
-
dispatch({ type: SET_ZOOM, event, trackID });
|
|
85
|
+
dispatch({ type: 'SET_ZOOM', payload: { event, trackID } });
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
};
|
|
@@ -105,7 +106,7 @@ export function ViewerResponsiveWrapper(props) {
|
|
|
105
106
|
const dispatch = useDispatch();
|
|
106
107
|
const { width, height, children } = props;
|
|
107
108
|
useEffect(() => {
|
|
108
|
-
dispatch({ type: SET_DIMENSIONS, width, height });
|
|
109
|
+
dispatch({ type: 'SET_DIMENSIONS', payload: { width, height } });
|
|
109
110
|
}, [width, height, dispatch]);
|
|
110
111
|
return children;
|
|
111
112
|
}
|
|
@@ -67,12 +67,10 @@ export function FidCanvas() {
|
|
|
67
67
|
return null;
|
|
68
68
|
const w = Math.max(canvasWidth, imageData.width);
|
|
69
69
|
const h = Math.max(canvasHeight, imageData.height);
|
|
70
|
-
return (_jsx("foreignObject", {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
y: `${top}`,
|
|
75
|
-
}, children: _jsx("canvas", { ref: canvasRef, ...{ width: w, height: h }, style: {
|
|
70
|
+
return (_jsx("foreignObject", { width: canvasWidth,
|
|
71
|
+
height: canvasHeight,
|
|
72
|
+
x: `${left}`,
|
|
73
|
+
y: `${top}`, children: _jsx("canvas", { ref: canvasRef, width: w, height: h, style: {
|
|
76
74
|
backgroundColor: 'white',
|
|
77
75
|
} }) }));
|
|
78
76
|
}
|
|
@@ -71,5 +71,5 @@ export default function Contours() {
|
|
|
71
71
|
const spectra2d = useMemo(() => {
|
|
72
72
|
return getSpectraByNucleus(activeTab, spectra).filter((datum) => datum.info.isFt);
|
|
73
73
|
}, [activeTab, spectra]);
|
|
74
|
-
return _jsx(MemoizedContours, {
|
|
74
|
+
return _jsx(MemoizedContours, { spectra: spectra2d, displayerKey });
|
|
75
75
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
declare const LAYOUT: {
|
|
2
|
-
TOP_1D:
|
|
3
|
-
LEFT_1D:
|
|
4
|
-
CENTER_2D:
|
|
2
|
+
readonly TOP_1D: "TOP_1D";
|
|
3
|
+
readonly LEFT_1D: "LEFT_1D";
|
|
4
|
+
readonly CENTER_2D: "CENTER_2D";
|
|
5
5
|
};
|
|
6
|
+
type Layout = keyof typeof LAYOUT;
|
|
6
7
|
interface MarginProps {
|
|
7
8
|
top: number;
|
|
8
9
|
left: number;
|
|
@@ -39,25 +40,9 @@ interface StartEndProps {
|
|
|
39
40
|
startY: number;
|
|
40
41
|
endY?: number;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
endX: number;
|
|
47
|
-
endY: number;
|
|
48
|
-
};
|
|
49
|
-
TOP_1D: {
|
|
50
|
-
startX: number;
|
|
51
|
-
startY: number;
|
|
52
|
-
endX: number;
|
|
53
|
-
endY: number;
|
|
54
|
-
};
|
|
55
|
-
LEFT_1D: {
|
|
56
|
-
startX: number;
|
|
57
|
-
startY: number;
|
|
58
|
-
endX: number;
|
|
59
|
-
endY: number;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
declare function getLayoutID(dimension: DimensionType, brushData: StartEndProps): string | null;
|
|
43
|
+
type DimensionType = {
|
|
44
|
+
[key in Layout]: Required<StartEndProps>;
|
|
45
|
+
};
|
|
46
|
+
declare function getLayoutID(dimension: DimensionType, brushData: StartEndProps): Layout | null;
|
|
63
47
|
export { LAYOUT, get2DDimensionLayout, getLayoutID };
|
|
48
|
+
export type { Layout };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Layout } from './DimensionLayout';
|
|
1
2
|
declare function get2DXScale(props: {
|
|
2
3
|
width: number;
|
|
3
4
|
margin: {
|
|
@@ -30,6 +31,6 @@ interface LeftLayout {
|
|
|
30
31
|
};
|
|
31
32
|
yDomain: Array<number>;
|
|
32
33
|
}
|
|
33
|
-
declare function get1DXScale(props: TopLayout | LeftLayout, layout:
|
|
34
|
+
declare function get1DXScale(props: TopLayout | LeftLayout, layout: Layout): import("d3-scale").ScaleLinear<number, number, never> | undefined;
|
|
34
35
|
declare function get1DYScale(yDomain: Array<number>, height: number, margin?: number): import("d3-scale").ScaleLinear<number, number, never>;
|
|
35
36
|
export { get2DXScale, get2DYScale, get1DXScale, get1DYScale };
|
|
@@ -14,7 +14,7 @@ function get2DYScale(props, reverse = false) {
|
|
|
14
14
|
: [margin.top, height - margin.bottom]);
|
|
15
15
|
}
|
|
16
16
|
function get1DXScale(props, layout) {
|
|
17
|
-
if (![
|
|
17
|
+
if (!['TOP_1D', 'LEFT_1D'].includes(layout)) {
|
|
18
18
|
throw new Error(`layout is required and must be ${LAYOUT.TOP_1D} or ${LAYOUT.LEFT_1D} `);
|
|
19
19
|
}
|
|
20
20
|
switch (layout) {
|