Learn R Programming

shinyMobile (version 0.1.0)

updateF7Gauge: update a framework7 gauge from the server side

Description

update a framework7 gauge from the server side

Usage

updateF7Gauge(session, id, value)

Arguments

session

Shiny session object.

id

Gauge id.

value

New value. Numeric between 0 and 100.

Examples

Run this code
# NOT RUN {
if (interactive()) {
 library(shiny)
 library(shinyMobile)


 shiny::shinyApp(
    ui = f7Page(
       title = "Gauges",
       f7SingleLayout(
          navbar = f7Navbar(title = "update f7Gauge"),
          f7Gauge(
             id = "mygauge",
             type  = "semicircle",
             value = 50,
             borderColor = "#2196f3",
             borderWidth = 10,
             valueText = "50%",
             valueFontSize = 41,
             valueTextColor = "#2196f3",
             labelText = "amount of something"
          ),
          f7Button("go", "Update Gauge")
       )
    ),
    server = function(input, output, session) {
       observeEvent(input$go, {
          updateF7Gauge(session, id = "mygauge", value = 75)
       })
    }
 )
}
# }

Run the code above in your browser using DataLab