{"version":3,"sources":["kendo.dataviz.gauge.js"],"names":["f","define","$","objectKey","object","key","parts","push","sort","join","hashKey","str","i","hash","length","charCodeAt","zeroSize","width","height","baseline","measureText","text","style","measureBox","TextMetrics","current","measure","LRUCache","DEFAULT_OPTIONS","defaultMeasureBox","window","kendo","util","Class","extend","init","size","this","_size","_length","_map","put","value","map","entry","_head","_tail","newer","older","get","baselineMarkerSize","document","createElement","cssText","options","_cache","box","styleKey","cacheKey","cachedResult","baselineMarker","_baselineMarker","cloneNode","textContent","appendChild","body","String","offsetWidth","offsetHeight","offsetTop","parentNode","removeChild","marker","deepExtend","jQuery","amd","a1","a2","a3","undefined","_buildLabel","label","labelBox","textBox","children","border","background","elements","Group","wrapper","Path","fromRect","Rect","x1","y1","stroke","Text","Point","font","fill","color","styleGeometry","_pad","bbox","clone","padding","styleBox","dashType","lineJoin","lineCap","append","getRange","range","min","max","from","defined","MIN_VALUE","to","MAX_VALUE","math","origin","getOrigin","getSize","spacing","getSpacing","setOrigin","x","left","y","top","setSize","right","bottom","_unpad","ArrowLinearPointerAnimation","BarLinearPointerAnimation","Math","Widget","ui","dataviz","autoMajorUnit","ChartElement","NumericAxis","Axis","Box2D","isNumber","interpolateValue","round","geo","geometry","draw","drawing","ANGULAR_SPEED","LINEAR_SPEED","ARROW","ARROW_POINTER","BAR_POINTER","BLACK","CAP_SIZE","COORD_PRECISION","Number","DEFAULT_HEIGHT","DEFAULT_LINE_WIDTH","DEFAULT_WIDTH","DEFAULT_MIN_WIDTH","DEFAULT_MIN_HEIGHT","DEFAULT_MARGIN","DEGREE","PI","GEO_ARC_ADJUST_ANGLE","INSIDE","LINEAR","NEEDLE","OUTSIDE","RADIAL_POINTER","X","Y","Pointer","scale","pointer","scaleOptions","fn","call","newValue","that","arguments","_oldValue","repaint","RadialPointer","shape","cap","arrow","animation","type","duration","setRadius","radius","clear","render","parent","center","setAngle","angle","transform","rotate","oldAngle","slotAngle","newAngle","transitions","RadialPointerAnimation","play","arc","startAngle","reverse","_renderNeedle","_renderCap","_renderArrow","reflow","getRadiusX","capSize","fromPoints","minorTickSize","minorTicks","needleColor","needlePath","moveTo","lineTo","close","capColor","circle","Circle","RadialScale","majorUnit","minorUnit","majorTicks","align","visible","endAngle","labels","position","renderArc","labelElements","renderLabels","ticks","renderTicks","ranges","renderRanges","repositionRanges","result","halfWidth","halfHeight","labelAngle","lp","cx","cy","isInside","lbl","labelPos","prevLabelPos","labelTransform","majorTickSize","tickAngles","count","labelsOptions","rangeDistance","rangeSize","labelsGroup","setRadiusX","setRadiusY","pointAt","cos","sin","translate","union","rangeRadius","newRadius","getRangeRadius","_geometry","segment","rangeGeom","segments","rangeSegments","segmentsCount","Arc","radiusX","radiusY","opacity","rangeSegment","j","gauge","defaultColor","rangePlaceholderColor","r","drawTicks","unit","tickOptions","tickStart","tickEnd","labelsPosition","allTicks","tickArc","majorTickAngles","_tickDifference","minorTickAngles","normalizeTickAngles","angles","skip","splice","ring","stepValue","pos","tickCount","step","positions","repositionTicks","minor","newPoint","xDiff","yDiff","diff","anchor","Transformation","Gauge","element","userOptions","themeOptions","themeName","theme","themes","destroy","empty","_originalOptions","toLowerCase","isArray","addClass","surface","_createSurface","redraw","plotArea","renderAs","gaugeArea","pointers","_setValueOptions","_draw","_visuals","exportVisual","allValues","values","concat","_resize","t","_getSize","_createGaugeArea","css","_createModel","_gaugeAreaMargin","areaGeometry","margin","wrap","appendTo","Surface","create","RadialGauge","radialGauge","notify","name","_initialPlotArea","fitScale","alignScale","_buildVisual","visuals","minDiff","midDiff","maxDiff","mid","oldDiff","plotAreaBox","abs","getDiff","staleFlag","getPlotBox","plotBbox","plotBox","plotBoxCenter","boxCenter","paddingX","paddingY","LinearGauge","linearGauge","vertical","bboxX","bboxY","bbox2D","_getBox","_alignElements","_shrinkElements","scaleElements","currentOptions","LinearScale","ArrowLinearPointer","BarLinearPointer","y2","x2","scaleBox","pointerBox","mirror","line","_alignLines","scaleLine","renderLine","scaleTicks","slot","slotX","slotY","getSlot","lineBox","linePath","tickPositions","skipUnit","tickLineOptions","tickX","tickY","renderAxisTick","getMajorTickPositions","getMinorTickPositions","start","end","tickPath","LinearPointer","track","pointerRangeBox","trackBox","trackSize","pointerHalfSize","space","pad","getElementOptions","_margin","pointerShape","halfSize","sign","setup","elementOptions","p2","p3","p4","dir","minSlot","axis","sizeAxis","p1","pointerPath","oldShape","oldPoints","newPoints","group","Animation","easing","anim","AnimationFactory","register","fromScale","toScale","distanceTo","translateX","translateY","speed","_set","setter","toUpperCase","points","plugin","ExportMixin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,qBAAsB,cAAeD,IAC9C,YACG,SAAUE,GAmDP,QAASC,GAAUC,GAAnB,GAEaC,GADLC,IACJ,KAASD,IAAOD,GACZE,EAAMC,KAAKF,EAAMD,EAAOC,GAE5B,OAAOC,GAAME,OAAOC,KAAK,IAE7B,QAASC,GAAQC,GAAjB,GAEaC,GADLC,EAAO,UACX,KAASD,EAAI,EAAGA,EAAID,EAAIG,SAAUF,EAC9BC,IAASA,GAAQ,IAAMA,GAAQ,IAAMA,GAAQ,IAAMA,GAAQ,IAAMA,GAAQ,IACzEA,GAAQF,EAAII,WAAWH,EAE3B,OAAOC,KAAS,EAEpB,QAASG,KACL,OACIC,MAAO,EACPC,OAAQ,EACRC,SAAU,GAsDlB,QAASC,GAAYC,EAAMC,EAAOC,GAC9B,MAAOC,GAAYC,QAAQC,QAAQL,EAAMC,EAAOC,GA7HvD,GAEOI,GAuEAC,EACAC,EAKAL,CA9EJM,QAAOC,MAAMC,KAAOF,OAAOC,MAAMC,SAC7BL,EAAWI,MAAME,MAAMC,QACvBC,KAAM,SAAUC,GACZC,KAAKC,MAAQF,EACbC,KAAKE,QAAU,EACfF,KAAKG,SAETC,IAAK,SAAUpC,EAAKqC,GAAf,GACGC,GAAMN,KAAKG,KACXI,GACAvC,IAAKA,EACLqC,MAAOA,EAEXC,GAAItC,GAAOuC,EACNP,K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\n \n \n \n \n \n \n\n*/\n(function (f, define) {\n define('util/text-metrics', ['kendo.core'], f);\n}(function () {\n (function ($) {\n window.kendo.util = window.kendo.util || {};\n var LRUCache = kendo.Class.extend({\n init: function (size) {\n this._size = size;\n this._length = 0;\n this._map = {};\n },\n put: function (key, value) {\n var map = this._map;\n var entry = {\n key: key,\n value: value\n };\n map[key] = entry;\n if (!this._head) {\n this._head = this._tail = entry;\n } else {\n this._tail.newer = entry;\n entry.older = this._tail;\n this._tail = entry;\n }\n if (this._length >= this._size) {\n map[this._head.key] = null;\n this._head = this._head.newer;\n this._head.older = null;\n } else {\n this._length++;\n }\n },\n get: function (key) {\n var entry = this._map[key];\n if (entry) {\n if (entry === this._head && entry !== this._tail) {\n this._head = entry.newer;\n this._head.older = null;\n }\n if (entry !== this._tail) {\n if (entry.older) {\n entry.older.newer = entry.newer;\n entry.newer.older = entry.older;\n }\n entry.older = this._tail;\n entry.newer = null;\n this._tail.newer = entry;\n this._tail = entry;\n }\n return entry.value;\n }\n }\n });\n function objectKey(object) {\n var parts = [];\n for (var key in object) {\n parts.push(key + object[key]);\n }\n return parts.sort().join('');\n }\n function hashKey(str) {\n var hash = 2166136261;\n for (var i = 0; i < str.length; ++i) {\n hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);\n hash ^= str.charCodeAt(i);\n }\n return hash >>> 0;\n }\n function zeroSize() {\n return {\n width: 0,\n height: 0,\n baseline: 0\n };\n }\n var DEFAULT_OPTIONS = { baselineMarkerSize: 1 };\n var defaultMeasureBox;\n if (typeof document !== 'undefined') {\n defaultMeasureBox = document.createElement('div');\n defaultMeasureBox.style.cssText = 'position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;' + 'padding: 0 !important; margin: 0 !important; border: 0 !important;' + 'line-height: normal !important; visibility: hidden !important; white-space: nowrap!important;';\n }\n var TextMetrics = kendo.Class.extend({\n init: function (options) {\n this._cache = new LRUCache(1000);\n this.options = $.extend({}, DEFAULT_OPTIONS, options);\n },\n measure: function (text, style, box) {\n if (!text) {\n return zeroSize();\n }\n var styleKey = objectKey(style);\n var cacheKey = hashKey(text + styleKey);\n var cachedResult = this._cache.get(cacheKey);\n if (cachedResult) {\n return cachedResult;\n }\n var size = zeroSize();\n var measureBox = box || defaultMeasureBox;\n var baselineMarker = this._baselineMarker().cloneNode(false);\n for (var key in style) {\n var value = style[key];\n if (typeof value !== 'undefined') {\n measureBox.style[key] = value;\n }\n }\n measureBox.textContent = text;\n measureBox.appendChild(baselineMarker);\n document.body.appendChild(measureBox);\n if (String(text).length) {\n size.width = measureBox.offsetWidth - this.options.baselineMarkerSize;\n size.height = measureBox.offsetHeight;\n size.baseline = baselineMarker.offsetTop + this.options.baselineMarkerSize;\n }\n if (size.width > 0 && size.height > 0) {\n this._cache.put(cacheKey, size);\n }\n measureBox.parentNode.removeChild(measureBox);\n return size;\n },\n _baselineMarker: function () {\n var marker = document.createElement('div');\n marker.style.cssText = 'display: inline-block; vertical-align: baseline;width: ' + this.options.baselineMarkerSize + 'px; height: ' + this.options.baselineMarkerSize + 'px;overflow: hidden;';\n return marker;\n }\n });\n TextMetrics.current = new TextMetrics();\n function measureText(text, style, measureBox) {\n return TextMetrics.current.measure(text, style, measureBox);\n }\n kendo.deepExtend(kendo.util, {\n LRUCache: LRUCache,\n TextMetrics: TextMetrics,\n measureText: measureText,\n objectKey: objectKey,\n hashKey: hashKey\n });\n }(window.kendo.jQuery));\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));\n(function (f, define) {\n define('kendo.dataviz.gauge', [\n 'kendo.dataviz.core',\n 'kendo.drawing',\n 'kendo.dataviz.themes'\n ], f);\n}(function () {\n var __meta__ = {\n id: 'dataviz.gauge',\n name: 'Gauge',\n category: 'dataviz',\n description: 'Radial and Linear gauges.',\n depends: [\n 'dataviz.core',\n 'dataviz.themes'\n ]\n };\n (function ($, undefined) {\n var math = Math, kendo = window.kendo, Widget = kendo.ui.Widget, deepExtend = kendo.deepExtend, dataviz = kendo.dataviz, autoMajorUnit = dataviz.autoMajorUnit, ChartElement = dataviz.ChartElement, NumericAxis = dataviz.NumericAxis, Axis = dataviz.Axis, Box2D = dataviz.Box2D, Class = kendo.Class, defined = dataviz.defined, isNumber = dataviz.isNumber, interpolateValue = dataviz.interpolateValue, getSpacing = dataviz.getSpacing, round = dataviz.round, geo = dataviz.geometry, draw = dataviz.drawing, Point = geo.Point, Group = draw.Group, Path = draw.Path, Rect = geo.Rect, Text = draw.Text;\n var ANGULAR_SPEED = 150, LINEAR_SPEED = 250, ARROW = 'arrow', ARROW_POINTER = 'arrowPointer', BAR_POINTER = 'barPointer', BLACK = '#000', CAP_SIZE = 0.05, COORD_PRECISION = dataviz.COORD_PRECISION, MAX_VALUE = Number.MAX_VALUE, MIN_VALUE = -Number.MAX_VALUE, DEFAULT_HEIGHT = 200, DEFAULT_LINE_WIDTH = 0.5, DEFAULT_WIDTH = 200, DEFAULT_MIN_WIDTH = 60, DEFAULT_MIN_HEIGHT = 60, DEFAULT_MARGIN = 5, DEGREE = math.PI / 180, GEO_ARC_ADJUST_ANGLE = 180, INSIDE = 'inside', LINEAR = 'linear', NEEDLE = 'needle', OUTSIDE = 'outside', RADIAL_POINTER = 'radialPointer', X = 'x', Y = 'y';\n var Pointer = Class.extend({\n init: function (scale, options) {\n var pointer = this;\n var scaleOptions = scale.options;\n ChartElement.fn.init.call(pointer, options);\n options = pointer.options;\n options.fill = options.color;\n pointer.scale = scale;\n if (defined(options.value)) {\n options.value = math.min(math.max(options.value, scaleOptions.min), scaleOptions.max);\n } else {\n options.value = scaleOptions.min;\n }\n },\n options: { color: BLACK },\n value: function (newValue) {\n var that = this;\n var options = that.options;\n var value = options.value;\n var scaleOptions = that.scale.options;\n if (arguments.length === 0) {\n return value;\n }\n options._oldValue = options._oldValue !== undefined ? options.value : scaleOptions.min;\n options.value = math.min(math.max(newValue, scaleOptions.min), scaleOptions.max);\n if (that.elements) {\n that.repaint();\n }\n }\n });\n var RadialPointer = Pointer.extend({\n options: {\n shape: NEEDLE,\n cap: { size: CAP_SIZE },\n arrow: {\n width: 16,\n height: 14\n },\n animation: {\n type: RADIAL_POINTER,\n duration: ANGULAR_SPEED\n }\n },\n setRadius: function (radius) {\n var that = this;\n if (radius) {\n that.elements.clear();\n that.render(that.parent, that.center, radius);\n }\n },\n setAngle: function (angle) {\n this.elements.transform(geo.transform().rotate(angle, this.center));\n },\n repaint: function () {\n var that = this;\n var scale = that.scale;\n var options = that.options;\n var oldAngle = scale.slotAngle(options._oldValue);\n var newAngle = scale.slotAngle(options.value);\n if (options.animation.transitions === false) {\n that.setAngle(newAngle);\n } else {\n new RadialPointerAnimation(that.elements, deepExtend(options.animation, {\n oldAngle: oldAngle,\n newAngle: newAngle\n })).play();\n }\n },\n render: function () {\n var that = this;\n var scale = that.scale;\n var center = scale.arc.center;\n var options = that.options;\n var elements = new Group();\n if (options.animation !== false) {\n deepExtend(options.animation, {\n startAngle: 0,\n center: center,\n reverse: scale.options.reverse\n });\n }\n if (options.shape === NEEDLE) {\n elements.append(that._renderNeedle(), that._renderCap());\n } else {\n elements.append(that._renderArrow());\n }\n that.elements = elements;\n that.setAngle(DEGREE);\n return elements;\n },\n reflow: function (arc) {\n var that = this;\n var center = that.center = arc.center;\n var radius = that.radius = arc.getRadiusX();\n var capSize = that.capSize = Math.round(radius * that.options.cap.size);\n that.bbox = Rect.fromPoints(new Point(center.x - capSize, center.y - capSize), new Point(center.x + capSize, center.y + capSize));\n },\n _renderNeedle: function () {\n var that = this;\n var options = that.options;\n var minorTickSize = that.scale.options.minorTicks.size;\n var center = that.center;\n var needleColor = options.color;\n var needlePath = new Path({\n fill: { color: needleColor },\n stroke: {\n color: needleColor,\n width: DEFAULT_LINE_WIDTH\n }\n });\n needlePath.moveTo(center.x + that.radius - minorTickSize, center.y).lineTo(center.x, center.y - that.capSize / 2).lineTo(center.x, center.y + that.capSize / 2).close();\n return needlePath;\n },\n _renderCap: function () {\n var that = this;\n var options = that.options;\n var capColor = options.cap.color || options.color;\n var circle = new geo.Circle(that.center, that.capSize);\n var cap = new draw.Circle(circle, {\n fill: { color: capColor },\n stroke: { color: capColor }\n });\n return cap;\n }\n });\n var RadialScale = NumericAxis.extend({\n init: function (options) {\n var scale = this;\n scale.options = deepExtend({}, scale.options, options);\n scale.options.majorUnit = scale.options.majorUnit || autoMajorUnit(scale.options.min, scale.options.max);\n scale.options.minorUnit = scale.options.minorUnit || scale.options.majorUnit / 10;\n Axis.fn.init.call(scale, scale.options);\n },\n options: {\n min: 0,\n max: 100,\n majorTicks: {\n size: 15,\n align: INSIDE,\n color: BLACK,\n width: DEFAULT_LINE_WIDTH,\n visible: true\n },\n minorTicks: {\n size: 10,\n align: INSIDE,\n color: BLACK,\n width: DEFAULT_LINE_WIDTH,\n visible: true\n },\n startAngle: -30,\n endAngle: 210,\n labels: {\n position: INSIDE,\n padding: 2\n }\n },\n render: function (center, radius) {\n var that = this;\n var arc = that.renderArc(center, radius);\n that.bbox = arc.bbox();\n that.labelElements = that.renderLabels();\n that.ticks = that.renderTicks();\n that.ranges = that.renderRanges();\n },\n reflow: function (bbox) {\n var that = this;\n var center = bbox.center();\n var radius = math.min(bbox.height(), bbox.width()) / 2;\n if (that.bbox !== undefined) {\n that.bbox = that.arc.bbox();\n that.radius(that.arc.getRadiusX());\n that.repositionRanges();\n that.renderLabels();\n } else {\n return that.render(center, radius);\n }\n },\n slotAngle: function (value) {\n var options = this.options;\n var startAngle = options.startAngle;\n var reverse = options.reverse;\n var angle = options.endAngle - startAngle;\n var min = options.min;\n var max = options.max;\n var result;\n if (reverse) {\n result = options.endAngle - (value - min) / (max - min) * angle;\n } else {\n result = (value - min) / (max - min) * angle + startAngle;\n }\n return result + GEO_ARC_ADJUST_ANGLE;\n },\n renderLabels: function () {\n var that = this;\n var options = that.options;\n var majorTickSize = options.majorTicks.size;\n var arc = that.arc.clone();\n var radius = arc.getRadiusX();\n var tickAngles = that.tickAngles(arc, options.majorUnit);\n var labels = that.labels;\n var count = labels.length;\n var labelsOptions = options.labels;\n var padding = labelsOptions.padding;\n var rangeDistance = radius * 0.05;\n var rangeSize = options.rangeSize = options.rangeSize || radius * 0.1;\n var ranges = options.ranges || [];\n var halfWidth, halfHeight, labelAngle;\n var angle, label, lp, i, cx, cy, isInside;\n var labelsGroup = new Group();\n var lbl, labelPos, prevLabelPos, labelTransform;\n if (that.options.rangeDistance !== undefined) {\n rangeDistance = that.options.rangeDistance;\n } else {\n that.options.rangeDistance = rangeDistance;\n }\n if (labelsOptions.position === INSIDE) {\n radius -= majorTickSize;\n if (ranges.length && that.labelElements === undefined) {\n radius -= rangeSize + rangeDistance;\n }\n arc.setRadiusX(radius).setRadiusY(radius);\n }\n for (i = 0; i < count; i++) {\n label = labels[i];\n halfWidth = label.box.width() / 2;\n halfHeight = label.box.height() / 2;\n angle = tickAngles[i];\n labelAngle = (angle - GEO_ARC_ADJUST_ANGLE) * DEGREE;\n isInside = labelsOptions.position === INSIDE;\n lp = arc.pointAt(angle);\n cx = lp.x + math.cos(labelAngle) * (halfWidth + padding) * (isInside ? 1 : -1);\n cy = lp.y + math.sin(labelAngle) * (halfHeight + padding) * (isInside ? 1 : -1);\n label.reflow(new dataviz.Box2D(cx - halfWidth, cy - halfHeight, cx + halfWidth, cy + halfHeight));\n labelPos = new Point(label.box.x1, label.box.y1);\n if (that.labelElements === undefined) {\n lbl = _buildLabel(label, options.labels);\n labelsGroup.append(lbl);\n } else {\n lbl = that.labelElements.children[i];\n prevLabelPos = lbl.bbox().origin;\n labelTransform = lbl.transform() || geo.transform();\n labelTransform.translate(labelPos.x - prevLabelPos.x, labelPos.y - prevLabelPos.y);\n lbl.transform(labelTransform);\n }\n that.bbox = Rect.union(that.bbox, lbl.bbox());\n }\n return labelsGroup;\n },\n repositionRanges: function () {\n var that = this;\n var ranges = that.ranges.children;\n var rangeSize = that.options.rangeSize;\n var rangeDistance = that.options.rangeDistance;\n var rangeRadius, newRadius;\n if (ranges.length > 0) {\n rangeRadius = that.getRangeRadius();\n if (that.options.labels.position === INSIDE) {\n rangeRadius += rangeSize + rangeDistance;\n }\n newRadius = rangeRadius + rangeSize / 2;\n for (var i = 0; i < ranges.length; i++) {\n ranges[i]._geometry.setRadiusX(newRadius).setRadiusY(newRadius);\n }\n that.bbox = Rect.union(that.bbox, that.ranges.bbox());\n }\n },\n renderRanges: function () {\n var that = this;\n var arc = that.arc;\n var result = new Group();\n var from, to;\n var segments = that.rangeSegments();\n var segmentsCount = segments.length;\n var reverse = that.options.reverse;\n var rangeSize = that.options.rangeSize;\n var rangeDistance = that.options.rangeDistance;\n var segment, rangeRadius, rangeGeom, i;\n if (segmentsCount) {\n rangeRadius = that.getRangeRadius();\n that.radius(that.radius() - rangeSize - rangeDistance);\n for (i = 0; i < segmentsCount; i++) {\n segment = segments[i];\n from = that.slotAngle(segment[reverse ? 'to' : 'from']);\n to = that.slotAngle(segment[!reverse ? 'to' : 'from']);\n if (to - from !== 0) {\n rangeGeom = new geo.Arc(arc.center, {\n radiusX: rangeRadius + rangeSize / 2,\n radiusY: rangeRadius + rangeSize / 2,\n startAngle: from,\n endAngle: to\n });\n result.append(new draw.Arc(rangeGeom, {\n stroke: {\n width: rangeSize,\n color: segment.color,\n opacity: segment.opacity\n }\n }));\n }\n }\n }\n return result;\n },\n rangeSegments: function () {\n var gauge = this;\n var options = gauge.options;\n var ranges = options.ranges || [];\n var count = ranges.length;\n var range;\n var segmentsCount;\n var defaultColor = options.rangePlaceholderColor;\n var segments = [];\n var segment;\n var min = options.min;\n var max = options.max;\n var i, j;\n function rangeSegment(from, to, color, opacity) {\n return {\n from: from,\n to: to,\n color: color,\n opacity: opacity\n };\n }\n if (count) {\n segments.push(rangeSegment(min, max, defaultColor));\n for (i = 0; i < count; i++) {\n range = getRange(ranges[i], min, max);\n segmentsCount = segments.length;\n for (j = 0; j < segmentsCount; j++) {\n segment = segments[j];\n if (segment.from <= range.from && range.from <= segment.to) {\n segments.push(rangeSegment(range.from, range.to, range.color, range.opacity));\n if (segment.from <= range.to && range.to <= segment.to) {\n segments.push(rangeSegment(range.to, segment.to, defaultColor, range.opacity));\n }\n segment.to = range.from;\n break;\n }\n }\n }\n }\n return segments;\n },\n getRangeRadius: function () {\n var that = this;\n var options = that.options;\n var majorTickSize = options.majorTicks.size;\n var rangeSize = options.rangeSize;\n var rangeDistance = options.rangeDistance;\n var arc = that.arc;\n var r;\n if (options.labels.position === OUTSIDE) {\n r = arc.getRadiusX() - majorTickSize - rangeDistance - rangeSize;\n } else {\n r = arc.getRadiusX() - rangeSize;\n }\n return r;\n },\n renderArc: function (center, radius) {\n var that = this;\n var options = that.options;\n var arc = that.arc = new geo.Arc(center, {\n radiusX: radius,\n radiusY: radius,\n startAngle: options.startAngle + GEO_ARC_ADJUST_ANGLE,\n endAngle: options.endAngle + GEO_ARC_ADJUST_ANGLE\n });\n return arc;\n },\n renderTicks: function () {\n var that = this;\n var arc = that.arc;\n var options = that.options;\n var labelsPosition = options.labels.position;\n var allTicks = new Group();\n var majorTickSize = options.majorTicks.size;\n var minorTickSize = options.minorTicks.size;\n var tickArc = arc.clone();\n var radius = tickArc.getRadiusX();\n function drawTicks(arc, tickAngles, unit, tickOptions) {\n var ticks = new Group(), center = arc.center, radius = arc.getRadiusX(), i, tickStart, tickEnd, visible = tickOptions.visible;\n if (visible) {\n for (i = 0; i < tickAngles.length; i++) {\n tickStart = arc.pointAt(tickAngles[i]);\n tickEnd = new Point(center.x + radius - tickOptions.size, center.y).rotate(tickAngles[i], center);\n ticks.append(new Path({\n stroke: {\n color: tickOptions.color,\n width: tickOptions.width\n }\n }).moveTo(tickStart).lineTo(tickEnd));\n }\n }\n return ticks;\n }\n that.majorTickAngles = that.tickAngles(arc, options.majorUnit);\n that.majorTicks = drawTicks(tickArc, that.majorTickAngles, options.majorUnit, options.majorTicks);\n allTicks.append(that.majorTicks);\n that._tickDifference = majorTickSize - minorTickSize;\n if (labelsPosition === OUTSIDE) {\n tickArc.setRadiusX(radius - majorTickSize + minorTickSize).setRadiusY(radius - majorTickSize + minorTickSize);\n }\n that.minorTickAngles = that.normalizeTickAngles(that.tickAngles(arc, options.minorUnit));\n that.minorTicks = drawTicks(tickArc, that.minorTickAngles, options.minorUnit, options.minorTicks, options.majorUnit);\n allTicks.append(that.minorTicks);\n return allTicks;\n },\n normalizeTickAngles: function (angles) {\n var that = this;\n var options = that.options;\n var skip = options.majorUnit / options.minorUnit;\n for (var i = angles.length - 1; i >= 0; i--) {\n if (i % skip === 0) {\n angles.splice(i, 1);\n }\n }\n return angles;\n },\n tickAngles: function (ring, stepValue) {\n var scale = this;\n var options = scale.options;\n var reverse = options.reverse;\n var range = options.max - options.min;\n var angle = ring.endAngle - ring.startAngle;\n var pos = ring.startAngle;\n var tickCount = range / stepValue;\n var step = angle / tickCount;\n var positions = [];\n var i;\n if (reverse) {\n pos += angle;\n step = -step;\n }\n for (i = 0; i < tickCount; i++) {\n positions.push(round(pos, COORD_PRECISION));\n pos += step;\n }\n if (round(pos) <= ring.endAngle) {\n positions.push(pos);\n }\n return positions;\n },\n radius: function (radius) {\n var that = this;\n if (radius) {\n that.arc.setRadiusX(radius).setRadiusY(radius);\n that.repositionTicks(that.majorTicks.children, that.majorTickAngles);\n that.repositionTicks(that.minorTicks.children, that.minorTickAngles, true);\n } else {\n return that.arc.getRadiusX();\n }\n },\n repositionTicks: function (ticks, tickAngles, minor) {\n var that = this;\n var diff = minor ? that._tickDifference || 0 : 0;\n var tickArc = that.arc;\n var radius = tickArc.getRadiusX();\n if (minor && that.options.labels.position === OUTSIDE && diff !== 0) {\n tickArc = that.arc.clone();\n tickArc.setRadiusX(radius - diff).setRadiusY(radius - diff);\n }\n for (var i = 0; i < ticks.length; i++) {\n var newPoint = tickArc.pointAt(tickAngles[i]);\n var segments = ticks[i].segments;\n var xDiff = newPoint.x - segments[0].anchor().x;\n var yDiff = newPoint.y - segments[0].anchor().y;\n ticks[i].transform(new geo.Transformation().translate(xDiff, yDiff));\n }\n }\n });\n var Gauge = Widget.extend({\n init: function (element, userOptions) {\n var gauge = this;\n var options;\n var themeOptions;\n var themeName;\n var themes = dataviz.ui.themes || {};\n var theme;\n kendo.destroy(element);\n $(element).empty();\n Widget.fn.init.call(gauge, element);\n gauge.wrapper = gauge.element;\n gauge._originalOptions = deepExtend({}, userOptions);\n options = deepExtend({}, gauge.options, userOptions);\n themeName = options.theme;\n theme = themes[themeName] || themes[themeName.toLowerCase()];\n themeOptions = themeName && theme ? theme.gauge : {};\n gauge.options = deepExtend({}, themeOptions, options);\n if ($.isArray(options.pointer)) {\n for (var i = 0; i < options.pointer.length; i++) {\n gauge.options.pointer[i] = deepExtend({}, themeOptions.pointer, options.pointer[i]);\n }\n }\n gauge.element.addClass('k-gauge');\n gauge.surface = gauge._createSurface();\n gauge.redraw();\n },\n options: {\n plotArea: {},\n theme: 'default',\n renderAs: '',\n pointer: {},\n scale: {},\n gaugeArea: {}\n },\n destroy: function () {\n this.surface.destroy();\n Widget.fn.destroy.call(this);\n },\n value: function (value) {\n var that = this;\n var pointer = that.pointers[0];\n if (arguments.length === 0) {\n return pointer.value();\n }\n pointer.value(value);\n that._setValueOptions(value);\n },\n _draw: function () {\n var surface = this.surface;\n surface.clear();\n surface.draw(this._visuals);\n },\n exportVisual: function () {\n return this._visuals;\n },\n allValues: function (values) {\n var that = this;\n var pointers = that.pointers;\n var allValues = [];\n var i;\n if (arguments.length === 0) {\n for (i = 0; i < pointers.length; i++) {\n allValues.push(pointers[i].value());\n }\n return allValues;\n }\n if ($.isArray(values)) {\n for (i = 0; i < values.length; i++) {\n if (isNumber(values[i])) {\n pointers[i].value(values[i]);\n }\n }\n }\n that._setValueOptions(values);\n },\n _setValueOptions: function (values) {\n var pointers = [].concat(this.options.pointer);\n values = [].concat(values);\n for (var i = 0; i < values.length; i++) {\n pointers[i].value = values[i];\n }\n },\n _resize: function () {\n var that = this;\n var t = that.options.transitions;\n var i;\n that.options.transitions = false;\n for (i = 0; i < that.pointers.length; i++) {\n that.pointers[i].options.animation.transitions = false;\n }\n that.redraw();\n that.options.transitions = t;\n for (i = 0; i < that.pointers.length; i++) {\n that.pointers[i].options.animation.transitions = t;\n }\n },\n redraw: function () {\n var that = this;\n var size = deepExtend(that._getSize(), that.options.gaugeArea);\n var wrapper = new Rect([\n 0,\n 0\n ], [\n size.width,\n size.height\n ]);\n var bbox;\n that.surface.clear();\n that.gaugeArea = that._createGaugeArea();\n that.surface.element.css({\n width: size.width,\n height: size.height\n });\n that._createModel();\n bbox = _unpad(wrapper.bbox(), that._gaugeAreaMargin);\n that.reflow(bbox);\n },\n _createGaugeArea: function () {\n var that = this;\n var options = that.options.gaugeArea;\n var size = that.surface.size();\n var border = options.border || {};\n var areaGeometry = new Rect([\n 0,\n 0\n ], [\n size.width,\n size.height\n ]);\n that._gaugeAreaMargin = options.margin || DEFAULT_MARGIN;\n if (border.width > 0) {\n areaGeometry = _unpad(areaGeometry, border.width);\n }\n var gaugeArea = Path.fromRect(areaGeometry, {\n stroke: {\n color: border.width ? border.color : '',\n width: border.width,\n dashType: border.dashType,\n lineJoin: 'round',\n lineCap: 'round'\n },\n fill: { color: options.background }\n });\n return gaugeArea;\n },\n _createSurface: function () {\n var that = this;\n var options = that.options;\n var size = that._getSize();\n size = options.gaugeArea ? deepExtend(size, options.gaugeArea) : size;\n var wrap = $('
').appendTo(that.element).css({\n width: size.width,\n height: size.height\n });\n return new draw.Surface.create(wrap, { type: options.renderAs });\n },\n getSize: function () {\n return this._getSize();\n },\n _getSize: function () {\n var that = this;\n var element = that.element;\n var width = element.width();\n var height = element.height();\n if (!width) {\n width = DEFAULT_WIDTH;\n }\n if (!height) {\n height = DEFAULT_HEIGHT;\n }\n return {\n width: width,\n height: height\n };\n }\n });\n var RadialGauge = Gauge.extend({\n init: function (element, options) {\n var radialGauge = this;\n Gauge.fn.init.call(radialGauge, element, options);\n kendo.notify(radialGauge, dataviz.ui);\n },\n options: {\n name: 'RadialGauge',\n transitions: true,\n gaugeArea: { background: '' }\n },\n reflow: function (bbox) {\n var that = this;\n var pointers = that.pointers;\n that.scale.reflow(bbox);\n that._initialPlotArea = that.scale.bbox;\n for (var i = 0; i < pointers.length; i++) {\n pointers[i].reflow(that.scale.arc);\n that._initialPlotArea = Rect.union(that._initialPlotArea, pointers[i].bbox);\n }\n that.fitScale(bbox);\n that.alignScale(bbox);\n that._buildVisual(that.gaugeArea, pointers, that.scale);\n that._draw();\n },\n _buildVisual: function (gaugeArea, pointers, scale) {\n var visuals = new Group();\n var current;\n visuals.append(gaugeArea);\n visuals.append(scale.ticks);\n visuals.append(scale.ranges);\n for (var i = 0; i < pointers.length; i++) {\n current = pointers[i];\n current.render();\n visuals.append(current.elements);\n current.value(current.options.value);\n }\n visuals.append(scale.labelElements);\n this._visuals = visuals;\n },\n fitScale: function (bbox) {\n var that = this;\n var scale = that.scale;\n var arc = scale.arc;\n var plotAreaBox = that._initialPlotArea;\n var step = math.abs(that.getDiff(plotAreaBox, bbox));\n var min = round(step, COORD_PRECISION);\n var max = round(-step, COORD_PRECISION);\n var minDiff, midDiff, maxDiff, mid, oldDiff;\n var staleFlag = 0;\n var i = 0;\n while (i++ < 100) {\n staleFlag = oldDiff === maxDiff ? staleFlag + 1 : 0;\n if (staleFlag > 5) {\n break;\n }\n if (min != mid) {\n minDiff = that.getPlotBox(min, bbox, arc);\n if (0 <= minDiff && minDiff <= 2) {\n break;\n }\n }\n if (max != mid) {\n maxDiff = that.getPlotBox(max, bbox, arc);\n if (0 <= maxDiff && maxDiff <= 2) {\n break;\n }\n }\n if (minDiff > 0 && maxDiff > 0) {\n mid = min * 2;\n } else if (minDiff < 0 && maxDiff < 0) {\n mid = max * 2;\n } else {\n mid = round((min + max) / 2 || 1, COORD_PRECISION);\n }\n midDiff = that.getPlotBox(mid, bbox, arc);\n if (0 <= midDiff && midDiff <= 2) {\n break;\n }\n oldDiff = maxDiff;\n if (midDiff > 0) {\n max = mid;\n maxDiff = midDiff;\n } else {\n min = mid;\n minDiff = midDiff;\n }\n }\n },\n getPlotBox: function (step, bbox, arc) {\n var that = this;\n var scale = that.scale;\n var pointers = that.pointers;\n var radius = arc.getRadiusX();\n arc = arc.clone();\n arc.setRadiusX(radius + step).setRadiusY(radius + step);\n scale.arc = arc;\n scale.reflow(bbox);\n that.plotBbox = scale.bbox;\n for (var i = 0; i < pointers.length; i++) {\n pointers[i].reflow(arc);\n that.plotBbox = Rect.union(that.plotBbox, pointers[i].bbox);\n }\n return that.getDiff(that.plotBbox, bbox);\n },\n getDiff: function (plotBox, box) {\n return math.min(box.width() - plotBox.width(), box.height() - plotBox.height());\n },\n alignScale: function (bbox) {\n var that = this;\n var plotBoxCenter = that.plotBbox.center();\n var boxCenter = bbox.center();\n var paddingX = plotBoxCenter.x - boxCenter.x;\n var paddingY = plotBoxCenter.y - boxCenter.y;\n var scale = that.scale;\n var pointers = that.pointers;\n scale.arc.center.x -= paddingX;\n scale.arc.center.y -= paddingY;\n scale.reflow(bbox);\n for (var i = 0; i < pointers.length; i++) {\n pointers[i].reflow(scale.arc);\n that.plotBbox = Rect.union(scale.bbox, pointers[i].bbox);\n }\n },\n _createModel: function () {\n var that = this;\n var options = that.options;\n var pointers = options.pointer;\n var scale = that.scale = new RadialScale(options.scale);\n var current;\n that.pointers = [];\n pointers = $.isArray(pointers) ? pointers : [pointers];\n for (var i = 0; i < pointers.length; i++) {\n current = new RadialPointer(scale, deepExtend({}, pointers[i], { animation: { transitions: options.transitions } }));\n that.pointers.push(current);\n }\n }\n });\n var LinearGauge = Gauge.extend({\n init: function (element, options) {\n var linearGauge = this;\n Gauge.fn.init.call(linearGauge, element, options);\n kendo.notify(linearGauge, dataviz.ui);\n },\n options: {\n name: 'LinearGauge',\n transitions: true,\n gaugeArea: { background: '' },\n scale: { vertical: true }\n },\n reflow: function (bbox) {\n var that = this;\n var pointers = that.pointers;\n var bboxX = bbox.origin.x;\n var bboxY = bbox.origin.y;\n var bbox2D = new dataviz.Box2D(bboxX, bboxY, bboxX + bbox.width(), bboxY + bbox.height());\n that.scale.reflow(bbox2D);\n for (var i = 0; i < pointers.length; i++) {\n pointers[i].reflow();\n }\n that.bbox = that._getBox(bbox2D);\n that._alignElements();\n that._shrinkElements();\n that._buildVisual();\n that._draw();\n },\n _buildVisual: function () {\n var that = this;\n var visuals = new Group();\n var scaleElements = that.scale.render();\n var pointers = that.pointers;\n var current;\n visuals.append(that.gaugeArea);\n visuals.append(scaleElements);\n for (var i = 0; i < pointers.length; i++) {\n current = pointers[i];\n visuals.append(current.render());\n current.value(current.options.value);\n }\n that._visuals = visuals;\n },\n _createModel: function () {\n var that = this;\n var options = that.options;\n var pointers = options.pointer;\n var scale = that.scale = new LinearScale(options.scale);\n var current, currentOptions;\n that.pointers = [];\n pointers = $.isArray(pointers) ? pointers : [pointers];\n for (var i = 0; i < pointers.length; i++) {\n currentOptions = deepExtend({}, pointers[i], { animation: { transitions: options.transitions } });\n if (currentOptions.shape === ARROW) {\n current = new ArrowLinearPointer(scale, currentOptions);\n } else {\n current = new BarLinearPointer(scale, currentOptions);\n }\n that.pointers.push(current);\n }\n },\n _getSize: function () {\n var gauge = this;\n var element = gauge.element;\n var width = element.width();\n var height = element.height();\n var vertical = gauge.options.scale.vertical;\n if (!width) {\n width = vertical ? DEFAULT_MIN_WIDTH : DEFAULT_WIDTH;\n }\n if (!height) {\n height = vertical ? DEFAULT_HEIGHT : DEFAULT_MIN_HEIGHT;\n }\n return {\n width: width,\n height: height\n };\n },\n _getBox: function (box) {\n var that = this;\n var scale = that.scale;\n var pointers = that.pointers;\n var boxCenter = box.center();\n var plotAreaBox = pointers[0].box.clone().wrap(scale.box);\n var size;\n for (var i = 0; i < pointers.length; i++) {\n plotAreaBox.wrap(pointers[i].box.clone());\n }\n if (scale.options.vertical) {\n size = plotAreaBox.width() / 2;\n plotAreaBox = new Box2D(boxCenter.x - size, box.y1, boxCenter.x + size, box.y2);\n } else {\n size = plotAreaBox.height() / 2;\n plotAreaBox = new Box2D(box.x1, boxCenter.y - size, box.x2, boxCenter.y + size);\n }\n return plotAreaBox;\n },\n _alignElements: function () {\n var that = this;\n var scale = that.scale;\n var pointers = that.pointers;\n var scaleBox = scale.box;\n var box = pointers[0].box.clone().wrap(scale.box);\n var plotAreaBox = that.bbox;\n var diff, i;\n for (i = 0; i < pointers.length; i++) {\n box.wrap(pointers[i].box.clone());\n }\n if (scale.options.vertical) {\n diff = plotAreaBox.center().x - box.center().x;\n scale.reflow(new Box2D(scaleBox.x1 + diff, plotAreaBox.y1, scaleBox.x2 + diff, plotAreaBox.y2));\n } else {\n diff = plotAreaBox.center().y - box.center().y;\n scale.reflow(new Box2D(plotAreaBox.x1, scaleBox.y1 + diff, plotAreaBox.x2, scaleBox.y2 + diff));\n }\n for (i = 0; i < pointers.length; i++) {\n pointers[i].reflow(that.bbox);\n }\n },\n _shrinkElements: function () {\n var that = this;\n var scale = that.scale;\n var pointers = that.pointers;\n var scaleBox = scale.box.clone();\n var pos = scale.options.vertical ? 'y' : 'x';\n var pointerBox = pointers[0].box;\n var i;\n for (i = 0; i < pointers.length; i++) {\n pointerBox.wrap(pointers[i].box.clone());\n }\n scaleBox[pos + 1] += math.max(scaleBox[pos + 1] - pointerBox[pos + 1], 0);\n scaleBox[pos + 2] -= math.max(pointerBox[pos + 2] - scaleBox[pos + 2], 0);\n scale.reflow(scaleBox);\n for (i = 0; i < pointers.length; i++) {\n pointers[i].reflow(that.bbox);\n }\n }\n });\n var LinearScale = NumericAxis.extend({\n init: function (options) {\n var scale = this;\n scale.options = deepExtend({}, scale.options, options);\n scale.options = deepExtend({}, scale.options, { labels: { mirror: scale.options.mirror } });\n scale.options.majorUnit = scale.options.majorUnit || autoMajorUnit(scale.options.min, scale.options.max);\n Axis.fn.init.call(scale, scale.options);\n scale.options.minorUnit = scale.options.minorUnit || scale.options.majorUnit / 10;\n },\n options: {\n min: 0,\n max: 50,\n majorTicks: {\n size: 15,\n align: INSIDE,\n color: BLACK,\n width: DEFAULT_LINE_WIDTH,\n visible: true\n },\n minorTicks: {\n size: 10,\n align: INSIDE,\n color: BLACK,\n width: DEFAULT_LINE_WIDTH,\n visible: true\n },\n line: { width: DEFAULT_LINE_WIDTH },\n labels: {\n position: INSIDE,\n padding: 2\n },\n mirror: false,\n _alignLines: false\n },\n render: function () {\n var that = this;\n var elements = that.elements = new Group();\n var labels = that.renderLabels();\n var scaleLine = that.renderLine();\n var scaleTicks = that.renderTicks();\n var ranges = that.renderRanges();\n elements.append(scaleLine, labels, scaleTicks, ranges);\n return elements;\n },\n renderRanges: function () {\n var that = this;\n var options = that.options;\n var min = options.min;\n var max = options.max;\n var ranges = options.ranges || [];\n var vertical = options.vertical;\n var mirror = options.labels.mirror;\n var elements = new Group();\n var count = ranges.length;\n var rangeSize = options.rangeSize || options.minorTicks.size / 2;\n var range, slot, slotX, slotY, i;\n if (count) {\n for (i = 0; i < count; i++) {\n range = getRange(ranges[i], min, max);\n slot = that.getSlot(range.from, range.to);\n slotX = vertical ? that.lineBox() : slot;\n slotY = vertical ? slot : that.lineBox();\n if (vertical) {\n slotX.x1 -= rangeSize * (mirror ? -1 : 1);\n } else {\n slotY.y2 += rangeSize * (mirror ? -1 : 1);\n }\n elements.append(Path.fromRect(new Rect([\n slotX.x1,\n slotY.y1\n ], [\n slotX.x2 - slotX.x1,\n slotY.y2 - slotY.y1\n ]), {\n fill: {\n color: range.color,\n opacity: range.opacity\n },\n stroke: {}\n }));\n }\n }\n return elements;\n },\n renderLabels: function () {\n var that = this;\n var options = that.options;\n var labels = that.labels;\n var elements = new Group();\n for (var i = 0; i < labels.length; i++) {\n elements.append(_buildLabel(labels[i], options.labels));\n }\n return elements;\n },\n renderLine: function () {\n var that = this;\n var options = that.options;\n var line = options.line;\n var lineBox = that.lineBox();\n var linePath;\n var elements = new Group();\n if (line.width > 0 && line.visible) {\n linePath = new Path({\n stroke: {\n color: line.color,\n dashType: line.dashType,\n width: line.width\n }\n });\n linePath.moveTo(lineBox.x1, lineBox.y1).lineTo(lineBox.x2, lineBox.y2);\n elements.append(linePath);\n }\n return elements;\n },\n renderTicks: function () {\n var that = this;\n var ticks = new Group();\n var options = that.options;\n var lineBox = that.lineBox();\n var mirror = options.labels.mirror;\n var majorUnit = options.majorTicks.visible ? options.majorUnit : 0;\n var tickLineOptions = {\n _alignLines: options._alignLines,\n vertical: options.vertical\n };\n function render(tickPositions, tickOptions) {\n var i, count = tickPositions.length;\n if (tickOptions.visible) {\n for (i = tickOptions.skip; i < count; i += tickOptions.step) {\n if (i % tickOptions.skipUnit === 0) {\n continue;\n }\n tickLineOptions.tickX = mirror ? lineBox.x2 : lineBox.x2 - tickOptions.size;\n tickLineOptions.tickY = mirror ? lineBox.y1 - tickOptions.size : lineBox.y1;\n tickLineOptions.position = tickPositions[i];\n ticks.append(that.renderAxisTick(tickLineOptions, tickOptions));\n }\n }\n }\n render(that.getMajorTickPositions(), options.majorTicks);\n render(that.getMinorTickPositions(), deepExtend({}, { skipUnit: majorUnit / options.minorUnit }, options.minorTicks));\n return ticks;\n },\n renderAxisTick: function (options, tickOptions) {\n var tickX = options.tickX;\n var tickY = options.tickY;\n var position = options.position;\n var start, end, tickPath;\n if (options.vertical) {\n start = new Point(tickX, position);\n end = new Point(tickX + tickOptions.size, position);\n } else {\n start = new Point(position, tickY);\n end = new Point(position, tickY + tickOptions.size);\n }\n tickPath = new Path({\n stroke: {\n color: tickOptions.color,\n width: tickOptions.width\n }\n }).moveTo(start).lineTo(end);\n return tickPath;\n }\n });\n var LinearPointer = Pointer.extend({\n init: function (scale, options) {\n var pointer = this;\n Pointer.fn.init.call(pointer, scale, options);\n pointer.options = deepExtend({ track: { visible: defined(options.track) } }, pointer.options);\n },\n options: {\n shape: BAR_POINTER,\n track: { border: { width: 1 } },\n color: BLACK,\n border: { width: 1 },\n opacity: 1,\n margin: getSpacing(3),\n animation: { type: BAR_POINTER },\n visible: true\n },\n reflow: function () {\n var pointer = this;\n var options = pointer.options;\n var scale = pointer.scale;\n var scaleLine = scale.lineBox();\n var trackSize = options.track.size || options.size;\n var pointerHalfSize = options.size / 2;\n var mirror = scale.options.mirror;\n var margin = getSpacing(options.margin);\n var vertical = scale.options.vertical;\n var space = vertical ? margin[mirror ? 'left' : 'right'] : margin[mirror ? 'bottom' : 'top'];\n var pointerBox, pointerRangeBox, trackBox;\n space = mirror ? -space : space;\n if (vertical) {\n trackBox = new Box2D(scaleLine.x1 + space, scaleLine.y1, scaleLine.x1 + space, scaleLine.y2);\n if (mirror) {\n trackBox.x1 -= trackSize;\n } else {\n trackBox.x2 += trackSize;\n }\n if (options.shape !== BAR_POINTER) {\n pointerRangeBox = new Box2D(scaleLine.x2 + space, scaleLine.y1 - pointerHalfSize, scaleLine.x2 + space, scaleLine.y2 + pointerHalfSize);\n pointerBox = pointerRangeBox;\n }\n } else {\n trackBox = new Box2D(scaleLine.x1, scaleLine.y1 - space, scaleLine.x2, scaleLine.y1 - space);\n if (mirror) {\n trackBox.y2 += trackSize;\n } else {\n trackBox.y1 -= trackSize;\n }\n if (options.shape !== BAR_POINTER) {\n pointerRangeBox = new Box2D(scaleLine.x1 - pointerHalfSize, scaleLine.y1 - space, scaleLine.x2 + pointerHalfSize, scaleLine.y1 - space);\n pointerBox = pointerRangeBox;\n }\n }\n pointer.trackBox = trackBox;\n pointer.pointerRangeBox = pointerRangeBox;\n pointer.box = pointerBox || trackBox.clone().pad(options.border.width);\n },\n getElementOptions: function () {\n var options = this.options;\n return {\n fill: {\n color: options.color,\n opacity: options.opacity\n },\n stroke: defined(options.border) ? {\n color: options.border.width ? options.border.color || options.color : '',\n width: options.border.width,\n dashType: options.border.dashType,\n opacity: options.opacity\n } : null\n };\n },\n _margin: function () {\n var pointer = this;\n var options = pointer.options;\n var scale = pointer.scale;\n var mirror = scale.options.mirror;\n var margin = getSpacing(options.margin);\n var vertical = scale.options.vertical;\n var space = vertical ? margin[mirror ? 'left' : 'right'] : margin[mirror ? 'bottom' : 'top'];\n return space;\n }\n });\n var ArrowLinearPointer = LinearPointer.extend({\n init: function (scale, options) {\n LinearPointer.fn.init.call(this, scale, options);\n if (this.options.size === undefined) {\n this.options.size = this.scale.options.majorTicks.size * 0.6;\n }\n },\n pointerShape: function () {\n var that = this;\n var options = that.options;\n var scale = that.scale;\n var size = options.size;\n var vertical = scale.options.vertical;\n var halfSize = size / 2;\n var sign = scale.options.mirror ? -1 : 1;\n var reverse = scale.options.reverse;\n var pos, shape;\n if (vertical) {\n pos = reverse ? 'y2' : 'y1';\n shape = [\n new Point(0, 0 - halfSize),\n new Point(0 - sign * size, 0),\n new Point(0, 0 + halfSize)\n ];\n } else {\n pos = reverse ? 'x1' : 'x2';\n shape = [\n new Point(0 - halfSize, 0),\n new Point(0, 0 + sign * size),\n new Point(0 + halfSize, 0)\n ];\n }\n return shape;\n },\n repaint: function () {\n var that = this;\n var scale = that.scale;\n var options = that.options;\n var animation = new ArrowLinearPointerAnimation(that.elements, deepExtend(options.animation, {\n vertical: scale.options.vertical,\n mirror: scale.options.mirror,\n margin: that._margin(options.margin),\n from: scale.getSlot(options._oldValue),\n to: scale.getSlot(options.value)\n }));\n if (options.animation.transitions === false) {\n animation.options.duration = 0;\n }\n animation.setup();\n animation.play();\n },\n render: function () {\n var that = this;\n var options = that.options;\n var elements = new Group();\n var scale = that.scale;\n var elementOptions = that.getElementOptions();\n var shape = that.pointerShape(options.value);\n options.animation.type = ARROW_POINTER;\n elements = new Path({\n stroke: elementOptions.stroke,\n fill: elementOptions.fill\n }).moveTo(shape[0]).lineTo(shape[1]).lineTo(shape[2]).close();\n var slot = scale.getSlot(options.value);\n elements.transform(geo.transform().translate(slot.x1, slot.y1));\n that.elements = elements;\n return elements;\n }\n });\n var BarLinearPointer = LinearPointer.extend({\n init: function (scale, options) {\n LinearPointer.fn.init.call(this, scale, options);\n if (this.options.size === undefined) {\n this.options.size = this.scale.options.majorTicks.size * 0.3;\n }\n },\n pointerShape: function (value) {\n var that = this;\n var options = that.options;\n var scale = that.scale;\n var vertical = scale.options.vertical;\n var mirror = scale.options.mirror;\n var dir = mirror == vertical ? -1 : 1;\n var size = options.size * dir;\n var minSlot = scale.getSlot(scale.options.min);\n var slot = scale.getSlot(value);\n var axis = vertical ? Y : X;\n var sizeAxis = vertical ? X : Y;\n var margin = that._margin() * dir;\n var p1 = new Point();\n p1[axis] = minSlot[axis + '1'];\n p1[sizeAxis] = minSlot[sizeAxis + '1'];\n var p2 = new Point();\n p2[axis] = slot[axis + '1'];\n p2[sizeAxis] = slot[sizeAxis + '1'];\n if (vertical) {\n p1.translate(margin, 0);\n p2.translate(margin, 0);\n } else {\n p1.translate(0, margin);\n p2.translate(0, margin);\n }\n var p3 = p2.clone();\n var p4 = p1.clone();\n if (vertical) {\n p3.translate(size, 0);\n p4.translate(size, 0);\n } else {\n p3.translate(0, size);\n p4.translate(0, size);\n }\n return [\n p1,\n p2,\n p3,\n p4\n ];\n },\n repaint: function () {\n var that = this;\n var scale = that.scale;\n var options = that.options;\n var shape = that.pointerShape(options.value);\n var pointerPath = that.elements.children[0];\n var oldShape = that.pointerShape(options._oldValue);\n pointerPath.moveTo(shape[0]).lineTo(shape[1]).lineTo(shape[2]).lineTo(shape[3]).close();\n var animation = new BarLinearPointerAnimation(pointerPath, deepExtend(options.animation, {\n reverse: scale.options.reverse,\n vertical: scale.options.vertical,\n oldPoints: [\n oldShape[1],\n oldShape[2]\n ],\n newPoints: [\n shape[1],\n shape[2]\n ]\n }));\n if (options.animation.transitions === false) {\n animation.options.duration = 0;\n }\n animation.setup();\n animation.play();\n },\n render: function () {\n var that = this;\n var group = new Group();\n var elementOptions = that.getElementOptions();\n var pointer = new Path({\n stroke: elementOptions.stroke,\n fill: elementOptions.fill\n });\n group.append(pointer);\n that.elements = group;\n return group;\n }\n });\n var RadialPointerAnimation = draw.Animation.extend({\n init: function (element, options) {\n draw.Animation.fn.init.call(this, element, options);\n options = this.options;\n options.duration = math.max(math.abs(options.newAngle - options.oldAngle) / options.duration * 1000, 1);\n },\n options: {\n easing: LINEAR,\n duration: ANGULAR_SPEED\n },\n step: function (pos) {\n var anim = this;\n var options = anim.options;\n var angle = interpolateValue(options.oldAngle, options.newAngle, pos);\n anim.element.transform(geo.transform().rotate(angle, options.center));\n }\n });\n draw.AnimationFactory.current.register(RADIAL_POINTER, RadialPointerAnimation);\n var ArrowLinearPointerAnimation = draw.Animation.extend({\n options: {\n easing: LINEAR,\n duration: LINEAR_SPEED\n },\n setup: function () {\n var options = this.options;\n var margin = options.margin;\n var from = options.from;\n var to = options.to;\n var axis = options.vertical ? 'x1' : 'y1';\n if (options.mirror == options.vertical) {\n from[axis] -= margin;\n to[axis] -= margin;\n } else {\n from[axis] += margin;\n to[axis] += margin;\n }\n var fromScale = this.fromScale = new Point(from.x1, from.y1);\n var toScale = this.toScale = new Point(to.x1, to.y1);\n if (options.duration !== 0) {\n options.duration = math.max(fromScale.distanceTo(toScale) / options.duration * 1000, 1);\n }\n },\n step: function (pos) {\n var translateX = interpolateValue(this.fromScale.x, this.toScale.x, pos);\n var translateY = interpolateValue(this.fromScale.y, this.toScale.y, pos);\n this.element.transform(geo.transform().translate(translateX, translateY));\n }\n });\n draw.AnimationFactory.current.register(ARROW_POINTER, ArrowLinearPointerAnimation);\n var BarLinearPointerAnimation = draw.Animation.extend({\n options: {\n easing: LINEAR,\n speed: LINEAR_SPEED\n },\n setup: function () {\n var options = this.options;\n var newPoints = options.newPoints;\n var oldPoints = options.oldPoints;\n var axis = this.axis = options.vertical ? Y : X;\n var to = this.to = newPoints[0][axis];\n var from = this.from = oldPoints[0][axis];\n if (options.duration !== 0) {\n options.duration = math.max(math.abs(to - from) / options.speed * 1000, 1);\n }\n this._set(from);\n },\n step: function (pos) {\n var value = interpolateValue(this.from, this.to, pos);\n this._set(value);\n },\n _set: function (value) {\n var setter = 'set' + this.axis.toUpperCase();\n var points = this.options.newPoints;\n points[0][setter](value);\n points[1][setter](value);\n }\n });\n draw.AnimationFactory.current.register(BAR_POINTER, BarLinearPointerAnimation);\n function _buildLabel(label, options) {\n var labelBox = label.box;\n var textBox = label.children[0].box;\n var border = options.border || {};\n var background = options.background || '';\n var elements = new Group();\n var styleBox, styleGeometry, wrapper;\n wrapper = Path.fromRect(new Rect([\n labelBox.x1,\n labelBox.y1\n ], [\n labelBox.width(),\n labelBox.height()\n ]), { stroke: {} });\n var text = new Text(label.text, new Point(textBox.x1, textBox.y1), {\n font: options.font,\n fill: { color: options.color }\n });\n styleGeometry = _pad(text.bbox().clone(), options.padding);\n styleBox = Path.fromRect(styleGeometry, {\n stroke: {\n color: border.width ? border.color : '',\n width: border.width,\n dashType: border.dashType,\n lineJoin: 'round',\n lineCap: 'round'\n },\n fill: { color: background }\n });\n elements.append(wrapper);\n elements.append(styleBox);\n elements.append(text);\n return elements;\n }\n function getRange(range, min, max) {\n var from = defined(range.from) ? range.from : MIN_VALUE;\n var to = defined(range.to) ? range.to : MAX_VALUE;\n range.from = math.max(math.min(to, from), min);\n range.to = math.min(math.max(to, from), max);\n return range;\n }\n function _pad(bbox, value) {\n var origin = bbox.getOrigin();\n var size = bbox.getSize();\n var spacing = getSpacing(value);\n bbox.setOrigin([\n origin.x - spacing.left,\n origin.y - spacing.top\n ]);\n bbox.setSize([\n size.width + (spacing.left + spacing.right),\n size.height + (spacing.top + spacing.bottom)\n ]);\n return bbox;\n }\n function _unpad(bbox, value) {\n var spacing = getSpacing(value);\n spacing.left = -spacing.left;\n spacing.top = -spacing.top;\n spacing.right = -spacing.right;\n spacing.bottom = -spacing.bottom;\n return _pad(bbox, spacing);\n }\n dataviz.ui.plugin(RadialGauge);\n dataviz.ui.plugin(LinearGauge);\n dataviz.ExportMixin.extend(Gauge.fn);\n deepExtend(dataviz, {\n Gauge: Gauge,\n RadialPointer: RadialPointer,\n LinearPointer: LinearPointer,\n ArrowLinearPointer: ArrowLinearPointer,\n BarLinearPointer: BarLinearPointer,\n LinearScale: LinearScale,\n RadialScale: RadialScale,\n LinearGauge: LinearGauge,\n RadialGauge: RadialGauge\n });\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"]}