Skip to content

Instantly share code, notes, and snippets.

View zanarmstrong's full-sized avatar

zan zanarmstrong

View GitHub Profile
@zanarmstrong
zanarmstrong / gist:b5175f84352b31cc9f9297e5a28dac3b
Created April 28, 2016 22:46
forked from jsfire.io/animations
<!DOCTYPE html>
<meta charset="utf-8">
<title>2015-04-06</title>
<body>
<script src="/animations/d3.v3.min.js"></script>
<style>
html, body {
height: 100%;
background: #222;
@zanarmstrong
zanarmstrong / .block
Last active March 26, 2016 06:50
Focus+Context via Brushing
license: gpl-3.0
license: gpl-3.0
@zanarmstrong
zanarmstrong / .block
Created March 1, 2016 01:19
Stroke Dash Interpolation
license: gpl-3.0
// everything after here can take daily data and plot it, so would work for "real" data too
function aggregateData() {
var dateFormat = d3.time.format("%Y-%m-%d")
var granularity = '';
var data = [];
// incoming data object
var dailyData = {};
var days = [];
var getQuarterFloor = function(date) {
@zanarmstrong
zanarmstrong / README.md
Last active February 27, 2016 19:54
Population: precent

One of three visualizations designed to show the basic building blocks needed in almost all D3 projects:

loading data, svg, format data, data join, use data to define visual attributes, axis + labels, styling

@zanarmstrong
zanarmstrong / .block
Last active April 3, 2018 03:07
bar chart SF pop
license: mit
@zanarmstrong
zanarmstrong / index.html
Last active February 27, 2016 01:12
Seasonality of ER products, small multiples
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="stl.css">
<link href='http://fonts.googleapis.com/css?family=Raleway:400,700' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="projectTitle">Seasonality of products involved in ER visits, sorted by most to least seasonal</div>
<div class="projectDesc">For each product type and month, the chart shows the percent of accidents involving that product that took place in that month. For example, in 2014, just over 70% of all ER visits related to Fireworks occured in July. The products are sorted from most to least seasonal, ending with "stair/steps" accidents which are essentially equally likely in any month.</div>
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 17 columns, instead of 14 in line 8.
year,month,guns_total_per_1000,guns_total,guns_total_seas,handgun_share,longgun_share,missouri,maryland,new_jersey,district_of_columbia,mississippi,louisiana,alabama,texas,georgia,dc_handguns_per_100k_national_sales
2000,1,2.332,574951,655088.710685556,0.3183,0.6749,2.71,0.636,0.469,0,2.391,2.506,3.14,8.164,3.075,2.1
2000,2,2.344,649111,658925.860865386,0.3178,0.6755,2.728,0.642,0.475,0,2.394,2.493,3.122,8.274,3.045,0.5
2000,3,2.335,664622,657021.995131628,0.3202,0.6728,2.668,0.644,0.493,0,2.339,2.447,3.071,8.443,3.067,1
2000,4,2.342,552965,659698.47505256,0.3188,0.6741,2.743,0.687,0.517,0,2.422,2.601,3.188,8.451,3.171,1.5
2000,5,2.297,467712,647409.449152669,0.3148,0.6775,2.739,0.678,0.525,0,2.453,2.538,3.179,8.506,3.092,1.1
2000,6,2.319,479248,654262.383350558,0.3139,0.6791,2.823,0.651,0.551,0,2.473,2.48,3.167,8.519,3.072,0
2000,7,2.318,480019,654534.577614929,0.3116,0.6815,2.712,0.709,0.559,0,2.425,2.457,3.139,8.42,3.111,0.5
2000,8,2.277,618567,643789.807536772,0.3117,0.6815,2.61,0.678,0.564,0,2.361,2.372,
@zanarmstrong
zanarmstrong / LICENSE.txt
Last active January 28, 2016 21:15
Dynamic tiles clipping - adapted
The MIT License (MIT)
Copyright (c) 2014 [KoGor](https://github.com/KoGor)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: