Skip to content

Instantly share code, notes, and snippets.

@gabrielflorit
Created August 10, 2012 01:19
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 gabrielflorit/3310044 to your computer and use it in GitHub Desktop.
Save gabrielflorit/3310044 to your computer and use it in GitHub Desktop.
svg {
background: #222222;
}
rect {
fill: #FFFFFF;
}
var width = $('svg').width();
var height = $('svg').height();
var svg = d3.select('svg');
var g = svg.append('g');
svg
.attr('width', width)
.attr('height', height);
g.selectAll('rect')
.data([1])
.enter().append('rect')
.attr('x', 0)
.attr('y', 0)
.attr('width', 100)
.attr('height', 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment