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

improve add_recessions #29

Closed
3 of 4 tasks
matthewstern opened this issue Feb 25, 2020 · 3 comments
Closed
3 of 4 tasks

improve add_recessions #29

matthewstern opened this issue Feb 25, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@matthewstern
Copy link
Contributor

matthewstern commented Feb 25, 2020

  • Inherit min, max, and type (date vs int) of x axis from the primary aes, rather than specifying them again. (see ggproto, as implemented in geom_text_lastonly?)
  • cut off rectangles at highest and lowest grid lines rather than plot y axis min and max (better solution may be to define the y axis min and max as highest and lowest gridline so ymin = first gridline and ymax = last gridline).
  • not really an enhancement, but we'll need to confirm down the road that "recessions" text defaults to correct font and size once theme_cmap is applied.
  • there may be a way to improve the text_nudge_x argument's default to work better in more instances. Will need to play around.
@matthewstern matthewstern added the enhancement New feature or request label Feb 25, 2020
@matthewstern matthewstern self-assigned this Mar 4, 2020
@matthewstern
Copy link
Contributor Author

to do this I need to unpack a little bit more, and create an altered ggproto object for GeomRect that inherits data from the top-level command. See https://ggplot2-book.org/internals.html and Noel's work with last point highlighting.

@matthewstern
Copy link
Contributor Author

ggproto for rectangles is established. This inherits primary dataframe and uses that to filter the recessions. I have not yet figured out how to inherit the type of data...I am not sure this is possible.

Next step is to use the same framework to build a ggproto for text. Should be relatively straightforward.

@matthewstern
Copy link
Contributor Author

this is done. We may have to come back around to confirming fonts once theme_cmap is further along.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant