-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenums.ts
More file actions
47 lines (41 loc) · 1.12 KB
/
enums.ts
File metadata and controls
47 lines (41 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
export type base_id = string | number;
export interface EdgeNeighborhood {
from: {
id: base_id;
neighbors: base_id[];
};
to: {
id: base_id;
neighbors: base_id[];
};
}
export interface VertexArgs {
id: base_id;
weight?: number;
}
export interface EdgeArgs {
from: base_id;
to: base_id;
id?: base_id;
weight?: number;
do_force?: boolean;
}
export interface NetworkArgs {
is_directed?: boolean;
is_multigraph?: boolean;
edge_limit?: number;
vertex_limit?: number;
}
export type ParsedCSV = string[][];
export const ERROR = {
UNDEFINED_VALUES: "Undefined values being given as arguments!",
EDGE_LIMIT: "Can't add new edge. Limit of Edges exceeded",
VERTICE_LIMIT: "Can't add new vertex. Limit of Vertices exceeded",
EXISTING_EDGE: "Trying to add an edge with already existing ID",
EXISTING_VERTICE: "Trying to add a vertex with already existing ID",
INEXISTENT_VERTICE: "Vertex doesn't exist",
NOT_MULTIGRAPH:
"Trying to add multiple edges between two vertices. Graph is not a multigraph!",
UNDEFINED_ID: "Tried to use undefined id as input",
SELF_LOOP: "No self-loops",
};