UNPKG

gramoloss

Version:

Graph theory package for edition and computation

26 lines (25 loc) 801 B
import { Coord, Vect } from './coord'; import { Graph } from './graph'; import { Link } from './link'; export type VertexIndex = number | string; export declare class Vertex { index: VertexIndex; stackedIndex: number; neighbors: Map<VertexIndex, Vertex>; inNeighbors: Map<VertexIndex, Vertex>; outNeighbors: Map<VertexIndex, Vertex>; incidentLinks: Map<number, Link>; graph: Graph; pos: Coord; color: string; innerLabel: string; outerLabel: string; constructor(graph: Graph, index: VertexIndex, stackedIndex: number, x: number, y: number); degree(): number; indegree(): number; outdegree(): number; distTo(other: Vertex): number; translate(shift: Vect): void; getPos(): Coord; isInRectangle(c1: Coord, c2: Coord): boolean; }