Skip to main content
100%

stroke-dasharray

✓ Published0🌍 Public
FFrissAnalytics
Last edited Sep 19, 2018
Created on Sep 19, 2018

Ten black horizontal lines on a white SVG canvas demonstrate ten different stroke-dasharray styles, from a nearly solid line to a heavily dashed pattern. The example generates each line by mapping a data array from `d3.range(10)` to vertical positions, setting the `stroke-dasharray` attribute to `(d + 1) + ",5"` for increasing dash lengths. Using D3 v3 and SVG line elements, the code renders fixed-width strokes with a consistent 15-pixel stroke width to highlight the dash patterns.

AI-generated description

A few dynamically generated stroke-dasharray styles.

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/705856'>stroke-dasharray</a>

gpl-3.0 Licensed

Similar vizzes