我尝试为此example
实现基本滑块功能countries
但我无法阅读function animateMap() {
var timer; // create timer object
d3.select('#play')
.on('click', function() { // when user clicks the play button
if(playing == false) { // if the map is currently playing
timer = setInterval(function(){ // set a JS interval
if(currentAttribute < attributeArray.length-1) {
currentAttribute +=1; // increment the current attribute counter
} else {
currentAttribute = 0; // or reset it to zero
}
sequenceMap(); // update the representation of the map
d3.select('#clock').html(attributeArray[currentAttribute]); // update the clock
}, 2000);
d3.select(this).html('stop'); // change the button label to stop
playing = true; // change the status of the animation
} else { // else if is currently playing
clearInterval(timer); // stop the animation by clearing the interval
d3.select(this).html('play'); // change the button label to play
playing = false; // change the status again
}
});
}
。我需要更改什么才能让它运行?我尝试使用此示例的播放功能,但不是按钮播放我想使用滑块来触发事件
child_forename
Gist有任何提示吗?
答案 0 :(得分:0)
如果您想使用相同的时钟代码,可以试试这个
Error (use-package): git-gutter+ :init: Cannot open load file: git-gutter+
Error (use-package): helm pre-:config hook: Symbol's function definition is void: helm-flx-mode
Error (use-package): helm pre-:config hook: Symbol's function definition is void: helm-flx-mode