Skip to content

Instantly share code, notes, and snippets.

@ejfox
ejfox / _.md
Created November 27, 2012 15:40
Proof of Concept for Tabletop+Tributary
@ejfox
ejfox / county_map.coffee
Created December 6, 2012 21:48
Visited Counties
makeCountyMap = (error, us, openpaths) ->
console.log "HELLO!"
console.log error, us, openpaths
svg = d3.select("#county-map")
.attr({
height: 500
width: 900
})
.style({
@ejfox
ejfox / config.json
Created December 10, 2012 23:47
Leap + Tributary
{"description":"Leap + Tributary","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"tab":"edit","display_percent":0.7,"play":true,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"hidepanel":false}
@ejfox
ejfox / _.md
Created December 11, 2012 03:16
Leap + Tributary
@ejfox
ejfox / example_snippet.json
Created December 11, 2012 17:05
Example Snippet JSON (very meta)
{
"comments_url": "https://api.github.com/gists/4136856/comments",
"created_at": "2012-11-23T19:02:56Z",
"git_push_url": "git@gist.github.com:4136856.git",
"description": "",
"html_url": "https://gist.github.com/4136856",
"url": "https://api.github.com/gists/4136856",
"updated_at": "2012-11-23T19:18:00Z",
"public": true,
"forks": [
@ejfox
ejfox / snippet.json
Created December 11, 2012 17:08
Snippet Example Pruned
{
"snippet.js": {
"type": "application/javascript",
"filename": "snippet.js",
"language": "JavaScript",
"content": "vis = tributary.g\n \nvar width = 500,\n height = 300,\n padding = 80;\n\n// define the y scale (vertical)\nvar yScale = d3.scale.linear()\n .domain([0, 100]) // values between 0 and 100\n .range([height - padding, padding]); // map these to the chart height, less padding.\n\n// define the x scale (horizontal)\nvar mindate = new Date(2012,0,1),\n maxdate = new Date(2012,0,31);\n \nvar xScale = d3.time.scale()\n .domain([mindate, maxdate]) // values between for month of january\n\t.range([padding, width - padding * 2]); // map these the the chart width = total width minus padding at both sides\n \n\n// define the y axis\nvar yAxis = d3.svg.axis()\n .orient(\"left\")\n .ticks(5)\n .scale(yScale);\n\n\n// define the x axis\nvar xAxis = d3.svg.axis()\n .orient(\"bottom\")\n \t.ticks(4)\n .scale(xScale);\n\n// draw y axis with labels and move in from the size by th
metricHistory = (json) ->
historydiv = d3.select("#history")
width = 700
height = 100
console.log "JSAWN", json
# Create a new SVG for each metric there is
# "amMood", "optimism", "etc"
<!doctype html>
<html>
<head>
<title></title>
<meta charset=utf-8>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/square/crossfilter/master/crossfilter.min.js"></script>
<style>
.menu1-container, .menu2-container, .menu3-container{
position: relative;
@ejfox
ejfox / index.html
Created December 30, 2012 10:59
d3_examples
<!doctype html>
<html>
<head>
<title></title>
<meta charset=utf-8>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/square/crossfilter/master/crossfilter.min.js"></script>
<style>
body {
font-size: 100%;
@ejfox
ejfox / config.json
Created January 3, 2013 02:28
Another Inlet
{"description":"Another Inlet","endpoint":"","display":"svg","public":true,"require":[{"name":"Underscore","url":"http://underscorejs.org/underscore-min.js"},{"name":"TopoJSON","url":"http://raw.github.com/mbostock/topojson/master/topojson.js"},{"name":"Queue","url":"http://d3js.org/queue.v1.min.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"us.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"openpaths.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"tab":"edit","display_percent":0.2738095238095243,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"hidepanel":false}