Skip to content

Commit

Permalink
Move consts back out
Browse files Browse the repository at this point in the history
  • Loading branch information
JCQuintas committed Jun 19, 2024
1 parent b606028 commit a45bbc3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a45bbc3

Please sign in to comment.