D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
savinip
Full window
Github gist
2014-2011 Threatened Italian journalists
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>MOOC 2nd week exercise - Paola </title> <script type="text/javascript" src="https://d3js.org/d3.v3.js"></script> </head> <body> <style type="text/css"> body {background-color: greenyellow; } </style> <svg width="500" height="500"> <rect x="235" y="10" width="100" height="100" fill="red" /> <rect x="175" y="120" width="225" height="250" fill="blue" /> <rect fill="pink" x="150" y="40" width="270" height="100"/> <text x="160" y="35" text-anchor="middle" style="font-size: 30px; font-family: Arial"> POOR ME!</text> </svg> <script type="text/javascript"> //Load in contents of CSV file d3.csv("2014_threatened italian journalists.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