Optional
container: Timport React, { FC } from 'react';
import { digraph, toDot } from 'ts-graphviz';
import { Node, Subgraph, render, Edge } from '@ts-graphviz/react';
const Example: FC = () => (
<>
<Node id="a" />
<Subgraph id="my_cluster">
<Node id="b" />
</Subgraph>
<Edge targets={['b', 'a']} />
</>
);
const G = digraph((g) => render(<Example />, g));
console.log(toDot(G));
// digraph {
// "a";
// subgraph "my_cluster" {
// "b";
// }
// "b" -> "a";
// }
Generated using TypeDoc
Convert the given element to Graphviz model.