D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
dyorama
Full window
Github gist
Forest data and my SVG with a small I to index !
<!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="100" y1="100" x2="100" y2="260" stroke="black" stroke-width="3" /> <circle cx="100" cy="130" r="50" fill="green" /> <line x1="180" y1="130" x2="180" y2="260" stroke="black" stroke-width="3" /> <circle cx="180" cy="130" r="40" fill="blue" /> <line x1="240" y1="130" x2="240" y2="260" stroke="black" stroke-width="3" /> <circle cx="240" cy="130" r="30" fill="green" /> <circle cx="280" cy="130" r="20" fill="blue" /> <line x1="280" y1="130" x2="280" y2="260" stroke="black" stroke-width="3" /> <circle cx="310" cy="130" r="15" fill="green" /> <rect x="306" y="125" width="10" height="10" fill="black" /> <text x="0" y="40" fill="charcoal" font-size="42" font-weight="bold" font-family="Helvetica">FOREST AREA </text> </svg> <p>To view the data loaded, check the console</p> <script type="text/javascript"> //Load in contents of CSV file d3.csv("forestdata.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