Last active
November 30, 2017 13:44
-
-
Save j-medland/399b1d4d0fc72fd0971a38b07e0c5211 to your computer and use it in GitHub Desktop.
Fancy Clip Path
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> | |
<meta charset="utf-8"> | |
<svg width="960" height="500"></svg> | |
<script src="//d3js.org/d3.v4.min.js"></script> | |
<script> | |
var lineAPoint = [[10,50], [300,150], [950,50]] | |
var lineBPoint = [[10,150], [300,20], [950,50]] | |
var line = d3.line() | |
.x(function(d) { return d[0]; }) | |
.y(function(d) { return d[1]; }); | |
var lineA = d3.select('svg') | |
.append('path') | |
.datum(lineAPoint) | |
.attr('d', line) | |
var lineB = d3.select('svg') | |
.append('path') | |
.datum(lineBPoint) | |
.attr('d', line) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment