{"action":"created","comment":{"url":"https://api.github.com/repos/nicoespeon/gitgraph.js/pulls/comments/94335628","pull_request_review_id":14862396,"id":94335628,"diff_hunk":"@@ -1505,9 +1557,102 @@\n     return (typeof object === \"object\");\n   }\n \n+  /**\n+   * Returns `true` if any of the properties (nested or single) of `obj` specified by `key` are undefined or set to a value of null.\n+   * Modified from original source: http://stackoverflow.com/a/23809123.\n+   *\n+   * @param {*} obj - The object whose properties are to be tested as being undefined or equal to null.\n+   * @param {String} key - The property hierarchy of `obj` to be tested, specified using 'dot notation' (e.g. property1.property2.property3 etc).\n+   * @returns {Boolean} - True if ANY of the properties specified by `key` is undefined or equal to null, otherwise False.\n+   * @private\n+   */\n+  function _isNullOrUndefined(obj, key) {\n+\n+    /* We invert the result of '.every()' in order to meet the expected return value for the condition test of the function.\n+     * We have to do this, given that '.every()' will return immediately upon capturing a falsey value from the callback.\n+     *\n+     * See: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/every for more information.\n+     */\n+    return !(key.split(\".\").every(function(x) {\n+        if(typeof obj !== \"object\" || obj === null || !(x in obj)) {\n+          return false;\n+        }\n+        obj = obj[x];\n+        return true;\n+    }));\n+  }\n+\n+  /* Polyfill for ECMA-252 5th edition Array.prototype.every()\n+   * See: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/every\n+   * for more information.\n+   * */\n+  if (!Array.prototype.every) {\n+    Array.prototype.every = function(callbackfn, thisArg) {\n+      var T, k;\n+\n+      if (this === null) {\n+        throw new TypeError(\"this is null or not defined\");\n+      }\n+\n+      // 1. Let O be the result of calling ToObject passing the this","path":"src/gitgraph.js","position":187,"original_position":187,"commit_id":"bd35377d1d0a00c1db1b04cfc44f0c72401c02e9","original_commit_id":"bd35377d1d0a00c1db1b04cfc44f0c72401c02e9","user":{"login":"nicoespeon","id":1094774,"avatar_url":"https://avatars.githubusercontent.com/u/1094774?v=3","gravatar_id":"","url":"https://api.github.com/users/nicoespeon","html_url":"https://github.com/nicoespeon","followers_url":"https://api.github.com/users/nicoespeon/followers","following_url":"https://api.github.com/users/nicoespeon/following{/other_user}","gists_url":"https://api.github.com/users/nicoespeon/gists{/gist_id}","starred_url":"https://api.github.com/users/nicoespeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicoespeon/subscriptions","organizations_url":"https://api.github.com/users/nicoespeon/orgs","repos_url":"https://api.github.com/users/nicoespeon/repos","events_url":"https://api.github.com/users/nicoespeon/events{/privacy}","received_events_url":"https://api.github.com/users/nicoespeon/received_events","type":"User","site_admin":false},"body":"Thanks for the detailed polyfill and the link to the source, that's helpful (and documented).\r\n\r\nStill, you can get rid of all the detailed implementation comments as they mostly describe what the code is doing rather than why, which is not really useful.\r\n\r\nThanks a lot =)","created_at":"2017-01-02T17:34:44Z","updated_at":"2017-01-02T17:37:41Z","html_url":"https://github.com/nicoespeon/gitgraph.js/pull/134#discussion_r94335628","pull_request_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/pulls/134","_links":{"self":{"href":"https://api.github.com/repos/nicoespeon/gitgraph.js/pulls/comments/94335628"},"html":{"href":"https://github.com/nicoespeon/gitgraph.js/pull/134#discussion_r94335628"},"pull_request":{"href":"https://api.github.com/repos/nicoespeon/gitgraph.js/pulls/134"}}},"pull_request":{"url":"https://api.github.com/repos/nicoespeon/gitgraph.js/pulls/134","id":99392247,"html_url":"https://github.com/nicoespeon/gitgraph.js/pull/134","diff_url":"https://github.com/nicoespeon/gitgraph.js/pull/134.diff","patch_url":"https://github.com/nicoespeon/gitgraph.js/pull/134.patch","issue_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/issues/134","number":134,"state":"open","locked":false,"title":"Support branch label rotation in 'horizontal mode'.","user":{"login":"cgddrd","id":2536819,"avatar_url":"https://avatars.githubusercontent.com/u/2536819?v=3","gravatar_id":"","url":"https://api.github.com/users/cgddrd","html_url":"https://github.com/cgddrd","followers_url":"https://api.github.com/users/cgddrd/followers","following_url":"https://api.github.com/users/cgddrd/following{/other_user}","gists_url":"https://api.github.com/users/cgddrd/gists{/gist_id}","starred_url":"https://api.github.com/users/cgddrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgddrd/subscriptions","organizations_url":"https://api.github.com/users/cgddrd/orgs","repos_url":"https://api.github.com/users/cgddrd/repos","events_url":"https://api.github.com/users/cgddrd/events{/privacy}","received_events_url":"https://api.github.com/users/cgddrd/received_events","type":"User","site_admin":false},"body":"This PR enables graphs rendered in 'horizontal mode' to support branch label rotations besides the default of -90 (270) degrees. \r\n\r\nWhilst the motivation and focus of this work is to allow for branch labels to be set to zero degrees of rotation whilst rendered under 'horizontal mode', no limitations on the rotation angle are enforced. It should be noted however, that any label rendered with a rotation angle **NOT** set to an increment of 90 degrees (i.e 0, 90, 180 or 270) is not guaranteed to render in a sensible manner. \r\n\r\nSee below for an illustration of these changes using the example file 'gitflowsupport.js':\r\n\r\n**Before:** labels auto-default to a rotation of -90 degrees in horizontal mode\r\n\r\n<img width=\"860\" alt=\"screen shot 2016-12-26 at 11 54 24\" src=\"https://cloud.githubusercontent.com/assets/2536819/21486974/5b08bf36-cbb6-11e6-8168-b6a0e67090d8.png\">\r\n\r\n**Before:** labels (manually) forced to render at 0 degrees (positioning issues)\r\n\r\n<img width=\"861\" alt=\"screen shot 2016-12-26 at 11 51 00\" src=\"https://cloud.githubusercontent.com/assets/2536819/21486987/9f5c6598-cbb6-11e6-8096-ddc4c3e45922.png\">\r\n\r\n**After**: labels configured to render at 0 degrees (positioning and alignment handled correctly)\r\n\r\n<img width=\"858\" alt=\"screen shot 2016-12-26 at 11 48 57\" src=\"https://cloud.githubusercontent.com/assets/2536819/21486997/cc63692e-cbb6-11e6-94b7-b5a300e37d2a.png\">\r\n\r\n***Please note:*** These changes do not affect the current behaviour for rendering branch labels under 'vertical' or 'vertical-reverse' modes.\r\n\r\nConfiguration of the rotation angle for branch labels continues to be set using the existing `template.branch.labelRotation` property, as highlighted in the example below:\r\n\r\n```\r\nvar graphConfig = new GitGraph.Template({\r\n    branch: {\r\n        color: \"#000000\",\r\n        mergeStyle: \"straight\",\r\n        labelRotation: 0\r\n    },\r\n});\r\n\r\nvar config = {\r\n  template: graphConfig,\r\n  mode: \"extended\",\r\n  orientation: \"horizontal\"\r\n};\r\n```\r\n ","created_at":"2016-12-26T22:04:27Z","updated_at":"2017-01-02T17:37:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00f90b6324caa86682939291c6f6af95cd934637","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/pulls/134/commits","review_comments_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/pulls/134/comments","review_comment_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/issues/134/comments","statuses_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/statuses/bd35377d1d0a00c1db1b04cfc44f0c72401c02e9","head":{"label":"cgddrd:orientation-modes-support-label-rotation","ref":"orientation-modes-support-label-rotation","sha":"bd35377d1d0a00c1db1b04cfc44f0c72401c02e9","user":{"login":"cgddrd","id":2536819,"avatar_url":"https://avatars.githubusercontent.com/u/2536819?v=3","gravatar_id":"","url":"https://api.github.com/users/cgddrd","html_url":"https://github.com/cgddrd","followers_url":"https://api.github.com/users/cgddrd/followers","following_url":"https://api.github.com/users/cgddrd/following{/other_user}","gists_url":"https://api.github.com/users/cgddrd/gists{/gist_id}","starred_url":"https://api.github.com/users/cgddrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgddrd/subscriptions","organizations_url":"https://api.github.com/users/cgddrd/orgs","repos_url":"https://api.github.com/users/cgddrd/repos","events_url":"https://api.github.com/users/cgddrd/events{/privacy}","received_events_url":"https://api.github.com/users/cgddrd/received_events","type":"User","site_admin":false},"repo":{"id":77281051,"name":"gitgraph.js","full_name":"cgddrd/gitgraph.js","owner":{"login":"cgddrd","id":2536819,"avatar_url":"https://avatars.githubusercontent.com/u/2536819?v=3","gravatar_id":"","url":"https://api.github.com/users/cgddrd","html_url":"https://github.com/cgddrd","followers_url":"https://api.github.com/users/cgddrd/followers","following_url":"https://api.github.com/users/cgddrd/following{/other_user}","gists_url":"https://api.github.com/users/cgddrd/gists{/gist_id}","starred_url":"https://api.github.com/users/cgddrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgddrd/subscriptions","organizations_url":"https://api.github.com/users/cgddrd/orgs","repos_url":"https://api.github.com/users/cgddrd/repos","events_url":"https://api.github.com/users/cgddrd/events{/privacy}","received_events_url":"https://api.github.com/users/cgddrd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cgddrd/gitgraph.js","description":"A JavaScript library to draw pretty git graphs in the browser","fork":true,"url":"https://api.github.com/repos/cgddrd/gitgraph.js","forks_url":"https://api.github.com/repos/cgddrd/gitgraph.js/forks","keys_url":"https://api.github.com/repos/cgddrd/gitgraph.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cgddrd/gitgraph.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cgddrd/gitgraph.js/teams","hooks_url":"https://api.github.com/repos/cgddrd/gitgraph.js/hooks","issue_events_url":"https://api.github.com/repos/cgddrd/gitgraph.js/issues/events{/number}","events_url":"https://api.github.com/repos/cgddrd/gitgraph.js/events","assignees_url":"https://api.github.com/repos/cgddrd/gitgraph.js/assignees{/user}","branches_url":"https://api.github.com/repos/cgddrd/gitgraph.js/branches{/branch}","tags_url":"https://api.github.com/repos/cgddrd/gitgraph.js/tags","blobs_url":"https://api.github.com/repos/cgddrd/gitgraph.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cgddrd/gitgraph.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cgddrd/gitgraph.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/cgddrd/gitgraph.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cgddrd/gitgraph.js/statuses/{sha}","languages_url":"https://api.github.com/repos/cgddrd/gitgraph.js/languages","stargazers_url":"https://api.github.com/repos/cgddrd/gitgraph.js/stargazers","contributors_url":"https://api.github.com/repos/cgddrd/gitgraph.js/contributors","subscribers_url":"https://api.github.com/repos/cgddrd/gitgraph.js/subscribers","subscription_url":"https://api.github.com/repos/cgddrd/gitgraph.js/subscription","commits_url":"https://api.github.com/repos/cgddrd/gitgraph.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/cgddrd/gitgraph.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/cgddrd/gitgraph.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/cgddrd/gitgraph.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/cgddrd/gitgraph.js/contents/{+path}","compare_url":"https://api.github.com/repos/cgddrd/gitgraph.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cgddrd/gitgraph.js/merges","archive_url":"https://api.github.com/repos/cgddrd/gitgraph.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cgddrd/gitgraph.js/downloads","issues_url":"https://api.github.com/repos/cgddrd/gitgraph.js/issues{/number}","pulls_url":"https://api.github.com/repos/cgddrd/gitgraph.js/pulls{/number}","milestones_url":"https://api.github.com/repos/cgddrd/gitgraph.js/milestones{/number}","notifications_url":"https://api.github.com/repos/cgddrd/gitgraph.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cgddrd/gitgraph.js/labels{/name}","releases_url":"https://api.github.com/repos/cgddrd/gitgraph.js/releases{/id}","deployments_url":"https://api.github.com/repos/cgddrd/gitgraph.js/deployments","created_at":"2016-12-24T11:57:47Z","updated_at":"2016-12-24T11:57:49Z","pushed_at":"2016-12-27T00:06:37Z","git_url":"git://github.com/cgddrd/gitgraph.js.git","ssh_url":"git@github.com:cgddrd/gitgraph.js.git","clone_url":"https://github.com/cgddrd/gitgraph.js.git","svn_url":"https://github.com/cgddrd/gitgraph.js","homepage":"http://gitgraphjs.com/","size":893,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"nicoespeon:develop","ref":"develop","sha":"41a0d6922cd4949e24ffc2b9b2e89677e4cfdefa","user":{"login":"nicoespeon","id":1094774,"avatar_url":"https://avatars.githubusercontent.com/u/1094774?v=3","gravatar_id":"","url":"https://api.github.com/users/nicoespeon","html_url":"https://github.com/nicoespeon","followers_url":"https://api.github.com/users/nicoespeon/followers","following_url":"https://api.github.com/users/nicoespeon/following{/other_user}","gists_url":"https://api.github.com/users/nicoespeon/gists{/gist_id}","starred_url":"https://api.github.com/users/nicoespeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicoespeon/subscriptions","organizations_url":"https://api.github.com/users/nicoespeon/orgs","repos_url":"https://api.github.com/users/nicoespeon/repos","events_url":"https://api.github.com/users/nicoespeon/events{/privacy}","received_events_url":"https://api.github.com/users/nicoespeon/received_events","type":"User","site_admin":false},"repo":{"id":12105498,"name":"gitgraph.js","full_name":"nicoespeon/gitgraph.js","owner":{"login":"nicoespeon","id":1094774,"avatar_url":"https://avatars.githubusercontent.com/u/1094774?v=3","gravatar_id":"","url":"https://api.github.com/users/nicoespeon","html_url":"https://github.com/nicoespeon","followers_url":"https://api.github.com/users/nicoespeon/followers","following_url":"https://api.github.com/users/nicoespeon/following{/other_user}","gists_url":"https://api.github.com/users/nicoespeon/gists{/gist_id}","starred_url":"https://api.github.com/users/nicoespeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicoespeon/subscriptions","organizations_url":"https://api.github.com/users/nicoespeon/orgs","repos_url":"https://api.github.com/users/nicoespeon/repos","events_url":"https://api.github.com/users/nicoespeon/events{/privacy}","received_events_url":"https://api.github.com/users/nicoespeon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nicoespeon/gitgraph.js","description":"A JavaScript library to draw pretty git graphs in the browser","fork":false,"url":"https://api.github.com/repos/nicoespeon/gitgraph.js","forks_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/forks","keys_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/teams","hooks_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/hooks","issue_events_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/issues/events{/number}","events_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/events","assignees_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/assignees{/user}","branches_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/branches{/branch}","tags_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/tags","blobs_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/statuses/{sha}","languages_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/languages","stargazers_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/stargazers","contributors_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/contributors","subscribers_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/subscribers","subscription_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/subscription","commits_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/contents/{+path}","compare_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/merges","archive_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/downloads","issues_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/issues{/number}","pulls_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/pulls{/number}","milestones_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/milestones{/number}","notifications_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/labels{/name}","releases_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/releases{/id}","deployments_url":"https://api.github.com/repos/nicoespeon/gitgraph.js/deployments","created_at":"2013-08-14T09:46:20Z","updated_at":"2017-01-02T04:04:08Z","pushed_at":"2017-01-02T09:22:36Z","git_url":"git://github.com/nicoespeon/gitgraph.js.git","ssh_url":"git@github.com:nicoespeon/gitgraph.js.git","clone_url":"https://github.com/nicoespeon/gitgraph.js.git","svn_url":"https://github.com/nicoespeon/gitgraph.js","homepage":"http://gitgraphjs.com/","size":883,"stargazers_count":602,"watchers_count":602,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":125,"mirror_url":null,"open_issues_count":12,"forks":125,"open_issues":12,"watchers":602,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/nicoespeon/gitgraph.js/pulls/134"},"html":{"href":"https://github.com/nicoespeon/gitgraph.js/pull/134"},"issue":{"href":"https://api.github.com/repos/nicoespeon/gitgraph.js/issues/134"},"comments":{"href":"https://api.github.com/repos/nicoespeon/gitgraph.js/issues/134/comments"},"review_comments":{"href":"https://api.github.com/repos/nicoespeon/gitgraph.js/pulls/134/comments"},"review_comment":{"href":"https://api.github.com/repos/nicoespeon/gitgraph.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nicoespeon/gitgraph.js/pulls/134/commits"},"statuses":{"href":"https://api.github.com/repos/nicoespeon/gitgraph.js/statuses/bd35377d1d0a00c1db1b04cfc44f0c72401c02e9"}}}}
{"actor":{"display_login":"nicoespeon"}}