Commit 5b73d0352cae6b60430b5fb98c2ce91a1bfafd0b

Authored by Antoine Goutenoir
1 parent c298e1ad
Exists in master

Animate the scaling laws plot.

Showing 1 changed file with 16 additions and 2 deletions   Show diff stats
flaskr/templates/home.html
... ... @@ -166,16 +166,30 @@ jQuery(document).ready(function($){
166 166 return xSubgroup(d.key);
167 167 })
168 168 .attr("y", function (d) {
169   - return y(d.value);
  169 + return y(0);
170 170 })
171 171 .attr("width", xSubgroup.bandwidth())
172 172 .attr("height", function (d) {
173   - return height - y(d.value);
  173 + return 0;
174 174 })
  175 + //.attr("height", function (d) {
  176 + // return height - y(d.value);
  177 + //})
175 178 .attr("fill", function (d) {
176 179 return color(d.key);
177 180 });
178 181  
  182 + svg.selectAll("rect")
  183 + .transition()
  184 + .duration(500)
  185 + .attr("y", function (d) {
  186 + return y(d.value);
  187 + })
  188 + .attr("height", function (d) {
  189 + return height - y(d.value);
  190 + })
  191 + .delay(function(d, i) { return(i*100); });
  192 +
179 193 // Title
180 194 svg.append("g")
181 195 .append('text')
... ...