Skip to content

Nbagg enhancements #3552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 24, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed firefox keyboard focus bug with nbagg backend.
  • Loading branch information
pelson committed Sep 22, 2014
commit 3e4620ac3d407466f152eb6ef54518468ace2f4d
4 changes: 2 additions & 2 deletions lib/matplotlib/backends/backend_webagg.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from matplotlib.figure import Figure
from matplotlib._pylab_helpers import Gcf
from . import backend_webagg_core as core
from . import backend_nbagg
from .backend_nbagg import TimerTornado


def new_figure_manager(num, *args, **kwargs):
Expand Down Expand Up @@ -103,7 +103,7 @@ def show(self):
show()

def new_timer(self, *args, **kwargs):
return backend_nbagg.TimerTornado(*args, **kwargs)
return TimerTornado(*args, **kwargs)

def start_event_loop(self, timeout):
backend_bases.FigureCanvasBase.start_event_loop_default(
Expand Down
3 changes: 3 additions & 0 deletions lib/matplotlib/backends/web_backend/nbagg_mpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ mpl.figure.prototype.handle_close = function(fig, msg) {
// Update the output cell to use the data from the current canvas.
fig.push_to_output();
var dataURL = fig.canvas.toDataURL();
// Re-enable the keyboard manager in IPython - without this line, in FF,
// the notebook keyboard shortcuts fail.
IPython.keyboard_manager.enable()
$(fig.parent_element).html('<img src="' + dataURL + '">');
fig.send_message('closing', {});
fig.ws.close()
Expand Down