Skip to content

Instantly share code, notes, and snippets.

@acatejr
Last active April 21, 2016 21:48
Show Gist options
  • Save acatejr/2b4fa88dfb632dc67d56d71c6d062272 to your computer and use it in GitHub Desktop.
Save acatejr/2b4fa88dfb632dc67d56d71c6d062272 to your computer and use it in GitHub Desktop.
D3.js Code Snippets
// How to group data
var map = d3.nest()
.key(function(d) { return d.attribute; })
.rollup(function(v) {
return {
count: v.length
};
})
.map(data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment