{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/plottable/pulls/comments/131788248","pull_request_review_id":54800666,"id":131788248,"diff_hunk":"@@ -437,56 +434,49 @@ export class Plot extends Component {\n    */\n   protected _updateExtents() {\n     this._resetEntityStore();\n-    this._attrBindings.each((_, attr) => this._updateExtentsForAttr(attr));\n-    this._propertyExtents.each((_, property) => this._updateExtentsForProperty(property));\n     this._scales().forEach((scale) => scale.addIncludedValuesProvider(this._includedValuesProvider));\n   }\n \n-  private _updateExtentsForAttr(attr: string) {\n-    // Filters should never be applied to attributes\n-    this._updateExtentsForKey(attr, this._attrBindings, this._attrExtents, null);\n-  }\n-\n-  protected _updateExtentsForProperty(property: string) {\n-    this._updateExtentsForKey(property, this._propertyBindings, this._propertyExtents, this._filterForProperty(property));\n-  }\n-\n   protected _filterForProperty(property: string): IAccessor<boolean> {\n     return null;\n   }\n \n-  private _updateExtentsForKey(key: string, bindings: d3.Map<Plots.IAccessorScaleBinding<any, any>>,\n-                               extents: d3.Map<any[]>, filter: IAccessor<boolean>) {\n-    const accScaleBinding = bindings.get(key);\n-    if (accScaleBinding == null || accScaleBinding.accessor == null) {\n-      return;\n-    }\n-    extents.set(key, this.datasets().map((dataset) => this._computeExtent(dataset, accScaleBinding, filter)));\n-  }\n-\n-  private _computeExtent(dataset: Dataset, accScaleBinding: Plots.IAccessorScaleBinding<any, any>, filter: IAccessor<boolean>): any[] {\n-    const accessor = accScaleBinding.accessor;\n-    const scale = accScaleBinding.scale;\n-\n-    if (scale == null) {\n-      return [];\n-    }\n-\n-    let data = dataset.data();\n-    if (filter != null) {\n-      data = data.filter((d, i) => filter(d, i, dataset));\n+  protected getExtentsForAttr(attr: string) {\n+    if (this._attrExtents[attr] == null) {","path":"src/plots/plot.ts","position":98,"original_position":98,"commit_id":"cdd08206a3c08ffe5e131661de3b221df4e41b58","original_commit_id":"ab0cd97864ee0a7755ca00b2c51a2258673d9f41","user":{"login":"hellochar","id":1079495,"avatar_url":"https://avatars2.githubusercontent.com/u/1079495?v=4","gravatar_id":"","url":"https://api.github.com/users/hellochar","html_url":"https://github.com/hellochar","followers_url":"https://api.github.com/users/hellochar/followers","following_url":"https://api.github.com/users/hellochar/following{/other_user}","gists_url":"https://api.github.com/users/hellochar/gists{/gist_id}","starred_url":"https://api.github.com/users/hellochar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellochar/subscriptions","organizations_url":"https://api.github.com/users/hellochar/orgs","repos_url":"https://api.github.com/users/hellochar/repos","events_url":"https://api.github.com/users/hellochar/events{/privacy}","received_events_url":"https://api.github.com/users/hellochar/received_events","type":"User","site_admin":false},"body":"Nope, this should be defined the same way for all attrs (and will always be defined that way)","created_at":"2017-08-07T23:22:32Z","updated_at":"2017-08-07T23:22:32Z","html_url":"https://github.com/palantir/plottable/pull/3385#discussion_r131788248","pull_request_url":"https://api.github.com/repos/palantir/plottable/pulls/3385","_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments/131788248"},"html":{"href":"https://github.com/palantir/plottable/pull/3385#discussion_r131788248"},"pull_request":{"href":"https://api.github.com/repos/palantir/plottable/pulls/3385"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/plottable/pulls/3385","id":132644018,"html_url":"https://github.com/palantir/plottable/pull/3385","diff_url":"https://github.com/palantir/plottable/pull/3385.diff","patch_url":"https://github.com/palantir/plottable/pull/3385.patch","issue_url":"https://api.github.com/repos/palantir/plottable/issues/3385","number":3385,"state":"open","locked":false,"title":"memoize compute extents","user":{"login":"hellochar","id":1079495,"avatar_url":"https://avatars2.githubusercontent.com/u/1079495?v=4","gravatar_id":"","url":"https://api.github.com/users/hellochar","html_url":"https://github.com/hellochar","followers_url":"https://api.github.com/users/hellochar/followers","following_url":"https://api.github.com/users/hellochar/following{/other_user}","gists_url":"https://api.github.com/users/hellochar/gists{/gist_id}","starred_url":"https://api.github.com/users/hellochar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellochar/subscriptions","organizations_url":"https://api.github.com/users/hellochar/orgs","repos_url":"https://api.github.com/users/hellochar/repos","events_url":"https://api.github.com/users/hellochar/events{/privacy}","received_events_url":"https://api.github.com/users/hellochar/received_events","type":"User","site_admin":false},"body":"Memoize calls to computing the plot extents (which does a linear pass through the data), improving perf. This also lets us delete a bunch of _update methods and move away from the \"update\" paradigm","created_at":"2017-07-27T00:41:37Z","updated_at":"2017-08-07T23:22:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"932ee176de99d8df190ad9dfc261379c0516a346","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/palantir/plottable/pulls/3385/commits","review_comments_url":"https://api.github.com/repos/palantir/plottable/pulls/3385/comments","review_comment_url":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/palantir/plottable/issues/3385/comments","statuses_url":"https://api.github.com/repos/palantir/plottable/statuses/cdd08206a3c08ffe5e131661de3b221df4e41b58","head":{"label":"palantir:xzhang/memoize-compute-extents","ref":"xzhang/memoize-compute-extents","sha":"cdd08206a3c08ffe5e131661de3b221df4e41b58","user":{"login":"palantir","id":303157,"avatar_url":"https://avatars0.githubusercontent.com/u/303157?v=4","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://avatars0.githubusercontent.com/u/303157?v=4","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":":bar_chart: 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}","deployments_url":"https://api.github.com/repos/palantir/plottable/deployments","created_at":"2014-01-22T19:29:19Z","updated_at":"2017-08-02T10:57:27Z","pushed_at":"2017-08-07T22:22:36Z","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":"http://plottablejs.org/","size":75015,"stargazers_count":2170,"watchers_count":2170,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":181,"mirror_url":null,"open_issues_count":296,"forks":181,"open_issues":296,"watchers":2170,"default_branch":"develop"}},"base":{"label":"palantir:develop","ref":"develop","sha":"c7c2194b1c1f4c0e705779d3ef76255631ac801d","user":{"login":"palantir","id":303157,"avatar_url":"https://avatars0.githubusercontent.com/u/303157?v=4","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://avatars0.githubusercontent.com/u/303157?v=4","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":":bar_chart: 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}","deployments_url":"https://api.github.com/repos/palantir/plottable/deployments","created_at":"2014-01-22T19:29:19Z","updated_at":"2017-08-02T10:57:27Z","pushed_at":"2017-08-07T22:22:36Z","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":"http://plottablejs.org/","size":75015,"stargazers_count":2170,"watchers_count":2170,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":181,"mirror_url":null,"open_issues_count":296,"forks":181,"open_issues":296,"watchers":2170,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/3385"},"html":{"href":"https://github.com/palantir/plottable/pull/3385"},"issue":{"href":"https://api.github.com/repos/palantir/plottable/issues/3385"},"comments":{"href":"https://api.github.com/repos/palantir/plottable/issues/3385/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/plottable/pulls/3385/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/palantir/plottable/pulls/3385/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/plottable/statuses/cdd08206a3c08ffe5e131661de3b221df4e41b58"}}}}
{"actor":{"display_login":"hellochar"}}