Commit 608b48a0 by vida092

actualizacion enero

parent 50597612
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>COMUNIDAD - SPECIES</title> <title>COMUNIDAD - EPI SPECIES</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<meta http-equiv="Cache-control" content="no-cache"> <meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache-control" content="no-store"> <meta http-equiv="Cache-control" content="no-store">
<title>NICHO - SPECIES</title> <title>NICHO EPI-SPECIES</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
<!-- <button id="btn_tutorial" type="button" title="" class="btn btn-warning "></button> --> <!-- <button id="btn_tutorial" type="button" title="" class="btn btn-warning "></button> -->
<!-- <button id="btn_demo" type="button" title="" class="btn btn-warning display-marker" data-toggle="modal" data-target="#modalDemo"></button> --> <!-- <button id="btn_demo" type="button" title="" class="btn btn-warning display-marker" data-toggle="modal" data-target="#modalDemo"></button> -->
<button id="nicho_link" type="button" class="btn btn-primary pull-right"></button> <button id="nicho_link" type="button" class="btn btn-primary pull-right" style="visibility: hidden"></button>
<!-- <button id="tuto_res" class="btn btn-warning display-marker" type="button" <!-- <button id="tuto_res" class="btn btn-warning display-marker" type="button"
style="visibility: hidden" style="visibility: hidden"
...@@ -271,9 +271,9 @@ ...@@ -271,9 +271,9 @@
<!--<div class="col-md-12 col-sm-12 col-xs-12">--> <!--<div class="col-md-12 col-sm-12 col-xs-12">-->
<label class="text-sm" id="footprint_region" ></label> <label class="text-sm" id="footprint_region" ></label>
<select id="footprint_region_select" class="form-control" > <select id="footprint_region_select" class="form-control" >
<option value="México" selected="selected"> <!-- <option value="México" selected="selected">
México México
</option> </option> -->
</select> </select>
<!--agregar sólo México--> <!--agregar sólo México-->
</div> </div>
...@@ -286,10 +286,10 @@ ...@@ -286,10 +286,10 @@
<option value="state">Estados</option> <option value="state">Estados</option>
<option selected="selected" value="mun">Municipios</option> <option selected="selected" value="mun">Municipios</option>
<option value="ageb">AGEBs</option> <option value="ageb">AGEBs</option>
<option value="8">8 km</option> <option value="8km">8 km</option>
<option value="16">16 km</option> <option value="16km">16 km</option>
<option value="32">32 km</option> <option value="32km">32 km</option>
<option value="64">64 km</option> <option value="64km">64 km</option>
</select> </select>
</div> </div>
...@@ -553,7 +553,7 @@ ...@@ -553,7 +553,7 @@
<h2 id="lb_params_variables" class="sidebar-header-species"></h2> <h2 id="lb_params_variables" class="sidebar-header-species"></h2>
<div id="tuto_val" class="row container_20p "> <!-- <div id="tuto_val" class="row container_20p ">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 padding-sides-zero"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 padding-sides-zero">
...@@ -578,7 +578,7 @@ ...@@ -578,7 +578,7 @@
</div> </div>
<!-- <div class="row"> -->
<div class="col-md-12 col-sm-12 col-xs-12 "> <div class="col-md-12 col-sm-12 col-xs-12 ">
...@@ -594,9 +594,9 @@ ...@@ -594,9 +594,9 @@
</div> </div>
<!-- </div> -->
</div> </div> -->
<div id="tuto_val" class="row container_15p "> <div id="tuto_val" class="row container_15p ">
...@@ -661,7 +661,7 @@ ...@@ -661,7 +661,7 @@
</div> </div>
<div id="tuto_apriori" class="row container_15p"> <!-- <div id="tuto_apriori" class="row container_15p">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 padding-sides-zero"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 padding-sides-zero">
...@@ -692,9 +692,9 @@ ...@@ -692,9 +692,9 @@
</div> </div> -->
<div id="tuto_map_prob" class="row container_15p"> <!-- <div id="tuto_map_prob" class="row container_15p">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 padding-sides-zero"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 padding-sides-zero">
...@@ -722,7 +722,7 @@ ...@@ -722,7 +722,7 @@
</div> </div>
</div> </div> -->
<!-- </div> --> <!-- </div> -->
...@@ -778,7 +778,7 @@ ...@@ -778,7 +778,7 @@
<label for="basic-url">Visualización</label> <label for="basic-url">Visualización</label>
<!-- <div class=" dropdown_group "> <div class=" dropdown_group ">
...@@ -790,14 +790,14 @@ ...@@ -790,14 +790,14 @@
<ul class="dropdown-menu dropdown_idioma"> <ul class="dropdown-menu dropdown_idioma">
<li><a class="map_type" label="Equal range" value="range">Equal range </a></li> <li><a class="map_type" label="Equal range" value="range">Equal range </a></li>
<li><a class="map_type" label="Standard deviation" value="deviation" ">Standard deviation </a></li> <li><a class="map_type" label="Standard deviation" value="deviation" >Standard deviation </a></li>
<li><a class="map_type" label="Natural Breaks" value="jenks" ">Natural Breaks </a></li> <li><a class="map_type" label="Natural Breaks" value="jenks" >Natural Breaks </a></li>
</ul> </ul>
</div> </div>
</div> --> </div>
</div> </div>
...@@ -870,18 +870,19 @@ ...@@ -870,18 +870,19 @@
<div class="row"> <div class="row">
<div id="div_munlist" class="row-fluid myScrollableBlockDecilList box_shadow bg-card"> <!-- <div id="div_munlist" class="row-fluid myScrollableBlockDecilList box_shadow bg-card">
<table id="tbl_munlist" class="display compact cell-border" cellspacing="0"></table> <table id="tbl_munlist" class="display compact cell-border" cellspacing="0"></table>
</div> </div> -->
</div> </div>
<div id="treeAddedPanel" class="row-fluid myScrollableBlockDecilList box_shadow bg-card">
<table id="tdisplay" class="display compact cell-border" ></table>
<div class="row"> </div>
<div class="row histogramrow" style="visibility:hidden; display: none;">
<div id="histcontainer_row" class="row-fluid histcontainer_row "> <div id="histcontainer_row" class="row-fluid histcontainer_row ">
...@@ -911,13 +912,6 @@ ...@@ -911,13 +912,6 @@
</div> </div>
<div id="treeAddedPanel" class="row-fluid myScrollableBlockDecilList box_shadow bg-card">
<table id="tdisplay" class="display compact cell-border" ></table>
</div>
</div> </div>
......
images/dna.png

951 Bytes

images/rep.png

360 Bytes

