Created
March 28, 2019 15:41
-
-
Save cpsievert/adeba0d11e6dd7dec3539a97d3d6e0db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Untitled" | |
output: html_document | |
runtime: shiny_prerendered | |
--- | |
```{r} | |
library(plotly) | |
plotlyOutput("p") | |
``` | |
```{r, context="server"} | |
output$p <- renderPlotly({ | |
plot_ly(x = c("A", "B", "C"), y = rnorm(3)) %>% | |
layout(yaxis = list(range = c(-4, 4))) | |
}) | |
``` | |
```{r, context="server"} | |
observe({ | |
invalidateLater(100) | |
plotlyProxy("p", session) %>% | |
plotlyProxyInvoke("restyle", "y", list(rnorm(3))) | |
}) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment