plotly / plotly/plotly.R

Remove obsolete/unactionable warnings

Abierto
#2,296 0 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
R
Estrellas
2.7k
Forks
641
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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!

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comience por la ruta de toWebGL() y el código que emite el aviso de scattergl sobre hoveron y las advertencias de Windows/RStudio; en el issue no se nombran archivos fuente ni pruebas. Reproduzca el ejemplo proporcionado de ggplot2/plotly en la configuración indicada y, a continuación, verifique que la advertencia obsoleta haya desaparecido y que se haya abordado el comportamiento de la advertencia restante.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
r
Área
data-visualization
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.