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]

使用提供的图数据绘制美人鱼图

参数:

nodes (dict[str, str]): 节点id列表 edges (List[Edge]): 边的列表,包含源、目标和数据。 curve_style (CurveStyle, optional): 边的曲线样式。 node_colors (NodeColors, optional): 不同类型节点的颜色。 wrap_label_n_words (int, optional): 边标签的换行字数。

返回:

str: Mermaid图语法

Parameters
  • nodes (Dict[str, str]) –

  • edges (List[Edge]) –

  • first_node_label (Optional[str]) –

  • last_node_label (Optional[str]) –

  • with_styles (bool) –

  • curve_style (CurveStyle) –

  • node_colors (NodeColors) –

  • wrap_label_n_words (int) –

Return type

str