D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
cristinaversino
Full window
Github gist
Exercise 2 - Loading data
<!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="700" height="75"> <text x="0" y="50" fill="charcoal" font-size="42" font-weight="bold" font-family="Helvetica">SIPRI Arms Transfers database</text> </svg> <p>Loading data; try looking in the console!</p> <script type="text/javascript"> //Load in contents of CSV file d3.csv("SIPRI_Arms_Transfers_DB.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