transitive-js
Version:
A tool for generating dynamic stylized transit maps that are easy to understand.
64 lines (63 loc) • 2.19 kB
TypeScript
/**
* A graph representing the underlying 'wireframe' network
*/
export default class NetworkGraph {
constructor(network: any, vertices: any);
network: any;
edges: any[];
vertices: any[];
/**
* Object mapping groups of edges that share the same two vertices.
* - Key is string of format A_B, where A and B are vertex IDs and A < B
* - Value is array of edges
*/
edgeGroups: {};
/**
* Get the bounds of the graph in the graph's internal x/y coordinate space
*
* @return [[left, top], [right, bottom]]
*/
bounds(): any[][];
/**
* Add Vertex
*/
addVertex(point: any, x: any, y: any): Vertex;
/**
* Add Edge
*/
addEdge(stops: any, from: any, to: any, segmentType: any): Edge | undefined;
removeEdge(edge: any): void;
getEdgeGroup(edge: any): any;
getEdgeGroupKey(edge: any, segmentType: any): string;
mergeVertices(vertexArray: any): void;
sortVertices(): void;
/**
* Get the equivalent edge
*/
getEquivalentEdge(pointArray: any, from: any, to: any): any;
/**
* Split a specified graph edge around a set of specified split points, where
* all split points are internal points of the edge to be split. A set of N
* valid split points will result in N+1 new edges. The original edge is
* removed from the graph.
*/
splitEdgeAtInternalPoints(edge: any, points: any): void;
pruneVertices(): void;
mergeEdges(edge1: any, edge2: any): void;
snapToGrid(cellSize: any): void;
calculateGeometry(cellSize: any, angleConstraint: any): void;
resetCoordinates(): void;
recenter(): void;
/** 2D line bundling & offsetting **/
apply2DOffsets(): void;
currentAlignmentId: any;
/**
* Traverses the graph vertex-by-vertex, creating comparisons between all pairs of
* edges for which a topological relationship can be established.
*/
initComparisons(): void;
bundleComparisons: {} | undefined;
storeComparison(s1: any, s2: any): void;
}
import Vertex from "./vertex";
import Edge from "./edge";