Live data from Hacker News

Combining the power of R and D3.js

blog.ae.be

1–10 of 16 posts

Re: Combining the power of R and D3.js

#3
Somewhat close in spirit to what seems like a never-ending side project I have: https://dl.dropboxusercontent.com/u/7702253/AlthingiJS-1.mov Here I show Javascript and APL, but the plan is to eventually include at the very least also R. But so far I'm still rewriting what I have until I'm happy with it, so it's taking ages.

Re: Combining the power of R and D3.js

#4
R is a very powerful tool, but I fail to see how it's adding value in this case. It seems like the author is advocating just using R to clean up the data and put it in JSON. The same can be done (without overhead for context switching and server-client architecture) in JS itself. Tools like Crossfilter [0] can be seamlessly integrated with D3.

[0]: https://square.github.io/crossfilter/

Re: Combining the power of R and D3.js

#5

Somewhat close in spirit to what seems like a never-ending side project I have: https://dl.dropboxusercontent.com/u/7702253/AlthingiJS-1.mov Here I show Javascript and APL, but the plan is to eventually include at the very least also R. But so far I'm still rewriting what I have until I'm happy with it, so it's taking ages.

That's cool, but... code or it didn't happen. Are you running an APL interpreter client-side or shuttling the code and data back to the server? If it's the latter, are you sandboxing in some way the arbitrary code being executed?

Re: Combining the power of R and D3.js

#6
post #4

R is a very powerful tool, but I fail to see how it's adding value in this case. It seems like the author is advocating just using R to clean up the data and put it in JSON. The same can be done (without overhead for context switching and server-client architecture) in JS itself. Tools like Crossfilter [0] can be seamlessly integrated with D3. [0]: https://square.github.io/crossfilter/

Perhaps the intent is the other way around, encouraging people familiar with R to take a look at using D3.

Re: Combining the power of R and D3.js

#8
post #5

Somewhat close in spirit to what seems like a never-ending side project I have: https://dl.dropboxusercontent.com/u/7702253/AlthingiJS-1.mov Here I show Javascript and APL, but the plan is to eventually include at the very least also R. But so far I'm still rewriting what I have until I'm happy with it, so it's taking ages.

That's cool, but... code or it didn't happen. Are you running an APL interpreter client-side or shuttling the code and data back to the server? If it's the latter, are you sandboxing in some way the arbitrary code being executed?

Yes, that's the thing. At the current point it is usable (barely) as an APL/javascript REPL, but there are several corners that are very rough, not counting unhandled data structures and such. Every time I have some spare time with some clear mind I work a little on it, so it's not stalled, but has been going for quite a few months already without much improvement.

As for your question, data goes back to the "server" (there's go code interacting with the APL interpreter and sanitising inputs and outputs, converting to JSON, etc) but this is expected to be used as a local service (using a port not listening to the outside world), so no, no arbitrary code execution failsafes (if I were to deploy it in some real, server-ed way I'd isolate interpreters via sessions in the go 'middle' layer).

Re: Combining the power of R and D3.js

#10
post #4

R is a very powerful tool, but I fail to see how it's adding value in this case. It seems like the author is advocating just using R to clean up the data and put it in JSON. The same can be done (without overhead for context switching and server-client architecture) in JS itself. Tools like Crossfilter [0] can be seamlessly integrated with D3. [0]: https://square.github.io/crossfilter/

This is the way I would want my work flow:

1) Use R clean the data

2) Use R to turn the raw data into analytically data

3) Use R to do exploratory charting etc

[Most project stop here]

4) Final Product: RMarkdown (For static reports), Shiny (Interactive variable charts), or now D3 if I want to have interactive charts. My interactive charts would be very few.

I wouldn't want to do the first three steps with javascript.

Post reply on HN