makegvflow | R Documentation |
Takes a character string or vector and creates a graphviz
flowchart from the
hierarchy indicated by the number of indended spaces in each line. The text
for the root levels is not indented, and major, minor, and tiny levels are indented
2, 4, or 6 spaces, respectively. Default color, font size, and fill color are
chosen so that the chart is suitable for presentations. Simple $LaTeX$ math
markup is converted to simple HTML markup using tth::tth()
. Text lines
are automatically wrapped to keep text boxes from being too wide. Text lines
beginning with "+" are combined with the previous major, minor, or tiny text line
but separated by a double line break (single break if lbdouble=FALSE
).
makegvflow(
.object.,
...,
direction = c("TD", "LR"),
style = "filled",
shape = "box",
font = "Times-Roman",
fontsize = 18,
fontcolor = "blue",
fillcolor = "azure",
penwidth = 0.1,
arrowcolor = "blue3",
arrowsize = 0.7,
width = 30,
lbdouble = TRUE,
extracon = NULL,
file,
onlyprint = FALSE
)
.object. |
character string or vector of plain text plus possible $LaTeX$ math delimited by single dollar signs. An empty initial line is ignore, so the user need not worry about having an initial quote mark on a line by itself. |
... |
name=value pairs that makes values replace |
direction |
direction of the flow chart, default is top-down |
style |
node style |
shape |
node shape |
font |
font for text in nodes |
fontsize |
text font size |
fontcolor |
text color |
fillcolor |
node fill color |
penwidth |
thickness of lines for node borders |
arrowcolor |
arrow color |
arrowsize |
arrow size |
width |
text width for word-wrapping |
lbdouble |
set to |
extracon |
one or more text strings specifying extra connections between nodes using node names |
file |
name of file to hold |
onlyprint |
set to ```{dot} //| label: fig-flow1 //| fig-height: 4 //| fig-cap: "Chart caption" //| file: graphviz.dot ``` |
The function uses knitr::knit_expand()
to apply variable insertions before the diagram is rendered by Quarto. See this for an example. ##' @title makegvflow
nothing; used to knitr::knit_expand()
graphviz markup
Frank Harrell
makegraphviz()
x <- '
Root text
Major 1
Minor 11 {{jj}}
Minor 12
Major 2
Minor 21
Minor 22
Minor 23 that is very very long and just keeps going
tiny 231 and $\\alph + \\sum_{i=1}^{n}X_{i}$
tiny 232
+ a second line for tiny 232 that is pretty long
+ a third line for tiny 232
Major 3
Minor 31
tiny 311'
makegvflow(x, extracon='n12 -> n21', jj='tiger', onlyprint=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.