nmr-processing 9.5.0 → 9.5.1-pre.1685396168
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/apodization/apodization.d.ts +6 -5
- package/lib/apodization/apodization.js +4 -1
- package/lib/apodization/apodization.js.map +1 -1
- package/lib/apodization/applyWindow.js.map +1 -1
- package/lib/apodization/compose.js.map +1 -1
- package/lib/apodization/getFunction.js +3 -0
- package/lib/apodization/getFunction.js.map +1 -1
- package/lib/apodization/shapes/WindowFunctions.d.ts +6 -1
- package/lib/apodization/shapes/sineBell.d.ts +27 -0
- package/lib/apodization/shapes/sineBell.js +17 -0
- package/lib/apodization/shapes/sineBell.js.map +1 -0
- package/lib/apodization/utils/getData.js.map +1 -1
- package/lib/constants/SignalsKinds.d.ts +9 -0
- package/lib/constants/SignalsKinds.js +40 -0
- package/lib/constants/SignalsKinds.js.map +1 -0
- package/lib/datum/Entry1D.d.ts +10 -0
- package/lib/datum/Entry1D.js +3 -0
- package/lib/datum/Entry1D.js.map +1 -0
- package/lib/datum/ExclusionZone.d.ts +5 -0
- package/lib/datum/ExclusionZone.js +3 -0
- package/lib/datum/ExclusionZone.js.map +1 -0
- package/lib/datum/Filters.d.ts +13 -0
- package/lib/datum/Filters.js +49 -0
- package/lib/datum/Filters.js.map +1 -0
- package/lib/datum/FiltersManager.d.ts +30 -0
- package/lib/datum/FiltersManager.js +184 -0
- package/lib/datum/FiltersManager.js.map +1 -0
- package/lib/datum/MatrixFilter.d.ts +39 -0
- package/lib/datum/MatrixFilter.js +3 -0
- package/lib/datum/MatrixFilter.js.map +1 -0
- package/lib/datum/MatrixOptions.d.ts +28 -0
- package/lib/datum/MatrixOptions.js +3 -0
- package/lib/datum/MatrixOptions.js.map +1 -0
- package/lib/datum/data1d/filter1d/apodization.d.ts +26 -0
- package/lib/datum/data1d/filter1d/apodization.js +75 -0
- package/lib/datum/data1d/filter1d/apodization.js.map +1 -0
- package/lib/datum/data1d/filter1d/baselineCorrection.d.ts +32 -0
- package/lib/datum/data1d/filter1d/baselineCorrection.js +61 -0
- package/lib/datum/data1d/filter1d/baselineCorrection.js.map +1 -0
- package/lib/datum/data1d/filter1d/digitalFilter.d.ts +18 -0
- package/lib/datum/data1d/filter1d/digitalFilter.js +47 -0
- package/lib/datum/data1d/filter1d/digitalFilter.js.map +1 -0
- package/lib/datum/data1d/filter1d/equallySpaced.d.ts +29 -0
- package/lib/datum/data1d/filter1d/equallySpaced.js +55 -0
- package/lib/datum/data1d/filter1d/equallySpaced.js.map +1 -0
- package/lib/datum/data1d/filter1d/exclusionZones.d.ts +11 -0
- package/lib/datum/data1d/filter1d/exclusionZones.js +35 -0
- package/lib/datum/data1d/filter1d/exclusionZones.js.map +1 -0
- package/lib/datum/data1d/filter1d/fft.d.ts +14 -0
- package/lib/datum/data1d/filter1d/fft.js +94 -0
- package/lib/datum/data1d/filter1d/fft.js.map +1 -0
- package/lib/datum/data1d/filter1d/phaseCorrection.d.ts +33 -0
- package/lib/datum/data1d/filter1d/phaseCorrection.js +84 -0
- package/lib/datum/data1d/filter1d/phaseCorrection.js.map +1 -0
- package/lib/datum/data1d/filter1d/shiftX.d.ts +16 -0
- package/lib/datum/data1d/filter1d/shiftX.js +30 -0
- package/lib/datum/data1d/filter1d/shiftX.js.map +1 -0
- package/lib/datum/data1d/filter1d/signalProcessing.d.ts +17 -0
- package/lib/datum/data1d/filter1d/signalProcessing.js +88 -0
- package/lib/datum/data1d/filter1d/signalProcessing.js.map +1 -0
- package/lib/datum/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +5 -0
- package/lib/datum/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +41 -0
- package/lib/datum/data1d/filter1d/utils/padDataToNextPowerOfTwo.js.map +1 -0
- package/lib/datum/data1d/filter1d/zeroFilling.d.ts +18 -0
- package/lib/datum/data1d/filter1d/zeroFilling.js +68 -0
- package/lib/datum/data1d/filter1d/zeroFilling.js.map +1 -0
- package/lib/datum/data1d/updateRelatives.d.ts +4 -0
- package/lib/datum/data1d/updateRelatives.js +36 -0
- package/lib/datum/data1d/updateRelatives.js.map +1 -0
- package/lib/datum/data1d/utils/RangeUtilities.d.ts +22 -0
- package/lib/datum/data1d/utils/RangeUtilities.js +83 -0
- package/lib/datum/data1d/utils/RangeUtilities.js.map +1 -0
- package/lib/datum/data1d/utils/checkIntegralKind.d.ts +7 -0
- package/lib/datum/data1d/utils/checkIntegralKind.js +14 -0
- package/lib/datum/data1d/utils/checkIntegralKind.js.map +1 -0
- package/lib/datum/data1d/utils/checkRangeKind.d.ts +2 -0
- package/lib/datum/data1d/utils/checkRangeKind.js +10 -0
- package/lib/datum/data1d/utils/checkRangeKind.js.map +1 -0
- package/lib/datum/data1d/utils/getShiftX.d.ts +2 -0
- package/lib/datum/data1d/utils/getShiftX.js +11 -0
- package/lib/datum/data1d/utils/getShiftX.js.map +1 -0
- package/lib/datum/data1d/utils/getSpectrumErrorValue.d.ts +2 -0
- package/lib/datum/data1d/utils/getSpectrumErrorValue.js +9 -0
- package/lib/datum/data1d/utils/getSpectrumErrorValue.js.map +1 -0
- package/lib/datum/data1d/utils/mapIntegrals.d.ts +13 -0
- package/lib/datum/data1d/utils/mapIntegrals.js +41 -0
- package/lib/datum/data1d/utils/mapIntegrals.js.map +1 -0
- package/lib/datum/data1d/utils/mapPeaks.d.ts +4 -0
- package/lib/datum/data1d/utils/mapPeaks.js +51 -0
- package/lib/datum/data1d/utils/mapPeaks.js.map +1 -0
- package/lib/datum/data1d/utils/mapRanges.d.ts +38 -0
- package/lib/datum/data1d/utils/mapRanges.js +84 -0
- package/lib/datum/data1d/utils/mapRanges.js.map +1 -0
- package/lib/datum/data1d/utils/updateIntegrals.d.ts +2 -0
- package/lib/datum/data1d/utils/updateIntegrals.js +11 -0
- package/lib/datum/data1d/utils/updateIntegrals.js.map +1 -0
- package/lib/datum/data1d/utils/updateIntegralsRelativeValues.d.ts +2 -0
- package/lib/datum/data1d/utils/updateIntegralsRelativeValues.js +10 -0
- package/lib/datum/data1d/utils/updateIntegralsRelativeValues.js.map +1 -0
- package/lib/datum/data1d/utils/updatePeaks.d.ts +2 -0
- package/lib/datum/data1d/utils/updatePeaks.js +12 -0
- package/lib/datum/data1d/utils/updatePeaks.js.map +1 -0
- package/lib/datum/data1d/utils/updateRanges.d.ts +2 -0
- package/lib/datum/data1d/utils/updateRanges.js +14 -0
- package/lib/datum/data1d/utils/updateRanges.js.map +1 -0
- package/lib/datum/data1d/utils/updateRangesRelativeValues.d.ts +2 -0
- package/lib/datum/data1d/utils/updateRangesRelativeValues.js +10 -0
- package/lib/datum/data1d/utils/updateRangesRelativeValues.js.map +1 -0
- package/lib/datum/data2d/filter2d/shiftX.d.ts +16 -0
- package/lib/datum/data2d/filter2d/shiftX.js +34 -0
- package/lib/datum/data2d/filter2d/shiftX.js.map +1 -0
- package/lib/datum/data2d/filter2d/shiftY.d.ts +16 -0
- package/lib/datum/data2d/filter2d/shiftY.js +34 -0
- package/lib/datum/data2d/filter2d/shiftY.js.map +1 -0
- package/lib/datum/data2d/utils/get2DSpectrumErrorValue.d.ts +6 -0
- package/lib/datum/data2d/utils/get2DSpectrumErrorValue.js +14 -0
- package/lib/datum/data2d/utils/get2DSpectrumErrorValue.js.map +1 -0
- package/lib/datum/data2d/utils/getShift.d.ts +6 -0
- package/lib/datum/data2d/utils/getShift.js +20 -0
- package/lib/datum/data2d/utils/getShift.js.map +1 -0
- package/lib/datum/data2d/utils/isZoneExists.d.ts +4 -0
- package/lib/datum/data2d/utils/isZoneExists.js +21 -0
- package/lib/datum/data2d/utils/isZoneExists.js.map +1 -0
- package/lib/datum/data2d/utils/mapZones.d.ts +34 -0
- package/lib/datum/data2d/utils/mapZones.js +68 -0
- package/lib/datum/data2d/utils/mapZones.js.map +1 -0
- package/lib/datum/data2d/utils/updateZones.d.ts +2 -0
- package/lib/datum/data2d/utils/updateZones.js +12 -0
- package/lib/datum/data2d/utils/updateZones.js.map +1 -0
- package/lib/index.d.ts +35 -0
- package/lib/index.js +27 -0
- package/lib/index.js.map +1 -1
- package/lib/signals/signalsToRanges.js.map +1 -1
- package/lib/signals/simulation/simulateXYPeaks.js.map +1 -1
- package/lib/signals/utils/jAnalyzer.d.ts +11 -8
- package/lib/signals/utils/jAnalyzer.js.map +1 -1
- package/lib/types/ContourOptions.d.ts +10 -0
- package/lib/types/ContourOptions.js +3 -0
- package/lib/types/ContourOptions.js.map +1 -0
- package/lib/types/Data1D.d.ts +5 -0
- package/lib/types/Data1D.js +3 -0
- package/lib/types/Data1D.js.map +1 -0
- package/lib/types/Data2D.d.ts +5 -0
- package/{lib-esm/xyz → lib/types}/Data2D.js.map +1 -1
- package/lib/types/Display.d.ts +3 -0
- package/lib/types/Display.js +3 -0
- package/lib/types/Display.js.map +1 -0
- package/lib/types/Display1D.d.ts +7 -0
- package/lib/types/Display1D.js +3 -0
- package/lib/types/Display1D.js.map +1 -0
- package/lib/types/Display2D.d.ts +11 -0
- package/lib/types/Display2D.js +3 -0
- package/lib/types/Display2D.js.map +1 -0
- package/lib/types/Filter.d.ts +11 -0
- package/lib/types/Filter.js +3 -0
- package/lib/types/Filter.js.map +1 -0
- package/lib/types/Info/Info.d.ts +15 -0
- package/lib/types/Info/Info.js +3 -0
- package/lib/types/Info/Info.js.map +1 -0
- package/lib/types/Info/Info1D.d.ts +13 -0
- package/lib/types/Info/Info1D.js +3 -0
- package/lib/types/Info/Info1D.js.map +1 -0
- package/lib/types/Info/Info2D.d.ts +10 -0
- package/lib/types/Info/Info2D.js +3 -0
- package/lib/types/Info/Info2D.js.map +1 -0
- package/lib/types/Integral.d.ts +10 -0
- package/lib/types/Integral.js +3 -0
- package/lib/types/Integral.js.map +1 -0
- package/lib/types/Integrals.d.ts +6 -0
- package/lib/types/Integrals.js +3 -0
- package/lib/types/Integrals.js.map +1 -0
- package/lib/types/Jcoupling.d.ts +5 -0
- package/lib/types/Jcoupling.js +3 -0
- package/lib/types/Jcoupling.js.map +1 -0
- package/lib/types/ObjectXY.d.ts +4 -0
- package/lib/types/ObjectXY.js +3 -0
- package/lib/types/ObjectXY.js.map +1 -0
- package/lib/types/Options/DataSelectionOption.d.ts +1 -0
- package/lib/types/Options/DataSelectionOption.js +3 -0
- package/lib/types/Options/DataSelectionOption.js.map +1 -0
- package/lib/types/Options/JcampParsingOptions.d.ts +30 -0
- package/lib/types/Options/JcampParsingOptions.js +3 -0
- package/lib/types/Options/JcampParsingOptions.js.map +1 -0
- package/lib/types/Options/NmredataParsingOptions.d.ts +14 -0
- package/lib/types/Options/NmredataParsingOptions.js +3 -0
- package/lib/types/Options/NmredataParsingOptions.js.map +1 -0
- package/lib/types/Options/ParsingOptions.d.ts +74 -0
- package/lib/types/Options/ParsingOptions.js +3 -0
- package/lib/types/Options/ParsingOptions.js.map +1 -0
- package/lib/types/Options/SumOptions.d.ts +24 -0
- package/lib/types/Options/SumOptions.js +3 -0
- package/lib/types/Options/SumOptions.js.map +1 -0
- package/lib/types/Peaks/BasePeak.d.ts +3 -0
- package/lib/types/Peaks/BasePeak.js +3 -0
- package/lib/types/Peaks/BasePeak.js.map +1 -0
- package/lib/types/Peaks/Peak1D.d.ts +5 -0
- package/lib/types/Peaks/Peak1D.js +3 -0
- package/lib/types/Peaks/Peak1D.js.map +1 -0
- package/lib/types/Peaks/Peak2D.d.ts +13 -0
- package/lib/types/Peaks/Peak2D.js +3 -0
- package/lib/types/Peaks/Peak2D.js.map +1 -0
- package/lib/types/Peaks/Peaks.d.ts +5 -0
- package/lib/types/Peaks/Peaks.js +3 -0
- package/lib/types/Peaks/Peaks.js.map +1 -0
- package/lib/types/Ranges/Ranges.d.ts +16 -0
- package/lib/types/Ranges/Ranges.js +3 -0
- package/lib/types/Ranges/Ranges.js.map +1 -0
- package/lib/types/Signals/Signal.d.ts +4 -0
- package/lib/types/Signals/Signal.js +3 -0
- package/lib/types/Signals/Signal.js.map +1 -0
- package/lib/types/Signals/Signal1D.d.ts +6 -0
- package/lib/types/Signals/Signal1D.js +3 -0
- package/lib/types/Signals/Signal1D.js.map +1 -0
- package/lib/types/Signals/Signal2D.d.ts +18 -0
- package/lib/types/Signals/Signal2D.js +3 -0
- package/lib/types/Signals/Signal2D.js.map +1 -0
- package/lib/types/Spectrum/BaseSpectrum.d.ts +7 -0
- package/lib/types/Spectrum/BaseSpectrum.js +3 -0
- package/lib/types/Spectrum/BaseSpectrum.js.map +1 -0
- package/lib/types/Spectrum/Spectrum.d.ts +3 -0
- package/lib/types/Spectrum/Spectrum.js +3 -0
- package/lib/types/Spectrum/Spectrum.js.map +1 -0
- package/lib/types/Spectrum/Spectrum1D.d.ts +20 -0
- package/lib/types/Spectrum/Spectrum1D.js +3 -0
- package/lib/types/Spectrum/Spectrum1D.js.map +1 -0
- package/lib/types/Spectrum/Spectrum2D.d.ts +16 -0
- package/lib/types/Spectrum/Spectrum2D.js +3 -0
- package/lib/types/Spectrum/Spectrum2D.js.map +1 -0
- package/lib/types/Zones/Zone.d.ts +13 -0
- package/lib/types/Zones/Zone.js +3 -0
- package/lib/types/Zones/Zone.js.map +1 -0
- package/lib/types/Zones/Zones.d.ts +5 -0
- package/lib/types/Zones/Zones.js +3 -0
- package/lib/types/Zones/Zones.js.map +1 -0
- package/lib/types/common/MapOptions.d.ts +5 -0
- package/lib/types/common/MapOptions.js +3 -0
- package/lib/types/common/MapOptions.js.map +1 -0
- package/lib/utilities/checkData2DFid.d.ts +3 -0
- package/lib/utilities/checkData2DFid.js +10 -0
- package/lib/utilities/checkData2DFid.js.map +1 -0
- package/lib/utilities/cloneData1D.d.ts +6 -0
- package/lib/utilities/cloneData1D.js +9 -0
- package/lib/utilities/cloneData1D.js.map +1 -0
- package/lib/utilities/cloneData2D.d.ts +2 -0
- package/lib/utilities/cloneData2D.js +28 -0
- package/lib/utilities/cloneData2D.js.map +1 -0
- package/lib/utilities/getSum.d.ts +8 -0
- package/lib/utilities/getSum.js +25 -0
- package/lib/utilities/getSum.js.map +1 -0
- package/lib/xyz/Entry2D.d.ts +10 -0
- package/lib/xyz/Entry2D.js +3 -0
- package/lib/xyz/Entry2D.js.map +1 -0
- package/lib/xyz/quadrature.d.ts +7 -0
- package/lib/xyz/quadrature.js +54 -0
- package/lib/xyz/quadrature.js.map +1 -0
- package/lib/xyz/util/fft2d/digitalFilter.d.ts +7 -0
- package/lib/xyz/util/fft2d/digitalFilter.js +20 -0
- package/lib/xyz/util/fft2d/digitalFilter.js.map +1 -0
- package/lib/xyz/util/fft2d/fftDirectDimension.d.ts +24 -0
- package/lib/xyz/util/fft2d/fftDirectDimension.js +57 -0
- package/lib/xyz/util/fft2d/fftDirectDimension.js.map +1 -0
- package/lib/xyz/util/fft2d/fftIndirectDimension.d.ts +23 -0
- package/lib/xyz/util/fft2d/fftIndirectDimension.js +72 -0
- package/lib/xyz/util/fft2d/fftIndirectDimension.js.map +1 -0
- package/lib/xyz/util/fft2d/removeDCOffset.d.ts +5 -0
- package/lib/xyz/util/fft2d/removeDCOffset.js +19 -0
- package/lib/xyz/util/fft2d/removeDCOffset.js.map +1 -0
- package/lib/xyz/util/fft2d/zeroFilling.d.ts +10 -0
- package/lib/xyz/util/fft2d/zeroFilling.js +29 -0
- package/lib/xyz/util/fft2d/zeroFilling.js.map +1 -0
- package/lib/xyz/util/padData.d.ts +5 -3
- package/lib/xyz/util/padData.js +7 -7
- package/lib/xyz/util/padData.js.map +1 -1
- package/lib/xyz/xyzAutoSignalsPicking.d.ts +2 -2
- package/lib/xyz/xyzAutoSignalsPicking.js.map +1 -1
- package/lib/xyz/xyzAutoZonesPicking.d.ts +2 -8
- package/lib/xyz/xyzAutoZonesPicking.js.map +1 -1
- package/lib/xyz/xyzBidimensionalFFT.d.ts +40 -0
- package/lib/xyz/xyzBidimensionalFFT.js +79 -0
- package/lib/xyz/xyzBidimensionalFFT.js.map +1 -0
- package/lib/xyz/xyzJResAnalyzer.d.ts +1 -4
- package/lib/xyz/xyzJResAnalyzer.js +35 -26
- package/lib/xyz/xyzJResAnalyzer.js.map +1 -1
- package/lib-esm/apodization/apodization.js +4 -1
- package/lib-esm/apodization/apodization.js.map +1 -1
- package/lib-esm/apodization/applyWindow.js.map +1 -1
- package/lib-esm/apodization/compose.js.map +1 -1
- package/lib-esm/apodization/getFunction.js +3 -0
- package/lib-esm/apodization/getFunction.js.map +1 -1
- package/lib-esm/apodization/shapes/sineBell.js +13 -0
- package/lib-esm/apodization/shapes/sineBell.js.map +1 -0
- package/lib-esm/apodization/utils/getData.js.map +1 -1
- package/lib-esm/constants/SignalsKinds.js +37 -0
- package/lib-esm/constants/SignalsKinds.js.map +1 -0
- package/lib-esm/datum/Entry1D.js +2 -0
- package/lib-esm/datum/Entry1D.js.map +1 -0
- package/lib-esm/datum/ExclusionZone.js +2 -0
- package/lib-esm/datum/ExclusionZone.js.map +1 -0
- package/lib-esm/datum/Filters.js +23 -0
- package/lib-esm/datum/Filters.js.map +1 -0
- package/lib-esm/datum/FiltersManager.js +175 -0
- package/lib-esm/datum/FiltersManager.js.map +1 -0
- package/lib-esm/datum/MatrixFilter.js +2 -0
- package/lib-esm/datum/MatrixFilter.js.map +1 -0
- package/lib-esm/datum/MatrixOptions.js +2 -0
- package/lib-esm/datum/MatrixOptions.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/apodization.js +68 -0
- package/lib-esm/datum/data1d/filter1d/apodization.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/baselineCorrection.js +52 -0
- package/lib-esm/datum/data1d/filter1d/baselineCorrection.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/digitalFilter.js +41 -0
- package/lib-esm/datum/data1d/filter1d/digitalFilter.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/equallySpaced.js +49 -0
- package/lib-esm/datum/data1d/filter1d/equallySpaced.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/exclusionZones.js +29 -0
- package/lib-esm/datum/data1d/filter1d/exclusionZones.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/fft.js +88 -0
- package/lib-esm/datum/data1d/filter1d/fft.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/phaseCorrection.js +78 -0
- package/lib-esm/datum/data1d/filter1d/phaseCorrection.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/shiftX.js +24 -0
- package/lib-esm/datum/data1d/filter1d/shiftX.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/signalProcessing.js +58 -0
- package/lib-esm/datum/data1d/filter1d/signalProcessing.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +37 -0
- package/lib-esm/datum/data1d/filter1d/utils/padDataToNextPowerOfTwo.js.map +1 -0
- package/lib-esm/datum/data1d/filter1d/zeroFilling.js +62 -0
- package/lib-esm/datum/data1d/filter1d/zeroFilling.js.map +1 -0
- package/lib-esm/datum/data1d/updateRelatives.js +32 -0
- package/lib-esm/datum/data1d/updateRelatives.js.map +1 -0
- package/lib-esm/datum/data1d/utils/RangeUtilities.js +69 -0
- package/lib-esm/datum/data1d/utils/RangeUtilities.js.map +1 -0
- package/lib-esm/datum/data1d/utils/checkIntegralKind.js +10 -0
- package/lib-esm/datum/data1d/utils/checkIntegralKind.js.map +1 -0
- package/lib-esm/datum/data1d/utils/checkRangeKind.js +6 -0
- package/lib-esm/datum/data1d/utils/checkRangeKind.js.map +1 -0
- package/lib-esm/datum/data1d/utils/getShiftX.js +7 -0
- package/lib-esm/datum/data1d/utils/getShiftX.js.map +1 -0
- package/lib-esm/datum/data1d/utils/getSpectrumErrorValue.js +5 -0
- package/lib-esm/datum/data1d/utils/getSpectrumErrorValue.js.map +1 -0
- package/lib-esm/datum/data1d/utils/mapIntegrals.js +37 -0
- package/lib-esm/datum/data1d/utils/mapIntegrals.js.map +1 -0
- package/lib-esm/datum/data1d/utils/mapPeaks.js +47 -0
- package/lib-esm/datum/data1d/utils/mapPeaks.js.map +1 -0
- package/lib-esm/datum/data1d/utils/mapRanges.js +80 -0
- package/lib-esm/datum/data1d/utils/mapRanges.js.map +1 -0
- package/lib-esm/datum/data1d/utils/updateIntegrals.js +7 -0
- package/lib-esm/datum/data1d/utils/updateIntegrals.js.map +1 -0
- package/lib-esm/datum/data1d/utils/updateIntegralsRelativeValues.js +6 -0
- package/lib-esm/datum/data1d/utils/updateIntegralsRelativeValues.js.map +1 -0
- package/lib-esm/datum/data1d/utils/updatePeaks.js +8 -0
- package/lib-esm/datum/data1d/utils/updatePeaks.js.map +1 -0
- package/lib-esm/datum/data1d/utils/updateRanges.js +10 -0
- package/lib-esm/datum/data1d/utils/updateRanges.js.map +1 -0
- package/lib-esm/datum/data1d/utils/updateRangesRelativeValues.js +6 -0
- package/lib-esm/datum/data1d/utils/updateRangesRelativeValues.js.map +1 -0
- package/lib-esm/datum/data2d/filter2d/shiftX.js +28 -0
- package/lib-esm/datum/data2d/filter2d/shiftX.js.map +1 -0
- package/lib-esm/datum/data2d/filter2d/shiftY.js +28 -0
- package/lib-esm/datum/data2d/filter2d/shiftY.js.map +1 -0
- package/lib-esm/datum/data2d/utils/get2DSpectrumErrorValue.js +10 -0
- package/lib-esm/datum/data2d/utils/get2DSpectrumErrorValue.js.map +1 -0
- package/lib-esm/datum/data2d/utils/getShift.js +16 -0
- package/lib-esm/datum/data2d/utils/getShift.js.map +1 -0
- package/lib-esm/datum/data2d/utils/isZoneExists.js +17 -0
- package/lib-esm/datum/data2d/utils/isZoneExists.js.map +1 -0
- package/lib-esm/datum/data2d/utils/mapZones.js +64 -0
- package/lib-esm/datum/data2d/utils/mapZones.js.map +1 -0
- package/lib-esm/datum/data2d/utils/updateZones.js +8 -0
- package/lib-esm/datum/data2d/utils/updateZones.js.map +1 -0
- package/lib-esm/index.js +14 -0
- package/lib-esm/index.js.map +1 -1
- package/lib-esm/signals/signalsToRanges.js.map +1 -1
- package/lib-esm/signals/simulation/simulateXYPeaks.js.map +1 -1
- package/lib-esm/signals/utils/jAnalyzer.js.map +1 -1
- package/lib-esm/types/ContourOptions.js +2 -0
- package/lib-esm/types/ContourOptions.js.map +1 -0
- package/lib-esm/types/Data1D.js +2 -0
- package/lib-esm/types/Data1D.js.map +1 -0
- package/{lib/xyz → lib-esm/types}/Data2D.js.map +1 -1
- package/lib-esm/types/Display.js +2 -0
- package/lib-esm/types/Display.js.map +1 -0
- package/lib-esm/types/Display1D.js +2 -0
- package/lib-esm/types/Display1D.js.map +1 -0
- package/lib-esm/types/Display2D.js +2 -0
- package/lib-esm/types/Display2D.js.map +1 -0
- package/lib-esm/types/Filter.js +2 -0
- package/lib-esm/types/Filter.js.map +1 -0
- package/lib-esm/types/Info/Info.js +2 -0
- package/lib-esm/types/Info/Info.js.map +1 -0
- package/lib-esm/types/Info/Info1D.js +2 -0
- package/lib-esm/types/Info/Info1D.js.map +1 -0
- package/lib-esm/types/Info/Info2D.js +2 -0
- package/lib-esm/types/Info/Info2D.js.map +1 -0
- package/lib-esm/types/Integral.js +2 -0
- package/lib-esm/types/Integral.js.map +1 -0
- package/lib-esm/types/Integrals.js +2 -0
- package/lib-esm/types/Integrals.js.map +1 -0
- package/lib-esm/types/Jcoupling.js +2 -0
- package/lib-esm/types/Jcoupling.js.map +1 -0
- package/lib-esm/types/ObjectXY.js +2 -0
- package/lib-esm/types/ObjectXY.js.map +1 -0
- package/lib-esm/types/Options/DataSelectionOption.js +2 -0
- package/lib-esm/types/Options/DataSelectionOption.js.map +1 -0
- package/lib-esm/types/Options/JcampParsingOptions.js +2 -0
- package/lib-esm/types/Options/JcampParsingOptions.js.map +1 -0
- package/lib-esm/types/Options/NmredataParsingOptions.js +2 -0
- package/lib-esm/types/Options/NmredataParsingOptions.js.map +1 -0
- package/lib-esm/types/Options/ParsingOptions.js +2 -0
- package/lib-esm/types/Options/ParsingOptions.js.map +1 -0
- package/lib-esm/types/Options/SumOptions.js +2 -0
- package/lib-esm/types/Options/SumOptions.js.map +1 -0
- package/lib-esm/types/Peaks/BasePeak.js +2 -0
- package/lib-esm/types/Peaks/BasePeak.js.map +1 -0
- package/lib-esm/types/Peaks/Peak1D.js +2 -0
- package/lib-esm/types/Peaks/Peak1D.js.map +1 -0
- package/lib-esm/types/Peaks/Peak2D.js +2 -0
- package/lib-esm/types/Peaks/Peak2D.js.map +1 -0
- package/lib-esm/types/Peaks/Peaks.js +2 -0
- package/lib-esm/types/Peaks/Peaks.js.map +1 -0
- package/lib-esm/types/Ranges/Ranges.js +2 -0
- package/lib-esm/types/Ranges/Ranges.js.map +1 -0
- package/lib-esm/types/Signals/Signal.js +2 -0
- package/lib-esm/types/Signals/Signal.js.map +1 -0
- package/lib-esm/types/Signals/Signal1D.js +2 -0
- package/lib-esm/types/Signals/Signal1D.js.map +1 -0
- package/lib-esm/types/Signals/Signal2D.js +2 -0
- package/lib-esm/types/Signals/Signal2D.js.map +1 -0
- package/lib-esm/types/Spectrum/BaseSpectrum.js +2 -0
- package/lib-esm/types/Spectrum/BaseSpectrum.js.map +1 -0
- package/lib-esm/types/Spectrum/Spectrum.js +2 -0
- package/lib-esm/types/Spectrum/Spectrum.js.map +1 -0
- package/lib-esm/types/Spectrum/Spectrum1D.js +2 -0
- package/lib-esm/types/Spectrum/Spectrum1D.js.map +1 -0
- package/lib-esm/types/Spectrum/Spectrum2D.js +2 -0
- package/lib-esm/types/Spectrum/Spectrum2D.js.map +1 -0
- package/lib-esm/types/Zones/Zone.js +2 -0
- package/lib-esm/types/Zones/Zone.js.map +1 -0
- package/lib-esm/types/Zones/Zones.js +2 -0
- package/lib-esm/types/Zones/Zones.js.map +1 -0
- package/lib-esm/types/common/MapOptions.js +2 -0
- package/lib-esm/types/common/MapOptions.js.map +1 -0
- package/lib-esm/utilities/checkData2DFid.js +6 -0
- package/lib-esm/utilities/checkData2DFid.js.map +1 -0
- package/lib-esm/utilities/cloneData1D.js +5 -0
- package/lib-esm/utilities/cloneData1D.js.map +1 -0
- package/lib-esm/utilities/cloneData2D.js +24 -0
- package/lib-esm/utilities/cloneData2D.js.map +1 -0
- package/lib-esm/utilities/getSum.js +21 -0
- package/lib-esm/utilities/getSum.js.map +1 -0
- package/lib-esm/xyz/Entry2D.js +2 -0
- package/lib-esm/xyz/Entry2D.js.map +1 -0
- package/lib-esm/xyz/quadrature.js +50 -0
- package/lib-esm/xyz/quadrature.js.map +1 -0
- package/lib-esm/xyz/util/fft2d/digitalFilter.js +16 -0
- package/lib-esm/xyz/util/fft2d/digitalFilter.js.map +1 -0
- package/lib-esm/xyz/util/fft2d/fftDirectDimension.js +50 -0
- package/lib-esm/xyz/util/fft2d/fftDirectDimension.js.map +1 -0
- package/lib-esm/xyz/util/fft2d/fftIndirectDimension.js +65 -0
- package/lib-esm/xyz/util/fft2d/fftIndirectDimension.js.map +1 -0
- package/lib-esm/xyz/util/fft2d/removeDCOffset.js +15 -0
- package/lib-esm/xyz/util/fft2d/removeDCOffset.js.map +1 -0
- package/lib-esm/xyz/util/fft2d/zeroFilling.js +25 -0
- package/lib-esm/xyz/util/fft2d/zeroFilling.js.map +1 -0
- package/lib-esm/xyz/util/padData.js +7 -4
- package/lib-esm/xyz/util/padData.js.map +1 -1
- package/lib-esm/xyz/xyzAutoSignalsPicking.js.map +1 -1
- package/lib-esm/xyz/xyzAutoZonesPicking.js.map +1 -1
- package/lib-esm/xyz/xyzBidimensionalFFT.js +75 -0
- package/lib-esm/xyz/xyzBidimensionalFFT.js.map +1 -0
- package/lib-esm/xyz/xyzJResAnalyzer.js +35 -26
- package/lib-esm/xyz/xyzJResAnalyzer.js.map +1 -1
- package/package.json +10 -2
- package/src/apodization/apodization.ts +8 -4
- package/src/apodization/applyWindow.ts +0 -1
- package/src/apodization/compose.ts +1 -0
- package/src/apodization/getFunction.ts +3 -0
- package/src/apodization/shapes/WindowFunctions.ts +7 -1
- package/src/apodization/shapes/sineBell.ts +41 -0
- package/src/apodization/utils/getData.ts +0 -1
- package/src/constants/SignalsKinds.ts +37 -0
- package/src/datum/Entry1D.ts +11 -0
- package/src/datum/ExclusionZone.ts +5 -0
- package/src/datum/Filters.ts +44 -0
- package/src/datum/FiltersManager.ts +238 -0
- package/src/datum/MatrixFilter.ts +58 -0
- package/src/datum/MatrixOptions.ts +25 -0
- package/src/datum/data1d/filter1d/apodization.ts +90 -0
- package/src/datum/data1d/filter1d/baselineCorrection.ts +83 -0
- package/src/datum/data1d/filter1d/digitalFilter.ts +54 -0
- package/src/datum/data1d/filter1d/equallySpaced.ts +61 -0
- package/src/datum/data1d/filter1d/exclusionZones.ts +34 -0
- package/src/datum/data1d/filter1d/fft.ts +138 -0
- package/src/datum/data1d/filter1d/phaseCorrection.ts +127 -0
- package/src/datum/data1d/filter1d/shiftX.ts +31 -0
- package/src/datum/data1d/filter1d/signalProcessing.ts +79 -0
- package/src/datum/data1d/filter1d/utils/padDataToNextPowerOfTwo.ts +49 -0
- package/src/datum/data1d/filter1d/zeroFilling.ts +90 -0
- package/src/datum/data1d/updateRelatives.ts +50 -0
- package/src/datum/data1d/utils/RangeUtilities.ts +102 -0
- package/src/datum/data1d/utils/checkIntegralKind.ts +11 -0
- package/src/datum/data1d/utils/checkRangeKind.ts +8 -0
- package/src/datum/data1d/utils/getShiftX.ts +10 -0
- package/src/datum/data1d/utils/getSpectrumErrorValue.ts +6 -0
- package/src/datum/data1d/utils/mapIntegrals.ts +52 -0
- package/src/datum/data1d/utils/mapPeaks.ts +62 -0
- package/src/datum/data1d/utils/mapRanges.ts +107 -0
- package/src/datum/data1d/utils/updateIntegrals.ts +13 -0
- package/src/datum/data1d/utils/updateIntegralsRelativeValues.ts +17 -0
- package/src/datum/data1d/utils/updatePeaks.ts +10 -0
- package/src/datum/data1d/utils/updateRanges.ts +12 -0
- package/src/datum/data1d/utils/updateRangesRelativeValues.ts +16 -0
- package/src/datum/data2d/filter2d/shiftX.ts +37 -0
- package/src/datum/data2d/filter2d/shiftY.ts +36 -0
- package/src/datum/data2d/utils/get2DSpectrumErrorValue.ts +18 -0
- package/src/datum/data2d/utils/getShift.ts +23 -0
- package/src/datum/data2d/utils/isZoneExists.ts +27 -0
- package/src/datum/data2d/utils/mapZones.ts +80 -0
- package/src/datum/data2d/utils/updateZones.ts +10 -0
- package/src/index.ts +38 -0
- package/src/signals/signalsToRanges.ts +1 -1
- package/src/signals/simulation/simulateXYPeaks.ts +1 -1
- package/src/signals/utils/jAnalyzer.ts +20 -10
- package/src/types/ContourOptions.ts +10 -0
- package/src/types/Data1D.ts +5 -0
- package/src/types/Data2D.ts +7 -0
- package/src/types/Display.ts +3 -0
- package/src/types/Display1D.ts +8 -0
- package/src/types/Display2D.ts +12 -0
- package/src/types/Filter.ts +12 -0
- package/src/types/Info/Info.ts +15 -0
- package/src/types/Info/Info1D.ts +14 -0
- package/src/types/Info/Info2D.ts +11 -0
- package/src/types/Integral.ts +10 -0
- package/src/types/Integrals.ts +7 -0
- package/src/types/Jcoupling.ts +5 -0
- package/src/types/ObjectXY.ts +4 -0
- package/src/types/Options/DataSelectionOption.ts +6 -0
- package/src/types/Options/JcampParsingOptions.ts +35 -0
- package/src/types/Options/NmredataParsingOptions.ts +20 -0
- package/src/types/Options/ParsingOptions.ts +80 -0
- package/src/types/Options/SumOptions.ts +24 -0
- package/src/types/Peaks/BasePeak.ts +3 -0
- package/src/types/Peaks/Peak1D.ts +7 -0
- package/src/types/Peaks/Peak2D.ts +11 -0
- package/src/types/Peaks/Peaks.ts +6 -0
- package/src/types/Ranges/Ranges.ts +19 -0
- package/src/types/Signals/Signal.ts +4 -0
- package/src/types/Signals/Signal1D.ts +8 -0
- package/src/types/Signals/Signal2D.ts +21 -0
- package/src/types/Spectrum/BaseSpectrum.ts +8 -0
- package/src/types/Spectrum/Spectrum.ts +4 -0
- package/src/types/Spectrum/Spectrum1D.ts +23 -0
- package/src/types/Spectrum/Spectrum2D.ts +19 -0
- package/src/types/Zones/Zone.ts +15 -0
- package/src/types/Zones/Zones.ts +6 -0
- package/src/types/common/MapOptions.ts +6 -0
- package/src/utilities/checkData2DFid.ts +10 -0
- package/src/utilities/cloneData1D.ts +6 -0
- package/src/utilities/cloneData2D.ts +27 -0
- package/src/utilities/getSum.ts +24 -0
- package/src/xyz/Entry2D.ts +12 -0
- package/src/xyz/quadrature.ts +68 -0
- package/src/xyz/util/fft2d/digitalFilter.ts +24 -0
- package/src/xyz/util/fft2d/fftDirectDimension.ts +111 -0
- package/src/xyz/util/fft2d/fftIndirectDimension.ts +123 -0
- package/src/xyz/util/fft2d/removeDCOffset.ts +19 -0
- package/src/xyz/util/fft2d/zeroFilling.ts +39 -0
- package/src/xyz/util/padData.ts +13 -7
- package/src/xyz/xyzAutoSignalsPicking.ts +2 -2
- package/src/xyz/xyzAutoZonesPicking.ts +3 -9
- package/src/xyz/xyzBidimensionalFFT.ts +122 -0
- package/src/xyz/xyzJResAnalyzer.ts +51 -42
- package/lib/xyz/Data2D.d.ts +0 -7
- package/src/xyz/Data2D.ts +0 -7
- /package/lib/{xyz → types}/Data2D.js +0 -0
- /package/lib-esm/{xyz → types}/Data2D.js +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Data1D } from '../../../types/Data1D';
|
|
2
|
+
import { Entry1D } from '../../Entry1D';
|
|
3
|
+
import { FilterDomainUpdateRules } from '../../FiltersManager';
|
|
4
|
+
|
|
5
|
+
export const id = 'zeroFilling';
|
|
6
|
+
export const name = 'Zero Filling';
|
|
7
|
+
export const DOMAIN_UPDATE_RULES: Readonly<FilterDomainUpdateRules> = {
|
|
8
|
+
updateXDomain: true,
|
|
9
|
+
updateYDomain: false,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export interface ZeroFillingOptions {
|
|
13
|
+
nbPoints?: number;
|
|
14
|
+
factor?: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function apply(datum1D: Entry1D, options: ZeroFillingOptions) {
|
|
18
|
+
if (!isApplicable(datum1D)) {
|
|
19
|
+
throw new Error('zeroFilling not applicable on this data');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let { nbPoints, factor = 2 } = options;
|
|
23
|
+
|
|
24
|
+
if (!nbPoints) {
|
|
25
|
+
nbPoints = 2 ** Math.round(Math.log2(datum1D.data.x.length * factor));
|
|
26
|
+
const filter = datum1D.filters.find((filter) => filter.name === id);
|
|
27
|
+
if (filter) {
|
|
28
|
+
filter.value = { nbPoints };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let digitalFilterApplied = datum1D.filters.some(
|
|
33
|
+
(e) => e.name === 'digitalFilter' && e.flag,
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
let grpdly = datum1D.info?.digitalFilter || 0;
|
|
37
|
+
let pointsToShift;
|
|
38
|
+
if (grpdly > 0 && digitalFilterApplied) {
|
|
39
|
+
pointsToShift = Math.floor(grpdly);
|
|
40
|
+
} else {
|
|
41
|
+
pointsToShift = 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const { re, im, x } = datum1D.data;
|
|
45
|
+
|
|
46
|
+
let newRE = new Float64Array(nbPoints);
|
|
47
|
+
let newIM = new Float64Array(nbPoints);
|
|
48
|
+
let newX = new Float64Array(nbPoints);
|
|
49
|
+
|
|
50
|
+
const length = Math.min(nbPoints, re.length);
|
|
51
|
+
|
|
52
|
+
newRE.set(re.slice(0, length - pointsToShift));
|
|
53
|
+
newIM.set(im.slice(0, length - pointsToShift));
|
|
54
|
+
newX.set(x.slice(0, length - pointsToShift));
|
|
55
|
+
|
|
56
|
+
let diff = x[1] - x[0];
|
|
57
|
+
let currentX = x[length - pointsToShift - 1];
|
|
58
|
+
for (let i = length - pointsToShift; i < nbPoints; i++) {
|
|
59
|
+
currentX += diff;
|
|
60
|
+
newX[i] = currentX;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (pointsToShift > 0 && pointsToShift < nbPoints) {
|
|
64
|
+
newRE.set(re.slice(re.length - pointsToShift), nbPoints - pointsToShift);
|
|
65
|
+
newIM.set(im.slice(re.length - pointsToShift), nbPoints - pointsToShift);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
datum1D.data = { ...datum1D.data, re: newRE, im: newIM, x: newX };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function isApplicable(
|
|
72
|
+
datum1D: Entry1D,
|
|
73
|
+
): datum1D is Entry1D & { data: Required<Data1D> } {
|
|
74
|
+
if (datum1D.info.isComplex && datum1D.info.isFid) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function reduce(
|
|
81
|
+
_previousValue: ZeroFillingOptions,
|
|
82
|
+
newValue: ZeroFillingOptions,
|
|
83
|
+
) {
|
|
84
|
+
delete newValue.factor;
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
once: true,
|
|
88
|
+
reduce: newValue,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Integral } from '../../types/Integral';
|
|
2
|
+
import { Integrals } from '../../types/Integrals';
|
|
3
|
+
import { Range, Ranges } from '../../types/Ranges/Ranges';
|
|
4
|
+
import { getSum } from '../../utilities/getSum';
|
|
5
|
+
|
|
6
|
+
export function updateRelatives<Data extends Integral | Range>(
|
|
7
|
+
data: Data extends Integral ? Integrals : Ranges,
|
|
8
|
+
key: keyof Extract<Data, string>,
|
|
9
|
+
check: (value: any) => boolean,
|
|
10
|
+
forceCalculateIntegral = false,
|
|
11
|
+
): void {
|
|
12
|
+
const { values, options } = data;
|
|
13
|
+
|
|
14
|
+
const currentSum = getSum(values, 'absolute', check);
|
|
15
|
+
|
|
16
|
+
let factor = 0;
|
|
17
|
+
if (options?.sum) {
|
|
18
|
+
if (options.isSumConstant || forceCalculateIntegral) {
|
|
19
|
+
factor = currentSum > 0 ? options.sum / currentSum : 0;
|
|
20
|
+
} else if (values?.[0]) {
|
|
21
|
+
const item = values[0];
|
|
22
|
+
//@ts-expect-error should works well
|
|
23
|
+
factor = (item[key as string] || options.sum) / item.absolute;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
data.values = mapValues(values, factor, check) as Data extends Integral
|
|
28
|
+
? Integral[]
|
|
29
|
+
: Range[];
|
|
30
|
+
|
|
31
|
+
if (!options.isSumConstant && !forceCalculateIntegral) {
|
|
32
|
+
options.sum = getSum(values, key as string, check);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function mapValues<T extends Integral[] | Range[]>(
|
|
37
|
+
values: T,
|
|
38
|
+
factor: number,
|
|
39
|
+
check: (value: any) => boolean,
|
|
40
|
+
) {
|
|
41
|
+
return values.map((value) => {
|
|
42
|
+
return {
|
|
43
|
+
...value,
|
|
44
|
+
...(check(value) && {
|
|
45
|
+
//@ts-expect-error should works well
|
|
46
|
+
[key as string]: value.absolute * factor,
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { v4 as generateID } from '@lukeed/uuid';
|
|
2
|
+
import omit from 'lodash/omit';
|
|
3
|
+
|
|
4
|
+
import { DatumKind } from '../../../constants/SignalsKinds';
|
|
5
|
+
import { Range } from '../../../types/Ranges/Ranges';
|
|
6
|
+
import { Signal1D } from '../../../types/Signals/Signal1D';
|
|
7
|
+
|
|
8
|
+
export function getDiaIDs(range: Range): string[] {
|
|
9
|
+
return ([] as string[]).concat(
|
|
10
|
+
range.diaIDs || [],
|
|
11
|
+
range.signals
|
|
12
|
+
? range.signals.flatMap((_signal) => _signal.diaIDs || [])
|
|
13
|
+
: [],
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function getNbAtoms(range: Range, signalIndex?: number): number {
|
|
18
|
+
if (signalIndex === undefined) {
|
|
19
|
+
let sum = 0;
|
|
20
|
+
if (range.signals) {
|
|
21
|
+
for (const signal of range.signals) {
|
|
22
|
+
sum += signal.nbAtoms || 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return sum;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return range.signals[signalIndex].nbAtoms || 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function setNbAtoms(range: Range, signalIndex?: number): void {
|
|
32
|
+
range.nbAtoms = getNbAtoms(range, signalIndex);
|
|
33
|
+
if (range.nbAtoms === 0) {
|
|
34
|
+
delete range.nbAtoms;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function resetDiaIDs(range: Range): void {
|
|
39
|
+
const deletedKeys = ['diaIDs', 'nbAtoms'];
|
|
40
|
+
range = omit(range, deletedKeys) as Range;
|
|
41
|
+
range.signals = range.signals.map((signal) => {
|
|
42
|
+
return omit(signal, deletedKeys) as Signal1D;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @param {object} range
|
|
49
|
+
* @param {String('both' | 'range' | 'signal')} unlinkType
|
|
50
|
+
* @param {object} options
|
|
51
|
+
* @param {number} [options.signalIndex]
|
|
52
|
+
* @returns {object}
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
interface UnlinkOptions {
|
|
56
|
+
unlinkType?: 'both' | 'range' | 'signal';
|
|
57
|
+
signalIndex?: number;
|
|
58
|
+
}
|
|
59
|
+
export function unlink(range: Range, options: UnlinkOptions = {}): Range {
|
|
60
|
+
const { unlinkType = 'both', signalIndex = -1 } = options;
|
|
61
|
+
const keys = ['diaIDs', 'nbAtoms'];
|
|
62
|
+
|
|
63
|
+
switch (unlinkType) {
|
|
64
|
+
case 'both':
|
|
65
|
+
resetDiaIDs(range);
|
|
66
|
+
break;
|
|
67
|
+
case 'range':
|
|
68
|
+
range = omit(range, keys) as Range;
|
|
69
|
+
break;
|
|
70
|
+
case 'signal':
|
|
71
|
+
if (signalIndex !== -1) {
|
|
72
|
+
range.signals[signalIndex] = omit(
|
|
73
|
+
range.signals[signalIndex],
|
|
74
|
+
keys,
|
|
75
|
+
) as Signal1D;
|
|
76
|
+
}
|
|
77
|
+
break;
|
|
78
|
+
default:
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
return range;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function addDefaultSignal(range: Range) {
|
|
85
|
+
range.signals.push({
|
|
86
|
+
id: generateID(),
|
|
87
|
+
multiplicity: 'm',
|
|
88
|
+
kind: 'signal',
|
|
89
|
+
js: [],
|
|
90
|
+
delta: (range.to + range.from) / 2,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function checkRangeKind(range: Range) {
|
|
95
|
+
return range.kind === DatumKind.signal;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function checkSignalKinds(range: Range, kinds: string[]) {
|
|
99
|
+
return !range.signals.some(
|
|
100
|
+
(_signal) => _signal.kind === undefined || !kinds.includes(_signal.kind),
|
|
101
|
+
);
|
|
102
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SignalKindsToInclude } from '../../../constants/SignalsKinds';
|
|
2
|
+
import { Integral } from '../../../types/Integral';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* check whether integral based on its kind can be included in another operation or not
|
|
6
|
+
* @param integral integral
|
|
7
|
+
* @returns {boolean}
|
|
8
|
+
*/
|
|
9
|
+
export function checkIntegralKind(integral: Integral): boolean {
|
|
10
|
+
return SignalKindsToInclude.includes(integral.kind);
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SignalKindsToInclude } from '../../../constants/SignalsKinds';
|
|
2
|
+
import { Range } from '../../../types/Ranges/Ranges';
|
|
3
|
+
|
|
4
|
+
import { checkSignalKinds } from './RangeUtilities';
|
|
5
|
+
|
|
6
|
+
export function checkRangeKind(range: Range): boolean {
|
|
7
|
+
return range.signals && checkSignalKinds(range, SignalKindsToInclude);
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Spectrum1D } from '../../../types/Spectrum/Spectrum1D';
|
|
2
|
+
import { Filters } from '../../Filters';
|
|
3
|
+
|
|
4
|
+
export function getShiftX(spectrum: Spectrum1D): number {
|
|
5
|
+
const filter =
|
|
6
|
+
spectrum?.filters &&
|
|
7
|
+
spectrum?.filters.find((filter) => filter.name === Filters.shiftX.id);
|
|
8
|
+
|
|
9
|
+
return filter?.flag ? filter.value.shift : 0;
|
|
10
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { v4 } from '@lukeed/uuid';
|
|
2
|
+
import { xyIntegration } from 'ml-spectra-processing';
|
|
3
|
+
|
|
4
|
+
import { Integral } from '../../../types/Integral';
|
|
5
|
+
import { Spectrum1D } from '../../../types/Spectrum/Spectrum1D';
|
|
6
|
+
import { ShiftTarget } from '../../../types/common/MapOptions';
|
|
7
|
+
|
|
8
|
+
import { getShiftX } from './getShiftX';
|
|
9
|
+
|
|
10
|
+
function getRange(integral: Integral, shiftTarget: ShiftTarget, shift: number) {
|
|
11
|
+
const { originFrom, originTo, from, to } = integral;
|
|
12
|
+
if (shiftTarget === 'origin') {
|
|
13
|
+
return {
|
|
14
|
+
originFrom: from - shift,
|
|
15
|
+
originTo: to - shift,
|
|
16
|
+
from,
|
|
17
|
+
to,
|
|
18
|
+
};
|
|
19
|
+
} else {
|
|
20
|
+
return {
|
|
21
|
+
originFrom,
|
|
22
|
+
originTo,
|
|
23
|
+
from: originFrom + shift,
|
|
24
|
+
to: originTo + shift,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function mapIntegrals(
|
|
30
|
+
integrals: Integral[],
|
|
31
|
+
spectrum: Spectrum1D,
|
|
32
|
+
shiftTarget: ShiftTarget = 'origin',
|
|
33
|
+
) {
|
|
34
|
+
const { x, re } = spectrum.data;
|
|
35
|
+
const shiftX = getShiftX(spectrum);
|
|
36
|
+
|
|
37
|
+
return integrals.map((integral) => {
|
|
38
|
+
const integralBoundary = getRange(integral, shiftTarget, shiftX);
|
|
39
|
+
|
|
40
|
+
const absolute = xyIntegration(
|
|
41
|
+
{ x, y: re },
|
|
42
|
+
{ from: integralBoundary.from, to: integralBoundary.to, reverse: true },
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
...integral,
|
|
47
|
+
id: integral.id || v4(),
|
|
48
|
+
...integralBoundary,
|
|
49
|
+
absolute,
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { v4 } from '@lukeed/uuid';
|
|
2
|
+
|
|
3
|
+
import { Peak1D } from '../../../types/Peaks/Peak1D';
|
|
4
|
+
import { Spectrum1D } from '../../../types/Spectrum/Spectrum1D';
|
|
5
|
+
import { MapOptions, ShiftTarget } from '../../../types/common/MapOptions';
|
|
6
|
+
|
|
7
|
+
import { getShiftX } from './getShiftX';
|
|
8
|
+
import { getSpectrumErrorValue } from './getSpectrumErrorValue';
|
|
9
|
+
|
|
10
|
+
function isExists(peak: Peak1D, spectrum: Spectrum1D, error: number) {
|
|
11
|
+
// check if the Peak is already exists
|
|
12
|
+
for (const { x } of spectrum.peaks?.values || []) {
|
|
13
|
+
if (Math.abs(peak.x - x) < error) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function getPeakDelta(peak: Peak1D, shiftTarget: ShiftTarget, shift: number) {
|
|
21
|
+
const { originalX = 0, x } = peak;
|
|
22
|
+
if (shiftTarget === 'origin') {
|
|
23
|
+
return {
|
|
24
|
+
originalX: x - shift,
|
|
25
|
+
x,
|
|
26
|
+
};
|
|
27
|
+
} else {
|
|
28
|
+
return {
|
|
29
|
+
originalX,
|
|
30
|
+
x: originalX + shift,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function mapPeaks(
|
|
36
|
+
peaks: Peak1D[],
|
|
37
|
+
spectrum: Spectrum1D,
|
|
38
|
+
options: MapOptions = {},
|
|
39
|
+
) {
|
|
40
|
+
const { checkIsExisting = true, shiftTarget = 'origin' } = options;
|
|
41
|
+
const shiftX = getShiftX(spectrum);
|
|
42
|
+
const error = getSpectrumErrorValue(spectrum);
|
|
43
|
+
|
|
44
|
+
let newPeaks: Peak1D[] = [];
|
|
45
|
+
|
|
46
|
+
for (const peak of peaks) {
|
|
47
|
+
const peakDelta = getPeakDelta(peak, shiftTarget, shiftX);
|
|
48
|
+
|
|
49
|
+
if (
|
|
50
|
+
!checkIsExisting ||
|
|
51
|
+
(checkIsExisting && !isExists(peak, spectrum, error))
|
|
52
|
+
) {
|
|
53
|
+
newPeaks.push({
|
|
54
|
+
...peak,
|
|
55
|
+
id: peak?.id || v4(),
|
|
56
|
+
...peakDelta,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return newPeaks;
|
|
62
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { v4 } from '@lukeed/uuid';
|
|
2
|
+
import { xyIntegration } from 'ml-spectra-processing';
|
|
3
|
+
|
|
4
|
+
import { DatumKind } from '../../../constants/SignalsKinds';
|
|
5
|
+
import { Range } from '../../../types/Ranges/Ranges';
|
|
6
|
+
import { Signal1D } from '../../../types/Signals/Signal1D';
|
|
7
|
+
import { Spectrum1D } from '../../../types/Spectrum/Spectrum1D';
|
|
8
|
+
import { MapOptions, ShiftTarget } from '../../../types/common/MapOptions';
|
|
9
|
+
|
|
10
|
+
import { getShiftX } from './getShiftX';
|
|
11
|
+
import { getSpectrumErrorValue } from './getSpectrumErrorValue';
|
|
12
|
+
|
|
13
|
+
function checkRange(range: Range, spectrum: Spectrum1D, error: number) {
|
|
14
|
+
// check if the range is already exists
|
|
15
|
+
for (const { from, to } of spectrum.ranges?.values || []) {
|
|
16
|
+
if (
|
|
17
|
+
Math.abs(range.from - from) < error &&
|
|
18
|
+
Math.abs(range.to - to) < error
|
|
19
|
+
) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getRange(
|
|
26
|
+
range: Range,
|
|
27
|
+
shiftTarget: 'origin' | 'current',
|
|
28
|
+
shift: number,
|
|
29
|
+
) {
|
|
30
|
+
const { originFrom, originTo, from, to } = range;
|
|
31
|
+
if (shiftTarget === 'origin') {
|
|
32
|
+
return {
|
|
33
|
+
originFrom: from - shift,
|
|
34
|
+
originTo: to - shift,
|
|
35
|
+
from,
|
|
36
|
+
to,
|
|
37
|
+
};
|
|
38
|
+
} else {
|
|
39
|
+
return {
|
|
40
|
+
originFrom,
|
|
41
|
+
originTo,
|
|
42
|
+
from: (originFrom || 0) + shift,
|
|
43
|
+
to: (originTo || 0) + shift,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function getSignalDelta(
|
|
48
|
+
signal: Signal1D,
|
|
49
|
+
shiftTarget: ShiftTarget,
|
|
50
|
+
shift: number,
|
|
51
|
+
) {
|
|
52
|
+
const { delta, originDelta } = signal;
|
|
53
|
+
if (shiftTarget === 'origin') {
|
|
54
|
+
return {
|
|
55
|
+
originDelta: delta - shift,
|
|
56
|
+
delta,
|
|
57
|
+
};
|
|
58
|
+
} else {
|
|
59
|
+
return {
|
|
60
|
+
originDelta,
|
|
61
|
+
delta: (originDelta || 0) + shift,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function mapRanges(
|
|
67
|
+
ranges: Range[],
|
|
68
|
+
spectrum: Spectrum1D,
|
|
69
|
+
options: MapOptions = {},
|
|
70
|
+
) {
|
|
71
|
+
const { checkIsExisting = true, shiftTarget = 'origin' } = options;
|
|
72
|
+
const { x, re } = spectrum.data;
|
|
73
|
+
const shiftX = getShiftX(spectrum);
|
|
74
|
+
const error = getSpectrumErrorValue(spectrum);
|
|
75
|
+
|
|
76
|
+
if (checkIsExisting) {
|
|
77
|
+
ranges = ranges.filter(
|
|
78
|
+
(r) =>
|
|
79
|
+
(checkIsExisting && !checkRange(r, spectrum, error)) || r.id === 'new',
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
return ranges.map((range) => {
|
|
83
|
+
const rangeBoundary = getRange(range, shiftTarget, shiftX);
|
|
84
|
+
|
|
85
|
+
const absolute = xyIntegration(
|
|
86
|
+
{ x, y: re },
|
|
87
|
+
{ from: rangeBoundary.from, to: rangeBoundary.to, reverse: true },
|
|
88
|
+
);
|
|
89
|
+
const signals = range.signals.map((signal) => {
|
|
90
|
+
const { kind = null, id, ...resSignal } = signal;
|
|
91
|
+
return {
|
|
92
|
+
kind: kind || 'signal',
|
|
93
|
+
id: id || v4(),
|
|
94
|
+
...resSignal,
|
|
95
|
+
...getSignalDelta(signal, shiftTarget, shiftX),
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
...range,
|
|
100
|
+
id: range.id || v4(),
|
|
101
|
+
kind: signals?.[0].kind || DatumKind.signal,
|
|
102
|
+
...rangeBoundary,
|
|
103
|
+
absolute,
|
|
104
|
+
signals,
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Spectrum1D } from '../../../types/Spectrum/Spectrum1D';
|
|
2
|
+
|
|
3
|
+
import { mapIntegrals } from './mapIntegrals';
|
|
4
|
+
import { updateIntegralsRelativeValues } from './updateIntegralsRelativeValues';
|
|
5
|
+
|
|
6
|
+
export function updateIntegrals(spectrum: Spectrum1D) {
|
|
7
|
+
spectrum.integrals.values = mapIntegrals(
|
|
8
|
+
spectrum.integrals.values,
|
|
9
|
+
spectrum,
|
|
10
|
+
'current',
|
|
11
|
+
);
|
|
12
|
+
updateIntegralsRelativeValues(spectrum, true);
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Integral } from '../../../types/Integral';
|
|
2
|
+
import { Spectrum1D } from '../../../types/Spectrum/Spectrum1D';
|
|
3
|
+
import { updateRelatives } from '../updateRelatives';
|
|
4
|
+
|
|
5
|
+
import { checkIntegralKind } from './checkIntegralKind';
|
|
6
|
+
|
|
7
|
+
export function updateIntegralsRelativeValues(
|
|
8
|
+
spectrum: Spectrum1D,
|
|
9
|
+
forceCalculateIntegral = false,
|
|
10
|
+
) {
|
|
11
|
+
updateRelatives<Integral>(
|
|
12
|
+
spectrum.integrals,
|
|
13
|
+
'integral',
|
|
14
|
+
checkIntegralKind,
|
|
15
|
+
forceCalculateIntegral,
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Spectrum1D } from '../../../types/Spectrum/Spectrum1D';
|
|
2
|
+
|
|
3
|
+
import { mapPeaks } from './mapPeaks';
|
|
4
|
+
|
|
5
|
+
export function updatePeaks(spectrum: Spectrum1D) {
|
|
6
|
+
spectrum.peaks.values = mapPeaks(spectrum.peaks.values, spectrum, {
|
|
7
|
+
checkIsExisting: false,
|
|
8
|
+
shiftTarget: 'current',
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Spectrum1D } from '../../../types/Spectrum/Spectrum1D';
|
|
2
|
+
|
|
3
|
+
import { mapRanges } from './mapRanges';
|
|
4
|
+
import { updateRangesRelativeValues } from './updateRangesRelativeValues';
|
|
5
|
+
|
|
6
|
+
export function updateRanges(spectrum: Spectrum1D) {
|
|
7
|
+
spectrum.ranges.values = mapRanges(spectrum.ranges.values, spectrum, {
|
|
8
|
+
checkIsExisting: false,
|
|
9
|
+
shiftTarget: 'current',
|
|
10
|
+
});
|
|
11
|
+
updateRangesRelativeValues(spectrum, true);
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Spectrum1D } from '../../../types/Spectrum/Spectrum1D';
|
|
2
|
+
import { updateRelatives } from '../updateRelatives';
|
|
3
|
+
|
|
4
|
+
import { checkRangeKind } from './checkRangeKind';
|
|
5
|
+
|
|
6
|
+
export function updateRangesRelativeValues(
|
|
7
|
+
spectrum: Spectrum1D,
|
|
8
|
+
forceCalculateIntegral = false,
|
|
9
|
+
) {
|
|
10
|
+
updateRelatives(
|
|
11
|
+
spectrum.ranges,
|
|
12
|
+
'integration',
|
|
13
|
+
checkRangeKind,
|
|
14
|
+
forceCalculateIntegral,
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MinMaxContent } from 'cheminfo-types';
|
|
2
|
+
|
|
3
|
+
import { Entry2D } from '../../../xyz/Entry2D';
|
|
4
|
+
import { FilterDomainUpdateRules } from '../../FiltersManager';
|
|
5
|
+
|
|
6
|
+
export const id = 'shift2DX';
|
|
7
|
+
export const name = 'Shift 2D X';
|
|
8
|
+
|
|
9
|
+
export const DOMAIN_UPDATE_RULES: Readonly<FilterDomainUpdateRules> = {
|
|
10
|
+
updateXDomain: true,
|
|
11
|
+
updateYDomain: false,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} datum2d
|
|
17
|
+
* @param {number} [shiftValue=0]
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export function apply(datum2D: Entry2D, shiftValue = 0) {
|
|
21
|
+
const data: Record<string, MinMaxContent> = { ...datum2D.data };
|
|
22
|
+
for (const key in data) {
|
|
23
|
+
data[key].minX += shiftValue;
|
|
24
|
+
data[key].maxX += shiftValue;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function isApplicable() {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function reduce(previousValue: number, newValue: number) {
|
|
33
|
+
return {
|
|
34
|
+
once: true,
|
|
35
|
+
reduce: previousValue + newValue,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { MinMaxContent } from 'cheminfo-types';
|
|
2
|
+
|
|
3
|
+
import { Entry2D } from '../../../xyz/Entry2D';
|
|
4
|
+
import { FilterDomainUpdateRules } from '../../FiltersManager';
|
|
5
|
+
|
|
6
|
+
export const id = 'shift2DY';
|
|
7
|
+
export const name = 'Shift 2D Y';
|
|
8
|
+
|
|
9
|
+
export const DOMAIN_UPDATE_RULES: Readonly<FilterDomainUpdateRules> = {
|
|
10
|
+
updateXDomain: false,
|
|
11
|
+
updateYDomain: true,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} datum2d
|
|
17
|
+
* @param {number} [shiftValue=0]
|
|
18
|
+
*/
|
|
19
|
+
export function apply(datum2D: Entry2D, shiftValue = 0) {
|
|
20
|
+
const data: Record<string, MinMaxContent> = { ...datum2D.data };
|
|
21
|
+
for (const key in data) {
|
|
22
|
+
data[key].minY += shiftValue;
|
|
23
|
+
data[key].maxY += shiftValue;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function isApplicable() {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function reduce(previousValue: number, newValue: number) {
|
|
32
|
+
return {
|
|
33
|
+
once: true,
|
|
34
|
+
reduce: previousValue + newValue,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Data2DFid, Data2DFt } from 'cheminfo-types';
|
|
2
|
+
|
|
3
|
+
import { Spectrum2D } from '../../../types/Spectrum/Spectrum2D';
|
|
4
|
+
|
|
5
|
+
export interface Zone2DError {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function get2DSpectrumErrorValue(spectrum: Spectrum2D): Zone2DError {
|
|
11
|
+
const { data, info } = spectrum;
|
|
12
|
+
const { minX, maxX, minY, maxY } = info.isFid
|
|
13
|
+
? (data as Data2DFid).re
|
|
14
|
+
: (data as Data2DFt).rr;
|
|
15
|
+
const x = Math.abs(maxX - minX) / 10000;
|
|
16
|
+
const y = Math.abs(maxY - minY) / 10000;
|
|
17
|
+
return { x, y };
|
|
18
|
+
}
|