D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
victorkausch
Full window
Github gist
Data Viz Assignment #3
Built with
blockbuilder.org
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>D3 Example</title> <script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> </head> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Tangerine"> <style> circle{fill: #89df3e} </style> <body> <h1 style="font-family:Tangerine";>Data Viz Assignment 3</h1> <script> var svg = d3.select("body").append("svg") .attr("width", 250) .attr("height", 250); function a_name (d){ // Bind data var circles = svg.selectAll("circle").data(d); // Enter circles.enter().append("circle") .attr("r", 20); // Update circles .attr("cx", function (d){ return d.x; }) .attr("cy", function (d){ return d.y; }); // Exit circles.exit().remove(); } d3.csv("https://gist.githubusercontent.com/sandravizmad/7287d19eee4e427d988282dbcf81faaa/raw/1150864a4881223226559f6dae83155b0d3a0d05/test", function (d){a_name(d);}); </script> </body> </html>
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js