Skip to content

Commit a45bbc3

Browse files
committed
Move consts back out
1 parent b606028 commit a45bbc3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/x-charts/src/context/CartesianProvider/computeValue.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ const getRange = (drawingArea: DrawingArea, axisName: 'x' | 'y', isReverse?: boo
2727
return isReverse ? range.reverse() : range;
2828
};
2929

30+
const DEFAULT_CATEGORY_GAP_RATIO = 0.2;
31+
const DEFAULT_BAR_GAP_RATIO = 0.1;
32+
3033
export function computeValue(
3134
drawingArea: DrawingArea,
3235
formattedSeries: FormattedSeries,
@@ -77,9 +80,6 @@ export function computeValue(
7780
const range = getRange(drawingArea, axisName, axis.reverse);
7881

7982
if (isBandScaleConfig(axis)) {
80-
const DEFAULT_CATEGORY_GAP_RATIO = 0.2;
81-
const DEFAULT_BAR_GAP_RATIO = 0.1;
82-
8383
const categoryGapRatio = axis.categoryGapRatio ?? DEFAULT_CATEGORY_GAP_RATIO;
8484
const barGapRatio = axis.barGapRatio ?? DEFAULT_BAR_GAP_RATIO;
8585
// Reverse range because ordinal scales are presented from top to bottom on y-axis

0 commit comments

Comments
 (0)