forked from Mikhus/canvas-gauges
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgauge.min.js.map
1 lines (1 loc) · 170 KB
/
gauge.min.js.map
1
{"version":3,"sources":["gauge.min.js"],"names":["ns","_toConsumableArray","arr","Array","isArray","i","arr2","length","from","_possibleConstructorReturn","self","call","ReferenceError","_inherits","subClass","superClass","TypeError","prototype","Object","create","constructor","value","enumerable","writable","configurable","setPrototypeOf","__proto__","_classCallCheck","instance","Constructor","vendorize","prop","window","global","vendors","s","capitalized","charAt","toUpperCase","substr","vendorProp","step","time","draw","start","rule","duration","end","anim","progress","percent","frame","requestAnimationFrame","Collection","apply","this","arguments","verifyError","err","DOMException","result","roundRect","context","x","y","w","h","r","beginPath","moveTo","lineTo","quadraticCurveTo","closePath","padValue","val","options","dec","valueDec","int","valueInt","strVal","n","parseFloat","Math","abs","toFixed","toString","split","round","formatMajorTickNumber","num","right","hasDec","majorTicksDec","majorTicksInt","indexOf","join","replace","radians","degrees","PI","radialPoint","radius","angle","sin","cos","linearGradient","colorFrom","colorTo","isVertical","undefined","grad","createLinearGradient","addColorStop","drawNeedleShadow","needleShadow","shadowOffsetX","shadowOffsetY","shadowBlur","shadowColor","colorNeedleShadowDown","drawValueBox","max","valueBox","text","valueText","strokeStyle","lineWidth","save","font","fontValueSize","fontValue","th","tw","measureText","width","bx","by","bw","bh","br","valueBoxBorderRadius","rect","gy","valueBoxStroke","grd","createRadialGradient","colorValueBoxRect","colorValueBoxRectEnd","stroke","colorValueBoxShadow","colorValueBoxBackground","fillStyle","fill","restore","valueTextShadow","colorValueTextShadow","colorValueText","textAlign","fillText","drawRadialCircle","arc","drawings","maxRadialRadius","maxRadius","borderShadowWidth","borderOuterWidth","borderMiddleWidth","borderInnerWidth","drawRadialPlate","d0","r0","r1","r2","r3","colorBorderOuter","colorBorderOuterEnd","colorBorderMiddle","colorBorderMiddleEnd","colorBorderInner","colorBorderInnerEnd","colorBorderShadow","colorPlateEnd","colorPlate","drawRadialHighlights","radialTicksRadius","highlights","hlt","vd","maxValue","minValue","ticksAngle","sa","startAngle","ea","to","ps","pe","ps1","pe1","rotate","HPI","color","drawRadialMinorTicks","SmartCanvas","pixelRatio","colorMinorTicks","minorTicks","majorTicks","closeStrokedPath","drawRadialMajorTicks","colors","push","colorMajorTicks","radialNextAngle","strokeTicks","drawRadialNumbers","points","isAnimated","animationTarget","colorNumbers","plateValueAngle","point","fontNumbersSize","fontNumbers","drawRadialTitle","title","fontTitleSize","fontTitle","colorTitle","drawRadialUnits","units","fontUnitsSize","fontUnits","colorUnits","drawRadialNeedle","needle","needleCircleSize","rIn","needleEnd","rStart","needleStart","rOut","pad1","needleWidth","pad2","isFixed","colorNeedle","colorNeedleEnd","needleType","colorNeedleShadowUp","needleCircleOuter","colorNeedleCircleOuter","colorNeedleCircleOuterEnd","needleCircleInner","colorNeedleCircleInner","colorNeedleCircleInnerEnd","drawRadialValueBox","drawRectangle","colorStart","colorEnd","barDimensions","hasTitle","hasUnits","hasValue","titleMargin","unitsMargin","valueMargin","strokeWidth","barStrokeWidth","barBeginCircle","barWidth","barLength","barMargin","x0","y0","dx","hasLeft","hasRight","ticksWidth","dy","barOffset","ticksLength","X","Y","baseX","baseY","ticksPadding","drawLinearBarShape","type","_barDimensions","fullBarLength","direction","alpha","asin","cosAlpha","sinAlpha","x1","y1","cutRadius","x2","y2","x3","y3","rx","ry","colorBarStroke","colorBar","colorBarEnd","colorBarProgress","colorBarProgressEnd","drawLinearBar","hasTicksBar","notWhich","needleSide","tickSide","numberSide","drawLinearBarProgress","barProgress","drawLinearBarHighlights","_context$barDimension","tickOffset","interval","eX","eH","eY","hLeft","hRight","entry","eStart","eW","drawLinearTick","drawLinearTicks","ticksSize","deltaLen","lineLength","_context$barDimension2","tickX","tickY","tickLen","tickLeft","tickRight","tickSpace","prepareTicks","drawLinearMajorTicks","_prepareTicks","_prepareTicks2","_slicedToArray","_context$barDimension3","rightTicks","leftTicks","sX","sY","drawLinearTickStroke","drawLinearMinorTicks","_prepareTicks3","_prepareTicks4","ticksWidthMinor","drawLinearMajorTicksNumbers","_context$barDimension4","ticks","textHeight","numLeft","numRight","textX","textY","textWidth","numberOffset","tick","drawLinearTitle","_context$barDimension5","drawLinearUnits","_context$barDimension6","drawLinearBarNeedle","_context$barDimension7","position","tickWidth","baseLength","needleLength","toLowerCase","drawLinearArrowNeedle","drawLinearLineNeedle","barStart","nLeft","nRight","needleStyle","isRight","peakLength","bodyLength","halfWidth","drawLinearValueBox","drawLinearPlate","borderRadius","w1","w2","w3","w4","h1","h2","h3","h4","x4","y4","sliceIterator","_arr","_n","_d","_e","_s","_i","Symbol","iterator","next","done","_get","get","object","property","receiver","Function","desc","getOwnPropertyDescriptor","parent","getPrototypeOf","getter","_createClass","defineProperties","target","props","descriptor","defineProperty","key","protoProps","staticProps","assign","firstSource","nextSource","keysArray","keys","nextIndex","len","nextKey","searchElement","fromIndex","k","O","Infinity","callback","setTimeout","Date","getTime","rules","linear","p","quad","pow","dequad","quint","dequint","cycle","acos","decycle","bounce","debounce","a","b","elastic","delastic","Animation","_this","performance","now","cancelAnimationFrame","id","DomObserver","element","toDashed","Type","mutationsObserved","isObservable","MutationObserver","domReady","traverse","bind","node","tagName","getAttribute","elements","document","getElementsByTagName","process","observe","body","childList","subtree","attributes","characterData","attributeOldValue","characterDataOldValue","records","_this2","_loop","record","attributeName","isValidNode","oldValue","addedNodes","ii","ss","_this3","JSON","parse","stringify","hasOwnProperty","toAttributeName","attributeValue","renderTo","observer","forEach","attr","disconnect","destroy","_prop","map","part","_options","update","test","e","camelCase","str","handler","readyState","addEventListener","attachEvent","canvas","height","collection","init","style","elementClone","cloneNode","getContext","contextClone","drawWidth","drawHeight","drawX","drawY","minSide","initialized","translate","index","splice","clearRect","onRedraw","scale","redraw","devicePixelRatio","matchMedia","addListener","GenericOptions","animatedValue","animateOnInit","borders","animation","animationDuration","animationRule","getElementById","gauges","BaseGauge","className","name","HTMLCanvasElement","parentNode","offsetWidth","offsetHeight","_value","set","_this4","fromValue","animate","defaultRadialGaugeOptions","RadialGauge","_BaseGauge","isNaN","commit","drawImage","_context","initialize","defaultLinearGaugeOptions","LinearGauge","_BaseGauge2","drawBox","concat","module","exports"],"mappings":"CAAC,SAASA,GAAK,YAQf,SAASC,GAAmBC,GAAO,GAAIC,MAAMC,QAAQF,GAAM,CAAE,IAAK,GAAIG,GAAI,EAAGC,EAAOH,MAAMD,EAAIK,QAASF,EAAIH,EAAIK,OAAQF,IAAOC,EAAKD,GAAKH,EAAIG,EAAM,OAAOC,GAAe,MAAOH,OAAMK,KAAKN,GAE1L,QAASO,GAA2BC,EAAMC,GAAQ,IAAKD,EAAQ,KAAM,IAAIE,gBAAe,4DAAgE,QAAOD,GAAyB,gBAATA,IAAqC,kBAATA,GAA8BD,EAAPC,EAElO,QAASE,GAAUC,EAAUC,GAAc,GAA0B,kBAAfA,IAA4C,OAAfA,EAAuB,KAAM,IAAIC,WAAU,iEAAoED,GAAeD,GAASG,UAAYC,OAAOC,OAAOJ,GAAcA,EAAWE,WAAaG,aAAeC,MAAOP,EAAUQ,YAAY,EAAOC,UAAU,EAAMC,cAAc,KAAeT,IAAYG,OAAOO,eAAiBP,OAAOO,eAAeX,EAAUC,GAAcD,EAASY,UAAYX,GAEje,QAASY,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIb,WAAU,qCAsIhH,QAASc,GAAUC,EAAMvB,GAMrB,GAJKA,IACDA,EAAyB,mBAAXwB,QAAyBC,OAASD,QAG1B,mBAAfxB,GAAKuB,GACZ,MAAOvB,GAAKuB,EAQhB,KALA,GAAIG,IAAW,SAAU,MAAO,KAAM,KAClC7B,EAAI,EACJ8B,EAAID,EAAQ3B,OACZ6B,EAAcL,EAAKM,OAAO,GAAGC,cAAgBP,EAAKQ,OAAO,GAEtDlC,EAAI8B,EAAG9B,IAAK,CACf,GAAImC,GAAahC,EAAK0B,EAAQ7B,GAAK+B,EAGnC,IAA0B,mBAAfI,GACP,MAAOA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gBvM,EAAQuM,cAEvC0D,EAAwBjQ,EAASa,GACjCuR,EAAqBpS,EAASa,GAC9B6Q,EAAqB1R,EAASa,GAC9B2R,EAA4BxS,EAASa,GACrCsS,EAAgBnT,EAASa,GACzBwS,EAAgBrT,EAASa,GAEzB4c,EAAOK,aAAaS,aAAc,EAGtC9e,KAAKge,OAAOkD,SAGZlD,EAAOzd,QAAQ2e,UAAU1e,EAAGC,EAAGC,EAAGC,GAClCqd,EAAOzd,QAAQkE,OAEfuZ,EAAOzd,QAAQ4gB,UAAUnD,EAAOK,aAAc7d,EAAGC,EAAGC,EAAGC,GACvDqd,EAAOzd,QAAQkE,OAEf6L,EAAsBvQ,MAAMwD,QAAYya,EAAOzd,QAASa,GAASsgB,OAAOhlB,EAAmBsD,KAAKyhB,WAChG3N,EAAoBkK,EAAOzd,QAASa,GACpC2T,EAAmBhV,MAAMwD,QAAYya,EAAOzd,QAASa,EAASA,EAAQse,cAAgB1f,KAAKoB,QAAQtD,MAAQkC,KAAKlC,OAAO4jB,OAAOhlB,EAAmBsD,KAAKyhB,WAEtJlL,GAAKgL,EAAY7jB,UAAUS,WAAaR,OAAOqZ,eAAeuK,EAAY7jB,WAAY,OAAQsC,MAAM5C,KAAK4C,MAC3G,MAAOG,GACLwG,GAASzG,YAAYC,GAGzB,MAAOH,UAIRuhB,GACTrB,GASgB,oBAAPzjB,KACPA,EAAgB,YAAI8kB,IAGxBrB,GAAUmB,WAAW,cAAeC,IAA8C,mBAAXK,SAA0BhkB,OAAOga,OAAOlb,GAAKqD,WAAYA,EAAW2f,eAAgBA,GAAe5F,UAAWA,GAAUqG,UAAWA,GAAUvZ,SAAUA,GAAS0C,YAAaA,GAAY9K,UAAWA,KAAgC,mBAAXojB,QAA0BA,OAAOC,QAAUnjB","file":"gauge.min.js","sourcesContent":["(function(ns) {'use strict';\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @external {Object.assign} https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n */\n/* istanbul ignore next */\nif (!Object.assign) {\n Object.defineProperty(Object, 'assign', {\n enumerable: false,\n configurable: true,\n writable: true,\n value: function value(target, firstSource) {\n 'use strict';\n\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert first argument to object');\n }\n\n var to = Object(target);\n var i = 1;\n\n for (; i < arguments.length; i++) {\n var nextSource = arguments[i];\n\n if (nextSource === undefined || nextSource === null) {\n continue;\n }\n\n var keysArray = Object.keys(Object(nextSource));\n var nextIndex = 0,\n len = keysArray.length;\n\n for (; nextIndex < len; nextIndex++) {\n var nextKey = keysArray[nextIndex];\n var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n\n if (desc !== undefined && desc.enumerable) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n\n return to;\n }\n });\n}\n\n/**\n * @external {Array.indexOf} https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf\n */\n/* istanbul ignore next */\nif (!Array.prototype.indexOf) {\n Array.prototype.indexOf = function (searchElement, fromIndex) {\n var k;\n\n if (this == null) {\n throw new TypeError('\"this\" is null or not defined');\n }\n\n var O = Object(this);\n var len = O.length >>> 0;\n\n if (len === 0) {\n return -1;\n }\n\n var n = +fromIndex || 0;\n\n if (Math.abs(n) === Infinity) {\n n = 0;\n }\n\n if (n >= len) {\n return -1;\n }\n\n k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);\n\n while (k < len) {\n if (k in O && O[k] === searchElement) {\n return k;\n }\n\n k++;\n }\n\n return -1;\n };\n}\n\n/*!\n * @license\n * Minimalistic HTML5 Canvas Gauge implementation\n *\n * This code is subject to MIT license.\n *\n * Copyright (c) 2012 Mykhailo Stadnyk <[email protected]>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n/**\n * Look-ups for a proper vendor-specific property and returns its value\n *\n * @example\n * var requestAnimationFrame = vendorize('requestAnimationFrame');\n * // it will refer properly to:\n * // - window.requestAnimationFrame by default or to\n * // - window.webkitRequestAnimationFrame or to\n * // - window.mozRequestAnimationFrame or to\n * // - window.msRequestAnimationFrame or to\n * // - window.oRequestAnimationFrame\n * // depending on the current browser vendor\n *\n * @author Mykhailo Stadnyk <[email protected]>\n * @param {string} prop\n * @param {HTMLElement|Window|object} [from] - default is window\n * @returns {*}\n */\nfunction vendorize(prop, from) {\n /* istanbul ignore else: no reason to cover */\n if (!from) {\n from = typeof window === 'undefined' ? global : window;\n }\n\n if (typeof from[prop] !== 'undefined') {\n return from[prop];\n }\n\n var vendors = ['webkit', 'moz', 'ms', 'o'];\n var i = 0;\n var s = vendors.length;\n var capitalized = prop.charAt(0).toUpperCase() + prop.substr(1);\n\n for (; i < s; i++) {\n var vendorProp = from[vendors[i] + capitalized];\n\n /* istanbul ignore if: requires very complex environment to test (specific browser version) */\n if (typeof vendorProp !== 'undefined') {\n return vendorProp;\n }\n }\n\n return null;\n}\n\n/*!\n * @license\n * Minimalistic HTML5 Canvas Gauge implementation\n *\n * This code is subject to MIT license.\n *\n * Copyright (c) 2012 Mykhailo Stadnyk <[email protected]>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * @ignore\n * @typedef {object} ns\n */\n\n/* istanbul ignore next */\n/**\n * @type {function(callback: function(time: number): number, element?: HTMLElement)}\n * @access private\n */\nvar requestAnimationFrame = vendorize('requestAnimationFrame') || function (callback) {\n return setTimeout(function () {\n return callback(new Date().getTime());\n }, 1000 / 60);\n};\n\n/**\n * Generic AnimationRule function interface\n *\n * @typedef {function(percent: number): number} AnimationRule\n */\n\n/**\n * Callback for animation step draw event.\n * It will be called each time animation step is executed, bypassing\n * as first argument a percent of animation completeness. It is expected\n * that this callback will do an actual work of animating an elements or\n * whatever, as far as animation engine is just calculating and executing\n * animation steps without any knowledge about things under animation.\n *\n * @typedef {function(percent: number): *} DrawEventCallback\n */\n\n/**\n * Callback for animation complete event.\n * It is called once each animation is complete.\n *\n * @typedef {function(): *} EndEventCallback\n */\n\n/**\n * Predefined known animation rules.\n * It's a simple collection of math for some most used animations.\n *\n * @typedef {{linear: AnimationRule, quad: AnimationRule, dequad: AnimationRule, quint: AnimationRule, dequint: AnimationRule, cycle: AnimationRule, decycle: AnimationRule, bounce: AnimationRule, debounce: AnimationRule, elastic: AnimationRule, delastic: AnimationRule}} AnimationRules\n */\n\n/* istanbul ignore next: no reason covering this */\nvar rules = {\n linear: function linear(p) {\n return p;\n },\n quad: function quad(p) {\n return Math.pow(p, 2);\n },\n dequad: function dequad(p) {\n return 1 - rules.quad(1 - p);\n },\n quint: function quint(p) {\n return Math.pow(p, 5);\n },\n dequint: function dequint(p) {\n return 1 - Math.pow(1 - p, 5);\n },\n cycle: function cycle(p) {\n return 1 - Math.sin(Math.acos(p));\n },\n decycle: function decycle(p) {\n return Math.sin(Math.acos(1 - p));\n },\n bounce: function bounce(p) {\n return 1 - rules.debounce(1 - p);\n },\n debounce: function debounce(p) {\n var a = 0,\n b = 1;\n for (; 1; a += b, b /= 2) {\n if (p >= (7 - 4 * a) / 11) {\n return -Math.pow((11 - 6 * a - 11 * p) / 4, 2) + Math.pow(b, 2);\n }\n }\n },\n elastic: function elastic(p) {\n return 1 - rules.delastic(1 - p);\n },\n delastic: function delastic(p) {\n var x = 1.5;\n return Math.pow(2, 10 * (p - 1)) * Math.cos(20 * Math.PI * x / 3 * p);\n }\n};\n\n/* istanbul ignore next: private, not testable */\n/**\n * Evaluates animation step and decides if the next step required or\n * stops animation calling a proper events.\n *\n * @access private\n * @param {number} time\n * @param {DrawEventCallback} draw\n * @param {number} start\n * @param {AnimationRule} rule\n * @param {number} duration\n * @param {EndEventCallback} end\n * @param {Animation} anim\n */\nfunction step(time, draw, start, rule, duration, end, anim) {\n if (typeof rule !== 'function') {\n throw new TypeError('Invalid animation rule:', rule);\n }\n\n var progress = time - start;\n var percent = progress / duration;\n\n if (percent > 1) {\n percent = 1;\n }\n\n draw && draw(percent === 1 ? percent : rule(percent));\n\n if (progress < duration) {\n anim.frame = requestAnimationFrame(function (time) {\n return step(time, draw, start, rule, duration, end, anim);\n });\n } else {\n end && end();\n }\n}\n\n/**\n * Animation engine API for JavaScript-based animations.\n * This is simply an animation core framework which simplifies creation\n * of various animations for generic purposes.\n *\n * @example\n * // create 'linear' animation engine, 500ms duration\n * let linear = new Animation('linear', 500);\n *\n * // create 'elastic' animation engine\n * let elastic = new Animation('elastic');\n *\n * // define animation behavior\n * let bounced = new Animation('bounce', 500, percent => {\n * let value = parseInt(percent * 100, 10);\n *\n * $('div.bounced').css({\n * width: value + '%',\n * height: value + '%'\n * });\n * });\n *\n * // execute animation\n * bounced.animate();\n *\n * // execute animation and handle when its finished\n * bounced.animate(null, () => {\n * console.log('Animation finished!');\n * });\n */\n\nvar Animation = function () {\n\n /**\n * @constructor\n * @param {string|AnimationRule} rule\n * @param {number} duration\n * @param {DrawEventCallback} [draw]\n * @param {EndEventCallback} [end]\n */\n function Animation() {\n var rule = arguments.length <= 0 || arguments[0] === undefined ? 'linear' : arguments[0];\n var duration = arguments.length <= 1 || arguments[1] === undefined ? 250 : arguments[1];\n var draw = arguments.length <= 2 || arguments[2] === undefined ? function () {} : arguments[2];\n var end = arguments.length <= 3 || arguments[3] === undefined ? function () {} : arguments[3];\n\n _classCallCheck(this, Animation);\n\n /**\n * Overall animation duration in milliseconds.\n * By default is equal to 250 ms.\n *\n * @type {number}\n */\n this.duration = duration;\n\n /**\n * Animation rule. By default is linear animation.\n * Animation rule is a subject to animation rules, which are\n * a simple object containing math-based methods for calculating\n * animation steps.\n *\n * @type {string|AnimationRule}\n */\n this.rule = rule;\n\n /**\n * Callback function for the animation step draw event.\n *\n * @type {DrawEventCallback}\n */\n this.draw = draw;\n\n /**\n * Callback for the animation complete event.\n *\n * @type {EndEventCallback}\n */\n this.end = end;\n\n if (typeof this.draw !== 'function') {\n throw new TypeError('Invalid animation draw callback:', draw);\n }\n\n if (typeof this.end !== 'function') {\n throw new TypeError('Invalid animation end callback:', end);\n }\n }\n\n /* istanbul ignore next: non-testable */\n /**\n * Performs animation calling each animation step draw callback and\n * end callback at the end of animation. Callbacks are optional to this\n * method call. If them are not bypassed will be used that ones which\n * was pre-set on constructing an Animation object or pre-set after\n * construction.\n *\n * @example\n * function draw(percent) {\n * $('.my-animated-divs').css({\n * width: parseInt(percent * 100, 10) + '%'\n * });\n * }\n * function done() {\n * console.log('Animation complete!');\n * }\n *\n * // Define 'draw' and 'end' callbacks on construction\n * var animation = new Animation('cycle', 500, draw, done);\n * animation.animate();\n *\n * // Define 'draw' and 'end' callbacks after construction\n * var animation = new Animation('cycle', 500);\n * animation.draw = draw;\n * animation.end = done;\n * animation.animate();\n *\n * // Define 'draw' and 'end' callbacks at animation\n * var animation = new Animation('cycle', 500);\n * animation.animate(draw, done);\n *\n * @param {DrawEventCallback} [draw]\n * @param {EndEventCallback} [end]\n */\n\n\n _createClass(Animation, [{\n key: 'animate',\n value: function animate(draw, end) {\n var _this = this;\n\n //noinspection JSUnresolvedVariable\n var start = ns.performance && ns.performance.now ? ns.performance.now() : vendorize('animationStartTime') || Date.now();\n\n draw = draw || this.draw;\n end = end || this.end;\n\n /**\n * Current requested animation frame identifier\n *\n * @type {number}\n */\n this.frame = requestAnimationFrame(function (time) {\n return step(time, draw, start, rules[_this.rule] || _this.rule, _this.duration, end, _this);\n });\n }\n\n /**\n * Destroys this object properly\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n if (this.frame) {\n var cancelAnimationFrame = vendorize('cancelAnimationFrame') ||\n /* istanbul ignore next */\n function (id) {};\n\n cancelAnimationFrame(this.frame);\n this.frame = null;\n }\n\n this.draw = null;\n this.end = null;\n }\n }]);\n\n return Animation;\n}();\n\n/**\n * Animation rules bound statically to Animation constructor.\n *\n * @type {AnimationRules}\n * @static\n */\n\n\nAnimation.rules = rules;\n\n/*!\n * @license\n * Minimalistic HTML5 Canvas Gauge implementation\n *\n * This code is subject to MIT license.\n *\n * Copyright (c) 2012 Mykhailo Stadnyk <[email protected]>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n/**\n * @typedef {{ constructor: function(options: GenericOptions): GaugeInterface, draw: function(): GaugeInterface, destroy: function, update: function(options: GenericOptions) }} GaugeInterface\n */\n/**\n * @typedef {{parse: function, stringify: function}} JSON\n * @external {JSON} https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON\n */\n/**\n * @ignore\n * @typedef {{MutationObserver: function}} ns\n */\n\n/**\n * DOM Observer.\n * It will observe DOM document for a configured element types and\n * instantiate associated Types for an existing or newly added DOM elements\n *\n * @example\n * class ProgressBar {\n * constructor(options) {}\n * draw() {}\n * }\n *\n * // It will observe DOM document for elements <div>\n * // having attribute 'data-type=\"progress\"'\n * // and instantiate for each new instance of ProgressBar\n *\n * new DomParser({color: 'red'}, 'div', 'progress', ProgressBar);\n *\n * // assume we could have HTML like this\n * // <div data-type=\"progress\" color=\"blue\"></div>\n * // in this case all matching attributes names for a given options will be\n * // parsed and bypassed to an instance from HTML attributes\n */\n\nvar DomObserver = function () {\n\n /**\n * @constructor\n * @param {object} options\n * @param {string} element\n * @param {string} type\n */\n function DomObserver(options, element, type) {\n _classCallCheck(this, DomObserver);\n\n //noinspection JSUnresolvedVariable\n /**\n * Default instantiation options for the given type\n *\n * @type {Object}\n */\n this.options = options;\n\n /**\n * Name of an element to lookup/observe\n *\n * @type {string}\n */\n this.element = element.toLowerCase();\n\n /**\n * data-type attribute value to lookup\n *\n * @type {string}\n */\n this.type = DomObserver.toDashed(type);\n\n /**\n * Actual type constructor to instantiate for each found element\n *\n * @type {Function}\n */\n this.Type = ns[type];\n\n /**\n * Signals if mutations observer for this type or not\n *\n * @type {boolean}\n */\n this.mutationsObserved = false;\n\n /**\n * Flag specifies whenever the browser supports observing\n * of DOM tree mutations or not\n *\n * @type {boolean}\n */\n this.isObservable = !!ns.MutationObserver;\n\n /* istanbul ignore next: this should be tested with end-to-end tests */\n DomObserver.domReady(this.traverse.bind(this));\n }\n\n /**\n * Checks if given node is valid node to process\n *\n * @param {Node|HTMLElement} node\n * @returns {boolean}\n */\n\n\n _createClass(DomObserver, [{\n key: 'isValidNode',\n value: function isValidNode(node) {\n //noinspection JSUnresolvedVariable\n return !!(node.tagName && node.tagName.toLowerCase() === this.element && node.getAttribute('data-type') === this.type);\n }\n\n /**\n * Traverse entire current DOM tree and process matching nodes.\n * Usually it should be called only once on document initialization.\n */\n\n }, {\n key: 'traverse',\n value: function traverse() {\n var elements = document.getElementsByTagName(this.element);\n var i = 0,\n s = elements.length;\n\n /* istanbul ignore next: this should be tested with end-to-end tests */\n for (; i < s; i++) {\n this.process(elements[i]);\n }\n\n if (this.isObservable && !this.mutationsObserved) {\n new ns.MutationObserver(this.observe.bind(this)).observe(document.body, {\n childList: true,\n subtree: true,\n attributes: true,\n characterData: true,\n attributeOldValue: true,\n characterDataOldValue: true\n });\n\n this.mutationsObserved = true;\n }\n }\n\n /**\n * Observes given mutation records for an elements to process\n *\n * @param {MutationRecord[]} records\n */\n\n }, {\n key: 'observe',\n value: function observe(records) {\n var _this2 = this;\n\n var i = 0;\n var s = records.length;\n\n /* istanbul ignore next: this should be tested with end-to-end tests */\n\n var _loop = function _loop() {\n var record = records[i];\n\n if (record.type === 'attributes' && record.attributeName === 'data-type' && _this2.isValidNode(record.target) && record.oldValue !== _this2.type) // skip false-positive mutations\n {\n setTimeout(function () {\n return _this2.process(record.target);\n });\n } else if (record.addedNodes && record.addedNodes.length) {\n var ii = 0;\n var ss = record.addedNodes.length;\n\n for (; ii < ss; ii++) {\n _this2.process(record.addedNodes[ii]);\n }\n }\n };\n\n for (; i < s; i++) {\n _loop();\n }\n }\n\n /**\n * Parses given attribute value to a proper JavaScript value.\n * For example it will parse some stringified value to a proper type\n * value, e.g. 'true' => true, 'null' => null, '{\"prop\": 20}' => {prop: 20}\n *\n * @param {*} value\n * @return {*}\n */\n\n }, {\n key: 'process',\n\n\n /**\n * Processes a given node, instantiating a proper type constructor for it\n *\n * @param {Node|HTMLElement} node\n * @returns {GaugeInterface|null}\n */\n value: function process(node) {\n var _this3 = this;\n\n if (!this.isValidNode(node)) return null;\n\n var prop = void 0;\n var options = JSON.parse(JSON.stringify(this.options));\n var instance = null;\n\n for (prop in options) {\n /* istanbul ignore else: non-testable in most cases */\n if (options.hasOwnProperty(prop)) {\n var attributeName = DomObserver.toAttributeName(prop);\n var attributeValue = DomObserver.parse(node.getAttribute(attributeName));\n\n if (attributeValue !== null && attributeValue !== undefined) {\n options[prop] = attributeValue;\n }\n }\n }\n\n options.renderTo = node;\n instance = new this.Type(options);\n instance.draw && instance.draw();\n\n if (!this.isObservable) return instance;\n\n instance.observer = new ns.MutationObserver(function (records) {\n records.forEach(function (record) {\n if (record.type === 'attributes') {\n var attr = record.attributeName.toLowerCase();\n var type = node.getAttribute(attr).toLowerCase();\n\n if (attr === 'data-type' && type && type !== _this3.type) {\n instance.observer.disconnect();\n delete instance.observer;\n instance.destroy && instance.destroy();\n } else if (attr.substr(0, 5) === 'data-') {\n var _prop = attr.substr(5).split('-').map(function (part, i) {\n return !i ? part : part.charAt(0).toUpperCase() + part.substr(1);\n }).join('');\n var _options = {};\n\n _options[_prop] = node.getAttribute(record.attributeName);\n\n instance.update && instance.update(_options);\n }\n }\n });\n });\n\n //noinspection JSCheckFunctionSignatures\n instance.observer.observe(node, { attributes: true });\n\n return instance;\n }\n\n /**\n * Transforms camelCase string to dashed string\n *\n * @static\n * @param {string} camelCase\n * @return {string}\n */\n\n }], [{\n key: 'parse',\n value: function parse(value) {\n // parse boolean\n if (value === 'true') return true;\n if (value === 'false') return false;\n\n // parse undefined\n if (value === 'undefined') return undefined;\n\n // parse null\n if (value === 'null') return null;\n\n // Comma-separated strings to array parsing.\n // It won't match strings which contains non alphanumeric characters to\n // prevent strings like 'rgba(0,0,0,0)' or JSON-like from being parsed.\n // Typically it simply allows easily declare arrays as comma-separated\n // numbers or plain strings. If something more complicated is\n // required it can be declared using JSON format syntax\n if (/^[-+#.\\w\\d\\s]+(?:,[-+#.\\w\\d\\s]*)+$/.test(value)) {\n return value.split(',');\n }\n\n // parse JSON\n try {\n return JSON.parse(value);\n } catch (e) {}\n\n // plain value - no need to parse\n return value;\n }\n }, {\n key: 'toDashed',\n value: function toDashed(camelCase) {\n var arr = camelCase.split(/(?=[A-Z])/);\n var i = 1;\n var s = arr.length;\n var str = arr[0].toLowerCase();\n\n for (; i < s; i++) {\n str += '-' + arr[i].toLowerCase();\n }\n\n return str;\n }\n\n /**\n * Transforms camel case property name to dash separated attribute name\n *\n * @static\n * @param {string} str\n * @returns {string}\n */\n\n }, {\n key: 'toAttributeName',\n value: function toAttributeName(str) {\n return 'data-' + DomObserver.toDashed(str);\n }\n\n /**\n * Cross-browser DOM ready handler\n *\n * @static\n * @param {Function} handler\n */\n\n }, {\n key: 'domReady',\n value: function domReady(handler) {\n if (/comp|inter|loaded/.test((ns.document || {}).readyState + '')) return handler();\n\n if (ns.addEventListener) ns.addEventListener('DOMContentLoaded', handler, false);else if (ns.attachEvent) ns.attachEvent('onload', handler);\n }\n }]);\n\n return DomObserver;\n}();\n\n/*!\n * @license\n * Minimalistic HTML5 Canvas Gauge implementation\n *\n * This code is subject to MIT license.\n *\n * Copyright (c) 2012 Mykhailo Stadnyk <[email protected]>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * @ignore\n * @typedef {object} ns\n */\n\n/**\n * Drawings on canvas using hidden canvas as a cache for better\n * performance drawings during canvas animations. SmartCanvas also\n * adopts a canvas to\n */\n\n\nvar SmartCanvas = function () {\n\n /**\n * @constructor\n * @param {HTMLCanvasElement} canvas\n * @param {number} [width]\n * @param {number} [height]\n */\n function SmartCanvas(canvas, width, height) {\n _classCallCheck(this, SmartCanvas);\n\n SmartCanvas.collection.push(this);\n\n /**\n * Canvas base width\n *\n * @type {number}\n */\n this.width = width || 0;\n\n /**\n * Canvas base height\n *\n * @type {number}\n */\n this.height = height || 0;\n\n /**\n * Target drawings canvas element\n *\n * @type {HTMLCanvasElement}\n */\n this.element = canvas;\n\n this.init();\n }\n\n /**\n * Initializes canvases and contexts\n */\n\n\n _createClass(SmartCanvas, [{\n key: 'init',\n value: function init() {\n var pixelRatio = SmartCanvas.pixelRatio;\n\n this.element.width = this.width * pixelRatio;\n this.element.height = this.height * pixelRatio;\n\n this.element.style.width = this.width + 'px';\n this.element.style.height = this.height + 'px';\n\n /**\n * Canvas caching element\n *\n * @type {HTMLCanvasElement|Node}\n */\n this.elementClone = this.element.cloneNode(true);\n\n //noinspection JSUnresolvedVariable\n /**\n * Target drawings canvas element 2D context\n *\n * @type {CanvasRenderingContext2D}\n */\n this.context = this.element.getContext('2d');\n\n /**\n * Canvas caching element 2D context\n *\n * @type {CanvasRenderingContext2D}\n */\n this.contextClone = this.elementClone.getContext('2d');\n\n /**\n * Actual drawings width\n *\n * @type {number}\n */\n this.drawWidth = this.element.width;\n\n /**\n * Actual drawings height\n *\n * @type {number}\n */\n this.drawHeight = this.element.height;\n\n /**\n * X-coordinate of drawings zero point\n *\n * @type {number}\n */\n this.drawX = this.drawWidth / 2;\n\n /**\n * Y-coordinate of drawings zero point\n *\n * @type {number}\n */\n this.drawY = this.drawHeight / 2;\n\n /**\n * Minimal side length in pixels of the drawing\n *\n * @type {number}\n */\n this.minSide = this.drawX < this.drawY ? this.drawX : this.drawY;\n\n this.elementClone.initialized = false;\n\n this.contextClone.translate(this.drawX, this.drawY);\n this.contextClone.save();\n\n this.context.translate(this.drawX, this.drawY);\n this.context.save();\n\n this.context.max = this.contextClone.max = this.minSide;\n this.context.maxRadius = this.contextClone.maxRadius = null;\n }\n\n /**\n * Destroys this object, removing the references from memory\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n var index = SmartCanvas.collection.indexOf(this);\n\n /* istanbul ignore else */\n if (~index) {\n SmartCanvas.collection.splice(index, 1);\n }\n\n this.context.clearRect(-this.drawX, -this.drawY, this.drawWidth, this.drawHeight);\n\n // dereference all created elements\n this.context.max = null;\n delete this.context.max;\n\n this.context.maxRadius = null;\n delete this.context.maxRadius;\n\n this.context = null;\n this.contextClone = null;\n this.elementClone = null;\n this.element = null;\n\n /**\n * On canvas redraw event callback\n *\n * @type {function|null|undefined}\n */\n this.onRedraw = null;\n }\n\n /**\n * Commits the drawings\n */\n\n }, {\n key: 'commit',\n value: function commit() {\n var scale = SmartCanvas.pixelRatio;\n\n if (scale !== 1) {\n this.contextClone.scale(scale, scale);\n this.contextClone.save();\n }\n\n return this;\n }\n\n /**\n * Redraw this object\n */\n\n }, {\n key: 'redraw',\n value: function redraw() {\n this.init();\n\n /**\n * On canvas redraw event callback\n *\n * @type {function(): *}\n */\n this.onRedraw && this.onRedraw();\n\n return this;\n }\n\n /**\n * Returns current device pixel ratio\n *\n * @returns {number}\n */\n\n }], [{\n key: 'redraw',\n\n\n /**\n * Forces redraw all canvas in the current collection\n */\n value: function redraw() {\n var i = 0;\n var s = SmartCanvas.collection.length;\n\n for (; i < s; i++) {\n SmartCanvas.collection[i].redraw();\n }\n }\n }, {\n key: 'pixelRatio',\n get: function get() {\n /* istanbul ignore next */\n //noinspection JSUnresolvedVariable\n return ns.devicePixelRatio || 1;\n }\n }]);\n\n return SmartCanvas;\n}();\n\nSmartCanvas.collection = [];\n\n/* istanbul ignore next: very browser-specific testing required to cover */\n//noinspection JSUnresolvedVariable\nif (ns.matchMedia) {\n //noinspection JSUnresolvedFunction\n ns.matchMedia('screen and (min-resolution: 2dppx)').addListener(SmartCanvas.redraw);\n}\n\n/*!\n * @license\n * Minimalistic HTML5 Canvas Gauge implementation\n *\n * This code is subject to MIT license.\n *\n * Copyright (c) 2012 Mykhailo Stadnyk <[email protected]>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Describes rendering target element. Can be either string identifier of\n * the element or the element itself.\n *\n * @typedef {HTMLElement|string} RenderTarget\n */\n\n/**\n * Highlight area definition.\n * It describes highlight area starting from value to value using\n * color. Color can be describes with hex, rgb or rgba value.\n *\n * @typedef {{ from: number, to: number, color: string}} Highlight\n */\n\n/**\n * Shared generic gauges options\n *\n * @type {{renderTo: RenderTarget, width: number, height: number, minValue: number, maxValue: number, value: number, units: string|boolean, majorTicks: number[]|string[], minorTicks: number, strokeTicks: boolean, animatedValue: boolean, animateOnInit: boolean, title: string|boolean, borders: boolean, valueInt: number, valueDec: number, majorTicksInt: number, majorTicksDec: number, animation: boolean, animationDuration: number, animationRule: string|AnimationRule, colorPlate: string, colorPlateEnd: string, colorMajorTicks: string, colorMinorTicks: string, colorTitle: string, colorUnits: string, colorNumbers: string, colorNeedle: string, colorNeedleEnd: string, colorValueText: string, colorValueTextShadow: string, colorBorderShadow: string, colorBorderOuter: string, colorBorderOuterEnd: string, colorBorderMiddle: string, colorBorderMiddleEnd: string, colorBorderInner: string, colorBorderInnerEnd: string, colorValueBoxRect: string, colorValueBoxRectEnd: string, colorValueBoxBackground: string, colorValueBoxShadow: string, colorNeedleShadowUp: string, colorNeedleShadowDown: string, needle: boolean, needleShadow: boolean, needleType: string, needleStart: number, needleEnd: number, needleWidth: number, borderOuterWidth: number, borderMiddleWidth: number, borderInnerWidth: number, borderShadowWidth: number, valueBox: boolean, valueBoxStroke: number, valueText: string, valueTextShadow: boolean, valueBoxBorderRadius: number, highlights: Highlight[], fontNumbers: string, fontTitle: string, fontUnits: string, fontValue: string, fontTitleSize: number, fontValueSize: number, fontUnitsSize: number, fontNumbersSize: number}} GenericOptions\n */\nvar GenericOptions = {\n // basic options\n renderTo: null,\n width: 0,\n height: 0,\n minValue: 0,\n maxValue: 100,\n value: 0,\n units: false,\n majorTicks: [0, 20, 40, 60, 80, 100],\n minorTicks: 10,\n strokeTicks: true,\n animatedValue: false,\n animateOnInit: false,\n title: false,\n borders: true,\n\n // number formats\n valueInt: 3,\n valueDec: 2,\n majorTicksInt: 1,\n majorTicksDec: 0,\n\n // animations\n animation: true,\n animationDuration: 500,\n animationRule: 'cycle',\n\n // colors\n colorPlate: '#fff',\n colorPlateEnd: '',\n colorMajorTicks: '#444',\n colorMinorTicks: '#666',\n colorTitle: '#888',\n colorUnits: '#888',\n colorNumbers: '#444',\n colorNeedle: 'rgba(240,128,128,1)',\n colorNeedleEnd: 'rgba(255,160,122,.9)',\n colorValueText: '#444',\n colorValueTextShadow: 'rgba(0,0,0,0.3)',\n colorBorderShadow: 'rgba(0,0,0,0.5)',\n colorBorderOuter: '#ddd',\n colorBorderOuterEnd: '#aaa',\n colorBorderMiddle: '#eee',\n colorBorderMiddleEnd: '#f0f0f0',\n colorBorderInner: '#fafafa',\n colorBorderInnerEnd: '#ccc',\n colorValueBoxRect: '#888',\n colorValueBoxRectEnd: '#666',\n colorValueBoxBackground: '#babab2',\n colorValueBoxShadow: 'rgba(0,0,0,1)',\n colorNeedleShadowUp: 'rgba(2,255,255,0.2)',\n colorNeedleShadowDown: 'rgba(188,143,143,0.45)',\n\n fontNumbers: 'Arial',\n fontTitle: 'Arial',\n fontUnits: 'Arial',\n fontValue: 'Arial',\n\n fontNumbersSize: 20,\n fontTitleSize: 24,\n fontUnitsSize: 22,\n fontValueSize: 40,\n\n // needle\n needle: true,\n needleShadow: true,\n needleType: 'arrow',\n needleStart: 5,\n needleEnd: 85,\n needleWidth: 4,\n\n // borders\n borderOuterWidth: 3,\n borderMiddleWidth: 3,\n borderInnerWidth: 3,\n borderShadowWidth: 3,\n\n // value and highlights\n valueBox: true,\n valueBoxStroke: 5,\n valueText: '',\n valueTextShadow: true,\n valueBoxBorderRadius: 2.5,\n highlights: [{ from: 20, to: 60, color: '#eee' }, { from: 60, to: 80, color: '#ccc' }, { from: 80, to: 100, color: '#999' }]\n};\n\n/*!\n * @license\n * Minimalistic HTML5 Canvas Gauge implementation\n *\n * This code is subject to MIT license.\n *\n * Copyright (c) 2012 Mykhailo Stadnyk <[email protected]>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Gauge collections type.\n *\n * It is used ES5 declaration here, because babel\n * transpiles inheritance incorrectly in this case.\n *\n * @class Collection\n * @constructor\n */\nfunction Collection() {\n Array.prototype.constructor.apply(this, arguments);\n}\n\nCollection.prototype = Object.create(Array.prototype);\nCollection.prototype.constructor = Collection;\n\n/**\n * Returns gauge object by its identifier or index in the collection\n *\n * @param {string|number} id\n * @return {*}\n */\nCollection.prototype.get = function (id) {\n if (typeof id === 'string') {\n var i = 0;\n var s = this.length;\n\n for (; i < s; i++) {\n var canvas = this[i].options.renderTo.tagName ? this[i].options.renderTo :\n /* istanbul ignore next: should be tested with e2e tests */\n document.getElementById(this[i].options.renderTo || '');\n\n if (canvas.getAttribute('id') === id) {\n return this[i];\n }\n }\n } else if (typeof id === 'number') {\n return this[id];\n }\n\n return null;\n};\n\nvar round = Math.round;\nvar abs = Math.abs;\n\nvar gauges = new Collection();\n\n/**\n * Basic abstract BaseGauge class implementing common functionality\n * for different type of gauges.\n *\n * It should not be instantiated directly but must be extended by a final\n * gauge implementation.\n *\n * @abstract\n * @example\n *\n * class MyCoolGauge extends BaseGauge {\n *\n * // theses methods below MUST be implemented:\n *\n * constructor(options) {\n * // ... do something with options\n * super(options);\n * // ... implement anything else\n * }\n *\n * draw() {\n * // ... some implementation here\n * return this;\n * }\n * }\n */\n\nvar BaseGauge = function () {\n\n /**\n * @constructor\n * @abstract\n * @param {GenericOptions} options\n */\n function BaseGauge(options) {\n _classCallCheck(this, BaseGauge);\n\n var className = this.constructor.name;\n\n if (className === 'BaseGauge') {\n throw new TypeError('Attempt to instantiate abstract class!');\n }\n\n gauges.push(this);\n\n /**\n * Gauge type class\n *\n * @type {BaseGauge} type\n */\n this.type = ns[className];\n\n /**\n * True if gauge has been drawn for the first time, false otherwise.\n *\n * @type {boolean}\n */\n this.initialized = false;\n\n options.minValue = parseFloat(options.minValue);\n options.maxValue = parseFloat(options.maxValue);\n options.value = parseFloat(options.value) || 0;\n\n if (!options.borders) {\n options.borderInnerWidth = options.borderMiddleWidth = options.borderOuterWidth = 0;\n }\n\n if (!options.renderTo) {\n throw TypeError('Canvas element was not specified when creating ' + 'the Gauge object!');\n }\n\n var canvas = options.renderTo.tagName ? options.renderTo :\n /* istanbul ignore next: to be tested with e2e tests */\n document.getElementById(options.renderTo);\n\n if (!(canvas instanceof HTMLCanvasElement)) {\n throw TypeError('Given gauge canvas element is invalid!');\n }\n\n options.width = parseFloat(options.width) || 0;\n options.height = parseFloat(options.height) || 0;\n\n if (!options.width || !options.height) {\n if (!options.width) options.width = canvas.parentNode ? canvas.parentNode.offsetWidth : canvas.offsetWidth;\n if (!options.height) options.height = canvas.parentNode ? canvas.parentNode.offsetHeight : canvas.offsetHeight;\n }\n\n /**\n * Gauge options\n *\n * @type {GenericOptions} options\n */\n this.options = options || {};\n\n if (this.options.animateOnInit) {\n this._value = this.options.value;\n this.options.value = this.options.minValue;\n }\n\n /**\n * @type {SmartCanvas} canvas\n */\n this.canvas = new SmartCanvas(canvas, options.width, options.height);\n this.canvas.onRedraw = this.draw.bind(this);\n\n /**\n * @type {Animation} animation\n */\n this.animation = new Animation(options.animationRule, options.animationDuration);\n }\n\n /**\n * Sets new value for this gauge.\n * If gauge is animated by configuration it will trigger a proper animation.\n * Upsetting a value triggers gauge redraw.\n *\n * @param {number} value\n */\n\n\n _createClass(BaseGauge, [{\n key: 'update',\n\n\n /**\n * Updates gauge configuration options at runtime and redraws the gauge\n *\n * @param {RadialGaugeOptions} options\n * @returns {BaseGauge}\n */\n value: function update(options) {\n Object.assign(this.options, options || {});\n\n this.canvas.width = this.options.width;\n this.canvas.height = this.options.height;\n\n this.animation.rule = this.options.animationRule;\n this.animation.duration = this.options.animationDuration;\n\n this.canvas.redraw();\n\n return this;\n }\n\n /**\n * Performs destruction of this object properly\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n var index = gauges.indexOf(this);\n\n /* istanbul ignore else */\n if (~index) {\n //noinspection JSUnresolvedFunction\n gauges.splice(index, 1);\n }\n\n this.canvas.destroy();\n this.canvas = null;\n\n this.animation.destroy();\n this.animation = null;\n }\n\n /**\n * Triggering gauge render on a canvas.\n *\n * @abstract\n * @returns {BaseGauge}\n */\n\n }, {\n key: 'draw',\n value: function draw() {\n if (this.options.animateOnInit && !this.initialized) {\n this.value = this._value;\n this.initialized = true;\n }\n }\n\n /**\n * Inject given gauge object into DOM\n *\n * @param {string} type\n * @param {GenericOptions} options\n */\n\n }, {\n key: 'value',\n set: function set(value) {\n var _this4 = this;\n\n var fromValue = this.options.value;\n\n if (value === this.options.value) return;\n\n if (this.options.animation) {\n /**\n * @type {number}\n * @access private\n */\n this._value = value;\n\n this.animation.animate(function (percent) {\n _this4.options.value = fromValue + (value - fromValue) * percent;\n\n _this4.draw();\n }, function () {\n _this4.options.value = value;\n delete _this4._value;\n _this4.draw();\n });\n } else {\n this.options.value = value;\n this.draw();\n }\n }\n\n /**\n * Returns current value of the gauge\n *\n * @return {number}\n */\n ,\n get: function get() {\n return typeof this._value === 'undefined' ? this.options.value : this._value;\n }\n }], [{\n key: 'initialize',\n value: function initialize(type, options) {\n new DomObserver(options, 'canvas', type);\n }\n }]);\n\n return BaseGauge;\n}();\n\n/**\n * @ignore\n * @typedef {object} ns\n */\n/* istanbul ignore if */\n\n\nif (typeof ns !== 'undefined') {\n ns['BaseGauge'] = BaseGauge;\n (ns.document || ns)['gauges'] = gauges;\n}\n\n/*!\n * @license\n * Minimalistic HTML5 Canvas Gauge implementation\n *\n * This code is subject to MIT license.\n *\n * Copyright (c) 2012 Mykhailo Stadnyk <[email protected]>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * @access private\n * @typedef {CanvasRenderingContext2D|{max: number, maxRadius: number, barDimensions: object}} Canvas2DContext\n */\n\n/* istanbul ignore next: private, not testable */\n/**\n * Examines if a given error is something to throw or to ignore\n *\n * @param {Error} err\n */\nfunction verifyError(err) {\n // there is some unpredictable error in FF in some circumstances\n // which we found simply safe to ignore than to fight with it\n // noinspection JSUnresolvedVariable\n if (err instanceof DOMException && err.result === 0x8053000b) {\n return; // ignore it\n }\n\n throw err;\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws rounded corners rectangle\n *\n * @param {Canvas2DContext} context\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n * @param {number} r\n */\nfunction roundRect(context, x, y, w, h, r) {\n context.beginPath();\n\n context.moveTo(x + r, y);\n context.lineTo(x + w - r, y);\n\n context.quadraticCurveTo(x + w, y, x + w, y + r);\n context.lineTo(x + w, y + h - r);\n\n context.quadraticCurveTo(x + w, y + h, x + w - r, y + h);\n context.lineTo(x + r, y + h);\n\n context.quadraticCurveTo(x, y + h, x, y + h - r);\n context.lineTo(x, y + r);\n\n context.quadraticCurveTo(x, y, x + r, y);\n\n context.closePath();\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Pads a given value with leading zeros using the given options\n *\n * @param {number} val\n * @param {RadialGaugeOptions|{valueInt: number, valueDec: number}} options\n * @returns {string}\n */\nfunction padValue(val, options) {\n var dec = options.valueDec;\n var int = options.valueInt;\n var i = 0;\n var s = void 0,\n strVal = void 0,\n n = void 0;\n\n val = parseFloat(val);\n n = val < 0;\n val = Math.abs(val);\n\n if (dec > 0) {\n strVal = val.toFixed(dec).toString().split('.');\n s = int - strVal[0].length;\n\n for (; i < s; ++i) {\n strVal[0] = '0' + strVal[0];\n }\n\n strVal = (n ? '-' : '') + strVal[0] + '.' + strVal[1];\n } else {\n strVal = Math.round(val).toString();\n s = int - strVal.length;\n\n for (; i < s; ++i) {\n strVal = '0' + strVal;\n }\n\n strVal = (n ? '-' : '') + strVal;\n }\n\n return strVal;\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Formats a number for display on the dial's plate using the majorTicksFormat\n * config option.\n *\n * @param {number} num number to format\n * @param {object} options\n * @returns {string} formatted number\n */\nfunction formatMajorTickNumber(num, options) {\n var right = void 0,\n hasDec = false;\n\n // First, force the correct number of digits right of the decimal.\n if (options.majorTicksDec === 0) {\n right = Math.round(num).toString();\n } else {\n right = num.toFixed(options.majorTicksDec);\n }\n\n // Second, force the correct number of digits left of the decimal.\n if (options.majorTicksInt > 1) {\n // Does this number have a decimal?\n hasDec = ~right.indexOf('.');\n\n // Is this number a negative number?\n if (~right.indexOf('-')) {\n return '-' + [options.majorTicksInt + options.majorTicksDec + 2 + (hasDec ? 1 : 0) - right.length].join('0') + right.replace('-', '');\n } else {\n return [options.majorTicksInt + options.majorTicksDec + 1 + (hasDec ? 1 : 0) - right.length].join('0') + right;\n }\n }\n\n return right;\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Transforms degrees to radians\n *\n * @param {number} degrees\n * @returns {number}\n */\nfunction radians(degrees) {\n return degrees * Math.PI / 180;\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Calculates and returns radial point coordinates\n *\n * @param {number} radius\n * @param {number} angle\n * @returns {{x: number, y: number}}\n */\nfunction radialPoint(radius, angle) {\n return { x: -radius * Math.sin(angle), y: radius * Math.cos(angle) };\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Creates and returns linear gradient canvas object\n *\n * @param {Canvas2DContext} context\n * @param {string} colorFrom\n * @param {string} colorTo\n * @param {number} length\n * @param {boolean} [isVertical]\n * @param {number} [from]\n * @returns {CanvasGradient}\n */\nfunction linearGradient(context, colorFrom, colorTo, length) {\n var isVertical = arguments.length <= 4 || arguments[4] === undefined ? true : arguments[4];\n var from = arguments.length <= 5 || arguments[5] === undefined ? 0 : arguments[5];\n\n var grad = context.createLinearGradient(isVertical ? 0 : from, isVertical ? from : 0, isVertical ? 0 : length, isVertical ? length : 0);\n\n grad.addColorStop(0, colorFrom);\n grad.addColorStop(1, colorTo);\n\n return grad;\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws gauge needle shadow\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {RadialGaugeOptions} options\n */\nfunction drawNeedleShadow(context, options) {\n if (!options.needleShadow) return;\n\n context.shadowOffsetX = 2;\n context.shadowOffsetY = 2;\n context.shadowBlur = 10;\n context.shadowColor = options.colorNeedleShadowDown;\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws value box at given position\n *\n * @param {Canvas2DContext} context\n * @param {GenericOptions} options\n * @param {number|string} value\n * @param {number} x\n * @param {number} y\n * @param {number} max\n */\nfunction drawValueBox(context, options, value, x, y, max) {\n if (!options.valueBox) return;\n\n var text = options.valueText || padValue(value, options);\n\n context.shadowOffsetX = null;\n context.shadowOffsetY = null;\n context.shadowBlur = null;\n context.shadowColor = '';\n context.strokeStyle = null;\n context.lineWidth = 0;\n context.save();\n\n context.font = options.fontValueSize * (max / 200) + 'px ' + options.fontValue;\n context.save();\n context.beginPath();\n\n var th = 0.12 * max;\n var tw = context.measureText(options.valueText ? text : '-' + padValue(0, options)).width;\n var bx = -tw / 2 - 0.025 * max;\n var by = y - th - 0.04 * max;\n var bw = tw + 0.05 * max;\n var bh = th + 0.07 * max;\n var br = max * options.valueBoxBorderRadius / 100;\n\n if (br) roundRect(context, bx, by, bw, bh, br);else context.rect(bx, by, bw, bh);\n\n var gy = y - 0.12 * max - 0.025 * max + (0.12 * max + 0.045 * max) / 2;\n\n if (options.valueBoxStroke) {\n var grd = context.createRadialGradient(x, gy, max / 10, x, gy, max / 5);\n\n grd.addColorStop(0, options.colorValueBoxRect);\n grd.addColorStop(1, options.colorValueBoxRectEnd);\n\n context.strokeStyle = grd;\n context.lineWidth = max * options.valueBoxStroke / 100;\n context.stroke();\n }\n\n if (options.colorValueBoxShadow) {\n context.shadowBlur = 0.012 * max;\n context.shadowColor = options.colorValueBoxShadow;\n }\n\n if (options.colorValueBoxBackground) {\n context.fillStyle = options.colorValueBoxBackground;\n context.fill();\n }\n\n context.closePath();\n context.restore();\n\n if (options.valueTextShadow) {\n context.shadowOffsetX = 0.004 * max;\n context.shadowOffsetY = 0.004 * max;\n context.shadowBlur = 0.012 * max;\n context.shadowColor = options.colorValueTextShadow;\n }\n\n context.fillStyle = options.colorValueText;\n context.textAlign = 'center';\n context.fillText(text, -x, y);\n context.restore();\n}\n\nvar drawings = {\n roundRect: roundRect,\n padValue: padValue,\n formatMajorTickNumber: formatMajorTickNumber,\n radians: radians,\n radialPoint: radialPoint,\n linearGradient: linearGradient,\n drawNeedleShadow: drawNeedleShadow,\n drawValueBox: drawValueBox,\n verifyError: verifyError\n};\n\ndrawings;\n\n/*!\n * @license\n * Minimalistic HTML5 Canvas Gauge implementation\n *\n * This code is subject to MIT license.\n *\n * Copyright (c) 2012 Mykhailo Stadnyk <[email protected]>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nvar PI = Math.PI;\nvar HPI = PI / 2;\n\n/**\n * Gauge configuration options\n *\n * @typedef {GenericOptions|{ticksAngle: number, startAngle: number, colorNeedleCircleOuter: string, colorNeedleCircleOuterEnd: string, colorNeedleCircleInner: string, colorNeedleCircleInnerEnd: string, needleCircleSize: number, needleCircleInner: boolean, needleCircleOuter: boolean, animationTarget: string}} RadialGaugeOptions\n */\n\n/**\n * Default gauge configuration options\n *\n * @access private\n * @type {RadialGaugeOptions}\n */\nvar defaultRadialGaugeOptions = Object.assign({}, GenericOptions, {\n // basic options\n ticksAngle: 270,\n startAngle: 45,\n\n // colors\n colorNeedleCircleOuter: '#f0f0f0',\n colorNeedleCircleOuterEnd: '#ccc',\n colorNeedleCircleInner: '#e8e8e8',\n colorNeedleCircleInnerEnd: '#f5f5f5',\n\n // needle\n needleCircleSize: 10,\n needleCircleInner: true,\n needleCircleOuter: true,\n\n // custom animations\n animationTarget: 'needle' // 'needle' or 'plate'\n});\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws gradient-filled circle on a canvas\n *\n * @access private\n * @param {number} radius\n * @param {Canvas2DContext} context\n * @param {string} start gradient start color\n * @param {string} end gradient end color\n */\nfunction drawRadialCircle(radius, context, start, end) {\n context.beginPath();\n context.arc(0, 0, abs(radius), 0, PI * 2, true);\n context.fillStyle = drawings.linearGradient(context, start, end, radius);\n context.fill();\n context.closePath();\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Returns max radius without borders for the gauge\n *\n * @param {Canvas2DContext} context\n * @param {RadialGaugeOptions} options\n * @return {number}\n */\nfunction maxRadialRadius(context, options) {\n if (!context.maxRadius) {\n context.maxRadius = context.max - options.borderShadowWidth - options.borderOuterWidth - options.borderMiddleWidth - options.borderInnerWidth;\n }\n\n return context.maxRadius;\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws gauge plate on the canvas\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {RadialGaugeOptions} options\n */\nfunction drawRadialPlate(context, options) {\n var d0 = options.borderShadowWidth;\n var r0 = context.max - options.borderShadowWidth;\n var r1 = r0 - options.borderOuterWidth;\n var r2 = r1 - options.borderMiddleWidth;\n var r3 = maxRadialRadius(context, options);\n var grad = void 0;\n\n context.save();\n\n if (options.borderOuterWidth) {\n drawRadialCircle(r0, context, options.colorBorderOuter, options.colorBorderOuterEnd);\n }\n\n if (options.borderMiddleWidth) {\n drawRadialCircle(r1, context, options.colorBorderMiddle, options.colorBorderMiddleEnd);\n }\n\n if (options.borderInnerWidth) {\n drawRadialCircle(r2, context, options.colorBorderInner, options.colorBorderInnerEnd);\n }\n\n if (d0) {\n context.shadowBlur = d0;\n context.shadowColor = options.colorBorderShadow;\n }\n\n context.beginPath();\n context.arc(0, 0, abs(r3), 0, PI * 2, true);\n\n if (options.colorPlateEnd) {\n grad = context.createRadialGradient(0, 0, r3 / 2, 0, 0, r3);\n grad.addColorStop(0, options.colorPlate);\n grad.addColorStop(1, options.colorPlateEnd);\n } else {\n grad = options.colorPlate;\n }\n\n context.fillStyle = grad;\n\n context.fill();\n context.closePath();\n\n context.restore();\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws gauge highlight areas on a canvas\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {RadialGaugeOptions} options\n */\nfunction drawRadialHighlights(context, options) {\n context.save();\n\n var r1 = abs(radialTicksRadius(context, options));\n var r2 = abs(r1 - context.max * .15);\n var i = 0,\n s = options.highlights.length;\n\n for (; i < s; i++) {\n var hlt = options.highlights[i];\n var vd = (options.maxValue - options.minValue) / options.ticksAngle;\n var sa = drawings.radians(options.startAngle + (hlt.from - options.minValue) / vd);\n var ea = drawings.radians(options.startAngle + (hlt.to - options.minValue) / vd);\n var ps = drawings.radialPoint(r2, sa);\n var pe = drawings.radialPoint(r1, sa);\n var ps1 = drawings.radialPoint(r1, ea);\n var pe1 = drawings.radialPoint(r2, ea);\n\n context.beginPath();\n context.rotate(HPI);\n context.arc(0, 0, r1, sa, ea, false);\n context.restore();\n context.save();\n context.moveTo(ps.x, ps.y);\n context.lineTo(pe.x, pe.y);\n context.lineTo(ps1.x, ps1.y);\n context.lineTo(pe1.x, pe1.y);\n context.lineTo(ps.x, ps.y);\n context.closePath();\n\n context.fillStyle = hlt.color;\n context.fill();\n\n context.beginPath();\n context.rotate(HPI);\n context.arc(0, 0, r2, sa - 0.2, ea + 0.2, false);\n context.restore();\n context.closePath();\n\n context.fillStyle = options.colorPlate;\n context.fill();\n context.save();\n }\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws minor ticks bar on a canvas\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {RadialGaugeOptions} options\n */\nfunction drawRadialMinorTicks(context, options) {\n var radius = radialTicksRadius(context, options);\n\n context.lineWidth = SmartCanvas.pixelRatio;\n context.strokeStyle = options.colorMinorTicks;\n\n context.save();\n\n var s = options.minorTicks * (options.majorTicks.length - 1);\n var i = 0;\n\n for (; i < s; ++i) {\n var angle = options.startAngle + i * (options.ticksAngle / s);\n\n context.rotate(drawings.radians(angle));\n\n context.beginPath();\n context.moveTo(0, radius);\n context.lineTo(0, radius - context.max * .075);\n closeStrokedPath(context);\n }\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Returns ticks radius\n *\n * @access private\n * @param context\n * @param options\n * @return {number}\n */\nfunction radialTicksRadius(context, options) {\n return maxRadialRadius(context, options) - context.max * .05;\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws gauge major ticks bar on a canvas\n *\n * @param {Canvas2DContext} context\n * @param {RadialGaugeOptions} options\n */\nfunction drawRadialMajorTicks(context, options) {\n var r = abs(radialTicksRadius(context, options));\n var i = void 0,\n colors = void 0;\n var s = options.majorTicks.length;\n var pixelRatio = SmartCanvas.pixelRatio;\n\n context.lineWidth = 2 * pixelRatio;\n context.save();\n\n if (s === 0) {\n options.majorTicks.push(drawings.formatMajorTickNumber(options.minValue, options));\n options.majorTicks.push(drawings.formatMajorTickNumber(options.maxValue, options));\n s = 2;\n }\n\n colors = options.colorMajorTicks instanceof Array ? options.colorMajorTicks : Array(s).fill(options.colorMajorTicks);\n\n i = 0;\n for (; i < s; ++i) {\n context.strokeStyle = colors[i];\n context.rotate(drawings.radians(radialNextAngle(options, i, s)));\n\n context.beginPath();\n context.moveTo(0, r);\n context.lineTo(0, r - context.max * .15);\n closeStrokedPath(context);\n }\n\n if (options.strokeTicks) {\n context.strokeStyle = colors[0];\n context.rotate(HPI);\n\n context.beginPath();\n context.arc(0, 0, r, drawings.radians(options.startAngle), drawings.radians(options.startAngle + options.ticksAngle), false);\n closeStrokedPath(context);\n }\n}\n\n/* istanbul ignore next: private, not testable */\nfunction radialNextAngle(options, i, s) {\n return options.startAngle + i * (options.ticksAngle / (s - 1));\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Strokes, closes path and restores previous context state\n *\n * @param {Canvas2DContext} context\n */\nfunction closeStrokedPath(context) {\n context.stroke();\n context.restore();\n context.closePath();\n context.save();\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws gauge bar numbers\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {RadialGaugeOptions} options\n */\nfunction drawRadialNumbers(context, options) {\n var radius = maxRadialRadius(context, options) - context.max * .35;\n var points = {};\n var i = 0;\n var s = options.majorTicks.length;\n var isAnimated = options.animationTarget !== 'needle';\n var colors = options.colorNumbers instanceof Array ? options.colorNumbers : Array(s).fill(options.colorNumbers);\n\n var plateValueAngle = isAnimated ? -(options.value - options.minValue) / (options.maxValue - options.minValue) * options.ticksAngle : 0;\n\n if (isAnimated) {\n context.save();\n context.rotate(-drawings.radians(plateValueAngle));\n }\n\n for (; i < s; ++i) {\n var angle = plateValueAngle + radialNextAngle(options, i, s);\n var point = drawings.radialPoint(radius, drawings.radians(angle));\n\n if (angle === 360) angle = 0;\n\n if (points[angle]) {\n continue; //already drawn at this place, skipping\n }\n\n points[angle] = true;\n\n context.font = options.fontNumbersSize * (context.max / 200) + 'px ' + options.fontNumbers;\n context.fillStyle = colors[i];\n context.lineWidth = 0;\n context.textAlign = 'center';\n context.fillText(options.majorTicks[i], point.x, point.y + 3);\n }\n\n isAnimated && context.restore();\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws gauge title\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {RadialGaugeOptions} options\n */\nfunction drawRadialTitle(context, options) {\n if (!options.title) return;\n\n context.save();\n context.font = options.fontTitleSize * (context.max / 200) + 'px ' + options.fontTitle;\n context.fillStyle = options.colorTitle;\n context.textAlign = 'center';\n context.fillText(options.title, 0, -context.max / 4.25, context.max * .8);\n context.restore();\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws units name on the gauge\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {RadialGaugeOptions} options\n */\nfunction drawRadialUnits(context, options) {\n if (!options.units) return;\n\n context.save();\n context.font = options.fontUnitsSize * (context.max / 200) + 'px ' + options.fontUnits;\n context.fillStyle = options.colorUnits;\n context.textAlign = 'center';\n context.fillText(options.units, 0, context.max / 3.25, context.max * .8);\n context.restore();\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws gauge needle\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {RadialGaugeOptions} options\n */\nfunction drawRadialNeedle(context, options) {\n if (!options.needle) return;\n\n var value = options.value;\n var max = maxRadialRadius(context, options);\n var r1 = abs(max / 100 * options.needleCircleSize);\n var r2 = abs(max / 100 * options.needleCircleSize * 0.75);\n var rIn = abs(max / 100 * options.needleEnd);\n var rStart = abs(options.needleStart ? max / 100 * options.needleStart : 0);\n var rOut = abs(max * .2);\n var pad1 = max / 100 * options.needleWidth;\n var pad2 = max / 100 * options.needleWidth / 2;\n var pixelRatio = SmartCanvas.pixelRatio;\n var isFixed = options.animationTarget !== 'needle';\n\n context.save();\n\n drawings.drawNeedleShadow(context, options);\n\n context.rotate(drawings.radians(isFixed ? options.startAngle : options.startAngle + (value - options.minValue) / (options.maxValue - options.minValue) * options.ticksAngle));\n\n context.fillStyle = drawings.linearGradient(context, options.colorNeedle, options.colorNeedleEnd, rIn - rOut);\n\n if (options.needleType === 'arrow') {\n context.beginPath();\n context.moveTo(-pad2, -rOut);\n context.lineTo(-pad1, 0);\n context.lineTo(-1 * pixelRatio, rIn);\n context.lineTo(pixelRatio, rIn);\n context.lineTo(pad1, 0);\n context.lineTo(pad2, -rOut);\n context.closePath();\n context.fill();\n\n context.beginPath();\n context.lineTo(-0.5 * pixelRatio, rIn);\n context.lineTo(-1 * pixelRatio, rIn);\n context.lineTo(-pad1, 0);\n context.lineTo(-pad2, -rOut);\n context.lineTo(pad2 / 2 * pixelRatio - 2 * pixelRatio, -rOut);\n context.closePath();\n context.fillStyle = options.colorNeedleShadowUp;\n context.fill();\n } else {\n // simple line needle\n context.beginPath();\n context.moveTo(-pad2, rIn);\n context.lineTo(-pad2, rStart);\n context.lineTo(pad2, rStart);\n context.lineTo(pad2, rIn);\n context.closePath();\n context.fill();\n }\n\n if (options.needleCircleSize) {\n drawings.drawNeedleShadow(context, options);\n\n if (options.needleCircleOuter) {\n context.beginPath();\n context.arc(0, 0, r1, 0, PI * 2, true);\n context.fillStyle = drawings.linearGradient(context, options.colorNeedleCircleOuter, options.colorNeedleCircleOuterEnd, r1);\n context.fill();\n context.closePath();\n }\n\n if (options.needleCircleInner) {\n context.beginPath();\n context.arc(0, 0, r2, 0, PI * 2, true);\n context.fillStyle = drawings.linearGradient(context, options.colorNeedleCircleInner, options.colorNeedleCircleInnerEnd, r2);\n context.fill();\n context.closePath();\n }\n\n context.restore();\n }\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws gauge value box\n *\n * @param {Canvas2DContext} context\n * @param {RadialGaugeOptions} options\n * @param {number} value\n */\nfunction drawRadialValueBox(context, options, value) {\n drawings.drawValueBox(context, options, value, 0, context.max - context.max * .33, context.max);\n}\n\n/**\n * Minimalistic HTML5 Canvas Gauge\n * @example\n * var gauge = new RadialGauge({\n * renderTo: 'gauge-id', // identifier of HTML canvas element or element itself\n * width: 400,\n * height: 400,\n * units: 'Km/h',\n * title: false,\n * value: 0,\n * minValue: 0,\n * maxValue: 220,\n * majorTicks: [\n * '0','20','40','60','80','100','120','140','160','180','200','220'\n * ],\n * minorTicks: 2,\n * strokeTicks: false,\n * highlights: [\n * { from: 0, to: 50, color: 'rgba(0,255,0,.15)' },\n * { from: 50, to: 100, color: 'rgba(255,255,0,.15)' },\n * { from: 100, to: 150, color: 'rgba(255,30,0,.25)' },\n * { from: 150, to: 200, color: 'rgba(255,0,225,.25)' },\n * { from: 200, to: 220, color: 'rgba(0,0,255,.25)' }\n * ],\n * colorPlate: '#222',\n * colorMajorTicks: '#f5f5f5',\n * colorMinorTicks: '#ddd',\n * colorTitle: '#fff',\n * colorUnits: '#ccc',\n * colorNumbers: '#eee',\n * colorNeedleStart: 'rgba(240, 128, 128, 1)',\n * colorNeedleEnd: 'rgba(255, 160, 122, .9)',\n * valueBox: true,\n * animationRule: 'bounce'\n * });\n * // draw initially\n * gauge.draw();\n * // animate\n * setInterval(() => {\n * gauge.value = Math.random() * -220 + 220;\n * }, 1000);\n */\n\nvar RadialGauge = function (_BaseGauge) {\n _inherits(RadialGauge, _BaseGauge);\n\n /**\n * @constructor\n * @param {RadialGaugeOptions} options\n */\n function RadialGauge(options) {\n _classCallCheck(this, RadialGauge);\n\n options = Object.assign({}, defaultRadialGaugeOptions, options || {});\n\n /* istanbul ignore if */\n if (isNaN(options.startAngle)) options.startAngle = 45;\n /* istanbul ignore if */\n if (isNaN(options.ticksAngle)) options.ticksAngle = 270;\n\n /* istanbul ignore if */\n if (options.ticksAngle > 360) options.ticksAngle = 360;\n /* istanbul ignore if */\n if (options.ticksAngle < 0) options.ticksAngle = 0;\n\n /* istanbul ignore if */\n if (options.startAngle < 0) options.startAngle = 0;\n /* istanbul ignore if */\n if (options.startAngle > 360) options.startAngle = 360;\n\n return _possibleConstructorReturn(this, (RadialGauge.__proto__ || Object.getPrototypeOf(RadialGauge)).call(this, options));\n }\n\n /* */\n /**\n * Triggering gauge render on a canvas.\n *\n * @returns {RadialGauge}\n */\n\n\n _createClass(RadialGauge, [{\n key: 'draw',\n value: function draw() {\n try {\n var canvas = this.canvas;\n var x = -canvas.drawX;\n var y = -canvas.drawY;\n var w = canvas.drawWidth;\n var h = canvas.drawHeight;\n\n var options = this.options;\n\n if (options.animationTarget === 'needle') {\n if (!canvas.elementClone.initialized) {\n var context = canvas.contextClone;\n\n // clear the cache\n context.clearRect(x, y, w, h);\n context.save();\n\n drawRadialPlate(context, options);\n drawRadialHighlights(context, options);\n drawRadialMinorTicks(context, options);\n drawRadialMajorTicks(context, options);\n drawRadialNumbers(context, options);\n drawRadialTitle(context, options);\n drawRadialUnits(context, options);\n\n canvas.elementClone.initialized = true;\n }\n\n this.canvas.commit();\n\n // clear the canvas\n canvas.context.clearRect(x, y, w, h);\n canvas.context.save();\n\n canvas.context.drawImage(canvas.elementClone, x, y, w, h);\n canvas.context.save();\n\n drawRadialValueBox(canvas.context, options, options.animatedValue ? this.options.value : this.value);\n drawRadialNeedle(canvas.context, options);\n } else {\n var plateValueAngle = -drawings.radians((options.value - options.minValue) / (options.maxValue - options.minValue) * options.ticksAngle);\n\n // clear the canvas\n canvas.context.clearRect(x, y, w, h);\n canvas.context.save();\n\n drawRadialPlate(canvas.context, options);\n\n canvas.context.rotate(plateValueAngle);\n\n // animated\n drawRadialHighlights(canvas.context, options);\n drawRadialMinorTicks(canvas.context, options);\n drawRadialMajorTicks(canvas.context, options);\n drawRadialNumbers(canvas.context, options);\n\n // non-animated\n canvas.context.rotate(-plateValueAngle);\n canvas.context.save();\n\n if (!canvas.elementClone.initialized) {\n var _context = canvas.contextClone;\n\n // clear the cache\n _context.clearRect(x, y, w, h);\n _context.save();\n\n drawRadialTitle(_context, options);\n drawRadialUnits(_context, options);\n drawRadialNeedle(_context, options);\n\n canvas.elementClone.initialized = true;\n }\n\n canvas.context.drawImage(canvas.elementClone, x, y, w, h);\n }\n\n // value box animations\n drawRadialValueBox(canvas.context, options, options.animatedValue ? this.options.value : this.value);\n\n _get(RadialGauge.prototype.__proto__ || Object.getPrototypeOf(RadialGauge.prototype), 'draw', this).call(this);\n } catch (err) {\n drawings.verifyError(err);\n }\n\n return this;\n }\n }]);\n\n return RadialGauge;\n}(BaseGauge);\n\n/**\n * @ignore\n * @typedef {object} ns\n */\n/* istanbul ignore if */\n\n\nif (typeof ns !== 'undefined') {\n ns['RadialGauge'] = RadialGauge;\n}\n\nBaseGauge.initialize('RadialGauge', defaultRadialGaugeOptions);\n\n/*!\n * @license\n * Minimalistic HTML5 Canvas Gauge implementation\n *\n * This code is subject to MIT license.\n *\n * Copyright (c) 2012 Mykhailo Stadnyk <[email protected]>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Linear gauge configuration options\n *\n * @typedef {GenericOptions|{borderRadius: number, barBeginCircle: number, barWidth: number, barStrokeWidth: number, barProgress: boolean, colorBar: string, colorBarEnd: string, colorBarStroke: string, colorBarProgress: string, colorBarProgressEnd: string, tickSide: string, needleSide: string, numberSide: string, ticksWidth: number, ticksWidthMinor: number, ticksPadding: number, barLength: number}} LinearGaugeOptions\n */\n\n/**\n * Default linear gauge configuration options\n *\n * @type {LinearGaugeOptions}\n */\nvar defaultLinearGaugeOptions = Object.assign({}, GenericOptions, {\n // basic options\n borderRadius: 0,\n // width: 150,\n // height: 400,\n\n // bar\n barBeginCircle: 30, // percents\n barWidth: 20, // percents\n barStrokeWidth: 0, // pixels\n barProgress: true,\n\n colorBarStroke: '#222',\n colorBar: '#ccc',\n colorBarEnd: '',\n colorBarProgress: '#888',\n colorBarProgressEnd: '',\n\n needleWidth: 6,\n\n tickSide: 'both', // available: 'left', 'right', 'both'\n needleSide: 'both', // available: 'left', 'right', 'both'\n\n numberSide: 'both', // available: 'left', 'right', 'both'\n\n ticksWidth: 10,\n ticksWidthMinor: 5,\n ticksPadding: 5,\n barLength: 85,\n fontTitleSize: 26\n});\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws rectangle on a canvas\n *\n * @param {Canvas2DContext} context\n * @param {number} r radius for founded corner rectangle if 0 or less won't be drawn\n * @param {number} x x-coordinate of the top-left corner\n * @param {number} y y-coordinate of the top-left corner\n * @param {number} w width of the rectangle\n * @param {number} h height of the rectangle\n * @param {string} colorStart base fill color of the rectangle\n * @param {string} [colorEnd] gradient color of the rectangle\n */\nfunction drawRectangle(context, r, x, y, w, h, colorStart, colorEnd) {\n context.beginPath();\n context.fillStyle = colorEnd ? drawings.linearGradient(context, colorStart, colorEnd, w > h ? w : h, h > w, w > h ? x : y) : colorStart;\n\n r > 0 ? drawings.roundRect(context, x, y, w, h, r) : context.rect(x, y, w, h);\n\n context.fill();\n context.closePath();\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Calculates and returns linear gauge base bar dimensions.\n *\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions|{barStrokeWidth: number, barBeginCircle: number, barWidth: number, hasLeft: boolean, hasRight: boolean}} options\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n * @return {{isVertical: boolean, width: number, length: number, barWidth: number, barLength: number, strokeWidth: number, barMargin: number, radius: number, x0: number, y0: number, barOffset: number, titleMargin: number, unitsMargin: number, X: number, Y: number, baseX: number, baseY: number, ticksPadding: number}}\n */\nfunction barDimensions(context, options, x, y, w, h) {\n var pixelRatio = SmartCanvas.pixelRatio;\n var isVertical = h >= w;\n var width = isVertical ? w * .85 : h;\n var length = isVertical ? h : w;\n\n x = isVertical ? round(x + (w - width) / 2) : x;\n\n var hasTitle = !!options.title;\n var hasUnits = !!options.units;\n var hasValue = !!options.valueBox;\n\n var titleMargin = void 0;\n var unitsMargin = void 0;\n var valueMargin = void 0;\n\n if (isVertical) {\n unitsMargin = round(length * .05);\n titleMargin = round(length * .075);\n valueMargin = round(length * .075);\n\n if (hasTitle) {\n length -= titleMargin;\n y += titleMargin;\n }\n\n if (hasUnits) length -= unitsMargin;\n if (hasValue) length -= valueMargin;\n } else {\n unitsMargin = titleMargin = round(width * .15);\n\n if (hasTitle) {\n width -= titleMargin;\n y += titleMargin;\n }\n\n if (hasUnits) width -= unitsMargin;\n }\n\n var strokeWidth = options.barStrokeWidth * 2;\n var radius = options.barBeginCircle ? round(width * options.barBeginCircle / 200 - strokeWidth / 2) : 0;\n\n var barWidth = round(width * options.barWidth / 100 - strokeWidth);\n var barLength = round(length * options.barLength / 100 - strokeWidth);\n var barMargin = round((length - barLength) / 2);\n\n // coordinates for arc of the bar if configured\n var x0 = round(x + (isVertical ? width / 2 : barMargin + radius));\n var y0 = round(y + (isVertical ? length - barMargin - radius + strokeWidth / 2 : width / 2));\n var dx = isVertical && !(options.hasLeft && options.hasRight) ? (options.hasRight ? -1 : 1) * options.ticksWidth / 100 * width : 0;\n var dy = !isVertical && !(options.hasLeft && options.hasRight) ? (options.hasRight ? -1 : 1) * options.ticksWidth / 100 * width : 0;\n\n //noinspection JSUndefinedPropertyAssignment\n context.barDimensions = {\n isVertical: isVertical,\n width: width,\n length: length,\n barWidth: barWidth,\n barLength: barLength,\n strokeWidth: strokeWidth,\n barMargin: barMargin,\n radius: radius,\n pixelRatio: pixelRatio,\n barOffset: null,\n titleMargin: hasTitle ? titleMargin : 0,\n unitsMargin: hasUnits ? unitsMargin : 0,\n get ticksLength() {\n return this.barLength - this.barOffset - this.strokeWidth;\n },\n X: x + dx,\n Y: y + dy,\n x0: x0 + dx,\n y0: y0 + dy,\n baseX: x,\n baseY: y,\n ticksPadding: options.ticksPadding / 100\n };\n\n return context.barDimensions;\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws bar shape from the given options on a given canvas context\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n * @param {string} type\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n */\nfunction drawLinearBarShape(context, options, type, x, y, w, h) {\n var _barDimensions = barDimensions(context, options, x, y, w, h);\n\n var isVertical = _barDimensions.isVertical;\n var width = _barDimensions.width;\n var barWidth = _barDimensions.barWidth;\n var barLength = _barDimensions.barLength;\n var strokeWidth = _barDimensions.strokeWidth;\n var barMargin = _barDimensions.barMargin;\n var radius = _barDimensions.radius;\n var x0 = _barDimensions.x0;\n var y0 = _barDimensions.y0;\n var X = _barDimensions.X;\n var Y = _barDimensions.Y;\n\n var fullBarLength = barLength;\n\n context.save();\n context.beginPath();\n\n if (options.barBeginCircle) {\n var direction = drawings.radians(isVertical ? 270 : 0);\n var alpha = Math.asin(barWidth / 2 / radius);\n var cosAlpha = Math.cos(alpha);\n var sinAlpha = Math.sin(alpha);\n\n var x1 = x0 + (isVertical ? radius * sinAlpha : radius * cosAlpha - strokeWidth / 2);\n var y1 = isVertical ? y0 - radius * cosAlpha : y0 + radius * sinAlpha;\n var cutRadius = isVertical ? abs(y1 - y0) : abs(x1 - x0);\n\n context.barDimensions.barOffset = round(cutRadius + radius);\n\n // bottom point\n var x2 = isVertical ? round(x0 - radius * sinAlpha) : x1;\n var y2 = isVertical ? y1 : round(y0 - radius * sinAlpha);\n\n if (type === 'progress') {\n barLength = context.barDimensions.barOffset + (barLength - context.barDimensions.barOffset) * (options.value - options.minValue) / (options.maxValue - options.minValue);\n }\n\n // bar ends at\n var x3 = round(x1 + barLength - context.barDimensions.barOffset + strokeWidth / 2); // h\n var y3 = round(y1 - barLength + context.barDimensions.barOffset - strokeWidth / 2); // v\n\n context.arc(x0, y0, radius, direction + alpha, direction - alpha);\n\n if (isVertical) {\n context.moveTo(x1, y2);\n context.lineTo(x1, y3);\n context.lineTo(x2, y3);\n context.lineTo(x2, y2);\n } else {\n context.moveTo(x1, y2);\n context.lineTo(x3, y2);\n context.lineTo(x3, y1);\n context.lineTo(x1, y1);\n }\n } else {\n // simply rectangle\n var rx = round(isVertical ? X + (width - barWidth) / 2 : X + barMargin);\n var ry = round(isVertical ? Y + barLength + barMargin : Y + (width - barWidth) / 2);\n\n if (type === 'progress') {\n barLength *= (options.value - options.minValue) / (options.maxValue - options.minValue);\n }\n\n if (isVertical) context.rect(rx, ry, barWidth, -barLength);else context.rect(rx, ry, barLength, barWidth);\n }\n\n if (type !== 'progress' && options.barStrokeWidth) {\n context.lineWidth = strokeWidth;\n context.strokeStyle = options.colorBarStroke;\n //context.lineJoin = 'round';\n context.stroke();\n }\n\n if (type !== 'progress' && options.colorBar) {\n context.fillStyle = options.colorBarEnd ? drawings.linearGradient(context, options.colorBar, options.colorBarEnd, barLength, isVertical, isVertical ? Y : X) : options.colorBar;\n context.fill();\n } else if (type === 'progress' && options.colorBarProgress) {\n context.fillStyle = options.colorBarProgressEnd ? drawings.linearGradient(context, options.colorBarProgress, options.colorBarProgressEnd, fullBarLength, isVertical, isVertical ? Y : X) : options.colorBarProgress;\n context.fill();\n }\n\n context.closePath();\n\n // fix dimensions for further usage\n if (options.barBeginCircle) context.barDimensions.radius += strokeWidth;\n\n context.barDimensions.barWidth += strokeWidth;\n context.barDimensions.barLength += strokeWidth;\n}\n\n/**\n * Draws gauge bar\n *\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n * @param {number} x x-coordinate of the top-left corner of the gauge\n * @param {number} y y-coordinate of the top-left corner of the gauge\n * @param {number} w width of the gauge\n * @param {number} h height of the gauge\n */\nfunction drawLinearBar(context, options, x, y, w, h) {\n drawLinearBarShape(context, options, '', x, y, w, h);\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Helper function to calculate bar ticks presence on the sides\n *\n * @param {string} notWhich\n * @param {LinearGaugeOptions} options\n * @return {boolean}\n */\nfunction hasTicksBar(notWhich, options) {\n return options.needleSide !== notWhich || options.tickSide !== notWhich || options.numberSide !== notWhich;\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws gauge bar progress\n *\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n * @param {number} x x-coordinate of the top-left corner of the gauge\n * @param {number} y y-coordinate of the top-left corner of the gauge\n * @param {number} w width of the gauge\n * @param {number} h height of the gauge\n */\nfunction drawLinearBarProgress(context, options, x, y, w, h) {\n options.barProgress && drawLinearBarShape(context, options, 'progress', x, y, w, h);\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws gauge bar highlighted areas\n *\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n */\nfunction drawLinearBarHighlights(context, options) {\n var _context$barDimension = context.barDimensions;\n var isVertical = _context$barDimension.isVertical;\n var width = _context$barDimension.width;\n var length = _context$barDimension.length;\n var barWidth = _context$barDimension.barWidth;\n var barOffset = _context$barDimension.barOffset;\n var barMargin = _context$barDimension.barMargin;\n var X = _context$barDimension.X;\n var Y = _context$barDimension.Y;\n var ticksLength = _context$barDimension.ticksLength;\n var ticksPadding = _context$barDimension.ticksPadding;\n\n\n if (!options.highlights) return;\n\n var hasLeft = options.tickSide !== 'right';\n var hasRight = options.tickSide !== 'left';\n var i = 0;\n var s = options.highlights.length;\n var tickOffset = (width - barWidth) / 2;\n var interval = options.maxValue - options.minValue;\n var eX = round(isVertical ? X + tickOffset : X + barMargin + barOffset);\n var eH = options.ticksWidth / 100 * width;\n var eY = isVertical ? Y + length - barMargin - barOffset : Y + tickOffset;\n var hLeft = round((options.ticksWidth / 100 + ticksPadding) * width);\n var hRight = round(barWidth + ticksPadding * width);\n\n context.save();\n\n for (; i < s; i++) {\n var entry = options.highlights[i];\n var eStart = ticksLength * abs(entry.from) / interval;\n var eW = ticksLength * abs((entry.to - entry.from) / interval);\n\n context.beginPath();\n context.fillStyle = entry.color;\n\n if (isVertical) {\n if (hasLeft) context.rect(eX - hLeft, eY - eStart, eH, -eW);\n\n if (hasRight) context.rect(eX + hRight, eY - eStart, eH, -eW);\n } else {\n if (hasLeft) context.rect(eX + eStart, eY - hLeft, eW, eH);\n\n if (hasRight) context.rect(eX + eStart, eY + hRight, eW, eH);\n }\n\n context.fill();\n context.closePath();\n }\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws a tick line on a linear gauge\n *\n * @param {Canvas2DContext} context\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\nfunction drawLinearTick(context, x1, y1, x2, y2) {\n context.beginPath();\n\n context.moveTo(x1, y1);\n context.lineTo(x2, y2);\n context.stroke();\n\n context.closePath();\n context.save();\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws ticks\n *\n * @param {Canvas2DContext} context\n * @param {string} color\n * @param {number} ticksSize\n * @param {number} deltaLen\n * @param {boolean} hasLeft\n * @param {boolean} hasRight\n * @param {number} lineWidth\n * @param {number} lineLength\n */\nfunction drawLinearTicks(context, color, ticksSize, deltaLen, hasLeft, hasRight, lineWidth, lineLength) {\n var _context$barDimension2 = context.barDimensions;\n var isVertical = _context$barDimension2.isVertical;\n var length = _context$barDimension2.length;\n var barWidth = _context$barDimension2.barWidth;\n var barOffset = _context$barDimension2.barOffset;\n var barMargin = _context$barDimension2.barMargin;\n var pixelRatio = _context$barDimension2.pixelRatio;\n var width = _context$barDimension2.width;\n var X = _context$barDimension2.X;\n var Y = _context$barDimension2.Y;\n var ticksLength = _context$barDimension2.ticksLength;\n var ticksPadding = _context$barDimension2.ticksPadding;\n\n var tickOffset = (width - barWidth) / 2;\n var tickX = void 0,\n tickY = void 0;\n var i = 0;\n var tickLen = lineLength * width;\n var tickLeft = tickOffset - ticksPadding * width;\n var tickRight = tickOffset + barWidth + tickLen + ticksPadding * width;\n var tickSpace = ticksLength / (ticksSize - deltaLen);\n var colors = color instanceof Array ? color : Array(ticksSize).fill(color);\n\n context.lineWidth = lineWidth * pixelRatio;\n context.save();\n\n for (; i < ticksSize; i++) {\n context.strokeStyle = colors[i];\n\n if (isVertical) {\n tickY = Y + length - barMargin - barOffset - i * tickSpace;\n\n if (hasLeft) {\n tickX = X + tickLeft;\n drawLinearTick(context, tickX, tickY, round(tickX - tickLen), tickY);\n }\n\n if (hasRight) {\n tickX = X + tickRight;\n drawLinearTick(context, tickX, tickY, round(tickX - tickLen), tickY);\n }\n } else {\n tickX = X + barMargin + barOffset + i * tickSpace;\n\n if (hasLeft) {\n tickY = Y + tickLeft;\n drawLinearTick(context, tickX, tickY, tickX, round(tickY - tickLen));\n }\n\n if (hasRight) {\n tickY = Y + tickRight;\n drawLinearTick(context, tickX, round(tickY), tickX, tickY - tickLen);\n }\n }\n }\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Prepares major ticks data\n *\n * @access private\n * @param {LinearGaugeOptions} options\n * @return {[boolean, boolean]}\n */\nfunction prepareTicks(options) {\n if (!options.majorTicks.length) {\n options.majorTicks.push(drawings.formatMajorTickNumber(options.minValue, options));\n options.majorTicks.push(drawings.formatMajorTickNumber(options.maxValue, options));\n }\n\n return [options.tickSide !== 'right', options.tickSide !== 'left'];\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws major ticks\n *\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n */\nfunction drawLinearMajorTicks(context, options) {\n var _prepareTicks = prepareTicks(options);\n\n var _prepareTicks2 = _slicedToArray(_prepareTicks, 2);\n\n var hasLeft = _prepareTicks2[0];\n var hasRight = _prepareTicks2[1];\n\n var lineWidth = 2;\n var colors = options.colorMajorTicks instanceof Array ? options.colorMajorTicks : Array(options.colorMajorTicks.length).fill(options.colorMajorTicks);\n\n drawLinearTicks(context, options.colorMajorTicks, options.majorTicks.length, 1, hasLeft, hasRight, lineWidth, options.ticksWidth / 100);\n\n if (options.strokeTicks) {\n var _context$barDimension3 = context.barDimensions;\n var isVertical = _context$barDimension3.isVertical;\n var length = _context$barDimension3.length;\n var width = _context$barDimension3.width;\n var barWidth = _context$barDimension3.barWidth;\n var barMargin = _context$barDimension3.barMargin;\n var barOffset = _context$barDimension3.barOffset;\n var X = _context$barDimension3.X;\n var Y = _context$barDimension3.Y;\n var ticksLength = _context$barDimension3.ticksLength;\n var pixelRatio = _context$barDimension3.pixelRatio;\n var ticksPadding = _context$barDimension3.ticksPadding;\n\n var rightTicks = (width - barWidth) / 2 + barWidth + ticksPadding * width;\n var leftTicks = (width - barWidth) / 2 - ticksPadding * width;\n var sX = void 0,\n sY = void 0,\n eX = void 0,\n eY = void 0;\n\n context.strokeStyle = colors[0];\n\n lineWidth *= pixelRatio;\n\n if (isVertical) {\n sY = Y + length - barMargin - barOffset + lineWidth / 2;\n eY = sY - ticksLength - lineWidth;\n\n if (hasLeft) {\n eX = sX = round(X + leftTicks);\n drawLinearTickStroke(context, sX, sY, eX, eY);\n }\n\n if (hasRight) {\n eX = sX = round(X + rightTicks);\n drawLinearTickStroke(context, sX, sY, eX, eY);\n }\n } else {\n sX = X + barMargin + barOffset - lineWidth / 2;\n eX = sX + ticksLength + lineWidth;\n\n if (hasLeft) {\n eY = sY = round(Y + leftTicks);\n drawLinearTickStroke(context, sX, sY, eX, eY);\n }\n\n if (hasRight) {\n eY = sY = round(Y + rightTicks);\n drawLinearTickStroke(context, sX, sY, eX, eY);\n }\n }\n }\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws ticks stroke\n *\n * @param {Canvas2DContext} context\n * @param {number} sX\n * @param {number} sY\n * @param {number} eX\n * @param {number} eY\n */\nfunction drawLinearTickStroke(context, sX, sY, eX, eY) {\n context.beginPath();\n context.moveTo(sX, sY);\n context.lineTo(eX, eY);\n context.stroke();\n context.closePath();\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws minor ticks\n *\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n */\nfunction drawLinearMinorTicks(context, options) {\n var _prepareTicks3 = prepareTicks(options);\n\n var _prepareTicks4 = _slicedToArray(_prepareTicks3, 2);\n\n var hasLeft = _prepareTicks4[0];\n var hasRight = _prepareTicks4[1];\n\n\n drawLinearTicks(context, options.colorMinorTicks, options.minorTicks * (options.majorTicks.length - 1), 0, hasLeft, hasRight, 1, options.ticksWidthMinor / 100);\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws major tick numbers\n *\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n */\nfunction drawLinearMajorTicksNumbers(context, options) {\n var _context$barDimension4 = context.barDimensions;\n var isVertical = _context$barDimension4.isVertical;\n var length = _context$barDimension4.length;\n var width = _context$barDimension4.width;\n var barWidth = _context$barDimension4.barWidth;\n var barMargin = _context$barDimension4.barMargin;\n var barOffset = _context$barDimension4.barOffset;\n var X = _context$barDimension4.X;\n var Y = _context$barDimension4.Y;\n var ticksLength = _context$barDimension4.ticksLength;\n var ticksPadding = _context$barDimension4.ticksPadding;\n\n var ticks = options.majorTicks.length;\n var hasLeft = options.numberSide !== 'right';\n var hasRight = options.numberSide !== 'left';\n var textHeight = options.fontNumbersSize * width / 200;\n var i = 0;\n var ticksWidth = (options.ticksWidth / 100 + ticksPadding * 2) * width;\n var numLeft = (width - barWidth) / 2 - ticksWidth;\n var numRight = (width - barWidth) / 2 + barWidth + ticksWidth;\n var textX = void 0,\n textY = void 0,\n textWidth = void 0,\n numberOffset = void 0,\n tick = void 0;\n var colors = options.colorNumbers instanceof Array ? options.colorNumbers : Array(ticks).fill(options.colorNumbers);\n\n context.font = textHeight + 'px ' + options.fontNumbers;\n context.lineWidth = 0;\n context.textAlign = 'center';\n\n for (; i < ticks; i++) {\n context.fillStyle = colors[i];\n tick = options.majorTicks[i];\n numberOffset = i * ticksLength / (ticks - 1);\n\n if (isVertical) {\n textY = Y + length - barMargin - barOffset - numberOffset + textHeight / 3;\n\n if (hasLeft) {\n context.textAlign = 'right';\n context.fillText(tick, X + numLeft, textY);\n }\n\n if (hasRight) {\n context.textAlign = 'left';\n context.fillText(tick, X + numRight, textY);\n }\n } else {\n textWidth = context.measureText(tick).width;\n textX = X + barMargin + barOffset + numberOffset;\n\n if (hasLeft) {\n context.fillText(tick, textX, Y + numLeft);\n }\n\n if (hasRight) {\n context.fillText(tick, textX, Y + numRight + textHeight);\n }\n }\n }\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws linear gauge title\n *\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n */\nfunction drawLinearTitle(context, options) {\n if (!options.title) return;\n\n var _context$barDimension5 = context.barDimensions;\n var isVertical = _context$barDimension5.isVertical;\n var width = _context$barDimension5.width;\n var length = _context$barDimension5.length;\n var baseX = _context$barDimension5.baseX;\n var baseY = _context$barDimension5.baseY;\n var titleMargin = _context$barDimension5.titleMargin;\n\n var textHeight = options.fontTitleSize * width / 200;\n var textX = round(baseX + (isVertical ? width : length) / 2);\n var textY = round(baseY + titleMargin / 2 - (isVertical ? textHeight : textHeight / 2) - .025 * (isVertical ? length : width));\n\n context.save();\n context.textAlign = 'center';\n context.fillStyle = options.colorTitle;\n context.font = textHeight + 'px ' + options.fontTitle;\n context.lineWidth = 0;\n context.fillText(options.title, textX, textY, isVertical ? width : length);\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws linear gauge units\n *\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n */\nfunction drawLinearUnits(context, options) {\n if (!options.units) return;\n\n var _context$barDimension6 = context.barDimensions;\n var isVertical = _context$barDimension6.isVertical;\n var width = _context$barDimension6.width;\n var length = _context$barDimension6.length;\n var baseX = _context$barDimension6.baseX;\n var baseY = _context$barDimension6.baseY;\n var unitsMargin = _context$barDimension6.unitsMargin;\n\n var textHeight = options.fontUnitsSize * width / 200;\n var textX = round(baseX + (isVertical ? width : length) / 2);\n var textY = round(baseY + (isVertical ? length : width) + unitsMargin / 2 - textHeight / 2);\n\n context.save();\n context.textAlign = 'center';\n context.fillStyle = options.colorTitle;\n context.font = textHeight + 'px ' + options.fontUnits;\n context.lineWidth = 0;\n context.fillText(options.units, textX, textY, isVertical ? width : length);\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws linear gauge needles\n *\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n */\nfunction drawLinearBarNeedle(context, options) {\n if (!options.needle) return;\n\n var _context$barDimension7 = context.barDimensions;\n var isVertical = _context$barDimension7.isVertical;\n var width = _context$barDimension7.width;\n var length = _context$barDimension7.length;\n var barWidth = _context$barDimension7.barWidth;\n var barOffset = _context$barDimension7.barOffset;\n var barMargin = _context$barDimension7.barMargin;\n var ticksLength = _context$barDimension7.ticksLength;\n var X = _context$barDimension7.X;\n var Y = _context$barDimension7.Y;\n var ticksPadding = _context$barDimension7.ticksPadding;\n\n var hasLeft = options.needleSide !== 'right';\n var hasRight = options.needleSide !== 'left';\n var position = ticksLength * (options.value - options.minValue) / (options.maxValue - options.minValue);\n var tickWidth = (options.ticksWidth / 100 + ticksPadding) * width;\n var baseLength = barWidth / 2 + tickWidth;\n var needleLength = baseLength * (options.needleEnd / 100);\n var sX = void 0,\n eX = void 0,\n sY = void 0,\n eY = void 0;\n var draw = options.needleType.toLowerCase() === 'arrow' ? drawLinearArrowNeedle : drawLinearLineNeedle;\n var barStart = (width - barWidth) / 2;\n var needleStart = baseLength * (options.needleStart / 100);\n var nLeft = barStart - tickWidth - needleStart;\n var nRight = barStart + barWidth + tickWidth + needleStart;\n\n context.save();\n\n drawings.drawNeedleShadow(context, options);\n\n if (isVertical) {\n sY = round(Y + length - barMargin - barOffset - position);\n\n if (hasLeft) {\n sX = round(X + nLeft);\n eX = sX + needleLength;\n draw(context, options, sX, sY, eX, sY, needleLength);\n }\n\n if (hasRight) {\n sX = round(X + nRight);\n eX = sX - needleLength;\n draw(context, options, sX, sY, eX, sY, needleLength, true);\n }\n } else {\n sX = round(X + barMargin + barOffset + position);\n\n if (hasLeft) {\n sY = round(Y + nLeft);\n eY = sY + needleLength;\n draw(context, options, sX, sY, sX, eY, needleLength);\n }\n\n if (hasRight) {\n sY = round(Y + nRight);\n eY = sY - needleLength;\n draw(context, options, sX, sY, sX, eY, needleLength, true);\n }\n }\n\n context.restore();\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Returns needle color style\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n * @param {number} length\n * @param {boolean} [isRight]\n * @return {CanvasGradient|string}\n */\nfunction needleStyle(context, options, length, isRight) {\n return options.colorNeedleEnd ? drawings.linearGradient(context, isRight ? options.colorNeedleEnd : options.colorNeedle, isRight ? options.colorNeedle : options.colorNeedleEnd, length, !context.barDimensions.isVertical) : options.colorNeedle;\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws line needle shape\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n * @param {number} sX\n * @param {number} sY\n * @param {number} eX\n * @param {number} eY\n * @param {number} length\n * @param {boolean} [isRight]\n */\nfunction drawLinearLineNeedle(context, options, sX, sY, eX, eY, length, isRight) {\n context.lineWidth = options.needleWidth;\n context.strokeStyle = needleStyle(context, options, length, isRight);\n\n context.beginPath();\n context.moveTo(sX, sY);\n context.lineTo(eX, eY);\n context.stroke();\n context.closePath();\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws arrow needle shape\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n * @param {number} sX\n * @param {number} sY\n * @param {number} eX\n * @param {number} eY\n * @param {number} length\n * @param {boolean} [isRight]\n */\nfunction drawLinearArrowNeedle(context, options, sX, sY, eX, eY, length, isRight) {\n var peakLength = round(length * .4);\n var bodyLength = length - peakLength;\n var isVertical = sX === eX;\n var halfWidth = options.needleWidth / 2;\n\n context.fillStyle = needleStyle(context, options, length, isRight);\n\n context.beginPath();\n\n if (isVertical) {\n if (sY > eY) bodyLength *= -1;\n\n context.moveTo(sX - halfWidth, sY);\n context.lineTo(sX + halfWidth, sY);\n context.lineTo(sX + halfWidth, sY + bodyLength);\n context.lineTo(sX, eY);\n context.lineTo(sX - halfWidth, sY + bodyLength);\n context.lineTo(sX - halfWidth, sY);\n } else {\n if (sX > eX) bodyLength *= -1;\n\n context.moveTo(sX, sY - halfWidth);\n context.lineTo(sX, sY + halfWidth);\n context.lineTo(sX + bodyLength, sY + halfWidth);\n context.lineTo(eX, sY);\n context.lineTo(sX + bodyLength, sY - halfWidth);\n context.lineTo(sX, sY - halfWidth);\n }\n\n context.fill();\n context.closePath();\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws value box for linear gauge\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n * @param {number} value\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n */\nfunction drawLinearValueBox(context, options, value, x, y, w, h) {\n // currently value box is available only for vertical linear gauge,\n // as far as by design it is hard to find a proper place for\n // horizontal ones\n context.barDimensions.isVertical && drawings.drawValueBox(context, options, value, x + w / 2, y + h - 40 * (w / 300), w);\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws linear gauge plate\n *\n * @param {Canvas2DContext} context\n * @param {LinearGaugeOptions} options\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n */\nfunction drawLinearPlate(context, options, x, y, w, h) {\n context.save();\n\n var r = options.borderRadius;\n\n var w1 = w - options.borderShadowWidth;\n var w2 = w1 - options.borderOuterWidth * 2;\n var w3 = w2 - options.borderMiddleWidth * 2;\n var w4 = w3 - options.borderInnerWidth * 2;\n\n var h1 = h - options.borderShadowWidth * 2;\n var h2 = h1 - options.borderOuterWidth * 2;\n var h3 = h2 - options.borderMiddleWidth * 2;\n var h4 = h3 - options.borderInnerWidth * 2;\n\n var x2 = x - (w2 - w1) / 2;\n var x3 = x2 - (w3 - w2) / 2;\n var x4 = x3 - (w4 - w3) / 2;\n\n var y2 = y - (h2 - h1) / 2;\n var y3 = y2 - (h3 - h2) / 2;\n var y4 = y3 - (h4 - h3) / 2;\n\n if (options.borderOuterWidth) {\n drawRectangle(context, r, x, y, w1, h1, options.colorBorderOuter, options.colorBorderOuterEnd);\n }\n\n if (options.borderMiddleWidth) {\n drawRectangle(context, --r, x2, y2, w2, h2, options.colorBorderMiddle, options.colorBorderMiddleEnd);\n }\n\n if (options.borderInnerWidth) {\n drawRectangle(context, --r, x3, y3, w3, h3, options.colorBorderInner, options.colorBorderInnerEnd);\n }\n\n if (options.borderShadowWidth) {\n context.shadowBlur = options.borderShadowWidth;\n context.shadowColor = options.colorBorderShadow;\n }\n\n drawRectangle(context, r, x4, y4, w4, h4, options.colorPlate, options.colorPlateEnd);\n\n context.restore();\n\n return [x4, y4, w4, h4];\n}\n\n/**\n * Minimalistic HTML5 Canvas Linear Gauge\n */\n\nvar LinearGauge = function (_BaseGauge2) {\n _inherits(LinearGauge, _BaseGauge2);\n\n /**\n * @constructor\n * @param {LinearGaugeOptions} options\n */\n function LinearGauge(options) {\n _classCallCheck(this, LinearGauge);\n\n options = Object.assign({}, defaultLinearGaugeOptions, options || {});\n\n /* istanbul ignore else */\n if (options.barStrokeWidth >= options.barWidth) {\n options.barStrokeWidth = round(options.barWidth / 2);\n }\n\n //noinspection JSUndefinedPropertyAssignment\n options.hasLeft = hasTicksBar('right', options);\n //noinspection JSUndefinedPropertyAssignment\n options.hasRight = hasTicksBar('left', options);\n\n return _possibleConstructorReturn(this, (LinearGauge.__proto__ || Object.getPrototypeOf(LinearGauge)).call(this, options));\n }\n\n /* istanbul ignore next */\n /**\n * Triggering linear gauge render on a canvas.\n *\n * @returns {LinearGauge}\n */\n\n\n _createClass(LinearGauge, [{\n key: 'draw',\n value: function draw() {\n try {\n var canvas = this.canvas;\n var x = -canvas.drawX;\n var y = -canvas.drawY;\n var w = canvas.drawWidth;\n var h = canvas.drawHeight;\n\n var options = this.options;\n\n if (!canvas.elementClone.initialized) {\n var context = canvas.contextClone;\n\n // clear the cache\n context.clearRect(x, y, w, h);\n context.save();\n\n this.drawBox = drawLinearPlate(context, options, x, y, w, h);\n\n drawLinearBar.apply(undefined, [context, options].concat(_toConsumableArray(this.drawBox)));\n\n canvas.context.barDimensions = context.barDimensions;\n\n drawLinearBarHighlights(context, options);\n drawLinearMinorTicks(context, options);\n drawLinearMajorTicks(context, options);\n drawLinearMajorTicksNumbers(context, options);\n drawLinearTitle(context, options);\n drawLinearUnits(context, options);\n\n canvas.elementClone.initialized = true;\n }\n\n this.canvas.commit();\n\n // clear the canvas\n canvas.context.clearRect(x, y, w, h);\n canvas.context.save();\n\n canvas.context.drawImage(canvas.elementClone, x, y, w, h);\n canvas.context.save();\n\n drawLinearBarProgress.apply(undefined, [canvas.context, options].concat(_toConsumableArray(this.drawBox)));\n drawLinearBarNeedle(canvas.context, options);\n drawLinearValueBox.apply(undefined, [canvas.context, options, options.animatedValue ? this.options.value : this.value].concat(_toConsumableArray(this.drawBox)));\n\n _get(LinearGauge.prototype.__proto__ || Object.getPrototypeOf(LinearGauge.prototype), 'draw', this).call(this);\n } catch (err) {\n drawings.verifyError(err);\n }\n\n return this;\n }\n }]);\n\n return LinearGauge;\n}(BaseGauge);\n\n/**\n * @ignore\n * @typedef {object} ns\n */\n/* istanbul ignore if */\n\n\nif (typeof ns !== 'undefined') {\n ns['LinearGauge'] = LinearGauge;\n}\n\nBaseGauge.initialize('LinearGauge', defaultLinearGaugeOptions);;typeof module !== \"undefined\" && Object.assign(ns, {Collection: Collection,GenericOptions: GenericOptions,Animation: Animation,BaseGauge: BaseGauge,drawings: drawings,SmartCanvas: SmartCanvas,vendorize: vendorize});}(typeof module !== \"undefined\" ? module.exports : window));"],"sourceRoot":"/source/"}