{"action":"created","issue":{"url":"https://api.github.com/repos/datastorm-open/visNetwork/issues/129","repository_url":"https://api.github.com/repos/datastorm-open/visNetwork","labels_url":"https://api.github.com/repos/datastorm-open/visNetwork/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/datastorm-open/visNetwork/issues/129/comments","events_url":"https://api.github.com/repos/datastorm-open/visNetwork/issues/129/events","html_url":"https://github.com/datastorm-open/visNetwork/issues/129","id":195195420,"number":129,"title":"question:  visSetSelection for multiple edges (“group” of edges?)","user":{"login":"ZedLeb","id":8373677,"avatar_url":"https://avatars.githubusercontent.com/u/8373677?v=3","gravatar_id":"","url":"https://api.github.com/users/ZedLeb","html_url":"https://github.com/ZedLeb","followers_url":"https://api.github.com/users/ZedLeb/followers","following_url":"https://api.github.com/users/ZedLeb/following{/other_user}","gists_url":"https://api.github.com/users/ZedLeb/gists{/gist_id}","starred_url":"https://api.github.com/users/ZedLeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZedLeb/subscriptions","organizations_url":"https://api.github.com/users/ZedLeb/orgs","repos_url":"https://api.github.com/users/ZedLeb/repos","events_url":"https://api.github.com/users/ZedLeb/events{/privacy}","received_events_url":"https://api.github.com/users/ZedLeb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-13T08:57:36Z","updated_at":"2016-12-14T13:28:30Z","closed_at":null,"body":"I have tried to emulate this original example code for selecting multiple edges\r\n```\r\nobserve({\r\n  nodes_selection <- input$selnodes\r\n  edges_selection <- input$seledges\r\n  visNetworkProxy(\"network_proxy_select\") %>%\r\n    visSetSelection(nodesId = nodes_selection, edgesId = edges_selection)\r\n})\r\n```\r\nwhich works exactly as expected when I run it.\r\n\r\nI am building a `visNetwork` of all the systems that we use in our company and their (data) interactions.  I want to be able to demonstrate that a data input in one system can impact other systems.  One way we want to do this is by picking a ‘theme’ of data such as a change to a mould used in the factory (currently affecting at least five different systems).\r\n\r\nThere is a column in my edge dataframe for theme.  Each edge also has an ID - as I thought that would be necessary when when we pick a theme.\r\n\r\nMy code below currently picks the IDs but I did try a version of `selectInput` that uses `choices = edges$theme` - which correctly displays the theme choice but I’m stuck at translating this choice into a filtered list of IDs.\r\n\r\nSo - my problem is twofold:\r\n\r\n1. **When I run my version of the original code – my edges are not selected (they are not highlighted) – is there any clue why my code doesn’t do the same as the original?**\r\n2. **I actually want my user to be able to select a ‘Theme’ from the input box which then translates to a number of IDs – all of which I want to be shown as selected.  I think this is like a group but for edges.  Can anyone tell me if this is possible?**\r\n\r\n**My UI function**\r\n```\r\nui <- fluidPage(\r\n  \r\n  sidebarLayout(\r\n    sidebarPanel(\r\n      selectInput(inputId = \"seledges\", label = \"Theme\", choices = edges$ID, multiple = TRUE)\r\n    ),\r\n    mainPanel(visNetworkOutput(\"network_proxy_select\"))\r\n  )\r\n  \r\n)\r\n\r\n```\r\n\r\n**My server function**\r\n```\r\nserver <- function(input, output) {\r\n  output$network_proxy_select <- renderVisNetwork({\r\n\r\n  \r\n    visNetwork(nodes, edges, height = \"100%\", width = \"100%\") %>%\r\n      visOptions(highlightNearest = TRUE) %>%\r\n      visLayout(randomSeed = 123)\r\n  })\r\n  \r\n\r\n   observe({\r\n\r\n     nodes_selection <- input$selnodes\r\n     edges_selection <- input$seledges\r\n\r\n     visNetworkProxy(\"network_proxy_select\") %>%\r\n       visSetSelection(nodesId = nodes_selection, edgesId = edges_selection)\r\n  })\r\n  \r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/datastorm-open/visNetwork/issues/comments/267033508","html_url":"https://github.com/datastorm-open/visNetwork/issues/129#issuecomment-267033508","issue_url":"https://api.github.com/repos/datastorm-open/visNetwork/issues/129","id":267033508,"user":{"login":"ZedLeb","id":8373677,"avatar_url":"https://avatars.githubusercontent.com/u/8373677?v=3","gravatar_id":"","url":"https://api.github.com/users/ZedLeb","html_url":"https://github.com/ZedLeb","followers_url":"https://api.github.com/users/ZedLeb/followers","following_url":"https://api.github.com/users/ZedLeb/following{/other_user}","gists_url":"https://api.github.com/users/ZedLeb/gists{/gist_id}","starred_url":"https://api.github.com/users/ZedLeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZedLeb/subscriptions","organizations_url":"https://api.github.com/users/ZedLeb/orgs","repos_url":"https://api.github.com/users/ZedLeb/repos","events_url":"https://api.github.com/users/ZedLeb/events{/privacy}","received_events_url":"https://api.github.com/users/ZedLeb/received_events","type":"User","site_admin":false},"created_at":"2016-12-14T13:28:30Z","updated_at":"2016-12-14T13:28:30Z","body":"Leave an idiot alone long enough....I've answered my first problem - I was using `ID` instead of `id` \r\n\r\n`visSelectEdges(id = edges_selection)`\r\n\r\nOnly took 24 hours to work that out!!  I can now replicate the original code and select multiple IDs - sorry ids :) in my Shiny app\r\n\r\nHowever, I'm still battling with the other problem of needing to select a group of multiple IDs by a shared theme...\r\n\r\nUsing this sort of filter \r\n\r\n```\r\n    edges_selection <- edges %>%\r\n     filter(str_detect(theme, edges_input)) %>%\r\n     select(id) %>%\r\n     .$id\r\n```\r\nhaving used `edges$theme `as my `choice `in `selectInput`"}}
{"actor":{"display_login":"ZedLeb"}}