Commit 02e514b8132a97944c00e3b4de6143556727d8f3
1 parent
67db4e6a
Exists in
master
docs: add some info logs
Showing
1 changed file
with
4 additions
and
1 deletions
Show diff stats
flaskr/static/js/plots/emissions-equidistant-map.js
1 | // jQuery-free | 1 | // jQuery-free |
2 | -function draw_emissions_equidistant_map(containerSelector, worldDataUrl, countriesDataUrl, emissionsDataUrl) { | 2 | +function draw_emissions_equidistant_map(containerSelector, worldDataUrl, emissionsDataUrl) { |
3 | let margin = {top: 48, right: 88, bottom: 68, left: 98}, | 3 | let margin = {top: 48, right: 88, bottom: 68, left: 98}, |
4 | width = 960 - margin.left - margin.right, | 4 | width = 960 - margin.left - margin.right, |
5 | height = 540 - margin.top - margin.bottom; | 5 | height = 540 - margin.top - margin.bottom; |
@@ -362,6 +362,7 @@ function draw_emissions_equidistant_map(containerSelector, worldDataUrl, countri | @@ -362,6 +362,7 @@ function draw_emissions_equidistant_map(containerSelector, worldDataUrl, countri | ||
362 | 362 | ||
363 | 363 | ||
364 | document.addEventListener("DOMContentLoaded", () => { | 364 | document.addEventListener("DOMContentLoaded", () => { |
365 | + console.info("[Emissions Equidistant Map] Starting…"); | ||
365 | width = document.querySelector(containerSelector).parentElement.offsetWidth; | 366 | width = document.querySelector(containerSelector).parentElement.offsetWidth; |
366 | width = width - margin.left - margin.right; | 367 | width = width - margin.left - margin.right; |
367 | svg = d3.select(containerSelector) | 368 | svg = d3.select(containerSelector) |
@@ -373,12 +374,14 @@ function draw_emissions_equidistant_map(containerSelector, worldDataUrl, countri | @@ -373,12 +374,14 @@ function draw_emissions_equidistant_map(containerSelector, worldDataUrl, countri | ||
373 | d3.csv(emissionsDataUrl), | 374 | d3.csv(emissionsDataUrl), |
374 | d3.json(worldDataUrl), | 375 | d3.json(worldDataUrl), |
375 | ]).then((allTheData) => { | 376 | ]).then((allTheData) => { |
377 | + console.info("[Emissions Equidistant Map] Generating…"); | ||
376 | [emissionsData, worldData] = allTheData; | 378 | [emissionsData, worldData] = allTheData; |
377 | crunchEmissionsData(); | 379 | crunchEmissionsData(); |
378 | recenterOnLatLon( | 380 | recenterOnLatLon( |
379 | parseFloat(emissionsData[0].latitude), | 381 | parseFloat(emissionsData[0].latitude), |
380 | parseFloat(emissionsData[0].longitude) | 382 | parseFloat(emissionsData[0].longitude) |
381 | ); | 383 | ); |
384 | + console.info("[Emissions Equidistant Map] Done.-"); | ||
382 | }); | 385 | }); |
383 | 386 | ||
384 | d3.select(containerSelector+" svg").on("mousedown", function(event) { | 387 | d3.select(containerSelector+" svg").on("mousedown", function(event) { |