kcf-jackson / jsReact

R package: Modelling in R. Interactivity in JS. Best of both worlds.
Other
70 stars 7 forks source link

couple of questions #2

Open timelyportfolio opened 6 years ago

timelyportfolio commented 6 years ago

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.

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.

kcf-jackson commented 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...

Regarding your examples...

Collaboration would be great! Is there anything particular you want to build? Anyway, let me open another issue for this.

timelyportfolio commented 6 years ago

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.

kcf-jackson commented 6 years ago

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):

  1. t-SNE live visualisation (adding the control panel on the right) (I just finished that over the weekend...)
  2. create an example using D3 (and data from R)
  3. handwriting generation (extract the JS model from the website and adapt it to example 6)

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.