Additional D3 symbol types.
For use with D3 version 4+.
A demo is available here.
If you use NPM, npm install d3-symbol-extra
. Otherwise, download the
latest release.
AMD, CommonJS, and vanilla environments are supported. In vanilla, a d3
global is exported:
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="d3-symbol-extra.js"></script>
<svg width="100" height="100"></svg>
<script>
var symbol = d3.symbol().size(1000).type(d3.symbolPentagon);
d3.select('svg').append('path')
.attr('transform', 'translate(50, 50)')
.attr('d', function(d, i) {
return symbol();
});
</script>
The triangle symbol type rotated 180°. See d3.symbolTriangle.
The triangle symbol type rotated 90° counterclockwise. See d3.symbolTriangle.
The triangle symbol type rotated 90° clockwise. See d3.symbolTriangle.
The diamond symbol type laid horizontally. See d3.symbolDiamond.
The square symbol type rotated 45°. See d3.symbolSquare.
The pentagon symbol type.
The hexagon symbol type.
The hexagon symbol type rotated to have horizontal top and bottom edges.
The octagon symbol type.
The octagon symbol type rotated to have horizontal top and bottom edges.
The Greek cross symbol type rotated 45°. Alias: d3.symbolCrossAlt. See d3.symbolCross.