...@@ -57,7 +57,8 @@ ...@@ -57,7 +57,8 @@
<a class="logo" id="logoCIC" href="http://www.cic-ctic.unam.mx" target="_blank">Coordinación de la Investigación Científica</a> <a class="logo" id="logoCIC" href="http://www.cic-ctic.unam.mx" target="_blank">Coordinación de la Investigación Científica</a>
<a class="logo" id="logoC3" href="https://www.c3.unam.mx" target="_blank">Centro de Ciencias de la Complejidad</a> <a class="logo" id="logoC3" href="https://www.c3.unam.mx" target="_blank">Centro de Ciencias de la Complejidad</a>
<a class="logo" id="logoPINCC" href="https://www.pincc.unam.mx/" target="_blank">Programa de Investigación en Cambio Climatico</a> <a class="logo" id="logoPINCC" href="https://www.pincc.unam.mx/" target="_blank">Programa de Investigación en Cambio Climatico</a>
<a class="logo" id="logoChilam" href="https://chilam.c3.unam.mx">Chilam – Laboratorio para la simulación de Sistemas Complejos Adaptativos</a> <a class="logo" id="logoCAyCC" href="https://www.atmosfera.unam.mx/" target="_blank">Instituto de Ciencias de la Atmósfera y Cambio Climático</a>
<a class="logo" id="logoChilam" href="https://chilam.c3.unam.mx" target="_blank">Chilam – Laboratorio para la simulación de Sistemas Complejos Adaptativos</a>
</div> </div>
<a target="_blank" href="https://chilam.c3.unam.mx/proyectos/epi-species" class="button-2">Más información sobre EPI-SPECIES</a> <a target="_blank" href="https://chilam.c3.unam.mx/proyectos/epi-species" class="button-2">Más información sobre EPI-SPECIES</a>
......
...@@ -299,19 +299,20 @@ var histogram_module = (function (verbose) { ...@@ -299,19 +299,20 @@ var histogram_module = (function (verbose) {
.on("click",function(d,i) { .on("click",function(d,i) {
console.log("calculando valores") console.log("calculando valores")
// console.log(d) console.log(d)
console.log(i)
var deciles = [], grupos = [] var deciles = [], grupos = []
d3.selectAll(".lbdecil_chk .tick .selected") d3.selectAll(".lbdecil_chk .tick .selected")
.each(function (d, i) { .each(function (d, i) {
// console.log(d) console.log(d)
deciles.push(d) deciles.push(d)
}) })
d3.selectAll(".rect_legend.selected") d3.selectAll(".rect_legend.selected")
.each(function (d, i) { .each(function (d, i) {
// console.log(d) console.log(d)
grupos.push(d) grupos.push(d)
}) })
...@@ -324,6 +325,10 @@ var histogram_module = (function (verbose) { ...@@ -324,6 +325,10 @@ var histogram_module = (function (verbose) {
_toast_module.showToast_BottomCenter(_iTrans.prop('no_decilgrupo'), "warning"); _toast_module.showToast_BottomCenter(_iTrans.prop('no_decilgrupo'), "warning");
return return
} }
body.selected_decile = deciles
console.log(body.selected_decile)
console.log(body)
console.log("ahora se llama ala función load decile table")
// _display_module_nicho.loadDecilDataTable(d.decil, d.name, false, [], []); // _display_module_nicho.loadDecilDataTable(d.decil, d.name, false, [], []);
...@@ -926,7 +931,7 @@ var histogram_module = (function (verbose) { ...@@ -926,7 +931,7 @@ var histogram_module = (function (verbose) {
return y_right(d.recall); return y_right(d.recall);
}); });
// console.log(line);
svg.append("path") svg.append("path")
.datum(recall_item) .datum(recall_item)
...@@ -949,7 +954,7 @@ var histogram_module = (function (verbose) { ...@@ -949,7 +954,7 @@ var histogram_module = (function (verbose) {
.attr("r", 3.5) .attr("r", 3.5)
.attr("cx", function (d, i) { .attr("cx", function (d, i) {
// return x0(recall_item.length - i) + (x1.rangeBand() * (ageNames.length / 2));
return x0(d.decil) + (x1.rangeBand() * (ageNames.length / 2)); return x0(d.decil) + (x1.rangeBand() * (ageNames.length / 2));
......
/** /**
* Módulo mapa, utilizado para crear y gestionar el mapa en nicho ecológico y comunidad ecológica. * Módulo mapa, utilizado para crear y gestionar el mapa en nicho ecológico y comunidad ecológica.
* *
...@@ -692,12 +691,9 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) { ...@@ -692,12 +691,9 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) {
_REGION_SELECTED = region_selected; _REGION_SELECTED = region_selected;
let query = 'query{get_mesh(grid_res: "' + _grid_res + '"){cve simplified_geom}}' let query = 'query{get_mesh(grid_res: "' + _grid_res + '"){cve simplified_geom}}'
console.log(query) console.log(query)
console.log("aquí está el query ------------------------------------")
// query{get_mesh(grid_res: "mun"){cve simplified_geom}}
$.ajax({ $.ajax({
...@@ -710,7 +706,7 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) { ...@@ -710,7 +706,7 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) {
let obj = data["get_mesh"] let obj = data["get_mesh"]
let json = {type: 'FeatureCollection',crs: {}, features: []} let json = {type: 'FeatureCollection',crs: {}, features: []}
console.log(obj) //console.log(obj)
for (let i = 0; i < obj.length; i++) for (let i = 0; i < obj.length; i++)
...@@ -2101,7 +2097,7 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) { ...@@ -2101,7 +2097,7 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) {
function busca_especie_grupo(taxones, region = 1, val_process = false, grid_res = "state", fuente = "nicho", disease, agent) { function busca_especie_grupo(taxones, region = 1, val_process = false, grid_res = "state", fuente = "nicho", disease, agent) {
_VERBOSE ? console.log("busca_especie_grupo") : _VERBOSE; _VERBOSE ? console.log("busca_especie_grupo") : _VERBOSE;
console.log("_grid_map_occ: " + _grid_map_occ) console.log("_grid_map_occ: " + _grid_map_occ)
console.log("_grid_res: " + _grid_res) console.log("_grid_res: " + _grid_res)
...@@ -2110,8 +2106,8 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) { ...@@ -2110,8 +2106,8 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) {
console.log("region: " + region) console.log("region: " + region)
_DISEASE_SELECTED = disease; _DISEASE_SELECTED = disease;
_AGENT_SELECTED = agent; _AGENT_SELECTED = agent;
console.log("_DISEASE_SELECTED" + disease) console.log("_DISEASE_SELECTED: " + disease)
console.log("_AGENT_SELECTED" + _AGENT_SELECTED) console.log("_AGENT_SELECTED: " + _AGENT_SELECTED)
_taxones = taxones _taxones = taxones
...@@ -2218,12 +2214,7 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) { ...@@ -2218,12 +2214,7 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) {
"region": region "region": region
} }
// if (_AGENT_SELECTED == 'Hospederos')
// var _url = 'http://10.90.0.42:4006/graphql/hospederos/'
// else if (_AGENT_SELECTED == 'Patogenos')
// var _url = "http://10.90.0.42:4007/graphql/patogenos/"
// else
// var _url = "http://10.90.0.42:4008/graphql/vectores/"
var _url = "https://covid19.c3.unam.mx/gateway/api/nodes/" var _url = "https://covid19.c3.unam.mx/gateway/api/nodes/"
...@@ -2231,11 +2222,40 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) { ...@@ -2231,11 +2222,40 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) {
let fecha_ini = document.getElementById("yearPicker_start").value.trim() let fecha_ini = document.getElementById("yearPicker_start").value.trim()
let fecha_fin = document.getElementById("yearPicker_end").value.trim() let fecha_fin = document.getElementById("yearPicker_end").value.trim()
console.log( _PARENT_FIELD)
//_PARENT_FIELD.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "")
switch(_PARENT_FIELD){
case("phylum"):
var label_target = "phylum"
break;
case("class"):
var label_target = "clase";
break;
case("order"):
var label_target = "orden";
break;
case("family"):
var label_target = "familia";
break;
case("genus"):
var label_target = "genero";
break;
case("species"):
var label_target= "species"
break;
default:
console.log("nada que hacer")
}
if(label_target === "species"){
label_target = "nombrecientifico"
}
console.log(label_target)
if ( fecha_ini.length < 3) if ( fecha_ini.length < 3)
var query = 'query{occurrences_by_taxon_' + nodo + '(query: "nombreenfermedad = \''+ _DISEASE_SELECTED + '\' AND '+ _PARENT_FIELD.toLowerCase() +' = \'' + _LABEL_VALUE +'\' "){individuosinfectados gridid_'+ _grid_res + '}}' var query = 'query{occurrences_by_taxon_' + nodo + '(query: "nombreenfermedad = \''+ _DISEASE_SELECTED + '\' AND '+ label_target +' = \'' + _LABEL_VALUE +'\' "){individuosinfectados gridid_'+ _grid_res + '}}'
else else
var query = 'query{occurrences_by_taxon_' + nodo + '(query: "nombreenfermedad = \''+ _DISEASE_SELECTED + '\' AND '+ _PARENT_FIELD.toLowerCase() +' = \'' + _LABEL_VALUE +'\' AND aniocolecta >= \''+ fecha_ini + ' \' AND aniocolecta <= \'' + fecha_fin + ' \'"){individuosinfectados gridid_'+ _grid_res + '}}' var query = 'query{occurrences_by_taxon_' + nodo + '(query: "nombreenfermedad = \''+ _DISEASE_SELECTED + '\' AND '+ label_target +' = \'' + _LABEL_VALUE +'\' AND aniocolecta >= \''+ fecha_ini + ' \' AND aniocolecta <= \'' + fecha_fin + ' \'"){individuosinfectados gridid_'+ _grid_res + '}}'
console.log(query) console.log(query)
...@@ -2250,7 +2270,7 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) { ...@@ -2250,7 +2270,7 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) {
let data2 = resp.data["occurrences_by_taxon_" + nodo] let data2 = resp.data["occurrences_by_taxon_" + nodo]
//let data = resp["data"]; //let data = resp["data"];
//let obj = data["get_mesh"] //let obj = data["get_mesh"]
console.log(data2) //console.log(data2)
let gridid = {gridid: []} let gridid = {gridid: []}
for (let i = 0; i < data2.length; i++) { for (let i = 0; i < data2.length; i++) {
let mesh = "gridid_" + _grid_res let mesh = "gridid_" + _grid_res
...@@ -2316,7 +2336,7 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) { ...@@ -2316,7 +2336,7 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) {
num_occ += parseInt(item["occ"]) num_occ += parseInt(item["occ"])
}) })
console.log(_data_sp_occ) //console.log(_data_sp_occ)
console.log("num_cell_occ: " + num_cell_occ) console.log("num_cell_occ: " + num_cell_occ)
console.log("num_occ: " + num_occ) console.log("num_occ: " + num_occ)
...@@ -2783,22 +2803,23 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) { ...@@ -2783,22 +2803,23 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) {
function createRankColor(json, mapa_prob, map_type) { function createRankColor(json, mapa_prob, map_type) {
_VERBOSE ? console.log("createRankColor") : _VERBOSE; _VERBOSE ? console.log("createRankColor") : _VERBOSE;
console.log(json)
// console.log("map_type: " + map_type)
var equal_range_sections = 9; var equal_range_sections = 9;
var grid_color = d3.map([]); var grid_color = d3.map([]);
var colors = jQuery.extend(true, [], colorbrewer.RdBu[9]); var colors = jQuery.extend(true, [], colorbrewer.RdBu[9]);
colors = colors.reverse() colors = colors.reverse()
// console.log(colors)
var equal_range_colors = jQuery.extend(true, [], colorbrewer.Blues[equal_range_sections])
console.log(mapa_prob)
console.log(json)
console.log(colors)
console.log("map_type: " + map_type)
var equal_range_colors = jQuery.extend(true, [], colorbrewer.Blues[equal_range_sections])
equal_range_colors = equal_range_colors.reverse() equal_range_colors = equal_range_colors.reverse()
equal_range_colors = equal_range_colors.concat(jQuery.extend(true, [], colorbrewer.Reds[equal_range_sections])) equal_range_colors = equal_range_colors.concat(jQuery.extend(true, [], colorbrewer.Reds[equal_range_sections]))
...@@ -2927,31 +2948,24 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) { ...@@ -2927,31 +2948,24 @@ var map_module = (function (url_geoserver, workspace, verbose, url_zacatuche) {
.domain(arr_range_deviations) .domain(arr_range_deviations)
.range(colors); .range(colors);
// scales.quantize = d3.scale.quantize()
// .domain([min_scr, max_scr])
// .range(colors);
scales.jenks = d3.scale.threshold() scales.jenks = d3.scale.threshold()
.domain(breaks) .domain(breaks)
.range(colors); .range(colors);
// console.log(colors)
// console.log(rateById) var no_cells = 0
// console.log(scales['jenks9']) console.log("<====================================================>3")
// console.log(rateById[8526]) map_type = 'range'
// console.log(scales['jenks'](rateById[8526])) console.log(scales)
// console.log(scales['deviation'](-45)) console.log(map_type)
// console.log(scales['deviation'](0)) console.log(">====================================================<3")
// console.log(scales['deviation'](3)) $.each(json, function (_index, d) {
// console.log(scales['deviation'](20)) //console.log("<====================================================>4")
// console.log(scales['deviation'](80)) //no_cells += 1
//console.log(d, no_cells)
$.each(json, function (index, d) { //console.log(">====================================================<4")
grid_color.set(parseInt(d.gridid), {color: scales[map_type](rateById[d.gridid]), score: d.tscore}); grid_color.set(parseInt(d.gridid), {color: scales[map_type](rateById[d.gridid]), score: d.tscore});
// grid_color.set(parseInt(d.gridid), {color: scales['deviation'](rateById[d.gridid]), score: d.tscore}); //grid_color.set(parseInt(d.gridid), {color: scales['deviation'](rateById[d.gridid]), score: d.tscore});
}) })
......
...@@ -1500,7 +1500,7 @@ var net_module = (function(verbose, url_zacatuche, map_module_net, utils_module) ...@@ -1500,7 +1500,7 @@ var net_module = (function(verbose, url_zacatuche, map_module_net, utils_module)
$.ajax({ $.ajax({
// url: _url_zacatuche + "/niche/especie/getCountGridid", // url: _url_zacatuche + "/niche/especie/getCountGridid",
url: _url_zacatuche + "/niche/especie/getGroupCountGridid", url: "https://covid19.c3.unam.mx/gateway/api/nodes/",
type: 'post', type: 'post',
data: sdata, data: sdata,
success: function(resp) { success: function(resp) {
......
...@@ -17,7 +17,7 @@ var module_nicho = (function () { ...@@ -17,7 +17,7 @@ var module_nicho = (function () {
var _AGENT_TEXT_SELECTED; var _AGENT_TEXT_SELECTED;
// actualizar este arreglo si cambian los ids de las secciones // actualizar este arreglo si cambian los ids de las secciones
var _SCROLL_SECTIONS = ["section0","section1","map","myScrollableBlockEpsilonDecil","histcontainer_row"]; var _SCROLL_SECTIONS = ["section0","section1","map","myScrollableBlockEpsilonDecil"]//,"histcontainer_row"];
var _SCROLL_INDEX = 0; var _SCROLL_INDEX = 0;
...@@ -297,7 +297,7 @@ var module_nicho = (function () { ...@@ -297,7 +297,7 @@ var module_nicho = (function () {
$("#grid_resolution").change(function (e) { $("#grid_resolution").change(function (e) {
_VERBOSE ? console.log("Cambia grid resolución") : _VERBOSE; _VERBOSE ? console.log("Cambia grid resolución a" + $("#grid_resolution").val() ) : _VERBOSE;
// No es necesario regenerar resultados // No es necesario regenerar resultados
_regenMessage(); _regenMessage();
...@@ -309,6 +309,8 @@ var module_nicho = (function () { ...@@ -309,6 +309,8 @@ var module_nicho = (function () {
// No es necesario regenerar resultados // No es necesario regenerar resultados
_regenMessage(); _regenMessage();
}); });
...@@ -719,6 +721,7 @@ var module_nicho = (function () { ...@@ -719,6 +721,7 @@ var module_nicho = (function () {
// _confLiveTutorial(); // _confLiveTutorial();
_genLinkURL(); _genLinkURL();
} }
function _regenMessage() { function _regenMessage() {
...@@ -1136,28 +1139,30 @@ var module_nicho = (function () { ...@@ -1136,28 +1139,30 @@ var module_nicho = (function () {
} }
// se ejecutan los modulos necesarios para iniciar el proceso de obteción de epsilon y score y visualización de tablas, histogramas y mapa // se ejecutan los modulos necesarios para iniciar el proceso de obteción de epsilon y score y visualización de tablas, histogramas y mapa
$("#get_esc_ep").click(function () { $("#get_esc_ep").click(function () {
_VERBOSE ? console.log("get_esc_ep") : _VERBOSE; _VERBOSE ? console.log("get_esc_ep") : _VERBOSE;
var num_items = 0, spid, idreg, subgroups, sp_target; var num_items = 0, spid, idreg, subgroups, sp_target;
// $("#specie_next").css('visibility', 'hidden'); $("#specie_next").css('visibility', 'hidden');
$("#show_gen").css('visibility', 'visible'); $("#show_gen").css('visibility', 'visible');
$("#btn_tuto_steps_result").css('visibility', 'visible'); $("#btn_tuto_steps_result").css('visibility', 'visible');
// _cleanTutorialButtons(); // _cleanTutorialButtons();
console.log(_taxones)
if (_taxones.length === 0) { if (_taxones.length === 0) {
// no se ha seleccionado especie objetivo // no se ha seleccionado especie objetivo
_module_toast.showToast_BottomCenter(_iTrans.prop('lb_error_especie'), "error"); _module_toast.showToast_BottomCenter(_iTrans.prop('lb_error_especie'), "error");
return; return;
} }
// spid = _map_module_nicho.get_specieTarget().spid; // spid = _map_module_nicho.get_specieTarget().spid;
// _VERBOSE ? console.log(spid) : _VERBOSE; // _VERBOSE ? console.log(spid) : _VERBOSE;
...@@ -1184,25 +1189,24 @@ var module_nicho = (function () { ...@@ -1184,25 +1189,24 @@ var module_nicho = (function () {
_res_display_module_nicho.set_subGroups(subgroups); _res_display_module_nicho.set_subGroups(subgroups);
_res_display_module_nicho.set_typeBioclim(type_time); _res_display_module_nicho.set_typeBioclim(type_time);
if (subgroups.length > 0) { if (subgroups.length > 0) {
// // asegura que si el grupo de variables seleccionado tiene mas de un grupo taxonomico agregue el total // asegura que si el grupo de variables seleccionado tiene mas de un grupo taxonomico agregue el total
// subgroups.forEach(function (grupo) { subgroups.forEach(function (grupo) {
// if (grupo.value.length > 1) { if (grupo.value.length > 1) {
// grupo.value.forEach(function (item) { grupo.value.forEach(function (item) {
// num_items++; num_items++;
// }); });
// } }
// }); });
// // asegura que si existe mas de un grupo de variables, se calcule el total de todos los grupos // asegura que si existe mas de un grupo de variables, se calcule el total de todos los grupos
// if (subgroups.length > 1) { if (subgroups.length > 1) {
// num_items++; num_items++;
// } }
} else { } else {
...@@ -1241,8 +1245,8 @@ var module_nicho = (function () { ...@@ -1241,8 +1245,8 @@ var module_nicho = (function () {
console.log("grid_res: " + grid_res); console.log("grid_res: " + grid_res);
console.log("footprint_region: " + footprint_region); console.log("footprint_region: " + footprint_region);
console.log("disease" + disease); console.log("disease: " + disease.toLowerCase());
console.log("agent"+ agent); console.log("agent: "+ agent.normalize('NFD').replace(/[\u0300-\u036f]/g,""));
var fossil = $("#chkFosil").is(':checked'); var fossil = $("#chkFosil").is(':checked');
...@@ -1251,7 +1255,7 @@ var module_nicho = (function () { ...@@ -1251,7 +1255,7 @@ var module_nicho = (function () {
console.log("liminf: " + liminf) console.log("liminf: " + liminf)
console.log("limsup: " + limsup) console.log("limsup: " + limsup)
var rango_fechas = [] var rango_fechas = []
if (liminf == "" || limsup == "") { if (liminf == "" || limsup == "") {
rango_fechas = undefined; rango_fechas = undefined;
...@@ -1265,14 +1269,59 @@ var module_nicho = (function () { ...@@ -1265,14 +1269,59 @@ var module_nicho = (function () {
// if (rango_fechas[0] == $("#sliderFecha").slider("option", "min") && rango_fechas[1] == $("#sliderFecha").slider("option", "max")) { // if (rango_fechas[0] == $("#sliderFecha").slider("option", "min") && rango_fechas[1] == $("#sliderFecha").slider("option", "max")) {
// rango_fechas = undefined; // rango_fechas = undefined;
// } // }
console.log( subgroups)
var chkFecha = $("#chkFecha").is(':checked'); var chkFecha = $("#chkFecha").is(':checked');
// slider_value = val_process ? $("#sliderValidation").slider("value") : 0;
//slider_value = val_process ? $("#sliderValidation").slider("value") : 0;
var slider_value = val_process ? true : false; var slider_value = val_process ? true : false;
_componente_fuente.getBodyElements()
covariables=[];
covariables_filter={}
//covobj= {"inegi2020": inegi2020, "snib": snib, "worldclim":worldclim}
Object.keys(covobj).forEach(key=>{
if (covobj[key].length > 0){
covariables.push(key);
covariables_filter[key]=covobj[key]
}
})
switch(agent){
case ("Vectores"):
var agente="vector";
break;
default:
var agente = agent.normalize('NFD').replace(/[\u0300-\u036f]/g,"").toLowerCase().substring(0, agent.length - 1);
break;
}
body={
"selected_decile": [10],
"mesh": grid_res,
"covariables":covariables,
"covariable_filter":covariables_filter,
"target":{
"species": target_species[0], //Por el momento el target debe tener un sólo taxon, luego sólo hay que borrar "[0]"
"disease": disease,
"agent": agente
},
"target_attribute_filter":[],
"lim_inf_first": "2021-04-03",
"lim_sup_first": "2021-05-02",
"lim_inf_training": "2021-05-03",
"lim_sup_training": "2021-06-02",
"lim_inf_validation": "2021-06-03",
"lim_sup_validation": "2021-07-02"
}
// Falta agregar la condición makesense. // Falta agregar la condición makesense.
// Cuando se realiza una consulta por region seleccioanda se verica que la especie objetivo se encuentre dentro de esta area // Cuando se realiza una consulta por region seleccioanda se verica que la especie objetivo se encuentre dentro de esta area
...@@ -1281,6 +1330,7 @@ var module_nicho = (function () { ...@@ -1281,6 +1330,7 @@ var module_nicho = (function () {
} }
}); });
......
...@@ -254,6 +254,7 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -254,6 +254,7 @@ var res_display_module = (function (verbose, url_zacatuche) {
*/ */
function set_subGroups(subgroups) { function set_subGroups(subgroups) {
_subgroups = subgroups; _subgroups = subgroups;
console.log(subgroups)
} }
/** /**
...@@ -436,8 +437,10 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -436,8 +437,10 @@ var res_display_module = (function (verbose, url_zacatuche) {
$("#btn_map_type").append('<span class="caret"></span>'); $("#btn_map_type").append('<span class="caret"></span>');
_configureStyleMap(); _configureStyleMap();
if (_return_map) { if (_return_map) {
_map_module_nicho.set_colorCellsDecilMap(); _map_module_nicho.set_colorCellsDecilMap();
} }
...@@ -576,9 +579,10 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -576,9 +579,10 @@ var res_display_module = (function (verbose, url_zacatuche) {
_REQUESTS = num_items + _subgroups.length; //_REQUESTS = num_items + _subgroups.length;
_REQUESTS=1
_ITER_REQUESTS = _REQUESTS; _ITER_REQUESTS = _REQUESTS;
// _VERBOSE ? console.log("Peticiones al servidor: " + _REQUESTS) : _VERBOSE; _VERBOSE ? console.log("Peticiones al servidor: " + _REQUESTS) : _VERBOSE;
// document.getElementById("tbl_hist").style.display = "inline"; // document.getElementById("tbl_hist").style.display = "inline";
_cleanPanel(); _cleanPanel();
...@@ -613,6 +617,8 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -613,6 +617,8 @@ var res_display_module = (function (verbose, url_zacatuche) {
_VERBOSE ? console.log("callDisplayProcess NICHO") : _VERBOSE; _VERBOSE ? console.log("callDisplayProcess NICHO") : _VERBOSE;
despliegaLoadings(); despliegaLoadings();
var taxon_values = []; var taxon_values = [];
...@@ -683,7 +689,7 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -683,7 +689,7 @@ var res_display_module = (function (verbose, url_zacatuche) {
$.ajax({ $.ajax({
url: _url_zacatuche + "/niche/especie/getGroupValidationTables", url: "https://covid19.c3.unam.mx/gateway/api/analysis/cells/",
type: 'post', type: 'post',
data: { data: {
// spid: _spid, // spid: _spid,
...@@ -728,8 +734,29 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -728,8 +734,29 @@ var res_display_module = (function (verbose, url_zacatuche) {
_VERBOSE ? console.log("_deleteValidationTables") : _VERBOSE; _VERBOSE ? console.log("_deleteValidationTables") : _VERBOSE;
// $.ajax({
// url: _url_zacatuche + "/niche/especie/deleteValidationTables",
// type: 'post',
// data: {
// idtable: _idtemptable
// },
// dataType: "json",
// success: function (resp) {
// console.log("delete");
// console.log(resp);
// _requestReturned = 1;
// _idtemptable = "";
// },
// error: function (jqXHR, textStatus, errorThrown) {
// _VERBOSE ? console.log("textStatus: " + textStatus) : _VERBOSE;
// _VERBOSE ? console.log("errorThrown: " + errorThrown) : _VERBOSE;
// }
// });
$.ajax({ $.ajax({
url: _url_zacatuche + "/niche/especie/deleteValidationTables", url: "https://covid19.c3.unam.mx/gateway/api/analysis/cells/",
type: 'post', type: 'post',
data: { data: {
idtable: _idtemptable idtable: _idtemptable
...@@ -1087,6 +1114,7 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1087,6 +1114,7 @@ var res_display_module = (function (verbose, url_zacatuche) {
}); });
_REQUESTS_NUMBER = _REQUESTS_MADE.length; _REQUESTS_NUMBER = _REQUESTS_MADE.length;
console.log("_REQUESTS_NUMBER: " + _REQUESTS_NUMBER); console.log("_REQUESTS_NUMBER: " + _REQUESTS_NUMBER);
// console.log(_TREE_GENERATED); // console.log(_TREE_GENERATED);
// console.log(_REQUESTS_MADE); // console.log(_REQUESTS_MADE);
...@@ -1094,10 +1122,7 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1094,10 +1122,7 @@ var res_display_module = (function (verbose, url_zacatuche) {
// return; // return;
_REQUESTS_MADE.forEach(function (item, index) { _REQUESTS_MADE.forEach(function (item, index) {
// console.log(item);
_createScore_Decil(item); _createScore_Decil(item);
}); });
} }
...@@ -1117,6 +1142,8 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1117,6 +1142,8 @@ var res_display_module = (function (verbose, url_zacatuche) {
*/ */
function _createScore_Decil(decildata) { function _createScore_Decil(decildata) {
_VERBOSE ? console.log("_createScore_Decil") : _VERBOSE; _VERBOSE ? console.log("_createScore_Decil") : _VERBOSE;
$('#chartdiv_score_decil').loading({ $('#chartdiv_score_decil').loading({
...@@ -1124,30 +1151,37 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1124,30 +1151,37 @@ var res_display_module = (function (verbose, url_zacatuche) {
}); });
var data_request = jQuery.extend(true, {}, decildata); var data_request = jQuery.extend(true, {}, decildata);
//var data_request = JSON.stringify(body)
console.log(data_request)
data_request["decil_selected"] = [_default_decil] data_request["decil_selected"] = [_default_decil]
console.log("<====================================================>1")
console.log(data_request)
// decildata["with_data_freq"] = false; // decildata["with_data_freq"] = false;
// decildata["with_data_score_cell"] = true; // decildata["with_data_score_cell"] = true;
// decildata["with_data_freq_cell"] = false; // decildata["with_data_freq_cell"] = false;
// decildata["with_data_score_decil"] = false; // decildata["with_data_score_decil"] = false;
///tal vez quitar
var verbo = _val_process_temp ? "countsTaxonsGroupTimeValidation" : "countsTaxonsGroup" var verbo = _val_process_temp ? "countsTaxonsGroupTimeValidation" : "countsTaxonsGroup"
// cambiando peticiones ajax por promesas y fetch api
fetch(_url_zacatuche + "/niche/" + verbo, { // Si se esta haciendo bien la peticion al servidor de epi-puma 2.0
method: "POST", fetch("https://covid19.c3.unam.mx/gateway/api/analysis/cells/",{
body: JSON.stringify(data_request), method:"POST",
headers: { //body: JSON.stringify(data_request),
"Content-Type": "application/json" body: JSON.stringify(body),
headers:{
"Content-Type": "application/json"
} }
}) })
.then(resp => resp.json()) .then(resp => resp.json())
.then(respuesta => { .then(respuesta => {
console.log("<====================================================>2")
console.log(respuesta) console.log(respuesta)
console.log(">====================================================<2")
if(!respuesta.ok){ if(!respuesta.ok){
// TODO: mandar mensaje de error // TODO: mandar mensaje de error
...@@ -1156,15 +1190,25 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1156,15 +1190,25 @@ var res_display_module = (function (verbose, url_zacatuche) {
return return
} }
_REQUESTS_NUMBER = _REQUESTS_NUMBER - 1; ///talvez modificar
_REQUESTS_NUMBER = 0;
// PROCESANDO PETICIONES INDIVIDUALES // PROCESANDO PETICIONES INDIVIDUALES
var data_response = jQuery.extend(true, [], respuesta.data); //var data_response = jQuery.extend(true, [], respuesta.data);
var validation_data = _val_process_temp ? respuesta.time_validation : respuesta.validation_data var data_response = respuesta.data
console.log(data_response)
var validation_data = respuesta.validation_data
processSingleResponse(data_response, data_request, validation_data); processSingleResponse(data_response, data_request, validation_data);
_REQUESTS_DONE.push(respuesta); _REQUESTS_DONE.push(respuesta);
console.log("****************-------********")
console.log(_REQUESTS_DONE)
_REQUESTS_DONE=_REQUESTS_DONE.slice(0,1)
console.log("****************-------********")
console.log(_REQUESTS_DONE)
// todas las peticiones han sido realizadas // todas las peticiones han sido realizadas
if (_REQUESTS_NUMBER === 0) { if (_REQUESTS_NUMBER === 0) {
...@@ -1191,6 +1235,14 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1191,6 +1235,14 @@ var res_display_module = (function (verbose, url_zacatuche) {
cell_summary = cell_summary.concat(item.cell_summary); cell_summary = cell_summary.concat(item.cell_summary);
}); });
// total_score_cell = respuesta.data_score_cell;
// percentage_avg = respuesta.percentage_avg
// decil_cells = respuesta.decil_cells
// time_validacion_decil = respuesta.time_validation // revisar si es necesario
// cell_summary = respuesta.cell_summary
console.log(total_eps_scr); console.log(total_eps_scr);
console.log(total_score_cell); console.log(total_score_cell);
console.log(percentage_avg); console.log(percentage_avg);
...@@ -1296,15 +1348,17 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1296,15 +1348,17 @@ var res_display_module = (function (verbose, url_zacatuche) {
total_request.with_data_score_decil = true total_request.with_data_score_decil = true
total_request.decil_selected = [_default_decil] total_request.decil_selected = [_default_decil]
verbo = _val_process_temp ? "countsTaxonsGroupTimeValidation" : "countsTaxonsGroup" verbo = _val_process_temp ? "countsTaxonsGroupTimeValidation" : "countsTaxonsGroup"
///ojo
fetch(_url_zacatuche + "/niche/" + verbo, { fetch("https://covid19.c3.unam.mx/gateway/api/analysis/cells/",{
method: "POST", method:"POST",
body: JSON.stringify(total_request), //body: JSON.stringify(data_request),
headers: { body: JSON.stringify(body),
"Content-Type": "application/json" headers:{
"Content-Type": "application/json"
} }
}) })
.then(resp => resp.json()) .then(resp => resp.json())
.then(resp => { .then(resp => {
...@@ -1313,8 +1367,9 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1313,8 +1367,9 @@ var res_display_module = (function (verbose, url_zacatuche) {
_VERBOSE ? console.log("_TREE_GENERATED.hasTotal resp.ok") : _VERBOSE; _VERBOSE ? console.log("_TREE_GENERATED.hasTotal resp.ok") : _VERBOSE;
var total_counts = resp.data; var total_counts = resp.data;
var validation_data = _val_process_temp ? resp.time_validation : resp.validation_data var validation_data = resp.validation_data
// var validation_data = resp.validation_data // var validation_data = resp.validation_data
...@@ -1325,24 +1380,21 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1325,24 +1380,21 @@ var res_display_module = (function (verbose, url_zacatuche) {
var decil_cells = resp.decil_cells var decil_cells = resp.decil_cells
// sobre escribe el resultado en caso de ser total // sobre escribe el resultado en caso de ser total
cell_summary = resp.cell_summary //cell_summary = resp.cell_summary
// console.log("total_counts: " + total_counts.length) // console.log("total_counts: " + total_counts.length)
// console.log(decil_cells) // console.log(decil_cells)
// console.log(percentage_avg) console.log(percentage_avg)
console.log("<====================================================>8")
console.log(validation_data) console.log(validation_data)
console.log(data_score_cell) console.log(data_score_cell)
console.log(">====================================================<8")
// console.log(cell_summary) // console.log(cell_summary)
if(_val_process_temp){
$("#div_munlist").show(); $("#div_munlist").hide();
processTableMun(cell_summary);
}
else{
$("#div_munlist").hide();
}
var data_decil_byanalysis = {data: _utils_module.processDataForScoreDecil(data_score_cell), gpo_name: "Total", names: names_byanalysis, deciles: validation_data}; var data_decil_byanalysis = {data: _utils_module.processDataForScoreDecil(data_score_cell), gpo_name: "Total", names: names_byanalysis, deciles: validation_data};
...@@ -1372,25 +1424,20 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1372,25 +1424,20 @@ var res_display_module = (function (verbose, url_zacatuche) {
}); });
} } else{
else{
console.log("<=======================RESULTS_TODISPLAY=============================>7")
console.log(_RESULTS_TODISPLAY) console.log(_RESULTS_TODISPLAY)
console.log(">====================================================<7")
if(_val_process_temp){
$("#div_munlist").show(); $("#div_munlist").hide();
processTableMun(cell_summary);
}
else{
$("#div_munlist").hide();
}
_histogram_module_nicho.createMultipleBarChart(_RESULTS_TODISPLAY, [], _id_chartscr_decil, d3.map([])); _histogram_module_nicho.createMultipleBarChart(_RESULTS_TODISPLAY, [], _id_chartscr_decil, d3.map([]));
loadDecilDataTable([_default_decil], "Total", true, percentage_avg, decil_cells); loadDecilDataTable([_default_decil], "Total", true, percentage_avg, decil_cells);
$('#chartdiv_score_decil').loading('stop'); $('#chartdiv_score_decil').loading('stop');
} }
...@@ -1442,14 +1489,13 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1442,14 +1489,13 @@ var res_display_module = (function (verbose, url_zacatuche) {
console.log("gridres_column: " + gridres_column); console.log("gridres_column: " + gridres_column);
console.log(map_result); console.log(map_result);
console.log(data); console.log(data);
fetch("https://covid19.c3.unam.mx/gateway/api/analysis/cells/",{
fetch(_url_zacatuche + "/niche/especie/getColumnsGrid", { method:"POST",
method: "POST", body: JSON.stringify(data),
body: JSON.stringify(data), headers:{
headers: { "Content-Type": "application/json"
"Content-Type": "application/json" }
} })
})
.then(resp => resp.json()) .then(resp => resp.json())
.then(resp => { .then(resp => {
...@@ -1556,11 +1602,12 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1556,11 +1602,12 @@ var res_display_module = (function (verbose, url_zacatuche) {
function processSingleResponse(data, data_request, validation_data = []) { function processSingleResponse(data, data_request, validation_data = []) {
_VERBOSE ? console.log("processSingleResponse") : _VERBOSE; _VERBOSE ? console.log("processSingleResponse") : _VERBOSE;
console.log(_TREE_GENERATED)
_TREE_GENERATED.groups.forEach(function (group_item, index) { _TREE_GENERATED.groups.forEach(function (group_item, index) {
// console.log(group_item); console.log(group_item);
// console.log(data_request); console.log(data_request);
if (group_item.groupid === data_request.covariables[0].group_item) { if (group_item.groupid === data_request.covariables[0].group_item) {
...@@ -1651,10 +1698,6 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1651,10 +1698,6 @@ var res_display_module = (function (verbose, url_zacatuche) {
console.log("value.name: " + value.name); console.log("value.name: " + value.name);
console.log("name: " + name); console.log("name: " + name);
console.log(_currentNameView !== name); console.log(_currentNameView !== name);
// console.log(_currentDecil !== decil);
console.log(_currentDecil); console.log(_currentDecil);
console.log(deciles); console.log(deciles);
...@@ -1714,10 +1757,10 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1714,10 +1757,10 @@ var res_display_module = (function (verbose, url_zacatuche) {
$('#map').loading('stop'); $('#map').loading('stop');
} }
else{ else{
console.log("se hace la petición a la segunda tabla")
fetch(_url_zacatuche + "/niche/countsTaxonsGroup", { fetch("https://covid19.c3.unam.mx/gateway/api/analysis/cells/", {
method: "POST", method: "POST",
body: JSON.stringify(request), body: JSON.stringify(body),
headers: { headers: {
"Content-Type": "application/json" "Content-Type": "application/json"
} }
...@@ -1729,12 +1772,13 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1729,12 +1772,13 @@ var res_display_module = (function (verbose, url_zacatuche) {
// $("#map_next").show("slow"); // $("#map_next").show("slow");
if (resp.ok) { if (resp.ok) {
_VERBOSE ? console.log("loadDecilDataTable resp.ok") : _VERBOSE; _VERBOSE ? console.log("loadDecilDataTable resp.ok") : _VERBOSE;
var percentage_avg = resp.percentage_avg; var percentage_avg = resp.percentage_avg;
var decil_cells = resp.decil_cells; var decil_cells = resp.data_score_cell;
console.log(percentage_avg) console.log(percentage_avg)
...@@ -1773,8 +1817,9 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1773,8 +1817,9 @@ var res_display_module = (function (verbose, url_zacatuche) {
_VERBOSE ? console.log("createTableDecil") : _VERBOSE; _VERBOSE ? console.log("createTableDecil") : _VERBOSE;
var decil_list = []; var decil_list = [];
// console.log(counts) console.log(counts)
_table_module_eps.createDecilList(counts); _table_module_eps.createDecilList(counts);
...@@ -1915,12 +1960,14 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1915,12 +1960,14 @@ var res_display_module = (function (verbose, url_zacatuche) {
data.forEach(function (d) { data.forEach(function (d) {
var item_list = []; var item_list = [];
// console.log("*****-----*****----**---*-**--*-*")
// console.log(d)
// las variables climáticas no cuentan con reino, phylum, clase, etc // las variables climáticas no cuentan con reino, phylum, clase, etc
if (d.reinovalido === "" && d.phylumdivisionvalido === "" && d.especieepiteto === "") { if (d.reinovalido === "" && d.phylumdivisionvalido === "" && d.especieepiteto === "") {
// var arg_values = d.especievalidabusqueda.split(" ") // var arg_values = d.especievalidabusqueda.split(" ")
console.log(d) //console.log(d)
var range = d.tag.split(":") var range = d.tag.split(":")
var label = d.label.replace(/[^a-zA-Z0-9]/g, "").replace(/ /g,'') var label = d.label.replace(/[^a-zA-Z0-9]/g, "").replace(/ /g,'')
...@@ -1931,11 +1978,11 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1931,11 +1978,11 @@ var res_display_module = (function (verbose, url_zacatuche) {
// var value = _iTrans.prop(label) + " (" + parseFloat(range[0]).toFixed(2) + " : " + parseFloat(range[1]).toFixed(2) + ") " // var value = _iTrans.prop(label) + " (" + parseFloat(range[0]).toFixed(2) + " : " + parseFloat(range[1]).toFixed(2) + ") "
if(d.tag.split(":").length > 1){ if(d.tag.split(":").length > 1){
var value = _iTrans.prop(label) + " (" + min + " : " + max + ") "; var value = _iTrans.prop(label) + " (" + d.tag + ") ";
}else { }else {
var value = _iTrans.prop(label) + ' (' + d.tag + ')'; var value = _iTrans.prop(label) + ' (' + d.tag + ')';
} }
item_list.push(value) item_list.push(value)
...@@ -1943,7 +1990,8 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1943,7 +1990,8 @@ var res_display_module = (function (verbose, url_zacatuche) {
} else { } else {
//item_list.push(d.generovalido + " " +d.especieepiteto + " " + d.nombreinfra) //item_list.push(d.generovalido + " " +d.especieepiteto + " " + d.nombreinfra)
item_list.push(d.description + ' ' + d.especieepiteto) //item_list.push(d.generovalido + ' ' + d.especievalida)
item_list.push(d.especievalida)
} }
// var namesp = d.reinovalido === "" ? d.type +" "+ d.layer : // var namesp = d.reinovalido === "" ? d.type +" "+ d.layer :
...@@ -1964,6 +2012,8 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1964,6 +2012,8 @@ var res_display_module = (function (verbose, url_zacatuche) {
}); });
var json_arg = {data: data_list} var json_arg = {data: data_list}
console.log("*//*/*/*/*/*/*/*/*/*/*/*/")
console.log(json_arg)
_table_module_eps.createEspList(json_arg); _table_module_eps.createEspList(json_arg);
_tbl_eps = true; _tbl_eps = true;
...@@ -1979,7 +2029,9 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -1979,7 +2029,9 @@ var res_display_module = (function (verbose, url_zacatuche) {
function activeDecilOccurrences(decil_cells, deciles){ function activeDecilOccurrences(decil_cells, deciles){
_VERBOSE ? console.log("activeDecilOccurrences") : _VERBOSE; _VERBOSE ? console.log("activeDecilOccurrences") : _VERBOSE;
console.log(decil_cells)
_map_module_nicho.updateDecilLayer(deciles) _map_module_nicho.updateDecilLayer(deciles)
_map_module_nicho.setDecilCells(decil_cells); _map_module_nicho.setDecilCells(decil_cells);
...@@ -2826,12 +2878,7 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -2826,12 +2878,7 @@ var res_display_module = (function (verbose, url_zacatuche) {
} }
else{ else{
// if (_AGENT_SELECTED == 'Hospederos')
// var _url = 'http://10.90.0.42:4006/graphql/hospederos/'
// else if (_AGENT_SELECTED == 'Patogenos')
// var _url = "http://10.90.0.42:4007/graphql/patogenos/"
// else
// var _url = "http://10.90.0.42:4008/graphql/vectores/"
var _url = "https://covid19.c3.unam.mx/gateway/api/nodes/" var _url = "https://covid19.c3.unam.mx/gateway/api/nodes/"
let nodo = _AGENT_SELECTED.toLowerCase() let nodo = _AGENT_SELECTED.toLowerCase()
...@@ -3243,7 +3290,7 @@ var res_display_module = (function (verbose, url_zacatuche) { ...@@ -3243,7 +3290,7 @@ var res_display_module = (function (verbose, url_zacatuche) {
setHistogramModule: setHistogramModule, setHistogramModule: setHistogramModule,
loadDecilDataTable: loadDecilDataTable, loadDecilDataTable: loadDecilDataTable,
set_taxones: set_taxones, set_taxones: set_taxones,
// _configureStyleMap: _configureStyleMap _configureStyleMap: _configureStyleMap,
activeDecilOccurrences: activeDecilOccurrences activeDecilOccurrences: activeDecilOccurrences
} }
......
...@@ -293,18 +293,18 @@ $("#modalMail").modal("hide"); ...@@ -293,18 +293,18 @@ $("#modalMail").modal("hide");
var temp_item_value = itemGroup.label.toString().split(">>")[1].trim(); var temp_item_value = itemGroup.label.toString().split(">>")[1].trim();
var temp_item_parent = itemGroup.parent ? itemGroup.parent : ""; var temp_item_parent = itemGroup.parent ? itemGroup.parent : "";
// _VERBOSE ? console.log(_reino_campos[temp_item_field]) : _VERBOSE; //_VERBOSE ? console.log(_reino_campos[temp_item_field]) : _VERBOSE;
_VERBOSE ? console.log(temp_item_field) : _VERBOSE; _VERBOSE ? console.log(temp_item_field) : _VERBOSE;
_VERBOSE ? console.log(temp_item_value) : _VERBOSE; _VERBOSE ? console.log(temp_item_value) : _VERBOSE;
_VERBOSE ? console.log(temp_item_parent) : _VERBOSE; _VERBOSE ? console.log(temp_item_parent) : _VERBOSE;
filters.push({ filters.push({
'biotic': true, 'biotic': true,
'level': group_level_biotic, 'level': group_level_biotic,
'rank': map_taxon.get(temp_item_field), 'rank': map_taxon.get(temp_item_field),
'value': temp_item_value, 'value': temp_item_value,
'type': itemGroup.type, 'type': itemGroup.type,
// 'field': _reino_campos[temp_item_field], // 'field': _reino_campos[temp_item_field],
// 'parent': temp_item_parent, // 'parent': temp_item_parent,
"fGroupId": _idFilterGroup, "fGroupId": _idFilterGroup,
......
...@@ -71,19 +71,20 @@ var table_module = (function(verbose) { ...@@ -71,19 +71,20 @@ var table_module = (function(verbose) {
function createDecilList(list_elements = null) { function createDecilList(list_elements = null) {
_VERBOSE ? console.log("createDecilList") : _VERBOSE; _VERBOSE ? console.log("createDecilList") : _VERBOSE;
console.log(list_elements.length)
if(list_elements){ if(list_elements){
_data_list_decil = [] _data_list_decil = []
list_elements.forEach(function(d) { list_elements.forEach(function(d) {
// console.log(d) //console.log(d)
var value_abio = ""; var value_abio = "";
if (d.species.indexOf("|") !== -1) { if (d.species.indexOf("|") !== -1) {
console.log(d); console.log(d);
var arg_values = d.species.split("|") var arg_values = d.species.split("|")
// console.log(arg_values) // console.log(arg_values)
...@@ -105,15 +106,15 @@ var table_module = (function(verbose) { ...@@ -105,15 +106,15 @@ var table_module = (function(verbose) {
// value = _iTrans.prop(lb) + " (" + parseFloat(range[0]).toFixed(2) + " : " + parseFloat(range[1]).toFixed(2) + ") " // value = _iTrans.prop(lb) + " (" + parseFloat(range[0]).toFixed(2) + " : " + parseFloat(range[1]).toFixed(2) + ") "
if(range.length > 1){ if(range.length > 1){
value_abio = _iTrans.prop(lb) + " (" + min + " : " + max +")"; value_abio = _iTrans.prop(lb) + " (" + min + " : " + max +")";
}else{ }else{
value_abio = _iTrans.prop(lb) + ' (' + tag + ')'; value_abio = _iTrans.prop(lb) + ' (' + tag + ')';
if(tag === ''){ if(tag === ''){
//value_abio = d.species; //value_abio = d.species;
value_abio = ''; value_abio = '';
} }
} }
} }
...@@ -125,18 +126,21 @@ var table_module = (function(verbose) { ...@@ -125,18 +126,21 @@ var table_module = (function(verbose) {
var item_list = []; var item_list = [];
item_list.push(d.decil) item_list.push(d.decil)
if(d.description === '') { // if(d.description === '') {
item_list.push(value_abio) // item_list.push(value_abio)
}else{ // }else{
item_list.push(d.description + ' '+ d.species.split(' ')[1]) // item_list.push(d.description + ' '+ d.species.split(' ')[1])
} // }
item_list.push(d.species)
item_list.push(d.epsilon)
item_list.push(d.score) item_list.push(d.epsilon.toFixed(3))
item_list.push(d.score.toFixed(3))
item_list.push(d.occ) item_list.push(d.occ)
item_list.push(d.occ_perdecile) item_list.push(d.occ_perdecile)
_data_list_decil.push(item_list) _data_list_decil.push(item_list)
}) })
} }
...@@ -318,9 +322,20 @@ var table_module = (function(verbose) { ...@@ -318,9 +322,20 @@ var table_module = (function(verbose) {
function createEspList(rawdata = null) { function createEspList(rawdata = null) {
_VERBOSE ? console.log("createEspList") : _VERBOSE; _VERBOSE ? console.log("createEspList") : _VERBOSE;
console.log("cambiar a 3 decimales")
// var data_list = rawdata.data; // var data_list = rawdata.data;
_data_list_eps = rawdata ? rawdata.data : _data_list_eps _data_list_eps = rawdata ? rawdata.data : _data_list_eps
// console.log(rawdata)
// console.log(rawdata.data)
_data_list_eps.forEach(element=> element[6]=element[6].toFixed(3))
_data_list_eps.forEach(element=> element[5]=element[5].toFixed(3))
console.log(_data_list_eps)
if (_tbl != false) { if (_tbl != false) {
// $('#tdisplay').dataTable().fnClearTable(); // $('#tdisplay').dataTable().fnClearTable();
...@@ -837,19 +852,21 @@ var table_module = (function(verbose) { ...@@ -837,19 +852,21 @@ var table_module = (function(verbose) {
item_list.push(name_s); item_list.push(name_s);
item_list.push(name_t); item_list.push(name_t);
item_list.push(val.nij); item_list.push(val.nij);
item_list.push(val.nj); item_list.push(val.nj);
item_list.push(val.ni); item_list.push(val.ni);
item_list.push(val.n); item_list.push(val.n);
item_list.push(val.value); item_list.push(val.value.toFixed(3));
item_list.push(val.score); item_list.push(val.score.toFixed(3));
data_list.push(item_list) data_list.push(item_list)
}); });
// }) // })
......
...@@ -35,9 +35,9 @@ var toast_module = (function(verbose){ ...@@ -35,9 +35,9 @@ var toast_module = (function(verbose){
"debug": false, "debug": false,
"onclick": null, "onclick": null,
"fadeIn": 300, "fadeIn": 300,
"fadeOut": 1000, "fadeOut": 2000,
"timeOut": 2000, "timeOut": 2000,
"extendedTimeOut": 2000, "extendedTimeOut": 3000,
"positionClass": "toast-center-center", "positionClass": "toast-center-center",
"preventDuplicates": true, "preventDuplicates": true,
"progressBar": true "progressBar": true
......
...@@ -216,7 +216,7 @@ var utils_module = (function (verbose) { ...@@ -216,7 +216,7 @@ var utils_module = (function (verbose) {
} }
function processDataForScoreCell(data, apriori, mapa_prob, all_cells = []) { function processDataForScoreCell(data, apriori, mapa_prob, all_cells = []) {
_VERBOSE ? console.log("processDataForScoreCell") : _VERBOSE; _VERBOSE ? console.log("processDataForScoreCell") : _VERBOSE;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -107,10 +107,11 @@ header .logo{ ...@@ -107,10 +107,11 @@ header .logo{
} }
header #logoPINCC{ header #logoPINCC{
background-color: rgba(195,195,195,.25); background-color: rgba(195,195,195,.25);
background-image: url(https://www.pincc.unam.mx/wp-content/uploads/2021/04/cropped-logo_pincc_alta.png); background-image: url(/images/pincc.jpg);
background-size:4em; background-size:5em;
width: 5em; width: 5em;
} }
header #logoC3{ header #logoC3{
background-color: rgba(195,195,195,.25); background-color: rgba(195,195,195,.25);
background-image: url(https://chilam.c3.unam.mx/wp-content/themes/chilam/images/logos/c3-g.svg); background-image: url(https://chilam.c3.unam.mx/wp-content/themes/chilam/images/logos/c3-g.svg);
...@@ -122,6 +123,13 @@ header #logoChilam{ ...@@ -122,6 +123,13 @@ header #logoChilam{
background-size:15rem; background-size:15rem;
width: 15.5rem; width: 15.5rem;
} }
header #logoCAyCC{
background-image: url(/images/CAyCC.png);
background-size:14rem;
width: 15.5rem;
}
header #logoCIC{ header #logoCIC{
background-color: rgba(195,195,195,.5); background-color: rgba(195,195,195,.5);
background-image: url(https://chilam.c3.unam.mx/wp-content/themes/chilam/images/logos/cic-g.svg); background-image: url(https://chilam.c3.unam.mx/wp-content/themes/chilam/images/logos/cic-g.svg);
......
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