Skip to content

Instantly share code, notes, and snippets.

@johnmichel
Created November 24, 2014 22:23
Show Gist options
  • Save johnmichel/87e253b7b07ab855bee2 to your computer and use it in GitHub Desktop.
Save johnmichel/87e253b7b07ab855bee2 to your computer and use it in GitHub Desktop.

Revisions

  1. johnmichel revised this gist Nov 24, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions _.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    [ <a href="http://tributary.io/inlet/87e253b7b07ab855bee2">Launch: 2 level binding</a> ] 87e253b7b07ab855bee2 by johnmichel<br>[ <a href="http://tributary.io/inlet/4b0a4ec75d812cc48817">Launch: 2 level binding</a> ] 4b0a4ec75d812cc48817 by trinary<br>
  2. johnmichel created this gist Nov 24, 2014.
    1 change: 1 addition & 0 deletions config.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {"description":"2 level binding","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"ajax-caching":true}
    258 changes: 258 additions & 0 deletions data.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,258 @@
    {
    "drinks": [
    {
    "date": "2014-11-01",
    "drinks": [
    {
    "time": "15:07",
    "amount": 11,
    "roaster": "ReAnimator",
    "variety": "Keystone Blend",
    "method": "Chemex",
    "container": "Dinosaur mug",
    "location": "Apartment"
    }
    ]
    },
    {
    "date": "2014-11-02",
    "drinks": [
    {
    "time": "9:25",
    "amount": 12,
    "roaster": "Toby's Estate",
    "variety": "Guatemala - El Tambor",
    "method": "Pourover",
    "container": "Paper to-go cup",
    "location": "Bean Vault Coffee"
    }
    ]
    },
    {
    "date": "2014-11-03",
    "drinks": [
    {
    "time": "08:09",
    "amount": 11,
    "roaster": "Rival Brothers",
    "variety": "Ethiopia - Limu Natural",
    "method": "Drip",
    "container": "CSS Is Awesome mug",
    "location": "Empathy Lab"
    },
    {
    "time": "10:32",
    "amount": 11,
    "roaster": "ReAnimator",
    "variety": "El Salvador - Guyabo",
    "method": "Drip",
    "container": "CSS Is Awesome mug",
    "location": "Empathy Lab"
    }
    ]
    },
    {
    "date": "2014-11-04",
    "drinks": [
    {
    "time": "7:41",
    "amount": 11,
    "roaster": "ReAnimator",
    "variety": "Foundation Blend",
    "method": "Drip",
    "container": "CSS Is Awesome mug",
    "location": "Empathy Lab"
    },
    {
    "time": "9:29",
    "amount": 11,
    "roaster": "ReAnimator",
    "variety": "El Salvador - Guyabo",
    "method": "Drip",
    "container": "CSS Is Awesome mug",
    "location": "Empathy Lab"
    },
    {
    "time": "10:25",
    "amount": 11,
    "roaster": "ReAnimator",
    "variety": "El Salvador - Guyabo",
    "method": "Drip",
    "container": "CSS Is Awesome mug",
    "location": "Empathy Lab"
    }
    ]
    },
    {
    "date": "2014-11-05",
    "drinks": [
    {
    "time": "8:19",
    "amount": 11,
    "roaster": "ReAnimator",
    "variety": "El Salvador - Guyabo",
    "method": "Drip",
    "container": "CSS Is Awesome mug",
    "location": "Empathy Lab"
    },
    {
    "time": "9:45",
    "amount": 11,
    "roaster": "ReAnimator",
    "variety": "Foundation Blend",
    "method": "Drip",
    "container": "CSS Is Awesome mug",
    "location": "Empathy Lab"
    }
    ]
    },
    {
    "date": "2014-11-06",
    "drinks": [
    {
    "time": "8:24",
    "amount": 11,
    "roaster": "ReAnimator",
    "variety": "Foundation Blend",
    "method": "Drip",
    "container": "CSS Is Awesome mug",
    "location": "Empathy Lab"
    },
    {
    "time": "10:07",
    "amount": 11,
    "roaster": "ReAnimator",
    "variety": "El Salvador - Guyabo",
    "method": "Drip",
    "container": "CSS Is Awesome mug",
    "location": "Empathy Lab"
    }
    ]
    },
    {
    "date": "2014-11-07",
    "drinks": [
    {
    "time": "8:14",
    "amount": 11,
    "roaster": "Rival Brothers",
    "variety": "Honduras - Guachipilin Blend",
    "method": "Chemex",
    "container": "Dinosaur mug",
    "location": "Apartment"
    }
    ]
    },
    {
    "date": "2014-11-08",
    "drinks": [
    {
    "time": "12:38",
    "amount": 3,
    "roaster": "ReAnimator",
    "variety": "Keystone Blend",
    "method": "Espresso",
    "container": "White ceramic cup",
    "location": "Apartment"
    }
    ]
    },
    {
    "date": "2014-11-15",
    "drinks": [
    {
    "time": "11:44",
    "amount": 12,
    "roaster": "Stumptown",
    "variety": "Ethiopia - Duromina",
    "method": "BeeHouse Pourover",
    "container": "Paper to-go cup",
    "location": "Stumptown W 8th"
    }
    ]
    },
    {
    "date": "2014-11-16",
    "drinks": [
    {
    "time": "10:01",
    "amount": 3,
    "roaster": "Rival Brothers",
    "variety": "Costa Rica - La Acostena",
    "method": "Espresso",
    "container": "White ceramic cup",
    "location": "Apartment"
    },
    {
    "time": "14:49",
    "amount": 12,
    "roaster": "Ocean City Coffee Company",
    "variety": "Ethiopia - Sidamo",
    "method": "Chemex",
    "container": "Sutro Bears mug",
    "location": "House"
    }
    ]
    },
    {
    "date": "2014-11-22",
    "drinks": [
    {
    "time": "11:59",
    "amount": 18,
    "roaster": "Rival Brothers",
    "variety": "Whistle & Cuss",
    "method": "Chemex",
    "container": "Coffee Methods mug",
    "location": "Apartment"
    },
    {
    "time": "13:42",
    "amount": 18,
    "roaster": "Rival Brothers",
    "variety": "Costa Rica - La Acostena",
    "method": "Chemex",
    "container": "Coffee Methods mug",
    "location": "Apartment"
    }
    ]
    },
    {
    "date": "2014-11-23",
    "drinks": [
    {
    "time": "10:36",
    "amount": 18,
    "roaster": "Rival Brothers",
    "variety": "Sumatra - ",
    "method": "Chemex",
    "container": "Coffee Methods mug",
    "location": "Apartment"
    }
    ]
    },
    {
    "date": "2014-11-24",
    "drinks": [
    {
    "time": "9:07",
    "amount": 18,
    "roaster": "Tonx",
    "variety": " - ",
    "method": "Chemex",
    "container": "Coffee Methods mug",
    "location": "Apartment"
    },
    {
    "time": "13:09",
    "amount": 12,
    "roaster": "Stumptown",
    "variety": "Ethiopia - Duromina",
    "method": "Chemex",
    "container": "Dinosaur mug",
    "location": "Apartment"
    }
    ]
    }
    ]
    }
    10 changes: 10 additions & 0 deletions inlet.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    var data = tributary.data;
    var svg = d3.select("svg");
    var gs = svg.selectAll("g").data(data.drinks).enter().append("g");
    var cs = gs.selectAll("circle").data(function(d) { return d.drinks; }).enter().append("circle");
    cs.attr({
    r: 5,
    cx: function(d,i) {return d.amount * 20},
    cy: 40
    });
    console.log("asdf",cs);