StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
909 B
39 lines
909 B
4 years ago
|
import isWindow from "./isWindow.js";
|
||
|
const win = {
|
||
|
realWindow: undefined,
|
||
|
window: undefined,
|
||
|
getWindow,
|
||
|
init
|
||
|
};
|
||
|
export function init(window) {
|
||
|
// get wrapped window if using Shadow DOM polyfill
|
||
|
win.realWindow = window; // create a TextNode
|
||
|
|
||
|
const el = window.document.createTextNode(''); // check if it's wrapped by a polyfill
|
||
|
|
||
|
if (el.ownerDocument !== window.document && typeof window.wrap === 'function' && window.wrap(el) === el) {
|
||
|
// use wrapped window
|
||
|
window = window.wrap(window);
|
||
|
}
|
||
|
|
||
|
win.window = window;
|
||
|
}
|
||
|
|
||
|
if (typeof window === 'undefined') {
|
||
|
win.window = undefined;
|
||
|
win.realWindow = undefined;
|
||
|
} else {
|
||
|
init(window);
|
||
|
}
|
||
|
|
||
|
export function getWindow(node) {
|
||
|
if (isWindow(node)) {
|
||
|
return node;
|
||
|
}
|
||
|
|
||
|
const rootNode = node.ownerDocument || node;
|
||
|
return rootNode.defaultView || win.window;
|
||
|
}
|
||
|
win.init = init;
|
||
|
export default win;
|
||
|
//# sourceMappingURL=window.js.map
|