Created
October 5, 2015 22:43
-
-
Save davidski/59cc3e192562b44fffc8 to your computer and use it in GitHub Desktop.
Knight Center D3 - Module 4
This file contains 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
Location | Jan | May | July | Sept | |
---|---|---|---|---|---|
Linden Ave N and N 130th St | 61 | 255 | 244 | 186 | |
Greenwood Ave N and N 85th St | 39 | 103 | 82 | 79 | |
NE Ravenna Blvd, E Green Lake Way N/NE 71st St | 176 | 408 | 420 | 492 | |
32nd Ave NW and NW 54th St | 81 | 298 | 212 | 258 | |
NW Market St and 24th Ave NW/Shilshole Ave NW | 135 | 415 | 481 | 424 | |
15th Ave NW and NW Market St | 82 | 92 | 73 | 85 | |
N 45th St and Stone Way N | 126 | 328 | 320 | 382 | |
Lake City Way and NE 125th St | 52 | 73 | 109 | 116 | |
NE Northgate Way and 5th Ave NE | 36 | 28 | 56 | 51 | |
12th Ave NE and NE 65th St | 102 | 68 | 151 | 88 | |
Sand Point Way NE at NE 65th St | 24 | 160 | 415 | 204 | |
NE 45th St and Brooklyn Ave NE | 188 | 212 | 224 | 254 | |
Montlake Blvd NE and NE Pacific St | 378 | 809 | 826 | 872 | |
15th Ave W and W Nickerson St (Ballard Bridge) | 108 | 182 | 205 | 42 | |
32nd Ave W and W McGraw St | 4 | 36 | 77 | 45 | |
Queen Anne Ave N and Boston St | 22 | 62 | 98 | 58 | |
Westlake Ave N and Valley St | 145 | 406 | 395 | 480 | |
Fairview Ave N and Valley St | 16 | 120 | 93 | 122 | |
Mercer St and 9th Ave N | 87 | 245 | 276 | 291 | |
Mercer St and Fairview Ave N | 23 | 78 | 100 | 81 | |
Dexter Ave N and Denny Way | 316 | 800 | 706 | 635 | |
Alaskan Way and Broad St | 204 | 676 | 840 | 697 | |
5th Ave and Stewart St (McGraw Square) | 143 | 248 | 232 | 254 | |
Boren Ave and Pine St | 172 | 373 | 414 | 380 | |
Madison St and 6th Ave | 51 | 79 | 75 | 84 | |
Colman Dock (Alaskan Way and Columbia) | 123 | 270 | 474 | 288 | |
Eastlake Ave E and Furhman Ave E (University Bridge) | 384 | 917 | 984 | 915 | |
Broadway E and E John St | 134 | 266 | 183 | 329 | |
E Pine St and Broadway E | 180 | 365 | 404 | 2675 | |
12th Ave and Madison St/Union St | 190 | 460 | 469 | 558 | |
23rd Ave E and E Union St | 50 | 107 | 104 | 131 | |
1st Ave S and S Jackson St | 121 | 326 | 309 | 407 | |
7th Ave S and S Jackson St | 48 | 133 | 170 | 859 | |
8th Ave S and S Dearborn St | 95 | 271 | 200 | 405 | |
1st Ave S and S Lander St | 62 | 150 | 112 | 161 | |
E Marginal Way S and S Hanford St | 127 | 545 | 418 | 429 | |
35th Ave SW and SW Avalon Way | 71 | 149 | 170 | 126 | |
California Ave SW and SW Alaska St | 32 | 105 | 61 | 75 | |
California Ave SW and Fauntleroy Way SW | 37 | 185 | 152 | 51 | |
Fauntleroy Way SW and SW Cloverdale St | 21 | 88 | 107 | 77 | |
26th Ave SW and SW Barton St | 7 | 37 | 41 | 40 | |
8th Ave S and S Cloverdale St | 21 | 95 | 115 | 69 | |
Airport Way S and S Vale St | 19 | 80 | 64 | 71 | |
12th Ave S and S Jackson St | 91 | 234 | 315 | 266 | |
Beacon Ave S and S Lander St/16th Ave S | 41 | 134 | 110 | 143 | |
Rainer Ave S and M L King Jr Way S | 28 | 46 | 30 | 28 | |
M L King Jr Way S and S Alaska St | 21 | 37 | 68 | 57 | |
M L King Jr Way S and S Othello St | 10 | 23 | 57 | 21 | |
Rainier Ave S and S Henderson St | 9 | 22 | 21 | 24 |
This file contains 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> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Module 4 Exercise - David F. Severski</title> | |
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script> | |
<style type="text/css"> | |
body { | |
background-color: white; | |
font-family: Helvetica, Arial, sans-serif; | |
} | |
h1 { | |
font-size: 24px; | |
margin: 0; | |
} | |
p { | |
font-size: 14px; | |
margin: 10px 0 0 0; | |
} | |
svg { | |
background-color: white; | |
} | |
rect:hover { | |
fill: orange; | |
} | |
.axis path, | |
.axis line { | |
fill: none; | |
stroke: black; | |
shape-rendering: crispEdges; | |
} | |
.axis text { | |
font-family: sans-serif; | |
font-size: 11px; | |
} | |
.y.axis path, | |
.y.axis line { | |
opacity: 0; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Jannuary 2013 Bike Count</h1> | |
<p>Seattle Bike counts by location. Source: <a href="http://data.seattle.gov">Seattle Data.gov</a></p> | |
<script type="text/javascript"> | |
var w = 700; | |
var h = 600; | |
var padding = [ 20, 10, 30, 300 ]; //Top, right, bottom, left | |
var svg = d3.select("body") | |
.append("svg") | |
.attr("width", w) | |
.attr("height", h); | |
var widthScale = d3.scale.linear() | |
.range([ 0, w - padding[1] - padding[3] ]); | |
var heightScale = d3.scale.ordinal() | |
.rangeRoundBands([ padding[0], h - padding[2] ], 0.1); | |
var xAxis = d3.svg.axis() | |
.scale(widthScale) | |
.orient("bottom"); | |
var yAxis = d3.svg.axis() | |
.scale(heightScale) | |
.orient("left"); | |
d3.csv("2013_NBPD_Bike_Counts.csv", function(data) { | |
data.sort(function(a, b) { | |
return d3.descending(+a.Jan, +b.Jan); | |
}); | |
widthScale.domain([ 0, d3.max(data, function(d) { | |
return +d.Jan; | |
}) ]); | |
heightScale.domain(data.map(function(d) { return d.Location; } )); | |
var rects = svg.selectAll("rect") | |
.data(data) | |
.enter() | |
.append("rect"); | |
rects.attr("x", padding[3]) | |
.attr("y", function(d) { | |
return heightScale(d.Location); | |
}) | |
.attr("width", function(d) { | |
return widthScale(d.Jan); | |
}) | |
.attr("height", heightScale.rangeBand()) | |
.attr("fill", "steelblue") | |
.append("title") | |
.text(function(d) { | |
return d.Location + "'s January 2013 bike count is " + d.Jan; | |
}); | |
svg.append("g") | |
.attr("class", "x axis") | |
.attr("transform", "translate(" + padding[3] + "," + (h - padding[2]) + ")") | |
.call(xAxis); | |
svg.append("g") | |
.attr("class", "y axis") | |
.attr("transform", "translate(" + padding[3] + ",0)") | |
.call(yAxis); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment