A short demo of dancing line charts, mostly made for students of Shan and Kevin's Dataviz class at Berkeley. The data and interactive are based on the NYT's Housing's Rise and Fall in 20 Cities. Data is from The Standard & Poor’s Case-Shiller Home Price Index.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h1>Test tktktk</h1> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(XML) | |
| years <- 1950:2012 | |
| data <- NULL | |
| for (i in years) { | |
| print(i) | |
| url <- paste("http://www.basketball-reference.com/draft/NBA_", i, ".html", sep="") | |
| page <- htmlTreeParse(readLines(url), useInternalNodes=T) | |
| table <- readHTMLTable(page)$stats |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(rgdal) | |
| # a clean data frame called d2 | |
| maptest <- d2 | |
| coordinates(maptest) <- c("lng", "lat") | |
| proj4string(maptest) <- CRS("+proj=longlat") | |
| ogrInfo(dsn = "shapes", "County") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function nytAlbersUsa() { | |
| var lower48 = d3.geo.albers().rotate([96, 0]).center([0, 38]).parallels([29.5, 45.5]), | |
| alaska = d3.geo.albers().rotate([160, 0, -35]).center([45, 44]).parallels([55, 65]), | |
| hawaii = d3.geo.albers().rotate([160, 0]).center([0, 20]).parallels([8, 18]); | |
| function nytAlbersUsa(coordinates) { | |
| return projection(coordinates)(coordinates); | |
| } | |
| function projection(point) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <style> | |
| /*whole page*/ | |
| body { | |
| width:900px; | |
| margin:20px auto; | |
| font-family:georgia, sans-serif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| width: 800px; | |
| margin: 20px auto; | |
| font-family: georgia; | |
| } | |
| h1 { | |
| font-family: arial; | |
| font-weight: bold; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var mapStyles = [ { "elementType" : "all", | |
| "featureType" : "all", | |
| "stylers" : [ { "lightness" : 53 }, | |
| { "gamma" : 0.80000000000000004 }, | |
| { "saturation" : -61 } | |
| ] | |
| }, | |
| { "elementType" : "geometry", | |
| "featureType" : "road.local", | |
| "stylers" : [ { "saturation" : -73 }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ASPECTRATIO=1.777777777777 # 16x9 | |
| WIDTH=970 | |
| ffmpeg -i jackalope.mov -vcodec libx264 -acodec libfaac -pix_fmt yuv420p -b:v 1000k -b:a 128k -threads 0 -vf scale=$WIDTH':trunc('$WIDTH'/'$ASPECTRATIO'/2)*2' promo.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="wrapper"> | |
| <video width="640" height="360" style="width: 100%; height: 100%;" id="player1"> | |
| <!-- Pseudo HTML5 --> | |
| <source type="video/youtube" src="http://www.youtube.com/watch?v=nOEw9iiopwI" /> | |
| </video> | |
| </div> |
OlderNewer