partial_bundle() not working with Shiny
Open
Nobody has claimed this yet.
bug
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
I've been trying to use partial_bundle() so that the plotly.js distributed is smaller and my Shiny created website loads faster
When I try to use partial bundle the plot is not showing. Using chrome dev tools it shows "ReferenceError: Plotly is not defined" in plotly.js line 162
Here is a minimal example:
library(shiny)
library(plotly)
ui <- fluidPage(
fluidRow(plotlyOutput("distPlot"))
)
server <- function(input, output) {
output$distPlot <- renderPlotly({
p <- plot_ly(x = 1:10, y = 1:10)%>% partial_bundle()
})
}
shinyApp(ui = ui, server = server)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal Shiny example in the issue and reproduce the browser's “Plotly is not defined” error from plotly.js. Trace how partial_bundle() is integrated into Shiny output; the issue is done when the plot renders in Shiny without that error while using the smaller bundle.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, r
- Domain
- data-visualization, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100