Skip to content

Instantly share code, notes, and snippets.

@sacul-git
Created July 22, 2019 18:25
Show Gist options
  • Save sacul-git/e980de92b5f936cde5fd05a0b6becf9c to your computer and use it in GitHub Desktop.
Save sacul-git/e980de92b5f936cde5fd05a0b6becf9c to your computer and use it in GitHub Desktop.
Tabbed Dash for R app with resizing figure
library(dash)
library(dashHtmlComponents)
library(dashCoreComponents)
library(plotly)
app <- Dash$new()
app$layout(
htmlDiv(
children = list(
dccTabs(
children = list(
dccTab(
label = "Partner Map",
children = htmlDiv(
# Set the height of the div in your tab
style = list(height = "90vh"),
children = dccGraph(
# Set the graph to inherit the height of its parent div
style = list(height = "inherit"),
# Insert your plot_ly plot here:
figure = plot_geo() %>%
layout(
geo = list(
showframe = FALSE,
showcountries = TRUE,
showland = TRUE,
landcolor = "grey"
)
)
)
)
),
dccTab(
label = "Another tab"
)
)
)
)
)
)
app$run_server()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment