Activity8_Task1_DV_LB_Q1.2
A horizontal bar chart displays the population of twenty countries in 2020, with bars sorted by country name and scaled linearly along the x-axis. The visualization uses React components to render SVG elements, with d3.scaleBand and d3.scaleLinear handling the axes. D3's csv loader fetches the dataset from a GitHub raw URL, multiplies the 2010 value by 1000 to represent population, and formats tick labels using d3.format. Light green bars include native SVG tooltips showing the formatted population value.
AI-generated descriptionexport const AxisLeft = ({ yScale }) => yScale.domain().map(tickValue => ( <g className="tick"> <text key={tickValue} style={{ textAnchor: 'end' }} x={-3} dy=".32em" y={yScale(tickValue) + yScale.bandwidth() / 2} > {tickValue} </text> </g> ));