bloc.plotting.network_cytoscape#

Export the Bloc GUI’s live Cytoscape.js network graph to a PNG.

Distinct from bloc.io.scenario’s graphviz-based network figure (a simpler diagram used by the Calculation Note pipeline): this renders the actual canvas the interactive GUI draws – dagre layout, swim lanes, stage grouping and all – by driving a headless browser against a throwaway copy of that GUI.

Thin Bloc wrapper around Boulder’s own boulder.schema_export.render_network_schema_png(): the only thing this module adds is wiring in BlocRunner (so from: inheritance and Bloc mechanism resolution work) and the bloc.boulder_plugins registration, the same way bloc.core.cli does for the interactive GUI.

Requires the optional playwright dependency (lazily imported, via Boulder):

pip install bloc[gui-export]
playwright install chromium

CLI:

python -m bloc.plotting.network_cytoscape path/to/model.yaml --out diagram.png

Functions#

render_network_png(yaml_path, output_path, **kwargs)

Render yaml_path's network to a PNG at output_path and return it.

main([argv])

Module Contents#

bloc.plotting.network_cytoscape.render_network_png(yaml_path, output_path, **kwargs)#

Render yaml_path’s network to a PNG at output_path and return it.

**kwargs (host, timeout, bg, scale) are forwarded to boulder.schema_export.render_network_schema_png().

bloc.plotting.network_cytoscape.main(argv=None)#