Lab 1 Writeup
Tucker Craig
08/29/2017

1. What is the difference between d3.scaleBand() and d3.scaleLinear(), and why is the rangeRound perimeter defined as [height, 0] for the y-axis instead of [0, height]?

d3.scaleBand() takes each value in the domain will be mapped to an even length of the range, consisting of a length of band and a length of padding. where d3.scaleLinear() takes input from a continuous domain and maps it to a continuous range.

(https://www.pshrmn.com/tutorials/d3/scales/)

rangeRound starts at height and goes to 0 because we want the lowest value (the start of our rangeRound) to be at the bottom of our vertical axis. Because we are in the svg object, and because the top left corner of our webpage is 0,0, we start from the height of our svg block - which is really just the bottom edge of the section.

2. What is "g" in the following code?

var g = svg.append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

g is a variable, which we use to 'pick up' our bars for our graph and insert or append them into the svg.

3. What type is the UNIQUE_STUDENTS value?

UNIQUE_STUDENTS is a String, which is why we need to use '+' to convert to integer so the data is mean-able.

4. Imagine if you had visualized this data using a pie chart. Briefly compare and contrast a piechart and a bar graph and discuss advantages and disadvantages for each.

The pie chart would not be an appropriate representation because you wouldn't be able to easily tell the difference between any two subjects. Especially given our data set where many subjects yield the same or similar average interest. We are at an advantage by using a bar graph because of the amount of information the user can see at a glance.