Plot an interactive MTG

# S3 method for mtg
plotly_mtg(mtg, ..., .scale = NULL, .angle = 45, .phylotaxy = TRUE)

# S3 method for Node
plotly_mtg(mtg, ..., .scale = NULL, .angle = 45, .phylotaxy = TRUE)

plotly_mtg(mtg, ..., .scale = NULL, .angle = 45, .phylotaxy = TRUE)

Arguments

mtg

An MTG, as from read_mtg()

...

Names of the variables to be added to the tooltip (see details and examples).

.scale

The scale required for plotting

.angle

Insertion angle when branching

.phylotaxy

Is phylotaxy required ? Uses 180 degrees if TRUE.

Value

A plotly object of the MTG

Details

The name of each argument in ... will be the name of a the variable given in the tooltip, and the value will be the value of the corresponding variable given as value. The arguments in ... are automatically quoted and evaluated in the context of the mtg. They support unquoting and splicing. See the chapter about metaprogramming in the book "Advanced R" from H. Wickham for an introduction to these concepts.

See also

mutate_mtg() to compute variables and add it to the tooltip with ....

Examples

filepath= system.file("extdata", "simple_plant.mtg", package = "XploRer") MTG= read_mtg(filepath)
#> Warning: the condition has length > 1 and only the first element will be used
#> Warning: the condition has length > 1 and only the first element will be used
#> Warning: the condition has length > 1 and only the first element will be used
#> Warning: the condition has length > 1 and only the first element will be used
plotly_mtg(MTG) # We can add more information to the tooltip, e.g. the values of the Length column: plotly_mtg(MTG, Length) # We can also use custom names for the variable in the tooltip: plotly_mtg(MTG, node_width = Width) # Here the tooltip will show the Width, labeled as "node_width"