-
-
Couldn't load subscription status.
- Fork 1k
Closed
Labels
Milestone
Description
In the old visualisation you could add values like "Shape": "circle" and "Filled": "true" to the agent_portrayal dict.
With the new Solara based visualisation, that's not yet possible. It should be implemented in mesa/visualization/components. Somewhere around here:
mesa/mesa/visualization/components/altair.py
Lines 50 to 55 in 74e2df6
| has_color = "color" in all_agent_data[0] | |
| if has_color: | |
| encoding_dict["color"] = alt.Color("color", type="nominal") | |
| has_size = "size" in all_agent_data[0] | |
| if has_size: | |
| encoding_dict["size"] = alt.Size("size", type="quantitative") |
and maybe also in:
mesa/mesa/visualization/components/matplotlib.py
Lines 40 to 47 in 74e2df6
| for agent in content: | |
| data = agent_portrayal(agent) | |
| x.append(i) | |
| y.append(j) | |
| if "size" in data: | |
| s.append(data["size"]) | |
| if "color" in data: | |
| c.append(data["color"]) |