Browse Source

Interactivité avec plotly

static
Maxime Wack 6 years ago
parent
commit
49522ed6d7
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      app.R

+ 10
- 1
app.R View File

@@ -70,6 +70,7 @@ ui <- shinyUI(fluidPage(
checkboxInput("Rang", "Afficher le rang dans un choix", value = T)
),
mainPanel(
textOutput("plotly"),
conditionalPanel("input.Select == 'ville + spé'",plotlyOutput("outPlot")),
dataTableOutput("outTable")
)
@@ -225,7 +226,7 @@ server <- shinyServer(function(input, output, session)
geom_path(color = "black")
else
plotVilleSpe() %>%
ggplot(aes(x = Date, y = Rang, color = Etudiant)) +
ggplot(aes(x = Date, y = Rang, color = Etudiant, key = Etudiant)) +
geom_line() +
geom_point(data = plotVilleSpe() %>%
group_by(Etudiant) %>%
@@ -271,6 +272,14 @@ server <- shinyServer(function(input, output, session)
updateRadioButtons(session, "Spe", selected = valueSpe)
updateRadioButtons(session, "Select", selected = valueSelect)
})

observeEvent(event_data("plotly_click"),
{
info <- event_data("plotly_click")

updateNumericInput(session, "Etudiant", value = info$key)
updateRadioButtons(session, "Select", selected = "étudiant")
})
})

shinyApp(ui, server, options = list(host = "0.0.0.0", port = 4377))

Loading…
Cancel
Save