| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- /* *
- *
- * (c) 2010-2021 Torstein Honsi
- *
- * License: www.highcharts.com/license
- *
- * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
- *
- * */
- 'use strict';
- /* *
- *
- * Constants
- *
- * */
- /**
- * @private
- * @deprecated
- * @todo Rename UMD argument `win` to `window`; move code to `Globals.win`
- */
- var w = (typeof win !== 'undefined' ?
- win :
- typeof window !== 'undefined' ?
- window :
- {}
- // eslint-disable-next-line node/no-unsupported-features/es-builtins
- );
- /* *
- *
- * Namespace
- *
- * */
- /**
- * Shared Highcharts properties.
- */
- var Globals;
- (function (Globals) {
- /* *
- *
- * Constants
- *
- * */
- Globals.SVG_NS = 'http://www.w3.org/2000/svg', Globals.product = 'Highcharts', Globals.version = '9.1.0', Globals.win = w, Globals.doc = Globals.win.document, Globals.svg = (Globals.doc &&
- Globals.doc.createElementNS &&
- !!Globals.doc.createElementNS(Globals.SVG_NS, 'svg').createSVGRect), Globals.userAgent = (Globals.win.navigator && Globals.win.navigator.userAgent) || '', Globals.isChrome = Globals.userAgent.indexOf('Chrome') !== -1, Globals.isFirefox = Globals.userAgent.indexOf('Firefox') !== -1, Globals.isMS = /(edge|msie|trident)/i.test(Globals.userAgent) && !Globals.win.opera, Globals.isSafari = !Globals.isChrome && Globals.userAgent.indexOf('Safari') !== -1, Globals.isTouchDevice = /(Mobile|Android|Windows Phone)/.test(Globals.userAgent), Globals.isWebKit = Globals.userAgent.indexOf('AppleWebKit') !== -1, Globals.deg2rad = Math.PI * 2 / 360, Globals.hasBidiBug = (Globals.isFirefox &&
- parseInt(Globals.userAgent.split('Firefox/')[1], 10) < 4 // issue #38
- ), Globals.hasTouch = !!Globals.win.TouchEvent, Globals.marginNames = [
- 'plotTop',
- 'marginRight',
- 'marginBottom',
- 'plotLeft'
- ], Globals.noop = function () { }, Globals.supportsPassiveEvents = (function () {
- // Checks whether the browser supports passive events, (#11353).
- var supportsPassive = false;
- // Object.defineProperty doesn't work on IE as well as passive
- // events - instead of using polyfill, we can exclude IE totally.
- if (!Globals.isMS) {
- var opts = Object.defineProperty({}, 'passive', {
- get: function () {
- supportsPassive = true;
- }
- });
- if (Globals.win.addEventListener && Globals.win.removeEventListener) {
- Globals.win.addEventListener('testPassive', Globals.noop, opts);
- Globals.win.removeEventListener('testPassive', Globals.noop, opts);
- }
- }
- return supportsPassive;
- }());
- /**
- * An array containing the current chart objects in the page. A chart's
- * position in the array is preserved throughout the page's lifetime. When
- * a chart is destroyed, the array item becomes `undefined`.
- *
- * @name Highcharts.charts
- * @type {Array<Highcharts.Chart|undefined>}
- */
- Globals.charts = [];
- /**
- * A hook for defining additional date format specifiers. New
- * specifiers are defined as key-value pairs by using the
- * specifier as key, and a function which takes the timestamp as
- * value. This function returns the formatted portion of the
- * date.
- *
- * @sample highcharts/global/dateformats/
- * Adding support for week number
- *
- * @name Highcharts.dateFormats
- * @type {Record<string, Highcharts.TimeFormatCallbackFunction>}
- */
- Globals.dateFormats = {};
- /**
- * @private
- * @deprecated
- * @todo Use only `Core/Series/SeriesRegistry.seriesTypes`
- */
- Globals.seriesTypes = {};
- /**
- * @private
- */
- Globals.symbolSizes = {};
- })(Globals || (Globals = {}));
- /* *
- *
- * Default Export
- *
- * */
- export default Globals;
|