nmrium 0.32.0 → 0.33.0-pre.1667755480
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/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/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/KeysListenerTracker.js +14 -15
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +6 -6
- 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.js +3 -5
- 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/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 +4 -4
- 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/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/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 +40 -14
- package/lib/component/reducer/Reducer.js +12 -11
- 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 +49 -67
- package/lib/component/reducer/actions/FiltersActions.js +3 -3
- package/lib/component/reducer/actions/HistoryActions.js +5 -5
- package/lib/component/reducer/actions/LoadActions.js +12 -0
- package/lib/component/reducer/actions/PreferencesActions.js +18 -37
- package/lib/component/reducer/actions/RangesActions.js +14 -12
- package/lib/component/reducer/actions/SpectrumsActions.js +10 -4
- package/lib/component/reducer/actions/ToolsActions.js +20 -35
- package/lib/component/reducer/actions/ZonesActions.js +2 -2
- 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/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/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 +1 -1
- 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} +53 -78
- package/lib/component/utility/formatNumber.d.ts +6 -1
- package/lib/component/utility/formatNumber.js +5 -4
- package/lib/data/Filters.d.ts +16 -17
- package/lib/data/Filters.js +16 -17
- 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 +2 -2
- 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 +7 -18
- 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/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/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- 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/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/KeysListenerTracker.js +14 -15
- package/lib-cjs/component/NMRium.js +7 -7
- 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 +3 -5
- 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/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 +4 -4
- 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/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/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 +11 -10
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +49 -67
- package/lib-cjs/component/reducer/actions/FiltersActions.js +3 -3
- package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
- package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +18 -37
- package/lib-cjs/component/reducer/actions/RangesActions.js +14 -12
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +9 -3
- package/lib-cjs/component/reducer/actions/ToolsActions.js +20 -35
- package/lib-cjs/component/reducer/actions/ZonesActions.js +2 -2
- 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/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 +1 -1
- 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} +77 -79
- package/lib-cjs/component/utility/formatNumber.js +5 -4
- package/lib-cjs/data/Filters.js +17 -33
- 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 +2 -2
- 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 +7 -18
- 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/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 +30 -26
- 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/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/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
|
@@ -14,19 +14,22 @@ function apply(datum1D) {
|
|
|
14
14
|
throw new Error('fft not applicable on this data');
|
|
15
15
|
}
|
|
16
16
|
let digitalFilterApplied = datum1D.filters.some((e) => e.name === 'digitalFilter' && e.flag);
|
|
17
|
-
const
|
|
17
|
+
const data = datum1D.meta.AQ_mod === 1
|
|
18
|
+
? removeDCOffset(datum1D, digitalFilterApplied)
|
|
19
|
+
: { ...datum1D.data };
|
|
18
20
|
if (data.x.length !== data.re.length || data.x.length !== data.im.length) {
|
|
19
21
|
throw new Error('The length of data should be equal');
|
|
20
22
|
}
|
|
21
23
|
else if (!isPowerOfTwo(datum1D.data.x.length)) {
|
|
22
24
|
(0, padDataToNextPowerOfTwo_1.padDataToNextPowerOfTwo)(datum1D, digitalFilterApplied);
|
|
23
25
|
}
|
|
24
|
-
Object.assign(
|
|
26
|
+
Object.assign(data, (0, ml_spectra_processing_1.reimFFT)(data, { applyZeroShift: true }));
|
|
25
27
|
if (digitalFilterApplied) {
|
|
26
28
|
let { digitalFilter = 0 } = datum1D.info;
|
|
27
29
|
let ph1 = (digitalFilter - Math.floor(digitalFilter)) * Math.PI * 2;
|
|
28
|
-
Object.assign(
|
|
30
|
+
Object.assign(data, (0, ml_spectra_processing_1.reimPhaseCorrection)(data, 0, ph1));
|
|
29
31
|
}
|
|
32
|
+
Object.assign(datum1D.data, data);
|
|
30
33
|
datum1D.data.x = generateXAxis(datum1D);
|
|
31
34
|
datum1D.info = { ...datum1D.info, isFid: false, isFt: true };
|
|
32
35
|
}
|
|
@@ -46,9 +49,9 @@ function reduce() {
|
|
|
46
49
|
exports.reduce = reduce;
|
|
47
50
|
function generateXAxis(datum1D) {
|
|
48
51
|
const info = datum1D.info;
|
|
49
|
-
const baseFrequency = parseFloat(info.baseFrequency);
|
|
50
|
-
const frequencyOffset = parseFloat(info.frequencyOffset);
|
|
51
|
-
const spectralWidth = parseFloat(info.spectralWidth);
|
|
52
|
+
const baseFrequency = Number.parseFloat(info.baseFrequency);
|
|
53
|
+
const frequencyOffset = Number.parseFloat(info.frequencyOffset);
|
|
54
|
+
const spectralWidth = Number.parseFloat(info.spectralWidth);
|
|
52
55
|
const offset = frequencyOffset / baseFrequency;
|
|
53
56
|
let spectralHalfWidth = 0.5 * spectralWidth;
|
|
54
57
|
let nbPoints = datum1D.data.x.length;
|
|
@@ -64,3 +67,17 @@ function generateXAxis(datum1D) {
|
|
|
64
67
|
function isPowerOfTwo(n) {
|
|
65
68
|
return n !== 0 && (n & (n - 1)) === 0;
|
|
66
69
|
}
|
|
70
|
+
function removeDCOffset(datum1D, digitalFilterApplied) {
|
|
71
|
+
let { digitalFilter = 0 } = digitalFilterApplied ? datum1D.info : {};
|
|
72
|
+
const data = { ...datum1D.data };
|
|
73
|
+
const nbPoints = data.re.length;
|
|
74
|
+
const newRe = new Float64Array(data.re);
|
|
75
|
+
const newIm = new Float64Array(data.im);
|
|
76
|
+
const averageRe = (0, ml_spectra_processing_1.xMean)(data.re.slice((nbPoints * 0.75) >> 0, nbPoints - digitalFilter));
|
|
77
|
+
const averageIm = (0, ml_spectra_processing_1.xMean)(data.im.slice((nbPoints * 0.75) >> 0, nbPoints - digitalFilter));
|
|
78
|
+
for (let i = digitalFilterApplied ? 0 : digitalFilter; i < nbPoints - digitalFilter; i++) {
|
|
79
|
+
newRe[i] -= averageRe;
|
|
80
|
+
newIm[i] -= averageIm;
|
|
81
|
+
}
|
|
82
|
+
return { x: data.x, re: newRe, im: newIm };
|
|
83
|
+
}
|
|
@@ -21,8 +21,8 @@ function apply(datum1D, options = {}) {
|
|
|
21
21
|
datum1D.data.im = new Float64Array(0);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
|
-
ph0 *= Math.PI / 180
|
|
25
|
-
ph1 *= Math.PI / 180
|
|
24
|
+
ph0 *= Math.PI / 180;
|
|
25
|
+
ph1 *= Math.PI / 180;
|
|
26
26
|
Object.assign(datum1D.data, (0, ml_spectra_processing_1.reimPhaseCorrection)(datum1D.data, ph0, ph1));
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -19,7 +19,7 @@ function padDataToNextPowerOfTwo(datum1D, digitalFilterApplied) {
|
|
|
19
19
|
size,
|
|
20
20
|
step: x[1] - x[0],
|
|
21
21
|
});
|
|
22
|
-
datum1D.data = { ...datum1D.data,
|
|
22
|
+
datum1D.data = { ...datum1D.data, re: newRE, im: newIM, x: newX };
|
|
23
23
|
}
|
|
24
24
|
exports.padDataToNextPowerOfTwo = padDataToNextPowerOfTwo;
|
|
25
25
|
function getPointsToShift(datum1D) {
|
|
@@ -39,7 +39,7 @@ function apply(datum1D, size) {
|
|
|
39
39
|
newRE.set(re.slice(re.length - pointsToShift), size - pointsToShift);
|
|
40
40
|
newIM.set(im.slice(re.length - pointsToShift), size - pointsToShift);
|
|
41
41
|
}
|
|
42
|
-
datum1D.data = { ...datum1D.data,
|
|
42
|
+
datum1D.data = { ...datum1D.data, re: newRE, im: newIM, x: newX };
|
|
43
43
|
}
|
|
44
44
|
exports.apply = apply;
|
|
45
45
|
function isApplicable(datum1D) {
|
|
@@ -14,12 +14,9 @@ exports.defaultContourOptions = {
|
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
16
|
class Processing2D {
|
|
17
|
-
constructor(minMax, options = exports.defaultContourOptions, defaultLevel = {
|
|
18
|
-
positive: 10,
|
|
19
|
-
negative: 10,
|
|
20
|
-
}) {
|
|
17
|
+
constructor(minMax, options = exports.defaultContourOptions, defaultLevel = {}) {
|
|
21
18
|
this.options = options;
|
|
22
|
-
const { positive, negative } = defaultLevel;
|
|
19
|
+
const { positive = 10, negative = 10 } = defaultLevel;
|
|
23
20
|
this.currentLevelPositive = positive;
|
|
24
21
|
this.currentLevelNegative = negative;
|
|
25
22
|
const xs = getRange(minMax.minX, minMax.maxX, minMax.z[0].length);
|
|
@@ -100,19 +97,11 @@ class Processing2D {
|
|
|
100
97
|
if (negative) {
|
|
101
98
|
_range = _range.map((value) => -value);
|
|
102
99
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
timeout,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
catch (e) {
|
|
112
|
-
// eslint-disable-next-line no-console
|
|
113
|
-
console.log(e);
|
|
114
|
-
throw e;
|
|
115
|
-
}
|
|
100
|
+
const contours = this.conrec.drawContour({
|
|
101
|
+
contourDrawer: 'basic',
|
|
102
|
+
levels: _range,
|
|
103
|
+
timeout,
|
|
104
|
+
});
|
|
116
105
|
return Object.freeze(contours);
|
|
117
106
|
}
|
|
118
107
|
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_CONTOURS_OPTIONS = exports.getDefaultContoursLevel = exports.contoursManager = exports.drawContours = void 0;
|
|
4
|
+
const ml_conrec_1 = require("ml-conrec");
|
|
5
|
+
const calculateSanPlot_1 = require("../../utilities/calculateSanPlot");
|
|
6
|
+
const DEFAULT_CONTOURS_OPTIONS = {
|
|
7
|
+
positive: {
|
|
8
|
+
contourLevels: [0, 21],
|
|
9
|
+
numberOfLayers: 10,
|
|
10
|
+
},
|
|
11
|
+
negative: {
|
|
12
|
+
contourLevels: [0, 21],
|
|
13
|
+
numberOfLayers: 10,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
exports.DEFAULT_CONTOURS_OPTIONS = DEFAULT_CONTOURS_OPTIONS;
|
|
17
|
+
const LEVEL_SIGNS = ['positive', 'negative'];
|
|
18
|
+
function getDefaultContoursLevel(options) {
|
|
19
|
+
const defaultLevel = { negative: 10, positive: 10 };
|
|
20
|
+
for (const sign of LEVEL_SIGNS) {
|
|
21
|
+
const [min, max] = options[sign].contourLevels;
|
|
22
|
+
defaultLevel[sign] = min + max / 2;
|
|
23
|
+
}
|
|
24
|
+
return defaultLevel;
|
|
25
|
+
}
|
|
26
|
+
exports.getDefaultContoursLevel = getDefaultContoursLevel;
|
|
27
|
+
function contoursManager(spectrumID, state, options) {
|
|
28
|
+
const spectraLevels = { ...state };
|
|
29
|
+
const contourOptions = { ...options };
|
|
30
|
+
if (!state || !state[spectrumID]) {
|
|
31
|
+
const defaultLevel = getDefaultContoursLevel(contourOptions);
|
|
32
|
+
spectraLevels[spectrumID] = defaultLevel;
|
|
33
|
+
}
|
|
34
|
+
const currentLevel = spectraLevels[spectrumID];
|
|
35
|
+
const wheel = (value, shiftKey) => prepareWheel(value, { shiftKey, contourOptions, currentLevel });
|
|
36
|
+
const getLevel = () => currentLevel;
|
|
37
|
+
const checkLevel = () => prepareCheckLevel(currentLevel, contourOptions);
|
|
38
|
+
return { wheel, getLevel, checkLevel };
|
|
39
|
+
}
|
|
40
|
+
exports.contoursManager = contoursManager;
|
|
41
|
+
function prepareWheel(value, options) {
|
|
42
|
+
let { shiftKey, currentLevel, contourOptions } = options;
|
|
43
|
+
const sign = Math.sign(value);
|
|
44
|
+
const positiveBoundary = contourOptions.positive.contourLevels;
|
|
45
|
+
const negativeBoundary = contourOptions.negative.contourLevels;
|
|
46
|
+
if (shiftKey) {
|
|
47
|
+
if ((currentLevel.positive === positiveBoundary[0] && sign === -1) ||
|
|
48
|
+
(currentLevel.positive >= positiveBoundary[1] && sign === 1)) {
|
|
49
|
+
return currentLevel;
|
|
50
|
+
}
|
|
51
|
+
currentLevel.positive += sign;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
if ((currentLevel.positive > positiveBoundary[0] && sign === -1) ||
|
|
55
|
+
(currentLevel.positive < positiveBoundary[1] && sign === 1)) {
|
|
56
|
+
currentLevel.positive += sign;
|
|
57
|
+
}
|
|
58
|
+
if ((currentLevel.negative > negativeBoundary[0] && sign === -1) ||
|
|
59
|
+
(currentLevel.negative < negativeBoundary[1] && sign === 1)) {
|
|
60
|
+
currentLevel.negative += sign;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return currentLevel;
|
|
64
|
+
}
|
|
65
|
+
function prepareCheckLevel(currentLevel, options) {
|
|
66
|
+
const level = { ...currentLevel };
|
|
67
|
+
for (const sign of LEVEL_SIGNS) {
|
|
68
|
+
const [min, max] = options[sign].contourLevels;
|
|
69
|
+
//check if the level is out of the boundary
|
|
70
|
+
if (level[sign] > max) {
|
|
71
|
+
level[sign] = max;
|
|
72
|
+
}
|
|
73
|
+
else if (level[sign] < min) {
|
|
74
|
+
level[sign] = min;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return level;
|
|
78
|
+
}
|
|
79
|
+
function getRange(min, max, length, exp) {
|
|
80
|
+
if (exp !== undefined) {
|
|
81
|
+
const factors = [];
|
|
82
|
+
factors[0] = 0;
|
|
83
|
+
for (let i = 1; i <= length; i++) {
|
|
84
|
+
factors[i] = factors[i - 1] + (exp - 1) / Math.pow(exp, i);
|
|
85
|
+
}
|
|
86
|
+
const lastFactor = factors[length];
|
|
87
|
+
const result = new Array(length);
|
|
88
|
+
for (let i = 0; i < length; i++) {
|
|
89
|
+
result[i] = (max - min) * (1 - factors[i + 1] / lastFactor) + min;
|
|
90
|
+
}
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
const step = (max - min) / (length - 1);
|
|
95
|
+
return range(min, max + step / 2, step);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function range(from, to, step) {
|
|
99
|
+
const result = [];
|
|
100
|
+
for (let i = from; i < to; i += step) {
|
|
101
|
+
result.push(i);
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
function drawContours(level, datum, negative = false) {
|
|
106
|
+
const zoom = level / 2 + 1;
|
|
107
|
+
const { positive: { numberOfLayers: numberOfPositiveLayer }, negative: { numberOfLayers: numberOfNegativeLayer }, } = datum.display.contourOptions;
|
|
108
|
+
if (negative) {
|
|
109
|
+
return getContours(zoom, {
|
|
110
|
+
negative,
|
|
111
|
+
nbLevels: numberOfNegativeLayer,
|
|
112
|
+
data: datum.data,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return getContours(zoom, {
|
|
116
|
+
nbLevels: numberOfPositiveLayer,
|
|
117
|
+
data: datum.data,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
exports.drawContours = drawContours;
|
|
121
|
+
function getContours(zoomLevel, options) {
|
|
122
|
+
const { negative = false, timeout = 2000, nbLevels, data } = options;
|
|
123
|
+
const xs = getRange(data.minX, data.maxX, data.z[0].length);
|
|
124
|
+
const ys = getRange(data.minY, data.maxY, data.z.length);
|
|
125
|
+
const conrec = new ml_conrec_1.Conrec(data.z, { xs, ys, swapAxes: false });
|
|
126
|
+
const sanResult = (0, calculateSanPlot_1.calculateSanPlot)('2D', data);
|
|
127
|
+
const median = sanResult.positive;
|
|
128
|
+
const max = Math.max(Math.abs(data.maxZ), Math.abs(data.minZ));
|
|
129
|
+
let _range = getRange(median * 1 * Math.pow(2, zoomLevel), max, nbLevels, 2);
|
|
130
|
+
if (negative) {
|
|
131
|
+
_range = _range.map((value) => -value);
|
|
132
|
+
}
|
|
133
|
+
return conrec.drawContour({
|
|
134
|
+
contourDrawer: 'basic',
|
|
135
|
+
levels: _range,
|
|
136
|
+
timeout,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
3
|
+
exports.detectZonesManual = exports.detectZones = exports.changeZoneSignal = exports.toJSON = exports.updateShift = exports.getShift = exports.isSpectrum2D = exports.initiateDatum2D = exports.getSlice = exports.getMissingProjection = void 0;
|
|
4
|
+
var getMissingProjection_1 = require("./getMissingProjection");
|
|
5
5
|
Object.defineProperty(exports, "getMissingProjection", { enumerable: true, get: function () { return getMissingProjection_1.getMissingProjection; } });
|
|
6
|
-
|
|
6
|
+
var getSlice_1 = require("./getSlice");
|
|
7
7
|
Object.defineProperty(exports, "getSlice", { enumerable: true, get: function () { return getSlice_1.getSlice; } });
|
|
8
|
-
|
|
8
|
+
var initiateDatum2D_1 = require("./initiateDatum2D");
|
|
9
9
|
Object.defineProperty(exports, "initiateDatum2D", { enumerable: true, get: function () { return initiateDatum2D_1.initiateDatum2D; } });
|
|
10
|
-
|
|
10
|
+
var isSpectrum2D_1 = require("./isSpectrum2D");
|
|
11
11
|
Object.defineProperty(exports, "isSpectrum2D", { enumerable: true, get: function () { return isSpectrum2D_1.isSpectrum2D; } });
|
|
12
|
-
|
|
12
|
+
var getShift_1 = require("./shift/getShift");
|
|
13
13
|
Object.defineProperty(exports, "getShift", { enumerable: true, get: function () { return getShift_1.getShift; } });
|
|
14
|
-
|
|
14
|
+
var updateShift_1 = require("./shift/updateShift");
|
|
15
15
|
Object.defineProperty(exports, "updateShift", { enumerable: true, get: function () { return updateShift_1.updateShift; } });
|
|
16
|
-
|
|
16
|
+
var toJSON_1 = require("./toJSON");
|
|
17
17
|
Object.defineProperty(exports, "toJSON", { enumerable: true, get: function () { return toJSON_1.toJSON; } });
|
|
18
|
-
|
|
18
|
+
var changeZoneSignal_1 = require("./zones/changeZoneSignal");
|
|
19
19
|
Object.defineProperty(exports, "changeZoneSignal", { enumerable: true, get: function () { return changeZoneSignal_1.changeZoneSignal; } });
|
|
20
|
-
|
|
20
|
+
var detectZones_1 = require("./zones/detectZones");
|
|
21
21
|
Object.defineProperty(exports, "detectZones", { enumerable: true, get: function () { return detectZones_1.detectZones; } });
|
|
22
|
-
|
|
22
|
+
var detectZonesManual_1 = require("./zones/detectZonesManual");
|
|
23
23
|
Object.defineProperty(exports, "detectZonesManual", { enumerable: true, get: function () { return detectZonesManual_1.detectZonesManual; } });
|
|
@@ -27,7 +27,7 @@ exports.initiateDatum2D = void 0;
|
|
|
27
27
|
const uuid_1 = require("@lukeed/uuid");
|
|
28
28
|
const FiltersManager = __importStar(require("../../FiltersManager"));
|
|
29
29
|
const getColor_1 = require("../../utilities/getColor");
|
|
30
|
-
const
|
|
30
|
+
const contours_1 = require("./contours");
|
|
31
31
|
function initiateDatum2D(options, usedColors = {}) {
|
|
32
32
|
const datum = {};
|
|
33
33
|
datum.id = options.id || (0, uuid_1.v4)();
|
|
@@ -36,12 +36,12 @@ function initiateDatum2D(options, usedColors = {}) {
|
|
|
36
36
|
...options.source,
|
|
37
37
|
};
|
|
38
38
|
datum.display = {
|
|
39
|
-
name: options.display?.name
|
|
39
|
+
name: options.display?.name || (0, uuid_1.v4)(),
|
|
40
40
|
...getColor(options, usedColors),
|
|
41
41
|
isPositiveVisible: true,
|
|
42
42
|
isNegativeVisible: true,
|
|
43
43
|
isVisible: true,
|
|
44
|
-
contourOptions:
|
|
44
|
+
contourOptions: contours_1.DEFAULT_CONTOURS_OPTIONS,
|
|
45
45
|
dimension: 2,
|
|
46
46
|
...options.display,
|
|
47
47
|
};
|
|
@@ -66,7 +66,6 @@ function initiateDatum2D(options, usedColors = {}) {
|
|
|
66
66
|
datum.originalData = datum.data;
|
|
67
67
|
datum.filters = Object.assign([], options.filters);
|
|
68
68
|
datum.zones = { values: [], options: {}, ...options.zones };
|
|
69
|
-
datum.processingController = new Processing2D_1.default(datum.data, datum.display.contourOptions);
|
|
70
69
|
//reapply filters after load the original data
|
|
71
70
|
FiltersManager.reapplyFilters(datum);
|
|
72
71
|
return datum;
|
|
@@ -28,15 +28,14 @@ const Filters = __importStar(require("../../../Filters"));
|
|
|
28
28
|
function getShift(datum) {
|
|
29
29
|
let shift = { xShift: 0, yShift: 0 };
|
|
30
30
|
if (datum?.filters) {
|
|
31
|
-
|
|
31
|
+
for (const filter of datum.filters) {
|
|
32
32
|
if (filter.name === Filters.shift2DX.id) {
|
|
33
|
-
|
|
33
|
+
shift.xShift = filter?.flag ? filter.value : 0;
|
|
34
34
|
}
|
|
35
35
|
if (filter.name === Filters.shift2DY.id) {
|
|
36
|
-
|
|
36
|
+
shift.yShift = filter?.flag ? filter.value : 0;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
}, { xShift: 0, yShift: 0 });
|
|
38
|
+
}
|
|
40
39
|
}
|
|
41
40
|
return shift;
|
|
42
41
|
}
|
|
@@ -11,18 +11,23 @@ function detectZones(datum, options) {
|
|
|
11
11
|
const { minX, maxX, minY, maxY } = datum.data;
|
|
12
12
|
const xError = Math.abs(maxX - minX) / 10000;
|
|
13
13
|
const yError = Math.abs(maxY - minY) / 10000;
|
|
14
|
-
|
|
14
|
+
return zones
|
|
15
|
+
.filter((zone) => {
|
|
15
16
|
const newXRange = zone.x || { from: 0, to: 0 };
|
|
16
17
|
const newYRange = zone.y || { from: 0, to: 0 };
|
|
17
|
-
// check if the zone is already exists
|
|
18
18
|
for (const { x, y } of datum.zones.values) {
|
|
19
19
|
if (Math.abs(newXRange.from - x.from) < xError &&
|
|
20
20
|
Math.abs(newXRange.to - x.to) < xError &&
|
|
21
21
|
Math.abs(newYRange.from - y.from) < yError &&
|
|
22
22
|
Math.abs(newYRange.to - y.to) < yError) {
|
|
23
|
-
return
|
|
23
|
+
return false;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
+
return true;
|
|
27
|
+
})
|
|
28
|
+
.map((zone) => {
|
|
29
|
+
const newXRange = zone.x || { from: 0, to: 0 };
|
|
30
|
+
const newYRange = zone.y || { from: 0, to: 0 };
|
|
26
31
|
const signals = zone.signals.map((signal) => {
|
|
27
32
|
return {
|
|
28
33
|
id: (0, uuid_1.v4)(),
|
|
@@ -38,15 +43,13 @@ function detectZones(datum, options) {
|
|
|
38
43
|
kind: 'signal',
|
|
39
44
|
};
|
|
40
45
|
});
|
|
41
|
-
|
|
46
|
+
return {
|
|
42
47
|
id: (0, uuid_1.v4)(),
|
|
43
48
|
x: { from: newXRange.from, to: newXRange.to },
|
|
44
49
|
y: { from: newYRange.from, to: newYRange.to },
|
|
45
50
|
signals,
|
|
46
51
|
kind: SignalsKinds_1.DatumKind.signal,
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
}, []);
|
|
50
|
-
return formattedZones;
|
|
52
|
+
};
|
|
53
|
+
});
|
|
51
54
|
}
|
|
52
55
|
exports.detectZones = detectZones;
|
|
@@ -26,8 +26,7 @@ function getDetectionZones(datum, options) {
|
|
|
26
26
|
}
|
|
27
27
|
exports.getDetectionZones = getDetectionZones;
|
|
28
28
|
function autoZonesDetection(data, options) {
|
|
29
|
-
const { thresholdFactor, clean, maxPercentCutOff, convolutionByFFT } = options;
|
|
30
|
-
const { nucleus: nuclei, originFrequency } = options.info;
|
|
29
|
+
const { thresholdFactor, clean, maxPercentCutOff, convolutionByFFT, info: { nucleus: nuclei, originFrequency }, } = options;
|
|
31
30
|
const { enhanceSymmetry = nuclei[0] === nuclei[1] } = options;
|
|
32
31
|
let zones = (0, nmr_processing_1.xyzAutoZonesPicking)(data, {
|
|
33
32
|
nuclei,
|
|
@@ -12,7 +12,7 @@ function fromJSON(mols = []) {
|
|
|
12
12
|
for (let fragment of fragments) {
|
|
13
13
|
molecules.push((0, Molecule_1.initMolecule)({
|
|
14
14
|
molfile: fragment.toMolfileV3(),
|
|
15
|
-
label: mol.label
|
|
15
|
+
label: mol.label || `P${getLabelNumber(reservedNumbers)}`,
|
|
16
16
|
id: mol.id,
|
|
17
17
|
}));
|
|
18
18
|
}
|
|
@@ -8,15 +8,19 @@ const omit_1 = __importDefault(require("lodash/omit"));
|
|
|
8
8
|
const SignalsKinds_1 = require("../constants/SignalsKinds");
|
|
9
9
|
function getDiaIDs(range) {
|
|
10
10
|
return [].concat(range.diaIDs || [], range.signals
|
|
11
|
-
? range.signals.
|
|
11
|
+
? range.signals.flatMap((_signal) => _signal.diaIDs || [])
|
|
12
12
|
: []);
|
|
13
13
|
}
|
|
14
14
|
exports.getDiaIDs = getDiaIDs;
|
|
15
15
|
function getNbAtoms(range, signalIndex) {
|
|
16
16
|
if (signalIndex === undefined) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
let sum = 0;
|
|
18
|
+
if (range.signals) {
|
|
19
|
+
for (const signal of range.signals) {
|
|
20
|
+
sum += signal.nbAtoms || 0;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return sum;
|
|
20
24
|
}
|
|
21
25
|
return range.signals[signalIndex].nbAtoms || 0;
|
|
22
26
|
}
|
|
@@ -81,15 +85,15 @@ function checkSignalKinds(range, kinds) {
|
|
|
81
85
|
}
|
|
82
86
|
exports.checkSignalKinds = checkSignalKinds;
|
|
83
87
|
function unlinkInAssignmentData(assignmentData, ranges) {
|
|
84
|
-
const ids = ranges.
|
|
88
|
+
const ids = ranges.flatMap((range) => {
|
|
85
89
|
if (range.id) {
|
|
86
|
-
|
|
90
|
+
return range.id;
|
|
87
91
|
}
|
|
88
92
|
if (range.signals) {
|
|
89
|
-
|
|
93
|
+
return range.signals.map((signal) => signal.id);
|
|
90
94
|
}
|
|
91
|
-
return
|
|
92
|
-
}
|
|
95
|
+
return [];
|
|
96
|
+
});
|
|
93
97
|
assignmentData.dispatch({
|
|
94
98
|
type: 'REMOVE_ALL',
|
|
95
99
|
payload: { id: ids, axis: 'x' },
|
|
@@ -4,14 +4,18 @@ exports.unlinkInAssignmentData = exports.unlink = exports.checkSignalKinds = exp
|
|
|
4
4
|
const SignalsKinds_1 = require("../constants/SignalsKinds");
|
|
5
5
|
function getDiaIDs(zone, axis) {
|
|
6
6
|
return [].concat(zone[axis].diaIDs || [], zone.signals
|
|
7
|
-
? zone.signals.
|
|
7
|
+
? zone.signals.flatMap((signal) => signal[axis].diaIDs || [])
|
|
8
8
|
: []);
|
|
9
9
|
}
|
|
10
10
|
exports.getDiaIDs = getDiaIDs;
|
|
11
11
|
function getNbAtoms(zone, axis) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
let sum = 0;
|
|
13
|
+
if (zone.signals) {
|
|
14
|
+
for (const signal of zone.signals) {
|
|
15
|
+
sum += signal[axis].nbAtoms || 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return sum;
|
|
15
19
|
}
|
|
16
20
|
exports.getNbAtoms = getNbAtoms;
|
|
17
21
|
function setNbAtoms(zone, axis) {
|
|
@@ -24,10 +28,10 @@ exports.setNbAtoms = setNbAtoms;
|
|
|
24
28
|
function resetDiaIDs(zone, axis) {
|
|
25
29
|
delete zone[axis].diaIDs;
|
|
26
30
|
delete zone[axis].nbAtoms;
|
|
27
|
-
zone.signals
|
|
31
|
+
for (const signal of zone.signals) {
|
|
28
32
|
delete signal[axis].diaIDs;
|
|
29
33
|
delete signal[axis].nbAtoms;
|
|
30
|
-
}
|
|
34
|
+
}
|
|
31
35
|
return zone;
|
|
32
36
|
}
|
|
33
37
|
exports.resetDiaIDs = resetDiaIDs;
|
|
@@ -58,24 +62,24 @@ function unlink(zone, isOnZoneLevel, signalIndex, axis) {
|
|
|
58
62
|
setNbAtoms(zone, axis);
|
|
59
63
|
}
|
|
60
64
|
else {
|
|
61
|
-
['x', 'y']
|
|
65
|
+
for (const key of ['x', 'y']) {
|
|
62
66
|
resetDiaIDs(zone, key);
|
|
63
67
|
setNbAtoms(zone, key);
|
|
64
|
-
}
|
|
68
|
+
}
|
|
65
69
|
}
|
|
66
70
|
return zone;
|
|
67
71
|
}
|
|
68
72
|
exports.unlink = unlink;
|
|
69
73
|
function unlinkInAssignmentData(assignmentData, zones, axis) {
|
|
70
|
-
const ids = zones.
|
|
74
|
+
const ids = zones.flatMap((zone) => {
|
|
71
75
|
if (zone.id) {
|
|
72
|
-
|
|
76
|
+
return zone.id;
|
|
73
77
|
}
|
|
74
78
|
if (zone.signals) {
|
|
75
|
-
|
|
79
|
+
return zone.signals.map((signal) => signal.id);
|
|
76
80
|
}
|
|
77
|
-
return
|
|
78
|
-
}
|
|
81
|
+
return [];
|
|
82
|
+
});
|
|
79
83
|
if (axis) {
|
|
80
84
|
assignmentData.dispatch({
|
|
81
85
|
type: 'REMOVE_ALL',
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
function generateChar(index) {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
// a
|
|
5
|
+
const aPosition = 97;
|
|
6
|
+
// z
|
|
7
|
+
const zPosition = 122;
|
|
8
|
+
const len = zPosition - aPosition + 1;
|
|
9
|
+
let charResult = '';
|
|
8
10
|
while (index >= 0) {
|
|
9
|
-
|
|
11
|
+
charResult = String.fromCodePoint((index % len) + aPosition) + charResult;
|
|
10
12
|
index = Math.floor(index / len) - 1;
|
|
11
13
|
}
|
|
12
|
-
return
|
|
14
|
+
return charResult;
|
|
13
15
|
}
|
|
14
16
|
exports.default = generateChar;
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const mfCheck = /^(?:[A-Z][a-z]?\d* *)+$/;
|
|
4
4
|
function getAtomsFromMF(mf) {
|
|
5
5
|
if (!mfCheck.test(mf)) {
|
|
6
|
-
throw Error(`MF can not be parsed: ${mf}`);
|
|
6
|
+
throw new Error(`MF can not be parsed: ${mf}`);
|
|
7
7
|
}
|
|
8
8
|
const atoms = {};
|
|
9
|
-
const parts = mf.matchAll(/(?<atom>[A-Z][a-z]?)(?<number
|
|
9
|
+
const parts = mf.matchAll(/(?<atom>[A-Z][a-z]?)(?<number>\d*)/g);
|
|
10
10
|
for (const part of parts) {
|
|
11
11
|
const { atom, number } = part.groups;
|
|
12
12
|
if (!atoms[atom]) {
|
|
@@ -57,16 +57,16 @@ function getColor(isRandom = false, usedColors = [], opacity = 100) {
|
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
59
|
const lum = -0.25;
|
|
60
|
-
let hex = String(`#${Math.random().toString(16).slice(2, 8).toUpperCase()}`).replace(/[
|
|
60
|
+
let hex = String(`#${Math.random().toString(16).slice(2, 8).toUpperCase()}`).replace(/[^\da-f]/gi, '');
|
|
61
61
|
if (hex.length < 6) {
|
|
62
62
|
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
|
|
63
63
|
}
|
|
64
64
|
let rgb = '#';
|
|
65
65
|
let c;
|
|
66
66
|
for (let i = 0; i < 3; i++) {
|
|
67
|
-
c = parseInt(hex.
|
|
67
|
+
c = Number.parseInt(hex.slice(i * 2, i * 2 + 2), 16);
|
|
68
68
|
c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16);
|
|
69
|
-
rgb += `00${c}`.
|
|
69
|
+
rgb += `00${c}`.slice(c.length);
|
|
70
70
|
}
|
|
71
71
|
return rgb + percentToHex(opacity);
|
|
72
72
|
}
|
|
@@ -9,8 +9,11 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.getSum = void 0;
|
|
11
11
|
function getSum(values, key, check = null) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
let sum = 0;
|
|
13
|
+
for (const current of values) {
|
|
14
|
+
if (check?.(current))
|
|
15
|
+
sum += Math.abs(current[key]);
|
|
16
|
+
}
|
|
17
|
+
return sum;
|
|
15
18
|
}
|
|
16
19
|
exports.getSum = getSum;
|
package/lib-cjs/versionInfo.js
CHANGED