Closed zmeers closed 6 years ago
yeah completely agree. It should also allow stuff like gganimation/tweenr stuff to be integrated easier 👍
I think we'll have to write our code using tidyeval (https://dplyr.tidyverse.org/articles/programming.html, http://ggplot2.tidyverse.org/articles/extending-ggplot2.html#creating-a-new-geom). I've never used tidyeval before... So we'll see how it goes.
one thing that I'm not sure is needed or even desirable, but in terms of using geoms, might be interesting if there are any parliaments that have (e.g.) one chamber of arcs vs. one chamber of benches.
Could be interesting to try and get that working using facets a la https://stackoverflow.com/questions/7903972/can-you-specify-different-geoms-for-different-facets-in-a-ggplot
Regarding creating new types of faceting, read https://cran.r-project.org/web/packages/ggplot2/vignettes/extending-ggplot2.html
I'd like to get the opposition benches working in the new geom before we merge with the master branch. And I think when we merge, we should update the version of the package.
I think we should consider breaking down
ggparliament()
into separate geoms. This will give the user more flexibility over the final product and it should more like an extension to ggplot2 instead of a separate plotting system. Moreover, breaking the monolithic functions into separate geoms gives us the opportunity to create additional functions for data preparation and scales for party colours.The user will have the ability to pick and choose separate parts of the package AND they won't have to learn entirely new parameters as the ggplot2 syntax should be relatively familiar to them already. I'm proposing that we do the following (they are just examples and I'm open to change!):
geom_parliament_dots(aes(x=x,y=y,group=group), type=c('u-shape', 'hemicircle', 'bench'), ...)
geom_parliament_waffle()
geom_parliament_rose()
geom_parliament_arc()
geom_parliament_bar()
parliament_data(transform=c('dots', 'waffle', 'rose', 'arc', 'bar')
scale_colour_party(country="Australia")
scale_fill_party()