-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Sprints!A task that might be good to tackle during sprints!A task that might be good to tackle during sprints!
Milestone
Description
Our new (and current) visualization doesn't support visualising PropertyLayers yet. It would be really great if it could do that.
- PropertyLayers:
Line 569 in 290cedd
class PropertyLayer: - Visualization: https://github.com/projectmesa/mesa/tree/main/mesa/visualization
I think you need to decide if you want to use matplotlib or altair for it, and then add it either here:
mesa/mesa/visualization/components/matplotlib.py
Lines 13 to 23 in 002d3f4
def SpaceMatplotlib(model, agent_portrayal, dependencies: list[any] | None = None): | |
space_fig = Figure() | |
space_ax = space_fig.subplots() | |
space = getattr(model, "grid", None) | |
if space is None: | |
# Sometimes the space is defined as model.space instead of model.grid | |
space = model.space | |
if isinstance(space, mesa.space.NetworkGrid): | |
_draw_network_grid(space, space_ax, agent_portrayal) | |
elif isinstance(space, mesa.space.ContinuousSpace): | |
_draw_continuous_space(space, space_ax, agent_portrayal) |
or here
mesa/mesa/visualization/components/altair.py
Lines 10 to 14 in 002d3f4
def SpaceAltair(model, agent_portrayal, dependencies: list[any] | None = None): | |
space = getattr(model, "grid", None) | |
if space is None: | |
# Sometimes the space is defined as model.space instead of model.grid | |
space = model.space |
Metadata
Metadata
Assignees
Labels
Sprints!A task that might be good to tackle during sprints!A task that might be good to tackle during sprints!