D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
missmee
Full window
Github gist
Women in parliaments worldwide 2004-2014
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Loading CSV Data with D3</title> <script type="text/javascript" src="https://d3js.org/d3.v3.js"></script> </head> <body> <svg width="500" height="500"> <circle cx="250" cy="75" r="50" stroke="#3B0A63" stroke-width="20" fill="white" /> <line x1="250" y1="120" x2="250" y2="210" stroke-width="20" stroke="#3B0A63" /> <line x1="210" y1="160" x2="290" y2="160" stroke-width="20" stroke="#3B0A63" /> <text x="75" y="300" font-family="arial" font-size="18" fill="black">No women on this page; they are all in the console.</text> </svg> <script type="text/javascript"> //Load in contents of CSV file d3.csv("women-in-parliament-2004-2014-coma.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