Skip to content

Commit e1adaed

Browse files
authored
Merge pull request #818 from plotly/colorscale-fix
add autocolorscale false when user updates colorscale
2 parents a22f466 + c4bf95f commit e1adaed

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/components/fields/ColorscalePicker.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Field from './Field';
33
import PropTypes from 'prop-types';
44
import React, {Component} from 'react';
55
import {connectToContainer} from 'lib';
6+
import {EDITOR_ACTIONS} from 'lib/constants';
67

78
export class UnconnectedColorscalePicker extends Component {
89
constructor(props) {
@@ -22,6 +23,13 @@ export class UnconnectedColorscalePicker extends Component {
2223
}),
2324
colorscaleType
2425
);
26+
this.context.onUpdate({
27+
type: EDITOR_ACTIONS.UPDATE_TRACES,
28+
payload: {
29+
update: {autocolorscale: false},
30+
traceIndexes: [this.props.fullContainer.index],
31+
},
32+
});
2533
}
2634
}
2735

@@ -43,6 +51,7 @@ export class UnconnectedColorscalePicker extends Component {
4351

4452
UnconnectedColorscalePicker.propTypes = {
4553
fullValue: PropTypes.any,
54+
fullContainer: PropTypes.object,
4655
updatePlot: PropTypes.func,
4756
initialCategory: PropTypes.string,
4857
...Field.propTypes,
@@ -51,6 +60,7 @@ UnconnectedColorscalePicker.propTypes = {
5160
UnconnectedColorscalePicker.contextTypes = {
5261
container: PropTypes.object,
5362
graphDiv: PropTypes.object,
63+
onUpdate: PropTypes.func,
5464
};
5565

5666
export default connectToContainer(UnconnectedColorscalePicker);

0 commit comments

Comments
 (0)