Created
August 21, 2012 05:45
-
-
Save gabrielflorit/3412272 to your computer and use it in GitHub Desktop.
created by livecoding - http://livecoding.io/3412272
This file contains hidden or 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"]} |
This file contains hidden or 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
| <h1>Hello! This is a graphic! Try:</h1> | |
| <ul> | |
| <li>placing the circle inside the square</li> | |
| <li>making the circle touch the square</li> | |
| </ul> | |
| <svg></svg> |
This file contains hidden or 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); | |
| svg.selectAll('circle') | |
| .data([18]) | |
| .enter().append('circle') | |
| .attr('cy', 296) | |
| .attr('cx', 300) | |
| .attr('r', 89); | |
| svg.selectAll('rect') | |
| .data([200]) | |
| .enter().append('rect') | |
| .attr('x', String) | |
| .attr('y', String) | |
| .attr('width', String) | |
| .attr('height', String) | |
| .style('fill', 'none') | |
| .style('stroke', '#000000'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment