diff --git a/src/data/data1d/Spectrum1D/initiateDatum1D.ts b/src/data/data1d/Spectrum1D/initiateDatum1D.ts index 344b71edb..1e38857d0 100644 --- a/src/data/data1d/Spectrum1D/initiateDatum1D.ts +++ b/src/data/data1d/Spectrum1D/initiateDatum1D.ts @@ -22,7 +22,7 @@ export function initiateDatum1D( ): Spectrum1D { const { usedColors = {}, filters = [] } = options; - const spectrumObj: Partial = {}; + const spectrumObj: Partial = { ...spectrum }; spectrumObj.id = spectrum.id || v4(); spectrumObj.display = { diff --git a/src/data/data2d/Spectrum2D/initiateDatum2D.ts b/src/data/data2d/Spectrum2D/initiateDatum2D.ts index e3bc4e5de..cb3c5459c 100644 --- a/src/data/data2d/Spectrum2D/initiateDatum2D.ts +++ b/src/data/data2d/Spectrum2D/initiateDatum2D.ts @@ -10,10 +10,9 @@ import { initiateZones } from './zones/initiateZones'; const defaultMinMax = { z: [], minX: 0, minY: 0, maxX: 0, maxY: 0 }; export function initiateDatum2D(spectrum: any, usedColors = {}): Spectrum2D { - const datum: any = {}; + const datum: any = { ...spectrum }; datum.id = spectrum.id || v4(); - datum.selector = spectrum?.selector || {}; datum.display = { isPositiveVisible: true,