Skip to content

Instantly share code, notes, and snippets.

@tjwudi
Created May 14, 2015 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjwudi/969c772e0bb0fcb3fc02 to your computer and use it in GitHub Desktop.
Save tjwudi/969c772e0bb0fcb3fc02 to your computer and use it in GitHub Desktop.
d3 table
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>D3 Playground</title>
</head>
<body>
<div id="display"></div>
<script src="//cdn.jsdelivr.net/jquery/2.1.4/jquery.min.js"></script>
<script src="//cdn.jsdelivr.net/d3js/3.5.5/d3.min.js"></script>
<script src="table.js"></script>
<script>
d3.json('pics.json', function(err, pics) {
var table = d3.chart.table();
var container = d3.select('#display').
append('div').
classed('table-container', true);
table.data(pics.data.children);
table(container);
});
</script>
</body>
</html>
{"kind": "Listing", "data": {"modhash": "", "children": [{"kind": "t3", "data": {"domain": "i.imgur.com", "banned_by": null, "media_embed": {}, "subreddit": "pics", "selftext_html": null, "selftext": "", "likes": null, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35vdng", "gilded": 1, "archived": false, "clicked": false, "report_reasons": null, "author": "Bobosbananas", "media": null, "score": 5210, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://a.thumbs.redditmedia.com/YpB_c4dU00djePrPRcspeX93fgGLU4S3grxMwUZuEk4.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35vdng", "permalink": "/r/pics/comments/35vdng/i_delivered_a_potato_today/", "stickied": false, "created": 1431578986.0, "url": "http://i.imgur.com/MVmoKh9.jpg", "author_flair_text": null, "title": "I delivered a potato today.", "created_utc": 1431550186.0, "ups": 5210, "num_comments": 1125, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35vbw5", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "TDare2bcool", "media": null, "score": 3710, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/iwxxm75HWHUtJe8Fdn80ihtDvwLo59xP2kUcV3ukYHY.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35vbw5", "permalink": "/r/pics/comments/35vbw5/so_one_of_the_students_came_in_with_her_kid/", "stickied": false, "created": 1431552985.0, "url": "http://i.imgur.com/CgX2eAN.jpg?1", "author_flair_text": null, "title": "So one of the students came in with her kid because she couldn't afford a babysitter. The kid started crying in class and the mother, being embarrassed, gets up to leave but the professor took the kid from her, calmed him down, and continued teaching.", "created_utc": 1431549385.0, "ups": 3710, "num_comments": 1992, "visited": false, "num_reports": null, "distinguished": null}}, {"kind": "t3", "data": {"domain": "m.imgur.com", "banned_by": null, "media_embed": {"content": "&lt;iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fimgur.com%2Fa%2FF78F6%2Fembed&amp;url=http%3A%2F%2Fimgur.com%2Fa%2FF78F6&amp;image=http%3A%2F%2Fi.imgur.com%2F0es0MjN.jpg&amp;key=2aa3c4d5f3de4f5b9120b660ad850dc9&amp;type=text%2Fhtml&amp;schema=imgur\" width=\"550\" height=\"550\" scrolling=\"no\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;", "width": 550, "scrolling": false, "height": 550}, "subreddit": "pics", "selftext_html": null, "selftext": "", "likes": null, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35ufuc", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "iamkokonutz", "media": {"oembed": {"provider_url": "http://imgur.com", "description": "My buddy was camping near the highway in Haines, Alaska when a curious fox took an interest in him.", "title": "Alaska Highway Fox", "type": "rich", "thumbnail_width": 1067, "height": 550, "width": 550, "html": "&lt;iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fimgur.com%2Fa%2FF78F6%2Fembed&amp;url=http%3A%2F%2Fimgur.com%2Fa%2FF78F6&amp;image=http%3A%2F%2Fi.imgur.com%2F0es0MjN.jpg&amp;key=2aa3c4d5f3de4f5b9120b660ad850dc9&amp;type=text%2Fhtml&amp;schema=imgur\" width=\"550\" height=\"550\" scrolling=\"no\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;", "version": "1.0", "provider_name": "Imgur", "thumbnail_url": "http://i.imgur.com/0es0MjN.jpg", "thumbnail_height": 1600}, "type": "m.imgur.com"}, "score": 4920, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/WlFTMiIDrpk6llUiWC6-2cI_V9ikn5IAXngQmnqZ_ec.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35ufuc", "permalink": "/r/pics/comments/35ufuc/my_buddy_was_camping_near_the_highway_in_haines/", "stickied": false, "created": 1431538436.0, "url": "http://m.imgur.com/a/F78F6", "author_flair_text": null, "title": "My buddy was camping near the highway in Haines, Alaska when a curious fox took an interest in him...", "created_utc": 1431534836.0, "ups": 4920, "num_comments": 290, "visited": false, "num_reports": null, "distinguished": null}}, {"kind": "t3", "data": {"domain": "lughertexture.com", "banned_by": null, "media_embed": {}, "subreddit": "pics", "selftext_html": null, "selftext": "", "likes": null, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35uirx", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "SergeantPenguin", "media": null, "score": 3317, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://a.thumbs.redditmedia.com/4D_aCKDSkN67pLcNpJE8PMfYZPAhAFOeG6CzRDeDEY0.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35uirx", "permalink": "/r/pics/comments/35uirx/a_guy_literally_lied_about_his_suicidal_daughter/", "stickied": false, "created": 1431539760.0, "url": "http://www.lughertexture.com/images/textures/details/vegetation_26/trees_63/hackberry_tree_20131230_1040936985.png", "author_flair_text": null, "title": "A guy literally lied about his suicidal daughter donating organs for karma on /r/pics. Anyone want to remind me why sob stories are allowed here? Meanwhile here's a picture of a tree.", "created_utc": 1431536160.0, "ups": 3317, "num_comments": 566, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35u8x0", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "JuergenKohler", "media": null, "score": 3342, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/4ouHoCbGDimA2dbpfmrFr2jPoxZLBezz4wSblxzfKog.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35u8x0", "permalink": "/r/pics/comments/35u8x0/restoring_an_old_fiat_in_italy/", "stickied": false, "created": 1431560375.0, "url": "http://imgur.com/FOhjdXC", "author_flair_text": null, "title": "Restoring an old Fiat in Italy", "created_utc": 1431531575.0, "ups": 3342, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35u33j", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "Pimping_NZ", "media": null, "score": 3841, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/krEWiaELvkkp2rWi7H_K2O1phcUj2sdX0ySBk3jq3kQ.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35u33j", "permalink": "/r/pics/comments/35u33j/wilt_chamberlain_and_andre_the_giant_taking/", "stickied": false, "created": 1431532414.0, "url": "http://i.imgur.com/IfSNFsH.jpg", "author_flair_text": null, "title": "Wilt Chamberlain and Andre the Giant taking Arnold Schwarzenegger for a stroll. Btw Arnold is 6'2", "created_utc": 1431528814.0, "ups": 3841, "num_comments": 1520, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35upim", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "mbritt74", "media": null, "score": 2118, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/sPo3hHoFxqdGNXjd_jdM9vCoPgEc8IuLrFr-O53e_yY.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35upim", "permalink": "/r/pics/comments/35upim/i_want_to_live_here/", "stickied": false, "created": 1431568030.0, "url": "https://i.imgur.com/vxf9QCx.jpg", "author_flair_text": null, "title": "I want to live here.", "created_utc": 1431539230.0, "ups": 2118, "num_comments": 132, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35uuuj", "gilded": 1, "archived": false, "clicked": false, "report_reasons": null, "author": "KaylaCMarie", "media": null, "score": 1876, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/nyzzh-mBWI5ZvoLHFlZjUQb0AyS9tT0dmwE2CFF47_k.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35uuuj", "permalink": "/r/pics/comments/35uuuj/so_i_got_bashed_before_for_posting_a_picture_with/", "stickied": false, "created": 1431545170.0, "url": "http://imgur.com/FP8psBV", "author_flair_text": null, "title": "So, I got bashed before for posting a picture with a photo of my cat cropped next to it. I'm \"fake\" and my cat is \"fake.\" So, here is a non filtered photo of my cat and I's eyes. Now you know why I didn't try to take a picture WITH her. She hates the camera. Enjoy.", "created_utc": 1431541570.0, "ups": 1876, "num_comments": 1781, "visited": false, "num_reports": null, "distinguished": null}}, {"kind": "t3", "data": {"domain": "assets.elleuk.com", "banned_by": null, "media_embed": {}, "subreddit": "pics", "selftext_html": null, "selftext": "", "likes": null, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35tzmb", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "mook_uk1", "media": null, "score": 3799, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/uTQM4_Mk83Gewm5weduZT1YzEweGko-Hj7tyFfjucxo.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35tzmb", "permalink": "/r/pics/comments/35tzmb/prince_harry/", "stickied": false, "created": 1431555891.0, "url": "http://assets.elleuk.com/gallery/9891/prince-harry-out-in-new-zealand-may-2015-rex-gallery.jpg", "author_flair_text": null, "title": "Prince Harry", "created_utc": 1431527091.0, "ups": 3799, "num_comments": 246, "visited": false, "num_reports": null, "distinguished": null}}, {"kind": "t3", "data": {"domain": "imgur.com", "banned_by": null, "media_embed": {"content": "&lt;iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fimgur.com%2Fa%2Fl2J86%2Fembed&amp;url=http%3A%2F%2Fimgur.com%2Fa%2Fl2J86&amp;image=http%3A%2F%2Fi.imgur.com%2FdvrAZHG.jpg&amp;key=2aa3c4d5f3de4f5b9120b660ad850dc9&amp;type=text%2Fhtml&amp;schema=imgur\" width=\"550\" height=\"550\" scrolling=\"no\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;", "width": 550, "scrolling": false, "height": 550}, "subreddit": "pics", "selftext_html": null, "selftext": "", "likes": null, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35trwu", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "Zombieeham1", "media": {"type": "imgur.com", "oembed": {"provider_url": "http://imgur.com", "description": "This album is really big! It's going to take us a bit to get your download ready for you. Enter your email and we will notify you when it's ready.", "title": "- Album on Imgur", "thumbnail_width": 880, "height": 550, "width": 550, "html": "&lt;iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fimgur.com%2Fa%2Fl2J86%2Fembed&amp;url=http%3A%2F%2Fimgur.com%2Fa%2Fl2J86&amp;image=http%3A%2F%2Fi.imgur.com%2FdvrAZHG.jpg&amp;key=2aa3c4d5f3de4f5b9120b660ad850dc9&amp;type=text%2Fhtml&amp;schema=imgur\" width=\"550\" height=\"550\" scrolling=\"no\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;", "version": "1.0", "provider_name": "Imgur", "thumbnail_url": "http://i.imgur.com/dvrAZHG.jpg", "type": "rich", "thumbnail_height": 704}}, "score": 4212, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://a.thumbs.redditmedia.com/KVNFasIzAUM4GvOSntpjNEKQ4OVXQVk2L2ccaaFg9u4.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35trwu", "permalink": "/r/pics/comments/35trwu/fractal_fabrege/", "stickied": false, "created": 1431526579.0, "url": "http://imgur.com/a/l2J86", "author_flair_text": null, "title": "Fractal Fabrege", "created_utc": 1431522979.0, "ups": 4212, "num_comments": 200, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35twrz", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "chickachickaboom", "media": null, "score": 3440, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://a.thumbs.redditmedia.com/2n1KueAKC5EIrDZw3iKQfiZxp29xz1zMDz7WJhrGIu0.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35twrz", "permalink": "/r/pics/comments/35twrz/i_appreciate_your_sense_of_humor_cedar_point/", "stickied": false, "created": 1431554422.0, "url": "http://imgur.com/3Uu73hn", "author_flair_text": null, "title": "I appreciate your sense of humor, Cedar Point.", "created_utc": 1431525622.0, "ups": 3440, "num_comments": 275, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35tsqs", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "mrbigglessworth", "media": null, "score": 3812, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/g2JyvNUckiYJ6DimCOo385VUHD2Y_DB6O_zbZpFHTqo.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35tsqs", "permalink": "/r/pics/comments/35tsqs/80s_big_hair_had_nothing_on_my_moms_hair_from_1970/", "stickied": false, "created": 1431552243.0, "url": "http://imgur.com/0DuUOUd", "author_flair_text": null, "title": "80s big hair had nothing on my moms hair from 1970!", "created_utc": 1431523443.0, "ups": 3812, "num_comments": 166, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35tuu9", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "droopydog22", "media": null, "score": 3297, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/CHXfE_645f0g83LL6Yevc6XL7serN24MC8aDM4cm5fY.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35tuu9", "permalink": "/r/pics/comments/35tuu9/somebody_became_a_man_today/", "stickied": false, "created": 1431553381.0, "url": "http://imgur.com/4IV0dmN", "author_flair_text": null, "title": "Somebody became a man today", "created_utc": 1431524581.0, "ups": 3297, "num_comments": 786, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35uafc", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "Trker", "media": null, "score": 2136, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/MxdmRhhkAawzrCir5KmFDsE7bVN389d2h9YGKfaGJTQ.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35uafc", "permalink": "/r/pics/comments/35uafc/first_sketch_of_my_princess_let_me_know_if_this/", "stickied": false, "created": 1431561108.0, "url": "http://imgur.com/fdMViIO", "author_flair_text": null, "title": "First sketch of my Princess, let me know if this is good or not :)", "created_utc": 1431532308.0, "ups": 2136, "num_comments": 261, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35to8l", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "Thelittlepuppet_", "media": null, "score": 3734, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/mYkYfYWctoqIZARMPSCY6IxqA8-EYY95LZxBuPu9N9Y.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35to8l", "permalink": "/r/pics/comments/35to8l/those_lines/", "stickied": false, "created": 1431549578.0, "url": "http://i.imgur.com/afQofF9.jpg", "author_flair_text": null, "title": "those lines", "created_utc": 1431520778.0, "ups": 3734, "num_comments": 160, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35vi8d", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "ne1butu", "media": null, "score": 730, "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": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35vi8d", "permalink": "/r/pics/comments/35vi8d/prostitute_leaning_on_a_police_car_in_new_york/", "stickied": false, "created": 1431580981.0, "url": "http://i.imgur.com/5Y47wTQ.jpg", "author_flair_text": null, "title": "Prostitute leaning on a police car in New York - 1980", "created_utc": 1431552181.0, "ups": 730, "num_comments": 40, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35ttj7", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "skash416", "media": null, "score": 2985, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/z3Kk6ZtM7gQdfhAKn_1Evns5WSPvBaNv9pccPbMQ58o.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35ttj7", "permalink": "/r/pics/comments/35ttj7/i_made_a_friend_in_dingle_ireland_today/", "stickied": false, "created": 1431552674.0, "url": "http://imgur.com/IxECT5B", "author_flair_text": null, "title": "I made a friend in Dingle, Ireland today", "created_utc": 1431523874.0, "ups": 2985, "num_comments": 102, "visited": false, "num_reports": null, "distinguished": null}}, {"kind": "t3", "data": {"domain": "imgur.com", "banned_by": null, "media_embed": {"content": "&lt;iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fimgur.com%2Fa%2FkRLzv%2Fembed&amp;url=http%3A%2F%2Fimgur.com%2Fa%2FkRLzv&amp;image=http%3A%2F%2Fi.imgur.com%2F9QOcnWF.jpg&amp;key=2aa3c4d5f3de4f5b9120b660ad850dc9&amp;type=text%2Fhtml&amp;schema=imgur\" width=\"550\" height=\"550\" scrolling=\"no\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;", "width": 550, "scrolling": false, "height": 550}, "subreddit": "pics", "selftext_html": null, "selftext": "", "likes": null, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35uhqa", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "Face_Blindness", "media": {"oembed": {"provider_url": "http://imgur.com", "description": "They&amp;#039;ve been traveling through India for the last 9 months now, and found themselves in Kathmandu, Nepal during the massive 7.8 earthquake at the end of April. They were fortunately not hurt in the process and took the opportunity to step up and provide aid where needed.", "title": "Aiding the People of Nepal", "type": "rich", "thumbnail_width": 720, "height": 550, "width": 550, "html": "&lt;iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fimgur.com%2Fa%2FkRLzv%2Fembed&amp;url=http%3A%2F%2Fimgur.com%2Fa%2FkRLzv&amp;image=http%3A%2F%2Fi.imgur.com%2F9QOcnWF.jpg&amp;key=2aa3c4d5f3de4f5b9120b660ad850dc9&amp;type=text%2Fhtml&amp;schema=imgur\" width=\"550\" height=\"550\" scrolling=\"no\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;", "version": "1.0", "provider_name": "Imgur", "thumbnail_url": "http://i.imgur.com/9QOcnWF.jpg", "thumbnail_height": 960}, "type": "imgur.com"}, "score": 1345, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/sNaTtg_mqBht7_SHiWAACA6BGieZb9od9_07ZK0Jzrg.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35uhqa", "permalink": "/r/pics/comments/35uhqa/my_friends_were_caught_in_both_earthquakes_in/", "stickied": false, "created": 1431564479.0, "url": "http://imgur.com/a/kRLzv", "author_flair_text": null, "title": "My friends were caught in both earthquakes in Nepal. They are not hurt. Instead of leaving, they stayed. Here's a glimpse into the devastation and their mission to help.", "created_utc": 1431535679.0, "ups": 1345, "num_comments": 44, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35v70d", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "bananaphoneMan", "media": null, "score": 474, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/fFt030g1mHHZQfef37HmQJiEanjP_Pz6bICsC3LDw-c.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35v70d", "permalink": "/r/pics/comments/35v70d/thought_we_could_handle_a_shortcut_to_the_grand/", "stickied": false, "created": 1431575988.0, "url": "http://i.imgur.com/I9O1fJW.jpg", "author_flair_text": null, "title": "Thought we could handle a shortcut to the Grand Canyon", "created_utc": 1431547188.0, "ups": 474, "num_comments": 71, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35w6jb", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "Saroekin", "media": null, "score": 195, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/PxqYhY76lpQ0JVNu4ckkysRw6OvdId2GP2OcZEQdZ4Y.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35w6jb", "permalink": "/r/pics/comments/35w6jb/a_long_time_ago_in_a_cul_de_sac_far_far_away/", "stickied": false, "created": 1431592977.0, "url": "https://imgur.com/gallery/WdtoP", "author_flair_text": null, "title": "A Long Time Ago, In A Cul De Sac Far Far Away...", "created_utc": 1431564177.0, "ups": 195, "num_comments": 19, "visited": false, "num_reports": null, "distinguished": null}}, {"kind": "t3", "data": {"domain": "imgur.com", "banned_by": null, "media_embed": {"content": "&lt;iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fimgur.com%2Fa%2FJb4Uv%2Fembed&amp;url=http%3A%2F%2Fimgur.com%2Fa%2FJb4Uv&amp;image=http%3A%2F%2Fi.imgur.com%2F7hfAaw8.jpg&amp;key=2aa3c4d5f3de4f5b9120b660ad850dc9&amp;type=text%2Fhtml&amp;schema=imgur\" width=\"550\" height=\"550\" scrolling=\"no\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;", "width": 550, "scrolling": false, "height": 550}, "subreddit": "pics", "selftext_html": null, "selftext": "", "likes": null, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35ux4j", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "Cainplay", "media": {"oembed": {"provider_url": "http://imgur.com", "title": "I refinished a Bass Guitar", "type": "rich", "html": "&lt;iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fimgur.com%2Fa%2FJb4Uv%2Fembed&amp;url=http%3A%2F%2Fimgur.com%2Fa%2FJb4Uv&amp;image=http%3A%2F%2Fi.imgur.com%2F7hfAaw8.jpg&amp;key=2aa3c4d5f3de4f5b9120b660ad850dc9&amp;type=text%2Fhtml&amp;schema=imgur\" width=\"550\" height=\"550\" scrolling=\"no\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;", "thumbnail_width": 2448, "height": 550, "width": 550, "version": "1.0", "provider_name": "Imgur", "thumbnail_url": "http://i.imgur.com/7hfAaw8.jpg", "thumbnail_height": 3264}, "type": "imgur.com"}, "score": 579, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/52rdUBO9gKe8DZADAeRkoVKPQTK64UyTa_hunHjrz-o.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35ux4j", "permalink": "/r/pics/comments/35ux4j/i_refinished_my_brothers_first_bass_guitar_for/", "stickied": false, "created": 1431571436.0, "url": "http://imgur.com/a/Jb4Uv", "author_flair_text": null, "title": "I refinished my brother's first Bass Guitar for his birthday!", "created_utc": 1431542636.0, "ups": 579, "num_comments": 43, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35svt2", "gilded": 1, "archived": false, "clicked": false, "report_reasons": null, "author": "DFine5", "media": null, "score": 4729, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://a.thumbs.redditmedia.com/bntsEpeiTmEHyTsBYxDR0dtELQuPoQ0b-cf4Sa0pAC4.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35svt2", "permalink": "/r/pics/comments/35svt2/lose_right_arm_and_break_my_left_hand_friend/", "stickied": false, "created": 1431525227.0, "url": "http://i.imgur.com/bN3q4fg.jpg", "author_flair_text": null, "title": "Lose right arm and break my left hand friend gives me this shirt", "created_utc": 1431496427.0, "ups": 4729, "num_comments": 2861, "visited": false, "num_reports": null, "distinguished": null}}, {"kind": "t3", "data": {"domain": "imgur.com", "banned_by": null, "media_embed": {"content": "&lt;iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fimgur.com%2Fa%2FDW7p9%2Fembed&amp;url=http%3A%2F%2Fimgur.com%2Fa%2FDW7p9&amp;image=http%3A%2F%2Fi.imgur.com%2FoMucd5K.jpg&amp;key=2aa3c4d5f3de4f5b9120b660ad850dc9&amp;type=text%2Fhtml&amp;schema=imgur\" width=\"550\" height=\"550\" scrolling=\"no\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;", "width": 550, "scrolling": false, "height": 550}, "subreddit": "pics", "selftext_html": null, "selftext": "", "likes": null, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35vjnj", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "verstands", "media": {"type": "imgur.com", "oembed": {"provider_url": "http://imgur.com", "description": "Just a reminder:the natural diet of these birds is BONES. Not just bone marrow; actual bone shards. They pick up huge freaking bones from carcasses and drop them onto rocks until they get spiky pieces and then they swallow them. Their stomach acid dissolves bone.", "title": "- Album on Imgur", "thumbnail_width": 500, "height": 550, "width": 550, "html": "&lt;iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fimgur.com%2Fa%2FDW7p9%2Fembed&amp;url=http%3A%2F%2Fimgur.com%2Fa%2FDW7p9&amp;image=http%3A%2F%2Fi.imgur.com%2FoMucd5K.jpg&amp;key=2aa3c4d5f3de4f5b9120b660ad850dc9&amp;type=text%2Fhtml&amp;schema=imgur\" width=\"550\" height=\"550\" scrolling=\"no\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;", "version": "1.0", "provider_name": "Imgur", "thumbnail_url": "http://i.imgur.com/oMucd5K.jpg", "type": "rich", "thumbnail_height": 473}}, "score": 255, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/iCV41eyXjmyVYo-UMRD4ISrX3xXapFdGnxOq4pOr8GQ.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35vjnj", "permalink": "/r/pics/comments/35vjnj/so_metal/", "stickied": false, "created": 1431581634.0, "url": "http://imgur.com/a/DW7p9", "author_flair_text": null, "title": "So metal", "created_utc": 1431552834.0, "ups": 255, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35twv4", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "ne1butu", "media": null, "score": 977, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://a.thumbs.redditmedia.com/xJUv_z1bOvstYxsy6yZZLd5h0mYrP8boYZJhKcL6xn0.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35twv4", "permalink": "/r/pics/comments/35twv4/parking_space_that_lowers_to_become_hidden/", "stickied": false, "created": 1431554468.0, "url": "http://i.imgur.com/qOkVmP0.jpg", "author_flair_text": null, "title": "Parking space that lowers to become hidden underground", "created_utc": 1431525668.0, "ups": 977, "num_comments": 60, "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, "suggested_sort": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "35ts9y", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "iam4real", "media": null, "score": 1024, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "http://b.thumbs.redditmedia.com/Ox-Wh3OpUZt-_U-IoRy1VJqzhBUIt34CmyaRERCGOhg.jpg", "subreddit_id": "t5_2qh0u", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "removal_reason": null, "is_self": false, "name": "t3_35ts9y", "permalink": "/r/pics/comments/35ts9y/live_by_the_sword_fry_by_the_sword/", "stickied": false, "created": 1431551992.0, "url": "http://i.imgur.com/JueqC0P.jpg", "author_flair_text": null, "title": "Live by the sword, fry by the sword", "created_utc": 1431523192.0, "ups": 1024, "num_comments": 39, "visited": false, "num_reports": null, "distinguished": null}}], "after": "t3_35ts9y", "before": null}}
if (!d3.chart) d3.chart = {};
d3.chart.table = function() {
var data;
function chart(container) {
var table = container.append("table");
var rows = table.selectAll("tr.row")
.data(data);
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 });
rows.exit().remove();
}
chart.data = function(newData) {
data = newData;
return chart;
};
return chart;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment