Compare View
Commits (2)
Showing
2 changed files
Show diff stats
flaskr/static/js/plots/emissions-equidistant-map.js
1 | 1 | // jQuery-free |
2 | -function draw_emissions_equidistant_map(containerSelector, worldDataUrl, countriesDataUrl, emissionsDataUrl) { | |
2 | +function draw_emissions_equidistant_map(containerSelector, worldDataUrl, emissionsDataUrl) { | |
3 | 3 | let margin = {top: 48, right: 88, bottom: 68, left: 98}, |
4 | 4 | width = 960 - margin.left - margin.right, |
5 | 5 | height = 540 - margin.top - margin.bottom; |
... | ... | @@ -362,6 +362,7 @@ function draw_emissions_equidistant_map(containerSelector, worldDataUrl, countri |
362 | 362 | |
363 | 363 | |
364 | 364 | document.addEventListener("DOMContentLoaded", () => { |
365 | + console.info("[Emissions Equidistant Map] Starting…"); | |
365 | 366 | width = document.querySelector(containerSelector).parentElement.offsetWidth; |
366 | 367 | width = width - margin.left - margin.right; |
367 | 368 | svg = d3.select(containerSelector) |
... | ... | @@ -373,12 +374,14 @@ function draw_emissions_equidistant_map(containerSelector, worldDataUrl, countri |
373 | 374 | d3.csv(emissionsDataUrl), |
374 | 375 | d3.json(worldDataUrl), |
375 | 376 | ]).then((allTheData) => { |
377 | + console.info("[Emissions Equidistant Map] Generating…"); | |
376 | 378 | [emissionsData, worldData] = allTheData; |
377 | 379 | crunchEmissionsData(); |
378 | 380 | recenterOnLatLon( |
379 | 381 | parseFloat(emissionsData[0].latitude), |
380 | 382 | parseFloat(emissionsData[0].longitude) |
381 | 383 | ); |
384 | + console.info("[Emissions Equidistant Map] Done.-"); | |
382 | 385 | }); |
383 | 386 | |
384 | 387 | d3.select(containerSelector+" svg").on("mousedown", function(event) { | ... | ... |
flaskr/templates/estimation.html
... | ... | @@ -262,30 +262,33 @@ |
262 | 262 | |
263 | 263 | <script type="text/javascript"> |
264 | 264 | |
265 | -const plots_config = { | |
265 | +var plots_config = { | |
266 | 266 | 'cities_count': {{ estimation_output.cities | length }} |
267 | 267 | }; |
268 | 268 | |
269 | 269 | {% if not estimation.is_many_to_many() %} |
270 | +/** | |
270 | 271 | draw_emissions_per_distance( |
271 | 272 | "#emissions_per_distance_histogram", |
272 | 273 | "/estimation/{{ estimation.public_id }}.csv" |
273 | 274 | ); |
275 | +**/ | |
274 | 276 | draw_sorted_emissions_inequality( |
275 | 277 | "#sorted_emissions_inequality", |
276 | 278 | "/estimation/{{ estimation.public_id }}.csv" |
277 | 279 | ); |
278 | 280 | {% endif %} |
279 | 281 | |
280 | - | |
282 | +/** | |
281 | 283 | draw_emissions_equidistant_map( |
282 | 284 | "#d3viz_emissions_equidistant_map", |
283 | 285 | {#"/static/public/data/worldmap.geo.json",#} |
284 | 286 | "/static/public/data/world-earth.geojson", |
285 | - "/static/public/data/countries-coordinates.csv", | |
287 | + {#"/static/public/data/countries-coordinates.csv",#} | |
286 | 288 | "/estimation/{{ estimation.public_id }}.csv" |
287 | 289 | {#"/estimation/{{ estimation.public_id }}/trips_to_destination_0.csv"#} |
288 | 290 | ); |
291 | +**/ | |
289 | 292 | |
290 | 293 | draw_travel_legs_worldmap( |
291 | 294 | "#d3viz_travels", |
... | ... | @@ -372,6 +375,7 @@ jQuery(document).ready(function($){ |
372 | 375 | |
373 | 376 | |
374 | 377 | jQuery(document).ready(function($){ |
378 | + console.info("[Footprint Lollipop] Starting…"); | |
375 | 379 | var vizid = "#cities_footprints_d3viz_lollipop"; |
376 | 380 | var csvUrl = "/estimation/{{ estimation.public_id }}.csv"; |
377 | 381 | var y_key = 'city'; |
... | ... | @@ -399,6 +403,7 @@ jQuery(document).ready(function($){ |
399 | 403 | "translate(" + margin.left + "," + margin.top + ")"); |
400 | 404 | |
401 | 405 | d3.csv(csvUrl).then(function (data) { |
406 | + console.info("[Footprint Lollipop] Generating…"); | |
402 | 407 | // Extrema |
403 | 408 | var data_x_max = d3.max(data, function (d) { |
404 | 409 | return parseFloat(d[x_key]); |
... | ... | @@ -606,7 +611,7 @@ jQuery(document).ready(function($){ |
606 | 611 | }); |
607 | 612 | |
608 | 613 | $('#cities_footprints_spinner').hide(); |
609 | - | |
614 | + console.info("[Footprint Lollipop] Done."); | |
610 | 615 | }); |
611 | 616 | |
612 | 617 | }); | ... | ... |