Notes for March 8

Project 1 has started up! Make sure that you submit Milestone 1 on Friday for completion credit.

Today we're looking at data joins. There are now two different ways to do a data join in d3.
This page demonstrates the "new" way to do joins.
While another page demonstrates the "old" style of join.

For this class the .join("elementName") pattern in a new style data join is often enough. You will start to use the .join(enter => {}, update => {}, exit => {} ) pattern when you have animated transitions or more involved steps in creating elements.

If you're still confused about why we use translate to make scatterplots, Mike Bostock has a handy page discussing chart margins.

HTML for today:

Data join demo:

[ - - - - - - - - - ]

Scatterplot:

Code for today, pt1:
    
    
  
Code for today, pt2: