{
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append('g')
.attr('transform', `translate(0, ${height - margin.bottom})`)
.call(d3.axisBottom(bar_scale))
svg.selectAll('rect')
.data(olympians.map(d => d.sport))
.join('rect')
.attr('x', d => bar_scale(d))
.attr('width', bar_scale.bandwidth())
.attr('y', margin.top)
.attr('height', height - margin.bottom - margin.top)
.style('stroke', 'white');
return svg.node();
}