Map animation in D3.
This file contains 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
switchHeight = 15px | |
switchPadding = 2px | |
switchWidth = 25px | |
.switch | |
position absolute | |
height switchHeight | |
width switchWidth | |
top 4px | |
right 5px | |
border-top-left-radius 25% 50% |
This file contains 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
generateTitle = -> | |
v = 'aeiouy' | |
c = 'bcdfghjklmnpqrstvwxz' | |
text = '' | |
for i in [0..6] | |
group = if i % 2 then v else c | |
letter = group.charAt(Math.floor(Math.random() * group.length)) | |
if i is 0 | |
letter = letter.toUpperCase() |
This file contains 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
div = document.createElement('div') | |
fakeSvg = '<svg>' + markerIcon + '</svg>' | |
div.innerHTML = '' + fakeSvg | |
for el in Array::slice.call(div.childNodes[0].childNodes) | |
marker.node().appendChild(el) |
This file contains 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 as = document.querySelectorAll('br + a') | |
for (var i = 0, len = as.length; i < len; i++) { | |
var a = _ref[i] | |
a.setAttribute('download', a.textContent) | |
a.click() | |
} |
This file contains 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
# Size of the map | |
size = 240 | |
# Zoom level to see all Australia | |
startScale = 330 | |
# Zoom level when zoomed | |
zoomedScale = 1330 | |
# Transition duration | |
duration = 400 | |
projection = d3.geo.mercator() |
This file contains 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
// Returned promise | |
var promise = new Parse.Promise() | |
// Error function | |
var error = function() { | |
console.error('Error:', arguments) | |
// Break it | |
response.error('Query failed, check logs') | |
} |
This file contains 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
averaveColor = (colors) -> | |
d2h = (d) -> d.toString(16) | |
h2d = (h) -> parseInt(h, 16) | |
r = g = b = 0 | |
for color in colors | |
r += h2d(color.slice(1, 3)) | |
g += h2d(color.slice(3, 5)) | |
b += h2d(color.slice(5)) |
This file contains 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
// Resize el if too long | |
fontSize = parseInt(el.style.fontSize) | |
while (el.offsetWidth < el.scrollWidth) | |
el.style.fontSize = --fontSize |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.