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)Use less chrome
Section titled “Use less chrome”Keep only the minimap or toolbar when the graph is part of a document:
garphield(edges, chrome = "minimap")Write an HTML file
Section titled “Write an HTML file”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.
Use another renderer
Section titled “Use another renderer”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.