-
-
Save Eireen/bd36df24e107cff70051b074fdc15495 to your computer and use it in GitHub Desktop.
Drawing a triangle with d3.svg.symbol().type("triangle-up")
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> | |
<html> | |
<head> | |
<script src="http://d3js.org/d3.v2.min.js"></script> | |
</head> | |
<body></body> | |
</html> | |
<script type="text/javascript"> | |
var svg = d3.select("body").append("svg") | |
.attr("width", window.innerWidth) | |
.attr("height", window.innerHeight) | |
.append('path') | |
.attr("d", d3.svg.symbol().type("triangle-up").size(500)) | |
.attr("transform", function(d) { return "translate(" + 100 + "," + 100 + ")"; }) | |
.style("fill", "red"); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment