{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/plottable/pulls/comments/40237418","id":40237418,"diff_hunk":"@@ -149,6 +149,54 @@ describe(\"TimeAxis\", () => {\n     svg.remove();\n   });\n \n+  it(\"tick labels do not overlap with tick marks in top orientation\", () => {\n+    let svg = TestMethods.generateSVG(400, 100);\n+    scale.domain([new Date(\"2010-01-01\"), new Date(\"2014-01-01\")]);\n+    axis = new Plottable.Axes.Time(scale, \"top\");\n+\n+    function checkTierDisplayPosition (tierDisplayPositions: string[]) {\n+      axis.tierLabelPositions(tierDisplayPositions);\n+      axis.renderTo(svg);\n+      let style = (<any>axis)._element.append(\"style\");\n+      style.attr(\"type\", \"text/css\");\n+      style.text(\".plottable .axis.time-axis text { font-family: Arial; }\");\n+      let tickMarks = d3.selectAll(`.${Plottable.Axis.TICK_MARK_CLASS}:not(.${Plottable.Axis.END_TICK_MARK_CLASS})`);\n+      assert.operator(tickMarks.size(), \">=\", 1, \"There are at least one tick marks in the test\");\n+      let tickLabels = d3.selectAll(`.${Plottable.Axis.TICK_LABEL_CLASS}`)\n+      .filter(function(d, i){\n+        return window.getComputedStyle(this).visibility !== \"hidden\";\n+      });\n+      assert.operator(tickLabels.size(), \">=\", 1, `There are at least one tick labels in the test`);\n+\n+      function clientRectsOverlap(clientRectA: ClientRect, clientRectB: ClientRect) {\n+        if (clientRectA.right < clientRectB.left + window.Pixel_CloseTo_Requirement) {\n+            return false;\n+        }\n+        if (window.Pixel_CloseTo_Requirement + clientRectA.left > clientRectB.right) {\n+            return false;\n+        }\n+        if (clientRectA.bottom < clientRectB.top + window.Pixel_CloseTo_Requirement) {\n+            return false;\n+        }\n+        if (window.Pixel_CloseTo_Requirement + clientRectA.top > clientRectB.bottom) {\n+            return false;\n+        }\n+        return true;\n+      }\n+      tickMarks.each(function(tickMark) {\n+        let tickMarkRect = this.getBoundingClientRect();\n+        tickLabels.each(function(tickLabel) {\n+          let tickLabelRect = this.getBoundingClientRect();\n+          let isOverlap = clientRectsOverlap(tickMarkRect, tickLabelRect);","path":"test/axes/timeAxisTests.ts","position":42,"original_position":42,"commit_id":"ddc2881fcc9833503d903ac14310301f65686757","original_commit_id":"ddc2881fcc9833503d903ac14310301f65686757","user":{"login":"aicioara","id":3248682,"avatar_url":"https://avatars.githubusercontent.com/u/3248682?v=3","gravatar_id":"","url":"https://api.github.com/users/aicioara","html_url":"https://github.com/aicioara","followers_url":"https://api.github.com/users/aicioara/followers","following_url":"https://api.github.com/users/aicioara/following{/other_user}","gists_url":"https://api.github.com/users/aicioara/gists{/gist_id}","starred_url":"https://api.github.com/users/aicioara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aicioara/subscriptions","organizations_url":"https://api.github.com/users/aicioara/orgs","repos_url":"https://api.github.com/users/aicioara/repos","events_url":"https://api.github.com/users/aicioara/events{/privacy}","received_events_url":"https://api.github.com/users/aicioara/received_events","type":"User","site_admin":false},"body":"<del> this variable has an awkward name. Let's call it `markOverlapsLabel`. </del>\r\n\r\nInline in the assert below. No need for new variable.","created_at":"2015-09-23T18:13:36Z","updated_at":"2015-09-23T18:13:36Z","html_url":"https://github.com/palantir/plottable/pull/2778#discussion_r40237418","pull_request_url":"https://api.github.com/repos/palantir/plottable/pulls/2778","_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments/40237418"},"html":{"href":"https://github.com/palantir/plottable/pull/2778#discussion_r40237418"},"pull_request":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2778"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/plottable/pulls/2778","id":45254487,"html_url":"https://github.com/palantir/plottable/pull/2778","diff_url":"https://github.com/palantir/plottable/pull/2778.diff","patch_url":"https://github.com/palantir/plottable/pull/2778.patch","issue_url":"https://api.github.com/repos/palantir/plottable/issues/2778","number":2778,"state":"open","locked":false,"title":"Correct the label position with \"center\" tierlabelposition and \"top\" orientation","user":{"login":"yunhaolucky","id":3696519,"avatar_url":"https://avatars.githubusercontent.com/u/3696519?v=3","gravatar_id":"","url":"https://api.github.com/users/yunhaolucky","html_url":"https://github.com/yunhaolucky","followers_url":"https://api.github.com/users/yunhaolucky/followers","following_url":"https://api.github.com/users/yunhaolucky/following{/other_user}","gists_url":"https://api.github.com/users/yunhaolucky/gists{/gist_id}","starred_url":"https://api.github.com/users/yunhaolucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yunhaolucky/subscriptions","organizations_url":"https://api.github.com/users/yunhaolucky/orgs","repos_url":"https://api.github.com/users/yunhaolucky/repos","events_url":"https://api.github.com/users/yunhaolucky/events{/privacy}","received_events_url":"https://api.github.com/users/yunhaolucky/received_events","type":"User","site_admin":false},"body":"**Issue**:\r\nIn a time axis with `top` orientation, the `y` value of label positions are not calculated correctly when its `tierlabelposition` is set to `center` . This is an issue because it makes tick marks overlap with tick labels and hide all labels as a result. \r\n\r\n**Fix**:\r\nWhen calculate the `y` value of label positions, we do not consider the height of tick marks. I fix this.\r\n\r\n**JSFiddle**:\r\nBefore:http://jsfiddle.net/o87wsq9h/2/\r\nAfter:http://jsfiddle.net/o87wsq9h/3/\r\n\r\nclose #2772","created_at":"2015-09-17T05:56:40Z","updated_at":"2015-09-23T18:13:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7620e0672637ec83e6d1cd21edb9e8bd00e48c91","assignee":{"login":"aicioara","id":3248682,"avatar_url":"https://avatars.githubusercontent.com/u/3248682?v=3","gravatar_id":"","url":"https://api.github.com/users/aicioara","html_url":"https://github.com/aicioara","followers_url":"https://api.github.com/users/aicioara/followers","following_url":"https://api.github.com/users/aicioara/following{/other_user}","gists_url":"https://api.github.com/users/aicioara/gists{/gist_id}","starred_url":"https://api.github.com/users/aicioara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aicioara/subscriptions","organizations_url":"https://api.github.com/users/aicioara/orgs","repos_url":"https://api.github.com/users/aicioara/repos","events_url":"https://api.github.com/users/aicioara/events{/privacy}","received_events_url":"https://api.github.com/users/aicioara/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/palantir/plottable/pulls/2778/commits","review_comments_url":"https://api.github.com/repos/palantir/plottable/pulls/2778/comments","review_comment_url":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/palantir/plottable/issues/2778/comments","statuses_url":"https://api.github.com/repos/palantir/plottable/statuses/ddc2881fcc9833503d903ac14310301f65686757","head":{"label":"palantir:2772fix","ref":"2772fix","sha":"ddc2881fcc9833503d903ac14310301f65686757","user":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"repo":{"id":16149854,"name":"plottable","full_name":"palantir/plottable","owner":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/palantir/plottable","description":"A library of modular chart components, built on D3","fork":false,"url":"https://api.github.com/repos/palantir/plottable","forks_url":"https://api.github.com/repos/palantir/plottable/forks","keys_url":"https://api.github.com/repos/palantir/plottable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/palantir/plottable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/palantir/plottable/teams","hooks_url":"https://api.github.com/repos/palantir/plottable/hooks","issue_events_url":"https://api.github.com/repos/palantir/plottable/issues/events{/number}","events_url":"https://api.github.com/repos/palantir/plottable/events","assignees_url":"https://api.github.com/repos/palantir/plottable/assignees{/user}","branches_url":"https://api.github.com/repos/palantir/plottable/branches{/branch}","tags_url":"https://api.github.com/repos/palantir/plottable/tags","blobs_url":"https://api.github.com/repos/palantir/plottable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/palantir/plottable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/palantir/plottable/git/refs{/sha}","trees_url":"https://api.github.com/repos/palantir/plottable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/palantir/plottable/statuses/{sha}","languages_url":"https://api.github.com/repos/palantir/plottable/languages","stargazers_url":"https://api.github.com/repos/palantir/plottable/stargazers","contributors_url":"https://api.github.com/repos/palantir/plottable/contributors","subscribers_url":"https://api.github.com/repos/palantir/plottable/subscribers","subscription_url":"https://api.github.com/repos/palantir/plottable/subscription","commits_url":"https://api.github.com/repos/palantir/plottable/commits{/sha}","git_commits_url":"https://api.github.com/repos/palantir/plottable/git/commits{/sha}","comments_url":"https://api.github.com/repos/palantir/plottable/comments{/number}","issue_comment_url":"https://api.github.com/repos/palantir/plottable/issues/comments{/number}","contents_url":"https://api.github.com/repos/palantir/plottable/contents/{+path}","compare_url":"https://api.github.com/repos/palantir/plottable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/palantir/plottable/merges","archive_url":"https://api.github.com/repos/palantir/plottable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/palantir/plottable/downloads","issues_url":"https://api.github.com/repos/palantir/plottable/issues{/number}","pulls_url":"https://api.github.com/repos/palantir/plottable/pulls{/number}","milestones_url":"https://api.github.com/repos/palantir/plottable/milestones{/number}","notifications_url":"https://api.github.com/repos/palantir/plottable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/palantir/plottable/labels{/name}","releases_url":"https://api.github.com/repos/palantir/plottable/releases{/id}","created_at":"2014-01-22T19:29:19Z","updated_at":"2015-09-23T11:58:26Z","pushed_at":"2015-09-23T17:37:14Z","git_url":"git://github.com/palantir/plottable.git","ssh_url":"git@github.com:palantir/plottable.git","clone_url":"https://github.com/palantir/plottable.git","svn_url":"https://github.com/palantir/plottable","homepage":"plottablejs.org","size":136612,"stargazers_count":725,"watchers_count":725,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":205,"forks":76,"open_issues":205,"watchers":725,"default_branch":"develop"}},"base":{"label":"palantir:develop","ref":"develop","sha":"9491d51d7d78bbf16cb2d02f1170e3b54314a181","user":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"repo":{"id":16149854,"name":"plottable","full_name":"palantir/plottable","owner":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/palantir/plottable","description":"A library of modular chart components, built on D3","fork":false,"url":"https://api.github.com/repos/palantir/plottable","forks_url":"https://api.github.com/repos/palantir/plottable/forks","keys_url":"https://api.github.com/repos/palantir/plottable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/palantir/plottable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/palantir/plottable/teams","hooks_url":"https://api.github.com/repos/palantir/plottable/hooks","issue_events_url":"https://api.github.com/repos/palantir/plottable/issues/events{/number}","events_url":"https://api.github.com/repos/palantir/plottable/events","assignees_url":"https://api.github.com/repos/palantir/plottable/assignees{/user}","branches_url":"https://api.github.com/repos/palantir/plottable/branches{/branch}","tags_url":"https://api.github.com/repos/palantir/plottable/tags","blobs_url":"https://api.github.com/repos/palantir/plottable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/palantir/plottable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/palantir/plottable/git/refs{/sha}","trees_url":"https://api.github.com/repos/palantir/plottable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/palantir/plottable/statuses/{sha}","languages_url":"https://api.github.com/repos/palantir/plottable/languages","stargazers_url":"https://api.github.com/repos/palantir/plottable/stargazers","contributors_url":"https://api.github.com/repos/palantir/plottable/contributors","subscribers_url":"https://api.github.com/repos/palantir/plottable/subscribers","subscription_url":"https://api.github.com/repos/palantir/plottable/subscription","commits_url":"https://api.github.com/repos/palantir/plottable/commits{/sha}","git_commits_url":"https://api.github.com/repos/palantir/plottable/git/commits{/sha}","comments_url":"https://api.github.com/repos/palantir/plottable/comments{/number}","issue_comment_url":"https://api.github.com/repos/palantir/plottable/issues/comments{/number}","contents_url":"https://api.github.com/repos/palantir/plottable/contents/{+path}","compare_url":"https://api.github.com/repos/palantir/plottable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/palantir/plottable/merges","archive_url":"https://api.github.com/repos/palantir/plottable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/palantir/plottable/downloads","issues_url":"https://api.github.com/repos/palantir/plottable/issues{/number}","pulls_url":"https://api.github.com/repos/palantir/plottable/pulls{/number}","milestones_url":"https://api.github.com/repos/palantir/plottable/milestones{/number}","notifications_url":"https://api.github.com/repos/palantir/plottable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/palantir/plottable/labels{/name}","releases_url":"https://api.github.com/repos/palantir/plottable/releases{/id}","created_at":"2014-01-22T19:29:19Z","updated_at":"2015-09-23T11:58:26Z","pushed_at":"2015-09-23T17:37:14Z","git_url":"git://github.com/palantir/plottable.git","ssh_url":"git@github.com:palantir/plottable.git","clone_url":"https://github.com/palantir/plottable.git","svn_url":"https://github.com/palantir/plottable","homepage":"plottablejs.org","size":136612,"stargazers_count":725,"watchers_count":725,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":205,"forks":76,"open_issues":205,"watchers":725,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2778"},"html":{"href":"https://github.com/palantir/plottable/pull/2778"},"issue":{"href":"https://api.github.com/repos/palantir/plottable/issues/2778"},"comments":{"href":"https://api.github.com/repos/palantir/plottable/issues/2778/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2778/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2778/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/plottable/statuses/ddc2881fcc9833503d903ac14310301f65686757"}}}}