Skip to content

Instantly share code, notes, and snippets.

@blehman
Created November 3, 2013 22:57
Show Gist options
  • Save blehman/7295836 to your computer and use it in GitHub Desktop.
Save blehman/7295836 to your computer and use it in GitHub Desktop.
Tributary inlet
{"description":"Tributary inlet","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01}
var data = [
{ name: "Alice", values:[2,4,5,6,7]},
{ name: "Bob", values:[2,4,5,6,7]},
{ name: "Chris", values:[2,4,5,6,7]}
];
var svg = d3.select("svg");
var names = d3.selectAll(".name").data(data);
var stack = d3.layout.stack().values(function(d) { return d.values; } );
console.log(stack(data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment