I hereby claim:
- I am moklick on github.
- I am moklick (https://keybase.io/moklick) on keybase.
- I have a public key ASCRAEeOQsPTamLtJzCu8u1sdYvSq43rr2iOmsyPIAU5Qgo
To claim this, I am signing this object:
import { formatDefaultLocale } from 'd3-format'; | |
const germanNumberFormat = formatDefaultLocale({ | |
decimal: ',', | |
thousands: '.', | |
grouping: [3], | |
currency: ['€', ''] | |
}); | |
export function numberFormat(num, decimals = 0) { |
// via http://stackoverflow.com/questions/10730309/find-all-text-nodes-in-html-page#answer-10730777 | |
function findTextNodes(el) { | |
var node; | |
var textNodes = []; | |
var walk = document.createTreeWalker(el, NodeFilter.SHOW_TEXT, null, false); | |
while (node = walk.nextNode()) { | |
textNodes.push(node); | |
} | |
return textNodes; | |
} |
I hereby claim:
To claim this, I am signing this object:
const customCRS = L.extend({}, L.CRS.Earth, { | |
projection: L.Projection.SphericalMercator, | |
transformation: (function () { | |
var scale = 0.5 / (Math.PI * L.Projection.SphericalMercator.R); | |
return new L.Transformation(scale, 0.5, -scale, 0.5); | |
}()), | |
scale: function (zoom) { | |
return 512 * Math.pow(2, zoom); | |
} | |
}); |
// from 1337 to 1.337 | |
function formatNumber(number){ | |
return (parseFloat(number) / 1000).toFixed(3).toString(); | |
} | |
// from 12.123 to 12,123 | |
function replacePoint(number) { | |
return number.toString().replace('.', ','); | |
} |
var FusionHelper = { | |
query: function(params) { | |
var base = 'https://www.googleapis.com/fusiontables/v1/query?', | |
url = base + $.param({ | |
sql: params.sql, | |
key: '***' | |
}); | |
$.ajax({ | |
url: url, | |
type: 'POST', |