{"action":"opened","number":3965,"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3965","id":26790088,"html_url":"https://github.com/matplotlib/matplotlib/pull/3965","diff_url":"https://github.com/matplotlib/matplotlib/pull/3965.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/3965.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3965","number":3965,"state":"open","locked":false,"title":"Js fixes for key events + ipython notebooks","user":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"body":"First pass at getting key events to work in ipython notebooks\r\n\r\nCloses #3963\r\n\r\nDemo, mouse over the figure to give it focus.  Clicking any mouse button or pushing any key should color-cycle the line.\r\n\r\n```python\r\nimport matplotlib\r\nimport itertools\r\nimport numpy as np\r\nmatplotlib.use('nbagg')\r\nimport matplotlib.pyplot as plt\r\nplt.close('all')\r\nfig, ax = plt.subplots()\r\nx = np.linspace(0,10,10000)\r\ny = np.sin(x)\r\nln, = ax.plot(x,y)\r\nevt = []\r\ncolors = iter(itertools.cycle(['r', 'g', 'b', 'k', 'c']))\r\ndef on_event(event):\r\n    evt.append(event)\r\n    ln.set_color(next(colors))\r\n    fig.canvas.draw()\r\n    fig.canvas.draw_idle()\r\nfig.canvas.mpl_connect('button_press_event', on_event)\r\nfig.canvas.mpl_connect('key_press_event', on_event)\r\nplt.show()\r\n```\r\n\r\nRemaining issues:\r\n - [ ] mousing out of the figure area does not release focus, is this the correct behavior?\r\n - [ ] not sure I injected the extra style at the right place in the DOM or than I used the right pattern to do it","created_at":"2015-01-04T03:05:33Z","updated_at":"2015-01-04T03:05:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3965/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3965/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/{number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3965/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/98094dd68e4719da2f32958902f5741d46d4f8d5","head":{"label":"tacaswell:js_fixes","ref":"js_fixes","sha":"98094dd68e4719da2f32958902f5741d46d4f8d5","user":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"repo":{"id":5345572,"name":"matplotlib","full_name":"tacaswell/matplotlib","owner":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tacaswell/matplotlib","description":"","fork":true,"url":"https://api.github.com/repos/tacaswell/matplotlib","forks_url":"https://api.github.com/repos/tacaswell/matplotlib/forks","keys_url":"https://api.github.com/repos/tacaswell/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tacaswell/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tacaswell/matplotlib/teams","hooks_url":"https://api.github.com/repos/tacaswell/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/tacaswell/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/tacaswell/matplotlib/events","assignees_url":"https://api.github.com/repos/tacaswell/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/tacaswell/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/tacaswell/matplotlib/tags","blobs_url":"https://api.github.com/repos/tacaswell/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tacaswell/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tacaswell/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/tacaswell/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tacaswell/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/tacaswell/matplotlib/languages","stargazers_url":"https://api.github.com/repos/tacaswell/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/tacaswell/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/tacaswell/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/tacaswell/matplotlib/subscription","commits_url":"https://api.github.com/repos/tacaswell/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/tacaswell/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/tacaswell/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/tacaswell/matplotlib/issues/comments/{number}","contents_url":"https://api.github.com/repos/tacaswell/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/tacaswell/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tacaswell/matplotlib/merges","archive_url":"https://api.github.com/repos/tacaswell/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tacaswell/matplotlib/downloads","issues_url":"https://api.github.com/repos/tacaswell/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/tacaswell/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/tacaswell/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/tacaswell/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tacaswell/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/tacaswell/matplotlib/releases{/id}","created_at":"2012-08-08T18:19:38Z","updated_at":"2014-12-31T23:28:54Z","pushed_at":"2015-01-04T02:58:50Z","git_url":"git://github.com/tacaswell/matplotlib.git","ssh_url":"git@github.com:tacaswell/matplotlib.git","clone_url":"https://github.com/tacaswell/matplotlib.git","svn_url":"https://github.com/tacaswell/matplotlib","homepage":"","size":303313,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"matplotlib:master","ref":"master","sha":"ab549acc3a546c03b2fce1a5a156df4c2a60d6cd","user":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"repo":{"id":1385122,"name":"matplotlib","full_name":"matplotlib/matplotlib","owner":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matplotlib/matplotlib","description":"matplotlib: plotting with Python","fork":false,"url":"https://api.github.com/repos/matplotlib/matplotlib","forks_url":"https://api.github.com/repos/matplotlib/matplotlib/forks","keys_url":"https://api.github.com/repos/matplotlib/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matplotlib/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matplotlib/matplotlib/teams","hooks_url":"https://api.github.com/repos/matplotlib/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/matplotlib/matplotlib/events","assignees_url":"https://api.github.com/repos/matplotlib/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/matplotlib/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/matplotlib/matplotlib/tags","blobs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matplotlib/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/matplotlib/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/matplotlib/matplotlib/languages","stargazers_url":"https://api.github.com/repos/matplotlib/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/matplotlib/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/matplotlib/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/matplotlib/matplotlib/subscription","commits_url":"https://api.github.com/repos/matplotlib/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/matplotlib/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/{number}","contents_url":"https://api.github.com/repos/matplotlib/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/matplotlib/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matplotlib/matplotlib/merges","archive_url":"https://api.github.com/repos/matplotlib/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matplotlib/matplotlib/downloads","issues_url":"https://api.github.com/repos/matplotlib/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/matplotlib/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/matplotlib/matplotlib/releases{/id}","created_at":"2011-02-19T03:17:12Z","updated_at":"2015-01-03T03:10:32Z","pushed_at":"2015-01-02T14:52:39Z","git_url":"git://github.com/matplotlib/matplotlib.git","ssh_url":"git@github.com:matplotlib/matplotlib.git","clone_url":"https://github.com/matplotlib/matplotlib.git","svn_url":"https://github.com/matplotlib/matplotlib","homepage":"http://matplotlib.org/","size":249717,"stargazers_count":2136,"watchers_count":2136,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1045,"mirror_url":null,"open_issues_count":444,"forks":1045,"open_issues":444,"watchers":2136,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3965"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/3965"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/3965"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/3965/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3965/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3965/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/98094dd68e4719da2f32958902f5741d46d4f8d5"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":6,"additions":41,"deletions":10,"changed_files":2}}