How to freeze a part of dashboard body in R Shiny? - css

I have an R Shiny dashboard.
In its body, I have some user inputs located in the top part of the body, e.g. sliders and text inputs.
Underneath user inputs, I have charts that are being rendered when a user changes inputs.
There are several charts located in several rows, therefore a user needs to scroll down to go through all of them.
I want to freeze the upper part of the dashboard body, so when a user scrolls down, all user inputs are still being visible. Something similar to Excel's "Freeze Rows" functionality.
How do I do that?

Please check the function absolutePanel() from the library markdown. It is exactly what you are looking for!
I'm attaching a hyperlink of the same below.
Absolutely Positioned Panels

Related

What can I do with this error? In regards with navigation thing in shinyapp

I have this problem with my project that it says "Error: Navigation containers expect a collection of bslib::nav()/shiny::tabPanel()s and/or bslib::nav_menu()/shiny::navbarMenu()s. Consider using header or footer if you wish to place content above (or below) every panel's contents."
enter image description here
Code <- this is the code I am currently working on, a Determinant matrix calculator

Adding reactive text to the section above the main panel of shiny dashboard

I'm hoping to add reactive data coming in from an API into the section above the main panel, like the attached photo. It would be to the right of the dashboard header and centred.
Click to see where in shiny output I would like the text
I am fairly new to working with shiny but have read some similar questions here Add text on right of shinydashboard header
Any suggestions or resources to read would be super helpful.
Thanks in advance!

googleCharts resets in size in Shiny after second load

So I'm using the googleCharts package in my Shiny app and creating a line chart.
I have a function that creates a different kind of main panel with tabsetpanel depending on the options the user selects. The first load works fine, but when I switch options in my app and it loads the main panel page the second time, the chart shrinks in size unless I specify an exact height and width in options.
The interesting part is if I select the options so the main panel that's created doesn't have a chart, then select one that does, it resets and works fine again. So it's almost like some kind of reactive problem where its saving the wrong page size and not doing a full load.
Any ideas on what I could do? Is there a way for me to force a refresh/reload of the mainPanel?
I actually ended up solving this using invalidateLater, but I would appreciate it if there's a different solution too, since the user can see the chart being redrawn with this solution

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.

Altering The Sorting Arrows In an R Shiny tabPanel

I didn't see anything here or in http://shiny.rstudio.com/reference/shiny that seems to hit on this problem.
In an R Shiny tabPanel output, the sorting arrows align with the right side of the search fields at the bottom of the page.
Here's a pretty good example:
http://shiny.rstudio.com/gallery/datatables-options.html
Is there a way to make them align just to the right of the column name text up top?
Alternatively (or possibly both), is there a way to change the color of the arrows?
The default greyish doesn't really stand out. Bonus points to make the up and down arrows different colors.
Doing it directly in RShiny is best, but I could muddle my way through .js or .css if needed.
I'm trying to head off imminent support requests of "the column is sorting wrong" and "I can't see the arrows" before I push into production.
At the bottom of that shiny example you showed they show that you can pass in through the options parameter options to the rendering for the DataTable table, via the shiny::renderDataTable() function.
Hopefully the http://datatables.net/ site has documentation on what you want if it's indeed possible
If you look at Developer Tools on the http://shiny.rstudio.com/gallery/datatables-options.html page maybe you can see what element would need to be changed.

Resources