Bokeh - Adding a new plot on click of a button - bokeh

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

Related

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

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 ?

How do you see your viewer items in R studio?

How can I see previous tables that I generated in the viewer instead of only the most recent thing that I ran? For example if I've run several tables and changed one or two things and I wanted to be able to compare them side by side, how do I see them both? I'm thinking about how I can scroll through an SPSS output file.
I'm not sure if this is a code thing or a settings thing. Opening a new window doesn't seem to do anything. Refreshing the viewer doesn't seem to change anything.
I can put things in the viewer no problem using view() or expss_output_viewer or out="viewer".
I can only seem to get it to display the most recent table I ran.
Click the arrows in the upper left of the viewer pane to see previously plotted tables.
Image of viewer pane with arrows highlighted
Using flextable
flextable(mtcars)
Using expss
expss_output_viewer()
as.etable(mtcars)

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.

Can we show static count without hover in gvisGeoChart | googleVis

I am using googleVis to create a GeoChart and its working as expected. This work on local hosted website but we don't have R infra to host the same website. Now all the count parameter is showing on hover and unfortunately I have to share the same report to my client in Image format where I can't show hover. I am attaching a sample graph where I captured one hover meanwhile I have to show all the counts on each location.
Can someone please help me to show static count on graph, I am not able to find the way to create it.

uiOutput not displaying with shiny server

I have a shiny app that is working fine locally, whether I open it in a window or the browser, but after putting it onto our shiny server I am getting some unexpected behavior.
I have two plots that get displayed using uiOutput. The first displays after loading a data file, and the second is just a zoomed plot which appears when the user selects a region from the first plot and double clicks. After putting this app on our server and using it in a browser, the first plot appears when the user uploads a file, but the second plot will not display (it is completely blank - no data points, axes or labels).
What is strange is that the data in this second plot can still be interacted with. I have included hover functionality so that when the user hovers over a point in the second plot, information gets displayed about the point in a small text window. Even though the second plot never appears, if I move the mouse over the region where the plot should be, this hover information gets displayed correctly. Depending on the size of the region selecting for zooming (i.e. if it is large), the zoomed image may not fit in the window making scrollbars necessary. If I select a large region for zooming, scrollbars appear as if the image is there, but the plot is as I said blank. I can render the zoomed plot as a pdf and that looks correct, but this isn't what I want.
As I said, everything works fine locally and this only happens after putting the app on our server. The same thing happens in Firefox, Safari and Chrome. This has to be something related to the shiny server but I have no idea what as both plots are being rendered in the same way.
I've managed to figure this out. In server.R when I generate the zoomed plot, I am doing two things. First, I am creating a pdf as follows:
pdf("z_plot.pdf")
plot()
...
dev.off()
The purpose of this is to have a plot that can be downloaded if required. After this, I am issuing the commands to render the plot in my shiny app. This is all being done in the same reactive expression, which for some reason works locally but when run on a shiny server only the pdf gets generated. I just had to separate the plotting commands into two reactive expressions and everything worked fine.

Resources