Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to graph plotting #1140

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

vyudu
Copy link
Collaborator

@vyudu vyudu commented Nov 27, 2024

Using Stress() by default (if connected) to reduce edge crossings, adding support for kwargs, refactoring some code. Graph comparison below (after/before)
graph
display

Copy link
Member

@isaacsas isaacsas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vyudu, feel free to merge after addressing my comments.

@@ -14,13 +14,13 @@ Wrapper intended to allow plotting of multiple edges. This is needed in the foll
struct MultiGraphWrap{T} <: Graphs.AbstractGraph{T}
g::SimpleDiGraph{T}
multiedges::Vector{Graphs.SimpleEdge{T}}
edgeorder::Vector{Int64}
edgeorder::Vector{Int64} # sets the drawing order of the edges. Needed because multiedges need to be consecutive to be drawn properly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
edgeorder::Vector{Int64} # sets the drawing order of the edges. Needed because multiedges need to be consecutive to be drawn properly.
"""sets the drawing order of the edges. Needed because multiedges need to be consecutive to be drawn properly."""
edgeorder::Vector{Int64}

# Return the multigraph and reaction order corresponding to the complex graph. The reaction order is the order of reactions(rn) that would match the edge order given by g.edgeorder.
function ComplexGraphWrap(rn::ReactionSystem)
img = incidencematgraph(rn); D = incidencemat(rn; sparse=true)
specs = species(rn); rxs = reactions(rn)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
specs = species(rn); rxs = reactions(rn)
specs = species(rn)
rxs = reactions(rn)

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.

2 participants