Skip to content

Instantly share code, notes, and snippets.

@gabrielflorit
Created August 21, 2012 05:44
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/3412267 to your computer and use it in GitHub Desktop.
Save gabrielflorit/3412267 to your computer and use it in GitHub Desktop.
created by livecoding - http://livecoding.io/3412267
{"libraries":["d3"]}
<h1>Hello! This is a graphic! Try:</h1>
<ul>
<li>adding another circle</li>
<li>making all the circles the same radius</li>
<li>coloring all the circles red</li>
<li>coloring all the circles olive green</li>
</ul>
<svg></svg>
var width = $('svg').width();
var height = $('svg').height();
var svg = d3.select('svg');
svg
.attr('width', width)
.attr('height', height);
svg.selectAll('circle')
.data([64, 128, 256])
.enter().append('circle')
.attr('cy', 128)
.attr('cx', String)
.attr('r', Math.sqrt);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment