D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
nvenkataraman1
Full window
Github gist
Global Energy SVG and D3 Data Loading
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Creating SVG and Loading CSV Data with D3</title> <script type="text/javascript" src="https://d3js.org/d3.v3.js"></script> </head> <body> <p>Check Global Renewable Energy Production Data in Console!</p> <svg width="800" height="600"> <circle cx="200" cy="100" r="100" fill="orange"/> </svg> <script type="text/javascript"> //Load in contents of CSV file d3.csv("./combined_energy.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