Skip to content

Commit

Permalink
Add support for new plotly_sunburstclick event, closes #1648
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert committed Nov 6, 2019
1 parent 290c8ef commit bcae42b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/shiny.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ event_data <- function(
"plotly_hover", "plotly_unhover", "plotly_click", "plotly_doubleclick",
"plotly_selected", "plotly_selecting", "plotly_brushed", "plotly_brushing",
"plotly_deselect", "plotly_relayout", "plotly_restyle", "plotly_legendclick",
"plotly_legenddoubleclick", "plotly_clickannotation", "plotly_afterplot"
"plotly_legenddoubleclick", "plotly_clickannotation", "plotly_afterplot",
"plotly_sunburstclick"
),
source = "A",
session = shiny::getDefaultReactiveDomain(),
Expand Down Expand Up @@ -252,7 +253,8 @@ shiny_event_defaults <- function() {
"plotly_clickannotation",
"plotly_doubleclick",
"plotly_deselect",
"plotly_afterplot"
"plotly_afterplot",
"plotly_sunburstclick"
)
}

Expand Down
1 change: 1 addition & 0 deletions inst/htmlwidgets/plotly.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ HTMLWidgets.widget({

var eventDataFunctionMap = {
plotly_click: eventDataWithKey,
plotly_sunburstclick: eventDataWithKey,
plotly_hover: eventDataWithKey,
plotly_unhover: eventDataWithKey,
// If 'plotly_selected' has already been fired, and you click
Expand Down

0 comments on commit bcae42b

Please sign in to comment.