D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
aimbellone
Full window
Github gist
Rome marital status (2011)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Module 2: exercise</title> <script type="text/javascript" src="https://d3js.org/d3.v3.js"></script> </head> <body> <svg width="500" height="100"> <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow"> </circle><rect x="94" y="10" width="150" height="80" stroke="blue" stroke-width="4" fill="red"></rect><text x="260" y="50" fill="purple">My first SVG!</text> </svg> <p>... and my first load of data! (look in the console)</p> <script type="text/javascript"> //Load in contents of CSV file d3.csv("marital_status_rome_2011.csv", function(data) { //Now CSV contents have been transformed into //an array of JSON objects. //Log 'data' to the console, for verification. console.log(data); }); </script> </body> </html>
Modified
http://d3js.org/d3.v3.js
to a secure url
https://d3js.org/d3.v3.js