Last active
January 2, 2017 07:24
-
-
Save JanneSalokoski/b6a8163eb0aa8302707681d8717b0469 to your computer and use it in GitHub Desktop.
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> | |
<style type="text/css"> | |
path | |
{ | |
fill: none; | |
stroke: red; | |
stroke-width: 3px; | |
} | |
</style> | |
<script type="text/javascript" src="https://d3js.org/d3.v4.min.js"></script> | |
</head> | |
<body> | |
<svg id="bezier" width="600" height="100"> | |
<path /> | |
</svg> | |
<script type="text/javascript"> | |
var data = [[0, 50], [100, 80], [200, 40], [300, 60], [400, 30]]; | |
var line = d3.line() | |
.curve(d3.curveCardinal); | |
d3.select("#bezier > path") | |
.attr("d", line(data)); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment