MCPcopy Create free account
hub / github.com/effect-app/libs / stronglyConnectedComponents

Function stronglyConnectedComponents

repos/effect/packages/effect/src/Graph.ts:2987–3082  ·  view source on GitHub ↗
(
  graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">
)

Source from the content-addressed store, hash-verified

2985 * }
2986 *
2987 * const options: Graph.MermaidOptions<string, string> = {
2988 * nodeShape: shapeSelector
2989 * }
2990 * options.nodeShape?.("decision") // => "diamond"
2991 * ```
2992 *
2993 * @category models
2994 * @since 3.18.0
2995 */
2996export type MermaidNodeShape =
2997 | "rectangle" // A["label"]
2998 | "rounded" // A("label")
2999 | "circle" // A(("label"))
3000 | "diamond" // A{"label"}
3001 | "hexagon" // A{{"label"}}
3002 | "stadium" // A(["label"])
3003 | "subroutine" // A[["label"]]
3004 | "cylindrical" // A[("label")]
3005
3006/**
3007 * Mermaid diagram direction types for controlling layout orientation.
3008 *
3009 * **Details**
3010 *
3011 * Determines the flow direction of nodes and edges in the diagram:
3012 * - `TB`/`TD`: Top to Bottom (vertical layout, default)
3013 * - `BT`: Bottom to Top (reverse vertical)
3014 * - `LR`: Left to Right (horizontal layout)
3015 * - `RL`: Right to Left (reverse horizontal)
3016 *
3017 * **Example** (Configuring Mermaid directions)
3018 *
3019 * ```ts import.meta.vitest
3020 * import type { Graph } from "effect"
3021 *
3022 * // Horizontal workflow diagram
3023 * const horizontalOptions: Graph.MermaidOptions<string, string> = {
3024 * direction: "LR"
3025 * }
3026 *
3027 * // Vertical hierarchy (default)
3028 * const verticalOptions: Graph.MermaidOptions<string, string> = {
3029 * direction: "TB"
3030 * }
3031 *
3032 * // Bottom-up flow
3033 * const bottomUpOptions: Graph.MermaidOptions<string, string> = {
3034 * direction: "BT"
3035 * }
3036 * Array.of(horizontalOptions.direction, verticalOptions.direction, bottomUpOptions.direction) // => ["LR", "TB", "BT"]
3037 * ```
3038 *
3039 * @category models
3040 * @since 3.18.0
3041 */
3042export type MermaidDirection =
3043 | "TB" // Top to Bottom (default)
3044 | "TD" // Top Down (same as TB)

Callers

nothing calls this directly

Calls 6

getDirectedNeighborsFunction · 0.85
pushMethod · 0.80
clearMethod · 0.80
addMethod · 0.65
getMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…