GGplotly on Github and Kaggle

Hey guys, I've been trying to use GGPLOTLY to show visualizations in my Rmarkdown for some days now. It always works perfectly in my local RStudio and Posit cloud, but I always just get a blank tab for the ggplotly visualizations when I pubish on Kaggle and Github.
I know I could just use ggplot alone, but ggplotly gives much more information to viewers with its interactive features.
Any contribution to this would be much appreciated.


I'm no expert on this matter, so I am kinda guessing, but doesn't plotly use JavaScript? Maybe it runs on your machine because you have Java installed and your R IDE knows where to find it. Once you upload, it does not have path access and hence, fails.

After a quick google search, I found a kaggle script that uses plotly, so it should be possible to implement.

DT, Plotly and ggplotly in R | Kaggle

But as I said, I'm guessing here. Hope this helps.

I don't know about kaggle, but how are you publishing on github ? ggplotly will produce a plotly graph and this require some JS dependencies and some CSS. When you produce a HTML document, are you using self_contained: true. With this option, everything will be included in your single HTML file (but could be heavy one). Without that, you will have a folder with resources, and this needs to be published too.

Hope it helps

Yeah you're right, I was only getting a folder with all the visualizations, which of course only showed as usual ggplot images when published on Github. I will try "self_contained: true" in a few hours and get back to you.

Thank you.

Yea you're right about me having Java installed - thanks for pointing that out!
Also, I had been searching for a Kaggle script that uses ggplotly for hours and found none, thanks a lot for sharing the script, it works perfectly!

note: Java and Javascript have no concrete relationship , they are too rather different programming languages. Javascript was named Javascript only catch hype that Java had carved out for itself in previous years. If you are trying to solve javascript issues, I wouldnt want you to get distracted reading about Java, as it will have no bearing on your issues.

Hope this helps !

When I publish my RMarkdown document to platforms like RPubs or my personal website, the interactive features of ggplotly don't seem to work. The plots appear static, and viewers can't interact with them as intended. I've tried different output formats, including HTML, but the issue persists. I believe that interactive visualizations are essential for conveying information effectively, and I'd greatly appreciate any insights or solutions the community can provide to ensure these plots work seamlessly when shared online.
plumbing estimating

Are you correctly publishing also the resources, embeded or as companion folder ?
What are the issue you see in the browser console in your website ?
Can you share code to reproduce ?

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.