Visualisation Utilities
hades.visualisation.websockets
¶
output events or event results to websockets for live visualisation using custom frontend TS/JS code or other clients
EventContext
¶
Bases: BaseModel
full details of an event notification's result
Source code in hades/visualisation/websockets.py
HadesWS
¶
Bases: Hades
Hades with a websocket server bundled. Waits for at least one client to connect before starting the simulation
Source code in hades/visualisation/websockets.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
run(until=None)
async
¶
start a server if none is injected and wait for a client connection
Source code in hades/visualisation/websockets.py
ws_server(websocket)
async
¶
received client messages
Source code in hades/visualisation/websockets.py
WebSocketProcess
¶
Bases: Process
simple process which sends all the events it receives as JSON to a websockets server this could be used for visualisation or monitoring
Source code in hades/visualisation/websockets.py
hades.visualisation.networkx
¶
to_digraph(underworld, allowed_responses=None)
¶
build from hades's event_results object the full set of connections as a networkx digraph
Source code in hades/visualisation/networkx.py
write_mermaid(G)
¶
output a networkx digraph as a simple mermaid graph