plotly / plotly/plotly.R

Remove obsolete/unactionable warnings

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

还没有人认领这个 Issue。

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

描述

On Windows 10 (version 21H2, build 19044.3448) using RStudio 2023.06.1, when I run the following code

library(ggplot2)
library(plotly)

gplt <- ggplot(iris) + geom_point(aes(x= Sepal.Length, y = Sepal.Width))
gplt |> toWebGL()

I get the following warnings:

Warning messages:
1: 'scattergl' objects don't have these attributes: 'hoveron'
Valid attributes include:
'connectgaps', 'customdata', 'customdatasrc', 'dx', 'dy', 'error_x', 'error_y', 'fill', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hovertemplate', 'hovertemplatesrc', 'hovertext', 'hovertextsrc', 'ids', 'idssrc', 'legendgroup', 'legendgrouptitle', 'legendrank', 'line', 'marker', 'meta', 'metasrc', 'mode', 'name', 'opacity', 'selected', 'selectedpoints', 'showlegend', 'stream', 'text', 'textfont', 'textposition', 'textpositionsrc', 'textsrc', 'texttemplate', 'texttemplatesrc', 'transforms', 'type', 'uid', 'uirevision', 'unselected', 'visible', 'x', 'x0', 'xaxis', 'xcalendar', 'xhoverformat', 'xperiod', 'xperiod0', 'xperiodalignment', 'xsrc', 'y', 'y0', 'yaxis', 'ycalendar', 'yhoverformat', 'yperiod', 'yperiod0', 'yperiodalignment', 'ysrc', 'key', 'set', 'frame', 'transforms', '_isNestedKey', '_isSimpleKey', '_isGraticule', '_bbox'
 
2: 'scattergl' trace types don't currently render in RStudio on Windows. Open in another web browser (IE, Chrome, Firefox, etc).
  • The second warning is outdated. The plot renders fine on the viewer panel and I successfully can zoom and interact with it. I suggest removing it.

  • The first warning was reported back in 2019 on #1582. It is useless to me (and I guess most users) since it is not clear what can we do to avoid it. It is also weird because it happens on a simple plotly use-case. I am using this function, but it would be nice if it could be addressed:

library(ggplot2)
library(plotly)

workaround_hoveron_warning <- function(p) {
  p$x$data <- lapply(p$x$data, function(item) {
    item$hoveron <- NULL
    item
  })
  p
}

gplt <- ggplot(iris) + geom_point(aes(x= Sepal.Length, y = Sepal.Width))
gplt |> toWebGL() |> workaround_hoveron_warning()

Questions
  • Would a PR removing the RStudio on Windows warning be acceptable?
  • Is there a better approach for avoiding the hoveron warning?

Thanks!

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 toWebGL() 路径以及发出 scattergl 的 hoveron 警告和 Windows/RStudio 警告的代码开始;issue 中没有指定源文件或测试。按照所述设置重现提供的 ggplot2/plotly 示例,然后验证过时的警告已消失,并且剩余警告的行为已得到处理。

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

评估

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

把新 issue 发到你的邮箱

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