Skip to content

Commit

Permalink
Merge pull request #728 from nielsenmarkus11/nielsenmarkus11-patch-1
Browse files Browse the repository at this point in the history
Add `source` argument to both the source plot and `event_data` function
  • Loading branch information
cpsievert authored Sep 26, 2016
2 parents 9bcee73 + a8f96a8 commit 85128db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inst/examples/plotlyLinkedClick/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ui <- fluidPage(
server <- function(input, output, session) {
output$heat <- renderPlotly({
plot_ly(x = nms, y = nms, z = correlation,
key = correlation, type = "heatmap") %>%
key = correlation, type = "heatmap", source = "heatplot") %>%
layout(xaxis = list(title = ""),
yaxis = list(title = ""))
})
Expand All @@ -35,7 +35,7 @@ server <- function(input, output, session) {
})

output$scatterplot <- renderPlotly({
s <- event_data("plotly_click")
s <- event_data("plotly_click", source = "heatplot")
if (length(s)) {
vars <- c(s[["x"]], s[["y"]])
d <- setNames(mtcars[vars], c("x", "y"))
Expand Down

0 comments on commit 85128db

Please sign in to comment.