nmrium 0.31.0 → 0.33.0-pre.1667632695
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/Chart1D.js +1 -1
- package/lib/component/1d/FooterBanner.js +17 -10
- package/lib/component/1d/LinesSeries.js +1 -1
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/XAxis.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib/component/1d/{Integral.d.ts → integral/Integral.d.ts} +0 -0
- package/lib/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib/component/1d/integral/IntegralIndicator.d.ts +9 -0
- package/lib/component/1d/integral/IntegralIndicator.js +27 -0
- package/lib/component/1d/{IntegralResizable.d.ts → integral/IntegralResizable.d.ts} +0 -0
- package/lib/component/1d/integral/IntegralResizable.js +69 -0
- package/lib/component/1d/{IntegralsSeries.d.ts → integral/IntegralsSeries.d.ts} +0 -0
- package/lib/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib/component/1d/ranges/Range.js +27 -50
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +2 -2
- package/lib/component/2d/Contours.js +61 -42
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/Left1DChart.js +1 -1
- package/lib/component/2d/Top1DChart.js +1 -1
- package/lib/component/2d/Viewer2D.js +11 -14
- package/lib/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib/component/2d/zones/IndicationLines.js +5 -8
- package/lib/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +6 -6
- package/lib/component/SplitPaneWrapper.js +1 -1
- package/lib/component/assignment/actions/initAssignment.js +17 -17
- package/lib/component/assignment/index.js +2 -2
- package/lib/component/context/PreferencesContext.js +3 -6
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/CheckBoxCell.js +1 -1
- package/lib/component/elements/ContextMenu.js +2 -2
- package/lib/component/elements/EditableColumn.d.ts +3 -1
- package/lib/component/elements/EditableColumn.js +21 -8
- package/lib/component/elements/GroupPane.d.ts +12 -0
- package/lib/component/elements/GroupPane.js +14 -0
- package/lib/component/elements/Input.js +7 -4
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/Label.js +1 -2
- package/lib/component/elements/MolecularFormulaInput.js +2 -0
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -1
- package/lib/component/elements/ReactTable/ReactTable.js +72 -38
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +3 -2
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib/component/elements/accordion/Accordion.js +2 -2
- package/lib/component/elements/draggble/useDraggable.js +1 -3
- package/lib/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
- package/lib/component/elements/formik/FormikColorPicker.js +5 -8
- package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib/component/elements/formik/FormikForm.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput.js +12 -20
- package/lib/component/elements/formik/FormikOnChange.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.js +13 -10
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/elements/formik/FormikSlider.d.ts +2 -4
- package/lib/component/elements/formik/FormikSlider.js +8 -11
- package/lib/component/elements/formik/FormikTextarea.js +1 -1
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib/component/elements/popup/Alert/Provider.js +7 -7
- package/lib/component/elements/popup/Alert/index.d.ts +3 -4
- package/lib/component/elements/popup/Alert/index.js +3 -4
- package/lib/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib/component/elements/popup/Modal/Provider.js +16 -31
- package/lib/component/elements/popup/Modal/index.d.ts +4 -5
- package/lib/component/elements/popup/Modal/index.js +4 -5
- package/lib/component/header/Header.js +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib/component/hooks/useCombinedRefs.js +2 -2
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +9 -6
- package/lib/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib/component/hooks/usePanelPreferences.js +9 -7
- package/lib/component/loader/DropZone.js +10 -2
- package/lib/component/modal/AlignSpectraModal.js +1 -1
- package/lib/component/modal/ExportAsMatrixModal.js +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +2 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib/component/modal/PredictSpectraModal.js +5 -5
- package/lib/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib/component/modal/setting/GeneralSettings.js +11 -14
- package/lib/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -1
- package/lib/component/modal/setting/WorkspaceItem.js +36 -48
- package/lib/component/modal/setting/settingsValidation.d.ts +58 -57
- package/lib/component/modal/setting/settingsValidation.js +14 -12
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib/component/panels/InformationPanel.js +52 -56
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +5 -5
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +3 -26
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +3 -3
- package/lib/component/reducer/Reducer.d.ts +26 -45
- package/lib/component/reducer/Reducer.js +13 -12
- package/lib/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/DomainActions.js +52 -69
- package/lib/component/reducer/actions/FiltersActions.js +15 -6
- package/lib/component/reducer/actions/HistoryActions.js +5 -5
- package/lib/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib/component/reducer/actions/LoadActions.js +12 -0
- package/lib/component/reducer/actions/PeaksActions.js +7 -6
- package/lib/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +28 -24
- package/lib/component/reducer/actions/SpectrumsActions.js +13 -6
- package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +28 -41
- package/lib/component/reducer/actions/ZonesActions.js +11 -10
- package/lib/component/reducer/core/Constants.js +1 -1
- package/lib/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrum.js +4 -0
- package/lib/component/reducer/helper/getSpectrum.js +3 -5
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +1 -1
- package/lib/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib/component/reducer/preferences/actions/setPreferences.js +5 -6
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +2 -2
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -4
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib/component/tool/BrushX.js +3 -3
- package/lib/component/tool/BrushXY.js +5 -5
- package/lib/component/tool/CrossLinePointer.js +3 -3
- package/lib/component/toolbar/BasicToolBar.js +9 -8
- package/lib/component/utility/Evaluate.js +2 -2
- package/lib/component/utility/FileUtility.d.ts +2 -9
- package/lib/component/utility/FileUtility.js +11 -28
- package/lib/component/utility/GroupByInfoKey.d.ts +1 -1
- package/lib/component/utility/GroupByInfoKey.js +11 -13
- package/lib/component/utility/PathBuilder.js +1 -1
- package/lib/component/utility/PreferencesHelper.js +2 -3
- package/lib/component/utility/{Export.d.ts → export.d.ts} +0 -0
- package/lib/component/utility/{Export.js → export.js} +54 -73
- package/lib/component/utility/formatNumber.d.ts +6 -1
- package/lib/component/utility/formatNumber.js +5 -4
- package/lib/component/workspaces/Workspace.d.ts +1 -1
- package/lib/component/workspaces/exercise.js +4 -4
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/Filters.d.ts +16 -18
- package/lib/data/Filters.js +16 -18
- package/lib/data/FiltersManager.js +4 -3
- package/lib/data/PredictionManager.js +8 -10
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/SpectraManager.js +25 -60
- package/lib/data/data1d/MultipleAnalysis.js +74 -70
- package/lib/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +24 -25
- package/lib/data/data1d/Spectrum1D/index.js +24 -25
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib/data/data1d/database.js +45 -28
- package/lib/data/data1d/filter1d/apodization.js +2 -1
- package/lib/data/data1d/filter1d/fft.js +24 -7
- package/lib/data/data1d/filter1d/phaseCorrection.js +11 -5
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +10 -20
- package/lib/data/data2d/Spectrum2D/contours.d.ts +40 -0
- package/lib/data/data2d/Spectrum2D/contours.js +132 -0
- package/lib/data/data2d/Spectrum2D/index.d.ts +10 -11
- package/lib/data/data2d/Spectrum2D/index.js +10 -11
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/index.d.ts +12 -13
- package/lib/data/types/data2d/Data2D.d.ts +2 -0
- package/lib/data/types/data2d/Datum2D.d.ts +0 -1
- package/lib/data/types/data2d/index.d.ts +8 -9
- package/lib/data/utilities/RangeUtilities.js +13 -9
- package/lib/data/utilities/ZoneUtilities.js +17 -13
- package/lib/data/utilities/calculateSanPlot.d.ts +8 -0
- package/lib/data/utilities/calculateSanPlot.js +31 -0
- package/lib/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib/data/utilities/generateChar.js +8 -6
- package/lib/data/utilities/getAtom.js +1 -1
- package/lib/data/utilities/getAtomsFromMF.js +2 -2
- package/lib/data/utilities/getColor.js +3 -3
- package/lib/data/utilities/getSum.js +6 -3
- package/lib/types/NMRiumGeneralPreferences.d.ts +2 -2
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +16 -9
- package/lib-cjs/component/1d/LinesSeries.js +1 -1
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/XAxis.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib-cjs/component/1d/integral/IntegralIndicator.js +31 -0
- package/lib-cjs/component/1d/integral/IntegralResizable.js +74 -0
- package/lib-cjs/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib-cjs/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib-cjs/component/1d/ranges/Range.js +27 -50
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +2 -2
- package/lib-cjs/component/2d/Contours.js +60 -41
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/Left1DChart.js +1 -1
- package/lib-cjs/component/2d/Top1DChart.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +11 -14
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +5 -8
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib-cjs/component/NMRium.js +7 -7
- package/lib-cjs/component/SplitPaneWrapper.js +1 -1
- package/lib-cjs/component/assignment/actions/initAssignment.js +17 -17
- package/lib-cjs/component/assignment/index.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +3 -6
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/CheckBoxCell.js +1 -1
- package/lib-cjs/component/elements/ContextMenu.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +21 -8
- package/lib-cjs/component/elements/GroupPane.js +18 -0
- package/lib-cjs/component/elements/Input.js +7 -4
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/Label.js +1 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +2 -0
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +71 -37
- package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib-cjs/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib-cjs/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -2
- package/lib-cjs/component/elements/draggble/useDraggable.js +1 -3
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +4 -7
- package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib-cjs/component/elements/formik/FormikForm.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +12 -20
- package/lib-cjs/component/elements/formik/FormikOnChange.js +13 -10
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSlider.js +7 -10
- package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
- package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +8 -8
- package/lib-cjs/component/elements/popup/Alert/index.js +5 -5
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +16 -31
- package/lib-cjs/component/elements/popup/Modal/index.js +7 -7
- package/lib-cjs/component/header/Header.js +1 -1
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib-cjs/component/hooks/useCombinedRefs.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +14 -11
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +9 -7
- package/lib-cjs/component/loader/DropZone.js +10 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib-cjs/component/modal/PredictSpectraModal.js +5 -5
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib-cjs/component/modal/setting/GeneralSettings.js +11 -14
- package/lib-cjs/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +37 -49
- package/lib-cjs/component/modal/setting/settingsValidation.js +14 -12
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib-cjs/component/panels/InformationPanel.js +51 -55
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -25
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +3 -3
- package/lib-cjs/component/reducer/Reducer.js +12 -11
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +52 -69
- package/lib-cjs/component/reducer/actions/FiltersActions.js +15 -6
- package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
- package/lib-cjs/component/reducer/actions/PeaksActions.js +7 -6
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib-cjs/component/reducer/actions/RangesActions.js +28 -24
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +12 -5
- package/lib-cjs/component/reducer/actions/ToolsActions.js +28 -41
- package/lib-cjs/component/reducer/actions/ZonesActions.js +11 -10
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib-cjs/component/reducer/helper/getActiveSpectrum.js +8 -0
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -5
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +5 -9
- package/lib-cjs/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib-cjs/component/tool/BrushX.js +3 -3
- package/lib-cjs/component/tool/BrushXY.js +5 -5
- package/lib-cjs/component/tool/CrossLinePointer.js +3 -3
- package/lib-cjs/component/toolbar/BasicToolBar.js +8 -7
- package/lib-cjs/component/utility/Evaluate.js +2 -2
- package/lib-cjs/component/utility/FileUtility.js +11 -29
- package/lib-cjs/component/utility/GroupByInfoKey.js +11 -13
- package/lib-cjs/component/utility/PathBuilder.js +1 -1
- package/lib-cjs/component/utility/PreferencesHelper.js +2 -3
- package/lib-cjs/component/utility/{Export.js → export.js} +78 -74
- package/lib-cjs/component/utility/formatNumber.js +5 -4
- package/lib-cjs/component/workspaces/exercise.js +4 -4
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib-cjs/data/Filters.js +17 -35
- package/lib-cjs/data/FiltersManager.js +4 -3
- package/lib-cjs/data/PredictionManager.js +8 -10
- package/lib-cjs/data/SpectraManager.js +26 -62
- package/lib-cjs/data/data1d/MultipleAnalysis.js +74 -70
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/index.js +25 -25
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib-cjs/data/data1d/database.js +45 -28
- package/lib-cjs/data/data1d/filter1d/apodization.js +2 -1
- package/lib-cjs/data/data1d/filter1d/fft.js +23 -6
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +10 -4
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Processing2D.js +10 -20
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +138 -0
- package/lib-cjs/data/data2d/Spectrum2D/index.js +11 -11
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/RangeUtilities.js +13 -9
- package/lib-cjs/data/utilities/ZoneUtilities.js +17 -13
- package/lib-cjs/data/utilities/calculateSanPlot.js +35 -0
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib-cjs/data/utilities/generateChar.js +8 -6
- package/lib-cjs/data/utilities/getAtom.js +1 -1
- package/lib-cjs/data/utilities/getAtomsFromMF.js +2 -2
- package/lib-cjs/data/utilities/getColor.js +3 -3
- package/lib-cjs/data/utilities/getSum.js +6 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +36 -31
- package/lib/component/1d/IntegralResizable.js +0 -72
- package/lib/component/elements/popup/helpers.d.ts +0 -1
- package/lib/component/elements/popup/helpers.js +0 -9
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.js +0 -8
- package/lib/data/data1d/Data1DManager.d.ts +0 -3
- package/lib/data/data1d/Data1DManager.js +0 -98
- package/lib/data/data1d/filter1d/absolute.d.ts +0 -13
- package/lib/data/data1d/filter1d/absolute.js +0 -26
- package/lib/data/data2d/Data2DManager.d.ts +0 -3
- package/lib/data/data2d/Data2DManager.js +0 -34
- package/lib/data/types/data2d/Contour.d.ts +0 -4
- package/lib/data/types/data2d/Contour.js +0 -1
- package/lib/data/types/data2d/Contours.d.ts +0 -2
- package/lib/data/types/data2d/Contours.js +0 -1
- package/lib-cjs/component/1d/IntegralResizable.js +0 -77
- package/lib-cjs/component/elements/popup/helpers.js +0 -13
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +0 -14
- package/lib-cjs/data/data1d/Data1DManager.js +0 -104
- package/lib-cjs/data/data1d/filter1d/absolute.js +0 -32
- package/lib-cjs/data/data2d/Data2DManager.js +0 -40
- package/lib-cjs/data/types/data2d/Contour.js +0 -2
- package/lib-cjs/data/types/data2d/Contours.js +0 -2
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Conrec } from 'ml-conrec';
|
|
2
|
+
import { calculateSanPlot } from '../../utilities/calculateSanPlot';
|
|
3
|
+
const DEFAULT_CONTOURS_OPTIONS = {
|
|
4
|
+
positive: {
|
|
5
|
+
contourLevels: [0, 21],
|
|
6
|
+
numberOfLayers: 10,
|
|
7
|
+
},
|
|
8
|
+
negative: {
|
|
9
|
+
contourLevels: [0, 21],
|
|
10
|
+
numberOfLayers: 10,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
const LEVEL_SIGNS = ['positive', 'negative'];
|
|
14
|
+
function getDefaultContoursLevel(options) {
|
|
15
|
+
const defaultLevel = { negative: 10, positive: 10 };
|
|
16
|
+
for (const sign of LEVEL_SIGNS) {
|
|
17
|
+
const [min, max] = options[sign].contourLevels;
|
|
18
|
+
defaultLevel[sign] = min + max / 2;
|
|
19
|
+
}
|
|
20
|
+
return defaultLevel;
|
|
21
|
+
}
|
|
22
|
+
function contoursManager(spectrumID, state, options) {
|
|
23
|
+
const spectraLevels = { ...state };
|
|
24
|
+
const contourOptions = { ...options };
|
|
25
|
+
if (!state || !state[spectrumID]) {
|
|
26
|
+
const defaultLevel = getDefaultContoursLevel(contourOptions);
|
|
27
|
+
spectraLevels[spectrumID] = defaultLevel;
|
|
28
|
+
}
|
|
29
|
+
const currentLevel = spectraLevels[spectrumID];
|
|
30
|
+
const wheel = (value, shiftKey) => prepareWheel(value, { shiftKey, contourOptions, currentLevel });
|
|
31
|
+
const getLevel = () => currentLevel;
|
|
32
|
+
const checkLevel = () => prepareCheckLevel(currentLevel, contourOptions);
|
|
33
|
+
return { wheel, getLevel, checkLevel };
|
|
34
|
+
}
|
|
35
|
+
function prepareWheel(value, options) {
|
|
36
|
+
let { shiftKey, currentLevel, contourOptions } = options;
|
|
37
|
+
const sign = Math.sign(value);
|
|
38
|
+
const positiveBoundary = contourOptions.positive.contourLevels;
|
|
39
|
+
const negativeBoundary = contourOptions.negative.contourLevels;
|
|
40
|
+
if (shiftKey) {
|
|
41
|
+
if ((currentLevel.positive === positiveBoundary[0] && sign === -1) ||
|
|
42
|
+
(currentLevel.positive >= positiveBoundary[1] && sign === 1)) {
|
|
43
|
+
return currentLevel;
|
|
44
|
+
}
|
|
45
|
+
currentLevel.positive += sign;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
if ((currentLevel.positive > positiveBoundary[0] && sign === -1) ||
|
|
49
|
+
(currentLevel.positive < positiveBoundary[1] && sign === 1)) {
|
|
50
|
+
currentLevel.positive += sign;
|
|
51
|
+
}
|
|
52
|
+
if ((currentLevel.negative > negativeBoundary[0] && sign === -1) ||
|
|
53
|
+
(currentLevel.negative < negativeBoundary[1] && sign === 1)) {
|
|
54
|
+
currentLevel.negative += sign;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return currentLevel;
|
|
58
|
+
}
|
|
59
|
+
function prepareCheckLevel(currentLevel, options) {
|
|
60
|
+
const level = { ...currentLevel };
|
|
61
|
+
for (const sign of LEVEL_SIGNS) {
|
|
62
|
+
const [min, max] = options[sign].contourLevels;
|
|
63
|
+
//check if the level is out of the boundary
|
|
64
|
+
if (level[sign] > max) {
|
|
65
|
+
level[sign] = max;
|
|
66
|
+
}
|
|
67
|
+
else if (level[sign] < min) {
|
|
68
|
+
level[sign] = min;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return level;
|
|
72
|
+
}
|
|
73
|
+
function getRange(min, max, length, exp) {
|
|
74
|
+
if (exp !== undefined) {
|
|
75
|
+
const factors = [];
|
|
76
|
+
factors[0] = 0;
|
|
77
|
+
for (let i = 1; i <= length; i++) {
|
|
78
|
+
factors[i] = factors[i - 1] + (exp - 1) / Math.pow(exp, i);
|
|
79
|
+
}
|
|
80
|
+
const lastFactor = factors[length];
|
|
81
|
+
const result = new Array(length);
|
|
82
|
+
for (let i = 0; i < length; i++) {
|
|
83
|
+
result[i] = (max - min) * (1 - factors[i + 1] / lastFactor) + min;
|
|
84
|
+
}
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
const step = (max - min) / (length - 1);
|
|
89
|
+
return range(min, max + step / 2, step);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function range(from, to, step) {
|
|
93
|
+
const result = [];
|
|
94
|
+
for (let i = from; i < to; i += step) {
|
|
95
|
+
result.push(i);
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
function drawContours(level, datum, negative = false) {
|
|
100
|
+
const zoom = level / 2 + 1;
|
|
101
|
+
const { positive: { numberOfLayers: numberOfPositiveLayer }, negative: { numberOfLayers: numberOfNegativeLayer }, } = datum.display.contourOptions;
|
|
102
|
+
if (negative) {
|
|
103
|
+
return getContours(zoom, {
|
|
104
|
+
negative,
|
|
105
|
+
nbLevels: numberOfNegativeLayer,
|
|
106
|
+
data: datum.data,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return getContours(zoom, {
|
|
110
|
+
nbLevels: numberOfPositiveLayer,
|
|
111
|
+
data: datum.data,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function getContours(zoomLevel, options) {
|
|
115
|
+
const { negative = false, timeout = 2000, nbLevels, data } = options;
|
|
116
|
+
const xs = getRange(data.minX, data.maxX, data.z[0].length);
|
|
117
|
+
const ys = getRange(data.minY, data.maxY, data.z.length);
|
|
118
|
+
const conrec = new Conrec(data.z, { xs, ys, swapAxes: false });
|
|
119
|
+
const sanResult = calculateSanPlot('2D', data);
|
|
120
|
+
const median = sanResult.positive;
|
|
121
|
+
const max = Math.max(Math.abs(data.maxZ), Math.abs(data.minZ));
|
|
122
|
+
let _range = getRange(median * 1 * Math.pow(2, zoomLevel), max, nbLevels, 2);
|
|
123
|
+
if (negative) {
|
|
124
|
+
_range = _range.map((value) => -value);
|
|
125
|
+
}
|
|
126
|
+
return conrec.drawContour({
|
|
127
|
+
contourDrawer: 'basic',
|
|
128
|
+
levels: _range,
|
|
129
|
+
timeout,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
export { drawContours, contoursManager, getDefaultContoursLevel, DEFAULT_CONTOURS_OPTIONS, };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { initiateDatum2D, isSpectrum2D, toJSON, changeZoneSignal, detectZones, detectZonesManual, getMissingProjection, getSlice, updateShift, getShift, };
|
|
1
|
+
export { getMissingProjection } from './getMissingProjection';
|
|
2
|
+
export { getSlice } from './getSlice';
|
|
3
|
+
export { initiateDatum2D } from './initiateDatum2D';
|
|
4
|
+
export { isSpectrum2D } from './isSpectrum2D';
|
|
5
|
+
export { getShift } from './shift/getShift';
|
|
6
|
+
export { updateShift } from './shift/updateShift';
|
|
7
|
+
export { toJSON } from './toJSON';
|
|
8
|
+
export { changeZoneSignal } from './zones/changeZoneSignal';
|
|
9
|
+
export { detectZones } from './zones/detectZones';
|
|
10
|
+
export { detectZonesManual } from './zones/detectZonesManual';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { initiateDatum2D, isSpectrum2D, toJSON, changeZoneSignal, detectZones, detectZonesManual, getMissingProjection, getSlice, updateShift, getShift, };
|
|
1
|
+
export { getMissingProjection } from './getMissingProjection';
|
|
2
|
+
export { getSlice } from './getSlice';
|
|
3
|
+
export { initiateDatum2D } from './initiateDatum2D';
|
|
4
|
+
export { isSpectrum2D } from './isSpectrum2D';
|
|
5
|
+
export { getShift } from './shift/getShift';
|
|
6
|
+
export { updateShift } from './shift/updateShift';
|
|
7
|
+
export { toJSON } from './toJSON';
|
|
8
|
+
export { changeZoneSignal } from './zones/changeZoneSignal';
|
|
9
|
+
export { detectZones } from './zones/detectZones';
|
|
10
|
+
export { detectZonesManual } from './zones/detectZonesManual';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { v4 } from '@lukeed/uuid';
|
|
2
2
|
import * as FiltersManager from '../../FiltersManager';
|
|
3
3
|
import { get2DColor } from '../../utilities/getColor';
|
|
4
|
-
import
|
|
4
|
+
import { DEFAULT_CONTOURS_OPTIONS } from './contours';
|
|
5
5
|
export function initiateDatum2D(options, usedColors = {}) {
|
|
6
6
|
const datum = {};
|
|
7
7
|
datum.id = options.id || v4();
|
|
@@ -10,12 +10,12 @@ export function initiateDatum2D(options, usedColors = {}) {
|
|
|
10
10
|
...options.source,
|
|
11
11
|
};
|
|
12
12
|
datum.display = {
|
|
13
|
-
name: options.display?.name
|
|
13
|
+
name: options.display?.name || v4(),
|
|
14
14
|
...getColor(options, usedColors),
|
|
15
15
|
isPositiveVisible: true,
|
|
16
16
|
isNegativeVisible: true,
|
|
17
17
|
isVisible: true,
|
|
18
|
-
contourOptions:
|
|
18
|
+
contourOptions: DEFAULT_CONTOURS_OPTIONS,
|
|
19
19
|
dimension: 2,
|
|
20
20
|
...options.display,
|
|
21
21
|
};
|
|
@@ -40,7 +40,6 @@ export function initiateDatum2D(options, usedColors = {}) {
|
|
|
40
40
|
datum.originalData = datum.data;
|
|
41
41
|
datum.filters = Object.assign([], options.filters);
|
|
42
42
|
datum.zones = { values: [], options: {}, ...options.zones };
|
|
43
|
-
datum.processingController = new Processing2D(datum.data, datum.display.contourOptions);
|
|
44
43
|
//reapply filters after load the original data
|
|
45
44
|
FiltersManager.reapplyFilters(datum);
|
|
46
45
|
return datum;
|
|
@@ -2,15 +2,14 @@ import * as Filters from '../../../Filters';
|
|
|
2
2
|
export function getShift(datum) {
|
|
3
3
|
let shift = { xShift: 0, yShift: 0 };
|
|
4
4
|
if (datum?.filters) {
|
|
5
|
-
|
|
5
|
+
for (const filter of datum.filters) {
|
|
6
6
|
if (filter.name === Filters.shift2DX.id) {
|
|
7
|
-
|
|
7
|
+
shift.xShift = filter?.flag ? filter.value : 0;
|
|
8
8
|
}
|
|
9
9
|
if (filter.name === Filters.shift2DY.id) {
|
|
10
|
-
|
|
10
|
+
shift.yShift = filter?.flag ? filter.value : 0;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
}, { xShift: 0, yShift: 0 });
|
|
12
|
+
}
|
|
14
13
|
}
|
|
15
14
|
return shift;
|
|
16
15
|
}
|
|
@@ -8,18 +8,23 @@ export function detectZones(datum, options) {
|
|
|
8
8
|
const { minX, maxX, minY, maxY } = datum.data;
|
|
9
9
|
const xError = Math.abs(maxX - minX) / 10000;
|
|
10
10
|
const yError = Math.abs(maxY - minY) / 10000;
|
|
11
|
-
|
|
11
|
+
return zones
|
|
12
|
+
.filter((zone) => {
|
|
12
13
|
const newXRange = zone.x || { from: 0, to: 0 };
|
|
13
14
|
const newYRange = zone.y || { from: 0, to: 0 };
|
|
14
|
-
// check if the zone is already exists
|
|
15
15
|
for (const { x, y } of datum.zones.values) {
|
|
16
16
|
if (Math.abs(newXRange.from - x.from) < xError &&
|
|
17
17
|
Math.abs(newXRange.to - x.to) < xError &&
|
|
18
18
|
Math.abs(newYRange.from - y.from) < yError &&
|
|
19
19
|
Math.abs(newYRange.to - y.to) < yError) {
|
|
20
|
-
return
|
|
20
|
+
return false;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
return true;
|
|
24
|
+
})
|
|
25
|
+
.map((zone) => {
|
|
26
|
+
const newXRange = zone.x || { from: 0, to: 0 };
|
|
27
|
+
const newYRange = zone.y || { from: 0, to: 0 };
|
|
23
28
|
const signals = zone.signals.map((signal) => {
|
|
24
29
|
return {
|
|
25
30
|
id: v4(),
|
|
@@ -35,14 +40,12 @@ export function detectZones(datum, options) {
|
|
|
35
40
|
kind: 'signal',
|
|
36
41
|
};
|
|
37
42
|
});
|
|
38
|
-
|
|
43
|
+
return {
|
|
39
44
|
id: v4(),
|
|
40
45
|
x: { from: newXRange.from, to: newXRange.to },
|
|
41
46
|
y: { from: newYRange.from, to: newYRange.to },
|
|
42
47
|
signals,
|
|
43
48
|
kind: DatumKind.signal,
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
}, []);
|
|
47
|
-
return formattedZones;
|
|
49
|
+
};
|
|
50
|
+
});
|
|
48
51
|
}
|
|
@@ -22,8 +22,7 @@ export function getDetectionZones(datum, options) {
|
|
|
22
22
|
return autoZonesDetection(dataMatrix, { ...options, info: datum.info });
|
|
23
23
|
}
|
|
24
24
|
function autoZonesDetection(data, options) {
|
|
25
|
-
const { thresholdFactor, clean, maxPercentCutOff, convolutionByFFT } = options;
|
|
26
|
-
const { nucleus: nuclei, originFrequency } = options.info;
|
|
25
|
+
const { thresholdFactor, clean, maxPercentCutOff, convolutionByFFT, info: { nucleus: nuclei, originFrequency }, } = options;
|
|
27
26
|
const { enhanceSymmetry = nuclei[0] === nuclei[1] } = options;
|
|
28
27
|
let zones = xyzAutoZonesPicking(data, {
|
|
29
28
|
nuclei,
|
|
@@ -9,7 +9,7 @@ export function fromJSON(mols = []) {
|
|
|
9
9
|
for (let fragment of fragments) {
|
|
10
10
|
molecules.push(initMolecule({
|
|
11
11
|
molfile: fragment.toMolfileV3(),
|
|
12
|
-
label: mol.label
|
|
12
|
+
label: mol.label || `P${getLabelNumber(reservedNumbers)}`,
|
|
13
13
|
id: mol.id,
|
|
14
14
|
}));
|
|
15
15
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export type { Data1D, Datum1D, Display1D, Info1D, Integral, Integrals, Peak, Peaks, Range, Ranges, Signal1D, RangeDetectionResult, };
|
|
1
|
+
export { type Data1D } from './Data1D';
|
|
2
|
+
export { type Datum1D } from './Datum1D';
|
|
3
|
+
export { type Display1D } from './Display1D';
|
|
4
|
+
export { type Info1D } from './Info1D';
|
|
5
|
+
export { type Integral } from './Integral';
|
|
6
|
+
export { type Integrals } from './Integrals';
|
|
7
|
+
export { type Peak } from './Peak';
|
|
8
|
+
export { type Peaks } from './Peaks';
|
|
9
|
+
export { type Range } from './Range';
|
|
10
|
+
export { type RangeDetectionResult } from './RangeDetectionResult';
|
|
11
|
+
export { type Ranges } from './Ranges';
|
|
12
|
+
export { type Signal1D } from './Signal1D';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export type { Zone, Zones, Signal2D, Info2D, Display2D, ContourOptions, Datum2D, Data2D, };
|
|
1
|
+
export { type ContourOptions } from './ContourOptions';
|
|
2
|
+
export { type Data2D } from './Data2D';
|
|
3
|
+
export { type Datum2D } from './Datum2D';
|
|
4
|
+
export { type Display2D } from './Display2D';
|
|
5
|
+
export { type Info2D } from './Info2D';
|
|
6
|
+
export { type Signal2D } from './Signal2D';
|
|
7
|
+
export { type Zone } from './Zone';
|
|
8
|
+
export { type Zones } from './Zones';
|
|
@@ -2,14 +2,18 @@ import omit from 'lodash/omit';
|
|
|
2
2
|
import { DatumKind } from '../constants/SignalsKinds';
|
|
3
3
|
export function getDiaIDs(range) {
|
|
4
4
|
return [].concat(range.diaIDs || [], range.signals
|
|
5
|
-
? range.signals.
|
|
5
|
+
? range.signals.flatMap((_signal) => _signal.diaIDs || [])
|
|
6
6
|
: []);
|
|
7
7
|
}
|
|
8
8
|
export function getNbAtoms(range, signalIndex) {
|
|
9
9
|
if (signalIndex === undefined) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
let sum = 0;
|
|
11
|
+
if (range.signals) {
|
|
12
|
+
for (const signal of range.signals) {
|
|
13
|
+
sum += signal.nbAtoms || 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return sum;
|
|
13
17
|
}
|
|
14
18
|
return range.signals[signalIndex].nbAtoms || 0;
|
|
15
19
|
}
|
|
@@ -67,15 +71,15 @@ export function checkSignalKinds(range, kinds) {
|
|
|
67
71
|
return !range.signals.some((_signal) => _signal.kind === undefined || !kinds.includes(_signal.kind));
|
|
68
72
|
}
|
|
69
73
|
export function unlinkInAssignmentData(assignmentData, ranges) {
|
|
70
|
-
const ids = ranges.
|
|
74
|
+
const ids = ranges.flatMap((range) => {
|
|
71
75
|
if (range.id) {
|
|
72
|
-
|
|
76
|
+
return range.id;
|
|
73
77
|
}
|
|
74
78
|
if (range.signals) {
|
|
75
|
-
|
|
79
|
+
return range.signals.map((signal) => signal.id);
|
|
76
80
|
}
|
|
77
|
-
return
|
|
78
|
-
}
|
|
81
|
+
return [];
|
|
82
|
+
});
|
|
79
83
|
assignmentData.dispatch({
|
|
80
84
|
type: 'REMOVE_ALL',
|
|
81
85
|
payload: { id: ids, axis: 'x' },
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { DatumKind } from '../constants/SignalsKinds';
|
|
2
2
|
export function getDiaIDs(zone, axis) {
|
|
3
3
|
return [].concat(zone[axis].diaIDs || [], zone.signals
|
|
4
|
-
? zone.signals.
|
|
4
|
+
? zone.signals.flatMap((signal) => signal[axis].diaIDs || [])
|
|
5
5
|
: []);
|
|
6
6
|
}
|
|
7
7
|
export function getNbAtoms(zone, axis) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
let sum = 0;
|
|
9
|
+
if (zone.signals) {
|
|
10
|
+
for (const signal of zone.signals) {
|
|
11
|
+
sum += signal[axis].nbAtoms || 0;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return sum;
|
|
11
15
|
}
|
|
12
16
|
export function setNbAtoms(zone, axis) {
|
|
13
17
|
zone[axis].nbAtoms = getNbAtoms(zone, axis);
|
|
@@ -18,10 +22,10 @@ export function setNbAtoms(zone, axis) {
|
|
|
18
22
|
export function resetDiaIDs(zone, axis) {
|
|
19
23
|
delete zone[axis].diaIDs;
|
|
20
24
|
delete zone[axis].nbAtoms;
|
|
21
|
-
zone.signals
|
|
25
|
+
for (const signal of zone.signals) {
|
|
22
26
|
delete signal[axis].diaIDs;
|
|
23
27
|
delete signal[axis].nbAtoms;
|
|
24
|
-
}
|
|
28
|
+
}
|
|
25
29
|
return zone;
|
|
26
30
|
}
|
|
27
31
|
export function checkZoneKind(zone) {
|
|
@@ -49,23 +53,23 @@ export function unlink(zone, isOnZoneLevel, signalIndex, axis) {
|
|
|
49
53
|
setNbAtoms(zone, axis);
|
|
50
54
|
}
|
|
51
55
|
else {
|
|
52
|
-
['x', 'y']
|
|
56
|
+
for (const key of ['x', 'y']) {
|
|
53
57
|
resetDiaIDs(zone, key);
|
|
54
58
|
setNbAtoms(zone, key);
|
|
55
|
-
}
|
|
59
|
+
}
|
|
56
60
|
}
|
|
57
61
|
return zone;
|
|
58
62
|
}
|
|
59
63
|
export function unlinkInAssignmentData(assignmentData, zones, axis) {
|
|
60
|
-
const ids = zones.
|
|
64
|
+
const ids = zones.flatMap((zone) => {
|
|
61
65
|
if (zone.id) {
|
|
62
|
-
|
|
66
|
+
return zone.id;
|
|
63
67
|
}
|
|
64
68
|
if (zone.signals) {
|
|
65
|
-
|
|
69
|
+
return zone.signals.map((signal) => signal.id);
|
|
66
70
|
}
|
|
67
|
-
return
|
|
68
|
-
}
|
|
71
|
+
return [];
|
|
72
|
+
});
|
|
69
73
|
if (axis) {
|
|
70
74
|
assignmentData.dispatch({
|
|
71
75
|
type: 'REMOVE_ALL',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Data1D } from '../types/data1d';
|
|
2
|
+
import { Data2D } from '../types/data2d';
|
|
3
|
+
export declare function calculateSanPlot<T extends '1D' | '2D'>(dimension: T, data: T extends '1D' ? Data1D : Data2D): {
|
|
4
|
+
positive: number;
|
|
5
|
+
negative: number;
|
|
6
|
+
snr: number;
|
|
7
|
+
sanplot: Record<string, import("cheminfo-types").DataXY<import("cheminfo-types").DoubleArray>>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { xNoiseSanPlot } from 'ml-spectra-processing';
|
|
2
|
+
export function calculateSanPlot(dimension, data) {
|
|
3
|
+
const input = dimension === '1D'
|
|
4
|
+
? prepare1DData(data)
|
|
5
|
+
: prepare2DData(data);
|
|
6
|
+
return xNoiseSanPlot(input);
|
|
7
|
+
}
|
|
8
|
+
function prepare1DData(data) {
|
|
9
|
+
const length = data.re.length;
|
|
10
|
+
const jump = Math.floor(length / 307200) || 1;
|
|
11
|
+
const array = new Float64Array((length / jump) >> 0);
|
|
12
|
+
let index = 0;
|
|
13
|
+
for (let i = 0; i < array.length; i += jump) {
|
|
14
|
+
array[index++] = data.re[i];
|
|
15
|
+
}
|
|
16
|
+
return array;
|
|
17
|
+
}
|
|
18
|
+
function prepare2DData(data) {
|
|
19
|
+
let cols = data.z[0].length;
|
|
20
|
+
let rows = data.z.length;
|
|
21
|
+
let jump = Math.floor((cols * rows) / 204800) || 1;
|
|
22
|
+
const array = new Float64Array(((cols * rows) / jump) >> 0);
|
|
23
|
+
let index = 0;
|
|
24
|
+
// console.log('jump', jump, cols * rows);
|
|
25
|
+
for (let r = 0; r < rows; r += 1) {
|
|
26
|
+
for (let c = 0; c < cols; c += jump) {
|
|
27
|
+
array[index++] = data.z[r][c];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return array;
|
|
31
|
+
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export default function generateChar(index) {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
// a
|
|
3
|
+
const aPosition = 97;
|
|
4
|
+
// z
|
|
5
|
+
const zPosition = 122;
|
|
6
|
+
const len = zPosition - aPosition + 1;
|
|
7
|
+
let charResult = '';
|
|
6
8
|
while (index >= 0) {
|
|
7
|
-
|
|
9
|
+
charResult = String.fromCodePoint((index % len) + aPosition) + charResult;
|
|
8
10
|
index = Math.floor(index / len) - 1;
|
|
9
11
|
}
|
|
10
|
-
return
|
|
12
|
+
return charResult;
|
|
11
13
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const mfCheck = /^(?:[A-Z][a-z]?\d* *)+$/;
|
|
2
2
|
export default function getAtomsFromMF(mf) {
|
|
3
3
|
if (!mfCheck.test(mf)) {
|
|
4
|
-
throw Error(`MF can not be parsed: ${mf}`);
|
|
4
|
+
throw new Error(`MF can not be parsed: ${mf}`);
|
|
5
5
|
}
|
|
6
6
|
const atoms = {};
|
|
7
|
-
const parts = mf.matchAll(/(?<atom>[A-Z][a-z]?)(?<number
|
|
7
|
+
const parts = mf.matchAll(/(?<atom>[A-Z][a-z]?)(?<number>\d*)/g);
|
|
8
8
|
for (const part of parts) {
|
|
9
9
|
const { atom, number } = part.groups;
|
|
10
10
|
if (!atoms[atom]) {
|
|
@@ -52,16 +52,16 @@ export default function getColor(isRandom = false, usedColors = [], opacity = 10
|
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
54
|
const lum = -0.25;
|
|
55
|
-
let hex = String(`#${Math.random().toString(16).slice(2, 8).toUpperCase()}`).replace(/[
|
|
55
|
+
let hex = String(`#${Math.random().toString(16).slice(2, 8).toUpperCase()}`).replace(/[^\da-f]/gi, '');
|
|
56
56
|
if (hex.length < 6) {
|
|
57
57
|
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
|
|
58
58
|
}
|
|
59
59
|
let rgb = '#';
|
|
60
60
|
let c;
|
|
61
61
|
for (let i = 0; i < 3; i++) {
|
|
62
|
-
c = parseInt(hex.
|
|
62
|
+
c = Number.parseInt(hex.slice(i * 2, i * 2 + 2), 16);
|
|
63
63
|
c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16);
|
|
64
|
-
rgb += `00${c}`.
|
|
64
|
+
rgb += `00${c}`.slice(c.length);
|
|
65
65
|
}
|
|
66
66
|
return rgb + percentToHex(opacity);
|
|
67
67
|
}
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
* @returns number
|
|
7
7
|
*/
|
|
8
8
|
export function getSum(values, key, check = null) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
let sum = 0;
|
|
10
|
+
for (const current of values) {
|
|
11
|
+
if (check?.(current))
|
|
12
|
+
sum += Math.abs(current[key]);
|
|
13
|
+
}
|
|
14
|
+
return sum;
|
|
12
15
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SplitPaneSize } from 'analysis-ui-components';
|
|
2
2
|
import { PanelPreferencesType } from './PanelPreferencesType';
|
|
3
3
|
export interface NMRiumGeneralPreferences {
|
|
4
4
|
hideGeneralSettings: boolean;
|
|
5
5
|
experimentalFeatures: PanelPreferencesType;
|
|
6
6
|
hidePanelOnLoad: boolean;
|
|
7
|
-
initialPanelWidth?:
|
|
7
|
+
initialPanelWidth?: SplitPaneSize;
|
|
8
8
|
}
|
package/lib/versionInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default { version: '
|
|
1
|
+
export default { version: 'HEAD' };
|
|
@@ -7,10 +7,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const FloatMoleculeStructures_1 = __importDefault(require("../tool/FloatMoleculeStructures"));
|
|
8
8
|
const ApodizationLine_1 = __importDefault(require("./ApodizationLine"));
|
|
9
9
|
const ExclusionZonesAnnotations_1 = __importDefault(require("./ExclusionZonesAnnotations"));
|
|
10
|
-
const IntegralsSeries_1 = __importDefault(require("./IntegralsSeries"));
|
|
11
10
|
const LinesSeries_1 = __importDefault(require("./LinesSeries"));
|
|
12
11
|
const XAxis_1 = __importDefault(require("./XAxis"));
|
|
13
12
|
const DatabaseElements_1 = __importDefault(require("./database/DatabaseElements"));
|
|
13
|
+
const IntegralsSeries_1 = __importDefault(require("./integral/IntegralsSeries"));
|
|
14
14
|
const JGraph_1 = __importDefault(require("./jCouplingGraph/JGraph"));
|
|
15
15
|
const MultiAnalysisRanges_1 = __importDefault(require("./multiAnalysis/MultiAnalysisRanges"));
|
|
16
16
|
const PeakAnnotations_1 = __importDefault(require("./peaks/PeakAnnotations"));
|