D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
P3nny
Full window
Github gist
Hello World: You like my SVG cutie?
<!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> <link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'> </head> <style type="text/css"> body {background-color: #009DDF;} svg {background-color: white;} </style> </head> <body> <svg width="600" height="400"> <circle cx="230" cy="120" r="50" fill="blue" /> <circle cx="230" cy="120" r="15" fill="black" /> <circle cx="235" cy="120" r="5" fill="white" /> <circle cx="370" cy="120" r="50" fill="blue" /> <circle cx="370" cy="120" r="15" fill="black" /> <circle cx="375" cy="120" r="5" fill="white" /> <rect x="180" y="230" width="250" height="40" fill="pink" /> <text x="240" y="260" font-size="24" font-weight="bold" font-family="Comic">Hello World!</text> </svg> <script type="text/javascript"> //Load in contents of CSV file d3.csv("cologne_city_quarter.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