{"action":"created","comment":{"url":"https://api.github.com/repos/IBM/carbon-charts/pulls/comments/232705184","pull_request_review_id":173959805,"id":232705184,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjcwNTE4NA==","diff_hunk":"@@ -162,6 +164,16 @@ export class BaseChart {\n \t\t\t}\n \t\t});\n \n+\t\tif (typeof this.fixedDataLabels === \"undefined\") {","path":"packages/core/src/base-chart.ts","position":13,"original_position":13,"commit_id":"dc9e19238f5d76f88d446108649d7e62099f9644","original_commit_id":"dc9e19238f5d76f88d446108649d7e62099f9644","user":{"login":"cal-smith","id":1744185,"node_id":"MDQ6VXNlcjE3NDQxODU=","avatar_url":"https://avatars1.githubusercontent.com/u/1744185?v=4","gravatar_id":"","url":"https://api.github.com/users/cal-smith","html_url":"https://github.com/cal-smith","followers_url":"https://api.github.com/users/cal-smith/followers","following_url":"https://api.github.com/users/cal-smith/following{/other_user}","gists_url":"https://api.github.com/users/cal-smith/gists{/gist_id}","starred_url":"https://api.github.com/users/cal-smith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cal-smith/subscriptions","organizations_url":"https://api.github.com/users/cal-smith/orgs","repos_url":"https://api.github.com/users/cal-smith/repos","events_url":"https://api.github.com/users/cal-smith/events{/privacy}","received_events_url":"https://api.github.com/users/cal-smith/received_events","type":"User","site_admin":false},"body":"I'd either flip this if statement around, or do `if(!this.fixedDataLabels)`, unless we need to check for specifically \"undefined\".","created_at":"2018-11-12T15:38:30Z","updated_at":"2018-11-12T15:38:36Z","html_url":"https://github.com/IBM/carbon-charts/pull/84#discussion_r232705184","pull_request_url":"https://api.github.com/repos/IBM/carbon-charts/pulls/84","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/IBM/carbon-charts/pulls/comments/232705184"},"html":{"href":"https://github.com/IBM/carbon-charts/pull/84#discussion_r232705184"},"pull_request":{"href":"https://api.github.com/repos/IBM/carbon-charts/pulls/84"}}},"pull_request":{"url":"https://api.github.com/repos/IBM/carbon-charts/pulls/84","id":229598688,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5NTk4Njg4","html_url":"https://github.com/IBM/carbon-charts/pull/84","diff_url":"https://github.com/IBM/carbon-charts/pull/84.diff","patch_url":"https://github.com/IBM/carbon-charts/pull/84.patch","issue_url":"https://api.github.com/repos/IBM/carbon-charts/issues/84","number":84,"state":"open","locked":false,"title":"Fix(core): Fix label colours on donut charts","user":{"login":"JohnPeng47","id":9957837,"node_id":"MDQ6VXNlcjk5NTc4Mzc=","avatar_url":"https://avatars3.githubusercontent.com/u/9957837?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnPeng47","html_url":"https://github.com/JohnPeng47","followers_url":"https://api.github.com/users/JohnPeng47/followers","following_url":"https://api.github.com/users/JohnPeng47/following{/other_user}","gists_url":"https://api.github.com/users/JohnPeng47/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnPeng47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnPeng47/subscriptions","organizations_url":"https://api.github.com/users/JohnPeng47/orgs","repos_url":"https://api.github.com/users/JohnPeng47/repos","events_url":"https://api.github.com/users/JohnPeng47/events{/privacy}","received_events_url":"https://api.github.com/users/JohnPeng47/received_events","type":"User","site_admin":false},"body":"On every chart re-render, color values gets mapped to data labels using d3.OrdinalScale.range().\r\nBecause donut chart reorders its label data due to sorting, the indices of the label changes while\r\nthe ordering of the colours remain static, resulting in labels without a fixed colour. So instead of\r\npassing the sorted labels to be mapped to colours, instead I take a copy of the whole set of labesl\r\nduring chart initalization, and use this instead. On every data update, I also check for the\r\naddition of new labels not present in the copy, and I push these to the copy array.\r\n\r\nCloses #68","created_at":"2018-11-09T06:18:02Z","updated_at":"2018-11-12T15:38:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7557d6b47940abb7c25582865228b290c9f01391","assignee":{"login":"zvonimirfras","id":9692126,"node_id":"MDQ6VXNlcjk2OTIxMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/9692126?v=4","gravatar_id":"","url":"https://api.github.com/users/zvonimirfras","html_url":"https://github.com/zvonimirfras","followers_url":"https://api.github.com/users/zvonimirfras/followers","following_url":"https://api.github.com/users/zvonimirfras/following{/other_user}","gists_url":"https://api.github.com/users/zvonimirfras/gists{/gist_id}","starred_url":"https://api.github.com/users/zvonimirfras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zvonimirfras/subscriptions","organizations_url":"https://api.github.com/users/zvonimirfras/orgs","repos_url":"https://api.github.com/users/zvonimirfras/repos","events_url":"https://api.github.com/users/zvonimirfras/events{/privacy}","received_events_url":"https://api.github.com/users/zvonimirfras/received_events","type":"User","site_admin":false},"assignees":[{"login":"zvonimirfras","id":9692126,"node_id":"MDQ6VXNlcjk2OTIxMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/9692126?v=4","gravatar_id":"","url":"https://api.github.com/users/zvonimirfras","html_url":"https://github.com/zvonimirfras","followers_url":"https://api.github.com/users/zvonimirfras/followers","following_url":"https://api.github.com/users/zvonimirfras/following{/other_user}","gists_url":"https://api.github.com/users/zvonimirfras/gists{/gist_id}","starred_url":"https://api.github.com/users/zvonimirfras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zvonimirfras/subscriptions","organizations_url":"https://api.github.com/users/zvonimirfras/orgs","repos_url":"https://api.github.com/users/zvonimirfras/repos","events_url":"https://api.github.com/users/zvonimirfras/events{/privacy}","received_events_url":"https://api.github.com/users/zvonimirfras/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"zvonimirfras","id":9692126,"node_id":"MDQ6VXNlcjk2OTIxMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/9692126?v=4","gravatar_id":"","url":"https://api.github.com/users/zvonimirfras","html_url":"https://github.com/zvonimirfras","followers_url":"https://api.github.com/users/zvonimirfras/followers","following_url":"https://api.github.com/users/zvonimirfras/following{/other_user}","gists_url":"https://api.github.com/users/zvonimirfras/gists{/gist_id}","starred_url":"https://api.github.com/users/zvonimirfras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zvonimirfras/subscriptions","organizations_url":"https://api.github.com/users/zvonimirfras/orgs","repos_url":"https://api.github.com/users/zvonimirfras/repos","events_url":"https://api.github.com/users/zvonimirfras/events{/privacy}","received_events_url":"https://api.github.com/users/zvonimirfras/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/IBM/carbon-charts/pulls/84/commits","review_comments_url":"https://api.github.com/repos/IBM/carbon-charts/pulls/84/comments","review_comment_url":"https://api.github.com/repos/IBM/carbon-charts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IBM/carbon-charts/issues/84/comments","statuses_url":"https://api.github.com/repos/IBM/carbon-charts/statuses/dc9e19238f5d76f88d446108649d7e62099f9644","head":{"label":"JohnPeng47:master","ref":"master","sha":"dc9e19238f5d76f88d446108649d7e62099f9644","user":{"login":"JohnPeng47","id":9957837,"node_id":"MDQ6VXNlcjk5NTc4Mzc=","avatar_url":"https://avatars3.githubusercontent.com/u/9957837?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnPeng47","html_url":"https://github.com/JohnPeng47","followers_url":"https://api.github.com/users/JohnPeng47/followers","following_url":"https://api.github.com/users/JohnPeng47/following{/other_user}","gists_url":"https://api.github.com/users/JohnPeng47/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnPeng47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnPeng47/subscriptions","organizations_url":"https://api.github.com/users/JohnPeng47/orgs","repos_url":"https://api.github.com/users/JohnPeng47/repos","events_url":"https://api.github.com/users/JohnPeng47/events{/privacy}","received_events_url":"https://api.github.com/users/JohnPeng47/received_events","type":"User","site_admin":false},"repo":{"id":156795082,"node_id":"MDEwOlJlcG9zaXRvcnkxNTY3OTUwODI=","name":"carbon-charts","full_name":"JohnPeng47/carbon-charts","private":false,"owner":{"login":"JohnPeng47","id":9957837,"node_id":"MDQ6VXNlcjk5NTc4Mzc=","avatar_url":"https://avatars3.githubusercontent.com/u/9957837?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnPeng47","html_url":"https://github.com/JohnPeng47","followers_url":"https://api.github.com/users/JohnPeng47/followers","following_url":"https://api.github.com/users/JohnPeng47/following{/other_user}","gists_url":"https://api.github.com/users/JohnPeng47/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnPeng47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnPeng47/subscriptions","organizations_url":"https://api.github.com/users/JohnPeng47/orgs","repos_url":"https://api.github.com/users/JohnPeng47/repos","events_url":"https://api.github.com/users/JohnPeng47/events{/privacy}","received_events_url":"https://api.github.com/users/JohnPeng47/received_events","type":"User","site_admin":false},"html_url":"https://github.com/JohnPeng47/carbon-charts","description":":bar_chart: :chart_with_upwards_trend: Reusable charts implemented using D3 & typescript","fork":true,"url":"https://api.github.com/repos/JohnPeng47/carbon-charts","forks_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/forks","keys_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/teams","hooks_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/hooks","issue_events_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/issues/events{/number}","events_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/events","assignees_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/assignees{/user}","branches_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/branches{/branch}","tags_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/tags","blobs_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/git/refs{/sha}","trees_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/statuses/{sha}","languages_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/languages","stargazers_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/stargazers","contributors_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/contributors","subscribers_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/subscribers","subscription_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/subscription","commits_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/commits{/sha}","git_commits_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/git/commits{/sha}","comments_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/comments{/number}","issue_comment_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/issues/comments{/number}","contents_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/contents/{+path}","compare_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/merges","archive_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/downloads","issues_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/issues{/number}","pulls_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/pulls{/number}","milestones_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/milestones{/number}","notifications_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/labels{/name}","releases_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/releases{/id}","deployments_url":"https://api.github.com/repos/JohnPeng47/carbon-charts/deployments","created_at":"2018-11-09T01:56:05Z","updated_at":"2018-11-09T06:44:21Z","pushed_at":"2018-11-09T06:44:20Z","git_url":"git://github.com/JohnPeng47/carbon-charts.git","ssh_url":"git@github.com:JohnPeng47/carbon-charts.git","clone_url":"https://github.com/JohnPeng47/carbon-charts.git","svn_url":"https://github.com/JohnPeng47/carbon-charts","homepage":"https://charts.carbondesignsystem.com","size":10303,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"IBM:master","ref":"master","sha":"a5fffcf265caa4dbf17d19e252cdd34ac6b989a5","user":{"login":"IBM","id":1459110,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0NTkxMTA=","avatar_url":"https://avatars0.githubusercontent.com/u/1459110?v=4","gravatar_id":"","url":"https://api.github.com/users/IBM","html_url":"https://github.com/IBM","followers_url":"https://api.github.com/users/IBM/followers","following_url":"https://api.github.com/users/IBM/following{/other_user}","gists_url":"https://api.github.com/users/IBM/gists{/gist_id}","starred_url":"https://api.github.com/users/IBM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IBM/subscriptions","organizations_url":"https://api.github.com/users/IBM/orgs","repos_url":"https://api.github.com/users/IBM/repos","events_url":"https://api.github.com/users/IBM/events{/privacy}","received_events_url":"https://api.github.com/users/IBM/received_events","type":"Organization","site_admin":false},"repo":{"id":143059476,"node_id":"MDEwOlJlcG9zaXRvcnkxNDMwNTk0NzY=","name":"carbon-charts","full_name":"IBM/carbon-charts","private":false,"owner":{"login":"IBM","id":1459110,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0NTkxMTA=","avatar_url":"https://avatars0.githubusercontent.com/u/1459110?v=4","gravatar_id":"","url":"https://api.github.com/users/IBM","html_url":"https://github.com/IBM","followers_url":"https://api.github.com/users/IBM/followers","following_url":"https://api.github.com/users/IBM/following{/other_user}","gists_url":"https://api.github.com/users/IBM/gists{/gist_id}","starred_url":"https://api.github.com/users/IBM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IBM/subscriptions","organizations_url":"https://api.github.com/users/IBM/orgs","repos_url":"https://api.github.com/users/IBM/repos","events_url":"https://api.github.com/users/IBM/events{/privacy}","received_events_url":"https://api.github.com/users/IBM/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/IBM/carbon-charts","description":":bar_chart: :chart_with_upwards_trend: Reusable charts implemented using D3 & typescript","fork":false,"url":"https://api.github.com/repos/IBM/carbon-charts","forks_url":"https://api.github.com/repos/IBM/carbon-charts/forks","keys_url":"https://api.github.com/repos/IBM/carbon-charts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IBM/carbon-charts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IBM/carbon-charts/teams","hooks_url":"https://api.github.com/repos/IBM/carbon-charts/hooks","issue_events_url":"https://api.github.com/repos/IBM/carbon-charts/issues/events{/number}","events_url":"https://api.github.com/repos/IBM/carbon-charts/events","assignees_url":"https://api.github.com/repos/IBM/carbon-charts/assignees{/user}","branches_url":"https://api.github.com/repos/IBM/carbon-charts/branches{/branch}","tags_url":"https://api.github.com/repos/IBM/carbon-charts/tags","blobs_url":"https://api.github.com/repos/IBM/carbon-charts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IBM/carbon-charts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IBM/carbon-charts/git/refs{/sha}","trees_url":"https://api.github.com/repos/IBM/carbon-charts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IBM/carbon-charts/statuses/{sha}","languages_url":"https://api.github.com/repos/IBM/carbon-charts/languages","stargazers_url":"https://api.github.com/repos/IBM/carbon-charts/stargazers","contributors_url":"https://api.github.com/repos/IBM/carbon-charts/contributors","subscribers_url":"https://api.github.com/repos/IBM/carbon-charts/subscribers","subscription_url":"https://api.github.com/repos/IBM/carbon-charts/subscription","commits_url":"https://api.github.com/repos/IBM/carbon-charts/commits{/sha}","git_commits_url":"https://api.github.com/repos/IBM/carbon-charts/git/commits{/sha}","comments_url":"https://api.github.com/repos/IBM/carbon-charts/comments{/number}","issue_comment_url":"https://api.github.com/repos/IBM/carbon-charts/issues/comments{/number}","contents_url":"https://api.github.com/repos/IBM/carbon-charts/contents/{+path}","compare_url":"https://api.github.com/repos/IBM/carbon-charts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IBM/carbon-charts/merges","archive_url":"https://api.github.com/repos/IBM/carbon-charts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IBM/carbon-charts/downloads","issues_url":"https://api.github.com/repos/IBM/carbon-charts/issues{/number}","pulls_url":"https://api.github.com/repos/IBM/carbon-charts/pulls{/number}","milestones_url":"https://api.github.com/repos/IBM/carbon-charts/milestones{/number}","notifications_url":"https://api.github.com/repos/IBM/carbon-charts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IBM/carbon-charts/labels{/name}","releases_url":"https://api.github.com/repos/IBM/carbon-charts/releases{/id}","deployments_url":"https://api.github.com/repos/IBM/carbon-charts/deployments","created_at":"2018-07-31T19:41:49Z","updated_at":"2018-11-09T14:54:27Z","pushed_at":"2018-11-12T07:02:56Z","git_url":"git://github.com/IBM/carbon-charts.git","ssh_url":"git@github.com:IBM/carbon-charts.git","clone_url":"https://github.com/IBM/carbon-charts.git","svn_url":"https://github.com/IBM/carbon-charts","homepage":"https://charts.carbondesignsystem.com","size":10546,"stargazers_count":25,"watchers_count":25,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":29,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":13,"open_issues":29,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IBM/carbon-charts/pulls/84"},"html":{"href":"https://github.com/IBM/carbon-charts/pull/84"},"issue":{"href":"https://api.github.com/repos/IBM/carbon-charts/issues/84"},"comments":{"href":"https://api.github.com/repos/IBM/carbon-charts/issues/84/comments"},"review_comments":{"href":"https://api.github.com/repos/IBM/carbon-charts/pulls/84/comments"},"review_comment":{"href":"https://api.github.com/repos/IBM/carbon-charts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IBM/carbon-charts/pulls/84/commits"},"statuses":{"href":"https://api.github.com/repos/IBM/carbon-charts/statuses/dc9e19238f5d76f88d446108649d7e62099f9644"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"cal-smith"}}