D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
jalapic
Full window
Github gist
Stop and Frisk NYC 2014
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Loading Stop and Frisk CSV Data with D3</title> <script type="text/javascript" src="https://d3js.org/d3.v3.js"></script> </head> <body> <p>Here are the Stop and Frisk Data for NYC 2014</p> <svg width="500" height="500"> <line x1="131" y1="26" x2="70" y2="26" stroke="red" stroke-width="3" /> <line x1="70" y1="26" x2="26" y2="69" stroke="red" stroke-width="3" /> <line x1="26" y1="69" x2="26" y2="130" stroke="red" stroke-width="3" /> <line x1="26" y1="130" x2="69" y2="174" stroke="red" stroke-width="3" /> <line x1="69" y1="174" x2="130" y2="174" stroke="red" stroke-width="3" /> <line x1="130" y1="174" x2="174" y2="131" stroke="red" stroke-width="3" /> <line x1="174" y1="131" x2="174" y2="70" stroke="red" stroke-width="3" /> <line x1="174" y1="70" x2="131" y2="26" stroke="red" stroke-width="3" /> <text x="45" y="114" fill="red" font-size="42" font-weight="bold" font-family="Helvetica">STOP</text> </svg> <script type="text/javascript"> //Load in contents of CSV file d3.csv("stopfrisk.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