block by nitaku cc764f1fba5e3d5562117836eb516e9e

D3 4.x template

Full Screen

A very simple template for using D3 4.x. D3-selection-multi is loaded to enable CoffeeScript’s shorthand notation for setting attributes:

svg.append 'circle'
  .attrs
    r: 100
    cx: width/2
    cy: height/2
    fill: 'teal'

Notice that D3 4.x uses .attrs() instead of .attr().

index.js

index.html

index.coffee

index.css