nope/resources/ui/graph/interfaces/IVisjsOptions.ts

102 lines
2.2 KiB
TypeScript
Raw Normal View History

2020-10-25 20:14:51 +00:00
/**
* @author Martin Karkowski
* @email m.karkowski@zema.de
* @create date 2020-03-12 12:36:28
* @modify date 2020-03-12 12:36:28
* @desc [description]
*/
import { IBaseNodeOptions } from './IBaseNodeOptions';
import { IBaseEdgeOptions } from './IBaseEdgeOptions';
export interface IVisjsOptions {
autoResize?: boolean;
layout?: Layout;
nodes?: Nodes & Partial<IBaseNodeOptions>;
edges?: Edges & Partial<IBaseEdgeOptions>;
physics?: Physics | boolean;
interaction?: Interaction | boolean;
manipulation?: IManipulation | boolean;
height?: string
2020-10-25 20:14:51 +00:00
}
export interface IManipulation {
enabled?: boolean,
initiallyActive?: boolean,
addNode?: boolean,
addEdge?: boolean,
editNode?: undefined,
editEdge?: boolean,
deleteNode?: boolean,
deleteEdge?: boolean,
controlNodeStyle?:IBaseNodeOptions
}
export interface Edges {
arrows?: string;
smooth?: boolean;
shadow?: boolean;
color?: Color;
font?: Font;
}
export interface Color {
inherit: boolean;
}
export interface Font {
background: string;
}
export interface Interaction {
multiselect?: boolean;
hover?: boolean;
dragNodes?: boolean,
dragView?: boolean,
hideEdgesOnDrag?: boolean,
hideNodesOnDrag?: boolean,
keyboard?: {
enabled: boolean
},
navigationButtons?: boolean,
selectable?: boolean,
zoomView?: boolean
}
export interface Layout {
hierarchical: Hierarchical;
}
export interface Hierarchical {
enabled: boolean;
}
export interface Nodes {
shadow: boolean;
}
export interface Physics {
enabled?: boolean;
stabilization?: Stabilization;
solver?: string;
barnesHut?: BarnesHut;
}
export interface BarnesHut {
gravitationalConstant: number;
centralGravity: number;
springLength: number;
springConstant: number;
damping: number;
avoidOverlap: number;
}
export interface Stabilization {
enabled: boolean;
iterations: number;
updateInterval: number;
onlyDynamicEdges: boolean;
fit: boolean;
}