stroke-dasharray
✓ Published0🌍 Public
Mmbostock
Last edited Feb 8, 2016
Created on Nov 18, 2010
Ten horizontal black lines are rendered across the SVG canvas, each displaying a distinct stroke-dasharray pattern. The dashes increase in length from the top line to the bottom, while the gap between dashes remains constant at five pixels. Using D3 v3, the code binds an array of ten numbers to `line` elements and sets each line’s `stroke-dasharray` attribute to `${d + 1},5`. The lines are evenly spaced vertically across the 960×500 viewport, with a consistent stroke width of 15 pixels.
AI-generated descriptionA few dynamically generated stroke-dasharray styles.
gpl-3.0 Licensed