htmltools::tags$script(src = "//code.jquery.com/jquery-1.11.1.min.js")
htmltools::tags$script(src = "//cdn.opencpu.org/opencpu-0.4.js")
# devtools::install_github("Rstudio/flexdashboard")
library(flexdashboard)

Page 1

Row {data-height=200}

Definition {data-width=800}

Test for a dashboard with opencpu.

Loading a page is slow due to the size of the web page loaded: so far 1.4 Mb. Most of the size is due to the flexdashboard interface (multiple pages & tab adjustment).

There is a trade off between the complexity of the page (mobile compatible or not, multiple pages, etc.) and the size of the page.

Selection (integer between 1 and 544) {data-width=200}

htmltools::tags$input(type="integer", class="form-control", id="myid", value="1", style = "width: 90%")

htmltools::tags$button("Update dashboard!", type="submit", id="idsubmit", class="btn btn-default")

Row {data-height=200}

Age

valueBox(0, icon = "fa-pencil", color = '#01bb69')

Height

valueBox(0, icon = "fa-envelope-o", color = '#ff8039')

Weight

valueBox(0, icon = "fa-trash", color = '#fb305a')

Id

valueBox(0, icon = "fa-puzzle-piece")

Sex

valueBox(0, icon = "fa-money", color = '#02a8ee')

Row {data-height=200}

Indicator 1

gauge(90, min = 0, max = 100, gaugeSectors(
  success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
))

Indicator 2

gauge(30, min = 0, max = 100, gaugeSectors(
  success = c(41, 50), warning = c(21, 40), danger = c(0, 20)
))

Indicator 3

gauge(8, min = 0, max = 100, gaugeSectors(
  success = c(0, 2), warning = c(3, 6), danger = c(7, 10)
))

Row {data-height=400}

Age, Weight and Height Graphs

htmltools::tags$div(id="plotdiv", style="height: 270px")

Page 2

Row {data-height=300}

Age Height by Sex

data("howell")

ggplot2::ggplot(data = howell, ggplot2::aes(x = age, y = height, color = as.factor(male))) +
  ggplot2::geom_point()

Age Weight by Sex

data("howell")

ggplot2::ggplot(data = howell, ggplot2::aes(x = age, y = weight, color = as.factor(male))) +
  ggplot2::geom_point()

Row {data-height=700}

Mapping

htmltools::tags$button("Map", type="button", id="myBtn")
htmltools::tags$iframe(src="about:blank", style='height: 620px;width: 1300px;display: none;')


YvesCR/flexocpu documentation built on May 10, 2019, 1:55 a.m.