10 lines
14 KiB
JavaScript
10 lines
14 KiB
JavaScript
/*
|
|
* Kendo UI Complete v2013.3.1119 (http://kendoui.com)
|
|
* Copyright 2013 Telerik AD. All rights reserved.
|
|
*
|
|
* Kendo UI Complete commercial licenses may be obtained at
|
|
* https://www.kendoui.com/purchase/license-agreement/kendo-ui-complete-commercial.aspx
|
|
* If you do not own a commercial license, this file shall be governed by the trial license terms.
|
|
*/
|
|
!function(define){return define(["./kendo.dataviz.core.min"],function(){!function(){function t(t){this.view=t}function e(t){this.view=t}function n(t){return d.round(t)+.5}function i(t,e){var n,i,r=[];if(t=t?t.toLowerCase():null,t&&t!=L){for(n=S[t],i=0;i<n.length;i++)r.push(n[i]*(e||1));return"stroke-dasharray='"+r.join(" ")+"' "}return""}var r,o,a=jQuery,s=document,d=Math,p=window.kendo,l=p.Class,c=p.dataviz,f=c.Box2D,u=c.ExpandAnimation,h=c.Point2D,m=c.ViewBase,y=c.ViewElement,x=p.deepExtend,v=c.defined,w=c.round,g=c.renderTemplate,T=c.rotatePoint,P=c.uniqueId,A="butt",D=c.CLIP,G=c.COORD_PRECISION,S=c.DASH_ARRAYS,O=c.DEFAULT_WIDTH,C=c.DEFAULT_HEIGHT,k=c.DEFAULT_FONT,I="none",V="radial",L="solid",b="square",M="http://www.w3.org/2000/svg",R="transparent",E="undefined",_=m.extend({init:function(n){var i=this;m.fn.init.call(i,n),i.decorators.push(new t(i),new e(i)),c.ui.Chart&&i.decorators.push(new c.BarAnimationDecorator(i),new c.PieAnimationDecorator(i),new c.BubbleAnimationDecorator(i)),i.decorators.push(new r(i),new c.FadeAnimationDecorator(i)),c.Gauge&&i.decorators.push(new c.RadialPointerAnimationDecorator(i),new c.ArrowPointerAnimationDecorator(i),new c.BarIndicatorAnimationDecorator(i)),i.defsId=P(),i.template=_.template,i.display=i.options.inline?"inline":"block",i.template||(i.template=_.template=g("<?xml version='1.0' ?><svg xmlns='"+M+"' version='1.1' "+"width='#= d.options.width #px' height='#= d.options.height #px' "+"style='position: relative; display: #= d.display #;'>"+"#= d.renderDefinitions() #"+"#= d.renderContent() #</svg>"))},options:{width:O,height:C},renderTo:function(t){var e,n=this;return n.setupAnimations(),c.renderSVG(t,n.render()),e=t.firstElementChild,n.alignToScreen(e),n.playAnimations(),n._viewElement=e,e},renderDefinitions:function(){var t=this,e=t.defsId,n=m.fn.renderDefinitions.call(t);return"<defs id='"+e+"'>"+n+"</defs>"},renderElement:function(t){var e,n,i=this,r=s.createElement("div"),o=s.getElementById(i.defsId);return c.renderSVG(r,"<?xml version='1.0' ?><svg xmlns='"+M+"' version='1.1'>"+i.renderDefinitions()+t.render()+"</svg>"),e=r.firstElementChild.firstChild,n=r.firstElementChild.lastChild,o&&o.textContent!==e.textContent&&o.parentNode.replaceChild(e,o),n},createGroup:function(t){return this.decorate(new Q(t))},createText:function(t,e){return this.decorate(new z(t,e))},createRect:function(t,e){return this.decorate(new H(t.points(),!0,this.setDefaults(e)))},createCubicCurve:function(t,e,n){return this.decorate(new F(t,e,n))},createLine:function(t,e,n,i,r){return this.decorate(new H([new h(t,e),new h(n,i)],!1,this.setDefaults(r)))},createMultiLine:function(t,e){return this.decorate(new j(t,!1,this.setDefaults(e)))},createPolyline:function(t,e,n){return this.decorate(new H(t,e,this.setDefaults(n)))},createCircle:function(t,e,n){return this.decorate(new q(t,e,n))},createSector:function(t,e){return this.decorate(new N(t,e))},createRing:function(t,e){return this.decorate(new B(t,e))},createPin:function(t,e){return this.decorate(new W(t,e))},createGradient:function(t){return t.type===V?v(t.ir)?new Z(t):new X(t):new K(t)},alignToScreen:function(t){var e,n,i,r;try{e=t.getScreenCTM?t.getScreenCTM():null}catch(o){}e&&(n=-e.e%1,i=-e.f%1,r=t.style,(0!==n||0!==i)&&(r.left=n+"px",r.top=i+"px"))}}),z=y.extend({init:function(t,e){var n=this;y.fn.init.call(n,e),n.content=t,n.template=z.template,n.template||(n.template=z.template=g("<text #= d.renderId() # #= d.renderDataAttributes() # x='#= Math.round(d.options.x) #' y='#= Math.round(d.options.y + d.options.baseline) #' fill-opacity='#= d.options.fillOpacity #' #= d.options.rotation ? d.renderRotation() : '' # style='font: #= d.options.font #; #= d.renderCursor() #' fill='#= d.options.color #'>#= d.content #</text>"))},options:{x:0,y:0,baseline:0,font:k,size:{width:0,height:0},fillOpacity:1,cursor:{}},refresh:function(t){var e=this.options;a(t).attr({"fill-opacity":e.fillOpacity})},clone:function(){var t=this;return new z(t.content,x({},t.options))},renderRotation:function(){var t=this,e=t.options,n=e.size,i=w(e.x+n.normalWidth/2,G),r=w(e.y+n.normalHeight/2,G),o=w(e.x+n.width/2,G),a=w(e.y+n.height/2,G),s=w(o-i,G),d=w(a-r,G);return"transform='translate("+s+","+d+") "+"rotate("+e.rotation+","+i+","+r+")'"}}),U=y.extend({init:function(t){var e=this;y.fn.init.call(e,t),e.template=U.template,e.template||(e.template=U.template=g("<path #= d.renderId() #style='display: #= d.renderDisplay() #; #= d.renderCursor() #' #= d.renderDataAttributes() # d='#= d.renderPoints() #' #= d.renderAttr(\"stroke\", d.options.stroke) # #= d.renderAttr(\"stroke-width\", d.options.strokeWidth) ##= d.renderDashType() # stroke-linecap='#= d.renderLinecap() #' stroke-linejoin='round' fill-opacity='#= d.options.fillOpacity #' stroke-opacity='#= d.options.strokeOpacity #' fill='#= d.renderFill() #'></path>"))},options:{fill:"",fillOpacity:1,strokeOpacity:1,rotation:[0,0,0],strokeLineCap:b,visible:!0,cursor:{}},refresh:function(t){var e=this.options;a(t).attr({d:this.renderPoints(),"fill-opacity":e.fillOpacity,"stroke-opacity":e.strokeOpacity}).css("display",this.renderDisplay())},clone:function(){return new U(x({},this.options))},renderPoints:function(){},renderDashType:function(){var t=this,e=t.options;return i(e.dashType,e.strokeWidth)},renderLinecap:function(){var t=this.options,e=t.dashType,n=t.strokeLineCap;return e&&e!=L?A:n},renderFill:function(){var t=this.options.fill;return t&&t!==R?t:I},renderDisplay:function(){return this.options.visible?"block":"none"},destroy:function(){}}),F=U.extend({init:function(t,e,n){var i=this;U.fn.init.call(i,e),i.areaPoints=n,i.points=t},renderPoints:function(){var t,e=this,n=e.points,i=[],r=e.areaPoints;for(t=0;t<n.length;t++)1==t%3&&i.push("C"),i.push(w(n[t].x,G)+" "+w(n[t].y,G));if(r&&r.length){for(t=0;t<r.length;t++)i.push("L "+r[t].x+" "+r[t].y);i.push("z")}return"M "+i.join(" ")}}),H=U.extend({init:function(t,e,n){var i=this;U.fn.init.call(i,n),i.points=t,i.closed=e},renderPoints:function(){var t=this,e=t.points;return t._renderPoints(e)},_renderPoints:function(t){var e,n=this,i=n.options.rotation,r=new h(i[1],i[2]),o=-i[0],a=[];for(e=0;e<t.length;e++)a.push(n._print(t[e].clone().rotate(r,o)));return n.closed&&a.push("z"),"M"+a.join(" ")},clone:function(){var t=this;return new H(x([],t.points),t.closed,x({},t.options))},_print:function(t){var e=this,i=e.options,r=i.strokeWidth,o=i.align!==!1&&r&&0!==r%2,a=o?n:w;return a(t.x,G)+" "+a(t.y,G)}}),j=H.extend({renderPoints:function(){var t,e=this,n=e.points,i=[];for(t=0;t<n.length;t++)i.push(e._renderPoints(n[t]));return i.join(" ")}}),B=U.extend({init:function(t,e){var n=this;U.fn.init.call(n,e),n.pathTemplate=B.pathTemplate,n.pathTemplate||(n.pathTemplate=B.pathTemplate=g("M #= d.firstOuterPoint.x # #= d.firstOuterPoint.y # A#= d.r # #= d.r # 0 #= d.isReflexAngle ? '1' : '0' #,1 #= d.secondOuterPoint.x # #= d.secondOuterPoint.y # L #= d.secondInnerPoint.x # #= d.secondInnerPoint.y # A#= d.ir # #= d.ir # 0 #= d.isReflexAngle ? '1' : '0' #,0 #= d.firstInnerPoint.x # #= d.firstInnerPoint.y # z")),n.config=t||{}},renderPoints:function(){var t,e,n=this,i=n.config,r=i.startAngle,o=i.angle+r,a=o-r>180,s=d.max(i.r,0),p=d.max(i.ir,0),l=i.c,c=i.point(r),f=i.point(r,!0);return w(r)%360===w(o)%360&&(o-=.05),t=i.point(o),e=i.point(o,!0),n.pathTemplate({firstOuterPoint:c,secondOuterPoint:t,isReflexAngle:a,r:s,ir:p,cx:l.x,cy:l.y,firstInnerPoint:f,secondInnerPoint:e})},clone:function(){var t=this;return new B(x({},t.config),x({},t.options))}}),W=U.extend({init:function(t,e){var n=this;U.fn.init.call(n,e),n.pathTemplate=W.pathTemplate,n.pathTemplate||(n.pathTemplate=W.pathTemplate=g("M #= d.origin.x # #= d.origin.y # #= d.as.x # #= d.as.y # A#= d.r # #= d.r # 0 #= d.isReflexAngle ? '1' : '0' #,0 #= d.ae.x # #= d.ae.y # z")),n.config=t||new c.Pin},renderPoints:function(){var t=this,e=t.config,n=e.radius,i=d.PI/180,r=e.arcAngle,o=n*d.sin(r*i/2),a=e.height-n*(1-d.cos(r*i/2)),s=e.origin,p={x:s.x+o,y:s.y-a},l={x:s.x-o,y:s.y-a},c=function(n,i){var r=t.options.rotation,o=e.rotation;return n=T(n.x,n.y,r[1],r[2],-r[0]),i&&(n=T(n.x,n.y,s.x,s.y,o)),n};return s=c(s),t.pathTemplate({origin:s,as:c(p,!0),ae:c(l,!0),r:n,isReflexAngle:r>180})}}),N=B.extend({init:function(t,e){var n=this;B.fn.init.call(n,t,e),n.pathTemplate=N.pathTemplate,n.pathTemplate||(n.pathTemplate=N.pathTemplate=g("M #= d.firstOuterPoint.x # #= d.firstOuterPoint.y # A#= d.r # #= d.r # 0 #= d.isReflexAngle ? '1' : '0' #,1 #= d.secondOuterPoint.x # #= d.secondOuterPoint.y # L #= d.cx # #= d.cy # z"))},options:{fill:"",fillOpacity:1,strokeOpacity:1,strokeLineCap:b},clone:function(){var t=this;return new N(x({},t.config),x({},t.options))}}),q=y.extend({init:function(t,e,n){var i=this;y.fn.init.call(i,n),i.c=t,i.r=e,i.template=q.template,i.template||(i.template=q.template=g("<circle #= d.renderId() # #= d.renderDataAttributes() #cx='#= d.c.x #' cy='#= d.c.y #' r='#= d.r #' #= d.renderAttr(\"stroke\", d.options.stroke) # #= d.renderAttr(\"stroke-width\", d.options.strokeWidth) #fill-opacity='#= d.options.fillOpacity #' stroke-opacity='#= d.options.strokeOpacity #' fill='#= d.options.fill || \"none\" #'></circle>"))},options:{fill:"",fillOpacity:1,strokeOpacity:1},refresh:function(t){a(t).attr({r:d.max(0,this.r),"fill-opacity":this.options.fillOpacity})},clone:function(){var t=this;return new q(x({},t.c),t.r,x({},t.options))}}),Q=y.extend({init:function(t){var e=this;y.fn.init.call(e,t),e.template=Q.template,e.template||(e.template=Q.template=g('<g#= d.renderId() ##= d.renderDataAttributes() ##= d.renderAttr("clip-path", d.options.clipPath) #>#= d.renderContent() #</g>'))}}),Y=y.extend({init:function(t){var e=this;y.fn.init.call(e,t),e.template=Y.template,e.template||(e.template=Y.template=g('<clipPath#= d.renderAttr("id", d.options.id) #>#= d.renderContent() #</clipPath>'))}}),J=y.extend({init:function(t){var e=this;y.fn.init.call(e,t)},options:{id:""},renderStops:function(){var t,e,n=this,i=n.options.stops,r=n.stopTemplate,o=i.length,a="";for(t=0;o>t;t++)e=i[t],a+=r(e);return a}}),K=J.extend({init:function(t){var e=this;J.fn.init.call(e,t),e.template=K.template,e.stopTemplate=K.stopTemplate,e.template||(e.template=K.template=g("<linearGradient id='#= d.options.id #' gradientTransform='rotate(#= d.options.rotation #)'> #= d.renderStops() #</linearGradient>"),e.stopTemplate=K.stopTemplate=g("<stop offset='#= Math.round(d.offset * 100) #%' style='stop-color:#= d.color #;stop-opacity:#= d.opacity #' />"))},options:{rotation:0}}),X=J.extend({init:function(t){var e=this;J.fn.init.call(e,t),e.template=X.template,e.stopTemplate=X.stopTemplate,e.template||(e.template=X.template=g("<radialGradient id='#= d.options.id #' cx='#= d.options.cx #' cy='#= d.options.cy #' fx='#= d.options.cx #' fy='#= d.options.cy #' r='#= d.options.r #' gradientUnits='userSpaceOnUse'>#= d.renderStops() #</radialGradient>"),e.stopTemplate=X.stopTemplate=g("<stop offset='#= Math.round(d.offset * 100) #%' style='stop-color:#= d.color #;stop-opacity:#= d.opacity #' />"))}}),Z=y.extend({init:function(t){var e=this;y.fn.init.call(e,t),e.template=Z.template,e.stopTemplate=Z.stopTemplate,e.template||(e.template=Z.template=g("<radialGradient id='#= d.options.id #' cx='#= d.options.cx #' cy='#= d.options.cy #' fx='#= d.options.cx #' fy='#= d.options.cy #' r='#= d.options.r #' gradientUnits='userSpaceOnUse'>#= d.renderStops() #</radialGradient>"),e.stopTemplate=Z.stopTemplate=g("<stop offset='#= d.offset #%' style='stop-color:#= d.color #;stop-opacity:#= d.opacity #' />"))},options:{id:""},renderStops:function(){var t,e,n=this,i=n.options,r=i.stops,o=n.stopTemplate,a=100*(i.ir/i.r),s=r.length,d="";for(e=x({},r[0]),e.offset=a,d+=o(e),t=1;s>t;t++)e=x({},r[t]),e.offset=e.offset*(100-a)+a,d+=o(e);return d}});t.prototype={decorate:function(t){var e,n,i=this,r=i.view,o=t.options,a=o.id;return o.overlay?(t.options.id=P(),e=r.createGroup(),n=t.clone(),e.children.push(t,n),n.options.id=a,n.options.fill=o.overlay,e):t}},e.prototype={decorate:function(t){var e=this,n=t.options;return n.fill=e.getPaint(n.fill),t},getPaint:function(t){var e,n,i,r=this,o=r.view,a=o.definitions;return t&&v(t.gradient)?(e=o.buildGradient(t),e?(n=e.id,i=a[n],i||(i=o.createGradient(e),a[n]=i),"url("+r.baseUrl()+"#"+i.options.id+")"):I):t},baseUrl:function(){var t=s.getElementsByTagName("base")[0],e="",n=s.location.href,i=n.indexOf("#");return t&&!p.support.browser.msie&&(-1!==i&&(n=n.substring(0,i)),e=n),e}},r=l.extend({init:function(t){this.view=t},decorate:function(t){var e,n,i=this,r=i.view,o=i.clipId,a=r.options,s=t.options.animation,d=r.definitions;return s&&s.type===D&&a.transitions&&(o||(i.clipId=o=P()),e=d[o],e||(e=new Y({id:o}),n=r.createRect(new f(0,0,a.width,a.height),{id:P()}),e.children.push(n),d[o]=e,r.animations.push(new u(n,{size:a.width}))),t.options.clipPath="url(#"+o+")"),t}}),o=function(t,e){t.innerHTML=e},function(){var t="<svg xmlns='"+M+"'></svg>",e=s.createElement("div"),n=typeof DOMParser!=E;e.innerHTML=t,n&&e.firstChild.namespaceURI!=M&&(o=function(t,e){var n=new DOMParser,i=n.parseFromString(e,"text/xml"),r=s.adoptNode(i.documentElement);t.innerHTML="",t.appendChild(r)})}(),c.supportsSVG()&&c.ViewFactory.current.register("svg",_,10),x(c,{renderSVG:o,SVGCircle:q,SVGClipAnimationDecorator:r,SVGClipPath:Y,SVGGradientDecorator:e,SVGGroup:Q,SVGLine:H,SVGMultiLine:j,SVGLinearGradient:K,SVGOverlayDecorator:t,SVGPath:U,SVGRadialGradient:X,SVGDonutGradient:Z,SVGRing:B,SVGSector:N,SVGText:z,SVGView:_})}(window.kendo.jQuery)})}("function"==typeof define&&define.amd?define:function(t,e){return e()});
|
|
//@ sourceMappingURL=kendo.dataviz.svg.min.js.map
|