Skip to content

Commit 97d535d

Browse files
committed
fix make_x_component function names in SolaraViz
1 parent d76cba1 commit 97d535d

File tree

9 files changed

+23
-20
lines changed

9 files changed

+23
-20
lines changed

examples/aco_tsp/app.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import solara
77
from aco_tsp.model import AcoTspModel, TSPGraph
88
from matplotlib.figure import Figure
9-
from mesa.visualization import SolaraViz, make_plot_measure
9+
from mesa.visualization import SolaraViz, make_plot_component
1010

1111

1212
def circle_portrayal_example(agent):
@@ -70,7 +70,10 @@ def ant_level_distances(model):
7070

7171
page = SolaraViz(
7272
model,
73-
components=[make_plot_measure(["best_distance_iter", "best_distance"]), make_graph],
73+
components=[
74+
make_plot_component(["best_distance_iter", "best_distance"]),
75+
make_graph,
76+
],
7477
model_params=model_params,
7578
play_interval=1,
7679
)

examples/hex_snowflake/conways_game_of_life_fast/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from mesa.visualization import SolaraViz, make_plot_measure, make_space_matplotlib
1+
from mesa.visualization import SolaraViz, make_plot_component, make_space_component
22
from model import GameOfLifeModel
33

44
propertylayer_portrayal = {
@@ -38,8 +38,8 @@
3838

3939
gol = GameOfLifeModel()
4040

41-
layer_viz = make_space_matplotlib(propertylayer_portrayal=propertylayer_portrayal)
42-
TotalAlivePlot = make_plot_measure("Cells alive")
41+
layer_viz = make_space_component(propertylayer_portrayal=propertylayer_portrayal)
42+
TotalAlivePlot = make_plot_component("Cells alive")
4343

4444
page = SolaraViz(
4545
gol,

examples/hotelling_law/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from hotelling_law.agents import ConsumerAgent, StoreAgent
66
from hotelling_law.model import HotellingModel
77
from matplotlib.figure import Figure
8-
from mesa.visualization import SolaraViz, make_plot_measure
8+
from mesa.visualization import SolaraViz, make_plot_component
99

1010
model_params = {
1111
"N_stores": {
@@ -349,7 +349,7 @@ def make_revenue_line_chart(model):
349349
make_price_changes_line_chart,
350350
make_market_share_and_price_chart,
351351
make_market_share_line_chart,
352-
make_plot_measure("Price Variance"),
352+
make_plot_component("Price Variance"),
353353
make_revenue_line_chart,
354354
],
355355
name="Hotelling's Law Model",

gis/agents_and_networks/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22

3-
from mesa.visualization import Slider, SolaraViz, make_plot_measure
3+
from mesa.visualization import Slider, SolaraViz, make_plot_component
44
from mesa_geo.visualization import make_geospace_leaflet
55
from src.model.model import AgentsAndNetworks
66
from src.visualization.utils import agent_draw, make_plot_clock
@@ -56,8 +56,8 @@ def parse_args():
5656
[
5757
make_geospace_leaflet(agent_draw, zoom=campus_params[campus]["zoom"]),
5858
make_plot_clock,
59-
make_plot_measure(["status_home", "status_work", "status_traveling"]),
60-
make_plot_measure(["friendship_home", "friendship_work"]),
59+
make_plot_component(["status_home", "status_work", "status_traveling"]),
60+
make_plot_component(["friendship_home", "friendship_work"]),
6161
],
6262
name="Agents and Networks",
6363
model_params=model_params,

gis/geo_schelling/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import solara
2-
from mesa.visualization import Slider, SolaraViz, make_plot_measure
2+
from mesa.visualization import Slider, SolaraViz, make_plot_component
33
from mesa_geo.visualization import make_geospace_leaflet
44
from model import GeoSchelling
55

@@ -34,7 +34,7 @@ def schelling_draw(agent):
3434
model,
3535
[
3636
make_geospace_leaflet(schelling_draw, zoom=4),
37-
make_plot_measure(["happy"]),
37+
make_plot_component(["happy"]),
3838
make_plot_happiness,
3939
],
4040
model_params=model_params,

gis/geo_schelling_points/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import solara
22
from geo_schelling_points.agents import PersonAgent, RegionAgent
33
from geo_schelling_points.model import GeoSchellingPoints
4-
from mesa.visualization import Slider, SolaraViz, make_plot_measure
4+
from mesa.visualization import Slider, SolaraViz, make_plot_component
55
from mesa_geo.visualization import make_geospace_leaflet
66

77

@@ -36,7 +36,7 @@ def schelling_draw(agent):
3636
model,
3737
[
3838
make_geospace_leaflet(schelling_draw, zoom=4),
39-
make_plot_measure(["happy", "unhappy"]),
39+
make_plot_component(["happy", "unhappy"]),
4040
make_plot_happiness,
4141
],
4242
model_params=model_params,

gis/geo_sir/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from geo_sir.agents import PersonAgent
22
from geo_sir.model import GeoSir
3-
from mesa.visualization import Slider, SolaraViz, make_plot_measure
3+
from mesa.visualization import Slider, SolaraViz, make_plot_component
44
from mesa_geo.visualization import make_geospace_leaflet
55

66
model_params = {
@@ -33,7 +33,7 @@ def infected_draw(agent):
3333
model,
3434
[
3535
make_geospace_leaflet(infected_draw, zoom=12),
36-
make_plot_measure(["infected", "susceptible", "recovered", "dead"]),
36+
make_plot_component(["infected", "susceptible", "recovered", "dead"]),
3737
],
3838
name="Basic agent-based SIR model",
3939
model_params=model_params,

gis/rainfall/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Tuple
22

3-
from mesa.visualization import Slider, SolaraViz, make_plot_measure
3+
from mesa.visualization import Slider, SolaraViz, make_plot_component
44
from mesa_geo.visualization import make_geospace_leaflet
55
from rainfall.model import Rainfall
66
from rainfall.space import LakeCell
@@ -33,7 +33,7 @@ def cell_portrayal(cell: LakeCell) -> Tuple[float, float, float, float]:
3333
model,
3434
[
3535
make_geospace_leaflet(cell_portrayal, zoom=11),
36-
make_plot_measure(
36+
make_plot_component(
3737
["Total Amount of Water", "Total Contained", "Total Outflow"]
3838
),
3939
],

gis/urban_growth/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Tuple
22

33
import solara
4-
from mesa.visualization import Slider, SolaraViz, make_plot_measure
4+
from mesa.visualization import Slider, SolaraViz, make_plot_component
55
from mesa_geo.visualization import make_geospace_leaflet
66
from urban_growth.model import UrbanGrowth
77
from urban_growth.space import UrbanCell
@@ -37,7 +37,7 @@ def make_plot_urbanized(model):
3737
model,
3838
[
3939
make_geospace_leaflet(cell_portrayal, zoom=12.1),
40-
make_plot_measure(["Percentage Urbanized"]),
40+
make_plot_component(["Percentage Urbanized"]),
4141
make_plot_urbanized,
4242
],
4343
name="Urban Growth Model",

0 commit comments

Comments
 (0)