From 5727690ae67dc73d78ff92bede675cf24afea90c Mon Sep 17 00:00:00 2001 From: Mykhailo Stadnyk Date: Fri, 19 Aug 2016 16:57:45 +0300 Subject: [PATCH] End-to-end test infrastructure re-factored --- README.md | 3 +- gauge.min.js.map | 2 +- gulpfile.js | 52 ++++++++++++++++++++++++------ lib/Gauge.js | 2 +- package.json | 6 ++-- test/e2e/gauges.e2e.js | 38 ++++++++++++++++++++++ test/e2e/pageobject/gauges.page.js | 29 ----------------- test/e2e/pageobject/page.js | 7 ---- test/e2e/spec/gauges.spec.js | 10 ------ wdio.conf.js | 25 -------------- 10 files changed, 86 insertions(+), 88 deletions(-) create mode 100644 test/e2e/gauges.e2e.js delete mode 100644 test/e2e/pageobject/gauges.page.js delete mode 100644 test/e2e/pageobject/page.js delete mode 100644 test/e2e/spec/gauges.spec.js delete mode 100644 wdio.conf.js diff --git a/README.md b/README.md index abffab45..b9a06fff 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,9 @@ No dependencies. Suitable for IoT devices because of minimum code base. ## Install -Make it simple using npm or bower: +Make it simple using npm: $ npm install canv-gauge - $ bower install canv-gauge ## Documentation diff --git a/gauge.min.js.map b/gauge.min.js.map index 830a1a01..037b4422 100644 --- a/gauge.min.js.map +++ b/gauge.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["gauge.min.js"],"names":["e","t","n","r","s","o","u","a","require","i","f","Error","code","l","exports","call","length","1","module","step","time","draw","start","rule","duration","end","anim","TypeError","progress","percent","frame","requestAnimationFrame","Object","defineProperty","value","vendorize","callback","setTimeout","Date","getTime","rules","linear","p","quad","Math","pow","dequad","quint","dequint","cycle","sin","acos","decycle","bounce","debounce","b","elastic","delastic","x","cos","PI","Animation","arguments","undefined","babelHelpers","classCallCheck","this","createClass","key","_this","window","performance","now","cancelAnimationFrame","id","default","./babelHelpers","./vendorize","2","toAttributeName","str","arr","split","toLowerCase","domReady","handler","addEventListener","attachEvent","DomObserver","options","element","type","Type","traverse","MutationObserver","observe","bind","document","body","childList","subtree","attributes","characterData","attributeOldValue","characterDataOldValue","node","tagName","getAttribute","elements","getElementsByTagName","isValidNode","process","records","record","attributeName","target","oldValue","addedNodes","ii","ss","prop","JSON","parse","stringify","hasOwnProperty","attributeValue","renderTo","test","3","formatMajorTickNumber","num","right","hasDec","majorTicksDec","round","toString","toFixed","majorTicksInt","indexOf","join","replace","radians","degrees","radialPoint","radius","angle","y","linearGradient","context","colorFrom","colorTo","grad","createLinearGradient","addColorStop","padValue","val","dec","valueDec","int","valueInt","strVal","parseFloat","abs","drawCircle","beginPath","arc","fillStyle","fill","maxRadius","max","borderShadowWidth","borderOuterWidth","borderMiddleWidth","borderInnerWidth","drawPlate","d0","r0","r1","r2","r3","save","glow","shadowBlur","shadowColor","colorBorderShadow","borders","borderOuter","colorBorderOuterStart","colorBorderOuterEnd","restore","borderMiddle","colorBorderMiddleStart","colorBorderMiddleEnd","borderInner","colorBorderInnerStart","colorBorderInnerEnd","colorPlate","drawHighlights","highlights","hlt","vd","maxValue","minValue","ticksAngle","sa","startAngle","from","ea","to","ps","pe","ps1","pe1","rotate","moveTo","lineTo","closePath","color","drawMinorTicks","lineWidth","SmartCanvas","pixelRatio","strokeStyle","colorMinorTicks","minorTicks","majorTicks","stroke","drawMajorTicks","colorMajorTicks","numberOfDefaultTicks","tickSize","push","strokeTicks","drawNumbers","points","point","font","colorNumbers","textAlign","fillText","drawTitle","title","colorTitle","drawUnits","units","colorUnits","drawNeedleShadow","needleShadow","shadowOffsetX","shadowOffsetY","colorNeedleShadowDown","drawNeedle","needle","needleCircleSize","rIn","needleEnd","rStart","needleStart","rOut","pad1","needleWidth","pad2","needleType","colorNeedleStart","colorNeedleEnd","colorNeedleShadowUp","needleCircle","needleCircleOuter","colorNeedleCircleOuterStart","colorNeedleCircleOuterEnd","needleCircleInner","colorNeedleCircleInnerStart","colorNeedleCircleInnerEnd","roundRect","w","h","quadraticCurveTo","drawValueBox","valueText","text","valueBox","th","tw","measureText","width","grd","createRadialGradient","colorValueBoxRectStart","colorValueBoxRectEnd","colorValueBoxShadow","colorValueBoxBackground","colorValueTextShadow","colorValueText","DomParser","SharedOptions","defaultOptions","assign","Gauge","Collection","parseInt","isNaN","Array","canvas","getElementById","height","onRedraw","animation","animationRule","animationDuration","drawX","drawY","drawWidth","drawHeight","elementClone","initialized","contextClone","clearRect","commit","drawImage","redraw","index","splice","destroy","set","fromValue","_value","animate","get","./Animation","./DomObserver","./SharedOptions","./SmartCanvas","./polyfill","4","updateValueOnAnimation","5","init","style","cloneNode","getContext","minSide","translate","scale","devicePixelRatio","matchMedia","addListener","6","global","instance","Constructor","defineProperties","props","descriptor","enumerable","configurable","writable","protoProps","staticProps","prototype","extends","source","self","7","firstSource","nextSource","keysArray","keys","nextIndex","len","nextKey","desc","getOwnPropertyDescriptor","searchElement","fromIndex","k","O","Infinity","8","vendors","capitalized","charAt","toUpperCase","substr","vendorProp"],"mappings":"CAAA,QAAUA,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATC,UAAqBA,OAAQ,KAAIF,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGI,EAAE,MAAOA,GAAEJ,GAAE,EAAI,IAAIK,GAAE,GAAIC,OAAM,uBAAuBN,EAAE,IAAK,MAAMK,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEX,EAAEG,IAAIS,WAAYb,GAAEI,GAAG,GAAGU,KAAKF,EAAEC,QAAQ,SAASd,GAAG,GAAIE,GAAED,EAAEI,GAAG,GAAGL,EAAG,OAAOI,GAAEF,EAAEA,EAAEF,IAAIa,EAAEA,EAAEC,QAAQd,EAAEC,EAAEC,EAAEC,GAAG,MAAOD,GAAEG,GAAGS,QAAkD,IAAI,GAA1CL,GAAkB,kBAATD,UAAqBA,QAAgBH,EAAE,EAAEA,EAAEF,EAAEa,OAAOX,IAAID,EAA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,GAAajL,EAAK4K,EAAQjX,GAAKkX,EAGnC,IAA0B,mBAAfI,GACP,MAAOA,GAIf,MAAO,MAxEX/V,OAAOC,eAAenB,EAAS,cAC3BoB,OAAO,IAEXpB,EAAQ6D,QAAUxC,EAwElBjB,EAAOJ,QAAUqB,IAEdpB,KAAKmD,KAAuB,mBAAXyR,QAAyBA,OAAyB,mBAATc,MAAuBA,KAAyB,mBAAXnS,QAAyBA,qBAChH,EAAE","file":"gauge.min.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o\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 */\nrequire('./babelHelpers');\n\nvar vendorize = require('./vendorize');\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 babelHelpers.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 babelHelpers.createClass(Animation, [{\n key: 'animate',\n value: function animate(draw, end) {\n var _this = this;\n\n //noinspection JSUnresolvedVariable\n var start = vendorize('animationStartTime') || window.performance && window.performance.now ? window.performance.now() : 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 return Animation;\n}();\n\n/**\n * Animation rules bound statically to Animation constructor.\n *\n * @type {AnimationRules}\n * @static\n */\n\n\nexports.default = Animation;\nAnimation.rules = rules;\n\nmodule.exports = Animation;\n\n},{\"./babelHelpers\":6,\"./vendorize\":8}],2:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 \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 */\nrequire('./babelHelpers');\n\n/**\n * @typedef {{ constructor: function(options: object): GaugeInterface, draw: function(): GaugeInterface }} GaugeInterface\n */\n\n/* istanbul ignore next: private, not testable */\n/**\n * Transforms camel case property name to dash separated attribute name\n *\n * @access private\n * @param {string} str\n * @returns {string}\n */\nfunction toAttributeName(str) {\n var arr = str.split(/(?=[A-Z])/);\n var i = 0;\n var s = arr.length;\n\n str = 'data';\n\n for (; i < s; i++) {\n str += '-' + arr[i].toLowerCase();\n }\n\n return str;\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Cross-browser DOM ready handler\n *\n * @access private\n * @param {Function} handler\n */\nfunction domReady(handler) {\n if (window.addEventListener) {\n window.addEventListener('DOMContentLoaded', handler, false);\n } else {\n window.attachEvent('onload', handler);\n }\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
\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 * //
\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 * @param {Function} Type\n */\n function DomObserver(options, element, type, Type) {\n var _this = this;\n\n babelHelpers.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 = type;\n\n /**\n * Actual type constructor to instantiate for each found element\n *\n * @type {Function}\n */\n this.Type = Type;\n\n /* istanbul ignore next: this should be tested with end-to-end tests */\n domReady(function () {\n _this.traverse();\n\n if (window.MutationObserver) {\n //noinspection JSCheckFunctionSignatures\n new 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 });\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 babelHelpers.createClass(DomObserver, [{\n key: 'isValidNode',\n value: function isValidNode(node) {\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 var node = elements[i];\n\n if (this.isValidNode(node)) {\n this.process(node);\n }\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 i = 0;\n var s = records.length;\n\n /* istanbul ignore next: this should be tested with end-to-end tests */\n for (; i < s; i++) {\n var record = records[i];\n\n if (record.type === 'attributes' && record.attributeName === 'data-type' && this.isValidNode(record.target) && record.oldValue !== this.type) // skip false-positive mutations\n {\n this.process(record.target);\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 var node = record.addedNodes[ii];\n\n if (this.isValidNode(node)) {\n this.process(node);\n }\n }\n }\n }\n }\n\n /**\n * Parses given attribute value to a proper javascript value\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}\n */\n value: function process(node) {\n var prop = void 0;\n var options = JSON.parse(JSON.stringify(this.options));\n\n for (prop in options) {\n /* istanbul ignore else: non-testable in most cases */\n if (options.hasOwnProperty(prop)) {\n var attributeName = 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\n return new this.Type(options).draw();\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 alphanum 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 return DomObserver;\n}();\n\nexports.default = DomObserver;\n\n\nmodule.exports = DomObserver;\n\n},{\"./babelHelpers\":6}],3:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 \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 * @authors: Mykhailo Stadnyk \n * Chris Poile \n * Luca Invernizzi \n * Rhys Lloyd \n * Robert Blackburn \n * Charles Galpin \n * Luca Ghio \n * Greg \n * David Esperalta \n * Gwenaël (https://thegtricks.thegounet.fr)\n * migeruhito (https://github.com/migeruhito)\n */\nrequire('./polyfill');\nrequire('./babelHelpers');\n\nvar Animation = require('./Animation');\nvar SmartCanvas = require('./SmartCanvas');\nvar DomParser = require('./DomObserver');\nvar SharedOptions = require('./SharedOptions');\n\n// todo: customizable fonts\n// todo: readme and documentation update\n// todo: github pages\n// todo: wiki\n// todo: LinearGauge implementation\n// todo: online configurator\n// todo: online packager\n// todo: e2e tests\n// todo: optimize build process (glueand minify without babel and browserify)\n// todo: angular 2 integration\n// todo: react integrations\n// todo: typescript definitions\n\n/**\n * Gauge configuration options\n *\n * @typedef {{renderTo: RenderTarget, width: number, height: number, title: string|boolean, maxValue: number, minValue: number, value: number, majorTicks: Array, minorTicks: number, ticksAngle: number, startAngle: number, strokeTicks: boolean, units: string|boolean, updateValueOnAnimation: boolean, glow: boolean, valueInt: number, valueDec: number, majorTicksInt: number, majorTicksDec: number, animation: boolean, animationDuration: number, animationRule: AnimationRule, colorPlate: string, colorMajorTicks: string, colorMinorTicks: string, colorTitle: string, colorUnits: string, colorNumbers: string, colorNeedleStart: string, colorNeedleEnd: string, colorNeedleCircleOuterStart: string, colorNeedleCircleOuterEnd: string, colorNeedleCircleInnerStart: string, colorNeedleCircleInnerEnd: string, colorNeedleShadowUp: string, colorNeedleShadowDown: string, colorValueBoxRectStart: string, colorValueBoxRectEnd: string, colorValueBoxBackground: string, colorValueBoxShadow: string, colorValueText: string, colorValueTextShadow: string, colorBorderShadow: string, colorBorderOuterStart: string, colorBorderOuterEnd: string, colorBorderMiddleStart: string, colorBorderMiddleEnd: string, colorBorderInnerStart: string, colorBorderInnerEnd: string, needle: boolean, needleShadow: boolean, needleType: string, needleStart: number, needleEnd: number, needleWidth: number, needleCircle: boolean, needleCircleSize: number, needleCircleInner: boolean, needleCircleOuter: boolean, borders: boolean, borderOuter: boolean, borderOuterWidth: number, borderMiddle: boolean, borderMiddleWidth: number, borderInner: boolean, borderInnerWidth: number, borderShadowWidth: number, valueBox: boolean, valueText: boolean, highlights: Highlight[]}} GaugeOptions\n */\n\n/**\n * @access private\n * @typedef {CanvasRenderingContext2D|{max: number, maxRadius: number}} Canvas2DContext\n */\n\n//noinspection JSValidateTypes\n/**\n * Default gauge configuration options\n *\n * @access private\n * @type {GaugeOptions}\n */\nvar defaultOptions = Object.assign({}, SharedOptions, {\n // basic options\n ticksAngle: 270,\n startAngle: 45,\n\n // colors\n colorNeedleCircleOuterStart: '#f0f0f0',\n colorNeedleCircleOuterEnd: '#ccc',\n colorNeedleCircleInnerStart: '#e8e8e8',\n colorNeedleCircleInnerEnd: '#f5f5f5',\n colorNeedleShadowUp: 'rgba(2,255,255,0.2)',\n colorNeedleShadowDown: 'rgba(188,143,143,0.45)',\n colorValueBoxRectStart: '#888',\n colorValueBoxRectEnd: '#666',\n colorValueBoxBackground: '#babab2',\n colorValueBoxShadow: 'rgba(0,0,0,1)',\n\n // needle\n needleStart: 0,\n needleEnd: 85,\n needleWidth: 4,\n needleCircle: true,\n needleCircleSize: 10,\n needleCircleInner: true,\n needleCircleOuter: true\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 * @access private\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 * @access private\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 * @access private\n * @param {Canvas2DContext} context\n * @param {string} colorFrom\n * @param {string} colorTo\n * @param {number} length\n * @returns {CanvasGradient}\n */\nfunction linearGradient(context, colorFrom, colorTo, length) {\n var grad = context.createLinearGradient(0, 0, 0, length);\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 * Pads a given value with leading zeros using the given options\n *\n * @access private\n * @param {number} val\n * @param {{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 * 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 drawCircle(radius, context, start, end) {\n context.beginPath();\n context.arc(0, 0, radius, 0, Math.PI * 2, true);\n context.fillStyle = linearGradient(context, start, end, radius);\n context.fill();\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 {GaugeOptions} options\n * @return {number}\n */\nfunction maxRadius(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 {GaugeOptions} options\n */\nfunction drawPlate(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 = maxRadius(context, options);\n\n context.save();\n\n if (options.glow) {\n context.shadowBlur = d0;\n context.shadowColor = options.colorBorderShadow;\n }\n\n if (options.borders) {\n if (options.borderOuter) {\n drawCircle(r0, context, options.colorBorderOuterStart, options.colorBorderOuterEnd);\n }\n\n context.restore();\n\n if (options.borderMiddle) {\n drawCircle(r1, context, options.colorBorderMiddleStart, options.colorBorderMiddleEnd);\n }\n\n if (options.borderInner) {\n drawCircle(r2, context, options.colorBorderInnerStart, options.colorBorderInnerEnd);\n }\n }\n\n context.beginPath();\n context.arc(0, 0, r3, 0, Math.PI * 2, true);\n context.fillStyle = options.colorPlate;\n context.fill();\n\n context.save();\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 {GaugeOptions} options\n */\nfunction drawHighlights(context, options) {\n context.save();\n\n var r1 = maxRadius(context, options) - context.max * .05;\n var r2 = 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 = radians(options.startAngle + (hlt.from - options.minValue) / vd);\n var ea = radians(options.startAngle + (hlt.to - options.minValue) / vd);\n var ps = radialPoint(r2, sa);\n var pe = radialPoint(r1, sa);\n var ps1 = radialPoint(r1, ea);\n var pe1 = radialPoint(r2, ea);\n\n context.beginPath();\n context.rotate(radians(90));\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(radians(90));\n context.arc(0, 0, r2, sa - 0.2, ea + 0.2, false);\n context.restore();\n\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 {GaugeOptions} options\n */\nfunction drawMinorTicks(context, options) {\n var radius = maxRadius(context, options) - context.max * .05;\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(radians(angle));\n\n context.beginPath();\n context.moveTo(0, radius);\n context.lineTo(0, radius - context.max * .075);\n context.stroke();\n\n context.restore();\n context.save();\n }\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 {GaugeOptions} options\n */\nfunction drawMajorTicks(context, options) {\n var r = maxRadius(context, options) - context.max * .05;\n var i = 0;\n var s = options.majorTicks.length;\n var pixelRatio = SmartCanvas.pixelRatio;\n\n context.lineWidth = 2 * pixelRatio;\n context.strokeStyle = options.colorMajorTicks;\n context.save();\n\n if (s === 0) {\n var numberOfDefaultTicks = 5;\n var tickSize = (options.maxValue - options.minValue) / numberOfDefaultTicks;\n\n for (; i < numberOfDefaultTicks; i++) {\n options.majorTicks.push(formatMajorTickNumber(options.minValue + tickSize * i, options));\n }\n options.majorTicks.push(formatMajorTickNumber(options.maxValue, options));\n }\n\n i = 0;\n for (; i < s; ++i) {\n var a = options.startAngle + i * (options.ticksAngle / (s - 1));\n context.rotate(radians(a));\n\n context.beginPath();\n context.moveTo(0, r);\n context.lineTo(0, r - context.max * .15);\n context.stroke();\n\n context.restore();\n context.save();\n }\n\n if (options.strokeTicks) {\n context.rotate(radians(90));\n\n context.beginPath();\n context.arc(0, 0, r, radians(options.startAngle), radians(options.startAngle + options.ticksAngle), false);\n context.stroke();\n context.restore();\n\n context.save();\n }\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 {GaugeOptions} options\n */\nfunction drawNumbers(context, options) {\n var radius = maxRadius(context, options) - context.max * .35;\n var points = {};\n var i = 0;\n var s = options.majorTicks.length;\n\n for (; i < s; ++i) {\n var angle = options.startAngle + i * (options.ticksAngle / (s - 1));\n var point = radialPoint(radius, 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 = 20 * (context.max / 200) + 'px Arial';\n context.fillStyle = options.colorNumbers;\n context.lineWidth = 0;\n context.textAlign = 'center';\n context.fillText(options.majorTicks[i], point.x, point.y + 3);\n }\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws gauge title\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {GaugeOptions} options\n */\nfunction drawTitle(context, options) {\n if (!options.title) return;\n\n context.save();\n context.font = 24 * (context.max / 200) + 'px Arial';\n context.fillStyle = options.colorTitle;\n context.textAlign = 'center';\n context.fillText(options.title, 0, -context.max / 4.25);\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 {GaugeOptions} options\n */\nfunction drawUnits(context, options) {\n if (!options.units) return;\n\n context.save();\n context.font = 22 * (context.max / 200) + 'px Arial';\n context.fillStyle = options.colorUnits;\n context.textAlign = 'center';\n context.fillText(options.units, 0, context.max / 3.25);\n context.restore();\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 {GaugeOptions} 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 gauge needle\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {GaugeOptions} options\n */\nfunction drawNeedle(context, options) {\n if (!options.needle) return;\n\n var value = options.value;\n var max = maxRadius(context, options);\n var r1 = max / 100 * options.needleCircleSize;\n var r2 = max / 100 * options.needleCircleSize * 0.75;\n var rIn = max / 100 * options.needleEnd;\n var rStart = options.needleStart ? max / 100 * options.needleStart : 0,\n rOut = max * .2;\n var pad1 = max / 100 * options.needleWidth;\n var pad2 = max / 100 * options.needleWidth / 2;\n var pixelRatio = SmartCanvas.pixelRatio;\n\n drawNeedleShadow(context, options);\n\n context.save();\n\n context.rotate(radians(options.startAngle + (value - options.minValue) / (options.maxValue - options.minValue) * options.ticksAngle));\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\n context.fillStyle = linearGradient(context, options.colorNeedleStart, options.colorNeedleEnd, rIn - rOut);\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\n context.fillStyle = linearGradient(context, options.colorNeedleStart, options.colorNeedleEnd, rIn - rOut);\n context.fill();\n }\n\n context.restore();\n\n if (options.needleCircle) {\n drawNeedleShadow(context, options);\n\n if (options.needleCircleOuter) {\n context.beginPath();\n context.arc(0, 0, r1, 0, Math.PI * 2, true);\n context.fillStyle = linearGradient(context, options.colorNeedleCircleOuterStart, options.colorNeedleCircleOuterEnd, r1);\n context.fill();\n context.restore();\n }\n\n if (options.needleCircleInner) {\n context.beginPath();\n context.arc(0, 0, r2, 0, Math.PI * 2, true);\n context.fillStyle = linearGradient(context, options.colorNeedleCircleInnerStart, options.colorNeedleCircleInnerEnd, r2);\n context.fill();\n }\n }\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws rounded corners rectangle\n *\n * @access private\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 * Draws gauge value box\n *\n * @param {Canvas2DContext} context\n * @param {GaugeOptions} options\n * @param {number} value\n */\nfunction drawValueBox(context, options, value) {\n if (!options.valueText) return;\n\n var max = context.max;\n var text = padValue(value, options);\n var y = max - max * .33;\n var x = 0;\n\n context.save();\n context.font = 40 * (max / 200) + 'px Led';\n context.save();\n\n if (options.valueBox) {\n var th = 0.12 * max;\n var tw = context.measureText('-' + padValue(0, options)).width;\n\n roundRect(context, -tw / 2 - 0.025 * max, y - th - 0.04 * max, tw + 0.05 * max, th + 0.07 * max, 0.025 * max);\n }\n\n var grd = context.createRadialGradient(x, y - 0.12 * max - 0.025 * max + (0.12 * max + 0.045 * max) / 2, max / 10, x, y - 0.12 * max - 0.025 * max + (0.12 * max + 0.045 * max) / 2, max / 5);\n\n grd.addColorStop(0, options.colorValueBoxRectStart);\n grd.addColorStop(1, options.colorValueBoxRectEnd);\n\n context.strokeStyle = grd;\n context.lineWidth = 0.05 * max;\n context.stroke();\n\n context.shadowBlur = 0.012 * max;\n context.shadowColor = options.colorValueBoxShadow;\n\n context.fillStyle = options.colorValueBoxBackground;\n context.fill();\n\n context.restore();\n\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 context.fillStyle = options.colorValueText;\n context.textAlign = 'center';\n context.fillText(text, -x, y);\n\n context.restore();\n}\n\n/**\n * Minimalistic HTML5 Canvas Gauge\n * @example\n * var gauge = new Gauge({\n * renderTo: 'gauge',\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 Gauge = function () {\n\n /**\n * @constructor\n * @param {GaugeOptions} options\n */\n function Gauge(options) {\n babelHelpers.classCallCheck(this, Gauge);\n\n Gauge.Collection.push(this);\n\n options = Object.assign({}, defaultOptions, options || {});\n\n options.startAngle = parseInt(options.startAngle, 10);\n options.ticksAngle = parseInt(options.ticksAngle, 10);\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 options.minValue = parseFloat(options.minValue);\n options.maxValue = parseFloat(options.maxValue);\n\n /* istanbul ignore if */\n if (!(options.highlights instanceof Array)) {\n options.highlights = [];\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 //noinspection JSUnresolvedVariable\n /**\n * @property {GaugeOptions} Gauge.options\n */\n this.options = options;\n\n /**\n * @property {SmartCanvas} Gauge.canvas\n */\n this.canvas = new SmartCanvas(canvas, options.width, options.height);\n this.canvas.onRedraw = this.draw.bind(this);\n\n /**\n * @property {Animation} Gauge.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 babelHelpers.createClass(Gauge, [{\n key: 'draw',\n\n\n /**\n * Triggering gauge render on a canvas.\n *\n * @returns {Gauge}\n */\n value: function draw() {\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 drawPlate(context, options);\n drawHighlights(context, options);\n drawMinorTicks(context, options);\n drawMajorTicks(context, options);\n drawNumbers(context, options);\n drawTitle(context, options);\n drawUnits(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 drawValueBox(canvas.context, options, this.value);\n drawNeedle(canvas.context, options);\n\n return this;\n }\n\n /**\n * Updates gauge configuration options at runtime and redraws the gauge\n *\n * @param {GaugeOptions} options\n * @returns {Gauge}\n */\n\n }, {\n key: 'update',\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 = Gauge.Collection.indexOf(this);\n\n /* istanbul ignore else */\n if (~index) {\n Gauge.Collection.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 key: 'value',\n set: function set(value) {\n var _this = this;\n\n if (value === this.options.value) return;\n\n if (this.options.animation) {\n (function () {\n var fromValue = _this.options.value;\n\n /**\n * @type {number}\n * @access private\n */\n _this._value = value;\n\n _this.animation.animate(function (percent) {\n _this.options.value = fromValue + (value - fromValue) * percent;\n\n _this.draw();\n }, function () {\n _this.options.value = value;\n delete _this._value;\n _this.draw();\n });\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 return Gauge;\n}();\n\nexports.default = Gauge;\n\n\nGauge.Collection = [];\nGauge.Collection.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\nnew DomParser(defaultOptions, 'canvas', 'gauge', Gauge);\n\nmodule.exports = window['Gauge'] = Gauge;\n\n},{\"./Animation\":1,\"./DomObserver\":2,\"./SharedOptions\":4,\"./SmartCanvas\":5,\"./babelHelpers\":6,\"./polyfill\":7}],4:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 \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\nvar SharedOptions = {\n // basic options\n renderTo: null,\n width: 200,\n height: 200,\n minValue: 0,\n maxValue: 100,\n value: 0,\n units: false,\n majorTicks: [],\n minorTicks: 10,\n strokeTicks: true,\n updateValueOnAnimation: false,\n glow: true,\n title: false,\n\n // number formats\n valueInt: 3,\n valueDec: 2,\n majorTicksInt: 1,\n majorTicksDec: 0,\n\n // animations\n animation: true,\n animationDuration: 250,\n animationRule: 'cycle',\n\n // colors\n colorPlate: '#fff',\n colorMajorTicks: '#444',\n colorMinorTicks: '#666',\n colorTitle: '#888',\n colorUnits: '#888',\n colorNumbers: '#444',\n colorNeedleStart: '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 colorBorderOuterStart: '#ddd',\n colorBorderOuterEnd: '#aaa',\n colorBorderMiddleStart: '#eee',\n colorBorderMiddleEnd: '#f0f0f0',\n colorBorderInnerStart: '#fafafa',\n colorBorderInnerEnd: '#ccc',\n\n // needle\n needle: true,\n needleShadow: true,\n needleType: 'arrow',\n\n // borders\n borders: true,\n borderOuter: true,\n borderOuterWidth: 3,\n borderMiddle: true,\n borderMiddleWidth: 3,\n borderInner: true,\n borderInnerWidth: 3,\n borderShadowWidth: 3,\n\n // value and highlights\n valueBox: true,\n valueText: true,\n highlights: [{ from: 20, to: 60, color: '#eee' }, { from: 60, to: 80, color: '#ccc' }, { from: 80, to: 100, color: '#999' }]\n};\n\nexports.default = SharedOptions;\n\n\nmodule.exports = SharedOptions;\n\n},{}],5:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 \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 */\nrequire('./babelHelpers');\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\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 babelHelpers.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 babelHelpers.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 // derefecence 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 this.contextClone.scale(scale, scale);\n this.contextClone.save();\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 window.devicePixelRatio || 1;\n }\n }]);\n return SmartCanvas;\n}();\n\nexports.default = SmartCanvas;\n\n\nSmartCanvas.Collection = [];\n\n/* istanbul ignore next: very browser-specific testing required to cover */\n//noinspection JSUnresolvedVariable\nif (window.matchMedia) {\n //noinspection JSUnresolvedFunction\n window.matchMedia('screen and (min-resolution: 2dppx)').addListener(SmartCanvas.redraw);\n}\n\nmodule.exports = SmartCanvas;\n\n},{\"./babelHelpers\":6}],6:[function(require,module,exports){\n(function (global){\n\"use strict\";\n\n/* istanbul ignore next */\n(typeof window === 'undefined' ? global : window).babelHelpers = {\n classCallCheck: function classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n },\n\n createClass: function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }(),\n\n extends: Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n }\n};\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],7:[function(require,module,exports){\n'use strict';\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},{}],8:[function(require,module,exports){\n(function (global){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = vendorize;\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 \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 \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\nmodule.exports = vendorize;\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}]},{},[6,3]);\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["gauge.min.js"],"names":["e","t","n","r","s","o","u","a","require","i","f","Error","code","l","exports","call","length","1","module","step","time","draw","start","rule","duration","end","anim","TypeError","progress","percent","frame","requestAnimationFrame","Object","defineProperty","value","vendorize","callback","setTimeout","Date","getTime","rules","linear","p","quad","Math","pow","dequad","quint","dequint","cycle","sin","acos","decycle","bounce","debounce","b","elastic","delastic","x","cos","PI","Animation","arguments","undefined","babelHelpers","classCallCheck","this","createClass","key","_this","window","performance","now","cancelAnimationFrame","id","default","./babelHelpers","./vendorize","2","toAttributeName","str","arr","split","toLowerCase","domReady","handler","addEventListener","attachEvent","DomObserver","options","element","type","Type","traverse","MutationObserver","observe","bind","document","body","childList","subtree","attributes","characterData","attributeOldValue","characterDataOldValue","node","tagName","getAttribute","elements","getElementsByTagName","isValidNode","process","records","record","attributeName","target","oldValue","addedNodes","ii","ss","prop","JSON","parse","stringify","hasOwnProperty","attributeValue","renderTo","test","3","formatMajorTickNumber","num","right","hasDec","majorTicksDec","round","toString","toFixed","majorTicksInt","indexOf","join","replace","radians","degrees","radialPoint","radius","angle","y","linearGradient","context","colorFrom","colorTo","grad","createLinearGradient","addColorStop","padValue","val","dec","valueDec","int","valueInt","strVal","parseFloat","abs","drawCircle","beginPath","arc","fillStyle","fill","maxRadius","max","borderShadowWidth","borderOuterWidth","borderMiddleWidth","borderInnerWidth","drawPlate","d0","r0","r1","r2","r3","save","glow","shadowBlur","shadowColor","colorBorderShadow","borders","borderOuter","colorBorderOuterStart","colorBorderOuterEnd","restore","borderMiddle","colorBorderMiddleStart","colorBorderMiddleEnd","borderInner","colorBorderInnerStart","colorBorderInnerEnd","colorPlate","drawHighlights","highlights","hlt","vd","maxValue","minValue","ticksAngle","sa","startAngle","from","ea","to","ps","pe","ps1","pe1","rotate","moveTo","lineTo","closePath","color","drawMinorTicks","lineWidth","SmartCanvas","pixelRatio","strokeStyle","colorMinorTicks","minorTicks","majorTicks","stroke","drawMajorTicks","colorMajorTicks","numberOfDefaultTicks","tickSize","push","strokeTicks","drawNumbers","points","point","font","colorNumbers","textAlign","fillText","drawTitle","title","colorTitle","drawUnits","units","colorUnits","drawNeedleShadow","needleShadow","shadowOffsetX","shadowOffsetY","colorNeedleShadowDown","drawNeedle","needle","needleCircleSize","rIn","needleEnd","rStart","needleStart","rOut","pad1","needleWidth","pad2","needleType","colorNeedleStart","colorNeedleEnd","colorNeedleShadowUp","needleCircle","needleCircleOuter","colorNeedleCircleOuterStart","colorNeedleCircleOuterEnd","needleCircleInner","colorNeedleCircleInnerStart","colorNeedleCircleInnerEnd","roundRect","w","h","quadraticCurveTo","drawValueBox","valueText","text","valueBox","th","tw","measureText","width","grd","createRadialGradient","colorValueBoxRectStart","colorValueBoxRectEnd","colorValueBoxShadow","colorValueBoxBackground","colorValueTextShadow","colorValueText","DomParser","SharedOptions","defaultOptions","assign","Gauge","Collection","parseInt","isNaN","Array","canvas","getElementById","height","onRedraw","animation","animationRule","animationDuration","drawX","drawY","drawWidth","drawHeight","elementClone","initialized","contextClone","clearRect","commit","drawImage","redraw","index","splice","destroy","set","fromValue","_value","animate","get","./Animation","./DomObserver","./SharedOptions","./SmartCanvas","./polyfill","4","updateValueOnAnimation","5","init","style","cloneNode","getContext","minSide","translate","scale","devicePixelRatio","matchMedia","addListener","6","global","instance","Constructor","defineProperties","props","descriptor","enumerable","configurable","writable","protoProps","staticProps","prototype","extends","source","self","7","firstSource","nextSource","keysArray","keys","nextIndex","len","nextKey","desc","getOwnPropertyDescriptor","searchElement","fromIndex","k","O","Infinity","8","vendors","capitalized","charAt","toUpperCase","substr","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IAAI9W,IAAKmX,GAAa,CAMtB,IAJIzU,KAAKsH,IAAIhK,KAAOsX,EAAAA,IAChBtX,EAAI,GAGJA,GAAK8W,EACL,OAAO,CAKX,KAFAM,EAAI1U,KAAK6H,IAAIvK,GAAK,EAAIA,EAAI8W,EAAMpU,KAAKsH,IAAIhK,GAAI,GAEtCoX,EAAIN,GAAK,CACZ,GAAIM,IAAKC,IAAKA,EAAED,KAAOF,EACnB,MAAOE,EAGXA,KAGJ,OAAO,SAITG,GAAG,SAASjX,EAAQU,EAAOJ,IACjC,SAAW6U,GACX,YAkDA,SAASxT,GAAUqF,EAAMsF,GAMrB,GAJKA,IACDA,EAAyB,mBAAXxI,QAAyBqR,EAASrR,QAG1B,mBAAfwI,GAAKtF,GACZ,MAAOsF,GAAKtF,EAQhB,KALA,GAAIkQ,IAAW,SAAU,MAAO,KAAM,KAClCjX,EAAI,EACJL,EAAIsX,EAAQ1W,OACZ2W,EAAcnQ,EAAKoQ,OAAO,GAAGC,cAAgBrQ,EAAKsQ,OAAO,GAEtDrX,EAAIL,EAAGK,IAAK,CACf,GAAIsX,GAAajL,EAAK4K,EAAQjX,GAAKkX,EAGnC,IAA0B,mBAAfI,GACP,MAAOA,GAIf,MAAO,MAxEX/V,OAAOC,eAAenB,EAAS,cAC3BoB,OAAO,IAEXpB,EAAQ6D,QAAUxC,EAwElBjB,EAAOJ,QAAUqB,IAEdpB,KAAKmD,KAAuB,mBAAXyR,QAAyBA,OAAyB,mBAATc,MAAuBA,KAAyB,mBAAXnS,QAAyBA,qBAChH,EAAE","file":"gauge.min.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o\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 */\nrequire('./babelHelpers');\n\nvar vendorize = require('./vendorize');\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 babelHelpers.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 babelHelpers.createClass(Animation, [{\n key: 'animate',\n value: function animate(draw, end) {\n var _this = this;\n\n //noinspection JSUnresolvedVariable\n var start = vendorize('animationStartTime') || window.performance && window.performance.now ? window.performance.now() : 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 return Animation;\n}();\n\n/**\n * Animation rules bound statically to Animation constructor.\n *\n * @type {AnimationRules}\n * @static\n */\n\n\nexports.default = Animation;\nAnimation.rules = rules;\n\nmodule.exports = Animation;\n\n},{\"./babelHelpers\":6,\"./vendorize\":8}],2:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 \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 */\nrequire('./babelHelpers');\n\n/**\n * @typedef {{ constructor: function(options: object): GaugeInterface, draw: function(): GaugeInterface }} GaugeInterface\n */\n\n/* istanbul ignore next: private, not testable */\n/**\n * Transforms camel case property name to dash separated attribute name\n *\n * @access private\n * @param {string} str\n * @returns {string}\n */\nfunction toAttributeName(str) {\n var arr = str.split(/(?=[A-Z])/);\n var i = 0;\n var s = arr.length;\n\n str = 'data';\n\n for (; i < s; i++) {\n str += '-' + arr[i].toLowerCase();\n }\n\n return str;\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Cross-browser DOM ready handler\n *\n * @access private\n * @param {Function} handler\n */\nfunction domReady(handler) {\n if (window.addEventListener) {\n window.addEventListener('DOMContentLoaded', handler, false);\n } else {\n window.attachEvent('onload', handler);\n }\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
\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 * //
\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 * @param {Function} Type\n */\n function DomObserver(options, element, type, Type) {\n var _this = this;\n\n babelHelpers.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 = type;\n\n /**\n * Actual type constructor to instantiate for each found element\n *\n * @type {Function}\n */\n this.Type = Type;\n\n /* istanbul ignore next: this should be tested with end-to-end tests */\n domReady(function () {\n _this.traverse();\n\n if (window.MutationObserver) {\n //noinspection JSCheckFunctionSignatures\n new 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 });\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 babelHelpers.createClass(DomObserver, [{\n key: 'isValidNode',\n value: function isValidNode(node) {\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 var node = elements[i];\n\n if (this.isValidNode(node)) {\n this.process(node);\n }\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 i = 0;\n var s = records.length;\n\n /* istanbul ignore next: this should be tested with end-to-end tests */\n for (; i < s; i++) {\n var record = records[i];\n\n if (record.type === 'attributes' && record.attributeName === 'data-type' && this.isValidNode(record.target) && record.oldValue !== this.type) // skip false-positive mutations\n {\n this.process(record.target);\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 var node = record.addedNodes[ii];\n\n if (this.isValidNode(node)) {\n this.process(node);\n }\n }\n }\n }\n }\n\n /**\n * Parses given attribute value to a proper javascript value\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}\n */\n value: function process(node) {\n var prop = void 0;\n var options = JSON.parse(JSON.stringify(this.options));\n\n for (prop in options) {\n /* istanbul ignore else: non-testable in most cases */\n if (options.hasOwnProperty(prop)) {\n var attributeName = 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\n return new this.Type(options).draw();\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 alphanum 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 return DomObserver;\n}();\n\nexports.default = DomObserver;\n\n\nmodule.exports = DomObserver;\n\n},{\"./babelHelpers\":6}],3:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 \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 * @authors: Mykhailo Stadnyk \n * Chris Poile \n * Luca Invernizzi \n * Rhys Lloyd \n * Robert Blackburn \n * Charles Galpin \n * Luca Ghio \n * Greg \n * David Esperalta \n * Gwenaël (https://thegtricks.thegounet.fr)\n * migeruhito (https://github.com/migeruhito)\n */\nrequire('./polyfill');\nrequire('./babelHelpers');\n\nvar Animation = require('./Animation');\nvar SmartCanvas = require('./SmartCanvas');\nvar DomParser = require('./DomObserver');\nvar SharedOptions = require('./SharedOptions');\n\n// todo: customizable fonts\n// todo: readme and documentation update\n// todo: github pages\n// todo: wiki\n// todo: LinearGauge implementation\n// todo: online configurator\n// todo: online packager\n// todo: e2e tests\n// todo: optimize build process (glue and minify without babel and browserify)\n// todo: angular 2 integration\n// todo: react integrations\n// todo: typescript definitions\n\n/**\n * Gauge configuration options\n *\n * @typedef {{renderTo: RenderTarget, width: number, height: number, title: string|boolean, maxValue: number, minValue: number, value: number, majorTicks: Array, minorTicks: number, ticksAngle: number, startAngle: number, strokeTicks: boolean, units: string|boolean, updateValueOnAnimation: boolean, glow: boolean, valueInt: number, valueDec: number, majorTicksInt: number, majorTicksDec: number, animation: boolean, animationDuration: number, animationRule: AnimationRule, colorPlate: string, colorMajorTicks: string, colorMinorTicks: string, colorTitle: string, colorUnits: string, colorNumbers: string, colorNeedleStart: string, colorNeedleEnd: string, colorNeedleCircleOuterStart: string, colorNeedleCircleOuterEnd: string, colorNeedleCircleInnerStart: string, colorNeedleCircleInnerEnd: string, colorNeedleShadowUp: string, colorNeedleShadowDown: string, colorValueBoxRectStart: string, colorValueBoxRectEnd: string, colorValueBoxBackground: string, colorValueBoxShadow: string, colorValueText: string, colorValueTextShadow: string, colorBorderShadow: string, colorBorderOuterStart: string, colorBorderOuterEnd: string, colorBorderMiddleStart: string, colorBorderMiddleEnd: string, colorBorderInnerStart: string, colorBorderInnerEnd: string, needle: boolean, needleShadow: boolean, needleType: string, needleStart: number, needleEnd: number, needleWidth: number, needleCircle: boolean, needleCircleSize: number, needleCircleInner: boolean, needleCircleOuter: boolean, borders: boolean, borderOuter: boolean, borderOuterWidth: number, borderMiddle: boolean, borderMiddleWidth: number, borderInner: boolean, borderInnerWidth: number, borderShadowWidth: number, valueBox: boolean, valueText: boolean, highlights: Highlight[]}} GaugeOptions\n */\n\n/**\n * @access private\n * @typedef {CanvasRenderingContext2D|{max: number, maxRadius: number}} Canvas2DContext\n */\n\n//noinspection JSValidateTypes\n/**\n * Default gauge configuration options\n *\n * @access private\n * @type {GaugeOptions}\n */\nvar defaultOptions = Object.assign({}, SharedOptions, {\n // basic options\n ticksAngle: 270,\n startAngle: 45,\n\n // colors\n colorNeedleCircleOuterStart: '#f0f0f0',\n colorNeedleCircleOuterEnd: '#ccc',\n colorNeedleCircleInnerStart: '#e8e8e8',\n colorNeedleCircleInnerEnd: '#f5f5f5',\n colorNeedleShadowUp: 'rgba(2,255,255,0.2)',\n colorNeedleShadowDown: 'rgba(188,143,143,0.45)',\n colorValueBoxRectStart: '#888',\n colorValueBoxRectEnd: '#666',\n colorValueBoxBackground: '#babab2',\n colorValueBoxShadow: 'rgba(0,0,0,1)',\n\n // needle\n needleStart: 0,\n needleEnd: 85,\n needleWidth: 4,\n needleCircle: true,\n needleCircleSize: 10,\n needleCircleInner: true,\n needleCircleOuter: true\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 * @access private\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 * @access private\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 * @access private\n * @param {Canvas2DContext} context\n * @param {string} colorFrom\n * @param {string} colorTo\n * @param {number} length\n * @returns {CanvasGradient}\n */\nfunction linearGradient(context, colorFrom, colorTo, length) {\n var grad = context.createLinearGradient(0, 0, 0, length);\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 * Pads a given value with leading zeros using the given options\n *\n * @access private\n * @param {number} val\n * @param {{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 * 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 drawCircle(radius, context, start, end) {\n context.beginPath();\n context.arc(0, 0, radius, 0, Math.PI * 2, true);\n context.fillStyle = linearGradient(context, start, end, radius);\n context.fill();\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 {GaugeOptions} options\n * @return {number}\n */\nfunction maxRadius(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 {GaugeOptions} options\n */\nfunction drawPlate(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 = maxRadius(context, options);\n\n context.save();\n\n if (options.glow) {\n context.shadowBlur = d0;\n context.shadowColor = options.colorBorderShadow;\n }\n\n if (options.borders) {\n if (options.borderOuter) {\n drawCircle(r0, context, options.colorBorderOuterStart, options.colorBorderOuterEnd);\n }\n\n context.restore();\n\n if (options.borderMiddle) {\n drawCircle(r1, context, options.colorBorderMiddleStart, options.colorBorderMiddleEnd);\n }\n\n if (options.borderInner) {\n drawCircle(r2, context, options.colorBorderInnerStart, options.colorBorderInnerEnd);\n }\n }\n\n context.beginPath();\n context.arc(0, 0, r3, 0, Math.PI * 2, true);\n context.fillStyle = options.colorPlate;\n context.fill();\n\n context.save();\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 {GaugeOptions} options\n */\nfunction drawHighlights(context, options) {\n context.save();\n\n var r1 = maxRadius(context, options) - context.max * .05;\n var r2 = 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 = radians(options.startAngle + (hlt.from - options.minValue) / vd);\n var ea = radians(options.startAngle + (hlt.to - options.minValue) / vd);\n var ps = radialPoint(r2, sa);\n var pe = radialPoint(r1, sa);\n var ps1 = radialPoint(r1, ea);\n var pe1 = radialPoint(r2, ea);\n\n context.beginPath();\n context.rotate(radians(90));\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(radians(90));\n context.arc(0, 0, r2, sa - 0.2, ea + 0.2, false);\n context.restore();\n\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 {GaugeOptions} options\n */\nfunction drawMinorTicks(context, options) {\n var radius = maxRadius(context, options) - context.max * .05;\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(radians(angle));\n\n context.beginPath();\n context.moveTo(0, radius);\n context.lineTo(0, radius - context.max * .075);\n context.stroke();\n\n context.restore();\n context.save();\n }\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 {GaugeOptions} options\n */\nfunction drawMajorTicks(context, options) {\n var r = maxRadius(context, options) - context.max * .05;\n var i = 0;\n var s = options.majorTicks.length;\n var pixelRatio = SmartCanvas.pixelRatio;\n\n context.lineWidth = 2 * pixelRatio;\n context.strokeStyle = options.colorMajorTicks;\n context.save();\n\n if (s === 0) {\n var numberOfDefaultTicks = 5;\n var tickSize = (options.maxValue - options.minValue) / numberOfDefaultTicks;\n\n for (; i < numberOfDefaultTicks; i++) {\n options.majorTicks.push(formatMajorTickNumber(options.minValue + tickSize * i, options));\n }\n options.majorTicks.push(formatMajorTickNumber(options.maxValue, options));\n }\n\n i = 0;\n for (; i < s; ++i) {\n var a = options.startAngle + i * (options.ticksAngle / (s - 1));\n context.rotate(radians(a));\n\n context.beginPath();\n context.moveTo(0, r);\n context.lineTo(0, r - context.max * .15);\n context.stroke();\n\n context.restore();\n context.save();\n }\n\n if (options.strokeTicks) {\n context.rotate(radians(90));\n\n context.beginPath();\n context.arc(0, 0, r, radians(options.startAngle), radians(options.startAngle + options.ticksAngle), false);\n context.stroke();\n context.restore();\n\n context.save();\n }\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 {GaugeOptions} options\n */\nfunction drawNumbers(context, options) {\n var radius = maxRadius(context, options) - context.max * .35;\n var points = {};\n var i = 0;\n var s = options.majorTicks.length;\n\n for (; i < s; ++i) {\n var angle = options.startAngle + i * (options.ticksAngle / (s - 1));\n var point = radialPoint(radius, 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 = 20 * (context.max / 200) + 'px Arial';\n context.fillStyle = options.colorNumbers;\n context.lineWidth = 0;\n context.textAlign = 'center';\n context.fillText(options.majorTicks[i], point.x, point.y + 3);\n }\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws gauge title\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {GaugeOptions} options\n */\nfunction drawTitle(context, options) {\n if (!options.title) return;\n\n context.save();\n context.font = 24 * (context.max / 200) + 'px Arial';\n context.fillStyle = options.colorTitle;\n context.textAlign = 'center';\n context.fillText(options.title, 0, -context.max / 4.25);\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 {GaugeOptions} options\n */\nfunction drawUnits(context, options) {\n if (!options.units) return;\n\n context.save();\n context.font = 22 * (context.max / 200) + 'px Arial';\n context.fillStyle = options.colorUnits;\n context.textAlign = 'center';\n context.fillText(options.units, 0, context.max / 3.25);\n context.restore();\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 {GaugeOptions} 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 gauge needle\n *\n * @access private\n * @param {Canvas2DContext} context\n * @param {GaugeOptions} options\n */\nfunction drawNeedle(context, options) {\n if (!options.needle) return;\n\n var value = options.value;\n var max = maxRadius(context, options);\n var r1 = max / 100 * options.needleCircleSize;\n var r2 = max / 100 * options.needleCircleSize * 0.75;\n var rIn = max / 100 * options.needleEnd;\n var rStart = options.needleStart ? max / 100 * options.needleStart : 0,\n rOut = max * .2;\n var pad1 = max / 100 * options.needleWidth;\n var pad2 = max / 100 * options.needleWidth / 2;\n var pixelRatio = SmartCanvas.pixelRatio;\n\n drawNeedleShadow(context, options);\n\n context.save();\n\n context.rotate(radians(options.startAngle + (value - options.minValue) / (options.maxValue - options.minValue) * options.ticksAngle));\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\n context.fillStyle = linearGradient(context, options.colorNeedleStart, options.colorNeedleEnd, rIn - rOut);\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\n context.fillStyle = linearGradient(context, options.colorNeedleStart, options.colorNeedleEnd, rIn - rOut);\n context.fill();\n }\n\n context.restore();\n\n if (options.needleCircle) {\n drawNeedleShadow(context, options);\n\n if (options.needleCircleOuter) {\n context.beginPath();\n context.arc(0, 0, r1, 0, Math.PI * 2, true);\n context.fillStyle = linearGradient(context, options.colorNeedleCircleOuterStart, options.colorNeedleCircleOuterEnd, r1);\n context.fill();\n context.restore();\n }\n\n if (options.needleCircleInner) {\n context.beginPath();\n context.arc(0, 0, r2, 0, Math.PI * 2, true);\n context.fillStyle = linearGradient(context, options.colorNeedleCircleInnerStart, options.colorNeedleCircleInnerEnd, r2);\n context.fill();\n }\n }\n}\n\n/* istanbul ignore next: private, not testable */\n/**\n * Draws rounded corners rectangle\n *\n * @access private\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 * Draws gauge value box\n *\n * @param {Canvas2DContext} context\n * @param {GaugeOptions} options\n * @param {number} value\n */\nfunction drawValueBox(context, options, value) {\n if (!options.valueText) return;\n\n var max = context.max;\n var text = padValue(value, options);\n var y = max - max * .33;\n var x = 0;\n\n context.save();\n context.font = 40 * (max / 200) + 'px Led';\n context.save();\n\n if (options.valueBox) {\n var th = 0.12 * max;\n var tw = context.measureText('-' + padValue(0, options)).width;\n\n roundRect(context, -tw / 2 - 0.025 * max, y - th - 0.04 * max, tw + 0.05 * max, th + 0.07 * max, 0.025 * max);\n }\n\n var grd = context.createRadialGradient(x, y - 0.12 * max - 0.025 * max + (0.12 * max + 0.045 * max) / 2, max / 10, x, y - 0.12 * max - 0.025 * max + (0.12 * max + 0.045 * max) / 2, max / 5);\n\n grd.addColorStop(0, options.colorValueBoxRectStart);\n grd.addColorStop(1, options.colorValueBoxRectEnd);\n\n context.strokeStyle = grd;\n context.lineWidth = 0.05 * max;\n context.stroke();\n\n context.shadowBlur = 0.012 * max;\n context.shadowColor = options.colorValueBoxShadow;\n\n context.fillStyle = options.colorValueBoxBackground;\n context.fill();\n\n context.restore();\n\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 context.fillStyle = options.colorValueText;\n context.textAlign = 'center';\n context.fillText(text, -x, y);\n\n context.restore();\n}\n\n/**\n * Minimalistic HTML5 Canvas Gauge\n * @example\n * var gauge = new Gauge({\n * renderTo: 'gauge',\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 Gauge = function () {\n\n /**\n * @constructor\n * @param {GaugeOptions} options\n */\n function Gauge(options) {\n babelHelpers.classCallCheck(this, Gauge);\n\n Gauge.Collection.push(this);\n\n options = Object.assign({}, defaultOptions, options || {});\n\n options.startAngle = parseInt(options.startAngle, 10);\n options.ticksAngle = parseInt(options.ticksAngle, 10);\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 options.minValue = parseFloat(options.minValue);\n options.maxValue = parseFloat(options.maxValue);\n\n /* istanbul ignore if */\n if (!(options.highlights instanceof Array)) {\n options.highlights = [];\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 //noinspection JSUnresolvedVariable\n /**\n * @property {GaugeOptions} Gauge.options\n */\n this.options = options;\n\n /**\n * @property {SmartCanvas} Gauge.canvas\n */\n this.canvas = new SmartCanvas(canvas, options.width, options.height);\n this.canvas.onRedraw = this.draw.bind(this);\n\n /**\n * @property {Animation} Gauge.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 babelHelpers.createClass(Gauge, [{\n key: 'draw',\n\n\n /**\n * Triggering gauge render on a canvas.\n *\n * @returns {Gauge}\n */\n value: function draw() {\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 drawPlate(context, options);\n drawHighlights(context, options);\n drawMinorTicks(context, options);\n drawMajorTicks(context, options);\n drawNumbers(context, options);\n drawTitle(context, options);\n drawUnits(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 drawValueBox(canvas.context, options, this.value);\n drawNeedle(canvas.context, options);\n\n return this;\n }\n\n /**\n * Updates gauge configuration options at runtime and redraws the gauge\n *\n * @param {GaugeOptions} options\n * @returns {Gauge}\n */\n\n }, {\n key: 'update',\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 = Gauge.Collection.indexOf(this);\n\n /* istanbul ignore else */\n if (~index) {\n Gauge.Collection.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 key: 'value',\n set: function set(value) {\n var _this = this;\n\n if (value === this.options.value) return;\n\n if (this.options.animation) {\n (function () {\n var fromValue = _this.options.value;\n\n /**\n * @type {number}\n * @access private\n */\n _this._value = value;\n\n _this.animation.animate(function (percent) {\n _this.options.value = fromValue + (value - fromValue) * percent;\n\n _this.draw();\n }, function () {\n _this.options.value = value;\n delete _this._value;\n _this.draw();\n });\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 return Gauge;\n}();\n\nexports.default = Gauge;\n\n\nGauge.Collection = [];\nGauge.Collection.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\nnew DomParser(defaultOptions, 'canvas', 'gauge', Gauge);\n\nmodule.exports = window['Gauge'] = Gauge;\n\n},{\"./Animation\":1,\"./DomObserver\":2,\"./SharedOptions\":4,\"./SmartCanvas\":5,\"./babelHelpers\":6,\"./polyfill\":7}],4:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 \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\nvar SharedOptions = {\n // basic options\n renderTo: null,\n width: 200,\n height: 200,\n minValue: 0,\n maxValue: 100,\n value: 0,\n units: false,\n majorTicks: [],\n minorTicks: 10,\n strokeTicks: true,\n updateValueOnAnimation: false,\n glow: true,\n title: false,\n\n // number formats\n valueInt: 3,\n valueDec: 2,\n majorTicksInt: 1,\n majorTicksDec: 0,\n\n // animations\n animation: true,\n animationDuration: 250,\n animationRule: 'cycle',\n\n // colors\n colorPlate: '#fff',\n colorMajorTicks: '#444',\n colorMinorTicks: '#666',\n colorTitle: '#888',\n colorUnits: '#888',\n colorNumbers: '#444',\n colorNeedleStart: '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 colorBorderOuterStart: '#ddd',\n colorBorderOuterEnd: '#aaa',\n colorBorderMiddleStart: '#eee',\n colorBorderMiddleEnd: '#f0f0f0',\n colorBorderInnerStart: '#fafafa',\n colorBorderInnerEnd: '#ccc',\n\n // needle\n needle: true,\n needleShadow: true,\n needleType: 'arrow',\n\n // borders\n borders: true,\n borderOuter: true,\n borderOuterWidth: 3,\n borderMiddle: true,\n borderMiddleWidth: 3,\n borderInner: true,\n borderInnerWidth: 3,\n borderShadowWidth: 3,\n\n // value and highlights\n valueBox: true,\n valueText: true,\n highlights: [{ from: 20, to: 60, color: '#eee' }, { from: 60, to: 80, color: '#ccc' }, { from: 80, to: 100, color: '#999' }]\n};\n\nexports.default = SharedOptions;\n\n\nmodule.exports = SharedOptions;\n\n},{}],5:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 \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 */\nrequire('./babelHelpers');\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\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 babelHelpers.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 babelHelpers.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 // derefecence 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 this.contextClone.scale(scale, scale);\n this.contextClone.save();\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 window.devicePixelRatio || 1;\n }\n }]);\n return SmartCanvas;\n}();\n\nexports.default = SmartCanvas;\n\n\nSmartCanvas.Collection = [];\n\n/* istanbul ignore next: very browser-specific testing required to cover */\n//noinspection JSUnresolvedVariable\nif (window.matchMedia) {\n //noinspection JSUnresolvedFunction\n window.matchMedia('screen and (min-resolution: 2dppx)').addListener(SmartCanvas.redraw);\n}\n\nmodule.exports = SmartCanvas;\n\n},{\"./babelHelpers\":6}],6:[function(require,module,exports){\n(function (global){\n\"use strict\";\n\n/* istanbul ignore next */\n(typeof window === 'undefined' ? global : window).babelHelpers = {\n classCallCheck: function classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n },\n\n createClass: function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }(),\n\n extends: Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n }\n};\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],7:[function(require,module,exports){\n'use strict';\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},{}],8:[function(require,module,exports){\n(function (global){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = vendorize;\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 \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 \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\nmodule.exports = vendorize;\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}]},{},[6,3]);\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index bf14861b..f3b07a2d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -23,6 +23,9 @@ const gutil = require('gulp-util'); const chalk = require('chalk'); const http = require('https'); const fs = require('fs'); +const selenium = require('selenium-standalone'); +const mocha = require('gulp-mocha'); +const cp = require('child_process'); /** * Displays this usage information. @@ -123,7 +126,7 @@ gulp.task('gzip', ['build'], () => { }); /** - * Performs JavaScript syntax linting checks. + * Performs JavaScript syntax check. * * @task {lint} */ @@ -147,7 +150,7 @@ gulp.task('lint', () => { * * @task {test:spec} */ -gulp.task('test:spec', ['lint'], done => { +gulp.task('test:spec', done => { console.log(chalk.bold.green('Starting unit tests...')); let server = new KarmaServer({ @@ -167,9 +170,9 @@ gulp.task('test:spec', ['lint'], done => { '(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?' + '[0-9A-ORZcf-nqry=><]', 'g'); let coverage = fs.readFileSync( - './coverage/report/coverage.txt', - { encoding: 'utf8' } - ) + './coverage/report/coverage.txt', + { encoding: 'utf8' } + ) .replace(rx, '') .split(/\r?\n/)[2] .split(':')[1] @@ -203,6 +206,27 @@ gulp.task('test:spec', ['lint'], done => { }).start(); }); +/** + * Installs and starts selenium server + * + * @task {selenium} + */ +gulp.task('selenium', done => { + cp.execSync('pkill -f selenium-standalone'); + + selenium.install({ logger: gutil.log }, err => { + if (err) return done(err); + + selenium.start((err, child) => { + if (err) return done(err); + + selenium.child = child; + + done(); + }); + }); +}); + /** * Runs end-to-end tests. * @@ -219,16 +243,24 @@ gulp.task('test:spec', ['lint'], done => { * drawing, most probably expected pixels won't match the expected specs, * so we can automatically figure something is broken. */ -gulp.task('test:e2e', () => { +gulp.task('test:e2e', ['selenium'], done => { console.log(chalk.bold.green('\nStarting end-to-end tests...\n')); - return gulp.src('wdio.conf.js') - .pipe(wdio({ type: 'selenium' })) - .once('error', () => process.exit(1)); + gulp.src(['test/e2e/**/*.e2e.js']) + .pipe(mocha({ reporter: 'spec' })) + .once('error', err => { + console.error(err); + cp.execSync('pkill -f selenium-standalone'); + process.exit(1); + }) + .once('end', () => { + cp.execSync('pkill -f selenium-standalone'); + done(); + }); }); /** - * Runs all tests including end-to-end tests as well. + * Runs all tests and checks. * * @task {test} */ diff --git a/lib/Gauge.js b/lib/Gauge.js index f9907f1d..133c6afd 100644 --- a/lib/Gauge.js +++ b/lib/Gauge.js @@ -52,7 +52,7 @@ const SharedOptions = require('./SharedOptions'); // todo: online configurator // todo: online packager // todo: e2e tests -// todo: optimize build process (glueand minify without babel and browserify) +// todo: optimize build process (glue and minify without babel and browserify) // todo: angular 2 integration // todo: react integrations // todo: typescript definitions diff --git a/package.json b/package.json index 7b056ab1..b90c7fdb 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,6 @@ "babel-cli": "^6.11.4", "babel-plugin-external-helpers-2": "^6.3.13", "babel-plugin-transform-object-assign": "^6.8.0", - "babel-plugin-transform-runtime": "^6.12.0", "babel-preset-es2015": "^6.13.2", "babelify": "^7.3.0", "brfs": "^1.4.3", @@ -89,6 +88,7 @@ "gulp-eslint": "^3.0.1", "gulp-gzip": "^1.4.0", "gulp-help-doc": "^1.0.4", + "gulp-mocha": "^3.0.1", "gulp-rename": "^1.2.2", "gulp-sourcemaps": "^1.6.0", "gulp-uglify": "^2.0.0", @@ -107,12 +107,12 @@ "karma-threshold-reporter": "^0.1.15", "mocha": "^3.0.2", "rimraf": "^2.5.4", + "selenium-standalone": "^5.5.0", "sinon": "^1.17.5", "utils-merge": "^1.0.0", "vinyl-buffer": "^1.0.0", "vinyl-source-stream": "^1.1.0", "watchify": "^3.7.0", - "wdio-mocha-framework": "^0.4.0", - "wdio-spec-reporter": "0.0.3" + "webdriverio": "^4.2.7" } } diff --git a/test/e2e/gauges.e2e.js b/test/e2e/gauges.e2e.js new file mode 100644 index 00000000..c3700da5 --- /dev/null +++ b/test/e2e/gauges.e2e.js @@ -0,0 +1,38 @@ +const expect = require('chai').expect; +const webdriver = require('webdriverio'); +const fs = require('fs'); +const chalk = require('chalk'); +const TIMEOUT = 90000; + +describe('Gauges UI', function() { + this.timeout(TIMEOUT); + + let client; + let url = 'file://' + fs.realpathSync('.') + '/test/gauges.html'; + + console.log(chalk.cyan(' Loading UI from "' + url + '"')); + + before(() => { + client = webdriver.remote({ + desiredCapabilities: { browserName: 'chrome' }}); + + return client.init(); + }); + + it('checking gauges ui', done => { + client + .url(url) + .execute(function () { + return document.title; + }) + .then(result => { + // console.log(result.value); + expect(result.value).to.be.a('string'); + done(); + }); + }); + + after(() => { + return client.end(); + }); +}); diff --git a/test/e2e/pageobject/gauges.page.js b/test/e2e/pageobject/gauges.page.js deleted file mode 100644 index 339c51df..00000000 --- a/test/e2e/pageobject/gauges.page.js +++ /dev/null @@ -1,29 +0,0 @@ -const page = require('./page'); - -const gaugesPage = Object.create(page, { - /** - * define elements - */ - customGauge: { - get() { - return browser.elements('canvas:first-child'); - } - }, - - defaultGauge: { - get() { - return browser.elements('canvas:last-child'); - } - }, - - /** - * define or overwrite page methods - */ - open: { - value: function() { - page.open.call(this, 'gauges'); - } - } -}); - -module.exports = gaugesPage; diff --git a/test/e2e/pageobject/page.js b/test/e2e/pageobject/page.js deleted file mode 100644 index fe79a572..00000000 --- a/test/e2e/pageobject/page.js +++ /dev/null @@ -1,7 +0,0 @@ -class Page { - open(path) { - browser.url('/' + path); - } -} - -module.exports = new Page(); diff --git a/test/e2e/spec/gauges.spec.js b/test/e2e/spec/gauges.spec.js deleted file mode 100644 index 6e33b3b5..00000000 --- a/test/e2e/spec/gauges.spec.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('chai').expect; -const GaugesPage = require('../pageobject/gauges.page'); - -describe('gauges', () => { - it('gauge canvases should be present on a page', () => { - GaugesPage.open(); - expect(GaugesPage.customGauge.state).equals('success'); - expect(GaugesPage.defaultGauge.state).equals('success'); - }); -}); diff --git a/wdio.conf.js b/wdio.conf.js deleted file mode 100644 index f703ee35..00000000 --- a/wdio.conf.js +++ /dev/null @@ -1,25 +0,0 @@ -exports.config = { - specs: [ - './test/e2e/spec/**/*.js' - ], - exclude: [], - maxInstances: 10, - capabilities: [{ browserName: 'chrome' }], - sync: true, - logLevel: 'error', - coloredLogs: true, - screenshotPath: './errorShots/', - baseUrl: 'file://' + __dirname + '/test', - waitforTimeout: 10000, - connectionRetryTimeout: 90000, - connectionRetryCount: 3, - framework: 'mocha', - mochaOpts: { - ui: 'bdd' - }, - reporters: ['spec'] -}; - -if (process.env.TRAVIS) { - exports.config.capabilities = [{ browserName: 'firefox' }]; -}