D3NutsAndBolts2

by Simon Raper

HTML

<p>The earthman</p>
<p>Dare!</p>
<p>In the flesh</p>

JavaScript

formatting = [{"fontsize": "20px", 
               "color": "blue"},
              {"fontsize": "40px", 
               "color": "red"},
              {"fontsize": "80px", 
               "color": "green"},
             ]

d3.selectAll("p")
              .data(formatting)
              .style("font-size", function(d) {return d.fontsize})
              .style("color", function(d) {return d.color});