Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Corvince committed Sep 17, 2024
1 parent 544bbf9 commit 9046139
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/boltzmann_wealth_model_experimental/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def agent_portrayal(agent):

# Create visualization elements. The visualization elements are solara components
# that receive the model instance as a "prop" and display it in a certain way.
# Under the hood these are just functions that receive the model instance.
# You can also author your own visualization elements, they just have to return
# a valid solara component or an ipywidget.
# Under the hood these are just classes that receive the model instance.
# You can also author your own visualization elements, which can also be functions
# that receive the model instance and return a valid solara component.
SpaceGraph = make_space_matplotlib(agent_portrayal)
GiniPlot = make_plot_measure("Gini")

Expand Down
5 changes: 3 additions & 2 deletions examples/conways_game_of_life_fast/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@

gol = GameOfLifeModel(10, 10)

AlivePlot = make_plot_measure("Cells alive", "Fraction alive")
TotalAlivePlot = make_plot_measure("Cells alive")
FractionAlivePlot = make_plot_measure("Fraction alive")


page = SolaraViz(
gol,
components=[AlivePlot],
components=[TotalAlivePlot, FractionAlivePlot],
model_params=model_params,
name="Game of Life Model",
)
Expand Down

0 comments on commit 9046139

Please sign in to comment.