Skip to content
Snippets Groups Projects
Commit 0a41d20d authored by andsant's avatar andsant
Browse files

Update 6 files

- /README.md
- /index.html
- /visualizacion.js
- /datosDesescolarizacion.csv
- /mundo.json
- /visualizacion.css
parents
No related branches found
No related tags found
No related merge requests found
En esta visualización, se muestra la tasa de no escolarización total de cada país mediante un mapa coroplético.
Es un mapa que contiene interactividad, al pasar el cursor sobre un país, aparece un recuadro de información que muestra la tasa de no escolarización total, desglosada por sexo (hombres y mujeres) y por tipo de zona residencial (rural y urbana). Además, se indican la fuente y año de los datos. También contiene un zoom para poder consultar todos los países sin problema.
\ No newline at end of file
pais,codigoPais,total,mujeres,hombres,rural,urbana,year,fuente
"Aruba","ABW",0.8,,,,,2014,UNESCO
"Somalilandia","ABV",sin datos,,,,,,
"Afganistán","AFG",37.0,47.0,28.0,42.0,19.0,2015,UNICEF
"Angola","AGO",22.0,22.0,21.0,35.0,14.0,2016,UNICEF
"Albania","ALB",2.0,2.0,3.0,4.0,1.0,2018,UNICEF
"Antártida","ATA",sin datos,,,,,,
"Tierras Australes y Antárticas Francesas","ATF",sin datos,,,,,,
"Algeria","DZA",2.0,2.0,2.0,2.0,1.0,2020,UNICEF
"Andorra","AND",0.4,,,,,2023,UNESCO
"Emiratos Árabes Unidos","ARE",0.18,,,,,2023,UNESCO
"Argentina","ARG",0.0,0.0,0.0,,,2020,UNESCO
"Armenia","ARM",5.0,4.0,5.0,6.0,3.0,2016,UNICEF
"Samoa Americana","ASM",sin datos,,,,,,
"Antigua y Barbuda","ATG",0.26,,,,,2019,UNESCO
"Australia","AUS",0.29,,,,,2022,UNESCO
"Austria","AUT",1.68,,,,,2022,UNESCO
"Azerbaiyán","AZE",1.54,,,,,2023,UNESCO
"Burundi","BDI",18.0,18,18,19,6,2017,UNICEF
"Bélgica","BEL",1.2,,,,,2022,UNESCO
"Benin","BEN",32.0,35,28,38,21,2018,UNICEF
"Burkina Faso","BFA",48.0,50.0,46.0,55.0,17.0,2010,UNICEF
"Bangladesh","BGD",6.0,5.0,8.0,6.0,6.0,2019,UNICEF
"Bulgaria","BGR",5.3,,,,,2022,UNESCO
"Bahrein","BHR",7.0,,,,,2023,UNESCO
"Bahamas","BHS",29.34,,,,,2023,UNESCO
"Bosnia y Herzegovina","BIH",3.0,4.0,2.0,3.0,3.0,2012,UNICEF
"Belarús","BLR",0.0,0,0,0,0,2020,UNICEF
"Belice","BLZ",2.0,2.0,2.0,3.0,1.0,2016,UNICEF
"Bermudas","BMU",0.68,,,,,2012,UNESCO
"Bolivia","BOL",3.0,3.0,3.0,3.0,3.0,2016,UNICEF
"Brasil","BRA",0,0,1,1,0,2019,UNICEF
"Barbados","BRB",1.0,1,0,1,0,2012,UNICEF
"Brunei Darussalam","BRN",3.55,,,,,2023,UNESCO
"Bhután","BTN",8.0,7.0,9.0,10.0,3.0,2010,UNICEF
"Botswana","BWA",1.0,1.0,1.0,1.0,1.0,2017,UNICEF
"República Centroafricana","CAF",26.0,30,23,34,12,2019,UNICEF
"Canadá","CAN",3.99,,,,,2022,UNESCO
"Suiza","CHE",0.26,,,,,2022,UNESCO
"Islas del Canal","CHI",sin datos,,,,,,
"Chile","CHL",1.0,1,2,1,2,2017,UNICEF
"China","CHN",5.0,5,5,5,5,2015,UNICEF
"Côte d'Ivoire","CIV",23.0,26,21,29,15,2016,UNICEF
"Camerún","CMR",15.0,17,14,24,6,2018,UNICEF
"República Democrática del Congo","COD",22.0,22,21,28,13,2018,UNICEF
"República del Congo","COG",3,3,3,6,2,2015,UNICEF
"Colombia","COL",2,2,2,2,2,2015,UNICEF
"Comoras","COM",14,15,14,17,9,2012,UNICEF
"Cabo Verde","CPV",10.87,,,,,2021,UNESCO
"Costa Rica","CRI",1,1,1,1,1,2018,UNICEF
"Cuba","CUB",1,1,1,1,1,2019,UNICEF
"Curacao","CUW",3.4,,,,,2023,UNESCO
"Islas Caimán","CYM",14.5,,,,,2023,UNESCO
"Chipre","CYP",0.84,,,,,2022,UNESCO
"República Checa","CZE",0.08,,,,,2022,UNESCO
"Alemania","DEU",1.91,,,,,2022,UNESCO
"Djibouti","DJI",sin datos,,,,,,
"Dominica","DMA",12.86,,,,,2023,UNESCO
"Dinamarca","DNK",0.59,,,,,2022,UNESCO
"República Dominicana","DOM",3,3,3,4,3,2019,UNICEF
"Argelia","DZA",0.97,,,,,2023,UNESCO
"Ecuador","ECU",1,2,1,1,2,2019,UNICEF
"Egipto","EGY",3,3,3,3,3,2014,UNICEF
"Eritrea","ERI",44.87,,,,,2022,UNESCO
"España","ESP",1.80,,,,,2022,UNESCO
"Estonia","EST",1.82,,,,,2022,UNESCO
"Etiopía","ETH",25,25,26,27,9,2016,UNICEF
"Finlandia","FIN",1.97,,,,,2022,UNESCO
"Fiji","FJI",1.88,,,,,2023,UNESCO
"Francia","FRA",0.01,,,,,2022,UNESCO
"Islas Feroe","FRO",sin datos,,,,,,
"Islas Malvinas","FLK",sin datos,,,,,,
"Micronesia (Estados Federados de)","FSM",15.96,,,,,2022,UNESCO
"Gabón","GAB",4,3,4,5,4,2012,UNICEF
"Reino Unido","GBR",0.09,,,,,2022,UNESCO
"Georgia","GEO",1,1,1,2,1,2018,UNICEF
"Ghana","GHA",7,6,7,8,4,2018,UNICEF
"Gibraltar","GIB",23.11,,,,,1982,UNESCO
"Guinea","GIN",34,37,31,44,14,2018,UNICEF
"Gambia","GMB",27,27,28,35,18,2013,UNICEF
"Guinea-Bissau","GNB",28,26,29,36,11,2019,UNICEF
"Guinea Ecuatorial","GNQ",61.80,,,,,2015,UNESCO
"Grecia","GRC",0,,,,,2022,UNESCO
"Granada","GRD",18.37,,,,,2021,UNESCO
"Groenlandia","GRL",sin datos,,,,,,
"Guatemala","GTM",6,6,5,6,4,2015,UNICEF
"Guam","GUM",sin datos,,,,,,
"Guyana","GUY",2,2,2,3,1,2020,UNICEF
"Hong Kong","HKG",0.87,,,,,2022,UNESCO
"Honduras","HND",4,4,5,5,3,2019,UNICEF
"Croacia","HRV",1.73,,,,,2022,UNESCO
"Haití","HTI",8,8,9,11,4,2017,UNICEF
"Hungría","HUN",3.68,,,,,2022,UNESCO
"Indonesia","IDN",1,1,2,2,1,2017,UNICEF
"Isla de Man","IMN",sin datos,,,,,,
"India","IND",6,6,6,7,4,2016,UNICEF
"Irlanda","IRL",1.10,,,,,2022,UNESCO
"Irán","IRN",2.01,,,,,2020,UNESCO
"Iraq","IRQ",8,10,7,11,7,2018,UNICEF
"Islandia","ISL",1.52,,,,,2022,UNESCO
"Israel","ISR",3.66,,,,,2022,UNESCO
"Italia","ITA",2.5,,,,,2022,UNESCO
"Jamaica","JAM",0,0,1,1,0,2011,UNICEF
"Jordania","JOR",3,2,3,2,3,2018,UNICEF
"Japón","JPN",0.10,,,,,2022,UNESCO
"Kazajstán","KAZ",0,0,0,0,1,2015,UNICEF
"Kenya","KEN",5,5,5,5,3,2014,UNICEF
"Kirguistán","KGZ",1,1,1,1,1,2018,UNICEF
"Camboya","KHM",6,5,7,7,3,2014,UNICEF
"Kiribati","KIR",3,2,4,2,4,2019,UNICEF
"Saint Kitts y Nevis","KNA",1.15,,,,,2010,UNESCO
"República de Corea","KOR",1.07,,,,,2022,UNESCO
"Kuwait","KWT",2.95,,,,,2015,UNESCO
"República Democrática Popular Lao","LAO",8,8,8,10,3,2017,UNESCO
"Líbano","LBN",24.16,,,,,2023,UNESCO
"Liberia","LBR",17,17,18,23,14,2013,UNICEF
"Libia","LBY",3.33,,,,,1978,UNESCO
"Santa Lucía","LCA",0,1,0,0,0,2012,UNICEF
"Liechtenstein","LIE",0.82,,,,,2021,UNESCO
"Sri Lanka","LKA",2,2,2,2,3,2016,UNICEF
"Lesotho","LSO",3,2,4,3,3,2018,UNICEF
"Lituania","LTU",0.02,,,,,2022,UNESCO
"Luxemburgo","LUX",0.34,,,,,2022,UNESCO
"Letonia","LVA",1.44,,,,,2022,UNESCO
"Región Administrativa Especial de Macao, China","MAC",14.20,,,,,2023,UNESCO
"Isla de San Martín (parte francesa)","MAF",sin datos,,,,,,
"Marruecos","MAR",0.71,,,,,2023,UNESCO
"Mónaco","MCO",sin datos,,,,,,
"República de Moldova","MDA",1,1,1,0,1,2012,UNICEF
"Madagascar","MDG",22,19,24,24,11,2018,UNICEF
"Maldivas","MDV",1,1,1,1,1,2017,UNICEF
"México","MEX",1,1,1,2,1,2018,UNICEF
"Islas Marshall","MHL",2.45,,,,,2022,UNESCO
"Macedonia del Norte","MKD",2,1,2,1,2,2019,UNICEF
"Malí","MLI",47,50,45,55,18,2015,UNICEF
"Malta","MLT",6.87,,,,,2022,UNESCO
"Myanmar","MMR",6,7,5,7,3,2016,UNICEF
"Montenegro","MNE",3,3,4,3,4,2018,UNICEF
"Mongolia","MNG",4,3,5,3,4,2018,UNICEF
"Mariana","MNP",sin datos,,,,,,
"Mozambique","MOZ",23,23,23,27,12,2011,UNICEF
"Mauritania","MRT",42,40,44,51,29,2015,UNICEF
"Mauricio","MUS",1.74,,,,,2023,UNESCO
"Malawi","MWI",6,5,6,6,2,2016,UNICEF
"Malasia","MYS",1.85,,,,,2023,UNESCO
"Namibia","NAM",4,4,5,6,2,2013,UNICEF
"Nueva Caledonia","NCL",5.75,,,,,1991,UNESCO
"Níger","NER",49,54,45,55,17,2012,UNICEF
"Nigeria","NGA",28,29,27,39,11,2018,UNICEF
"Nicaragua","NIC",9.75,,,,,2023,UNESCO
"Países Bajos","NLD",0.40,,,,,2022,UNESCO
"Noruega","NOR",0.95,,,,,2022,UNESCO
"Nepal","NPL",6,7,5,6,5,2019,UNICEF
"Nauru","NRU",3,2,3,,,2011,UNICEF
"Nueva Zelanda","NZL",2.548,,,,,2022,UNESCO
"Omán","OMN",3,2,3,3,2,2014,UNICEF
"Pakistán","PAK",23,27,19,28,12,2018,UNICEF
"Panamá","PAN",1,1,1,1,1,2013,UNICEF
"Perú","PER",3,2,3,2,3,2012,UNICEF
"Filipinas","PHL",2,2,3,2,2,2017,UNICEF
"Palau","PLW",12.59,,,,,2023,UNESCO
"Papua Nueva Guinea","PNG",1.30,,,,,2018,UNESCO
"Polonia","POL",0.02,,,,,2022,UNESCO
"Puerto Rico","PRI",17.93,,,,,2023,UNESCO
"República Popular Democrática de Corea","PRK",3,3,3,4,3,2017,UNICEF
"Portugal","PRT",0.34,,,,,2022,UNESCO
"Paraguay","PRY",1,1,1,1,0,2017,UNICEF
"Ribera Occidental y Gaza","PSE",8.92,,,,,2023,UNESCO
"Polinesia Francesa","PYF",8.67,,,,,1996,UNESCO
"Qatar","QAT",3,2,3,,,2012,UNICEF
"Rumania","ROU",8,9,8,,,2016,UNICEF
"Federación de Rusia","RUS",4.94,,,,,2023,UNESCO
"Rwanda","RWA",6,4,7,6,4,2015,UNICEF
"Arabia Saudita","SAU",2.82,,,,,2021,UNESCO
"Sudán","SDN",21,21,20,27,6,2014,UNICEF
"Senegal","SEN",39,38,40,51,20,2019,UNICEF
"Singapur","SGP",0.93,,,,,2022,UNESCO
"Islas Salomón","SLB",28.62,,,,,2023,UNESCO
"Sierra Leona","SLE",17,15,20,24,8,2017,UNICEF
"El Salvador","SLV",4,3,4,5,3,2014,UNICEF
"San Marino","SMR",6.76,,,,,2023,UNESCO
"Somalia","SOM",85.08,,,,,1980,UNESCO
"Serbia","SRB",1,1,0,0,1,2019,UNICEF
"Sahara Occidental","ESH",sin datos,,,,,,
"Sudán del Sur","SDS",72.0,75.0,70.0,78.0,56.0,2010,UNICEF
"Santo Tomé y Príncipe","STP",3,3,4,3,3,2019,UNICEF
"Suriname","SUR",2,2,3,3,2,2018,UNICEF
"República Eslovaca","SVK",2.86,,,,,2022,UNESCO
"Eslovenia","SVN",1.20,,,,,2022,UNESCO
"Suecia","SWE",0.56,,,,,2022,UNESCO
"Eswatini","SWZ",1,1,2,2,1,2014,UNICEF
"Sint Maarten (Dutch part)","SXM",sin datos,,,,,,
"Seychelles","SYC",2.83,,,,,2023,UNESCO
"República Árabe Siria","SYR",23.57,,,,,2023,UNESCO
"Islas Turcas y Caicos","TCA",2,1,4,0,2,2020,UNICEF
"Chad","TCD",57.0,59.0,54.0,61.0,36.0,2019,UNICEF
"Togo","TGO",8,9,8,11,3,2017,UNICEF
"Tailandia","THA",1,1,1,1,1,2019,UNICEF
"Tayikistán","TJK",2,2,2,2,2,2017,UNICEF
"Turkmenistán","TKM",1,1,2,1,2,2019,UNICEF
"Timor-Leste","TLS",10,9,10,11,4,2016,UNICEF
"Tonga","TON",4,4,4,4,3,2019,UNICEF
"Trinidad y Tobago","TTO",1,1,1,1,1,2011,UNICEF
"Túnez","TUN",3,3,3,3,3,2018,UNICEF
"Turquía","TUR",4,3,5,4,4,2013,UNICEF
"Tuvalu","TUV",16,15,16,20,13,2020,UNICEF
"Taiwan","TWN",sin datos,,,,,,
"Tanzanía","TZA",16,14,18,19,7,2016,UNICEF
"Uganda","UGA",8,8,9,9,6,2016,UNICEF
"Ucrania","UKR",2,2,2,3,1,2012,UNICEF
"Uruguay","URY",1,1,1,0,1,2013,UNICEF
"Estados Unidos","USA",3.98,,,,,2022,UNESCO
"Uzbekistán","UZB",4.8,,,,,2023,UNESCO
"San Vicente y las Granadinas","VCT",1.39,,,,,2023,UNESCO
"Venezuela","VEN",0.55,,,,,2023,UNESCO
"Islas Vírgenes Británicas","VGB",1.00,,,,,2022,UNESCO
"Islas Vírgenes (EE.UU.)","VIR",sin datos,,,,,,
"Viet Nam","VNM",2,2,1,2,1,2014,UNICEF
"Vanuatu","VUT",8.58,,,,,2023,UNESCO
"Samoa","WSM",7,7,7,7,6,2020,UNICEF
"Kosovo","OSA",2,2,2,1,3,2020,UNICEF
"Yemen","YEM",23,27,19,27,14,2013,UNICEF
"Sudáfrica","ZAF",1,1,1,1,1,2016,UNICEF
"Zambia","ZMB",16,13,18,19,9,2018,UNICEF
"Zimbabwe","ZWE",5,4,5,5,4,2019,UNICEF
"Chipre del Norte","-99",sin datos,,,,,,
\ No newline at end of file
<!DOCTYPE HTMLPUBLIC “-//W3C//DTD HTML4.01”>
<html>
<head>
<title>Mapa coroplético</title>
<script src="http://d3js.org/d3.v6.min.js"></script>
<link rel="stylesheet" type="text/css" href="visualizacion.css">
</head>
<body style="background-color: rgba(191, 204, 226, 0.504);">
<div id="div1">
<h1 id="titulo">TASA DE NIÑOS SIN ESCOLARIZAR EN PRIMARIA</h1>
<div id="div2">
<svg id="svg_mapa" width="1050" height="435" >
<rect width="100%" height="100%" fill="white" stroke="black" />
</svg>
<script src="visualizacion.js"></script>
</div>
</div>
</body>
</html>
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
#div1 {
margin-top: 3%;
height: 90%;
width: 95%;
}
#div2 {
margin-left: 7%;
height: 75%;
width: 90%;
}
#titulo{
font-family: 'Verdana', sans-serif;
font-size: 22pt;
text-align: center;
color: rgb(2,2,67);
}
#parrafo1{
font-family: arial;
font-size: 14pt;
text-align:left;
color:red;
}
var datos = "datosDesescolarizacion.csv";
var mapa = "mundo.json";
var paletaColores = ['#32CD32', '#ADFF2F', '#FFFF00', '#FF6347', '#B22222', 'grey'];
var dominio = [2,10,20,30];
const svg = d3.select("svg"),
width = +svg.attr("width"),
height = +svg.attr("height")
// path del mapa y proyección
const path = d3.geoPath();
const projection = d3.geoNaturalEarth1()
.scale(150)
.center([-20,-10]);
// crea el Tooltip, cuadro de texto que contiene datos adicionales
const Tooltip = d3.select("body")
.append("div")
.style("opacity", 0)
.attr("class", "tooltip")
.style("position","absolute")
.style("background-color", "white")
.style("border", "solid")
.style("border-width", "2px")
.style("border-radius", "5px")
.style("padding", "5px");
//Zoom
const g = svg.append("g");
const zoom = d3.zoom()
.scaleExtent([1, 9]) //Límites del zoom
.on("zoom", function (event) {
g.attr("transform", event.transform);
});
svg.call(zoom); //agregar al svg el comportamiento de zoom
// Datos y paleta de colores del mapa
const data = new Map();
const colorScale = d3.scaleThreshold()
.domain(dominio)
.range(paletaColores);
Promise.all([
d3.json(mapa),
d3.csv(datos, function(d) { // Carga datos del csv
data.set(d.codigoPais, {
pais: d.pais,
total: +d.total,
mujeres: +d.mujeres,
hombres: +d.hombres,
rural: +d.rural,
urbana: +d.urbana,
year: d.year,
fuente: d.fuente
});
})
]).then(function(loadData){
let topo = loadData[0]
//define el evento mouseOver
let mouseOver = function(d) {
d3.selectAll(".Country")
.transition()
.duration(200)
.style("opacity", .6)
d3.select(this)
.transition()
.duration(200)
.style("opacity", 1)
Tooltip
.style("opacity", 1)
d3.select(this)
.style("stroke", "black")
.style("opacity", 1)
}
//define el evento mousemove
let mousemove = function(event, d) {
let countryData = data.get(d.id) || {};
var contenido = '';
if(countryData.total>=0){ // Crea el texto del Tooltip
contenido = `<strong>${countryData.pais} </strong>(${countryData.total}%)<br>`;
if(countryData.mujeres || countryData.hombres){
contenido = contenido + `<strong>Mujeres:</strong> ${countryData.mujeres}%<br>
<strong>Hombres:</strong> ${countryData.hombres}% <br>`;
}
if(countryData.rural || countryData.urbana){
contenido = contenido + `<strong>Rural:</strong> ${countryData.rural}% <br>
<strong>Urbana:</strong> ${countryData.urbana}% <br>`;
}
contenido = contenido + `${countryData.fuente}, ${countryData.year}`;
}else if (!countryData.total && !countryData.mujeres && !countryData.hombres && !countryData.rural && !countryData.urbana) {
contenido = `<strong>${countryData.pais} <br> </strong>(sin datos)`;
}
Tooltip
.style("opacity", 1)
.html(contenido)
.style("left", (event.pageX + 10) + "px")
.style("top", (event.pageY + 10) + "px");
}
//define el evento mouseLeave
let mouseLeave = function(d) {
Tooltip
.style("opacity", 0)
.html(``)
d3.select(this)
.style("stroke", "none")
d3.selectAll(".Country")
.transition()
.duration(200)
.style("opacity", 1)
.style("stroke","black")
d3.select(this)
.transition()
.duration(200)
}
// dibuja el mapa
g.selectAll("path")
.data(topo.features)
.enter()
.append("path")
.attr("d", d3.geoPath().projection(projection))//dibuja la silueta de cada país
//rellena cada país de su correspondiente color
.attr("fill", function (d) {
let countryData = data.get(d.id) || {};
d.total = countryData.total;
if (d.total>=0){
return colorScale(d.total);
}
return "grey";
})
.style("stroke", "black")
.style("stroke-width","0.3px")
.attr("class", function(d){ return "Country" } )
.style("opacity", 1)
.on("mouseover", mouseOver )
.on("mousemove", mousemove )
.on("mouseleave", mouseLeave )
}
)
//Leyenda
var keys = ["< 2%", "2% - 10%", "10% - 20%", "20% - 30%", "> 30%", "Sin datos"]
var color = d3.scaleOrdinal()
.domain(keys)
.range(paletaColores);
svg.append("rect").attr("x", 10).attr("y", 270).attr("width", 115).attr("height", 155).style("fill", "white").style("stroke","grey")
svg.append("text").attr("x", 35).attr("y", 290).text('Leyenda').style("font-size", "16px")
// Añade los cuadros de cada color
var size = 15
svg.selectAll("rectangulos")
.data(keys)
.enter()
.append("rect")
.attr("x", 20)
.attr("y", function(d,i){ return 300 + i*(size+5)})
.attr("width", size)
.attr("height", size)
.style("fill", function(d){ return color(d)})
// Añade texto por cada cuadro de la leyenda
svg.selectAll("etiquetas")
.data(keys)
.enter()
.append("text")
.attr("x", 22 + size*1.2)
.attr("y", function(d,i){ return 305 + i*(size+5) + (size/2)})
.text(function(d){ return d})
.attr("text-anchor", "left")
.style("alignment-baseline", "middle")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment