Skip to content

Commit

Permalink
Comments adressed
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Aug 6, 2024
1 parent b18b250 commit 43bd1b6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
Binary file added basin_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions core/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Legolas = "0.5"
LinearSolve = "2.24"
Logging = "<0.0.1, 1"
LoggingExtras = "1"
Makie = "0.21"
MetaGraphsNext = "0.6, 0.7"
OrdinaryDiffEq = "6.7"
PreallocationTools = "0.4"
Expand Down
15 changes: 5 additions & 10 deletions core/ext/RibasimMakieExt.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
module RibasimMakieExt
using DataFrames: DataFrame
using Makie: Figure, Axis, lines!, axislegend
using Ribasim: Ribasim, Model
if isdefined(Base, :get_extension)
using Makie
using DataFrames
else
using ..Makie
using ..DataFrames
end

function Ribasim.plot_basin_data!(model::Model, ax::Axis, column::Symbol)
basin_data = DataFrame(Ribasim.basin_table(model))
Expand All @@ -21,8 +16,8 @@ end

function Ribasim.plot_basin_data(model::Model)
f = Figure()
ax1 = Axis(f[1, 1]; ylabel = "level")
ax2 = Axis(f[2, 1]; xlabel = "time", ylabel = "storage")
ax1 = Axis(f[1, 1]; ylabel = "level [m]")
ax2 = Axis(f[2, 1]; xlabel = "time", ylabel = "storage [m³]")
Ribasim.plot_basin_data!(model, ax1, :level)
Ribasim.plot_basin_data!(model, ax2, :storage)
f
Expand All @@ -49,7 +44,7 @@ end

function Ribasim.plot_flow(model::Model)
f = Figure()
ax = Axis(f[1, 1]; xlabel = "time", ylabel = "flow rate")
ax = Axis(f[1, 1]; xlabel = "time", ylabel = "flow rate [m³s⁻¹]")
edge_ids = unique(Ribasim.flow_table(model).edge_id)
for edge_id in edge_ids
Ribasim.plot_flow!(model, ax, edge_id; skip_conservative_out = true)
Expand Down
Binary file added flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 43bd1b6

Please sign in to comment.