Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created June 4, 2013 19:34
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 tmcw/5708838 to your computer and use it in GitHub Desktop.
Save tmcw/5708838 to your computer and use it in GitHub Desktop.
{
"libraries": [
"d3"
],
"mode": "css",
"layout": "fullscreen mode (vertical)",
"resolution": "reset"
}
svg {
position: absolute;
}
var width = $('svg').width();
var height = $('svg').height();
var svg = d3.select('svg');
svg
.attr('width', width)
.attr('height', height);
svg.selectAll('rect')
.data([1])
.enter().append('rect')
.attr('y', height/2)
.attr('x', width/2)
.attr('width', 70)
.attr('height', 30);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment