Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
---
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