Difference between revisions of "Widget:PnChoropleths"

From International Robin Hood Bibliography
m
m
 
(7 intermediate revisions by the same user not shown)
Line 232: Line 232:
 
'<tr><td>Miscellaneous</td><td colspan="2">' + d.Miscellaneous + '</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>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>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> 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>' +  
+
'<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>';
 
'</tbody>';
 
return txt;
 
return txt;
Line 262: Line 262:
 
for (var key in d.counties) {
 
for (var key in d.counties) {
 
var cur = d.counties[key];
 
var cur = d.counties[key];
paths[cur.path].style.stroke = "#ffffff";
+
paths[cur.path].style.strokeWidth = "0px";
 
}
 
}
 
} else {
 
} else {
Line 269: Line 269:
 
var cur = d.counties[key];
 
var cur = d.counties[key];
 
paths[cur.path].style.fill = cur.totalcol;
 
paths[cur.path].style.fill = cur.totalcol;
paths[cur.path].style.stroke = "#ffffff";
+
paths[cur.path].style.strokeWidth = "0px";
 
}
 
}
 
} else if (w.nav.choroVar === "area") {
 
} else if (w.nav.choroVar === "area") {
Line 275: Line 275:
 
var cur = d.counties[key];
 
var cur = d.counties[key];
 
paths[cur.path].style.fill = cur.pnperkm2col;
 
paths[cur.path].style.fill = cur.pnperkm2col;
paths[cur.path].style.stroke = "#ffffff";
+
paths[cur.path].style.strokeWidth = "0px";
 
}
 
}
 
} else {
 
} else {
Line 281: Line 281:
 
var cur = d.counties[key];
 
var cur = d.counties[key];
 
paths[cur.path].style.fill = cur.pnperkm2popcol;
 
paths[cur.path].style.fill = cur.pnperkm2popcol;
paths[cur.path].style.stroke = "#ffffff";
+
paths[cur.path].style.strokeWidth = "0px";
 
}
 
}
 
}
 
}
Line 356: Line 356:
 
 
 
m.addSpinner = function (elem) {
 
m.addSpinner = function (elem) {
var svg = '<svg version="1.1" id="L9" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">';
+
var svg = '<svg version="1.1" id="spinner" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">';
 
svg += '<path fill="#fff" d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">';
 
svg += '<path fill="#fff" d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">';
 
svg += '<animateTransform attributeName="transform" attributeType="XML" type="rotate" dur="2s" from="0 50 50" to="360 50 50" repeatCount="indefinite"/>';
 
svg += '<animateTransform attributeName="transform" attributeType="XML" type="rotate" dur="2s" from="0 50 50" to="360 50 50" repeatCount="indefinite"/>';
 
svg += '</path></svg>';
 
svg += '</path></svg>';
 
elem.innerHTML = svg;
 
elem.innerHTML = svg;
 +
elem.firstElementChild.firstElementChild.style.strokeWidth = "0px";
 
};
 
};
 
  
 
 
Line 460: Line 460:
 
( function() {
 
( function() {
  
 +
    if (location.href.includes("Place-name_choropleths")) {
 +
        document.getElementsByClassName("mw-selflink")[0].style.display = "none";
 +
    }
 
     var w = window.IRHB;
 
     var w = window.IRHB;
 
     var gjson = "https://www.irhb.org/wiki/geo/england/country/England.json";
 
     var gjson = "https://www.irhb.org/wiki/geo/england/country/England.json";

Latest revision as of 09:43, 22 May 2020

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