Downloading plot without rangeslider
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I'm making a shiny app with several plots where rangesliders come in very handy.
However, when a user tries to download a plot, it would be more practical if the rangeslider were disabled.
Can this be achieved?
Below is some example code:
library(shiny)
library(plotly)
library(magrittr)
ui <- fluidPage(
plotlyOutput("myplot")
)
server <- function(input, output, session) {
output$myplot <- renderPlotly({
data <- data.frame(x = 1:40, y = 1:40+5)
plot_ly(data) %>% add_bars(x = ~x, y = ~y) %>%
layout(xaxis = list(title = "Scroll me",
rangeslider = list(yaxis = list(rangemode = "auto"),
fixedrange = TRUE)
))
})
}
shinyApp(ui, server)
When hovering over the plot there's a camera icon (download button"), and the rangeslider gets captured as-is in the resulting png. Can it be set to invisible before download?
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 by running the provided R Shiny example and inspect the plotly download-button behavior when the rangeslider is present. Determine how the downloaded PNG can omit the rangeslider while leaving it visible in the interactive plot; done means the example downloads without capturing the rangeslider.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100