Downloading plot without rangeslider
未关闭
还没有人认领这个 Issue。
- 主要语言
- R
- 星标
- 2.7k
- 派生
- 641
- PR 合并指标
- 30 天内没有已合并 PR
描述
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?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先运行提供的 R Shiny 示例,并检查存在 rangeslider 时 plotly 下载按钮的行为。确定如何让下载的 PNG 不包含 rangeslider,同时让它继续显示在交互式图表中;当示例下载后未捕获 rangeslider 时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- r
- 领域
- data-visualization
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100