Skip to content

Commit

Permalink
Merge pull request #147 from uclahs-cds/hwinata-add-polygon-parameters
Browse files Browse the repository at this point in the history
add polygon params
  • Loading branch information
whelena authored Oct 2, 2024
2 parents 93769a9 + 4241872 commit 609e27a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Documentation for heatmaps and clone-genome distribution plot
* Option to disable node drawing with node-by-node control
* Node-by-node control of node size
* Add parameters to specify polygon shape and width.

## Update
* Fixed angle calculation bug where child angles do not follow
Expand Down
8 changes: 4 additions & 4 deletions R/SRCGrob.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ SRCGrob <- function(
add.normal = FALSE,
use.radians = FALSE,
normal.cex = 1,
sig.shape = 3,
label.nodes = TRUE,
disable.polygons = FALSE,
polygon.shape = 3,
polygon.width = 1.2,
length.from.node.edge = TRUE,
size.units = 'npc'
) {
Expand All @@ -49,7 +50,6 @@ SRCGrob <- function(

fixed.angle <- pi / 6;
min.width <- get.plot.width(horizontal.padding);
wid <- 1.2;
spread <- 1;
cluster.list <- NULL;
node.radius <- 0.1;
Expand Down Expand Up @@ -80,11 +80,11 @@ SRCGrob <- function(
scale1 = scale1,
scale2 = scale2,
yat = yat,
wid = wid,
wid = polygon.width,
length.from.node.edge = length.from.node.edge,
default.branch.width = 4,
add.polygons = add.polygons,
sig.shape = sig.shape,
sig.shape = polygon.shape,
spread = spread,
fixed.angle = fixed.angle,
add.node.text = add.node.text,
Expand Down
10 changes: 6 additions & 4 deletions man/SRCGrob.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ SRCGrob(
add.normal = FALSE,
use.radians = FALSE,
normal.cex = 1,
sig.shape = 3,
label.nodes = TRUE,
disable.polygons = FALSE,
polygon.shape = 3,
polygon.width = 1.2,
length.from.node.edge = TRUE,
size.units = "npc"
);
Expand Down Expand Up @@ -73,12 +74,13 @@ SRCGrob(
\item{add.normal}{Adds a normal}
\item{use.radians}{Unit to be used for "angle" column (degrees or radians)}
\item{normal.cex}{Font size within the normal "box"}
\item{sig.shape}{
\item{label.nodes}{Enable/disable node labels}
\item{disable.polygons}{Disables CP polygon drawing (even when CP values are provided)}
\item{polygon.shape}{
Changes the shape of the CP shading.
Lower values are smoother.
}
\item{label.nodes}{Enable/disable node labels}
\item{disable.polygons}{Disables CP polygon drawing (even when CP values are provided)}
\item{polygon.width}{Width of the CP shading}
\item{length.from.node.edge}{
Sets the branch length to be calculated from the edge of the node instead of the centre
}
Expand Down

0 comments on commit 609e27a

Please sign in to comment.