# HG changeset patch # User Dennis Fink # Date 2016-03-01 23:14:07 # Node ID 4729289ef49b724fd559cf7c5fe30c5effdbc6a6 # Parent e4ec01c311f1ca9d1abb9502d6e8825d1f743ff9 Use green colors diff --git a/ennstatus/static/js/worldmap.js b/ennstatus/static/js/worldmap.js --- a/ennstatus/static/js/worldmap.js +++ b/ennstatus/static/js/worldmap.js @@ -35,9 +35,9 @@ setup(width, height); function setup(width, height) { projection = d3.geo.mercator() - .translate([(width / 2), (height / 2)]) - .scale(width / 2 / Math.PI) - + .translate([(width / 2), (height / 2)]) + .scale(width / 2 / Math.PI) + path = d3.geo.path().projection(projection); svg = d3.select("#chart").append("svg") @@ -73,23 +73,19 @@ function draw(topo) { d3.json("/data/worldmap", function(err, data) { - var colorscale = d3.scale.threshold().domain(d3.range(1, data.max+1)).range([ - "#c0c2e6", - "#b2b5e0", - "#a4a7da", - "#969ad5", - "#888ccf", - "#7a7fca", - "#6c71c4", - "#5e63be", - "#5056b9", - "#464caf", - "#4146a1", - "#3b4093", - "#353a85", - "#303477", - "#2a2e69", - "#25285b" + var colorscale = d3.scale.threshold().domain(d3.range(1, (data.max+1)/3).map(function(n) { var a=1, b=1, f=1; for(var i = 2; i <= n; i++) { f = a+b; a=b; b=f } return f;})).range([ + "#aeffb9", + "#87ff97", + "#60ff76", + "#38ff54", + "#11ff32", + "#00e920", + "#00c21b", + "#009a15", + "#008713", + "#007310", + "#00600d", + "#004c0a" ]) country.enter().insert("path")