D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
sghidek
Full window
Github gist
NC restaurants
<!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>Not much to see here; try looking in the console!</p> <script type="text/javascript"> //Load in contents of CSV file d3.csv("NCrestaurants.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> <svg width="500" height="200"> <rect x="80" y="10" width="175" height="175" fill="gray" /> <circle cx="120" cy="150" r="60" fill="white" /> <line x1="80" y1="120" x2="310" y2="120" stroke="black" stroke-width="4" /> <text x="105" y="105" fill="charcoal" font-size="96" font-weight="bold" font-family="Helvetica">SGH</text> <text x="100" y="100" fill="orange" font-size="96" font-weight="bold" font-family="Helvetica">SGH</text> </svg> </body> </html>
Modified
http://d3js.org/d3.v3.js
to a secure url
https://d3js.org/d3.v3.js