Skip to content

Instantly share code, notes, and snippets.

@tslumley
Last active August 29, 2015 14:16
Show Gist options
  • Save tslumley/9d6265ad35cc9b0f125b to your computer and use it in GitHub Desktop.
Save tslumley/9d6265ad35cc9b0f125b to your computer and use it in GitHub Desktop.
Electorate candidate donations, all parties, 2014

Election donations, New Zealand, 2014.

Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<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>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
<?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:45"/>
<gridsvg:argument name="name" value="~/CASHMAPS/national.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="jjcpc.off.1">
<g id="GRID.polygon.4326.1" onmousemove="showTooltip(evt, 'Invercargill')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4326.1.1" points="93.97,97.75 93.97,93.97 90.78,92.08 87.58,93.97 87.58,97.75 90.78,99.64" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4327.1" onmousemove="showTooltip(evt, 'Clutha-Southland')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4327.1.1" points="106.44,119.02 106.44,114.38 102.51,112.06 98.59,114.38 98.59,119.02 102.51,121.34" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4328.1" onmousemove="showTooltip(evt, 'Dunedin South')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4328.1.1" points="116.08,138.61 116.08,136.45 114.25,135.37 112.43,136.45 112.43,138.61 114.25,139.69" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4329.1" onmousemove="showTooltip(evt, 'Dunedin North')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4329.1.1" points="140.55,139.19 140.55,135.86 137.73,134.2 134.92,135.86 134.92,139.19 137.73,140.86" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4330.1" onmousemove="showTooltip(evt, 'Waitaki')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4330.1.1" points="128.81,160.03 128.81,156.7 125.99,155.03 123.18,156.7 123.18,160.03 125.99,161.69" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4331.1" onmousemove="showTooltip(evt, 'Rangitata')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4331.1.1" points="141.95,181.69 141.95,176.7 137.73,174.2 133.51,176.7 133.51,181.69 137.73,184.19" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4332.1" onmousemove="showTooltip(evt, 'Wigram')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4332.1.1" points="151.86,201.44 151.86,198.62 149.47,197.2 147.08,198.62 147.08,201.44 149.47,202.85" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4333.1" onmousemove="showTooltip(evt, 'Port Hills')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4333.1.1" points="176.26,201.99 176.26,198.07 172.95,196.11 169.64,198.07 169.64,201.99 172.95,203.95" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4334.1" onmousemove="showTooltip(evt, 'Ilam')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4334.1.1" points="164.02,222.53 164.02,219.2 161.21,217.53 158.4,219.2 158.4,222.53 161.21,224.19" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4335.1" onmousemove="showTooltip(evt, 'Christchurch Central')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4335.1.1" points="188.26,222.97 188.26,218.75 184.69,216.63 181.12,218.75 181.12,222.97 184.69,225.09" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4336.1" onmousemove="showTooltip(evt, 'West Coast-Tasman')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4336.1.1" points="153.01,243.79 153.01,239.6 149.47,237.51 145.93,239.6 145.93,243.79 149.47,245.88" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4337.1" onmousemove="showTooltip(evt, 'Selwyn')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4337.1.1" points="176.56,243.83 176.56,239.56 172.95,237.43 169.34,239.56 169.34,243.83 172.95,245.96" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4338.1" onmousemove="showTooltip(evt, 'Christchurch East')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4338.1.1" points="198.36,242.83 198.36,240.55 196.43,239.41 194.5,240.55 194.5,242.83 196.43,243.97" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4339.1" onmousemove="showTooltip(evt, 'Waimakariri')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4339.1.1" points="188.29,264.66 188.29,260.4 184.69,258.27 181.09,260.4 181.09,264.66 184.69,266.78" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4340.1" onmousemove="showTooltip(evt, 'Nelson')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4340.1.1" points="176.56,285.49 176.56,281.23 172.95,279.09 169.34,281.23 169.34,285.49 172.95,287.63" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4341.1" onmousemove="showTooltip(evt, 'Kaik&#x14D;ura')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4341.1.1" points="200.04,285.49 200.04,281.23 196.43,279.09 192.82,281.23 192.82,285.49 196.43,287.63" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4342.1" onmousemove="showTooltip(evt, 'Wellington Central')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4342.1.1" points="245.78,284.78 245.78,281.94 243.38,280.53 240.99,281.94 240.99,284.78 243.38,286.19" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4343.1" onmousemove="showTooltip(evt, 'Rongotai')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4343.1.1" points="268,284.03 268,282.69 266.86,282.02 265.73,282.69 265.73,284.03 266.86,284.7" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4344.1" onmousemove="showTooltip(evt, '&#x14C;h&#x101;riu')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4344.1.1" points="257.58,305.65 257.58,302.74 255.12,301.29 252.67,302.74 252.67,305.65 255.12,307.1" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4345.1" onmousemove="showTooltip(evt, 'Hutt South')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4345.1.1" points="282.31,306.39 282.31,302 278.6,299.81 274.9,302 274.9,306.39 278.6,308.58" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4346.1" onmousemove="showTooltip(evt, 'Mana')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4346.1.1" points="269.72,326.71 269.72,323.34 266.86,321.65 264.01,323.34 264.01,326.71 266.86,328.4" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4347.1" onmousemove="showTooltip(evt, 'Rimutaka')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4347.1.1" points="293.84,327.1 293.84,322.95 290.34,320.88 286.84,322.95 286.84,327.1 290.34,329.17" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4348.1" onmousemove="showTooltip(evt, '&#x14C;taki')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4348.1.1" points="282.07,347.91 282.07,343.81 278.6,341.76 275.14,343.81 275.14,347.91 278.6,349.96" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4349.1" onmousemove="showTooltip(evt, 'Wairarapa')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4349.1.1" points="304.4,347.23 304.4,344.49 302.08,343.12 299.76,344.49 299.76,347.23 302.08,348.6" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4350.1" onmousemove="showTooltip(evt, 'Palmerston North')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4350.1.1" points="294,368.85 294,364.53 290.34,362.37 286.69,364.53 286.69,368.85 290.34,371.02" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4351.1" onmousemove="showTooltip(evt, 'Tukituki')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4351.1.1" points="317.28,368.74 317.28,364.64 313.82,362.59 310.36,364.64 310.36,368.74 313.82,370.79" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4352.1" onmousemove="showTooltip(evt, 'Rangit&#x12B;kei')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4352.1.1" points="305.08,389.3 305.08,385.75 302.08,383.98 299.09,385.75 299.09,389.3 302.08,391.07" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4353.1" onmousemove="showTooltip(evt, 'Napier')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4353.1.1" points="329.52,389.87 329.52,385.18 325.56,382.84 321.6,385.18 321.6,389.87 325.56,392.21" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4354.1" onmousemove="showTooltip(evt, 'New Plymouth')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4354.1.1" points="294.11,410.58 294.11,406.13 290.34,403.91 286.58,406.13 286.58,410.58 290.34,412.81" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4355.1" onmousemove="showTooltip(evt, 'Whanganui')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4355.1.1" points="316.63,410.02 316.63,406.69 313.82,405.03 311.01,406.69 311.01,410.02 313.82,411.69" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4356.1" onmousemove="showTooltip(evt, 'Rotorua')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4356.1.1" points="342.37,411.36 342.37,405.36 337.3,402.35 332.22,405.36 332.22,411.36 337.3,414.36" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4357.1" onmousemove="showTooltip(evt, 'East Coast')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4357.1.1" points="363.45,409.94 363.45,406.78 360.78,405.19 358.1,406.78 358.1,409.94 360.78,411.52" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4358.1" onmousemove="showTooltip(evt, 'Taranaki-King Country')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4358.1.1" points="305.32,431.1 305.32,427.28 302.08,425.36 298.85,427.28 298.85,431.1 302.08,433.02" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4359.1" onmousemove="showTooltip(evt, 'Taup&#x14D;')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4359.1.1" points="329.44,431.49 329.44,426.89 325.56,424.6 321.68,426.89 321.68,431.49 325.56,433.78" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4360.1" onmousemove="showTooltip(evt, 'Hamilton West')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4360.1.1" points="293.81,452.07 293.81,447.97 290.34,445.93 286.88,447.97 286.88,452.07 290.34,454.12" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4361.1" onmousemove="showTooltip(evt, 'Hamilton East')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4361.1.1" points="317.09,451.96 317.09,448.09 313.82,446.15 310.55,448.09 310.55,451.96 313.82,453.9" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4362.1" onmousemove="showTooltip(evt, 'Bay of Plenty')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4362.1.1" points="340.91,452.16 340.91,447.89 337.3,445.75 333.69,447.89 333.69,452.16 337.3,454.29" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4363.1" onmousemove="showTooltip(evt, 'Tauranga')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4363.1.1" points="365.17,452.62 365.17,447.42 360.78,444.82 356.38,447.42 356.38,452.62 360.78,455.23" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4364.1" onmousemove="showTooltip(evt, 'Waikato')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4364.1.1" points="304.61,472.36 304.61,469.36 302.08,467.86 299.55,469.36 299.55,472.36 302.08,473.85" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4365.1" onmousemove="showTooltip(evt, 'Coromandel')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4365.1.1" points="329.17,472.99 329.17,468.72 325.56,466.59 321.95,468.72 321.95,472.99 325.56,475.12" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4366.1" onmousemove="showTooltip(evt, 'Papakura')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4366.1.1" points="293.51,493.56 293.51,489.81 290.34,487.94 287.17,489.81 287.17,493.56 290.34,495.44" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4367.1" onmousemove="showTooltip(evt, 'Hunua')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4367.1.1" points="317.02,493.58 317.02,489.8 313.82,487.91 310.62,489.8 310.62,493.58 313.82,495.47" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4368.1" onmousemove="showTooltip(evt, 'M&#x101;ngere')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4368.1.1" points="281.39,514.17 281.39,510.87 278.6,509.22 275.81,510.87 275.81,514.17 278.6,515.82" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4369.1" onmousemove="showTooltip(evt, 'Manurewa')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4369.1.1" points="304.87,514.17 304.87,510.87 302.08,509.22 299.29,510.87 299.29,514.17 302.08,515.82" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4370.1" onmousemove="showTooltip(evt, 'New Lynn')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4370.1.1" points="246.51,535.21 246.51,531.5 243.38,529.65 240.26,531.5 240.26,535.21 243.38,537.06" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4371.1" onmousemove="showTooltip(evt, 'Mt Roskill')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4371.1.1" points="268.88,534.55 268.88,532.16 266.86,530.97 264.85,532.16 264.85,534.55 266.86,535.74" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4372.1" onmousemove="showTooltip(evt, 'Manukau East')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4372.1.1" points="292.66,534.73 292.66,531.98 290.34,530.61 288.02,531.98 288.02,534.73 290.34,536.1" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4373.1" onmousemove="showTooltip(evt, 'Botany')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4373.1.1" points="318.86,536.34 318.86,530.37 313.82,527.39 308.78,530.37 308.78,536.34 313.82,539.32" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4374.1" onmousemove="showTooltip(evt, 'Kelston')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4374.1.1" points="233.96,555.56 233.96,552.82 231.65,551.45 229.33,552.82 229.33,555.56 231.65,556.93" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4375.1" onmousemove="showTooltip(evt, 'Mt Albert')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4375.1.1" points="257.81,555.78 257.81,552.6 255.12,551.01 252.44,552.6 252.44,555.78 255.12,557.36" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4376.1" onmousemove="showTooltip(evt, 'Epsom')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4376.1.1" points="280.78,555.48 280.78,552.9 278.6,551.61 276.42,552.9 276.42,555.48 278.6,556.77" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4377.1" onmousemove="showTooltip(evt, 'Maungakiekie')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4377.1.1" points="306.29,556.68 306.29,551.7 302.08,549.21 297.88,551.7 297.88,556.68 302.08,559.16" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4378.1" onmousemove="showTooltip(evt, 'Pakuranga')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4378.1.1" points="327.16,555.14 327.16,553.24 325.56,552.29 323.96,553.24 323.96,555.14 325.56,556.08" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4379.1" onmousemove="showTooltip(evt, 'Te Tai Tonga')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4379.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(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4380.1" onmousemove="showTooltip(evt, 'Te Atat&#x16B;')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4380.1.1" points="247.36,577.37 247.36,572.67 243.38,570.31 239.41,572.67 239.41,577.37 243.38,579.73" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4381.1" onmousemove="showTooltip(evt, 'Auckland Central')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4381.1.1" points="267.39,575.33 267.39,574.71 266.86,574.4 266.34,574.71 266.34,575.33 266.86,575.64" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4382.1" onmousemove="showTooltip(evt, 'T&#x101;maki')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4382.1.1" points="293.8,577.06 293.8,572.98 290.34,570.93 286.89,572.98 286.89,577.06 290.34,579.11" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4383.1" onmousemove="showTooltip(evt, 'Te Tai Hau&#x101;uru')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4383.1.1" points="114.78,596.16 114.78,595.54 114.25,595.23 113.73,595.54 113.73,596.16 114.25,596.48" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4384.1" onmousemove="showTooltip(evt, 'Ikaroa-R&#x101;whiti')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4384.1.1" points="138.26,596.16 138.26,595.54 137.73,595.23 137.21,595.54 137.21,596.16 137.73,596.48" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4385.1" onmousemove="showTooltip(evt, 'Upper Harbour')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4385.1.1" points="258.25,597.7 258.25,594 255.12,592.15 252,594 252,597.7 255.12,599.55" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4386.1" onmousemove="showTooltip(evt, 'Northcote')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4386.1.1" points="281.42,597.52 281.42,594.19 278.6,592.52 275.78,594.19 275.78,597.52 278.6,599.19" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4387.1" onmousemove="showTooltip(evt, 'Hauraki-Waikato')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4387.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(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4388.1" onmousemove="showTooltip(evt, 'Waiariki')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4388.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(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4389.1" onmousemove="showTooltip(evt, 'Helensville')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4389.1.1" points="246.65,618.62 246.65,614.76 243.38,612.83 240.12,614.76 240.12,618.62 243.38,620.54" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4390.1" onmousemove="showTooltip(evt, 'East Coast Bays')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4390.1.1" points="269.44,618.21 269.44,615.17 266.86,613.64 264.29,615.17 264.29,618.21 266.86,619.73" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4391.1" onmousemove="showTooltip(evt, 'North Shore')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4391.1.1" points="293.14,618.34 293.14,615.03 290.34,613.37 287.54,615.03 287.54,618.34 290.34,620" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4392.1" onmousemove="showTooltip(evt, 'T&#x101;maki Makaurau')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4392.1.1" points="114.78,637.83 114.78,637.21 114.25,636.9 113.73,637.21 113.73,637.83 114.25,638.14" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4393.1" onmousemove="showTooltip(evt, 'Rodney')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4393.1.1" points="258.61,639.58 258.61,635.46 255.12,633.4 251.64,635.46 251.64,639.58 255.12,641.64" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4394.1" onmousemove="showTooltip(evt, 'Te Tai Tokerau')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4394.1.1" points="103.04,658.66 103.04,658.04 102.51,657.73 101.99,658.04 101.99,658.66 102.51,658.97" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4395.1" onmousemove="showTooltip(evt, 'Northland')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4395.1.1" points="246.64,660.28 246.64,656.43 243.38,654.51 240.13,656.43 240.13,660.28 243.38,662.2" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.polygon.4396.1" onmousemove="showTooltip(evt, 'Whangarei')" onmouseout="hideTooltip()">
<polygon id="GRID.polygon.4396.1.1" points="270.21,660.33 270.21,656.37 266.86,654.4 263.52,656.37 263.52,660.33 266.86,662.31" fill="rgb(30,70,128)" stroke="rgb(0,0,0)" stroke-opacity="1" fill-opacity="1"/>
</g>
<g id="GRID.rect.4397.1" onmousemove="showTooltip(evt, 'NA')" onmouseout="hideTooltip()">
<rect id="GRID.rect.4397.1.1" x="67.3" y="533.68" width="114.46" height="166.79"/>
</g>
<script type="application/ecmascript" id="GRID.script.grob.4398" xlink:href="tooltip.js"/>
</g>
</g>
</g>
</svg>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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