@@ -24,9 +24,17 @@ import { isCountryDrawn } from './utils/geo.js';
2424import { toggleSoblePass , toggleFilmPass } from './fx/postprocessing.js' ;
2525
2626// Import charts
27- import { initBarChart , removeBarChart , updateBarChartData } from './chart.js' ;
28- import { initScatter , countryFocusOff , countryFocusOn } from './scatter.js' ;
29- import { initLineChart , removeLineChart } from './linechart' ;
27+ import {
28+ initBarChart ,
29+ removeBarChart ,
30+ updateBarChartData ,
31+ } from './graphs/chart.js' ;
32+ import {
33+ initScatter ,
34+ countryFocusOff ,
35+ countryFocusOn ,
36+ } from './graphs/scatter.js' ;
37+ import { initLineChart , removeLineChart } from './graphs/linechart' ;
3038
3139// Import data sets
3240import worldHappiness from '../../datasets/world-happiness.json' ;
@@ -129,7 +137,7 @@ let renderingOptions = {
129137// Object that holds the world happiness data from the selected year as yearWorldHappiness.data
130138let yearWorldHappiness = {
131139 dataInteral : worldHappiness [ yearSliderValue ] ,
132- dataListener : function ( val ) { } ,
140+ dataListener : function ( val ) { } ,
133141 set data ( val ) {
134142 this . dataInteral = val ;
135143 this . dataListener ( val ) ;
@@ -240,14 +248,18 @@ searchMatch.addEventListener('click', function (e) {
240248 // Check if country has alpha 3
241249 if ( fuzzySearch && isCountryDrawn ( fuzzySearch . alpha3 ) ) {
242250 console . log ( 'test' ) ;
243- console . log ( 'Fuzzy: ' , fuzzySearch . name )
251+ console . log ( 'Fuzzy: ' , fuzzySearch . name ) ;
244252 searchedCountry . data = {
245253 id : fuzzySearch . alpha3 ,
246254 name : fuzzySearch . name ,
247255 index : null ,
248256 } ;
249- barChartPanel . setHeaderTitle ( `Bar chart of ${ hoveredCountry . data . name } ` ) ;
250- lineChartPanel . setHeaderTitle ( `Line chart of ${ hoveredCountry . data . name } ` ) ;
257+ barChartPanel . setHeaderTitle (
258+ `Bar chart of ${ hoveredCountry . data . name } `
259+ ) ;
260+ lineChartPanel . setHeaderTitle (
261+ `Line chart of ${ hoveredCountry . data . name } `
262+ ) ;
251263 } else {
252264 createErrorPanel (
253265 'Country not found' ,
@@ -276,13 +288,13 @@ hoveredCountry.registerListener(function (val) {
276288 countriesOfTheWorld [ hoveredCountry . data . id ] [ 'Population' ] ;
277289 countryDensityTag . innerHTML =
278290 countriesOfTheWorld [ hoveredCountry . data . id ] [
279- 'Pop. Density (per sq. mi.)'
291+ 'Pop. Density (per sq. mi.)'
280292 ] ;
281293 countryAreaTag . innerHTML =
282294 countriesOfTheWorld [ hoveredCountry . data . id ] [ 'Area (sq. mi.)' ] ;
283295 countyGDPTag . innerHTML =
284296 countriesOfTheWorld [ hoveredCountry . data . id ] [
285- 'GDP ($ per capita)'
297+ 'GDP ($ per capita)'
286298 ] ;
287299 }
288300 } else {
0 commit comments