Skip to content

Instantly share code, notes, and snippets.

@cpsievert
Created March 28, 2019 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cpsievert/adeba0d11e6dd7dec3539a97d3d6e0db to your computer and use it in GitHub Desktop.
Save cpsievert/adeba0d11e6dd7dec3539a97d3d6e0db to your computer and use it in GitHub Desktop.
---
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