Widget:Test1: Difference between revisions
From International Robin Hood Bibliography
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
<noinclude><div class="no-img">This widget displays the navigation map on country and administrative division landing pages in the place-names section of IRHB. It takes no parameters.</div></noinclude><includeonly><div id="navMapNav"></div><script> | <noinclude><div class="no-img">This widget displays the navigation map on country and administrative division landing pages in the place-names section of IRHB. It takes no parameters.</div></noinclude><includeonly><div id="navMapNav"></div><script> | ||
//Utility | //Utility | ||
( function() { | ( function() { | ||
Line 248: | Line 239: | ||
m.makeResponsive = function(div, svg) { | m.makeResponsive = function(div, svg) { | ||
console.log("OK"); | console.log("OK X"); | ||
var container = d3.select(svg.node().parentNode); | var container = d3.select(svg.node().parentNode); | ||
var w = parseInt(svg.style("width")); | var w = parseInt(svg.style("width")); | ||
Line 274: | Line 265: | ||
m.prepareMap = function() { | m.prepareMap = function() { | ||
console.log("OK 1"); | |||
var mp = get(m.curMap); | var mp = get(m.curMap); | ||
var width = 496, height = 550; | var width = 496, height = 550; | ||
Line 286: | Line 278: | ||
tooltip = d3.select("body").append("div").attr("class","ttip"); | tooltip = d3.select("body").append("div").attr("class","ttip"); | ||
d3.xml("/wiki/geo/england/country/England.svg",function(error,geodata) { | d3.xml("/wiki/geo/england/country/England.svg",function(error,geodata) { | ||
console.log("OK 2"); | |||
if (!error) { | if (!error) { | ||
console.log("OK 3"); | |||
features.selectAll("path").data(geodata.features).enter().append("path").attr("d",path).on("mouseover",showTooltip).on("mousemove",moveTooltip).on("mouseout",hideTooltip).on("click",clicked); | features.selectAll("path").data(geodata.features).enter().append("path").attr("d",path).on("mouseover",showTooltip).on("mousemove",moveTooltip).on("mouseout",hideTooltip).on("click",clicked); | ||
w.choro.choropleth(); | w.choro.choropleth(); | ||
Line 296: | Line 290: | ||
m.makeResponsive(div, svg); | m.makeResponsive(div, svg); | ||
} else { | } else { | ||
console.log("Øv: Error!"); | |||
return console.log(error); | return console.log(error); | ||
} | } |
Revision as of 16:42, 22 May 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.