Viewing a saved revision (read-only)
67bf53a9a9ef43b29238218b31447be6
Fork for SDV assn 6 M&K
This example visualizes the distribution of hero primary attributes by attack type, using grouped horizontal bars to compare counts of melee and ranged attacks across different attribute categories. The chart is rendered as an SVG via React and D3 v7, with data loaded from a CSV file and processed using `d3.group` to nest attack type counts within each primary attribute. Bars are colored using `d3.scaleOrdinal` with a light blue for melee and dark blue for ranged, while value labels are placed at the end of each bar. The visualization uses `d3.scaleBand` for the categorical y-axis and `d3.scaleLinear` for the numeric x-axis, with hover logging enabled for debugging.
AI-generated descriptionThis bar chart shows population of the top 10 most populous countries. The data comes from the year 2018 estimate in United Nations: World Population Prospects 2017. It also demonstrates customization of D3 axes.