Skip to content

SolaraViz: Visualize PropertyLayers #2138

Closed
@EwoutH

Description

@EwoutH

Our new (and current) visualization doesn't support visualising PropertyLayers yet. It would be really great if it could do that.

I think you need to decide if you want to use matplotlib or altair for it, and then add it either here:

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
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

No one assigned

    Labels

    Sprints!A task that might be good to tackle during sprints!

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions