{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/plottable/pulls/comments/42098585","id":42098585,"diff_hunk":"@@ -74,7 +74,14 @@ export class Drawer {\n    * @param{any[]} data The data to be drawn\n    */\n   private _bindSelectionData(data: any[]) {\n-    let dataElements = this.selection().data(data);\n+    // if the dataset has a key, use it when binding the data   \n+    let dataElements: d3.selection.Update<any>;\n+    if (this._dataset && this._dataset.keyFunction()) {","path":"src/drawers/drawer.ts","position":7,"original_position":7,"commit_id":"369620657d2d18c7b538281a6bf1fce3d869b4a7","original_commit_id":"369620657d2d18c7b538281a6bf1fce3d869b4a7","user":{"login":"bluong","id":1448299,"avatar_url":"https://avatars.githubusercontent.com/u/1448299?v=3","gravatar_id":"","url":"https://api.github.com/users/bluong","html_url":"https://github.com/bluong","followers_url":"https://api.github.com/users/bluong/followers","following_url":"https://api.github.com/users/bluong/following{/other_user}","gists_url":"https://api.github.com/users/bluong/gists{/gist_id}","starred_url":"https://api.github.com/users/bluong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluong/subscriptions","organizations_url":"https://api.github.com/users/bluong/orgs","repos_url":"https://api.github.com/users/bluong/repos","events_url":"https://api.github.com/users/bluong/events{/privacy}","received_events_url":"https://api.github.com/users/bluong/received_events","type":"User","site_admin":false},"body":"Since it seems that `this._dataset.keyFunction()` will never be `null` (it is by default using the index as the key, and there is a guard surrounding setting it to `null`), do we need the above guard?","created_at":"2015-10-15T09:02:07Z","updated_at":"2015-10-15T09:02:07Z","html_url":"https://github.com/palantir/plottable/pull/2870#discussion_r42098585","pull_request_url":"https://api.github.com/repos/palantir/plottable/pulls/2870","_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments/42098585"},"html":{"href":"https://github.com/palantir/plottable/pull/2870#discussion_r42098585"},"pull_request":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2870"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/plottable/pulls/2870","id":47397882,"html_url":"https://github.com/palantir/plottable/pull/2870","diff_url":"https://github.com/palantir/plottable/pull/2870.diff","patch_url":"https://github.com/palantir/plottable/pull/2870.patch","issue_url":"https://api.github.com/repos/palantir/plottable/issues/2870","number":2870,"state":"open","locked":false,"title":"Implement Data.KeyFunction","user":{"login":"softwords","id":8971705,"avatar_url":"https://avatars.githubusercontent.com/u/8971705?v=3","gravatar_id":"","url":"https://api.github.com/users/softwords","html_url":"https://github.com/softwords","followers_url":"https://api.github.com/users/softwords/followers","following_url":"https://api.github.com/users/softwords/following{/other_user}","gists_url":"https://api.github.com/users/softwords/gists{/gist_id}","starred_url":"https://api.github.com/users/softwords/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softwords/subscriptions","organizations_url":"https://api.github.com/users/softwords/orgs","repos_url":"https://api.github.com/users/softwords/repos","events_url":"https://api.github.com/users/softwords/events{/privacy}","received_events_url":"https://api.github.com/users/softwords/received_events","type":"User","site_admin":false},"body":"Resubmitted against objectConstancy branch - previously #2833\r\nalso see issue #2512 \r\nThis pull request\r\n\r\nadds the key function to Dataset\r\nuses this key in Drawer when binding data to the selection\r\nprovides 2 predefined keys:\r\n-- NoConstancy - which will return a new value each time it is called, therefore ensuring that there is never object constancy; that is, all elements in the selection are removed and recreated\r\n-- useIndex - returns the index of the datum n the array, which is the default behaviour of d3 anyway\r\n\r\nThis PR provides a necessary foundation for developing animations in plottable that respect \"object constancy\" - proving visual representation of elements moving, entering or exiting the datasets being plotted.","created_at":"2015-10-12T09:06:42Z","updated_at":"2015-10-15T09:02:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5ae1080aec255505ceebe360851b0ee5b03c3008","assignee":{"login":"crmorford","id":7527733,"avatar_url":"https://avatars.githubusercontent.com/u/7527733?v=3","gravatar_id":"","url":"https://api.github.com/users/crmorford","html_url":"https://github.com/crmorford","followers_url":"https://api.github.com/users/crmorford/followers","following_url":"https://api.github.com/users/crmorford/following{/other_user}","gists_url":"https://api.github.com/users/crmorford/gists{/gist_id}","starred_url":"https://api.github.com/users/crmorford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crmorford/subscriptions","organizations_url":"https://api.github.com/users/crmorford/orgs","repos_url":"https://api.github.com/users/crmorford/repos","events_url":"https://api.github.com/users/crmorford/events{/privacy}","received_events_url":"https://api.github.com/users/crmorford/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/palantir/plottable/pulls/2870/commits","review_comments_url":"https://api.github.com/repos/palantir/plottable/pulls/2870/comments","review_comment_url":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/palantir/plottable/issues/2870/comments","statuses_url":"https://api.github.com/repos/palantir/plottable/statuses/369620657d2d18c7b538281a6bf1fce3d869b4a7","head":{"label":"softwords:DatasetKey","ref":"DatasetKey","sha":"369620657d2d18c7b538281a6bf1fce3d869b4a7","user":{"login":"softwords","id":8971705,"avatar_url":"https://avatars.githubusercontent.com/u/8971705?v=3","gravatar_id":"","url":"https://api.github.com/users/softwords","html_url":"https://github.com/softwords","followers_url":"https://api.github.com/users/softwords/followers","following_url":"https://api.github.com/users/softwords/following{/other_user}","gists_url":"https://api.github.com/users/softwords/gists{/gist_id}","starred_url":"https://api.github.com/users/softwords/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softwords/subscriptions","organizations_url":"https://api.github.com/users/softwords/orgs","repos_url":"https://api.github.com/users/softwords/repos","events_url":"https://api.github.com/users/softwords/events{/privacy}","received_events_url":"https://api.github.com/users/softwords/received_events","type":"User","site_admin":false},"repo":{"id":42768727,"name":"plottable","full_name":"softwords/plottable","owner":{"login":"softwords","id":8971705,"avatar_url":"https://avatars.githubusercontent.com/u/8971705?v=3","gravatar_id":"","url":"https://api.github.com/users/softwords","html_url":"https://github.com/softwords","followers_url":"https://api.github.com/users/softwords/followers","following_url":"https://api.github.com/users/softwords/following{/other_user}","gists_url":"https://api.github.com/users/softwords/gists{/gist_id}","starred_url":"https://api.github.com/users/softwords/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softwords/subscriptions","organizations_url":"https://api.github.com/users/softwords/orgs","repos_url":"https://api.github.com/users/softwords/repos","events_url":"https://api.github.com/users/softwords/events{/privacy}","received_events_url":"https://api.github.com/users/softwords/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/softwords/plottable","description":"A library of modular chart components, built on D3","fork":true,"url":"https://api.github.com/repos/softwords/plottable","forks_url":"https://api.github.com/repos/softwords/plottable/forks","keys_url":"https://api.github.com/repos/softwords/plottable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/softwords/plottable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/softwords/plottable/teams","hooks_url":"https://api.github.com/repos/softwords/plottable/hooks","issue_events_url":"https://api.github.com/repos/softwords/plottable/issues/events{/number}","events_url":"https://api.github.com/repos/softwords/plottable/events","assignees_url":"https://api.github.com/repos/softwords/plottable/assignees{/user}","branches_url":"https://api.github.com/repos/softwords/plottable/branches{/branch}","tags_url":"https://api.github.com/repos/softwords/plottable/tags","blobs_url":"https://api.github.com/repos/softwords/plottable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/softwords/plottable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/softwords/plottable/git/refs{/sha}","trees_url":"https://api.github.com/repos/softwords/plottable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/softwords/plottable/statuses/{sha}","languages_url":"https://api.github.com/repos/softwords/plottable/languages","stargazers_url":"https://api.github.com/repos/softwords/plottable/stargazers","contributors_url":"https://api.github.com/repos/softwords/plottable/contributors","subscribers_url":"https://api.github.com/repos/softwords/plottable/subscribers","subscription_url":"https://api.github.com/repos/softwords/plottable/subscription","commits_url":"https://api.github.com/repos/softwords/plottable/commits{/sha}","git_commits_url":"https://api.github.com/repos/softwords/plottable/git/commits{/sha}","comments_url":"https://api.github.com/repos/softwords/plottable/comments{/number}","issue_comment_url":"https://api.github.com/repos/softwords/plottable/issues/comments{/number}","contents_url":"https://api.github.com/repos/softwords/plottable/contents/{+path}","compare_url":"https://api.github.com/repos/softwords/plottable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/softwords/plottable/merges","archive_url":"https://api.github.com/repos/softwords/plottable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/softwords/plottable/downloads","issues_url":"https://api.github.com/repos/softwords/plottable/issues{/number}","pulls_url":"https://api.github.com/repos/softwords/plottable/pulls{/number}","milestones_url":"https://api.github.com/repos/softwords/plottable/milestones{/number}","notifications_url":"https://api.github.com/repos/softwords/plottable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/softwords/plottable/labels{/name}","releases_url":"https://api.github.com/repos/softwords/plottable/releases{/id}","created_at":"2015-09-19T10:20:05Z","updated_at":"2015-09-19T10:20:07Z","pushed_at":"2015-10-15T07:30:46Z","git_url":"git://github.com/softwords/plottable.git","ssh_url":"git@github.com:softwords/plottable.git","clone_url":"https://github.com/softwords/plottable.git","svn_url":"https://github.com/softwords/plottable","homepage":"plottablejs.org","size":63256,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"palantir:objectConstancy","ref":"objectConstancy","sha":"2fd6f1145039fad548d40d68fee9e7efd94db886","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-10-14T21:13:03Z","pushed_at":"2015-10-15T03:16:52Z","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":137794,"stargazers_count":749,"watchers_count":749,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":80,"mirror_url":null,"open_issues_count":225,"forks":80,"open_issues":225,"watchers":749,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2870"},"html":{"href":"https://github.com/palantir/plottable/pull/2870"},"issue":{"href":"https://api.github.com/repos/palantir/plottable/issues/2870"},"comments":{"href":"https://api.github.com/repos/palantir/plottable/issues/2870/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2870/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2870/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/plottable/statuses/369620657d2d18c7b538281a6bf1fce3d869b4a7"}}}}