Package: effect
Module: Graph
Mermaid node shape types for diagram visualization.
Details
Each shape produces different visual representations in Mermaid diagrams:
rectangle: Standard rectangular nodes A["label"]rounded: Rounded rectangular nodes A("label")circle: Circular nodes A(("label"))diamond: Diamond-shaped nodes A{"label"}hexagon: Hexagonal nodes Alabelstadium: Stadium-shaped nodes A(["label"])subroutine: Subroutine-style nodes A[["label"]]cylindrical: Cylindrical database-style nodes A[("label")]Example (Selecting Mermaid node shapes)
import type { Graph } from "effect"
// Shape selector function for different node types
const shapeSelector = (nodeData: string): Graph.MermaidNodeShape => {
if (nodeData.includes("start") || nodeData.includes("end")) return "circle"
if (nodeData.includes("decision")) return "diamond"
if (nodeData.includes("process")) return "rectangle"
if (nodeData.includes("data")) return "cylindrical"
return "rounded"
}
const options: Graph.MermaidOptions<string, string> = {
nodeShape: shapeSelector
}
Signature
type MermaidNodeShape = | "rectangle" // A["label"]
| "rounded" // A("label")
| "circle" // A(("label"))
| "diamond" // A{"label"}
| "hexagon" // Alabel
| "stadium" // A(["label"])
| "subroutine" // A[["label"]]
| "cylindrical"
Since v3.18.0