{"action":"created","comment":{"url":"https://api.github.com/repos/hybsearch/hybsearch/pulls/comments/172732913","pull_request_review_id":101798466,"id":172732913,"diff_hunk":"@@ -122,19 +124,61 @@ function findOutliers(objs, whitelist, found = []) {\n \treturn found\n }\n \n-function onNodeClicked(data) {\n-\tconsole.log('Clicked on node point with data:', data)\n-\n-\tlet outliers = findOutliers(data.branchset, getWhitelist())\n-\tconsole.log('Outliers found:', outliers)\n+function ToggleMuteLeaves(doMute){\n+\tvar nodes = document.querySelectorAll(\".node.leaf\")\n+\tnodesMuted = doMute\n+\tfor(var i=0;i<nodes.length;i++){\n+\t\tvar node = nodes[i];\n+\t\tvar isMuted = node.className.baseVal.indexOf(\"muted\") != -1;\n+\t\tif(doMute && !isMuted){\n+\t\t\tnode.className.baseVal += \" muted\"\n+\t\t}\n+\t\tif(!doMute && isMuted){\n+\t\t\tnode.className.baseVal = node.className.baseVal.replace(\"muted\",\"\")\n+\t\t}\n+\t\t\n+\t}\n+}\n \n-\toutliers.forEach(outlier =>\n-\t\tdocument.getElementById(outlier).setAttribute('fill', 'green')\n-\t)\n+function onNodeClicked(data) {\n+\tif(data.name == \"\" || nmResults == undefined)\n+\t\treturn; // We don't care about anything that's not a leaf node\n+\t// Find the other individual that is nonmonophyletic with this one\n+\tvar nonmono_pair;\n+\tfor(var i=0;i<nmResults.nm.length;i++){\n+\t\tvar pair = nmResults.nm[i];\n+\t\tif(pair[0].ident == data.ident){\n+\t\t\tnonmono_pair = pair[1];\n+\t\t\tbreak;\n+\t\t}\n+\t\tif(pair[1].ident == data.ident){\n+\t\t\tnonmono_pair = pair[0];\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\t// Now let's toggle the non-mono pair green if one was found\n+\n+\tif(nonmono_pair){\n+\t\t// If it's already muted, toggle all off \n+\t\tvar nodeSVG = document.querySelector(\"[data-ident='\"+data.ident+\"']\")\n+\t\tvar pairSVG = document.querySelector(\"[data-ident='\"+nonmono_pair.ident+\"']\")","path":"electron/graph.js","position":58,"original_position":58,"commit_id":"ab4f6215e2667ab4c302715802ad29241afdf3a3","original_commit_id":"ab4f6215e2667ab4c302715802ad29241afdf3a3","user":{"login":"hawkrives","id":464441,"avatar_url":"https://avatars0.githubusercontent.com/u/464441?v=4","gravatar_id":"","url":"https://api.github.com/users/hawkrives","html_url":"https://github.com/hawkrives","followers_url":"https://api.github.com/users/hawkrives/followers","following_url":"https://api.github.com/users/hawkrives/following{/other_user}","gists_url":"https://api.github.com/users/hawkrives/gists{/gist_id}","starred_url":"https://api.github.com/users/hawkrives/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hawkrives/subscriptions","organizations_url":"https://api.github.com/users/hawkrives/orgs","repos_url":"https://api.github.com/users/hawkrives/repos","events_url":"https://api.github.com/users/hawkrives/events{/privacy}","received_events_url":"https://api.github.com/users/hawkrives/received_events","type":"User","site_admin":false},"body":"Use a template string here, please: \r\n\r\n```js\r\ndocument.querySelector(`[data-ident='${nonmono_pair.ident}']`)\r\n```","created_at":"2018-03-07T03:29:56Z","updated_at":"2018-03-07T03:36:11Z","html_url":"https://github.com/hybsearch/hybsearch/pull/48#discussion_r172732913","pull_request_url":"https://api.github.com/repos/hybsearch/hybsearch/pulls/48","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/hybsearch/hybsearch/pulls/comments/172732913"},"html":{"href":"https://github.com/hybsearch/hybsearch/pull/48#discussion_r172732913"},"pull_request":{"href":"https://api.github.com/repos/hybsearch/hybsearch/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/hybsearch/hybsearch/pulls/48","id":173342585,"html_url":"https://github.com/hybsearch/hybsearch/pull/48","diff_url":"https://github.com/hybsearch/hybsearch/pull/48.diff","patch_url":"https://github.com/hybsearch/hybsearch/pull/48.patch","issue_url":"https://api.github.com/repos/hybsearch/hybsearch/issues/48","number":48,"state":"open","locked":false,"title":"Clicking a node highlights its nonmonophylic pair","user":{"login":"OmarShehata","id":1711126,"avatar_url":"https://avatars0.githubusercontent.com/u/1711126?v=4","gravatar_id":"","url":"https://api.github.com/users/OmarShehata","html_url":"https://github.com/OmarShehata","followers_url":"https://api.github.com/users/OmarShehata/followers","following_url":"https://api.github.com/users/OmarShehata/following{/other_user}","gists_url":"https://api.github.com/users/OmarShehata/gists{/gist_id}","starred_url":"https://api.github.com/users/OmarShehata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OmarShehata/subscriptions","organizations_url":"https://api.github.com/users/OmarShehata/orgs","repos_url":"https://api.github.com/users/OmarShehata/repos","events_url":"https://api.github.com/users/OmarShehata/events{/privacy}","received_events_url":"https://api.github.com/users/OmarShehata/received_events","type":"User","site_admin":false},"body":"This fixes #42 by refactoring what clicking does. The old code was throwing an error because it was attempting to get input from an html input field that no longer exist.\r\n\r\nThe new behavior accepts clicks on any leaf node, and will pop up an alert telling you its pair. It will also set all other nodes except for the pair to opacity 0.2 so that it is visually easy to find the pair. Clicking again will reset everything to opacity 1 (clicking on a blue dot will also set opacity to 1). \r\n\r\nI would personally prefer to chuck the alert and just have it toggle the opacity, but I'm keeping it for now in case the biologists' use case is more about just getting the number than seeing it in the tree. ","created_at":"2018-03-07T03:17:02Z","updated_at":"2018-03-07T03:36:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f87d7f42ed1a7739575b165ca167ee8ed413e9c7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hybsearch/hybsearch/pulls/48/commits","review_comments_url":"https://api.github.com/repos/hybsearch/hybsearch/pulls/48/comments","review_comment_url":"https://api.github.com/repos/hybsearch/hybsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hybsearch/hybsearch/issues/48/comments","statuses_url":"https://api.github.com/repos/hybsearch/hybsearch/statuses/ab4f6215e2667ab4c302715802ad29241afdf3a3","head":{"label":"hybsearch:fixing-node-click","ref":"fixing-node-click","sha":"ab4f6215e2667ab4c302715802ad29241afdf3a3","user":{"login":"hybsearch","id":36679323,"avatar_url":"https://avatars0.githubusercontent.com/u/36679323?v=4","gravatar_id":"","url":"https://api.github.com/users/hybsearch","html_url":"https://github.com/hybsearch","followers_url":"https://api.github.com/users/hybsearch/followers","following_url":"https://api.github.com/users/hybsearch/following{/other_user}","gists_url":"https://api.github.com/users/hybsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/hybsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hybsearch/subscriptions","organizations_url":"https://api.github.com/users/hybsearch/orgs","repos_url":"https://api.github.com/users/hybsearch/repos","events_url":"https://api.github.com/users/hybsearch/events{/privacy}","received_events_url":"https://api.github.com/users/hybsearch/received_events","type":"Organization","site_admin":false},"repo":{"id":58569358,"name":"hybsearch","full_name":"hybsearch/hybsearch","owner":{"login":"hybsearch","id":36679323,"avatar_url":"https://avatars0.githubusercontent.com/u/36679323?v=4","gravatar_id":"","url":"https://api.github.com/users/hybsearch","html_url":"https://github.com/hybsearch","followers_url":"https://api.github.com/users/hybsearch/followers","following_url":"https://api.github.com/users/hybsearch/following{/other_user}","gists_url":"https://api.github.com/users/hybsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/hybsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hybsearch/subscriptions","organizations_url":"https://api.github.com/users/hybsearch/orgs","repos_url":"https://api.github.com/users/hybsearch/repos","events_url":"https://api.github.com/users/hybsearch/events{/privacy}","received_events_url":"https://api.github.com/users/hybsearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hybsearch/hybsearch","description":"Find nonmonophyly in phylogenetic trees by looking for ILS and unexpected hybridization","fork":false,"url":"https://api.github.com/repos/hybsearch/hybsearch","forks_url":"https://api.github.com/repos/hybsearch/hybsearch/forks","keys_url":"https://api.github.com/repos/hybsearch/hybsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hybsearch/hybsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hybsearch/hybsearch/teams","hooks_url":"https://api.github.com/repos/hybsearch/hybsearch/hooks","issue_events_url":"https://api.github.com/repos/hybsearch/hybsearch/issues/events{/number}","events_url":"https://api.github.com/repos/hybsearch/hybsearch/events","assignees_url":"https://api.github.com/repos/hybsearch/hybsearch/assignees{/user}","branches_url":"https://api.github.com/repos/hybsearch/hybsearch/branches{/branch}","tags_url":"https://api.github.com/repos/hybsearch/hybsearch/tags","blobs_url":"https://api.github.com/repos/hybsearch/hybsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hybsearch/hybsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hybsearch/hybsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/hybsearch/hybsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hybsearch/hybsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/hybsearch/hybsearch/languages","stargazers_url":"https://api.github.com/repos/hybsearch/hybsearch/stargazers","contributors_url":"https://api.github.com/repos/hybsearch/hybsearch/contributors","subscribers_url":"https://api.github.com/repos/hybsearch/hybsearch/subscribers","subscription_url":"https://api.github.com/repos/hybsearch/hybsearch/subscription","commits_url":"https://api.github.com/repos/hybsearch/hybsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/hybsearch/hybsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/hybsearch/hybsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/hybsearch/hybsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/hybsearch/hybsearch/contents/{+path}","compare_url":"https://api.github.com/repos/hybsearch/hybsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hybsearch/hybsearch/merges","archive_url":"https://api.github.com/repos/hybsearch/hybsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hybsearch/hybsearch/downloads","issues_url":"https://api.github.com/repos/hybsearch/hybsearch/issues{/number}","pulls_url":"https://api.github.com/repos/hybsearch/hybsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/hybsearch/hybsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/hybsearch/hybsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hybsearch/hybsearch/labels{/name}","releases_url":"https://api.github.com/repos/hybsearch/hybsearch/releases{/id}","deployments_url":"https://api.github.com/repos/hybsearch/hybsearch/deployments","created_at":"2016-05-11T18:14:05Z","updated_at":"2018-02-20T22:19:38Z","pushed_at":"2018-03-07T03:17:03Z","git_url":"git://github.com/hybsearch/hybsearch.git","ssh_url":"git@github.com:hybsearch/hybsearch.git","clone_url":"https://github.com/hybsearch/hybsearch.git","svn_url":"https://github.com/hybsearch/hybsearch","homepage":"https://hybsearch.github.io","size":100164,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":1,"open_issues":11,"watchers":1,"default_branch":"master"}},"base":{"label":"hybsearch:master","ref":"master","sha":"c4a472a200d40a4e9edab96e17fb5f6a74f1a4ab","user":{"login":"hybsearch","id":36679323,"avatar_url":"https://avatars0.githubusercontent.com/u/36679323?v=4","gravatar_id":"","url":"https://api.github.com/users/hybsearch","html_url":"https://github.com/hybsearch","followers_url":"https://api.github.com/users/hybsearch/followers","following_url":"https://api.github.com/users/hybsearch/following{/other_user}","gists_url":"https://api.github.com/users/hybsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/hybsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hybsearch/subscriptions","organizations_url":"https://api.github.com/users/hybsearch/orgs","repos_url":"https://api.github.com/users/hybsearch/repos","events_url":"https://api.github.com/users/hybsearch/events{/privacy}","received_events_url":"https://api.github.com/users/hybsearch/received_events","type":"Organization","site_admin":false},"repo":{"id":58569358,"name":"hybsearch","full_name":"hybsearch/hybsearch","owner":{"login":"hybsearch","id":36679323,"avatar_url":"https://avatars0.githubusercontent.com/u/36679323?v=4","gravatar_id":"","url":"https://api.github.com/users/hybsearch","html_url":"https://github.com/hybsearch","followers_url":"https://api.github.com/users/hybsearch/followers","following_url":"https://api.github.com/users/hybsearch/following{/other_user}","gists_url":"https://api.github.com/users/hybsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/hybsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hybsearch/subscriptions","organizations_url":"https://api.github.com/users/hybsearch/orgs","repos_url":"https://api.github.com/users/hybsearch/repos","events_url":"https://api.github.com/users/hybsearch/events{/privacy}","received_events_url":"https://api.github.com/users/hybsearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hybsearch/hybsearch","description":"Find nonmonophyly in phylogenetic trees by looking for ILS and unexpected hybridization","fork":false,"url":"https://api.github.com/repos/hybsearch/hybsearch","forks_url":"https://api.github.com/repos/hybsearch/hybsearch/forks","keys_url":"https://api.github.com/repos/hybsearch/hybsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hybsearch/hybsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hybsearch/hybsearch/teams","hooks_url":"https://api.github.com/repos/hybsearch/hybsearch/hooks","issue_events_url":"https://api.github.com/repos/hybsearch/hybsearch/issues/events{/number}","events_url":"https://api.github.com/repos/hybsearch/hybsearch/events","assignees_url":"https://api.github.com/repos/hybsearch/hybsearch/assignees{/user}","branches_url":"https://api.github.com/repos/hybsearch/hybsearch/branches{/branch}","tags_url":"https://api.github.com/repos/hybsearch/hybsearch/tags","blobs_url":"https://api.github.com/repos/hybsearch/hybsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hybsearch/hybsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hybsearch/hybsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/hybsearch/hybsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hybsearch/hybsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/hybsearch/hybsearch/languages","stargazers_url":"https://api.github.com/repos/hybsearch/hybsearch/stargazers","contributors_url":"https://api.github.com/repos/hybsearch/hybsearch/contributors","subscribers_url":"https://api.github.com/repos/hybsearch/hybsearch/subscribers","subscription_url":"https://api.github.com/repos/hybsearch/hybsearch/subscription","commits_url":"https://api.github.com/repos/hybsearch/hybsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/hybsearch/hybsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/hybsearch/hybsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/hybsearch/hybsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/hybsearch/hybsearch/contents/{+path}","compare_url":"https://api.github.com/repos/hybsearch/hybsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hybsearch/hybsearch/merges","archive_url":"https://api.github.com/repos/hybsearch/hybsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hybsearch/hybsearch/downloads","issues_url":"https://api.github.com/repos/hybsearch/hybsearch/issues{/number}","pulls_url":"https://api.github.com/repos/hybsearch/hybsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/hybsearch/hybsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/hybsearch/hybsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hybsearch/hybsearch/labels{/name}","releases_url":"https://api.github.com/repos/hybsearch/hybsearch/releases{/id}","deployments_url":"https://api.github.com/repos/hybsearch/hybsearch/deployments","created_at":"2016-05-11T18:14:05Z","updated_at":"2018-02-20T22:19:38Z","pushed_at":"2018-03-07T03:17:03Z","git_url":"git://github.com/hybsearch/hybsearch.git","ssh_url":"git@github.com:hybsearch/hybsearch.git","clone_url":"https://github.com/hybsearch/hybsearch.git","svn_url":"https://github.com/hybsearch/hybsearch","homepage":"https://hybsearch.github.io","size":100164,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":1,"open_issues":11,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hybsearch/hybsearch/pulls/48"},"html":{"href":"https://github.com/hybsearch/hybsearch/pull/48"},"issue":{"href":"https://api.github.com/repos/hybsearch/hybsearch/issues/48"},"comments":{"href":"https://api.github.com/repos/hybsearch/hybsearch/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/hybsearch/hybsearch/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/hybsearch/hybsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hybsearch/hybsearch/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/hybsearch/hybsearch/statuses/ab4f6215e2667ab4c302715802ad29241afdf3a3"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"hawkrives"}}