Skip to content

Commit

Permalink
Show historic data for selected country
Browse files Browse the repository at this point in the history
  • Loading branch information
mawds committed Aug 9, 2018
1 parent be77161 commit 89c591b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions worked_example/app.R
Expand Up @@ -79,8 +79,14 @@ server <- function(input, output) {
})

output$gapminderPlot <- renderPlot({
plotData() %>%
produceGapminderPlot()
if (length(activeCountry()) == 0) { # No country selected; regular plot
plotData() %>%
produceGapminderPlot()
} else {
plotData() %>%
produceGapminderPlot(makeSemiTransparent = TRUE) %>%
addHistoricPlot(historicData())
}
})

output$clickData <- renderPrint(({
Expand Down

0 comments on commit 89c591b

Please sign in to comment.