import { StemPlot } from './StemPlot' type Props = { amplitudes: number[] /** degrees */ phasesDeg: number[] color: string } const PHASE_TICKS = [-180, -90, 0, 90, 180] const degLabel = (v: number) => `${v}°` /** Fourier coefficients of the tone: amplitude and phase per harmonic. */ export function SpectrumPlot({ amplitudes, phasesDeg, color }: Props) { const aMax = Math.max(1, ...amplitudes) const aTicks = [0, aMax / 2, aMax] return (