nmrium 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/lib/component/1d/ApodizationLine.d.ts +3 -0
- package/lib/component/1d/ApodizationLine.js +49 -0
- package/lib/component/1d/Chart1D.js +4 -2
- package/lib/component/1d/ExclusionZoneAnnotation.d.ts +1 -1
- package/lib/component/1d/ExclusionZoneAnnotation.js +14 -7
- package/lib/component/1d/FooterBanner.js +3 -1
- package/lib/component/1d/IntegralResizable.js +5 -4
- package/lib/component/1d/IntegralsSeries.js +3 -1
- package/lib/component/1d/LinesSeries.js +7 -5
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +10 -13
- package/lib/component/1d/database/DatabaseElements.js +2 -2
- package/lib/component/1d/database/DatabaseSpectrum.js +3 -3
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +3 -3
- package/lib/component/1d/jCouplingGraph/JGraph.js +5 -1
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +16 -14
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +6 -5
- package/lib/component/1d/{PeakAnnotation.d.ts → peaks/PeakAnnotation.d.ts} +1 -2
- package/lib/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib/component/1d/{PeakAnnotations.d.ts → peaks/PeakAnnotations.d.ts} +0 -0
- package/lib/component/1d/peaks/PeakAnnotations.js +28 -0
- package/lib/component/1d/peaks/PeaksShapes.d.ts +3 -0
- package/lib/component/1d/peaks/PeaksShapes.js +37 -0
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +13 -0
- package/lib/component/1d/peaks/usePeakShapesPath.js +49 -0
- package/lib/component/1d/ranges/Range.js +4 -4
- package/lib/component/1d/ranges/Ranges.js +8 -2
- package/lib/component/1d/tool/PeakPointer.js +3 -1
- package/lib/component/1d/tool/XLabelPointer.js +3 -1
- package/lib/component/2d/Contours.js +3 -1
- package/lib/component/2d/FooterBanner.js +5 -3
- package/lib/component/2d/Viewer2D.js +6 -6
- package/lib/component/2d/XAxis.js +2 -2
- package/lib/component/2d/YAxis.js +2 -2
- package/lib/component/2d/tools/XYLabelPointer.js +3 -1
- package/lib/component/2d/tools/slicing/SlicingView.js +3 -1
- package/lib/component/2d/zones/IndicationLines.js +1 -1
- package/lib/component/2d/zones/Signal.d.ts +3 -2
- package/lib/component/2d/zones/Signal.js +3 -3
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/2d/zones/Zone.js +4 -4
- package/lib/component/2d/zones/Zones.js +14 -19
- package/lib/component/EventsTrackers/KeysListenerTracker.js +91 -52
- package/lib/component/NMRium.d.ts +2 -0
- package/lib/component/NMRium.js +14 -3
- package/lib/component/assignment/AssignmentsContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.d.ts +1 -1
- package/lib/component/context/GlobalContext.js +3 -3
- package/lib/component/elements/ActiveButton.d.ts +17 -0
- package/lib/component/elements/ActiveButton.js +28 -0
- package/lib/component/elements/Button.d.ts +6 -6
- package/lib/component/elements/Button.js +5 -5
- package/lib/component/elements/ButtonToolTip.js +1 -1
- package/lib/component/elements/CheckBox.d.ts +2 -6
- package/lib/component/elements/CheckBox.js +4 -6
- package/lib/component/elements/Input.d.ts +5 -4
- package/lib/component/elements/Input.js +1 -1
- package/lib/component/elements/Label.d.ts +8 -6
- package/lib/component/elements/Label.js +3 -3
- package/lib/component/elements/MoleculeSelection.d.ts +2 -2
- package/lib/component/elements/MoleculeSelection.js +1 -1
- package/lib/component/elements/NextPrev.js +1 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
- package/lib/component/elements/Select.d.ts +7 -11
- package/lib/component/elements/Select.js +6 -8
- package/lib/component/elements/Tab/Tab.js +1 -1
- package/lib/component/elements/Table/Table.d.ts +1 -2
- package/lib/component/elements/Table/Table.js +2 -2
- package/lib/component/elements/ToggleButton.d.ts +1 -2
- package/lib/component/elements/ToggleButton.js +3 -2
- package/lib/component/elements/accordion/AccordionItem.js +2 -2
- package/lib/component/elements/formik/FormikNumberInput.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.d.ts +3 -2
- package/lib/component/elements/formik/FormikOnChange.js +11 -5
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib/component/elements/popup/Modal/Provider.d.ts +3 -3
- package/lib/component/elements/popup/Modal/Provider.js +8 -11
- package/lib/component/elements/resizer/DivResizer.js +3 -3
- package/lib/component/elements/resizer/Resizer.d.ts +1 -0
- package/lib/component/elements/resizer/SVGResizer.js +3 -3
- package/lib/component/header/ApodizationOptionsPanel.d.ts +2 -0
- package/lib/component/header/ApodizationOptionsPanel.js +81 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.d.ts +2 -1
- package/lib/component/header/AutoPeakPickingOptionPanel.js +40 -36
- package/lib/component/header/BaseLineCorrectionPanel.d.ts +1 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +84 -52
- package/lib/component/header/Header.js +5 -2
- package/lib/component/header/HeaderContainer.d.ts +7 -0
- package/lib/component/header/HeaderContainer.js +10 -0
- package/lib/component/header/ManualPhaseCorrectionPanel.js +27 -29
- package/lib/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib/component/header/ZeroFillingOptionsPanel.js +52 -47
- package/lib/component/header/Zones2DOptionPanel.js +11 -13
- package/lib/component/highlight/index.d.ts +27 -10
- package/lib/component/highlight/index.js +19 -17
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +10 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib/component/hooks/useDatumWithSpectraStatistics.js +3 -1
- package/lib/component/hooks/useExport.d.ts +0 -1
- package/lib/component/hooks/useExport.js +1 -17
- package/lib/component/hooks/useFilter.d.ts +1 -0
- package/lib/component/hooks/useFilter.js +7 -0
- package/lib/component/hooks/useIntegralPath.js +5 -2
- package/lib/component/hooks/useNucleus.js +4 -4
- package/lib/component/hooks/useSpectraPerNucleus.js +1 -1
- package/lib/component/hooks/useSpectrum.js +3 -1
- package/lib/component/hooks/useToolsFunctions.js +1 -1
- package/lib/component/loader/DropZone.js +8 -148
- package/lib/component/modal/AlignSpectraModal.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +9 -0
- package/lib/component/modal/EditPeakShapeModal.js +85 -0
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js +2 -3
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib/component/modal/PredictSpectraModal.js +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib/component/modal/changeSum/SelectMolecule.js +2 -2
- package/lib/component/modal/editRange/EditRangeModal.js +3 -3
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +4 -9
- package/lib/component/modal/setting/DatabasesTabContent.js +2 -2
- package/lib/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib/component/modal/setting/GeneralSettings.js +1 -1
- package/lib/component/modal/setting/ToolsTabContent.js +17 -13
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -2
- package/lib/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +5 -4
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +13 -10
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +4 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +5 -3
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +12 -4
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/Panels.js +3 -3
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +47 -22
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib/component/panels/PeaksPanel/PeaksTable.js +44 -13
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts +2 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +10 -9
- package/lib/component/panels/RangesPanel/RangesPanel.js +7 -3
- package/lib/component/panels/RangesPanel/RangesTableRow.js +4 -4
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +3 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +3 -3
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -1
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib/component/panels/SummaryPanel/utilities/useInView.js +3 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +19 -10
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -13
- package/lib/component/panels/databasePanel/DatabaseTable.js +3 -3
- package/lib/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.js +3 -12
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +2 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib/component/reducer/IgnoreActions.js +5 -0
- package/lib/component/reducer/Reducer.d.ts +141 -51
- package/lib/component/reducer/Reducer.js +69 -45
- package/lib/component/reducer/actions/DomainActions.d.ts +1 -1
- package/lib/component/reducer/actions/DomainActions.js +11 -9
- package/lib/component/reducer/actions/FiltersActions.d.ts +13 -7
- package/lib/component/reducer/actions/FiltersActions.js +326 -204
- package/lib/component/reducer/actions/IntegralsActions.js +15 -10
- package/lib/component/reducer/actions/LoadActions.d.ts +2 -5
- package/lib/component/reducer/actions/LoadActions.js +19 -34
- package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -1
- package/lib/component/reducer/actions/MoleculeActions.js +48 -19
- package/lib/component/reducer/actions/PeaksActions.d.ts +4 -1
- package/lib/component/reducer/actions/PeaksActions.js +52 -13
- package/lib/component/reducer/actions/PreferencesActions.js +8 -10
- package/lib/component/reducer/actions/RangesActions.d.ts +3 -3
- package/lib/component/reducer/actions/RangesActions.js +87 -29
- package/lib/component/reducer/actions/SpectraAnalysisAction.js +5 -5
- package/lib/component/reducer/actions/SpectrumsActions.js +14 -11
- package/lib/component/reducer/actions/ToolsActions.js +47 -95
- package/lib/component/reducer/actions/ZonesActions.d.ts +4 -1
- package/lib/component/reducer/actions/ZonesActions.js +68 -17
- package/lib/component/reducer/helper/Zoom1DManager.js +2 -1
- package/lib/component/reducer/helper/getActiveSpectrumOrFail.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrumOrFail.js +6 -0
- package/lib/component/reducer/helper/getSpectrum.js +3 -2
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +7 -0
- package/lib/component/reducer/helper/getStrongestPeak.js +15 -0
- package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +23 -15
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib/component/reducer/types/Types.d.ts +12 -0
- package/lib/component/reducer/types/Types.js +12 -0
- package/lib/component/tool/BrushX.js +1 -1
- package/lib/component/tool/BrushXY.js +4 -3
- package/lib/component/tool/CrossLinePointer.js +5 -4
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +8 -2
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +22 -7
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +3 -2
- package/lib/component/tool/FloatMoleculeStructures/index.js +19 -6
- package/lib/component/toolbar/BasicToolBar.js +7 -14
- package/lib/component/toolbar/FunctionToolBar.js +13 -23
- package/lib/component/toolbar/ToolTypes.d.ts +7 -1
- package/lib/component/toolbar/ToolTypes.js +119 -9
- package/lib/component/utility/assert.d.ts +1 -0
- package/lib/component/utility/assert.js +5 -0
- package/lib/component/workspaces/Workspace.d.ts +4 -1
- package/lib/component/workspaces/basic.js +12 -11
- package/lib/component/workspaces/embedded.js +14 -13
- package/lib/component/workspaces/exercise.js +10 -6
- package/lib/component/workspaces/prediction.js +14 -13
- package/lib/component/workspaces/process1D.js +20 -19
- package/lib/component/workspaces/workspaceDefaultProperties.js +14 -15
- package/lib/constants.js +1 -1
- package/lib/data/Filters.d.ts +2 -2
- package/lib/data/Filters.js +2 -2
- package/lib/data/FiltersManager.js +3 -3
- package/lib/data/PredictionManager.d.ts +0 -1
- package/lib/data/PredictionManager.js +15 -15
- package/lib/data/SpectraManager.d.ts +2 -5
- package/lib/data/SpectraManager.js +4 -95
- package/lib/data/constants/SignalsKinds.d.ts +0 -1
- package/lib/data/constants/SignalsKinds.js +0 -8
- package/lib/data/data1d/Data1DManager.js +5 -5
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +5 -5
- package/lib/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +2 -2
- package/lib/data/data1d/Spectrum1D/index.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/index.js +2 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -2
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -16
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +8 -0
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +24 -0
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +2 -0
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -3
- package/lib/data/data1d/database.js +4 -6
- package/lib/data/data1d/filter1d/apodization.d.ts +25 -0
- package/lib/data/data1d/filter1d/apodization.js +63 -0
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +24 -7
- package/lib/data/data1d/filter1d/baselineCorrection.js +10 -17
- package/lib/data/data1d/filter1d/fft.js +11 -0
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +2 -0
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +35 -0
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.d.ts +9 -0
- package/lib/data/data1d/filter1d/zeroFillingAndApodization.js +24 -0
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +3 -2
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -3
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.d.ts +1 -1
- package/lib/data/molecules/Molecule.d.ts +20 -6
- package/lib/data/molecules/Molecule.js +5 -8
- package/lib/data/molecules/MoleculeManager.d.ts +4 -4
- package/lib/data/molecules/MoleculeManager.js +5 -5
- package/lib/data/types/data1d/SumOptions.d.ts +1 -1
- package/lib/data/utilities/generateNumbersPowerOfX.d.ts +0 -1
- package/lib/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib/data/utilities/isInRange.d.ts +7 -0
- package/lib/data/utilities/isInRange.js +4 -0
- package/lib/types/NMRiumDataReturn.d.ts +2 -2
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -2
- package/lib/types/NMRiumToolBarPreferences.d.ts +14 -13
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +77 -0
- package/lib-cjs/component/1d/Chart1D.js +4 -2
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +15 -8
- package/lib-cjs/component/1d/FooterBanner.js +3 -1
- package/lib-cjs/component/1d/IntegralResizable.js +4 -3
- package/lib-cjs/component/1d/IntegralsSeries.js +3 -1
- package/lib-cjs/component/1d/LinesSeries.js +6 -4
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +10 -13
- package/lib-cjs/component/1d/database/DatabaseElements.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -2
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +5 -1
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +15 -13
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -3
- package/lib-cjs/component/1d/{PeakAnnotation.js → peaks/PeakAnnotation.js} +8 -9
- package/lib-cjs/component/1d/peaks/PeakAnnotations.js +33 -0
- package/lib-cjs/component/1d/peaks/PeaksShapes.js +42 -0
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +53 -0
- package/lib-cjs/component/1d/ranges/Range.js +3 -3
- package/lib-cjs/component/1d/ranges/Ranges.js +7 -1
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -1
- package/lib-cjs/component/1d/tool/XLabelPointer.js +3 -1
- package/lib-cjs/component/2d/Contours.js +3 -1
- package/lib-cjs/component/2d/FooterBanner.js +5 -3
- package/lib-cjs/component/2d/Viewer2D.js +6 -6
- package/lib-cjs/component/2d/XAxis.js +2 -2
- package/lib-cjs/component/2d/YAxis.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +3 -1
- package/lib-cjs/component/2d/tools/slicing/SlicingView.js +3 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +1 -1
- package/lib-cjs/component/2d/zones/Signal.js +3 -3
- package/lib-cjs/component/2d/zones/Zone.js +3 -3
- package/lib-cjs/component/2d/zones/Zones.js +13 -18
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +89 -50
- package/lib-cjs/component/NMRium.js +14 -3
- package/lib-cjs/component/context/GlobalContext.js +4 -4
- package/lib-cjs/component/elements/ActiveButton.js +33 -0
- package/lib-cjs/component/elements/Button.js +5 -5
- package/lib-cjs/component/elements/ButtonToolTip.js +1 -1
- package/lib-cjs/component/elements/CheckBox.js +3 -5
- package/lib-cjs/component/elements/Input.js +1 -1
- package/lib-cjs/component/elements/Label.js +3 -3
- package/lib-cjs/component/elements/MoleculeSelection.js +1 -1
- package/lib-cjs/component/elements/NextPrev.js +1 -1
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/Select.js +6 -8
- package/lib-cjs/component/elements/Tab/Tab.js +1 -1
- package/lib-cjs/component/elements/Table/Table.js +2 -2
- package/lib-cjs/component/elements/ToggleButton.js +3 -2
- package/lib-cjs/component/elements/accordion/AccordionItem.js +2 -2
- package/lib-cjs/component/elements/formik/FormikOnChange.js +10 -4
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +8 -11
- package/lib-cjs/component/elements/resizer/DivResizer.js +3 -3
- package/lib-cjs/component/elements/resizer/SVGResizer.js +2 -2
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +110 -0
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +39 -35
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +82 -49
- package/lib-cjs/component/header/Header.js +5 -2
- package/lib-cjs/component/header/HeaderContainer.js +14 -0
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +26 -28
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +19 -21
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +73 -45
- package/lib-cjs/component/header/Zones2DOptionPanel.js +11 -13
- package/lib-cjs/component/highlight/index.js +20 -18
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +2 -2
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +31 -1
- package/lib-cjs/component/hooks/useDatumWithSpectraStatistics.js +3 -1
- package/lib-cjs/component/hooks/useExport.js +0 -16
- package/lib-cjs/component/hooks/useFilter.js +14 -0
- package/lib-cjs/component/hooks/useIntegralPath.js +5 -2
- package/lib-cjs/component/hooks/useNucleus.js +4 -4
- package/lib-cjs/component/hooks/useSpectraPerNucleus.js +1 -1
- package/lib-cjs/component/hooks/useSpectrum.js +3 -1
- package/lib-cjs/component/hooks/useToolsFunctions.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +7 -150
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
- package/lib-cjs/component/modal/EditPeakShapeModal.js +113 -0
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +2 -3
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -2
- package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +9 -11
- package/lib-cjs/component/modal/changeSum/SelectMolecule.js +2 -2
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -3
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +3 -8
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +17 -13
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +2 -2
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +1 -1
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +3 -3
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -9
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +11 -3
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib-cjs/component/panels/Panels.js +3 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +45 -20
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +17 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +42 -11
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +10 -9
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +7 -3
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +3 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +4 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +4 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +2 -3
- package/lib-cjs/component/panels/SummaryPanel/utilities/useInView.js +3 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +18 -9
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -13
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -1
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +3 -12
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +15 -3
- package/lib-cjs/component/reducer/IgnoreActions.js +5 -0
- package/lib-cjs/component/reducer/Reducer.js +72 -50
- package/lib-cjs/component/reducer/actions/DomainActions.js +11 -9
- package/lib-cjs/component/reducer/actions/FiltersActions.js +332 -205
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +15 -10
- package/lib-cjs/component/reducer/actions/LoadActions.js +18 -36
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +49 -19
- package/lib-cjs/component/reducer/actions/PeaksActions.js +54 -12
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +8 -10
- package/lib-cjs/component/reducer/actions/RangesActions.js +87 -29
- package/lib-cjs/component/reducer/actions/SpectraAnalysisAction.js +5 -5
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +14 -11
- package/lib-cjs/component/reducer/actions/ToolsActions.js +46 -94
- package/lib-cjs/component/reducer/actions/ZonesActions.js +71 -17
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -1
- package/lib-cjs/component/reducer/helper/getActiveSpectrumOrFail.js +10 -0
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -2
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +19 -0
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -5
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +3 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib-cjs/component/reducer/types/Types.js +15 -3
- package/lib-cjs/component/tool/BrushX.js +1 -1
- package/lib-cjs/component/tool/BrushXY.js +4 -3
- package/lib-cjs/component/tool/CrossLinePointer.js +5 -4
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +21 -6
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +19 -6
- package/lib-cjs/component/toolbar/BasicToolBar.js +7 -14
- package/lib-cjs/component/toolbar/FunctionToolBar.js +12 -22
- package/lib-cjs/component/toolbar/ToolTypes.js +119 -9
- package/lib-cjs/component/utility/assert.js +9 -0
- package/lib-cjs/component/workspaces/basic.js +12 -11
- package/lib-cjs/component/workspaces/embedded.js +14 -13
- package/lib-cjs/component/workspaces/exercise.js +10 -6
- package/lib-cjs/component/workspaces/prediction.js +14 -13
- package/lib-cjs/component/workspaces/process1D.js +20 -19
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +14 -15
- package/lib-cjs/constants.js +1 -1
- package/lib-cjs/data/Filters.js +3 -3
- package/lib-cjs/data/FiltersManager.js +3 -6
- package/lib-cjs/data/PredictionManager.js +15 -15
- package/lib-cjs/data/SpectraManager.js +5 -100
- package/lib-cjs/data/constants/SignalsKinds.js +0 -8
- package/lib-cjs/data/data1d/Data1DManager.js +5 -5
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +18 -12
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +2 -5
- package/lib-cjs/data/data1d/Spectrum1D/index.js +3 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +5 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +15 -19
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +28 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +2 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -5
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +3 -6
- package/lib-cjs/data/data1d/database.js +4 -6
- package/lib-cjs/data/data1d/filter1d/apodization.js +70 -0
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +11 -18
- package/lib-cjs/data/data1d/filter1d/fft.js +11 -0
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +39 -0
- package/lib-cjs/data/data1d/filter1d/zeroFillingAndApodization.js +30 -0
- package/lib-cjs/data/data2d/Processing2D.js +3 -2
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -6
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +3 -6
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +3 -6
- package/lib-cjs/data/molecules/Molecule.js +5 -8
- package/lib-cjs/data/molecules/MoleculeManager.js +5 -5
- package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +0 -1
- package/lib-cjs/data/utilities/isInRange.js +7 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +36 -35
- package/lib/component/1d/PeakAnnotations.js +0 -41
- package/lib/component/utility/nmredataToNmrium.d.ts +0 -4
- package/lib/component/utility/nmredataToNmrium.js +0 -66
- package/lib/component/utility/nmriumToNmredata.d.ts +0 -2
- package/lib/component/utility/nmriumToNmredata.js +0 -80
- package/lib/component/utility/util/nmredata/addRanges.d.ts +0 -1
- package/lib/component/utility/util/nmredata/addRanges.js +0 -52
- package/lib/component/utility/util/nmredata/addSource.d.ts +0 -6
- package/lib/component/utility/util/nmredata/addSource.js +0 -54
- package/lib/component/utility/util/nmredata/addZones.d.ts +0 -1
- package/lib/component/utility/util/nmredata/addZones.js +0 -41
- package/lib/component/utility/util/nmredata/flat2DSignals.d.ts +0 -1
- package/lib/component/utility/util/nmredata/flat2DSignals.js +0 -7
- package/lib/component/utility/util/nmredata/get1DSignals.d.ts +0 -10
- package/lib/component/utility/util/nmredata/get1DSignals.js +0 -96
- package/lib/component/utility/util/nmredata/get2DSignals.d.ts +0 -8
- package/lib/component/utility/util/nmredata/get2DSignals.js +0 -59
- package/lib/component/utility/util/nmredata/getCouplingObserved.d.ts +0 -1
- package/lib/component/utility/util/nmredata/getCouplingObserved.js +0 -11
- package/lib/component/utility/util/nmredata/getLabels.d.ts +0 -9
- package/lib/component/utility/util/nmredata/getLabels.js +0 -66
- package/lib/component/utility/util/nmredata/getToFix.d.ts +0 -1
- package/lib/component/utility/util/nmredata/getToFix.js +0 -19
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +0 -14
- package/lib/data/data1d/filter1d/lineBroadening.js +0 -57
- package/lib/data/migration/MigrationManager.d.ts +0 -2
- package/lib/data/migration/MigrationManager.js +0 -17
- package/lib/data/migration/changeKeys.d.ts +0 -1
- package/lib/data/migration/changeKeys.js +0 -9
- package/lib/data/migration/migrateToVersion1.d.ts +0 -11
- package/lib/data/migration/migrateToVersion1.js +0 -32
- package/lib/data/migration/migrateToVersion2.d.ts +0 -1
- package/lib/data/migration/migrateToVersion2.js +0 -111
- package/lib/data/utilities/generateID.d.ts +0 -1
- package/lib/data/utilities/generateID.js +0 -9
- package/lib-cjs/component/1d/PeakAnnotations.js +0 -46
- package/lib-cjs/component/utility/nmredataToNmrium.js +0 -73
- package/lib-cjs/component/utility/nmriumToNmredata.js +0 -87
- package/lib-cjs/component/utility/util/nmredata/addRanges.js +0 -56
- package/lib-cjs/component/utility/util/nmredata/addSource.js +0 -61
- package/lib-cjs/component/utility/util/nmredata/addZones.js +0 -48
- package/lib-cjs/component/utility/util/nmredata/flat2DSignals.js +0 -11
- package/lib-cjs/component/utility/util/nmredata/get1DSignals.js +0 -100
- package/lib-cjs/component/utility/util/nmredata/get2DSignals.js +0 -63
- package/lib-cjs/component/utility/util/nmredata/getCouplingObserved.js +0 -15
- package/lib-cjs/component/utility/util/nmredata/getLabels.js +0 -70
- package/lib-cjs/component/utility/util/nmredata/getToFix.js +0 -23
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +0 -63
- package/lib-cjs/data/migration/MigrationManager.js +0 -24
- package/lib-cjs/data/migration/changeKeys.js +0 -13
- package/lib-cjs/data/migration/migrateToVersion1.js +0 -35
- package/lib-cjs/data/migration/migrateToVersion2.js +0 -114
- package/lib-cjs/data/utilities/generateID.js +0 -12
|
@@ -24,7 +24,7 @@ function MultiAnalysisRangesInner({ activeTab, spectraAnalysis, displayerKey, })
|
|
|
24
24
|
}
|
|
25
25
|
const MemoizedMultiAnalysisRanges = (0, react_1.memo)(MultiAnalysisRangesInner);
|
|
26
26
|
function MultiAnalysisRanges() {
|
|
27
|
-
const { activeTab, spectraAnalysis, displayerKey } = (0, ChartContext_1.useChartData)();
|
|
27
|
+
const { view: { spectra: { activeTab }, }, spectraAnalysis, displayerKey, } = (0, ChartContext_1.useChartData)();
|
|
28
28
|
return ((0, jsx_runtime_1.jsx)(MemoizedMultiAnalysisRanges, { ...{ activeTab, spectraAnalysis, displayerKey } }));
|
|
29
29
|
}
|
|
30
30
|
exports.default = MultiAnalysisRanges;
|
|
@@ -12,6 +12,7 @@ const ChartContext_1 = require("../../context/ChartContext");
|
|
|
12
12
|
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
13
13
|
const highlight_1 = require("../../highlight");
|
|
14
14
|
const MultiplicityUtilities_1 = require("../../panels/extra/utilities/MultiplicityUtilities");
|
|
15
|
+
const Reducer_1 = require("../../reducer/Reducer");
|
|
15
16
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
16
17
|
const LevelNode_1 = __importDefault(require("./LevelNode"));
|
|
17
18
|
const StringNode_1 = __importDefault(require("./StringNode"));
|
|
@@ -30,11 +31,11 @@ function MultiplicityTree({ rangeFrom, rangeTo, signal, labelOptions = {
|
|
|
30
31
|
fontSize: 11,
|
|
31
32
|
}, }) {
|
|
32
33
|
const { scaleX, scaleY } = (0, ScaleContext_1.useScaleChecked)();
|
|
33
|
-
const { data: spectraData,
|
|
34
|
+
const { data: spectraData, toolOptions: { selectedTool }, width, } = (0, ChartContext_1.useChartData)();
|
|
35
|
+
const activeSpectrum = (0, Reducer_1.useActiveSpectrum)();
|
|
34
36
|
const assignment = (0, AssignmentsContext_1.useAssignment)(signal.id);
|
|
35
37
|
const highlight = (0, highlight_1.useHighlight)(extractID(assignment), {
|
|
36
|
-
type: highlight_1.
|
|
37
|
-
extra: extractID(assignment),
|
|
38
|
+
type: highlight_1.HighlightEventSource.SIGNAL,
|
|
38
39
|
});
|
|
39
40
|
const spectrumData = (0, react_1.useMemo)(() =>
|
|
40
41
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
@@ -4,11 +4,11 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
4
4
|
/** @jsxImportSource @emotion/react */
|
|
5
5
|
const react_1 = require("@emotion/react");
|
|
6
6
|
const react_2 = require("react");
|
|
7
|
-
const DispatchContext_1 = require("
|
|
8
|
-
const highlight_1 = require("
|
|
9
|
-
const usePanelPreferences_1 = require("
|
|
10
|
-
const Types_1 = require("
|
|
11
|
-
const formatNumber_1 = require("
|
|
7
|
+
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
8
|
+
const highlight_1 = require("../../highlight");
|
|
9
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
10
|
+
const Types_1 = require("../../reducer/types/Types");
|
|
11
|
+
const formatNumber_1 = require("../../utility/formatNumber");
|
|
12
12
|
const styles = (0, react_1.css) `
|
|
13
13
|
input {
|
|
14
14
|
-webkit-user-select: text; /* Safari 3.1+ */
|
|
@@ -47,14 +47,14 @@ const styles = (0, react_1.css) `
|
|
|
47
47
|
}
|
|
48
48
|
`;
|
|
49
49
|
function PeakAnnotation({ id, x, y, sign, // 1 positive -1 negative
|
|
50
|
-
value, color,
|
|
50
|
+
value, color, nucleus, }) {
|
|
51
51
|
const refText = (0, react_2.useRef)(null);
|
|
52
52
|
const [isSelected, setIsSelected] = (0, react_2.useState)(false);
|
|
53
53
|
const [_value, setValue] = (0, react_2.useState)(value);
|
|
54
54
|
const [containerSize, setContainerSize] = (0, react_2.useState)({ width: 0, height: 0 });
|
|
55
55
|
const { deltaPPM } = (0, usePanelPreferences_1.usePanelPreferences)('peaks', nucleus);
|
|
56
56
|
const highlight = (0, highlight_1.useHighlight)([id], {
|
|
57
|
-
type: highlight_1.
|
|
57
|
+
type: highlight_1.HighlightEventSource.PEAK,
|
|
58
58
|
extra: { id },
|
|
59
59
|
});
|
|
60
60
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
@@ -115,9 +115,8 @@ value, color, isActive, nucleus, }) {
|
|
|
115
115
|
}, children: (0, jsx_runtime_1.jsx)("input", { onClick: handleSelectPeakAnnotation, className: isSelected ? 'input-over' : 'notification-input-normal', style: {
|
|
116
116
|
width: 'inherit',
|
|
117
117
|
border: isSelected ? `1px solid ${color}` : `0`,
|
|
118
|
-
opacity: isActive ? 1 : 0.2,
|
|
119
118
|
userSelect: 'none',
|
|
120
119
|
color,
|
|
121
|
-
}, value: oldValue, onKeyDown: handleKeyDown, onChange: handleChange, type: "number"
|
|
120
|
+
}, value: oldValue, onKeyDown: handleKeyDown, onChange: handleChange, type: "number" }) }) })] }));
|
|
122
121
|
}
|
|
123
122
|
exports.default = PeakAnnotation;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const ChartContext_1 = require("../../context/ChartContext");
|
|
9
|
+
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
10
|
+
const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
|
|
11
|
+
const Reducer_1 = require("../../reducer/Reducer");
|
|
12
|
+
const getVerticalShift_1 = __importDefault(require("../utilities/getVerticalShift"));
|
|
13
|
+
const PeakAnnotation_1 = __importDefault(require("./PeakAnnotation"));
|
|
14
|
+
const emptyData = { peaks: {}, info: {}, display: {} };
|
|
15
|
+
function PeakAnnotations() {
|
|
16
|
+
const { verticalAlign, displayerKey } = (0, ChartContext_1.useChartData)();
|
|
17
|
+
const activeSpectrum = (0, Reducer_1.useActiveSpectrum)();
|
|
18
|
+
const { scaleX, scaleY } = (0, ScaleContext_1.useScaleChecked)();
|
|
19
|
+
const spectrum = (0, useSpectrum_1.default)(emptyData);
|
|
20
|
+
const Peaks = (0, react_1.useMemo)(() => {
|
|
21
|
+
const getVerticalAlign = () => {
|
|
22
|
+
return (0, getVerticalShift_1.default)(verticalAlign, { index: activeSpectrum?.index });
|
|
23
|
+
};
|
|
24
|
+
if (!spectrum?.peaks?.values ||
|
|
25
|
+
!spectrum.display.isVisible ||
|
|
26
|
+
!spectrum.display.isPeaksMarkersVisible) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("g", { transform: `translate(0,-${getVerticalAlign()})`, children: spectrum.peaks.values.map(({ x, y, id }) => ((0, jsx_runtime_1.jsx)(PeakAnnotation_1.default, { x: scaleX()(x), y: scaleY(spectrum.id)(y) - 5, sign: Math.sign(y), id: id, value: x, color: "#730000", nucleus: spectrum.info.nucleus }, id))) }));
|
|
30
|
+
}, [spectrum, verticalAlign, activeSpectrum?.index, scaleX, scaleY]);
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)("g", { className: "peaks", clipPath: `url(#${displayerKey}clip-chart-1d)`, children: Peaks }));
|
|
32
|
+
}
|
|
33
|
+
exports.default = PeakAnnotations;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const ChartContext_1 = require("../../context/ChartContext");
|
|
8
|
+
const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
|
|
9
|
+
const Reducer_1 = require("../../reducer/Reducer");
|
|
10
|
+
const getVerticalShift_1 = __importDefault(require("../utilities/getVerticalShift"));
|
|
11
|
+
const usePeakShapesPath_1 = require("./usePeakShapesPath");
|
|
12
|
+
const emptyData = { peaks: {}, display: {} };
|
|
13
|
+
function PeaksShapes() {
|
|
14
|
+
const { verticalAlign, displayerKey, toolOptions: { data: { peaksOptions: { showPeaksShapes, showPeaksSum }, }, }, } = (0, ChartContext_1.useChartData)();
|
|
15
|
+
const activeSpectrum = (0, Reducer_1.useActiveSpectrum)();
|
|
16
|
+
const spectrum = (0, useSpectrum_1.default)(emptyData);
|
|
17
|
+
if (!spectrum?.peaks?.values || !spectrum.display.isVisible) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const vAlign = (0, getVerticalShift_1.default)(verticalAlign, {
|
|
21
|
+
index: activeSpectrum?.index,
|
|
22
|
+
});
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)("g", { className: "peaks-shapes", clipPath: `url(#${displayerKey}clip-chart-1d)`, children: [showPeaksShapes && (0, jsx_runtime_1.jsx)(PeaksShapesItems, { vAlign: vAlign }), showPeaksSum && (0, jsx_runtime_1.jsx)(PeaksShapesSum, { vAlign: vAlign })] }));
|
|
24
|
+
}
|
|
25
|
+
function PeaksShapesItems(props) {
|
|
26
|
+
const spectrum = (0, useSpectrum_1.default)(emptyData);
|
|
27
|
+
const getPath = (0, usePeakShapesPath_1.usePeakShapesPath)(spectrum);
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)("g", { children: [' ', spectrum.peaks.values.map((peak) => {
|
|
29
|
+
const { fill, path } = getPath({ target: 'peakShape', peak });
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)("path", { fill: fill, fillOpacity: 0.3, d: path, transform: `translate(0,-${props.vAlign})` }, peak.id));
|
|
31
|
+
})] }));
|
|
32
|
+
}
|
|
33
|
+
function PeaksShapesSum(props) {
|
|
34
|
+
const spectrum = (0, useSpectrum_1.default)(emptyData);
|
|
35
|
+
const getPath = (0, usePeakShapesPath_1.usePeakShapesPath)(spectrum);
|
|
36
|
+
const { fill, path } = getPath({
|
|
37
|
+
target: 'peaksSum',
|
|
38
|
+
peaks: spectrum.peaks.values,
|
|
39
|
+
});
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)("path", { stroke: 'darkblue', fill: fill, d: path, transform: `translate(0,-${props.vAlign})` }));
|
|
41
|
+
}
|
|
42
|
+
exports.default = PeaksShapes;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePeakShapesPath = void 0;
|
|
4
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
5
|
+
const ChartContext_1 = require("../../context/ChartContext");
|
|
6
|
+
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
7
|
+
const PathBuilder_1 = require("../../utility/PathBuilder");
|
|
8
|
+
function usePeakShapesPath(spectrum) {
|
|
9
|
+
const { scaleX, scaleY } = (0, ScaleContext_1.useScaleChecked)();
|
|
10
|
+
const { width, xDomain } = (0, ChartContext_1.useChartData)();
|
|
11
|
+
return function getPath(options) {
|
|
12
|
+
const { target } = options;
|
|
13
|
+
const frequency = spectrum.info.originFrequency;
|
|
14
|
+
let pathSeries = null;
|
|
15
|
+
switch (target) {
|
|
16
|
+
case 'peakShape':
|
|
17
|
+
pathSeries = (0, nmr_processing_1.peakToXY)(options.peak, {
|
|
18
|
+
frequency,
|
|
19
|
+
nbPoints: 1024,
|
|
20
|
+
from: options.peak.x - (options.peak.width / frequency) * 9,
|
|
21
|
+
to: options.peak.x + (options.peak.width / frequency) * 9,
|
|
22
|
+
});
|
|
23
|
+
break;
|
|
24
|
+
case 'peaksSum':
|
|
25
|
+
pathSeries = (0, nmr_processing_1.peaksToXY)(options.peaks, {
|
|
26
|
+
frequency,
|
|
27
|
+
nbPoints: width,
|
|
28
|
+
from: xDomain[0],
|
|
29
|
+
to: xDomain[1],
|
|
30
|
+
});
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
const _scaleX = scaleX();
|
|
36
|
+
const _scaleY = scaleY(spectrum.id);
|
|
37
|
+
const pathBuilder = new PathBuilder_1.PathBuilder();
|
|
38
|
+
let fill = 'transparent';
|
|
39
|
+
if (pathSeries) {
|
|
40
|
+
const { x, y } = pathSeries;
|
|
41
|
+
pathBuilder.moveTo(_scaleX(x[0]), _scaleY(y[0]));
|
|
42
|
+
for (let i = 1; i < x.length; i++) {
|
|
43
|
+
pathBuilder.lineTo(_scaleX(x[i]), _scaleY(y[i]));
|
|
44
|
+
}
|
|
45
|
+
if (target === 'peakShape') {
|
|
46
|
+
pathBuilder.closePath();
|
|
47
|
+
fill = 'black';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return { path: pathBuilder.toString(), fill };
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
exports.usePeakShapesPath = usePeakShapesPath;
|
|
@@ -52,7 +52,7 @@ function Range({ rangeData, showMultiplicityTrees, selectedTool, relativeFormat,
|
|
|
52
52
|
const { id, integration, signals } = rangeData;
|
|
53
53
|
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
54
54
|
const assignmentRange = (0, AssignmentsContext_1.useAssignment)(id);
|
|
55
|
-
const highlightRange = (0, highlight_1.useHighlight)([assignmentRange.id].concat(assignmentRange.assigned?.x || []).concat((0, filterForIDsWithAssignment_1.filterForIDsWithAssignment)(assignmentData, signals.map((_signal) => _signal.id))), { type: highlight_1.
|
|
55
|
+
const highlightRange = (0, highlight_1.useHighlight)([assignmentRange.id].concat(assignmentRange.assigned?.x || []).concat((0, filterForIDsWithAssignment_1.filterForIDsWithAssignment)(assignmentData, signals.map((_signal) => _signal.id))), { type: highlight_1.HighlightEventSource.RANGE, extra: { id } });
|
|
56
56
|
const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
|
|
57
57
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
58
58
|
const [reduceOpacity, setReduceOpacity] = (0, react_2.useState)(false);
|
|
@@ -87,7 +87,7 @@ function Range({ rangeData, showMultiplicityTrees, selectedTool, relativeFormat,
|
|
|
87
87
|
highlightRange.hide();
|
|
88
88
|
}, [assignmentRange, highlightRange]);
|
|
89
89
|
const assignHandler = (0, react_2.useCallback)((e) => {
|
|
90
|
-
if (selectedTool === ToolTypes_1.options.
|
|
90
|
+
if (selectedTool === ToolTypes_1.options.rangePicking.id &&
|
|
91
91
|
e.shiftKey &&
|
|
92
92
|
!isBlockedByEditing) {
|
|
93
93
|
assignmentRange.setActive('x');
|
|
@@ -95,7 +95,7 @@ function Range({ rangeData, showMultiplicityTrees, selectedTool, relativeFormat,
|
|
|
95
95
|
}, [assignmentRange, isBlockedByEditing, selectedTool]);
|
|
96
96
|
const from = scaleX()(rangeData.from);
|
|
97
97
|
const to = scaleX()(rangeData.to);
|
|
98
|
-
return ((0, jsx_runtime_1.jsxs)("g", { "data-test-id": "range", style: { outline: 'none' }, onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, onClick: assignHandler, children: [(0, jsx_runtime_1.jsx)(Resizer_1.default, { tag: "svg", initialPosition: { x1: to, x2: from }, onEnd: handleOnStopResizing, parentElement: viewerRef, children: ({ x1, x2 }, isActive) => ((0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,10)`, css: isBlockedByEditing ||
|
|
98
|
+
return ((0, jsx_runtime_1.jsxs)("g", { "data-test-id": "range", style: { outline: 'none' }, onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, onClick: assignHandler, children: [(0, jsx_runtime_1.jsx)(Resizer_1.default, { tag: "svg", initialPosition: { x1: to, x2: from }, onEnd: handleOnStopResizing, parentElement: viewerRef, disabled: selectedTool !== ToolTypes_1.options.rangePicking.id, children: ({ x1, x2 }, isActive) => ((0, jsx_runtime_1.jsxs)("g", { transform: `translate(0,10)`, css: isBlockedByEditing ||
|
|
99
99
|
highlightRange.isActive ||
|
|
100
100
|
assignmentRange.isActive ||
|
|
101
101
|
isActive
|
|
@@ -8,6 +8,7 @@ const react_1 = require("react");
|
|
|
8
8
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
9
9
|
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
10
10
|
const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
|
|
11
|
+
const Reducer_1 = require("../../reducer/Reducer");
|
|
11
12
|
const Range_1 = __importDefault(require("./Range"));
|
|
12
13
|
const RangeIntegral_1 = __importDefault(require("./RangeIntegral"));
|
|
13
14
|
function RangesInner({ ranges, displayerKey, selectedTool, showMultiplicityTrees, showRangesIntegrals, relativeFormat, }) {
|
|
@@ -16,7 +17,12 @@ function RangesInner({ ranges, displayerKey, selectedTool, showMultiplicityTrees
|
|
|
16
17
|
const MemoizedRanges = (0, react_1.memo)(RangesInner);
|
|
17
18
|
const empyData = { ranges: {} };
|
|
18
19
|
function Ranges() {
|
|
19
|
-
const { displayerKey,
|
|
20
|
+
const { displayerKey, view: { ranges: rangeState, spectra: { activeTab }, }, toolOptions: { selectedTool }, } = (0, ChartContext_1.useChartData)();
|
|
21
|
+
const activeSpectrum = (0, Reducer_1.useActiveSpectrum)();
|
|
22
|
+
const { showMultiplicityTrees, showRangesIntegrals } = (0, react_1.useMemo)(() => activeSpectrum
|
|
23
|
+
? rangeState.find((r) => r.spectrumID === activeSpectrum.id) ||
|
|
24
|
+
Reducer_1.rangeStateInit
|
|
25
|
+
: Reducer_1.rangeStateInit, [activeSpectrum, rangeState]);
|
|
20
26
|
const { ranges } = (0, useSpectrum_1.default)(empyData);
|
|
21
27
|
const rangesPreferences = (0, usePanelPreferences_1.usePanelPreferences)('ranges', activeTab);
|
|
22
28
|
return ((0, jsx_runtime_1.jsx)(MemoizedRanges, { ...{
|
|
@@ -11,6 +11,7 @@ const BrushTracker_1 = require("../../EventsTrackers/BrushTracker");
|
|
|
11
11
|
const MouseTracker_1 = require("../../EventsTrackers/MouseTracker");
|
|
12
12
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
13
13
|
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
14
|
+
const Reducer_1 = require("../../reducer/Reducer");
|
|
14
15
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
15
16
|
const getVerticalShift_1 = __importDefault(require("../utilities/getVerticalShift"));
|
|
16
17
|
const styles = {
|
|
@@ -21,8 +22,9 @@ const styles = {
|
|
|
21
22
|
SVGPadding: 1,
|
|
22
23
|
};
|
|
23
24
|
function PeakPointer() {
|
|
24
|
-
const { height, width, margin,
|
|
25
|
+
const { height, width, margin, data, mode, toolOptions: { selectedTool }, verticalAlign, } = (0, ChartContext_1.useChartData)();
|
|
25
26
|
const { scaleX, scaleY } = (0, ScaleContext_1.useScaleChecked)();
|
|
27
|
+
const activeSpectrum = (0, Reducer_1.useActiveSpectrum)();
|
|
26
28
|
let position = (0, react_1.useContext)(MouseTracker_1.MouseContext);
|
|
27
29
|
const brushState = (0, react_1.useContext)(BrushTracker_1.BrushContext);
|
|
28
30
|
const [closePeakPosition, setPosition] = (0, react_1.useState)();
|
|
@@ -7,6 +7,7 @@ const MouseTracker_1 = require("../../EventsTrackers/MouseTracker");
|
|
|
7
7
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
8
8
|
const ScaleContext_1 = require("../../context/ScaleContext");
|
|
9
9
|
const useFormatNumberByNucleus_1 = require("../../hooks/useFormatNumberByNucleus");
|
|
10
|
+
const Reducer_1 = require("../../reducer/Reducer");
|
|
10
11
|
const style = {
|
|
11
12
|
cursor: 'crosshair',
|
|
12
13
|
transformOrigin: 'bottom right',
|
|
@@ -18,7 +19,8 @@ const style = {
|
|
|
18
19
|
userSelect: 'none',
|
|
19
20
|
};
|
|
20
21
|
function XLabelPointer() {
|
|
21
|
-
const { height, width, margin, data
|
|
22
|
+
const { height, width, margin, data } = (0, ChartContext_1.useChartData)();
|
|
23
|
+
const activeSpectrum = (0, Reducer_1.useActiveSpectrum)();
|
|
22
24
|
const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
|
|
23
25
|
const position = (0, react_1.useContext)(MouseTracker_1.MouseContext);
|
|
24
26
|
const brushState = (0, react_1.useContext)(BrushTracker_1.BrushContext);
|
|
@@ -9,10 +9,12 @@ const react_1 = require("react");
|
|
|
9
9
|
const Spectrum2D_1 = require("../../data/data2d/Spectrum2D");
|
|
10
10
|
const ChartContext_1 = require("../context/ChartContext");
|
|
11
11
|
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
12
|
+
const Reducer_1 = require("../reducer/Reducer");
|
|
12
13
|
const PathBuilder_1 = require("../utility/PathBuilder");
|
|
13
14
|
const scale_1 = require("./utilities/scale");
|
|
14
15
|
function ContoursPaths({ id: spectrumID, sign, color, datum, }) {
|
|
15
|
-
const { margin, width, height, xDomain, yDomain, contours
|
|
16
|
+
const { margin, width, height, xDomain, yDomain, contours } = (0, ChartContext_1.useChartData)();
|
|
17
|
+
const activeSpectrum = (0, Reducer_1.useActiveSpectrum)();
|
|
16
18
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
17
19
|
const { xShift, yShift } = (0, Spectrum2D_1.getShift)(datum);
|
|
18
20
|
const isActive = (0, react_1.useMemo)(() => {
|
|
@@ -11,6 +11,7 @@ const BrushTracker_1 = require("../EventsTrackers/BrushTracker");
|
|
|
11
11
|
const MouseTracker_1 = require("../EventsTrackers/MouseTracker");
|
|
12
12
|
const ChartContext_1 = require("../context/ChartContext");
|
|
13
13
|
const useFormatNumberByNucleus_1 = require("../hooks/useFormatNumberByNucleus");
|
|
14
|
+
const Reducer_1 = require("../reducer/Reducer");
|
|
14
15
|
const ToolTypes_1 = require("../toolbar/ToolTypes");
|
|
15
16
|
const DimensionLayout_1 = require("./utilities/DimensionLayout");
|
|
16
17
|
const scale_1 = require("./utilities/scale");
|
|
@@ -51,7 +52,8 @@ const styles = (0, react_1.css) `
|
|
|
51
52
|
function FooterBanner({ layout, data1D }) {
|
|
52
53
|
const position = (0, react_2.useContext)(MouseTracker_1.MouseContext);
|
|
53
54
|
const { startX, endX, startY, endY, step } = (0, react_2.useContext)(BrushTracker_1.BrushContext);
|
|
54
|
-
const { margin, width, height,
|
|
55
|
+
const { margin, width, height, xDomain, yDomain, yDomains, view: { spectra: { activeTab }, }, data, toolOptions: { selectedTool }, } = (0, ChartContext_1.useChartData)();
|
|
56
|
+
const activeSpectrum = (0, Reducer_1.useActiveSpectrum)();
|
|
55
57
|
const trackID = position &&
|
|
56
58
|
(0, DimensionLayout_1.getLayoutID)(layout, {
|
|
57
59
|
startX: position.x,
|
|
@@ -63,7 +65,7 @@ function FooterBanner({ layout, data1D }) {
|
|
|
63
65
|
if (!data1D || data1D.length === 0) {
|
|
64
66
|
return (0, scale_1.get2DXScale)({ width, margin, xDomain });
|
|
65
67
|
}
|
|
66
|
-
if (selectedTool !== ToolTypes_1.options.
|
|
68
|
+
if (selectedTool !== ToolTypes_1.options.slicing.id) {
|
|
67
69
|
switch (trackID) {
|
|
68
70
|
case DimensionLayout_1.LAYOUT.TOP_1D:
|
|
69
71
|
case DimensionLayout_1.LAYOUT.CENTER_2D: {
|
|
@@ -82,7 +84,7 @@ function FooterBanner({ layout, data1D }) {
|
|
|
82
84
|
if (!data1D || data1D.length === 0) {
|
|
83
85
|
return (0, scale_1.get2DYScale)({ height, margin, yDomain });
|
|
84
86
|
}
|
|
85
|
-
if (selectedTool !== ToolTypes_1.options.
|
|
87
|
+
if (selectedTool !== ToolTypes_1.options.slicing.id) {
|
|
86
88
|
switch (trackID) {
|
|
87
89
|
case DimensionLayout_1.LAYOUT.CENTER_2D: {
|
|
88
90
|
return (0, scale_1.get2DYScale)({ height, margin, yDomain });
|
|
@@ -48,15 +48,15 @@ const SlicingView_1 = __importDefault(require("./tools/slicing/SlicingView"));
|
|
|
48
48
|
const DimensionLayout_1 = require("./utilities/DimensionLayout");
|
|
49
49
|
function Viewer2D({ emptyText = undefined }) {
|
|
50
50
|
const state = (0, ChartContext_1.useChartData)();
|
|
51
|
-
const { toolOptions: { selectedTool }, isLoading, data, margin,
|
|
51
|
+
const { toolOptions: { selectedTool }, isLoading, data, margin, view: { spectra: { activeSpectra, activeTab }, }, } = state;
|
|
52
52
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
53
53
|
const { info } = (0, useSpectrum_1.default)({ info: {} });
|
|
54
54
|
const isVisible = info.isFt || !('isFt' in info);
|
|
55
55
|
const spectrumData = (0, react_1.useMemo)(() => {
|
|
56
56
|
const nucleuses = activeTab.split(',');
|
|
57
57
|
return nucleuses.reduce((acc, n) => {
|
|
58
|
-
if (
|
|
59
|
-
const id =
|
|
58
|
+
if (activeSpectra[n]?.id) {
|
|
59
|
+
const id = activeSpectra[n]?.id;
|
|
60
60
|
const spectrum = data.find((datum) => datum.id === id && !datum.info.isFid);
|
|
61
61
|
if (spectrum) {
|
|
62
62
|
acc.push(spectrum);
|
|
@@ -67,7 +67,7 @@ function Viewer2D({ emptyText = undefined }) {
|
|
|
67
67
|
}
|
|
68
68
|
return acc;
|
|
69
69
|
}, []);
|
|
70
|
-
}, [activeTab, data,
|
|
70
|
+
}, [activeTab, data, activeSpectra]);
|
|
71
71
|
const DIMENSION = (0, DimensionLayout_1.get2DDimensionLayout)(state);
|
|
72
72
|
const handelBrushEnd = (0, react_1.useCallback)((brushData) => {
|
|
73
73
|
const trackID = (0, DimensionLayout_1.getLayoutID)(DIMENSION, brushData);
|
|
@@ -80,7 +80,7 @@ function Viewer2D({ emptyText = undefined }) {
|
|
|
80
80
|
}
|
|
81
81
|
else if (brushData.shiftKey) {
|
|
82
82
|
switch (selectedTool) {
|
|
83
|
-
case ToolTypes_1.options.
|
|
83
|
+
case ToolTypes_1.options.zonePicking.id:
|
|
84
84
|
dispatch({ type: Types_1.ADD_2D_ZONE, ...brushData });
|
|
85
85
|
break;
|
|
86
86
|
default:
|
|
@@ -137,7 +137,7 @@ function Viewer2D({ emptyText = undefined }) {
|
|
|
137
137
|
margin: 'auto',
|
|
138
138
|
position: 'relative',
|
|
139
139
|
overflow: 'hidden',
|
|
140
|
-
}, children: (0, jsx_runtime_1.jsxs)(MouseTracker_1.MouseTracker, { style: { width: '100%', height: `100%`, position: 'absolute' }, children: [selectedTool && selectedTool === ToolTypes_1.options.
|
|
140
|
+
}, children: (0, jsx_runtime_1.jsxs)(MouseTracker_1.MouseTracker, { style: { width: '100%', height: `100%`, position: 'absolute' }, children: [selectedTool && selectedTool === ToolTypes_1.options.slicing.id && ((0, jsx_runtime_1.jsx)(SlicingView_1.default, {})), (0, jsx_runtime_1.jsx)(CrossLinePointer_1.default, {}), spectrumData && ((0, jsx_runtime_1.jsx)(XYLabelPointer_1.default, { data1D: spectrumData, layout: DIMENSION })), (0, jsx_runtime_1.jsx)(BrushXY_1.default, { brushType: BrushXY_1.BRUSH_TYPE.XY, dimensionBorder: DIMENSION.CENTER_2D }), (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [spectrumData?.[0] && ((0, jsx_runtime_1.jsx)(BrushXY_1.default, { brushType: BrushXY_1.BRUSH_TYPE.X, dimensionBorder: DIMENSION.TOP_1D, height: margin.top })), spectrumData?.[1] && ((0, jsx_runtime_1.jsx)(BrushXY_1.default, { brushType: BrushXY_1.BRUSH_TYPE.Y, dimensionBorder: DIMENSION.LEFT_1D, width: margin.left }))] }), spectrumData && ((0, jsx_runtime_1.jsx)(FooterBanner_1.default, { data1D: spectrumData, layout: DIMENSION })), (0, jsx_runtime_1.jsx)(Chart2D_1.default, { spectra: spectrumData })] }) }))] })) }));
|
|
141
141
|
}
|
|
142
142
|
function ViewerResponsiveWrapper(props) {
|
|
143
143
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
@@ -46,7 +46,7 @@ const defaultMargin = { right: 100, top: 0, left: 0, bottom: 0 };
|
|
|
46
46
|
function XAxis(props) {
|
|
47
47
|
const { show = true, label = 'δ [ppm]', margin: marginProps = defaultMargin, } = props;
|
|
48
48
|
const state = (0, ChartContext_1.useChartData)();
|
|
49
|
-
const { xDomain, height, width, margin,
|
|
49
|
+
const { xDomain, height, width, margin, view: { spectra: { activeSpectra, activeTab }, }, } = state;
|
|
50
50
|
const refAxis = (0, react_2.useRef)(null);
|
|
51
51
|
(0, react_2.useEffect)(() => {
|
|
52
52
|
if (!show)
|
|
@@ -64,7 +64,7 @@ function XAxis(props) {
|
|
|
64
64
|
margin.right,
|
|
65
65
|
margin.top,
|
|
66
66
|
show,
|
|
67
|
-
|
|
67
|
+
activeSpectra,
|
|
68
68
|
width,
|
|
69
69
|
xDomain,
|
|
70
70
|
]);
|
|
@@ -51,7 +51,7 @@ function YAxis(props) {
|
|
|
51
51
|
const { show = true, label = '', margin: marginProps = defaultMargin, } = props;
|
|
52
52
|
const refAxis = (0, react_2.useRef)(null);
|
|
53
53
|
const state = (0, ChartContext_1.useChartData)();
|
|
54
|
-
const { yDomain, width, height, activeTab,
|
|
54
|
+
const { yDomain, width, height, view: { spectra: { activeTab, activeSpectra }, }, margin, } = state;
|
|
55
55
|
(0, react_2.useEffect)(() => {
|
|
56
56
|
if (!show || !yDomain)
|
|
57
57
|
return;
|
|
@@ -59,7 +59,7 @@ function YAxis(props) {
|
|
|
59
59
|
const axis = d3.axisRight(scaleY).ticks(8).tickFormat(d3.format('0'));
|
|
60
60
|
// @ts-expect-error well typed
|
|
61
61
|
d3.select(refAxis.current).call(axis);
|
|
62
|
-
}, [show, yDomain, activeTab,
|
|
62
|
+
}, [show, yDomain, activeTab, activeSpectra, height, margin]);
|
|
63
63
|
if (!width || !height) {
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
@@ -6,6 +6,7 @@ const BrushTracker_1 = require("../../EventsTrackers/BrushTracker");
|
|
|
6
6
|
const MouseTracker_1 = require("../../EventsTrackers/MouseTracker");
|
|
7
7
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
8
8
|
const useFormatNumberByNucleus_1 = require("../../hooks/useFormatNumberByNucleus");
|
|
9
|
+
const Reducer_1 = require("../../reducer/Reducer");
|
|
9
10
|
const DimensionLayout_1 = require("../utilities/DimensionLayout");
|
|
10
11
|
const scale_1 = require("../utilities/scale");
|
|
11
12
|
const style = {
|
|
@@ -24,7 +25,8 @@ const style = {
|
|
|
24
25
|
function XYLabelPointer({ layout, data1D }) {
|
|
25
26
|
const position = (0, react_1.useContext)(MouseTracker_1.MouseContext);
|
|
26
27
|
const { step } = (0, react_1.useContext)(BrushTracker_1.BrushContext);
|
|
27
|
-
const { margin, width, height, xDomain, yDomain, yDomains, activeTab,
|
|
28
|
+
const { margin, width, height, xDomain, yDomain, yDomains, view: { spectra: { activeTab }, }, } = (0, ChartContext_1.useChartData)();
|
|
29
|
+
const activeSpectrum = (0, Reducer_1.useActiveSpectrum)();
|
|
28
30
|
const trackID = position &&
|
|
29
31
|
(0, DimensionLayout_1.getLayoutID)(layout, {
|
|
30
32
|
startX: position.x,
|
|
@@ -8,12 +8,14 @@ const react_1 = require("react");
|
|
|
8
8
|
const Spectrum2D_1 = require("../../../../data/data2d/Spectrum2D");
|
|
9
9
|
const MouseTracker_1 = require("../../../EventsTrackers/MouseTracker");
|
|
10
10
|
const ChartContext_1 = require("../../../context/ChartContext");
|
|
11
|
+
const Reducer_1 = require("../../../reducer/Reducer");
|
|
11
12
|
const scale_1 = require("../../utilities/scale");
|
|
12
13
|
const HorizontalSliceChart_1 = __importDefault(require("./HorizontalSliceChart"));
|
|
13
14
|
const VerticalSliceChart_1 = __importDefault(require("./VerticalSliceChart"));
|
|
14
15
|
function SlicingView() {
|
|
15
|
-
const { width, height, margin,
|
|
16
|
+
const { width, height, margin, data: spectra, xDomain, yDomain, } = (0, ChartContext_1.useChartData)();
|
|
16
17
|
const position = (0, MouseTracker_1.useMouseTracker)();
|
|
18
|
+
const activeSpectrum = (0, Reducer_1.useActiveSpectrum)();
|
|
17
19
|
const chart2d = (0, react_1.useMemo)(() => {
|
|
18
20
|
if (position && activeSpectrum && activeSpectrum.id) {
|
|
19
21
|
const { x, y } = position;
|
|
@@ -13,7 +13,7 @@ const lineStyle = (0, react_1.css) `
|
|
|
13
13
|
opacity: 0.7;
|
|
14
14
|
`;
|
|
15
15
|
function IndicationLines({ axis, show }) {
|
|
16
|
-
const { data, activeTab, margin, width, height, xDomain, yDomain, displayerMode, } = (0, ChartContext_1.useChartData)();
|
|
16
|
+
const { data, view: { spectra: { activeTab }, }, margin, width, height, xDomain, yDomain, displayerMode, } = (0, ChartContext_1.useChartData)();
|
|
17
17
|
const [deltas1D, setDeltas1D] = (0, react_2.useState)([]);
|
|
18
18
|
const scaleX = (0, scale_1.get2DXScale)({ margin, width, xDomain });
|
|
19
19
|
const scaleY = (0, scale_1.get2DYScale)({ margin, height, yDomain });
|
|
@@ -12,7 +12,7 @@ const ChartContext_1 = require("../../context/ChartContext");
|
|
|
12
12
|
const highlight_1 = require("../../highlight");
|
|
13
13
|
const scale_1 = require("../utilities/scale");
|
|
14
14
|
const SignalCrosshair_1 = __importDefault(require("./SignalCrosshair"));
|
|
15
|
-
|
|
15
|
+
function Signal({ signal, isVisible }) {
|
|
16
16
|
const { margin, width, height, xDomain, yDomain } = (0, ChartContext_1.useChartData)();
|
|
17
17
|
const scaleX = (0, scale_1.get2DXScale)({ margin, width, xDomain });
|
|
18
18
|
const scaleY = (0, scale_1.get2DYScale)({ margin, height, yDomain });
|
|
@@ -48,5 +48,5 @@ const Signal = (0, react_1.memo)(({ signal, isVisible }) => {
|
|
|
48
48
|
}, cx: scaleX(signal.x.delta || 0), cy: scaleY(signal.y.delta || 0), r: isHighlighted ? 6 : 4, fill: isHighlighted ? 'green' : 'darkgreen' }, signal.id)] })), (0, jsx_runtime_1.jsx)("g", { className: "zone-signal-peak", style: { pointerEvents: 'none' }, children: isVisible.peaks &&
|
|
49
49
|
signal.peaks &&
|
|
50
50
|
signal.peaks.map((peak, i) => ((0, jsx_runtime_1.jsx)("circle", { cx: scaleX(peak.x), cy: scaleY(peak.y), r: 2, fill: "black" }, `${signal.id + i}`))) })] }));
|
|
51
|
-
}
|
|
52
|
-
exports.default = Signal;
|
|
51
|
+
}
|
|
52
|
+
exports.default = (0, react_1.memo)(Signal);
|
|
@@ -40,11 +40,11 @@ const stylesHighlighted = (0, react_1.css) `
|
|
|
40
40
|
cursor: pointer;
|
|
41
41
|
}
|
|
42
42
|
`;
|
|
43
|
-
|
|
43
|
+
function Zone({ zoneData, isVisible }) {
|
|
44
44
|
const { x, y, id, signals } = zoneData;
|
|
45
45
|
const assignmentZone = (0, AssignmentsContext_1.useAssignment)(id);
|
|
46
46
|
const highlightZone = (0, highlight_1.useHighlight)([assignmentZone.id], {
|
|
47
|
-
type: highlight_1.
|
|
47
|
+
type: highlight_1.HighlightEventSource.ZONE,
|
|
48
48
|
extra: { id: assignmentZone.id },
|
|
49
49
|
});
|
|
50
50
|
const { margin, width, height, xDomain, yDomain } = (0, ChartContext_1.useChartData)();
|
|
@@ -65,5 +65,5 @@ const Zone = ({ zoneData, isVisible }) => {
|
|
|
65
65
|
assignmentZone.hide();
|
|
66
66
|
highlightZone.hide();
|
|
67
67
|
}, children: [isVisible.zones && ((0, jsx_runtime_1.jsx)("g", { transform: `translate(${scaleX(x2)},${scaleY(y1)})`, children: (0, jsx_runtime_1.jsx)("rect", { x: "0", width: scaleX(x1) - scaleX(x2), height: scaleY(y2) - scaleY(y1), className: "Integral-area", fill: "#0000000f", stroke: reduceOpacity ? '#343a40' : 'darkgreen', strokeWidth: reduceOpacity ? '0' : '1' }) })), signals.map((_signal, i) => ((0, jsx_runtime_1.jsx)(Signal_1.default, { signal: _signal, isVisible: isVisible }, `${id + i}`)))] }, id));
|
|
68
|
-
}
|
|
68
|
+
}
|
|
69
69
|
exports.default = Zone;
|
|
@@ -7,30 +7,25 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
9
9
|
const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
|
|
10
|
-
const
|
|
10
|
+
const Reducer_1 = require("../../reducer/Reducer");
|
|
11
11
|
const Zone_1 = __importDefault(require("./Zone"));
|
|
12
|
-
function ZonesInner({ zones, display, displayerKey }) {
|
|
13
|
-
const [isVisible, setVisibility] = (0, react_1.useState)({
|
|
14
|
-
zones: true,
|
|
15
|
-
signals: true,
|
|
16
|
-
peaks: true,
|
|
17
|
-
});
|
|
18
|
-
(0, react_1.useEffect)(() => {
|
|
19
|
-
Events_1.default.on('onZonesVisibilityChange', ({ key }) => {
|
|
20
|
-
setVisibility((prevVisiblity) => ({
|
|
21
|
-
...prevVisiblity,
|
|
22
|
-
[key]: !prevVisiblity[key],
|
|
23
|
-
}));
|
|
24
|
-
});
|
|
25
|
-
}, []);
|
|
12
|
+
function ZonesInner({ zones, display, displayerKey, isVisible, }) {
|
|
26
13
|
return ((0, jsx_runtime_1.jsx)("g", { clipPath: `url(#${displayerKey}clip-chart-2d)`, className: "2D-Zones", children: display.isVisible &&
|
|
27
14
|
zones.values.map((zone) => ((0, jsx_runtime_1.jsx)("g", { className: "zone", children: (0, jsx_runtime_1.jsx)(Zone_1.default, { zoneData: zone, isVisible: isVisible }) }, zone.id))) }));
|
|
28
15
|
}
|
|
29
16
|
const MemoizedZones = (0, react_1.memo)(ZonesInner);
|
|
30
17
|
const emptyData = { zones: {}, display: {} };
|
|
31
18
|
function Zones() {
|
|
32
|
-
const { displayerKey } = (0, ChartContext_1.useChartData)();
|
|
33
|
-
const { zones, display } = (0, useSpectrum_1.default)(emptyData);
|
|
34
|
-
|
|
19
|
+
const { displayerKey, view: { zones: zoneState }, } = (0, ChartContext_1.useChartData)();
|
|
20
|
+
const { zones, display, id } = (0, useSpectrum_1.default)(emptyData);
|
|
21
|
+
const isVisible = (0, react_1.useMemo)(() => {
|
|
22
|
+
const { showPeaks, showSignals, showZones } = zoneState.find((r) => r.spectrumID === id) || Reducer_1.zoneStateInit;
|
|
23
|
+
return {
|
|
24
|
+
zones: showZones,
|
|
25
|
+
signals: showSignals,
|
|
26
|
+
peaks: showPeaks,
|
|
27
|
+
};
|
|
28
|
+
}, [id, zoneState]);
|
|
29
|
+
return (0, jsx_runtime_1.jsx)(MemoizedZones, { ...{ zones, display, displayerKey, isVisible } });
|
|
35
30
|
}
|
|
36
31
|
exports.default = Zones;
|