Skip to content

Commit 85128db

Browse files
authored
Merge pull request #728 from nielsenmarkus11/nielsenmarkus11-patch-1
Add `source` argument to both the source plot and `event_data` function
2 parents 9bcee73 + a8f96a8 commit 85128db

File tree

1 file changed

+2
-2
lines changed
  • inst/examples/plotlyLinkedClick

1 file changed

+2
-2
lines changed

inst/examples/plotlyLinkedClick/app.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ui <- fluidPage(
1919
server <- function(input, output, session) {
2020
output$heat <- renderPlotly({
2121
plot_ly(x = nms, y = nms, z = correlation,
22-
key = correlation, type = "heatmap") %>%
22+
key = correlation, type = "heatmap", source = "heatplot") %>%
2323
layout(xaxis = list(title = ""),
2424
yaxis = list(title = ""))
2525
})
@@ -35,7 +35,7 @@ server <- function(input, output, session) {
3535
})
3636

3737
output$scatterplot <- renderPlotly({
38-
s <- event_data("plotly_click")
38+
s <- event_data("plotly_click", source = "heatplot")
3939
if (length(s)) {
4040
vars <- c(s[["x"]], s[["y"]])
4141
d <- setNames(mtcars[vars], c("x", "y"))

0 commit comments

Comments
 (0)