D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
lee00678
Full window
Github gist
State Health Practice
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>State Health Practice</title> <style type="text/css"> body { background-color: white; } svg { background-color: white; } </style> <script type="text/javascript" src="https://d3js.org/d3.v3.js"></script> </head> <body> <svg width="800" height="800"> <text x="0" y="20" fill="charcoal" font-size="20" font-weight="normal" font-family="Open Sans">State Health</text> <rect x="20" y="50" width="100" height="40" fill="orange" /> </svg> <script type="text/javascript"> //Load in contents of CSV file d3.csv("statehealth.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); }); var s = d3.select("svg") .append("circle") .attr("cx", 100) .attr("cy", 200) .attr("fill", "black") .attr("r", 30); var img = d3.selectAll("svg") .append("svg:image") .attr("xlink:href", "https://upload.wikimedia.org/wikipedia/commons/3/32/Blank_US_Map.svg") .attr("x", 140) .attr("width", 600) .attr("height", 600); </script> </body> </html>
Modified
http://d3js.org/d3.v3.js
to a secure url
https://d3js.org/d3.v3.js