nick34992
2/25/2017 - 12:59 AM

D3: svg, path, d3.selectAll, .style: Sketch and Fill Triangle

D3: svg, path, d3.selectAll, .style: Sketch and Fill Triangle

<!DOCTYPE html>
<html>
<head>
  <meta name="description"
        content="Use path mini-language to trace a triangle and fill it">
</head>
<body>
  <script src="http://d3js.org/d3.v3.min.js" charset=" utf-8"></script>
  <svg width="720" height="120">
    <path d="M 10 10 L 310 10 L 160 110 Z"/>
  </svg>
  <script>
    d3.selectAll('path').style('fill', 'darkkhaki');
  </script>
</body>
</html>