You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ext/CatalystGraphMakieExtension/rn_graph_plot.jl
+79-45Lines changed: 79 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,22 @@
3
3
#############
4
4
5
5
"""
6
-
SRGraphWrap{T}
6
+
MultiGraphWrap{T}
7
7
8
-
Wrapper for the species-reaction graph containing edges for rate-dependence on species. Intended to allow plotting of multiple edges.
8
+
Wrapper intended to allow plotting of multiple edges. This is needed in the following cases:
9
+
- For the species-reaction graph, multiple edges can exist when a reaction depends on some species for its rate, and if that species is produced by the reaction.
10
+
- For the complex graph, multiple edges can exist between a pair of nodes if there are multiple reactions between the same complexes. This might include a reversible pair of reactions - we might have three total edges if one reaction is reversible, and we have a separate reaction going from one complex to the other.
11
+
12
+
`gen_distances` sets the distances between the edges that allows multiple to be visible on the plot at the same time.
9
13
"""
10
-
structSRGraphWrap{T} <:Graphs.AbstractGraph{T}
14
+
structMultiGraphWrap{T} <:Graphs.AbstractGraph{T}
11
15
g::SimpleDiGraph{T}
12
-
rateedges::Vector{Graphs.SimpleEdge{T}}
16
+
multiedges::Vector{Graphs.SimpleEdge{T}}
13
17
edgeorder::Vector{Int64}
14
18
end
15
19
16
-
# Create the SimpleDiGraph corresponding to the species and reactions
17
-
functionSRGraphWrap(rn::ReactionSystem)
20
+
# Create the SimpleDiGraph corresponding to the species and reactions, the species-reaction graph
21
+
functionMultiGraphWrap(rn::ReactionSystem)
18
22
srg =species_reaction_graph(rn)
19
23
rateedges =Vector{Graphs.SimpleEdge{Int}}()
20
24
sm =speciesmap(rn); specs =species(rn)
@@ -32,33 +36,46 @@ function SRGraphWrap(rn::ReactionSystem)
0 commit comments