Skip to contents

An HTML dependency that gives every Mermaid diagram Quarto draws on the page (each {mermaid} block, and each cc_erd()) the look and controls of the figures in the CalCOFI.io docs book: Source Sans 3 labels and curved edges, then a viewer with +/-/reset controls, drag to pan, double-click to zoom and a full-screen button (Esc closes; the mouse wheel zooms only in full screen). Quarto still draws the diagrams in the browser, so a page is the same whichever machine rendered it and no headless browser runs at render time.

Usage

cc_diagram_viewer()

Value

An htmltools::htmlDependency() (it renders nothing visible).

Details

cc_erd() attaches it by itself; call cc_diagram_viewer() in a chunk of a page that has {mermaid} blocks but no ERD. Attaching it more than once is harmless.

Examples

if (FALSE) { # \dontrun{
# in a Quarto notebook chunk
calcofi4r::cc_diagram_viewer()
} # }