Open timelyportfolio opened 6 years ago
Hi! Glad to know that you like the idea. I just checked out your repo, apparently you have done a lot of work on R-JS interaction 👍 .
To answer your questions...
I have tried htmltools
, xml2
, XML
and also data.tree
. In the end, it boils down to a design choice. Those packages seem a bit too general, and I am more happy to trade powerfulness for simplicity. Frankly, I didn't manage to get any of them to work the way I want, so I wrote it myself. I think that part takes less than 100 lines, so it is easy to extend or modify.
More or less. One motivation is to create things more reactive than Shiny as Shiny's reactive update seems a bit slow (and I didn't know about sendCustomMessage
until recently. It might be able to speed things up, but I haven't seen many examples / documentations on it). I started with httpuv
just because it was much easier to modify the example there than to find out how Shiny works underneath 😅 .
Regarding your examples...
websocket
package has been removed from CRAN...Collaboration would be great! Is there anything particular you want to build? Anyway, let me open another issue for this.
Very helpful and thorough response, so now I understand much better. Sorry for the errors in my post; I was far sloppier than I thought. I have corrected the "JavaScript in R" to https://jsinr.me which is also crossposted at buildingwidgets. Most of my old examples don't work, but I have enjoyed watching the evolution of the space at the intersection of http, JavaScript, and R.
I want to build everything 😄 , so I don't have anything particular to suggest. Happy to help toward any direction that you would like to pursue. I might try to rework one of your examples to show another method of achieving so that you can decide which you like better.
More than anything, I appreciate your spirit and enthusiasm. Thanks.
Thanks for the link. I really like the 11/19 React antd
and the 10/18 sankeytree transition 👍 . The JS code seems pretty tough to me though 😓 in the sense that I am not sure how I could modify it to create something I need. Surely I'll keep an eye on your latest posts / tutorials!
Great! I was looking at this earlier today and thinking this might be a possibility. I have investigated it briefly and made a prototype. The direction I am thinking of is to allow user pass in their data from R, and see the result in R. So basically, it is a platform for users to experiment t-SNE with different datasets or to explore a dataset with different t-SNE hyperparameters. I think the current R implementation only gives a final answer so it's hard to know what's happening in-between and to tune the hyperparameters.
It seems the original post uses d3.js. I replace that with plotly.js because it uses much less lines. (Not sure if you have noticed, generally I try to keep each example < 100 lines. Simplicity is a key theme in this package.) Having said that, I would like to explore using D3 in this package too!
On the other hand, my original plan was to continue from the third panel of example 6 and finish the example as seen here.
So in short, I propose three options (and of course you are free to consider any other ones):
Yes. I also feel that some of the examples could benefit from reimplementing, so feel free to rework them! In fact, the repo started off as a learning repo, and it will stay that way (it's good to know about different ways of doing things). The whole package thing is really to facilitate communication. A somewhat funny motivation of this package is to help users learn enough that they don't need this package. :stuck_out_tongue_winking_eye:
As a side note, I am slowly moving the examples from 'inst' to a new folder 'examples' because CMD-check keeps complaining my package size is too large. Cheers.
I love what you are doing here and have been going down a similar path for many years. I had a couple of questions out of curiousity.
Why not use
htmltools
orxml2
/XML
to build up your document?I assume you are intentionally avoiding Shiny and its overhead. Is this true? I abandoned most of my work with the websocket communication once Shiny was released ( an example from five years ago :) ). However, this was also before
httpuv
was created. Now, thathttpuv
supports nonblocking (Shiny at some point ashttpuv
), I can see why you would choose directhttpuv
for websocket communication.Thanks so much for your work on this. Happy to collaborate if you would like. I am currently doing a series of weekly posts on JavaScript in R. Here are some of my old experiments https://github.com/timelyportfolio/shiny-websockets.