Skip to content

Instantly share code, notes, and snippets.

@enjalot
Created April 28, 2013 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enjalot/5478507 to your computer and use it in GitHub Desktop.
Save enjalot/5478507 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},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/NapWbws.png"}
var data = [ {name: "first", start: 0, end: 23},
{name: "first", start: 5, end: 52},
{name: "first", start: 36, end: 34},
{name: "first", start: 52, end: 23}];
d3.select("#chart").append("svg");
var width = 100,
height = 100;
var svg = d3.select("svg")
var teams = svg.selectAll("g.team").data( data );
teams
.enter()
.append("g")
.attr("class", "team");
var l_col = teams.selectAll("text.label.act")
.data(function(d) { return [d]; });
l_col
.enter()
.append("text")
.classed("label act", true)
.attr("x", function(d) { return d.start; })
.attr("y", function(d) { return d.end; })
.text(function(d) { return d.name+ " " + d.start; });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment