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

[query/ggplot] re-enables interactivity for plots that use dummy traces #12585

Merged
merged 1 commit into from
Jan 12, 2023

Conversation

iris-garden
Copy link
Contributor

CHANGELOG: hail.ggplots 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 if hail.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:
Screenshot 2023-01-09 at 15 29 34

The same plot after this change:
Screenshot 2023-01-09 at 15 11 37

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 if `hail.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).
@danking danking merged commit c5747f8 into hail-is:main Jan 12, 2023
danking pushed a commit to danking/hail that referenced this pull request Jan 30, 2023
…es (hail-is#12585)

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 if `hail.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).
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 this pull request may close these issues.

3 participants