Network Circular layouts in Visus_On_Network #1769
Unanswered
jenny61599
asked this question in
Q&A
Replies: 1 comment 3 replies
-
It is much harder to customize For your use case, I'd modify the app.py to have this def space_drawer(viz):
space_fig = Figure()
space_ax = space_fig.subplots()
graph = viz.model.grid.G
pos = nx.circular_layout(graph, seed=0)
nx.draw(
graph,
ax=space_ax,
pos=pos,
**agent_portrayal(graph),
)
space_ax.set_axis_off()
solara.FigureMatplotlib(space_fig, dependencies=[viz.model, viz.df]) and then modify the page = JupyterViz(
VirusOnNetwork,
model_params,
measures=[
make_plot,
make_text(get_resistant_susceptible_ratio),
],
name="Virus Model",
space_drawer=space_drawer,
)
page # noqa This is a very new viz frontend, so I haven't made it even easier yet. But even for now, it is still easier than the default one. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am working with a modified Virus Model from the examples folder, and I was wondering if it is possible to visualize the network with a circular network in server.py? Below is my current code for generating graph G.
As for the changes in server.py, I am still using mesa.visualization.NetworkModule() and mesa.visualization.ChartModule as in the original. I assume that to do a circular layout, it should be done in server.py instead of model.py?
Beta Was this translation helpful? Give feedback.
All reactions