Changeset 19808


Ignore:
Timestamp:
11/25/15 13:46:00 (9 years ago)
Author:
Eric.Larour
Message:

CHG: introduced some checks for data that is essentially 0 filled in javascript plots.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/webgl.js

    r19798 r19808  
    117117} //}}}
    118118function rgb(value, min, max) { //{{{
     119       
     120        var normalizedValue;
    119121                                       
    120122        colorbar=colorbars["rainbow"];
    121123
    122124        value = clamp(value, min, max);
    123         var normalizedValue = (value - min) / (max - min);
     125        if((max-min)!=0) normalizedValue = (value - min) / (max - min);
     126        else normalizedValue = value;
     127
    124128        var index = clamp(Math.round(normalizedValue * colorbar.length), 0, colorbar.length - 1);
    125129        return colorbar[index];
Note: See TracChangeset for help on using the changeset viewer.