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
+4 -2
View File
@@ -30,9 +30,11 @@ const merge = (ref, src) => {
};
const DEFAULT_OPTIONS = {
'expand': 'h',
'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';
+2
View File
@@ -4,7 +4,9 @@ const faDiagrams = require('../src/index');
test('test fail placing', () => {
const data = {
options: {
'placing': {
'diagonals': false,
}
},
nodes: [
{name: '1', icon: ''},