Jump to: navigation, search

Difference between revisions of "Widget:PnChoropleths"

m
m
Line 199: Line 199:
 
'<tr><td>PN/km<sup>2</sup> idx</td><td colspan="2">' + e.pnperkm2idx + '</td></tr>' +
 
'<tr><td>PN/km<sup>2</sup> idx</td><td colspan="2">' + e.pnperkm2idx + '</td></tr>' +
 
'<tr><td>PN/county avg.</td><td colspan="2">' + e.pnpercounty + '</td></tr>' +
 
'<tr><td>PN/county avg.</td><td colspan="2">' + e.pnpercounty + '</td></tr>' +
'</tbody>' +
+
'</tbody>';
'</table>';
+
 +
var counties = Object.keys(c);
 +
var nCounties = counties.length;
 +
var idxLeics = 19;
 +
for (var i = 0; i < idxLeics; i++) {
 +
var cty = counties[i];
 +
tables += getCountyData(cty, c[cty]);
 +
}
 +
tables += '</table>';
 
get("dSet").innerHTML = tables;
 
get("dSet").innerHTML = tables;
console.log(Object.keys(c));
 
 
};
 
};
 
 
 
 
function prepareCountyData(itm) {
+
function getCountyData(cty, d) {
//var txt =  
+
var txt = '<tbody id="' + cty + '"><tr class="header"><th colspan="2">' + cty + '</th>' +
//<tbody id="Bedfordshire"><tr class="header"><th colspan="2">Bedfordshire</th><th><span class="expando-c" style="display: none;">—&nbsp;</span><span class="expando-o" style="display: inline-block;">▢&nbsp;</span></th></tr><tr style="display: none;"><td style="width: 127px;">Area (km<sup>2</sup>)</td><td colspan="2">1207.96236</td></tr><tr style="display: none;"><td style="width: 127px;">Population</td><td colspan="2">16</td></tr><tr style="display: none;"><td style="width: 127px;">Pop. density/km<sup>2</sup></td><td colspan="2">133.03725788277</td></tr><tr style="display: none;"><td style="width: 127px;">Km<sup>2</sup>/PN</td><td colspan="2">603.98118</td></tr><tr style="display: none;"><td style="width: 127px;">PN/km<sup>2</sup></td><td colspan="2">0.00165568072833</td></tr><tr style="display: none;"><td style="width: 127px;">RH names</td><td colspan="2">2</td></tr><tr style="display: none;"><td style="width: 127px;">Local traditions</td><td colspan="2">0</td></tr><tr style="display: none;"><td style="width: 127px;">Literary locales</td><td colspan="2">0</td></tr><tr style="display: none;"><td style="width: 127px;">Artifacts</td><td colspan="2">0</td></tr><tr style="display: none;"><td style="width: 127px;">Miscellaneous</td><td colspan="2">0</td></tr><tr style="display: none;"><td style="width: 127px;">Total count</td><td colspan="2">2</td></tr><tr style="display: none;"><td style="width: 127px;">Count idx.</td><td>10</td><td style="background-color:#b70000; width:1.5em;"></td></tr><tr style="display: none;"><td style="width: 127px;">PN/km<sup>2</sup> idx.</td><td>28</td><td style="background-color:#d11919; width:1.5em;"></td></tr><tr style="display: none;"><td style="width: 127px;">PN/km<sup>2</sup>/pop. idx.</td><td>14</td><td style="background-color:#b70000; width:1.5em;"></td></tr></tbody>
+
'<th><span class="expando-c">—&nbsp;</span><span class="expando-o">▢&nbsp;</span></th></tr>' +
 +
'<tr><td>Area (km<sup>2</sup>)</td><td colspan="2">' + d.area + '</td></tr>' +
 +
'<tr><td>Population</td><td colspan="2">' + d.population + '</td></tr>' +
 +
'<tr><td>Pop. density/km<sup>2</sup></td><td colspan="2">' + d.popdensity + '</td></tr>' +
 +
'<tr><td>Km<sup>2</sup>/PN</td><td colspan="2">' + d.km2perpn + '</td></tr>' +
 +
'<tr><td>PN/km<sup>2</sup></td><td colspan="2">' d.pnperkm2 + '</td></tr>' +
 +
'<tr><td>RH names</td><td colspan="2">' + d["Robin Hood name"] + '</td></tr>' +
 +
'<tr><td>Local traditions</td><td colspan="2">' + d["Local tradition"] + '</td></tr>' +
 +
'<tr><td>Literary locales</td><td colspan="2">' + d["Literary locale"] + '</td></tr>' +
 +
'<tr><td>Artifacts</td><td colspan="2">' + d.Artifacts+ '</td></tr>' +
 +
'<tr><td>Miscellaneous</td><td colspan="2">' + d.Miscellaneous + '</td></tr>' +
 +
'<tr><td>Total count</td><td colspan="2">' + d.total + '</td></tr>' +
 +
'<tr><td>Count idx.</td><td>' + d.totalidx + '</td><td style="background-color:' + d.totalcol + '; width:1.5em;"></td></tr>' +
 +
'<tr><td>PN/km<sup>2</sup> idx.</td><td>' + d.pnperkm2idx + '</td><td style="background-color:' + d.pnperkm2col + '; width:1.5em;"></td></tr>' +
 +
'<tr><td>PN/km<sup>2</sup>/pop. idx.</td><td>' + d.pnperkm2popidx + '</td><td style="background-color:' + d.pnperkm2popcol + '; width:1.5em;"></td></tr>' +
 +
'</tbody>';
 +
return txt;
 
}
 
}
  

Revision as of 11:08, 2 June 2019

This widget displays the navigation map on country and administrative division landing pages in the place-names section of IRHB. It takes no parameters.