Duncan, I don’t think it is a particularly clever or efficient example, but my 
package exCon does some of what you describe.  Additional disclaimer: I’m not 
very good at serious Javascript, and find the scoping rules challenging.  Even 
so, exCon works pretty well on large data sets.  But you may be more interested 
in the infrastructure aspects.

https://cran.r-project.org/package=exCon 
<https://cran.r-project.org/package=exCon>

The gathering of separate .js files, minifying and deployment are handled in 
the main function exCon.R.  Javascript  and html files in inst/extdata.

Bryan
****************
Prof. Bryan Hanson (emeritus)
Dept of Chemistry & Biochemistry
DePauw University
Greencastle IN 46135 USA
Web: academic.depauw.edu/~hanson/index.html
Repo: github.com/bryanhanson
Nerdy Blog: ChemoSpec.org
The Twit: @ProfBryanHanson
I’m usually @ -4 GMT/UTC

> On Jun 1, 2020, at 7:44 AM, Duncan Murdoch <murdoch.dun...@gmail.com> wrote:
> 
> The rgl package includes a large amount of Javascript source to handle the 
> display of output in browsers using rglwidget().  Currently this is mostly in 
> one big file (inst/htmlwidgets/lib/rglClass/rglClass.src.js), but I'd like to 
> make some improvements:
> 
> - splitting it into separate files with related functions
> - automatically "compiling" it into a single file stripped of white space and 
> comments, for faster loading.
> 
> Unfortunately, I have no other experience writing a Javascript library, so I 
> really don't know what I'm doing.  Can anyone point me to other R packages 
> containing htmlwidgets that do this "properly", or point to instructions for 
> the standard workflow for Javascript library development outside of R that I 
> could adapt?
> 
> Duncan Murdoch
> 
> ______________________________________________
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel












        [[alternative HTML version deleted]]

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to