Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
vyudu committed Nov 16, 2024
1 parent ef0635f commit a46a0c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
14 changes: 3 additions & 11 deletions ext/CatalystGraphMakieExtension/rn_graph_plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,12 @@ function gen_distances(g::SRGraphWrap; inc = 0.2)
distances
end

"""
plot_petrinet(rn::ReactionSystem)
See the documentation for [`plot_network`](@ref).
"""
function Catalyst.plot_petrinet(rn::ReactionSystem)
plot_network(rn)
end

"""
plot_network(rn::ReactionSystem; interactive=false)
Converts a [`ReactionSystem`](@ref) into a GraphMakie plot of the species reaction graph.
Reactions correspond to small green circles, and species to blue circles.
Converts a [`ReactionSystem`](@ref) into a GraphMakie plot of the species reaction graph
(or Petri net representation). Reactions correspond to small green circles, and
species to blue circles.
Notes:
- Black arrows from species to reactions indicate reactants, and are labelled
Expand Down
9 changes: 6 additions & 3 deletions src/network_analysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,12 @@ end
species_reaction_graph(rn::ReactionSystem)
Construct a directed simple graph where there are two types of nodes: species and reactions.
An edge from a species *s* to reaction *r* indicates that *s* is a reactant for *r*, and an edge from a reaction
r to a species s indicates that *s* is a product of *r*. By default, the species vertices are listed
first, so the first *n* indices correspond to species nodes.
An edge from a species *s* to reaction *r* indicates that *s* is a reactant for *r*, and
an edge from a reaction *r* to a species *s* indicates that *s* is a product of *r*. By
default, the species vertices are listed first, so the first *n* indices correspond to
species nodes.
Note: this is equivalent to the Petri net representation of a chemical reaction network.
For example,
```julia
Expand Down

0 comments on commit a46a0c5

Please sign in to comment.