Correctly using NetworkModule visualisation to visualise a network #1560
-
Hey! I am new to Mesa and ABM modelling in general and am attempting to implement a disaster response model that runs on a city's street network as a grid. I am struggling to get the visualization of the model to run in the inbuilt visualization server. I have created the network graph using the The documentation isn't super clear about what could be wrong. Has anyone encountered this bug before? I am attaching a link to my repository for this project in-case someone wants to take a look at my code. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The error message I got is The error is due to street_network.data has the node indices starting from 1, 2, 3, ..., but D3.js assumes the nodes start from 0, 1, 2... self.G = nx.relabel_nodes(self.G, {3999: 0}) |
Beta Was this translation helpful? Give feedback.
The error message I got is
Uncaught Error: node not found: 15012
.TypeError: t.app is undefined content_script_bundle.js:93:1027
this is probably one of your Chrome/Firefox extension's problem.The error is due to street_network.data has the node indices starting from 1, 2, 3, ..., but D3.js assumes the nodes start from 0, 1, 2...
To fix the
node not found
error message, you rename node 15012 to node 0: