SVG Graph Network API Documentation - v0.2.0
    Preparing search index...

    Class AutoColorGenerator

    AutoColorGenerator - Automatically generates visually distinct colors for node types

    Uses the golden ratio method to ensure maximum perceptual distinction between colors. Colors are generated deterministically - the same node type will always receive the same color.

    const generator = new AutoColorGenerator();
    const style = generator.generateColorForType('database', 'dark');
    // Returns: { fill: 'hsl(222, 65%, 40%)', stroke: 'hsl(222, 75%, 20%)', ... }
    Index

    Constructors

    Methods

    • Generate a color style for a specific node type

      Parameters

      • nodeType: string

        The type of node to generate colors for

      • themeName: string

        The current theme name (affects color adjustments)

      Returns NodeStyleConfig

      NodeStyleConfig with fill, stroke, strokeWidth, and opacity

    • Reset the generator, clearing all type-to-index mappings Useful when changing themes or restarting color assignments

      Returns void