fix: Y labels on gain graphs

This commit is contained in:
2026-10-25 16:43:28 +01:00
parent 4ca7410ad8
commit 998cd53ffe
2 changed files with 4 additions and 5 deletions
@@ -68,8 +68,7 @@ function buildCurvesForChannels<T extends string>(
}
const formatX = (v: number) => Math.round(v).toString();
export const formatOutputY = (v: number) => Math.round(v).toString();
export const formatInputY = (v: number) => {
export const formatY = (v: number) => {
if (v === 0) return '0';
if (v > 0) return v % 12 === 0 ? `+${Math.round(v)}` : '';
return Math.abs(v) % 15 === 0 ? Math.round(v).toString() : '';
@@ -17,7 +17,7 @@ import { CurvePoint, sumCurvePoints } from '../../utils/graph/curve';
import { getGeqCurvePoints } from '../../utils/graph/geq';
import { getPeqCurvePoints } from '../../utils/graph/peq';
import { getCrossoverCurvePoints } from '../../utils/graph/crossover';
import { ChannelCurves, formatInputY, formatOutputY, ResponseGraph } from './GainGraph';
import { ChannelCurves, formatY, ResponseGraph } from './GainGraph';
// ---- Curve construction -----------------------------------------------
@@ -336,7 +336,7 @@ function GainSection({
showStages={showInputStages}
liveGains={liveInputGains}
getChannelCurves={getInputChannelCurves}
formatY={formatInputY}
formatY={formatY}
/>
</div>
@@ -369,7 +369,7 @@ function GainSection({
showStages={showOutputStages}
liveGains={liveOutputGains}
getChannelCurves={getOutputChannelCurves}
formatY={formatOutputY}
formatY={formatY}
/>
</div>
</div>