diff --git a/src/mesa_interactive/components/grid.py b/src/mesa_interactive/components/grid.py index fef519f..ed93d72 100644 --- a/src/mesa_interactive/components/grid.py +++ b/src/mesa_interactive/components/grid.py @@ -9,6 +9,8 @@ def get_agent_data_from_coord_iter(agents_per_coordinate): for agents, (x, y) in agents_per_coordinate: if agents: # Checking if the list is non-empty + if not isinstance(agents, list): + agents = [agents] for agent in agents: agent_data = json.loads( json.dumps(agent.__dict__, skipkeys=True, default=str)