[query/ggplot] re-enables interactivity for plots that use dummy traces #12585
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CHANGELOG:
hail.ggplot
s that have more than one legend group or facet are now interactive. If such a plot has enough legend entries that the legend would be taller than the plot, the legend will now be scrollable. Legend entries for such plots can be clicked to show/hide traces on the plot, but this does not work and is a known issue that will only be addressed ifhail.ggplot
is migrated off of plotly.Currently, scatter plots with more than one legend group and plots with multiple facets are static. This is because both these types of plot leverage empty traces in order to produce legends that match R's ggplot2's legends more closely than the ones plotly generates by default. As a result, the interactive elements of the legends for these types of plot, specifically the ability to click on traces in the legend to show/hide them in the plot, do not work.
However, it appears that if there are enough legend entries that the legend would be taller than the plot, plotly makes the legend scrollable. When the plot is static, however, the scroll for the legend is disabled, and there is no other way to show the legend entries that get truncated by the height of the graph.
This change re-enables the interactivity for plots that use dummy traces to generate their legends in order to preserve the legends' scrolling functionality. The show/hide functionality still does not work, and is now a known issue that may be fixed later by the introduction of a different plotting backend (other than plotly).
An example static plot with too many legend entries:
The same plot after this change: