Description Usage Arguments Details Value See Also Examples
Plot an interactive MTG
1 2 3 4 5 6 7 | ## S3 method for class 'mtg'
plotly_mtg(mtg, ..., .scale = NULL, .angle = 45, .phylotaxy = TRUE)
## S3 method for class 'Node'
plotly_mtg(mtg, ..., .scale = NULL, .angle = 45, .phylotaxy = TRUE)
plotly_mtg(mtg, ..., .scale = NULL, .angle = 45, .phylotaxy = TRUE)
|
mtg |
An MTG, as from |
... |
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 |
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.
A plotly object of the MTG
mutate_mtg()
to compute variables and add it to the tooltip with ...
.
1 2 3 4 5 6 7 8 9 10 | filepath= system.file("extdata", "simple_plant.mtg", package = "XploRer")
MTG= read_mtg(filepath)
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"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.