Skip to content

Commit

Permalink
improve code readability
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinerg committed Nov 22, 2018
1 parent ee222d5 commit 75e8910
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/colorscale/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var flipScale = require('./flip_scale');


module.exports = function calc(gd, trace, opts) {
var fullLayout = gd._fullLayout;
var vals = opts.vals;
var containerStr = opts.containerStr;
var cLetter = opts.cLetter;
Expand Down Expand Up @@ -86,8 +87,8 @@ module.exports = function calc(gd, trace, opts) {
doUpdate(autoAttr, (auto !== false || (min === undefined && max === undefined)));

if(container.autocolorscale) {
if(min * max < 0) scl = gd._fullLayout.colorscale.diverging;
else if(min >= 0) scl = gd._fullLayout.colorscale.sequential;
if(min * max < 0) scl = fullLayout.colorscale.diverging;
else if(min >= 0) scl = fullLayout.colorscale.sequential;
else scl = gd._fullLayout.colorscale.sequentialminus;

// reversescale is handled at the containerOut level
Expand Down

0 comments on commit 75e8910

Please sign in to comment.