title: Display graphic according to selected input
body: <p>I want to display a graphic in another tab according to selected input in the first tab.</p>
  <p>For &quot;auto&quot;, i want to display a graphic (named &quot;graph_auto&quot;) in TAB B and if &quot;boat&quot; is selected, i want to display another graphic (named &quot;graph_boat&quot;) in TAB B.This i what i did :</p>
  <pre><code>---
  title: &quot;my report&quot;
  
  output: 
    flexdashboard::flex_dashboard:
      orientation: columns
      vertical_layout: fill
      social: menu
  
  runtime: shiny
  ---
  
  
  ```{r setup, include=FALSE}
  library(flexdashboard)
  library(shiny)
  library(htmltools)
  library(flextable)
  library(plotly)
  
  
  ```
  
  
  RESULTS
  =======================================================================
  
  
  Column
  -----------------------------------------------------------------------
  
  ### TAB A
  
  ```{r}
  # creation du tibble sur ce KPI
  
  my_data = data.frame(product = rep(c(&quot;auto&quot;, &quot;boat&quot;),each=2),
                       year = c(&quot;2009&quot;, &quot;2011&quot;, &quot;2005&quot;, &quot;2019&quot;),
                       price = c(&quot;10 000&quot;, &quot;20 000&quot;, &quot;7 000&quot;, &quot;60 000&quot;),
                       speed = c(&quot;220&quot;, &quot;250&quot;, &quot;70&quot;, &quot;140&quot;))
  
  
  ui &lt;- fluidPage(
    selectInput(&quot;product&quot;, &quot;&quot;, choices = my_data$product),
    uiOutput(&quot;tbl&quot;)
  )
  
  server &lt;- function(input, output, session) {
    output$tbl &lt;- renderUI( {
      out &lt;- subset(my_data, product ==input$product)
      library(flextable)
      htmltools_value((flextable(out)))
    })
  }
  
  shinyApp(ui, server)
  
  
  ```
  
  
  Column 
  -----------------------------------------------------------------------
  
  ### TAB B
  ```{r}
  # if &quot;auto&quot; is selected, then display this graphic
  graph_auto &lt;- plot_ly(midwest, x = ~percollege, color = ~state, type = &quot;box&quot;)
  
  # if &quot;boat&quot; is selected, then display this graphic
  graph_boat &lt;- plot_ly(midwest, x = ~percollege, type = &quot;box&quot;, width = 600, height = 400)
  
  
  
  ```
  </code></pre>
  <p>but i am stuck to display graphic according to the selected product. How can we access to selected input from another tab ? Some help would be appreciated</p>