{"action":"closed","issue":{"url":"https://api.github.com/repos/dnschneid/crouton/issues/2782","repository_url":"https://api.github.com/repos/dnschneid/crouton","labels_url":"https://api.github.com/repos/dnschneid/crouton/issues/2782/labels{/name}","comments_url":"https://api.github.com/repos/dnschneid/crouton/issues/2782/comments","events_url":"https://api.github.com/repos/dnschneid/crouton/issues/2782/events","html_url":"https://github.com/dnschneid/crouton/issues/2782","id":177813379,"number":2782,"title":"Coordinates of zoomed area highchart shiny R","user":{"login":"hmgs92","id":22299067,"avatar_url":"https://avatars.githubusercontent.com/u/22299067?v=3","gravatar_id":"","url":"https://api.github.com/users/hmgs92","html_url":"https://github.com/hmgs92","followers_url":"https://api.github.com/users/hmgs92/followers","following_url":"https://api.github.com/users/hmgs92/following{/other_user}","gists_url":"https://api.github.com/users/hmgs92/gists{/gist_id}","starred_url":"https://api.github.com/users/hmgs92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmgs92/subscriptions","organizations_url":"https://api.github.com/users/hmgs92/orgs","repos_url":"https://api.github.com/users/hmgs92/repos","events_url":"https://api.github.com/users/hmgs92/events{/privacy}","received_events_url":"https://api.github.com/users/hmgs92/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-19T15:15:45Z","updated_at":"2016-10-11T16:25:12Z","closed_at":"2016-10-11T16:25:12Z","body":"\r\nI have this scatter plot where I want to zoom in an area and then subset a table to show only the data from the subsetted points. The first step is done by zoomType = \"xy\", but I'm having troubles on the second step. Could anyone give me a hint on how can I access the upper left and bottom right points coordinates of the zoomed area, so I can subset the table?\r\n\r\nThank you!\r\n\r\n```\r\nlibrary(\"shiny\")\r\nlibrary(\"highcharter\")\r\n\r\nui <- shinyUI(\r\n  fluidPage(\r\n    column(width = 8, highchartOutput(\"hcontainer\", height = \"500px\")),\r\n    column(width = 4, textOutput(\"text\"))\r\n  )\r\n)\r\n\r\nserver <- function(input, output) {      \r\n\r\n\r\n  dscars <- round(mvrnorm(n = 20, mu = c(1, 1), Sigma = matrix(c(1,0,0,1),2)), 2)\r\n  dsplan <- round(mvrnorm(n = 10, mu = c(3, 4), Sigma = matrix(c(2,.5,2,2),2)), 2)\r\n  dstrck <- round(mvrnorm(n = 15, mu = c(5, 1), Sigma = matrix(c(1,.5,.5,1),2)), 2)\r\n\r\n  output$hcontainer <- renderHighchart({      \r\n\r\n    canvasClickFunction <- JS(\"function(event) {Shiny.onInputChange('canvasClicked', [this.name, event.point.category]);}\")\r\n    legendClickFunction <- JS(\"function(event) {Shiny.onInputChange('legendClicked', this.name);}\")\r\n\r\n    highchart() %>% \r\n      hc_chart(type = \"scatter\", zoomType = \"xy\") %>% \r\n      hc_tooltip(\r\n        useHTML = T,\r\n        enabled = F,\r\n        pointFormat = paste0(\"<span style=\\\"color:{series.color};\\\">{series.options.icon}</span>\",\r\n                             \"{series.name}: <b>[{point.x}, {point.y}]</b><br/>\")\r\n      ) %>% \r\n      hc_add_series(data = list.parse2(as.data.frame(dscars)),marker = list(symbol = fa_icon_mark(\"car\")),icon = fa_icon(\"car\"), name = \"car\") %>% \r\n      hc_add_series(data = list.parse2(as.data.frame(dsplan)),marker = list(symbol = fa_icon_mark(\"plane\")),icon = fa_icon(\"plane\"), name = \"plane\") %>% \r\n      hc_add_series(data = list.parse2(as.data.frame(dstrck)),marker = list(symbol = fa_icon_mark(\"truck\")),icon = fa_icon(\"truck\"), name = \"truck\") %>%\r\n      hc_plotOptions(series = list(stacking = FALSE, events = list(click = canvasClickFunction, legendItemClick = legendClickFunction))) \r\n\r\n\r\n  })      \r\n\r\n  makeReactiveBinding(\"outputText\")\r\n\r\n  observeEvent(input$canvasClicked, {\r\n    outputText <<- paste0(\"You clicked on series \", input$canvasClicked[1], \" and the bar you clicked was from category \", input$canvasClicked[2], \".\") \r\n  })\r\n\r\n  observeEvent(input$legendClicked, {\r\n    outputText <<- paste0(\"You clicked into the legend and selected series \", input$legendClicked, \".\")\r\n  })\r\n\r\n  output$text <- renderText({\r\n    outputText      \r\n  })\r\n}\r\n\r\nshinyApp(ui, server) \r\n```\r\n\r\n\r\n"}}
{"actor":{"display_login":"drinkcat"}}