Commit fb7aea2cb27fe274af299f4e1a47989ab4fa34b5

Authored by Renato De Donato
1 parent 57372c47

tooltip, a new hope!

datalets/datasetexplorer-datalet/js/buildtreemap.js
@@ -131,33 +131,27 @@ function build(root, meta, place_holder, select_listener, width, height) { @@ -131,33 +131,27 @@ function build(root, meta, place_holder, select_listener, width, height) {
131 .call(rect) 131 .call(rect)
132 .attr("onmousemove", function(d) { 132 .attr("onmousemove", function(d) {
133 //var data = ["lvl", "name", "color", "description", "logoUrl", "datasets", "datasetUrl"]; 133 //var data = ["lvl", "name", "color", "description", "logoUrl", "datasets", "datasetUrl"];
134 - var data = ["", d.name, d.color, "", "", d.value, ""] 134 + var data = ["", d.name, d.color, "", "", d.value, ""];
  135 + data[2] = ["#000000"];
135 var id = d.name.split(':')[1]; 136 var id = d.name.split(':')[1];
136 if (d.depth == 1) { 137 if (d.depth == 1) {
137 // FIRST LVL 138 // FIRST LVL
138 data[0] = "first"; 139 data[0] = "first";
139 data[1] = meta[id]['title']; 140 data[1] = meta[id]['title'];
140 data[3] = meta[id]['description']; 141 data[3] = meta[id]['description'];
141 - data[4] = meta[id]['logo_url'];  
142 - data[4] = ODE.THEME_IMAGES_URL + "/logos/"+id+".png";  
143 - console.log(data[4]); 142 + data[4] = ((ODE.THEME_IMAGES_URL == undefined) ? parent.ODE.THEME_IMAGES_URL : ODE.THEME_IMAGES_URL) + "/logos/"+id+".png";//meta[id]['logo_url'];
144 //data[5] = d.value; 143 //data[5] = d.value;
145 } else if (d._children && !d._children[0]._children) { 144 } else if (d._children && !d._children[0]._children) {
146 // LAST LVL 145 // LAST LVL
147 data[0] = "last"; 146 data[0] = "last";
148 - //data[6] = "datasert url";//??? 147 + //data[6] = "datasert url";
149 } else { 148 } else {
150 // MIDDLE LVL 149 // MIDDLE LVL
151 data[0] = "middle"; 150 data[0] = "middle";
152 - //data[5] = "1111";//meta???  
153 } 151 }
154 - //console.log(data);  
155 - //console.log(data.toString());  
156 return "showTooltip(event, '" + data + "')"; 152 return "showTooltip(event, '" + data + "')";
157 }) 153 })
158 .attr("onmouseout", function() {return "hideTooltip()";}) 154 .attr("onmouseout", function() {return "hideTooltip()";})
159 - //.append("title")  
160 - //.text(function(d) { return d.name; /*formatNumber(d.value);*/ });  
161 155
162 g.append("text") 156 g.append("text")
163 .attr("dy", ".75em") 157 .attr("dy", ".75em")
datalets/datasetexplorer-datalet/treemap_tooltip.html
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
65 margin: 0px; 65 margin: 0px;
66 padding: 0px; 66 padding: 0px;
67 height: 64px; 67 height: 64px;
68 - width: 64px; 68 + /*width: 64px;*/
69 } 69 }
70 70
71 p { 71 p {
@@ -83,9 +83,9 @@ @@ -83,9 +83,9 @@
83 <iron-icon icon="communication:call-made" class="this" style$="color: {{color}};"></iron-icon> 83 <iron-icon icon="communication:call-made" class="this" style$="color: {{color}};"></iron-icon>
84 <div class="tooltip_top"> 84 <div class="tooltip_top">
85 <div class="tooltip_logo"><img class="tooltip_img" src$={{logoUrl}}></div> 85 <div class="tooltip_logo"><img class="tooltip_img" src$={{logoUrl}}></div>
86 - <div class="tooltip_name" style$="color: {{color}};">{{name}}</div> 86 + <!--<div class="tooltip_name" style$="color: {{color}};">{{name}}</div>-->
87 </div> 87 </div>
88 - <p><i>{{description}}</i></p> 88 + <p><b style$="color: {{color}};">{{name}}</b>: <i>{{description}}</i></p>
89 <p>There are <b>{{datasets}}</b> datasets.</p> 89 <p>There are <b>{{datasets}}</b> datasets.</p>
90 </paper-dialog> 90 </paper-dialog>
91 91