Skip to content

Commit 76a9c93

Browse files
committed
'input_*' wildcard can now accept any type
1 parent 0b6f93b commit 76a9c93

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

inst/htmlwidgets/plotly.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,19 +305,16 @@ HTMLWidgets.widget({
305305
// TODO: make this more consistent with Graph() props?
306306
if (instance.setProps) {
307307
graphDiv.on('plotly_relayout', function(d) {
308-
instance.setProps({"input_plotly_relayout": JSON.stringify(d) });
308+
instance.setProps({"input_plotly_relayout": d});
309309
});
310310
graphDiv.on('plotly_hover', function(d) {
311-
var val = JSON.stringify(eventDataWithKey(d));
312-
instance.setProps({"input_plotly_hover": val});
311+
instance.setProps({"input_plotly_hover": eventDataWithKey(d)});
313312
});
314313
graphDiv.on('plotly_click', function(d) {
315-
var val = JSON.stringify(eventDataWithKey(d));
316-
instance.setProps({"input_plotly_click": val});
314+
instance.setProps({"input_plotly_click": eventDataWithKey(d)});
317315
});
318316
graphDiv.on('plotly_selected', function(d) {
319-
var val = JSON.stringify(eventDataWithKey(d));
320-
instance.setProps({"input_plotly_selected": val});
317+
instance.setProps({"input_plotly_selected": eventDataWithKey(d)});
321318
});
322319
graphDiv.on('plotly_unhover', function(eventData) {
323320
instance.setProps({"input_plotly_hover": null});

0 commit comments

Comments
 (0)