plotly / plotly/plotly.R

cannot drag a horizontal or vertical line shape

未关闭
#1,532 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

plotly.js
主要语言
R
星标
2.7k
派生
641
PR 合并指标
30 天内没有已合并 PR

描述

I have a simple editable plot with a horizontal line shape like so

plot_ly() %>%
  layout(
  shapes=list(
    type = "line",  line = list(color = "red"),
    x0 = 0,  x1 = 1, xref="paper",
    y0 = 0, y1 = 0
  )
) %>%
config(editable=TRUE)

My problem is that I cannot drag the line shape. It just does not register (e.g. the pointer always stays a cross-hair and never converts to a hand) no matter how slowly or closely I try to point to the red line: when I click it always zooms and never drags the line. Even if I zoom this to the nano-scale the red line just never gets detected. The weird thing is that if I make this a slanted line (y0=0, y1=1), the problem goes away and I can drag the line shape without problem.

I am doing this from the plot viewer in RStudio, but even within an app it does not work.

I know this will be ascribed to idiosyncrasies of my set-up (I took this code more or less verbatim from an example on dragging a vertical line; this example also does not work for me), so please tell me what about my set-up (see below for details about this) could be causing this. It is very annoying as I really need this basic feature (it is more or less why I decided I will switch to plotly for what I want to do), but at the moment am stuck at this seemingly simple roadblock.

sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /.automount/apps/GNU/R/3.5.1_conda/lib/R/lib/libRblas.so

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8
[8] LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] plotly_4.9.0 ggplot2_3.1.1 promises_1.0.1 shiny_1.2.0

loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 pillar_1.3.1 compiler_3.5.1 later_0.8.0 plyr_1.8.4 tools_3.5.1 digest_0.6.18 viridisLite_0.3.0 jsonlite_1.6 tibble_2.1.1
[11] gtable_0.3.0 pkgconfig_2.0.2 rlang_0.3.4 rstudioapi_0.10 crosstalk_1.0.0 yaml_2.2.0 l1000_1.0 withr_2.1.2 dplyr_0.8.0.1 httr_1.4.0
[21] htmlwidgets_1.3 grid_3.5.1 tidyselect_0.2.5 glue_1.3.1 data.table_1.12.2 R6_2.4.0 tidyr_0.8.3 purrr_0.3.2 magrittr_1.5 scales_1.0.0
[31] htmltools_0.3.6 assertthat_0.2.1 mime_0.6 xtable_1.8-3 colorspace_1.4-1 httpuv_1.5.1 lazyeval_0.2.2 munsell_0.5.0 crayon_1.3.4

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

先在绘图查看器中使用最小的 plot_ly()、layout(shapes=...) 和 config(editable=TRUE) 重现,并将水平线或垂直线与斜线进行比较。跟踪可编辑形状的交互,并验证受影响的线条在 RStudio 查看器和 app 中都可以拖动,而不会触发缩放。

由索引模型根据 Issue 内容生成。

评估

技术栈
r
领域
data-visualization
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。