• Converts the given element to DOT language and returns it.

    Parameters

    • element: ReactElement<any, string | JSXElementConstructor<any>>
    • Optional container: RootGraphModel

    Returns string

    Rendered dot string

    Example

    import React, { FC } from 'react';
    import { Digraph, Node, Subgraph, renderToDot, Edge } from '@ts-graphviz/react';

    const Example: FC = () => (
    <Digraph>
    <Node id="a" />
    <Subgraph id="my_cluster">
    <Node id="b" />
    </Subgraph>
    <Edge targets={['b', 'a']} />
    </Digraph>
    );

    const dot = renderToDot(<Example />);
    console.log(dot);
    // digraph {
    // "a";
    // subgraph "my_cluster" {
    // "b";
    // }
    // "b" -> "a";
    // }

Generated using TypeDoc