Skip to content

Add graph_svg(), fn_graph(), pkg_graph()#21

Merged
TroyHernandez merged 2 commits into
mainfrom
add-graph-viz
Apr 24, 2026
Merged

Add graph_svg(), fn_graph(), pkg_graph()#21
TroyHernandez merged 2 commits into
mainfrom
add-graph-viz

Conversation

@TroyHernandez
Copy link
Copy Markdown
Contributor

Summary

Force-directed SVG graph rendering for code-analysis results. No new dependencies.

  • graph_svg(edges, nodes, ...) — base R Fruchterman-Reingold layout with gravity toward center, emits static SVG. Hover tooltips via `<title>` (multi-line through ` `), click-to-navigate via ``, CSS `:hover` highlighting. Defaults 1200x900.
  • fn_graph(project_dir) — function call graph via `symbols()`. Tooltips carry file:line, visibility (exported/internal/external), and degree counts.
  • pkg_graph(scan_dir) — package dependency graph via `projects()`. Tooltips carry title + version + dep counts. Optional `include_suggests = TRUE`.

Bumps 0.4.0 → 0.5.0.

⚠ The blast-radius-documentation branch also bumps to 0.5.0; whoever merges second will need to re-bump.

Test plan

  • 132 tinytest results pass locally
  • Smoke tested against pensar (function graph) and ~/ (package graph) — SVGs in ~/Sync
  • CI (no workflow configured yet)

graph_svg() renders a static SVG force-directed graph via a base R
Fruchterman-Reingold layout with gravity toward the center so nodes
don't pile at the viewport bounds. Default 1200x900. Hover tooltips
from <title> (multi-line via &#10;), click navigation from <a xlink:href>,
CSS :hover highlighting. No JavaScript.

fn_graph(project_dir) renders internal function-call edges via
symbols(). Tooltips carry file:line, visibility (exported/internal/
external), and degree counts (called by N | calls M).

pkg_graph(scan_dir) renders package-level dependency edges via
projects(). Tooltips carry title, version, and dep counts. Optional
include_suggests = TRUE reads Suggests directly from DESCRIPTION.

Bumps 0.4.0 -> 0.5.0.
# Conflicts:
#	DESCRIPTION
@TroyHernandez TroyHernandez merged commit 8dc3239 into main Apr 24, 2026
4 checks passed
@TroyHernandez TroyHernandez deleted the add-graph-viz branch April 24, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant