GraphVizOptions<N, E>Configuration options for GraphViz DOT format generation from graphs.
Details
These options customize node labels, edge labels, and graph naming in DOT format compatible with GraphViz tools.
Example (Configuring GraphViz labels)
import type { Graph } from "effect"
// Basic options with custom labels
const basicOptions: Graph.GraphVizOptions<string, number> = {
nodeLabel: (data) => `Node: ${data}`,
edgeLabel: (data) => `Weight: ${data}`
}
// Complete options with graph naming
const namedOptions: Graph.GraphVizOptions<string, string> = {
nodeLabel: (data) => data.toUpperCase(),
edgeLabel: (data) => data,
graphName: "MyDependencyGraph"
}options
Source effect/Graph.ts:200119 lines
export interface interface GraphVizOptions<N, E>Configuration options for GraphViz DOT format generation from graphs.
Details
These options customize node labels, edge labels, and graph naming in DOT
format compatible with GraphViz tools.
Example (Configuring GraphViz labels)
import type { Graph } from "effect"
// Basic options with custom labels
const basicOptions: Graph.GraphVizOptions<string, number> = {
nodeLabel: (data) => `Node: ${data}`,
edgeLabel: (data) => `Weight: ${data}`
}
// Complete options with graph naming
const namedOptions: Graph.GraphVizOptions<string, string> = {
nodeLabel: (data) => data.toUpperCase(),
edgeLabel: (data) => data,
graphName: "MyDependencyGraph"
}
GraphVizOptions<function (type parameter) N in GraphVizOptions<N, E>N, function (type parameter) E in GraphVizOptions<N, E>E> {
/**
* Function to generate custom labels for nodes.
* Defaults to String(data) if not provided.
*/
readonly GraphVizOptions<N, E>.nodeLabel?: ((data: N) => string) | undefinedFunction to generate custom labels for nodes.
Defaults to String(data) if not provided.
nodeLabel?: (data: Ndata: function (type parameter) N in GraphVizOptions<N, E>N) => string
/**
* Function to generate custom labels for edges.
* Defaults to String(data) if not provided.
*/
readonly GraphVizOptions<N, E>.edgeLabel?: ((data: E) => string) | undefinedFunction to generate custom labels for edges.
Defaults to String(data) if not provided.
edgeLabel?: (data: Edata: function (type parameter) E in GraphVizOptions<N, E>E) => string
/**
* Name for the DOT graph.
* Defaults to "G" if not provided.
*/
readonly GraphVizOptions<N, E>.graphName?: string | undefinedName for the DOT graph.
Defaults to "G" if not provided.
graphName?: string
}Referenced by 1 symbols