{"action":"created","comment":{"url":"https://api.github.com/repos/Addepar/ember-charts/pulls/comments/32791538","id":32791538,"diff_hunk":"@@ -219,3 +228,10 @@ Ember.Charts.Legend = Ember.Mixin.create\n       .text((d) -> d.label)\n       .attr(@get 'legendLabelAttrs')\n       .call(labelTrimmer.get 'trim')\n+\n+    # we use averageLegendLabelWidth in order to estimate how much to move the\n+    # labels to make them seem roughly centered\n+    totalLabelWidth = 0\n+    legend.selectAll('text').each ->\n+      totalLabelWidth += this.getComputedTextLength()\n+    @set 'averageLegendLabelWidth', totalLabelWidth / @get 'legendItems.length'","path":"src/charts/legend.coffee","position":47,"original_position":47,"commit_id":"42c1e97b247286af5ab5e8b6fdc5be45f21d693a","original_commit_id":"42c1e97b247286af5ab5e8b6fdc5be45f21d693a","user":{"login":"Dylnuge","id":118624,"avatar_url":"https://avatars.githubusercontent.com/u/118624?v=3","gravatar_id":"","url":"https://api.github.com/users/Dylnuge","html_url":"https://github.com/Dylnuge","followers_url":"https://api.github.com/users/Dylnuge/followers","following_url":"https://api.github.com/users/Dylnuge/following{/other_user}","gists_url":"https://api.github.com/users/Dylnuge/gists{/gist_id}","starred_url":"https://api.github.com/users/Dylnuge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dylnuge/subscriptions","organizations_url":"https://api.github.com/users/Dylnuge/orgs","repos_url":"https://api.github.com/users/Dylnuge/repos","events_url":"https://api.github.com/users/Dylnuge/events{/privacy}","received_events_url":"https://api.github.com/users/Dylnuge/received_events","type":"User","site_admin":false},"body":"Oh OK, it's set here. It should probably be A) moved from where it is defined above (so as not to make it unclear if the user can set it) and B) turned into an Ember computed property if possible (can observe `legendItems.[]`)","created_at":"2015-06-19T00:04:34Z","updated_at":"2015-06-19T00:04:34Z","html_url":"https://github.com/Addepar/ember-charts/pull/87#discussion_r32791538","pull_request_url":"https://api.github.com/repos/Addepar/ember-charts/pulls/87","_links":{"self":{"href":"https://api.github.com/repos/Addepar/ember-charts/pulls/comments/32791538"},"html":{"href":"https://github.com/Addepar/ember-charts/pull/87#discussion_r32791538"},"pull_request":{"href":"https://api.github.com/repos/Addepar/ember-charts/pulls/87"}}},"pull_request":{"url":"https://api.github.com/repos/Addepar/ember-charts/pulls/87","id":37956299,"html_url":"https://github.com/Addepar/ember-charts/pull/87","diff_url":"https://github.com/Addepar/ember-charts/pull/87.diff","patch_url":"https://github.com/Addepar/ember-charts/pull/87.patch","issue_url":"https://api.github.com/repos/Addepar/ember-charts/issues/87","number":87,"state":"open","locked":false,"title":"Remove padding from graphs that do not require it, rework legend","user":{"login":"NicholasMohr","id":3210747,"avatar_url":"https://avatars.githubusercontent.com/u/3210747?v=3","gravatar_id":"","url":"https://api.github.com/users/NicholasMohr","html_url":"https://github.com/NicholasMohr","followers_url":"https://api.github.com/users/NicholasMohr/followers","following_url":"https://api.github.com/users/NicholasMohr/following{/other_user}","gists_url":"https://api.github.com/users/NicholasMohr/gists{/gist_id}","starred_url":"https://api.github.com/users/NicholasMohr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NicholasMohr/subscriptions","organizations_url":"https://api.github.com/users/NicholasMohr/orgs","repos_url":"https://api.github.com/users/NicholasMohr/repos","events_url":"https://api.github.com/users/NicholasMohr/events{/privacy}","received_events_url":"https://api.github.com/users/NicholasMohr/received_events","type":"User","site_admin":false},"body":"Removed the 30 pixel margin for vertical bars, scatter, time\r\nseries.  Lined up the labels on the left side of these graphs\r\nto the left edge of the graph using the computed length of\r\nthe labels' strings\r\n\r\nThis set of changes revealed that the legend relied on\r\nthe 30 pixel margin to seem centered.  Added an offset using\r\nthe average length of the legend label.","created_at":"2015-06-17T22:59:31Z","updated_at":"2015-06-19T00:04:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Addepar/ember-charts/pulls/87/commits","review_comments_url":"https://api.github.com/repos/Addepar/ember-charts/pulls/87/comments","review_comment_url":"https://api.github.com/repos/Addepar/ember-charts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Addepar/ember-charts/issues/87/comments","statuses_url":"https://api.github.com/repos/Addepar/ember-charts/statuses/42c1e97b247286af5ab5e8b6fdc5be45f21d693a","head":{"label":"Addepar:nick/remove_padding","ref":"nick/remove_padding","sha":"42c1e97b247286af5ab5e8b6fdc5be45f21d693a","user":{"login":"Addepar","id":847867,"avatar_url":"https://avatars.githubusercontent.com/u/847867?v=3","gravatar_id":"","url":"https://api.github.com/users/Addepar","html_url":"https://github.com/Addepar","followers_url":"https://api.github.com/users/Addepar/followers","following_url":"https://api.github.com/users/Addepar/following{/other_user}","gists_url":"https://api.github.com/users/Addepar/gists{/gist_id}","starred_url":"https://api.github.com/users/Addepar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Addepar/subscriptions","organizations_url":"https://api.github.com/users/Addepar/orgs","repos_url":"https://api.github.com/users/Addepar/repos","events_url":"https://api.github.com/users/Addepar/events{/privacy}","received_events_url":"https://api.github.com/users/Addepar/received_events","type":"Organization","site_admin":false},"repo":{"id":13790555,"name":"ember-charts","full_name":"Addepar/ember-charts","owner":{"login":"Addepar","id":847867,"avatar_url":"https://avatars.githubusercontent.com/u/847867?v=3","gravatar_id":"","url":"https://api.github.com/users/Addepar","html_url":"https://github.com/Addepar","followers_url":"https://api.github.com/users/Addepar/followers","following_url":"https://api.github.com/users/Addepar/following{/other_user}","gists_url":"https://api.github.com/users/Addepar/gists{/gist_id}","starred_url":"https://api.github.com/users/Addepar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Addepar/subscriptions","organizations_url":"https://api.github.com/users/Addepar/orgs","repos_url":"https://api.github.com/users/Addepar/repos","events_url":"https://api.github.com/users/Addepar/events{/privacy}","received_events_url":"https://api.github.com/users/Addepar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Addepar/ember-charts","description":"","fork":false,"url":"https://api.github.com/repos/Addepar/ember-charts","forks_url":"https://api.github.com/repos/Addepar/ember-charts/forks","keys_url":"https://api.github.com/repos/Addepar/ember-charts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Addepar/ember-charts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Addepar/ember-charts/teams","hooks_url":"https://api.github.com/repos/Addepar/ember-charts/hooks","issue_events_url":"https://api.github.com/repos/Addepar/ember-charts/issues/events{/number}","events_url":"https://api.github.com/repos/Addepar/ember-charts/events","assignees_url":"https://api.github.com/repos/Addepar/ember-charts/assignees{/user}","branches_url":"https://api.github.com/repos/Addepar/ember-charts/branches{/branch}","tags_url":"https://api.github.com/repos/Addepar/ember-charts/tags","blobs_url":"https://api.github.com/repos/Addepar/ember-charts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Addepar/ember-charts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Addepar/ember-charts/git/refs{/sha}","trees_url":"https://api.github.com/repos/Addepar/ember-charts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Addepar/ember-charts/statuses/{sha}","languages_url":"https://api.github.com/repos/Addepar/ember-charts/languages","stargazers_url":"https://api.github.com/repos/Addepar/ember-charts/stargazers","contributors_url":"https://api.github.com/repos/Addepar/ember-charts/contributors","subscribers_url":"https://api.github.com/repos/Addepar/ember-charts/subscribers","subscription_url":"https://api.github.com/repos/Addepar/ember-charts/subscription","commits_url":"https://api.github.com/repos/Addepar/ember-charts/commits{/sha}","git_commits_url":"https://api.github.com/repos/Addepar/ember-charts/git/commits{/sha}","comments_url":"https://api.github.com/repos/Addepar/ember-charts/comments{/number}","issue_comment_url":"https://api.github.com/repos/Addepar/ember-charts/issues/comments{/number}","contents_url":"https://api.github.com/repos/Addepar/ember-charts/contents/{+path}","compare_url":"https://api.github.com/repos/Addepar/ember-charts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Addepar/ember-charts/merges","archive_url":"https://api.github.com/repos/Addepar/ember-charts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Addepar/ember-charts/downloads","issues_url":"https://api.github.com/repos/Addepar/ember-charts/issues{/number}","pulls_url":"https://api.github.com/repos/Addepar/ember-charts/pulls{/number}","milestones_url":"https://api.github.com/repos/Addepar/ember-charts/milestones{/number}","notifications_url":"https://api.github.com/repos/Addepar/ember-charts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Addepar/ember-charts/labels{/name}","releases_url":"https://api.github.com/repos/Addepar/ember-charts/releases{/id}","created_at":"2013-10-23T01:27:05Z","updated_at":"2015-06-18T18:13:00Z","pushed_at":"2015-06-17T22:59:31Z","git_url":"git://github.com/Addepar/ember-charts.git","ssh_url":"git@github.com:Addepar/ember-charts.git","clone_url":"https://github.com/Addepar/ember-charts.git","svn_url":"https://github.com/Addepar/ember-charts","homepage":null,"size":7529,"stargazers_count":614,"watchers_count":614,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":94,"mirror_url":null,"open_issues_count":10,"forks":94,"open_issues":10,"watchers":614,"default_branch":"master"}},"base":{"label":"Addepar:master","ref":"master","sha":"1e39d0d5688691eb09bc63b97cfa74b585e28cdc","user":{"login":"Addepar","id":847867,"avatar_url":"https://avatars.githubusercontent.com/u/847867?v=3","gravatar_id":"","url":"https://api.github.com/users/Addepar","html_url":"https://github.com/Addepar","followers_url":"https://api.github.com/users/Addepar/followers","following_url":"https://api.github.com/users/Addepar/following{/other_user}","gists_url":"https://api.github.com/users/Addepar/gists{/gist_id}","starred_url":"https://api.github.com/users/Addepar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Addepar/subscriptions","organizations_url":"https://api.github.com/users/Addepar/orgs","repos_url":"https://api.github.com/users/Addepar/repos","events_url":"https://api.github.com/users/Addepar/events{/privacy}","received_events_url":"https://api.github.com/users/Addepar/received_events","type":"Organization","site_admin":false},"repo":{"id":13790555,"name":"ember-charts","full_name":"Addepar/ember-charts","owner":{"login":"Addepar","id":847867,"avatar_url":"https://avatars.githubusercontent.com/u/847867?v=3","gravatar_id":"","url":"https://api.github.com/users/Addepar","html_url":"https://github.com/Addepar","followers_url":"https://api.github.com/users/Addepar/followers","following_url":"https://api.github.com/users/Addepar/following{/other_user}","gists_url":"https://api.github.com/users/Addepar/gists{/gist_id}","starred_url":"https://api.github.com/users/Addepar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Addepar/subscriptions","organizations_url":"https://api.github.com/users/Addepar/orgs","repos_url":"https://api.github.com/users/Addepar/repos","events_url":"https://api.github.com/users/Addepar/events{/privacy}","received_events_url":"https://api.github.com/users/Addepar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Addepar/ember-charts","description":"","fork":false,"url":"https://api.github.com/repos/Addepar/ember-charts","forks_url":"https://api.github.com/repos/Addepar/ember-charts/forks","keys_url":"https://api.github.com/repos/Addepar/ember-charts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Addepar/ember-charts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Addepar/ember-charts/teams","hooks_url":"https://api.github.com/repos/Addepar/ember-charts/hooks","issue_events_url":"https://api.github.com/repos/Addepar/ember-charts/issues/events{/number}","events_url":"https://api.github.com/repos/Addepar/ember-charts/events","assignees_url":"https://api.github.com/repos/Addepar/ember-charts/assignees{/user}","branches_url":"https://api.github.com/repos/Addepar/ember-charts/branches{/branch}","tags_url":"https://api.github.com/repos/Addepar/ember-charts/tags","blobs_url":"https://api.github.com/repos/Addepar/ember-charts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Addepar/ember-charts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Addepar/ember-charts/git/refs{/sha}","trees_url":"https://api.github.com/repos/Addepar/ember-charts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Addepar/ember-charts/statuses/{sha}","languages_url":"https://api.github.com/repos/Addepar/ember-charts/languages","stargazers_url":"https://api.github.com/repos/Addepar/ember-charts/stargazers","contributors_url":"https://api.github.com/repos/Addepar/ember-charts/contributors","subscribers_url":"https://api.github.com/repos/Addepar/ember-charts/subscribers","subscription_url":"https://api.github.com/repos/Addepar/ember-charts/subscription","commits_url":"https://api.github.com/repos/Addepar/ember-charts/commits{/sha}","git_commits_url":"https://api.github.com/repos/Addepar/ember-charts/git/commits{/sha}","comments_url":"https://api.github.com/repos/Addepar/ember-charts/comments{/number}","issue_comment_url":"https://api.github.com/repos/Addepar/ember-charts/issues/comments{/number}","contents_url":"https://api.github.com/repos/Addepar/ember-charts/contents/{+path}","compare_url":"https://api.github.com/repos/Addepar/ember-charts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Addepar/ember-charts/merges","archive_url":"https://api.github.com/repos/Addepar/ember-charts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Addepar/ember-charts/downloads","issues_url":"https://api.github.com/repos/Addepar/ember-charts/issues{/number}","pulls_url":"https://api.github.com/repos/Addepar/ember-charts/pulls{/number}","milestones_url":"https://api.github.com/repos/Addepar/ember-charts/milestones{/number}","notifications_url":"https://api.github.com/repos/Addepar/ember-charts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Addepar/ember-charts/labels{/name}","releases_url":"https://api.github.com/repos/Addepar/ember-charts/releases{/id}","created_at":"2013-10-23T01:27:05Z","updated_at":"2015-06-18T18:13:00Z","pushed_at":"2015-06-17T22:59:31Z","git_url":"git://github.com/Addepar/ember-charts.git","ssh_url":"git@github.com:Addepar/ember-charts.git","clone_url":"https://github.com/Addepar/ember-charts.git","svn_url":"https://github.com/Addepar/ember-charts","homepage":null,"size":7529,"stargazers_count":614,"watchers_count":614,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":94,"mirror_url":null,"open_issues_count":10,"forks":94,"open_issues":10,"watchers":614,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Addepar/ember-charts/pulls/87"},"html":{"href":"https://github.com/Addepar/ember-charts/pull/87"},"issue":{"href":"https://api.github.com/repos/Addepar/ember-charts/issues/87"},"comments":{"href":"https://api.github.com/repos/Addepar/ember-charts/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/Addepar/ember-charts/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/Addepar/ember-charts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Addepar/ember-charts/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/Addepar/ember-charts/statuses/42c1e97b247286af5ab5e8b6fdc5be45f21d693a"}}}}