Skip to content

Commit f9ec66e

Browse files
committed
Add call to updatePlot in componentWillReceiveProps
1 parent 0613066 commit f9ec66e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/components/fields/TraceSelector.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ class TraceSelector extends Component {
7575
}
7676

7777
componentWillReceiveProps(nextProps, nextContext) {
78+
if (
79+
!nextProps.container.type ||
80+
(nextProps.container.type === 'scatter' && !nextProps.container.mode)
81+
) {
82+
this.updatePlot({type: 'scatter', mode: 'lines+markers'});
83+
}
7884
this.setLocals(nextProps, nextContext);
7985
}
8086

src/lib/customTraceType.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export function plotlyTraceToCustomTrace(trace) {
1212
(!trace.mode || trace.mode === 'lines' || trace.mode === 'lines+markers')
1313
) {
1414
return 'line';
15+
} else if (!trace.type) {
16+
return 'line';
1517
}
1618
return trace.type;
1719
}

0 commit comments

Comments
 (0)