---
title: "Untitled"
runtime: "shiny" # use polished with or without runtime shiny
polished:
  # run polished::secure_rmd() to render this document with polished authentication
  app_name: "flex_dashboard"
  sign_in_page:
    color: "#006CB5"
    company_name: "Tychobra"
    logo: "https://raw.githubusercontent.com/Tychobra/polished/master/inst/assets/images/tychobra_logo_white.svg"
    background_image: "https://raw.githubusercontent.com/Tychobra/polished_example_apps/master/02_custom_sign_in/www/images/milky_way.jpeg"
output:  
  flexdashboard::flex_dashboard: 
    orientation: columns
    vertical_layout: fill
---

```{r global, include=FALSE}
library(shiny)
library(flexdashboard)
# load data in 'global' chunk so it can be shared by all users of the dashboard
library(datasets)
data(faithful)
```

Column {.sidebar}
-----------------------------------------------------------------------

Waiting time between eruptions and the duration of the eruption for the
Old Faithful geyser in Yellowstone National Park, Wyoming, USA.

```{r}
selectInput("n_breaks", label = "Number of bins:",
            choices = c(10, 20, 35, 50), selected = 20)
sliderInput("bw_adjust", label = "Bandwidth adjustment:",
            min = 0.2, max = 2, value = 1, step = 0.2)
```

Column
-----------------------------------------------------------------------

### Geyser Eruption Duration

```{r}
renderPlot({
  hist(faithful$eruptions, probability = TRUE, breaks = as.numeric(input$n_breaks),
       xlab = "Duration (minutes)", main = "Geyser Eruption Duration")
  
  dens <- density(faithful$eruptions, adjust = input$bw_adjust)
  lines(dens, col = "blue")
})
```