{"action":"created","issue":{"url":"https://api.github.com/repos/tischi/HTM_Explorer/issues/22","repository_url":"https://api.github.com/repos/tischi/HTM_Explorer","labels_url":"https://api.github.com/repos/tischi/HTM_Explorer/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/tischi/HTM_Explorer/issues/22/comments","events_url":"https://api.github.com/repos/tischi/HTM_Explorer/issues/22/events","html_url":"https://github.com/tischi/HTM_Explorer/issues/22","id":168272847,"number":22,"title":"Image name from plot","user":{"login":"hmbotelho","id":7735703,"avatar_url":"https://avatars.githubusercontent.com/u/7735703?v=3","gravatar_id":"","url":"https://api.github.com/users/hmbotelho","html_url":"https://github.com/hmbotelho","followers_url":"https://api.github.com/users/hmbotelho/followers","following_url":"https://api.github.com/users/hmbotelho/following{/other_user}","gists_url":"https://api.github.com/users/hmbotelho/gists{/gist_id}","starred_url":"https://api.github.com/users/hmbotelho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmbotelho/subscriptions","organizations_url":"https://api.github.com/users/hmbotelho/orgs","repos_url":"https://api.github.com/users/hmbotelho/repos","events_url":"https://api.github.com/users/hmbotelho/events{/privacy}","received_events_url":"https://api.github.com/users/hmbotelho/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-29T08:11:46Z","updated_at":"2016-08-05T14:12:53Z","closed_at":null,"body":"In a plot: get the name of the image generating a point without clicking on it.\r\n\r\nTwo ways of doing this:\r\n- By hovering the mouse pointer over the point (which I believe requires a Shiny app)\r\n- A new \"click & list\" feature, whereby clicking a data point prints the treatment, Xcoordinate & Ycoordinate to the console. \r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/tischi/HTM_Explorer/issues/comments/237861068","html_url":"https://github.com/tischi/HTM_Explorer/issues/22#issuecomment-237861068","issue_url":"https://api.github.com/repos/tischi/HTM_Explorer/issues/22","id":237861068,"user":{"login":"tischi","id":2157566,"avatar_url":"https://avatars.githubusercontent.com/u/2157566?v=3","gravatar_id":"","url":"https://api.github.com/users/tischi","html_url":"https://github.com/tischi","followers_url":"https://api.github.com/users/tischi/followers","following_url":"https://api.github.com/users/tischi/following{/other_user}","gists_url":"https://api.github.com/users/tischi/gists{/gist_id}","starred_url":"https://api.github.com/users/tischi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tischi/subscriptions","organizations_url":"https://api.github.com/users/tischi/orgs","repos_url":"https://api.github.com/users/tischi/repos","events_url":"https://api.github.com/users/tischi/events{/privacy}","received_events_url":"https://api.github.com/users/tischi/received_events","type":"User","site_admin":false},"created_at":"2016-08-05T14:12:53Z","updated_at":"2016-08-05T14:12:53Z","body":"below code almosts does the job!\r\n\"just\" have to figure out how to pass the data table to the app.R, unless everything is handling from within the shiny app, which is probably anyway the nicer solution!\r\n\r\n```\r\n# save this file in a folder and call it app.R\r\n# launch it with print(source(\"../app.R\"))\r\n\r\ndata = iris\r\nfiji_binary = '/Applications/Fiji.app/Contents/MacOS/ImageJ-macosx -debug '\r\n\r\nlibrary(plotly)\r\nlibrary(shiny)\r\n\r\nserver <- function(input, output, session) {\r\n  \r\n  output$plot <- renderPlotly({\r\n    plot_ly(data = data, x = Sepal.Length, y = Petal.Length, mode = \"markers\") \r\n    layout(xaxis = list(title = \"\"), \r\n           yaxis = list(title = \"\"))\r\n  })\r\n\r\n  output$selection <- renderPrint({\r\n    s <- event_data(\"plotly_click\")\r\n    if (length(s) == 0) {\r\n      \"Click on a data point!\"\r\n    } else {\r\n      print(\"You selected:\")\r\n      print(s)\r\n      i = s[['pointNumber']]\r\n      print(data[i,])\r\n      print(\"Launching Fiji now....\")\r\n      system(fiji_binary,wait=F)\r\n    }\r\n  })\r\n\r\n}\r\n\r\nui <- fluidPage(\r\n  mainPanel(\r\n    plotlyOutput(\"plot\")\r\n  ),\r\n  verbatimTextOutput(\"selection\")\r\n)\r\n\r\n\r\nshinyApp(ui = ui, server = server)\r\n```"}}
{"actor":{"display_login":"tischi"}}