Skip to content

Commit

Permalink
Fussing about comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicScrewdriver committed Aug 27, 2024
1 parent e25cf31 commit b283d18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const YGridTick = ({y, range}: {y: number; range: [Interval, Interval]}) => {
const yPositionText = yPosition + tickLabelSize * 0.25; // Center the text vertically on the tick

// If the graph displays both the y and x axis lines within the graph, we want
// to hide the tick at -1 on the y-axis to prevent overlap with the x-axis line
// to hide the label at -1 on the y-axis to prevent overlap with the x-axis label
const hideNegative1 = range[X][MIN] < 0 && range[X][MAX] > -1;
if (hideNegative1 && y === -1) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ const axisOptions = (
// Get the vertical adjustment for the grid clippig mask based on the range
const getVerticalClipAdjustment = (range: GraphRange) => {
const yMax = range[1][1];
// If the yMax is less than or equal to 0 and is an odd number
// If the yMax is odd, less than or equal to 0, and not -1 (special case),
// then we need to adjust the grid by 6.6 units to accomodate the
// size of the axis arrows. Otherwise, we need to adjust by 0.5 units
// for just the grid border.
// to accommodate for just the grid border.
return yMax <= 0 && yMax % 2 !== 0 && yMax !== -1 ? 6.6 : 0.5;
};

Expand All @@ -85,7 +85,7 @@ const getClipPath = (
const yMax = yPaneRange[1];

// Adjust the necessary padding for the clipping path
// by the range of the graph and the graph bounds
// by the range of the graph and the graph bounds
const xPad = range[0][0] - Math.min(0, xMin);
const yPad = range[1][1] - Math.max(0, yMax);

Expand Down

0 comments on commit b283d18

Please sign in to comment.