Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Giving the user more control in solara visualization of spaces #2389

Open
quaquel opened this issue Oct 19, 2024 · 0 comments
Open

Giving the user more control in solara visualization of spaces #2389

quaquel opened this issue Oct 19, 2024 · 0 comments

Comments

@quaquel
Copy link
Member

quaquel commented Oct 19, 2024

The current signature for displaying a space is

def make_space_matplotlib(agent_portrayal=None, propertylayer_portrayal=None):

This gives the user explicit control over the agent_portrayal and the propertylayer_portrayal. However, it also means that the mesa code is making implicit assumptions regarding the attribute to which the space is assigned in the model, and how (depending on the used space class) it is to be visualized. Moreover, it makes space visualization not easily extendable by the user. So, I suggest changing the signature to

def make_space_matplotlib(agent_portrayal=None, propertylayer_portrayal=None, space_portrayal=None, space:str =None):

If space_portrayal is None, we can use the existing if elif structure in SpaceMatplotlib to identify the correct space_portrayal function (probably moved into a separate helper function). Likewise, if space is None, we can fall back on checking model.grid and model.space. This same more fine grained API can also be applied to make_space_altair. @Corvince, @EwoutH, any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant