{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/plottable/pulls/comments/36697872","id":36697872,"diff_hunk":"@@ -0,0 +1,154 @@\n+///<reference path=\"../reference.ts\" />\n+\n+module Plottable {\n+export module Components {\n+  export class GuideLineLayer<D> extends Component {\n+    public static ORIENTATION_VERTICAL = \"vertical\";\n+    public static ORIENTATION_HORIZONTAL = \"horizontal\";\n+\n+    private _orientation: string;\n+    private _value: D;\n+    private _scale: QuantitativeScale<D>;\n+    private _pixelPosition: number;\n+    private _scaleUpdateCallback = () => {\n+      this._updatePixelPosition();\n+      this.render();\n+    };\n+    private _line: d3.Selection<void>;\n+\n+    constructor(orientation: string) {\n+      super();\n+      if (orientation !== GuideLineLayer.ORIENTATION_VERTICAL && orientation !== GuideLineLayer.ORIENTATION_HORIZONTAL) {\n+        throw new Error(orientation + \" is not a valid orientation for GuideLineLayer\");\n+      }\n+      this._orientation = orientation;\n+      this._clipPathEnabled = true;\n+      this.addClass(\"guide-line-layer\");\n+    }\n+\n+    protected _setup() {\n+      super._setup();\n+      this._line = this.content().append(\"line\").classed(\"guide-line\", true);\n+    }\n+\n+    protected _sizeFromOffer(availableWidth: number, availableHeight: number) {\n+      return {\n+        width: availableWidth,\n+        height: availableHeight\n+      };\n+    }\n+\n+    private _isVertical() {\n+      return this._orientation === GuideLineLayer.ORIENTATION_VERTICAL;\n+    }\n+\n+    public fixedWidth() {\n+      return true;\n+    }\n+\n+    public fixedHeight() {\n+      return true;\n+    }","path":"src/components/guideLineLayer.ts","position":51,"original_position":51,"commit_id":"dc263f52ce89a0edd3a7bb62cb903540cf4a17d9","original_commit_id":"dc263f52ce89a0edd3a7bb62cb903540cf4a17d9","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":"`Gridlines` probably has to follow this example also.  I'll mark that.","created_at":"2015-08-10T23:40:07Z","updated_at":"2015-08-10T23:40:07Z","html_url":"https://github.com/palantir/plottable/pull/2593#discussion_r36697872","pull_request_url":"https://api.github.com/repos/palantir/plottable/pulls/2593","_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments/36697872"},"html":{"href":"https://github.com/palantir/plottable/pull/2593#discussion_r36697872"},"pull_request":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2593"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/plottable/pulls/2593","id":42073102,"html_url":"https://github.com/palantir/plottable/pull/2593","diff_url":"https://github.com/palantir/plottable/pull/2593.diff","patch_url":"https://github.com/palantir/plottable/pull/2593.patch","issue_url":"https://api.github.com/repos/palantir/plottable/issues/2593","number":2593,"state":"open","locked":false,"title":"Add GuideLineLayer","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":"Added new class `GuideLineLayer`. This `Component` fully-occupies a cell in a `Table` (like `SelectionBoxLayer`), and draws either a vertical or horizontal line at a specified position in data- or pixel-space:\r\n\r\n`DragLineLayer` will extend this class.\r\n\r\n<img width=\"647\" alt=\"screen shot 2015-08-10 at 2 58 24 pm\" src=\"https://cloud.githubusercontent.com/assets/1440449/9185387/5084b7be-3f70-11e5-94d9-0cfdddafe5bb.png\">\r\n\r\nFeatures the following API points:\r\n```Typescript\r\nconstructor(orientation: string); // \"vertical\" or \"horizontal\"\r\n\r\n/**\r\n * Gets the QuantitativeScale on the GuideLineLayer.\r\n */\r\nscale(): QuantitativeScale<D>;\r\n/**\r\n * Sets the QuantitativeScale on the GuideLineLayer.\r\n * If the value of the guide line in data-space has been set,\r\n * the position of the guide line in pixel-space will be updated.\r\n */\r\nscale(scale: QuantitativeScale<D>): GuideLineLayer<D>;\r\n\r\n/**\r\n * Gets the position of the guide line in data-space.\r\n */\r\nvalue(): D;\r\n/**\r\n * Sets the position of the guide line in data-space.\r\n * If the GuideLineLayer has a scale, the position of the line\r\n * in pixel-space will be updated accordingly.\r\n */\r\nvalue(value: D): GuideLineLayer<D>;\r\n\r\n/**\r\n * Gets the position of the guide line in pixel-space.\r\n */\r\npixelPosition(): number;\r\n/**\r\n * Sets the position of the guide line in pixel-space.\r\n * If the GuideLineLayer has a scale, the position of the line\r\n * in data-space will be updated accordingly.\r\n */\r\npixelPosition(pixelPosition: number): GuideLineLayer<D>;\r\n```\r\n\r\nCSS styles should be applied to the following element to style the line:\r\n```CSS\r\n.plottable .guide-line-layer line.guide-line {\r\n  ...\r\n}\r\n```\r\n\r\nDemo: http://jsfiddle.net/fza2vdcc/","created_at":"2015-08-10T22:20:06Z","updated_at":"2015-08-10T23:40:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"90ff3e63082a6795f2988340d4e89a2c83954ee3","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/2593/commits","review_comments_url":"https://api.github.com/repos/palantir/plottable/pulls/2593/comments","review_comment_url":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/palantir/plottable/issues/2593/comments","statuses_url":"https://api.github.com/repos/palantir/plottable/statuses/dc263f52ce89a0edd3a7bb62cb903540cf4a17d9","head":{"label":"palantir:guideLineLayer","ref":"guideLineLayer","sha":"dc263f52ce89a0edd3a7bb62cb903540cf4a17d9","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-08-08T14:06:02Z","pushed_at":"2015-08-10T23:26:50Z","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":130210,"stargazers_count":651,"watchers_count":651,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":146,"forks":65,"open_issues":146,"watchers":651,"default_branch":"develop"}},"base":{"label":"palantir:develop","ref":"develop","sha":"7808ab43e3c1124d61ecb629483278563ce8f701","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-08-08T14:06:02Z","pushed_at":"2015-08-10T23:26:50Z","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":130210,"stargazers_count":651,"watchers_count":651,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":146,"forks":65,"open_issues":146,"watchers":651,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2593"},"html":{"href":"https://github.com/palantir/plottable/pull/2593"},"issue":{"href":"https://api.github.com/repos/palantir/plottable/issues/2593"},"comments":{"href":"https://api.github.com/repos/palantir/plottable/issues/2593/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2593/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2593/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/plottable/statuses/dc263f52ce89a0edd3a7bb62cb903540cf4a17d9"}}}}