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 @@ ...@@ -66,6 +66,7 @@
<div class="row d-flex flex-fill"> <div class="row d-flex flex-fill">
<div class="col-6" id="mexmap"> <div class="col-6" id="mexmap">
<div class="picker"> <div class="picker">
<select id="indicatorSelect"></select>
<select id="regionSelect"></select> <select id="regionSelect"></select>
</div> </div>
<div class="text-center loader"> <div class="text-center loader">
...@@ -187,39 +188,28 @@ ...@@ -187,39 +188,28 @@
<script> <script>
$("#showFlows").on("click", () => { $("#showFlows").on("click", () => {
let body = document.getElementsByTagName('body')[0]; ["../js/centropais_functions.js", "../js/centropais_basemap.js", "../js/centropais_charts.js"].forEach( src =>{
let script1 = document.createElement('script'); let script = document.createElement('script');
let script2 = document.createElement('script'); script.src = src;
let script3 = document.createElement('script'); script.async = false;
script1.src = "../js/centropais_functions.js"; document.body.appendChild(script);
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);
}); });
$("#showUrban").on("click", () => { $("#showUrban").on("click", () => {
let body = document.getElementsByTagName('body')[0]; ["../js/evolucion_urbana.js", "../js/evolucion_urbana_charts.js"].forEach( src =>{
let script1 = document.createElement('script'); let script = document.createElement('script');
let script2 = document.createElement('script'); script.src = src;
script1.src = "../js/evolucion_urbana.js"; script.async = false;
script1.async = false; document.body.appendChild(script);
script2.src = "../js/evolucion_urbana_charts.js"; });
script2.async = false;
body.appendChild(script1);
body.appendChild(script2);
}); });
$("#showPeriurban").on("click", () => { $("#showPeriurban").on("click", () => {
let body = document.getElementsByTagName('body')[0];
let script = document.createElement('script'); let script = document.createElement('script');
script.src = "../js/centropais_periurbano.js"; script.src = "../js/centropais_periurbano.js";
script.async = false; script.async = false;
body.appendChild(script); document.body.appendChild(script);
}); });
</script> </script>
......
...@@ -58,7 +58,7 @@ indicators.forEach((indicator, index) => { ...@@ -58,7 +58,7 @@ indicators.forEach((indicator, index) => {
// chart variables // chart variables
indicatorVars[indicator] = { indicatorVars[indicator] = {
"chart": `${indicator}Chart`, "chart": `${indicator}Chart`,
"chartaData": `${indicator}Data`, "chartData": `${indicator}Data`,
"container": `#${indicator}-graph` "container": `#${indicator}-graph`
}; };
}); });
...@@ -153,6 +153,7 @@ d3.json("https://unpkg.com/d3-time-format@2.1.1/locale/es-MX.json").then(locale ...@@ -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 //TODO: remove unused functions
$("#startHeader").remove(); $("#startHeader").remove();
$("#initial-backdrop").remove(); $("#initial-backdrop").remove();
$("#regionSelect").remove();
$("#mainContainer")[0].style.setProperty("display", "flex", "important") $("#mainContainer")[0].style.setProperty("display", "flex", "important")
$("#mexmap").show(); $("#mexmap").show();
......
...@@ -546,6 +546,7 @@ legend.onAdd = () => { ...@@ -546,6 +546,7 @@ legend.onAdd = () => {
// hide initial screen and show map // hide initial screen and show map
$("#startHeader").remove(); $("#startHeader").remove();
$("#initial-backdrop").remove(); $("#initial-backdrop").remove();
$("#indicatorSelect").remove();
$("#mainContainer")[0].style.setProperty("display", "flex", "important"); $("#mainContainer")[0].style.setProperty("display", "flex", "important");
let title = $("#title"); let title = $("#title");
title.html(`<h2>Comportamiento periurbano en la regi&oacute;n metropolitana centro pa&iacute;s</h2>`); 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