I'm working on a new version of the R package
rgexf, a package that essentially creates XML files called GEXF that are used by Gephi and can also be used with some JS libraries. I'm figuring out how to include the gexf-js library with this using htmlwidgets.
The problem is that, as a difference from other JS libraries, gexf-js reads the data from a file, a GEXF file, and hence, for the library to work you need to have the GEXF file somewhere where it can be fetched (sorry if I'm not using the right wording, I'm not a JS person, I've just started to read about it!), which I don't see how to do with htmlwidgets.
I understand that htmlwidgets allows me specifying the
lib/ files that will be used during the creation of the widget by including them in
inst/htmlwidgets/lib/gexfjs (in my case), which is working, but I have no idea how to include a dynamically created file (a GEXF in my case) in the set of files that are included with the widget.
Again, the idea is that whenever the user calls the R binding function gexfjs(), the user will be passing, say, a path to a GEXF file that he/she wants to visualize, so the widget should take that file and include it in the set of files on which it depends. Makes sense?