D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
simmonslk
Full window
Github gist
Population Estimates 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> <svg width="500" height="500"> <line x1="200" y1="200" x2="400" y2="400" stroke="gold" stroke-width="3" /> <line x1="200" y1="200" x2="300" y2="10" stroke="gold" stroke-width="3" /> <line x1="200" y1="200" x2="50" y2="10" stroke="gold" stroke-width="3" /> <line x1="200" y1="200" x2="10" y2="150" stroke="gold" stroke-width="3" /> <line x1="200" y1="200" x2="10" y2="350" stroke="gold" stroke-width="3" /> <line x1="200" y1="200" x2="450" y2="150" stroke="gold" stroke-width="3" /> <line x1="200" y1="200" x2="210" y2="450" stroke="gold" stroke-width="3" /> <circle cx="200" cy="200" r="100" fill="gold" /> <text x="130" y="210" fill="charcoal" font-size="42" font-weight="bold" font-family="Helvetica">Hello!</text> </svg> <script type="text/javascript"> //Load in contents of CSV file d3.csv("population estimates.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