Skip to content

Instantly share code, notes, and snippets.

View hepplerj's full-sized avatar
💭
building the history web

Jason Heppler hepplerj

💭
building the history web
View GitHub Profile
@hepplerj
hepplerj / index.html
Last active August 29, 2015 14:17
Wordtree 2
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node circle {
fill: #fff;
stroke: steelblue;
stroke-width: 1.5px;
}
@hepplerj
hepplerj / choro.R
Last active August 29, 2015 14:18
Problem with `fortify` giving me a fatal error.
library(ggmap)
library(rgdal)
library(tidyr)
library(dplyr)
library(ggplot2)
library(RColorBrewer)
# Read data
# The shapefile comes from NHGIS, modified to include only California census tracts.
tract_1960_shp <- readOGR("/Users/jheppler/data/census-transformed/1960-census/", "1960-ca-tracts")
> tract_1960_df <- fortify(tract_1960_shp, region = "GISJOIN")
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘proj4string’ for signature ‘"NULL"’
@hepplerj
hepplerj / bootstrap.min.css
Last active August 29, 2015 14:20
Parallel coordinate z-score with table
/*!
* Bootstrap v3.3.2 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box
@hepplerj
hepplerj / data.json
Last active August 29, 2015 14:21
Arc Diagram
{
"nodes":[
{
"name": "Julie",
"gender": "female"
},
{
"name": "Matt",
"gender": "male"
},
@hepplerj
hepplerj / index.html
Last active August 29, 2015 14:21
Chinese Text
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Chinese Input</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link href="./bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
<link rel="stylesheet" href="style.css">
@hepplerj
hepplerj / index.html
Created August 27, 2015 19:11
D3 starter
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DHRG</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
</head>
@hepplerj
hepplerj / carter.csv
Last active September 19, 2015 22:03
Sample data
Year Total Great Britain Ireland Scandinavia Other Northwestern Europe Germany Poland Other Central Europe Former Soviet Union and Baltic States Other Eastern Europe Greece Italy Portugal Spain Other Southern Europe Japan China
1820 7691 2410 3614 23 452 968 5 0 14 1 0 30 35 139 0 1
1821 5936 3210 1518 24 521 383 1 0 7 0 0 63 18 191 0 0
1822 4418 1221 2267 28 522 148 3 0 10 4 0 35 28 152 0 0
1823 4016 1100 1908 7 528 183 3 0 7 2 0 33 24 220 1 0
1824 4965 1264 2345 20 671 230 4 0 7 2 5 45 13 359 0 0
1825 8543 2095 4888 18 719 450 1 0 10 0 0 75 13 273 1 1
1826 9751 2319 5408 26 968 511 0 0 4 2 4 57 16 436 0 0
1827 16719 4186 9766 28 1829 432 1 0 19 1 0 35 7 414 1 0
1828 24729 5352 12488 60 4700 1851 1 0 7 6 7 34 14 209 0 0
@hepplerj
hepplerj / index.html
Created September 12, 2015 23:29
Mapbox GL
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Mapbox GL</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.7.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.7.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@hepplerj
hepplerj / 2013MASTER.csv
Last active April 20, 2019 01:45
Mass Shootings in the U.S.
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
reported,date,shooter,killed,wounded,location,article1,article2,article3,article4,article5,article6,article7,article8,article9
,1/1/2013,Carlito Montoya,4,0,"Sacramento, CA",http://sanfrancisco.cbslocal.com/2013/01/12/3-young-men-teenage-boy-murdered-on-oakland-streets-in-6-hours-no-arrests/,http://hinterlandgazette.com/2013/01/oakland-gun-violence-ken-harbin-larry-lovette-eddiebo-rodriguez-4-killed-6hour-span.html,http://www.huffingtonpost.com/2013/01/12/oakland-shootings_n_2464783.html,,,,,,
,1/1/2013,Unknown,1,3,"Hawthorne, CA",http://losangeles.cbslocal.com/2013/01/01/man-killed-3-wounded-at-nye-party-in-hawthorne/,http://latimesblogs.latimes.com/lanow/2013/01/hawthorne-new-year-party-three-killed.html,,,,,,,
,1/1/2013,Julian Sims,0,4,"McKeesport, PA",http://pittsburgh.cbslocal.com/2013/01/01/4-people-shot-in-mckeesport/,http://www.wtae.com/news/local/allegheny/U-S-Marshals-task-force-arrests-New-Year-s-party-shooting-suspect/-/10927008/17977588/-/1ydqtj/-/index.html,,,,,,,
,1/1/2013,"Desmen Noble, Da