Title: | 'Shiny' Applications for the R Package 'Luminescence' |
---|---|
Description: | A collection of 'shiny' applications for the R package 'Luminescence'. These mainly, but not exclusively, include applications for plotting chronometric data from e.g. luminescence or radiocarbon dating. It further provides access to bootstraps tooltip and popover functionality and contains the 'jscolor.js' library with a custom 'shiny' output binding. |
Authors: | Christoph Burow [aut, cre]
|
Maintainer: | Christoph Burow <[email protected]> |
License: | GPL-3 |
Version: | 0.2.4 |
Built: | 2025-03-03 10:24:40 UTC |
Source: | https://github.com/tzerk/rlumshiny |
A collection of shiny applications for the R package Luminescence. These mainly, but not exclusively, include applications for plotting chronometric data from e.g. luminescence or radiocarbon dating. It further provides access to bootstraps tooltip and popover functionality as well as a binding to JSColor.
In addition to its main purpose of providing convenient access to the Luminescence
shiny applications (see app_RLum
) this package also provides further functions to extend the
functionality of shiny. From the Bootstrap framework the JavaScript tooltip and popover
components can be added to any shiny application via tooltip
and popover
.
It further provides a custom input binding to the JavaScript/HTML color picker JSColor.
Offering access to most options provided by the JSColor API the function jscolorInput
is easily implemented in a shiny app. RGB colors are returned as hex values and can be
directly used in R's base plotting functions without the need of any format conversion.
Maintainer: Christoph Burow [email protected] (ORCID)
Authors:
Urs Tilmann Wolpert
Sebastian Kreutzer (ORCID)
Other contributors:
R Luminescence Package Team [contributor]
Jan Odvarko (jscolor.js in www/jscolor) [copyright holder]
AnalytixWare (ShinySky package) [copyright holder]
RStudio (chooser_inputBinding.js in www/ and chooser.R in R/) [copyright holder]
Useful links:
A wrapper for shiny::runApp to start interactive shiny apps for the R package Luminescence.
The RLumShiny package provides a single function from which all shiny apps can be started: app_RLum()
.
It essentially only takes one argument, which is a unique keyword specifying which application to start.
See the table below for a list of available shiny apps and which keywords to use. If no keyword is used
a dashboard will be started instead, from which an application can be started.
Application name: | Keyword: | Function: |
Abanico Plot | abanico | Luminescence::plot_AbanicoPlot |
Histogram | histogram | Luminescence::plot_Histogram |
Kernel Density Estimate Plot | KDE | Luminescence::plot_KDE |
Radial Plot | radialplot | Luminescence::plot_RadialPlot |
Dose Recovery Test | doserecovery | Luminescence::plot_DRTResults |
Cosmic Dose Rate | cosmicdose | Luminescence::calc_CosmicDoseRate |
CW Curve Transformation | transformCW | Luminescence::CW2pHMi, Luminescence::CW2pLM, Luminescence::CW2pLMi, Luminescence::CW2pPMi |
Filter Combinations | filter | Luminescence::plot_FilterCombinations |
Fast Ratio | fastratio | Luminescence::calc_FastRatio |
Fading Correction | fading | Luminescence::analyse_FadingMeasurement, Luminescence::calc_FadingCorr |
Test Stimulation Power | teststimulationpower | Luminescence::plot_RLum |
Scale Gamma Dose Rate | scalegamma | Luminescence::scale_GammaDose |
RCarb app | RCarb | RCarb::model_DoseRate |
The app_RLum()
function is just a wrapper for shiny::runApp.
Via the ...
argument further arguments can be directly passed to shiny::runApp.
See ?shiny::runApp
for further details on valid arguments.
app_RLum(app = NULL, ...)
app_RLum(app = NULL, ...)
app |
character (required): name of the application to start. See details for a list of available apps. |
... |
further arguments to pass to shiny::runApp |
Christoph Burow, University of Cologne (Germany)
## Not run: # Dashboard app_RLum() # Plotting apps app_RLum("abanico") app_RLum("histogram") app_RLum("KDE") app_RLum("radialplot") app_RLum("doserecovery") # Further apps app_RLum("cosmicdose") app_RLum("transformCW") app_RLum("filter") app_RLum("fastratio") app_RLum("fading") app_RLum("surfaceexposure") app_RLum("teststimulationpower") app_RLum("scalegamma") app_RLum("RCarb") ## End(Not run)
## Not run: # Dashboard app_RLum() # Plotting apps app_RLum("abanico") app_RLum("histogram") app_RLum("KDE") app_RLum("radialplot") app_RLum("doserecovery") # Further apps app_RLum("cosmicdose") app_RLum("transformCW") app_RLum("filter") app_RLum("fastratio") app_RLum("fading") app_RLum("surfaceexposure") app_RLum("teststimulationpower") app_RLum("scalegamma") app_RLum("RCarb") ## End(Not run)
Creates a JSColor (Javascript/HTML Color Picker) widget to be used in shiny applications.
jscolorInput( inputId, label, value, position = "bottom", color = "transparent", mode = "HSV", slider = TRUE, close = FALSE )
jscolorInput( inputId, label, value, position = "bottom", color = "transparent", mode = "HSV", slider = TRUE, close = FALSE )
inputId |
character (required): Specifies the input slot that will be used to access the value. |
label |
character (optional): Display label for the control, or NULL for no label. |
value |
character (optional): Initial RGB value of the color picker. Default is black ('#000000'). |
position |
character (with default): Position of the picker relative to the text input ('bottom', 'left', 'top', 'right'). |
color |
character (with default): Picker color scheme ('transparent' by default). Use RGB color coding ('000000'). |
mode |
character (with default): Mode of hue, saturation and value. Can either be 'HSV' or 'HVS'. |
slider |
logical (with default): Show or hide the slider. |
close |
logical (with default): Show or hide a close button. |
Other input.elements: shiny::animationOptions, shiny::sliderInput; shiny::checkboxGroupInput; shiny::checkboxInput; shiny::dateInput; shiny::dateRangeInput; shiny::fileInput; shiny::numericInput; shiny::passwordInput; shiny::radioButtons; shiny::selectInput, shiny::selectizeInput; shiny::submitButton; shiny::textInput
# html code jscolorInput("col", "Color", "21BF6B", slider = FALSE) # example app ## Not run: shinyApp( ui = fluidPage( jscolorInput(inputId = "col", label = "JSColor Picker", value = "21BF6B", position = "right", mode = "HVS", close = TRUE), plotOutput("plot") ), server = function(input, output) { output$plot <- renderPlot({ plot(cars, col = input$col, cex = 2, pch = 16) }) }) ## End(Not run)
# html code jscolorInput("col", "Color", "21BF6B", slider = FALSE) # example app ## Not run: shinyApp( ui = fluidPage( jscolorInput(inputId = "col", label = "JSColor Picker", value = "21BF6B", position = "right", mode = "HVS", close = TRUE), plotOutput("plot") ), server = function(input, output) { output$plot <- renderPlot({ plot(cars, col = input$col, cex = 2, pch = 16) }) }) ## End(Not run)
Add small overlays of content for housing secondary information.
popover( title, content, header = NULL, html = TRUE, class = "btn btn-default", placement = c("right", "top", "left", "bottom"), trigger = c("click", "hover", "focus", "manual") )
popover( title, content, header = NULL, html = TRUE, class = "btn btn-default", placement = c("right", "top", "left", "bottom"), trigger = c("click", "hover", "focus", "manual") )
title |
|
content |
|
header |
|
html |
|
class |
|
placement |
|
trigger |
|
# html code popover("title", "Some content") # example app ## Not run: shinyApp( ui = fluidPage( jscolorInput(inputId = "col", label = "JSColor Picker", value = "21BF6B", position = "right", mode = "HVS", close = TRUE), popover(title = "Help!", content = "Call 911"), plotOutput("plot") ), server = function(input, output) { output$plot <- renderPlot({ plot(cars, col = input$col, cex = 2, pch = 16) }) }) ## End(Not run)
# html code popover("title", "Some content") # example app ## Not run: shinyApp( ui = fluidPage( jscolorInput(inputId = "col", label = "JSColor Picker", value = "21BF6B", position = "right", mode = "HVS", close = TRUE), popover(title = "Help!", content = "Call 911"), plotOutput("plot") ), server = function(input, output) { output$plot <- renderPlot({ plot(cars, col = input$col, cex = 2, pch = 16) }) }) ## End(Not run)
Create bootstrap tooltips for any HTML element to be used in shiny applications.
tooltip( refId, text, attr = NULL, animation = TRUE, delay = 100, html = TRUE, placement = "auto", trigger = "hover" )
tooltip( refId, text, attr = NULL, animation = TRUE, delay = 100, html = TRUE, placement = "auto", trigger = "hover" )
refId |
|
text |
|
attr |
|
animation |
|
delay |
|
html |
|
placement |
|
trigger |
|
# javascript code tt <- tooltip("elementId", "This is a tooltip.") str(tt) # example app ## Not run: shinyApp( ui = fluidPage( jscolorInput(inputId = "col", label = "JSColor Picker", value = "21BF6B", position = "right", mode = "HVS", close = TRUE), tooltip("col", "This is a JScolor widget"), checkboxInput("cbox", "Checkbox", FALSE), tooltip("cbox", "This is a checkbox"), checkboxGroupInput("cboxg", "Checkbox group", selected = "a", choices = c("a" = "a", "b" = "b", "c" = "c")), tooltip("cboxg", "This is a <b>checkbox group</b>", html = TRUE), selectInput("select", "Selectinput", selected = "a", choices = c("a"="a", "b"="b")), tooltip("select", "This is a text input field", attr = "for", placement = "right"), passwordInput("pwIn", "Passwordinput"), tooltip("pwIn", "This is a password input field"), plotOutput("plot") ), server = function(input, output) { output$plot <- renderPlot({ plot(cars, col = input$col, cex = 2, pch = 16) }) }) ## End(Not run)
# javascript code tt <- tooltip("elementId", "This is a tooltip.") str(tt) # example app ## Not run: shinyApp( ui = fluidPage( jscolorInput(inputId = "col", label = "JSColor Picker", value = "21BF6B", position = "right", mode = "HVS", close = TRUE), tooltip("col", "This is a JScolor widget"), checkboxInput("cbox", "Checkbox", FALSE), tooltip("cbox", "This is a checkbox"), checkboxGroupInput("cboxg", "Checkbox group", selected = "a", choices = c("a" = "a", "b" = "b", "c" = "c")), tooltip("cboxg", "This is a <b>checkbox group</b>", html = TRUE), selectInput("select", "Selectinput", selected = "a", choices = c("a"="a", "b"="b")), tooltip("select", "This is a text input field", attr = "for", placement = "right"), passwordInput("pwIn", "Passwordinput"), tooltip("pwIn", "This is a password input field"), plotOutput("plot") ), server = function(input, output) { output$plot <- renderPlot({ plot(cars, col = input$col, cex = 2, pch = 16) }) }) ## End(Not run)