Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove obsolete/unactionable warnings #2296

Open
zeehio opened this issue Oct 4, 2023 · 0 comments · May be fixed by #2302
Open

Remove obsolete/unactionable warnings #2296

zeehio opened this issue Oct 4, 2023 · 0 comments · May be fixed by #2302

Comments

@zeehio
Copy link
Contributor

zeehio commented Oct 4, 2023

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 toWebGL: 'scattergl' objects don't have these attributes: 'hoveron' #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!

zeehio added a commit to zeehio/plotly.R that referenced this issue Oct 6, 2023
When converting a ggplot object to webgl, invalid 'hoveron' warnings appear.

If the toWebGL() function receives the ggplot object then it is possible for us to remove those warnings.

Closes: plotly#2296
Closes: plotly#1582
@zeehio zeehio linked a pull request Oct 7, 2023 that will close this issue
zeehio added a commit to zeehio/plotly.R that referenced this issue Oct 8, 2023
When converting a ggplot object to webgl, invalid 'hoveron' warnings appear.

If the toWebGL() function receives the ggplot object then it is possible for us to remove those warnings.

Closes: plotly#2296
Closes: plotly#1582
zeehio added a commit to zeehio/plotly.R that referenced this issue Oct 19, 2023
When converting a ggplot object to webgl, invalid 'hoveron' warnings appear.

If the toWebGL() function receives the ggplot object then it is possible for us to remove those warnings.

Closes: plotly#2296
Closes: plotly#1582
zeehio added a commit to zeehio/plotly.R that referenced this issue Oct 23, 2023
When converting a ggplot object to webgl, invalid 'hoveron' warnings appear.

If the toWebGL() function receives the ggplot object then it is possible for us to remove those warnings.

Closes: plotly#2296
Closes: plotly#1582
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant