Skip to content

Commit 6894669

Browse files
committed
fix(Spectrogram): fix shadow init display issue because of -Infinity value
1 parent 7d0deae commit 6894669

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/components/visualization/Spectrogram/Spectrogram.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ export const Spectrogram = forwardRef<SpectrogramRef, SpectrogramProps>((props,
157157
.attr('height', height)
158158
const frequencyResolution = SAMPLE_RATE / (fftSize * 2)
159159
const updatedData: SpectrogramDataPoint[] = _data.map((point, i) => ({
160-
...point,
161160
frequency: i * frequencyResolution,
161+
amplitude: point.amplitude === -Infinity ? -300 : point.amplitude,
162162
}))
163163

164164
// Create the area generator, to be used for the shadow

0 commit comments

Comments
 (0)