2/18/2023 0 Comments R shiny plotly and data table pdfBecause we want our app to be responsive and modify the visualization according user input, we wrap the logic to filter the data inside observeEvent. This is all done in the server part of our code. pickerInput( inputId = "stocks", label = h4("Stocks"), choices = c( "Gravity" = tickers, "Sea Limited" = tickers, "Palantir" = tickers, "Unity" = tickers, "Cloudflare" = tickers, "Snowflake" = tickers, "MongoDB" = tickers), selected = tickers, options = list(`actions-box` = TRUE), multiple = T )īased on the user input, we need to specify how our app should behave. Importantly, we specify the inputId in order to reference the selected stocks in our server logic. All are selected by default using the selected argument. Please have a look at the bottom of the article to see how we put the individual components together in our sidebar.įirst, a pickerInput lets the user pick between stocks and select/deselect all. In our app, we will need some input components that allow the user to pick and choose between stocks, the desired time range and whether or not to include a benchmark. This part requires a bit more work, since this is where we specify what the user can do. We simple write the following: titlePanel("My Tech Stock Portfolio") The Sidebar A sidebar where users can select and filter the data.Our app will have three main UI components: This is demonstrated at the bottom of the article where we will put it all together. The code specifying the user interface will be wrapped in the fluidPage function and saved in a variable that we call ui.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |