Network displayed in visualization has correct nodes but wrong edges #2134
Unanswered
malawleyGH
asked this question in
Q&A
Replies: 1 comment 5 replies
-
This might be your problem? #1433. Otherwise, I recommend using the Solara-based new visualization, which will become the default in the upcoming Mesa release, 3.0. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on an ABM similar to the example virus on a network. The model itself is good, but the visualization is not working. The browser opens fine, a network is displayed, the nodes are correct, but the edges are all wrong. The portrayal method is creating the correct network configuration. I have traced the journey of the portrayal to the method "write_message" in websocket.py. My understanding is that this method converts the portrayal dictionary to json format and sends to the websocket. Here is a bit of the code:
def write_message(
self, message: Union[bytes, str, Dict[str, Any]], binary: bool = False
) -> "Future[None]":
"""Sends the given message to the client of this Web Socket.
Notice that I inserted a print statement (near the bottom) that prints the message before it is sent. I checked the printed message carefully, it is the correct graph configuration, correct nodes and edges, correct node and edge colors, etc., and the json format of the message checks out when I tested it in python.
When the network is displayed, the nodes are the correct color, but the edges are all wrong. I tried this in both Edge and Chrome and got the same result, so I don't think it is the browser. I am at a loss of what to do now. Any suggestions would be greatly appreciated, I will be happy to provide more information if needed. Thanks
Beta Was this translation helpful? Give feedback.
All reactions