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

webGl warning #27

Closed
adhikars11 opened this issue Jul 29, 2021 · 4 comments
Closed

webGl warning #27

adhikars11 opened this issue Jul 29, 2021 · 4 comments

Comments

@adhikars11
Copy link
Collaborator

When converting the svg plots to webGL using the toWebGL function, it gives warnings and the warnings are all the same:

Warning: 'scattergl' objects don't have these attributes: 'hoveron'
Valid attributes include:
'type', 'visible', 'showlegend', 'legendgroup', 'name', 'uid', 'ids', 'customdata', 'meta', 'selectedpoints', 'hoverinfo', 'hoverlabel', 'stream', 'transforms', 'uirevision', 'x', 'x0', 'dx', 'y', 'y0', 'dy', 'xperiod', 'yperiod', 'xperiod0', 'yperiod0', 'xperiodalignment', 'yperiodalignment', 'text', 'hovertext', 'textposition', 'textfont', 'mode', 'line', 'marker', 'connectgaps', 'fill', 'fillcolor', 'selected', 'unselected', 'opacity', 'hovertemplate', 'texttemplate', 'error_x', 'error_y', 'xcalendar', 'ycalendar', 'xaxis', 'yaxis', 'idssrc', 'customdatasrc', 'metasrc', 'hoverinfosrc', 'xsrc', 'ysrc', 'textsrc', 'hovertextsrc', 'textpositionsrc', 'hovertemplatesrc', 'texttemplatesrc', 'key', 'set', 'frame', 'transforms', '_isNestedKey', '_isSimpleKey', '_isGraticule', '_bbox'

We know that it is a case of false positive, so we are either going to suppress the warning as mentioned here or use plot_ly instead of ggplotly to get rid o the warnings.

@adhikars11
Copy link
Collaborator Author

Fixed by assigning a hoveron value manually in ggplotly2() function:

ggplotly2 <- function(x, ...) {
  info <- shiny::getCurrentOutputInfo()
  height <- if (is.function(info$height)) info$height()
  width <- if (is.function(info$width)) info$width()
  gg <- plotly::ggplotly(x, width = width, height = height, ...)
  gg$x$data <- lapply(gg$x$data, function(x) {
    x$hoveron <- NULL
    x
  })
  gg
}

@nara3m
Copy link

nara3m commented Jun 29, 2022

Thanks for fix

Fixed by assigning a hoveron value manually in ggplotly2() function:

But above fix shows a warning
Warning: Error in UseMethod: no applicable method for 'plotly_build' applied to an object of class "shiny.tag"

@juliasilge
Copy link
Member

Hello @nara3m! We don't recommend that you post on old, closed issues, but instead of that you create a reprex (a minimal reproducible example) and open a new issue. If you've never heard of a reprex before, you may want to start with the tidyverse.org help page. Thanks! 🙌

@github-actions
Copy link

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants