Skip to content

Instantly share code, notes, and snippets.

@enjalot
Last active December 26, 2015 12:09
Show Gist options
  • Save enjalot/7149418 to your computer and use it in GitHub Desktop.
Save enjalot/7149418 to your computer and use it in GitHub Desktop.
html5devconf intermediate d3.js workshop
if(!d3.chart) d3.chart = {};
d3.chart.brush = function() {
var g;
var data;
var width = 600;
var height = 30;
var dispatch = d3.dispatch(chart, "filter");
function chart(container) {
g = container;
var extent = d3.extent(data, function(d) {
return d.data.created
})
var scale = d3.time.scale()
.domain(extent)
.range([0, width])
var brush = d3.svg.brush()
brush.x(scale)
brush(g)
g.selectAll("rect").attr("height", height)
g.selectAll(".background")
.style({fill: "#4B9E9E", visibility: "visible"})
g.selectAll(".extent")
.style({fill: "#78C5C5", visibility: "visible"})
g.selectAll(".resize rect")
.style({fill: "#276C86", visibility: "visible"})
var rects = g.selectAll("rect.events")
.data(data)
rects.enter()
.append("rect").classed("events", true)
rects.attr({
x: function(d) { return scale(d.data.created);},
y: 0,
width: 1,
height: height
}).style("pointer-events", "none")
rects.exit().remove()
brush.on("brushend", function() {
var ext = brush.extent()
var filtered = data.filter(function(d) {
return (d.data.created > ext[0] && d.data.created < ext[1])
})
g.selectAll("rect.events")
.style("stroke", "")
g.selectAll("rect.events")
.data(filtered, function(d) { return d.data.id })
.style({
stroke: "#fff"
})
//emit filtered data
dispatch.filter(filtered)
})
var axis = d3.svg.axis()
.scale(scale)
.orient("bottom")
.tickValues([new Date(extent[0]), new Date(extent[0] + (extent[1] - extent[0])/2) , new Date(extent[1])])
.tickFormat(d3.time.format("%b %d %H:%M"))
var agroup = g.append("g")
agroup.attr("transform", "translate(" + [0, height] + ")")
axis(agroup)
agroup.selectAll("path")
.style({ fill: "none", stroke: "#000"})
agroup.selectAll("line")
.style({ stroke: "#000"})
}
chart.highlight = function(data) {
var rects = g.selectAll("rect.events")
.style("stroke", "")
.style("stroke-width", "")
rects.data(data, function(d) { return d.data.id })
.style("stroke", "orange")
.style("stroke-width", 3)
}
chart.data = function(value) {
if(!arguments.length) return data;
data = value;
return chart;
}
chart.width = function(value) {
if(!arguments.length) return width;
width = value;
return chart;
}
chart.height = function(value) {
if(!arguments.length) return height;
height = value;
return chart;
}
return d3.rebind(chart, dispatch, "on");
}
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<style>
svg {
width: 500px;
height: 500px;
border: 1px solid gray;
float:left;
}
.table {
width: 400px;
height: 500px;
overflow: scroll;
float:left;
}
.axis {
font-size: 10px;
}
.axis path {
fill: none;
stroke: #000000;
}
.axis .tick line {
stroke: #000;
}
td {
padding: 5px;
}
</style>
</head>
<body>
<svg></svg>
<div id="display"></div>
<script src="http://d3js.org/d3.v3.js"></script>
<script src="table.js"></script>
<script src="scatter.js"></script>
<script src="brush.js"></script>
<script>
var display = d3.select("#display");
d3.json("pics.json", function(err, pics) {
var data = pics.data.children;
data.forEach(function(d) {
d.data.created *= 1000;
})
console.log(data);
var display = d3.select("#display")
//table
var tdiv = display.append("div").classed("table", true)
var table = d3.chart.table()
table.data(data)
table(tdiv);
var svg = d3.select("svg")
//scatter plot
var sgroup = svg.append("g")
.attr("transform", "translate(50, 0)")
var scatter = d3.chart.scatter()
scatter.data(data)
scatter.width(400)
scatter(sgroup)
//brush
var bgroup = svg.append("g")
.attr("transform", "translate(50, 430)")
var brush = d3.chart.brush()
brush
.data(data)
.width(400)
brush(bgroup)
brush.on("filter", function(filtered) {
console.log("filtered", filtered);
scatter.data(filtered);
scatter.update();
table.data(filtered)
table.update();
})
table.on("hover", function(hovered) {
scatter.highlight(hovered)
brush.highlight(hovered)
})
scatter.on("hover", function(hovered) {
table.highlight(hovered)
brush.highlight(hovered)
})
})
</script>
</body>
</html>
{
"kind": "Listing",
"data": {
"modhash": "0ci9rz4pav3497b76dbedd0ffb0fbe61ae517994a9e7ccadc0",
"children": [
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p5s25",
"secure_media_embed": {},
"stickied": false,
"author": "Chikyu",
"media": null,
"score": 3400,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://f.thumbs.redditmedia.com/asWiuhvOZjpIWvpG.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 9999,
"is_self": false,
"permalink": "/r/pics/comments/1p5s25/lightning_ridge_black_opal/",
"name": "t3_1p5s25",
"created": 1382688679,
"url": "http://i.imgur.com/OYQ3b.jpg",
"author_flair_text": null,
"title": "Lightning Ridge Black Opal",
"created_utc": 1382659879,
"link_flair_text": null,
"distinguished": null,
"num_comments": 455,
"visited": false,
"num_reports": null,
"ups": 13399
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p5p5o",
"secure_media_embed": {},
"stickied": false,
"author": "DecentOpinion",
"media": null,
"score": 2824,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://f.thumbs.redditmedia.com/mFjQx3k6l9nir5mM.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 3190,
"is_self": false,
"permalink": "/r/pics/comments/1p5p5o/so_this_guy_just_rollerblades_up_to_the_fountain/",
"name": "t3_1p5p5o",
"created": 1382686340,
"url": "http://i.imgur.com/d7rSOzW.jpg",
"author_flair_text": null,
"title": "So this guy just rollerblades up to the fountain with an injured seagull and holds it while it drinks from the fountain",
"created_utc": 1382657540,
"link_flair_text": null,
"distinguished": null,
"num_comments": 191,
"visited": false,
"num_reports": null,
"ups": 6014
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p592m",
"secure_media_embed": {},
"stickied": false,
"author": "smellymolls",
"media": null,
"score": 2507,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://b.thumbs.redditmedia.com/pYVLlZWOBUcHvUw7.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 1953,
"is_self": false,
"permalink": "/r/pics/comments/1p592m/over_2000_yo_heads_of_statues_previolusly_part_of/",
"name": "t3_1p592m",
"created": 1382674342,
"url": "http://i.imgur.com/1Q0jAso.jpg",
"author_flair_text": null,
"title": "Over 2000 y/o heads of statues previolusly part of a tomb-sanctuary in Turkey",
"created_utc": 1382645542,
"link_flair_text": null,
"distinguished": null,
"num_comments": 87,
"visited": false,
"num_reports": null,
"ups": 4460
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p51sj",
"secure_media_embed": {},
"stickied": false,
"author": "l0v4",
"media": null,
"score": 3075,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/ROkSp1-6YMEE3INh.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 15791,
"is_self": false,
"permalink": "/r/pics/comments/1p51sj/deteriorating_leaf/",
"name": "t3_1p51sj",
"created": 1382669086,
"url": "http://i.imgur.com/MwB5JWb.jpg",
"author_flair_text": null,
"title": "Deteriorating Leaf",
"created_utc": 1382640286,
"link_flair_text": null,
"distinguished": null,
"num_comments": 232,
"visited": false,
"num_reports": null,
"ups": 18866
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4wem",
"secure_media_embed": {},
"stickied": false,
"author": "bananashirt178",
"media": null,
"score": 2944,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://d.thumbs.redditmedia.com/xA8qbfL4yEwiUh7-.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 9127,
"is_self": false,
"permalink": "/r/pics/comments/1p4wem/fall_in_michigan/",
"name": "t3_1p4wem",
"created": 1382665352,
"url": "http://i.imgur.com/nxMHf35.jpg",
"author_flair_text": null,
"title": "Fall in Michigan",
"created_utc": 1382636552,
"link_flair_text": null,
"distinguished": null,
"num_comments": 444,
"visited": false,
"num_reports": null,
"ups": 12071
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4yyi",
"secure_media_embed": {},
"stickied": false,
"author": "Proteon",
"media": null,
"score": 2637,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/dfav_Lx94A929B78.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 2912,
"is_self": false,
"permalink": "/r/pics/comments/1p4yyi/500_year_old_fox_shaped_armor_of_emperor_charles_v/",
"name": "t3_1p4yyi",
"created": 1382667111,
"url": "http://imgur.com/RT4hZKn",
"author_flair_text": null,
"title": "500 year old fox shaped armor of Emperor Charles V",
"created_utc": 1382638311,
"link_flair_text": null,
"distinguished": null,
"num_comments": 175,
"visited": false,
"num_reports": null,
"ups": 5549
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4t18",
"secure_media_embed": {},
"stickied": false,
"author": "rogue702",
"media": null,
"score": 3227,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://b.thumbs.redditmedia.com/lPIIW7CatYIMDZha.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 19615,
"is_self": false,
"permalink": "/r/pics/comments/1p4t18/my_dads_costume_last_year_dont_know_how_he_can/",
"name": "t3_1p4t18",
"created": 1382662893,
"url": "http://imgur.com/GJCyGZ3",
"author_flair_text": null,
"title": "My Dad's costume last year- Don't know how he can top this",
"created_utc": 1382634093,
"link_flair_text": null,
"distinguished": null,
"num_comments": 218,
"visited": false,
"num_reports": null,
"ups": 22842
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {
"content": "&lt;iframe class=\"imgur-album\" width=\"550\" height=\"550\" frameborder=\"0\" src=\"http://imgur.com/a/a1h6R/embed\"&gt;&lt;/iframe&gt;",
"width": 550,
"scrolling": false,
"height": 550
},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p542a",
"secure_media_embed": {},
"stickied": false,
"author": "EvTheSmev",
"media": {
"type": "imgur.com",
"oembed": {
"provider_url": "http://imgur.com",
"description": "Imgur is home to the web's most popular image content, curated in real time by a dedicated community through commenting, voting and sharing.",
"title": "Stages of Cancer - Imgur",
"type": "rich",
"thumbnail_width": 640,
"height": 550,
"width": 550,
"html": "&lt;iframe class=\"imgur-album\" width=\"550\" height=\"550\" frameborder=\"0\" src=\"http://imgur.com/a/a1h6R/embed\"&gt;&lt;/iframe&gt;",
"version": "1.0",
"provider_name": "Imgur",
"thumbnail_url": "http://i.imgur.com/B4GM5T4.jpg",
"thumbnail_height": 417
}
},
"score": 2236,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/58mlNcC9dNrqkzEh.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 30971,
"is_self": false,
"permalink": "/r/pics/comments/1p542a/a_mans_wife_was_diagnosed_with_cancer_so_he/",
"name": "t3_1p542a",
"created": 1382645502,
"url": "http://imgur.com/a/a1h6R",
"author_flair_text": null,
"title": "A man's wife was diagnosed with cancer, so he photographed the entire battle in unforgettable pictures",
"created_utc": 1382641902,
"link_flair_text": null,
"distinguished": null,
"num_comments": 2268,
"visited": false,
"num_reports": null,
"ups": 33207
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p59zf",
"secure_media_embed": {},
"stickied": false,
"author": "jayRokk",
"media": null,
"score": 1670,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://f.thumbs.redditmedia.com/iYIsNC-m2andCOIq.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 3376,
"is_self": false,
"permalink": "/r/pics/comments/1p59zf/i_grew_up_during_the_clinton_era_this_is_how_i/",
"name": "t3_1p59zf",
"created": 1382649809,
"url": "http://i.imgur.com/zf8DRtZ.jpg",
"author_flair_text": null,
"title": "I grew up during the Clinton era. This is how I feel about that time.",
"created_utc": 1382646209,
"link_flair_text": null,
"distinguished": null,
"num_comments": 317,
"visited": false,
"num_reports": null,
"ups": 5046
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4zwo",
"secure_media_embed": {},
"stickied": false,
"author": "jesbaker",
"media": null,
"score": 2206,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://a.thumbs.redditmedia.com/4PYVsqekcf4WD0oT.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 13277,
"is_self": false,
"permalink": "/r/pics/comments/1p4zwo/ron_swanson_lunchable/",
"name": "t3_1p4zwo",
"created": 1382667754,
"url": "http://i.imgur.com/cM3HR8c.jpg",
"author_flair_text": null,
"title": "Ron Swanson lunchable.",
"created_utc": 1382638954,
"link_flair_text": null,
"distinguished": null,
"num_comments": 382,
"visited": false,
"num_reports": null,
"ups": 15483
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4rwo",
"secure_media_embed": {},
"stickied": false,
"author": "BeyondRemedy",
"media": null,
"score": 2630,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://e.thumbs.redditmedia.com/hQQvWPA4t42uBLeX.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 9257,
"is_self": false,
"permalink": "/r/pics/comments/1p4rwo/saw_this_guy_at_the_cavs_game_last_night/",
"name": "t3_1p4rwo",
"created": 1382662042,
"url": "http://imgur.com/no0Mr9B",
"author_flair_text": null,
"title": "Saw this guy at the Cavs game last night",
"created_utc": 1382633242,
"link_flair_text": null,
"distinguished": null,
"num_comments": 301,
"visited": false,
"num_reports": null,
"ups": 11887
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4tzv",
"secure_media_embed": {},
"stickied": false,
"author": "xerxes_fifield",
"media": null,
"score": 2453,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://a.thumbs.redditmedia.com/C0tl_MwJEdso6klx.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 20827,
"is_self": false,
"permalink": "/r/pics/comments/1p4tzv/i_saw_this_bus_at_an_intersection_in_minneapolis/",
"name": "t3_1p4tzv",
"created": 1382663629,
"url": "http://i.imgur.com/bxKMs4f.jpg",
"author_flair_text": null,
"title": "I saw this bus at an intersection in Minneapolis today. It was probably on its way to the front page...",
"created_utc": 1382634829,
"link_flair_text": null,
"distinguished": null,
"num_comments": 918,
"visited": false,
"num_reports": null,
"ups": 23280
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p555y",
"secure_media_embed": {},
"stickied": false,
"author": "fugololo",
"media": null,
"score": 1585,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/szvyfYS_pRhYeZu8.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 636,
"is_self": false,
"permalink": "/r/pics/comments/1p555y/toad_on_a_mushroom/",
"name": "t3_1p555y",
"created": 1382671521,
"url": "http://imgur.com/gJb4mVs",
"author_flair_text": null,
"title": "Toad on a mushroom",
"created_utc": 1382642721,
"link_flair_text": null,
"distinguished": null,
"num_comments": 51,
"visited": false,
"num_reports": null,
"ups": 2221
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4qqn",
"secure_media_embed": {},
"stickied": false,
"author": "TheGreatMattsby",
"media": null,
"score": 2601,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/mv_UrX-bXRLCmdFh.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 2845,
"is_self": false,
"permalink": "/r/pics/comments/1p4qqn/the_flume_gorge_in_new_hampshire/",
"name": "t3_1p4qqn",
"created": 1382661175,
"url": "http://i.imgur.com/K5tswjn.png",
"author_flair_text": null,
"title": "The Flume Gorge in New Hampshire",
"created_utc": 1382632375,
"link_flair_text": null,
"distinguished": null,
"num_comments": 232,
"visited": false,
"num_reports": null,
"ups": 5446
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4zvo",
"secure_media_embed": {},
"stickied": false,
"author": "PGERMS",
"media": null,
"score": 1720,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/UhjsVFRvbBDOVJBh.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 844,
"is_self": false,
"permalink": "/r/pics/comments/1p4zvo/christopher_lloyd_turns_75_today_long_live_the_doc/",
"name": "t3_1p4zvo",
"created": 1382667735,
"url": "http://i.imgur.com/PMRc8li.jpg",
"author_flair_text": null,
"title": "Christopher Lloyd turns 75 today, long live THE DOC!",
"created_utc": 1382638935,
"link_flair_text": null,
"distinguished": null,
"num_comments": 48,
"visited": false,
"num_reports": null,
"ups": 2564
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4tih",
"secure_media_embed": {},
"stickied": false,
"author": "MeGustaTeGusta",
"media": null,
"score": 1896,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/n2QwG8oeTXR-q4IV.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 5843,
"is_self": false,
"permalink": "/r/pics/comments/1p4tih/my_wife_was_pulled_out_the_algebra_class_she/",
"name": "t3_1p4tih",
"created": 1382638045,
"url": "http://i.imgur.com/8eMz8bF.jpg",
"author_flair_text": null,
"title": "My wife was pulled out the algebra class she teaches and hanged for witchcraft as part of a school-wide Crucible lesson. She sent me this \"noose selfie.\"",
"created_utc": 1382634445,
"link_flair_text": null,
"distinguished": null,
"num_comments": 454,
"visited": false,
"num_reports": null,
"ups": 7739
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4xc4",
"secure_media_embed": {},
"stickied": false,
"author": "jeremykylelover69",
"media": null,
"score": 1519,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/lQ128Lb1yV7forWh.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 2567,
"is_self": false,
"permalink": "/r/pics/comments/1p4xc4/new_york_1969/",
"name": "t3_1p4xc4",
"created": 1382665971,
"url": "http://i.imgur.com/s6T0Fwi.jpg",
"author_flair_text": null,
"title": "New York, 1969",
"created_utc": 1382637171,
"link_flair_text": null,
"distinguished": null,
"num_comments": 168,
"visited": false,
"num_reports": null,
"ups": 4086
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4jfn",
"secure_media_embed": {},
"stickied": false,
"author": "873294106872",
"media": null,
"score": 2386,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://f.thumbs.redditmedia.com/T23esJhO7mNoVMtq.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 2642,
"is_self": false,
"permalink": "/r/pics/comments/1p4jfn/someone_decided_to_drive_into_fresh_concrete_this/",
"name": "t3_1p4jfn",
"created": 1382655564,
"url": "http://imgur.com/5xjL27N",
"author_flair_text": null,
"title": "Someone decided to drive into fresh concrete this morning",
"created_utc": 1382626764,
"link_flair_text": null,
"distinguished": null,
"num_comments": 518,
"visited": false,
"num_reports": null,
"ups": 5028
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p53c0",
"secure_media_embed": {},
"stickied": false,
"author": "braytron",
"media": null,
"score": 1067,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://a.thumbs.redditmedia.com/IRE89i1YNTJanKRl.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 356,
"is_self": false,
"permalink": "/r/pics/comments/1p53c0/no_officer_we_were_only_fishing/",
"name": "t3_1p53c0",
"created": 1382670170,
"url": "http://imgur.com/qHvJVZ1",
"author_flair_text": null,
"title": "No officer, we were only fishing",
"created_utc": 1382641370,
"link_flair_text": null,
"distinguished": null,
"num_comments": 101,
"visited": false,
"num_reports": null,
"ups": 1423
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4nl8",
"secure_media_embed": {},
"stickied": false,
"author": "Halftonefrank",
"media": null,
"score": 1895,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://f.thumbs.redditmedia.com/fwBXmQ4ODs7NRHSe.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 13638,
"is_self": false,
"permalink": "/r/pics/comments/1p4nl8/my_ron_swanson_for_halloween/",
"name": "t3_1p4nl8",
"created": 1382658824,
"url": "http://i.imgur.com/KVR3x2h.png",
"author_flair_text": null,
"title": "My Ron Swanson for Halloween.",
"created_utc": 1382630024,
"link_flair_text": null,
"distinguished": null,
"num_comments": 402,
"visited": false,
"num_reports": null,
"ups": 15533
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4eds",
"secure_media_embed": {},
"stickied": false,
"author": "ibarabi",
"media": null,
"score": 2737,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://e.thumbs.redditmedia.com/QU6QIYuH6OY4jDTX.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 8205,
"is_self": false,
"permalink": "/r/pics/comments/1p4eds/feeding_the_hungry/",
"name": "t3_1p4eds",
"created": 1382651191,
"url": "http://imgur.com/HjJjjvc",
"author_flair_text": null,
"title": "Feeding the Hungry",
"created_utc": 1382622391,
"link_flair_text": null,
"distinguished": null,
"num_comments": 252,
"visited": false,
"num_reports": null,
"ups": 10942
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4rlx",
"secure_media_embed": {},
"stickied": false,
"author": "aimocin",
"media": null,
"score": 1481,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://d.thumbs.redditmedia.com/y39QRj0cFrU-QLO3.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 1136,
"is_self": false,
"permalink": "/r/pics/comments/1p4rlx/her_hand_on_his_face_makes_it/",
"name": "t3_1p4rlx",
"created": 1382661813,
"url": "http://i.imgur.com/wkWHcqF.jpg",
"author_flair_text": null,
"title": "Her hand on his face makes it.",
"created_utc": 1382633013,
"link_flair_text": null,
"distinguished": null,
"num_comments": 100,
"visited": false,
"num_reports": null,
"ups": 2617
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {
"content": "&lt;iframe class=\"imgur-album\" width=\"550\" height=\"550\" frameborder=\"0\" src=\"http://imgur.com/a/j5hSo/embed\"&gt;&lt;/iframe&gt;",
"width": 550,
"scrolling": false,
"height": 550
},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4b0i",
"secure_media_embed": {},
"stickied": false,
"author": "gargameljr",
"media": {
"oembed": {
"provider_url": "http://imgur.com",
"description": "Imgur is home to the web's most popular image content, curated in real time by a dedicated community through commenting, voting and sharing.",
"title": "NYC Lifestyles - Imgur",
"thumbnail_width": 1008,
"height": 550,
"width": 550,
"html": "&lt;iframe class=\"imgur-album\" width=\"550\" height=\"550\" frameborder=\"0\" src=\"http://imgur.com/a/j5hSo/embed\"&gt;&lt;/iframe&gt;",
"version": "1.0",
"provider_name": "Imgur",
"thumbnail_url": "http://i.imgur.com/gkKbrjU.jpg",
"type": "rich",
"thumbnail_height": 1350
},
"type": "imgur.com"
},
"score": 2979,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://f.thumbs.redditmedia.com/fbK-ZctM2W1ne0ew.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 9135,
"is_self": false,
"permalink": "/r/pics/comments/1p4b0i/landlord_responded_right_away_when_i_sent_him_the/",
"name": "t3_1p4b0i",
"created": 1382647842,
"url": "http://imgur.com/a/j5hSo",
"author_flair_text": null,
"title": "Landlord responded right away when I sent him the second pic",
"created_utc": 1382619042,
"link_flair_text": null,
"distinguished": null,
"num_comments": 646,
"visited": false,
"num_reports": null,
"ups": 12114
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4em4",
"secure_media_embed": {},
"stickied": false,
"author": "superbstevens",
"media": null,
"score": 2403,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://b.thumbs.redditmedia.com/HO8ttRvWIcF5d8OI.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 22372,
"is_self": false,
"permalink": "/r/pics/comments/1p4em4/in_case_anyone_was_wondering_what_banksy_art_was/",
"name": "t3_1p4em4",
"created": 1382651422,
"url": "http://i.imgur.com/eDGzLYp.jpg",
"author_flair_text": null,
"title": "In case anyone was wondering what Banksy art was \"canceled by the NYPD\" yesterday, here's what I saw when I walked out of my work today in NYC.",
"created_utc": 1382622622,
"link_flair_text": null,
"distinguished": null,
"num_comments": 2483,
"visited": false,
"num_reports": null,
"ups": 24775
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {
"content": "&lt;iframe class=\"imgur-album\" width=\"550\" height=\"550\" frameborder=\"0\" src=\"http://imgur.com/a/o6Hc4/embed\"&gt;&lt;/iframe&gt;",
"width": 550,
"scrolling": false,
"height": 550
},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4fti",
"secure_media_embed": {},
"stickied": false,
"author": "BrkDancNotHarts",
"media": {
"oembed": {
"provider_url": "http://imgur.com",
"description": "Imgur is home to the web's most popular image content, curated in real time by a dedicated community through commenting, voting and sharing.",
"title": "Pin Ups - Imgur",
"thumbnail_width": 2722,
"height": 550,
"width": 550,
"html": "&lt;iframe class=\"imgur-album\" width=\"550\" height=\"550\" frameborder=\"0\" src=\"http://imgur.com/a/o6Hc4/embed\"&gt;&lt;/iframe&gt;",
"version": "1.0",
"provider_name": "Imgur",
"thumbnail_url": "http://i.imgur.com/vVtj54f.jpg",
"type": "rich",
"thumbnail_height": 4165
},
"type": "imgur.com"
},
"score": 2228,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://f.thumbs.redditmedia.com/MajF0xxLcDk9o89S.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 3000,
"is_self": false,
"permalink": "/r/pics/comments/1p4fti/series_i_photographed_with_paper_cut_outs_of_pin/",
"name": "t3_1p4fti",
"created": 1382652532,
"url": "http://imgur.com/a/o6Hc4",
"author_flair_text": null,
"title": "Series I photographed with paper cut outs of pin ups",
"created_utc": 1382623732,
"link_flair_text": null,
"distinguished": null,
"num_comments": 93,
"visited": false,
"num_reports": null,
"ups": 5228
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4hej",
"secure_media_embed": {},
"stickied": false,
"author": "Join_You_In_The_Sun",
"media": null,
"score": 1867,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://e.thumbs.redditmedia.com/ug5xf-CixD6Ie3tX.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 10374,
"is_self": false,
"permalink": "/r/pics/comments/1p4hej/wasnt_sure_which_villain_to_go_as_from_the_dark/",
"name": "t3_1p4hej",
"created": 1382653930,
"url": "http://i.imgur.com/O54eTJH.jpg",
"author_flair_text": null,
"title": "Wasn't sure which villain to go as from \"The Dark Knight Trilogy\"...so why not all six of them?",
"created_utc": 1382625130,
"link_flair_text": null,
"distinguished": null,
"num_comments": 301,
"visited": false,
"num_reports": null,
"ups": 12241
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4bc3",
"secure_media_embed": {},
"stickied": false,
"author": "royalbritish",
"media": null,
"score": 2474,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://e.thumbs.redditmedia.com/OJbb0Er2Gywx2tVF.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 7072,
"is_self": false,
"permalink": "/r/pics/comments/1p4bc3/black_lion_pub_in_brighton_truly_amazing/",
"name": "t3_1p4bc3",
"created": 1382648204,
"url": "http://i.imgur.com/48wFIdA.jpg",
"author_flair_text": null,
"title": "Black lion pub in Brighton. Truly amazing",
"created_utc": 1382619404,
"link_flair_text": null,
"distinguished": null,
"num_comments": 438,
"visited": false,
"num_reports": null,
"ups": 9546
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p48co",
"secure_media_embed": {},
"stickied": false,
"author": "CALL_OF_THE_TURD",
"media": null,
"score": 2692,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://a.thumbs.redditmedia.com/WxpJ9k17DSmx_FC0.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 8812,
"is_self": false,
"permalink": "/r/pics/comments/1p48co/old_school_cocacola_ad/",
"name": "t3_1p48co",
"created": 1382644608,
"url": "http://i.imgur.com/59Zf2xw.jpg",
"author_flair_text": null,
"title": "Old school Coca-Cola ad",
"created_utc": 1382615808,
"link_flair_text": null,
"distinguished": null,
"num_comments": 282,
"visited": false,
"num_reports": null,
"ups": 11504
}
},
{
"kind": "t3",
"data": {
"domain": "pbs.twimg.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4fm0",
"secure_media_embed": {},
"stickied": false,
"author": "TheGriff321",
"media": null,
"score": 1766,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://d.thumbs.redditmedia.com/AsWIphjGcfc5p-tu.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 1952,
"is_self": false,
"permalink": "/r/pics/comments/1p4fm0/a_beard_you_can_dunk_on/",
"name": "t3_1p4fm0",
"created": 1382652353,
"url": "https://pbs.twimg.com/media/BXTadb2CYAIlexU.jpg",
"author_flair_text": null,
"title": "A beard you can dunk on!",
"created_utc": 1382623553,
"link_flair_text": null,
"distinguished": null,
"num_comments": 50,
"visited": false,
"num_reports": null,
"ups": 3718
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4ajk",
"secure_media_embed": {},
"stickied": false,
"author": "lawndart653",
"media": null,
"score": 2199,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://a.thumbs.redditmedia.com/-SeHqRdAw3VcWzEr.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 8870,
"is_self": false,
"permalink": "/r/pics/comments/1p4ajk/10_years_ago_today_my_blackhawk_was_shot_down/",
"name": "t3_1p4ajk",
"created": 1382647325,
"url": "http://i.imgur.com/wy8O5mD.jpg",
"author_flair_text": null,
"title": "10 years ago today my Blackhawk was shot down near Tikrit in Iraq. My best friend is in the other hawk landing to pick us up. Thanks for the ride brother.",
"created_utc": 1382618525,
"link_flair_text": null,
"distinguished": null,
"num_comments": 483,
"visited": false,
"num_reports": null,
"ups": 11069
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p63vo",
"secure_media_embed": {},
"stickied": false,
"author": "ZeroCool79",
"media": null,
"score": 147,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://b.thumbs.redditmedia.com/RuIrI7N_qpgW9S7C.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 15,
"is_self": false,
"permalink": "/r/pics/comments/1p63vo/one_of_my_neighbors_put_this_sign_up_bravo/",
"name": "t3_1p63vo",
"created": 1382698248,
"url": "http://i.imgur.com/e0s2qNT.jpg",
"author_flair_text": null,
"title": "One of my neighbors put this sign up. Bravo!",
"created_utc": 1382669448,
"link_flair_text": null,
"ups": 162,
"num_comments": 14,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4m3c",
"secure_media_embed": {},
"stickied": false,
"author": "jjlew080",
"media": null,
"score": 1140,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/iFmuadqXU3O7Gm4J.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 408,
"is_self": false,
"permalink": "/r/pics/comments/1p4m3c/an_epic_shot_of_the_christ_the_redeemer_statue_in/",
"name": "t3_1p4m3c",
"created": 1382657697,
"url": "http://i.imgur.com/6x7J70d.jpg",
"author_flair_text": null,
"title": "An epic shot of the Christ the Redeemer Statue in Brazil",
"created_utc": 1382628897,
"link_flair_text": null,
"ups": 1548,
"num_comments": 26,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4aim",
"secure_media_embed": {},
"stickied": false,
"author": "ani625",
"media": null,
"score": 1898,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/fxXRt6BeifxWXhIJ.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 10448,
"is_self": false,
"permalink": "/r/pics/comments/1p4aim/cheshire_cat_lady/",
"name": "t3_1p4aim",
"created": 1382647294,
"url": "http://i.imgur.com/A2NOffx.jpg",
"author_flair_text": null,
"title": "Cheshire cat lady",
"created_utc": 1382618494,
"link_flair_text": null,
"ups": 12346,
"num_comments": 222,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4b0k",
"secure_media_embed": {},
"stickied": false,
"author": "youseeamousetrap",
"media": null,
"score": 1718,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://a.thumbs.redditmedia.com/xww9dXVfY3OZlHV0.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 1265,
"is_self": false,
"permalink": "/r/pics/comments/1p4b0k/prime_minister_of_ireland_photobombs_an/",
"name": "t3_1p4b0k",
"created": 1382647843,
"url": "http://i.imgur.com/RtOz6cD.png",
"author_flair_text": null,
"title": "Prime Minister of Ireland photobombs an suspecting couple of women.",
"created_utc": 1382619043,
"link_flair_text": null,
"ups": 2983,
"num_comments": 91,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4p12",
"secure_media_embed": {},
"stickied": false,
"author": "dmiller6590",
"media": null,
"score": 794,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://b.thumbs.redditmedia.com/AgFn6h4FFgmK_IM7.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 903,
"is_self": false,
"permalink": "/r/pics/comments/1p4p12/i_know_that_it_is_rather_common_now_a_days_to/",
"name": "t3_1p4p12",
"created": 1382659893,
"url": "http://imgur.com/8yLe96Z",
"author_flair_text": null,
"title": "I know that it is rather common now a days to have, but I am the first one in my entire family to get one of these.",
"created_utc": 1382631093,
"link_flair_text": null,
"ups": 1697,
"num_comments": 217,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4c2c",
"secure_media_embed": {},
"stickied": false,
"author": "lolligaggins",
"media": null,
"score": 1377,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/7zIk1S9v2oRDKHNP.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 14311,
"is_self": false,
"permalink": "/r/pics/comments/1p4c2c/well_which_is_it_whore/",
"name": "t3_1p4c2c",
"created": 1382648984,
"url": "http://i.imgur.com/gFHQtxn.jpg",
"author_flair_text": null,
"title": "Well which is it, whore?!",
"created_utc": 1382620184,
"link_flair_text": null,
"ups": 15688,
"num_comments": 405,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4awa",
"secure_media_embed": {},
"stickied": false,
"author": "ani625",
"media": null,
"score": 1431,
"approved_by": null,
"over_18": true,
"hidden": false,
"thumbnail": "nsfw",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 6284,
"is_self": false,
"permalink": "/r/pics/comments/1p4awa/yinyang/",
"name": "t3_1p4awa",
"created": 1382647711,
"url": "http://i.imgur.com/J33yqBE.jpg",
"author_flair_text": null,
"title": "Yin/Yang",
"created_utc": 1382618911,
"link_flair_text": null,
"ups": 7715,
"num_comments": 219,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p542v",
"secure_media_embed": {},
"stickied": false,
"author": "Goldmine44",
"media": null,
"score": 419,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/JVgmSGAAM4Q43CPb.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 85,
"is_self": false,
"permalink": "/r/pics/comments/1p542v/traversing_the_canadian_wilderness/",
"name": "t3_1p542v",
"created": 1382670715,
"url": "http://i.imgur.com/EyjKErh.jpg",
"author_flair_text": null,
"title": "Traversing the Canadian wilderness",
"created_utc": 1382641915,
"link_flair_text": null,
"ups": 504,
"num_comments": 13,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4blg",
"secure_media_embed": {},
"stickied": false,
"author": "1od1",
"media": null,
"score": 1297,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://e.thumbs.redditmedia.com/HEP51MKHQUBnFsXF.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 2657,
"is_self": false,
"permalink": "/r/pics/comments/1p4blg/edgar_allan_poe_and_abraham_lincoln_posing/",
"name": "t3_1p4blg",
"created": 1382648457,
"url": "http://imgur.com/uxm3fVU",
"author_flair_text": null,
"title": "Edgar Allan Poe and Abraham Lincoln posing.",
"created_utc": 1382619657,
"link_flair_text": null,
"ups": 3954,
"num_comments": 152,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p48zq",
"secure_media_embed": {},
"stickied": false,
"author": "jjlew080",
"media": null,
"score": 1470,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://b.thumbs.redditmedia.com/9B0NVMtSD8k3ru8m.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 700,
"is_self": false,
"permalink": "/r/pics/comments/1p48zq/freedom/",
"name": "t3_1p48zq",
"created": 1382645453,
"url": "http://i.imgur.com/2k0pZFm.jpg",
"author_flair_text": null,
"title": "Freedom!",
"created_utc": 1382616653,
"link_flair_text": null,
"ups": 2170,
"num_comments": 51,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p5y5y",
"secure_media_embed": {},
"stickied": false,
"author": "DrVonDickerson",
"media": null,
"score": 121,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/QV_R9hPM6PELfVHb.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 47,
"is_self": false,
"permalink": "/r/pics/comments/1p5y5y/vanity_fair_released_a_photo_of_the_royal_family/",
"name": "t3_1p5y5y",
"created": 1382693705,
"url": "http://i.imgur.com/I8QvjvD.png",
"author_flair_text": null,
"title": "Vanity Fair released a photo of the royal family... couldn't resist...",
"created_utc": 1382664905,
"link_flair_text": null,
"ups": 168,
"num_comments": 8,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p5v2l",
"secure_media_embed": {},
"stickied": false,
"author": "OkayAlrightLetsGo",
"media": null,
"score": 126,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://f.thumbs.redditmedia.com/Nyydw1vxeOtJHsD5.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 60,
"is_self": false,
"permalink": "/r/pics/comments/1p5v2l/murica/",
"name": "t3_1p5v2l",
"created": 1382691149,
"url": "http://www.imgur.com/jKY7WxX.jpeg",
"author_flair_text": null,
"title": "'Murica",
"created_utc": 1382662349,
"link_flair_text": null,
"ups": 186,
"num_comments": 16,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {
"content": "&lt;iframe class=\"imgur-album\" width=\"550\" height=\"550\" frameborder=\"0\" src=\"http://imgur.com/a/WXnI4/embed\"&gt;&lt;/iframe&gt;",
"width": 550,
"scrolling": false,
"height": 550
},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4mgp",
"secure_media_embed": {},
"stickied": false,
"author": "KingHorvath",
"media": {
"oembed": {
"provider_url": "http://imgur.com",
"description": "Imgur is home to the web's most popular image content, curated in real time by a dedicated community through commenting, voting and sharing.",
"title": "Infinite Mirror Table - Imgur",
"thumbnail_width": 1552,
"height": 550,
"width": 550,
"html": "&lt;iframe class=\"imgur-album\" width=\"550\" height=\"550\" frameborder=\"0\" src=\"http://imgur.com/a/WXnI4/embed\"&gt;&lt;/iframe&gt;",
"version": "1.0",
"provider_name": "Imgur",
"thumbnail_url": "http://i.imgur.com/YfIsAlw.jpg",
"type": "rich",
"thumbnail_height": 2592
},
"type": "imgur.com"
},
"score": 676,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://f.thumbs.redditmedia.com/cfP00wdAlnSAQNXG.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 192,
"is_self": false,
"permalink": "/r/pics/comments/1p4mgp/here_is_my_try_at_the_infinite_mirror_desk/",
"name": "t3_1p4mgp",
"created": 1382657961,
"url": "http://imgur.com/a/WXnI4",
"author_flair_text": null,
"title": "Here is my try at the infinite mirror desk !",
"created_utc": 1382629161,
"link_flair_text": null,
"ups": 868,
"num_comments": 26,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p46gi",
"secure_media_embed": {},
"stickied": false,
"author": "mingz",
"media": null,
"score": 1446,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://a.thumbs.redditmedia.com/ONPlvFK0J7qBdfUx.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 674,
"is_self": false,
"permalink": "/r/pics/comments/1p46gi/very_unfortunate_advertisement_placement/",
"name": "t3_1p46gi",
"created": 1382641903,
"url": "http://i.imgur.com/5aBAToa.jpg",
"author_flair_text": null,
"title": "Very unfortunate advertisement placement",
"created_utc": 1382613103,
"link_flair_text": null,
"ups": 2120,
"num_comments": 28,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4jqu",
"secure_media_embed": {},
"stickied": false,
"author": "rufusjonz",
"media": null,
"score": 651,
"approved_by": null,
"over_18": true,
"hidden": false,
"thumbnail": "nsfw",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 3926,
"is_self": false,
"permalink": "/r/pics/comments/1p4jqu/cool_green_sweater/",
"name": "t3_1p4jqu",
"created": 1382655813,
"url": "http://i.imgur.com/WGkUQZj.jpg",
"author_flair_text": null,
"title": "Cool Green Sweater",
"created_utc": 1382627013,
"link_flair_text": null,
"ups": 4577,
"num_comments": 215,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p44rh",
"secure_media_embed": {},
"stickied": false,
"author": "zimvi",
"media": null,
"score": 1537,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://c.thumbs.redditmedia.com/W8RnADJPZc3u1uiJ.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 4981,
"is_self": false,
"permalink": "/r/pics/comments/1p44rh/instant_mood_booster/",
"name": "t3_1p44rh",
"created": 1382636889,
"url": "http://i.imgur.com/kpMGLOq.jpg",
"author_flair_text": null,
"title": "Instant mood booster",
"created_utc": 1382608089,
"link_flair_text": null,
"ups": 6518,
"num_comments": 185,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4qps",
"secure_media_embed": {},
"stickied": false,
"author": "MightyTightyWhitey",
"media": null,
"score": 441,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://d.thumbs.redditmedia.com/XefKwRXkHZf-xfOQ.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 144,
"is_self": false,
"permalink": "/r/pics/comments/1p4qps/my_grandma_found_this_picture_of_her_dad_from_1918/",
"name": "t3_1p4qps",
"created": 1382661157,
"url": "http://imgur.com/1fGMpad",
"author_flair_text": null,
"title": "My grandma found this picture of her dad from 1918.",
"created_utc": 1382632357,
"link_flair_text": null,
"ups": 585,
"num_comments": 29,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p5k63",
"secure_media_embed": {},
"stickied": false,
"author": "Daylateo",
"media": null,
"score": 150,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://d.thumbs.redditmedia.com/iw2442PkR1HMK7Cu.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 40,
"is_self": false,
"permalink": "/r/pics/comments/1p5k63/over_three_years_later_and_i_still_cant_tell_him/",
"name": "t3_1p5k63",
"created": 1382682380,
"url": "http://i.imgur.com/1SWaK9l.jpg",
"author_flair_text": null,
"title": "Over three years later and I still can't tell him no.",
"created_utc": 1382653580,
"link_flair_text": null,
"ups": 190,
"num_comments": 4,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p4qkl",
"secure_media_embed": {},
"stickied": false,
"author": "Proteon",
"media": null,
"score": 429,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://a.thumbs.redditmedia.com/7N4Oim_-rLD7S8r6.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 96,
"is_self": false,
"permalink": "/r/pics/comments/1p4qkl/parliament_of_owls/",
"name": "t3_1p4qkl",
"created": 1382661047,
"url": "http://imgur.com/se3Yr56",
"author_flair_text": null,
"title": "Parliament of Owls",
"created_utc": 1382632247,
"link_flair_text": null,
"ups": 525,
"num_comments": 21,
"visited": false,
"num_reports": null,
"distinguished": null
}
},
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"banned_by": null,
"media_embed": {},
"subreddit": "pics",
"selftext_html": null,
"selftext": "",
"likes": null,
"secure_media": null,
"saved": false,
"id": "1p5335",
"secure_media_embed": {},
"stickied": false,
"author": "BattlefieldBastard",
"media": null,
"score": 264,
"approved_by": null,
"over_18": false,
"hidden": false,
"thumbnail": "http://d.thumbs.redditmedia.com/ectFcElAb4dmtBji.jpg",
"subreddit_id": "t5_2qh0u",
"edited": false,
"link_flair_css_class": null,
"author_flair_css_class": null,
"downs": 118,
"is_self": false,
"permalink": "/r/pics/comments/1p5335/ios_98/",
"name": "t3_1p5335",
"created": 1382670002,
"url": "http://i.imgur.com/hXhUnUa.jpg",
"author_flair_text": null,
"title": "iOS 98",
"created_utc": 1382641202,
"link_flair_text": null,
"ups": 382,
"num_comments": 25,
"visited": false,
"num_reports": null,
"distinguished": null
}
}
],
"after": "t3_1p5335",
"before": null
}
}
if(!d3.chart) d3.chart = {};
d3.chart.scatter = function() {
var g;
var data;
var width = 400;
var height = 400;
var cx = 10;
var numberBins = 5;
var dispatch = d3.dispatch(chart, "hover");
function chart(container) {
g = container;
g.append("g")
.classed("xaxis", true)
g.append("g")
.classed("yaxis", true)
update();
}
chart.update = update;
function update() {
var maxCreated = d3.max(data, function(d) { return d.data.created });
var minCreated = d3.min(data, function(d) { return d.data.created });
var maxScore = d3.max(data, function(d) { return d.data.score })
var colorScale = d3.scale.category20();
var createdScale = d3.time.scale()
.domain([minCreated, maxCreated])
.range([cx, width])
var commentScale = d3.scale.linear()
.domain(d3.extent(data, function(d) { return d.data.num_comments }))
.range([3, 15])
var yScale = d3.scale.linear()
.domain([0, maxScore])
.range([height, cx])
var xAxis = d3.svg.axis()
.scale(createdScale)
.ticks(3)
.tickFormat(d3.time.format("%b %d %H:%M"))
var yAxis = d3.svg.axis()
.scale(yScale)
.ticks(3)
.orient("left")
var xg = g.select(".xaxis")
.classed("axis", true)
.attr("transform", "translate(" + [0,height] + ")")
.transition()
.call(xAxis)
var yg = g.select(".yaxis")
.classed("axis", true)
.classed("yaxis", true)
.attr("transform", "translate(" + [cx - 5,0] + ")")
.transition()
.call(yAxis)
var circles = g.selectAll("circle")
.data(data, function(d) { return d.data.id })
circles.enter()
.append("circle")
circles
.style({
fill: function(d,i) { return colorScale(i) }
})
.transition()
.attr({
cx: function(d,i) { return createdScale(d.data.created) },
cy: function(d,i) { return yScale(d.data.score) },
r: function(d) { return commentScale(d.data.num_comments)}
})
circles.exit().remove()
circles.on("mouseover", function(d) {
d3.select(this).style("stroke", "black")
dispatch.hover([d])
})
circles.on("mouseout", function(d) {
d3.select(this).style("stroke", "")
dispatch.hover([])
})
}
chart.highlight = function(data) {
var circles = g.selectAll("circle")
.style("stroke", "")
circles.data(data, function(d) { return d.data.id })
.style("stroke", "orange")
.style("stroke-width", 3)
}
chart.data = function(value) {
if(!arguments.length) return data;
data = value;
return chart;
}
chart.width = function(value) {
if(!arguments.length) return width;
width = value;
return chart;
}
chart.height = function(value) {
if(!arguments.length) return height;
height = value;
return chart;
}
return d3.rebind(chart, dispatch, "on");
}
if(!d3.chart) d3.chart = {};
d3.chart.table = function() {
var div;
var data;
var width;
var dispatch = d3.dispatch(chart, "hover");
function chart(container) {
div = container;
var table = container.append("table")
update();
}
chart.update = update;
function update() {
var table = div.select("table")
var rows = table.selectAll("tr.row")
.data(data, function(d) { return d.data.id })
console.log("table data", data)
rows.exit().remove();
var rowsEnter = rows.enter()
.append("tr").classed("row", true)
rowsEnter.append("td")
.text(function(d) { return d.data.score })
rowsEnter.append("td")
.append("a")
.attr({
href: function(d) { return d.data.url }
})
.append("img")
.attr({
src: function(d) { return d.data.thumbnail }
})
rowsEnter.append("td")
.append("a")
.attr({
href: function(d) { return d.data.url }
}).text(function(d) { return d.data.title })
rowsEnter.append("td")
.text(function(d) { return d.data.ups })
rowsEnter.append("td")
.text(function(d) { return d.data.downs })
rowsEnter.on("mouseover", function(d) {
d3.select(this).style("background-color", "orange")
dispatch.hover([d])
})
rowsEnter.on("mouseout", function(d) {
d3.select(this).style("background-color", "")
dispatch.hover([])
})
}
chart.highlight = function(data) {
var trs = div.selectAll("tr")
.style("background-color", "")
trs.data(data, function(d) { return d.data.id })
.style("background-color", "orange")
}
chart.data = function(value) {
if(!arguments.length) return data;
data = value;
return chart;
}
chart.width = function(value) {
if(!arguments.length) return width;
width = value;
return chart;
}
return d3.rebind(chart, dispatch, "on");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment