GraphPlot rewritten as a layout engine; new HypergraphPlot ; v0.237 - #83
Merged
Merged
Conversation
GraphPlot was a minimal version: every vertex on a circle, directed edges as plain lines, axes on. It is now a deterministic layout engine (src/graph/glayout.c) plus a drawing layer: - Default layouts: stress majorization (SMACOF on BFS distances, from a Pivot MDS start, with circle/Tutte starts and a crossing count for small components), tidy layered trees, and layered DAGs (dummy vertices, barycentre ordering). Components are shelf-packed. - GraphLayout -> "StressEmbedding" | "SpringElectricalEmbedding" | "CircularEmbedding" | "LayeredEmbedding" | "LayeredDigraphEmbedding" | "BipartiteEmbedding" | "GridEmbedding". - Options: VertexCoordinates (list or rules), VertexLabels (placed in the widest gap), GraphHighlight, VertexStyle, EdgeStyle, EdgeLabels (including "EdgeWeight"), VertexSize. Other options pass through to Graphics. - Directed edges become Arrows that stop at the target disk; mutual pairs are offset. HypergraphPlot (new) draws each hyperedge as an inflated convex hull (translucent), a size-2 hyperedge as a stadium and a size-1 hyperedge as a ring, over a stress layout of the star expansion. PDF export gains Text offsets and Text[Style[...]] size/colour, the Arrowheads directive with clipped shafts, and equal scaling for an explicit AspectRatio -> Automatic. New graphplot_tests covers determinism, every layout and option, degenerate graphs and 500-1500 vertex graphs; leaks reports 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GraphPlot was minimal: every vertex on a circle, directed edges drawn as plain lines, axes on. This rewrites it as a deterministic layout engine (
src/graph/glayout.c) plus a drawing layer, and adds HypergraphPlot. v0.237.Changes
GraphLayout -> "StressEmbedding" | "SpringElectricalEmbedding" | "CircularEmbedding" | "LayeredEmbedding" | "LayeredDigraphEmbedding" | "BipartiteEmbedding" | "GridEmbedding".VertexCoordinates(list or rules),VertexLabels(placed in the widest gap),GraphHighlight,VertexStyle,EdgeStyle,EdgeLabels(including"EdgeWeight"),VertexSize. Any other option passes through toGraphics.Arrows that stop at the target disk; mutual pairs are offset.HypergraphPlot: each hyperedge is drawn as an inflated translucent convex hull, a size-2 hyperedge as a stadium and a size-1 hyperedge as a ring, over a stress layout of the star expansion.Textoffsets,Text[Style[...]]size/colour, theArrowheadsdirective with clipped shafts, and equal scaling for an explicitAspectRatio -> Automatic.graphs.md,hypergraphs.md,file-io.mdand the 2026-09-28 changelog.Testing
graphplot_testscovers determinism, every layout and option, degenerate graphs, and graphs with 500–1500 vertices.leaksreports 0.JIRA Ticket
N/A