D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
wmarcos
Full window
Github gist
Social Progress Index Test
<!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> <p>Try looking in the console ;)</p> <svg width="500" height="200"> <line x1="10" y1="10" x2="500" y2="10" stroke="blue" stroke-width="3" /> <line x1="10" y1="110" x2="500" y2="110" stroke="blue" stroke-width="3" /> <rect x="10" y="10" width="500" height="100" fill="gray" /> <circle cx="40" cy="80" r="20" fill="#000000" /> <circle cx="80" cy="80" r="20" fill="#000044" /> <circle cx="120" cy="80" r="20" fill="#000088" /> <circle cx="160" cy="80" r="20" fill="#0000BB" /> <circle cx="200" cy="80" r="20" fill="#0000EE" /> <circle cx="240" cy="80" r="20" fill="#0000FF" /> <circle cx="280" cy="80" r="20" fill="#0044FF" /> <circle cx="320" cy="80" r="20" fill="#0088FF" /> <circle cx="360" cy="80" r="20" fill="#00BBFF" /> <circle cx="400" cy="80" r="20" fill="#00EEFF" /> <circle cx="440" cy="80" r="20" fill="#00FFFF" /> <text x="10" y="50" fill="charcoal" font-size="38" font-weight="bold" font-family="Helvetica">Social progress index test</text> </svg> <script type="text/javascript"> //Load in contents of CSV file d3.csv("Social_Progress_Index.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