Toggle Menu
Prev Up Next

# `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

  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