plotly / plotly/plotly.R

Downloading plot without rangeslider

未關閉
#2,256 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 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?

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先執行提供的 R Shiny 範例,並檢查存在 rangeslider 時 plotly 下載按鈕的行為。確定如何讓下載的 PNG 不包含 rangeslider,同時讓它繼續顯示在互動式圖表中;當範例下載後未擷取 rangeslider 時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
r
領域
data-visualization
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。