Mermaid Diagrams in R

A nice tool to have at your disposal is a method for quickly making a connected graph diagram in your markdown. It may be a workflow you are trying to show or something an org chart or whatever. One thing that I've recently learned to through [Obsidian](https::// as I develop my second brain (I call it my *brainforest*) is that you can easily insert mermaid charts into markdown and have them render properly. In R, it is the same, though we have a few tricks we need to use so that it looks nice.


A `mermaid` chart is a simple textual representation of nodes and connections denoted as a string. There is a top down graph-like flowchart.

mermaid("graph TD; 
	A[Start] --> B{Is it?}; 
	B -- Yes --> C[OK]; 
	C --> D[Rethink]; 
	D --> B; 
	B -- No --> E[End];")

The thing that I find a bit of a pain (in RMarkdown though apparently not here in blogdown) is that the box around the plot in RMarkdown is a bit too large. To correct for that, we need to add to the function call that the diagram needs to take up 100% of the space.

mermaid("graph LR; 
A(Process 1)-->B(Process 2);

So that it all fits together.