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
| us_state_abbrev = { | |
| 'Alabama': 'AL', | |
| 'Alaska': 'AK', | |
| 'Arizona': 'AZ', | |
| 'Arkansas': 'AR', | |
| 'California': 'CA', | |
| 'Colorado': 'CO', | |
| 'Connecticut': 'CT', | |
| 'Delaware': 'DE', | |
| 'District of Columbia':'DC', |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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 sqwidth = 15; | |
| var svg = d3.select("div.graphic") | |
| .append("svg:svg") | |
| .attr("width", 600) | |
| .attr("height", 600); | |
| var key = ["ARI", "ATL", "BAL", "BOS", "CHC", "CHW", "CIN", "CLE", "COL", "DET", "HOU", "KCR", "LAA", "LAD", "MIA", "MIL", "MIN", "NYM", "NYY", "OAK", "PHI", "PIT", "SDP", "SEA", "SFG", "STL", "TBR", "TEX", "TOR", "WSN"]; | |
| var colors = ["#C51230", "#01487E", "#DF4601", "#BD3039", "#0E3386", "#555B66", "#EB184B", "#023465", "#333366", "#10293F", "#FF7F00", "#74B4FA", "#CE1141", "#005596", "#F46634", "#012143", "#B50131", "#F7742C", "#1C2841", "#00483A", "#CA1F2C", "#FFB40B", "#1C3465", "#1C8B85", "#FB5B1F", "#C41E3A", "#79BDEE", "#BD1021", "#003DA5", "#BA122B"]; | |
| var opac = [".10",".40",".60",".80","1"]; | |
| var csv = d3.csv("https://docs.google.com/spreadsheet/pub?key=0AtUL7G-Osv2ddDE3VmZNRThwMTlua3ZXR3NfeV8yTXc&output=csv", function (csv) { | |
| var labels = svg.selectAll(".label") |