MCPcopy Create free account
hub / github.com/srixivas/PcapXray / refresh_live

Function refresh_live

Source/Module/interactive_gui.py:179–195  ·  view source on GitHub ↗

Redraw the existing panel in-place from current memory state. Uses spring_layout (~100ms, no subprocess). Called every ~4s during live capture. No-op if the panel is not open.

()

Source from the content-addressed store, hash-verified

177
178
179def refresh_live() -> None:
180 """Redraw the existing panel in-place from current memory state.
181
182 Uses spring_layout (~100ms, no subprocess). Called every ~4s during live capture.
183 No-op if the panel is not open.
184 """
185 if _ax is None or _canvas_widget is None:
186 return
187 filt = _filter_var.get() if _filter_var is not None else "All"
188 nf = _node_filter_var.get() if _node_filter_var is not None else ""
189 G, pos, node_colors, edge_colors = _build_graph_data(live=True, filter_option=filt, node_filter=nf)
190 if G is None:
191 return
192 _draw_on_axes(_ax, G, pos, node_colors, edge_colors)
193 _figure.subplots_adjust(left=0.02, right=0.98, top=0.98, bottom=0.02)
194 _canvas_widget.draw()
195 log.debug("refresh_live: %d nodes", len(G.nodes))
196
197
198def _apply_panel_filter(*_) -> None:

Callers

nothing calls this directly

Calls 2

_build_graph_dataFunction · 0.85
_draw_on_axesFunction · 0.85

Tested by

no test coverage detected