Skip to content

Commit 532eb56

Browse files
committed
setProps is now attached to el (since some packages don't make use of instance)
1 parent cb29441 commit 532eb56

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

inst/htmlwidgets/plotly.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -303,29 +303,29 @@ HTMLWidgets.widget({
303303

304304
// send user input event data to dashR
305305
// TODO: make this more consistent with Graph() props?
306-
if (typeof instance.setProps === "function") {
306+
if (typeof el.setProps === "function") {
307307
graphDiv.on('plotly_relayout', function(d) {
308-
instance.setProps({"input_plotly_relayout": d});
308+
el.setProps({"input_plotly_relayout": d});
309309
});
310310
graphDiv.on('plotly_hover', function(d) {
311-
instance.setProps({"input_plotly_hover": eventDataWithKey(d)});
311+
el.setProps({"input_plotly_hover": eventDataWithKey(d)});
312312
});
313313
graphDiv.on('plotly_click', function(d) {
314-
instance.setProps({"input_plotly_click": eventDataWithKey(d)});
314+
el.setProps({"input_plotly_click": eventDataWithKey(d)});
315315
});
316316
graphDiv.on('plotly_selected', function(d) {
317-
instance.setProps({"input_plotly_selected": eventDataWithKey(d)});
317+
el.setProps({"input_plotly_selected": eventDataWithKey(d)});
318318
});
319319
graphDiv.on('plotly_unhover', function(eventData) {
320-
instance.setProps({"input_plotly_hover": null});
320+
el.setProps({"input_plotly_hover": null});
321321
});
322322
graphDiv.on('plotly_doubleclick', function(eventData) {
323-
instance.setProps({"input_plotly_click": null});
323+
el.setProps({"input_plotly_click": null});
324324
});
325325
// 'plotly_deselect' is code for doubleclick when in select mode
326326
graphDiv.on('plotly_deselect', function(eventData) {
327-
instance.setProps({"input_plotly_selected": null});
328-
instance.setProps({"input_plotly_click": null});
327+
el.setProps({"input_plotly_selected": null});
328+
el.setProps({"input_plotly_click": null});
329329
});
330330
}
331331

0 commit comments

Comments
 (0)