Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/colorbrewer.v1.min.js"></script>
<style type="text/css">
@atmccann
atmccann / oscars.html
Created March 6, 2014 16:30
text on a circle
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
@atmccann
atmccann / error
Created March 11, 2014 17:32
what did i do ¯\_(ツ)_/¯.
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:904:11)
at Server._listen2 (net.js:1042:14)
at listen (net.js:1064:10)
at Server.listen (net.js:1138:5)
at Function.app.listen (/Users/atmccann/Desktop/march-madness/node_modules/express/lib/application.js:533:24)
at Gulp.gulp.task.stage (/Users/atmccann/Desktop/march-madness/gulpfile.js:135:9)
@atmccann
atmccann / ps -A | grep "node"
Created March 11, 2014 17:35
no idea what im doing, sorry
177 atmccann:march-madness$ ps -A | grep "node"
659 ?? 3:27.84 /Applications/Atom.app/Contents/Frameworks/Atom Helper.app/Contents/MacOS/Atom Helper --type=renderer --disable-accelerated-compositing --js-flags=--harmony_collections --harmony-proxies --no-sandbox --lang=en-US --node-integration=all --disable-accelerated-video-decode --channel=657.0.2064015559
662 ?? 0:00.60 /Applications/Atom.app/Contents/Frameworks/Atom Helper.app/Contents/MacOS/Atom Helper --eval require('/Applications/Atom.app/Contents/Resources/app/node_modules/coffee-script/lib/coffee-script/coffee-script.js').register();^Jrequire('/Applications/Atom.app/Contents/Resources/app/src/coffee-cache.js').register();^Jrequire('/Applications/Atom.app/Contents/Resources/app/src/task-bootstrap.js'); --harmony_collections
7490 ?? 1:07.56 /Applications/Atom.app/Contents/Frameworks/Atom Helper.app/Contents/MacOS/Atom Helper --type=renderer --disable-accelerated-compositing --js-flags=--harmony_collections --harmony-proxies
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>scatter</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
.axis path,
.axis line {
@atmccann
atmccann / index.html
Created September 11, 2013 20:41
Bar chart with pos/neg values
<meta charset="utf-8">
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
body {
font: 12px Helvetica;
}
@atmccann
atmccann / data.json
Created September 18, 2013 21:59
bar chart transitions (can you tell i like bar charts?)
[{"network":"ABC","year_one":9860,"year_two":10596,"year_three":9989,"year_four":12217,"year_five":12281,"year_six":11913,"year_seven":12265,"year_eight":11050,"year_nine":9595,"year_ten":9871,"year_eleven":8339},
{"network":"AZA","year_one":0,"year_two":0,"year_three":0,"year_four":0,"year_five":213,"year_six":0,"year_seven":0,"year_eight":201,"year_nine":236,"year_ten":212,"year_eleven":0},
{"network":"CBS","year_one":13959,"year_two":13856,"year_three":13581,"year_four":12843,"year_five":13019,"year_six":11726,"year_seven":11274,"year_eight":11812,"year_nine":12538,"year_ten":12284,"year_eleven":10690},
{"network":"CW","year_one":0,"year_two":0,"year_three":0,"year_four":0,"year_five":2847,"year_six":2772,"year_seven":2911,"year_eight":2177,"year_nine":2481,"year_ten":1642,"year_eleven":688},
{"network":"ETV","year_one":0,"year_two":0,"year_three":0,"year_four":0,"year_five":0,"year_six":0,"year_seven":0,"year_eight":0,"year_nine":226,"year_ten":200,"year_eleven":231},
{"network":"FOX","year_one":7102,"yea
@atmccann
atmccann / data2.csv
Last active December 23, 2015 18:39
can i make this sortable or BETTER HELPppp
State 25 years old w/o subsidy 25 years old w/ subsidy 40 years old w/o subsidy 40 years old w/ subsidy 60 years old w/o subsidy 60 years old w/ subsidy
CT 258.0 193.0 258.0 193.0 697.0 193.0
DC 180.0 180.0 180.0 180.0 521.0 193.0
MD 179.0 179.0 179.0 179.0 484.0 193.0
ME 232.0 193.0 232.0 193.0 626.0 193.0
NY 390.0 193.0 390.0 193.0 390.0 193.0
RI 230.0 193.0 230.0 193.0 622.0 193.0
VA 199.0 193.0 199.0 193.0 537.0 193.0
VT 413.0 193.0 413.0 193.0 413.0 193.0
IN 232.0 193.0 232.0 193.0 626.0 193.0
@atmccann
atmccann / data2.csv
Created September 24, 2013 17:11
sorting is breaking :(
CT 258.0 193.0 258.0 193.0 697.0 193.0
DC 180.0 180.0 180.0 180.0 521.0 193.0
MD 179.0 179.0 179.0 179.0 484.0 193.0
ME 232.0 193.0 232.0 193.0 626.0 193.0
NY 390.0 193.0 390.0 193.0 390.0 193.0
RI 230.0 193.0 230.0 193.0 622.0 193.0
VA 199.0 193.0 199.0 193.0 537.0 193.0
VT 413.0 193.0 413.0 193.0 413.0 193.0
IN 232.0 193.0 232.0 193.0 626.0 193.0
@atmccann
atmccann / colorbrewer.js
Created September 25, 2013 22:37
multi series line chart
var colorbrewer = {YlGn: {
3: ["#f7fcb9","#addd8e","#31a354"],
4: ["#ffffcc","#c2e699","#78c679","#238443"],
5: ["#ffffcc","#c2e699","#78c679","#31a354","#006837"],
6: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],
7: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
8: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
9: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]
},YlGnBu: {
3: ["#edf8b1","#7fcdbb","#2c7fb8"],