source/eoc-main.js
// function to create the tooltip for the fourth wave
function to create the tooltip for the fourth wave
function to create the tooltip for the fourth wave
function showToolTip2(path, country, introduction, tasteProfile, varieties, production) {
			highlightArea(path, 'fourth-wave');
			toolTip
				.style('display', 'block');
			toolTip.append('h4')
				.text(country);
			toolTip.append('h5')
				.text('Introduction');
			toolTip.append('p')
				.text(introduction);
			toolTip.append('h5')
				.text('Taste profile');
			toolTip.append('p')
				.text(tasteProfile);
			toolTip.append('h5')
				.text('Varieties');
			toolTip.append('p')
				.text(varieties);
			toolTip.append('h5')
				.text('Production of 60kg bags (2013)');
			toolTip.append('p')
				.text(production);
			if (d3.event.pageX < window.innerWidth / 2) {
				toolTip
					.style('left', (d3.event.pageX) + 'px')
			}
			if (d3.event.pageX >= window.innerWidth / 2) {
				toolTip
					.style('left', (d3.event.pageX) - WIDTH.largeMap * 3 / 5 + 'px')
			}
			toolTip
				.style('top', (d3.event.pageY) - 200 + 'px')
				.style('display', 'block');
		}
function showToolTip2 ( path , country , introduction , tasteProfile , varieties , production ) { highlightArea ( path , 'fourth-wave' ) ; toolTip . style ( 'display' , 'block' ) ; toolTip . append ( 'h4' ) . text ( country ) ; toolTip . append ( 'h5' ) . text ( 'Introduction' ) ; toolTip . append ( 'p' ) . text ( introduction ) ; toolTip . append ( 'h5' ) . text ( 'Taste profile' ) ; toolTip . append ( 'p' ) . text ( tasteProfile ) ; toolTip . append ( 'h5' ) . text ( 'Varieties' ) ; toolTip . append ( 'p' ) . text ( varieties ) ; toolTip . append ( 'h5' ) . text ( 'Production of 60kg bags (2013)' ) ; toolTip . append ( 'p' ) . text ( production ) ; if ( d3 . event . pageX < window . innerWidth / 2 ) { toolTip . style ( 'left' , ( d3 . event . pageX ) + 'px' ) } if ( d3 . event . pageX >= window . innerWidth / 2 ) { toolTip . style ( 'left' , ( d3 . event . pageX ) - WIDTH . largeMap * 3 / 5 + 'px' ) } toolTip . style ( 'top' , ( d3 . event . pageY ) - 200 + 'px' ) . style ( 'display' , 'block' ) ; }
function to create the tooltip for the fourth wave
function to create the tooltip for the fourth wave
// add headers and text elements from json to tooltip // location of tooltip, flip if on right side