options separation

This commit is contained in:
Klemek
2019-07-12 09:26:30 +02:00
parent 513de5dd97
commit 04d92981a9
2 changed files with 9 additions and 5 deletions
+6 -4
View File
@@ -30,9 +30,11 @@ const merge = (ref, src) => {
};
const DEFAULT_OPTIONS = {
'expand': 'h',
'max-link-length': 2,
'diagonals': true,
'placing': {
'max-link-length': 2,
'diagonals': true,
},
'rendering': {}
};
@@ -50,7 +52,7 @@ const self = {
links.filter(l => !nodes[l.to]).forEach(l => console.warn(`unknown destination node "${l.to}"`));
links = links.filter(l => nodes[l.from] && nodes[l.to]);
nodes = placing(options).compute(nodes, links);
nodes = placing(options['placing']).compute(nodes, links);
if (!nodes)
throw 'Failed to place nodes';