Skip to content

Commit

Permalink
✨ (axis) align ticks with domain line on edges
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed May 21, 2024
1 parent 96906f9 commit 33bacb2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/@ourworldindata/grapher/src/axis/AxisViews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export class HorizontalAxisComponent extends React.Component<{
preferredAxisPosition,
labelColor,
tickColor,
tickMarkWidth,
tickMarkWidth = 1,
detailsMarker,
} = this.props
const { tickLabels, labelTextWrap: label, labelOffset, orient } = axis
Expand Down Expand Up @@ -408,9 +408,13 @@ export class HorizontalAxisComponent extends React.Component<{
{showTickMarks && (
<line
x1={axis.place(label.value)}
y1={tickMarksYPosition}
y1={tickMarksYPosition - tickMarkWidth / 2}
x2={axis.place(label.value)}
y2={tickMarksYPosition + tickSize}
y2={
tickMarksYPosition -
tickMarkWidth / 2 +
tickSize
}
stroke={SOLID_TICK_COLOR}
strokeWidth={tickMarkWidth}
/>
Expand Down

0 comments on commit 33bacb2

Please sign in to comment.