forked from vogievetsky/KoalasToTheMax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stuff
23 lines (22 loc) · 841 Bytes
/
stuff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Start slow opening on bubbles
var interval;
d3.select('body').on('keydown', function() {
if(d3.event.which === 32) {
if (interval) {
clearInterval(interval);
interval = null;
} else {
interval = setInterval(function() {
var expandable = vis.selectAll("circle")
.filter(function() { return d3.select(window.ppp = this).on('mouseover'); })[0];
if (expandable.length > 0) {
var ex = expandable[Math.floor(Math.random() * expandable.length)];
d3.select(ex).on('mouseover');
} else {
clearInterval(interval);
interval = null;
}
}, 150);
}
}
});