{"version":3,"sources":["kendo.dataviz.treemap.js"],"names":["f","define","defined","value","UNDEFINED","round","precision","power","pow","math","p","limitValue","min","max","rad","degrees","DEG_TO_RAD","deg","radians","isNumber","val","isNaN","valueOrDefault","defaultValue","sqr","objectKey","object","key","parts","push","sort","join","hashKey","str","i","hash","length","charCodeAt","hashObject","arrayLimits","arr","MAX_NUM","MIN_NUM","arrayMin","arrayMax","sparseArrayMin","sparseArrayLimits","sparseArrayMax","n","isFinite","undefined","last","array","append","first","second","apply","renderTemplate","text","kendo","template","useWithBlock","paramName","renderAttr","name","renderAllAttr","attrs","output","renderStyle","renderSize","size","renderPos","pos","result","toHyphens","split","isTransparent","color","arabicToRoman","literals","1","10","100","2","20","200","3","30","300","4","40","400","5","50","500","6","60","600","7","70","700","8","80","800","9","90","900","1000","values","roman","shift","romanToArabic","r","digits","prev","v","toLowerCase","x","l","c","d","m","charAt","memoize","cache","Object","create","id","arguments","this","ucs2decode","string","extra","counter","ucs2encode","map","String","fromCharCode","mergeSort","a","cmp","merge","b","ai","bi","slice","left","right","Math","floor","window","deepExtend","PI","Number","MAX_VALUE","now","Date","getTime","util","drawing","dataviz","amd","a1","a2","a3","$","zeroSize","width","height","baseline","measureText","style","measureBox","TextMetrics","current","measure","loadFonts","fonts","callback","promises","document","font","load","e","logToConsole","Promise","all","then","doc","Class","LRUCache","extend","init","_size","_length","_map","put","lru","entry","_head","_tail","newer","older","get","defaultMeasureBox","options","_cache","_initOptions","baselineMarkerSize","box","styleKey","cacheKey","cachedResult","baselineMarker","_baselineMarker","cloneNode","appendChild","body","offsetWidth","offsetHeight","offsetTop","parentNode","removeChild","jQuery","encodeBase64","input","chr1","chr2","chr3","enc1","enc2","enc3","enc4","encodeUTF8","KEY_STR","inArray","ObserversMixin","observers","_observers","addObserver","element","removeObserver","index","splice","trigger","methodName","event","observer","idx","_suspended","optionsChange","geometryChange","suspend","resume","_observerField","field","mixins","getField","row","getter","colorsByLength","rgbColor","minRGBtoDecimal","rgbToDecimal","maxRGBtoDecimal","isDarker","colorBrightness","colors","colorByIndex","g","buildColorFromRGB","minColor","abs","maxColor","step","currentStep","decimalToRgb","replace","colorToRGB","rgbToHex","number","toString","toUpperCase","colorLength","substring","rgb","parseInt","brightness","sqrt","proxy","isArray","outerHeight","_outerHeight","outerWidth","_outerWidth","Widget","ui","HierarchicalDataSource","data","NS","CHANGE","DATA_BOUND","ITEM_CREATED","MOUSEOVER_NS","MOUSELEAVE_NS","TreeMap","destroy","empty","fn","call","wrapper","_initTheme","addClass","_setLayout","_originalOptions","_initDataSource","_attachEvents","notify","theme","autoBind","textField","valueField","colorField","events","that","themes","themeName","themeOptions","treeMap","on","_mouseover","_mouseleave","_resizeHandler","resize","onResize","type","_layout","SliceAndDice","_view","SliceAndDiceView","Squarified","SquarifiedView","dataSource","_dataChangeHandler","_onDataChange","bind","fetch","setDataSource","unbind","item","root","htmlSize","node","items","_getByUid","uid","children","Query","_sortForGrouping","_wrapItem","compute","coord","_setColors","render","_cleanItems","createRoot","_root","_colorIdx","angular","elements","find","colorRange","leafNodes","colorIdx","dataItem","hasChildren","_contentSize","view","renderHeight","wrap","level","pop","concat","attr","getByUid","findByUid","target","hasClass","_removeActiveState","removeClass","off","unbindResize","getSize","dimensions","_resize","rootElement","css","_resizeItems","child","childElement","titleSize","filter","setItemSize","setOptions","_setEvents","top","leaf","tree","layoutChildren","minimumSideValue","firstElement","tail","parentArea","totalArea","itemsArea","parseFloat","area","layoutHorizontal","squarify","initElement","computeDim","newCoords","layoutLast","layoutRow","worstAspectRatio","dim","w","layoutV","layoutH","orientation","layoutVertical","layoutChange","areaSum","maxArea","minArea","rootCoord","newRootCoord","ans","_totalArea","total","offset","title","_clean","_getText","_createTitle","_compile","_createWrap","innerWidth","rootWrap","htmlElement","_createLeaf","_createTile","toggleClass","_tileColorBrightness","html","tile","_itemCoordinates","coordinates","_renderTemplate","titleTemplate","vertical","quotient","sliceAndDice","plugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CA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D,UAAW,SAAUnD,EAAM7G,GACvB,GAAI1K,EAMJ,OAJIA,GADAuR,EAAK+G,SACE5N,EAAQoH,SAAS,oBAAoB5L,SAErCwE,EAAQoH,SAAS,6BAA6B7L,SAI7DqR,aAAc,SAAU/F,GACpB,GAAI4F,EAMJ,OAJIA,GAAQpR,EADRwL,EAAK+G,SACK,sCAEA,gDAEPnB,EAAMpY,OAAOgH,EAAE,eAAeiS,KAAKrU,KAAK0T,SAAS9F,OA2FhE7L,GAAQwI,GAAGuK,OAAO9J,IACpB3J,OAAO3F,MAAMoK,QACRzE,OAAO3F,OACE,kBAAV1D,SAAwBA,OAAOgK,IAAMhK,OAAS,SAAUiK,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.dataviz.treemap.min.js","sourcesContent":["/*!\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n*/\n(function (f, define) {\n define('util/main', ['kendo.core'], f);\n}(function () {\n (function () {\n var math = Math, kendo = window.kendo, deepExtend = kendo.deepExtend;\n var DEG_TO_RAD = math.PI / 180, MAX_NUM = Number.MAX_VALUE, MIN_NUM = -Number.MAX_VALUE, UNDEFINED = 'undefined';\n function defined(value) {\n return typeof value !== UNDEFINED;\n }\n function round(value, precision) {\n var power = pow(precision);\n return math.round(value * power) / power;\n }\n function pow(p) {\n if (p) {\n return math.pow(10, p);\n } else {\n return 1;\n }\n }\n function limitValue(value, min, max) {\n return math.max(math.min(value, max), min);\n }\n function rad(degrees) {\n return degrees * DEG_TO_RAD;\n }\n function deg(radians) {\n return radians / DEG_TO_RAD;\n }\n function isNumber(val) {\n return typeof val === 'number' && !isNaN(val);\n }\n function valueOrDefault(value, defaultValue) {\n return defined(value) ? value : defaultValue;\n }\n function sqr(value) {\n return value * value;\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 hashObject(object) {\n return hashKey(objectKey(object));\n }\n var now = Date.now;\n if (!now) {\n now = function () {\n return new Date().getTime();\n };\n }\n function arrayLimits(arr) {\n var length = arr.length, i, min = MAX_NUM, max = MIN_NUM;\n for (i = 0; i < length; i++) {\n max = math.max(max, arr[i]);\n min = math.min(min, arr[i]);\n }\n return {\n min: min,\n max: max\n };\n }\n function arrayMin(arr) {\n return arrayLimits(arr).min;\n }\n function arrayMax(arr) {\n return arrayLimits(arr).max;\n }\n function sparseArrayMin(arr) {\n return sparseArrayLimits(arr).min;\n }\n function sparseArrayMax(arr) {\n return sparseArrayLimits(arr).max;\n }\n function sparseArrayLimits(arr) {\n var min = MAX_NUM, max = MIN_NUM;\n for (var i = 0, length = arr.length; i < length; i++) {\n var n = arr[i];\n if (n !== null && isFinite(n)) {\n min = math.min(min, n);\n max = math.max(max, n);\n }\n }\n return {\n min: min === MAX_NUM ? undefined : min,\n max: max === MIN_NUM ? undefined : max\n };\n }\n function last(array) {\n if (array) {\n return array[array.length - 1];\n }\n }\n function append(first, second) {\n first.push.apply(first, second);\n return first;\n }\n function renderTemplate(text) {\n return kendo.template(text, {\n useWithBlock: false,\n paramName: 'd'\n });\n }\n function renderAttr(name, value) {\n return defined(value) && value !== null ? ' ' + name + '=\\'' + value + '\\' ' : '';\n }\n function renderAllAttr(attrs) {\n var output = '';\n for (var i = 0; i < attrs.length; i++) {\n output += renderAttr(attrs[i][0], attrs[i][1]);\n }\n return output;\n }\n function renderStyle(attrs) {\n var output = '';\n for (var i = 0; i < attrs.length; i++) {\n var value = attrs[i][1];\n if (defined(value)) {\n output += attrs[i][0] + ':' + value + ';';\n }\n }\n if (output !== '') {\n return output;\n }\n }\n function renderSize(size) {\n if (typeof size !== 'string') {\n size += 'px';\n }\n return size;\n }\n function renderPos(pos) {\n var result = [];\n if (pos) {\n var parts = kendo.toHyphens(pos).split('-');\n for (var i = 0; i < parts.length; i++) {\n result.push('k-pos-' + parts[i]);\n }\n }\n return result.join(' ');\n }\n function isTransparent(color) {\n return color === '' || color === null || color === 'none' || color === 'transparent' || !defined(color);\n }\n function arabicToRoman(n) {\n var literals = {\n 1: 'i',\n 10: 'x',\n 100: 'c',\n 2: 'ii',\n 20: 'xx',\n 200: 'cc',\n 3: 'iii',\n 30: 'xxx',\n 300: 'ccc',\n 4: 'iv',\n 40: 'xl',\n 400: 'cd',\n 5: 'v',\n 50: 'l',\n 500: 'd',\n 6: 'vi',\n 60: 'lx',\n 600: 'dc',\n 7: 'vii',\n 70: 'lxx',\n 700: 'dcc',\n 8: 'viii',\n 80: 'lxxx',\n 800: 'dccc',\n 9: 'ix',\n 90: 'xc',\n 900: 'cm',\n 1000: 'm'\n };\n var values = [\n 1000,\n 900,\n 800,\n 700,\n 600,\n 500,\n 400,\n 300,\n 200,\n 100,\n 90,\n 80,\n 70,\n 60,\n 50,\n 40,\n 30,\n 20,\n 10,\n 9,\n 8,\n 7,\n 6,\n 5,\n 4,\n 3,\n 2,\n 1\n ];\n var roman = '';\n while (n > 0) {\n if (n < values[0]) {\n values.shift();\n } else {\n roman += literals[values[0]];\n n -= values[0];\n }\n }\n return roman;\n }\n function romanToArabic(r) {\n r = r.toLowerCase();\n var digits = {\n i: 1,\n v: 5,\n x: 10,\n l: 50,\n c: 100,\n d: 500,\n m: 1000\n };\n var value = 0, prev = 0;\n for (var i = 0; i < r.length; ++i) {\n var v = digits[r.charAt(i)];\n if (!v) {\n return null;\n }\n value += v;\n if (v > prev) {\n value -= 2 * prev;\n }\n prev = v;\n }\n return value;\n }\n function memoize(f) {\n var cache = Object.create(null);\n return function () {\n var id = '';\n for (var i = arguments.length; --i >= 0;) {\n id += ':' + arguments[i];\n }\n return id in cache ? cache[id] : cache[id] = f.apply(this, arguments);\n };\n }\n function ucs2decode(string) {\n var output = [], counter = 0, length = string.length, value, extra;\n while (counter < length) {\n value = string.charCodeAt(counter++);\n if (value >= 55296 && value <= 56319 && counter < length) {\n extra = string.charCodeAt(counter++);\n if ((extra & 64512) == 56320) {\n output.push(((value & 1023) << 10) + (extra & 1023) + 65536);\n } else {\n output.push(value);\n counter--;\n }\n } else {\n output.push(value);\n }\n }\n return output;\n }\n function ucs2encode(array) {\n return array.map(function (value) {\n var output = '';\n if (value > 65535) {\n value -= 65536;\n output += String.fromCharCode(value >>> 10 & 1023 | 55296);\n value = 56320 | value & 1023;\n }\n output += String.fromCharCode(value);\n return output;\n }).join('');\n }\n function mergeSort(a, cmp) {\n if (a.length < 2) {\n return a.slice();\n }\n function merge(a, b) {\n var r = [], ai = 0, bi = 0, i = 0;\n while (ai < a.length && bi < b.length) {\n if (cmp(a[ai], b[bi]) <= 0) {\n r[i++] = a[ai++];\n } else {\n r[i++] = b[bi++];\n }\n }\n if (ai < a.length) {\n r.push.apply(r, a.slice(ai));\n }\n if (bi < b.length) {\n r.push.apply(r, b.slice(bi));\n }\n return r;\n }\n return function sort(a) {\n if (a.length <= 1) {\n return a;\n }\n var m = Math.floor(a.length / 2);\n var left = a.slice(0, m);\n var right = a.slice(m);\n left = sort(left);\n right = sort(right);\n return merge(left, right);\n }(a);\n }\n deepExtend(kendo, {\n util: {\n MAX_NUM: MAX_NUM,\n MIN_NUM: MIN_NUM,\n append: append,\n arrayLimits: arrayLimits,\n arrayMin: arrayMin,\n arrayMax: arrayMax,\n defined: defined,\n deg: deg,\n hashKey: hashKey,\n hashObject: hashObject,\n isNumber: isNumber,\n isTransparent: isTransparent,\n last: last,\n limitValue: limitValue,\n now: now,\n objectKey: objectKey,\n round: round,\n rad: rad,\n renderAttr: renderAttr,\n renderAllAttr: renderAllAttr,\n renderPos: renderPos,\n renderSize: renderSize,\n renderStyle: renderStyle,\n renderTemplate: renderTemplate,\n sparseArrayLimits: sparseArrayLimits,\n sparseArrayMin: sparseArrayMin,\n sparseArrayMax: sparseArrayMax,\n sqr: sqr,\n valueOrDefault: valueOrDefault,\n romanToArabic: romanToArabic,\n arabicToRoman: arabicToRoman,\n memoize: memoize,\n ucs2encode: ucs2encode,\n ucs2decode: ucs2decode,\n mergeSort: mergeSort\n }\n });\n kendo.drawing.util = kendo.util;\n kendo.dataviz.util = kendo.util;\n }());\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));\n(function (f, define) {\n define('util/text-metrics', [\n 'kendo.core',\n 'util/main'\n ], f);\n}(function () {\n (function ($) {\n var doc = document, kendo = window.kendo, Class = kendo.Class, util = kendo.util, defined = util.defined;\n var LRUCache = 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 lru = this, map = lru._map, entry = {\n key: key,\n value: value\n };\n map[key] = entry;\n if (!lru._head) {\n lru._head = lru._tail = entry;\n } else {\n lru._tail.newer = entry;\n entry.older = lru._tail;\n lru._tail = entry;\n }\n if (lru._length >= lru._size) {\n map[lru._head.key] = null;\n lru._head = lru._head.newer;\n lru._head.older = null;\n } else {\n lru._length++;\n }\n },\n get: function (key) {\n var lru = this, entry = lru._map[key];\n if (entry) {\n if (entry === lru._head && entry !== lru._tail) {\n lru._head = entry.newer;\n lru._head.older = null;\n }\n if (entry !== lru._tail) {\n if (entry.older) {\n entry.older.newer = entry.newer;\n entry.newer.older = entry.older;\n }\n entry.older = lru._tail;\n entry.newer = null;\n lru._tail.newer = entry;\n lru._tail = entry;\n }\n return entry.value;\n }\n }\n });\n var defaultMeasureBox = $('
')[0];\n function zeroSize() {\n return {\n width: 0,\n height: 0,\n baseline: 0\n };\n }\n var TextMetrics = Class.extend({\n init: function (options) {\n this._cache = new LRUCache(1000);\n this._initOptions(options);\n },\n options: { baselineMarkerSize: 1 },\n measure: function (text, style, box) {\n if (!text) {\n return zeroSize();\n }\n var styleKey = util.objectKey(style), cacheKey = util.hashKey(text + styleKey), cachedResult = this._cache.get(cacheKey);\n if (cachedResult) {\n return cachedResult;\n }\n var size = zeroSize();\n var measureBox = box ? box : defaultMeasureBox;\n var baselineMarker = this._baselineMarker().cloneNode(false);\n for (var key in style) {\n var value = style[key];\n if (defined(value)) {\n measureBox.style[key] = value;\n }\n }\n $(measureBox).text(text);\n measureBox.appendChild(baselineMarker);\n doc.body.appendChild(measureBox);\n if ((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 return $('')[0];\n }\n });\n TextMetrics.current = new TextMetrics();\n function measureText(text, style, measureBox) {\n return TextMetrics.current.measure(text, style, measureBox);\n }\n function loadFonts(fonts, callback) {\n var promises = [];\n if (fonts.length > 0 && document.fonts) {\n try {\n promises = fonts.map(function (font) {\n return document.fonts.load(font);\n });\n } catch (e) {\n kendo.logToConsole(e);\n }\n Promise.all(promises).then(callback, callback);\n } else {\n callback();\n }\n }\n kendo.util.TextMetrics = TextMetrics;\n kendo.util.LRUCache = LRUCache;\n kendo.util.loadFonts = loadFonts;\n kendo.util.measureText = measureText;\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('util/base64', ['util/main'], f);\n}(function () {\n (function () {\n var kendo = window.kendo, deepExtend = kendo.deepExtend, fromCharCode = String.fromCharCode;\n var KEY_STR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n function encodeBase64(input) {\n var output = '';\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n var i = 0;\n input = encodeUTF8(input);\n while (i < input.length) {\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n enc1 = chr1 >> 2;\n enc2 = (chr1 & 3) << 4 | chr2 >> 4;\n enc3 = (chr2 & 15) << 2 | chr3 >> 6;\n enc4 = chr3 & 63;\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n output = output + KEY_STR.charAt(enc1) + KEY_STR.charAt(enc2) + KEY_STR.charAt(enc3) + KEY_STR.charAt(enc4);\n }\n return output;\n }\n function encodeUTF8(input) {\n var output = '';\n for (var i = 0; i < input.length; i++) {\n var c = input.charCodeAt(i);\n if (c < 128) {\n output += fromCharCode(c);\n } else if (c < 2048) {\n output += fromCharCode(192 | c >>> 6);\n output += fromCharCode(128 | c & 63);\n } else if (c < 65536) {\n output += fromCharCode(224 | c >>> 12);\n output += fromCharCode(128 | c >>> 6 & 63);\n output += fromCharCode(128 | c & 63);\n }\n }\n return output;\n }\n deepExtend(kendo.util, {\n encodeBase64: encodeBase64,\n encodeUTF8: encodeUTF8\n });\n }());\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));\n(function (f, define) {\n define('mixins/observers', ['kendo.core'], f);\n}(function () {\n (function ($) {\n var math = Math, kendo = window.kendo, deepExtend = kendo.deepExtend, inArray = $.inArray;\n var ObserversMixin = {\n observers: function () {\n this._observers = this._observers || [];\n return this._observers;\n },\n addObserver: function (element) {\n if (!this._observers) {\n this._observers = [element];\n } else {\n this._observers.push(element);\n }\n return this;\n },\n removeObserver: function (element) {\n var observers = this.observers();\n var index = inArray(element, observers);\n if (index != -1) {\n observers.splice(index, 1);\n }\n return this;\n },\n trigger: function (methodName, event) {\n var observers = this._observers;\n var observer;\n var idx;\n if (observers && !this._suspended) {\n for (idx = 0; idx < observers.length; idx++) {\n observer = observers[idx];\n if (observer[methodName]) {\n observer[methodName](event);\n }\n }\n }\n return this;\n },\n optionsChange: function (e) {\n e = e || {};\n e.element = this;\n this.trigger('optionsChange', e);\n },\n geometryChange: function () {\n this.trigger('geometryChange', { element: this });\n },\n suspend: function () {\n this._suspended = (this._suspended || 0) + 1;\n return this;\n },\n resume: function () {\n this._suspended = math.max((this._suspended || 0) - 1, 0);\n return this;\n },\n _observerField: function (field, value) {\n if (this[field]) {\n this[field].removeObserver(this);\n }\n this[field] = value;\n value.addObserver(this);\n }\n };\n deepExtend(kendo, { mixins: { ObserversMixin: ObserversMixin } });\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));\n(function (f, define) {\n define('kendo.dataviz.treemap', [\n 'kendo.data',\n 'kendo.userevents',\n 'kendo.dataviz.themes'\n ], f);\n}(function () {\n var __meta__ = {\n id: 'dataviz.treeMap',\n name: 'TreeMap',\n category: 'dataviz',\n description: 'The Kendo DataViz TreeMap',\n depends: [\n 'data',\n 'userevents',\n 'dataviz.themes'\n ]\n };\n (function ($, undefined) {\n var math = Math, proxy = $.proxy, isArray = $.isArray, kendo = window.kendo, outerHeight = kendo._outerHeight, outerWidth = kendo._outerWidth, Class = kendo.Class, Widget = kendo.ui.Widget, template = kendo.template, deepExtend = kendo.deepExtend, HierarchicalDataSource = kendo.data.HierarchicalDataSource, getter = kendo.getter, dataviz = kendo.dataviz;\n var NS = '.kendoTreeMap', CHANGE = 'change', DATA_BOUND = 'dataBound', ITEM_CREATED = 'itemCreated', MAX_VALUE = Number.MAX_VALUE, MOUSEOVER_NS = 'mouseover' + NS, MOUSELEAVE_NS = 'mouseleave' + NS, UNDEFINED = 'undefined';\n var TreeMap = Widget.extend({\n init: function (element, options) {\n kendo.destroy(element);\n $(element).empty();\n Widget.fn.init.call(this, element, options);\n this.wrapper = this.element;\n this._initTheme(this.options);\n this.element.addClass('k-widget k-treemap');\n this._setLayout();\n this._originalOptions = deepExtend({}, this.options);\n this._initDataSource();\n this._attachEvents();\n kendo.notify(this, dataviz.ui);\n },\n options: {\n name: 'TreeMap',\n theme: 'default',\n autoBind: true,\n textField: 'text',\n valueField: 'value',\n colorField: 'color'\n },\n events: [\n DATA_BOUND,\n ITEM_CREATED\n ],\n _initTheme: function (options) {\n var that = this, themes = dataviz.ui.themes || {}, themeName = ((options || {}).theme || '').toLowerCase(), themeOptions = (themes[themeName] || {}).treeMap;\n that.options = deepExtend({}, themeOptions, options);\n },\n _attachEvents: function () {\n this.element.on(MOUSEOVER_NS, proxy(this._mouseover, this)).on(MOUSELEAVE_NS, proxy(this._mouseleave, this));\n this._resizeHandler = proxy(this.resize, this, false);\n kendo.onResize(this._resizeHandler);\n },\n _setLayout: function () {\n if (this.options.type === 'horizontal') {\n this._layout = new SliceAndDice(false);\n this._view = new SliceAndDiceView(this, this.options);\n } else if (this.options.type === 'vertical') {\n this._layout = new SliceAndDice(true);\n this._view = new SliceAndDiceView(this, this.options);\n } else {\n this._layout = new Squarified();\n this._view = new SquarifiedView(this, this.options);\n }\n },\n _initDataSource: function () {\n var that = this, options = that.options, dataSource = options.dataSource;\n that._dataChangeHandler = proxy(that._onDataChange, that);\n that.dataSource = HierarchicalDataSource.create(dataSource).bind(CHANGE, that._dataChangeHandler);\n if (dataSource) {\n if (that.options.autoBind) {\n that.dataSource.fetch();\n }\n }\n },\n setDataSource: function (dataSource) {\n var that = this;\n that.dataSource.unbind(CHANGE, that._dataChangeHandler);\n that.dataSource = dataSource.bind(CHANGE, that._dataChangeHandler);\n if (dataSource) {\n if (that.options.autoBind) {\n that.dataSource.fetch();\n }\n }\n },\n _onDataChange: function (e) {\n var node = e.node;\n var items = e.items;\n var options = this.options;\n var item, i;\n if (!node) {\n this._cleanItems();\n this.element.empty();\n item = this._wrapItem(items[0]);\n this._layout.createRoot(item, outerWidth(this.element), outerHeight(this.element), this.options.type === 'vertical');\n this._view.createRoot(item);\n this._root = item;\n this._colorIdx = 0;\n } else {\n if (items.length) {\n var root = this._getByUid(node.uid);\n root.children = [];\n items = new kendo.data.Query(items)._sortForGrouping(options.valueField, 'desc');\n for (i = 0; i < items.length; i++) {\n item = items[i];\n root.children.push(this._wrapItem(item));\n }\n var htmlSize = this._view.htmlSize(root);\n this._layout.compute(root.children, root.coord, htmlSize);\n this._setColors(root.children);\n this._view.render(root);\n }\n }\n for (i = 0; i < items.length; i++) {\n items[i].load();\n }\n if (node) {\n this.trigger(DATA_BOUND, { node: node });\n }\n },\n _cleanItems: function () {\n var that = this;\n that.angular('cleanup', function () {\n return { elements: that.element.find('.k-leaf div,.k-treemap-title,.k-treemap-title-vertical') };\n });\n },\n _setColors: function (items) {\n var colors = this.options.colors;\n var colorIdx = this._colorIdx;\n var color = colors[colorIdx % colors.length];\n var colorRange, item;\n if (isArray(color)) {\n colorRange = colorsByLength(color[0], color[1], items.length);\n }\n var leafNodes = false;\n for (var i = 0; i < items.length; i++) {\n item = items[i];\n if (!defined(item.color)) {\n if (colorRange) {\n item.color = colorRange[i];\n } else {\n item.color = color;\n }\n }\n if (!item.dataItem.hasChildren) {\n leafNodes = true;\n }\n }\n if (leafNodes) {\n this._colorIdx++;\n }\n },\n _contentSize: function (root) {\n this.view.renderHeight(root);\n },\n _wrapItem: function (item) {\n var wrap = {};\n if (defined(this.options.valueField)) {\n wrap.value = getField(this.options.valueField, item);\n }\n if (defined(this.options.colorField)) {\n wrap.color = getField(this.options.colorField, item);\n }\n if (defined(this.options.textField)) {\n wrap.text = getField(this.options.textField, item);\n }\n wrap.level = item.level();\n wrap.dataItem = item;\n return wrap;\n },\n _getByUid: function (uid) {\n var items = [this._root];\n var item;\n while (items.length) {\n item = items.pop();\n if (item.dataItem.uid === uid) {\n return item;\n }\n if (item.children) {\n items = items.concat(item.children);\n }\n }\n },\n dataItem: function (node) {\n var uid = $(node).attr(kendo.attr('uid')), dataSource = this.dataSource;\n return dataSource && dataSource.getByUid(uid);\n },\n findByUid: function (uid) {\n return this.element.find('.k-treemap-tile[' + kendo.attr('uid') + '=\\'' + uid + '\\']');\n },\n _mouseover: function (e) {\n var target = $(e.target);\n if (target.hasClass('k-leaf')) {\n this._removeActiveState();\n target.removeClass('k-state-hover').addClass('k-state-hover');\n }\n },\n _removeActiveState: function () {\n this.element.find('.k-state-hover').removeClass('k-state-hover');\n },\n _mouseleave: function () {\n this._removeActiveState();\n },\n destroy: function () {\n Widget.fn.destroy.call(this);\n this.element.off(NS);\n if (this.dataSource) {\n this.dataSource.unbind(CHANGE, this._dataChangeHandler);\n }\n this._root = null;\n kendo.unbindResize(this._resizeHandler);\n kendo.destroy(this.element);\n },\n items: function () {\n return $();\n },\n getSize: function () {\n return kendo.dimensions(this.element);\n },\n _resize: function () {\n var root = this._root;\n if (root) {\n var element = this.element;\n var rootElement = element.children();\n root.coord.width = outerWidth(element);\n root.coord.height = outerHeight(element);\n rootElement.css({\n width: root.coord.width,\n height: root.coord.height\n });\n this._resizeItems(root, rootElement);\n }\n },\n _resizeItems: function (root, element) {\n if (root.children && root.children.length) {\n var elements = element.children('.k-treemap-wrap').children();\n var child, childElement;\n this._layout.compute(root.children, root.coord, { text: this._view.titleSize(root, element) });\n for (var idx = 0; idx < root.children.length; idx++) {\n child = root.children[idx];\n childElement = elements.filter('[' + kendo.attr('uid') + '=\\'' + child.dataItem.uid + '\\']');\n this._view.setItemSize(child, childElement);\n this._resizeItems(child, childElement);\n }\n }\n },\n setOptions: function (options) {\n var dataSource = options.dataSource;\n options.dataSource = undefined;\n this._originalOptions = deepExtend(this._originalOptions, options);\n this.options = deepExtend({}, this._originalOptions);\n this._setLayout();\n this._initTheme(this.options);\n Widget.fn._setEvents.call(this, options);\n if (dataSource) {\n this.setDataSource(HierarchicalDataSource.create(dataSource));\n }\n if (this.options.autoBind) {\n this.dataSource.fetch();\n }\n }\n });\n var Squarified = Class.extend({\n createRoot: function (root, width, height) {\n root.coord = {\n width: width,\n height: height,\n top: 0,\n left: 0\n };\n },\n leaf: function (tree) {\n return !tree.children;\n },\n layoutChildren: function (items, coord) {\n var parentArea = coord.width * coord.height;\n var totalArea = 0, itemsArea = [], i;\n for (i = 0; i < items.length; i++) {\n itemsArea[i] = parseFloat(items[i].value);\n totalArea += itemsArea[i];\n }\n for (i = 0; i < itemsArea.length; i++) {\n items[i].area = parentArea * itemsArea[i] / totalArea;\n }\n var minimumSideValue = this.layoutHorizontal() ? coord.height : coord.width;\n var firstElement = [items[0]];\n var tail = items.slice(1);\n this.squarify(tail, firstElement, minimumSideValue, coord);\n },\n squarify: function (tail, initElement, width, coord) {\n this.computeDim(tail, initElement, width, coord);\n },\n computeDim: function (tail, initElement, width, coord) {\n if (tail.length + initElement.length == 1) {\n var element = tail.length == 1 ? tail : initElement;\n this.layoutLast(element, width, coord);\n return;\n }\n if (tail.length >= 2 && initElement.length === 0) {\n initElement = [tail[0]];\n tail = tail.slice(1);\n }\n if (tail.length === 0) {\n if (initElement.length > 0) {\n this.layoutRow(initElement, width, coord);\n }\n return;\n }\n var firstElement = tail[0];\n if (this.worstAspectRatio(initElement, width) >= this.worstAspectRatio([firstElement].concat(initElement), width)) {\n this.computeDim(tail.slice(1), initElement.concat([firstElement]), width, coord);\n } else {\n var newCoords = this.layoutRow(initElement, width, coord);\n this.computeDim(tail, [], newCoords.dim, newCoords);\n }\n },\n layoutLast: function (items, w, coord) {\n items[0].coord = coord;\n },\n layoutRow: function (items, width, coord) {\n if (this.layoutHorizontal()) {\n return this.layoutV(items, width, coord);\n } else {\n return this.layoutH(items, width, coord);\n }\n },\n orientation: 'h',\n layoutVertical: function () {\n return this.orientation === 'v';\n },\n layoutHorizontal: function () {\n return this.orientation === 'h';\n },\n layoutChange: function () {\n this.orientation = this.layoutVertical() ? 'h' : 'v';\n },\n worstAspectRatio: function (items, width) {\n if (!items || items.length === 0) {\n return MAX_VALUE;\n }\n var areaSum = 0, maxArea = 0, minArea = MAX_VALUE;\n for (var i = 0; i < items.length; i++) {\n var area = items[i].area;\n areaSum += area;\n minArea = minArea < area ? minArea : area;\n maxArea = maxArea > area ? maxArea : area;\n }\n return math.max(width * width * maxArea / (areaSum * areaSum), areaSum * areaSum / (width * width * minArea));\n },\n compute: function (children, rootCoord, htmlSize) {\n if (!(rootCoord.width >= rootCoord.height && this.layoutHorizontal())) {\n this.layoutChange();\n }\n if (children && children.length > 0) {\n var newRootCoord = {\n width: rootCoord.width,\n height: rootCoord.height - htmlSize.text,\n top: 0,\n left: 0\n };\n this.layoutChildren(children, newRootCoord);\n }\n },\n layoutV: function (items, width, coord) {\n var totalArea = this._totalArea(items), top = 0;\n width = round(totalArea / width);\n for (var i = 0; i < items.length; i++) {\n var height = round(items[i].area / width);\n items[i].coord = {\n height: height,\n width: width,\n top: coord.top + top,\n left: coord.left\n };\n top += height;\n }\n var ans = {\n height: coord.height,\n width: coord.width - width,\n top: coord.top,\n left: coord.left + width\n };\n ans.dim = math.min(ans.width, ans.height);\n if (ans.dim != ans.height) {\n this.layoutChange();\n }\n return ans;\n },\n layoutH: function (items, width, coord) {\n var totalArea = this._totalArea(items);\n var height = round(totalArea / width), top = coord.top, left = 0;\n for (var i = 0; i < items.length; i++) {\n items[i].coord = {\n height: height,\n width: round(items[i].area / height),\n top: top,\n left: coord.left + left\n };\n left += items[i].coord.width;\n }\n var ans = {\n height: coord.height - height,\n width: coord.width,\n top: coord.top + height,\n left: coord.left\n };\n ans.dim = math.min(ans.width, ans.height);\n if (ans.dim != ans.width) {\n this.layoutChange();\n }\n return ans;\n },\n _totalArea: function (items) {\n var total = 0;\n for (var i = 0; i < items.length; i++) {\n total += items[i].area;\n }\n return total;\n }\n });\n var SquarifiedView = Class.extend({\n init: function (treeMap, options) {\n this.options = deepExtend({}, this.options, options);\n this.treeMap = treeMap;\n this.element = $(treeMap.element);\n this.offset = 0;\n },\n titleSize: function (item, element) {\n var text = element.children('.k-treemap-title');\n return text.height();\n },\n htmlSize: function (root) {\n var rootElement = this._getByUid(root.dataItem.uid);\n var htmlSize = { text: 0 };\n if (root.children) {\n this._clean(rootElement);\n var text = this._getText(root);\n if (text) {\n var title = this._createTitle(root);\n rootElement.append(title);\n this._compile(title, root.dataItem);\n htmlSize.text = title.height();\n }\n rootElement.append(this._createWrap());\n this.offset = (outerWidth(rootElement) - rootElement.innerWidth()) / 2;\n }\n return htmlSize;\n },\n _compile: function (element, dataItem) {\n this.treeMap.angular('compile', function () {\n return {\n elements: element,\n data: [{ dataItem: dataItem }]\n };\n });\n },\n _getByUid: function (uid) {\n return this.element.find('.k-treemap-tile[' + kendo.attr('uid') + '=\\'' + uid + '\\']');\n },\n render: function (root) {\n var rootElement = this._getByUid(root.dataItem.uid);\n var children = root.children;\n if (children) {\n var rootWrap = rootElement.find('.k-treemap-wrap');\n for (var i = 0; i < children.length; i++) {\n var leaf = children[i];\n var htmlElement = this._createLeaf(leaf);\n rootWrap.append(htmlElement);\n this._compile(htmlElement.children(), leaf.dataItem);\n this.treeMap.trigger(ITEM_CREATED, { element: htmlElement });\n }\n }\n },\n createRoot: function (root) {\n var htmlElement = this._createLeaf(root);\n this.element.append(htmlElement);\n this._compile(htmlElement.children(), root.dataItem);\n this.treeMap.trigger(ITEM_CREATED, { element: htmlElement });\n },\n _clean: function (root) {\n this.treeMap.angular('cleanup', function () {\n return { elements: root.children(':not(.k-treemap-wrap)') };\n });\n root.css('background-color', '');\n root.removeClass('k-leaf');\n root.removeClass('k-inverse');\n root.empty();\n },\n _createLeaf: function (item) {\n return this._createTile(item).css('background-color', item.color).addClass('k-leaf').toggleClass('k-inverse', this._tileColorBrightness(item) > 180).append($('').html(this._getText(item)));\n },\n _createTile: function (item) {\n var tile = $('');\n this.setItemSize(item, tile);\n if (defined(item.dataItem) && defined(item.dataItem.uid)) {\n tile.attr(kendo.attr('uid'), item.dataItem.uid);\n }\n return tile;\n },\n _itemCoordinates: function (item) {\n var coordinates = {\n width: item.coord.width,\n height: item.coord.height,\n left: item.coord.left,\n top: item.coord.top\n };\n if (coordinates.left && this.offset) {\n coordinates.width += this.offset * 2;\n } else {\n coordinates.width += this.offset;\n }\n if (coordinates.top) {\n coordinates.height += this.offset * 2;\n } else {\n coordinates.height += this.offset;\n }\n return coordinates;\n },\n setItemSize: function (item, element) {\n var coordinates = this._itemCoordinates(item);\n element.css({\n width: coordinates.width,\n height: coordinates.height,\n left: coordinates.left,\n top: coordinates.top\n });\n },\n _getText: function (item) {\n var text = item.text;\n if (this.options.template) {\n text = this._renderTemplate(item);\n }\n return text;\n },\n _renderTemplate: function (item) {\n var titleTemplate = template(this.options.template);\n return titleTemplate({\n dataItem: item.dataItem,\n text: item.text\n });\n },\n _createTitle: function (item) {\n return $('').append($('').html(this._getText(item)));\n },\n _createWrap: function () {\n return $('');\n },\n _tileColorBrightness: function (item) {\n return colorBrightness(item.color);\n }\n });\n var SliceAndDice = Class.extend({\n createRoot: function (root, width, height, vertical) {\n root.coord = {\n width: width,\n height: height,\n top: 0,\n left: 0\n };\n root.vertical = vertical;\n },\n init: function (vertical) {\n this.vertical = vertical;\n this.quotient = vertical ? 1 : 0;\n },\n compute: function (children, rootCoord, htmlSize) {\n if (children.length > 0) {\n var width = rootCoord.width;\n var height = rootCoord.height;\n if (this.vertical) {\n height -= htmlSize.text;\n } else {\n width -= htmlSize.text;\n }\n var newRootCoord = {\n width: width,\n height: height,\n top: 0,\n left: 0\n };\n this.layoutChildren(children, newRootCoord);\n }\n },\n layoutChildren: function (items, coord) {\n var parentArea = coord.width * coord.height;\n var totalArea = 0;\n var itemsArea = [];\n var i;\n for (i = 0; i < items.length; i++) {\n var item = items[i];\n itemsArea[i] = parseFloat(items[i].value);\n totalArea += itemsArea[i];\n item.vertical = this.vertical;\n }\n for (i = 0; i < itemsArea.length; i++) {\n items[i].area = parentArea * itemsArea[i] / totalArea;\n }\n this.sliceAndDice(items, coord);\n },\n sliceAndDice: function (items, coord) {\n var totalArea = this._totalArea(items);\n if (items[0].level % 2 === this.quotient) {\n this.layoutHorizontal(items, coord, totalArea);\n } else {\n this.layoutVertical(items, coord, totalArea);\n }\n },\n layoutHorizontal: function (items, coord, totalArea) {\n var left = 0;\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n var width = item.area / (totalArea / coord.width);\n item.coord = {\n height: coord.height,\n width: width,\n top: coord.top,\n left: coord.left + left\n };\n left += width;\n }\n },\n layoutVertical: function (items, coord, totalArea) {\n var top = 0;\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n var height = item.area / (totalArea / coord.height);\n item.coord = {\n height: height,\n width: coord.width,\n top: coord.top + top,\n left: coord.left\n };\n top += height;\n }\n },\n _totalArea: function (items) {\n var total = 0;\n for (var i = 0; i < items.length; i++) {\n total += items[i].area;\n }\n return total;\n }\n });\n var SliceAndDiceView = SquarifiedView.extend({\n htmlSize: function (root) {\n var rootElement = this._getByUid(root.dataItem.uid);\n var htmlSize = {\n text: 0,\n offset: 0\n };\n if (root.children) {\n this._clean(rootElement);\n var text = this._getText(root);\n if (text) {\n var title = this._createTitle(root);\n rootElement.append(title);\n this._compile(title, root.dataItem);\n if (root.vertical) {\n htmlSize.text = title.height();\n } else {\n htmlSize.text = title.width();\n }\n }\n rootElement.append(this._createWrap());\n this.offset = (outerWidth(rootElement) - rootElement.innerWidth()) / 2;\n }\n return htmlSize;\n },\n titleSize: function (item, element) {\n var size;\n if (item.vertical) {\n size = element.children('.k-treemap-title').height();\n } else {\n size = element.children('.k-treemap-title-vertical').width();\n }\n return size;\n },\n _createTitle: function (item) {\n var title;\n if (item.vertical) {\n title = $('');\n } else {\n title = $('');\n }\n return title.append($('').html(this._getText(item)));\n }\n });\n function getField(field, row) {\n if (row === null) {\n return row;\n }\n var get = getter(field, true);\n return get(row);\n }\n function defined(value) {\n return typeof value !== UNDEFINED;\n }\n function colorsByLength(min, max, length) {\n var minRGBtoDecimal = rgbToDecimal(min);\n var maxRGBtoDecimal = rgbToDecimal(max);\n var isDarker = colorBrightness(min) - colorBrightness(max) < 0;\n var colors = [];\n colors.push(min);\n for (var i = 0; i < length; i++) {\n var rgbColor = {\n r: colorByIndex(minRGBtoDecimal.r, maxRGBtoDecimal.r, i, length, isDarker),\n g: colorByIndex(minRGBtoDecimal.g, maxRGBtoDecimal.g, i, length, isDarker),\n b: colorByIndex(minRGBtoDecimal.b, maxRGBtoDecimal.b, i, length, isDarker)\n };\n colors.push(buildColorFromRGB(rgbColor));\n }\n colors.push(max);\n return colors;\n }\n function colorByIndex(min, max, index, length, isDarker) {\n var minColor = math.min(math.abs(min), math.abs(max));\n var maxColor = math.max(math.abs(min), math.abs(max));\n var step = (maxColor - minColor) / (length + 1);\n var currentStep = step * (index + 1);\n var color;\n if (isDarker) {\n color = minColor + currentStep;\n } else {\n color = maxColor - currentStep;\n }\n return color;\n }\n function buildColorFromRGB(color) {\n return '#' + decimalToRgb(color.r) + decimalToRgb(color.g) + decimalToRgb(color.b);\n }\n function rgbToDecimal(color) {\n color = color.replace('#', '');\n var rgbColor = colorToRGB(color);\n return {\n r: rgbToHex(rgbColor.r),\n g: rgbToHex(rgbColor.g),\n b: rgbToHex(rgbColor.b)\n };\n }\n function decimalToRgb(number) {\n var result = math.round(number).toString(16).toUpperCase();\n if (result.length === 1) {\n result = '0' + result;\n }\n return result;\n }\n function colorToRGB(color) {\n var colorLength = color.length;\n var rgbColor = {};\n if (colorLength === 3) {\n rgbColor.r = color[0];\n rgbColor.g = color[1];\n rgbColor.b = color[2];\n } else {\n rgbColor.r = color.substring(0, 2);\n rgbColor.g = color.substring(2, 4);\n rgbColor.b = color.substring(4, 6);\n }\n return rgbColor;\n }\n function rgbToHex(rgb) {\n return parseInt(rgb.toString(16), 16);\n }\n function colorBrightness(color) {\n var brightness = 0;\n if (color) {\n color = rgbToDecimal(color);\n brightness = math.sqrt(0.241 * color.r * color.r + 0.691 * color.g * color.g + 0.068 * color.b * color.b);\n }\n return brightness;\n }\n function round(value) {\n var power = math.pow(10, 4);\n return math.round(value * power) / power;\n }\n dataviz.ui.plugin(TreeMap);\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"],"sourceRoot":"/source/"}