Skip to content

Instantly share code, notes, and snippets.

View Ryshackleton's full-sized avatar

Ryan Shackleton Ryshackleton

View GitHub Profile
@Ryshackleton
Ryshackleton / hello-d3.html
Created March 26, 2017 22:09
Simple D3 (version 4) starter template
<!DOCTYPE html>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- using D3 version 4-->
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>/* CSS */</style>
</head>
<body>
@Ryshackleton
Ryshackleton / index.html
Last active March 30, 2017 06:35
D3 Transition Example - Maptime Seattle
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- using D3 version 4-->
<script src="https://d3js.org/d3.v4.min.js"></script>
<!-- could add CSS inside the <style> tags -->
@Ryshackleton
Ryshackleton / index.html
Last active March 30, 2017 18:14
Maptime Seattle Earthquake Map
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- using D3 version 4-->
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/topojson.v2.min.js"></script>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Ryshackleton
Ryshackleton / data.json
Created March 13, 2018 02:47
Some data
[{"sex":1,"year":1990,"location":102,"mean":0.0000188511631791},{"sex":1,"year":1990,"location":523,"mean":0.00000857296392606},{"sex":1,"year":1990,"location":524,"mean":0.000018008041589},{"sex":1,"year":1990,"location":525,"mean":0.0000268181301928},{"sex":1,"year":1990,"location":526,"mean":0.0000079867264729},{"sex":1,"year":1990,"location":527,"mean":0.0000402513580668},{"sex":1,"year":1990,"location":528,"mean":0.0000150980908926},{"sex":1,"year":1990,"location":529,"mean":0.0000161126196958},{"sex":1,"year":1990,"location":530,"mean":0.0000209933327999},{"sex":1,"year":1990,"location":532,"mean":0.0000139423567836},{"sex":1,"year":1990,"location":533,"mean":0.0000117223809133},{"sex":1,"year":1990,"location":534,"mean":0.0000129325963938},{"sex":1,"year":1990,"location":535,"mean":0.00000985742362283},{"sex":1,"year":1990,"location":536,"mean":0.0000265749460896},{"sex":1,"year":1990,"location":537,"mean":0.00000735575942933},{"sex":1,"year":1990,"location":538,"mean":0.00000649343875164},{"sex":1,"ye
@Ryshackleton
Ryshackleton / ihme-us-location-ids.csv
Created March 17, 2018 22:52
US State and County names - IHME location_id to FIPS code mapping
location_id location_name FIPS
102 United States 0
523 Alabama 1
524 Alaska 2
525 Arizona 4
526 Arkansas 5
527 California 6
528 Colorado 8
529 Connecticut 9
530 Delaware 10
We can't make this file beautiful and searchable because it's too large.
level,state_fips,county_fips,location_name
010,00,000,United States
040,01,000,Alabama
050,01,001,Autauga County
050,01,003,Baldwin County
050,01,005,Barbour County
050,01,007,Bibb County
050,01,009,Blount County
050,01,011,Bullock County
050,01,013,Butler County
@Ryshackleton
Ryshackleton / usa-topo-fips.json
Created March 18, 2018 03:56
usa-topojson-fips
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Ryshackleton
Ryshackleton / IHME-GBD_2016_DATA-4fe45551-1.csv
Created April 13, 2018 16:35
US Subnational Life Expectancy, All Ages, both sexes, 1990-2016
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 14 columns, instead of 12. in line 9.
measure_id,measure_name,location_id,location_name,sex_id,sex_name,age_id,age_name,metric_id,metric_name,year,val,upper,lower
26,Life expectancy,530,Delaware,3,Both,22,All Ages,5,Years,1999,76.2793505408,76.6376240018,75.8878822704
26,Life expectancy,532,Florida,3,Both,22,All Ages,5,Years,1999,77.385808956,77.7841910508,76.9595108863
26,Life expectancy,533,Georgia,3,Both,22,All Ages,5,Years,1999,75.2402637263,75.6741137857,74.7852899626
26,Life expectancy,534,Hawaii,3,Both,22,All Ages,5,Years,1999,79.4283102358,79.7878043629,79.0822906007
26,Life expectancy,535,Idaho,3,Both,22,All Ages,5,Years,1999,77.9222345593,78.3642224282,77.4196541273
26,Life expectancy,536,Illinois,3,Both,22,All Ages,5,Years,1999,76.516752219,76.8681442261,76.1694431903
26,Life expectancy,537,Indiana,3,Both,22,All Ages,5,Years,1999,76.1647538571,76.6109903857,75.7306548493
26,Life expectancy,538,Iowa,3,Both,22,All Ages,5,Years,1999,78.3360721141,78.7289256481,77.9500619067
26,Life expectancy,539,Kansas,3,Both,22,All Ages,5,Years,1999,77.