Quarto 1.4 adds Mermaid and Graphviz

R Programming and Python users can now create documents with visuals and graphs created in Mermaid and Graphviz

Pierre DeBois
CodeX

--

So Posit continues to offer upgrades to Quarto, particularly now that 1.4 has been released.

Two new intriguing visualization options are available to be rendered in a Quarto document. The two visualization formats are Mermaid, a JavaScript-based diagram framework, and Graphviz, an open-source graphic software for the visualization of structural information. The syntax of both can be created within a Quarto chunk the same way R and Python appear in a Quarto document.

Mermaid

The Mermaid library is designed for crafting the type of chart you want, then describing the relationship between each node, which then, in turn, is used to craft the graph.

The Mermaid chunk is called through using the phrase “mermaid” instead of “r”. You can then use the mermaid syntax to create the visual you want.

Let’s look at an example of a Mermaid chunk. It was created to match a short R chunk that multiplies x and y depending on the value of y being above the value 15. Below is the R programming…

--

--

Pierre DeBois
CodeX
Writer for

#analytics |#datascience |#JS |#rstats |#marketing services for #smallbiz | #retail | #nonprofits Contrib @CMSWire @smallbiztrends #blackbusiness #BLM