Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[charts] Divide CartesianProvider to use logic in Pro package #13531

Merged
merged 16 commits into from
Jun 19, 2024
Merged
Prev Previous commit
Move consts back out
  • Loading branch information
JCQuintas committed Jun 19, 2024
commit a45bbc3f3047367f4d77923bebe31588dbee6add
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(
JCQuintas marked this conversation as resolved.
Show resolved Hide resolved
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