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

Request to add roundrect.r option to layout.params #596

Open
8 tasks
n8layman opened this issue Dec 21, 2023 · 1 comment
Open
8 tasks

Request to add roundrect.r option to layout.params #596

n8layman opened this issue Dec 21, 2023 · 1 comment

Comments

@n8layman
Copy link

Prerequisites

  • Have you read Feedback and follow the guide?
    • make sure your are using the latest release version
    • read the documents
    • google your question/issue

Describe you issue

  • Make a reproducible example (e.g. 1)
  • your code should contain comments to describe the problem (e.g. what expected and actually happened?)

Ask in right place

  • for bugs or feature requests, post here (github issue)
  • for questions, please post to google group

It would be very useful to be able to modify the curvature of the tree when using the roundrect layout. For example to add just a little bit of curvature but not as much as is the default. Perhaps by modifying a roundrect.r layout parameter similar to what is available in geom_hilight. Please forgive me if this is already possible, I was unable to find any method after looking through the issues, discussion, google group, or code.

@xiangpin
Copy link
Member

you can use shape argument (default is 0.5, should be a numeric vector of values between -1 and 1) to control the radius of the rounded corners when layout='roundrect'.

for example

library(ggtree)
set.seet(123)
tree <- rtree(10)
p1 <- tree |> ggtree(layout='roundrect')
p2 <- tree |> ggtree(layout='roundrect', shape=.25)

image

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

2 participants