Widget:PlaceNamesChoropleths: Difference between revisions
From International Robin Hood Bibliography
mNo edit summary |
mNo edit summary |
||
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; | ||
}; | }; | ||
function | function getCountyData(cty, d) { | ||
var txt = '<tbody id="' + cty + '"><tr class="header"><th colspan="2">' + cty + '</th>' + | |||
'<th><span class="expando-c">— </span><span class="expando-o">▢ </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 15: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.