Created
November 8, 2017 19:18
-
-
Save valex/58d14770a972cfc3786d2e01b2b4bdf4 to your computer and use it in GitHub Desktop.
d3.js symbols
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> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<script src="http://d3js.org/d3.v4.min.js"></script> | |
<script src="https://d3js.org/d3-selection-multi.v1.min.js"></script> | |
<script> | |
var svg = d3.select('body') | |
.append('svg') | |
.attrs({ | |
width: 500, | |
height: 250 | |
}); | |
svg.selectAll('path') | |
.data(d3.symbols) | |
.enter() | |
.append('path') | |
.attrs({ | |
d: d3.symbol().type(function (d) { return d; }), | |
transform: function (d, i) { | |
return 'translate(' + (i * 20 + 10) + ',10)'; | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment