- +
@@ -269,7 +269,7 @@ - + @@ -420,4 +420,4 @@ - \ No newline at end of file + diff --git a/production/index.html b/production/index.html index fb59009e..b7bf2f37 100755 --- a/production/index.html +++ b/production/index.html @@ -19,13 +19,13 @@ - + - + @@ -253,7 +253,7 @@ 3 mins ago - Film festivals used to be do-or-die moments for movie makers. They were where... + Film festivals used to be do-or-die moments for movie makers. They were where... @@ -267,7 +267,7 @@ 3 mins ago - Film festivals used to be do-or-die moments for movie makers. They were where... + Film festivals used to be do-or-die moments for movie makers. They were where... @@ -281,7 +281,7 @@ 3 mins ago - Film festivals used to be do-or-die moments for movie makers. They were where... + Film festivals used to be do-or-die moments for movie makers. They were where... @@ -295,7 +295,7 @@ 3 mins ago - Film festivals used to be do-or-die moments for movie makers. They were where... + Film festivals used to be do-or-die moments for movie makers. They were where... @@ -1183,7 +1183,7 @@ - + diff --git a/production/index2.html b/production/index2.html index b9691a8c..95403894 100755 --- a/production/index2.html +++ b/production/index2.html @@ -19,7 +19,7 @@ - + diff --git a/production/index3.html b/production/index3.html index 1940f0d6..7ff6adac 100755 --- a/production/index3.html +++ b/production/index3.html @@ -19,7 +19,7 @@ - + diff --git a/production/js/maps/jquery-jvectormap-2.0.1.min.js b/production/js/maps/jquery-jvectormap-2.0.1.min.js deleted file mode 100755 index eb0627c2..00000000 --- a/production/js/maps/jquery-jvectormap-2.0.1.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(t){var e={set:{colors:1,values:1,backgroundColor:1,scaleColors:1,normalizeFunction:1,focus:1},get:{selectedRegions:1,selectedMarkers:1,mapObject:1,regionName:1}};t.fn.vectorMap=function(t){var a,s,a=this.children(".jvectormap-container").data("mapObject");if("addMap"===t)jvm.Map.maps[arguments[1]]=arguments[2];else{if(("set"===t||"get"===t)&&e[t][arguments[1]])return s=arguments[1].charAt(0).toUpperCase()+arguments[1].substr(1),a[t+s].apply(a,Array.prototype.slice.call(arguments,2));t=t||{},t.container=this,a=new jvm.Map(t)}return this}}(jQuery),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t:t(jQuery)}(function(t){function e(e){var r=e||window.event,h=o.call(arguments,1),l=0,m=0,c=0,p=0;if(e=t.event.fix(r),e.type="mousewheel","detail"in r&&(c=-1*r.detail),"wheelDelta"in r&&(c=r.wheelDelta),"wheelDeltaY"in r&&(c=r.wheelDeltaY),"wheelDeltaX"in r&&(m=-1*r.wheelDeltaX),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(m=-1*c,c=0),l=0===c?m:c,"deltaY"in r&&(c=-1*r.deltaY,l=c),"deltaX"in r&&(m=r.deltaX,0===c&&(l=-1*m)),0!==c||0!==m){if(1===r.deltaMode){var d=t.data(this,"mousewheel-line-height");l*=d,c*=d,m*=d}else if(2===r.deltaMode){var u=t.data(this,"mousewheel-page-height");l*=u,c*=u,m*=u}return p=Math.max(Math.abs(c),Math.abs(m)),(!n||n>p)&&(n=p,s(r,p)&&(n/=40)),s(r,p)&&(l/=40,m/=40,c/=40),l=Math[l>=1?"floor":"ceil"](l/n),m=Math[m>=1?"floor":"ceil"](m/n),c=Math[c>=1?"floor":"ceil"](c/n),e.deltaX=m,e.deltaY=c,e.deltaFactor=n,e.deltaMode=0,h.unshift(e,l,m,c),i&&clearTimeout(i),i=setTimeout(a,200),(t.event.dispatch||t.event.handle).apply(this,h)}}function a(){n=null}function s(t,e){return m.settings.adjustOldDeltas&&"mousewheel"===t.type&&e%120===0}var i,n,r=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],o=Array.prototype.slice;if(t.event.fixHooks)for(var l=r.length;l;)t.event.fixHooks[r[--l]]=t.event.mouseHooks;var m=t.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener)for(var a=h.length;a;)this.addEventListener(h[--a],e,!1);else this.onmousewheel=e;t.data(this,"mousewheel-line-height",m.getLineHeight(this)),t.data(this,"mousewheel-page-height",m.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=h.length;t;)this.removeEventListener(h[--t],e,!1);else this.onmousewheel=null},getLineHeight:function(e){return parseInt(t(e)["offsetParent"in t.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(e){return t(e).height()},settings:{adjustOldDeltas:!0}};t.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})});var jvm={inherits:function(t,e){function a(){}a.prototype=e.prototype,t.prototype=new a,t.prototype.constructor=t,t.parentClass=e},mixin:function(t,e){var a;for(a in e.prototype)e.prototype.hasOwnProperty(a)&&(t.prototype[a]=e.prototype[a])},min:function(t){var e,a=Number.MAX_VALUE;if(t instanceof Array)for(e=0;ea&&(a=t[e]);else for(e in t)t[e]>a&&(a=t[e]);return a},keys:function(t){var e,a=[];for(e in t)a.push(e);return a},values:function(t){var e,a,s=[];for(a=0;a");return a.error(function(){e.reject()}).load(function(){e.resolve(a)}),a.attr("src",t),e},isImageUrl:function(t){return/\.\w{3,4}$/.test(t)}};jvm.$=jQuery,Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){var a;if(null==this)throw new TypeError('"this" is null or not defined');var s=Object(this),i=s.length>>>0;if(0===i)return-1;var n=+e||0;if(1/0===Math.abs(n)&&(n=0),n>=i)return-1;for(a=Math.max(n>=0?n:i-Math.abs(n),0);i>a;){if(a in s&&s[a]===t)return a;a++}return-1}),jvm.AbstractElement=function(t,e){this.node=this.createElement(t),this.name=t,this.properties={},e&&this.set(e)},jvm.AbstractElement.prototype.set=function(t,e){var a;if("object"==typeof t)for(a in t)this.properties[a]=t[a],this.applyAttr(a,t[a]);else this.properties[t]=e,this.applyAttr(t,e)},jvm.AbstractElement.prototype.get=function(t){return this.properties[t]},jvm.AbstractElement.prototype.applyAttr=function(t,e){this.node.setAttribute(t,e)},jvm.AbstractElement.prototype.remove=function(){jvm.$(this.node).remove()},jvm.AbstractCanvasElement=function(t,e,a){this.container=t,this.setSize(e,a),this.rootElement=new jvm[this.classPrefix+"GroupElement"],this.node.appendChild(this.rootElement.node),this.container.appendChild(this.node)},jvm.AbstractCanvasElement.prototype.add=function(t,e){e=e||this.rootElement,e.add(t),t.canvas=this},jvm.AbstractCanvasElement.prototype.addPath=function(t,e,a){var s=new jvm[this.classPrefix+"PathElement"](t,e);return this.add(s,a),s},jvm.AbstractCanvasElement.prototype.addCircle=function(t,e,a){var s=new jvm[this.classPrefix+"CircleElement"](t,e);return this.add(s,a),s},jvm.AbstractCanvasElement.prototype.addImage=function(t,e,a){var s=new jvm[this.classPrefix+"ImageElement"](t,e);return this.add(s,a),s},jvm.AbstractCanvasElement.prototype.addText=function(t,e,a){var s=new jvm[this.classPrefix+"TextElement"](t,e);return this.add(s,a),s},jvm.AbstractCanvasElement.prototype.addGroup=function(t){var e=new jvm[this.classPrefix+"GroupElement"];return t?t.node.appendChild(e.node):this.node.appendChild(e.node),e.canvas=this,e},jvm.AbstractShapeElement=function(t,e,a){this.style=a||{},this.style.current=this.style.current||{},this.isHovered=!1,this.isSelected=!1,this.updateStyle()},jvm.AbstractShapeElement.prototype.setStyle=function(t,e){var a={};"object"==typeof t?a=t:a[t]=e,jvm.$.extend(this.style.current,a),this.updateStyle()},jvm.AbstractShapeElement.prototype.updateStyle=function(){var t={};jvm.AbstractShapeElement.mergeStyles(t,this.style.initial),jvm.AbstractShapeElement.mergeStyles(t,this.style.current),this.isHovered&&jvm.AbstractShapeElement.mergeStyles(t,this.style.hover),this.isSelected&&(jvm.AbstractShapeElement.mergeStyles(t,this.style.selected),this.isHovered&&jvm.AbstractShapeElement.mergeStyles(t,this.style.selectedHover)),this.set(t)},jvm.AbstractShapeElement.mergeStyles=function(t,e){var a;e=e||{};for(a in e)null===e[a]?delete t[a]:t[a]=e[a]},jvm.SVGElement=function(){jvm.SVGElement.parentClass.apply(this,arguments)},jvm.inherits(jvm.SVGElement,jvm.AbstractElement),jvm.SVGElement.svgns="http://www.w3.org/2000/svg",jvm.SVGElement.prototype.createElement=function(t){return document.createElementNS(jvm.SVGElement.svgns,t)},jvm.SVGElement.prototype.addClass=function(t){this.node.setAttribute("class",t)},jvm.SVGElement.prototype.getElementCtr=function(t){return jvm["SVG"+t]},jvm.SVGElement.prototype.getBBox=function(){return this.node.getBBox()},jvm.SVGGroupElement=function(){jvm.SVGGroupElement.parentClass.call(this,"g")},jvm.inherits(jvm.SVGGroupElement,jvm.SVGElement),jvm.SVGGroupElement.prototype.add=function(t){this.node.appendChild(t.node)},jvm.SVGCanvasElement=function(){this.classPrefix="SVG",jvm.SVGCanvasElement.parentClass.call(this,"svg"),this.defsElement=new jvm.SVGElement("defs"),this.node.appendChild(this.defsElement.node),jvm.AbstractCanvasElement.apply(this,arguments)},jvm.inherits(jvm.SVGCanvasElement,jvm.SVGElement),jvm.mixin(jvm.SVGCanvasElement,jvm.AbstractCanvasElement),jvm.SVGCanvasElement.prototype.setSize=function(t,e){this.width=t,this.height=e,this.node.setAttribute("width",t),this.node.setAttribute("height",e)},jvm.SVGCanvasElement.prototype.applyTransformParams=function(t,e,a){this.scale=t,this.transX=e,this.transY=a,this.rootElement.node.setAttribute("transform","scale("+t+") translate("+e+", "+a+")")},jvm.SVGShapeElement=function(t,e){jvm.SVGShapeElement.parentClass.call(this,t,e),jvm.AbstractShapeElement.apply(this,arguments)},jvm.inherits(jvm.SVGShapeElement,jvm.SVGElement),jvm.mixin(jvm.SVGShapeElement,jvm.AbstractShapeElement),jvm.SVGShapeElement.prototype.applyAttr=function(t,e){var a,s,i=this;"fill"===t&&jvm.isImageUrl(e)?jvm.SVGShapeElement.images[e]?this.applyAttr("fill","url(#image"+jvm.SVGShapeElement.images[e]+")"):jvm.whenImageLoaded(e).then(function(t){s=new jvm.SVGElement("image"),s.node.setAttributeNS("http://www.w3.org/1999/xlink","href",e),s.applyAttr("x","0"),s.applyAttr("y","0"),s.applyAttr("width",t[0].width),s.applyAttr("height",t[0].height),a=new jvm.SVGElement("pattern"),a.applyAttr("id","image"+jvm.SVGShapeElement.imageCounter),a.applyAttr("x",0),a.applyAttr("y",0),a.applyAttr("width",t[0].width/2),a.applyAttr("height",t[0].height/2),a.applyAttr("viewBox","0 0 "+t[0].width+" "+t[0].height),a.applyAttr("patternUnits","userSpaceOnUse"),a.node.appendChild(s.node),i.canvas.defsElement.node.appendChild(a.node),jvm.SVGShapeElement.images[e]=jvm.SVGShapeElement.imageCounter++,i.applyAttr("fill","url(#image"+jvm.SVGShapeElement.images[e]+")")}):jvm.SVGShapeElement.parentClass.prototype.applyAttr.apply(this,arguments)},jvm.SVGShapeElement.imageCounter=1,jvm.SVGShapeElement.images={},jvm.SVGPathElement=function(t,e){jvm.SVGPathElement.parentClass.call(this,"path",t,e),this.node.setAttribute("fill-rule","evenodd")},jvm.inherits(jvm.SVGPathElement,jvm.SVGShapeElement),jvm.SVGCircleElement=function(t,e){jvm.SVGCircleElement.parentClass.call(this,"circle",t,e)},jvm.inherits(jvm.SVGCircleElement,jvm.SVGShapeElement),jvm.SVGImageElement=function(t,e){jvm.SVGImageElement.parentClass.call(this,"image",t,e)},jvm.inherits(jvm.SVGImageElement,jvm.SVGShapeElement),jvm.SVGImageElement.prototype.applyAttr=function(t,e){var a=this;"image"==t?jvm.whenImageLoaded(e).then(function(t){a.node.setAttributeNS("http://www.w3.org/1999/xlink","href",e),a.width=t[0].width,a.height=t[0].height,a.applyAttr("width",a.width),a.applyAttr("height",a.height),a.applyAttr("x",a.cx-a.width/2),a.applyAttr("y",a.cy-a.height/2),jvm.$(a.node).trigger("imageloaded",[t])}):"cx"==t?(this.cx=e,this.width&&this.applyAttr("x",e-this.width/2)):"cy"==t?(this.cy=e,this.height&&this.applyAttr("y",e-this.height/2)):jvm.SVGImageElement.parentClass.prototype.applyAttr.apply(this,arguments)},jvm.SVGTextElement=function(t,e){jvm.SVGTextElement.parentClass.call(this,"text",t,e)},jvm.inherits(jvm.SVGTextElement,jvm.SVGShapeElement),jvm.SVGTextElement.prototype.applyAttr=function(t,e){"text"===t?this.node.textContent=e:jvm.SVGTextElement.parentClass.prototype.applyAttr.apply(this,arguments)},jvm.VMLElement=function(){jvm.VMLElement.VMLInitialized||jvm.VMLElement.initializeVML(),jvm.VMLElement.parentClass.apply(this,arguments)},jvm.inherits(jvm.VMLElement,jvm.AbstractElement),jvm.VMLElement.VMLInitialized=!1,jvm.VMLElement.initializeVML=function(){try{document.namespaces.rvml||document.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),jvm.VMLElement.prototype.createElement=function(t){return document.createElement("')}}catch(t){jvm.VMLElement.prototype.createElement=function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"),jvm.VMLElement.VMLInitialized=!0},jvm.VMLElement.prototype.getElementCtr=function(t){return jvm["VML"+t]},jvm.VMLElement.prototype.addClass=function(t){jvm.$(this.node).addClass(t)},jvm.VMLElement.prototype.applyAttr=function(t,e){this.node[t]=e},jvm.VMLElement.prototype.getBBox=function(){var t=jvm.$(this.node);return{x:t.position().left/this.canvas.scale,y:t.position().top/this.canvas.scale,width:t.width()/this.canvas.scale,height:t.height()/this.canvas.scale}},jvm.VMLGroupElement=function(){jvm.VMLGroupElement.parentClass.call(this,"group"),this.node.style.left="0px",this.node.style.top="0px",this.node.coordorigin="0 0"},jvm.inherits(jvm.VMLGroupElement,jvm.VMLElement),jvm.VMLGroupElement.prototype.add=function(t){this.node.appendChild(t.node)},jvm.VMLCanvasElement=function(){this.classPrefix="VML",jvm.VMLCanvasElement.parentClass.call(this,"group"),jvm.AbstractCanvasElement.apply(this,arguments),this.node.style.position="absolute"},jvm.inherits(jvm.VMLCanvasElement,jvm.VMLElement),jvm.mixin(jvm.VMLCanvasElement,jvm.AbstractCanvasElement),jvm.VMLCanvasElement.prototype.setSize=function(t,e){var a,s,i,n;if(this.width=t,this.height=e,this.node.style.width=t+"px",this.node.style.height=e+"px",this.node.coordsize=t+" "+e,this.node.coordorigin="0 0",this.rootElement){for(a=this.rootElement.node.getElementsByTagName("shape"),i=0,n=a.length;n>i;i++)a[i].coordsize=t+" "+e,a[i].style.width=t+"px",a[i].style.height=e+"px";for(s=this.node.getElementsByTagName("group"),i=0,n=s.length;n>i;i++)s[i].coordsize=t+" "+e,s[i].style.width=t+"px",s[i].style.height=e+"px"}},jvm.VMLCanvasElement.prototype.applyTransformParams=function(t,e,a){this.scale=t,this.transX=e,this.transY=a,this.rootElement.node.coordorigin=this.width-e-this.width/100+","+(this.height-a-this.height/100),this.rootElement.node.coordsize=this.width/t+","+this.height/t},jvm.VMLShapeElement=function(t,e){jvm.VMLShapeElement.parentClass.call(this,t,e),this.fillElement=new jvm.VMLElement("fill"),this.strokeElement=new jvm.VMLElement("stroke"),this.node.appendChild(this.fillElement.node),this.node.appendChild(this.strokeElement.node),this.node.stroked=!1,jvm.AbstractShapeElement.apply(this,arguments)},jvm.inherits(jvm.VMLShapeElement,jvm.VMLElement),jvm.mixin(jvm.VMLShapeElement,jvm.AbstractShapeElement),jvm.VMLShapeElement.prototype.applyAttr=function(t,e){switch(t){case"fill":this.node.fillcolor=e;break;case"fill-opacity":this.fillElement.node.opacity=Math.round(100*e)+"%";break;case"stroke":this.node.stroked="none"===e?!1:!0,this.node.strokecolor=e;break;case"stroke-opacity":this.strokeElement.node.opacity=Math.round(100*e)+"%";break;case"stroke-width":this.node.stroked=0===parseInt(e,10)?!1:!0,this.node.strokeweight=e;break;case"d":this.node.path=jvm.VMLPathElement.pathSvgToVml(e);break;default:jvm.VMLShapeElement.parentClass.prototype.applyAttr.apply(this,arguments)}},jvm.VMLPathElement=function(t,e){var a=new jvm.VMLElement("skew");jvm.VMLPathElement.parentClass.call(this,"shape",t,e),this.node.coordorigin="0 0",a.node.on=!0,a.node.matrix="0.01,0,0,0.01,0,0",a.node.offset="0,0",this.node.appendChild(a.node)},jvm.inherits(jvm.VMLPathElement,jvm.VMLShapeElement),jvm.VMLPathElement.prototype.applyAttr=function(t,e){"d"===t?this.node.path=jvm.VMLPathElement.pathSvgToVml(e):jvm.VMLShapeElement.prototype.applyAttr.call(this,t,e)},jvm.VMLPathElement.pathSvgToVml=function(t){var e,a,s=0,i=0;return t=t.replace(/(-?\d+)e(-?\d+)/g,"0"),t.replace(/([MmLlHhVvCcSs])\s*((?:-?\d*(?:\.\d+)?\s*,?\s*)+)/g,function(t,n,r){r=r.replace(/(\d)-/g,"$1,-").replace(/^\s+/g,"").replace(/\s+$/g,"").replace(/\s+/g,",").split(","),r[0]||r.shift();for(var h=0,o=r.length;o>h;h++)r[h]=Math.round(100*r[h]);switch(n){case"m":return s+=r[0],i+=r[1],"t"+r.join(",");case"M":return s=r[0],i=r[1],"m"+r.join(",");case"l":return s+=r[0],i+=r[1],"r"+r.join(",");case"L":return s=r[0],i=r[1],"l"+r.join(",");case"h":return s+=r[0],"r"+r[0]+",0";case"H":return s=r[0],"l"+s+","+i;case"v":return i+=r[0],"r0,"+r[0];case"V":return i=r[0],"l"+s+","+i;case"c":return e=s+r[r.length-4],a=i+r[r.length-3],s+=r[r.length-2],i+=r[r.length-1],"v"+r.join(",");case"C":return e=r[r.length-4],a=r[r.length-3],s=r[r.length-2],i=r[r.length-1],"c"+r.join(",");case"s":return r.unshift(i-a),r.unshift(s-e),e=s+r[r.length-4],a=i+r[r.length-3],s+=r[r.length-2],i+=r[r.length-1],"v"+r.join(",");case"S":return r.unshift(i+i-a),r.unshift(s+s-e),e=r[r.length-4],a=r[r.length-3],s=r[r.length-2],i=r[r.length-1],"c"+r.join(",")}return""}).replace(/z/g,"e")},jvm.VMLCircleElement=function(t,e){jvm.VMLCircleElement.parentClass.call(this,"oval",t,e)},jvm.inherits(jvm.VMLCircleElement,jvm.VMLShapeElement),jvm.VMLCircleElement.prototype.applyAttr=function(t,e){switch(t){case"r":this.node.style.width=2*e+"px",this.node.style.height=2*e+"px",this.applyAttr("cx",this.get("cx")||0),this.applyAttr("cy",this.get("cy")||0);break;case"cx":if(!e)return;this.node.style.left=e-(this.get("r")||0)+"px";break;case"cy":if(!e)return;this.node.style.top=e-(this.get("r")||0)+"px";break;default:jvm.VMLCircleElement.parentClass.prototype.applyAttr.call(this,t,e)}},jvm.VectorCanvas=function(t,e,a){return this.mode=window.SVGAngle?"svg":"vml",this.impl="svg"==this.mode?new jvm.SVGCanvasElement(t,e,a):new jvm.VMLCanvasElement(t,e,a),this.impl.mode=this.mode,this.impl},jvm.SimpleScale=function(t){this.scale=t},jvm.SimpleScale.prototype.getValue=function(t){return t},jvm.OrdinalScale=function(t){this.scale=t},jvm.OrdinalScale.prototype.getValue=function(t){return this.scale[t]},jvm.OrdinalScale.prototype.getTicks=function(){var t,e=[];for(t in this.scale)e.push({label:t,value:this.scale[t]});return e},jvm.NumericScale=function(t,e,a,s){this.scale=[],e=e||"linear",t&&this.setScale(t),e&&this.setNormalizeFunction(e),"undefined"!=typeof a&&this.setMin(a),"undefined"!=typeof s&&this.setMin(s)},jvm.NumericScale.prototype={setMin:function(t){this.clearMinValue=t,this.minValue="function"==typeof this.normalize?this.normalize(t):t},setMax:function(t){this.clearMaxValue=t,this.maxValue="function"==typeof this.normalize?this.normalize(t):t},setScale:function(t){var e;for(this.scale=[],e=0;e=0;)t-=s[n],n++;return t=this.vectorToNum(n==this.scale.length-1?this.scale[n]:this.vectorAdd(this.scale[n],this.vectorMult(this.vectorSubtract(this.scale[n+1],this.scale[n]),t/s[n])))},vectorToNum:function(t){var e,a=0;for(e=0;e=r?n*=10:.35>=r?n*=5:.75>=r&&(n*=2),s[0]=Math.floor(s[0]/n)*n,s[1]=Math.ceil(s[1]/n)*n,t=s[0];t<=s[1];)e=t==s[0]?this.clearMinValue:t==s[1]?this.clearMaxValue:t,h.push({label:t,value:this.getValue(e)}),t+=n;return h}},jvm.ColorScale=function(){jvm.ColorScale.parentClass.apply(this,arguments)},jvm.inherits(jvm.ColorScale,jvm.NumericScale),jvm.ColorScale.prototype.setScale=function(t){var e;for(e=0;e"),this.body.addClass("jvectormap-legend"),this.params.cssClass&&this.body.addClass(this.params.cssClass),t.vertical?this.map.legendCntVertical.append(this.body):this.map.legendCntHorizontal.append(this.body),this.render()},jvm.Legend.prototype.render=function(){var t,e,a,s,i=this.series.scale.getTicks(),n=jvm.$("
").addClass("jvectormap-legend-inner");for(this.body.html(""),this.params.title&&this.body.append(jvm.$("
").addClass("jvectormap-legend-title").html(this.params.title)),this.body.append(n),t=0;t").addClass("jvectormap-legend-tick"),a=jvm.$("
").addClass("jvectormap-legend-tick-sample"),this.series.params.attribute){case"fill":jvm.isImageUrl(i[t].value)?a.css("background","url("+i[t].value+")"):a.css("background",i[t].value);break;case"stroke":a.css("background",i[t].value);break;case"image":a.css("background","url("+i[t].value+") no-repeat center center");break;case"r":jvm.$("
").css({"border-radius":i[t].value,border:this.map.params.markerStyle.initial["stroke-width"]+"px "+this.map.params.markerStyle.initial.stroke+" solid",width:2*i[t].value+"px",height:2*i[t].value+"px",background:this.map.params.markerStyle.initial.fill}).appendTo(a)}e.append(a),s=i[t].label,this.params.labelRender&&(s=this.params.labelRender(s)),e.append(jvm.$("
"+s+"
").addClass("jvectormap-legend-tick-text")),n.append(e)}n.append(jvm.$("
").css("clear","both"))},jvm.DataSeries=function(t,e,a){var s;t=t||{},t.attribute=t.attribute||"fill",this.elements=e,this.params=t,this.map=a,t.attributes&&this.setAttributes(t.attributes),jvm.$.isArray(t.scale)?(s="fill"===t.attribute||"stroke"===t.attribute?jvm.ColorScale:jvm.NumericScale,this.scale=new s(t.scale,t.normalizeFunction,t.min,t.max)):this.scale=t.scale?new jvm.OrdinalScale(t.scale):new jvm.SimpleScale(t.scale),this.values=t.values||{},this.setValues(this.values),this.params.legend&&(this.legend=new jvm.Legend($.extend({map:this.map,series:this},this.params.legend)))},jvm.DataSeries.prototype={setAttributes:function(t,e){var a,s=t;if("string"==typeof t)this.elements[t]&&this.elements[t].setStyle(this.params.attribute,e);else for(a in s)this.elements[a]&&this.elements[a].element.setStyle(this.params.attribute,s[a])},setValues:function(t){var e,a,s=-Number.MAX_VALUE,i=Number.MAX_VALUE,n={};if(this.scale instanceof jvm.OrdinalScale||this.scale instanceof jvm.SimpleScale)for(a in t)n[a]=t[a]?this.scale.getValue(t[a]):this.elements[a].element.style.initial[this.params.attribute];else{if("undefined"==typeof this.params.min||"undefined"==typeof this.params.max)for(a in t)e=parseFloat(t[a]),e>s&&(s=e),i>e&&(i=e);"undefined"==typeof this.params.min?(this.scale.setMin(i),this.params.min=i):this.scale.setMin(this.params.min),"undefined"==typeof this.params.max?(this.scale.setMax(s),this.params.max=s):this.scale.setMax(this.params.max);for(a in t)"indexOf"!=a&&(e=parseFloat(t[a]),n[a]=isNaN(e)?this.elements[a].element.style.initial[this.params.attribute]:this.scale.getValue(e))}this.setAttributes(n),jvm.$.extend(this.values,t)},clear:function(){var t,e={};for(t in this.values)this.elements[t]&&(e[t]=this.elements[t].element.shape.style.initial[this.params.attribute]);this.setAttributes(e),this.values={}},setScale:function(t){this.scale.setScale(t),this.values&&this.setValues(this.values)},setNormalizeFunction:function(t){this.scale.setNormalizeFunction(t),this.values&&this.setValues(this.values)}},jvm.Proj={degRad:180/Math.PI,radDeg:Math.PI/180,radius:6381372,sgn:function(t){return t>0?1:0>t?-1:t},mill:function(t,e,a){return{x:this.radius*(e-a)*this.radDeg,y:-this.radius*Math.log(Math.tan((45+.4*t)*this.radDeg))/.8}},mill_inv:function(t,e,a){return{lat:(2.5*Math.atan(Math.exp(.8*e/this.radius))-5*Math.PI/8)*this.degRad,lng:(a*this.radDeg+t/this.radius)*this.degRad}},merc:function(t,e,a){return{x:this.radius*(e-a)*this.radDeg,y:-this.radius*Math.log(Math.tan(Math.PI/4+t*Math.PI/360))}},merc_inv:function(t,e,a){return{lat:(2*Math.atan(Math.exp(e/this.radius))-Math.PI/2)*this.degRad,lng:(a*this.radDeg+t/this.radius)*this.degRad}},aea:function(t,e,a){var s=0,i=a*this.radDeg,n=29.5*this.radDeg,r=45.5*this.radDeg,h=t*this.radDeg,o=e*this.radDeg,l=(Math.sin(n)+Math.sin(r))/2,m=Math.cos(n)*Math.cos(n)+2*l*Math.sin(n),c=l*(o-i),p=Math.sqrt(m-2*l*Math.sin(h))/l,d=Math.sqrt(m-2*l*Math.sin(s))/l;return{x:p*Math.sin(c)*this.radius,y:-(d-p*Math.cos(c))*this.radius}},aea_inv:function(t,e,a){var s=t/this.radius,i=e/this.radius,n=0,r=a*this.radDeg,h=29.5*this.radDeg,o=45.5*this.radDeg,l=(Math.sin(h)+Math.sin(o))/2,m=Math.cos(h)*Math.cos(h)+2*l*Math.sin(h),c=Math.sqrt(m-2*l*Math.sin(n))/l,p=Math.sqrt(s*s+(c-i)*(c-i)),d=Math.atan(s/(c-i));return{lat:Math.asin((m-p*p*l*l)/(2*l))*this.degRad,lng:(r+d/l)*this.degRad}},lcc:function(t,e,a){var s=0,i=a*this.radDeg,n=e*this.radDeg,r=33*this.radDeg,h=45*this.radDeg,o=t*this.radDeg,l=Math.log(Math.cos(r)*(1/Math.cos(h)))/Math.log(Math.tan(Math.PI/4+h/2)*(1/Math.tan(Math.PI/4+r/2))),m=Math.cos(r)*Math.pow(Math.tan(Math.PI/4+r/2),l)/l,c=m*Math.pow(1/Math.tan(Math.PI/4+o/2),l),p=m*Math.pow(1/Math.tan(Math.PI/4+s/2),l);return{x:c*Math.sin(l*(n-i))*this.radius,y:-(p-c*Math.cos(l*(n-i)))*this.radius}},lcc_inv:function(t,e,a){var s=t/this.radius,i=e/this.radius,n=0,r=a*this.radDeg,h=33*this.radDeg,o=45*this.radDeg,l=Math.log(Math.cos(h)*(1/Math.cos(o)))/Math.log(Math.tan(Math.PI/4+o/2)*(1/Math.tan(Math.PI/4+h/2))),m=Math.cos(h)*Math.pow(Math.tan(Math.PI/4+h/2),l)/l,c=m*Math.pow(1/Math.tan(Math.PI/4+n/2),l),p=this.sgn(l)*Math.sqrt(s*s+(c-i)*(c-i)),d=Math.atan(s/(c-i));return{lat:(2*Math.atan(Math.pow(m/p,1/l))-Math.PI/2)*this.degRad,lng:(r+d/l)*this.degRad}}},jvm.MapObject=function(){},jvm.MapObject.prototype.getLabelText=function(t){var e;return e=this.config.label?"function"==typeof this.config.label.render?this.config.label.render(t):t:null},jvm.MapObject.prototype.getLabelOffsets=function(t){var e;return this.config.label&&("function"==typeof this.config.label.offsets?e=this.config.label.offsets(t):"object"==typeof this.config.label.offsets&&(e=this.config.label.offsets[t])),e||[0,0]},jvm.MapObject.prototype.setHovered=function(t){this.isHovered!==t&&(this.isHovered=t,this.shape.isHovered=t,this.shape.updateStyle(),this.label&&(this.label.isHovered=t,this.label.updateStyle()))},jvm.MapObject.prototype.setSelected=function(t){this.isSelected!==t&&(this.isSelected=t,this.shape.isSelected=t,this.shape.updateStyle(),this.label&&(this.label.isSelected=t,this.label.updateStyle()),jvm.$(this.shape).trigger("selected",[t]))},jvm.MapObject.prototype.setStyle=function(){this.shape.setStyle.apply(this.shape,arguments)},jvm.MapObject.prototype.remove=function(){this.shape.remove(),this.label&&this.label.remove()},jvm.Region=function(t){var e,a,s;this.config=t,this.map=this.config.map,this.shape=t.canvas.addPath({d:t.path,"data-code":t.code},t.style,t.canvas.rootElement),this.shape.addClass("jvectormap-region jvectormap-element"),e=this.shape.getBBox(),a=this.getLabelText(t.code),this.config.label&&a&&(s=this.getLabelOffsets(t.code),this.labelX=e.x+e.width/2+s[0],this.labelY=e.y+e.height/2+s[1],this.label=t.canvas.addText({text:a,"text-anchor":"middle","alignment-baseline":"central",x:this.labelX,y:this.labelY,"data-code":t.code},t.labelStyle,t.labelsGroup),this.label.addClass("jvectormap-region jvectormap-element"))},jvm.inherits(jvm.Region,jvm.MapObject),jvm.Region.prototype.updateLabelPosition=function(){this.label&&this.label.set({x:this.labelX*this.map.scale+this.map.transX*this.map.scale,y:this.labelY*this.map.scale+this.map.transY*this.map.scale})},jvm.Marker=function(t){var e;this.config=t,this.map=this.config.map,this.isImage=!!this.config.style.initial.image,this.createShape(),e=this.getLabelText(t.index),this.config.label&&e&&(this.offsets=this.getLabelOffsets(t.index),this.labelX=t.cx/this.map.scale-this.map.transX,this.labelY=t.cy/this.map.scale-this.map.transY,this.label=t.canvas.addText({text:e,"data-index":t.index,dy:"0.6ex",x:this.labelX,y:this.labelY},t.labelStyle,t.labelsGroup),this.label.addClass("jvectormap-marker jvectormap-element"))},jvm.inherits(jvm.Marker,jvm.MapObject),jvm.Marker.prototype.createShape=function(){var t=this;this.shape&&this.shape.remove(),this.shape=this.config.canvas[this.isImage?"addImage":"addCircle"]({"data-index":this.config.index,cx:this.config.cx,cy:this.config.cy},this.config.style,this.config.group),this.shape.addClass("jvectormap-marker jvectormap-element"),this.isImage&&jvm.$(this.shape.node).on("imageloaded",function(){t.updateLabelPosition()})},jvm.Marker.prototype.updateLabelPosition=function(){this.label&&this.label.set({x:this.labelX*this.map.scale+this.offsets[0]+this.map.transX*this.map.scale+5+(this.isImage?(this.shape.width||0)/2:this.shape.properties.r),y:this.labelY*this.map.scale+this.map.transY*this.map.scale+this.offsets[1]})},jvm.Marker.prototype.setStyle=function(t){var e;jvm.Marker.parentClass.prototype.setStyle.apply(this,arguments),"r"===t&&this.updateLabelPosition(),e=!!this.shape.get("image"),e!=this.isImage&&(this.isImage=e,this.config.style=jvm.$.extend(!0,{},this.shape.style),this.createShape())},jvm.Map=function(t){var e,a=this;if(this.params=jvm.$.extend(!0,{},jvm.Map.defaultParams,t),!jvm.Map.maps[this.params.map])throw new Error("Attempt to use map which was not loaded: "+this.params.map);this.mapData=jvm.Map.maps[this.params.map],this.markers={},this.regions={},this.regionsColors={},this.regionsData={},this.container=jvm.$("
").addClass("jvectormap-container"),this.params.container&&this.params.container.append(this.container),this.container.data("mapObject",this),this.defaultWidth=this.mapData.width,this.defaultHeight=this.mapData.height,this.setBackgroundColor(this.params.backgroundColor),this.onResize=function(){a.updateSize()},jvm.$(window).resize(this.onResize);for(e in jvm.Map.apiEvents)this.params[e]&&this.container.bind(jvm.Map.apiEvents[e]+".jvectormap",this.params[e]);this.canvas=new jvm.VectorCanvas(this.container[0],this.width,this.height),("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&this.params.bindTouchEvents&&this.bindContainerTouchEvents(),this.bindContainerEvents(),this.bindElementEvents(),this.createTip(),this.params.zoomButtons&&this.bindZoomButtons(),this.createRegions(),this.createMarkers(this.params.markers||{}),this.updateSize(),this.params.focusOn&&("string"==typeof this.params.focusOn?this.params.focusOn={region:this.params.focusOn}:jvm.$.isArray(this.params.focusOn)&&(this.params.focusOn={regions:this.params.focusOn}),this.setFocus(this.params.focusOn)),this.params.selectedRegions&&this.setSelectedRegions(this.params.selectedRegions),this.params.selectedMarkers&&this.setSelectedMarkers(this.params.selectedMarkers),this.legendCntHorizontal=jvm.$("
").addClass("jvectormap-legend-cnt jvectormap-legend-cnt-h"),this.legendCntVertical=jvm.$("
").addClass("jvectormap-legend-cnt jvectormap-legend-cnt-v"),this.container.append(this.legendCntHorizontal),this.container.append(this.legendCntVertical),this.params.series&&this.createSeries()},jvm.Map.prototype={transX:0,transY:0,scale:1,baseTransX:0,baseTransY:0,baseScale:1,width:0,height:0,setBackgroundColor:function(t){this.container.css("background-color",t)},resize:function(){var t=this.baseScale;this.width/this.height>this.defaultWidth/this.defaultHeight?(this.baseScale=this.height/this.defaultHeight,this.baseTransX=Math.abs(this.width-this.defaultWidth*this.baseScale)/(2*this.baseScale)):(this.baseScale=this.width/this.defaultWidth,this.baseTransY=Math.abs(this.height-this.defaultHeight*this.baseScale)/(2*this.baseScale)),this.scale*=this.baseScale/t,this.transX*=this.baseScale/t,this.transY*=this.baseScale/t},updateSize:function(){this.width=this.container.width(),this.height=this.container.height(),this.resize(),this.canvas.setSize(this.width,this.height),this.applyTransform()},reset:function(){var t,e;for(t in this.series)for(e=0;ee?this.transY=e:this.transYt?this.transX=t:this.transXd[1].pageX?d[1].pageX+(d[0].pageX-d[1].pageX)/2:d[0].pageX+(d[1].pageX-d[0].pageX)/2,n=d[0].pageY>d[1].pageY?d[1].pageY+(d[0].pageY-d[1].pageY)/2:d[0].pageY+(d[1].pageY-d[0].pageY)/2,i-=l.left,n-=l.top,t=h.scale,e=Math.sqrt(Math.pow(d[0].pageX-d[1].pageX,2)+Math.pow(d[0].pageY-d[1].pageY,2)))),r=d.length};jvm.$(this.container).bind("touchstart",o),jvm.$(this.container).bind("touchmove",o)},bindElementEvents:function(){var t,e=this;this.container.mousemove(function(){t=!0}),this.container.delegate("[class~='jvectormap-element']","mouseover mouseout",function(t){var a=jvm.$(this).attr("class").baseVal||jvm.$(this).attr("class"),s=-1===a.indexOf("jvectormap-region")?"marker":"region",i=jvm.$(this).attr("region"==s?"data-code":"data-index"),n="region"==s?e.regions[i].element:e.markers[i].element,r="region"==s?e.mapData.paths[i].name:e.markers[i].config.name||"",h=jvm.$.Event(s+"TipShow.jvectormap"),o=jvm.$.Event(s+"Over.jvectormap");"mouseover"==t.type?(e.container.trigger(o,[i]),o.isDefaultPrevented()||n.setHovered(!0),e.tip.text(r),e.container.trigger(h,[e.tip,i]),h.isDefaultPrevented()||(e.tip.show(),e.tipWidth=e.tip.width(),e.tipHeight=e.tip.height())):(n.setHovered(!1),e.tip.hide(),e.container.trigger(s+"Out.jvectormap",[i]))}),this.container.delegate("[class~='jvectormap-element']","mousedown",function(){t=!1}),this.container.delegate("[class~='jvectormap-element']","mouseup",function(){var a=jvm.$(this).attr("class").baseVal?jvm.$(this).attr("class").baseVal:jvm.$(this).attr("class"),s=-1===a.indexOf("jvectormap-region")?"marker":"region",i=jvm.$(this).attr("region"==s?"data-code":"data-index"),n=jvm.$.Event(s+"Click.jvectormap"),r="region"==s?e.regions[i].element:e.markers[i].element;t||(e.container.trigger(n,[i]),("region"===s&&e.params.regionsSelectable||"marker"===s&&e.params.markersSelectable)&&(n.isDefaultPrevented()||(e.params[s+"sSelectableOne"]&&e.clearSelected(s+"s"),r.setSelected(!r.isSelected))))})},bindZoomButtons:function(){var t=this;jvm.$("
").addClass("jvectormap-zoomin").text("+").appendTo(this.container),jvm.$("
").addClass("jvectormap-zoomout").html("−").appendTo(this.container),this.container.find(".jvectormap-zoomin").click(function(){t.setScale(t.scale*t.params.zoomStep,t.width/2,t.height/2,!1,t.params.zoomAnimate)}),this.container.find(".jvectormap-zoomout").click(function(){t.setScale(t.scale/t.params.zoomStep,t.width/2,t.height/2,!1,t.params.zoomAnimate)})},createTip:function(){var t=this;this.tip=jvm.$("
").addClass("jvectormap-tip").appendTo(jvm.$("body")),this.container.mousemove(function(e){var a=e.pageX-15-t.tipWidth,s=e.pageY-15-t.tipHeight;5>a&&(a=e.pageX+15),5>s&&(s=e.pageY+15),t.tip.is(":visible")&&t.tip.css({left:a,top:s})})},setScale:function(t,e,a,s,i){var n,r,h,o,l,m,c,p,d,u=jvm.$.Event("zoom.jvectormap"),v=this,g=0,f=Math.abs(Math.round(60*(t-this.scale)/Math.max(t,this.scale))),j=new jvm.$.Deferred;return t>this.params.zoomMax*this.baseScale?t=this.params.zoomMax*this.baseScale:t0?(r=this.scale,h=(t-r)/f,o=this.transX*this.scale,m=this.transY*this.scale,l=(p*t-o)/f,c=(d*t-m)/f,n=setInterval(function(){g+=1,v.scale=r+h*g,v.transX=(o+l*g)/v.scale,v.transY=(m+c*g)/v.scale,v.applyTransform(),g==f&&(clearInterval(n),v.container.trigger(u,[t/v.baseScale]),j.resolve())},10)):(this.transX=p,this.transY=d,this.scale=t,this.applyTransform(),this.container.trigger(u,[t/this.baseScale]),j.resolve()),j},setFocus:function(t){var e,a,s,i,n,r;if(t=t||{},t.region?i=[t.region]:t.regions&&(i=t.regions),i){for(n=0;ne&&(e+=360),a=jvm.Proj[n.type](t,e,r),s=this.getInsetForPoint(a.x,a.y),s?(i=s.bbox,a.x=(a.x-i[0].x)/(i[1].x-i[0].x)*s.width*this.scale,a.y=(a.y-i[0].y)/(i[1].y-i[0].y)*s.height*this.scale,{x:a.x+this.transX*this.scale+s.left*this.scale,y:a.y+this.transY*this.scale+s.top*this.scale}):!1},pointToLatLng:function(t,e){var a,s,i,n,r,h=jvm.Map.maps[this.params.map].projection,o=h.centralMeridian,l=jvm.Map.maps[this.params.map].insets;for(a=0;ai[0].x&&ni[0].y&&rs[0].x&&ts[0].y&&e").addClass("jvectormap-goback").text("Back").appendTo(this.params.container),this.backButton.hide(),this.backButton.click(function(){e.goBack()}),this.spinner=jvm.$("
").addClass("jvectormap-spinner").appendTo(this.params.container),this.spinner.hide()},jvm.MultiMap.prototype={addMap:function(t,e){var a=jvm.$("
").css({width:"100%",height:"100%"});return this.params.container.append(a),this.maps[t]=new jvm.Map(jvm.$.extend(e,{container:a})),this.params.maxLevel>e.multiMapLevel&&this.maps[t].container.on("regionClick.jvectormap",{scope:this},function(t,e){var a=t.data.scope,s=a.params.mapNameByCode(e,a);a.drillDownPromise&&"pending"===a.drillDownPromise.state()||a.drillDown(s,e)}),this.maps[t]},downloadMap:function(t){var e=this,a=jvm.$.Deferred();return this.mapsLoaded[t]?a.resolve():jvm.$.get(this.params.mapUrlByCode(t,this)).then(function(){e.mapsLoaded[t]=!0,a.resolve()},function(){a.reject()}),a},drillDown:function(t,e){var a=this.history[this.history.length-1],s=this,i=a.setFocus({region:e,animate:!0}),n=this.downloadMap(e);i.then(function(){"pending"===n.state()&&s.spinner.show()}),n.always(function(){s.spinner.hide()}),this.drillDownPromise=jvm.$.when(n,i),this.drillDownPromise.then(function(){a.params.container.hide(),s.maps[t]?s.maps[t].params.container.show():s.addMap(t,{map:t,multiMapLevel:a.params.multiMapLevel+1}),s.history.push(s.maps[t]),s.backButton.show()})},goBack:function(){var t=this.history.pop(),e=this.history[this.history.length-1],a=this;t.setFocus({scale:1,x:.5,y:.5,animate:!0}).then(function(){t.params.container.hide(),e.params.container.show(),e.updateSize(),1===a.history.length&&a.backButton.hide(),e.setFocus({scale:1,x:.5,y:.5,animate:!0})})}},jvm.MultiMap.defaultParams={mapNameByCode:function(t,e){return t.toLowerCase()+"_"+e.defaultProjection+"_en"},mapUrlByCode:function(t,e){return"jquery-jvectormap-data-"+t.toLowerCase()+"-"+e.defaultProjection+"-en.js"}}; \ No newline at end of file diff --git a/production/js/maps/jquery-jvectormap-2.0.3.min.js b/production/js/maps/jquery-jvectormap-2.0.3.min.js new file mode 100755 index 00000000..eafa898c --- /dev/null +++ b/production/js/maps/jquery-jvectormap-2.0.3.min.js @@ -0,0 +1,2 @@ +!function($){var apiParams={set:{colors:1,values:1,backgroundColor:1,scaleColors:1,normalizeFunction:1,focus:1},get:{selectedRegions:1,selectedMarkers:1,mapObject:1,regionName:1}};$.fn.vectorMap=function(options){var map,methodName,map=this.children(".jvectormap-container").data("mapObject");if("addMap"===options)jvm.Map.maps[arguments[1]]=arguments[2];else{if(("set"===options||"get"===options)&&apiParams[options][arguments[1]])return methodName=arguments[1].charAt(0).toUpperCase()+arguments[1].substr(1),map[options+methodName].apply(map,Array.prototype.slice.call(arguments,2));options=options||{},options.container=this,map=new jvm.Map(options)}return this}}(jQuery),function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof exports?module.exports=factory:factory(jQuery)}(function($){function handler(event){var orgEvent=event||window.event,args=slice.call(arguments,1),delta=0,deltaX=0,deltaY=0,absDelta=0;if(event=$.event.fix(orgEvent),event.type="mousewheel","detail"in orgEvent&&(deltaY=-1*orgEvent.detail),"wheelDelta"in orgEvent&&(deltaY=orgEvent.wheelDelta),"wheelDeltaY"in orgEvent&&(deltaY=orgEvent.wheelDeltaY),"wheelDeltaX"in orgEvent&&(deltaX=-1*orgEvent.wheelDeltaX),"axis"in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS&&(deltaX=-1*deltaY,deltaY=0),delta=0===deltaY?deltaX:deltaY,"deltaY"in orgEvent&&(deltaY=-1*orgEvent.deltaY,delta=deltaY),"deltaX"in orgEvent&&(deltaX=orgEvent.deltaX,0===deltaY&&(delta=-1*deltaX)),0!==deltaY||0!==deltaX){if(1===orgEvent.deltaMode){var lineHeight=$.data(this,"mousewheel-line-height");delta*=lineHeight,deltaY*=lineHeight,deltaX*=lineHeight}else if(2===orgEvent.deltaMode){var pageHeight=$.data(this,"mousewheel-page-height");delta*=pageHeight,deltaY*=pageHeight,deltaX*=pageHeight}return absDelta=Math.max(Math.abs(deltaY),Math.abs(deltaX)),(!lowestDelta||lowestDelta>absDelta)&&(lowestDelta=absDelta,shouldAdjustOldDeltas(orgEvent,absDelta)&&(lowestDelta/=40)),shouldAdjustOldDeltas(orgEvent,absDelta)&&(delta/=40,deltaX/=40,deltaY/=40),delta=Math[delta>=1?"floor":"ceil"](delta/lowestDelta),deltaX=Math[deltaX>=1?"floor":"ceil"](deltaX/lowestDelta),deltaY=Math[deltaY>=1?"floor":"ceil"](deltaY/lowestDelta),event.deltaX=deltaX,event.deltaY=deltaY,event.deltaFactor=lowestDelta,event.deltaMode=0,args.unshift(event,delta,deltaX,deltaY),nullLowestDeltaTimeout&&clearTimeout(nullLowestDeltaTimeout),nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200),($.event.dispatch||$.event.handle).apply(this,args)}}function nullLowestDelta(){lowestDelta=null}function shouldAdjustOldDeltas(orgEvent,absDelta){return special.settings.adjustOldDeltas&&"mousewheel"===orgEvent.type&&absDelta%120===0}var nullLowestDeltaTimeout,lowestDelta,toFix=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],toBind="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],slice=Array.prototype.slice;if($.event.fixHooks)for(var i=toFix.length;i;)$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;var special=$.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener)for(var i=toBind.length;i;)this.addEventListener(toBind[--i],handler,!1);else this.onmousewheel=handler;$.data(this,"mousewheel-line-height",special.getLineHeight(this)),$.data(this,"mousewheel-page-height",special.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var i=toBind.length;i;)this.removeEventListener(toBind[--i],handler,!1);else this.onmousewheel=null},getLineHeight:function(elem){return parseInt($(elem)["offsetParent"in $.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(elem){return $(elem).height()},settings:{adjustOldDeltas:!0}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",fn)}})});var jvm={inherits:function(child,parent){function temp(){}temp.prototype=parent.prototype,child.prototype=new temp,child.prototype.constructor=child,child.parentClass=parent},mixin:function(target,source){var prop;for(prop in source.prototype)source.prototype.hasOwnProperty(prop)&&(target.prototype[prop]=source.prototype[prop])},min:function(values){var i,min=Number.MAX_VALUE;if(values instanceof Array)for(i=0;imax&&(max=values[i]);else for(i in values)values[i]>max&&(max=values[i]);return max},keys:function(object){var key,keys=[];for(key in object)keys.push(key);return keys},values:function(object){var key,i,values=[];for(i=0;i");return img.error(function(){deferred.reject()}).load(function(){deferred.resolve(img)}),img.attr("src",url),deferred},isImageUrl:function(s){return/\.\w{3,4}$/.test(s)}};jvm.$=jQuery,Array.prototype.indexOf||(Array.prototype.indexOf=function(searchElement,fromIndex){var k;if(null==this)throw new TypeError('"this" is null or not defined');var O=Object(this),len=O.length>>>0;if(0===len)return-1;var n=+fromIndex||0;if(1/0===Math.abs(n)&&(n=0),n>=len)return-1;for(k=Math.max(n>=0?n:len-Math.abs(n),0);len>k;){if(k in O&&O[k]===searchElement)return k;k++}return-1}),jvm.AbstractElement=function(name,config){this.node=this.createElement(name),this.name=name,this.properties={},config&&this.set(config)},jvm.AbstractElement.prototype.set=function(property,value){var key;if("object"==typeof property)for(key in property)this.properties[key]=property[key],this.applyAttr(key,property[key]);else this.properties[property]=value,this.applyAttr(property,value)},jvm.AbstractElement.prototype.get=function(property){return this.properties[property]},jvm.AbstractElement.prototype.applyAttr=function(property,value){this.node.setAttribute(property,value)},jvm.AbstractElement.prototype.remove=function(){jvm.$(this.node).remove()},jvm.AbstractCanvasElement=function(container,width,height){this.container=container,this.setSize(width,height),this.rootElement=new jvm[this.classPrefix+"GroupElement"],this.node.appendChild(this.rootElement.node),this.container.appendChild(this.node)},jvm.AbstractCanvasElement.prototype.add=function(element,group){group=group||this.rootElement,group.add(element),element.canvas=this},jvm.AbstractCanvasElement.prototype.addPath=function(config,style,group){var el=new jvm[this.classPrefix+"PathElement"](config,style);return this.add(el,group),el},jvm.AbstractCanvasElement.prototype.addCircle=function(config,style,group){var el=new jvm[this.classPrefix+"CircleElement"](config,style);return this.add(el,group),el},jvm.AbstractCanvasElement.prototype.addImage=function(config,style,group){var el=new jvm[this.classPrefix+"ImageElement"](config,style);return this.add(el,group),el},jvm.AbstractCanvasElement.prototype.addText=function(config,style,group){var el=new jvm[this.classPrefix+"TextElement"](config,style);return this.add(el,group),el},jvm.AbstractCanvasElement.prototype.addGroup=function(parentGroup){var el=new jvm[this.classPrefix+"GroupElement"];return parentGroup?parentGroup.node.appendChild(el.node):this.node.appendChild(el.node),el.canvas=this,el},jvm.AbstractShapeElement=function(name,config,style){this.style=style||{},this.style.current=this.style.current||{},this.isHovered=!1,this.isSelected=!1,this.updateStyle()},jvm.AbstractShapeElement.prototype.setStyle=function(property,value){var styles={};"object"==typeof property?styles=property:styles[property]=value,jvm.$.extend(this.style.current,styles),this.updateStyle()},jvm.AbstractShapeElement.prototype.updateStyle=function(){var attrs={};jvm.AbstractShapeElement.mergeStyles(attrs,this.style.initial),jvm.AbstractShapeElement.mergeStyles(attrs,this.style.current),this.isHovered&&jvm.AbstractShapeElement.mergeStyles(attrs,this.style.hover),this.isSelected&&(jvm.AbstractShapeElement.mergeStyles(attrs,this.style.selected),this.isHovered&&jvm.AbstractShapeElement.mergeStyles(attrs,this.style.selectedHover)),this.set(attrs)},jvm.AbstractShapeElement.mergeStyles=function(styles,newStyles){var key;newStyles=newStyles||{};for(key in newStyles)null===newStyles[key]?delete styles[key]:styles[key]=newStyles[key]},jvm.SVGElement=function(){jvm.SVGElement.parentClass.apply(this,arguments)},jvm.inherits(jvm.SVGElement,jvm.AbstractElement),jvm.SVGElement.svgns="http://www.w3.org/2000/svg",jvm.SVGElement.prototype.createElement=function(tagName){return document.createElementNS(jvm.SVGElement.svgns,tagName)},jvm.SVGElement.prototype.addClass=function(className){this.node.setAttribute("class",className)},jvm.SVGElement.prototype.getElementCtr=function(ctr){return jvm["SVG"+ctr]},jvm.SVGElement.prototype.getBBox=function(){return this.node.getBBox()},jvm.SVGGroupElement=function(){jvm.SVGGroupElement.parentClass.call(this,"g")},jvm.inherits(jvm.SVGGroupElement,jvm.SVGElement),jvm.SVGGroupElement.prototype.add=function(element){this.node.appendChild(element.node)},jvm.SVGCanvasElement=function(){this.classPrefix="SVG",jvm.SVGCanvasElement.parentClass.call(this,"svg"),this.defsElement=new jvm.SVGElement("defs"),this.node.appendChild(this.defsElement.node),jvm.AbstractCanvasElement.apply(this,arguments)},jvm.inherits(jvm.SVGCanvasElement,jvm.SVGElement),jvm.mixin(jvm.SVGCanvasElement,jvm.AbstractCanvasElement),jvm.SVGCanvasElement.prototype.setSize=function(width,height){this.width=width,this.height=height,this.node.setAttribute("width",width),this.node.setAttribute("height",height)},jvm.SVGCanvasElement.prototype.applyTransformParams=function(scale,transX,transY){this.scale=scale,this.transX=transX,this.transY=transY,this.rootElement.node.setAttribute("transform","scale("+scale+") translate("+transX+", "+transY+")")},jvm.SVGShapeElement=function(name,config){jvm.SVGShapeElement.parentClass.call(this,name,config),jvm.AbstractShapeElement.apply(this,arguments)},jvm.inherits(jvm.SVGShapeElement,jvm.SVGElement),jvm.mixin(jvm.SVGShapeElement,jvm.AbstractShapeElement),jvm.SVGShapeElement.prototype.applyAttr=function(attr,value){var patternEl,imageEl,that=this;"fill"===attr&&jvm.isImageUrl(value)?jvm.SVGShapeElement.images[value]?this.applyAttr("fill","url(#image"+jvm.SVGShapeElement.images[value]+")"):jvm.whenImageLoaded(value).then(function(img){imageEl=new jvm.SVGElement("image"),imageEl.node.setAttributeNS("http://www.w3.org/1999/xlink","href",value),imageEl.applyAttr("x","0"),imageEl.applyAttr("y","0"),imageEl.applyAttr("width",img[0].width),imageEl.applyAttr("height",img[0].height),patternEl=new jvm.SVGElement("pattern"),patternEl.applyAttr("id","image"+jvm.SVGShapeElement.imageCounter),patternEl.applyAttr("x",0),patternEl.applyAttr("y",0),patternEl.applyAttr("width",img[0].width/2),patternEl.applyAttr("height",img[0].height/2),patternEl.applyAttr("viewBox","0 0 "+img[0].width+" "+img[0].height),patternEl.applyAttr("patternUnits","userSpaceOnUse"),patternEl.node.appendChild(imageEl.node),that.canvas.defsElement.node.appendChild(patternEl.node),jvm.SVGShapeElement.images[value]=jvm.SVGShapeElement.imageCounter++,that.applyAttr("fill","url(#image"+jvm.SVGShapeElement.images[value]+")")}):jvm.SVGShapeElement.parentClass.prototype.applyAttr.apply(this,arguments)},jvm.SVGShapeElement.imageCounter=1,jvm.SVGShapeElement.images={},jvm.SVGPathElement=function(config,style){jvm.SVGPathElement.parentClass.call(this,"path",config,style),this.node.setAttribute("fill-rule","evenodd")},jvm.inherits(jvm.SVGPathElement,jvm.SVGShapeElement),jvm.SVGCircleElement=function(config,style){jvm.SVGCircleElement.parentClass.call(this,"circle",config,style)},jvm.inherits(jvm.SVGCircleElement,jvm.SVGShapeElement),jvm.SVGImageElement=function(config,style){jvm.SVGImageElement.parentClass.call(this,"image",config,style)},jvm.inherits(jvm.SVGImageElement,jvm.SVGShapeElement),jvm.SVGImageElement.prototype.applyAttr=function(attr,value){var that=this;"image"==attr?jvm.whenImageLoaded(value).then(function(img){that.node.setAttributeNS("http://www.w3.org/1999/xlink","href",value),that.width=img[0].width,that.height=img[0].height,that.applyAttr("width",that.width),that.applyAttr("height",that.height),that.applyAttr("x",that.cx-that.width/2),that.applyAttr("y",that.cy-that.height/2),jvm.$(that.node).trigger("imageloaded",[img])}):"cx"==attr?(this.cx=value,this.width&&this.applyAttr("x",value-this.width/2)):"cy"==attr?(this.cy=value,this.height&&this.applyAttr("y",value-this.height/2)):jvm.SVGImageElement.parentClass.prototype.applyAttr.apply(this,arguments)},jvm.SVGTextElement=function(config,style){jvm.SVGTextElement.parentClass.call(this,"text",config,style)},jvm.inherits(jvm.SVGTextElement,jvm.SVGShapeElement),jvm.SVGTextElement.prototype.applyAttr=function(attr,value){"text"===attr?this.node.textContent=value:jvm.SVGTextElement.parentClass.prototype.applyAttr.apply(this,arguments)},jvm.VMLElement=function(){jvm.VMLElement.VMLInitialized||jvm.VMLElement.initializeVML(),jvm.VMLElement.parentClass.apply(this,arguments)},jvm.inherits(jvm.VMLElement,jvm.AbstractElement),jvm.VMLElement.VMLInitialized=!1,jvm.VMLElement.initializeVML=function(){try{document.namespaces.rvml||document.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),jvm.VMLElement.prototype.createElement=function(tagName){return document.createElement("')}}catch(e){jvm.VMLElement.prototype.createElement=function(tagName){return document.createElement("<"+tagName+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"),jvm.VMLElement.VMLInitialized=!0},jvm.VMLElement.prototype.getElementCtr=function(ctr){return jvm["VML"+ctr]},jvm.VMLElement.prototype.addClass=function(className){jvm.$(this.node).addClass(className)},jvm.VMLElement.prototype.applyAttr=function(attr,value){this.node[attr]=value},jvm.VMLElement.prototype.getBBox=function(){var node=jvm.$(this.node);return{x:node.position().left/this.canvas.scale,y:node.position().top/this.canvas.scale,width:node.width()/this.canvas.scale,height:node.height()/this.canvas.scale}},jvm.VMLGroupElement=function(){jvm.VMLGroupElement.parentClass.call(this,"group"),this.node.style.left="0px",this.node.style.top="0px",this.node.coordorigin="0 0"},jvm.inherits(jvm.VMLGroupElement,jvm.VMLElement),jvm.VMLGroupElement.prototype.add=function(element){this.node.appendChild(element.node)},jvm.VMLCanvasElement=function(){this.classPrefix="VML",jvm.VMLCanvasElement.parentClass.call(this,"group"),jvm.AbstractCanvasElement.apply(this,arguments),this.node.style.position="absolute"},jvm.inherits(jvm.VMLCanvasElement,jvm.VMLElement),jvm.mixin(jvm.VMLCanvasElement,jvm.AbstractCanvasElement),jvm.VMLCanvasElement.prototype.setSize=function(width,height){var paths,groups,i,l;if(this.width=width,this.height=height,this.node.style.width=width+"px",this.node.style.height=height+"px",this.node.coordsize=width+" "+height,this.node.coordorigin="0 0",this.rootElement){for(paths=this.rootElement.node.getElementsByTagName("shape"),i=0,l=paths.length;l>i;i++)paths[i].coordsize=width+" "+height,paths[i].style.width=width+"px",paths[i].style.height=height+"px";for(groups=this.node.getElementsByTagName("group"),i=0,l=groups.length;l>i;i++)groups[i].coordsize=width+" "+height,groups[i].style.width=width+"px",groups[i].style.height=height+"px"}},jvm.VMLCanvasElement.prototype.applyTransformParams=function(scale,transX,transY){this.scale=scale,this.transX=transX,this.transY=transY,this.rootElement.node.coordorigin=this.width-transX-this.width/100+","+(this.height-transY-this.height/100),this.rootElement.node.coordsize=this.width/scale+","+this.height/scale},jvm.VMLShapeElement=function(name,config){jvm.VMLShapeElement.parentClass.call(this,name,config),this.fillElement=new jvm.VMLElement("fill"),this.strokeElement=new jvm.VMLElement("stroke"),this.node.appendChild(this.fillElement.node),this.node.appendChild(this.strokeElement.node),this.node.stroked=!1,jvm.AbstractShapeElement.apply(this,arguments)},jvm.inherits(jvm.VMLShapeElement,jvm.VMLElement),jvm.mixin(jvm.VMLShapeElement,jvm.AbstractShapeElement),jvm.VMLShapeElement.prototype.applyAttr=function(attr,value){switch(attr){case"fill":this.node.fillcolor=value;break;case"fill-opacity":this.fillElement.node.opacity=Math.round(100*value)+"%";break;case"stroke":this.node.stroked="none"===value?!1:!0,this.node.strokecolor=value;break;case"stroke-opacity":this.strokeElement.node.opacity=Math.round(100*value)+"%";break;case"stroke-width":this.node.stroked=0===parseInt(value,10)?!1:!0,this.node.strokeweight=value;break;case"d":this.node.path=jvm.VMLPathElement.pathSvgToVml(value);break;default:jvm.VMLShapeElement.parentClass.prototype.applyAttr.apply(this,arguments)}},jvm.VMLPathElement=function(config,style){var scale=new jvm.VMLElement("skew");jvm.VMLPathElement.parentClass.call(this,"shape",config,style),this.node.coordorigin="0 0",scale.node.on=!0,scale.node.matrix="0.01,0,0,0.01,0,0",scale.node.offset="0,0",this.node.appendChild(scale.node)},jvm.inherits(jvm.VMLPathElement,jvm.VMLShapeElement),jvm.VMLPathElement.prototype.applyAttr=function(attr,value){"d"===attr?this.node.path=jvm.VMLPathElement.pathSvgToVml(value):jvm.VMLShapeElement.prototype.applyAttr.call(this,attr,value)},jvm.VMLPathElement.pathSvgToVml=function(path){var ctrlx,ctrly,cx=0,cy=0;return path=path.replace(/(-?\d+)e(-?\d+)/g,"0"),path.replace(/([MmLlHhVvCcSs])\s*((?:-?\d*(?:\.\d+)?\s*,?\s*)+)/g,function(segment,letter,coords){coords=coords.replace(/(\d)-/g,"$1,-").replace(/^\s+/g,"").replace(/\s+$/g,"").replace(/\s+/g,",").split(","),coords[0]||coords.shift();for(var i=0,l=coords.length;l>i;i++)coords[i]=Math.round(100*coords[i]);switch(letter){case"m":return cx+=coords[0],cy+=coords[1],"t"+coords.join(",");case"M":return cx=coords[0],cy=coords[1],"m"+coords.join(",");case"l":return cx+=coords[0],cy+=coords[1],"r"+coords.join(",");case"L":return cx=coords[0],cy=coords[1],"l"+coords.join(",");case"h":return cx+=coords[0],"r"+coords[0]+",0";case"H":return cx=coords[0],"l"+cx+","+cy;case"v":return cy+=coords[0],"r0,"+coords[0];case"V":return cy=coords[0],"l"+cx+","+cy;case"c":return ctrlx=cx+coords[coords.length-4],ctrly=cy+coords[coords.length-3],cx+=coords[coords.length-2],cy+=coords[coords.length-1],"v"+coords.join(",");case"C":return ctrlx=coords[coords.length-4],ctrly=coords[coords.length-3],cx=coords[coords.length-2],cy=coords[coords.length-1],"c"+coords.join(",");case"s":return coords.unshift(cy-ctrly),coords.unshift(cx-ctrlx),ctrlx=cx+coords[coords.length-4],ctrly=cy+coords[coords.length-3],cx+=coords[coords.length-2],cy+=coords[coords.length-1],"v"+coords.join(",");case"S":return coords.unshift(cy+cy-ctrly),coords.unshift(cx+cx-ctrlx),ctrlx=coords[coords.length-4],ctrly=coords[coords.length-3],cx=coords[coords.length-2],cy=coords[coords.length-1],"c"+coords.join(",")}return""}).replace(/z/g,"e")},jvm.VMLCircleElement=function(config,style){jvm.VMLCircleElement.parentClass.call(this,"oval",config,style)},jvm.inherits(jvm.VMLCircleElement,jvm.VMLShapeElement),jvm.VMLCircleElement.prototype.applyAttr=function(attr,value){switch(attr){case"r":this.node.style.width=2*value+"px",this.node.style.height=2*value+"px",this.applyAttr("cx",this.get("cx")||0),this.applyAttr("cy",this.get("cy")||0);break;case"cx":if(!value)return;this.node.style.left=value-(this.get("r")||0)+"px";break;case"cy":if(!value)return;this.node.style.top=value-(this.get("r")||0)+"px";break;default:jvm.VMLCircleElement.parentClass.prototype.applyAttr.call(this,attr,value)}},jvm.VectorCanvas=function(container,width,height){return this.mode=window.SVGAngle?"svg":"vml",this.impl="svg"==this.mode?new jvm.SVGCanvasElement(container,width,height):new jvm.VMLCanvasElement(container,width,height),this.impl.mode=this.mode,this.impl},jvm.SimpleScale=function(scale){this.scale=scale},jvm.SimpleScale.prototype.getValue=function(value){return value},jvm.OrdinalScale=function(scale){this.scale=scale},jvm.OrdinalScale.prototype.getValue=function(value){return this.scale[value]},jvm.OrdinalScale.prototype.getTicks=function(){var key,ticks=[];for(key in this.scale)ticks.push({label:key,value:this.scale[key]});return ticks},jvm.NumericScale=function(scale,normalizeFunction,minValue,maxValue){this.scale=[],normalizeFunction=normalizeFunction||"linear",scale&&this.setScale(scale),normalizeFunction&&this.setNormalizeFunction(normalizeFunction),"undefined"!=typeof minValue&&this.setMin(minValue),"undefined"!=typeof maxValue&&this.setMax(maxValue)},jvm.NumericScale.prototype={setMin:function(min){this.clearMinValue=min,this.minValue="function"==typeof this.normalize?this.normalize(min):min},setMax:function(max){this.clearMaxValue=max,this.maxValue="function"==typeof this.normalize?this.normalize(max):max},setScale:function(scale){var i;for(this.scale=[],i=0;i=0;)value-=lengthes[i],i++;return value=this.vectorToNum(i==this.scale.length-1?this.scale[i]:this.vectorAdd(this.scale[i],this.vectorMult(this.vectorSubtract(this.scale[i+1],this.scale[i]),value/lengthes[i])))},vectorToNum:function(vector){var i,num=0;for(i=0;i=err?step*=10:.35>=err?step*=5:.75>=err&&(step*=2),extent[0]=Math.floor(extent[0]/step)*step,extent[1]=Math.ceil(extent[1]/step)*step,tick=extent[0];tick<=extent[1];)v=tick==extent[0]?this.clearMinValue:tick==extent[1]?this.clearMaxValue:tick,ticks.push({label:tick,value:this.getValue(v)}),tick+=step;return ticks}},jvm.ColorScale=function(){jvm.ColorScale.parentClass.apply(this,arguments)},jvm.inherits(jvm.ColorScale,jvm.NumericScale),jvm.ColorScale.prototype.setScale=function(scale){var i;for(i=0;i"),this.body.addClass("jvectormap-legend"),this.params.cssClass&&this.body.addClass(this.params.cssClass),params.vertical?this.map.legendCntVertical.append(this.body):this.map.legendCntHorizontal.append(this.body),this.render()},jvm.Legend.prototype.render=function(){var i,tick,sample,label,ticks=this.series.scale.getTicks(),inner=jvm.$("
").addClass("jvectormap-legend-inner");for(this.body.html(""),this.params.title&&this.body.append(jvm.$("
").addClass("jvectormap-legend-title").html(this.params.title)),this.body.append(inner),i=0;i").addClass("jvectormap-legend-tick"),sample=jvm.$("
").addClass("jvectormap-legend-tick-sample"),this.series.params.attribute){case"fill":jvm.isImageUrl(ticks[i].value)?sample.css("background","url("+ticks[i].value+")"):sample.css("background",ticks[i].value);break;case"stroke":sample.css("background",ticks[i].value);break;case"image":sample.css("background","url("+ticks[i].value+") no-repeat center center");break;case"r":jvm.$("
").css({"border-radius":ticks[i].value,border:this.map.params.markerStyle.initial["stroke-width"]+"px "+this.map.params.markerStyle.initial.stroke+" solid",width:2*ticks[i].value+"px",height:2*ticks[i].value+"px",background:this.map.params.markerStyle.initial.fill}).appendTo(sample)}tick.append(sample),label=ticks[i].label,this.params.labelRender&&(label=this.params.labelRender(label)),tick.append(jvm.$("
"+label+"
").addClass("jvectormap-legend-tick-text")),inner.append(tick)}inner.append(jvm.$("
").css("clear","both"))},jvm.DataSeries=function(params,elements,map){var scaleConstructor;params=params||{},params.attribute=params.attribute||"fill",this.elements=elements,this.params=params,this.map=map,params.attributes&&this.setAttributes(params.attributes),jvm.$.isArray(params.scale)?(scaleConstructor="fill"===params.attribute||"stroke"===params.attribute?jvm.ColorScale:jvm.NumericScale,this.scale=new scaleConstructor(params.scale,params.normalizeFunction,params.min,params.max)):this.scale=params.scale?new jvm.OrdinalScale(params.scale):new jvm.SimpleScale(params.scale),this.values=params.values||{},this.setValues(this.values),this.params.legend&&(this.legend=new jvm.Legend($.extend({map:this.map,series:this},this.params.legend)))},jvm.DataSeries.prototype={setAttributes:function(key,attr){var code,attrs=key;if("string"==typeof key)this.elements[key]&&this.elements[key].setStyle(this.params.attribute,attr);else for(code in attrs)this.elements[code]&&this.elements[code].element.setStyle(this.params.attribute,attrs[code])},setValues:function(values){var val,cc,max=-Number.MAX_VALUE,min=Number.MAX_VALUE,attrs={};if(this.scale instanceof jvm.OrdinalScale||this.scale instanceof jvm.SimpleScale)for(cc in values)attrs[cc]=values[cc]?this.scale.getValue(values[cc]):this.elements[cc].element.style.initial[this.params.attribute];else{if("undefined"==typeof this.params.min||"undefined"==typeof this.params.max)for(cc in values)val=parseFloat(values[cc]),val>max&&(max=val),min>val&&(min=val);"undefined"==typeof this.params.min?(this.scale.setMin(min),this.params.min=min):this.scale.setMin(this.params.min),"undefined"==typeof this.params.max?(this.scale.setMax(max),this.params.max=max):this.scale.setMax(this.params.max);for(cc in values)"indexOf"!=cc&&(val=parseFloat(values[cc]),attrs[cc]=isNaN(val)?this.elements[cc].element.style.initial[this.params.attribute]:this.scale.getValue(val))}this.setAttributes(attrs),jvm.$.extend(this.values,values)},clear:function(){var key,attrs={};for(key in this.values)this.elements[key]&&(attrs[key]=this.elements[key].element.shape.style.initial[this.params.attribute]);this.setAttributes(attrs),this.values={}},setScale:function(scale){this.scale.setScale(scale),this.values&&this.setValues(this.values)},setNormalizeFunction:function(f){this.scale.setNormalizeFunction(f),this.values&&this.setValues(this.values)}},jvm.Proj={degRad:180/Math.PI,radDeg:Math.PI/180,radius:6381372,sgn:function(n){return n>0?1:0>n?-1:n},mill:function(lat,lng,c){return{x:this.radius*(lng-c)*this.radDeg,y:-this.radius*Math.log(Math.tan((45+.4*lat)*this.radDeg))/.8}},mill_inv:function(x,y,c){return{lat:(2.5*Math.atan(Math.exp(.8*y/this.radius))-5*Math.PI/8)*this.degRad,lng:(c*this.radDeg+x/this.radius)*this.degRad}},merc:function(lat,lng,c){return{x:this.radius*(lng-c)*this.radDeg,y:-this.radius*Math.log(Math.tan(Math.PI/4+lat*Math.PI/360))}},merc_inv:function(x,y,c){return{lat:(2*Math.atan(Math.exp(y/this.radius))-Math.PI/2)*this.degRad,lng:(c*this.radDeg+x/this.radius)*this.degRad}},aea:function(lat,lng,c){var fi0=0,lambda0=c*this.radDeg,fi1=29.5*this.radDeg,fi2=45.5*this.radDeg,fi=lat*this.radDeg,lambda=lng*this.radDeg,n=(Math.sin(fi1)+Math.sin(fi2))/2,C=Math.cos(fi1)*Math.cos(fi1)+2*n*Math.sin(fi1),theta=n*(lambda-lambda0),ro=Math.sqrt(C-2*n*Math.sin(fi))/n,ro0=Math.sqrt(C-2*n*Math.sin(fi0))/n;return{x:ro*Math.sin(theta)*this.radius,y:-(ro0-ro*Math.cos(theta))*this.radius}},aea_inv:function(xCoord,yCoord,c){var x=xCoord/this.radius,y=yCoord/this.radius,fi0=0,lambda0=c*this.radDeg,fi1=29.5*this.radDeg,fi2=45.5*this.radDeg,n=(Math.sin(fi1)+Math.sin(fi2))/2,C=Math.cos(fi1)*Math.cos(fi1)+2*n*Math.sin(fi1),ro0=Math.sqrt(C-2*n*Math.sin(fi0))/n,ro=Math.sqrt(x*x+(ro0-y)*(ro0-y)),theta=Math.atan(x/(ro0-y));return{lat:Math.asin((C-ro*ro*n*n)/(2*n))*this.degRad,lng:(lambda0+theta/n)*this.degRad}},lcc:function(lat,lng,c){var fi0=0,lambda0=c*this.radDeg,lambda=lng*this.radDeg,fi1=33*this.radDeg,fi2=45*this.radDeg,fi=lat*this.radDeg,n=Math.log(Math.cos(fi1)*(1/Math.cos(fi2)))/Math.log(Math.tan(Math.PI/4+fi2/2)*(1/Math.tan(Math.PI/4+fi1/2))),F=Math.cos(fi1)*Math.pow(Math.tan(Math.PI/4+fi1/2),n)/n,ro=F*Math.pow(1/Math.tan(Math.PI/4+fi/2),n),ro0=F*Math.pow(1/Math.tan(Math.PI/4+fi0/2),n);return{x:ro*Math.sin(n*(lambda-lambda0))*this.radius,y:-(ro0-ro*Math.cos(n*(lambda-lambda0)))*this.radius}},lcc_inv:function(xCoord,yCoord,c){var x=xCoord/this.radius,y=yCoord/this.radius,fi0=0,lambda0=c*this.radDeg,fi1=33*this.radDeg,fi2=45*this.radDeg,n=Math.log(Math.cos(fi1)*(1/Math.cos(fi2)))/Math.log(Math.tan(Math.PI/4+fi2/2)*(1/Math.tan(Math.PI/4+fi1/2))),F=Math.cos(fi1)*Math.pow(Math.tan(Math.PI/4+fi1/2),n)/n,ro0=F*Math.pow(1/Math.tan(Math.PI/4+fi0/2),n),ro=this.sgn(n)*Math.sqrt(x*x+(ro0-y)*(ro0-y)),theta=Math.atan(x/(ro0-y));return{lat:(2*Math.atan(Math.pow(F/ro,1/n))-Math.PI/2)*this.degRad,lng:(lambda0+theta/n)*this.degRad}}},jvm.MapObject=function(){},jvm.MapObject.prototype.getLabelText=function(key){var text;return text=this.config.label?"function"==typeof this.config.label.render?this.config.label.render(key):key:null},jvm.MapObject.prototype.getLabelOffsets=function(key){var offsets;return this.config.label&&("function"==typeof this.config.label.offsets?offsets=this.config.label.offsets(key):"object"==typeof this.config.label.offsets&&(offsets=this.config.label.offsets[key])),offsets||[0,0]},jvm.MapObject.prototype.setHovered=function(isHovered){this.isHovered!==isHovered&&(this.isHovered=isHovered,this.shape.isHovered=isHovered,this.shape.updateStyle(),this.label&&(this.label.isHovered=isHovered,this.label.updateStyle()))},jvm.MapObject.prototype.setSelected=function(isSelected){this.isSelected!==isSelected&&(this.isSelected=isSelected,this.shape.isSelected=isSelected,this.shape.updateStyle(),this.label&&(this.label.isSelected=isSelected,this.label.updateStyle()),jvm.$(this.shape).trigger("selected",[isSelected]))},jvm.MapObject.prototype.setStyle=function(){this.shape.setStyle.apply(this.shape,arguments)},jvm.MapObject.prototype.remove=function(){this.shape.remove(),this.label&&this.label.remove()},jvm.Region=function(config){var bbox,text,offsets;this.config=config,this.map=this.config.map,this.shape=config.canvas.addPath({d:config.path,"data-code":config.code},config.style,config.canvas.rootElement),this.shape.addClass("jvectormap-region jvectormap-element"),bbox=this.shape.getBBox(),text=this.getLabelText(config.code),this.config.label&&text&&(offsets=this.getLabelOffsets(config.code),this.labelX=bbox.x+bbox.width/2+offsets[0],this.labelY=bbox.y+bbox.height/2+offsets[1],this.label=config.canvas.addText({text:text,"text-anchor":"middle","alignment-baseline":"central",x:this.labelX,y:this.labelY,"data-code":config.code},config.labelStyle,config.labelsGroup),this.label.addClass("jvectormap-region jvectormap-element")) +},jvm.inherits(jvm.Region,jvm.MapObject),jvm.Region.prototype.updateLabelPosition=function(){this.label&&this.label.set({x:this.labelX*this.map.scale+this.map.transX*this.map.scale,y:this.labelY*this.map.scale+this.map.transY*this.map.scale})},jvm.Marker=function(config){var text;this.config=config,this.map=this.config.map,this.isImage=!!this.config.style.initial.image,this.createShape(),text=this.getLabelText(config.index),this.config.label&&text&&(this.offsets=this.getLabelOffsets(config.index),this.labelX=config.cx/this.map.scale-this.map.transX,this.labelY=config.cy/this.map.scale-this.map.transY,this.label=config.canvas.addText({text:text,"data-index":config.index,dy:"0.6ex",x:this.labelX,y:this.labelY},config.labelStyle,config.labelsGroup),this.label.addClass("jvectormap-marker jvectormap-element"))},jvm.inherits(jvm.Marker,jvm.MapObject),jvm.Marker.prototype.createShape=function(){var that=this;this.shape&&this.shape.remove(),this.shape=this.config.canvas[this.isImage?"addImage":"addCircle"]({"data-index":this.config.index,cx:this.config.cx,cy:this.config.cy},this.config.style,this.config.group),this.shape.addClass("jvectormap-marker jvectormap-element"),this.isImage&&jvm.$(this.shape.node).on("imageloaded",function(){that.updateLabelPosition()})},jvm.Marker.prototype.updateLabelPosition=function(){this.label&&this.label.set({x:this.labelX*this.map.scale+this.offsets[0]+this.map.transX*this.map.scale+5+(this.isImage?(this.shape.width||0)/2:this.shape.properties.r),y:this.labelY*this.map.scale+this.map.transY*this.map.scale+this.offsets[1]})},jvm.Marker.prototype.setStyle=function(property){var isImage;jvm.Marker.parentClass.prototype.setStyle.apply(this,arguments),"r"===property&&this.updateLabelPosition(),isImage=!!this.shape.get("image"),isImage!=this.isImage&&(this.isImage=isImage,this.config.style=jvm.$.extend(!0,{},this.shape.style),this.createShape())},jvm.Map=function(params){var e,map=this;if(this.params=jvm.$.extend(!0,{},jvm.Map.defaultParams,params),!jvm.Map.maps[this.params.map])throw new Error("Attempt to use map which was not loaded: "+this.params.map);this.mapData=jvm.Map.maps[this.params.map],this.markers={},this.regions={},this.regionsColors={},this.regionsData={},this.container=jvm.$("
").addClass("jvectormap-container"),this.params.container&&this.params.container.append(this.container),this.container.data("mapObject",this),this.defaultWidth=this.mapData.width,this.defaultHeight=this.mapData.height,this.setBackgroundColor(this.params.backgroundColor),this.onResize=function(){map.updateSize()},jvm.$(window).resize(this.onResize);for(e in jvm.Map.apiEvents)this.params[e]&&this.container.bind(jvm.Map.apiEvents[e]+".jvectormap",this.params[e]);this.canvas=new jvm.VectorCanvas(this.container[0],this.width,this.height),this.params.bindTouchEvents&&("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch?this.bindContainerTouchEvents():window.MSGesture&&this.bindContainerPointerEvents()),this.bindContainerEvents(),this.bindElementEvents(),this.createTip(),this.params.zoomButtons&&this.bindZoomButtons(),this.createRegions(),this.createMarkers(this.params.markers||{}),this.updateSize(),this.params.focusOn&&("string"==typeof this.params.focusOn?this.params.focusOn={region:this.params.focusOn}:jvm.$.isArray(this.params.focusOn)&&(this.params.focusOn={regions:this.params.focusOn}),this.setFocus(this.params.focusOn)),this.params.selectedRegions&&this.setSelectedRegions(this.params.selectedRegions),this.params.selectedMarkers&&this.setSelectedMarkers(this.params.selectedMarkers),this.legendCntHorizontal=jvm.$("
").addClass("jvectormap-legend-cnt jvectormap-legend-cnt-h"),this.legendCntVertical=jvm.$("
").addClass("jvectormap-legend-cnt jvectormap-legend-cnt-v"),this.container.append(this.legendCntHorizontal),this.container.append(this.legendCntVertical),this.params.series&&this.createSeries()},jvm.Map.prototype={transX:0,transY:0,scale:1,baseTransX:0,baseTransY:0,baseScale:1,width:0,height:0,setBackgroundColor:function(backgroundColor){this.container.css("background-color",backgroundColor)},resize:function(){var curBaseScale=this.baseScale;this.width/this.height>this.defaultWidth/this.defaultHeight?(this.baseScale=this.height/this.defaultHeight,this.baseTransX=Math.abs(this.width-this.defaultWidth*this.baseScale)/(2*this.baseScale)):(this.baseScale=this.width/this.defaultWidth,this.baseTransY=Math.abs(this.height-this.defaultHeight*this.baseScale)/(2*this.baseScale)),this.scale*=this.baseScale/curBaseScale,this.transX*=this.baseScale/curBaseScale,this.transY*=this.baseScale/curBaseScale},updateSize:function(){this.width=this.container.width(),this.height=this.container.height(),this.resize(),this.canvas.setSize(this.width,this.height),this.applyTransform()},reset:function(){var key,i;for(key in this.series)for(i=0;imaxTransY?this.transY=maxTransY:this.transYmaxTransX?this.transX=maxTransX:this.transXtouches[1].pageX?touches[1].pageX+(touches[0].pageX-touches[1].pageX)/2:touches[0].pageX+(touches[1].pageX-touches[0].pageX)/2,centerTouchY=touches[0].pageY>touches[1].pageY?touches[1].pageY+(touches[0].pageY-touches[1].pageY)/2:touches[0].pageY+(touches[1].pageY-touches[0].pageY)/2,centerTouchX-=offset.left,centerTouchY-=offset.top,touchStartScale=map.scale,touchStartDistance=Math.sqrt(Math.pow(touches[0].pageX-touches[1].pageX,2)+Math.pow(touches[0].pageY-touches[1].pageY,2)))),lastTouchesLength=touches.length};jvm.$(this.container).bind("touchstart",handleTouchEvent),jvm.$(this.container).bind("touchmove",handleTouchEvent)},bindContainerPointerEvents:function(){var map=this,gesture=new MSGesture,element=this.container[0],handlePointerDownEvent=function(e){gesture.addPointer(e.pointerId)},handleGestureEvent=function(e){var transXOld,transYOld;(0!=e.translationX||0!=e.translationY)&&(transXOld=map.transX,transYOld=map.transY,map.transX+=e.translationX/map.scale,map.transY+=e.translationY/map.scale,map.applyTransform(),map.tip.hide(),(transXOld!=map.transX||transYOld!=map.transY)&&e.preventDefault()),1!=e.scale&&(map.setScale(map.scale*e.scale,e.offsetX,e.offsetY),map.tip.hide(),e.preventDefault())};gesture.target=element,element.addEventListener("MSGestureChange",handleGestureEvent,!1),element.addEventListener("pointerdown",handlePointerDownEvent,!1)},bindElementEvents:function(){var pageX,pageY,mouseMoved,map=this;this.container.mousemove(function(e){Math.abs(pageX-e.pageX)+Math.abs(pageY-e.pageY)>2&&(mouseMoved=!0)}),this.container.delegate("[class~='jvectormap-element']","mouseover mouseout",function(e){var baseVal=jvm.$(this).attr("class").baseVal||jvm.$(this).attr("class"),type=-1===baseVal.indexOf("jvectormap-region")?"marker":"region",code=jvm.$(this).attr("region"==type?"data-code":"data-index"),element="region"==type?map.regions[code].element:map.markers[code].element,tipText="region"==type?map.mapData.paths[code].name:map.markers[code].config.name||"",tipShowEvent=jvm.$.Event(type+"TipShow.jvectormap"),overEvent=jvm.$.Event(type+"Over.jvectormap");"mouseover"==e.type?(map.container.trigger(overEvent,[code]),overEvent.isDefaultPrevented()||element.setHovered(!0),map.tip.text(tipText),map.container.trigger(tipShowEvent,[map.tip,code]),tipShowEvent.isDefaultPrevented()||(map.tip.show(),map.tipWidth=map.tip.width(),map.tipHeight=map.tip.height())):(element.setHovered(!1),map.tip.hide(),map.container.trigger(type+"Out.jvectormap",[code]))}),this.container.delegate("[class~='jvectormap-element']","mousedown",function(e){pageX=e.pageX,pageY=e.pageY,mouseMoved=!1}),this.container.delegate("[class~='jvectormap-element']","mouseup",function(){var baseVal=jvm.$(this).attr("class").baseVal?jvm.$(this).attr("class").baseVal:jvm.$(this).attr("class"),type=-1===baseVal.indexOf("jvectormap-region")?"marker":"region",code=jvm.$(this).attr("region"==type?"data-code":"data-index"),clickEvent=jvm.$.Event(type+"Click.jvectormap"),element="region"==type?map.regions[code].element:map.markers[code].element;mouseMoved||(map.container.trigger(clickEvent,[code]),("region"===type&&map.params.regionsSelectable||"marker"===type&&map.params.markersSelectable)&&(clickEvent.isDefaultPrevented()||(map.params[type+"sSelectableOne"]&&map.clearSelected(type+"s"),element.setSelected(!element.isSelected))))})},bindZoomButtons:function(){var map=this;jvm.$("
").addClass("jvectormap-zoomin").text("+").appendTo(this.container),jvm.$("
").addClass("jvectormap-zoomout").html("−").appendTo(this.container),this.container.find(".jvectormap-zoomin").click(function(){map.setScale(map.scale*map.params.zoomStep,map.width/2,map.height/2,!1,map.params.zoomAnimate)}),this.container.find(".jvectormap-zoomout").click(function(){map.setScale(map.scale/map.params.zoomStep,map.width/2,map.height/2,!1,map.params.zoomAnimate)})},createTip:function(){var map=this;this.tip=jvm.$("
").addClass("jvectormap-tip").appendTo(jvm.$("body")),this.container.mousemove(function(e){var left=e.pageX-15-map.tipWidth,top=e.pageY-15-map.tipHeight;5>left&&(left=e.pageX+15),5>top&&(top=e.pageY+15),map.tip.css({left:left,top:top})})},setScale:function(scale,anchorX,anchorY,isCentered,animate){var interval,scaleStart,scaleDiff,transXStart,transXDiff,transYStart,transYDiff,transX,transY,viewportChangeEvent=jvm.$.Event("zoom.jvectormap"),that=this,i=0,count=Math.abs(Math.round(60*(scale-this.scale)/Math.max(scale,this.scale))),deferred=new jvm.$.Deferred;return scale>this.params.zoomMax*this.baseScale?scale=this.params.zoomMax*this.baseScale:scale0?(scaleStart=this.scale,scaleDiff=(scale-scaleStart)/count,transXStart=this.transX*this.scale,transYStart=this.transY*this.scale,transXDiff=(transX*scale-transXStart)/count,transYDiff=(transY*scale-transYStart)/count,interval=setInterval(function(){i+=1,that.scale=scaleStart+scaleDiff*i,that.transX=(transXStart+transXDiff*i)/that.scale,that.transY=(transYStart+transYDiff*i)/that.scale,that.applyTransform(),i==count&&(clearInterval(interval),that.container.trigger(viewportChangeEvent,[scale/that.baseScale]),deferred.resolve())},10)):(this.transX=transX,this.transY=transY,this.scale=scale,this.applyTransform(),this.container.trigger(viewportChangeEvent,[scale/this.baseScale]),deferred.resolve()),deferred},setFocus:function(config){var bbox,itemBbox,newBbox,codes,i,point;if(config=config||{},config.region?codes=[config.region]:config.regions&&(codes=config.regions),codes){for(i=0;ilng&&(lng+=360),point=jvm.Proj[proj.type](lat,lng,centralMeridian),inset=this.getInsetForPoint(point.x,point.y),inset?(bbox=inset.bbox,point.x=(point.x-bbox[0].x)/(bbox[1].x-bbox[0].x)*inset.width*this.scale,point.y=(point.y-bbox[0].y)/(bbox[1].y-bbox[0].y)*inset.height*this.scale,{x:point.x+this.transX*this.scale+inset.left*this.scale,y:point.y+this.transY*this.scale+inset.top*this.scale}):!1},pointToLatLng:function(x,y){var i,inset,bbox,nx,ny,proj=jvm.Map.maps[this.params.map].projection,centralMeridian=proj.centralMeridian,insets=jvm.Map.maps[this.params.map].insets;for(i=0;ibbox[0].x&&nxbbox[0].y&&nybbox[0].x&&xbbox[0].y&&y").addClass("jvectormap-goback").text("Back").appendTo(this.params.container),this.backButton.hide(),this.backButton.click(function(){that.goBack()}),this.spinner=jvm.$("
").addClass("jvectormap-spinner").appendTo(this.params.container),this.spinner.hide()},jvm.MultiMap.prototype={addMap:function(name,config){var cnt=jvm.$("
").css({width:"100%",height:"100%"});return this.params.container.append(cnt),this.maps[name]=new jvm.Map(jvm.$.extend(config,{container:cnt})),this.params.maxLevel>config.multiMapLevel&&this.maps[name].container.on("regionClick.jvectormap",{scope:this},function(e,code){var multimap=e.data.scope,mapName=multimap.params.mapNameByCode(code,multimap);multimap.drillDownPromise&&"pending"===multimap.drillDownPromise.state()||multimap.drillDown(mapName,code)}),this.maps[name]},downloadMap:function(code){var that=this,deferred=jvm.$.Deferred();return this.mapsLoaded[code]?deferred.resolve():jvm.$.get(this.params.mapUrlByCode(code,this)).then(function(){that.mapsLoaded[code]=!0,deferred.resolve()},function(){deferred.reject()}),deferred},drillDown:function(name,code){var currentMap=this.history[this.history.length-1],that=this,focusPromise=currentMap.setFocus({region:code,animate:!0}),downloadPromise=this.downloadMap(code);focusPromise.then(function(){"pending"===downloadPromise.state()&&that.spinner.show()}),downloadPromise.always(function(){that.spinner.hide()}),this.drillDownPromise=jvm.$.when(downloadPromise,focusPromise),this.drillDownPromise.then(function(){currentMap.params.container.hide(),that.maps[name]?that.maps[name].params.container.show():that.addMap(name,{map:name,multiMapLevel:currentMap.params.multiMapLevel+1}),that.history.push(that.maps[name]),that.backButton.show()})},goBack:function(){var currentMap=this.history.pop(),prevMap=this.history[this.history.length-1],that=this;currentMap.setFocus({scale:1,x:.5,y:.5,animate:!0}).then(function(){currentMap.params.container.hide(),prevMap.params.container.show(),prevMap.updateSize(),1===that.history.length&&that.backButton.hide(),prevMap.setFocus({scale:1,x:.5,y:.5,animate:!0})})}},jvm.MultiMap.defaultParams={mapNameByCode:function(code,multiMap){return code.toLowerCase()+"_"+multiMap.defaultProjection+"_en"},mapUrlByCode:function(code,multiMap){return"jquery-jvectormap-data-"+code.toLowerCase()+"-"+multiMap.defaultProjection+"-en.js"}}; diff --git a/production/other_charts.html b/production/other_charts.html index 8b587994..f4005d7a 100755 --- a/production/other_charts.html +++ b/production/other_charts.html @@ -21,7 +21,7 @@ - + @@ -499,7 +499,7 @@ - +