module documentation

Library for creating visualizations of the pytype typegraph. This is intended as a convenient wrapper for the jinja2 template. All it does is load the template, encode the program, then call template.render. Because the visualizer template uses an `include` statement, a full jinja2.Environment needs to be created. generate() accepts a jinja2.Loader in order to support different execution environments.

Function generate Generate the visualization webpage.
Constant _CYTOSCAPE_DAGRE_URL Undocumented
Constant _CYTOSCAPE_URL Undocumented
Constant _DAGRE_URL Undocumented
Constant _TEMPLATE_NAME Undocumented
def generate(program: cfg.Program, var_table: dict[int, str], loader: jinja2.BaseLoader, cytoscape_url: str = _CYTOSCAPE_URL, dagre_url: str = _DAGRE_URL, cytoscape_dagre_url: str = _CYTOSCAPE_DAGRE_URL) -> str: (source)

Generate the visualization webpage. Args: program: cfg.Program. The instance of the program to visualize. var_table: dict[int, str]. A mapping of cfg.Variable IDs to names. loader: jinja2.BaseLoader. The loader needs to be able to load files in this file's directory. cytoscape_url: str. The location of the Cytoscape library. May be a URL or a path. dagre_url: str. The location of the Dagre library. May be a URL or a path. cytoscape_dagre_url: str. The location of the cytoscape-dagre library. May be a URL or a path. Returns: str. The rendered visualization page.

_CYTOSCAPE_DAGRE_URL: str = (source)

Undocumented

Value
'https://www.gstatic.com/external_hosted/cytoscape-dagre/cytoscape-dagre.js'
_CYTOSCAPE_URL: str = (source)

Undocumented

Value
'https://www.gstatic.com/external_hosted/cytoscape/cytoscape.js'
_DAGRE_URL: str = (source)

Undocumented

Value
'https://www.gstatic.com/external_hosted/dagre/dagre.js'
_TEMPLATE_NAME: str = (source)

Undocumented

Value
'visualizer.html.jinja2'