From 4adc890cad7a2bd289b2413b1f04f65ba335cf7d Mon Sep 17 00:00:00 2001 From: "Ian Clarke (aider)" Date: Wed, 27 Nov 2024 00:40:56 -0600 Subject: [PATCH] fix: Correct vertical grid lines positioning in chart --- hugo-site/static/js/small-world-scale.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hugo-site/static/js/small-world-scale.js b/hugo-site/static/js/small-world-scale.js index 1173db27..4c5d6aee 100644 --- a/hugo-site/static/js/small-world-scale.js +++ b/hugo-site/static/js/small-world-scale.js @@ -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) @@ -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