-
-
Save nick3499/cb39d49c67a81e90354735a3921269ee to your computer and use it in GitHub Desktop.
D3byEX 9.10: Symbols (Adapted to D3.js v5)
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><meta charset=utf-8> | |
<head> | |
<meta name="description" content="D3.js v5, built-in symbol array" /> | |
</head> | |
<body> | |
<script src="http://d3js.org/d3.v5.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 }); // v5 | |
svg.selectAll('path') | |
.data(d3.symbols) // v5 | |
.enter() | |
.append('path') | |
.attrs({ // v5 | |
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
Updated script from v4 to v5