{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/plottable/pulls/comments/32577397","id":32577397,"diff_hunk":"@@ -93,12 +93,14 @@ export module Interactions {\n       var newCornerDistance = this._cornerDistance();\n \n       if (this._xScale != null && newCornerDistance !== 0 && oldCornerDistance !== 0) {\n-        PanZoom._magnifyScale(this._xScale, oldCornerDistance / newCornerDistance, oldCenterPoint.x);\n-        PanZoom._translateScale(this._xScale, oldCenterPoint.x - newCenterPoint.x);\n+        var invertedPX = this._xScale.invert(oldCenterPoint.x);\n+        this._xScale.zoomLevel(this._xScale.zoomLevel() * oldCornerDistance / newCornerDistance);\n+        PanZoom._translateScale(this._xScale, this._xScale.scale(invertedPX) - newCenterPoint.x);","path":"src/interactions/panZoomInteraction.ts","position":8,"original_position":8,"commit_id":"55f75281c9af9ea741de49bbdafa39154e3012f1","original_commit_id":"55f75281c9af9ea741de49bbdafa39154e3012f1","user":{"login":"jtlan","id":1440449,"avatar_url":"https://avatars.githubusercontent.com/u/1440449?v=3","gravatar_id":"","url":"https://api.github.com/users/jtlan","html_url":"https://github.com/jtlan","followers_url":"https://api.github.com/users/jtlan/followers","following_url":"https://api.github.com/users/jtlan/following{/other_user}","gists_url":"https://api.github.com/users/jtlan/gists{/gist_id}","starred_url":"https://api.github.com/users/jtlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtlan/subscriptions","organizations_url":"https://api.github.com/users/jtlan/orgs","repos_url":"https://api.github.com/users/jtlan/repos","events_url":"https://api.github.com/users/jtlan/events{/privacy}","received_events_url":"https://api.github.com/users/jtlan/received_events","type":"User","site_admin":false},"body":"But the call to `_translateScale()` has changed. What's the difference in functionality between  `_xScale.zoomLevel(...)` and `_magnifyScale(...)` that necessitates this change?","created_at":"2015-06-16T22:13:03Z","updated_at":"2015-06-16T22:13:03Z","html_url":"https://github.com/palantir/plottable/pull/2338#discussion_r32577397","pull_request_url":"https://api.github.com/repos/palantir/plottable/pulls/2338","_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments/32577397"},"html":{"href":"https://github.com/palantir/plottable/pull/2338#discussion_r32577397"},"pull_request":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2338"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/plottable/pulls/2338","id":37748308,"html_url":"https://github.com/palantir/plottable/pull/2338","diff_url":"https://github.com/palantir/plottable/pull/2338.diff","patch_url":"https://github.com/palantir/plottable/pull/2338.patch","issue_url":"https://api.github.com/repos/palantir/plottable/issues/2338","number":2338,"state":"open","locked":false,"title":"[QuantitativeScale] - Adding `zoomLevel()` endpoint","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":"Something I probably should have done a while back...\r\n\r\n`Interactions.PanZoom` currently taps into the `QuantitativeScale`'s API in order to determine the new domain of the scale.  Because of this, the zooming idea is not enforced at the `Scale` level.\r\n\r\nIn other words, unless users wanted to do tricky math, there was no way to zoom into a scale domain without using `Interactions.PanZoom`.  Now, `zoomLevel()` has been exposed such that users can, through code, set the zoom factor of the scale's domain.\r\n\r\nEDIT: New functionality - Setting the domain of a `QuantitativeScale` will set the `zoomLevel` back to 1.0.\r\n\r\nThis is mainly relevant as a precommit for #1639 \r\n\r\nAPI Changes:\r\n* `quantitativeScale.zoomLevel()` has been exposed to get the zoom factor for the scale's domain.\r\n* `quantitativeScale.zoomLevel(zoomLevel: number)` has been exposed to set the zoom factor for the scale's domain.  The scale will then dispatch this update accordingly","created_at":"2015-06-16T00:07:01Z","updated_at":"2015-06-16T22:13:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22fbee9c39807c1989b3f60cbf0e43c234df4c16","assignee":{"login":"jtlan","id":1440449,"avatar_url":"https://avatars.githubusercontent.com/u/1440449?v=3","gravatar_id":"","url":"https://api.github.com/users/jtlan","html_url":"https://github.com/jtlan","followers_url":"https://api.github.com/users/jtlan/followers","following_url":"https://api.github.com/users/jtlan/following{/other_user}","gists_url":"https://api.github.com/users/jtlan/gists{/gist_id}","starred_url":"https://api.github.com/users/jtlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtlan/subscriptions","organizations_url":"https://api.github.com/users/jtlan/orgs","repos_url":"https://api.github.com/users/jtlan/repos","events_url":"https://api.github.com/users/jtlan/events{/privacy}","received_events_url":"https://api.github.com/users/jtlan/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/palantir/plottable/pulls/2338/commits","review_comments_url":"https://api.github.com/repos/palantir/plottable/pulls/2338/comments","review_comment_url":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/palantir/plottable/issues/2338/comments","statuses_url":"https://api.github.com/repos/palantir/plottable/statuses/55f75281c9af9ea741de49bbdafa39154e3012f1","head":{"label":"palantir:zoomFactor","ref":"zoomFactor","sha":"55f75281c9af9ea741de49bbdafa39154e3012f1","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-06-16T21:19:55Z","pushed_at":"2015-06-16T21:45:37Z","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":121681,"stargazers_count":512,"watchers_count":512,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":155,"forks":45,"open_issues":155,"watchers":512,"default_branch":"develop"}},"base":{"label":"palantir:zoomLimit","ref":"zoomLimit","sha":"3b2c62425a781fb3c28475185977c148afed3450","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-06-16T21:19:55Z","pushed_at":"2015-06-16T21:45:37Z","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":121681,"stargazers_count":512,"watchers_count":512,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":155,"forks":45,"open_issues":155,"watchers":512,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2338"},"html":{"href":"https://github.com/palantir/plottable/pull/2338"},"issue":{"href":"https://api.github.com/repos/palantir/plottable/issues/2338"},"comments":{"href":"https://api.github.com/repos/palantir/plottable/issues/2338/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2338/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2338/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/plottable/statuses/55f75281c9af9ea741de49bbdafa39154e3012f1"}}}}