{"action":"created","comment":{"url":"https://api.github.com/repos/weaveworks/scope/pulls/comments/37199144","id":37199144,"diff_hunk":"@@ -33,11 +33,12 @@ const (\n // rendered topology.\n type LeafMapFunc func(report.NodeMetadata) (RenderableNode, bool)\n \n-// PseudoFunc creates RenderableNode representing pseudo nodes given the dstNodeID.\n-// The srcNode renderable node is essentially from MapFunc, representing one of\n-// the rendered nodes this pseudo node refers to. srcNodeID and dstNodeID are\n-// node IDs prior to mapping.\n-type PseudoFunc func(srcNodeID string, srcNode RenderableNode, dstNodeID string, local report.Networks) (RenderableNode, bool)\n+// PseudoFunc creates RenderableNode representing pseudo nodes given the nodeID.\n+// dstNodeID is the node id of one of the nodes this node is attached to.\n+// nodeID and dstNodeID are node IDs prior to mapping.  isClient indicated the direction\n+// of the edge to dstNodeID - true indicates nodeID is the client, false indicates\n+// nodeID is the server.","path":"render/mapping.go","position":13,"original_position":13,"commit_id":"1ac93b2977e922327297585b94e2c846c84d9c38","original_commit_id":"1ac93b2977e922327297585b94e2c846c84d9c38","user":{"login":"peterbourgon","id":114509,"avatar_url":"https://avatars.githubusercontent.com/u/114509?v=3","gravatar_id":"","url":"https://api.github.com/users/peterbourgon","html_url":"https://github.com/peterbourgon","followers_url":"https://api.github.com/users/peterbourgon/followers","following_url":"https://api.github.com/users/peterbourgon/following{/other_user}","gists_url":"https://api.github.com/users/peterbourgon/gists{/gist_id}","starred_url":"https://api.github.com/users/peterbourgon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterbourgon/subscriptions","organizations_url":"https://api.github.com/users/peterbourgon/orgs","repos_url":"https://api.github.com/users/peterbourgon/repos","events_url":"https://api.github.com/users/peterbourgon/events{/privacy}","received_events_url":"https://api.github.com/users/peterbourgon/received_events","type":"User","site_admin":false},"body":"Cleanup...\r\n\r\n```go\r\n// PseudoFunc creates RenderableNode representing pseudo nodes given the\r\n// nodeID. dstNodeID is the node ID of one of the nodes this node is attached\r\n// to. nodeID and dstNodeID are node IDs prior to mapping. isClient indicates\r\n// the direction of the edge to dstNodeID: true indicates nodeID is the\r\n// client, false indicates nodeID is the server.\r\n```","created_at":"2015-08-17T15:23:51Z","updated_at":"2015-08-17T15:23:51Z","html_url":"https://github.com/weaveworks/scope/pull/355#discussion_r37199144","pull_request_url":"https://api.github.com/repos/weaveworks/scope/pulls/355","_links":{"self":{"href":"https://api.github.com/repos/weaveworks/scope/pulls/comments/37199144"},"html":{"href":"https://github.com/weaveworks/scope/pull/355#discussion_r37199144"},"pull_request":{"href":"https://api.github.com/repos/weaveworks/scope/pulls/355"}}},"pull_request":{"url":"https://api.github.com/repos/weaveworks/scope/pulls/355","id":42359342,"html_url":"https://github.com/weaveworks/scope/pull/355","diff_url":"https://github.com/weaveworks/scope/pull/355.diff","patch_url":"https://github.com/weaveworks/scope/pull/355.patch","issue_url":"https://api.github.com/repos/weaveworks/scope/issues/355","number":355,"state":"open","locked":false,"title":"Make edge direction flow from client->server.","user":{"login":"tomwilkie","id":444037,"avatar_url":"https://avatars.githubusercontent.com/u/444037?v=3","gravatar_id":"","url":"https://api.github.com/users/tomwilkie","html_url":"https://github.com/tomwilkie","followers_url":"https://api.github.com/users/tomwilkie/followers","following_url":"https://api.github.com/users/tomwilkie/following{/other_user}","gists_url":"https://api.github.com/users/tomwilkie/gists{/gist_id}","starred_url":"https://api.github.com/users/tomwilkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomwilkie/subscriptions","organizations_url":"https://api.github.com/users/tomwilkie/orgs","repos_url":"https://api.github.com/users/tomwilkie/repos","events_url":"https://api.github.com/users/tomwilkie/events{/privacy}","received_events_url":"https://api.github.com/users/tomwilkie/received_events","type":"User","site_admin":false},"body":"So it turns out the layout engine we use is already trying to layout the graph from top-to-bottom: https://github.com/cpettitt/dagre/wiki\r\n\r\nThis change uses a simple heuristic (client port is the higher port) to orient the edges in the graph such that they flow from client to server.\r\n\r\nIt somewhat improves the graph layout.  Before:\r\n\r\n![screen shot 2015-08-13 at 15 51 00](https://cloud.githubusercontent.com/assets/444037/9252953/243f4ca4-41d3-11e5-8536-a5a471e618fd.png)\r\n\r\nAfter:\r\n\r\n![screen shot 2015-08-13 at 15 49 45](https://cloud.githubusercontent.com/assets/444037/9252956/291100e2-41d3-11e5-9fa8-7d0fbb9805c2.png)\r\n\r\n\r\n","created_at":"2015-08-13T14:51:34Z","updated_at":"2015-08-17T15:23:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f461ba1e0dd8d2337cd0352177555d659d5548b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/weaveworks/scope/pulls/355/commits","review_comments_url":"https://api.github.com/repos/weaveworks/scope/pulls/355/comments","review_comment_url":"https://api.github.com/repos/weaveworks/scope/pulls/comments{/number}","comments_url":"https://api.github.com/repos/weaveworks/scope/issues/355/comments","statuses_url":"https://api.github.com/repos/weaveworks/scope/statuses/1ac93b2977e922327297585b94e2c846c84d9c38","head":{"label":"weaveworks:directionality","ref":"directionality","sha":"1ac93b2977e922327297585b94e2c846c84d9c38","user":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"repo":{"id":34659664,"name":"scope","full_name":"weaveworks/scope","owner":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/weaveworks/scope","description":"Container visibility","fork":false,"url":"https://api.github.com/repos/weaveworks/scope","forks_url":"https://api.github.com/repos/weaveworks/scope/forks","keys_url":"https://api.github.com/repos/weaveworks/scope/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weaveworks/scope/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weaveworks/scope/teams","hooks_url":"https://api.github.com/repos/weaveworks/scope/hooks","issue_events_url":"https://api.github.com/repos/weaveworks/scope/issues/events{/number}","events_url":"https://api.github.com/repos/weaveworks/scope/events","assignees_url":"https://api.github.com/repos/weaveworks/scope/assignees{/user}","branches_url":"https://api.github.com/repos/weaveworks/scope/branches{/branch}","tags_url":"https://api.github.com/repos/weaveworks/scope/tags","blobs_url":"https://api.github.com/repos/weaveworks/scope/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weaveworks/scope/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weaveworks/scope/git/refs{/sha}","trees_url":"https://api.github.com/repos/weaveworks/scope/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weaveworks/scope/statuses/{sha}","languages_url":"https://api.github.com/repos/weaveworks/scope/languages","stargazers_url":"https://api.github.com/repos/weaveworks/scope/stargazers","contributors_url":"https://api.github.com/repos/weaveworks/scope/contributors","subscribers_url":"https://api.github.com/repos/weaveworks/scope/subscribers","subscription_url":"https://api.github.com/repos/weaveworks/scope/subscription","commits_url":"https://api.github.com/repos/weaveworks/scope/commits{/sha}","git_commits_url":"https://api.github.com/repos/weaveworks/scope/git/commits{/sha}","comments_url":"https://api.github.com/repos/weaveworks/scope/comments{/number}","issue_comment_url":"https://api.github.com/repos/weaveworks/scope/issues/comments{/number}","contents_url":"https://api.github.com/repos/weaveworks/scope/contents/{+path}","compare_url":"https://api.github.com/repos/weaveworks/scope/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weaveworks/scope/merges","archive_url":"https://api.github.com/repos/weaveworks/scope/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weaveworks/scope/downloads","issues_url":"https://api.github.com/repos/weaveworks/scope/issues{/number}","pulls_url":"https://api.github.com/repos/weaveworks/scope/pulls{/number}","milestones_url":"https://api.github.com/repos/weaveworks/scope/milestones{/number}","notifications_url":"https://api.github.com/repos/weaveworks/scope/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weaveworks/scope/labels{/name}","releases_url":"https://api.github.com/repos/weaveworks/scope/releases{/id}","created_at":"2015-04-27T10:12:35Z","updated_at":"2015-08-14T23:55:02Z","pushed_at":"2015-08-17T15:13:43Z","git_url":"git://github.com/weaveworks/scope.git","ssh_url":"git@github.com:weaveworks/scope.git","clone_url":"https://github.com/weaveworks/scope.git","svn_url":"https://github.com/weaveworks/scope","homepage":"http://weave.works/scope","size":26446,"stargazers_count":344,"watchers_count":344,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":36,"forks":15,"open_issues":36,"watchers":344,"default_branch":"master"}},"base":{"label":"weaveworks:master","ref":"master","sha":"a2ec507a14d1da52f347a7fb7343190c2815c4ec","user":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"repo":{"id":34659664,"name":"scope","full_name":"weaveworks/scope","owner":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/weaveworks/scope","description":"Container visibility","fork":false,"url":"https://api.github.com/repos/weaveworks/scope","forks_url":"https://api.github.com/repos/weaveworks/scope/forks","keys_url":"https://api.github.com/repos/weaveworks/scope/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weaveworks/scope/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weaveworks/scope/teams","hooks_url":"https://api.github.com/repos/weaveworks/scope/hooks","issue_events_url":"https://api.github.com/repos/weaveworks/scope/issues/events{/number}","events_url":"https://api.github.com/repos/weaveworks/scope/events","assignees_url":"https://api.github.com/repos/weaveworks/scope/assignees{/user}","branches_url":"https://api.github.com/repos/weaveworks/scope/branches{/branch}","tags_url":"https://api.github.com/repos/weaveworks/scope/tags","blobs_url":"https://api.github.com/repos/weaveworks/scope/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weaveworks/scope/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weaveworks/scope/git/refs{/sha}","trees_url":"https://api.github.com/repos/weaveworks/scope/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weaveworks/scope/statuses/{sha}","languages_url":"https://api.github.com/repos/weaveworks/scope/languages","stargazers_url":"https://api.github.com/repos/weaveworks/scope/stargazers","contributors_url":"https://api.github.com/repos/weaveworks/scope/contributors","subscribers_url":"https://api.github.com/repos/weaveworks/scope/subscribers","subscription_url":"https://api.github.com/repos/weaveworks/scope/subscription","commits_url":"https://api.github.com/repos/weaveworks/scope/commits{/sha}","git_commits_url":"https://api.github.com/repos/weaveworks/scope/git/commits{/sha}","comments_url":"https://api.github.com/repos/weaveworks/scope/comments{/number}","issue_comment_url":"https://api.github.com/repos/weaveworks/scope/issues/comments{/number}","contents_url":"https://api.github.com/repos/weaveworks/scope/contents/{+path}","compare_url":"https://api.github.com/repos/weaveworks/scope/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weaveworks/scope/merges","archive_url":"https://api.github.com/repos/weaveworks/scope/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weaveworks/scope/downloads","issues_url":"https://api.github.com/repos/weaveworks/scope/issues{/number}","pulls_url":"https://api.github.com/repos/weaveworks/scope/pulls{/number}","milestones_url":"https://api.github.com/repos/weaveworks/scope/milestones{/number}","notifications_url":"https://api.github.com/repos/weaveworks/scope/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weaveworks/scope/labels{/name}","releases_url":"https://api.github.com/repos/weaveworks/scope/releases{/id}","created_at":"2015-04-27T10:12:35Z","updated_at":"2015-08-14T23:55:02Z","pushed_at":"2015-08-17T15:13:43Z","git_url":"git://github.com/weaveworks/scope.git","ssh_url":"git@github.com:weaveworks/scope.git","clone_url":"https://github.com/weaveworks/scope.git","svn_url":"https://github.com/weaveworks/scope","homepage":"http://weave.works/scope","size":26446,"stargazers_count":344,"watchers_count":344,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":36,"forks":15,"open_issues":36,"watchers":344,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/weaveworks/scope/pulls/355"},"html":{"href":"https://github.com/weaveworks/scope/pull/355"},"issue":{"href":"https://api.github.com/repos/weaveworks/scope/issues/355"},"comments":{"href":"https://api.github.com/repos/weaveworks/scope/issues/355/comments"},"review_comments":{"href":"https://api.github.com/repos/weaveworks/scope/pulls/355/comments"},"review_comment":{"href":"https://api.github.com/repos/weaveworks/scope/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/weaveworks/scope/pulls/355/commits"},"statuses":{"href":"https://api.github.com/repos/weaveworks/scope/statuses/1ac93b2977e922327297585b94e2c846c84d9c38"}}}}