function renderHeatLegend(map) {
    resetLegend(map);
    map.el.defs = map.el.svg.append('defs').html('');

    var opts = map.options;
    var legend = map.el.legend;

    var gradient = map.el.defs
      .append('linearGradient')
      .attr('id', 'heat')
      .attr('x1', '0%')
      .attr('y1', '0%')
      .attr('x2', '100%')
      .attr('y2', '0%');

    var ramp = legend
      .append('rect')
      .attr('width', 150)
      .attr('height', 20)
      .attr('fill', 'url(#heat)');

    opts.fills.forEach(function(fill, i) {
      gradient
        .append('stop')
        .attr('offset', (i/(opts.fills.length-1) * 100)+'%')
        .attr('style', 'stop-color:'+fill.color);
    });

    map._y += 20 + pad;
  }
// Renders a heat gradient bar.
Renders a heat gradient bar.
Renders a heat gradient bar .
function renderHeatLegend(map) {
    resetLegend(map);
    map.el.defs = map.el.svg.append('defs').html('');
    var opts = map.options;
    var legend = map.el.legend;
    var gradient = map.el.defs
      .append('linearGradient')
      .attr('id', 'heat')
      .attr('x1', '0%')
      .attr('y1', '0%')
      .attr('x2', '100%')
      .attr('y2', '0%');
    var ramp = legend
      .append('rect')
      .attr('width', 150)
      .attr('height', 20)
      .attr('fill', 'url(#heat)');
    opts.fills.forEach(function(fill, i) {
      gradient
        .append('stop')
        .attr('offset', (i/(opts.fills.length-1) * 100)+'%')
        .attr('style', 'stop-color:'+fill.color);
    });
    map._y += 20 + pad;
  }
function renderHeatLegend ( map ) { resetLegend ( map ) ; map . el . defs = map . el . svg . append ( 'defs' ) . html ( '' ) ; var opts = map . options ; var legend = map . el . legend ; var gradient = map . el . defs . append ( 'linearGradient' ) . attr ( 'id' , 'heat' ) . attr ( 'x1' , '0%' ) . attr ( 'y1' , '0%' ) . attr ( 'x2' , '100%' ) . attr ( 'y2' , '0%' ) ; var ramp = legend . append ( 'rect' ) . attr ( 'width' , 150 ) . attr ( 'height' , 20 ) . attr ( 'fill' , 'url(#heat)' ) ; opts . fills . forEach ( function ( fill , i ) { gradient . append ( 'stop' ) . attr ( 'offset' , ( i / ( opts . fills . length - 1 ) * 100 ) + '%' ) . attr ( 'style' , 'stop-color:' + fill . color ) ; } ) ; map . _y += 20 + pad ; }
Renders a heat gradient bar.
Renders a heat gradient bar .