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 131 .call(rect)
132 132 .attr("onmousemove", function(d) {
133 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 136 var id = d.name.split(':')[1];
136 137 if (d.depth == 1) {
137 138 // FIRST LVL
138 139 data[0] = "first";
139 140 data[1] = meta[id]['title'];
140 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 143 //data[5] = d.value;
145 144 } else if (d._children && !d._children[0]._children) {
146 145 // LAST LVL
147 146 data[0] = "last";
148   - //data[6] = "datasert url";//???
  147 + //data[6] = "datasert url";
149 148 } else {
150 149 // MIDDLE LVL
151 150 data[0] = "middle";
152   - //data[5] = "1111";//meta???
153 151 }
154   - //console.log(data);
155   - //console.log(data.toString());
156 152 return "showTooltip(event, '" + data + "')";
157 153 })
158 154 .attr("onmouseout", function() {return "hideTooltip()";})
159   - //.append("title")
160   - //.text(function(d) { return d.name; /*formatNumber(d.value);*/ });
161 155  
162 156 g.append("text")
163 157 .attr("dy", ".75em")
... ...
datalets/datasetexplorer-datalet/treemap_tooltip.html
... ... @@ -65,7 +65,7 @@
65 65 margin: 0px;
66 66 padding: 0px;
67 67 height: 64px;
68   - width: 64px;
  68 + /*width: 64px;*/
69 69 }
70 70  
71 71 p {
... ... @@ -83,9 +83,9 @@
83 83 <iron-icon icon="communication:call-made" class="this" style$="color: {{color}};"></iron-icon>
84 84 <div class="tooltip_top">
85 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 87 </div>
88   - <p><i>{{description}}</i></p>
  88 + <p><b style$="color: {{color}};">{{name}}</b>: <i>{{description}}</i></p>
89 89 <p>There are <b>{{datasets}}</b> datasets.</p>
90 90 </paper-dialog>
91 91  
... ...