View this code at http://livecoding.io/5523152
Created
May 6, 2013 03:05
-
-
Save neilus/5523152 to your computer and use it in GitHub Desktop.
created by livecoding - http://livecoding.io/3419316
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"libraries": [ | |
"d3" | |
], | |
"mode": "javascript", | |
"layout": "fullscreen mode (horizontal)", | |
"resolution": "reset" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
svg { | |
position: absolute; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg></svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var width = $('svg').width(); | |
var height = $('svg').height(); | |
var svg = d3.select('svg'); | |
svg | |
.attr('width', width) | |
.attr('height', height); | |
numbers = [120,,54,160,180,240]; | |
svg.selectAll('circle') | |
.data(numbers) | |
.enter().append('circle') | |
.attr('cy', 236) | |
.attr('cx', String) | |
.attr('r', Math.sqrt); | |
divs = d3.selectAll("div") | |
.data(numbers) | |
.enter().text(String) | |
.append("div"); | |
divs.exit(); | |
divs.update(); | |
divs.order(); | |
/* | |
var circles = svg.selectAll("circle"); | |
circles.style("fill",d3.color(String)); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment