24 lines
		
	
	
		
			575 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			575 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import { Node } from './Node';
 | 
						|
import { Edge } from './Edge';
 | 
						|
 | 
						|
export class Graph extends Node {
 | 
						|
  public children: Array<Graph> = [];
 | 
						|
  public nodes: Array<GraphNode> = [];
 | 
						|
  public is_root = false;
 | 
						|
  public edges: Array<Edge>;
 | 
						|
 | 
						|
  // eslint-disable-next-line @typescript-eslint/naming-convention
 | 
						|
  public toString (): string {
 | 
						|
    return `subgraph cluster_${this.full_name} { 
 | 
						|
  ${this.children.map ((c) => c.toString ())
 | 
						|
    .join ('\n')}
 | 
						|
  
 | 
						|
  ${this.nodes.map ((c) => c.toString ())
 | 
						|
    .join ('\n')}
 | 
						|
 | 
						|
  ${this.edges.map ((c) => c.toString ())
 | 
						|
    .join ('\n')}
 | 
						|
}`;
 | 
						|
  }
 | 
						|
}
 |