From ccf152dbfd101c279901bde29cce71016cda0fdd Mon Sep 17 00:00:00 2001 From: Aleksei Ilin Date: Wed, 9 Sep 2026 06:45:33 +0200 Subject: [PATCH] fix: remove sign-guarded symlog from logarithm axis to fix negative labels for sub-1 prices --- src/extension/y-axis/logarithm.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/extension/y-axis/logarithm.ts b/src/extension/y-axis/logarithm.ts index 6c8b97ac2..279359ec9 100644 --- a/src/extension/y-axis/logarithm.ts +++ b/src/extension/y-axis/logarithm.ts @@ -18,14 +18,14 @@ import type { AxisTemplate } from '../../component/Axis' const logarithm: AxisTemplate = { name: 'logarithm', minSpan: (precision) => 0.05 * index10(-precision), - valueToRealValue: (value) => (value < 0 ? -log10(Math.abs(value)) : log10(value)), - realValueToDisplayValue: (value) => (value < 0 ? -index10(Math.abs(value)) : index10(value)), - displayValueToRealValue: (value) => (value < 0 ? -log10(Math.abs(value)) : log10(value)), - realValueToValue: (value) => (value < 0 ? -index10(Math.abs(value)) : index10(value)), + valueToRealValue: (value) => log10(value), + realValueToDisplayValue: (value) => index10(value), + displayValueToRealValue: (value) => log10(value), + realValueToValue: (value) => index10(value), createRange: ({ defaultRange }) => { const { from, to, range } = defaultRange - const realFrom = from < 0 ? -log10(Math.abs(from)) : log10(from) - const realTo = to < 0 ? -log10(Math.abs(to)) : log10(to) + const realFrom = log10(from) + const realTo = log10(to) return { from, to,