{"action":"closed","issue":{"url":"https://api.github.com/repos/DataKnowledge/visNetwork/issues/51","repository_url":"https://api.github.com/repos/DataKnowledge/visNetwork","labels_url":"https://api.github.com/repos/DataKnowledge/visNetwork/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/DataKnowledge/visNetwork/issues/51/comments","events_url":"https://api.github.com/repos/DataKnowledge/visNetwork/issues/51/events","html_url":"https://github.com/DataKnowledge/visNetwork/issues/51","id":132091761,"number":51,"title":"Specify variable node background colour and the border colour","user":{"login":"martinjhnhadley","id":9363263,"avatar_url":"https://avatars.githubusercontent.com/u/9363263?v=3","gravatar_id":"","url":"https://api.github.com/users/martinjhnhadley","html_url":"https://github.com/martinjhnhadley","followers_url":"https://api.github.com/users/martinjhnhadley/followers","following_url":"https://api.github.com/users/martinjhnhadley/following{/other_user}","gists_url":"https://api.github.com/users/martinjhnhadley/gists{/gist_id}","starred_url":"https://api.github.com/users/martinjhnhadley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinjhnhadley/subscriptions","organizations_url":"https://api.github.com/users/martinjhnhadley/orgs","repos_url":"https://api.github.com/users/martinjhnhadley/repos","events_url":"https://api.github.com/users/martinjhnhadley/events{/privacy}","received_events_url":"https://api.github.com/users/martinjhnhadley/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-08T09:35:52Z","updated_at":"2016-02-09T08:21:07Z","closed_at":"2016-02-09T08:21:07Z","body":"I would like to be able to vary the background colour of the nodes in my graph but use a border colour to ensure nicely delimitated nodes compared to edges.\r\n\r\nI thought that the following should work, but it does not:\r\n\r\n```r\r\nnodes <- data.frame(id = 1:3,\r\n                    color = c(\"lightblue\",\"red\",\"blue\"))\r\nedges <- data.frame(from = c(1,2), to = c(1,3))\r\nvisNetwork(nodes, edges) %>% visNodes(color = list(border = \"black\"))\r\n```\r\n\r\n![image](https://cloud.githubusercontent.com/assets/9363263/12882053/ac50d8c4-ce46-11e5-8118-3d3894e4af69.png)\r\n\r\nI tried providing a vector of colors directly to `visNodes` without success, indeed the colors are retained from the `data.frame` column `color`\r\n\r\n```r\r\nvisNetwork(nodes, edges) %>% visNodes(color = list(background = c(\"yellow\",\"pink\",\"blue\"), \r\nborder = \"black\"))\r\n```\r\n\r\n![image](https://cloud.githubusercontent.com/assets/9363263/12882089/0a92d360-ce47-11e5-9ddd-5efdcf019bc5.png)\r\n\r\nvisNetwork is a great package but is under queried on SE, I ask this question here in the Issues rather than SE because of that. I would like to take your feedback from here and post a self-answered question on SE to guide people there, if ok with you.\r\n"}}