D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
overberger
Full window
Github gist
Hispanic diversity in Fairfax County, VA
<!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> <style type="text/css"> body { background-color: gray; } svg { background-color: white; } </style> </head> <body> <p>Not much to see here; try looking in the console!</p> <svg width="600" height="200"> <rect x="10" y="10" width="580" height="70" fill="green" /> <text x="20" y="50" fill="charcoal" font-size="30" font-weight="bold" font-family="Helvetica">Hispanic diversity in Fairfax County, VA</text> </svg> <script type="text/javascript"> //Load in contents of CSV file d3.csv("FairfaxHispanic.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