Skip to content
Open Garphield

RStudio, Quarto, and R Markdown

garphield() returns an htmlwidget, so the same call works in the RStudio or Positron Viewer and in HTML output from Quarto or R Markdown.

library(garphieldr)
edges <- data.frame(source = c("a", "b"), target = c("b", "c"))
garphield(edges)

Keep only the minimap or toolbar when the graph is part of a document:

garphield(edges, chrome = "minimap")
project <- garphield_project(edges = edges)
save_garphield_html(project, "network.html", chrome = "minimap")

The file contains the project and loads the configured Garphield embed. You can serve it without the originating R process.

Pass an absolute URL ending in /embed:

garphield(edges, embed_url = "http://localhost:4173/embed")

Use Shiny when node clicks or R-side updates should move through a live session. The igraph to Quarto and Shiny tutorial walks through both.