From ae7ee9cc3f4ab0bb7ea05da08e4a6c015d03f923 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Thu, 30 Aug 2018 08:45:20 +0000 Subject: [PATCH] refacto: third round (Better node coloring, exception catching and comments) --- static/js/treeFromJson.js | 79 +++++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 29 deletions(-) diff --git a/static/js/treeFromJson.js b/static/js/treeFromJson.js index 572b412..6a3e96d 100644 --- a/static/js/treeFromJson.js +++ b/static/js/treeFromJson.js @@ -65,6 +65,7 @@ this.root.x0 = this.height / 2; this.root.y0 = 0; + // mapping table related if (this.options.toBeMapped.length > 0 ) { this.instructions = {}; this.prefillData = {}; @@ -117,7 +118,7 @@ let size = d.linkname !== undefined ? text : 0; maxSizePerDepth[d.depth] = size > m ? size : m; }); - // add previous level together + // add incrementally previous level together for (var i=1; i