{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/plottable/pulls/comments/42301829","id":42301829,"diff_hunk":"@@ -202,6 +181,33 @@ export module Plots {\n       return { x: pixelPoint.x, y: scaledYValue };\n     }\n \n+    protected _getDataToDraw() {\n+      if (!this.downsamplingEnabled()) {\n+        return super._getDataToDraw();\n+      }\n+      let dataToDraw = new Utils.Map<Dataset, any[]> ();\n+      if (this.datasets().length === 0) {\n+        return dataToDraw;\n+      }\n+      let overallFilteredDataIndices: number[] = [];\n+      this.datasets().forEach((dataset, i) => {\n+        let data = dataset.data();\n+        let filteredDataIndices = data.map((d, i) => i);\n+        if (this.croppedRenderingEnabled()) {\n+          filteredDataIndices = this._filterCroppedRendering(dataset, filteredDataIndices);\n+        }\n+        if (this.downsamplingEnabled()) {\n+          filteredDataIndices = this._filterDownsampling(dataset, filteredDataIndices);\n+        }\n+        overallFilteredDataIndices = overallFilteredDataIndices.concat(filteredDataIndices\n+          .filter((index) => {return overallFilteredDataIndices.indexOf(index) < 0; }));","path":"src/plots/stackedAreaPlot.ts","position":51,"original_position":51,"commit_id":"d76a16ea582d3998e694cb64d75a8dff4aeef05c","original_commit_id":"d76a16ea582d3998e694cb64d75a8dff4aeef05c","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":"This should work in `line`/ `area`. But for `LinePlot` with several datasets, we do not need to make sure all datasets have the same indices. Therefore, maybe we'd better just keep this in `StackedAreaPlot`.","created_at":"2015-10-17T00:04:27Z","updated_at":"2015-10-17T00:04:27Z","html_url":"https://github.com/palantir/plottable/pull/2881#discussion_r42301829","pull_request_url":"https://api.github.com/repos/palantir/plottable/pulls/2881","_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments/42301829"},"html":{"href":"https://github.com/palantir/plottable/pull/2881#discussion_r42301829"},"pull_request":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2881"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/plottable/pulls/2881","id":47685492,"html_url":"https://github.com/palantir/plottable/pull/2881","diff_url":"https://github.com/palantir/plottable/pull/2881.diff","patch_url":"https://github.com/palantir/plottable/pull/2881.patch","issue_url":"https://api.github.com/repos/palantir/plottable/issues/2881","number":2881,"state":"open","locked":false,"title":"enable downsampling in Stacked Area Plot","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\nWhen using downsampling, points with different x values are removed in different areas, which make the x value inconsistent among different dataset. This creates white spaces and overlappings between areas.\r\n\r\n**Fix**:\r\nThe point drawn are the union of the downsampling result of each area. This means a point is removed only when all points at the same x position are removed by downsampling. This might affect the rendering performance.\r\n\r\nDraw without white spaces and overlappings between areas: http://jsfiddle.net/yxpq4uuv/45/\r\nPerformance Test: http://jsfiddle.net/yxpq4uuv/46/\r\n\r\nclose #2868","created_at":"2015-10-14T16:52:55Z","updated_at":"2015-10-17T00:04:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"596ba7d4400f47b83d0eef2a1557b115c41e1d6a","assignee":{"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},"milestone":null,"commits_url":"https://api.github.com/repos/palantir/plottable/pulls/2881/commits","review_comments_url":"https://api.github.com/repos/palantir/plottable/pulls/2881/comments","review_comment_url":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/palantir/plottable/issues/2881/comments","statuses_url":"https://api.github.com/repos/palantir/plottable/statuses/d76a16ea582d3998e694cb64d75a8dff4aeef05c","head":{"label":"palantir:2868fix","ref":"2868fix","sha":"d76a16ea582d3998e694cb64d75a8dff4aeef05c","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-16T20:23:00Z","pushed_at":"2015-10-16T23:49:44Z","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":753,"watchers_count":753,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":80,"mirror_url":null,"open_issues_count":228,"forks":80,"open_issues":228,"watchers":753,"default_branch":"develop"}},"base":{"label":"palantir:develop","ref":"develop","sha":"a6781d0a2067be1ed258733b2b1ba64130c28bb4","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-16T20:23:00Z","pushed_at":"2015-10-16T23:49:44Z","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":753,"watchers_count":753,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":80,"mirror_url":null,"open_issues_count":228,"forks":80,"open_issues":228,"watchers":753,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2881"},"html":{"href":"https://github.com/palantir/plottable/pull/2881"},"issue":{"href":"https://api.github.com/repos/palantir/plottable/issues/2881"},"comments":{"href":"https://api.github.com/repos/palantir/plottable/issues/2881/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2881/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2881/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/plottable/statuses/d76a16ea582d3998e694cb64d75a8dff4aeef05c"}}}}