-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
188 lines (160 loc) · 13.6 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="./css/main.css">
<title>Infrazioni Torino 2017</title>
</head>
<body onload="readQuartieri()">
<!-- Esegue la funzione readQuartieri() una volta caricato il body, quindi dopo aver linkato gli script alla fine del body-->
<h1 class="titolo">Infrazioni Torino 2017</h1>
<div id="info">Per poter confrontare più quartieri contemporaneamente cliccare sopra i quartieri desiderati; è possibile confrontare un massimo di tre quartieri per volta. Per deselezionare un quartiere ed escluderlo dalla rappresentazione basterà cliccarci nuovamente.
In fondo alla pagina si può trovare un grafico con il numero di infrazioni per ogni quartiere.
</div>
<div id="top_part">
<div class="wrapper_map" id="map_container">
<svg width="100%" height="100%" viewBox="0 0 1166 1120" preserveAspectRatio="none">
<defs>
<filter x="0" y="0" width="1" height="1" id="solid">
<feFlood flood-color="rgba(255, 255, 255, 0.5)"/>
<feComposite in="SourceGraphic"/> <!-- operator="or" -->
</filter> <!-- Filtro SVG pensato per dare background al testo, alla fine non è stato usato-->
<linearGradient id="legenda" x1="50%" y1="0%" x2="50%" y2="100%" >
<stop offset="0%" style="stop-color:rgb(255,10,0);stop-opacity:1" />
<stop offset="100%" style="stop-color:rgb(255,254,0);stop-opacity:1" />
</linearGradient> <!-- Gradiente lineare per la colorazione della leggenda-->
</defs>
<!-- Definizione Poligoni dei quartieri per punti -->
<polygon id="Villaretto_Falchera_Rebaudengo" class="quartiere"
points="460,143,477,109,461,91,458,79,461,69,459,55,471,51,487,50,499,55,510,61,512,48,499,40,500,27,507,19,517,11,533,22,543,29,556,29,571,30,584,35,595,37,610,45,622,50,631,47,648,50,651,61,666,63,676,56,690,56,694,66,703,74,710,83,746,81,780,71,789,65,795,40,807,32,826,29,841,30,857,30,869,38,866,56,861,73,846,89,833,91,825,115,839,124,851,135,861,124,872,120,898,135,893,143,918,146,936,146,936,166,931,179,946,181,944,196,903,227,883,276,766,317,757,335,730,325,708,361,681,346,654,345,702,274,708,227,677,220,656,204,613,202,590,191,577,163,561,158,544,172,525,178,510,181,492,178,477,166,468,155">
</polygon>
<polygon id="Borgo_Vittoria" class="quartiere"
points="612,202,603,243,587,224,577,216,570,253,553,254,551,262,570,269,555,425,588,442,654,344,702,274,707,227,678,217,656,202">
</polygon>
<polygon id="Barriera_di_Milano" class="quartiere"
points="654,345,677,345,707,362,778,401,791,414,797,427,800,445,798,456,793,467,783,478,772,485,763,493,753,497,743,504,731,510,705,472,663,436,601,426">
</polygon>
<polygon id="Madonna_di_Campagna" class="quartiere"
points="460,141,451,149,453,207,462,218,462,230,453,237,441,240,427,241,408,241,407,294,509,305,445,445,471,456,508,415,519,415,537,419,554,425,571,268,550,263,552,254,570,252,575,216,584,218,593,235,602,242,606,229,610,203,592,190,582,172,576,164,563,158,554,164,546,172,535,176,528,179,511,182,491,176,475,167,464,150">
</polygon>
<polygon id="Vallette_Lucento" class="quartiere"
points="408,241,278,225,276,268,262,276,230,273,215,284,227,343,241,354,252,369,255,384,252,397,252,408,246,420,234,434,266,456,278,457,292,457,294,449,306,457,321,464,331,465,349,462,367,466,382,466,397,465,399,440,414,432,444,445,507,306,406,295">
</polygon>
<polygon id="Aurora" class="quartiere"
points="599,425,556,500,666,552,676,542,690,555,706,558,719,554,731,547,748,544,729,510,706,472,661,433">
</polygon>
<polygon id="Centro" class="quartiere" points="558,499,509,601,681,689,700,664,726,636,666,550"></polygon>
<polygon id="Crocetta" class="quartiere"
points="508,601,603,649,535,801,492,767,485,770,458,754,468,731,463,717,460,706,460,694"></polygon>
<polygon id="San_Donato_Campidoglio" class="quartiere"
points="588,442,539,535,394,543,400,440,416,432,472,454,509,411,556,426"></polygon>
<polygon id="Cenisia_Cit_Turin" class="quartiere" points="367,601,395,543,541,535,478,658"></polygon>
<polygon id="San_Paolo" class="quartiere"
points="368,599,479,658,461,692,459,713,468,727,461,744,347,708,349,653"></polygon>
<polygon id="San_Salvario" class="quartiere"
points="603,648,682,688,663,734,654,765,648,784,639,796,624,805,611,814,602,825,562,814,534,805">
</polygon>
<polygon id="Regio_Parco_Bertola" class="quartiere"
points="730,326,758,333,763,319,882,276,903,226,943,196,938,217,939,234,950,235,960,233,958,261,966,264,975,269,982,278,983,286,1030,320,1026,339,1023,361,969,402,975,411,957,419,938,419,912,409,890,398,877,397,869,404,861,413,851,426,849,438,848,452,854,466,860,476,884,511,890,531,893,544,892,551,889,559,885,566,880,573,877,578,871,582,864,587,853,589,835,593,817,598,801,602,789,603,781,606,729,511,760,493,778,480,792,466,800,447,796,427,783,407,751,386,707,362">
</polygon>
<polygon id="Vanchiglia" class="quartiere"
points="676,543,685,550,694,556,703,558,712,557,721,553,728,548,739,545,749,546,760,563,768,581,778,604,765,610,752,614,739,625,726,638,665,552">
</polygon>
<polygon id="Madonna_Del_Pilone" class="quartiere"
points="975,412,1012,463,1032,475,1057,485,1105,484,1115,492,1119,503,1122,514,1134,520,1147,519,1153,526,1056,684,921,842,917,832,911,826,897,821,890,816,888,806,889,794,882,789,873,780,865,773,859,765,856,754,855,744,852,735,848,724,852,709,850,697,843,688,834,680,829,673,821,667,815,662,813,644,807,636,795,635,779,606,806,599,828,596,854,587,872,584,880,574,888,563,890,550,890,530,885,512,877,501,865,481,855,464,848,449,850,431,853,421,862,413,869,407,876,399,890,398,905,407,917,412,930,416,940,419,951,420">
</polygon>
<polygon id="Parella" class="quartiere"
points="233,433,223,434,210,450,211,479,205,495,177,555,394,542,397,466,376,466,365,467,349,460,336,464,320,463,296,451,293,457,270,459">
</polygon>
<polygon id="Pozzo_Strada" class="quartiere"
points="178,556,393,542,368,597,359,621,350,650,349,684,346,709,292,694,292,676,263,676,242,682,227,677,208,666,199,673,188,663,199,629,220,618,200,607,188,584,164,580">
</polygon>
<polygon id="Cavoretto_Borgo_Po" class="quartiere"
points="778,606,795,636,805,635,813,645,814,663,827,671,834,682,841,687,851,699,850,711,847,723,853,737,855,753,861,766,869,776,886,791,890,812,895,822,908,826,915,832,920,843,885,885,859,908,842,916,812,924,774,940,772,960,762,967,749,964,737,964,728,969,722,971,709,972,689,965,673,960,659,962,648,964,638,969,633,976,628,986,618,999,612,1012,605,1021,594,1033,565,1028,573,955,573,925,587,907,596,896,594,861,596,836,601,822,615,808,637,799,644,791,654,768,661,746,667,720,680,690,702,660,726,634,755,613">
</polygon>
<polygon id="Nizza" class="quartiere"
points="534,805,600,826,596,842,597,894,576,919,573,933,572,948,567,1029,554,1027,489,1034,482,1010,477,934">
</polygon>
<polygon id="Lingotto" class="quartiere"
points="493,768,537,801,478,931,483,1008,439,986,426,1024,401,1017,373,990,350,980,456,843,452,836,484,771">
</polygon>
<polygon id="Santa_Rita" class="quartiere"
points="347,709,462,744,457,753,484,769,452,836,456,844,413,896,339,836"></polygon>
<polygon id="Mirafiori_Nord" class="quartiere"
points="291,692,349,709,338,835,413,897,393,922,292,873,239,904,213,887,226,840,238,848,252,799,265,795,267,785,246,781,253,767,246,758,275,737">
</polygon>
<polygon id="Mirafiori_Sud" class="quartiere"
points="67,797,237,904,291,873,394,922,349,979,372,991,397,1015,427,1023,439,987,482,1008,488,1032,467,1110,445,1095,427,1101,416,1106,398,1110,387,1102,375,1090,362,1093,350,1092,341,1081,325,1080,315,1080,307,1087,295,1092,279,1097,248,1082,226,1073,203,1080,183,1071,165,1061,150,1053,136,1064,123,1064,124,1044,116,1041,106,1047,96,1040,83,1032,99,1022,109,1005,148,1009,184,923,154,932,139,918,129,917,60,869,49,866,15,823,28,802,51,818">
</polygon>
<!-- Definizione rettangolo legenda -->
<rect id="legenda_r" class="quartiere"
x="1000" y="780" width="30" height="350" fill="url(#legenda)">
</rect>
<!-- Definizione nomi dei quartieri per punti -->
<text id="Villaretto_Falchera_Rebaudengo_t" x="540" y="150" class="text_map">Villaretto Falchera Rebaudengo</text><!-- filter="url(#solid)" aggiungi dentro text tag -->
<text id="Borgo_Vittoria_t" x="585" y="315" class="text_map">Borgo
<tspan x="575" y="345">Vittoria</tspan></text>
<text id="Barriera_di_Milano_t" x="675" y="400" class="text_map">Barriera
<tspan x="670" y="430">Di Milano</tspan></text>
<text id="Madonna_di_Campagna_t" x="460" y="260" class="text_map">Madonna
<tspan x="430" y="290">Di Campagna</tspan></text>
<text id="Vallette_Lucento_t" x="315" y="345" class="text_map">Vallette
<tspan x="315" y="370">Lucento</tspan></text>
<text id="Aurora_t" x="605" y="490" class="text_map">Aurora</text>
<text id="Centro_t" x="555" y="600" class="text_map">Centro</text>
<text id="Crocetta_t" x="495" y="675" class="text_map">Crocetta</text>
<text id="San_Donato_Campidoglio_t" x="415" y="485" class="text_map">San Donato
<tspan x="405" y="510">Campidoglio</tspan></text>
<text id="Cenisia_Cit_Turin_t" x="410" y="575" class="text_map">Cenisia
<tspan x="405" y="600">Cit Turin</tspan></text>
<text id="San_Paolo_t" x="370" y="665" class="text_map">Borgo
<tspan x="350" y="695">San Paolo</tspan></text>
<text id="San_Salvario_t" x="590" y="730" class="text_map">San
<tspan x="565" y="760">Salvario</tspan></text>
<text id="Regio_Parco_Bertola_t" x="840" y="325" class="text_map">Regio Parco
<tspan x="850" y="350">Bertola</tspan></text>
<text id="Vanchiglia_t" x="680" y="585" class="text_map">Vanchiglia</text>
<text id="Madonna_Del_Pilone_t" x="850" y="650" class="text_map">Madonna Del Pilone</text>
<text id="Parella_t" x="260" y="500" class="text_map">Parella</text>
<text id="Pozzo_Strada_t" x="240" y="605" class="text_map">Pozzo
<tspan x="240" y="630">Strada</tspan></text>
<text id="Cavoretto_Borgo_Po_t" x="690" y="830" class="text_map">Cavoretto
<tspan x="690" y="855">Borgo Po</tspan></text>
<text id="Nizza_t" x="520" y="890" class="text_map">Nizza</text>
<text id="Lingotto_t" x="380" y="970" class="text_map">Lingotto</text>
<text id="Santa_Rita_t" x="355" y="790" class="text_map">Santa Rita</text>
<text id="Mirafiori_Nord_t" x="255" y="820" class="text_map">Mirafiori
<tspan x="265" y="850">Nord</tspan></text>
<text id="Mirafiori_Sud_t" x="200" y="1020" class="text_map">Mirafiori Sud </text>
<text id="legend_min_t" x="1040" y="790" class="text_legend">1016 infrazioni </text>
<text id="legend_max_t" x="1040" y="1120" class="text_legend">42 infrazioni </text>
</svg>
</div>
<!-- Div per graficare l'andamento temporale e la divisione del tipo di sanzione -->
<div id="wrapper_destra">
<div class="graph_data" id="turin_temp"></div>
<div class="graph_data" id="turin_type"></div>
</div>
</div>
<!-- Div per graficare la classifica dei quartieri -->
<div class="graph_data" id="turin_quartieri"></div>
<!-- Futer con le con le fonti-->
<footer>
Dati presi da: <br>
<div class="links">
<a href="http://aperto.comune.torino.it/dataset/violazioni-ai-regolamenti-comunali-2017">http://aperto.comune.torino.it/dataset/violazioni-ai-regolamenti-comunali-2017</a>
<br>
<a href="http://aperto.comune.torino.it/dataset/toponomastica">http://aperto.comune.torino.it/dataset/toponomastica</a>
</div>
</footer>
<!-- CDNs -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<!-- Script interni usati -->
<script src="./scripts/utility_functions.js"></script>
<script src="./scripts/plotting.js"></script>
<script src="./scripts/quartieri.js"></script>
<script src="./scripts/main.js"></script>
<script src="./scripts/animations.js"></script>
</body>
</html>