I’m doing some form of data visualization learning for 180 days because I need to #JFDI.
See post explaining how and why I’m doing this.
Three Takeways Today
- Using .each() really a choice of syntax in many cases p 121
- When you write line generator functions, you need to define how it accesses the data to draw the line, append a <path> to the vans, and set its d attribution as equal to the the defined generator function. p 127
- var tweetLine = d3.svg.line()
- x(function(d) {
- return xScale(d.day); // defines accessor function to take day as attribute and pass it to xScale first
- })
- .y(function(d) {
- return yScale(d.tweets); // Take tweets and pass it to yScale
- });
- x(function(d) {
- d3.select(“svg”)
- .append(“path”)
- .attr(“d”, tweetLine(data)) // appended path is drawn according to the generator with loaded data
- .attr(“fill”, “none”)
- .attr(“stroke”, “blue”)
- .attr(“stroke-width”, 2);
- var tweetLine = d3.svg.line()
- If you create multiple lines, you’ll need multiple generator functions and multiple svgs with a different .attr(“d”, tweetLine(data), .attr(“d”, retweetLine(data)) p 128
Reading and Learning Data Visualization Theoretically/Critically:
- Use tables when you need people to look up individual value as easily as possible. Use graphs for when people need to be able to see patterns. p 44
- Tables for reporting on small sets of 20 numbers or less. Then get into graphs p 50
- Remember to design graphs for the story you want to tell p 51
Leave a Reply