Built with blockbuilder.org
Created
May 2, 2017 13:45
-
-
Save wrigh3tl/e5b1c0b3f43f7213b7627c0976126de9 to your computer and use it in GitHub Desktop.
fresh block
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
license: mit |
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 flag_data = [ | |
{ | |
"color": "#009246", | |
"width": 200, | |
"height": 400, | |
"x": 100, | |
"y": 50 | |
}, | |
{ | |
"color": "#F1F2F1", | |
"width": 200, | |
"height": 400, | |
"x": 300, | |
"y": 50 | |
}, | |
{ | |
"color": "#CE2B37", | |
"width": 200, | |
"height": 400, | |
"x": 500, | |
"y": 50 | |
} | |
]; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<h1>This has been an interesting nightmare</h1> | |
<script type="text/javascript" src="d3.v2.min.js"> | |
var var flag_data = [ | |
{ | |
"color": "#009246", | |
"width": 200, | |
"height": 400, | |
"x": 100, | |
"y": 50 | |
}, | |
{ | |
"color": "#F1F2F1", | |
"width": 200, | |
"height": 400, | |
"x": 300, | |
"y": 50 | |
}, | |
{ | |
"color": "#CE2B37", | |
"width": 200, | |
"height": 400, | |
"x": 500, | |
"y": 50 | |
} | |
]; | |
var p = d3.select("body").selectAll("p") | |
.data(flag_data) | |
.enter() | |
.append("p") | |
.text(function (d) {return d | |
;}); | |
var svgContainer = d3.select("body").append("svg") | |
.attr("width, 200") | |
.attr("height, 200"); | |
var rectangles = svgContainer.selectAll("rectangle") | |
.data(flag_data) | |
.append(rectangle) | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment