Embedded R HTMLwidgets

Hey all! I’m trying to embed an HTMLwidget exported from R (the statistical package). The R package exports as a complete HTML page including embedded scripts, etc. I can load the html document in my browser as a standalone page, so that part works fine.

To import the graphs into Webflow I am trying to use an include HTML call a la W3 schools, since the code is over 10k characters. I can call a test html page from Dropbox using the following link (https://dl.dropboxusercontent.com/s/4d8s7okrubindh5/test.html?dl=0). However, when I call the HTML widget nothing is displayed in the staging website (https://dl.dropboxusercontent.com/s/zla35fp2h3xa5dx/network.html?dl=0). Any idea how to get these graphs to display?

1 Like

I don’t think you can perform ajax cors using dropbox. Use the tutorial on “How to host files on Github” in the tips and tricks category.

I tried as you suggested and although that worked well for the test page, the network page still wouldn’t load.

Do you think it could have to do with the way Webflow loads the pages?

I fixed it! The problem is that R exports all the scripts as base-64 javascript and I couldn’t figure out how to call this correctly. Decoding the graph fixes it.

1 Like

@scienceducky, I am trying to do the same thing (embed htmlwidgets from R) – How did you decode the graph/ insert the decoded version?

Hi @scienceducky, I think I have the same situation at the moment, trying to embed a html widget built in R which exceeds the Webflow embed character limit. Are you able to post a bit more detail about your solution so that I and my developer colleague can try and get our widget on the site?

1 Like