forked from neo4j-contrib/neovis.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
65 lines (56 loc) · 1.71 KB
/
index.d.ts
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { DataSet } from "vis-data";
import { Node as VisNode, Edge as VisEdge } from "vis-network";
import { Node as Neo4jNode, Relationship as Neo4jRelationship } from "neo4j-driver";
export const NEOVIS_DEFAULT_CONFIG: unique symbol;
export interface ILabelConfig {
caption?: string;
size?: string;
community?: string;
sizeCypher?: string;
image?: string;
}
export interface IRelationshipConfig {
thickness?: string;
caption?: boolean | string;
}
export interface INeovisConfig {
container_id: string;
server_url: string;
server_user: string;
server_password: string;
labels?: {
[label: string]: ILabelConfig,
[NEOVIS_DEFAULT_CONFIG]?: IRelationshipConfig
};
relationships?: {
[relationship: string]: IRelationshipConfig,
[NEOVIS_DEFAULT_CONFIG]?: IRelationshipConfig
};
arrows?: boolean;
hierarchical?: boolean;
hierarchical_sort_method?: "hubsize" | "directed";
initial_cypher?: string;
console_debug?: boolean;
encrypted?: "ENCRYPTION_OFF" | "ENCRYPTION_ON";
trust?: "TRUST_ALL_CERTIFICATES" | "TRUST_SYSTEM_CA_SIGNED_CERTIFICATES";
}
export interface INode extends VisNode {
raw: Neo4jNode
}
export interface IEdge extends VisEdge {
raw: Neo4jRelationship
}
declare class Neovis {
constructor(config: INeovisConfig);
get nodes(): DataSet<INode>;
get edges(): DataSet<IEdge>;
render(): void;
clearNetwork(): void;
registerOnEvent(eventType: string, handler: (event: any) => void): void;
reinit(config: INeovisConfig): void;
reload(): void;
stabilize(): void;
renderWithCypher(query: string): void;
updateWithCypher(query: string): void;
}
export default Neovis;