{"action":"created","comment":{"url":"https://api.github.com/repos/twosigma/goll-e/pulls/comments/24127597","id":24127597,"diff_hunk":"@@ -0,0 +1,79 @@\n+/**\r\n+ * port.js\r\n+ *\r\n+ * Definition for the Port class. Ports are the points on a Node where\r\n+ * connections attach to or from the node. They can be either inputs\r\n+ * or outputs.\r\n+ */\r\n+\r\n+/**\r\n+ * Constructor function.\r\n+ *\r\n+ * @param id - The Port's unique identifier.\r\n+ * @param type - The type of port. Valid options include \"input\" or \"output\".\r\n+ */\r\n+var Port = function(id,type) {\r\n+\tthis.id = id || 0;\r\n+\tthis.x = 0;\r\n+\tthis.y = 0;\r\n+\tthis.type = type;\r\n+};\r\n+\r\n+/**\r\n+ * Getter method for the id property.\r\n+ */\r\n+Port.prototype.getID = function() {\r\n+\treturn this.id;\r\n+};\r\n+\r\n+/**\r\n+* Function to change the position description of the port in the node from the \r\n+* defined language to a coordinate plane.\r\n+*\r\n+* @param cardinal - cardinal direction in which the port is located (N,S,E,W).\r\n+* @param percentage - percentage of the way the port is located in a given cardinal direction.\r\n+*/\r\n+Port.prototype.cardinalToCoordinate = function(cardinal,percentage) {\r\n+\tif(cardinal == \"N\"){\r\n+\t\tthis.y = 100;\r\n+\t\tthis.x = percentage;\r\n+\t}\r\n+\tif(cardinal == \"S\"){\r\n+\t\tthis.y = 0;\r\n+\t\tthis.x = precentage;\r\n+\t}\r\n+\tif(cardinal == \"E\"){\r\n+\t\tthis.x = 100;\r\n+\t\tthis.y = percentage;\r\n+\t}\r\n+\tif(cardinal == \"W\"){\r\n+\t\tthis.x = 0;\r\n+\t\tthis.y = percentage;\r\n+\t}\r\n+};\r\n+\r\n+/**\r\n+ * Getter method for returning an xy-coordinate pair representing the Port's\r\n+ * position in 2D space.\r\n+ */\r\n+Port.prototype.getPos = function() {\r\n+\treturn [this.x,this.y];\r\n+};\r\n+\r\n+/**\r\n+ * Setter method for an xy-coordinate pair representing the Port's\r\n+ * position in 2D space.\r\n+ */\r\n+Port.prototype.setPos = function(x,y) {\r\n+\tthis.x = x;\r\n+\tthis.y = y;\r\n+};\r\n+/**\r\n+ * Getter method for the type property.\r\n+ */\r\n+Port.prototype.getType = function() {\r\n+\treturn this.type;\r","path":"lib/model/port.js","position":56,"original_position":75,"commit_id":"31ae0b147c92e560216db36356ac392153b600aa","original_commit_id":"9ed4c1e633304f6551bb63df1669cf813daf30ba","user":{"login":"salva-abate","id":1589075,"avatar_url":"https://avatars.githubusercontent.com/u/1589075?v=3","gravatar_id":"","url":"https://api.github.com/users/salva-abate","html_url":"https://github.com/salva-abate","followers_url":"https://api.github.com/users/salva-abate/followers","following_url":"https://api.github.com/users/salva-abate/following{/other_user}","gists_url":"https://api.github.com/users/salva-abate/gists{/gist_id}","starred_url":"https://api.github.com/users/salva-abate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salva-abate/subscriptions","organizations_url":"https://api.github.com/users/salva-abate/orgs","repos_url":"https://api.github.com/users/salva-abate/repos","events_url":"https://api.github.com/users/salva-abate/events{/privacy}","received_events_url":"https://api.github.com/users/salva-abate/received_events","type":"User","site_admin":false},"body":"We agreed that implementing this as polymorphism wouldn't really do anmything for us because the behavior of this object doesn't change whether its an in or an out port.","created_at":"2015-02-04T22:44:30Z","updated_at":"2015-02-04T22:44:30Z","html_url":"https://github.com/twosigma/goll-e/pull/4#discussion_r24127597","pull_request_url":"https://api.github.com/repos/twosigma/goll-e/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/comments/24127597"},"html":{"href":"https://github.com/twosigma/goll-e/pull/4#discussion_r24127597"},"pull_request":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/twosigma/goll-e/pulls/4","id":28324832,"html_url":"https://github.com/twosigma/goll-e/pull/4","diff_url":"https://github.com/twosigma/goll-e/pull/4.diff","patch_url":"https://github.com/twosigma/goll-e/pull/4.patch","issue_url":"https://api.github.com/repos/twosigma/goll-e/issues/4","number":4,"state":"open","locked":false,"title":"Data model","user":{"login":"salva-abate","id":1589075,"avatar_url":"https://avatars.githubusercontent.com/u/1589075?v=3","gravatar_id":"","url":"https://api.github.com/users/salva-abate","html_url":"https://github.com/salva-abate","followers_url":"https://api.github.com/users/salva-abate/followers","following_url":"https://api.github.com/users/salva-abate/following{/other_user}","gists_url":"https://api.github.com/users/salva-abate/gists{/gist_id}","starred_url":"https://api.github.com/users/salva-abate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salva-abate/subscriptions","organizations_url":"https://api.github.com/users/salva-abate/orgs","repos_url":"https://api.github.com/users/salva-abate/repos","events_url":"https://api.github.com/users/salva-abate/events{/privacy}","received_events_url":"https://api.github.com/users/salva-abate/received_events","type":"User","site_admin":false},"body":"Data model branch (objects and unit test for the objects). ","created_at":"2015-01-29T23:24:06Z","updated_at":"2015-02-04T22:44:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/twosigma/goll-e/pulls/4/commits","review_comments_url":"https://api.github.com/repos/twosigma/goll-e/pulls/4/comments","review_comment_url":"https://api.github.com/repos/twosigma/goll-e/pulls/comments/{number}","comments_url":"https://api.github.com/repos/twosigma/goll-e/issues/4/comments","statuses_url":"https://api.github.com/repos/twosigma/goll-e/statuses/31ae0b147c92e560216db36356ac392153b600aa","head":{"label":"twosigma:dataModel","ref":"dataModel","sha":"31ae0b147c92e560216db36356ac392153b600aa","user":{"login":"twosigma","id":4049181,"avatar_url":"https://avatars.githubusercontent.com/u/4049181?v=3","gravatar_id":"","url":"https://api.github.com/users/twosigma","html_url":"https://github.com/twosigma","followers_url":"https://api.github.com/users/twosigma/followers","following_url":"https://api.github.com/users/twosigma/following{/other_user}","gists_url":"https://api.github.com/users/twosigma/gists{/gist_id}","starred_url":"https://api.github.com/users/twosigma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twosigma/subscriptions","organizations_url":"https://api.github.com/users/twosigma/orgs","repos_url":"https://api.github.com/users/twosigma/repos","events_url":"https://api.github.com/users/twosigma/events{/privacy}","received_events_url":"https://api.github.com/users/twosigma/received_events","type":"Organization","site_admin":false},"repo":{"id":23775641,"name":"goll-e","full_name":"twosigma/goll-e","owner":{"login":"twosigma","id":4049181,"avatar_url":"https://avatars.githubusercontent.com/u/4049181?v=3","gravatar_id":"","url":"https://api.github.com/users/twosigma","html_url":"https://github.com/twosigma","followers_url":"https://api.github.com/users/twosigma/followers","following_url":"https://api.github.com/users/twosigma/following{/other_user}","gists_url":"https://api.github.com/users/twosigma/gists{/gist_id}","starred_url":"https://api.github.com/users/twosigma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twosigma/subscriptions","organizations_url":"https://api.github.com/users/twosigma/orgs","repos_url":"https://api.github.com/users/twosigma/repos","events_url":"https://api.github.com/users/twosigma/events{/privacy}","received_events_url":"https://api.github.com/users/twosigma/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twosigma/goll-e","description":"Graph Object Language and Layout Editor","fork":false,"url":"https://api.github.com/repos/twosigma/goll-e","forks_url":"https://api.github.com/repos/twosigma/goll-e/forks","keys_url":"https://api.github.com/repos/twosigma/goll-e/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twosigma/goll-e/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twosigma/goll-e/teams","hooks_url":"https://api.github.com/repos/twosigma/goll-e/hooks","issue_events_url":"https://api.github.com/repos/twosigma/goll-e/issues/events{/number}","events_url":"https://api.github.com/repos/twosigma/goll-e/events","assignees_url":"https://api.github.com/repos/twosigma/goll-e/assignees{/user}","branches_url":"https://api.github.com/repos/twosigma/goll-e/branches{/branch}","tags_url":"https://api.github.com/repos/twosigma/goll-e/tags","blobs_url":"https://api.github.com/repos/twosigma/goll-e/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twosigma/goll-e/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twosigma/goll-e/git/refs{/sha}","trees_url":"https://api.github.com/repos/twosigma/goll-e/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twosigma/goll-e/statuses/{sha}","languages_url":"https://api.github.com/repos/twosigma/goll-e/languages","stargazers_url":"https://api.github.com/repos/twosigma/goll-e/stargazers","contributors_url":"https://api.github.com/repos/twosigma/goll-e/contributors","subscribers_url":"https://api.github.com/repos/twosigma/goll-e/subscribers","subscription_url":"https://api.github.com/repos/twosigma/goll-e/subscription","commits_url":"https://api.github.com/repos/twosigma/goll-e/commits{/sha}","git_commits_url":"https://api.github.com/repos/twosigma/goll-e/git/commits{/sha}","comments_url":"https://api.github.com/repos/twosigma/goll-e/comments{/number}","issue_comment_url":"https://api.github.com/repos/twosigma/goll-e/issues/comments/{number}","contents_url":"https://api.github.com/repos/twosigma/goll-e/contents/{+path}","compare_url":"https://api.github.com/repos/twosigma/goll-e/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twosigma/goll-e/merges","archive_url":"https://api.github.com/repos/twosigma/goll-e/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twosigma/goll-e/downloads","issues_url":"https://api.github.com/repos/twosigma/goll-e/issues{/number}","pulls_url":"https://api.github.com/repos/twosigma/goll-e/pulls{/number}","milestones_url":"https://api.github.com/repos/twosigma/goll-e/milestones{/number}","notifications_url":"https://api.github.com/repos/twosigma/goll-e/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twosigma/goll-e/labels{/name}","releases_url":"https://api.github.com/repos/twosigma/goll-e/releases{/id}","created_at":"2014-09-08T01:19:14Z","updated_at":"2014-10-02T14:48:36Z","pushed_at":"2015-02-04T22:33:36Z","git_url":"git://github.com/twosigma/goll-e.git","ssh_url":"git@github.com:twosigma/goll-e.git","clone_url":"https://github.com/twosigma/goll-e.git","svn_url":"https://github.com/twosigma/goll-e","homepage":null,"size":656,"stargazers_count":3,"watchers_count":3,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"base":{"label":"twosigma:develop","ref":"develop","sha":"957589fa8a34ab2123972c55787b5a78d24e457f","user":{"login":"twosigma","id":4049181,"avatar_url":"https://avatars.githubusercontent.com/u/4049181?v=3","gravatar_id":"","url":"https://api.github.com/users/twosigma","html_url":"https://github.com/twosigma","followers_url":"https://api.github.com/users/twosigma/followers","following_url":"https://api.github.com/users/twosigma/following{/other_user}","gists_url":"https://api.github.com/users/twosigma/gists{/gist_id}","starred_url":"https://api.github.com/users/twosigma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twosigma/subscriptions","organizations_url":"https://api.github.com/users/twosigma/orgs","repos_url":"https://api.github.com/users/twosigma/repos","events_url":"https://api.github.com/users/twosigma/events{/privacy}","received_events_url":"https://api.github.com/users/twosigma/received_events","type":"Organization","site_admin":false},"repo":{"id":23775641,"name":"goll-e","full_name":"twosigma/goll-e","owner":{"login":"twosigma","id":4049181,"avatar_url":"https://avatars.githubusercontent.com/u/4049181?v=3","gravatar_id":"","url":"https://api.github.com/users/twosigma","html_url":"https://github.com/twosigma","followers_url":"https://api.github.com/users/twosigma/followers","following_url":"https://api.github.com/users/twosigma/following{/other_user}","gists_url":"https://api.github.com/users/twosigma/gists{/gist_id}","starred_url":"https://api.github.com/users/twosigma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twosigma/subscriptions","organizations_url":"https://api.github.com/users/twosigma/orgs","repos_url":"https://api.github.com/users/twosigma/repos","events_url":"https://api.github.com/users/twosigma/events{/privacy}","received_events_url":"https://api.github.com/users/twosigma/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twosigma/goll-e","description":"Graph Object Language and Layout Editor","fork":false,"url":"https://api.github.com/repos/twosigma/goll-e","forks_url":"https://api.github.com/repos/twosigma/goll-e/forks","keys_url":"https://api.github.com/repos/twosigma/goll-e/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twosigma/goll-e/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twosigma/goll-e/teams","hooks_url":"https://api.github.com/repos/twosigma/goll-e/hooks","issue_events_url":"https://api.github.com/repos/twosigma/goll-e/issues/events{/number}","events_url":"https://api.github.com/repos/twosigma/goll-e/events","assignees_url":"https://api.github.com/repos/twosigma/goll-e/assignees{/user}","branches_url":"https://api.github.com/repos/twosigma/goll-e/branches{/branch}","tags_url":"https://api.github.com/repos/twosigma/goll-e/tags","blobs_url":"https://api.github.com/repos/twosigma/goll-e/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twosigma/goll-e/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twosigma/goll-e/git/refs{/sha}","trees_url":"https://api.github.com/repos/twosigma/goll-e/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twosigma/goll-e/statuses/{sha}","languages_url":"https://api.github.com/repos/twosigma/goll-e/languages","stargazers_url":"https://api.github.com/repos/twosigma/goll-e/stargazers","contributors_url":"https://api.github.com/repos/twosigma/goll-e/contributors","subscribers_url":"https://api.github.com/repos/twosigma/goll-e/subscribers","subscription_url":"https://api.github.com/repos/twosigma/goll-e/subscription","commits_url":"https://api.github.com/repos/twosigma/goll-e/commits{/sha}","git_commits_url":"https://api.github.com/repos/twosigma/goll-e/git/commits{/sha}","comments_url":"https://api.github.com/repos/twosigma/goll-e/comments{/number}","issue_comment_url":"https://api.github.com/repos/twosigma/goll-e/issues/comments/{number}","contents_url":"https://api.github.com/repos/twosigma/goll-e/contents/{+path}","compare_url":"https://api.github.com/repos/twosigma/goll-e/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twosigma/goll-e/merges","archive_url":"https://api.github.com/repos/twosigma/goll-e/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twosigma/goll-e/downloads","issues_url":"https://api.github.com/repos/twosigma/goll-e/issues{/number}","pulls_url":"https://api.github.com/repos/twosigma/goll-e/pulls{/number}","milestones_url":"https://api.github.com/repos/twosigma/goll-e/milestones{/number}","notifications_url":"https://api.github.com/repos/twosigma/goll-e/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twosigma/goll-e/labels{/name}","releases_url":"https://api.github.com/repos/twosigma/goll-e/releases{/id}","created_at":"2014-09-08T01:19:14Z","updated_at":"2014-10-02T14:48:36Z","pushed_at":"2015-02-04T22:33:36Z","git_url":"git://github.com/twosigma/goll-e.git","ssh_url":"git@github.com:twosigma/goll-e.git","clone_url":"https://github.com/twosigma/goll-e.git","svn_url":"https://github.com/twosigma/goll-e","homepage":null,"size":656,"stargazers_count":3,"watchers_count":3,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/4"},"html":{"href":"https://github.com/twosigma/goll-e/pull/4"},"issue":{"href":"https://api.github.com/repos/twosigma/goll-e/issues/4"},"comments":{"href":"https://api.github.com/repos/twosigma/goll-e/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/twosigma/goll-e/statuses/31ae0b147c92e560216db36356ac392153b600aa"}}}}