Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understanding how dependencies in the yaml are loaded #426

Open
todd-davidson-beis opened this issue Mar 1, 2022 · 0 comments
Open

Understanding how dependencies in the yaml are loaded #426

todd-davidson-beis opened this issue Mar 1, 2022 · 0 comments

Comments

@todd-davidson-beis
Copy link

todd-davidson-beis commented Mar 1, 2022

I am using a package (rpivotTable) that uses a dependency (pivottables.js). I would like to use functions of the dependency that were released in version 2.21, but the package has not been updated for many years and still refers to version 2.19 of the dependency. I believe updating the dependency will let me use the functions, due to the way parameters are passed from the package. However, just updating the files in htmlwidgets/lib/pivottable/ does not seem to work. Just to check, I removed the whole /lib/ folder - and the package continues to work just fine! However, if I remove the .js or .yaml files, the package breaks, understandably. So I am interested to know when the dependencies in the .yaml are loaded, and how to force this to refresh.

To illustrate using the sigma example in the documentation:

From the intro vignette, I understand that a widget is defined by its .js and .yaml files. The latter points to dependencies in the /lib/ folder, which contains JavaScript files that can be referenced by code in the .js file. An example of the .yaml is given:

 dependencies:
   - name: sigma
     version: 1.0.3
     src: htmlwidgets/lib/sigma-1.0.3
     script: 
       - sigma.min.js
       - plugins/sigma.parsers.gexf.min.js

Running the sigma.R script calls htmlwidgets::createWidget("sigma",...) which clearly looks at sigma.js and sigma.yaml in the htmlwidgets/ folder. If I delete sigma.js, the sigma.R script no longer works. If I delete the .yaml, or change the name or version of a dependency, the sigma.R script no longer works.

If I change the src in the .yaml file, the script still works. If I completely delete the whole /lib/ folder, the script still works. These continue to work even when I restart the RStudio session, etc. So I would be grateful for any insight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant