Render targets pipeline as a vertical mermaid diagram for knitr
Source:R/tasks_mermaid.R
knit_targets_mermaid.RdThis function generates a mermaid diagram from a targets pipeline, modifies the direction from left-to-right (LR) to top-to-bottom (TB), and returns it as knitr asis output for embedding in R Markdown or Quarto documents.
Value
A character string formatted for knitr asis output containing the mermaid diagram with interactive tooltips.
Details
The diagram includes a config block (see the top of the output) that sets node and rank spacing for improved layout. The function also injects custom CSS and JS for zooming, panning, and interactive tooltips.
If a target in the pipeline has a `description` field in the manifest, it will be shown as a tooltip when hovering over the node. Descriptions are parsed as markdown (if the `markdown` package is installed) and rendered as HTML, so you can use formatting, links, and other markdown features in your tooltips.