diff --git a/examples/aco_tsp/app.py b/examples/aco_tsp/app.py index 00fa52e0..7a4ede59 100644 --- a/examples/aco_tsp/app.py +++ b/examples/aco_tsp/app.py @@ -6,7 +6,7 @@ import solara from aco_tsp.model import AcoTspModel, TSPGraph from matplotlib.figure import Figure -from mesa.visualization import SolaraViz, make_plot_measure +from mesa.visualization import SolaraViz, make_plot_component def circle_portrayal_example(agent): @@ -70,7 +70,10 @@ def ant_level_distances(model): page = SolaraViz( model, - components=[make_plot_measure(["best_distance_iter", "best_distance"]), make_graph], + components=[ + make_plot_component(["best_distance_iter", "best_distance"]), + make_graph, + ], model_params=model_params, play_interval=1, ) diff --git a/examples/hex_snowflake/conways_game_of_life_fast/GoL_fast_screenshot.png b/examples/conways_game_of_life_fast/GoL_fast_screenshot.png similarity index 100% rename from examples/hex_snowflake/conways_game_of_life_fast/GoL_fast_screenshot.png rename to examples/conways_game_of_life_fast/GoL_fast_screenshot.png diff --git a/examples/hex_snowflake/conways_game_of_life_fast/Readme.md b/examples/conways_game_of_life_fast/Readme.md similarity index 100% rename from examples/hex_snowflake/conways_game_of_life_fast/Readme.md rename to examples/conways_game_of_life_fast/Readme.md diff --git a/examples/hex_snowflake/conways_game_of_life_fast/app.py b/examples/conways_game_of_life_fast/app.py similarity index 79% rename from examples/hex_snowflake/conways_game_of_life_fast/app.py rename to examples/conways_game_of_life_fast/app.py index a3084905..9a1281ac 100644 --- a/examples/hex_snowflake/conways_game_of_life_fast/app.py +++ b/examples/conways_game_of_life_fast/app.py @@ -1,4 +1,4 @@ -from mesa.visualization import SolaraViz, make_plot_measure, make_space_matplotlib +from mesa.visualization import SolaraViz, make_plot_component, make_space_component from model import GameOfLifeModel propertylayer_portrayal = { @@ -38,8 +38,8 @@ gol = GameOfLifeModel() -layer_viz = make_space_matplotlib(propertylayer_portrayal=propertylayer_portrayal) -TotalAlivePlot = make_plot_measure("Cells alive") +layer_viz = make_space_component(propertylayer_portrayal=propertylayer_portrayal) +TotalAlivePlot = make_plot_component("Cells alive") page = SolaraViz( gol, diff --git a/examples/hex_snowflake/conways_game_of_life_fast/model.py b/examples/conways_game_of_life_fast/model.py similarity index 100% rename from examples/hex_snowflake/conways_game_of_life_fast/model.py rename to examples/conways_game_of_life_fast/model.py diff --git a/examples/hotelling_law/app.py b/examples/hotelling_law/app.py index e1aaaf2a..ec195ede 100644 --- a/examples/hotelling_law/app.py +++ b/examples/hotelling_law/app.py @@ -5,7 +5,7 @@ from hotelling_law.agents import ConsumerAgent, StoreAgent from hotelling_law.model import HotellingModel from matplotlib.figure import Figure -from mesa.visualization import SolaraViz, make_plot_measure +from mesa.visualization import SolaraViz, make_plot_component model_params = { "N_stores": { @@ -349,7 +349,7 @@ def make_revenue_line_chart(model): make_price_changes_line_chart, make_market_share_and_price_chart, make_market_share_line_chart, - make_plot_measure("Price Variance"), + make_plot_component("Price Variance"), make_revenue_line_chart, ], name="Hotelling's Law Model", diff --git a/gis/agents_and_networks/app.py b/gis/agents_and_networks/app.py index d80b1d33..2e08317a 100644 --- a/gis/agents_and_networks/app.py +++ b/gis/agents_and_networks/app.py @@ -1,6 +1,6 @@ import sys -from mesa.visualization import Slider, SolaraViz, make_plot_measure +from mesa.visualization import Slider, SolaraViz, make_plot_component from mesa_geo.visualization import make_geospace_leaflet from src.model.model import AgentsAndNetworks from src.visualization.utils import agent_draw, make_plot_clock @@ -56,8 +56,8 @@ def parse_args(): [ make_geospace_leaflet(agent_draw, zoom=campus_params[campus]["zoom"]), make_plot_clock, - make_plot_measure(["status_home", "status_work", "status_traveling"]), - make_plot_measure(["friendship_home", "friendship_work"]), + make_plot_component(["status_home", "status_work", "status_traveling"]), + make_plot_component(["friendship_home", "friendship_work"]), ], name="Agents and Networks", model_params=model_params, diff --git a/gis/geo_schelling/app.py b/gis/geo_schelling/app.py index 82c69a86..afed0142 100644 --- a/gis/geo_schelling/app.py +++ b/gis/geo_schelling/app.py @@ -1,5 +1,5 @@ import solara -from mesa.visualization import Slider, SolaraViz, make_plot_measure +from mesa.visualization import Slider, SolaraViz, make_plot_component from mesa_geo.visualization import make_geospace_leaflet from model import GeoSchelling @@ -34,7 +34,7 @@ def schelling_draw(agent): model, [ make_geospace_leaflet(schelling_draw, zoom=4), - make_plot_measure(["happy"]), + make_plot_component(["happy"]), make_plot_happiness, ], model_params=model_params, diff --git a/gis/geo_schelling_points/app.py b/gis/geo_schelling_points/app.py index e025b996..091e4c8a 100644 --- a/gis/geo_schelling_points/app.py +++ b/gis/geo_schelling_points/app.py @@ -1,7 +1,7 @@ import solara from geo_schelling_points.agents import PersonAgent, RegionAgent from geo_schelling_points.model import GeoSchellingPoints -from mesa.visualization import Slider, SolaraViz, make_plot_measure +from mesa.visualization import Slider, SolaraViz, make_plot_component from mesa_geo.visualization import make_geospace_leaflet @@ -36,7 +36,7 @@ def schelling_draw(agent): model, [ make_geospace_leaflet(schelling_draw, zoom=4), - make_plot_measure(["happy", "unhappy"]), + make_plot_component(["happy", "unhappy"]), make_plot_happiness, ], model_params=model_params, diff --git a/gis/geo_sir/app.py b/gis/geo_sir/app.py index 2c8177cb..7a76151c 100644 --- a/gis/geo_sir/app.py +++ b/gis/geo_sir/app.py @@ -1,6 +1,6 @@ from geo_sir.agents import PersonAgent from geo_sir.model import GeoSir -from mesa.visualization import Slider, SolaraViz, make_plot_measure +from mesa.visualization import Slider, SolaraViz, make_plot_component from mesa_geo.visualization import make_geospace_leaflet model_params = { @@ -33,7 +33,7 @@ def infected_draw(agent): model, [ make_geospace_leaflet(infected_draw, zoom=12), - make_plot_measure(["infected", "susceptible", "recovered", "dead"]), + make_plot_component(["infected", "susceptible", "recovered", "dead"]), ], name="Basic agent-based SIR model", model_params=model_params, diff --git a/gis/rainfall/app.py b/gis/rainfall/app.py index 32af70a0..1c5a72b5 100644 --- a/gis/rainfall/app.py +++ b/gis/rainfall/app.py @@ -1,6 +1,6 @@ from typing import Tuple -from mesa.visualization import Slider, SolaraViz, make_plot_measure +from mesa.visualization import Slider, SolaraViz, make_plot_component from mesa_geo.visualization import make_geospace_leaflet from rainfall.model import Rainfall from rainfall.space import LakeCell @@ -33,7 +33,7 @@ def cell_portrayal(cell: LakeCell) -> Tuple[float, float, float, float]: model, [ make_geospace_leaflet(cell_portrayal, zoom=11), - make_plot_measure( + make_plot_component( ["Total Amount of Water", "Total Contained", "Total Outflow"] ), ], diff --git a/gis/urban_growth/app.py b/gis/urban_growth/app.py index 9c3ffc59..bd426d8c 100644 --- a/gis/urban_growth/app.py +++ b/gis/urban_growth/app.py @@ -1,7 +1,7 @@ from typing import Tuple import solara -from mesa.visualization import Slider, SolaraViz, make_plot_measure +from mesa.visualization import Slider, SolaraViz, make_plot_component from mesa_geo.visualization import make_geospace_leaflet from urban_growth.model import UrbanGrowth from urban_growth.space import UrbanCell @@ -37,7 +37,7 @@ def make_plot_urbanized(model): model, [ make_geospace_leaflet(cell_portrayal, zoom=12.1), - make_plot_measure(["Percentage Urbanized"]), + make_plot_component(["Percentage Urbanized"]), make_plot_urbanized, ], name="Urban Growth Model",