Built with blockbuilder.org
-
-
Save timelyportfolio/a6ca7871defb9743efce to your computer and use it in GitHub Desktop.
Real-time bandlines
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"> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.18.0/ramda.min.js"></script> | |
| <link href="bandline.css" rel="stylesheet" type="text/css" /> | |
| <script src="flyd.js" type="text/javascript"></script> | |
| <script src="du.js" type="text/javascript"></script> | |
| <script src="data.js" type="text/javascript"></script> | |
| <script src="model.js" type="text/javascript"></script> | |
| <script src="bandline.js" type="text/javascript"></script> | |
| <script defer="defer" src="render.js" type="text/javascript"></script> | |
| <style> | |
| body { | |
| margin-left: 160px; | |
| margin-top: 40px; | |
| font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |
| font-size: 14px; | |
| } | |
| .header { | |
| font-weight: bold; | |
| fill: #777; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <script> | |
| var margin = {top: 20, right: 10, bottom: 20, left: 10}; | |
| var width = 960 - margin.left - margin.right; | |
| var height = 500 - margin.top - margin.bottom; | |
| var svg = d3.select("body").append("svg") | |
| .attr("width", width + margin.left + margin.right) | |
| .attr("height", height + margin.top + margin.bottom) | |
| .append("g") | |
| .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); | |
| // Feel free to change or delete any of the code you see! | |
| svg.append("rect") | |
| .attr({x: 100, y: 10, width: width - 200, height: height - 20}) | |
| .style({ fill: "#a72d1a"}) | |
| .transition().duration(3000).ease("bounce") | |
| .style({ fill: "#5db9e3"}) | |
| console.log("you are now rocking with d3", d3); | |
| </script> | |
| </body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment