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

Layer wrapper that allows arbitrary geometries to be used with the thickness aesthetic #217

Open
mjskay opened this issue Feb 27, 2024 · 1 comment

Comments

@mjskay
Copy link
Owner

mjskay commented Feb 27, 2024

Might be nice to allow arbitrary geometries to be used with the thickness aesthetic... probably something that wraps the layers and applies the thickness scaling to thickness values and then adds them to x or y as appropriate....

  • would only work with scale_thickness_shared()
  • would need some way to specify which aesthetics to add the thickness to --- maybe if thickness values are scaled relative to 0 this would just be solved by something like after_scale(y = y + thickness)? Not sure if justification and side would work correctly in this case though. So might need to just pass a set of aesthetics to add the thickness to.
  • would ideally handle side and justification
  • ideally something like with_thickness(geom_text(aes(xdist = d, y = some_factor, thickness = density(d, Mode(d))), label = "mode")) would work, though it might be hard to get there.
@mjskay mjskay changed the title Layer wrapping that allows arbitrary geometries to be used with the thickness aesthetic Layer wrapper that allows arbitrary geometries to be used with the thickness aesthetic Feb 27, 2024
@mjskay
Copy link
Owner Author

mjskay commented Feb 27, 2024

There's also a small set of geoms in addition to geom_spike that might be useful to have explicitly:

  • a horizontal line from the axis to a thickness value
  • a text label at a thickness value
  • a horizontal line between two equal thickness values (harder; simpler might be a line between two thickness values)

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

No branches or pull requests

1 participant