Skip to content

Commit

Permalink
Wind speed is now max 15/s. Fixes electricitymaps#23
Browse files Browse the repository at this point in the history
  • Loading branch information
corradio committed Jun 20, 2016
1 parent efee6bd commit 1d8fdb5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@
var co2color = d3.scale.linear()
.domain([0, 250, 500])
.range(['green', 'orange', 'black']);
var maxWind = 15;
var windColor = d3.scale.linear()
.domain(d3.range(0, 11).map( function (i) { return i * 4; } ))
.domain(d3.range(0, 11).map( function (i) { return d3.interpolate(0, maxWind)(i / 10.0); } ))
.range([
"rgba(0, 255, 255, 0.5)",
"rgba(100, 240, 255, 0.5)",
Expand All @@ -113,7 +114,8 @@
"rgba(225, 133, 255, 0.5)",
"rgba(236, 109, 255, 0.5)",
"rgba(255, 30, 219, 0.5)"
]);
])
.clamp(true);
var solarColor = d3.scale.linear()
.range(['black', 'orange'])
.domain([300, 440]);
Expand Down
3 changes: 2 additions & 1 deletion scripts/horizontalcolorbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ function HorizontalColorbar(selector, d3scale, d3TickFormat, d3TickValues) {
// Linear scale
this.scale = d3.scale.linear()
.range([0, this.colorbarWidth])
.domain(d3.extent(d3scale.domain()));
.domain(d3.extent(d3scale.domain()))
.clamp(d3scale.clamp());
this.gGradient = this.gColorbar.append('linearGradient')
.attr('id', selector + 'gradient')
.attr('x1', 0)
Expand Down
2 changes: 1 addition & 1 deletion vendor/wind-js/windy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
var Windy = function( params ){
var VELOCITY_SCALE = 1/100000;//1/70000 // scale for wind velocity (completely arbitrary--this value looks nice)
var INTENSITY_SCALE_STEP = 10; // step size of particle intensity color scale
var MAX_WIND_INTENSITY = 40; // wind velocity at which particle intensity is maximum (m/s)
var MAX_WIND_INTENSITY = 15; // wind velocity at which particle intensity is maximum (m/s)
var MAX_PARTICLE_AGE = 100; // max number of frames a particle is drawn before regeneration
var PARTICLE_LINE_WIDTH = 2; // line width of a drawn particle
var PARTICLE_MULTIPLIER = 1;//8 // particle count scalar (completely arbitrary--this values looks nice)
Expand Down

0 comments on commit 1d8fdb5

Please sign in to comment.