nope/resources/ui/graph/defaults/default.graph-options.ts

81 lines
1.9 KiB
TypeScript
Raw Normal View History

2020-10-25 20:14:51 +00:00
/**
* @author Martin Karkowski
* @email m.karkowski@zema.de
* @create date 2019-05-06 08:34:10
* @modify date 2020-04-09 08:50:44
* @desc [description]
*/
import { IVisjsOptions } from '../interfaces/IVisjsOptions';
export function generateGraphOptions(): IVisjsOptions {
return {
layout: {
hierarchical: {
enabled: false,
}
},
nodes: {
shadow: false,
},
edges: {
arrows: 'to',
smooth: false,
shadow: false,
color: {
inherit: false
},
font: {
background: 'white'
}
},
physics: {
enabled: false,
stabilization: {
enabled: false,
iterations: 1000,
updateInterval: 100,
onlyDynamicEdges: false,
fit: true
},
solver: 'barnesHut',
barnesHut: {
gravitationalConstant: -2000,
centralGravity: 0.3,
springLength: 95,
springConstant: 0.04,
damping: 0.09,
avoidOverlap: 0.5
},
},
interaction: {
multiselect: true,
hover: true
},
};
}
export function defaultStaticOptions(): IVisjsOptions{
return {
autoResize: false,
manipulation: {
enabled: false,
},
interaction: {
dragNodes: false,
dragView: false,
hideEdgesOnDrag: false,
hideNodesOnDrag: false,
hover: true,
keyboard: {
enabled: false
},
multiselect: false,
navigationButtons: false,
selectable: false,
zoomView: false
},
physics: false
};
}