ts-graphviz
    Preparing search index...

    Interface GraphvizRoot

    Graphviz root interface

    interface GraphvizRoot {
        getTopLevelModels(): DotObjectModel<DotObjectType>[];
        getTopLevelModels<T extends DotObjectModel<DotObjectType>>(
            typeGuard?: (model: DotObjectModel) => model is T,
        ): T[];
        render(element: ReactElement): Promise<void>;
        unmount(): void;
    }
    Index

    Methods

    • Get all top-level models that were rendered (no type parameters)

      Returns DotObjectModel<DotObjectType>[]

      Array of rendered models. In container mode, returns all non-container models. In non-container mode, returns top-level graph models.

    • Get top-level models with generic type casting or type guard filtering

      When called with a type guard function, filters models by type using runtime type checking

      Type Parameters

      Parameters

      • OptionaltypeGuard: (model: DotObjectModel) => model is T

        Type guard function to filter models

      Returns T[]

      Array of models matching the specified type

      When called with only a generic type parameter, casts all models to the specified type (trusted user assertion)

      // Runtime type filtering with type guard
      const nodes = root.getTopLevelModels(isNodeModel);

      // Direct type casting (user knows the type)
      const nodes = root.getTopLevelModels<NodeModel>();
    • Render a React element asynchronously

      Parameters

      • element: ReactElement

      Returns Promise<void>