From a45bbc3f3047367f4d77923bebe31588dbee6add Mon Sep 17 00:00:00 2001 From: Jose Quintas Date: Wed, 19 Jun 2024 10:31:01 +0200 Subject: [PATCH] Move consts back out --- .../x-charts/src/context/CartesianProvider/computeValue.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/x-charts/src/context/CartesianProvider/computeValue.ts b/packages/x-charts/src/context/CartesianProvider/computeValue.ts index 0d66626f6613..053b51cf1afd 100644 --- a/packages/x-charts/src/context/CartesianProvider/computeValue.ts +++ b/packages/x-charts/src/context/CartesianProvider/computeValue.ts @@ -27,6 +27,9 @@ const getRange = (drawingArea: DrawingArea, axisName: 'x' | 'y', isReverse?: boo return isReverse ? range.reverse() : range; }; +const DEFAULT_CATEGORY_GAP_RATIO = 0.2; +const DEFAULT_BAR_GAP_RATIO = 0.1; + export function computeValue( drawingArea: DrawingArea, formattedSeries: FormattedSeries, @@ -77,9 +80,6 @@ export function computeValue( const range = getRange(drawingArea, axisName, axis.reverse); if (isBandScaleConfig(axis)) { - const DEFAULT_CATEGORY_GAP_RATIO = 0.2; - const DEFAULT_BAR_GAP_RATIO = 0.1; - const categoryGapRatio = axis.categoryGapRatio ?? DEFAULT_CATEGORY_GAP_RATIO; const barGapRatio = axis.barGapRatio ?? DEFAULT_BAR_GAP_RATIO; // Reverse range because ordinal scales are presented from top to bottom on y-axis