From 5b73d0352cae6b60430b5fb98c2ce91a1bfafd0b Mon Sep 17 00:00:00 2001 From: Antoine Goutenoir Date: Wed, 30 Oct 2019 06:55:40 +0100 Subject: [PATCH] Animate the scaling laws plot. --- flaskr/templates/home.html | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/flaskr/templates/home.html b/flaskr/templates/home.html index 647fc87..224a1ff 100755 --- a/flaskr/templates/home.html +++ b/flaskr/templates/home.html @@ -166,16 +166,30 @@ jQuery(document).ready(function($){ return xSubgroup(d.key); }) .attr("y", function (d) { - return y(d.value); + return y(0); }) .attr("width", xSubgroup.bandwidth()) .attr("height", function (d) { - return height - y(d.value); + return 0; }) + //.attr("height", function (d) { + // return height - y(d.value); + //}) .attr("fill", function (d) { return color(d.key); }); + svg.selectAll("rect") + .transition() + .duration(500) + .attr("y", function (d) { + return y(d.value); + }) + .attr("height", function (d) { + return height - y(d.value); + }) + .delay(function(d, i) { return(i*100); }); + // Title svg.append("g") .append('text') -- libgit2 0.21.2