How can I left-align text in DiagrammeR::graphviz() when I use HTML code?
I need to insert bullet points, venus and mars signs into the nodes, and I have only been able to do this using HTML.
I can find several posts describing how to left-align when not using HTML (\\l), but I can't find any posts on how to do it using HTML.
How can I left-align the text in the nodes when using HTML?
Reprex:
```{r}
DiagrammeR::grViz("
digraph rmarkdown{
# Box
node [shape = box
fontname = Helvetica,
penwidth = 1.0,
fixedsize = true,
width = 3,
height = 1]
A;
A[label =
<
Top row<br/>
• Bullet one<br/>
• Bullet two with more words<br/>
♀ A venus sign
>]
}
")
```
I found an answer here: https://www.graphviz.org/doc/info/shapes.html
You need to insert the line ALIGN = 'LEFT' in the HTML line break code.
See below:
DiagrammeR::grViz("
digraph rmarkdown{
# Box
node [shape = box]
A;
A[label =
<
Top row<br ALIGN = 'LEFT'/>
• Bullet one<br ALIGN = 'LEFT'/>
• Bullet two with more words<br ALIGN = 'LEFT'/>
♀ A venus sign <br ALIGN = 'LEFT' />
>
]
}
")
```