Description Usage Arguments Examples
Change size of chart.
1 2 3 4 5 | change_size(proxy, width, height)
change_width(proxy, width)
change_height(proxy, height)
|
proxy |
A g2r proxy as returned by |
width, height |
New dimensions of chart. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | library(shiny)
ui <- fluidPage(
sliderInput("width", "width", min = 100, max = 700, value = 250),
g2Output("chart")
)
server <- function(input, output) {
output$chart <- renderG2({
g2(cars, asp(speed, dist)) %>%
fig_point()
})
observeEvent(input$width, {
g2Proxy("chart") %>%
change_width(input$width)
})
}
## Not run: shinyApp(ui, server)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.