API reference
python:astx:astx.viz._traverse_ast_to_mermaid
function _traverse_ast_to_mermaid
_traverse_ast_to_mermaid(ast: ReprStruct, *, direction: Direction = 'TD', named_items: bool = True) -> str
Source: packages/astx/src/astx/viz.py:56
Convert AST to Mermaid.
Parameters
direction : "TD" | "LR"
Layout direction.
named_items : bool
If True, emit ID["Label"] node declarations and quoted edge labels
(best for Jupyter/image). If False, emit plain identifiers and pipe
edge labels (compatible with mermaid-ascii).
Parameters
-
ast โ Type: ReprStruct
-
direction โ Type: Direction
-
named_items โ Type: bool
Returns
Type: str