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.
StackGenVis/frontend/node_modules/@interactjs/utils/browser.js

52 lines
2.1 KiB

4 years ago
import domObjects from "./domObjects.js";
import * as is from "./is.js";
import win from "./window.js";
const browser = {
init,
supportsTouch: null,
supportsPointerEvent: null,
isIOS7: null,
isIOS: null,
isIe9: null,
isOperaMobile: null,
prefixedMatchesSelector: null,
pEventTypes: null,
wheelEvent: null
};
function init(window) {
const Element = domObjects.Element;
const navigator = win.window.navigator; // Does the browser support touch input?
browser.supportsTouch = 'ontouchstart' in window || is.func(window.DocumentTouch) && domObjects.document instanceof window.DocumentTouch; // Does the browser support PointerEvents
browser.supportsPointerEvent = navigator.pointerEnabled !== false && !!domObjects.PointerEvent;
browser.isIOS = /iP(hone|od|ad)/.test(navigator.platform); // scrolling doesn't change the result of getClientRects on iOS 7
browser.isIOS7 = /iP(hone|od|ad)/.test(navigator.platform) && /OS 7[^\d]/.test(navigator.appVersion);
browser.isIe9 = /MSIE 9/.test(navigator.userAgent); // Opera Mobile must be handled differently
browser.isOperaMobile = navigator.appName === 'Opera' && browser.supportsTouch && /Presto/.test(navigator.userAgent); // prefix matchesSelector
browser.prefixedMatchesSelector = 'matches' in Element.prototype ? 'matches' : 'webkitMatchesSelector' in Element.prototype ? 'webkitMatchesSelector' : 'mozMatchesSelector' in Element.prototype ? 'mozMatchesSelector' : 'oMatchesSelector' in Element.prototype ? 'oMatchesSelector' : 'msMatchesSelector';
browser.pEventTypes = browser.supportsPointerEvent ? domObjects.PointerEvent === window.MSPointerEvent ? {
up: 'MSPointerUp',
down: 'MSPointerDown',
over: 'mouseover',
out: 'mouseout',
move: 'MSPointerMove',
cancel: 'MSPointerCancel'
} : {
up: 'pointerup',
down: 'pointerdown',
over: 'pointerover',
out: 'pointerout',
move: 'pointermove',
cancel: 'pointercancel'
} : null; // because Webkit and Opera still use 'mousewheel' event type
browser.wheelEvent = 'onmousewheel' in domObjects.document ? 'mousewheel' : 'wheel';
}
export default browser;
//# sourceMappingURL=browser.js.map