[ Launch: this is bullshit doj ] 8087106 by gelicia
-
-
Save gelicia/8087106 to your computer and use it in GitHub Desktop.
this is bullshit doj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"description":"this is bullshit doj","endpoint":"","display":"div","public":true,"require":[{"name":"collapsiblelists","url":"http://code.stephenmorley.org/javascript/collapsible-lists/CollapsibleLists.compressed.js"},{"name":"underscore","url":"http://underscorejs.org/underscore-min.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"collapsiblelist.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/6gldJus.png"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var calcCategories = ["Annual Parole Survey", "Annual Probation Survey", "Annual Survey of Jails"]; | |
d3.json("http://gelicia.com/hostedData/dojData.json", function(e,d){ | |
var finalData = []; | |
d = _.filter(d, function(d){return d.title !== null}); | |
for (var i = 0; i < calcCategories.length; i++) { | |
var thisCategory = _.filter(d, function(d){return d.title.indexOf(calcCategories[i]) > -1}); | |
console.log(thisCategory) | |
} | |
console.log(finalData) | |
d=_.groupBy(d, function(d){return d.title === null? "" : d.title.substring(0,10)}) | |
//console.log(d.length) | |
//console.log(d) | |
var display = d3.select("#display"); | |
var ul = display.append("ul").attr("id", "newList").classed("collapsibleList", true) | |
var parentItem = ul.append("li").text("hello") | |
var childList = parentItem.append("ul") | |
childList.append("li").text("hello2") | |
CollapsibleLists.applyTo(document.getElementById('newList')); | |
}) | |
/* | |
<ul class="collapsibleList"> | |
<li> | |
Parent item | |
<ul> | |
<li>Child item</li> | |
<li>Child item</li> | |
</ul> | |
</li> | |
<li> | |
Parent item | |
<ul> | |
<li>Child item</li> | |
<li>Child item</li> | |
</ul> | |
</li> | |
</ul>*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#display { | |
margin-top: 10px; | |
margin-left: 100px; | |
} | |
.collapsibleList li{ | |
cursor:auto; | |
font-weight:bold | |
} | |
.collapsibleList > li{ | |
/*font-weight:bold; */ | |
} | |
li.collapsibleListOpen{ | |
cursor:pointer; | |
} | |
li.collapsibleListClosed{ | |
cursor:pointer; | |
} | |
.collapsibleList > li > ul{ | |
font-size:12pt; | |
margin-left: 10px; | |
} | |
.collapsibleList > li > ul > li { | |
font-weight:normal; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment