Options
All
  • Public
  • Public/Protected
  • All
Menu

The generator class uses the generated file structure in the walker class to generate a .dot file which it passes to the dot software to generate a graph

export
implements

{IGenerator}

Hierarchy

  • Generator

Implements

Index

Constructors

constructor

  • new Generator(directory: string, structure: IWalkerStructure, name: string, pathedFileList: string[], allFiles: boolean, logger: Logger, outputType?: undefined | string, verbose?: undefined | false | true): Generator
  • Creates an instance of Generator.

    memberof

    Generator

    Parameters

    • directory: string
    • structure: IWalkerStructure
    • name: string
    • pathedFileList: string[]
    • allFiles: boolean
    • logger: Logger
    • Optional outputType: undefined | string
    • Optional verbose: undefined | false | true

    Returns Generator

Properties

Private allFiles

allFiles: boolean

Private codemapperDirectory

codemapperDirectory: string

The directory to save the output files to

memberof

Generator

Private colourSelector

colourSelector: number = 0

Used to pick a colour from the colours array

memberof

Generator

Private colours

colours: string[] = ["red","orange","darkgreen","blue","purple","chocolate2","gold","black","deeppink2","firebrick2","limegreen","yellow","turquoise1",]

Used to assign random colours to groups of lines

memberof

Generator

Private connectionsCodeCache

connectionsCodeCache: string = ""

Holds the connections code until it can be added to the main dot code

memberof

Generator

Private directory

directory: string

Private logger

logger: Logger

Private name

name: string

Private Optional outputType

outputType: undefined | string

Private pathedFileList

pathedFileList: string[]

Private structure

structure: IWalkerStructure

Private Optional verbose

verbose: undefined | false | true

Methods

Private addFiles

  • addFiles(files: string[], dotCode: string): string

Private addSubgraphs

  • addSubgraphs(dotCode: string, structure: object, depth?: number): string
  • Add subgraphs to the code

    memberof

    Generator

    Parameters

    • dotCode: string
    • structure: object
    • Default value depth: number = 0

    Returns string

Private checkDir

  • checkDir(directory?: undefined | string): string
  • Remove the last / or \ from the directory string if found

    memberof

    Generator

    Parameters

    • Optional directory: undefined | string

    Returns string

Private checkForDot

  • checkForDot(): { found: boolean; path?: undefined | string }
  • Check if dot is in the path, otherwise check for the install path

    memberof

    Generator

    Returns { found: boolean; path?: undefined | string }

    • found: boolean
    • Optional path?: undefined | string

Private cleanLines

  • cleanLines(lines: string[]): string[]

Private convertStructToDot

  • convertStructToDot(): Promise<string>

Private findPath

  • findPath(filename: string): string | undefined

Private findWindowsDir

  • findWindowsDir(): string | void

generate

  • generate(): Promise<void>

Private getFileLinks

  • getFileLinks(filename: string, nodeName: string): void

Private runDot

  • runDot(): Promise<void>

Private writeFile

  • writeFile(data: string, name: string): Promise<void>

Generated using TypeDoc