uclahs-cds / package-CancerEvolutionVisualization

Publication Quality Phylogenetic Tree Plots
https://cran.r-project.org/web/packages/CancerEvolutionVisualization/
GNU General Public License v2.0
2 stars 0 forks source link

Override branch angles #86

Closed dan-knight closed 11 months ago

dan-knight commented 1 year ago

Description

Closes #93: These changes allow optional angle overrides in tree input. These overrides do not affect the angle calculations (or, in other words, other angles are not calculated in relation to overridden angles). A new angle.unit parameter was added to the top-level SRCGrob function to allow angles to be specified in either radians or degrees.

Default Angles

Screenshot 2023-09-25 at 9 41 59 AM
tree.df <- data.frame(
    parent = c(NA, 1, 2, 2)
    );

tree.plot <- SRCGrob(tree.df);
grid.draw(tree.plot);

With Angle Override

Screenshot 2023-09-25 at 9 41 25 AM
tree.df <- data.frame(
    parent = c(NA, 1, 2, 2),
    angle = c(NA, NA, 90, NA)
    );

tree.plot <- SRCGrob(tree.df);
grid.draw(tree.plot);

  To automatically exclude such files using a .gitignore file, see here for example.

whelena commented 1 year ago

Why did the R-CMD-check failed? It seems there's a mismatch in the documentation?

dan-knight commented 1 year ago

It seems there's a mismatch in the documentation?

Ah, yep. I added a parameter to SRCGrob. Easy fix - on it.