Commit 916a655488d65f97b7e8ccd6daeddf7f84af246b
1 parent
2d8cf127
graph datalets updates
Showing
2 changed files
with
10 additions
and
9 deletions
datalets/graph-datalet/graph-datalet.html
@@ -116,7 +116,7 @@ Example: | @@ -116,7 +116,7 @@ Example: | ||
116 | */ | 116 | */ |
117 | graph : { | 117 | graph : { |
118 | type : Object, | 118 | type : Object, |
119 | - value : undefined | 119 | + value : {} |
120 | }, | 120 | }, |
121 | 121 | ||
122 | gnodes : { | 122 | gnodes : { |
@@ -373,6 +373,15 @@ Example: | @@ -373,6 +373,15 @@ Example: | ||
373 | this.mouseout(); | 373 | this.mouseout(); |
374 | }, | 374 | }, |
375 | 375 | ||
376 | + init : function(){ | ||
377 | + | ||
378 | + if(this.graph.nodes.length > 0){ | ||
379 | + this.graph.nodes[0].x = this.width / 2; | ||
380 | + this.graph.nodes[0].y = this.height / 8; | ||
381 | + this.buildGraph(); | ||
382 | + } | ||
383 | + }, | ||
384 | + | ||
376 | /** | 385 | /** |
377 | * It is called after the element’s template has been stamped and all elements inside the element’s local | 386 | * It is called after the element’s template has been stamped and all elements inside the element’s local |
378 | * DOM have been configured (with values bound from parents, deserialized attributes, or else default values) | 387 | * DOM have been configured (with values bound from parents, deserialized attributes, or else default values) |
@@ -395,12 +404,6 @@ Example: | @@ -395,12 +404,6 @@ Example: | ||
395 | .attr("pointer-events", "all") | 404 | .attr("pointer-events", "all") |
396 | .attr("style", "transform:translate(0px)") | 405 | .attr("style", "transform:translate(0px)") |
397 | .style("position", "absolute"); | 406 | .style("position", "absolute"); |
398 | - | ||
399 | - if(this.graph.nodes.length > 0){ | ||
400 | - this.graph.nodes[0].x = this.width / 2; | ||
401 | - this.graph.nodes[0].y = this.height / 8; | ||
402 | - this.buildGraph(); | ||
403 | - } | ||
404 | } | 407 | } |
405 | }); | 408 | }); |
406 | </script> | 409 | </script> |
datalets/graph-datalet/graph-with-clustering-datalet.html
@@ -567,8 +567,6 @@ Example: | @@ -567,8 +567,6 @@ Example: | ||
567 | .attr("pointer-events", "all") | 567 | .attr("pointer-events", "all") |
568 | .attr("style", "transform:translate(0px)") | 568 | .attr("style", "transform:translate(0px)") |
569 | .style("position", "absolute"); | 569 | .style("position", "absolute"); |
570 | - | ||
571 | - this.buildGraph(); | ||
572 | } | 570 | } |
573 | }); | 571 | }); |
574 | </script> | 572 | </script> |