Last active
August 29, 2015 14:06
-
-
Save bchartoff/231caabc4cb8949d3ed5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//listen for change event, call menuChanged func | |
dropDown.on("change", menuChanged }); | |
function menuChanged() { | |
var selectedValue = d3.event.target.value; | |
//get the name of the selected option from the change event object | |
countryData.indicators.forEach(function (d) { | |
//loop through your source data, however it happens to be organized (this is just an example) | |
if (selectedValue === d.name){ | |
//if the dropdown value matches the indicator name | |
console.log(d); | |
updateMap(d.name); | |
//call whatever function draws the #map according to whatever indicator | |
}; | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment