source/eoc-main.js
// function that links information to the specific country
function that links information to the specific country
function that links information to the specific country
function linkInfoCountry(countries, country, path) {
			var introduction = countries[country]['Introduction'];
			var tasteProfile = countries[country]['Taste profile'];
			var varieties = countries[country]['Varieties'];
			var production = countries[country]['Number of 60kg bags (2013)'];
			d3.select('.dropdown-menu').append('li')
				.attr('class', 'dropdown-menu-input')
				.text(country)
				.on('mouseover', function() {
					d3.select(this).classed('mouse-over-button', true);
				})
				.on('mouseout', function() {
					d3.select(this).classed('mouse-over-button', false);
				})
				.on('click', function() {
					if (toolTip.style('display') == 'block') {clearInformation('fourth-wave', path)}
					else {showToolTip2(path, country, introduction, tasteProfile, varieties, production)}
				});
				$('.dropdown-menu-input').click(function(e) {
            		e.stopPropagation()});
			path.on('mouseover', function() {
				if (mainMap.attr('class') == 'wave fourth-wave') {
					showToolTip2(path, country, introduction, tasteProfile, varieties, production);
				}
			});
		}
function linkInfoCountry ( countries , country , path ) { var introduction = countries [ country ] [ 'Introduction' ] ; var tasteProfile = countries [ country ] [ 'Taste profile' ] ; var varieties = countries [ country ] [ 'Varieties' ] ; var production = countries [ country ] [ 'Number of 60kg bags (2013)' ] ; d3 . select ( '.dropdown-menu' ) . append ( 'li' ) . attr ( 'class' , 'dropdown-menu-input' ) . text ( country ) . on ( 'mouseover' , function ( ) { d3 . select ( this ) . classed ( 'mouse-over-button' , true ) ; } ) . on ( 'mouseout' , function ( ) { d3 . select ( this ) . classed ( 'mouse-over-button' , false ) ; } ) . on ( 'click' , function ( ) { if ( toolTip . style ( 'display' ) == 'block' ) { clearInformation ( 'fourth-wave' , path ) } else { showToolTip2 ( path , country , introduction , tasteProfile , varieties , production ) } } ) ; $ ( '.dropdown-menu-input' ) . click ( function ( e ) { e . stopPropagation ( ) } ) ; path . on ( 'mouseover' , function ( ) { if ( mainMap . attr ( 'class' ) == 'wave fourth-wave' ) { showToolTip2 ( path , country , introduction , tasteProfile , varieties , production ) ; } } ) ; }
function that links information to the specific country
function that links information to the specific country
// information to be shown in the tooltip // link information to tooltip // showToolTip2(path, country, introduction, tasteProfile, varieties, production) // clearInformation('fourth-wave', path); // stop collapsing of dropdown menu if a country is clicked, only collapse if menu header is clicked // show tooltip on mouseover country