plotly / plotly/plotly.R

Remove obsolete/unactionable warnings

Open
#2,296 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the toWebGL() path and the code that emits the scattergl hoveron and Windows/RStudio warnings; no source files or tests are named in the issue. Reproduce the supplied ggplot2/plotly example on the stated setup, then verify the obsolete warning is gone and the remaining warning behavior is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.