@@ -27,9 +27,12 @@ module.exports = function calc(trace, vals, containerStr, cLetter) {
2727 inputContainer = trace . _input ;
2828 }
2929
30- var auto = container [ cLetter + 'auto' ] ,
31- min = container [ cLetter + 'min' ] ,
32- max = container [ cLetter + 'max' ] ,
30+ var autoAttr = cLetter + 'auto' ,
31+ minAttr = cLetter + 'min' ,
32+ maxAttr = cLetter + 'max' ,
33+ auto = container [ autoAttr ] ,
34+ min = container [ minAttr ] ,
35+ max = container [ maxAttr ] ,
3336 scl = container . colorscale ;
3437
3538 if ( auto !== false || min === undefined ) {
@@ -45,11 +48,21 @@ module.exports = function calc(trace, vals, containerStr, cLetter) {
4548 max += 0.5 ;
4649 }
4750
48- container [ cLetter + 'min' ] = min ;
49- container [ cLetter + 'max' ] = max ;
51+ container [ minAttr ] = min ;
52+ container [ maxAttr ] = max ;
5053
51- inputContainer [ cLetter + 'min' ] = min ;
52- inputContainer [ cLetter + 'max' ] = max ;
54+ inputContainer [ minAttr ] = min ;
55+ inputContainer [ maxAttr ] = max ;
56+
57+ /*
58+ * If auto was explicitly false but min or max was missing,
59+ * we filled in the missing piece here but later the trace does
60+ * not look auto.
61+ * Otherwise make sure the trace still looks auto as far as later
62+ * changes are concerned.
63+ */
64+ inputContainer [ autoAttr ] = ( auto !== false ||
65+ ( min === undefined && max === undefined ) ) ;
5366
5467 if ( container . autocolorscale ) {
5568 if ( min * max < 0 ) scl = scales . RdBu ;
0 commit comments