Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created June 4, 2013 19:33
Show Gist options
  • Save tmcw/5708828 to your computer and use it in GitHub Desktop.
Save tmcw/5708828 to your computer and use it in GitHub Desktop.
{
"libraries": [
"d3"
],
"mode": "css",
"layout": "fullscreen mode (vertical)",
"resolution": "reset"
}
svg {
position: absolute;
}
<!-- html goes here -->
<svg></svg>
var width = $('svg').width();
var height = $('svg').height();
var svg = d3.select('svg');
svg
.attr('width', width)
.attr('height', height);
svg.selectAll('ellipse')
.data([1])
.enter().append('ellipse')
.attr('cy', height/2)
.attr('cx', width/2)
.attr('rx', 70)
.attr('ry', 30);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment