-
Notifications
You must be signed in to change notification settings - Fork 25
Add support for GraphSpace in abmplot recipe #114
Conversation
Some to-dos:
|
Hey @Datseris , a design question for you: The GraphSpace plots behave a bit differently than the rest because we have not just agents (e.g. scatter points) like in the other spaces. Graphs consist of vertices and edges, therefore we need to allow users to style them appropriately. My current implementation uses the Now my question is whether this seems sane to you? There's certainly a break in the UX here but I'm not sure how to solve for it. It boils down to these two options: abmplot(model; ac = node_color, as = node_size, graphplotkwargs = (; edge_color, edge_width))
# or
abmplot(model; graphplotkwargs = (; node_color, node_size, edge_color, edge_width)) Which do you prefer? The first version is closer to the regular behaviour of our |
Other than that this PR just needs to add some documentation, increment patch number, etc. Here's a little (admittedly weird) showcase of our SIR model with random colours and widths of the edges: abmvideo.mp4 |
Maybe it would be a good idea to drop them completely and call them |
I've rearranged |
- Add method to pass an existing ABMObservable instead of an ABM - remove unnecessary _add_interaction kwarg - Nest different calls to abmplot/abmplot! to avoid code duplication - reorder some things in recipe to make more sense
- Works again with new recipe structure - Added support for GraphSpace inspection - Refactored id collection into separate ids_to_inspect methods - Changed GridSpace to AbstractGridSpace to also support GridSpaceSingle ootb
@Datseris Please have a final look if you're happy with everything. :) |
I am sorry for taking so long. Yes this is good to go, but did you add something about this in the docstring of |
Eh, here we have In any case, this needs documentation, I don't see anywhere documnted in a docstring how to change edges etc. at the moment., but all of these are possible to do as shown in the example file. Probably worth adding a subsection |
Thanks for the feedback. Yeah, you're right, I should add documentation to explain the details of how to use the recipe with GraphSpace models. A subsection definitely makes sense and I'll add that as soon as I find the time.
The function does that internally. It iterates over I chose
|
Okay, I see. Yes, this is different as it was done before. In the original version, the approach was: |
OK, I'll have to think about how to do this. For the edges it will of course not work because they follow such a different concept (i.e. the connection between two positions). There we will still need a special approach but that's not breaking for anyone since it's really only used with |
OK, now it works like this
and that should be what you want, right? No more |
Thanks so much for his @fbanning ! Tagging a release now! |
@fbanning I think you need to update the graph makie dependency in OSMMakie for us to tag a new release, see here: https://github.com/JuliaRegistries/General/actions/runs/4074308616/jobs/7019298171#step:16:186 |
Yeah, didn't tag the new release so far. Will do that now, should be available soon ™️ . |
Done. Already bumped OSMMakie compat on here as well as fixing the changes needed for Makie 0.19 to work (they renamed |
Closes #11
The basics are working already.
I'll try to finish this in the upcoming days so that it works nicely with user-styled vertices and edges.