D3 Tutorial

D3 Tutorial

by Nirvanachain

HTML

<!--
tutorial:
https://www.dashingd3js.com/table-of-contents
-->

<p>
  Hello World!
</p>

<svg width="50" height="50">
  <circle cx="25" cy="25" r="25" fill="green" />
</svg>

JavaScript

d3.select('body').append('p').text('what what');

d3.select('body')
	.append('svg')
  .attr('width', 50)
  .attr('height', 50)
  .append('circle')
  .attr('cx', 25)
  .attr('cy', 25)
  .attr('r', 25)
  .style('fill', 'purple')