[ Launch: Inlets With Titles/DateTime ] 4617510 by georules
[ Launch: Tributary Inlets With Titles ] 4617437 by georules
[ Launch: Tributary Inlets With Titles ] 4569668 by enjalot
[ Launch: Tributary Inlets ] 4562326 by poezn
[ Launch: Tributary Inlets ] 4561783 by enjalot
[ Launch: Tributary Inlets ] 4561743 by enjalot
[ Launch: Tributary Inlets ] 4549657 by enjalot
[ Launch: An inlet to Tributary ] 4545400 by enjalot
-
-
Save georules/4617510 to your computer and use it in GitHub Desktop.
Tributary API
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":"Tributary API","endpoint":"","display":"html","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"tab":"edit","display_percent":0.6150630391506304,"hidepanel":false} |
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
// https://github.com/enjalot/tributary/blob/4902fbb6cd12acdb16b084e8700ad6fee94fee90/server.js | |
// line 513+ | |
//still working on this | |
var display = d3.select("#display") | |
var users_url = '/api/users'; | |
var created_url = '/api/latest/created' | |
var fork_url = '/api/latest/forks' | |
var visits_url = '/api/latest/visits' | |
var most_viewed_url = '/api/most/viewed' | |
var most_forked_url = '/api/most/forked' | |
var counts_url = '/api/counts/visits' | |
function getdata() { | |
if (!tributary.apidata) { | |
d3.json(users_url, function(err, res) { | |
tributary.apidata = res; | |
}); | |
} | |
} | |
display.append("input") | |
.attr({ | |
id: "fetch", | |
type: "button", | |
value: "fetch" | |
}) | |
.on("click", function() { | |
getdata(); | |
render(); | |
}) | |
display.append("div").attr("id","data").classed("inlet",true) | |
data = display.select("#data") | |
data.style("width","60%").style("height","70%").style("overflow","scroll"); | |
function render() { | |
display.select("#data") | |
.text(function(){ | |
f = Object.keys(tributary.apidata[0]) | |
c = tributary.apidata.length | |
return users_url + ": "+ JSON.stringify(c) + " objects of : "+ JSON.stringify(f); | |
}) | |
} | |
getdata(); | |
render(); |
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
#fetch { | |
margin-top: 20px; | |
right: 40px; | |
font-size:29px; | |
} | |
.inlet { | |
margin-left: 10px; | |
margin-top: 20px; | |
} | |
.inlet img { | |
//margin-left: 10px; | |
margin-top: 5px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment