D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
reedml
Full window
Github gist
Exercise 2, SVG Image and Loading CSV Data
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Exercise 2</title> <script type="text/javascript" src="https://d3js.org/d3.v3.js"></script> </head> <body> <svg width="1000" height="1000"> <circle cx="100" cy="100" r="100" fill="blue" /> <rect x="250" y="100" width="200" height="200" fill="red" /> <circle cx="200" cy="200" r="100" fill="yellow" /> <text x="250" y="150" fill="charcoal" font-size="38" font-weight="bold" font-family="Georgia">Hello, SVG World</text> </svg> <script type="text/javascript"> //Load in contents of CSV file d3.csv("census_occupations_lowlevel.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