JavaScript Continous colors for choropleth in Leaflet

In Leaflet choropleth to assign colors you can use this function. http://leafletjs.com/examples/choropleth.html

function getColor(d) {
return d > 1000 ? '#800026' :
       d > 500  ? '#BD0026' :
       d > 200  ? '#E31A1C' :
       d > 100  ? '#FC4E2A' :
       d > 50   ? '#FD8D3C' :
       d > 20   ? '#FEB24C' :
       d > 10   ? '#FED976' :
                  '#FFEDA0';
 }

Instead of a particular breaks in colors is there a way I can just provide the minimum and maximum value and let the colors define themselves?

I have a couple of scales and defining a discrete scale for each of them is not possible.

Any suggestions to use Chroma.JS https://github.com/gka/chroma.js ?

Answer:1

I need to get last inserted id $stmt = $db->query("SELECT LAST_INSERT_ID();"); $row = $stmt->fetch(); echo $row['id']; js success: function(data) { console.log(data); } ...

I need to get last inserted id $stmt = $db->query("SELECT LAST_INSERT_ID();"); $row = $stmt->fetch(); echo $row['id']; js success: function(data) { console.log(data); } ...

// Browser onresize event window.onresize = function () { scope.$apply(); }; scope.render = function (data) { //debugger //var ...

// Browser onresize event window.onresize = function () { scope.$apply(); }; scope.render = function (data) { //debugger //var ...

  1. google chart legend click hide
  2. bokeh click legend to hide

I was trying to get a dynamic dependent select list using AJAX, but unable to get the second list. Here is my code. gethint.php is working fine. I don't know where I am doing wrong. <html> ...

I was trying to get a dynamic dependent select list using AJAX, but unable to get the second list. Here is my code. gethint.php is working fine. I don't know where I am doing wrong. <html> ...

  1. visual basic select dynamic range

I have this handler that I built to handle $http requests. It looks like this: .service('ApiHandler', ['$q', '$http', '$injector', 'apiUrl', 'ErrorService', 'toastr', function ($q, $http, $injector, ...

I have this handler that I built to handle $http requests. It looks like this: .service('ApiHandler', ['$q', '$http', '$injector', 'apiUrl', 'ErrorService', 'toastr', function ($q, $http, $injector, ...

  1. angularjs interceptor responseerror
  2. angularjs http interceptor responseerror
  3. angularjs interceptor response error handling