Runs when a node is clicked in the NetworkPlots
axes.
Required Parameters
agents — list[Agent]
The live agent(s) whose nodes were clicked on, possibly multiple if there are overlapping nodes in the current layout. Note that, if clicking on a historical network state (i.e. having scrubbed the time bar backward), the clicked agent may be dead, in which case
None
will be passed instead of an agent object.plot — NetworkPlot
The
NetworkPlot
object that was clicked on.t — int
The time currently displayed on the time slider. This may not match the current model time if the time slider has been scrubbed backward.
charwick
Feb 08, 2021 at 23:55Usually it will be desirable only to take an action if an agent is clicked while the current model time is displayed in the visualizer, since any actions taken will affect the current model state rather than the historical state. The third parameter can be used to ensure that the action is only taken when the visualization is current.
charwick
Feb 08, 2021 at 23:59NetworkPlot
does not automatically update its display when the model state changes. In order to update the visualization in place, it will be necessary to call theupdate()
(to alert it to changed data and overwrite the existing data for the current period) anddraw()
(to refresh the display) methods of theNetworkPlot
object passed as theplot
argument. The latter must be called with the forceUpdate=True option; otherwise the plot only updates when the wholeCharts
visualizer updates.