Built with blockbuilder.org
Last active
July 2, 2019 05:15
-
-
Save kousherAlam/ca1f17daa76453070a6c23c043fb2d62 to your computer and use it in GitHub Desktop.
d3-test-01
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
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<style> | |
body { | |
margin:0; | |
margin-top: 30px; | |
padding: 15px; | |
} | |
svg{ | |
border: 1px solid black; | |
box-shadow: 0px 0px 5px 2px rgba(0,0,0,.4); | |
} | |
</style> | |
</head> | |
<body> | |
<script> | |
// Feel free to change or delete any of the code you see in this editor! | |
const config = { | |
width: 670, | |
height: 500, | |
bar: { | |
width: 50, | |
height: 400, | |
} | |
} | |
var svg = d3.select("body").append("svg") | |
.attr("width", 670) | |
.attr("height", 500) | |
/* | |
* M = Move --- M(x y) | |
* L = Line L(x y) | |
* z = End | |
*/ | |
svg.append("path") | |
.attr("d", "M150 50 L75 200 L225 200 Z") | |
/* | |
svg.append("rect") | |
.attr("x", 10) | |
.attr("y", config.height - config.bar.height) | |
.attr("width", config.bar.width) | |
.attr("height", config.bar.height) | |
svg.append("text") | |
.text("Edit the code below to change me!") | |
.attr("y", 200) | |
.attr("x", 120) | |
.attr("font-size", 36) | |
.attr("font-family", "monospace") | |
*/ | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment