-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomo_se_gasta.html
More file actions
348 lines (312 loc) · 15.2 KB
/
como_se_gasta.html
File metadata and controls
348 lines (312 loc) · 15.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Mi Municipio - Cómo se gasta</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="styles.css" />
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="js/papaparse.min.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-142060975-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-142060975-1');
</script>
</head>
<body>
<div class="container" style="padding:0px">
<nav class="navbar" role="navigation">
<a class="navbar-brand"></a>
<ul class="navbar-nav flex-row float-right">
<li class="nav-item"><a href="nosotros.html" class="nav-link">NOSOTROS</a></li>
<li class="nav-item"><a href="mailto:[email protected]" class="nav-link">CONTACTO</a></li>
<li class="nav-item item-highlight"><a href="javascript:;" class="nav-link">ACAPULCO DE JUÁREZ <img src="images/flecha-topmenu.jpg" /></a></li>
</ul>
</nav>
</div>
<div class="container">
<div class="row" id="mainLogo"><a href="index.html"><img src="images/logo-header.jpg" /></a></div>
</div>
<div class="container title-bar-container">
<div class="row">
<div class="col" id="gastaTitleBar">
<div class="row main-title">¿Cómo se gasta?</div>
<div class="row title-submenu">
<div class="col">
<a href="#como-se-gasta">¿Cómo se gasta?</a>
<a href="#cuanto-recibio-mi-municipio">¿Cuánto recibió mi municipio?</a>
<a href="#cuanto-gasto-en-obras">¿Cuánto gastó en obras mi municipio?</a>
</div>
</div>
</div>
<div class="col title-button" id="planTitleButton">
<div class="title"><a href="plan_municipal.html">Plan</a><br /> <a href="plan_municipal.html">municipal</a></div>
<div class="icon"><a href="plan_municipal.html"><img src="images/plan-title-icon.jpg" /></a></div>
</div>
<div class="col title-button" id="decideTitleButton">
<div class="title"><a href="quien_decide.html">¿Quién</a><br /> <a href="quien_decide.html">decide?</a></div>
<div class="icon"><img src="images/decide-title-icon.jpg" /></div>
</div>
</div>
</div>
<a name="como-se-gasta"></a>
<div class="container body-content body-gasta-white">
<div class="row">
<div class="col body-title" id="gasta1">La Ley de Coordinación Fiscal obliga a las autoridades de tu municipio a</div>
</div>
<div class="row" style="padding:20px 0 0 0">
<div class="col-5 fondo-naranja">
<div class="row" style="padding:20px 20px 0 20px">
<div class="col-2" style="padding-top:10px"><img src="images/gasta-1.jpg" style="max-width:120%" /></div>
<div class="col">
<p class="title" id="gasta2">Informar</p>
<ul>
<li><span id="wordbanner">Cuánto recibe mi municipio para obras de</span> <strong><span id="wordBannerText">alcantarillado</span></strong>.</li>
<li id="gasta3">Cuándo lo gasta.</li>
<li id="gasta4">Dónde se encuentran las obras.</li>
<li id="gasta5">Quiénes son los beneficiarios.</li>
<li id="gasta6">Costo de las obras.</li>
<ul>
</div>
</div>
</div>
<div class="col-7 fondo-naranja" style="border-left:solid 8px #FFF">
<div class="row" style="padding:20px 20px 0 20px">
<div class="col-2" style="padding-top:10px"><img src="images/gasta-2.jpg" style="max-width:100%" /></div>
<div class="col">
<p class="title" id="gasta7">Seleccionar obras</p>
<ul>
<li id="gasta8">que se realizarán durante el año.</li>
<li id="gasta9">dichas obras deben atender a varias zonas del municipio.</li>
<li id="gasta10">la selección de obras debe realizarse entre el Consejo de Planeación para el Desarrollo Municipal (Coplademun) y los consejos de Desarrollo Municipal (CDM). En estos consejos deben participar autoridades municipales y representantes de grupos y organizaciones de la socieda civil.</li>
<ul>
</div>
</div>
</div>
</div>
</div>
<a name="cuanto-recibio-mi-municipio"></a>
<div class="container body-content body-gasta-white">
<div class="row">
<div class="col body-title">¿Cuánto recibió mi municipio?</div>
</div>
<div class="row">
<p class="gastaInformativo" id="cuanto1">
Acapulco recibió<span class="naranja">585,006,804.09</span> en 2017 para este tipo de obras y <span class="verde">sí informó a la población</span>.
</p>
</div>
</div>
<a name="cuanto-gasto-en-obras"></a>
<div class="container body-content body-naranja">
<div class="row">
<div class="col body-title">¿Cuánto gastó en obras mi municipio?</div>
</div>
<div class="row" style="padding-top:20px">
<p class="gastaInformativoNaranja" id="cuanto2">
En 2016, de los <span>507,731,381.00 pesos</span>
que Acapulco recibió,
<span>gastó 503,931,380.00, equivalente al 99% del presupuesto total para estos rubros.</span>
</p>
</div>
<div class="row" style="padding-bottom:20px">
<div class="col" style="padding-right:0; margin-right:0; padding-left:0; margin-left:0">
<svg id="treemapContainer"><g></g></svg>
</div>
<div class="col treemapLegend">
<img src="images/treemaplegend.jpg" />
</div>
</div>
</div>
<div class="container body-content body-gasta-white">
<div class="row">
<div class="col body-title">¡Infórmate y participa!</div>
</div>
<div class="row">
<div class="col">
<p style="font-size:15px" id="informate1">Guía para conocer el proceso de la planeación del gasto público de mi municipio.</p>
<!--<p><img src="images/placeholder-gasta.png" /></p>-->
<div id="informate1embed"><iframe style="width:525px; height:342px;" src="//e.issuu.com/embed.html#35186677/65362607" frameborder="0" allowfullscreen></iframe></div>
</div>
</div>
</div>
<div class="container footer-naranja">
<div class="row">
<div class="col text-right">
<a href="mailto:[email protected]"><img src="images/footericon-a-naranja.jpg" /></a>
<a href="https://www.facebook.com/MiMunicipioAcapulco/"><img src="images/footericon-fb-naranja.jpg" /></a>
</div>
</div>
</div>
<script>
var wordBanner = [];
var currentBanner = 0;
var treeData = {
"name": "Gasto por tipo de obras",
"children": []
};
Papa.parse("https://docs.google.com/spreadsheets/d/e/2PACX-1vQs9lXClRFuVomHZ8psDxm4cMyH3GdNZoMcnlXd2zCIZGvpmNh16bK_gtCfUB9u4Yzl6i_PuURduNri/pub?gid=1939707437&single=true&output=csv", {
download: true,
complete: function(results) {
var content = getPageLines('03_Como_Gasta_Mi_Municipio', results.data);
populateContent(content);
setInterval( function() { nextBanner(1) }, 3000 );
drawViz(treeData);
}
});
function getPageLines(section, lines) {
return lines.filter( line => line[0] == section );
}
function replaceReferences(text, parameters) {
var newText = text;
var params = parameters.split(';');
for(var j=0; j<params.length; j++) {
newText = newText.replace('[x]', params[j]);
}
return newText;
}
function populateContent(content) {
for(var i=0; i<content.length; i++) {
var item = content[i];
var text = item[3];
if(item[4] != '') {
text = replaceReferences(item[3], item[4]);
}
if(item[1] == 'Carrusel tipos de obras') {
$('#wordbanner').html(text);
var bannertexts = item[4].split(';');
bannertexts.forEach( function(texto) { wordBanner.push(texto); } );
}
else if(item[1] == 'Treemap') {
treeData.children.push( { "name": item[3], "value": item[4] } );
}
else {
switch(item[2]) {
case 'gasta1':
$('#gasta1').html(text);
break;
case 'gasta2':
$('#gasta2').html(text);
break;
case 'gasta3':
$('#gasta3').html(text);
break;
case 'gasta4':
$('#gasta4').html(text);
break;
case 'gasta5':
$('#gasta5').html(text);
break;
case 'gasta6':
$('#gasta6').html(text);
break;
case 'gasta7':
$('#gasta7').html(text);
break;
case 'gasta8':
$('#gasta8').html(text);
break;
case 'gasta9':
$('#gasta9').html(text);
break;
case 'gasta10':
$('#gasta10').html(text);
break;
case 'cuanto1':
if(item[6] == 'verde') text = text.replace('semaforo', 'verde');
else text = text.replace('semaforo', 'rojo');
$('#cuanto1').html(text);
break;
case 'cuanto2':
$('#cuanto2').html(text);
break;
case 'informate1':
$('#informate1').html(text);
$('#informate1embed').html(item[5]);
break;
}
}
}
}
function nextBanner(direction) {
currentBanner = currentBanner + direction;
if(currentBanner >= wordBanner.length) currentBanner = 0;
else if(currentBanner < 0) currentBanner = wordBanner.length - 1;
$('#wordBannerText').fadeOut( 500, function() {
$('#wordBannerText').html(wordBanner[currentBanner]);
$('#wordBannerText').fadeIn();
} );
}
/* TREEMAP SECTION */
var vWidth = $('#treemapContainer').width();
var vHeight = vWidth * 0.6;
var g = d3.select('svg').attr('width', vWidth).attr('height', vHeight).select('g');
var tool = d3.select("body").append("div").attr("class", "toolTip");
function drawViz(vData) {
var format = d3.format(",d");
var colors = d3.scaleQuantize()
.domain([1000000,10200000])
.range(["#0f2032", "#152d47", "#152d47", "#2c5f94", "#3c84cc", "#479ff6"]);
var fontSizes = [];
fontSizes["Vivienda"] = vWidth / 7;
fontSizes["Urbanización"] = vWidth / 11;
fontSizes["Educación"] = vWidth / 19;
fontSizes["Agua potable y saneamiento"] = vWidth / 51;
fontSizes["Otros"] = vWidth / 15;
fontSizes["Salud"] = vWidth / 12.5;
// Declare d3 layout
var vLayout = d3.treemap().size([vWidth, vHeight]);
// Layout + Data
var vRoot = d3.hierarchy(vData).sum(function (d) { return d.value; });
var vNodes = vRoot.descendants();
vLayout.tile(d3.treemapSquarify.ratio(1));
vLayout(vRoot);
//var vSlices = g.selectAll('rect').data(vNodes).enter().append('rect');
var vSlices = d3.select('svg g')
.selectAll('g')
.data(vNodes)
.enter()
.append('g')
.attr('transform', function(d) {return 'translate(' + [d.x0, d.y0] + ')'});
vSlices
.append('rect')
.attr('width', function(d) { return d.x1 - d.x0; })
.attr('height', function(d) { return d.y1 - d.y0; })
.style('fill', function(d) { return colors(d.data.value); } )
.on("mousemove", function (d) {
tool.style("left", d3.event.pageX + 10 + "px")
tool.style("top", d3.event.pageY - 20 + "px")
tool.style("display", "inline-block");
tool.html('$ ' + numberWithCommas(d.data.value));
}).on("mouseout", function (d) {
tool.style("display", "none");
});
vSlices
.append('text')
.attr('dx', 4)
.attr('dy', function(d,i) { return fontSizes[d.data.name] + 'px' })
.style('font-size', function(d,i) { return fontSizes[d.data.name] + 'px' })
.text(function(d) {
return d.data.name;
});
// Draw on screen
/*
vSlices.attr('x', function (d) { return d.x0; })
.attr('y', function (d) { return d.y0; })
.attr('width', function (d) { return d.x1 - d.x0; })
.attr('height', function (d) { return d.y1 - d.y0; });
*/
}
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
</script>
</body>
</html>