Skip to content

Commit 9dbf24e

Browse files
committed
2 parents f39dfe6 + 59d7550 commit 9dbf24e

File tree

7 files changed

+24
-14
lines changed

7 files changed

+24
-14
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import * as d3 from 'd3';
2-
import countriesOfTheWorld from '../../datasets/countries-of-the-world.json';
2+
import countriesOfTheWorld from '../../../datasets/countries-of-the-world.json';
33

44
// Import the necessary globe functions
55
import {
66
hoveredCountry,
77
clickedCountry,
88
setClickedCountry,
99
resetClickedCountry,
10-
} from './webgl/globe/globe.js';
10+
} from '../webgl/globe/globe.js';
1111

1212
// Variable that contains the svg frame
1313
var graph;

src/js/main.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,17 @@ import { isCountryDrawn } from './utils/geo.js';
2424
import { 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
3240
import 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
130138
let 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 {

src/js/ui/panels.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { jsPanel } from 'jspanel4/es6module/jspanel.js';
22
import 'jspanel4/es6module/extensions/hint/jspanel.hint.js';
33
import 'jspanel4/es6module/extensions/modal/jspanel.modal.js';
4-
import { initChart } from '../chart.js';
54

65
const panelTheme = {
76
bgPanel: '#10224D',

src/js/webgl/globe/globe.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { composer } from '../../fx/postprocessing.js';
1919

2020
// Import texture file
2121
import { createWorldTexture, createCountryTexture } from '../texture.js';
22-
import { initChart } from '../../chart.js';
2322

2423
let worldContainer = document.getElementById('worldContainer');
2524
worldContainer.addEventListener('dblclick', clickedOnCountry);

0 commit comments

Comments
 (0)