Skip to content

Commit

Permalink
fix: Correct vertical grid lines positioning in chart
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Nov 27, 2024
1 parent 734afde commit 4adc890
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hugo-site/static/js/small-world-scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ waitForD3().then(() => {

// Add static elements
// Add gridlines
// Add horizontal grid lines
chartG.append('g')
.attr('class', 'grid')
.attr('opacity', 0.1)
Expand All @@ -263,13 +264,14 @@ waitForD3().then(() => {
.tickSize(-chartWidth)
.tickFormat(''));

// Add vertical grid lines
chartG.append('g')
.attr('class', 'grid')
.attr('transform', `translate(0,${chartHeight})`)
.attr('opacity', 0.1)
.call(d3.axisBottom(xScale)
.ticks(10)
.tickSize(chartHeight)
.tickSize(-chartHeight) // Changed from positive to negative
.tickFormat(''));

// Add the axes
Expand Down

0 comments on commit 4adc890

Please sign in to comment.