Last active
October 21, 2023 01:00
-
-
Save hunminkoh/44b3b56c6136f8e475ef to your computer and use it in GitHub Desktop.
Drawing a triangle with d3.svg.symbol().type("triangle-up")
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> | |
<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