From 916a655488d65f97b7e8ccd6daeddf7f84af246b Mon Sep 17 00:00:00 2001 From: luigser Date: Fri, 19 Feb 2016 13:12:53 +0100 Subject: [PATCH] graph datalets updates --- datalets/graph-datalet/graph-datalet.html | 17 ++++++++++------- datalets/graph-datalet/graph-with-clustering-datalet.html | 2 -- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/datalets/graph-datalet/graph-datalet.html b/datalets/graph-datalet/graph-datalet.html index 985fbcf..d125ffa 100755 --- a/datalets/graph-datalet/graph-datalet.html +++ b/datalets/graph-datalet/graph-datalet.html @@ -116,7 +116,7 @@ Example: */ graph : { type : Object, - value : undefined + value : {} }, gnodes : { @@ -373,6 +373,15 @@ Example: this.mouseout(); }, + init : function(){ + + if(this.graph.nodes.length > 0){ + this.graph.nodes[0].x = this.width / 2; + this.graph.nodes[0].y = this.height / 8; + this.buildGraph(); + } + }, + /** * It is called after the element’s template has been stamped and all elements inside the element’s local * DOM have been configured (with values bound from parents, deserialized attributes, or else default values) @@ -395,12 +404,6 @@ Example: .attr("pointer-events", "all") .attr("style", "transform:translate(0px)") .style("position", "absolute"); - - if(this.graph.nodes.length > 0){ - this.graph.nodes[0].x = this.width / 2; - this.graph.nodes[0].y = this.height / 8; - this.buildGraph(); - } } }); diff --git a/datalets/graph-datalet/graph-with-clustering-datalet.html b/datalets/graph-datalet/graph-with-clustering-datalet.html index 3e4807b..219734d 100755 --- a/datalets/graph-datalet/graph-with-clustering-datalet.html +++ b/datalets/graph-datalet/graph-with-clustering-datalet.html @@ -567,8 +567,6 @@ Example: .attr("pointer-events", "all") .attr("style", "transform:translate(0px)") .style("position", "absolute"); - - this.buildGraph(); } }); -- libgit2 0.21.4