diff --git a/web/transitions/bar-transitions.html b/web/transitions/bar-transitions.html
index fee535669..4e345bdab 100644
--- a/web/transitions/bar-transitions.html
+++ b/web/transitions/bar-transitions.html
@@ -60,7 +60,13 @@
chart.x().domain([16,20]);
}, reset);
window.button3 = transitionTest.oscillate(function() {
- chart.x().domain([6,14]);
+ chart.x().domain([6.5,13.5]);
+ }, function() {
+ chart.x().domain([4.25,9.5]);
+ }, function() {
+ chart.x().domain([11.5,17.25]);
+ }, function() {
+ chart.x().domain([8.25,13.25]);
}, reset);
window.button4 = transitionTest.oscillate(function() {
chart.x().domain([0,10]);
diff --git a/web/transitions/transition-test.js b/web/transitions/transition-test.js
index fe25dd8f4..2ac25f7c6 100644
--- a/web/transitions/transition-test.js
+++ b/web/transitions/transition-test.js
@@ -22,17 +22,17 @@ var transitionTest = (function() {
window.clearInterval(inter);
inter = null;
}
- function oscillate(f1, f2) {
+ function oscillate() {
+ var fs = Array.prototype.slice.apply(arguments);
+ var curr = 0;
return function() {
stop();
var which = false;
- f1();
+ fs[curr]();
dc.redrawAll();
inter = window.setInterval(function() {
- if((which = !which))
- f2();
- else
- f1();
+ curr = (curr+1) % fs.length;
+ fs[curr]();
dc.redrawAll();
}, duration+pause);
};