Skip to content

feat: draw quivers with GraphViz via to_dot and a package extension#42

Open
pbelmans wants to merge 1 commit into
mainfrom
feat/visualize-quiver
Open

feat: draw quivers with GraphViz via to_dot and a package extension#42
pbelmans wants to merge 1 commit into
mainfrom
feat/visualize-quiver

Conversation

@pbelmans

Copy link
Copy Markdown
Member

What

Adds quiver visualization to QuiverTools. Parallel arrows and loops (a quiver's defining features) are drawn as themselves rather than collapsed to a single labelled edge.

API

  • to_dot(Q) returns a Graphviz DOT string. It is dependency-free and lives in the core package: one i -> j line per arrow, self-loops spread around their vertex with compass ports, and isolated vertices emitted explicitly.
  • using GraphViz activates a package extension that makes a Quiver display as an SVG drawing inline in notebooks (Pluto, IJulia) and VS Code.
  • draw(Q), from the REPL, renders the quiver and opens it in the system's default viewer, returning the temporary file path.

Design

  • The extension (ext/QuiverToolsGraphVizExt.jl) mirrors the existing Oscar extension. GraphViz is a weak dependency, so a plain using QuiverTools never loads a graphics binary; to_dot is always available, while the SVG show method and draw activate only once GraphViz is loaded.
  • Graphviz_jll is pinned to >= 2.50. Without the pin the resolver can select an older build whose libgvc binding is undefined, which crashes using GraphViz with a cryptic error.

Tests and docs

  • A to_dot testset covers arrow bookkeeping, port-spaced loops, and the no-arrow (isolated vertices) edge case; the exact output is locked by doctests.
  • Docstrings for to_dot and draw are added to the Quivers manual page.

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