Skip to content

Commit

Permalink
Merge pull request #27 from nrennie/parse-text
Browse files Browse the repository at this point in the history
parse geom text
  • Loading branch information
nrennie committed May 22, 2023
2 parents 901c503 + e9429ee commit cdf35dc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ggflowchart
Title: Flowcharts with 'ggplot2'
Version: 1.0.0.9003
Version: 1.0.0.9004
Authors@R:
person(given = "Nicola",
family = "Rennie",
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Add contributor guidelines
* Allow `x_nudge` and `y_nudge` to vary for each node. (issue #12)
* Add option for custom layout (issue #11)
* Add option to parse text in nodes.

## ggflowchart 1.0.0 2023_05_10

Expand Down
7 changes: 6 additions & 1 deletion R/ggflowchart.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#' or hex code, or the name of a column in node_data (quoted or unquoted).
#' Column names take priority over names of colours. Default `"black"`.
#' @param text_size Font size of labels in nodes. Default 3.88.
#' @param parse If TRUE, the labels will be parsed into expressions
#' and displayed as described in ?plotmath. Default `FALSE`.
#' @param arrow_colour Colour of arrows. Must be a valid colour name or hex
#' code. Default `"black"`.
#' @param arrow_size Size of arrow head. Default 0.3.
Expand Down Expand Up @@ -54,6 +56,7 @@ ggflowchart <- function(data,
alpha = 1,
text_colour = "black",
text_size = 3.88,
parse = FALSE,
arrow_colour = "black",
arrow_size = 0.3,
arrow_linewidth = 0.5,
Expand Down Expand Up @@ -171,7 +174,8 @@ ggflowchart <- function(data,
colour = !!text_colour
),
family = family,
size = text_size
size = text_size,
parse = parse
)
} else {
p <- p +
Expand All @@ -184,6 +188,7 @@ ggflowchart <- function(data,
),
family = family,
size = text_size,
parse = parse,
colour = as.character(text_colour)
)
}
Expand Down
4 changes: 4 additions & 0 deletions man/ggflowchart.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cdf35dc

Please sign in to comment.