upgrading d3.json in tributary

36 views
Skip to first unread message

Ian Johnson

unread,
Mar 9, 2014, 11:22:14 PM3/9/14
to trib...@googlegroups.com
hellooooo tribunauts!

long time no see. my bad for being so busy...
but I just added a feature that makes d3.json (and d3.csv, d3.xml etc) work as you'd hope it would in tributary.
The problem used to be that every keystroke would cause a new ajax call because the code is re-run. I used some esprima AST magic to hijack the d3.json function (as well as its cousins) that caches the result by the last URL you put in.

you should be able to develop with d3.json worry free in almost every case. if you want to turn off the caching for some reason there is a new button in the config panel.

for example:

Andrea Gauthier

unread,
Feb 3, 2015, 1:36:37 PM2/3/15
to trib...@googlegroups.com
Hi - I'm trying to get something similar to work.

Is there a way to use the command d3.csv() to access a file linked to the inlet? By this I mean that I created a new tab beside the "inlet.js" tab called "dataset.csv" and would like to access this and use it as data in a bar graph. 

I have the following at the moment: http://tributary.io/inlet/cb49cfd57f6a5a0a9c18

right now the length of the bars are based on a dummy dataset but the goal would be to access the csv file and use those values.

Thanks for any help in this regard.
Best,
Andrea

Andrea Gauthier

unread,
Feb 3, 2015, 1:41:54 PM2/3/15
to trib...@googlegroups.com
SOLVED! you must add a "./" before the .csv filename. :-)

Andrea Gauthier

unread,
Feb 3, 2015, 1:49:58 PM2/3/15
to trib...@googlegroups.com
I apologize - I spoke too soon. The above didn't work after all. I get the console message: {statusText: "Not Found", status: 404, responseURL: "http://sandbox.tributary.io/dataset.csv", response: "Cannot GET /dataset.csv", responseType: ""...}

Ian Johnson

unread,
Feb 15, 2015, 11:24:11 PM2/15/15
to Andrea Gauthier, trib...@googlegroups.com
Sorry for the delay Andrea!
the way you want to accomplish this is:

by default any file will be available on the tributary object, so tributary.dataset has your data in json form.

I should make the default behavior for d3.csv and d3.json work more like bl.ocks...


--
You received this message because you are subscribed to the Google Groups "Tributary" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tributary+...@googlegroups.com.
Visit this group at http://groups.google.com/group/tributary.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages