Skip to content

Commit 494ee45

Browse files
authored
Merge pull request #1130 from vyudu/graph-docs
GraphMakie docs update
2 parents 51b9d0b + 05fbd4f commit 494ee45

File tree

18 files changed

+164
-564
lines changed

18 files changed

+164
-564
lines changed

HISTORY.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,18 @@
4141
(k1, k2), A <--> B
4242
end
4343
```
44-
44+
- Catalyst's network visualization capability has shifted from using Graphviz to [GraphMakie.jl](https://graph.makie.org/stable/). To use this functionality, load the GraphMakie extension by installing `Catalyst` and `GraphMakie`, along with a Makie backend like `GLMakie`. There are two new methods for visualizing graphs: `plot_network` and `plot_complexes`, which respectively display the species-reaction graph and complex graph.
45+
```julia
46+
using Catalyst, GraphMakie, GLMakie
47+
brusselator = @reaction_network begin
48+
A, ∅ --> X
49+
1, 2X + Y --> 3X
50+
B, X --> Y
51+
1, X -->
52+
end
53+
plot_network(brusselator)
54+
```
55+
4556
## Catalyst 14.4.1
4657
- Support for user-defined functions on the RHS when providing coupled equations
4758
for CRNs using the @equations macro. For example, the following now works:

Project.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ julia = "1.10"
7575
[extras]
7676
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
7777
DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
78-
Graphviz_jll = "3c863552-8265-54e4-a6dc-903eb78fde85"
7978
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
8079
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
8180
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
@@ -99,4 +98,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
9998
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
10099

101100
[targets]
102-
test = ["DiffEqCallbacks", "DomainSets", "Graphviz_jll", "Logging", "NonlinearSolve", "OrdinaryDiffEqBDF", "OrdinaryDiffEqDefault", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqVerner", "Pkg", "Plots", "Random", "SafeTestsets", "SciMLBase", "SciMLNLSolve", "StableRNGs", "StaticArrays", "Statistics", "SteadyStateDiffEq", "StochasticDiffEq", "Test", "Unitful"]
101+
test = ["DiffEqCallbacks", "DomainSets", "Logging", "NonlinearSolve", "OrdinaryDiffEqBDF", "OrdinaryDiffEqDefault", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqVerner", "Pkg", "Plots", "Random", "SafeTestsets", "SciMLBase", "SciMLNLSolve", "StableRNGs", "StaticArrays", "Statistics", "SteadyStateDiffEq", "StochasticDiffEq", "Test", "Unitful"]

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
1818
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
1919
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
2020
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
21+
NetworkLayout = "46757867-2c16-5918-afeb-47bfcb05e46a"
2122
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
2223
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
2324
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"

docs/make.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using Documenter
22
using Catalyst, ModelingToolkit
3+
# Add packages for plotting
4+
using GraphMakie, CairoMakie
35

46
docpath = Base.source_dir()
57
assetpath = joinpath(docpath, "src", "assets")
@@ -37,7 +39,9 @@ makedocs(sitename = "Catalyst.jl",
3739
collapselevel = 1,
3840
assets = ["assets/favicon.ico"],
3941
canonical = "https://docs.sciml.ai/Catalyst/stable/"),
40-
modules = [Catalyst, ModelingToolkit],
42+
modules = [Catalyst, ModelingToolkit,
43+
isdefined(Base, :get_extension) ? Base.get_extension(Catalyst, :CatalystGraphMakieExtension) :
44+
Catalyst.CatalystGraphMakieExtension],
4145
doctest = false,
4246
clean = true,
4347
pages = pages,

docs/pages.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pages = Any[
4040
"Steady state analysis" => Any[
4141
"steady_state_functionality/homotopy_continuation.md",
4242
"steady_state_functionality/nonlinear_solve.md",
43-
"steady_state_functionality/steady_state_stability_computation.md",
43+
#"steady_state_functionality/steady_state_stability_computation.md",
4444
"steady_state_functionality/bifurcation_diagrams.md",
4545
"steady_state_functionality/dynamical_systems.md"
4646
],

docs/src/api.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ isequivalent
271271
==(rn1::ReactionSystem, rn2::ReactionSystem)
272272
```
273273

274-
## Network visualization
274+
## [Network visualization](@id network_visualization)
275275
[Latexify](https://korsbo.github.io/Latexify.jl/stable/) can be used to convert
276276
networks to LaTeX equations by
277277
```julia
@@ -292,13 +292,10 @@ displayed as the ODE form)
292292

293293
Finally, another optional argument (`expand_functions=true`) automatically expands functions defined by Catalyst (such as `mm`). To disable this, set `expand_functions=false`.
294294

295-
If [Graphviz](https://graphviz.org/) is installed and commandline accessible, it
296-
can be used to create and save network diagrams using [`Graph`](@ref) and
297-
[`savegraph`](@ref).
295+
Reaction networks can be plotted using the `GraphMakie` extension, which is loaded whenever all of `Catalyst`, `GraphMakie`, and `NetworkLayout` are loaded (note that a Makie backend, like `CairoMakie`, must be loaded as well). The two functions for plotting networks are `plot_network` and `plot_complexes`, which are two distinct representations.
298296
```@docs
299-
Graph
300-
complexgraph
301-
savegraph
297+
plot_network(::ReactionSystem)
298+
plot_complexes(::ReactionSystem)
302299
```
303300

304301
## [Rate laws](@id api_rate_laws)
35.6 KB
Loading
65.8 KB
Loading
61 KB
Loading

docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ etc).
2929
- Models can be [coupled with events](@ref constraint_equations_events) that affect the system and its state during simulations.
3030
- By leveraging ModelingToolkit, users have a variety of options for generating optimized system representations to use in solvers. These include construction of [dense or sparse Jacobians](@ref ode_simulation_performance_sparse_jacobian), [multithreading or parallelization of generated derivative functions](@ref ode_simulation_performance_parallelisation), [automatic classification of reactions into optimized jump types for Gillespie type simulations](https://docs.sciml.ai/JumpProcesses/stable/jump_types/#jump_types), [automatic construction of dependency graphs for jump systems](https://docs.sciml.ai/JumpProcesses/stable/jump_types/#Jump-Aggregators-Requiring-Dependency-Graphs), and more.
3131
- [Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl) symbolic expressions and Julia `Expr`s can be obtained for all rate laws and functions determining the deterministic and stochastic terms within resulting ODE, SDE, or jump models.
32-
- [Steady states](@ref homotopy_continuation) (and their [stabilities](@ref steady_state_stability)) can be computed for model ODE representations.
32+
- [Steady states](@ref homotopy_continuation) can be computed for model ODE representations.
3333

3434
#### [Features of Catalyst composing with other packages](@id doc_index_features_composed)
3535
- [OrdinaryDiffEq.jl](https://github.com/SciML/OrdinaryDiffEq.jl) Can be used to numerically solve generated reaction rate equation ODE models.
3636
- [StochasticDiffEq.jl](https://github.com/SciML/StochasticDiffEq.jl) can be used to numerically solve generated Chemical Langevin Equation SDE models.
3737
- [JumpProcesses.jl](https://github.com/SciML/JumpProcesses.jl) can be used to numerically sample generated Stochastic Chemical Kinetics Jump Process models.
3838
- Support for [parallelization of all simulations](@ref ode_simulation_performance_parallelisation), including parallelization of [ODE simulations on GPUs](@ref ode_simulation_performance_parallelisation_GPU) using [DiffEqGPU.jl](https://github.com/SciML/DiffEqGPU.jl).
3939
- [Latexify](https://korsbo.github.io/Latexify.jl/stable/) can be used to [generate LaTeX expressions](@ref visualisation_latex) corresponding to generated mathematical models or the underlying set of reactions.
40-
- [Graphviz](https://graphviz.org/) can be used to generate and [visualize reaction network graphs](@ref visualisation_graphs) (reusing the Graphviz interface created in [Catlab.jl](https://algebraicjulia.github.io/Catlab.jl/stable/)).
40+
- [GraphMakie](https://docs.makie.org/stable/) recipes are provided that can be used to generate and [visualize reaction network graphs](@ref visualisation_graphs)
4141
- Model steady states can be [computed through homotopy continuation](@ref homotopy_continuation) using [HomotopyContinuation.jl](https://github.com/JuliaHomotopyContinuation/HomotopyContinuation.jl) (which can find *all* steady states of systems with multiple ones), by [forward ODE simulations](@ref steady_state_solving_simulation) using [SteadyStateDiffEq.jl)](https://github.com/SciML/SteadyStateDiffEq.jl), or by [numerically solving steady-state nonlinear equations](@ref steady_state_solving_nonlinear) using [NonlinearSolve.jl](https://github.com/SciML/NonlinearSolve.jl).
4242
[BifurcationKit.jl](https://github.com/bifurcationkit/BifurcationKit.jl) can be used to compute bifurcation diagrams of model steady states (including finding periodic orbits).
4343
- [DynamicalSystems.jl](https://github.com/JuliaDynamics/DynamicalSystems.jl) can be used to compute model [basins of attraction](@ref dynamical_systems_basins_of_attraction), [Lyapunov spectrums](@ref dynamical_systems_lyapunov_exponents), and other dynamical system properties.

0 commit comments

Comments
 (0)