Learn R Programming

shinyWidgets (version 0.4.3)

knobInput: Knob Input

Description

Knob Input

Usage

knobInput(inputId, label, value, min = 0, max = 100, step = 1,
  angleOffset = 0, angleArc = 360, cursor = FALSE, thickness = NULL,
  lineCap = c("default", "round"), displayInput = TRUE,
  displayPrevious = FALSE, rotation = c("clockwise", "anticlockwise"),
  fgColor = NULL, inputColor = NULL, bgColor = NULL, readOnly = FALSE,
  skin = NULL, width = NULL, height = NULL)

Arguments

inputId

The input slot that will be used to access the value.

label

Display label for the control, or NULL for no label.

value

Initial value.

min

Minimum allowed value, default to 0.

max

Maximum allowed value, default to 100.

step

Specifies the interval between each selectable value, default to 1.

angleOffset

Starting angle in degrees, default to 0.

angleArc

Arc size in degrees, default to 360.

cursor

Display mode "cursor", don't work properly if width is not set in pixel, (TRUE or FALSE).

thickness

Gauge thickness, numeric value.

lineCap

Gauge stroke endings, 'default' or 'round'.

displayInput

Hide input in the middle of the knob (TRUE or FALSE).

displayPrevious

Display the previous value with transparency (TRUE or FALSE).

rotation

Direction of progression, 'clockwise' or 'anticlockwise'.

fgColor

Foreground color.

inputColor

Input value (number) color.

bgColor

Background color.

readOnly

Disable knob (TRUE or FALSE).

skin

Change Knob skin, only one option available : 'tron'.

width

The width of the input, e.g. 400px, or 100%.

height

The height of the input, e.g. 400px, or 100%.

Value

Numeric value server-side.

See Also

updateKnobInput for ganging the value server-side.

Examples

Run this code
# NOT RUN {
if (interactive()) {

library("shiny")
library("shinyWidgets")

ui <- fluidPage(
  knobInput(
    inputId = "myKnob",
    label = "Display previous:",
    value = 50,
    min = -100,
    displayPrevious = TRUE,
    fgColor = "#428BCA",
    inputColor = "#428BCA"
  ),
  verbatimTextOutput(outputId = "res")
)

server <- function(input, output, session) {

  output$res <- renderPrint(input$myKnob)

}

shinyApp(ui = ui, server = server)

}

# }

Run the code above in your browser using DataLab