Hyperlinkv0.8.0-beta.28

Graph

Graph.MermaidNodeShapetypeeffect/Graph.ts:2135
MermaidNodeShape

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
}
models
Source effect/Graph.ts:21359 lines
export type 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