Skip to content

Commit

Permalink
rotate through a few more spans
Browse files Browse the repository at this point in the history
to display the off-edge bug #949
  • Loading branch information
gordonwoodhull committed Sep 12, 2016
1 parent dd94478 commit 6feb378
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 7 additions & 1 deletion web/transitions/bar-transitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
12 changes: 6 additions & 6 deletions web/transitions/transition-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down

0 comments on commit 6feb378

Please sign in to comment.