D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
jonolave
Full window
Github gist
SVG & unemployment data
<!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> <style type="text/css"> body { background-color: black; } </style> </head> <body> <script type="text/javascript"> //Load in contents of CSV file d3.csv("unemployment.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> <svg width="500" height="200"> <circle cx="45" cy="80" r="18.3" fill="pink"/> <circle cx="127" cy="91.8" r="8.9" fill="grey"/> <circle cx="52" cy="143" r="14.3" fill="grey"/> <circle cx="89" cy="101" r="6.9" fill="grey"/> <circle cx="172" cy="90" r="4.6" fill="grey"/> <circle cx="118" cy="53" r="3.6" fill="pink"/> <circle cx="216" cy="77" r="13.1" fill="grey"/> <circle cx="263" cy="58" r="3.2" fill="pink"/> <circle cx="126" cy="152" r="37.4" fill="grey"/> <circle cx="190" cy="130" r="11.7" fill="pink"/> <circle cx="175" cy="40" r="18.9" fill="grey"/> <circle cx="257" cy="127" r="9.2" fill="grey"/> <circle cx="226" cy="157" r="14.7" fill="pink"/> <circle cx="222" cy="111" r="7.1" fill="grey"/> <circle cx="67" cy="28" r="10.5" fill="pink"/> <circle cx="311" cy="77" r="5.1" fill="grey"/> <rect x="369" y="68" fill="grey" width="7" height="7"/> <rect x="339" y="94" fill="pink" width="13" height="13"/> <rect x="404" y="47" fill="grey" width="13" height="13"/> <rect x="379" y="120" fill="pink" width="23" height="23"/> <rect x="405" y="88" fill="grey" width="11" height="11"/> <rect x="311" y="22" fill="pink" width="20" height="20"/> <rect x="440" y="66" fill="pink" width="19" height="19"/> <rect x="301" y="148" fill="pink" width="35" height="35"/> </svg> </body> </html>
Modified
http://d3js.org/d3.v3.js
to a secure url
https://d3js.org/d3.v3.js