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 | 116 | */ |
| 117 | 117 | graph : { |
| 118 | 118 | type : Object, |
| 119 | - value : undefined | |
| 119 | + value : {} | |
| 120 | 120 | }, |
| 121 | 121 | |
| 122 | 122 | gnodes : { |
| ... | ... | @@ -373,6 +373,15 @@ Example: |
| 373 | 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 | 386 | * It is called after the element’s template has been stamped and all elements inside the element’s local |
| 378 | 387 | * DOM have been configured (with values bound from parents, deserialized attributes, or else default values) |
| ... | ... | @@ -395,12 +404,6 @@ Example: |
| 395 | 404 | .attr("pointer-events", "all") |
| 396 | 405 | .attr("style", "transform:translate(0px)") |
| 397 | 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 | 409 | </script> | ... | ... |
datalets/graph-datalet/graph-with-clustering-datalet.html