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

Interactive plots with lots of overlayed peaks appear blank #16

Closed
6 tasks done
zeehio opened this issue Feb 25, 2023 · 0 comments
Closed
6 tasks done

Interactive plots with lots of overlayed peaks appear blank #16

zeehio opened this issue Feb 25, 2023 · 0 comments

Comments

@zeehio
Copy link
Member

zeehio commented Feb 25, 2023

Problem 1

plotly does not support annotation_raster between geoms, and places it above or below all of them. When we have a sample plotted with overlayed rectangles, the rectangles are not seen because they appear below the image.
https://github.com/plotly/plotly.R/blob/9ee548023bba6d68dd953f46485b2e611026766b/R/layers2layout.R#L12

Actions:

  • Provide a pull request to plotly.R. The PR removes the layer2layout conversion for RasterAnnot and provides a layar2trace conversion instead, using an image trace (it was not implemented with image traces because plotly-js did not have them at the time). I tested an implementation. It can't work because traces don't have a well defined z-order in plotly.js. Add way to configure trace module ordering within subplot plotly/plotly.js#3748 So changing ggplot2 raster annotations from "plotly layout images" to "plotly trace images" makes images to appear above the grid axis, but below other traces (we don't have control of the order of the geoms. I can't fix the z-index issue on plotly.js so I will drop this and hope for someone to eventually provide that feature to plotly.js. We will use a workaround.
  • Workaround: Add some additional dummy layers on top, so the rounding of the z-order takes the current annotation raster below instead of above

Problem 2

ggplotly is not hiding one of the legends

Action:

Problem 3

When a legend appears and it doesn't have enough space, plotly js fails with a JavaScript error and the plot becomes a blank page

Actions:

@zeehio zeehio mentioned this issue Feb 25, 2023
27 tasks
@zeehio zeehio changed the title Workaround blank interactive plot. plotly gives a JavaScript error in the browser console for some of our plots. Prepare a minimal example that reproduces the error, submit it to plotly developers and find a work around for us to use until it gets fixed. Interactive plots with lots of overlayed peaks appear blank Feb 25, 2023
zeehio added a commit that referenced this issue Feb 26, 2023
zeehio added a commit that referenced this issue Feb 26, 2023
@zeehio zeehio closed this as completed Feb 27, 2023
zeehio added a commit that referenced this issue Jun 3, 2023
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

No branches or pull requests

1 participant