Election donations, New Zealand, 2014.
Last active
August 29, 2015 14:16
-
-
Save tslumley/9d6265ad35cc9b0f125b to your computer and use it in GitHub Desktop.
Electorate candidate donations, all parties, 2014
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
All parties | |
</head> | |
<body> | |
<h3>Donations to electorate candidates, 2014</h3> | |
<p>Area is proportional to money, with the same scale across all maps. The inset map is the Māori electorates</p> | |
<p>Click for full-size versions with mouseover electorate names</p> | |
<h3>All parties</h3> | |
<a href="http://bl.ocks.org/tslumley/raw/9d6265ad35cc9b0f125b/allparties.svg"><img src="allparties.svg" type="image/svg+xml" height="300px"></a> | |
<h3>Shaded by margin of victory</h3> | |
<a href="http://bl.ocks.org/tslumley/raw/9d6265ad35cc9b0f125b/margins.svg"><img src="margins.svg" type="image/svg+xml" height="300px"></a> | |
<h3>Parties</h3> | |
<p>National</p> <a href="http://bl.ocks.org/tslumley/raw/9d6265ad35cc9b0f125b/national.svg"><img src="national.svg" type="image/svg+xml" height="300px"></a> | |
<p>Labour</p> | |
<a href="http://bl.ocks.org/tslumley/raw/9d6265ad35cc9b0f125b/labour.svg"><img src="labour.svg" type="image/svg+xml" height="300px"></a> | |
<p>Green Party</p> | |
<a href="http://bl.ocks.org/tslumley/raw/9d6265ad35cc9b0f125b/greens.svg"><img src="greens.svg" type="image/svg+xml" height="300px"></a> | |
<p>New Zealand First</p> | |
<a href="http://bl.ocks.org/tslumley/raw/9d6265ad35cc9b0f125b/nzfirst.svg"><img src="nzfirst.svg" type="image/svg+xml" height="300px"></a> | |
<p>ACT</p> | |
<a href="http://bl.ocks.org/tslumley/raw/9d6265ad35cc9b0f125b/act.svg"><img src="act.svg" type="image/svg+xml" height="300px"></a> | |
<p>Conservative Party</p> | |
<a href="http://bl.ocks.org/tslumley/raw/9d6265ad35cc9b0f125b/conservative.svg"><img src="conservative.svg" type="image/svg+xml" height="300px"></a> | |
<p>Internet Mana Party</p> | |
<a href="http://bl.ocks.org/tslumley/raw/9d6265ad35cc9b0f125b/imp.svg"><img src="imp.svg" type="image/svg+xml" height="300px"></a> | |
<p>Data from NZ Herald, layout from <a href="http://hindsight.clerestories.com/2014/01/06/chris-mcdowall-hexagonal-maps/">Chris McDowall</a> | |
modified by <a href="https://a3995c31ebd7ea534f2bb73d7af5d1ab1163a570.googledrive.com/host/0B-6BcF0gNMHCWjBYMm9jSmxlMTg/">David Friggens</a></p> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="422.75px" height="739.82px" viewBox="0 0 422.75 739.82" version="1.1"> | |
<metadata xmlns:gridsvg="http://www.stat.auckland.ac.nz/~paul/R/gridSVG/"> | |
<gridsvg:generator name="gridSVG" version="1.4-3" time="2015-03-08 11:59:46"/> | |
<gridsvg:argument name="name" value="~/CASHMAPS/labour.svg"/> | |
<gridsvg:argument name="exportCoords" value="none"/> | |
<gridsvg:argument name="exportMappings" value="none"/> | |
<gridsvg:argument name="exportJS" value="none"/> | |
<gridsvg:argument name="res" value="72"/> | |
<gridsvg:argument name="prefix" value=""/> | |
<gridsvg:argument name="addClasses" value="FALSE"/> | |
<gridsvg:argument name="indent" value="TRUE"/> | |
<gridsvg:argument name="htmlWrapper" value="FALSE"/> | |
<gridsvg:argument name="usePaths" value="vpPaths"/> | |
<gridsvg:argument name="uniqueNames" value="TRUE"/> | |
<gridsvg:separator name="id.sep" value="."/> | |
<gridsvg:separator name="gPath.sep" value="::"/> | |
<gridsvg:separator name="vpPath.sep" value="::"/> | |
</metadata> | |
<g transform="translate(0, 739.82) scale(1, -1)"> | |
<g id="gridSVG" fill="none" stroke="rgb(0,0,0)" stroke-dasharray="none" stroke-width="0.75" font-size="12" font-family="Helvetica, Arial, FreeSans, Liberation Sans, Nimbus Sans L, sans-serif" opacity="1" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-opacity="1" fill-opacity="0" font-weight="normal" font-style="normal"> | |
<g id="cfaht.off.1"> | |
<g id="GRID.polygon.4400.1" onmousemove="showTooltip(evt, 'Invercargill')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4400.1.1" points="92.87,97.1 92.87,94.63 90.78,93.39 88.68,94.63 88.68,97.1 90.78,98.34" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4401.1" onmousemove="showTooltip(evt, 'Clutha-Southland')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4401.1.1" points="103.65,117.37 103.65,116.02 102.51,115.35 101.37,116.02 101.37,117.37 102.51,118.05" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4402.1" onmousemove="showTooltip(evt, 'Dunedin South')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4402.1.1" points="117.29,139.32 117.29,135.74 114.25,133.94 111.22,135.74 111.22,139.32 114.25,141.12" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4403.1" onmousemove="showTooltip(evt, 'Dunedin North')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4403.1.1" points="138.87,138.2 138.87,136.86 137.73,136.18 136.59,136.86 136.59,138.2 137.73,138.88" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4404.1" onmousemove="showTooltip(evt, 'Waitaki')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4404.1.1" points="128.01,159.55 128.01,157.17 125.99,155.98 123.98,157.17 123.98,159.55 125.99,160.75" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4405.1" onmousemove="showTooltip(evt, 'Rangitata')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4405.1.1" points="138.26,179.51 138.26,178.88 137.73,178.57 137.21,178.88 137.21,179.51 137.73,179.82" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4406.1" onmousemove="showTooltip(evt, 'Wigram')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4406.1.1" points="152.72,201.95 152.72,198.11 149.47,196.19 146.23,198.11 146.23,201.95 149.47,203.87" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4407.1" onmousemove="showTooltip(evt, 'Port Hills')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4407.1.1" points="173.47,200.34 173.47,199.72 172.95,199.41 172.42,199.72 172.42,200.34 172.95,200.65" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4408.1" onmousemove="showTooltip(evt, 'Ilam')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4408.1.1" points="162.85,221.83 162.85,219.89 161.21,218.92 159.57,219.89 159.57,221.83 161.21,222.8" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4409.1" onmousemove="showTooltip(evt, 'Christchurch Central')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4409.1.1" points="188.41,223.06 188.41,218.66 184.69,216.46 180.97,218.66 180.97,223.06 184.69,225.27" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4410.1" onmousemove="showTooltip(evt, 'West Coast-Tasman')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4410.1.1" points="152.94,243.75 152.94,239.64 149.47,237.59 146,239.64 146,243.75 149.47,245.8" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4411.1" onmousemove="showTooltip(evt, 'Selwyn')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4411.1.1" points="173.47,242 173.47,241.38 172.95,241.07 172.42,241.38 172.42,242 172.95,242.32" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4412.1" onmousemove="showTooltip(evt, 'Christchurch East')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4412.1.1" points="198.66,243.01 198.66,240.38 196.43,239.06 194.2,240.38 194.2,243.01 196.43,244.33" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4413.1" onmousemove="showTooltip(evt, 'Waimakariri')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4413.1.1" points="188.32,264.68 188.32,260.38 184.69,258.23 181.06,260.38 181.06,264.68 184.69,266.83" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4414.1" onmousemove="showTooltip(evt, 'Nelson')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4414.1.1" points="173.47,283.67 173.47,283.05 172.95,282.74 172.42,283.05 172.42,283.67 172.95,283.98" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4415.1" onmousemove="showTooltip(evt, 'Kaikōura')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4415.1.1" points="197.95,284.26 197.95,282.46 196.43,281.56 194.9,282.46 194.9,284.26 196.43,285.16" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4416.1" onmousemove="showTooltip(evt, 'Wellington Central')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4416.1.1" points="244.91,284.26 244.91,282.46 243.38,281.56 241.86,282.46 241.86,284.26 243.38,285.16" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4417.1" onmousemove="showTooltip(evt, 'Rongotai')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4417.1.1" points="270.48,285.5 270.48,281.22 266.86,279.08 263.24,281.22 263.24,285.5 266.86,287.64" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4418.1" onmousemove="showTooltip(evt, 'Ōhāriu')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4418.1.1" points="256.78,305.17 256.78,303.22 255.12,302.24 253.47,303.22 253.47,305.17 255.12,306.15" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4419.1" onmousemove="showTooltip(evt, 'Hutt South')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4419.1.1" points="281.03,305.63 281.03,302.75 278.6,301.32 276.17,302.75 276.17,305.63 278.6,307.07" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4420.1" onmousemove="showTooltip(evt, 'Mana')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4420.1.1" points="268.55,326.02 268.55,324.03 266.86,323.03 265.18,324.03 265.18,326.02 266.86,327.02" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4421.1" onmousemove="showTooltip(evt, 'Rimutaka')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4421.1.1" points="290.87,325.34 290.87,324.72 290.34,324.4 289.82,324.72 289.82,325.34 290.34,325.65" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4422.1" onmousemove="showTooltip(evt, 'Ōtaki')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4422.1.1" points="282.67,348.27 282.67,343.45 278.6,341.04 274.53,343.45 274.53,348.27 278.6,350.67" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4423.1" onmousemove="showTooltip(evt, 'Wairarapa')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4423.1.1" points="305.01,347.59 305.01,344.13 302.08,342.39 299.15,344.13 299.15,347.59 302.08,349.32" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4424.1" onmousemove="showTooltip(evt, 'Palmerston North')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4424.1.1" points="293.09,368.32 293.09,365.07 290.34,363.44 287.59,365.07 287.59,368.32 290.34,369.94" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4425.1" onmousemove="showTooltip(evt, 'Tukituki')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4425.1.1" points="317.92,369.12 317.92,364.26 313.82,361.84 309.72,364.26 309.72,369.12 313.82,371.55" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4426.1" onmousemove="showTooltip(evt, 'Rangitīkei')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4426.1.1" points="304.91,389.2 304.91,385.85 302.08,384.18 299.25,385.85 299.25,389.2 302.08,390.87" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4427.1" onmousemove="showTooltip(evt, 'Napier')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4427.1.1" points="332.7,391.75 332.7,383.3 325.56,379.08 318.42,383.3 318.42,391.75 325.56,395.97" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4428.1" onmousemove="showTooltip(evt, 'New Plymouth')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4428.1.1" points="292.16,409.43 292.16,407.28 290.34,406.21 288.52,407.28 288.52,409.43 290.34,410.51" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4429.1" onmousemove="showTooltip(evt, 'Whanganui')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4429.1.1" points="314.34,408.67 314.34,408.05 313.82,407.74 313.29,408.05 313.29,408.67 313.82,408.98" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4430.1" onmousemove="showTooltip(evt, 'Rotorua')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4430.1.1" points="338.78,409.23 338.78,407.48 337.3,406.6 335.82,407.48 335.82,409.23 337.3,410.11" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4431.1" onmousemove="showTooltip(evt, 'East Coast')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4431.1.1" points="361.3,408.67 361.3,408.05 360.78,407.74 360.25,408.05 360.25,408.67 360.78,408.98" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4432.1" onmousemove="showTooltip(evt, 'Taranaki-King Country')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4432.1.1" points="302.61,429.5 302.61,428.88 302.08,428.57 301.56,428.88 301.56,429.5 302.08,429.81" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4433.1" onmousemove="showTooltip(evt, 'Taupō')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4433.1.1" points="326.08,429.5 326.08,428.88 325.56,428.57 325.03,428.88 325.03,429.5 325.56,429.81" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4434.1" onmousemove="showTooltip(evt, 'Hamilton West')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4434.1.1" points="293.29,451.77 293.29,448.28 290.34,446.54 287.4,448.28 287.4,451.77 290.34,453.51" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4435.1" onmousemove="showTooltip(evt, 'Hamilton East')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4435.1.1" points="315.5,451.01 315.5,449.03 313.82,448.04 312.14,449.03 312.14,451.01 313.82,452.01" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4436.1" onmousemove="showTooltip(evt, 'Bay of Plenty')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4436.1.1" points="337.82,450.33 337.82,449.71 337.3,449.4 336.77,449.71 336.77,450.33 337.3,450.64" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4437.1" onmousemove="showTooltip(evt, 'Tauranga')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4437.1.1" points="362.68,451.15 362.68,448.9 360.78,447.77 358.87,448.9 358.87,451.15 360.78,452.28" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4438.1" onmousemove="showTooltip(evt, 'Waikato')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4438.1.1" points="303.78,471.86 303.78,469.85 302.08,468.85 300.38,469.85 300.38,471.86 302.08,472.86" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4439.1" onmousemove="showTooltip(evt, 'Coromandel')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4439.1.1" points="327.39,471.94 327.39,469.77 325.56,468.69 323.73,469.77 323.73,471.94 325.56,473.02" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4440.1" onmousemove="showTooltip(evt, 'Papakura')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4440.1.1" points="290.87,492 290.87,491.38 290.34,491.07 289.82,491.38 289.82,492 290.34,492.31" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4441.1" onmousemove="showTooltip(evt, 'Hunua')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4441.1.1" points="314.34,492 314.34,491.38 313.82,491.07 313.29,491.38 313.29,492 313.82,492.31" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4442.1" onmousemove="showTooltip(evt, 'Māngere')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4442.1.1" points="282.68,514.93 282.68,510.11 278.6,507.7 274.53,510.11 274.53,514.93 278.6,517.34" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4443.1" onmousemove="showTooltip(evt, 'Manurewa')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4443.1.1" points="303.54,513.38 303.54,511.66 302.08,510.8 300.62,511.66 300.62,513.38 302.08,514.24" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4444.1" onmousemove="showTooltip(evt, 'New Lynn')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4444.1.1" points="244.91,534.26 244.91,532.45 243.38,531.55 241.86,532.45 241.86,534.26 243.38,535.16" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4445.1" onmousemove="showTooltip(evt, 'Mt Roskill')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4445.1.1" points="269.4,534.85 269.4,531.86 266.86,530.36 264.33,531.86 264.33,534.85 266.86,536.35" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4446.1" onmousemove="showTooltip(evt, 'Manukau East')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4446.1.1" points="294.43,535.77 294.43,530.94 290.34,528.52 286.26,530.94 286.26,535.77 290.34,538.19" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4447.1" onmousemove="showTooltip(evt, 'Botany')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4447.1.1" points="317.06,535.27 317.06,531.44 313.82,529.52 310.58,531.44 310.58,535.27 313.82,537.19" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4448.1" onmousemove="showTooltip(evt, 'Kelston')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4448.1.1" points="232.17,554.5 232.17,553.88 231.65,553.57 231.12,553.88 231.12,554.5 231.65,554.81" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4449.1" onmousemove="showTooltip(evt, 'Mt Albert')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4449.1.1" points="256.4,554.94 256.4,553.43 255.12,552.68 253.85,553.43 253.85,554.94 255.12,555.7" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4450.1" onmousemove="showTooltip(evt, 'Epsom')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4450.1.1" points="280.54,555.34 280.54,553.04 278.6,551.89 276.66,553.04 276.66,555.34 278.6,556.48" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4451.1" onmousemove="showTooltip(evt, 'Maungakiekie')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4451.1.1" points="303.13,554.81 303.13,553.57 302.08,552.95 301.03,553.57 301.03,554.81 302.08,555.43" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4452.1" onmousemove="showTooltip(evt, 'Pakuranga')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4452.1.1" points="326.08,554.5 326.08,553.88 325.56,553.57 325.03,553.88 325.03,554.5 325.56,554.81" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4453.1" onmousemove="showTooltip(evt, 'Te Tai Tonga')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4453.1.1" points="103.04,575.33 103.04,574.71 102.51,574.4 101.99,574.71 101.99,575.33 102.51,575.64" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4454.1" onmousemove="showTooltip(evt, 'Te Atatū')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4454.1.1" points="243.91,575.33 243.91,574.71 243.38,574.4 242.86,574.71 242.86,575.33 243.38,575.64" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4455.1" onmousemove="showTooltip(evt, 'Auckland Central')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4455.1.1" points="270.16,576.97 270.16,573.07 266.86,571.12 263.56,573.07 263.56,576.97 266.86,578.92" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4456.1" onmousemove="showTooltip(evt, 'Tāmaki')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4456.1.1" points="290.87,575.33 290.87,574.71 290.34,574.4 289.82,574.71 289.82,575.33 290.34,575.64" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4457.1" onmousemove="showTooltip(evt, 'Te Tai Hauāuru')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4457.1.1" points="116.93,597.44 116.93,594.27 114.25,592.68 111.57,594.27 111.57,597.44 114.25,599.02" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4458.1" onmousemove="showTooltip(evt, 'Ikaroa-Rāwhiti')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4458.1.1" points="139.26,596.76 139.26,594.95 137.73,594.05 136.21,594.95 136.21,596.76 137.73,597.66" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4459.1" onmousemove="showTooltip(evt, 'Upper Harbour')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4459.1.1" points="258.07,597.6 258.07,594.11 255.12,592.36 252.17,594.11 252.17,597.6 255.12,599.34" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4460.1" onmousemove="showTooltip(evt, 'Northcote')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4460.1.1" points="280.69,597.09 280.69,594.62 278.6,593.38 276.51,594.62 276.51,597.09 278.6,598.33" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4461.1" onmousemove="showTooltip(evt, 'Hauraki-Waikato')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4461.1.1" points="126.52,617 126.52,616.38 125.99,616.07 125.47,616.38 125.47,617 125.99,617.31" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4462.1" onmousemove="showTooltip(evt, 'Waiariki')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4462.1.1" points="150,617 150,616.38 149.47,616.07 148.95,616.38 148.95,617 149.47,617.31" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4463.1" onmousemove="showTooltip(evt, 'Helensville')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4463.1.1" points="243.91,617 243.91,616.38 243.38,616.07 242.86,616.38 242.86,617 243.38,617.31" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4464.1" onmousemove="showTooltip(evt, 'East Coast Bays')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4464.1.1" points="267.39,617 267.39,616.38 266.86,616.07 266.34,616.38 266.34,617 266.86,617.31" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4465.1" onmousemove="showTooltip(evt, 'North Shore')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4465.1.1" points="292.57,618 292.57,615.37 290.34,614.05 288.12,615.37 288.12,618 290.34,619.32" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4466.1" onmousemove="showTooltip(evt, 'Tāmaki Makaurau')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4466.1.1" points="116.69,638.96 116.69,636.08 114.25,634.64 111.82,636.08 111.82,638.96 114.25,640.4" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4467.1" onmousemove="showTooltip(evt, 'Rodney')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4467.1.1" points="255.65,637.83 255.65,637.21 255.12,636.9 254.6,637.21 254.6,637.83 255.12,638.14" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4468.1" onmousemove="showTooltip(evt, 'Te Tai Tokerau')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4468.1.1" points="104.73,659.66 104.73,657.04 102.51,655.74 100.3,657.04 100.3,659.66 102.51,660.97" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4469.1" onmousemove="showTooltip(evt, 'Northland')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4469.1.1" points="244.59,659.07 244.59,657.64 243.38,656.93 242.18,657.64 242.18,659.07 243.38,659.78" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.polygon.4470.1" onmousemove="showTooltip(evt, 'Whangarei')" onmouseout="hideTooltip()"> | |
<polygon id="GRID.polygon.4470.1.1" points="267.39,658.66 267.39,658.04 266.86,657.73 266.34,658.04 266.34,658.66 266.86,658.97" fill="rgb(217,42,25)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/> | |
</g> | |
<g id="GRID.rect.4471.1" onmousemove="showTooltip(evt, 'NA')" onmouseout="hideTooltip()"> | |
<rect id="GRID.rect.4471.1.1" x="67.3" y="533.68" width="114.46" height="166.79"/> | |
</g> | |
<script type="application/ecmascript" id="GRID.script.grob.4472" xlink:href="tooltip.js"/> | |
</g> | |
</g> | |
</g> | |
</svg> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var showTooltip = function(evt, label) { | |
// Getting rid of any existing tooltips | |
hideTooltip(); | |
var svgNS = "http://www.w3.org/2000/svg"; | |
var target = evt.currentTarget; | |
// Create new text node, rect and text for the tooltip | |
var content = document.createTextNode(label); | |
var text = document.createElementNS(svgNS, "text"); | |
text.setAttribute("id", "tooltipText"); | |
// Resetting some style attributes | |
text.setAttribute("font-size", "16px"); | |
text.setAttribute("fill", "black"); | |
text.setAttribute("stroke-width", "0"); | |
text.appendChild(content); | |
var rect = document.createElementNS(svgNS, "rect"); | |
rect.setAttribute("id", "tooltipRect"); | |
// Add rect and text to the bottom of the document. | |
// This is because SVG has a rendering order. | |
// We want the tooltip to be on top, therefore inserting last. | |
var wrappingGroup = document.getElementsByTagName("g")[0]; | |
wrappingGroup.appendChild(rect); | |
wrappingGroup.appendChild(text); | |
// Transforming the mouse location to the SVG coordinate system | |
// Snippet lifted from: http://tech.groups.yahoo.com/group/svg-developers/message/52701 | |
var m = target.getScreenCTM(); | |
var p = document.documentElement.createSVGPoint(); | |
p.x = evt.clientX; | |
p.y = evt.clientY; | |
p = p.matrixTransform(m.inverse()); | |
// Determine position for tooltip based on location of | |
// element that mouse is over | |
// AND size of text label | |
// Currently the tooltip is offset by (-3, 0) | |
var tooltipx = p.x - text.getBBox().width/2; | |
var tooltiplabx = tooltipx + 5; | |
var tooltipy = p.y + 0; | |
var tooltiplaby = tooltipy + 5; | |
// Position tooltip rect and text | |
text.setAttribute("transform", | |
"translate(" + tooltiplabx + ", " + tooltiplaby + ") " + | |
"scale(1, -1)"); | |
rect.setAttribute("x", tooltipx); | |
rect.setAttribute("y", tooltipy); | |
rect.setAttribute("width", text.getBBox().width + 10); | |
rect.setAttribute("height", text.getBBox().height + 5); | |
rect.setAttribute("stroke", "white"); | |
rect.setAttribute("fill", "white"); | |
}; | |
var hideTooltip = function() { | |
// Remove tooltip text and rect | |
var text = document.getElementById("tooltipText"); | |
var rect = document.getElementById("tooltipRect"); | |
if (text && rect) { | |
text.parentNode.removeChild(text); | |
rect.parentNode.removeChild(rect); | |
} | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment