MermaidNodeShapeMermaid node shape types for diagram visualization.
Details
Each shape produces different visual representations in Mermaid diagrams:
rectangle: Standard rectangular nodesA["label"]rounded: Rounded rectangular nodesA("label")circle: Circular nodesA(("label"))diamond: Diamond-shaped nodesA{"label"}hexagon: Hexagonal nodesA{{"label"}}stadium: Stadium-shaped nodesA(["label"])subroutine: Subroutine-style nodesA[["label"]]cylindrical: Cylindrical database-style nodesA[("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
}models
Source effect/Graph.ts:21359 lines
export type type MermaidNodeShape =
| "rectangle"
| "rounded"
| "circle"
| "diamond"
| "hexagon"
| "stadium"
| "subroutine"
| "cylindrical"
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 A{{"label"}}
stadium: 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
}
MermaidNodeShape =
| "rectangle" // A["label"]
| "rounded" // A("label")
| "circle" // A(("label"))
| "diamond" // A{"label"}
| "hexagon" // A{{"label"}}
| "stadium" // A(["label"])
| "subroutine" // A[["label"]]
| "cylindrical" // A[("label")]Referenced by 1 symbols