Skip to content

Instantly share code, notes, and snippets.

View bacanu's full-sized avatar

Cosmin Bacanu bacanu

View GitHub Profile
@bacanu
bacanu / d3.js_redditfp.html
Last active October 10, 2015 22:48
a content layout using d3.js, lightweight-jsonp and jquery-full-house
<!-- things you will need -->
<script src = 'http://code.jquery.com/jquery-1.8.2.min.js' ></script>
<script src = 'http://d3js.org/d3.v2.min.js' ></script>
<script src = 'https://raw.github.com/IntoMethod/Lightweight-JSONP/master/jsonp.js' ></script>
<script src = 'https://raw.github.com/kuchumovn/jquery-full-house/master/jquery-full-house.js' ></script>
<script>
var treemap = d3.layout.treemap()
.sort( function(a, b ){ return a.data && b.data ? (a.data.ups - a.data.downs ) - ( b.data.ups - b.data.downs ) : 1; } ) // i'm not a very smart man
.value(function(d) {