Feature request: Coordinates of mouse clicks when used with Shiny
未关闭
还没有人认领这个 Issue。
shiny
- 主要语言
- R
- 星标
- 2.7k
- 派生
- 641
- PR 合并指标
- 30 天内没有已合并 PR
描述
When using plotly with Shiny, would it be possible to implement a feature in plotly::plotlyOutput() similar to plotOutput("plot", click = "plot_click") to capture the exact coordinates of a mouse click like in the example below?
library(shiny)
ui <- basicPage(
plotOutput("plot1", click = "plot_click"),
verbatimTextOutput("info")
)
server <- function(input, output) {
output$plot1 <- renderPlot({
plot(mtcars$wt, mtcars$mpg)
})
output$info <- renderText({
paste0("x=", input$plot_click$x, "\ny=", input$plot_click$y)
})
}
shinyApp(ui, server)
I am hoping to be able to reproduce the exact mouse click positions during a data analysis and reuse them in a different analysis.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
该请求围绕 plotly::plotlyOutput() 以及示例中展示的 Shiny plotOutput(..., click=...) 行为展开。首先跟踪 plotly 输出如何与 Shiny 集成,然后验证鼠标点击是否能通过所请求的 input 暴露精确的 x 和 y 坐标;使用这些坐标值演示一个可工作的等效 API 即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- r
- 领域
- data-visualization
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100