Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Nbagg backend#3008

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 3 commits intomatplotlib:masterfrompelson:nbagg_backend
Jun 28, 2014
Merged
Show file tree
Hide file tree
Changes from1 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
NextNext commit
Small changes to clean up webagg javascript code a bit.
  • Loading branch information
@pelson
Jason Grout authored andpelson committedMay 19, 2014
commit5156c10c27af4bd1fd9075ceddf1aad1254e29ed
21 changes: 8 additions & 13 deletionslib/matplotlib/backends/backend_webagg_core.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -319,20 +319,15 @@ class NavigationToolbar2WebAgg(backend_bases.NavigationToolbar2):
None: None
}

def _init_toolbar(self):
# Use the standard toolbar items + download button
toolitems = (
backend_bases.NavigationToolbar2.toolitems +
(('Download', 'Download plot', 'download', 'download'),)
)

NavigationToolbar2WebAgg.toolitems = \
tuple(
(text, tooltip_text, self._jquery_icon_classes[image_file],
name_of_method)
for text, tooltip_text, image_file, name_of_method
in toolitems if image_file in self._jquery_icon_classes)

# Use the standard toolbar items + download button
toolitems = [(text, tooltip_text, _jquery_icon_classes[image_file], name_of_method)
for text, tooltip_text, image_file, name_of_method
in (backend_bases.NavigationToolbar2.toolitems +
(('Download', 'Download plot', 'download', 'download'),))
if image_file in _jquery_icon_classes]

def _init_toolbar(self):
self.message = ''
self.cursor = 0

Expand Down
14 changes: 4 additions & 10 deletionslib/matplotlib/backends/web_backend/mpl.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
/* Put everything inside the mpl namespace */
varmpl = {};
/* Put everything inside theglobalmpl namespace */
window.mpl = {};


mpl.get_websocket_type = function() {
Expand DownExpand Up@@ -56,21 +56,15 @@ mpl.figure = function(figure_id, websocket, ondownload, parent_element) {

this.waiting = false;

onopen_creator = function(fig) {
return function () {
this.ws.onopen = function () {
fig.send_message("supports_binary", {value: fig.supports_binary});
fig.send_message("refresh", {});
}
};
this.ws.onopen = onopen_creator(fig);

onload_creator = function(fig) {
return function() {
this.imageObj.onload = function() {
fig.context.drawImage(fig.imageObj, 0, 0);
fig.waiting = false;
};
};
this.imageObj.onload = onload_creator(fig);

this.imageObj.onunload = function() {
this.ws.close();
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp