From 6f8cacdaaec078fcbc59be97eca65a9b5f594370 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Mon, 25 Feb 2019 15:56:59 +0100 Subject: [PATCH] Message now to the right --- www/js/hugvey_console.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/www/js/hugvey_console.js b/www/js/hugvey_console.js index aaaa5a8..c90f528 100644 --- a/www/js/hugvey_console.js +++ b/www/js/hugvey_console.js @@ -495,7 +495,7 @@ class Graph { 'on': { 'click': ( e ) => { if(confirm("Do you want to remove this condition?")) { - console.log('remove condition for direction', condition, direction); +// console.log('remove condition for direction', condition, direction); panopticon.graph.rmCondition( condition, direction ); } } @@ -663,9 +663,9 @@ class Graph { // checkboxes to true/false let defs = g.getConditionTypes()[type]; - console.log(defs); +// console.log(defs); for(let field in defs) { - console.log(field); +// console.log(field); if(defs[field]['type'] == 'checkbox') { console.info('configure checkbox', field); form.set(field, form.has(field)); @@ -681,7 +681,7 @@ class Graph { vars = g._formPathToVars(pair[0], pair[1], vars); } // TODO: checkboxes - console.log("Createded", vars); +// console.log("Createded", vars); g.addConditionForDirection( type, label, vars, direction ); } } @@ -863,6 +863,7 @@ class Graph { createConnectedMsg(sourceMsg) { let newMsg = this.addMsg(); + this.getNodeById(newMsg['@id']).y = this.getNodeById(sourceMsg['@id']).y this.addDirection(sourceMsg, newMsg); this.build(); @@ -920,7 +921,7 @@ class Graph { let toRemove = ['sourceX', 'sourceY', 'targetX', 'targetY', 'vx', 'vy'] for ( let node of this.data ) { let n = {}; - console.log( node['source'] ); +// console.log( node['source'] ); for ( let e in node ) { if ( node.hasOwnProperty( e ) && toRemove.indexOf( e ) == -1 ) { if ( this.data.indexOf( node[e] ) != -1 ) { @@ -1040,10 +1041,10 @@ class Graph { .force( "link", d3.forceLink( this.directions ).id( d => d['@id'] ).strength(0) ) // .force( "charge", d3.forceManyBody().strength( 100 ) ) // .force( "center", d3.forceCenter( this.width / 2, this.height / 2 ) ) - .force( "collide", d3.forceCollide( this.nodeSize * 2.3 ).strength(2) ) + .force( "collide", d3.forceCollide( this.nodeSize * 1.5 ).strength(1) ) .force( "forceX", d3.forceX(function(m){ let fx = panopticon.graph.distances[m['@id']] !== null ? panopticon.graph.distances[m['@id']] * panopticon.graph.nodeSize * 4 : 0 - console.log('fx', m['@id'], panopticon.graph.distances[m['@id']], fx); +// console.log('fx', m['@id'], panopticon.graph.distances[m['@id']], fx); return fx; }).strength(50)) // .force( "forceY", d3.forceY(m => panopticon.graph.distances[m['@id']] !== null ? 0 : panopticon.graph.nodeSize * 3 ).strength(30)) @@ -1229,7 +1230,7 @@ class Graph { let targetsPerMsg = {}; let sourcesPerMsg = {}; - console.log("dir", this.directions); +// console.log("dir", this.directions); for(let direction of this.directions) { let from = typeof direction['source'] == "string" ? direction['source'] : direction['source']['@id']; let to = typeof direction['target'] == "string" ? direction['target'] : direction['target']['@id']; @@ -1248,7 +1249,7 @@ class Graph { let traverseMsg = function(msgId, depth, goingDown) { let msgsPerMsg = goingDown ? targetsPerMsg : sourcesPerMsg; - console.log(goingDown, msgId, depth); +// console.log(goingDown, msgId, depth); if(!msgsPerMsg.hasOwnProperty(msgId)) { // end of trail return;