D3: svg, canvas, path, style: SVG Triangle with Outline

nick3499
nick3499
Feb 25, 2017 · 1 min read
path_tri_outline.html

<svg width="400" height="400" sets (400,400) canvas. path d="M 10 10 L 380 10 L 190 380 Z" indicates SVG’s path mini-language where M 10 10 moves starting point to (x=10, y=10). L 380 10 draws line from (10, 10) to (380,10). L 190 380 draws line from (380,10) to (190,380). Z closes path to complete triangle outline. style="fill:mediumblue;stroke:darkred;stroke-width:10" applies styling to triangle and outline. stroke:darkred applies darkred outline. fill:mediumblue sets the blue inner field to HTML’s mediumblue.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade