effect-io-ai

Package: effect
Module: Graph

Graph.MermaidNodeShape

Mermaid node shape types for diagram visualization.

Details

Each shape produces different visual representations in Mermaid diagrams:

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"

Source

Since v3.18.0