Rshiny - Plotly Add watermark logo to plot only if download initiated - r

I am building a shiny app and in this app I have a plot and I decided to use renderPlotly and ggplotly to render it.
Using this link, it is fairly easy to create a watermark to a ggplotly plot.
However, I want this watermark to be generated only on the downloaded png version of my plot and not on the one rendered that users see while using the app.
Is this possible ? I thought about disabling he download button and using the download handler to generate a new plot with a watermark, but it seems very complicated and not at all efficient looking at this question
Any help ?

Related

Is there a way to download my dashboard as is in a pdf file

I have tried to download my application dashboard in png with the screenshot() function but some of the charts and texts are a little blurred.
Ideally I want to be able to download the dashboard texts and charts as is in a pdf file.
This is the link to my application:
https://iecprojects.shinyapps.io/CountryProfile1/
Is there any way I can achieve this? Any idea or example can help.

Is there a way to link a plotly modebar button with an actionButton in Rshiny?

I am working on an Rshiny app and I would like to download the plots I generate with plotly using an Rshiny actionButton instead of the built-in plotly download button. I have tried downloading the plots with downloadHandler, but for some reason the download window takes a long time to appear, something that doesn't happen when using the modebar's download button. Is there any way to link the plotly modebar download button with an Rshiny actionButton?
Thanks in advance!

Adding a responsive sidebar to a Leaflet application in R

I am building a Leaflet application in R. I want polygons in my map to be clickable. A side bar should then show additional information about the clicked element.
The only solution I could find are in Javascript, such as this one:
https://github.com/turbo87/leaflet-sidebar/
I only use R and don't know how/if I can combine that with Javascript

R Leaflet does not show legend when embedded in Shiny Dashboard

The map above renders perfectly fine in the following scenarios:
List item
RStudio Viewer
Shiny app
Shiny app using a minimal Shiny dashboard sceleton
When including the map in an existing, pretty complex Shiny dashboard, the looks as follows:
Obviously, the legend is missing. On top of that, the "reset view" action button has no effect.
Without posting the complete code of the complex shiny dashbboard, I would like make the following comments:
I have disabled all custom JS code and CSS
I use a bare "renderLeaflet" function without additional arguments
I have also tried to display the leaflet in a bare dashboard box without any further arguments
Any obvious culprit anyone could think of causing this issue? Anyone observed similar issues?
I wonder if you solved the issue. I noticed the legend of a raster layer disappears when using the function d3heatmap, for instance d3heatmap(mtcars, scale="column", colors="Blues"). When the line with the heatmap is commented out the dashboard knites just fine -even when the library d3heatmap is loaded. I used the code from this example. Oh I just noticed this has been addressed and solved in other questions, for example here.

Bokeh - Adding a new plot on click of a button

I am using bokeh to plot some graphs. I will be using bokeh serve to serve a python notebook. My use case is as follows:
The page will load with a text box and button. Based on the data that is entered into the text box , I need to show different graphs on button click.
What is the best way to go about it. I have tried adding the plot to the current doc and such. but none of them seem to be working.
I am using bokeh 0.11.1

Resources