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"),
...
Related
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
Issue
CSS styling is not displaying in the the VS Code preview for Markdown files despite being configured under the Workspace Settings per the VS Code documentation Extending the Markdown preview.
Expected
Here is how the published Markdown file media.md displays when being hosted.
Note: Green border added to highlight Markdown code.
Result
Here is how the Markdown file media.md displays in the VS Code preview.
Note: Green border added to highlight Markdown code.
Setup
Workspace Structure
The Markdown file attempting to be styled with assets/css/style.scss is media.md.
Workspace Settings
This is configured under Workspace Settings as opposed to User Settings.
{
"markdown.styles": [
"assets/css/style.scss"
]
}
It looks like the "markdown.styles": [] setting of VSC is particularly for CSS, not SCSS.
You can use Sass to process your *.scss into *.css files that the VSC Markdown preview will be able to understand.
From the looks of it, though, it seems you're working on a Jekyll site (I see a _config.yml Jekyll configuration file). In that case, serving your Jekyll site locally to preview changes may be a better option.
P.S. it would be easier to parse your question if the Markdown screenshots had a border around them to better differentiate between them and the details of the question itself :)
My shiny app was working well with icpns eg calendar icon displaying till I decided to update the font-awesome folder.I read online that you can download and replace rhe folder to get the latest fonts.I did this and now no icon is working or showing after including them in my dashboard code.How can I get them to work again?
Thanks Mark.
Actually I had overwritten the original fontt-awesome folder.But I got a work around.I searched for a font-awesome folder in the HTML directory of Rstudio and copy pasted this into the www folder of the shiny directory.My icons now work.
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.
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")