This version creates a bar chart that extends across a width
x height
SVG drawing canvas. It creates d3.scale
objects that create a linear mapping from the data values (0 to 42) and indices (0,1,2,3,4,5) to the SVG canvas's vertical (0 to height
) and horizontal (0 to width
) spans.
See Introducing d3-scale by Mike Bostock for more details on d3.scale
and how fundamental the mapping from data coordinates to viewing coordinates is to data visualization.