在d3中使用滑块映射数据示例

时间:2016-01-19 00:48:28

标签: javascript jquery d3.js

我尝试为此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有任何提示吗?

1 个答案:

答案 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