Draws a Mermaid graph using the provided graph data.
draw_mermaid(
nodes: dict[str, Node],
edges: list[Edge],
*,
first_node: str | None = None,
last_node: str | None = None,
with_styles: bool = True,
curve_style: CurveStyle = CurveStyle.LINEAR,
node_styles: NodeStyles | None = None,
wrap_label_n_words: int = 9,
frontmatter_config: dict[str, Any] | None = None
) -> str| Name | Type | Description |
|---|---|---|
nodes* | dict[str, Node] | List of node ids. |
edges* | list[Edge] | List of edges, object with a source, target and data. |
first_node | str | None | Default: NoneId of the first node. |
last_node | str | None | Default: NoneId of the last node. |
with_styles | bool | Default: TrueWhether to include styles in the graph. |
curve_style | CurveStyle | Default: CurveStyle.LINEARCurve style for the edges. |
node_styles | NodeStyles | None | Default: NoneNode colors for different types. |
wrap_label_n_words | int | Default: 9Words to wrap the edge labels. |
frontmatter_config | dict[str, Any] | None | Default: NoneMermaid frontmatter config. Can be used to customize theme and styles. Will be converted to YAML and added to the beginning of the mermaid graph. See more here: https://mermaid.js.org/config/configuration.html. Example config: |