How to use Highcharts theme with rCharts - r

I want to create my own theme for Highcharts to use them with rCharts on Shiny app. I've tried to add link to theme scrip by adding
tags$head(
tags$script(type="text/javascript", src = "js/themes/gray.js")
)
to ui.r. However this doesn't work. Should I call theme directly from rCharts function?

You need to have the required script in your app directory:
You can put it directly in your app directory and use includeScript("gray.js") or place it in the www folder
and use tags$head( tags$script(type="text/javascript", src = "gray.js") ). The scripts can be found on the
highcharts github page https://github.com/highslide-software/highcharts.com/blob/master/js/themes/gray.js .
I have included an example https://gist.github.com/johndharrison/bc1440afad69433f5e61 . You can run it by calling:
runGist("bc1440afad69433f5e61")

Related

Showcase mode with shiny modules

I have a shiny application that uses shiny modules.
Each module lives in its own file in modules/ and is sourced in global.R.
I also have a DESCRIPTION file which puts the shiny app into the showcase mode when deployed.
The problem is, that only code for global.R, server.R, and ui.R is displayed, which is helpful but does not show the full picture (eg showing that mymodule_server("myid") is run in server.R is helpful but I want to have the reactive elements of the function shown and highlighted as its usual in the showcase mode).
Is this possible without dumping all modules in global.R?
Note that this is related to https://github.com/rstudio/shiny/issues/3453

R 3.5.1 shiny dashboard theme change

I want to connect external css file for R shiny dashboard. I am using R 3.5.1. I have downloaded cerulean theme as bootstrap.css in www directory. Using the code below
dashboardBody(
tags$head(
tags$link( rel="stylesheet",
type='text/css',
href = 'bootstrap.css'))
But cerulean theme is not appearing in shiny app.
Also I want to change the search input box displaying in 3D to 2D. Please have a look below:
New search input box should appear like below
I have no idea why the following works, but from experience: just renaming the .css file in your www folder and, ofcourse, in the .R file gets it working.
Your code seems fine.
Alternatively you may try includeCSS(). For this you should put your CSS in your app directory.
shinyUI(fluidPage(
includeCSS("styles.css"),
...

How to use a single css for multiple Shiny applications

I have a set of shiny applications stored in a folder 'apps'. Within the folder app we thus have 'app1', 'app2', etc. In each of those applications we have the default shiny files/folders, i.e. ui.R, server.R, global.R and the folder www.
Each www has its own stylesheet which is loaded into the application in the head tag of ui.R file:
tags$link(rel = "stylesheet", type = "text/css", href = "template.css")
However, there is some template css that should be applied to all the applications. Were can I best store this template css and use it in all the applications?
I currently have a copy of the template css in each of the www folders, which works, but it is obviously not ideal when making changes to this css.

Call external (non-local, not in www) CSS files in Shiny

I would like to use CSS files not hosted on my Shiny server. Essentially, I'm at a university and would like to reference standard styles (and be seen to be using standard styles) without having to harvest all their styles and copy it to my server any time they update.
tags$link(rel = "stylesheet", type = "text/css", href = "custom.css") work great for custom.css within www, but I can't seem to reference an outside server.
I've also tried #import url('www.masterserver.edu/global.css') within my custom.css file to no avail.
Is there a way to do this?

customise shiny R data tables

Is it possible to apply customize css file to change appearance of dataTable in R Shiny? I tried applying
shinyUI(fluidPage(theme = "bootstrap.css",
at the beginning but it does not effect the row colour of the table.
You need to first create a 'www' directory inside your app directory. Download "bootstrap.css" and put it in there.
Compile and run!
It must work.

Resources