Template for creating bl.ocks.
-
-
Save milroc/3063137 to your computer and use it in GitHub Desktop.
bl.ocks template
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
| <!DOCTYPE html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <link type="text/css" rel="stylesheet" href="style.css"/> | |
| </head> | |
| <body> | |
| <script src="http://mbostock.github.com/d3/d3.js?2.7.2"></script> | |
| <script src="src.js"></script> | |
| <script src="test.js"></script> | |
| <script src="lib.js"></script> | |
| </body> | |
| </html> |
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
| d3.helper = {}; | |
| d3.helper.property = function(value) { | |
| return function(_) { | |
| if (!arguments.length) return value; | |
| value = _; | |
| return this; | |
| }; | |
| }; |
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
| function chartType() { | |
| function chart(selection) { | |
| //render chart | |
| } | |
| return chart; | |
| } |
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
| body { | |
| background-color: #FFF; | |
| } |
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 data = []; | |
| d3.select("body").append("svg") | |
| .data(data) | |
| .call(chartType); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment