######
#
#
#
#
#
#
#
#
#
#
#
###### Tutorials Link in here: https://youtu.be/R4a708-I30s
#
#
#
#
#
#
#
#
#
###File: Shiny1---StartHere

library(shiny)

#Beginner start here https://shiny.rstudio.com/tutorial/written-tutorial/lesson2/
#eventReactive example https://riptutorial.com/shiny/example/32341/eventreactive

ui <- fluidPage(
    headerPanel("Example eventReactive"),
    
    mainPanel(
        
        # input field
        textInput("user_text", label = "Enter some text:", placeholder = "Please enter some text."),
        
        # submit button
        actionButton("submit", label = "Submit"),
        
        # display text output
        textOutput("text"))
    
    ###Widget https://shiny.rstudio.com/tutorial/written-tutorial/lesson3/
)

server <- function(input, output) {
    
    # reactive expression
    text_reactive <- eventReactive( 
        input$submit, 
        {
        input$user_text
    })
    
    #Tutorials on renderText and other materials https://shiny.rstudio.com/tutorial/written-tutorial/lesson4/
    # text output
    output$text <- renderText({
        text_reactive()
    })
}

shinyApp(ui = ui, server = server)
## PhantomJS not found. You can install it with webshot::install_phantomjs(). If it is installed, please make sure the phantomjs executable can be found via the PATH variable.

Shiny applications not supported in static R Markdown documents

#Q&A 
##Where should I start learning all these? #Beginner start here https://shiny.rstudio.com/tutorial/written-tutorial/lesson2/