D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
wimbr
Full window
Github gist
Module2_loading_csv_data_eva
<!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.min.js"></script> </head> <body> <!-- ready for the svg? here it comes --> <svg width='100' height ='100'> <line style='stroke-width:1;stroke:gray' x1='0' y1='0' x2 ='100' y2 = '100'></line> <line style='stroke-width:1;stroke:black' x1='100' y1='0' x2 ='0' y2 = '100'></line> <line stroke-width='50' stroke='red' opacity='.1' x1='50' y1='0' x2 ='50' y2 = '100'></line> <polygon fill='blue' opacity='.2' points='0,50 50,0 100,50 50,100 '></polygon> </svg> <!-- done with the svg, lets load the csv in ... --> <script type="text/javascript"> //Load in contents of CSV file d3.csv("eva.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.min.js
to a secure url
https://d3js.org/d3.v3.min.js