Skip to content

Commit 57cf739

Browse files
Added attachListeners call back to draw method
1 parent 9fb045f commit 57cf739

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as React from 'react';
33

44
export interface IPlotlyChartProps {
55
config?: plotly.Config;
6-
data: Partial<plotly.ScatterData>[]
6+
data: Partial<plotly.ScatterData>[];
77
layout?: plotly.Layout;
88
onClick?: (event: plotly.PlotMouseEvent) => void;
99
onBeforeHover?: (event: plotly.PlotMouseEvent) => void;
@@ -48,6 +48,7 @@ class PlotlyChart extends React.Component<IPlotlyChartProps, any> {
4848
if (this.container) {
4949
// plotly.react will not destroy the old plot: https://plot.ly/javascript/plotlyjs-function-reference/#plotlyreact
5050
this.container = await plotly.react(this.container, data, Object.assign({}, layout), config);
51+
this.attachListeners();
5152
}
5253
};
5354

0 commit comments

Comments
 (0)