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

Appearance settings

IPython Widget #5754

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
May 4, 2016
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
Fix path and make mpl.js a UMD file
  • Loading branch information
blink1073 committed May 2, 2016
commit 566e97a3372949d15951bcd4646ecde748cdb280
26 changes: 21 additions & 5 deletions 26 lib/matplotlib/backends/web_backend/js/mpl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
/* Put everything inside the global mpl namespace */

// Universal Module Definition
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else {
// Browser globals (root is window)
root.returnExports = factory(root.jQuery);
}
}(this, function ($) {

window.mpl = {};


Expand Down Expand Up @@ -133,11 +145,11 @@ mpl.figure.prototype._init_canvas = function() {
this.context = canvas[0].getContext("2d");

var backingStore = this.context.backingStorePixelRatio ||
this.context.webkitBackingStorePixelRatio ||
this.context.mozBackingStorePixelRatio ||
this.context.msBackingStorePixelRatio ||
this.context.oBackingStorePixelRatio ||
this.context.backingStorePixelRatio || 1;
this.context.webkitBackingStorePixelRatio ||
this.context.mozBackingStorePixelRatio ||
this.context.msBackingStorePixelRatio ||
this.context.oBackingStorePixelRatio ||
this.context.backingStorePixelRatio || 1;

mpl.ratio = (window.devicePixelRatio || 1) / backingStore;

Expand Down Expand Up @@ -552,3 +564,7 @@ mpl.figure.prototype.toolbar_button_onclick = function(name) {
mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {
this.message.textContent = tooltip;
};

return mpl;

}));
2 changes: 1 addition & 1 deletion 2 lib/matplotlib/backends/web_backend/js/nbagg_mpl.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

define(['jupyter-js-widgets', './mpl.js'], function(widgets, mpl) {
define(['jupyter-js-widgets', '/nbextensions/matplotlib/mpl.js'], function(widgets, mpl) {

var MPLCanvasView = widgets.WidgetView.extend({

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.