[query/ggplot] Replaces cross-product legends with grouped ones#12254
Merged
Conversation
27fe83e to
616873d
Compare
58b56e2 to
cd3da08
Compare
Contributor
|
Just wanted to say this is dope! Particularly considering this issue has been open since 2020. |
cd3da08 to
ab40f16
Compare
Member
|
Really nice work! This is a great change that I'm happy to merge now, but this suggests a number of follow-up improvements:
|
patrick-schultz
previously requested changes
Oct 4, 2022
ab40f16 to
cdc75a3
Compare
Member
|
Sorry, could you also add an example to the docstring for |
Contributor
|
Another follow up PR: update the ggplot tutorial to include the use of cross-product legends! |
cdc75a3 to
d06f813
Compare
patrick-schultz
approved these changes
Oct 4, 2022
f528b40 to
7e30ff0
Compare
CHANGELOG: Replaced cross-product-style legends for data groups with factored ones (consistent with `ggplot2`'s implementation) for `hail.ggplot.geom_point`, and added support for custom legend group labels.
7e30ff0 to
c59e244
Compare
|
Hey everyone! Thank you so much for working on this. As the requestor of many ggplot features -- including this one -- I am so thankful for all your effort in making this a great graphics language :) |
iris-garden
added a commit
to iris-garden/hail
that referenced
this pull request
Nov 23, 2022
CHANGELOG: Added support for `scales`, `nrow`, and `ncol` arguments, as well as grouped legends, to `hail.ggplot.facet_wrap`. This change brings the `facet_wrap` interface more in line with the `ggplot2` implementation by defaulting to show axes (with tick marks) for all facets, as well as providing `scales`, `nrow` and `ncol` arguments that the user can use to specify whether the scales should be the same across facets and how many rows or columns to use. It also updates the faceting code to avoid duplicating legend entries when [grouped legends](hail-is#12254) are used, and to disable interactivity accordingly.
iris-garden
added a commit
to iris-garden/hail
that referenced
this pull request
Nov 23, 2022
CHANGELOG: Added support for `scales`, `nrow`, and `ncol` arguments, as well as grouped legends, to `hail.ggplot.facet_wrap`. This change brings the `facet_wrap` interface more in line with [the `ggplot2` implementation](https://ggplot2-book.org/facet.html#facet-wrap) by defaulting to show axes (with tick marks) for all facets, as well as providing `scales`, `nrow` and `ncol` arguments that the user can use to specify whether the scales should be the same across facets and how many rows or columns to use. It also updates the faceting code to avoid duplicating legend entries when [grouped legends](hail-is#12254) are used, and to disable interactivity accordingly.
iris-garden
added a commit
to iris-garden/hail
that referenced
this pull request
Nov 23, 2022
CHANGELOG: Added support for `scales`, `nrow`, and `ncol` arguments, as well as grouped legends, to `hail.ggplot.facet_wrap`. This change brings the `facet_wrap` interface more in line with [the `ggplot2` implementation](https://ggplot2-book.org/facet.html#facet-wrap) by defaulting to show axes (with tick marks) for all facets, as well as providing `scales`, `nrow` and `ncol` arguments that the user can use to specify whether the scales should be the same across facets and how many rows or columns to use. It also updates the faceting code to avoid duplicating legend entries when [grouped legends](hail-is#12254) are used, and to disable interactivity accordingly.
iris-garden
added a commit
to iris-garden/hail
that referenced
this pull request
Nov 23, 2022
CHANGELOG: Added support for `scales`, `nrow`, and `ncol` arguments, as well as grouped legends, to `hail.ggplot.facet_wrap`. This change brings the `facet_wrap` interface more in line with [the `ggplot2` implementation](https://ggplot2-book.org/facet.html#facet-wrap) by defaulting to show axes (with tick marks) for all facets, as well as providing `scales`, `nrow` and `ncol` arguments that the user can use to specify whether the scales should be the same across facets and how many rows or columns to use. It also updates the faceting code to avoid duplicating legend entries when [grouped legends](hail-is#12254) are used, and to disable interactivity accordingly.
iris-garden
added a commit
to iris-garden/hail
that referenced
this pull request
Nov 28, 2022
CHANGELOG: Added support for `scales`, `nrow`, and `ncol` arguments, as well as grouped legends, to `hail.ggplot.facet_wrap`. This change brings the `facet_wrap` interface more in line with [the `ggplot2` implementation](https://ggplot2-book.org/facet.html#facet-wrap) by defaulting to show axes (with tick marks) for all facets, as well as providing `scales`, `nrow` and `ncol` arguments that the user can use to specify whether the scales should be the same across facets and how many rows or columns to use. It also updates the faceting code to avoid duplicating legend entries when [grouped legends](hail-is#12254) are used, and to disable interactivity accordingly.
iris-garden
added a commit
to iris-garden/hail
that referenced
this pull request
Nov 28, 2022
CHANGELOG: Added support for `scales`, `nrow`, and `ncol` arguments, as well as grouped legends, to `hail.ggplot.facet_wrap`. This change brings the `facet_wrap` interface more in line with [the `ggplot2` implementation](https://ggplot2-book.org/facet.html#facet-wrap) by defaulting to show axes (with tick marks) for all facets, as well as providing `scales`, `nrow` and `ncol` arguments that the user can use to specify whether the scales should be the same across facets and how many rows or columns to use. It also updates the faceting code to avoid duplicating legend entries when [grouped legends](hail-is#12254) are used, and to disable interactivity accordingly.
iris-garden
added a commit
to iris-garden/hail
that referenced
this pull request
Nov 28, 2022
CHANGELOG: Added support for `scales`, `nrow`, and `ncol` arguments, as well as grouped legends, to `hail.ggplot.facet_wrap`. This change brings the `facet_wrap` interface more in line with [the `ggplot2` implementation](https://ggplot2-book.org/facet.html#facet-wrap) by defaulting to show axes (with tick marks) for all facets, as well as providing `scales`, `nrow` and `ncol` arguments that the user can use to specify whether the scales should be the same across facets and how many rows or columns to use. It also updates the faceting code to avoid duplicating legend entries when [grouped legends](hail-is#12254) are used, and to disable interactivity accordingly.
iris-garden
added a commit
to iris-garden/hail
that referenced
this pull request
Nov 29, 2022
CHANGELOG: Added support for `scales`, `nrow`, and `ncol` arguments, as well as grouped legends, to `hail.ggplot.facet_wrap`. This change brings the `facet_wrap` interface more in line with [the `ggplot2` implementation](https://ggplot2-book.org/facet.html#facet-wrap) by defaulting to show axes (with tick marks) for all facets, as well as providing `scales`, `nrow` and `ncol` arguments that the user can use to specify whether the scales should be the same across facets and how many rows or columns to use. It also updates the faceting code to avoid duplicating legend entries when [grouped legends](hail-is#12254) are used, and to disable interactivity accordingly.
iris-garden
added a commit
to iris-garden/hail
that referenced
this pull request
Nov 29, 2022
CHANGELOG: Added support for `scales`, `nrow`, and `ncol` arguments, as well as grouped legends, to `hail.ggplot.facet_wrap`. This change brings the `facet_wrap` interface more in line with [the `ggplot2` implementation](https://ggplot2-book.org/facet.html#facet-wrap) by defaulting to show axes (with tick marks) for all facets, as well as providing `scales`, `nrow` and `ncol` arguments that the user can use to specify whether the scales should be the same across facets and how many rows or columns to use. It also updates the faceting code to avoid duplicating legend entries when [grouped legends](hail-is#12254) are used, and to disable interactivity accordingly.
iris-garden
added a commit
to iris-garden/hail
that referenced
this pull request
Nov 29, 2022
CHANGELOG: Added support for `scales`, `nrow`, and `ncol` arguments, as well as grouped legends, to `hail.ggplot.facet_wrap`. This change brings the `facet_wrap` interface more in line with [the `ggplot2` implementation](https://ggplot2-book.org/facet.html#facet-wrap) by defaulting to show axes (with tick marks) for all facets, as well as providing `scales`, `nrow` and `ncol` arguments that the user can use to specify whether the scales should be the same across facets and how many rows or columns to use. It also updates the faceting code to avoid duplicating legend entries when [grouped legends](hail-is#12254) are used, and to disable interactivity accordingly.
iris-garden
added a commit
to iris-garden/hail
that referenced
this pull request
Nov 30, 2022
CHANGELOG: Added support for `scales`, `nrow`, and `ncol` arguments, as well as grouped legends, to `hail.ggplot.facet_wrap`. This change brings the `facet_wrap` interface more in line with [the `ggplot2` implementation](https://ggplot2-book.org/facet.html#facet-wrap) by defaulting to show axes (with tick marks) for all facets, as well as providing `scales`, `nrow` and `ncol` arguments that the user can use to specify whether the scales should be the same across facets and how many rows or columns to use. It also updates the faceting code to avoid duplicating legend entries when [grouped legends](hail-is#12254) are used, and to disable interactivity accordingly.
danking
pushed a commit
that referenced
this pull request
Dec 1, 2022
CHANGELOG: Added support for `scales`, `nrow`, and `ncol` arguments, as well as grouped legends, to `hail.ggplot.facet_wrap`. This change brings the `facet_wrap` interface more in line with [the `ggplot2` implementation](https://ggplot2-book.org/facet.html#facet-wrap) by defaulting to show axes (with tick marks) for all facets, as well as providing `scales`, `nrow` and `ncol` arguments that the user can use to specify whether the scales should be the same across facets and how many rows or columns to use. It also updates the faceting code to avoid duplicating legend entries when [grouped legends](#12254) are used, and to disable interactivity accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently,
hail.ggplot.geom_pointgenerates cross-product-style legends when theshapeandcoloraesthetics each have multiple groups. This change makes that behavior consistent withggplot2's implementation, producing legends where the groups are factored out. Because the strategy used to accomplish this does not preserve the interactive features of the legends, such as toggling groups' visibility, this change also makes all plots generated viahail.ggplot.geom_pointstatic.For example, before this change, this code:
Generates this legend:
After the change, this legend is generated:
Custom labels can be used by updating the code like so:
Generating this legend:
For more information on the current behavior, see #12244 and #12207.