Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
108 changes: 0 additions & 108 deletions LICENSE/LICENSE_JSXTOOLS_RESIZE_OBSERVER

This file was deleted.

16 changes: 1 addition & 15 deletions lib/matplotlib/backends/web_backend/js/mpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,7 @@ mpl.figure.prototype._init_canvas = function () {
'z-index: 1;'
);

// Apply a ponyfill if ResizeObserver is not implemented by browser.
if (this.ResizeObserver === undefined) {
if (window.ResizeObserver !== undefined) {
this.ResizeObserver = window.ResizeObserver;
} else {
var obs = _JSXTOOLS_RESIZE_OBSERVER({});
this.ResizeObserver = obs.ResizeObserver;
}
}

this.resizeObserverInstance = new this.ResizeObserver(function (entries) {
this.resizeObserverInstance = new ResizeObserver(function (entries) {
// There's no need to resize if the WebSocket is not connected:
// - If it is still connecting, then we will get an initial resize from
// Python once it connects.
Expand Down Expand Up @@ -728,7 +718,3 @@ mpl.figure.prototype.toolbar_button_onclick = function (name) {
mpl.figure.prototype.toolbar_button_onmouseover = function (tooltip) {
this.message.textContent = tooltip;
};

///////////////// REMAINING CONTENT GENERATED BY embed_js.py /////////////////
// prettier-ignore
var _JSXTOOLS_RESIZE_OBSERVER=function(A){var t,i=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,o=new Set;function s(e){if(!(this instanceof s))throw new TypeError("Constructor requires 'new' operator");i.set(this,e)}function h(){throw new TypeError("Function is not a constructor")}function c(e,t,i,n){e=0 in arguments?Number(arguments[0]):0,t=1 in arguments?Number(arguments[1]):0,i=2 in arguments?Number(arguments[2]):0,n=3 in arguments?Number(arguments[3]):0,this.right=(this.x=this.left=e)+(this.width=i),this.bottom=(this.y=this.top=t)+(this.height=n),Object.freeze(this)}function d(){t=requestAnimationFrame(d);var s=new WeakMap,p=new Set;o.forEach((function(t){r.get(t).forEach((function(i){var r=t instanceof window.SVGElement,o=a.get(t),d=r?0:parseFloat(o.paddingTop),f=r?0:parseFloat(o.paddingRight),l=r?0:parseFloat(o.paddingBottom),u=r?0:parseFloat(o.paddingLeft),g=r?0:parseFloat(o.borderTopWidth),m=r?0:parseFloat(o.borderRightWidth),w=r?0:parseFloat(o.borderBottomWidth),b=u+f,F=d+l,v=(r?0:parseFloat(o.borderLeftWidth))+m,W=g+w,y=r?0:t.offsetHeight-W-t.clientHeight,E=r?0:t.offsetWidth-v-t.clientWidth,R=b+v,z=F+W,M=r?t.width:parseFloat(o.width)-R-E,O=r?t.height:parseFloat(o.height)-z-y;if(n.has(t)){var k=n.get(t);if(k[0]===M&&k[1]===O)return}n.set(t,[M,O]);var S=Object.create(h.prototype);S.target=t,S.contentRect=new c(u,d,M,O),s.has(i)||(s.set(i,[]),p.add(i)),s.get(i).push(S)}))})),p.forEach((function(e){i.get(e).call(e,s.get(e),e)}))}return s.prototype.observe=function(i){if(i instanceof window.Element){r.has(i)||(r.set(i,new Set),o.add(i),a.set(i,window.getComputedStyle(i)));var n=r.get(i);n.has(this)||n.add(this),cancelAnimationFrame(t),t=requestAnimationFrame(d)}},s.prototype.unobserve=function(i){if(i instanceof window.Element&&r.has(i)){var n=r.get(i);n.has(this)&&(n.delete(this),n.size||(r.delete(i),o.delete(i))),n.size||r.delete(i),o.size||cancelAnimationFrame(t)}},A.DOMRectReadOnly=c,A.ResizeObserver=s,A.ResizeObserverEntry=h,A}; // eslint-disable-line
3 changes: 0 additions & 3 deletions lib/matplotlib/backends/web_backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
"lint:check": "npm run prettier:check && npm run eslint:check",
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json}\"",
"prettier:check": "prettier --check \"**/*{.ts,.tsx,.js,.jsx,.css,.json}\""
},
"dependencies": {
"@jsxtools/resize-observer": "^1.0.4"
}
}
2 changes: 0 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ project(
find_program('python3', 'python', version: '>= 3.11'),
'-m', 'setuptools_scm', check: true).stdout().strip(),
# qt_editor backend is MIT
# ResizeObserver at end of lib/matplotlib/backends/web_backend/js/mpl.js is CC0
# STIX, Computer Modern, and Last Resort are OFL
# DejaVu is Bitstream Vera and Public Domain
license: 'PSF-2.0 AND MIT AND CC0-1.0 AND OFL-1.1 AND Bitstream-Vera AND Public-Domain',
Expand All @@ -19,7 +18,6 @@ project(
'LICENSE/LICENSE_COURIERTEN',
'LICENSE/LICENSE_FREETYPE',
'LICENSE/LICENSE_HARFBUZZ',
'LICENSE/LICENSE_JSXTOOLS_RESIZE_OBSERVER',
'LICENSE/LICENSE_LAST_RESORT_FONT',
'LICENSE/LICENSE_LIBRAQM',
'LICENSE/LICENSE_QT4_EDITOR',
Expand Down
102 changes: 0 additions & 102 deletions tools/embed_js.py

This file was deleted.

Loading