Day 97 of 180 Days of Data Viz Learning #jfdi

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.

Code Learning:

D3 Nests Explained in Under Five Minutes

Three Takeaways:

  • Example:
    • var property_nest = d3.nest() //
      propertyNest.key(function(d) { return d.group}) //
      property.entries(data.properties) // activate our nest and output transformed version of input
      propertyNest.roll(function(S) { return d3.sum(s, function(d) {return d.oprice})}) // return rollup to property nest to get total cost of properties
  • In D3 nest roll-up, data is transformed. Keys just re-arrange.
  • Nest only creates new objects, data doesn’t change
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s