Skip to content

Commit 281e9bf

Browse files
committed
Set mode to markers explicitly when adding a trace / correct delete trace payload error
1 parent 5cc424c commit 281e9bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PlotlyEditor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class PlotlyEditor extends Component {
9393
if (this.props.onAddTrace) {
9494
this.props.onAddTrace(payload);
9595
}
96-
graphDiv.data.push({x: [], y: [], type: 'scatter'});
96+
graphDiv.data.push({x: [], y: [], type: 'scatter', mode: 'markers'});
9797
if (this.props.onUpdate) {
9898
this.props.onUpdate();
9999
}
@@ -104,7 +104,7 @@ class PlotlyEditor extends Component {
104104
this.props.onDeleteTrace(payload);
105105
}
106106
if (payload.traceIndexes && payload.traceIndexes.length) {
107-
graphDiv.data.splice(payload[0], 1);
107+
graphDiv.data.splice(payload.traceIndexes[0], 1);
108108
if (this.props.onUpdate) {
109109
this.props.onUpdate();
110110
}

0 commit comments

Comments
 (0)