Skip to content

Commit 71a3511

Browse files
committed
Updated Diamonds shiny example
Fixes #385
1 parent eab102d commit 71a3511

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

_posts/r/shiny-gallery/2016-02-24-explore-diamonds.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,15 @@ shinyServer(function(input, output, session) {
6969
facets <- paste(input$facet_row, '~', input$facet_col)
7070
if (facets != '. ~ .') p <- p + facet_grid(facets)
7171
# return the ggplot object and renderPlotly() will know how to handle it
72-
p
72+
73+
74+
# just verify that this is reactive as expected to the height slider
75+
height = input$plotHeight
76+
77+
ggp <- as.widget(ggplotly(p, height = height) %>% layout(autosize=TRUE))
78+
ggp$x$layout$height = height
79+
ggp
80+
7381
})
7482

7583
})

0 commit comments

Comments
 (0)