|
11 | 11 |
|
12 | 12 | var Registry = require('../../registry'); |
13 | 13 | var Lib = require('../../lib'); |
14 | | -var colorbarDefaults = require('../../components/colorbar/defaults'); |
| 14 | +var colorscaleDefaults = require('../../components/colorscale/defaults'); |
15 | 15 | var attributes = require('./attributes'); |
16 | 16 |
|
17 | | - |
18 | 17 | module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) { |
19 | 18 | function coerce(attr, dflt) { |
20 | 19 | return Lib.coerce(traceIn, traceOut, attributes, attr, dflt); |
@@ -77,23 +76,12 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout |
77 | 76 |
|
78 | 77 | if('intensity' in traceIn) { |
79 | 78 | coerce('intensity'); |
80 | | - coerce('showscale', true); |
81 | | - } |
82 | | - else { |
| 79 | + colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'c'}); |
| 80 | + } else { |
83 | 81 | traceOut.showscale = false; |
84 | 82 |
|
85 | 83 | if('facecolor' in traceIn) coerce('facecolor'); |
86 | 84 | else if('vertexcolor' in traceIn) coerce('vertexcolor'); |
87 | 85 | else coerce('color', defaultColor); |
88 | 86 | } |
89 | | - |
90 | | - if(traceOut.reversescale) { |
91 | | - traceOut.colorscale = traceOut.colorscale.map(function(si) { |
92 | | - return [1 - si[0], si[1]]; |
93 | | - }).reverse(); |
94 | | - } |
95 | | - |
96 | | - if(traceOut.showscale) { |
97 | | - colorbarDefaults(traceIn, traceOut, layout); |
98 | | - } |
99 | 87 | }; |
0 commit comments