Commit 26e669ac0dbf8c81d4b1e37df11eaa8b70d7c4b0

Authored by Renato De Donato
1 parent fcfe75af

treemap conflict

datalets/datasetexplorer-datalet/datasetexplorer-datalet.html
@@ -120,7 +120,7 @@ Example: @@ -120,7 +120,7 @@ Example:
120 </template> 120 </template>
121 121
122 <script src="../shared_js/d3.js"></script> 122 <script src="../shared_js/d3.js"></script>
123 - <script src="js/buildtreemap.js"></script> 123 + <script src="js/buildtreemap2.js"></script>
124 <script> 124 <script>
125 125
126 var DatasetexplorerBehavior = { 126 var DatasetexplorerBehavior = {
@@ -130,7 +130,8 @@ Example: @@ -130,7 +130,8 @@ Example:
130 children : [] 130 children : []
131 }, 131 },
132 132
133 - transformData: function(e){ 133 + transformData: function(e)
  134 + {
134 var treemapData = []; 135 var treemapData = [];
135 DatasetexplorerBehavior.map.name = this._component.title; 136 DatasetexplorerBehavior.map.name = this._component.title;
136 137
@@ -192,7 +193,7 @@ Example: @@ -192,7 +193,7 @@ Example:
192 var xyz = function(url) { 193 var xyz = function(url) {
193 me.selectResource(url); 194 me.selectResource(url);
194 } 195 }
195 - build(this.map, this.meta, "treemap_placeholder", xyz, this._component.width, this._component.height); 196 + build2(this.map, this.meta, this._component.$.treemap_placeholder, xyz, this._component.width, this._component.height);
196 }, 197 },
197 198
198 selectResource: function(url) { 199 selectResource: function(url) {
@@ -223,9 +224,9 @@ Example: @@ -223,9 +224,9 @@ Example:
223 }); 224 });
224 } 225 }
225 this.deleteWaitImage(); 226 this.deleteWaitImage();
226 - },  
227 - }; 227 + }
228 228
  229 + };
229 230
230 Polymer({ 231 Polymer({
231 is : 'datasetexplorer-datalet' , 232 is : 'datasetexplorer-datalet' ,
datalets/datasetexplorer-datalet/js/buildtreemap.js renamed to datalets/datasetexplorer-datalet/js/buildtreemap2.js
@@ -2,10 +2,9 @@ @@ -2,10 +2,9 @@
2 * Created by Utente on 17/07/2015. 2 * Created by Utente on 17/07/2015.
3 */ 3 */
4 4
5 -function build(root, meta, place_holder, select_listener, width, height) {  
6 -  
7 - var plwidth = width >= 0 ? width : $("#" + place_holder).width(),  
8 - plheight = height >= 0 ? height : $("#" + place_holder).height(); 5 +function build2(root, meta, place_holder, select_listener, width, height) {
  6 + var plwidth = width >= 0 ? width : $(place_holder).width(),
  7 + plheight = height >= 0 ? height : $(place_holder).height();
9 8
10 var margin = {top: 20, right: 0, bottom: 0, left: 0}, 9 var margin = {top: 20, right: 0, bottom: 0, left: 0},
11 width = plwidth, 10 width = plwidth,
@@ -27,8 +26,7 @@ function build(root, meta, place_holder, select_listener, width, height) { @@ -27,8 +26,7 @@ function build(root, meta, place_holder, select_listener, width, height) {
27 .ratio(height / width * 0.5 * (1 + Math.sqrt(5))) 26 .ratio(height / width * 0.5 * (1 + Math.sqrt(5)))
28 .round(false); 27 .round(false);
29 28
30 - var svg = d3.select("#" + place_holder)  
31 - .append("svg") 29 + var svg = d3.select(place_holder).append("svg")
32 .attr("width", width + margin.left + margin.right) 30 .attr("width", width + margin.left + margin.right)
33 .attr("height", height + margin.bottom + margin.top) 31 .attr("height", height + margin.bottom + margin.top)
34 .style("margin-left", -margin.left + "px") 32 .style("margin-left", -margin.left + "px")