An updating scatterplot as a demonstration of d3 enter, exit and update functions, based on Mike Bostock's general update patterns.
Cross-national income data is from the Luxembourg Income Study.
An updating scatterplot as a demonstration of d3 enter, exit and update functions, based on Mike Bostock's general update patterns.
Cross-national income data is from the Luxembourg Income Study.
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style type="text/css"> | |
body { | |
font-family: arial, sans; | |
font-size: 11px; | |
width: 720px; | |
margin: 30px auto; |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style type="text/css"> | |
body { | |
font-family: arial, sans; | |
font-size: 11px; | |
} | |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style type="text/css"> | |
/*css to go here*/ | |
svg { | |
border: 1px solid #f0f; | |
} |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script> | |
<style type="text/css"> | |
/*css to go here*/ | |
body { | |
font-family: arial, sans; | |
width: 720px; | |
margin: 20px auto; |
require 'open-uri' | |
require 'json' | |
def get_song_info(artist, song) | |
# this fixes some things with spaces for the url. | |
# there's probably a better way | |
query = (artist + ' ' + song).gsub! ' ', '%20' | |
# query = query.gsub! '’', '' |
d3.selectAll("path").style("stroke", "red"); |
setwd("/Users/kevin/NYT/working/2015-02-02-womens-skiing/r-work") | |
library(XML) | |
url_1 <- "http://data.fis-ski.com/global-links/statistics/overview-top-ranked-in-all-competitions.html?place=&season=" | |
url_2 <- "§or=AL&nation_place=&gender=" | |
url_3 <- "&category=WC&nbr=13&nation_comp=USA&discipline=" | |
url_4 <- "&Submit=Search" | |
years <- 1967:2015 |
<div id="g-refers"> | |
<div class="g-refer-text g-clearfix"> | |
<h4><a href="http://www.nytimes.com/pages/sports/soccer/index.html">World Cup 2014 Complete Coverage »</a></h4> | |
<ul id="g-refers-list"> | |
<li class="g-refer"> | |
<a href="http://www.nytimes.com/interactive/2014/06/08/magazine/world-cup-curse-of-maracana.html"> |
#g-refers { | |
overflow: hidden; | |
width: 100%; | |
margin: auto; | |
padding: 0; | |
color: #CCC; | |
border-top: 1px solid #dbdbdb; | |
margin-top: 60px; |