Commit 7456fdbd authored by Rodrigo Tapia-McClung's avatar Rodrigo Tapia-McClung

Re-added deleted indicatorSelect in index, remove indicatorSelect or...

Re-added deleted indicatorSelect in index, remove indicatorSelect or regionSelect, and reduced code when adding js files
parent 90289944
......@@ -66,6 +66,7 @@
<div class="row d-flex flex-fill">
<div class="col-6" id="mexmap">
<div class="picker">
<select id="indicatorSelect"></select>
<select id="regionSelect"></select>
</div>
<div class="text-center loader">
......@@ -187,39 +188,28 @@
<script>
$("#showFlows").on("click", () => {
let body = document.getElementsByTagName('body')[0];
let script1 = document.createElement('script');
let script2 = document.createElement('script');
let script3 = document.createElement('script');
script1.src = "../js/centropais_functions.js";
script1.async = false;
body.appendChild(script1);
script2.src = "../js/centropais_basemap.js";
script2.async = false;
body.appendChild(script2);
script3.src = "../js/centropais_charts.js";
script3.async = false;
body.appendChild(script3);
["../js/centropais_functions.js", "../js/centropais_basemap.js", "../js/centropais_charts.js"].forEach( src =>{
let script = document.createElement('script');
script.src = src;
script.async = false;
document.body.appendChild(script);
});
});
$("#showUrban").on("click", () => {
let body = document.getElementsByTagName('body')[0];
let script1 = document.createElement('script');
let script2 = document.createElement('script');
script1.src = "../js/evolucion_urbana.js";
script1.async = false;
script2.src = "../js/evolucion_urbana_charts.js";
script2.async = false;
body.appendChild(script1);
body.appendChild(script2);
["../js/evolucion_urbana.js", "../js/evolucion_urbana_charts.js"].forEach( src =>{
let script = document.createElement('script');
script.src = src;
script.async = false;
document.body.appendChild(script);
});
});
$("#showPeriurban").on("click", () => {
let body = document.getElementsByTagName('body')[0];
let script = document.createElement('script');
script.src = "../js/centropais_periurbano.js";
script.async = false;
body.appendChild(script);
document.body.appendChild(script);
});
</script>
......
......@@ -58,7 +58,7 @@ indicators.forEach((indicator, index) => {
// chart variables
indicatorVars[indicator] = {
"chart": `${indicator}Chart`,
"chartaData": `${indicator}Data`,
"chartData": `${indicator}Data`,
"container": `#${indicator}-graph`
};
});
......@@ -153,6 +153,7 @@ d3.json("https://unpkg.com/d3-time-format@2.1.1/locale/es-MX.json").then(locale
//TODO: remove unused functions
$("#startHeader").remove();
$("#initial-backdrop").remove();
$("#regionSelect").remove();
$("#mainContainer")[0].style.setProperty("display", "flex", "important")
$("#mexmap").show();
......
......@@ -546,6 +546,7 @@ legend.onAdd = () => {
// hide initial screen and show map
$("#startHeader").remove();
$("#initial-backdrop").remove();
$("#indicatorSelect").remove();
$("#mainContainer")[0].style.setProperty("display", "flex", "important");
let title = $("#title");
title.html(`<h2>Comportamiento periurbano en la regi&oacute;n metropolitana centro pa&iacute;s</h2>`);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment