Instantly share code, notes, and snippets.

What would you like to do?
d3 consume api and build document
<!doctype html>
<title>Reddit JSON</title>
body{ background-color: #C6C6C6; }
#content div {
border: 1px solid #000000;
margin: 5px;
padding: 5px;
span { margin: 5px; }
<script src=""></script>
<script type="text/javascript">
window.onload = function(){
d3.json('', function(err, data ){
var content ="#content")
var topics = content.selectAll("div")
var self =;
var link = self.append("a")
var author = self.append("span")
.text("by " +;
var text = self.append("p")
<div id="content">

This comment has been minimized.

Copy link

omaraboumrad commented Feb 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment