File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,13 @@ class EditorControls extends Component {
119119 this . props . beforeAddTrace ( payload ) ;
120120 }
121121
122- graphDiv . data . push ( this . props . useAsDefaultTrace ) ;
122+ // can't use default prop because plotly.js mutates it:
123+ // https://github.com/plotly/react-chart-editor/issues/509
124+ graphDiv . data . push (
125+ this . props . useAsDefaultTrace
126+ ? this . props . useAsDefaultTrace
127+ : { type : 'scatter' , mode : 'markers' }
128+ ) ;
123129
124130 if ( this . props . afterAddTrace ) {
125131 this . props . afterAddTrace ( payload ) ;
@@ -311,7 +317,6 @@ EditorControls.defaultProps = {
311317 traces : _ => traceTypes ( _ ) ,
312318 complex : true ,
313319 } ,
314- useAsDefaultTrace : { type : 'scatter' , mode : 'markers' } ,
315320} ;
316321
317322EditorControls . childContextTypes = {
You can’t perform that action at this time.
0 commit comments