A tool to support the visualisation of graphs of echarts4r, plotly, ggplot2, highcharter, leaflet, etc. by providing standardized Rijksoverheid (Dutch National Government) styling. This package is part of the [ROvis umbrella package] (https://github.com/rivm-syso/ROvis).
# Install from GitHub
# pak::pak("rivm-syso/ROvis.shiny")
install.packages("ROvis.shiny", repos = c('https://rivm-syso.r-universe.dev', 'https://cloud.r-project.org'))
A short example of on how to use the ro_shiny_graph_panel_ui() and ro_shiny_graph_panel_server functions in combination with your plotly-object. For the full functionality, please see the vignettes.
# Make a function for the plotly plot
plotly_function <- function(example_data) {
plotly::plot_ly(
data = example_data,
x = ~`Aantal cases`,
y = ~`Leeftijdsgroep`,
color = ~Geslacht,
type = "bar",
orientation = "h"
)
}
# Make the ui and server of the app
ui <- shiny::fluidPage(
useShinyjs(),
ro_shiny_graph_panel_ui("mod1", plotly::plotlyOutput)
)
server <- function(input, output, session) {
ro_shiny_graph_panel_server(
id = "mod1",
plot_render_fun = plotly::renderPlotly,
plot_data_fun = function() plotly_function(example_data),
data = example_data,
caption = "Aantal gevallen per leeftijdsgroep en geslacht"
)
}
shiny::shinyApp(ui = ui, server = server)
First point of contact for questions: spin@rivm.nl (spin@rivm.nl)
We welcome contributions! Before you start, please read CONTRIBUTING.md. It explains how to open an issue, our git etiquette (branches, commits, pull requests and reviews) and our code standards. See CONTRIBUTORS.md for the list of contributors.
Below we describe the most important guidelines and practicalities for R package development on this project.
We use the testthat, lintr and roxygen2 package for development of tests, code style
checks and automatic documentation. We also use the devtools and usethis package during
development to adhere to standards for R packages and make developing easier! Install them
in your Rstudio environment:
install.packages(testthat)
install.packages(lintr)
install.packages(roxygen2)
install.packages(quarto)
install.packages(pkgdown)
install.packages(devtools)
install.packages(usethis)
Type devtools::load_all() in your console each time you start developing. This loads
all dependencies and non-exported functions in the NAMESPACE. This makes developing a lot easier!
To ensure code standardization and quality, follow these guidelines:
usethis::use_test()
usethis::use_package(). We use
the min_version argument to specify a minimum version.usethis::use_import_from()
devtools::document() to
create automatic documentation in the man folderThis R packages was created by ROvis team (spin@rivm.nl).
The code can be re-used under license EUPL v.1.2. See LICENCE for details.