{"action":"created","comment":{"url":"https://api.github.com/repos/twosigma/goll-e/pulls/comments/24712444","id":24712444,"diff_hunk":"@@ -1,23 +1,68 @@\n var React = require('react');\n+var IO = require('./io.jsx');\n var mouseDownDrag = require('../utilities/mouseDownDrag');\n+var PositionUtils = require('../utilities/positionUtils.js');\n+var CardinalDirection = require('../enum/cardinalDirection.js');\n+var IOLabelPosition = require('../enum/ioLabelPosition');\n+\n+var nodeWidth = 150;\n+var nodeHeight = nodeWidth/1.6;\n+var headerHeight = 35;\n+var padding = 5;\n+\n+var ioRadius = 4;\n+var ioSpacing = 15;\n+\n+// DATA MODEL scales values 0-100. Undo that.\n+var DATA_MODEL_MULTIPLIER = 100.0;\n+\n+// TODO: specific to rectangular nodes. Refactor out.\n+var DIRECTION_TO_LABEL_POSITION = {};\n+\n+DIRECTION_TO_LABEL_POSITION[CardinalDirection.NORTH] = IOLabelPosition.BELOW;\n+DIRECTION_TO_LABEL_POSITION[CardinalDirection.SOUTH] = IOLabelPosition.ABOVE;\n+DIRECTION_TO_LABEL_POSITION[CardinalDirection.EAST] = IOLabelPosition.LEFT;\n+DIRECTION_TO_LABEL_POSITION[CardinalDirection.WEST] = IOLabelPosition.RIGHT;\n+\n \n var Node = React.createClass({\n \n     render: function() {\n         return (\n-            <g className='node'>\n+            <g\n+             className='node'\n+             transform={'translate(' + this.props.x + ', ' + this.props.y + ')'} >\n                 <rect\n+                    height={nodeHeight} width={nodeWidth}\n                     className='node-box'\n-                    x={this.props.x} y={this.props.y} height='93.75' width='150'\n                     onMouseDown={mouseDownDrag.bind(this, 'node_body', null, null, this._onNodeBodyPseudoDrag)} />\n-                <text className='label' text-anchor='start' x={this.props.x + 5} y={this.props.y + 15}>\n+                <text className='label' text-anchor='start' x={padding} y={padding + 10}>\n                     {this.props.label}\n                 </text>\n-                {/* inputs and outputs */}\n+                {this._getRenderedIOs(this.props.inputs, true)}\n+                {this._getRenderedIOs(this.props.outputs, false)}\n             </g>\n         );\n     },\n \n+    _getRenderedIOs: function(ios, isInput) {","path":"lib/viewcomponents/node.jsx","position":52,"original_position":52,"commit_id":"77c3c438b5db4e94a7ff2dd16b109ed7701236a0","original_commit_id":"77c3c438b5db4e94a7ff2dd16b109ed7701236a0","user":{"login":"RobertWarrenGilmore","id":4361000,"avatar_url":"https://avatars.githubusercontent.com/u/4361000?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertWarrenGilmore","html_url":"https://github.com/RobertWarrenGilmore","followers_url":"https://api.github.com/users/RobertWarrenGilmore/followers","following_url":"https://api.github.com/users/RobertWarrenGilmore/following{/other_user}","gists_url":"https://api.github.com/users/RobertWarrenGilmore/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertWarrenGilmore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertWarrenGilmore/subscriptions","organizations_url":"https://api.github.com/users/RobertWarrenGilmore/orgs","repos_url":"https://api.github.com/users/RobertWarrenGilmore/repos","events_url":"https://api.github.com/users/RobertWarrenGilmore/events{/privacy}","received_events_url":"https://api.github.com/users/RobertWarrenGilmore/received_events","type":"User","site_admin":false},"body":"It took me a while to figure out that these are models. It might make it more clear if the naming of these models were changed throughout this file to have names like ioModels, ioModel, nodeModel. This might be something to do later.","created_at":"2015-02-14T05:33:13Z","updated_at":"2015-02-14T05:33:13Z","html_url":"https://github.com/twosigma/goll-e/pull/5#discussion_r24712444","pull_request_url":"https://api.github.com/repos/twosigma/goll-e/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/comments/24712444"},"html":{"href":"https://github.com/twosigma/goll-e/pull/5#discussion_r24712444"},"pull_request":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/twosigma/goll-e/pulls/5","id":28889936,"html_url":"https://github.com/twosigma/goll-e/pull/5","diff_url":"https://github.com/twosigma/goll-e/pull/5.diff","patch_url":"https://github.com/twosigma/goll-e/pull/5.patch","issue_url":"https://api.github.com/repos/twosigma/goll-e/issues/5","number":5,"state":"open","locked":false,"title":"Inputs & Outputs [GOL-32]","user":{"login":"jboolean","id":406931,"avatar_url":"https://avatars.githubusercontent.com/u/406931?v=3","gravatar_id":"","url":"https://api.github.com/users/jboolean","html_url":"https://github.com/jboolean","followers_url":"https://api.github.com/users/jboolean/followers","following_url":"https://api.github.com/users/jboolean/following{/other_user}","gists_url":"https://api.github.com/users/jboolean/gists{/gist_id}","starred_url":"https://api.github.com/users/jboolean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jboolean/subscriptions","organizations_url":"https://api.github.com/users/jboolean/orgs","repos_url":"https://api.github.com/users/jboolean/repos","events_url":"https://api.github.com/users/jboolean/events{/privacy}","received_events_url":"https://api.github.com/users/jboolean/received_events","type":"User","site_admin":false},"body":"This PR primarily adds very basic inputs and outputs to Nodes and the ability to move them by dragging. \r\nConsequently, it also modifies the static test data model to be more similar to the latest data model designs. \r\n\r\nIt also contains various cleanup, refactoring or tangential features that I did along the way. \r\nI do plan to update the method of dragging IOs so they don't feel like they're locked on train tracks. This PR may be declined if feedback warrants a lot of changes.","created_at":"2015-02-09T00:14:56Z","updated_at":"2015-02-14T05:33:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9dd5e04832bfcfd187f2be1f301d870b51a2edd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/twosigma/goll-e/pulls/5/commits","review_comments_url":"https://api.github.com/repos/twosigma/goll-e/pulls/5/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/5/comments","statuses_url":"https://api.github.com/repos/twosigma/goll-e/statuses/77c3c438b5db4e94a7ff2dd16b109ed7701236a0","head":{"label":"twosigma:ios","ref":"ios","sha":"77c3c438b5db4e94a7ff2dd16b109ed7701236a0","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-14T02:24:54Z","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":827,"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":2,"forks":1,"open_issues":2,"watchers":3,"default_branch":"master"}},"base":{"label":"twosigma:develop","ref":"develop","sha":"d069830862438da8edd3c969245110e0f63d5e09","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-14T02:24:54Z","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":827,"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":2,"forks":1,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/5"},"html":{"href":"https://github.com/twosigma/goll-e/pull/5"},"issue":{"href":"https://api.github.com/repos/twosigma/goll-e/issues/5"},"comments":{"href":"https://api.github.com/repos/twosigma/goll-e/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/twosigma/goll-e/pulls/5/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/5/commits"},"statuses":{"href":"https://api.github.com/repos/twosigma/goll-e/statuses/77c3c438b5db4e94a7ff2dd16b109ed7701236a0"}}}}