Skip to main content
Module

x/graphviz/mod.ts>ICluster

🦕 Simple Graphviz library for Deno.
Latest
interface ICluster
Re-export
import { type ICluster } from "https://deno.land/x/graphviz@v0.2.1/mod.ts";

Type Parameters

optional
T extends string = string

Properties

readonly
optional
id: string
readonly
attributes: Readonly<IClusterCommonAttributes>
readonly
nodes: ReadonlyArray<INode>
readonly
edges: ReadonlyArray<IEdge>
readonly
subgraphs: ReadonlyArray<ISubgraph>

Methods

addNode(node: INode): void

Add a Node to the cluster.

addEdge(edge: IEdge): void

Add Edge to the cluster.

addSubgraph(subgraph: ISubgraph): void

Add a Subgraph to the cluster.

existNode(nodeId: string): boolean

Check if the Node exists in the cluster.

existEdge(edge: IEdge): boolean

Check if the Edge exists in the cluster.

existSubgraph(subgraph: ISubgraph): boolean

Check if the Subgraph exists in the cluster.

removeNode(node: INode | string): void

Remove Node from the cluster.

removeEdge(edge: IEdge): void

Remove Edge from the cluster.

removeSubgraph(subgraph: ISubgraph): void

Remove Subgraph from the cluster.

createNode(id: string, attributes?: NodeAttributes): INode

Create a Node in the cluster.

createSubgraph(id?: string, attributes?: ClusterSubgraphAttributes): ISubgraph

Create a Subgraph and add it to the cluster.

createSubgraph(attributes?: ClusterSubgraphAttributes): ISubgraph
getSubgraph(id: string): ISubgraph | undefined

Get Subgraph in cluster by specifying id.

If there is no Subgraph with the specified id in the cluster, return undefined.

getNode(id: string): INode | undefined

Get Node in cluster by specifying id.

createEdge(targets: (EdgeTargetLike | EdgeTargetsLike)[], attributes?: EdgeAttributes): IEdge

Create Edge and add it to the cluster.

subgraph(id?: string, callback?: (subgraph: ISubgraph) => void): ISubgraph

Declarative API for Subgraph.

subgraph(
id?: string,
callback?: (subgraph: ISubgraph) => void,
): ISubgraph
subgraph(attributes?: ClusterSubgraphAttributes, callback?: (subgraph: ISubgraph) => void): ISubgraph
subgraph(callback?: (subgraph: ISubgraph) => void): ISubgraph
node(id: string, callback?: (node: INode) => void): INode

Declarative API for Node.

node(
id: string,
attributes?: NodeAttributes,
callback?: (node: INode) => void,
): INode
edge(targets: (EdgeTargetLike | EdgeTargetsLike)[], callback?: (edge: IEdge) => void): IEdge

Declarative API for Edge.

edge(
attributes?: EdgeAttributes,
callback?: (edge: IEdge) => void,
): IEdge