langchain_core.runnables.graph_mermaid
.draw_mermaidΒΆ
- langchain_core.runnables.graph_mermaid.draw_mermaid(nodes: Dict[str, str], edges: List[Edge], *, first_node_label: Optional[str] = None, last_node_label: Optional[str] = None, with_styles: bool = True, curve_style: CurveStyle = CurveStyle.LINEAR, node_colors: NodeColors = NodeColors(start='#ffdfba', end='#baffc9', other='#fad7de'), wrap_label_n_words: int = 9) str [source]ΒΆ
Draws a Mermaid graph using the provided graph data
- Parameters
nodes (dict[str, str]) β List of node ids
edges (List[Edge]) β List of edges, object with source,
data. (target and) β
curve_style (CurveStyle, optional) β Curve style for the edges.
node_colors (NodeColors, optional) β Node colors for different types.
wrap_label_n_words (int, optional) β Words to wrap the edge labels.
first_node_label (Optional[str]) β
last_node_label (Optional[str]) β
with_styles (bool) β
- Returns
Mermaid graph syntax
- Return type
str