Skip to content

Instantly share code, notes, and snippets.

/_.md

Forked from ptvans/_.md
Created September 25, 2012 23:57
Show Gist options
  • Save anonymous/3785183 to your computer and use it in GitHub Desktop.
Save anonymous/3785183 to your computer and use it in GitHub Desktop.
just another inlet to tributary
{"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":601,"height":515,"hide":false},"endpoint":"tributary","public":true,"editor_json0":{"vim":false,"emacs":false,"width":855,"height":570,"hide":true}}
[
{
"monthyr": "6/1/05",
"apicount": "39",
"cumulative": "39"
},
{
"monthyr": "9/1/05",
"apicount": "19",
"cumulative": "58"
},
{
"monthyr": "10/1/05",
"apicount": "20",
"cumulative": "78"
},
{
"monthyr": "11/1/05",
"apicount": "14",
"cumulative": "92"
},
{
"monthyr": "12/1/05",
"apicount": "16",
"cumulative": "108"
},
{
"monthyr": "1/1/06",
"apicount": "36",
"cumulative": "144"
},
{
"monthyr": "2/1/06",
"apicount": "26",
"cumulative": "170"
},
{
"monthyr": "3/1/06",
"apicount": "9",
"cumulative": "179"
},
{
"monthyr": "4/1/06",
"apicount": "12",
"cumulative": "191"
},
{
"monthyr": "5/1/06",
"apicount": "21",
"cumulative": "212"
},
{
"monthyr": "6/1/06",
"apicount": "19",
"cumulative": "231"
},
{
"monthyr": "7/1/06",
"apicount": "26",
"cumulative": "257"
},
{
"monthyr": "8/1/06",
"apicount": "23",
"cumulative": "280"
},
{
"monthyr": "9/1/06",
"apicount": "24",
"cumulative": "304"
},
{
"monthyr": "10/1/06",
"apicount": "30",
"cumulative": "334"
},
{
"monthyr": "11/1/06",
"apicount": "17",
"cumulative": "351"
},
{
"monthyr": "12/1/06",
"apicount": "16",
"cumulative": "367"
},
{
"monthyr": "1/1/07",
"apicount": "20",
"cumulative": "387"
},
{
"monthyr": "2/1/07",
"apicount": "13",
"cumulative": "400"
},
{
"monthyr": "3/1/07",
"apicount": "21",
"cumulative": "421"
},
{
"monthyr": "4/1/07",
"apicount": "23",
"cumulative": "444"
},
{
"monthyr": "5/1/07",
"apicount": "16",
"cumulative": "460"
},
{
"monthyr": "6/1/07",
"apicount": "19",
"cumulative": "479"
},
{
"monthyr": "7/1/07",
"apicount": "25",
"cumulative": "504"
},
{
"monthyr": "8/1/07",
"apicount": "17",
"cumulative": "521"
},
{
"monthyr": "9/1/07",
"apicount": "24",
"cumulative": "545"
},
{
"monthyr": "10/1/07",
"apicount": "17",
"cumulative": "562"
},
{
"monthyr": "11/1/07",
"apicount": "41",
"cumulative": "603"
},
{
"monthyr": "12/1/07",
"apicount": "33",
"cumulative": "636"
},
{
"monthyr": "1/1/08",
"apicount": "33",
"cumulative": "669"
},
{
"monthyr": "2/1/08",
"apicount": "56",
"cumulative": "725"
},
{
"monthyr": "3/1/08",
"apicount": "26",
"cumulative": "751"
},
{
"monthyr": "4/1/08",
"apicount": "34",
"cumulative": "785"
},
{
"monthyr": "5/1/08",
"apicount": "23",
"cumulative": "808"
},
{
"monthyr": "6/1/08",
"apicount": "70",
"cumulative": "878"
},
{
"monthyr": "7/1/08",
"apicount": "53",
"cumulative": "931"
},
{
"monthyr": "8/1/08",
"apicount": "49",
"cumulative": "980"
},
{
"monthyr": "9/1/08",
"apicount": "80",
"cumulative": "1060"
},
{
"monthyr": "10/1/08",
"apicount": "50",
"cumulative": "1110"
},
{
"monthyr": "11/1/08",
"apicount": "49",
"cumulative": "1159"
},
{
"monthyr": "12/1/08",
"apicount": "38",
"cumulative": "1197"
},
{
"monthyr": "1/1/09",
"apicount": "43",
"cumulative": "1240"
},
{
"monthyr": "2/1/09",
"apicount": "71",
"cumulative": "1311"
},
{
"monthyr": "3/1/09",
"apicount": "49",
"cumulative": "1360"
},
{
"monthyr": "4/1/09",
"apicount": "45",
"cumulative": "1405"
},
{
"monthyr": "5/1/09",
"apicount": "37",
"cumulative": "1442"
},
{
"monthyr": "6/1/09",
"apicount": "30",
"cumulative": "1472"
},
{
"monthyr": "7/1/09",
"apicount": "33",
"cumulative": "1505"
},
{
"monthyr": "8/1/09",
"apicount": "38",
"cumulative": "1543"
},
{
"monthyr": "9/1/09",
"apicount": "33",
"cumulative": "1576"
},
{
"monthyr": "10/1/09",
"apicount": "48",
"cumulative": "1624"
},
{
"monthyr": "11/1/09",
"apicount": "75",
"cumulative": "1699"
},
{
"monthyr": "12/1/09",
"apicount": "69",
"cumulative": "1768"
},
{
"monthyr": "1/1/10",
"apicount": "69",
"cumulative": "1837"
},
{
"monthyr": "2/1/10",
"apicount": "130",
"cumulative": "1967"
},
{
"monthyr": "3/1/10",
"apicount": "68",
"cumulative": "2035"
},
{
"monthyr": "4/1/10",
"apicount": "81",
"cumulative": "2116"
},
{
"monthyr": "5/1/10",
"apicount": "48",
"cumulative": "2164"
},
{
"monthyr": "6/1/10",
"apicount": "27",
"cumulative": "2191"
},
{
"monthyr": "7/1/10",
"apicount": "59",
"cumulative": "2250"
},
{
"monthyr": "8/1/10",
"apicount": "62",
"cumulative": "2312"
},
{
"monthyr": "9/1/10",
"apicount": "110",
"cumulative": "2422"
},
{
"monthyr": "10/1/10",
"apicount": "147",
"cumulative": "2569"
},
{
"monthyr": "11/1/10",
"apicount": "266",
"cumulative": "2835"
},
{
"monthyr": "12/1/10",
"apicount": "162",
"cumulative": "2997"
},
{
"monthyr": "1/1/11",
"apicount": "202",
"cumulative": "3199"
},
{
"monthyr": "2/1/11",
"apicount": "108",
"cumulative": "3307"
},
{
"monthyr": "3/1/11",
"apicount": "116",
"cumulative": "3423"
},
{
"monthyr": "4/1/11",
"apicount": "113",
"cumulative": "3536"
},
{
"monthyr": "5/1/11",
"apicount": "131",
"cumulative": "3667"
},
{
"monthyr": "6/1/11",
"apicount": "91",
"cumulative": "3758"
}
]
var col = tributary.data;
var svg = d3.select("svg");
var cx = 29;
var cy = 70;
var cw = 600;
var ch = 300;
var ymin = 0;
var ymax = d3.max(col, function(d) {return d.apicount});;
var y_scale = d3.scale.linear()
.domain([ymin, ymax])
.range([ch, 0]);
var chart = svg.append("g")
.attr("transform", "translate(" + [cx, cy] + ")");
//chart
chart.append("rect")
.attr({
id: "bg",
width: cw,
height: ch,
fill: "#D6D6D6",
stroke: "none"
})
chart.append("g")
.attr("id", "values")
var bars = chart.select("#values").selectAll("circle")
.data(col);
var barw = 9;
bars.enter()
.append("rect")
bars.attr({
x: function(d,i) {
return i * (barw + 1);
},
y: ch,
width: barw,
height: function(d,i) {
return d.apicount * 1;
},
fill: "#006DB6",
"fill-opacity": 0.65,
stroke: "#000000",
"stroke-width": 0
})
.append("title")
.text(function(d) {
return d.city;
})
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment