See here: 

https://github.com/wch/shiny-jsdemo

------------



justgageOutput <- function(outputId, width, height) {
  tags$div(id = outputId, class = "justgage_output", 
           style = sprintf("width:%dpx; height:%dpx", width, height)
          )
}

justgageOutput("live_gauge", width=250, height=200)


# Set the value for the gauge
# When this reactive expression is assigned to an output object, it is
# automatically wrapped into an observer (i.e., a reactive endpoint)
output$live_gauge <- reactive({
  running_mean <- mean(last(values(), n = 10))
  round(running_mean, 1)
})


