From ac96799588e04c101c0bb01a929124bdfd61cb5e Mon Sep 17 00:00:00 2001 From: techird Date: Tue, 24 Jun 2014 19:21:26 +0800 Subject: [PATCH] update readme --- README.md | 25 +++++++++++------------- dist/kity.js | 35 ++++++++++++---------------------- dist/kity.min.js | 8 ++++---- doc/images/hello-kity.png | Bin 0 -> 4643 bytes example/first.html | 24 +++++++++-------------- src/graphic/box.js | 2 +- src/graphic/paper.js | 3 +++ src/graphic/rect.js | 4 ---- src/graphic/shapecontainer.js | 25 +++++------------------- 9 files changed, 45 insertions(+), 81 deletions(-) create mode 100644 doc/images/hello-kity.png diff --git a/README.md b/README.md index 88b5cd3..ba268b6 100644 --- a/README.md +++ b/README.md @@ -23,25 +23,22 @@ Kity 是一个易用、直观、现代的矢量图形库。帮助你快速在页 ``` +![Hello Kity](doc/image/hello-kity.png) + 更详细的使用方法请参考 [wiki](https://github.com/fex-team/kity/wiki)。 ## 贡献 diff --git a/dist/kity.js b/dist/kity.js index e3c44d5..e743768 100644 --- a/dist/kity.js +++ b/dist/kity.js @@ -899,7 +899,7 @@ define("core/class", [], function(require, exports) { return this; }; Class.prototype.getType = function() { - return this.__KityClassName || this.constructor.name; + return this.__KityClassName; }; Class.prototype.getClass = function() { return this.constructor; @@ -914,9 +914,9 @@ define("core/class", [], function(require, exports) { } var KITY_INHERIT_FLAG = "__KITY_INHERIT_FLAG_" + +new Date(); function inherit(constructor, BaseClass, classname) { - var KityClass = constructor; + var KityClass = eval("(function " + classname + "( __inherit__flag ) {" + "if( __inherit__flag != KITY_INHERIT_FLAG ) {" + "KityClass.__KityConstructor.apply(this, arguments);" + "}" + "this.__KityClassName = KityClass.__KityClassName;" + "})"); KityClass.__KityConstructor = constructor; - KityClass.prototype = Object.create(BaseClass.prototype); + KityClass.prototype = new BaseClass(KITY_INHERIT_FLAG); for (var methodName in BaseClass.prototype) { if (BaseClass.prototype.hasOwnProperty(methodName) && methodName.indexOf("__Kity") !== 0) { KityClass.prototype[methodName] = BaseClass.prototype[methodName]; @@ -1668,7 +1668,7 @@ define("graphic/box", [ "core/class" ], function(require, exports, module) { return new Box(xMin, yMin, xMax - xMin, yMax - yMin); }, expand: function(ex, ey, ew, eh) { - return new Box(this.x + ex, this.y + ey, this.width + ew, this.height + eh); + return new Box(this.x + ex, this.y + ey, this.width - ex + ew, this.height - ey + eh); }, valueOf: function() { return [ this.x, this.y, this.width, this.height ]; @@ -4294,6 +4294,9 @@ define("graphic/paper", [ "core/class", "core/utils", "graphic/svg", "graphic/co } return parent; }, + isAttached: function() { + return !!this.getPaper(); + }, whenPaperReady: function(fn) { var me = this; function check() { @@ -4750,7 +4753,7 @@ define("graphic/radialgradientbrush", [ "graphic/gradientbrush", "graphic/svg", } }); }); -define("graphic/rect", [ "core/utils", "graphic/point", "core/class", "graphic/box", "graphic/path", "graphic/shape", "graphic/svg", "graphic/geometry", "graphic/shapecontainer", "graphic/container" ], function(require, exports, module) { +define("graphic/rect", [ "core/utils", "graphic/point", "core/class", "graphic/box", "graphic/path", "graphic/shape", "graphic/svg", "graphic/geometry" ], function(require, exports, module) { var RectUtils = {}, Utils = require("core/utils"), Point = require("graphic/point"), Box = require("graphic/box"); Utils.extend(RectUtils, { //根据传递进来的width、height和radius属性, @@ -4863,8 +4866,6 @@ define("graphic/rect", [ "core/utils", "graphic/point", "core/class", "graphic/b return this.update(); } }); - var ShapeContainer = require("graphic/shapecontainer"); - ShapeContainer.creators.rect = Rect; return Rect; }); define("graphic/regularpolygon", [ "graphic/point", "core/class", "graphic/path", "core/utils", "graphic/shape", "graphic/svg", "graphic/geometry" ], function(require, exports, module) { @@ -5159,24 +5160,9 @@ define("graphic/shape", [ "graphic/svg", "core/utils", "graphic/eventhandler", " define("graphic/shapecontainer", [ "graphic/container", "core/class", "core/utils", "graphic/shape", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen", "graphic/box" ], function(require, exports, module) { var Container = require("graphic/container"); var utils = require("core/utils"); - function construct(constructor, args) { - var obj = Object.create(constructor.prototype); - constructor.apply(obj, args); - return obj; - } var ShapeContainer = require("core/class").createClass("ShapeContainer", { base: Container, isShapeContainer: true, - create: function(name) { - var CreatorClass = ShapeContainer.creators[name]; - if (CreatorClass) { - var args = Array.prototype.slice.call(arguments, 1); - var shape = construct(CreatorClass, args); - this.addShape(shape); - return shape; - } - return null; - }, /* private */ handleAdd: function(shape, index) { var parent = this.getShapeNode(); @@ -5218,6 +5204,10 @@ define("graphic/shapecontainer", [ "graphic/container", "core/class", "core/util addShape: function(shape, index) { return this.addItem(shape, index); }, + put: function(shape) { + this.addShape(shape); + return shape; + }, appendShape: function(shape) { return this.addShape(shape); }, @@ -5321,7 +5311,6 @@ define("graphic/shapecontainer", [ "graphic/container", "core/class", "core/util return this; } }); - ShapeContainer.creators = {}; return ShapeContainer; }); /* diff --git a/dist/kity.min.js b/dist/kity.min.js index 57b4686..cd9c54d 100644 --- a/dist/kity.min.js +++ b/dist/kity.min.js @@ -6,7 +6,7 @@ * Copyright (c) 2014 Baidu FEX; Licensed BSD * ==================================================== */ -!function(){function a(a,b,c){if(d[a]={exports:{},value:null,factory:null},2===arguments.length&&(c=b),"[object Object]"===d.toString.call(c))d[a].value=c;else{if("function"!=typeof c)throw new Error("define函数未定义的行为");d[a].factory=c}}function b(a){var c=d[a],e=null;return c?c.value?c.value:(e=c.factory.call(null,b,c.exports,c),e&&(c.exports=e),c.value=c.exports,c.value):null}function c(a){return b(a)}var d={};a("animate/animator",["animate/timeline","graphic/eventhandler","animate/frame","core/utils","core/class","animate/easing","graphic/shape","graphic/svg","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){function b(a){var b=parseFloat(a,10);return/ms/.test(a)?b:/s/.test(a)?1e3*b:/min/.test(a)?60*b*1e3:b}var c=a("animate/timeline"),d=a("animate/easing"),e=a("core/class").createClass("Animator",{constructor:function(a,b,c){if(1==arguments.length){var d=arguments[0];this.beginValue=d.beginValue,this.finishValue=d.finishValue,this.setter=d.setter}else this.beginValue=a,this.finishValue=b,this.setter=c},start:function(a,c,d,e,f){4===arguments.length&&"function"==typeof e&&(f=e,e=0);var g=this.create(a,c,d,f);return e=b(e),e>0?setTimeout(function(){g.play()},e):g.play(),g},create:function(a,f,g,h){var i;return f=f&&b(f)||e.DEFAULT_DURATION,g=g||e.DEFAULT_EASING,"string"==typeof g&&(g=d[g]),i=new c(this,a,f,g),"function"==typeof h&&i.on("finish",h),i},reverse:function(){return new e(this.finishValue,this.beginValue,this.setter)}});e.DEFAULT_DURATION=300,e.DEFAULT_EASING="linear";var f=a("graphic/shape");return a("core/class").extendClass(f,{animate:function(a,b,c,d,e){function f(){g.shift(),g.length&&setTimeout(g[0].t.play.bind(g[0].t),g[0].d)}var g=this._KityAnimateQueue=this._KityAnimateQueue||[],h=a.create(this,b,c,e);return h.on("finish",f),g.push({t:h,d:d}),1==g.length&&setTimeout(h.play.bind(h),d),this},timeline:function(){return this._KityAnimateQueue[0].t},stop:function(){var a=this._KityAnimateQueue;if(a)for(;a.length;)a.shift().stop()}}),e}),a("animate/easing",[],function(){var a={linear:function(a,b,c,d){return c*(a/d)+b},swing:function(b,c,d,e){return a.easeOutQuad(b,c,d,e)},ease:function(b,c,d,e){return a.easeInOutCubic(b,c,d,e)},easeInQuad:function(a,b,c,d){return c*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){return-c*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){return(a/=d/2)<1?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b},easeInCubic:function(a,b,c,d){return c*(a/=d)*a*a+b},easeOutCubic:function(a,b,c,d){return c*((a=a/d-1)*a*a+1)+b},easeInOutCubic:function(a,b,c,d){return(a/=d/2)<1?c/2*a*a*a+b:c/2*((a-=2)*a*a+2)+b},easeInQuart:function(a,b,c,d){return c*(a/=d)*a*a*a+b},easeOutQuart:function(a,b,c,d){return-c*((a=a/d-1)*a*a*a-1)+b},easeInOutQuart:function(a,b,c,d){return(a/=d/2)<1?c/2*a*a*a*a+b:-c/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(a,b,c,d){return c*(a/=d)*a*a*a*a+b},easeOutQuint:function(a,b,c,d){return c*((a=a/d-1)*a*a*a*a+1)+b},easeInOutQuint:function(a,b,c,d){return(a/=d/2)<1?c/2*a*a*a*a*a+b:c/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},easeOutSine:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},easeInOutSine:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},easeInExpo:function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b},easeOutExpo:function(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b},easeInOutExpo:function(a,b,c,d){return 0===a?b:a==d?b+c:(a/=d/2)<1?c/2*Math.pow(2,10*(a-1))+b:c/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(a,b,c,d){return-c*(Math.sqrt(1-(a/=d)*a)-1)+b},easeOutCirc:function(a,b,c,d){return c*Math.sqrt(1-(a=a/d-1)*a)+b},easeInOutCirc:function(a,b,c,d){return(a/=d/2)<1?-c/2*(Math.sqrt(1-a*a)-1)+b:c/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(a,b,c,d){var e=1.70158,f=0,g=c;return 0===a?b:1==(a/=d)?b+c:(f||(f=.3*d),ga?-.5*g*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-e)*Math.PI/f)+b:g*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-e)*Math.PI/f)*.5+c+b},easeInBack:function(a,b,c,d,e){return void 0==e&&(e=1.70158),c*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){return void 0==e&&(e=1.70158),c*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){return void 0==e&&(e=1.70158),(a/=d/2)<1?c/2*a*a*(((e*=1.525)+1)*a-e)+b:c/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(b,c,d,e){return d-a.easeOutBounce(e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:2/2.75>a?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(b,c,d,e){return e/2>b?.5*a.easeInBounce(2*b,0,d,e)+c:.5*a.easeOutBounce(2*b-e,0,d,e)+.5*d+c}};return a}),a("animate/frame",[],function(a,b){function c(a){1===j.push(a)&&i(d)}function d(){var a=j;for(j=[];a.length;)h(a.pop())}function e(a){var b=g(a);return c(b),b}function f(a){var b=j.indexOf(a);~b&&j.splice(b,1)}function g(a){var b={index:0,time:+new Date,elapsed:0,action:a,next:function(){c(b)}};return b}function h(a){var b=+new Date,c=b-a.time;c>200&&(c=1e3/60),a.dur=c,a.elapsed+=c,a.time=b,a.action.call(null,a),a.index++}var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return setTimeout(a,1e3/60)},j=[];b.requestFrame=e,b.releaseFrame=f}),a("animate/motionanimator",["animate/animator","animate/timeline","animate/easing","core/class","graphic/shape","graphic/geometry","core/utils","graphic/point","graphic/vector","graphic/matrix","graphic/path","graphic/svg"],function(a){var b=a("animate/animator"),c=a("graphic/geometry"),d=a("graphic/path"),e=a("core/class").createClass("MotionAnimator",{base:b,constructor:function(a){var b=this;this.callBase({beginValue:0,finishValue:1,setter:function(a,e){var f=b.motionPath instanceof d?b.motionPath.getPathData():b.motionPath,g=c.pointAtPath(f,e);a.setTranslate(g.x,g.y),a.setRotate(g.tan.getAngle())}}),this.updatePath(a)},updatePath:function(a){this.motionPath=a}});return a("core/class").extendClass(d,{motion:function(a,b,c,d,f){return this.animate(new e(a),b,c,d,f)}}),e}),a("animate/opacityanimator",["animate/animator","animate/timeline","animate/easing","core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){var b=a("animate/animator"),c=a("core/class").createClass("OpacityAnimator",{base:b,constructor:function(a){this.callBase({beginValue:function(a){return a.getOpacity()},finishValue:a,setter:function(a,b){a.setOpacity(b)}})}}),d=a("graphic/shape");return a("core/class").extendClass(d,{fxOpacity:function(a,b,d,e,f){return this.animate(new c(a),b,d,e,f)},fadeTo:function(){return this.fxOpacity.apply(this,arguments)},fadeIn:function(){return this.fxOpacity.apply(this,[1].concat([].slice.call(arguments)))},fadeOut:function(){return this.fxOpacity.apply(this,[0].concat([].slice.call(arguments)))}}),c}),a("animate/pathanimator",["animate/animator","animate/timeline","animate/easing","core/class","graphic/shape","graphic/geometry","core/utils","graphic/point","graphic/vector","graphic/matrix","graphic/path","graphic/svg"],function(a){var b=a("animate/animator"),c=a("graphic/geometry"),d=a("core/class").createClass("OpacityAnimator",{base:b,constructor:function(a){this.callBase({beginValue:function(a){return this.beginPath=a.getPathData(),0},finishValue:1,setter:function(b,d){b.setPathData(c.pathTween(this.beginPath,a,d))}})}}),e=a("graphic/path");return a("core/class").extendClass(e,{fxPath:function(a,b,c,e,f){return this.animate(new d(a),b,c,e,f)}}),d}),a("animate/rotateanimator",["animate/animator","animate/timeline","animate/easing","core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){var b=a("animate/animator"),c=a("core/class").createClass("RotateAnimator",{base:b,constructor:function(a,b,c){this.callBase({beginValue:0,finishValue:a,setter:function(a,d,e){var f=e.getDelta();a.rotate(f,b,c)}})}}),d=a("graphic/shape");return a("core/class").extendClass(d,{fxRotate:function(a,b,d,e,f){return this.animate(new c(a),b,d,e,f)},fxRotateAnchor:function(a,b,d,e,f,g,h){return this.animate(new c(a,b,d),e,f,g,h)}}),c}),a("animate/scaleanimator",["animate/animator","animate/timeline","animate/easing","core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){var b=a("animate/animator"),c=a("core/class").createClass("ScaleAnimator",{base:b,constructor:function(a,b){this.callBase({beginValue:0,finishValue:1,setter:function(c,d,e){var f=e.getDelta(),g=Math.pow(a,f),h=Math.pow(b,f);c.scale(h,g)}})}}),d=a("graphic/shape");return a("core/class").extendClass(d,{fxScale:function(a,b,d,e,f,g){return this.animate(new c(a,b),d,e,f,g)}}),c}),a("animate/timeline",["graphic/eventhandler","core/utils","graphic/shapeevent","core/class","animate/frame"],function(a){function b(a,b,c){return g.paralle(a,b,function(a,b){return a+(b-a)*c})}function c(a,b){return g.paralle(a,b,function(a,b){return b-a})}function d(a,b,c){this.timeline=a,this.target=a.target,this.type=b;for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d])}var e=a("graphic/eventhandler"),f=a("animate/frame"),g=a("core/utils"),h=a("core/class").createClass("Timeline",{mixins:[e],constructor:function(a,b,c,d){this.callMixin(),this.target=b,this.time=0,this.duration=c,this.easing=d,this.animator=a,this.beginValue=a.beginValue,this.finishValue=a.finishValue,this.setter=a.setter,this.status="ready"},nextFrame:function(a){"playing"==this.status&&(this.time+=a.dur,this.setValue(this.getValue()),this.time>=this.duration&&this.timeUp(),a.next())},getPlayTime:function(){return this.rollbacking?this.duration-this.time:this.time},getTimeProportion:function(){return this.getPlayTime()/this.duration},getValueProportion:function(){return this.easing(this.getPlayTime(),0,1,this.duration)},getValue:function(){var a=this.beginValue,c=this.finishValue,d=this.getValueProportion();return b(a,c,d)},setValue:function(a){this.lastValue=this.currentValue,this.currentValue=a,this.setter.call(this.target,this.target,a,this)},getDelta:function(){return this.lastValue=void 0===this.lastValue?this.beginValue:this.lastValue,c(this.lastValue,this.currentValue)},play:function(){var a=this.status;switch(this.status="playing",a){case"ready":g.isFunction(this.beginValue)&&(this.beginValue=this.beginValue.call(this.target,this.target)),g.isFunction(this.finishValue)&&(this.finishValue=this.finishValue.call(this.target,this.target)),this.time=0,this.frame=f.requestFrame(this.nextFrame.bind(this));break;case"finished":case"stoped":this.time=0,this.frame=f.requestFrame(this.nextFrame.bind(this));break;case"paused":this.frame.next()}return this.fire("play",new d(this,"play",{lastStatus:a})),this},pause:function(){return this.status="paused",this.fire("pause",new d(this,"pause")),f.releaseFrame(this.frame),this},stop:function(){return this.status="stoped",this.setValue(this.finishValue),this.rollbacking=!1,this.fire("stop",new d(this,"stop")),f.releaseFrame(this.frame),this},timeUp:function(){this.repeatOption?(this.time=0,this.rollback?this.rollbacking?(this.decreaseRepeat(),this.rollbacking=!1):(this.rollbacking=!0,this.fire("rollback",new d(this,"rollback"))):this.decreaseRepeat(),this.repeatOption?this.fire("repeat",new d(this,"repeat")):this.finish()):this.finish()},finish:function(){this.setValue(this.finishValue),this.status="finished",this.fire("finish",new d(this,"finish")),f.releaseFrame(this.frame)},decreaseRepeat:function(){this.repeatOption!==!0&&this.repeatOption--},repeat:function(a,b){return this.repeatOption=a,this.rollback=b,this}});return h.requestFrame=f.requestFrame,h.releaseFrame=f.releaseFrame,h}),a("animate/translateanimator",["animate/animator","animate/timeline","animate/easing","core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){var b=a("animate/animator"),c=a("core/class").createClass("TranslateAnimator",{base:b,constructor:function(a,b){this.callBase({x:0,y:0},{x:a,y:b},function(a,b,c){var d=c.getDelta();a.translate(d.x,d.y)})}}),d=a("graphic/shape");return a("core/class").extendClass(d,{fxTranslate:function(a,b,d,e,f,g){return this.animate(new c(a,b),d,e,f,g)}}),c}),a("core/browser",[],function(){var a=function(){var a,b=navigator.userAgent.toLowerCase(),c=window.opera;a={ie:/(msie\s|trident.*rv:)([\w.]+)/.test(b),opera:!!c&&c.version,webkit:b.indexOf(" applewebkit/")>-1,mac:b.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode},a.gecko="Gecko"==navigator.product&&!a.webkit&&!a.opera&&!a.ie;var d=0;if(a.ie&&(d=1*(b.match(/(msie\s|trident.*rv:)([\w.]+)/)[2]||0),a.ie11Compat=11==document.documentMode,a.ie9Compat=9==document.documentMode),a.gecko){var e=b.match(/rv:([\d\.]+)/);e&&(e=e[1].split("."),d=1e4*e[0]+100*(e[1]||0)+1*(e[2]||0))}return/chrome\/(\d+\.\d)/i.test(b)&&(a.chrome=+RegExp.$1),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(b)&&!/chrome/i.test(b)&&(a.safari=+(RegExp.$1||RegExp.$2)),a.opera&&(d=parseFloat(c.version())),a.webkit&&(d=parseFloat(b.match(/ applewebkit\/(\d+)/)[1])),a.version=d,a.isCompatible=!a.mobile&&(a.ie&&d>=6||a.gecko&&d>=10801||a.opera&&d>=9.5||a.air&&d>=1||a.webkit&&d>=522||!1),a}();return a}),a("core/class",[],function(a,b){function c(){}function d(a,b){var c=a.toString();if(!/this\.callBase/.test(c))throw new Error(b+" : 类构造函数没有调用父类的构造函数!为了安全,请调用父类的构造函数")}function e(a,b){var c=a;c.__KityConstructor=a,c.prototype=Object.create(b.prototype);for(var d in b.prototype)b.prototype.hasOwnProperty(d)&&0!==d.indexOf("__Kity")&&(c.prototype[d]=b.prototype[d]);return c.prototype.constructor=c,c}function f(a,b){if(!1==b instanceof Array)return a;var c,d,e,f=b.length;for(a.__KityMixins={constructor:[]},c=0;f>c;c++){d=b[c].prototype;for(e in d)!1!==d.hasOwnProperty(e)&&0!==e.indexOf("__Kity")&&("constructor"===e?a.__KityMixins.constructor.push(d[e]):a.prototype[e]=a.__KityMixins[e]=d[e])}return a}function g(a,b){b.__KityClassName&&(b=b.prototype);for(var c in b)if(b.hasOwnProperty(c)&&c.indexOf("__Kity")&&"constructor"!=c){var d=a.prototype[c]=b[c];d.__KityMethodClass=a,d.__KityMethodName=c}return a}Function.prototype.bind=Function.prototype.bind||function(a){var b=Array.prototype.slice.call(arguments,1);return this.apply(a,b)},c.__KityClassName="Class",c.prototype.base=function(a){var b=arguments.callee.caller,c=b.__KityMethodClass.__KityBaseClass.prototype[a];return c.apply(this,Array.prototype.slice.call(arguments,1))},c.prototype.callBase=function(){var a=arguments.callee.caller,b=a.__KityMethodClass.__KityBaseClass.prototype[a.__KityMethodName];return b.apply(this,arguments)},c.prototype.mixin=function(a){var b=arguments.callee.caller,c=b.__KityMethodClass.__KityMixins;if(!c)return this;var d=c[a];return d.apply(this,Array.prototype.slice.call(arguments,1))},c.prototype.callMixin=function(){var a=arguments.callee.caller,b=a.__KityMethodName,c=a.__KityMethodClass.__KityMixins;if(!c)return this;var d=c[b];if("constructor"==b){for(var e=0,f=d.length;f>e;e++)d[e].call(this);return this}return d.apply(this,arguments)},c.prototype.pipe=function(a){return"function"==typeof a&&a.call(this,this),this},c.prototype.getType=function(){return this.__KityClassName||this.constructor.name},c.prototype.getClass=function(){return this.constructor};"__KITY_INHERIT_FLAG_"+ +new Date;c.prototype._accessProperty=function(){return this._propertyRawData||(this._propertyRawData={})},b.createClass=function(a,b){var h,i,j;return 1===arguments.length&&(b=arguments[0],a="AnonymousClass"),j=b.base||c,b.hasOwnProperty("constructor")?(h=b.constructor,j!=c&&d(h,a)):h=function(){this.callBase.apply(this,arguments),this.callMixin.apply(this,arguments)},i=e(h,j,a),i=f(i,b.mixins),i.__KityClassName=h.__KityClassName=a,i.__KityBaseClass=h.__KityBaseClass=j,i.__KityMethodName=h.__KityMethodName="constructor",i.__KityMethodClass=h.__KityMethodClass=i,delete b.mixins,delete b.constructor,delete b.base,i=g(i,b)},b.extendClass=g}),a("core/utils",[],function(){var a={each:function(a,b,c){if(null!==a)if(a.length===+a.length){for(var d=0,e=a.length;e>d;d++)if(b.call(c,a[d],d,a)===!1)return!1}else for(var f in a)if(a.hasOwnProperty(f)&&b.call(c,a[f],f,a)===!1)return!1},extend:function(a){for(var b=arguments,c=this.isBoolean(b[b.length-1])?b[b.length-1]:!1,d=this.isBoolean(b[b.length-1])?b.length-1:b.length,e=1;d>e;e++){var f=b[e];for(var g in f)c&&a.hasOwnProperty(g)||(a[g]=f[g])}return a},deepExtend:function(a){for(var b=arguments,c=this.isBoolean(b[b.length-1])?b[b.length-1]:!1,d=this.isBoolean(b[b.length-1])?b.length-1:b.length,e=1;d>e;e++){var f=b[e];for(var g in f)c&&a.hasOwnProperty(g)||(this.isObject(a[g])&&this.isObject(f[g])?this.deepExtend(a[g],f[g],c):a[g]=f[g])}return a},clone:function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},copy:function(a){return"object"!=typeof a?a:"function"==typeof a?null:JSON.parse(JSON.stringify(a))},queryPath:function(a,b){for(var c=a.split("."),d=0,e=b,f=c.length;f>d;){if(!(c[d]in e))return void 0;if(e=e[c[d]],d++,d>=f||void 0===e)return e}},getValue:function(a,b){return void 0!==a?a:b},flatten:function(b){var c,d=[],e=b.length;for(c=0;e>c;c++)b[c]instanceof Array?d=d.concat(a.flatten(b[c])):d.push(b[c]);return d},paralle:function(b,c,d){var e,f,g,h;if(b instanceof Array){for(h=[],f=0;fg;g++)b[5*g+3]=c[g]/255;return b[18]=a.get("a"),this.colorMatrixEffect.set("values",b.join(" ")),this},setOpacity:function(a){var b=this.colorMatrixEffect.get("values").split(" ");return b[18]=a,this.colorMatrixEffect.set("values",b.join(" ")),this},setOffset:function(a,b){this.setOffsetX(a),this.setOffsetY(b)},setOffsetX:function(a){this.offsetEffect.set("dx",a)},setOffsetY:function(a){this.offsetEffect.set("dy",a)},setDeviation:function(a){this.gaussianblurEffect.set("stdDeviation",a)}})}),a("graphic/bezier",["core/class","graphic/pointcontainer","graphic/container","graphic/path","core/utils","graphic/shape","graphic/svg","graphic/geometry"],function(a){return a("core/class").createClass("Bezier",{mixins:[a("graphic/pointcontainer")],base:a("graphic/path"),constructor:function(a){this.callBase(),a=a||[],this.changeable=!0,this.setBezierPoints(a)},getBezierPoints:function(){return this.getPoints()},setBezierPoints:function(a){return this.setPoints(a)},onContainerChanged:function(){this.changeable&&this.update()},update:function(){var a=null,b=this.getBezierPoints();if(!(b.length<2)){a=this.getDrawer(),a.clear();var c=b[0].getVertex(),d=null,e=null;a.moveTo(c.x,c.y);for(var f=1,g=b.length;g>f;f++)c=b[f].getVertex(),e=b[f].getBackward(),d=b[f-1].getForward(),a.bezierTo(d.x,d.y,e.x,e.y,c.x,c.y);return this}}})}),a("graphic/bezierpoint",["graphic/shapepoint","core/class","graphic/point","graphic/vector","graphic/matrix"],function(a){var b=a("graphic/shapepoint"),c=a("graphic/vector"),d=a("core/class").createClass("BezierPoint",{constructor:function(a,c,d){this.vertex=new b(a,c),this.forward=new b(a,c),this.backward=new b(a,c),this.setSmooth(void 0===d||d),this.setSymReflaction(!0)},clone:function(){var a=new d,b=null;return b=this.getVertex(),a.setVertex(b.x,b.y),b=this.getForward(),a.setForward(b.x,b.y),b=this.getBackward(),a.setBackward(b.x,b.y),a.setSmooth(a.isSmooth()),a},setVertex:function(a,b){return this.vertex.setPoint(a,b),this.update(),this},moveTo:function(a,b){var c=this.forward.getPoint(),d=this.backward.getPoint(),e=this.vertex.getPoint(),f={left:a-e.x,top:b-e.y};this.forward.setPoint(c.x+f.left,c.y+f.top),this.backward.setPoint(d.x+f.left,d.y+f.top),this.vertex.setPoint(a,b),this.update()},setForward:function(a,b){return this.forward.setPoint(a,b),this.smooth&&this.updateAnother(this.forward,this.backward),this.update(),this},setBackward:function(a,b){return this.backward.setPoint(a,b),this.smooth&&this.updateAnother(this.backward,this.forward),this.update(),this},setSymReflaction:function(a){this.symReflaction=a},isSymReflaction:function(){return this.symReflaction},updateAnother:function(a,b){var d=this.getVertex(),e=c.fromPoints(a.getPoint(),d),f=c.fromPoints(d,b.getPoint());f=c.normalize(e,this.isSymReflaction()?e.length():f.length()),b.setPoint(d.x+f.x,d.y+f.y)},setSmooth:function(a){return this.smooth=!!a,this},getVertex:function(){return this.vertex.getPoint()},getForward:function(){return this.forward.getPoint()},getBackward:function(){return this.backward.getPoint()},isSmooth:function(){return this.smooth},update:function(){return this.container?void(this.container.update&&this.container.update(this)):this}});return d}),a("graphic/box",["core/class"],function(a){var b=a("core/class").createClass("Box",{constructor:function(a,b,c,d){var e=arguments[0];e&&"object"==typeof e&&(a=e.x,b=e.y,c=e.width,d=e.height),0>c&&(a-=c=-c),0>d&&(b-=d=-d),this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this.left=a,this.right=this.x+this.width,this.top=this.y,this.bottom=this.y+this.height,this.cx=a+this.width/2,this.cy=b+this.height/2},getRangeX:function(){return[this.left,this.right]},getRangeY:function(){return[this.left,this.right]},merge:function(a){var c=Math.min(this.x,a.x),d=Math.max(this.right,a.right),e=Math.min(this.y,a.y),f=Math.max(this.bottom,a.bottom);return new b(c,e,d-c,f-e)},expand:function(a,c,d,e){return new b(this.x+a,this.y+c,this.width+d,this.height+e)},valueOf:function(){return[this.x,this.y,this.width,this.height]},toString:function(){return this.valueOf().join(" ")}});return b}),a("graphic/circle",["core/class","graphic/ellipse","core/utils","graphic/point","graphic/path"],function(a){return a("core/class").createClass("Circle",{base:a("graphic/ellipse"),constructor:function(a,b,c){this.callBase(a,a,b,c)},getRadius:function(){return this.getRadiusX()},setRadius:function(a){return this.callBase(a,a)}})}),a("graphic/clip",["core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box","graphic/shapecontainer","graphic/container"],function(a){var b=a("core/class"),c=a("graphic/shape"),d=b.createClass("Clip",{base:c,mixins:[a("graphic/shapecontainer")],constructor:function(){this.callBase("clipPath")},clip:function(a){return a.getNode().setAttribute("clip-path","url(#"+this.getId()+")"),this}});return b.extendClass(c,{clipWith:function(a){return a.clip(this),this}}),d}),a("graphic/color",["core/utils","graphic/standardcolor","core/class"],function(a){var b=a("core/utils"),c=a("graphic/standardcolor"),d={},e=a("core/class").createClass("Color",{constructor:function(){var a=null;"string"==typeof arguments[0]?(a=d.parseToValue(arguments[0]),null===a&&(a={r:0,g:0,b:0,h:0,s:0,l:0,a:1})):(a={r:0|arguments[0],g:0|arguments[1],b:0|arguments[2],a:parseFloat(arguments[3])||1},a=d.overflowFormat(a),a=b.extend(a,d.rgbValueToHslValue(a))),this._color=a},set:function(a,c){if(!e._MAX_VALUE[a])throw new Error("Color set(): Illegal parameter");return"a"!==a&&(c=Math.floor(c)),"h"==a&&(c=(c+360)%360),this._color[a]=Math.max(e._MIN_VALUE[a],Math.min(e._MAX_VALUE[a],c)),-1!=="rgb".indexOf(a)?this._color=b.extend(this._color,d.rgbValueToHslValue(this._color)):-1!=="hsl".indexOf(a)&&(this._color=b.extend(this._color,d.hslValueToRGBValue(this._color))),this},inc:function(a,b){return b=this.get(a)+b,"h"==a?b=(b+360)%360:(b=Math.min(e._MAX_VALUE[a],b),b=Math.max(e._MIN_VALUE[a],b)),this.clone().set(a,b)},dec:function(a,b){return this.inc(a,-b)},clone:function(){return new e(this.toRGBA())},get:function(a){return e._MAX_VALUE[a]?this._color[a]:null -},getValues:function(){return b.clone(this._color)},valueOf:function(){return this.getValues()},toRGB:function(){return d.toString(this._color,"rgb")},toRGBA:function(){return d.toString(this._color,"rgba")},toHEX:function(){return d.toString(this._color,"hex")},toHSL:function(){return d.toString(this._color,"hsl")},toHSLA:function(){return d.toString(this._color,"hsla")},toString:function(){return 1===this._color.a?this.toRGB():this.toRGBA()}});return b.extend(e,{_MAX_VALUE:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},_MIN_VALUE:{r:0,g:0,b:0,h:0,s:0,l:0,a:0},R:"r",G:"g",B:"b",H:"h",S:"s",L:"l",A:"a",parse:function(a){var c;return b.isString(a)&&(c=d.parseToValue(a)),b.isObject(a)&&"r"in a&&(c=a),null===c?new e:new e(c.r,c.g,c.b,c.a)},createHSL:function(a,b,c){return e.createHSLA(a,b,c,1)},createHSLA:function(a,b,c,d){var f=null;return b+="%",c+="%",f=["hsla("+a,b,c,d+")"],e.parse(f.join(", "))},createRGB:function(a,b,c){return e.createRGBA(a,b,c,1)},createRGBA:function(a,b,c,d){return new e(a,b,c,d)}}),b.extend(d,{parseToValue:function(a){var b={};if(a=c.EXTEND_STANDARD[a]||c.COLOR_STANDARD[a]||a,/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(a))b=d.hexToValue(a);else if(/^(rgba?)/i.test(a))b=d.rgbaToValue(a);else{if(!/^(hsla?)/i.test(a))return null;b=d.hslaToValue(a)}return d.overflowFormat(b)},hexToValue:function(a){var c={},e=["r","g","b"];return/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(a)?(a=RegExp.$1.split(""),b.each(e,function(b,e){c[b]=d.toNumber(3===a.length?a[e]+a[e]:a[2*e]+a[2*e+1])}),c=b.extend(c,d.rgbValueToHslValue(c)),c.a=1,c):null},rgbaToValue:function(a){var c={},e=!1,f=["r","g","b"];return/^(rgba?)/i.test(a)?(e=4===RegExp.$1.length,a=a.replace(/^rgba?/i,"").replace(/\s+/g,"").replace(/[^0-9,.]/g,"").split(","),b.each(f,function(b,d){c[b]=0|a[d]}),c=b.extend(c,d.rgbValueToHslValue(c)),c.a=e?parseFloat(a[3]):1,c):null},hslaToValue:function(a){var c={},e=!1;return/^(hsla?)/i.test(a)?(e=4===RegExp.$1.length,a=a.replace(/^hsla?/i,"").replace(/\s+/g,"").replace(/[^0-9,.]/g,"").split(","),c.h=0|a[0],c.s=0|a[1],c.l=0|a[2],c=b.extend(c,d.hslValueToRGBValue(c)),c=d.hslValueToRGBValue(c),c.a=e?parseFloat(a[3]):1,c):null},hslValueToRGBValue:function(a){function c(a,b,c){return 0>c?c+=1:c>1&&(c-=1),1>6*c?a+6*(b-a)*c:1>2*c?b:2>3*c?a+(b-a)*(2/3-c)*6:a}var d=null,e=null,f={};return a=b.extend({},a),a.h=a.h/360,a.s=a.s/100,a.l=a.l/100,0===a.s?f.r=f.g=f.b=a.l:(d=a.l<.5?a.l*(1+a.s):a.l+a.s-a.l*a.s,e=2*a.l-d,f.r=c(e,d,a.h+1/3),f.g=c(e,d,a.h),f.b=c(e,d,a.h-1/3)),f.r=Math.min(Math.round(255*f.r),255),f.g=Math.min(Math.round(255*f.g),255),f.b=Math.min(Math.round(255*f.b),255),f},rgbValueToHslValue:function(a){var c=null,d=null,e={};return a=b.extend({},a),a.r=a.r/255,a.g=a.g/255,a.b=a.b/255,c=Math.max(a.r,a.g,a.b),d=Math.min(a.r,a.g,a.b),c===d?e.h=0:c===a.r?e.h=a.g>=a.b?60*(a.g-a.b)/(c-d):60*(a.g-a.b)/(c-d)+360:c===a.g?e.h=60*(a.b-a.r)/(c-d)+120:c===a.b&&(e.h=60*(a.r-a.g)/(c-d)+240),e.l=(c+d)/2,e.s=0===e.l||c===d?0:e.l>0&&e.l<=.5?(c-d)/(c+d):(c-d)/(2-c-d),e.h=Math.round(e.h),e.s=Math.round(100*e.s),e.l=Math.round(100*e.l),e},toString:function(a,c){var e=[];return a=b.extend({},a),-1!==c.indexOf("hsl")&&(a.s+="%",a.l+="%"),"hex"!==c?(b.each(c.split(""),function(b){e.push(a[b])}),(c+"("+e.join(", ")+")").toLowerCase()):(e.push(d.toHexValue(+a.r)),e.push(d.toHexValue(+a.g)),e.push(d.toHexValue(+a.b)),("#"+e.join("")).toLowerCase())},toNumber:function(a){return 0|Number("0x"+a)},toHexValue:function(a){var b=a.toString(16);return 1===b.length?"0"+b:b},overflowFormat:function(a){var c=b.extend({},a),d="rgba";return b.each(d.split(""),function(a){c.hasOwnProperty(a)&&(c[a]=Math.min(e._MAX_VALUE[a],c[a]),c[a]=Math.max(e._MIN_VALUE[a],c[a]))}),c}}),e}),a("graphic/container",["core/class"],function(a){function b(){return this.container.removeItem(this),this}return a("core/class").createClass("Container",{getItems:function(){return this.items||(this.items=[])},getItem:function(a){return this.getItems()[a]},getFirstItem:function(){return this.getItem(0)},getLastItem:function(){return this.getItem(this.getItems().length-1)},indexOf:function(a){return this.getItems().indexOf(a)},eachItem:function(a){var b,c=this.getItems(),d=c.length;for(b=0;d>b;b++)a.call(this,b,c[b]);return this},addItem:function(a,c,d){var e=this.getItems(),f=e.length;return~e.indexOf(a)?this:(c>=0&&f>c||(c=f),e.splice(c,0,a),"object"==typeof a&&(a.container=this,a.remove=b),this.handleAdd(a,c),d||this.onContainerChanged("add",[a]),this)},addItems:function(a){for(var b=0,c=a.length;c>b;b++)this.addItem(a[b],-1,!0);return this.onContainerChanged("add",a),this},setItems:function(a){return this.clear().addItems(a)},appendItem:function(a){return this.addItem(a)},prependItem:function(a){return this.addItem(a,0)},removeItem:function(a,b){if("number"!=typeof a)return this.removeItem(this.indexOf(a));var c=this.getItems(),d=(c.length,c[a]);return void 0===d?this:(c.splice(a,1),d.container&&delete d.container,d.remove&&delete d.remove,this.handleRemove(d,a),b||this.onContainerChanged("remove",[d]),this)},clear:function(){for(var a,b=[];a=this.getFirstItem();)b.push(a),this.removeItem(0,!0);return this.onContainerChanged("remove",b),this},onContainerChanged:function(){},handleAdd:function(){},handleRemove:function(){}})}),a("graphic/curve",["core/utils","core/class","graphic/path","graphic/shape","graphic/svg","graphic/geometry","graphic/pointcontainer","graphic/container"],function(a){var b=a("core/utils"),c={getCurvePanLines:function(a,b){var d=c.getCenterPoints(a),e=c.getPanLine(a.length,d);return c.getMovedPanLines(a,e,b)},getCenterPoints:function(a){for(var b={},c=null,d=0,e=0,f=a.length;f>d;d++)e=d===f-1?0:d+1,c=d+","+e,b[c]={x:(a[d].x+a[e].y)/2,y:(a[d].x+a[e].y)/2};return b},getPanLine:function(a,b){for(var c,d={},e=null,f=0;a>f;f++){var g=null,h=null;c=(f+1)%a,e=c,g=b[f+","+c],f=c,c=(f+1)%a,h=b[f+","+c],d[e]={points:[{x:g.x,y:g.y},{x:h.x,y:h.y}],center:{x:(g.x+h.x)/2,y:(g.y+h.y)/2}},f=(e+a-1)%a}return d},getMovedPanLines:function(a,c,d){var e={};return b.each(a,function(a,f){var g=c[f],h=g.center,i={x:h.x-a.x,y:h.y-a.y},j=e[f]={points:[],center:{x:a.x,y:a.y}};b.each(g.points,function(a){var b={x:a.x-i.x,y:a.y-i.y},c=j.center,e=b.x-c.x,f=b.y-c.y;b.x=c.x+d*e,b.y=c.y+d*f,j.points.push(b)})}),e}};return a("core/class").createClass("Curve",{base:a("graphic/path"),mixins:[a("graphic/pointcontainer")],constructor:function(a,b){this.callBase(),this.setPoints(a||[]),this.closeState=!!b,this.changeable=!0,this.smoothFactor=1,this.update()},onContainerChanged:function(){this.changeable&&this.update()},setSmoothFactor:function(a){return this.smoothFactor=0>a?0:a,this.update(),this},getSmoothFactor:function(){return this.smoothFactor},update:function(){var a=this.getPoints(),b=null,d=this.getDrawer(),e=null,f=null,g=null;if(d.clear(),0===a.length)return this;if(d.moveTo(a[0]),1===a.length)return this;if(2===a.length)return d.lineTo(a[1]),this;b=c.getCurvePanLines(a,this.getSmoothFactor());for(var h=1,i=a.length;i>h;h++)e=b[h].center,f=this.closeState||h!=i-1?b[h].points[0]:b[h].center,g=this.closeState||1!=h?b[h-1].points[1]:b[h-1].center,d.bezierTo(g.x,g.y,f.x,f.y,e.x,e.y);return this.closeState&&(e=b[0].center,f=b[0].points[0],g=b[a.length-1].points[1],d.bezierTo(g.x,g.y,f.x,f.y,e.x,e.y)),this},close:function(){return this.closeState=!0,this.update()},open:function(){return this.closeState=!1,this.update()},isClose:function(){return!!this.closeState}})}),a("graphic/data",["core/class"],function(a){return a("core/class").createClass("Data",{constructor:function(){this._data={}},setData:function(a,b){return this._data[a]=b,this},getData:function(a){return this._data[a]},removeData:function(a){return delete this._data[a],this}})}),a("graphic/defbrush",["core/class","graphic/resource","graphic/svg"],function(a){return a("core/class").createClass("GradientBrush",{base:a("graphic/resource"),constructor:function(a){this.callBase(a)}})}),a("graphic/ellipse",["core/utils","graphic/point","core/class","graphic/path","graphic/shape","graphic/svg","graphic/geometry"],function(a){var b=(a("core/utils"),a("graphic/point"));return a("core/class").createClass("Ellipse",{base:a("graphic/path"),constructor:function(a,b,c,d){this.callBase(),this.rx=a||0,this.ry=b||0,this.cx=c||0,this.cy=d||0,this.update()},update:function(){var a=this.rx,b=this.ry,c=this.cx+a,d=this.cx-a,e=this.cy,f=this.getDrawer();return f.clear(),f.moveTo(c,e),f.arcTo(a,b,0,1,1,d,e),f.arcTo(a,b,0,1,1,c,e),this},getRadius:function(){return{x:this.rx,y:this.ry}},getRadiusX:function(){return this.rx},getRadiusY:function(){return this.ry},getCenter:function(){return new b(this.cx,this.cy)},getCenterX:function(){return this.cx},getCenterY:function(){return this.cy},setRadius:function(a,b){return this.rx=a,this.ry=b,this.update()},setRadiusX:function(a){return this.rx=a,this.update()},setRadiusY:function(a){return this.ry=a,this.update()},setCenter:function(a,c){if(1==arguments.length){var d=b.parse(arguments[0]);a=d.x,c=d.y}return this.cx=a,this.cy=c,this.update()},setCenterX:function(a){return this.cx=a,this.update()},setCenterY:function(a){return this.cy=a,this.update()}})}),a("graphic/eventhandler",["core/utils","graphic/shapeevent","graphic/matrix","graphic/point","core/class"],function(a){function b(a,b,c){return c=!!c,i.isString(a)&&(a=a.match(/\S+/g)),i.each(a,function(a){d.call(this,this.node,a,b,c)},this),this}function c(a,b){var c=null,d=this._EVNET_UID,e=void 0===b;try{c=l[d][a]}catch(g){return}return e||(e=!0,i.each(c,function(a,d){a===b?delete c[d]:e=!1})),e&&(f(this.node,a,k[d][a]),delete l[d][a],delete k[d][a]),this}function d(a,b,c,d){var f=this._EVNET_UID,g=this;k[f]||(k[f]={}),k[f][b]||(k[f][b]=function(a){a=new j(a||window.event),i.each(l[f][b],function(c){var e;return c&&(e=c.call(g,a),d&&g.off(b,c)),e},g)}),l[f]||(l[f]={}),l[f][b]?l[f][b].push(c):(l[f][b]=[c],a&&e(a,b,k[f][b]))}function e(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent("on"+b,c)}function f(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent(b,c)}function g(a,b,c){var d=new CustomEvent(b,{bubbles:!0,cancelable:!0});d._kityParam=c,a.dispatchEvent(d)}function h(a,b,c){var d=null,e=null;try{if(e=k[a._EVNET_UID][b],!e)return}catch(f){return}d=i.extend({type:b,target:a},c||{}),e.call(a,d)}!function(){function a(a,b){b=b||{bubbles:!1,cancelable:!1,detail:void 0};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail),c}a.prototype=window.Event.prototype,window.CustomEvent=a}();var i=a("core/utils"),j=a("graphic/shapeevent"),k={},l={},m=0;return a("core/class").createClass("EventHandler",{constructor:function(){this._EVNET_UID=++m},addEventListener:function(a,c){return b.call(this,a,c,!1)},addOnceEventListener:function(a,c){return b.call(this,a,c,!0)},removeEventListener:function(a,b){return c.call(this,a,b)},on:function(){return this.addEventListener.apply(this,arguments)},once:function(){return this.addOnceEventListener.apply(this,arguments)},off:function(){return this.removeEventListener.apply(this,arguments)},fire:function(){return this.trigger.apply(this,arguments)},trigger:function(a,b){return this.node?g(this.node,a,b):h(this,a,b),this}})}),a("graphic/geometry",["core/utils","graphic/point","core/class","graphic/vector","graphic/matrix","graphic/box"],function(a){function b(a){var b,c,d,e,f;for(b=[],c=0;cc;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function e(){var f=Array.prototype.slice.call(arguments,0),g=f.join("␀"),h=e.cache=e.cache||{},i=e.count=e.count||[];return h.hasOwnProperty(g)?(d(i,g),c?c(h[g]):h[g]):(i.length>=1e3&&delete h[i.shift()],i.push(g),h[g]=a.apply(b,f),c?c(h[g]):h[g])}return e}function d(a,b,c,e,f,g,h,i,j,k){var l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q=Math,R=Q.PI,S=Math.abs,T=120*R/180,U=R/180*(+f||0),V=[],W=function(a,b,c){var d=a*Q.cos(c)-b*Q.sin(c),e=a*Q.sin(c)+b*Q.cos(c);return{x:d,y:e}};if(k?(w=k[0],x=k[1],u=k[2],v=k[3]):(l=W(a,b,-U),a=l.x,b=l.y,l=W(i,j,-U),i=l.x,j=l.y,m=Q.cos(R/180*f),n=Q.sin(R/180*f),p=(a-i)/2,q=(b-j)/2,o=p*p/(c*c)+q*q/(e*e),o>1&&(o=Q.sqrt(o),c=o*c,e=o*e),r=c*c,s=e*e,t=(g==h?-1:1)*Q.sqrt(S((r*s-r*q*q-s*p*p)/(r*q*q+s*p*p))),u=t*c*q/e+(a+i)/2,v=t*-e*p/c+(b+j)/2,w=Q.asin(((b-v)/e).toFixed(9)),x=Q.asin(((j-v)/e).toFixed(9)),w=u>a?R-w:w,x=u>i?R-x:x,0>w&&(w=2*R+w),0>x&&(x=2*R+x),h&&w>x&&(w-=2*R),!h&&x>w&&(x-=2*R)),y=x-w,S(y)>T&&(z=x,A=i,B=j,x=w+T*(h&&x>w?1:-1),i=u+c*Q.cos(x),j=v+e*Q.sin(x),V=d(i,j,c,e,f,0,h,A,B,[x,z,u,v])),y=x-w,C=Q.cos(w),D=Q.sin(w),E=Q.cos(x),F=Q.sin(x),G=Q.tan(y/4),H=4/3*c*G,I=4/3*e*G,J=[a,b],K=[a+H*D,b-I*C],L=[i+H*F,j-I*E],M=[i,j],K[0]=2*J[0]-K[0],K[1]=2*J[1]-K[1],k)return[K,L,M].concat(V);for(V=[K,L,M].concat(V).join().split(","),N=[],O=0,P=V.length;P>O;O++)N[O]=O%2?W(V[O-1],V[O],U).y:W(V[O],V[O+1],U).x;return N}function e(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]}function f(a,b){function c(a){return function(b,c){return b+a*(c-b)}}var d=c(b||.5),e=a,f=e[0],g=e[1],h=e[2],i=e[3],j=e[4],k=e[5],l=e[6],m=e[7],n=d(f,h),o=d(g,i),p=d(h,j),q=d(i,k),r=d(j,l),s=d(k,m),t=d(n,p),u=d(o,q),v=d(p,r),w=d(q,s),x=d(t,v),y=d(u,w);return[[f,g,n,o,t,u,x,y],[x,y,v,w,r,s,l,m]]}var g=a("core/utils"),h=a("graphic/point"),i=a("graphic/vector"),j=a("graphic/matrix"),k={},l=/([achlmrqstvz])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?\s*)+)/gi,m=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)\s*,?\s*/gi,n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0};k.pathToString=function(a){return a=a||this,"string"==typeof a?a:a instanceof Array?(a=g.flatten(a),a.join(",").replace(/,?([achlmqrstvxz]),?/gi,"$1")):void 0},k.parsePathString=c(function(a){var b=[];return a.replace(l,function(a,c,d){var e=[],f=c.toLowerCase();if(d.replace(m,function(a,b){b&&e.push(+b)}),"m"==f&&e.length>2&&(b.push([c].concat(e.splice(0,2))),f="l",c="m"==c?"l":"L"),"r"==f)b.push([c].concat(e));else for(;e.length>=n[f]&&(b.push([c].concat(e.splice(0,n[f]))),n[f]););}),b.isUniform=!0,b.toString=k.pathToString,b}),k.pathToAbsolute=c(function(a){var b,c,d,e,f,g,h,i,j=a.isUniform?a:k.parsePathString(k.pathToString(a)),l=[],m=0,n=0,o=0,p=0,q=0;for("M"==j[0][0]&&(m=+j[0][1],n=+j[0][2],o=m,p=n,q++,l[0]=["M",m,n]),d=q,g=j.length;g>d;d++){if(l.push(b=[]),c=j[d],c[0]!=c[0].toUpperCase())switch(b[0]=c[0].toUpperCase(),b[0]){case"A":b[1]=c[1],b[2]=c[2],b[3]=c[3],b[4]=c[4],b[5]=c[5],b[6]=+(c[6]+m),b[7]=+(c[7]+n);break;case"V":b[1]=+c[1]+n;break;case"H":b[1]=+c[1]+m;break;case"M":o=+c[1]+m,p=+c[2]+n;break;default:for(e=1,h=c.length;h>e;e++)b[e]=+c[e]+(e%2?m:n)}else for(f=0,i=c.length;i>f;f++)b[f]=c[f];switch(b[0]){case"Z":m=o,n=p;break;case"H":m=b[1];break;case"V":n=b[1];break;case"M":o=b[b.length-2],p=b[b.length-1];break;default:m=b[b.length-2],n=b[b.length-1]}}return l.isUniform=!0,l.isAbsolute=!0,l.toString=k.pathToString,l}),k.pathToCurve=c(function(a){var b,c,f,g,h,i,j,l,m,n,o,p=[];for(a.isAbsolute||(a=k.pathToAbsolute(a)),b=0;bb;b++)d=a[b],"M"!=d[0]?"Z"!=d[0]?(f=k.bezierLength(e.concat(d.slice(1))),g.push([h,h+f]),h+=f,e=d.slice(4)):g.push(null):(e=d.slice(1),g.push(null));return g.totalLength=h,g});k.subPath=function(a,b,c){var d;if(c=c||0,d=b-c,d-=0|d,c-=0|c,b=c+d,b>1)return k.subPath(a,1,c).concat(k.subPath(a,b-1));a.isCurve||(a=k.pathToCurve(a));var e,f,g,h,i,j,l,m,n,p=o(a),q=p.totalLength,r=q*b,s=q*(c||0),t=[];for(e=0,f=a.length;f>e;e++)if("M"!=a[e][0]){if("Z"!=a[e][0])if(g=p[e][0],h=p[e][1],i=h-g,l=j.concat(a[e].slice(1)),s>h)j=l.slice(l.length-2);else{if(s>=g)m=k.subBezier(l,Math.min((r-g)/i,1),(s-g)/i),n=!0,j=m.slice(0,2),t.push(["M"].concat(m.slice(0,2))),t.push(["C"].concat(m.slice(2)));else if(r>=h)t.push(a[e].slice());else{if(!(r>=g))break;m=k.subBezier(l,(r-g)/i),t.push(["C"].concat(m.slice(2))),n=!1}j=l.slice(l.length-2)}}else j=a[e].slice(1),n&&t.push(a[e].slice());return t.isAbsolute=!0,t.isCurve=!0,t.isUniform=!0,t.toString=k.pathToString,t},k.pointAtPath=function(a,b){a.isCurve||(a=k.pathToCurve(a));var c=k.subPath(a,b),d="Z"==c[c.length-1][0]?c[c.length-2]:c[c.length-1];d=d.slice(1);var e=h.parse(d.slice(4)),f=h.parse(d.slice(2,4));return e.tan=i.fromPoints(f,e).normalize(),e},k.pathLength=c(function(a){a.isCurve||(a=k.pathToCurve(a));var b=o(a);return b.totalLength}),k.pathKeyPoints=c(function(a){var b,c,d;for(a.isCurve||(a=k.pathToCurve(a)),d=[],b=0,c=a.length;c>b;b++)"z"!=a[b][0]&&d.push(a[b].slice(a[b].length-2));return d});var p=c(function(a,c){function d(a,b){return a[b||a.i]&&a[b||a.i][0]}function e(a,b){return a[b||a.i]&&a[b||a.i].slice(1)}function f(a,b){var c=e(a,b);return c&&c.slice(-2)}function g(a){return"Z"==d(a)?(a.splice(a.i,1),!0):!1}function h(a){return"M"==d(a)?(a.o.splice(a.o.i,0,["M"].concat(f(a.o,a.o.i-1))),a.i++,a.o.i++,!0):!1}function i(a){for(var b,c=1;!b;)b=f(a,a.length-c++);for(a.o.i=a.i;a.lengthc;c++)for(f.push(g=[a[c][0]]),e=1;ee&&f.setAttribute("stop-opacity",e),this.node.appendChild(f),this}})}),a("graphic/group",["graphic/shapecontainer","graphic/container","core/utils","core/class","graphic/shape","graphic/svg","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){var b=a("graphic/shapecontainer");return a("core/class").createClass("Group",{mixins:[b],base:a("graphic/shape"),constructor:function(){this.callBase("g")}})}),a("graphic/hyperlink",["graphic/shapecontainer","graphic/container","core/utils","core/class","graphic/shape","graphic/svg","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){var b=a("graphic/shapecontainer");return a("core/class").createClass("HyperLink",{mixins:[b],base:a("graphic/shape"),constructor:function(a){this.callBase("a"),this.setHref(a)},setHref:function(a){return this.node.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),this},getHref:function(){return this.node.getAttributeNS("xlink:href")},setTarget:function(a){return this.node.setAttribute("target",a),this},getTarget:function(){return this.node.getAttribute("target")}})}),a("graphic/image",["core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){return a("core/class").createClass("Image",{base:a("graphic/shape"),constructor:function(a,b,c,d,e){this.callBase("image"),this.url=a,this.width=b||0,this.height=c||0,this.x=d||0,this.y=e||0,this.update()},update:function(){return this.node.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",this.url),this.node.setAttribute("x",this.x),this.node.setAttribute("y",this.y),this.node.setAttribute("width",this.width),this.node.setAttribute("height",this.height),this},setUrl:function(a){return this.url=""===a?null:a,this.update()},getUrl:function(){return this.url},setWidth:function(a){return this.width=a,this.update()},getWidth:function(){return this.width},setHeight:function(a){return this.height=a,this.update()},getHeight:function(){return this.height},setX:function(a){return this.x=a,this.update()},getX:function(){return this.x},setY:function(a){return this.y=a,this.update()},getY:function(){return this.y}})}),a("graphic/line",["core/class","graphic/path","core/utils","graphic/shape","graphic/svg","graphic/geometry"],function(a){return a("core/class").createClass("Line",{base:a("graphic/path"),constructor:function(a,b,c,d){this.callBase(),this.point1={x:a||0,y:b||0},this.point2={x:c||0,y:d||0},this.update()},setPoint1:function(a,b){return this.point1.x=a,this.point1.y=b,this.update()},setPoint2:function(a,b){return this.point2.x=a,this.point2.y=b,this.update()},getPoint1:function(){return{x:this.point1.x,y:this.point1.y}},getPoint2:function(){return{x:this.point2.x,y:this.point2.y}},update:function(){var a=this.getDrawer();return a.clear(),a.moveTo(this.point1.x,this.point1.y),a.lineTo(this.point2.x,this.point2.y),this}})}),a("graphic/lineargradientbrush",["graphic/svg","graphic/gradientbrush","graphic/defbrush","graphic/color","core/class"],function(a){var b="LinearGradientBrush",c=(a("graphic/svg"),a("graphic/gradientbrush"));return a("core/class").createClass(b,{base:c,constructor:function(a){this.callBase("linearGradient"),this.setStartPosition(0,0),this.setEndPosition(1,0),"function"==typeof a&&a.call(this,this)},setStartPosition:function(a,b){return this.node.setAttribute("x1",a),this.node.setAttribute("y1",b),this},setEndPosition:function(a,b){return this.node.setAttribute("x2",a),this.node.setAttribute("y2",b),this},getStartPosition:function(){return{x:+this.node.getAttribute("x1"),y:+this.node.getAttribute("y1")}},getEndPosition:function(){return{x:+this.node.getAttribute("x2"),y:+this.node.getAttribute("y2")}}})}),a("graphic/marker",["graphic/point","core/class","graphic/resource","graphic/svg","graphic/shapecontainer","graphic/container","core/utils","graphic/shape","graphic/viewbox","graphic/path","graphic/geometry"],function(a){var b=a("graphic/point"),c=a("core/class").createClass("Marker",{base:a("graphic/resource"),mixins:[a("graphic/shapecontainer"),a("graphic/viewbox")],constructor:function(){this.callBase("marker"),this.setOrient("auto")},setRef:function(a,b){return 1===arguments.length&&(b=a.y,a=a.x),this.node.setAttribute("refX",a),this.node.setAttribute("refY",b),this},getRef:function(){return new b(+this.node.getAttribute("refX"),+this.node.getAttribute("refY"))},setWidth:function(a){return this.node.setAttribute("markerWidth",this.width=a),this},setOrient:function(a){return this.node.setAttribute("orient",this.orient=a),this},getOrient:function(){return this.orient},getWidth:function(){return+this.width},setHeight:function(a){return this.node.setAttribute("markerHeight",this.height=a),this},getHeight:function(){return+this.height}}),d=a("graphic/path");return a("core/class").extendClass(d,{setMarker:function(a,b){return b=b||"end",a?this.node.setAttribute("marker-"+b,a.toString()):this.node.removeAttribute("marker-"+b),this}}),c}),a("graphic/mask",["core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box","graphic/shapecontainer","graphic/container"],function(a){var b=a("core/class"),c=a("graphic/shape"),d=b.createClass("Mask",{base:c,mixins:[a("graphic/shapecontainer")],constructor:function(){this.callBase("mask")},mask:function(a){return a.getNode().setAttribute("mask","url(#"+this.getId()+")"),this}});return b.extendClass(c,{maskWith:function(a){return a.mask(this),this}}),d}),a("graphic/matrix",["core/utils","graphic/box","core/class","graphic/point"],function(a){function b(a,b){return{a:b.a*a.a+b.c*a.b,b:b.b*a.a+b.d*a.b,c:b.a*a.c+b.c*a.d,d:b.b*a.c+b.d*a.d,e:b.a*a.e+b.c*a.f+b.e,f:b.b*a.e+b.d*a.f+b.f}}function c(a){return a*Math.PI/180}var d=a("core/utils"),e=a("graphic/box"),f=/matrix\((.+)\)/i,g=a("graphic/point"),h=a("core/class").createClass("Matrix",{constructor:function(){arguments.length?this.setMatrix.apply(this,arguments):this.setMatrix(1,0,0,1,0,0)},translate:function(a,c){return this.m=b(this.m,{a:1,c:0,e:a,b:0,d:1,f:c}),this},rotate:function(a){var d=c(a),e=Math.sin(d),f=Math.cos(d);return this.m=b(this.m,{a:f,c:-e,e:0,b:e,d:f,f:0}),this},scale:function(a,c){return void 0===c&&(c=a),this.m=b(this.m,{a:a,c:0,e:0,b:0,d:c,f:0}),this},skew:function(a,d){void 0===d&&(d=a);var e=Math.tan(c(a)),f=Math.tan(c(d));return this.m=b(this.m,{a:1,c:e,e:0,b:f,d:1,f:0}),this},inverse:function(){var a,b,c,d,e,f,g,i=this.m,j=i.a,k=i.b,l=i.c,m=i.d,n=i.e,o=i.f;return a=j*m-k*l,b=m/a,c=-k/a,d=-l/a,e=j/a,f=(l*o-n*m)/a,g=(k*n-j*o)/a,new h(b,c,d,e,f,g)},setMatrix:function(a,b,c,e,f,g){return this.m=1===arguments.length?d.clone(arguments[0]):{a:a,b:b,c:c,d:e,e:f,f:g},this},getMatrix:function(){return d.clone(this.m)},getTranslate:function(){var a=this.m;return{x:a.e/a.a,y:a.f/a.d}},mergeMatrix:function(a){return new h(b(this.m,a.m))},merge:function(a){return this.mergeMatrix(a)},toString:function(){return this.valueOf().join(" ")},valueOf:function(){var a=this.m;return[a.a,a.b,a.c,a.d,a.e,a.f]},equals:function(a){var b=this.m,c=a.m;return b.a==c.a&&b.b==c.b&&b.c==c.c&&b.d==c.d&&b.e==c.e&&b.f==c.f},transformPoint:function(){return h.transformPoint.apply(null,[].slice.call(arguments).concat([this.m]))},transformBox:function(a){return h.transformBox(a,this.m)}});return h.parse=function(a){var b,c=parseFloat;if(a instanceof Array)return new h({a:a[0],b:a[1],c:a[2],d:a[3],e:a[4],f:a[5]});if(b=f.exec(a)){var d=b[1].split(",");return 6!=d.length&&(d=b[1].split(" ")),new h({a:c(d[0]),b:c(d[1]),c:c(d[2]),d:c(d[3]),e:c(d[4]),f:c(d[5])})}return new h},h.transformPoint=function(a,b,c){return 2===arguments.length&&(c=b,b=a.y,a=a.x),new g(c.a*a+c.c*b+c.e,c.b*a+c.d*b+c.f)},h.transformBox=function(a,b){for(var c,f,g=Number.MAX_VALUE,i=-Number.MAX_VALUE,j=Number.MAX_VALUE,k=-Number.MAX_VALUE,l=[[a.x,a.y],[a.x+a.width,a.y],[a.x,a.y+a.height],[a.x+a.width,a.y+a.height]],m=[];c=l.pop();)f=h.transformPoint(c[0],c[1],b),m.push(f),g=Math.min(g,f.x),i=Math.max(i,f.x),j=Math.min(j,f.y),k=Math.max(k,f.y);return a=new e({x:g,y:j,width:i-g,height:k-j}),d.extend(a,{closurePoints:m}),a},h.getCTM=function(a,b){var c={a:1,b:0,c:0,d:1,e:0,f:0};switch(b=b||"parent"){case"screen":c=a.node.getScreenCTM();break;case"doc":case"paper":c=a.node.getCTM();break;case"view":case"top":a.getPaper()&&(c=a.node.getTransformToElement(a.getPaper().shapeNode));break;case"parent":a.node.parentNode&&(c=a.node.getTransformToElement(a.node.parentNode));break;default:b.node&&(c=a.node.getTransformToElement(b.shapeNode||b.node))}return c?new h(c.a,c.b,c.c,c.d,c.e,c.f):new h},h}),a("graphic/palette",["graphic/standardcolor","graphic/color","core/utils","core/class"],function(a){var b=a("graphic/standardcolor"),c=a("graphic/color"),d=a("core/utils"),e=a("core/class").createClass("Palette",{constructor:function(){this.color={}},get:function(a){var d=this.color[a]||b.EXTEND_STANDARD[a]||b.COLOR_STANDARD[a]||"";return d?new c(d):null},getColorValue:function(a){return this.color[a]||b.EXTEND_STANDARD[a]||b.COLOR_STANDARD[a]||""},add:function(a,b){return this.color[a]="string"==typeof b?new c(b).toRGBA():b.toRGBA(),b},remove:function(a){return this.color.hasOwnProperty(a)?(delete this.color[a],!0):!1}});return d.extend(e,{getColor:function(a){var d=b.EXTEND_STANDARD[a]||b.COLOR_STANDARD[a];return d?new c(d):null},getColorValue:function(a){return b.EXTEND_STANDARD[a]||b.COLOR_STANDARD[a]||""},addColor:function(a,d){return b.EXTEND_STANDARD[a]="string"==typeof d?new c(d).toRGBA():d.toRGBA(),d},removeColor:function(a){return b.EXTEND_STANDARD.hasOwnProperty(a)?(delete b.EXTEND_STANDARD[a],!0):!1}}),e}),a("graphic/paper",["core/class","core/utils","graphic/svg","graphic/container","graphic/shapecontainer","graphic/shape","graphic/viewbox","graphic/eventhandler","graphic/shapeevent","graphic/styled","graphic/matrix","graphic/box","graphic/point","graphic/data","graphic/pen"],function(a){var b=a("core/class"),c=a("core/utils"),d=a("graphic/svg"),e=a("graphic/container"),f=a("graphic/shapecontainer"),g=a("graphic/viewbox"),h=a("graphic/eventhandler"),i=a("graphic/styled"),j=a("graphic/matrix"),k=b.createClass("Paper",{mixins:[f,h,i,g],constructor:function(a){this.callBase(),this.node=this.createSVGNode(),this.node.paper=this,this.node.appendChild(this.resourceNode=d.createNode("defs")),this.node.appendChild(this.shapeNode=d.createNode("g")),this.resources=new e,this.setWidth("100%").setHeight("100%"),a&&this.renderTo(a),this.callMixin()},renderTo:function(a){c.isString(a)&&(a=document.getElementById(a)),this.container=a,a.appendChild(this.node)},createSVGNode:function(){var a=d.createNode("svg");return a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),a},getNode:function(){return this.node},getContainer:function(){return this.container},getWidth:function(){return this.node.clientWidth},setWidth:function(a){return this.node.setAttribute("width",a),this},getHeight:function(){return this.node.clientHeight},setHeight:function(a){return this.node.setAttribute("height",a),this},setViewPort:function(a,b,c){var d,e;1==arguments.length&&(d=arguments[0],a=d.center.x,b=d.center.y,c=d.zoom),c=c||1,e=this.getViewBox();var f=new j,g=e.x+e.width/2-a,h=e.y+e.height/2-b;return f.translate(-a,-b),f.scale(c),f.translate(a,b),f.translate(g,h),this.shapeNode.setAttribute("transform","matrix("+f+")"),this.viewport={center:{x:a,y:b},offset:{x:g,y:h},zoom:c},this},getViewPort:function(){if(!this.viewport){var a=this.getViewBox();return{zoom:1,center:{x:a.x+a.width/2,y:a.y+a.height/2},offset:{x:0,y:0}}}return this.viewport},getViewPortTransform:function(){var a=this.shapeNode.getCTM();return new j(a.a,a.b,a.c,a.d,a.e,a.f)},getTransform:function(){return this.getViewPortTransform().reverse()},addResource:function(a){return this.resources.appendItem(a),a.node&&this.resourceNode.appendChild(a.node),this},removeResource:function(a){return a.remove&&a.remove(),a.node&&this.resourceNode.removeChild(a.node),this},getPaper:function(){return this -}}),l=a("graphic/shape");return b.extendClass(l,{getPaper:function(){for(var a=this.container;a&&a instanceof k==!1;)a=a.container;return a},whenPaperReady:function(a){function b(){var b=c.getPaper();return b&&a&&a.call(c,b),b}var c=this;return b()||this.on("add treeadd",function d(){b()&&(c.off("add",d),c.off("treeadd",d))}),this}}),k}),a("graphic/path",["core/utils","core/class","graphic/shape","graphic/svg","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box","graphic/geometry","graphic/point","graphic/vector"],function(a){var b=a("core/utils"),c=a("core/class").createClass,d=a("graphic/shape"),e=a("graphic/svg"),f=a("graphic/geometry"),g=Array.prototype.slice,h=(b.flatten,c("PathDrawer",{constructor:function(a){this.segment=[],this.path=a,this.__clear=!1},getPath:function(){return this.path},redraw:function(){return this._transation=this._transation||[],this.clear()},done:function(){var a=this._transation;return this._transation=null,this.push(a),this},clear:function(){return this._transation?this._transation=[]:this.path.setPathData("M 0 0"),this._clear=!0,this},push:function(){var a,b=g.call(arguments);return this._transation?(this._transation.push(b),this):(this._clear?(a="",this._clear=!1):a=this.path.getPathData(),a=a||"",this.path.setPathData(a+f.pathToString(b)),this)},moveTo:function(){return this.push("M",g.call(arguments))},moveBy:function(){return this.push("m",g.call(arguments))},lineTo:function(){return this.push("L",g.call(arguments))},lineBy:function(){return this.push("l",g.call(arguments))},arcTo:function(){return this.push("A",g.call(arguments))},arcBy:function(){return this.push("a",arguments)},carcTo:function(a){return this.push("A",[a,a,0].concat(g.call(arguments,1)))},carcBy:function(a){return this.push("a",[a,a,0].concat(g.call(arguments,1)))},bezierTo:function(){return this.push("C",g.call(arguments))},bezierBy:function(){return this.push("c",g.call(arguments))},close:function(){return this.push("z")}}));return c("Path",{base:d,constructor:function(a){this.callBase("path"),a&&this.setPathData(a),this.node.setAttribute("fill",e.defaults.fill),this.node.setAttribute("stroke",e.defaults.stroke)},setPathData:function(a){return a=a||"M0,0",this.pathdata=f.pathToString(a),this.node.setAttribute("d",this.pathdata),this.trigger("shapeupdate",{type:"pathdata"}),this},getPathData:function(){return this.pathdata||""},getDrawer:function(){return new h(this)},isClosed:function(){var a=this.getPathData();return!!~a.indexOf("z")||!!~a.indexOf("Z")}})}),a("graphic/patternbrush",["graphic/defbrush","core/class","graphic/resource","graphic/shapecontainer","graphic/container","core/utils","graphic/shape","graphic/svg"],function(a){{var b=a("graphic/defbrush"),c=a("graphic/shapecontainer");a("graphic/svg")}return a("core/class").createClass("PatternBrush",{base:b,mixins:[c],constructor:function(){this.callBase("pattern"),this.node.setAttribute("patternUnits","userSpaceOnUse")},setX:function(a){return this.x=a,this.node.setAttribute("x",a),this},setY:function(a){return this.y=a,this.node.setAttribute("y",a),this},setWidth:function(a){return this.width=a,this.node.setAttribute("width",a),this},setHeight:function(a){return this.height=a,this.node.setAttribute("height",a),this},getWidth:function(){return this.width},getHeight:function(){return this.height}})}),a("graphic/pen",["graphic/color","core/utils","graphic/standardcolor","core/class"],function(a){var b=a("graphic/color");return a("core/class").createClass("Pen",{constructor:function(a,b){this.brush=a,this.width=b||1,this.linecap=null,this.linejoin=null,this.dashArray=null,this.opacity=1},getBrush:function(){return this.brush},setBrush:function(a){return this.brush=a,this},setColor:function(a){return this.setBrush(a)},getColor:function(){return this.brush instanceof b?this.brush:null},getWidth:function(){return this.width},setWidth:function(a){return this.width=a,this},getOpacity:function(){return this.opacity},setOpacity:function(a){this.opacity=a},getLineCap:function(){return this.linecap},setLineCap:function(a){return this.linecap=a,this},getLineJoin:function(){return this.linejoin},setLineJoin:function(a){return this.linejoin=a,this},getDashArray:function(){return this.dashArray},setDashArray:function(a){return this.dashArray=a,this},stroke:function(a){var b=a.node;b.setAttribute("stroke",this.brush.toString()),b.setAttribute("stroke-width",this.getWidth()),this.getOpacity()<1&&b.setAttribute("stroke-opacity",this.getOpacity()),this.getLineCap()&&b.setAttribute("stroke-linecap",this.getLineCap()),this.getLineJoin()&&b.setAttribute("stroke-linejoin",this.getLineJoin()),this.getDashArray()&&b.setAttribute("stroke-dasharray",this.getDashArray())}})}),a("graphic/pie",["core/class","graphic/sweep","graphic/point","graphic/path"],function(a){return a("core/class").createClass({base:a("graphic/sweep"),constructor:function(a,b,c){this.callBase([0,a],b,c)},getRadius:function(){return this.getSectionArray()[1]},setRadius:function(a){this.setSectionArray([0,a])}})}),a("graphic/point",["core/class"],function(a){var b=a("core/class").createClass("Point",{constructor:function(a,b){this.x=a||0,this.y=b||0},offset:function(a,c){return 1==arguments.length&&(c=a.y,a=a.x),new b(this.x+a,this.y+c)},valueOf:function(){return[this.x,this.y]},toString:function(){return this.valueOf().join(" ")},spof:function(){return new b((0|this.x)+.5,(0|this.y)+.5)}});return b.fromPolar=function(a,c,d){return"rad"!=d&&(c=c/180*Math.PI),new b(a*Math.cos(c),a*Math.sin(c))},b.parse=function(a){return a instanceof b?a:"string"==typeof a?b.parse(a.split(/\s*[\s,]\s*/)):"0"in a&&"1"in a?new b(a[0],a[1]):void 0},b}),a("graphic/pointcontainer",["core/class","graphic/container"],function(a){return a("core/class").createClass("PointContainer",{base:a("graphic/container"),constructor:function(){this.callBase()},addPoint:function(){return this.addItem.apply(this,arguments)},prependPoint:function(){return this.prependItem.apply(this,arguments)},appendPoint:function(){return this.appendItem.apply(this,arguments)},removePoint:function(){return this.removeItem.apply(this,arguments)},addPoints:function(){return this.addItems.apply(this,arguments)},setPoints:function(){return this.setItems.apply(this,arguments)},getPoint:function(){return this.getItem.apply(this,arguments)},getPoints:function(){return this.getItems.apply(this,arguments)},getFirstPoint:function(){return this.getFirstItem.apply(this,arguments)},getLastPoint:function(){return this.getLastItem.apply(this,arguments)}})}),a("graphic/poly",["core/utils","core/class","graphic/path","graphic/shape","graphic/svg","graphic/geometry","graphic/pointcontainer","graphic/container"],function(a){a("core/utils");return a("core/class").createClass("Poly",{base:a("graphic/path"),mixins:[a("graphic/pointcontainer")],constructor:function(a,b){this.callBase(),this.closeable=!!b,this.setPoints(a||[]),this.changeable=!0,this.update()},onContainerChanged:function(){this.changeable&&this.update()},update:function(){var a=this.getDrawer(),b=this.getPoints();if(a.clear(),!b.length)return this;a.moveTo(b[0]);for(var c,d=1,e=b.length;e>d;d++)c=b[d],a.lineTo(c);return this.closeable&&b.length>2&&a.close(),this}})}),a("graphic/polygon",["core/class","graphic/poly","core/utils","graphic/path","graphic/pointcontainer"],function(a){return a("core/class").createClass("Polygon",{base:a("graphic/poly"),constructor:function(a){this.callBase(a,!0)}})}),a("graphic/polyline",["core/class","graphic/poly","core/utils","graphic/path","graphic/pointcontainer"],function(a){return a("core/class").createClass("Polyline",{base:a("graphic/poly"),constructor:function(a){this.callBase(a)}})}),a("graphic/radialgradientbrush",["graphic/gradientbrush","graphic/svg","graphic/defbrush","graphic/color","core/class"],function(a){var b=a("graphic/gradientbrush");return a("core/class").createClass("RadialGradientBrush",{base:b,constructor:function(a){this.callBase("radialGradient"),this.setCenter(.5,.5),this.setFocal(.5,.5),this.setRadius(.5),"function"==typeof a&&a.call(this,this)},setCenter:function(a,b){return this.node.setAttribute("cx",a),this.node.setAttribute("cy",b),this},getCenter:function(){return{x:+this.node.getAttribute("cx"),y:+this.node.getAttribute("cy")}},setFocal:function(a,b){return this.node.setAttribute("fx",a),this.node.setAttribute("fy",b),this},getFocal:function(){return{x:+this.node.getAttribute("fx"),y:+this.node.getAttribute("fy")}},setRadius:function(a){return this.node.setAttribute("r",a),this},getRadius:function(){return+this.node.getAttribute("r")}})}),a("graphic/rect",["core/utils","graphic/point","core/class","graphic/box","graphic/path","graphic/shape","graphic/svg","graphic/geometry","graphic/shapecontainer","graphic/container"],function(a){var b={},c=a("core/utils"),d=a("graphic/point"),e=a("graphic/box");c.extend(b,{formatRadius:function(a,b,c){var d=Math.floor(Math.min(a/2,b/2));return Math.min(d,c)}});var f=a("core/class").createClass("Rect",{base:a("graphic/path"),constructor:function(a,c,d,e,f){this.callBase(),this.x=d||0,this.y=e||0,this.width=a||0,this.height=c||0,this.radius=b.formatRadius(this.width,this.height,f||0),this.update()},update:function(){var a=this.x,b=this.y,c=this.width,d=this.height,e=this.radius,f=this.getDrawer().redraw();return e?(c-=2*e,d-=2*e,f.push("M",a+e,b),f.push("h",c),f.push("a",e,e,0,0,1,e,e),f.push("v",d),f.push("a",e,e,0,0,1,-e,e),f.push("h",-c),f.push("a",e,e,0,0,1,-e,-e),f.push("v",-d),f.push("a",e,e,0,0,1,e,-e),f.push("z")):(f.push("M",a,b),f.push("h",c),f.push("v",d),f.push("h",-c),f.push("z")),f.done(),this},setWidth:function(a){return this.width=a,this.update()},setHeight:function(a){return this.height=a,this.update()},setSize:function(a,b){return this.width=a,this.height=b,this.update()},setBox:function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this.update()},getBox:function(){return new e(this.x,this.y,this.width,this.height)},getRadius:function(){return this.radius},setRadius:function(a){return this.radius=a,this.update()},getPosition:function(){return new d(this.x,this.y)},setPosition:function(a,b){if(1==arguments.length){var c=d.parse(arguments[0]);b=c.y,a=c.x}return this.x=a,this.y=b,this.update()},getWidth:function(){return this.width},getHeight:function(){return this.height},getPositionX:function(){return this.x},getPositionY:function(){return this.y},setPositionX:function(a){return this.x=a,this.update()},setPositionY:function(a){return this.y=a,this.update()}}),g=a("graphic/shapecontainer");return g.creators.rect=f,f}),a("graphic/regularpolygon",["graphic/point","core/class","graphic/path","core/utils","graphic/shape","graphic/svg","graphic/geometry"],function(a){var b=a("graphic/point");return a("core/class").createClass("RegularPolygon",{base:a("graphic/path"),constructor:function(a,c,d,e){this.callBase(),this.radius=c||0,this.side=Math.max(a||3,3),arguments.length>2&&3==arguments.length&&(e=d.y,d=d.x),this.center=new b(d,e),this.draw()},getSide:function(){return this.side},setSide:function(a){return this.side=a,this.draw()},getRadius:function(){return this.radius},setRadius:function(a){return this.radius=a,this.draw()},draw:function(){var a,c=this.radius,d=this.side,e=2*Math.PI/d,f=this.getDrawer();for(f.clear(),f.moveTo(b.fromPolar(c,Math.PI/2,"rad").offset(this.center)),a=0;d>=a;a++)f.lineTo(b.fromPolar(c,e*a+Math.PI/2,"rad").offset(this.center));return f.close(),this}})}),a("graphic/resource",["graphic/svg","core/class"],function(a){var b=a("graphic/svg");return a("core/class").createClass("Resource",{constructor:function(a){this.callBase(),this.node=b.createNode(a)},toString:function(){return"url(#"+this.node.id+")"}})}),a("graphic/ring",["core/class","graphic/sweep","graphic/point","graphic/path"],function(a){return a("core/class").createClass({base:a("graphic/sweep"),constructor:function(a,b){this.callBase([a,b],360,0)},getInnerRadius:function(){return this.getSectionArray()[0]},getOuterRadius:function(){return this.getSectionArray()[1]},setInnerRadius:function(a){this.setSectionArray([a,this.getOuterRadius()])},setOuterRadius:function(a){this.setSectionArray([this.getInnerRadius(),a])}})}),a("graphic/shape",["graphic/svg","core/utils","graphic/eventhandler","graphic/shapeevent","core/class","graphic/styled","graphic/data","graphic/matrix","graphic/box","graphic/point","graphic/pen","graphic/color"],function(a){var b=a("graphic/svg"),c=a("core/utils"),d=a("graphic/eventhandler"),e=a("graphic/styled"),f=a("graphic/data"),g=a("graphic/matrix"),h=(a("graphic/pen"),Array.prototype.slice),i=a("graphic/box"),j=a("core/class").createClass("Shape",{mixins:[d,e,f],constructor:function(a){this.node=b.createNode(a),this.node.shape=this,this.transform={translate:null,rotate:null,scale:null,matrix:null},this.callMixin()},getId:function(){return this.node.id},setId:function(a){return this.node.id=a,this},getNode:function(){return this.node},getBoundaryBox:function(){var a;try{a=this.node.getBBox()}catch(b){a={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}return new i(a)},getRenderBox:function(a){var b=this.getBoundaryBox(),c=this.getTransform(a);return c.transformBox(b)},getWidth:function(){return this.getRenderBox().width},getHeight:function(){return this.getRenderBox().height},getSize:function(){var a=this.getRenderBox();return delete a.x,delete a.y,a},setOpacity:function(a){return this.node.setAttribute("opacity",a),this},getOpacity:function(){var a=this.node.getAttribute("opacity");return a?+a:1},setVisible:function(a){return a?this.node.removeAttribute("display"):this.node.setAttribute("display","none"),this},getVisible:function(){this.node.getAttribute("display")},hasAncestor:function(a){for(var b=this.container;b;){if(b===a)return!0;b=b.container}return!1},getTransform:function(a){return g.getCTM(this,a)},clearTransform:function(){return this.node.removeAttribute("transform"),this.transform={translate:null,rotate:null,scale:null,matrix:null},this.trigger("shapeupdate",{type:"transform"}),this},_applyTransform:function(){var a=this.transform,b=[];return a.translate&&b.push(["translate(",a.translate,")"]),a.rotate&&b.push(["rotate(",a.rotate,")"]),a.scale&&b.push(["scale(",a.scale,")"]),a.matrix&&b.push(["matrix(",a.matrix,")"]),this.node.setAttribute("transform",c.flatten(b).join(" ")),this},setMatrix:function(a){return this.transform.matrix=a,this._applyTransform()},setTranslate:function(a){return this.transform.translate=null!==a&&h.call(arguments)||null,this._applyTransform()},setRotate:function(a){return this.transform.rotate=null!==a&&h.call(arguments)||null,this._applyTransform()},setScale:function(a){return this.transform.scale=null!==a&&h.call(arguments)||null,this._applyTransform()},translate:function(a,b){var c=this.transform.matrix||new g;return void 0===b&&(b=0),this.transform.matrix=c.translate(a,b),this._applyTransform()},rotate:function(a){var b=this.transform.matrix||new g;return this.transform.matrix=b.rotate(a),this._applyTransform()},scale:function(a,b){var c=this.transform.matrix||new g;return void 0===b&&(b=a),this.transform.matrix=c.scale(a,b),this._applyTransform()},skew:function(a,b){var c=this.transform.matrix||new g;return void 0===b&&(b=a),this.transform.matrix=c.skew(a,b),this._applyTransform()},stroke:function(a,b){return a&&a.stroke?a.stroke(this):a?(this.node.setAttribute("stroke",a.toString()),b&&this.node.setAttribute("stroke-width",b)):null===a&&this.node.removeAttribute("stroe"),this},fill:function(a){return a&&this.node.setAttribute("fill",a.toString()),null===a&&this.node.removeAttribute("fill"),this},setAttr:function(a,b){var d=this;c.isObject(a)&&c.each(a,function(a,b){d.setAttr(b,a)}),void 0===b||null===b||""===b?this.node.removeAttribute(a):this.node.setAttribute(a,b)},getAttr:function(a){return this.node.getAttribute(a)}});return j}),a("graphic/shapecontainer",["graphic/container","core/class","core/utils","graphic/shape","graphic/svg","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){function b(a,b){var c=Object.create(a.prototype);return a.apply(c,b),c}var c=a("graphic/container"),d=a("core/utils"),e=a("core/class").createClass("ShapeContainer",{base:c,isShapeContainer:!0,create:function(a){var c=e.creators[a];if(c){var d=Array.prototype.slice.call(arguments,1),f=b(c,d);return this.addShape(f),f}return null},handleAdd:function(a,b){var c=this.getShapeNode();c.insertBefore(a.node,c.childNodes[b]||null),a.trigger("add",{container:this}),a.notifyTreeModification&&a.notifyTreeModification("treeadd",this)},handleRemove:function(a){var b=this.getShapeNode();b.removeChild(a.node),a.trigger("remove",{container:this}),a.notifyTreeModification&&a.notifyTreeModification("treeremove",this)},notifyTreeModification:function(a,b){this.eachItem(function(c,d){d.notifyTreeModification&&d.notifyTreeModification(a,b),d.trigger(a,{container:b})})},getShape:function(a){return this.getItem(a)},addShape:function(a,b){return this.addItem(a,b)},appendShape:function(a){return this.addShape(a)},prependShape:function(a){return this.addShape(a,0)},replaceShape:function(a,b){var c=this.indexOf(b);if(-1!==c)return this.removeShape(c),this.addShape(a,c),this},addShapeBefore:function(a,b){var c=this.indexOf(b);return this.addShape(a,c)},addShapeAfter:function(a,b){var c=this.indexOf(b);return this.addShape(a,-1===c?void 0:c+1)},addShapes:function(a){return this.addItems(a)},removeShape:function(a){return this.removeItem(a)},getShapes:function(){return this.getItems()},getShapesByType:function(a){function b(e){a.toLowerCase()==e.getType().toLowerCase()&&c.push(e),e.isShapeContainer&&d.each(e.getShapes(),function(a){b(a)})}var c=[];return b(this),c},getShapeById:function(a){return this.getShapeNode().getElementById(a).shape},arrangeShape:function(a,b){return this.removeShape(a).addShape(a,b)},getShapeNode:function(){return this.shapeNode||this.node}}),f=a("graphic/shape");return a("core/class").extendClass(f,{bringTo:function(a){return this.container.arrangeShape(this,a),this},bringFront:function(){return this.bringTo(this.container.indexOf(this)+1)},bringBack:function(){return this.bringTo(this.container.indexOf(this)-1)},bringTop:function(){return this.container.removeShape(this).addShape(this),this},bringRear:function(){return this.bringTo(0)},bringRefer:function(a,b){return a.container&&(this.remove&&this.remove(),a.container.addShape(this,a.container.indexOf(a)+(b||0))),this},bringAbove:function(a){return this.bringRefer(a)},bringBelow:function(a){return this.bringRefer(a,1)},replaceBy:function(a){return this.container&&(a.bringAbove(this),this.remove()),this}}),e.creators={},e}),a("graphic/shapeevent",["graphic/matrix","core/utils","graphic/box","graphic/point","core/class"],function(a){{var b=a("graphic/matrix"),c=a("core/utils");a("graphic/point")}return a("core/class").createClass("ShapeEvent",{constructor:function(a){var b=null;c.isObject(a.target)?c.extend(this,a):(this.type=a.type,b=a.target,b.correspondingUseElement&&(b=b.correspondingUseElement),this.originEvent=a,this.targetShape=b.shape||b.paper||a.currentTarget&&(a.currentTarget.shape||a.currentTarget.paper),a._kityParam&&c.extend(this,a._kityParam))},preventDefault:function(){var a=this.originEvent;return a?a.preventDefault?(a.preventDefault(),a.cancelable):(a.returnValue=!1,!0):!0},getPosition:function(a,c){if(!this.originEvent)return null;var d=this.originEvent.touches?this.originEvent.touches[c||0]:this.originEvent,e=d&&d.clientX||0,f=d&&d.clientY||0,g=this.targetShape.shapeNode||this.targetShape.node,h=b.transformPoint(e,f,g.getScreenCTM().inverse());return b.getCTM(this.targetShape,a||"view").transformPoint(h)},stopPropagation:function(){var a=this.originEvent;return a?void(a.stopPropagation?a.stopPropagation():a.cancelBubble=!1):!0}})}),a("graphic/shapepoint",["core/class","graphic/point"],function(a){return a("core/class").createClass("ShapePoint",{base:a("graphic/point"),constructor:function(a,b){this.callBase(a,b)},setX:function(a){return this.setPoint(a,this.y)},setY:function(a){return this.setPoint(this.x,a)},setPoint:function(a,b){return this.x=a,this.y=b,this.update(),this},getPoint:function(){return this},update:function(){return this.container&&this.container.update&&this.container.update(),this}})}),a("graphic/standardcolor",[],{COLOR_STANDARD:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00"},EXTEND_STANDARD:{}}),a("graphic/star",["graphic/point","core/class","graphic/path","core/utils","graphic/shape","graphic/svg","graphic/geometry"],function(a){var b={3:.2,5:.38196601125,6:.57735026919,8:.541196100146,10:.726542528005,12:.707106781187},c=a("graphic/point");return a("core/class").createClass("Star",{base:a("graphic/path"),constructor:function(a,b,d,e,f){this.callBase(),this.vertex=a||3,this.radius=b||0,this.shrink=d,this.offset=e||new c(0,0),this.angleOffset=f||0,this.draw()},getVertex:function(){return this.vertex},setVertex:function(a){return this.vertex=a,this.draw()},getRadius:function(){return this.radius},setRadius:function(a){return this.radius=a,this.draw()},getShrink:function(){return this.shrink},setShrink:function(a){return this.shrink=a,this.draw()},getOffset:function(){return this.offset},setOffset:function(a){return this.offset=a,this.draw()},getAngleOffset:function(){return this.angleOffset},setAngleOffset:function(a){return this.angleOffset=a,this.draw()},draw:function(){var a,d,e=this.radius,f=this.radius*(this.shrink||b[this.vertex]||.5),g=this.vertex,h=this.offset,i=90,j=180/g,k=this.angleOffset,l=this.getDrawer();for(l.clear(),l.moveTo(c.fromPolar(f,i)),a=1;2*g>=a;a++)d=i+j*a,l.lineTo(a%2?c.fromPolar(e,d+k).offset(h):c.fromPolar(f,d));l.close()}})}),a("graphic/styled",["core/class"],function(a){function b(a){return a.classList||(a.classList=new c(a)),a.classList}var c=a("core/class").createClass("ClassList",{constructor:function(a){this._node=a,this._list=a.className.toString().split(" ")},_update:function(){this._node.className=this._list.join(" ")},add:function(a){this._list.push(a),this._update()},remove:function(a){var b=this._list.indexOf(a);~b&&this._list.splice(b,1),this._update()},contains:function(a){return!!~this._list.indexOf(a)}});return a("core/class").createClass("Styled",{addClass:function(a){return b(this.node).add(a),this},removeClass:function(a){return b(this.node).remove(a),this},hasClass:function(a){return b(this.node).contains(a)},setStyle:function(a){if(2==arguments.length)return this.node.style[arguments[0]]=arguments[1],this;for(var b in a)a.hasOwnProperty(b)&&(this.node.style[b]=a[b]);return this}})}),a("graphic/svg",[],function(){var a=document,b=0,c={createNode:function(d){var e=a.createElementNS(c.ns,d);return e.id="kity_"+d+"_"+b++,e},defaults:{stroke:"none",fill:"none"},xlink:"http://www.w3.org/1999/xlink",ns:"http://www.w3.org/2000/svg"};return c}),a("graphic/sweep",["graphic/point","core/class","graphic/path","core/utils","graphic/shape","graphic/svg","graphic/geometry"],function(a){var b=a("graphic/point");return a("core/class").createClass("Sweep",{base:a("graphic/path"),constructor:function(a,b,c){this.callBase(),this.sectionArray=a||[],this.angle=b||0,this.angleOffset=c||0,this.draw()},getSectionArray:function(){return this.sectionArray},setSectionArray:function(a){return this.sectionArray=a,this.draw()},getAngle:function(){return this.angle},setAngle:function(a){return this.angle=a,this.draw()},getAngleOffset:function(){return this.angleOffset},setAngleOffset:function(a){return this.angleOffset=a,this.draw()},draw:function(){var a,b=this.sectionArray;for(a=0;a0?1:-1;return 180*c*b/Math.PI}});return d.fromPoints=function(a,b){return new d(b.x-a.x,b.y-a.y)},a("core/class").extendClass(b,{asVector:function(){return new d(this.x,this.y)}}),d}),a("graphic/view",["graphic/shapecontainer","graphic/container","core/utils","core/class","graphic/shape","graphic/viewbox","graphic/view"],function(a){var b=a("graphic/shapecontainer"),c=a("graphic/viewbox");return a("core/class").createClass("View",{mixins:[b,c],base:a("graphic/view"),constructor:function(){this.callBase("view")}})}),a("graphic/viewbox",["core/class"],function(a){return a("core/class").createClass("ViewBox",{getViewBox:function(){var a=this.node.getAttribute("viewBox");return null===a?{x:0,y:0,width:this.node.clientWidth||this.node.parentNode.clientWidth,height:this.node.clientHeight||this.node.parentNode.clientHeight}:(a=a.split(" "),{x:+a[0],y:+a[1],width:+a[2],height:+a[3]})},setViewBox:function(a,b,c,d){return this.node.setAttribute("viewBox",[a,b,c,d].join(" ")),this}})}),a("kity",["core/utils","core/class","core/browser","graphic/box","graphic/bezier","graphic/pointcontainer","graphic/path","graphic/bezierpoint","graphic/shapepoint","graphic/vector","graphic/circle","graphic/ellipse","graphic/clip","graphic/shape","graphic/shapecontainer","graphic/color","graphic/standardcolor","graphic/container","graphic/curve","graphic/point","graphic/gradientbrush","graphic/svg","graphic/defbrush","graphic/group","graphic/hyperlink","graphic/image","graphic/line","graphic/lineargradientbrush","graphic/mask","graphic/matrix","graphic/marker","graphic/resource","graphic/viewbox","graphic/palette","graphic/paper","graphic/eventhandler","graphic/styled","graphic/geometry","graphic/patternbrush","graphic/pen","graphic/polygon","graphic/poly","graphic/polyline","graphic/pie","graphic/sweep","graphic/radialgradientbrush","graphic/rect","graphic/regularpolygon","graphic/ring","graphic/data","graphic/star","graphic/text","graphic/textcontent","graphic/textspan","graphic/use","animate/animator","animate/timeline","animate/easing","animate/opacityanimator","animate/rotateanimator","animate/scaleanimator","animate/frame","animate/translateanimator","animate/pathanimator","animate/motionanimator","filter/filter","filter/effectcontainer","filter/gaussianblurfilter","filter/effect/gaussianblureffect","filter/projectionfilter","filter/effect/effect","filter/effect/colormatrixeffect","filter/effect/compositeeffect","filter/effect/offseteffect","filter/effect/convolvematrixeffect"],function(a){var b={},c=a("core/utils");return b.version="2.0.0",c.extend(b,{createClass:a("core/class").createClass,extendClass:a("core/class").extendClass,Utils:c,Browser:a("core/browser"),Box:a("graphic/box"),Bezier:a("graphic/bezier"),BezierPoint:a("graphic/bezierpoint"),Circle:a("graphic/circle"),Clip:a("graphic/clip"),Color:a("graphic/color"),Container:a("graphic/container"),Curve:a("graphic/curve"),Ellipse:a("graphic/ellipse"),GradientBrush:a("graphic/gradientbrush"),Group:a("graphic/group"),HyperLink:a("graphic/hyperlink"),Image:a("graphic/image"),Line:a("graphic/line"),LinearGradientBrush:a("graphic/lineargradientbrush"),Mask:a("graphic/mask"),Matrix:a("graphic/matrix"),Marker:a("graphic/marker"),Palette:a("graphic/palette"),Paper:a("graphic/paper"),Path:a("graphic/path"),PatternBrush:a("graphic/patternbrush"),Pen:a("graphic/pen"),Point:a("graphic/point"),Polygon:a("graphic/polygon"),Polyline:a("graphic/polyline"),Pie:a("graphic/pie"),RadialGradientBrush:a("graphic/radialgradientbrush"),Rect:a("graphic/rect"),RegularPolygon:a("graphic/regularpolygon"),Ring:a("graphic/ring"),Shape:a("graphic/shape"),ShapePoint:a("graphic/shapepoint"),ShapeContainer:a("graphic/shapecontainer"),Sweep:a("graphic/sweep"),Star:a("graphic/star"),Text:a("graphic/text"),TextSpan:a("graphic/textspan"),Use:a("graphic/use"),Vector:a("graphic/vector"),g:a("graphic/geometry"),Animator:a("animate/animator"),Easing:a("animate/easing"),OpacityAnimator:a("animate/opacityanimator"),RotateAnimator:a("animate/rotateanimator"),ScaleAnimator:a("animate/scaleanimator"),Timeline:a("animate/timeline"),TranslateAnimator:a("animate/translateanimator"),PathAnimator:a("animate/pathanimator"),MotionAnimator:a("animate/motionanimator"),Filter:a("filter/filter"),GaussianblurFilter:a("filter/gaussianblurfilter"),ProjectionFilter:a("filter/projectionfilter"),ColorMatrixEffect:a("filter/effect/colormatrixeffect"),CompositeEffect:a("filter/effect/compositeeffect"),ConvolveMatrixEffect:a("filter/effect/convolvematrixeffect"),Effect:a("filter/effect/effect"),GaussianblurEffect:a("filter/effect/gaussianblureffect"),OffsetEffect:a("filter/effect/offseteffect")}),window.kity=b}),function(){try{inc.use("kity")}catch(a){c("kity")}}()}(); \ No newline at end of file +!function(){function define(a,b,c){if(_modules[a]={exports:{},value:null,factory:null},2===arguments.length&&(c=b),"[object Object]"===_modules.toString.call(c))_modules[a].value=c;else{if("function"!=typeof c)throw new Error("define函数未定义的行为");_modules[a].factory=c}}function require(a){var b=_modules[a],c=null;return b?b.value?b.value:(c=b.factory.call(null,require,b.exports,b),c&&(b.exports=c),b.value=b.exports,b.value):null}function use(a){return require(a)}var _modules={};define("animate/animator",["animate/timeline","graphic/eventhandler","animate/frame","core/utils","core/class","animate/easing","graphic/shape","graphic/svg","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){function b(a){var b=parseFloat(a,10);return/ms/.test(a)?b:/s/.test(a)?1e3*b:/min/.test(a)?60*b*1e3:b}var c=a("animate/timeline"),d=a("animate/easing"),e=a("core/class").createClass("Animator",{constructor:function(a,b,c){if(1==arguments.length){var d=arguments[0];this.beginValue=d.beginValue,this.finishValue=d.finishValue,this.setter=d.setter}else this.beginValue=a,this.finishValue=b,this.setter=c},start:function(a,c,d,e,f){4===arguments.length&&"function"==typeof e&&(f=e,e=0);var g=this.create(a,c,d,f);return e=b(e),e>0?setTimeout(function(){g.play()},e):g.play(),g},create:function(a,f,g,h){var i;return f=f&&b(f)||e.DEFAULT_DURATION,g=g||e.DEFAULT_EASING,"string"==typeof g&&(g=d[g]),i=new c(this,a,f,g),"function"==typeof h&&i.on("finish",h),i},reverse:function(){return new e(this.finishValue,this.beginValue,this.setter)}});e.DEFAULT_DURATION=300,e.DEFAULT_EASING="linear";var f=a("graphic/shape");return a("core/class").extendClass(f,{animate:function(a,b,c,d,e){function f(){g.shift(),g.length&&setTimeout(g[0].t.play.bind(g[0].t),g[0].d)}var g=this._KityAnimateQueue=this._KityAnimateQueue||[],h=a.create(this,b,c,e);return h.on("finish",f),g.push({t:h,d:d}),1==g.length&&setTimeout(h.play.bind(h),d),this},timeline:function(){return this._KityAnimateQueue[0].t},stop:function(){var a=this._KityAnimateQueue;if(a)for(;a.length;)a.shift().stop()}}),e}),define("animate/easing",[],function(){var a={linear:function(a,b,c,d){return c*(a/d)+b},swing:function(b,c,d,e){return a.easeOutQuad(b,c,d,e)},ease:function(b,c,d,e){return a.easeInOutCubic(b,c,d,e)},easeInQuad:function(a,b,c,d){return c*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){return-c*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){return(a/=d/2)<1?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b},easeInCubic:function(a,b,c,d){return c*(a/=d)*a*a+b},easeOutCubic:function(a,b,c,d){return c*((a=a/d-1)*a*a+1)+b},easeInOutCubic:function(a,b,c,d){return(a/=d/2)<1?c/2*a*a*a+b:c/2*((a-=2)*a*a+2)+b},easeInQuart:function(a,b,c,d){return c*(a/=d)*a*a*a+b},easeOutQuart:function(a,b,c,d){return-c*((a=a/d-1)*a*a*a-1)+b},easeInOutQuart:function(a,b,c,d){return(a/=d/2)<1?c/2*a*a*a*a+b:-c/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(a,b,c,d){return c*(a/=d)*a*a*a*a+b},easeOutQuint:function(a,b,c,d){return c*((a=a/d-1)*a*a*a*a+1)+b},easeInOutQuint:function(a,b,c,d){return(a/=d/2)<1?c/2*a*a*a*a*a+b:c/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},easeOutSine:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},easeInOutSine:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},easeInExpo:function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b},easeOutExpo:function(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b},easeInOutExpo:function(a,b,c,d){return 0===a?b:a==d?b+c:(a/=d/2)<1?c/2*Math.pow(2,10*(a-1))+b:c/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(a,b,c,d){return-c*(Math.sqrt(1-(a/=d)*a)-1)+b},easeOutCirc:function(a,b,c,d){return c*Math.sqrt(1-(a=a/d-1)*a)+b},easeInOutCirc:function(a,b,c,d){return(a/=d/2)<1?-c/2*(Math.sqrt(1-a*a)-1)+b:c/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(a,b,c,d){var e=1.70158,f=0,g=c;return 0===a?b:1==(a/=d)?b+c:(f||(f=.3*d),ga?-.5*g*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-e)*Math.PI/f)+b:g*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-e)*Math.PI/f)*.5+c+b},easeInBack:function(a,b,c,d,e){return void 0==e&&(e=1.70158),c*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){return void 0==e&&(e=1.70158),c*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){return void 0==e&&(e=1.70158),(a/=d/2)<1?c/2*a*a*(((e*=1.525)+1)*a-e)+b:c/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(b,c,d,e){return d-a.easeOutBounce(e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:2/2.75>a?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(b,c,d,e){return e/2>b?.5*a.easeInBounce(2*b,0,d,e)+c:.5*a.easeOutBounce(2*b-e,0,d,e)+.5*d+c}};return a}),define("animate/frame",[],function(a,b){function c(a){1===j.push(a)&&i(d)}function d(){var a=j;for(j=[];a.length;)h(a.pop())}function e(a){var b=g(a);return c(b),b}function f(a){var b=j.indexOf(a);~b&&j.splice(b,1)}function g(a){var b={index:0,time:+new Date,elapsed:0,action:a,next:function(){c(b)}};return b}function h(a){var b=+new Date,c=b-a.time;c>200&&(c=1e3/60),a.dur=c,a.elapsed+=c,a.time=b,a.action.call(null,a),a.index++}var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return setTimeout(a,1e3/60)},j=[];b.requestFrame=e,b.releaseFrame=f}),define("animate/motionanimator",["animate/animator","animate/timeline","animate/easing","core/class","graphic/shape","graphic/geometry","core/utils","graphic/point","graphic/vector","graphic/matrix","graphic/path","graphic/svg"],function(a){var b=a("animate/animator"),c=a("graphic/geometry"),d=a("graphic/path"),e=a("core/class").createClass("MotionAnimator",{base:b,constructor:function(a){var b=this;this.callBase({beginValue:0,finishValue:1,setter:function(a,e){var f=b.motionPath instanceof d?b.motionPath.getPathData():b.motionPath,g=c.pointAtPath(f,e);a.setTranslate(g.x,g.y),a.setRotate(g.tan.getAngle())}}),this.updatePath(a)},updatePath:function(a){this.motionPath=a}});return a("core/class").extendClass(d,{motion:function(a,b,c,d,f){return this.animate(new e(a),b,c,d,f)}}),e}),define("animate/opacityanimator",["animate/animator","animate/timeline","animate/easing","core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){var b=a("animate/animator"),c=a("core/class").createClass("OpacityAnimator",{base:b,constructor:function(a){this.callBase({beginValue:function(a){return a.getOpacity()},finishValue:a,setter:function(a,b){a.setOpacity(b)}})}}),d=a("graphic/shape");return a("core/class").extendClass(d,{fxOpacity:function(a,b,d,e,f){return this.animate(new c(a),b,d,e,f)},fadeTo:function(){return this.fxOpacity.apply(this,arguments)},fadeIn:function(){return this.fxOpacity.apply(this,[1].concat([].slice.call(arguments)))},fadeOut:function(){return this.fxOpacity.apply(this,[0].concat([].slice.call(arguments)))}}),c}),define("animate/pathanimator",["animate/animator","animate/timeline","animate/easing","core/class","graphic/shape","graphic/geometry","core/utils","graphic/point","graphic/vector","graphic/matrix","graphic/path","graphic/svg"],function(a){var b=a("animate/animator"),c=a("graphic/geometry"),d=a("core/class").createClass("OpacityAnimator",{base:b,constructor:function(a){this.callBase({beginValue:function(a){return this.beginPath=a.getPathData(),0},finishValue:1,setter:function(b,d){b.setPathData(c.pathTween(this.beginPath,a,d))}})}}),e=a("graphic/path");return a("core/class").extendClass(e,{fxPath:function(a,b,c,e,f){return this.animate(new d(a),b,c,e,f)}}),d}),define("animate/rotateanimator",["animate/animator","animate/timeline","animate/easing","core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){var b=a("animate/animator"),c=a("core/class").createClass("RotateAnimator",{base:b,constructor:function(a,b,c){this.callBase({beginValue:0,finishValue:a,setter:function(a,d,e){var f=e.getDelta();a.rotate(f,b,c)}})}}),d=a("graphic/shape");return a("core/class").extendClass(d,{fxRotate:function(a,b,d,e,f){return this.animate(new c(a),b,d,e,f)},fxRotateAnchor:function(a,b,d,e,f,g,h){return this.animate(new c(a,b,d),e,f,g,h)}}),c}),define("animate/scaleanimator",["animate/animator","animate/timeline","animate/easing","core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){var b=a("animate/animator"),c=a("core/class").createClass("ScaleAnimator",{base:b,constructor:function(a,b){this.callBase({beginValue:0,finishValue:1,setter:function(c,d,e){var f=e.getDelta(),g=Math.pow(a,f),h=Math.pow(b,f);c.scale(h,g)}})}}),d=a("graphic/shape");return a("core/class").extendClass(d,{fxScale:function(a,b,d,e,f,g){return this.animate(new c(a,b),d,e,f,g)}}),c}),define("animate/timeline",["graphic/eventhandler","core/utils","graphic/shapeevent","core/class","animate/frame"],function(a){function b(a,b,c){return g.paralle(a,b,function(a,b){return a+(b-a)*c})}function c(a,b){return g.paralle(a,b,function(a,b){return b-a})}function d(a,b,c){this.timeline=a,this.target=a.target,this.type=b;for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d])}var e=a("graphic/eventhandler"),f=a("animate/frame"),g=a("core/utils"),h=a("core/class").createClass("Timeline",{mixins:[e],constructor:function(a,b,c,d){this.callMixin(),this.target=b,this.time=0,this.duration=c,this.easing=d,this.animator=a,this.beginValue=a.beginValue,this.finishValue=a.finishValue,this.setter=a.setter,this.status="ready"},nextFrame:function(a){"playing"==this.status&&(this.time+=a.dur,this.setValue(this.getValue()),this.time>=this.duration&&this.timeUp(),a.next())},getPlayTime:function(){return this.rollbacking?this.duration-this.time:this.time},getTimeProportion:function(){return this.getPlayTime()/this.duration},getValueProportion:function(){return this.easing(this.getPlayTime(),0,1,this.duration)},getValue:function(){var a=this.beginValue,c=this.finishValue,d=this.getValueProportion();return b(a,c,d)},setValue:function(a){this.lastValue=this.currentValue,this.currentValue=a,this.setter.call(this.target,this.target,a,this)},getDelta:function(){return this.lastValue=void 0===this.lastValue?this.beginValue:this.lastValue,c(this.lastValue,this.currentValue)},play:function(){var a=this.status;switch(this.status="playing",a){case"ready":g.isFunction(this.beginValue)&&(this.beginValue=this.beginValue.call(this.target,this.target)),g.isFunction(this.finishValue)&&(this.finishValue=this.finishValue.call(this.target,this.target)),this.time=0,this.frame=f.requestFrame(this.nextFrame.bind(this));break;case"finished":case"stoped":this.time=0,this.frame=f.requestFrame(this.nextFrame.bind(this));break;case"paused":this.frame.next()}return this.fire("play",new d(this,"play",{lastStatus:a})),this},pause:function(){return this.status="paused",this.fire("pause",new d(this,"pause")),f.releaseFrame(this.frame),this},stop:function(){return this.status="stoped",this.setValue(this.finishValue),this.rollbacking=!1,this.fire("stop",new d(this,"stop")),f.releaseFrame(this.frame),this},timeUp:function(){this.repeatOption?(this.time=0,this.rollback?this.rollbacking?(this.decreaseRepeat(),this.rollbacking=!1):(this.rollbacking=!0,this.fire("rollback",new d(this,"rollback"))):this.decreaseRepeat(),this.repeatOption?this.fire("repeat",new d(this,"repeat")):this.finish()):this.finish()},finish:function(){this.setValue(this.finishValue),this.status="finished",this.fire("finish",new d(this,"finish")),f.releaseFrame(this.frame)},decreaseRepeat:function(){this.repeatOption!==!0&&this.repeatOption--},repeat:function(a,b){return this.repeatOption=a,this.rollback=b,this}});return h.requestFrame=f.requestFrame,h.releaseFrame=f.releaseFrame,h}),define("animate/translateanimator",["animate/animator","animate/timeline","animate/easing","core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){var b=a("animate/animator"),c=a("core/class").createClass("TranslateAnimator",{base:b,constructor:function(a,b){this.callBase({x:0,y:0},{x:a,y:b},function(a,b,c){var d=c.getDelta();a.translate(d.x,d.y)})}}),d=a("graphic/shape");return a("core/class").extendClass(d,{fxTranslate:function(a,b,d,e,f,g){return this.animate(new c(a,b),d,e,f,g)}}),c}),define("core/browser",[],function(){var a=function(){var a,b=navigator.userAgent.toLowerCase(),c=window.opera;a={ie:/(msie\s|trident.*rv:)([\w.]+)/.test(b),opera:!!c&&c.version,webkit:b.indexOf(" applewebkit/")>-1,mac:b.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode},a.gecko="Gecko"==navigator.product&&!a.webkit&&!a.opera&&!a.ie;var d=0;if(a.ie&&(d=1*(b.match(/(msie\s|trident.*rv:)([\w.]+)/)[2]||0),a.ie11Compat=11==document.documentMode,a.ie9Compat=9==document.documentMode),a.gecko){var e=b.match(/rv:([\d\.]+)/);e&&(e=e[1].split("."),d=1e4*e[0]+100*(e[1]||0)+1*(e[2]||0))}return/chrome\/(\d+\.\d)/i.test(b)&&(a.chrome=+RegExp.$1),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(b)&&!/chrome/i.test(b)&&(a.safari=+(RegExp.$1||RegExp.$2)),a.opera&&(d=parseFloat(c.version())),a.webkit&&(d=parseFloat(b.match(/ applewebkit\/(\d+)/)[1])),a.version=d,a.isCompatible=!a.mobile&&(a.ie&&d>=6||a.gecko&&d>=10801||a.opera&&d>=9.5||a.air&&d>=1||a.webkit&&d>=522||!1),a}();return a}),define("core/class",[],function(require,exports){function Class(){}function checkBaseConstructorCall(a,b){var c=a.toString();if(!/this\.callBase/.test(c))throw new Error(b+" : 类构造函数没有调用父类的构造函数!为了安全,请调用父类的构造函数")}function inherit(constructor,BaseClass,classname){var KityClass=eval("(function "+classname+"( __inherit__flag ) {if( __inherit__flag != KITY_INHERIT_FLAG ) {KityClass.__KityConstructor.apply(this, arguments);}this.__KityClassName = KityClass.__KityClassName;})");KityClass.__KityConstructor=constructor,KityClass.prototype=new BaseClass(KITY_INHERIT_FLAG);for(var methodName in BaseClass.prototype)BaseClass.prototype.hasOwnProperty(methodName)&&0!==methodName.indexOf("__Kity")&&(KityClass.prototype[methodName]=BaseClass.prototype[methodName]);return KityClass.prototype.constructor=KityClass,KityClass}function mixin(a,b){if(!1==b instanceof Array)return a;var c,d,e,f=b.length;for(a.__KityMixins={constructor:[]},c=0;f>c;c++){d=b[c].prototype;for(e in d)!1!==d.hasOwnProperty(e)&&0!==e.indexOf("__Kity")&&("constructor"===e?a.__KityMixins.constructor.push(d[e]):a.prototype[e]=a.__KityMixins[e]=d[e])}return a}function extend(a,b){b.__KityClassName&&(b=b.prototype);for(var c in b)if(b.hasOwnProperty(c)&&c.indexOf("__Kity")&&"constructor"!=c){var d=a.prototype[c]=b[c];d.__KityMethodClass=a,d.__KityMethodName=c}return a}Function.prototype.bind=Function.prototype.bind||function(a){var b=Array.prototype.slice.call(arguments,1);return this.apply(a,b)},Class.__KityClassName="Class",Class.prototype.base=function(a){var b=arguments.callee.caller,c=b.__KityMethodClass.__KityBaseClass.prototype[a];return c.apply(this,Array.prototype.slice.call(arguments,1))},Class.prototype.callBase=function(){var a=arguments.callee.caller,b=a.__KityMethodClass.__KityBaseClass.prototype[a.__KityMethodName];return b.apply(this,arguments)},Class.prototype.mixin=function(a){var b=arguments.callee.caller,c=b.__KityMethodClass.__KityMixins;if(!c)return this;var d=c[a];return d.apply(this,Array.prototype.slice.call(arguments,1))},Class.prototype.callMixin=function(){var a=arguments.callee.caller,b=a.__KityMethodName,c=a.__KityMethodClass.__KityMixins;if(!c)return this;var d=c[b];if("constructor"==b){for(var e=0,f=d.length;f>e;e++)d[e].call(this);return this}return d.apply(this,arguments)},Class.prototype.pipe=function(a){return"function"==typeof a&&a.call(this,this),this},Class.prototype.getType=function(){return this.__KityClassName},Class.prototype.getClass=function(){return this.constructor};var KITY_INHERIT_FLAG="__KITY_INHERIT_FLAG_"+ +new Date;Class.prototype._accessProperty=function(){return this._propertyRawData||(this._propertyRawData={})},exports.createClass=function(a,b){var c,d,e;return 1===arguments.length&&(b=arguments[0],a="AnonymousClass"),e=b.base||Class,b.hasOwnProperty("constructor")?(c=b.constructor,e!=Class&&checkBaseConstructorCall(c,a)):c=function(){this.callBase.apply(this,arguments),this.callMixin.apply(this,arguments)},d=inherit(c,e,a),d=mixin(d,b.mixins),d.__KityClassName=c.__KityClassName=a,d.__KityBaseClass=c.__KityBaseClass=e,d.__KityMethodName=c.__KityMethodName="constructor",d.__KityMethodClass=c.__KityMethodClass=d,delete b.mixins,delete b.constructor,delete b.base,d=extend(d,b)},exports.extendClass=extend}),define("core/utils",[],function(){var a={each:function(a,b,c){if(null!==a)if(a.length===+a.length){for(var d=0,e=a.length;e>d;d++)if(b.call(c,a[d],d,a)===!1)return!1}else for(var f in a)if(a.hasOwnProperty(f)&&b.call(c,a[f],f,a)===!1)return!1},extend:function(a){for(var b=arguments,c=this.isBoolean(b[b.length-1])?b[b.length-1]:!1,d=this.isBoolean(b[b.length-1])?b.length-1:b.length,e=1;d>e;e++){var f=b[e];for(var g in f)c&&a.hasOwnProperty(g)||(a[g]=f[g])}return a},deepExtend:function(a){for(var b=arguments,c=this.isBoolean(b[b.length-1])?b[b.length-1]:!1,d=this.isBoolean(b[b.length-1])?b.length-1:b.length,e=1;d>e;e++){var f=b[e];for(var g in f)c&&a.hasOwnProperty(g)||(this.isObject(a[g])&&this.isObject(f[g])?this.deepExtend(a[g],f[g],c):a[g]=f[g])}return a},clone:function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},copy:function(a){return"object"!=typeof a?a:"function"==typeof a?null:JSON.parse(JSON.stringify(a))},queryPath:function(a,b){for(var c=a.split("."),d=0,e=b,f=c.length;f>d;){if(!(c[d]in e))return void 0;if(e=e[c[d]],d++,d>=f||void 0===e)return e}},getValue:function(a,b){return void 0!==a?a:b},flatten:function(b){var c,d=[],e=b.length;for(c=0;e>c;c++)b[c]instanceof Array?d=d.concat(a.flatten(b[c])):d.push(b[c]);return d},paralle:function(b,c,d){var e,f,g,h;if(b instanceof Array){for(h=[],f=0;fg;g++)b[5*g+3]=c[g]/255;return b[18]=a.get("a"),this.colorMatrixEffect.set("values",b.join(" ")),this},setOpacity:function(a){var b=this.colorMatrixEffect.get("values").split(" ");return b[18]=a,this.colorMatrixEffect.set("values",b.join(" ")),this},setOffset:function(a,b){this.setOffsetX(a),this.setOffsetY(b)},setOffsetX:function(a){this.offsetEffect.set("dx",a)},setOffsetY:function(a){this.offsetEffect.set("dy",a)},setDeviation:function(a){this.gaussianblurEffect.set("stdDeviation",a)}})}),define("graphic/bezier",["core/class","graphic/pointcontainer","graphic/container","graphic/path","core/utils","graphic/shape","graphic/svg","graphic/geometry"],function(a){return a("core/class").createClass("Bezier",{mixins:[a("graphic/pointcontainer")],base:a("graphic/path"),constructor:function(a){this.callBase(),a=a||[],this.changeable=!0,this.setBezierPoints(a)},getBezierPoints:function(){return this.getPoints()},setBezierPoints:function(a){return this.setPoints(a)},onContainerChanged:function(){this.changeable&&this.update()},update:function(){var a=null,b=this.getBezierPoints();if(!(b.length<2)){a=this.getDrawer(),a.clear();var c=b[0].getVertex(),d=null,e=null;a.moveTo(c.x,c.y);for(var f=1,g=b.length;g>f;f++)c=b[f].getVertex(),e=b[f].getBackward(),d=b[f-1].getForward(),a.bezierTo(d.x,d.y,e.x,e.y,c.x,c.y);return this}}})}),define("graphic/bezierpoint",["graphic/shapepoint","core/class","graphic/point","graphic/vector","graphic/matrix"],function(a){var b=a("graphic/shapepoint"),c=a("graphic/vector"),d=a("core/class").createClass("BezierPoint",{constructor:function(a,c,d){this.vertex=new b(a,c),this.forward=new b(a,c),this.backward=new b(a,c),this.setSmooth(void 0===d||d),this.setSymReflaction(!0)},clone:function(){var a=new d,b=null;return b=this.getVertex(),a.setVertex(b.x,b.y),b=this.getForward(),a.setForward(b.x,b.y),b=this.getBackward(),a.setBackward(b.x,b.y),a.setSmooth(a.isSmooth()),a},setVertex:function(a,b){return this.vertex.setPoint(a,b),this.update(),this},moveTo:function(a,b){var c=this.forward.getPoint(),d=this.backward.getPoint(),e=this.vertex.getPoint(),f={left:a-e.x,top:b-e.y};this.forward.setPoint(c.x+f.left,c.y+f.top),this.backward.setPoint(d.x+f.left,d.y+f.top),this.vertex.setPoint(a,b),this.update()},setForward:function(a,b){return this.forward.setPoint(a,b),this.smooth&&this.updateAnother(this.forward,this.backward),this.update(),this},setBackward:function(a,b){return this.backward.setPoint(a,b),this.smooth&&this.updateAnother(this.backward,this.forward),this.update(),this},setSymReflaction:function(a){this.symReflaction=a},isSymReflaction:function(){return this.symReflaction},updateAnother:function(a,b){var d=this.getVertex(),e=c.fromPoints(a.getPoint(),d),f=c.fromPoints(d,b.getPoint());f=c.normalize(e,this.isSymReflaction()?e.length():f.length()),b.setPoint(d.x+f.x,d.y+f.y)},setSmooth:function(a){return this.smooth=!!a,this},getVertex:function(){return this.vertex.getPoint()},getForward:function(){return this.forward.getPoint()},getBackward:function(){return this.backward.getPoint()},isSmooth:function(){return this.smooth},update:function(){return this.container?void(this.container.update&&this.container.update(this)):this}});return d}),define("graphic/box",["core/class"],function(a){var b=a("core/class").createClass("Box",{constructor:function(a,b,c,d){var e=arguments[0];e&&"object"==typeof e&&(a=e.x,b=e.y,c=e.width,d=e.height),0>c&&(a-=c=-c),0>d&&(b-=d=-d),this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this.left=a,this.right=this.x+this.width,this.top=this.y,this.bottom=this.y+this.height,this.cx=a+this.width/2,this.cy=b+this.height/2},getRangeX:function(){return[this.left,this.right]},getRangeY:function(){return[this.left,this.right]},merge:function(a){var c=Math.min(this.x,a.x),d=Math.max(this.right,a.right),e=Math.min(this.y,a.y),f=Math.max(this.bottom,a.bottom);return new b(c,e,d-c,f-e)},expand:function(a,c,d,e){return new b(this.x+a,this.y+c,this.width-a+d,this.height-c+e)},valueOf:function(){return[this.x,this.y,this.width,this.height]},toString:function(){return this.valueOf().join(" ")}});return b}),define("graphic/circle",["core/class","graphic/ellipse","core/utils","graphic/point","graphic/path"],function(a){return a("core/class").createClass("Circle",{base:a("graphic/ellipse"),constructor:function(a,b,c){this.callBase(a,a,b,c)},getRadius:function(){return this.getRadiusX()},setRadius:function(a){return this.callBase(a,a)}})}),define("graphic/clip",["core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box","graphic/shapecontainer","graphic/container"],function(a){var b=a("core/class"),c=a("graphic/shape"),d=b.createClass("Clip",{base:c,mixins:[a("graphic/shapecontainer")],constructor:function(){this.callBase("clipPath")},clip:function(a){return a.getNode().setAttribute("clip-path","url(#"+this.getId()+")"),this}});return b.extendClass(c,{clipWith:function(a){return a.clip(this),this}}),d}),define("graphic/color",["core/utils","graphic/standardcolor","core/class"],function(a){var b=a("core/utils"),c=a("graphic/standardcolor"),d={},e=a("core/class").createClass("Color",{constructor:function(){var a=null;"string"==typeof arguments[0]?(a=d.parseToValue(arguments[0]),null===a&&(a={r:0,g:0,b:0,h:0,s:0,l:0,a:1})):(a={r:0|arguments[0],g:0|arguments[1],b:0|arguments[2],a:parseFloat(arguments[3])||1},a=d.overflowFormat(a),a=b.extend(a,d.rgbValueToHslValue(a))),this._color=a +},set:function(a,c){if(!e._MAX_VALUE[a])throw new Error("Color set(): Illegal parameter");return"a"!==a&&(c=Math.floor(c)),"h"==a&&(c=(c+360)%360),this._color[a]=Math.max(e._MIN_VALUE[a],Math.min(e._MAX_VALUE[a],c)),-1!=="rgb".indexOf(a)?this._color=b.extend(this._color,d.rgbValueToHslValue(this._color)):-1!=="hsl".indexOf(a)&&(this._color=b.extend(this._color,d.hslValueToRGBValue(this._color))),this},inc:function(a,b){return b=this.get(a)+b,"h"==a?b=(b+360)%360:(b=Math.min(e._MAX_VALUE[a],b),b=Math.max(e._MIN_VALUE[a],b)),this.clone().set(a,b)},dec:function(a,b){return this.inc(a,-b)},clone:function(){return new e(this.toRGBA())},get:function(a){return e._MAX_VALUE[a]?this._color[a]:null},getValues:function(){return b.clone(this._color)},valueOf:function(){return this.getValues()},toRGB:function(){return d.toString(this._color,"rgb")},toRGBA:function(){return d.toString(this._color,"rgba")},toHEX:function(){return d.toString(this._color,"hex")},toHSL:function(){return d.toString(this._color,"hsl")},toHSLA:function(){return d.toString(this._color,"hsla")},toString:function(){return 1===this._color.a?this.toRGB():this.toRGBA()}});return b.extend(e,{_MAX_VALUE:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},_MIN_VALUE:{r:0,g:0,b:0,h:0,s:0,l:0,a:0},R:"r",G:"g",B:"b",H:"h",S:"s",L:"l",A:"a",parse:function(a){var c;return b.isString(a)&&(c=d.parseToValue(a)),b.isObject(a)&&"r"in a&&(c=a),null===c?new e:new e(c.r,c.g,c.b,c.a)},createHSL:function(a,b,c){return e.createHSLA(a,b,c,1)},createHSLA:function(a,b,c,d){var f=null;return b+="%",c+="%",f=["hsla("+a,b,c,d+")"],e.parse(f.join(", "))},createRGB:function(a,b,c){return e.createRGBA(a,b,c,1)},createRGBA:function(a,b,c,d){return new e(a,b,c,d)}}),b.extend(d,{parseToValue:function(a){var b={};if(a=c.EXTEND_STANDARD[a]||c.COLOR_STANDARD[a]||a,/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(a))b=d.hexToValue(a);else if(/^(rgba?)/i.test(a))b=d.rgbaToValue(a);else{if(!/^(hsla?)/i.test(a))return null;b=d.hslaToValue(a)}return d.overflowFormat(b)},hexToValue:function(a){var c={},e=["r","g","b"];return/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(a)?(a=RegExp.$1.split(""),b.each(e,function(b,e){c[b]=d.toNumber(3===a.length?a[e]+a[e]:a[2*e]+a[2*e+1])}),c=b.extend(c,d.rgbValueToHslValue(c)),c.a=1,c):null},rgbaToValue:function(a){var c={},e=!1,f=["r","g","b"];return/^(rgba?)/i.test(a)?(e=4===RegExp.$1.length,a=a.replace(/^rgba?/i,"").replace(/\s+/g,"").replace(/[^0-9,.]/g,"").split(","),b.each(f,function(b,d){c[b]=0|a[d]}),c=b.extend(c,d.rgbValueToHslValue(c)),c.a=e?parseFloat(a[3]):1,c):null},hslaToValue:function(a){var c={},e=!1;return/^(hsla?)/i.test(a)?(e=4===RegExp.$1.length,a=a.replace(/^hsla?/i,"").replace(/\s+/g,"").replace(/[^0-9,.]/g,"").split(","),c.h=0|a[0],c.s=0|a[1],c.l=0|a[2],c=b.extend(c,d.hslValueToRGBValue(c)),c=d.hslValueToRGBValue(c),c.a=e?parseFloat(a[3]):1,c):null},hslValueToRGBValue:function(a){function c(a,b,c){return 0>c?c+=1:c>1&&(c-=1),1>6*c?a+6*(b-a)*c:1>2*c?b:2>3*c?a+(b-a)*(2/3-c)*6:a}var d=null,e=null,f={};return a=b.extend({},a),a.h=a.h/360,a.s=a.s/100,a.l=a.l/100,0===a.s?f.r=f.g=f.b=a.l:(d=a.l<.5?a.l*(1+a.s):a.l+a.s-a.l*a.s,e=2*a.l-d,f.r=c(e,d,a.h+1/3),f.g=c(e,d,a.h),f.b=c(e,d,a.h-1/3)),f.r=Math.min(Math.round(255*f.r),255),f.g=Math.min(Math.round(255*f.g),255),f.b=Math.min(Math.round(255*f.b),255),f},rgbValueToHslValue:function(a){var c=null,d=null,e={};return a=b.extend({},a),a.r=a.r/255,a.g=a.g/255,a.b=a.b/255,c=Math.max(a.r,a.g,a.b),d=Math.min(a.r,a.g,a.b),c===d?e.h=0:c===a.r?e.h=a.g>=a.b?60*(a.g-a.b)/(c-d):60*(a.g-a.b)/(c-d)+360:c===a.g?e.h=60*(a.b-a.r)/(c-d)+120:c===a.b&&(e.h=60*(a.r-a.g)/(c-d)+240),e.l=(c+d)/2,e.s=0===e.l||c===d?0:e.l>0&&e.l<=.5?(c-d)/(c+d):(c-d)/(2-c-d),e.h=Math.round(e.h),e.s=Math.round(100*e.s),e.l=Math.round(100*e.l),e},toString:function(a,c){var e=[];return a=b.extend({},a),-1!==c.indexOf("hsl")&&(a.s+="%",a.l+="%"),"hex"!==c?(b.each(c.split(""),function(b){e.push(a[b])}),(c+"("+e.join(", ")+")").toLowerCase()):(e.push(d.toHexValue(+a.r)),e.push(d.toHexValue(+a.g)),e.push(d.toHexValue(+a.b)),("#"+e.join("")).toLowerCase())},toNumber:function(a){return 0|Number("0x"+a)},toHexValue:function(a){var b=a.toString(16);return 1===b.length?"0"+b:b},overflowFormat:function(a){var c=b.extend({},a),d="rgba";return b.each(d.split(""),function(a){c.hasOwnProperty(a)&&(c[a]=Math.min(e._MAX_VALUE[a],c[a]),c[a]=Math.max(e._MIN_VALUE[a],c[a]))}),c}}),e}),define("graphic/container",["core/class"],function(a){function b(){return this.container.removeItem(this),this}return a("core/class").createClass("Container",{getItems:function(){return this.items||(this.items=[])},getItem:function(a){return this.getItems()[a]},getFirstItem:function(){return this.getItem(0)},getLastItem:function(){return this.getItem(this.getItems().length-1)},indexOf:function(a){return this.getItems().indexOf(a)},eachItem:function(a){var b,c=this.getItems(),d=c.length;for(b=0;d>b;b++)a.call(this,b,c[b]);return this},addItem:function(a,c,d){var e=this.getItems(),f=e.length;return~e.indexOf(a)?this:(c>=0&&f>c||(c=f),e.splice(c,0,a),"object"==typeof a&&(a.container=this,a.remove=b),this.handleAdd(a,c),d||this.onContainerChanged("add",[a]),this)},addItems:function(a){for(var b=0,c=a.length;c>b;b++)this.addItem(a[b],-1,!0);return this.onContainerChanged("add",a),this},setItems:function(a){return this.clear().addItems(a)},appendItem:function(a){return this.addItem(a)},prependItem:function(a){return this.addItem(a,0)},removeItem:function(a,b){if("number"!=typeof a)return this.removeItem(this.indexOf(a));var c=this.getItems(),d=(c.length,c[a]);return void 0===d?this:(c.splice(a,1),d.container&&delete d.container,d.remove&&delete d.remove,this.handleRemove(d,a),b||this.onContainerChanged("remove",[d]),this)},clear:function(){for(var a,b=[];a=this.getFirstItem();)b.push(a),this.removeItem(0,!0);return this.onContainerChanged("remove",b),this},onContainerChanged:function(){},handleAdd:function(){},handleRemove:function(){}})}),define("graphic/curve",["core/utils","core/class","graphic/path","graphic/shape","graphic/svg","graphic/geometry","graphic/pointcontainer","graphic/container"],function(a){var b=a("core/utils"),c={getCurvePanLines:function(a,b){var d=c.getCenterPoints(a),e=c.getPanLine(a.length,d);return c.getMovedPanLines(a,e,b)},getCenterPoints:function(a){for(var b={},c=null,d=0,e=0,f=a.length;f>d;d++)e=d===f-1?0:d+1,c=d+","+e,b[c]={x:(a[d].x+a[e].y)/2,y:(a[d].x+a[e].y)/2};return b},getPanLine:function(a,b){for(var c,d={},e=null,f=0;a>f;f++){var g=null,h=null;c=(f+1)%a,e=c,g=b[f+","+c],f=c,c=(f+1)%a,h=b[f+","+c],d[e]={points:[{x:g.x,y:g.y},{x:h.x,y:h.y}],center:{x:(g.x+h.x)/2,y:(g.y+h.y)/2}},f=(e+a-1)%a}return d},getMovedPanLines:function(a,c,d){var e={};return b.each(a,function(a,f){var g=c[f],h=g.center,i={x:h.x-a.x,y:h.y-a.y},j=e[f]={points:[],center:{x:a.x,y:a.y}};b.each(g.points,function(a){var b={x:a.x-i.x,y:a.y-i.y},c=j.center,e=b.x-c.x,f=b.y-c.y;b.x=c.x+d*e,b.y=c.y+d*f,j.points.push(b)})}),e}};return a("core/class").createClass("Curve",{base:a("graphic/path"),mixins:[a("graphic/pointcontainer")],constructor:function(a,b){this.callBase(),this.setPoints(a||[]),this.closeState=!!b,this.changeable=!0,this.smoothFactor=1,this.update()},onContainerChanged:function(){this.changeable&&this.update()},setSmoothFactor:function(a){return this.smoothFactor=0>a?0:a,this.update(),this},getSmoothFactor:function(){return this.smoothFactor},update:function(){var a=this.getPoints(),b=null,d=this.getDrawer(),e=null,f=null,g=null;if(d.clear(),0===a.length)return this;if(d.moveTo(a[0]),1===a.length)return this;if(2===a.length)return d.lineTo(a[1]),this;b=c.getCurvePanLines(a,this.getSmoothFactor());for(var h=1,i=a.length;i>h;h++)e=b[h].center,f=this.closeState||h!=i-1?b[h].points[0]:b[h].center,g=this.closeState||1!=h?b[h-1].points[1]:b[h-1].center,d.bezierTo(g.x,g.y,f.x,f.y,e.x,e.y);return this.closeState&&(e=b[0].center,f=b[0].points[0],g=b[a.length-1].points[1],d.bezierTo(g.x,g.y,f.x,f.y,e.x,e.y)),this},close:function(){return this.closeState=!0,this.update()},open:function(){return this.closeState=!1,this.update()},isClose:function(){return!!this.closeState}})}),define("graphic/data",["core/class"],function(a){return a("core/class").createClass("Data",{constructor:function(){this._data={}},setData:function(a,b){return this._data[a]=b,this},getData:function(a){return this._data[a]},removeData:function(a){return delete this._data[a],this}})}),define("graphic/defbrush",["core/class","graphic/resource","graphic/svg"],function(a){return a("core/class").createClass("GradientBrush",{base:a("graphic/resource"),constructor:function(a){this.callBase(a)}})}),define("graphic/ellipse",["core/utils","graphic/point","core/class","graphic/path","graphic/shape","graphic/svg","graphic/geometry"],function(a){var b=(a("core/utils"),a("graphic/point"));return a("core/class").createClass("Ellipse",{base:a("graphic/path"),constructor:function(a,b,c,d){this.callBase(),this.rx=a||0,this.ry=b||0,this.cx=c||0,this.cy=d||0,this.update()},update:function(){var a=this.rx,b=this.ry,c=this.cx+a,d=this.cx-a,e=this.cy,f=this.getDrawer();return f.clear(),f.moveTo(c,e),f.arcTo(a,b,0,1,1,d,e),f.arcTo(a,b,0,1,1,c,e),this},getRadius:function(){return{x:this.rx,y:this.ry}},getRadiusX:function(){return this.rx},getRadiusY:function(){return this.ry},getCenter:function(){return new b(this.cx,this.cy)},getCenterX:function(){return this.cx},getCenterY:function(){return this.cy},setRadius:function(a,b){return this.rx=a,this.ry=b,this.update()},setRadiusX:function(a){return this.rx=a,this.update()},setRadiusY:function(a){return this.ry=a,this.update()},setCenter:function(a,c){if(1==arguments.length){var d=b.parse(arguments[0]);a=d.x,c=d.y}return this.cx=a,this.cy=c,this.update()},setCenterX:function(a){return this.cx=a,this.update()},setCenterY:function(a){return this.cy=a,this.update()}})}),define("graphic/eventhandler",["core/utils","graphic/shapeevent","graphic/matrix","graphic/point","core/class"],function(a){function b(a,b,c){return c=!!c,i.isString(a)&&(a=a.match(/\S+/g)),i.each(a,function(a){d.call(this,this.node,a,b,c)},this),this}function c(a,b){var c=null,d=this._EVNET_UID,e=void 0===b;try{c=l[d][a]}catch(g){return}return e||(e=!0,i.each(c,function(a,d){a===b?delete c[d]:e=!1})),e&&(f(this.node,a,k[d][a]),delete l[d][a],delete k[d][a]),this}function d(a,b,c,d){var f=this._EVNET_UID,g=this;k[f]||(k[f]={}),k[f][b]||(k[f][b]=function(a){a=new j(a||window.event),i.each(l[f][b],function(c){var e;return c&&(e=c.call(g,a),d&&g.off(b,c)),e},g)}),l[f]||(l[f]={}),l[f][b]?l[f][b].push(c):(l[f][b]=[c],a&&e(a,b,k[f][b]))}function e(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent("on"+b,c)}function f(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent(b,c)}function g(a,b,c){var d=new CustomEvent(b,{bubbles:!0,cancelable:!0});d._kityParam=c,a.dispatchEvent(d)}function h(a,b,c){var d=null,e=null;try{if(e=k[a._EVNET_UID][b],!e)return}catch(f){return}d=i.extend({type:b,target:a},c||{}),e.call(a,d)}!function(){function a(a,b){b=b||{bubbles:!1,cancelable:!1,detail:void 0};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail),c}a.prototype=window.Event.prototype,window.CustomEvent=a}();var i=a("core/utils"),j=a("graphic/shapeevent"),k={},l={},m=0;return a("core/class").createClass("EventHandler",{constructor:function(){this._EVNET_UID=++m},addEventListener:function(a,c){return b.call(this,a,c,!1)},addOnceEventListener:function(a,c){return b.call(this,a,c,!0)},removeEventListener:function(a,b){return c.call(this,a,b)},on:function(){return this.addEventListener.apply(this,arguments)},once:function(){return this.addOnceEventListener.apply(this,arguments)},off:function(){return this.removeEventListener.apply(this,arguments)},fire:function(){return this.trigger.apply(this,arguments)},trigger:function(a,b){return this.node?g(this.node,a,b):h(this,a,b),this}})}),define("graphic/geometry",["core/utils","graphic/point","core/class","graphic/vector","graphic/matrix","graphic/box"],function(a){function b(a){var b,c,d,e,f;for(b=[],c=0;cc;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function e(){var f=Array.prototype.slice.call(arguments,0),g=f.join("␀"),h=e.cache=e.cache||{},i=e.count=e.count||[];return h.hasOwnProperty(g)?(d(i,g),c?c(h[g]):h[g]):(i.length>=1e3&&delete h[i.shift()],i.push(g),h[g]=a.apply(b,f),c?c(h[g]):h[g])}return e}function d(a,b,c,e,f,g,h,i,j,k){var l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q=Math,R=Q.PI,S=Math.abs,T=120*R/180,U=R/180*(+f||0),V=[],W=function(a,b,c){var d=a*Q.cos(c)-b*Q.sin(c),e=a*Q.sin(c)+b*Q.cos(c);return{x:d,y:e}};if(k?(w=k[0],x=k[1],u=k[2],v=k[3]):(l=W(a,b,-U),a=l.x,b=l.y,l=W(i,j,-U),i=l.x,j=l.y,m=Q.cos(R/180*f),n=Q.sin(R/180*f),p=(a-i)/2,q=(b-j)/2,o=p*p/(c*c)+q*q/(e*e),o>1&&(o=Q.sqrt(o),c=o*c,e=o*e),r=c*c,s=e*e,t=(g==h?-1:1)*Q.sqrt(S((r*s-r*q*q-s*p*p)/(r*q*q+s*p*p))),u=t*c*q/e+(a+i)/2,v=t*-e*p/c+(b+j)/2,w=Q.asin(((b-v)/e).toFixed(9)),x=Q.asin(((j-v)/e).toFixed(9)),w=u>a?R-w:w,x=u>i?R-x:x,0>w&&(w=2*R+w),0>x&&(x=2*R+x),h&&w>x&&(w-=2*R),!h&&x>w&&(x-=2*R)),y=x-w,S(y)>T&&(z=x,A=i,B=j,x=w+T*(h&&x>w?1:-1),i=u+c*Q.cos(x),j=v+e*Q.sin(x),V=d(i,j,c,e,f,0,h,A,B,[x,z,u,v])),y=x-w,C=Q.cos(w),D=Q.sin(w),E=Q.cos(x),F=Q.sin(x),G=Q.tan(y/4),H=4/3*c*G,I=4/3*e*G,J=[a,b],K=[a+H*D,b-I*C],L=[i+H*F,j-I*E],M=[i,j],K[0]=2*J[0]-K[0],K[1]=2*J[1]-K[1],k)return[K,L,M].concat(V);for(V=[K,L,M].concat(V).join().split(","),N=[],O=0,P=V.length;P>O;O++)N[O]=O%2?W(V[O-1],V[O],U).y:W(V[O],V[O+1],U).x;return N}function e(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]}function f(a,b){function c(a){return function(b,c){return b+a*(c-b)}}var d=c(b||.5),e=a,f=e[0],g=e[1],h=e[2],i=e[3],j=e[4],k=e[5],l=e[6],m=e[7],n=d(f,h),o=d(g,i),p=d(h,j),q=d(i,k),r=d(j,l),s=d(k,m),t=d(n,p),u=d(o,q),v=d(p,r),w=d(q,s),x=d(t,v),y=d(u,w);return[[f,g,n,o,t,u,x,y],[x,y,v,w,r,s,l,m]]}var g=a("core/utils"),h=a("graphic/point"),i=a("graphic/vector"),j=a("graphic/matrix"),k={},l=/([achlmrqstvz])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?\s*)+)/gi,m=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)\s*,?\s*/gi,n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0};k.pathToString=function(a){return a=a||this,"string"==typeof a?a:a instanceof Array?(a=g.flatten(a),a.join(",").replace(/,?([achlmqrstvxz]),?/gi,"$1")):void 0},k.parsePathString=c(function(a){var b=[];return a.replace(l,function(a,c,d){var e=[],f=c.toLowerCase();if(d.replace(m,function(a,b){b&&e.push(+b)}),"m"==f&&e.length>2&&(b.push([c].concat(e.splice(0,2))),f="l",c="m"==c?"l":"L"),"r"==f)b.push([c].concat(e));else for(;e.length>=n[f]&&(b.push([c].concat(e.splice(0,n[f]))),n[f]););}),b.isUniform=!0,b.toString=k.pathToString,b}),k.pathToAbsolute=c(function(a){var b,c,d,e,f,g,h,i,j=a.isUniform?a:k.parsePathString(k.pathToString(a)),l=[],m=0,n=0,o=0,p=0,q=0;for("M"==j[0][0]&&(m=+j[0][1],n=+j[0][2],o=m,p=n,q++,l[0]=["M",m,n]),d=q,g=j.length;g>d;d++){if(l.push(b=[]),c=j[d],c[0]!=c[0].toUpperCase())switch(b[0]=c[0].toUpperCase(),b[0]){case"A":b[1]=c[1],b[2]=c[2],b[3]=c[3],b[4]=c[4],b[5]=c[5],b[6]=+(c[6]+m),b[7]=+(c[7]+n);break;case"V":b[1]=+c[1]+n;break;case"H":b[1]=+c[1]+m;break;case"M":o=+c[1]+m,p=+c[2]+n;break;default:for(e=1,h=c.length;h>e;e++)b[e]=+c[e]+(e%2?m:n)}else for(f=0,i=c.length;i>f;f++)b[f]=c[f];switch(b[0]){case"Z":m=o,n=p;break;case"H":m=b[1];break;case"V":n=b[1];break;case"M":o=b[b.length-2],p=b[b.length-1];break;default:m=b[b.length-2],n=b[b.length-1]}}return l.isUniform=!0,l.isAbsolute=!0,l.toString=k.pathToString,l}),k.pathToCurve=c(function(a){var b,c,f,g,h,i,j,l,m,n,o,p=[];for(a.isAbsolute||(a=k.pathToAbsolute(a)),b=0;bb;b++)d=a[b],"M"!=d[0]?"Z"!=d[0]?(f=k.bezierLength(e.concat(d.slice(1))),g.push([h,h+f]),h+=f,e=d.slice(4)):g.push(null):(e=d.slice(1),g.push(null));return g.totalLength=h,g});k.subPath=function(a,b,c){var d;if(c=c||0,d=b-c,d-=0|d,c-=0|c,b=c+d,b>1)return k.subPath(a,1,c).concat(k.subPath(a,b-1));a.isCurve||(a=k.pathToCurve(a));var e,f,g,h,i,j,l,m,n,p=o(a),q=p.totalLength,r=q*b,s=q*(c||0),t=[];for(e=0,f=a.length;f>e;e++)if("M"!=a[e][0]){if("Z"!=a[e][0])if(g=p[e][0],h=p[e][1],i=h-g,l=j.concat(a[e].slice(1)),s>h)j=l.slice(l.length-2);else{if(s>=g)m=k.subBezier(l,Math.min((r-g)/i,1),(s-g)/i),n=!0,j=m.slice(0,2),t.push(["M"].concat(m.slice(0,2))),t.push(["C"].concat(m.slice(2)));else if(r>=h)t.push(a[e].slice());else{if(!(r>=g))break;m=k.subBezier(l,(r-g)/i),t.push(["C"].concat(m.slice(2))),n=!1}j=l.slice(l.length-2)}}else j=a[e].slice(1),n&&t.push(a[e].slice());return t.isAbsolute=!0,t.isCurve=!0,t.isUniform=!0,t.toString=k.pathToString,t},k.pointAtPath=function(a,b){a.isCurve||(a=k.pathToCurve(a));var c=k.subPath(a,b),d="Z"==c[c.length-1][0]?c[c.length-2]:c[c.length-1];d=d.slice(1);var e=h.parse(d.slice(4)),f=h.parse(d.slice(2,4));return e.tan=i.fromPoints(f,e).normalize(),e},k.pathLength=c(function(a){a.isCurve||(a=k.pathToCurve(a));var b=o(a);return b.totalLength}),k.pathKeyPoints=c(function(a){var b,c,d;for(a.isCurve||(a=k.pathToCurve(a)),d=[],b=0,c=a.length;c>b;b++)"z"!=a[b][0]&&d.push(a[b].slice(a[b].length-2));return d});var p=c(function(a,c){function d(a,b){return a[b||a.i]&&a[b||a.i][0]}function e(a,b){return a[b||a.i]&&a[b||a.i].slice(1)}function f(a,b){var c=e(a,b);return c&&c.slice(-2)}function g(a){return"Z"==d(a)?(a.splice(a.i,1),!0):!1}function h(a){return"M"==d(a)?(a.o.splice(a.o.i,0,["M"].concat(f(a.o,a.o.i-1))),a.i++,a.o.i++,!0):!1}function i(a){for(var b,c=1;!b;)b=f(a,a.length-c++);for(a.o.i=a.i;a.lengthc;c++)for(f.push(g=[a[c][0]]),e=1;ee&&f.setAttribute("stop-opacity",e),this.node.appendChild(f),this}})}),define("graphic/group",["graphic/shapecontainer","graphic/container","core/utils","core/class","graphic/shape","graphic/svg","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){var b=a("graphic/shapecontainer");return a("core/class").createClass("Group",{mixins:[b],base:a("graphic/shape"),constructor:function(){this.callBase("g")}})}),define("graphic/hyperlink",["graphic/shapecontainer","graphic/container","core/utils","core/class","graphic/shape","graphic/svg","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){var b=a("graphic/shapecontainer");return a("core/class").createClass("HyperLink",{mixins:[b],base:a("graphic/shape"),constructor:function(a){this.callBase("a"),this.setHref(a)},setHref:function(a){return this.node.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),this},getHref:function(){return this.node.getAttributeNS("xlink:href")},setTarget:function(a){return this.node.setAttribute("target",a),this},getTarget:function(){return this.node.getAttribute("target")}})}),define("graphic/image",["core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){return a("core/class").createClass("Image",{base:a("graphic/shape"),constructor:function(a,b,c,d,e){this.callBase("image"),this.url=a,this.width=b||0,this.height=c||0,this.x=d||0,this.y=e||0,this.update()},update:function(){return this.node.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",this.url),this.node.setAttribute("x",this.x),this.node.setAttribute("y",this.y),this.node.setAttribute("width",this.width),this.node.setAttribute("height",this.height),this},setUrl:function(a){return this.url=""===a?null:a,this.update()},getUrl:function(){return this.url},setWidth:function(a){return this.width=a,this.update()},getWidth:function(){return this.width},setHeight:function(a){return this.height=a,this.update()},getHeight:function(){return this.height},setX:function(a){return this.x=a,this.update()},getX:function(){return this.x},setY:function(a){return this.y=a,this.update()},getY:function(){return this.y}})}),define("graphic/line",["core/class","graphic/path","core/utils","graphic/shape","graphic/svg","graphic/geometry"],function(a){return a("core/class").createClass("Line",{base:a("graphic/path"),constructor:function(a,b,c,d){this.callBase(),this.point1={x:a||0,y:b||0},this.point2={x:c||0,y:d||0},this.update()},setPoint1:function(a,b){return this.point1.x=a,this.point1.y=b,this.update()},setPoint2:function(a,b){return this.point2.x=a,this.point2.y=b,this.update()},getPoint1:function(){return{x:this.point1.x,y:this.point1.y}},getPoint2:function(){return{x:this.point2.x,y:this.point2.y}},update:function(){var a=this.getDrawer();return a.clear(),a.moveTo(this.point1.x,this.point1.y),a.lineTo(this.point2.x,this.point2.y),this}})}),define("graphic/lineargradientbrush",["graphic/svg","graphic/gradientbrush","graphic/defbrush","graphic/color","core/class"],function(a){var b="LinearGradientBrush",c=(a("graphic/svg"),a("graphic/gradientbrush"));return a("core/class").createClass(b,{base:c,constructor:function(a){this.callBase("linearGradient"),this.setStartPosition(0,0),this.setEndPosition(1,0),"function"==typeof a&&a.call(this,this)},setStartPosition:function(a,b){return this.node.setAttribute("x1",a),this.node.setAttribute("y1",b),this},setEndPosition:function(a,b){return this.node.setAttribute("x2",a),this.node.setAttribute("y2",b),this},getStartPosition:function(){return{x:+this.node.getAttribute("x1"),y:+this.node.getAttribute("y1")}},getEndPosition:function(){return{x:+this.node.getAttribute("x2"),y:+this.node.getAttribute("y2")}}})}),define("graphic/marker",["graphic/point","core/class","graphic/resource","graphic/svg","graphic/shapecontainer","graphic/container","core/utils","graphic/shape","graphic/viewbox","graphic/path","graphic/geometry"],function(a){var b=a("graphic/point"),c=a("core/class").createClass("Marker",{base:a("graphic/resource"),mixins:[a("graphic/shapecontainer"),a("graphic/viewbox")],constructor:function(){this.callBase("marker"),this.setOrient("auto")},setRef:function(a,b){return 1===arguments.length&&(b=a.y,a=a.x),this.node.setAttribute("refX",a),this.node.setAttribute("refY",b),this},getRef:function(){return new b(+this.node.getAttribute("refX"),+this.node.getAttribute("refY"))},setWidth:function(a){return this.node.setAttribute("markerWidth",this.width=a),this},setOrient:function(a){return this.node.setAttribute("orient",this.orient=a),this},getOrient:function(){return this.orient},getWidth:function(){return+this.width},setHeight:function(a){return this.node.setAttribute("markerHeight",this.height=a),this},getHeight:function(){return+this.height}}),d=a("graphic/path");return a("core/class").extendClass(d,{setMarker:function(a,b){return b=b||"end",a?this.node.setAttribute("marker-"+b,a.toString()):this.node.removeAttribute("marker-"+b),this}}),c}),define("graphic/mask",["core/class","graphic/shape","graphic/svg","core/utils","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box","graphic/shapecontainer","graphic/container"],function(a){var b=a("core/class"),c=a("graphic/shape"),d=b.createClass("Mask",{base:c,mixins:[a("graphic/shapecontainer")],constructor:function(){this.callBase("mask")},mask:function(a){return a.getNode().setAttribute("mask","url(#"+this.getId()+")"),this}});return b.extendClass(c,{maskWith:function(a){return a.mask(this),this}}),d}),define("graphic/matrix",["core/utils","graphic/box","core/class","graphic/point"],function(a){function b(a,b){return{a:b.a*a.a+b.c*a.b,b:b.b*a.a+b.d*a.b,c:b.a*a.c+b.c*a.d,d:b.b*a.c+b.d*a.d,e:b.a*a.e+b.c*a.f+b.e,f:b.b*a.e+b.d*a.f+b.f}}function c(a){return a*Math.PI/180}var d=a("core/utils"),e=a("graphic/box"),f=/matrix\((.+)\)/i,g=a("graphic/point"),h=a("core/class").createClass("Matrix",{constructor:function(){arguments.length?this.setMatrix.apply(this,arguments):this.setMatrix(1,0,0,1,0,0)},translate:function(a,c){return this.m=b(this.m,{a:1,c:0,e:a,b:0,d:1,f:c}),this},rotate:function(a){var d=c(a),e=Math.sin(d),f=Math.cos(d);return this.m=b(this.m,{a:f,c:-e,e:0,b:e,d:f,f:0}),this},scale:function(a,c){return void 0===c&&(c=a),this.m=b(this.m,{a:a,c:0,e:0,b:0,d:c,f:0}),this},skew:function(a,d){void 0===d&&(d=a);var e=Math.tan(c(a)),f=Math.tan(c(d));return this.m=b(this.m,{a:1,c:e,e:0,b:f,d:1,f:0}),this},inverse:function(){var a,b,c,d,e,f,g,i=this.m,j=i.a,k=i.b,l=i.c,m=i.d,n=i.e,o=i.f;return a=j*m-k*l,b=m/a,c=-k/a,d=-l/a,e=j/a,f=(l*o-n*m)/a,g=(k*n-j*o)/a,new h(b,c,d,e,f,g)},setMatrix:function(a,b,c,e,f,g){return this.m=1===arguments.length?d.clone(arguments[0]):{a:a,b:b,c:c,d:e,e:f,f:g},this},getMatrix:function(){return d.clone(this.m)},getTranslate:function(){var a=this.m;return{x:a.e/a.a,y:a.f/a.d}},mergeMatrix:function(a){return new h(b(this.m,a.m))},merge:function(a){return this.mergeMatrix(a)},toString:function(){return this.valueOf().join(" ")},valueOf:function(){var a=this.m;return[a.a,a.b,a.c,a.d,a.e,a.f]},equals:function(a){var b=this.m,c=a.m;return b.a==c.a&&b.b==c.b&&b.c==c.c&&b.d==c.d&&b.e==c.e&&b.f==c.f},transformPoint:function(){return h.transformPoint.apply(null,[].slice.call(arguments).concat([this.m]))},transformBox:function(a){return h.transformBox(a,this.m)}});return h.parse=function(a){var b,c=parseFloat;if(a instanceof Array)return new h({a:a[0],b:a[1],c:a[2],d:a[3],e:a[4],f:a[5]});if(b=f.exec(a)){var d=b[1].split(",");return 6!=d.length&&(d=b[1].split(" ")),new h({a:c(d[0]),b:c(d[1]),c:c(d[2]),d:c(d[3]),e:c(d[4]),f:c(d[5])})}return new h},h.transformPoint=function(a,b,c){return 2===arguments.length&&(c=b,b=a.y,a=a.x),new g(c.a*a+c.c*b+c.e,c.b*a+c.d*b+c.f)},h.transformBox=function(a,b){for(var c,f,g=Number.MAX_VALUE,i=-Number.MAX_VALUE,j=Number.MAX_VALUE,k=-Number.MAX_VALUE,l=[[a.x,a.y],[a.x+a.width,a.y],[a.x,a.y+a.height],[a.x+a.width,a.y+a.height]],m=[];c=l.pop();)f=h.transformPoint(c[0],c[1],b),m.push(f),g=Math.min(g,f.x),i=Math.max(i,f.x),j=Math.min(j,f.y),k=Math.max(k,f.y);return a=new e({x:g,y:j,width:i-g,height:k-j}),d.extend(a,{closurePoints:m}),a},h.getCTM=function(a,b){var c={a:1,b:0,c:0,d:1,e:0,f:0};switch(b=b||"parent"){case"screen":c=a.node.getScreenCTM();break;case"doc":case"paper":c=a.node.getCTM();break;case"view":case"top":a.getPaper()&&(c=a.node.getTransformToElement(a.getPaper().shapeNode));break;case"parent":a.node.parentNode&&(c=a.node.getTransformToElement(a.node.parentNode));break;default:b.node&&(c=a.node.getTransformToElement(b.shapeNode||b.node))}return c?new h(c.a,c.b,c.c,c.d,c.e,c.f):new h},h}),define("graphic/palette",["graphic/standardcolor","graphic/color","core/utils","core/class"],function(a){var b=a("graphic/standardcolor"),c=a("graphic/color"),d=a("core/utils"),e=a("core/class").createClass("Palette",{constructor:function(){this.color={}},get:function(a){var d=this.color[a]||b.EXTEND_STANDARD[a]||b.COLOR_STANDARD[a]||"";return d?new c(d):null},getColorValue:function(a){return this.color[a]||b.EXTEND_STANDARD[a]||b.COLOR_STANDARD[a]||""},add:function(a,b){return this.color[a]="string"==typeof b?new c(b).toRGBA():b.toRGBA(),b},remove:function(a){return this.color.hasOwnProperty(a)?(delete this.color[a],!0):!1}});return d.extend(e,{getColor:function(a){var d=b.EXTEND_STANDARD[a]||b.COLOR_STANDARD[a];return d?new c(d):null},getColorValue:function(a){return b.EXTEND_STANDARD[a]||b.COLOR_STANDARD[a]||""},addColor:function(a,d){return b.EXTEND_STANDARD[a]="string"==typeof d?new c(d).toRGBA():d.toRGBA(),d},removeColor:function(a){return b.EXTEND_STANDARD.hasOwnProperty(a)?(delete b.EXTEND_STANDARD[a],!0):!1}}),e}),define("graphic/paper",["core/class","core/utils","graphic/svg","graphic/container","graphic/shapecontainer","graphic/shape","graphic/viewbox","graphic/eventhandler","graphic/shapeevent","graphic/styled","graphic/matrix","graphic/box","graphic/point","graphic/data","graphic/pen"],function(a){var b=a("core/class"),c=a("core/utils"),d=a("graphic/svg"),e=a("graphic/container"),f=a("graphic/shapecontainer"),g=a("graphic/viewbox"),h=a("graphic/eventhandler"),i=a("graphic/styled"),j=a("graphic/matrix"),k=b.createClass("Paper",{mixins:[f,h,i,g],constructor:function(a){this.callBase(),this.node=this.createSVGNode(),this.node.paper=this,this.node.appendChild(this.resourceNode=d.createNode("defs")),this.node.appendChild(this.shapeNode=d.createNode("g")),this.resources=new e,this.setWidth("100%").setHeight("100%"),a&&this.renderTo(a),this.callMixin()},renderTo:function(a){c.isString(a)&&(a=document.getElementById(a)),this.container=a,a.appendChild(this.node)},createSVGNode:function(){var a=d.createNode("svg");return a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),a},getNode:function(){return this.node},getContainer:function(){return this.container},getWidth:function(){return this.node.clientWidth},setWidth:function(a){return this.node.setAttribute("width",a),this},getHeight:function(){return this.node.clientHeight},setHeight:function(a){return this.node.setAttribute("height",a),this},setViewPort:function(a,b,c){var d,e;1==arguments.length&&(d=arguments[0],a=d.center.x,b=d.center.y,c=d.zoom),c=c||1,e=this.getViewBox();var f=new j,g=e.x+e.width/2-a,h=e.y+e.height/2-b; +return f.translate(-a,-b),f.scale(c),f.translate(a,b),f.translate(g,h),this.shapeNode.setAttribute("transform","matrix("+f+")"),this.viewport={center:{x:a,y:b},offset:{x:g,y:h},zoom:c},this},getViewPort:function(){if(!this.viewport){var a=this.getViewBox();return{zoom:1,center:{x:a.x+a.width/2,y:a.y+a.height/2},offset:{x:0,y:0}}}return this.viewport},getViewPortTransform:function(){var a=this.shapeNode.getCTM();return new j(a.a,a.b,a.c,a.d,a.e,a.f)},getTransform:function(){return this.getViewPortTransform().reverse()},addResource:function(a){return this.resources.appendItem(a),a.node&&this.resourceNode.appendChild(a.node),this},removeResource:function(a){return a.remove&&a.remove(),a.node&&this.resourceNode.removeChild(a.node),this},getPaper:function(){return this}}),l=a("graphic/shape");return b.extendClass(l,{getPaper:function(){for(var a=this.container;a&&a instanceof k==!1;)a=a.container;return a},isAttached:function(){return!!this.getPaper()},whenPaperReady:function(a){function b(){var b=c.getPaper();return b&&a&&a.call(c,b),b}var c=this;return b()||this.on("add treeadd",function d(){b()&&(c.off("add",d),c.off("treeadd",d))}),this}}),k}),define("graphic/path",["core/utils","core/class","graphic/shape","graphic/svg","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box","graphic/geometry","graphic/point","graphic/vector"],function(a){var b=a("core/utils"),c=a("core/class").createClass,d=a("graphic/shape"),e=a("graphic/svg"),f=a("graphic/geometry"),g=Array.prototype.slice,h=(b.flatten,c("PathDrawer",{constructor:function(a){this.segment=[],this.path=a,this.__clear=!1},getPath:function(){return this.path},redraw:function(){return this._transation=this._transation||[],this.clear()},done:function(){var a=this._transation;return this._transation=null,this.push(a),this},clear:function(){return this._transation?this._transation=[]:this.path.setPathData("M 0 0"),this._clear=!0,this},push:function(){var a,b=g.call(arguments);return this._transation?(this._transation.push(b),this):(this._clear?(a="",this._clear=!1):a=this.path.getPathData(),a=a||"",this.path.setPathData(a+f.pathToString(b)),this)},moveTo:function(){return this.push("M",g.call(arguments))},moveBy:function(){return this.push("m",g.call(arguments))},lineTo:function(){return this.push("L",g.call(arguments))},lineBy:function(){return this.push("l",g.call(arguments))},arcTo:function(){return this.push("A",g.call(arguments))},arcBy:function(){return this.push("a",arguments)},carcTo:function(a){return this.push("A",[a,a,0].concat(g.call(arguments,1)))},carcBy:function(a){return this.push("a",[a,a,0].concat(g.call(arguments,1)))},bezierTo:function(){return this.push("C",g.call(arguments))},bezierBy:function(){return this.push("c",g.call(arguments))},close:function(){return this.push("z")}}));return c("Path",{base:d,constructor:function(a){this.callBase("path"),a&&this.setPathData(a),this.node.setAttribute("fill",e.defaults.fill),this.node.setAttribute("stroke",e.defaults.stroke)},setPathData:function(a){return a=a||"M0,0",this.pathdata=f.pathToString(a),this.node.setAttribute("d",this.pathdata),this.trigger("shapeupdate",{type:"pathdata"}),this},getPathData:function(){return this.pathdata||""},getDrawer:function(){return new h(this)},isClosed:function(){var a=this.getPathData();return!!~a.indexOf("z")||!!~a.indexOf("Z")}})}),define("graphic/patternbrush",["graphic/defbrush","core/class","graphic/resource","graphic/shapecontainer","graphic/container","core/utils","graphic/shape","graphic/svg"],function(a){{var b=a("graphic/defbrush"),c=a("graphic/shapecontainer");a("graphic/svg")}return a("core/class").createClass("PatternBrush",{base:b,mixins:[c],constructor:function(){this.callBase("pattern"),this.node.setAttribute("patternUnits","userSpaceOnUse")},setX:function(a){return this.x=a,this.node.setAttribute("x",a),this},setY:function(a){return this.y=a,this.node.setAttribute("y",a),this},setWidth:function(a){return this.width=a,this.node.setAttribute("width",a),this},setHeight:function(a){return this.height=a,this.node.setAttribute("height",a),this},getWidth:function(){return this.width},getHeight:function(){return this.height}})}),define("graphic/pen",["graphic/color","core/utils","graphic/standardcolor","core/class"],function(a){var b=a("graphic/color");return a("core/class").createClass("Pen",{constructor:function(a,b){this.brush=a,this.width=b||1,this.linecap=null,this.linejoin=null,this.dashArray=null,this.opacity=1},getBrush:function(){return this.brush},setBrush:function(a){return this.brush=a,this},setColor:function(a){return this.setBrush(a)},getColor:function(){return this.brush instanceof b?this.brush:null},getWidth:function(){return this.width},setWidth:function(a){return this.width=a,this},getOpacity:function(){return this.opacity},setOpacity:function(a){this.opacity=a},getLineCap:function(){return this.linecap},setLineCap:function(a){return this.linecap=a,this},getLineJoin:function(){return this.linejoin},setLineJoin:function(a){return this.linejoin=a,this},getDashArray:function(){return this.dashArray},setDashArray:function(a){return this.dashArray=a,this},stroke:function(a){var b=a.node;b.setAttribute("stroke",this.brush.toString()),b.setAttribute("stroke-width",this.getWidth()),this.getOpacity()<1&&b.setAttribute("stroke-opacity",this.getOpacity()),this.getLineCap()&&b.setAttribute("stroke-linecap",this.getLineCap()),this.getLineJoin()&&b.setAttribute("stroke-linejoin",this.getLineJoin()),this.getDashArray()&&b.setAttribute("stroke-dasharray",this.getDashArray())}})}),define("graphic/pie",["core/class","graphic/sweep","graphic/point","graphic/path"],function(a){return a("core/class").createClass({base:a("graphic/sweep"),constructor:function(a,b,c){this.callBase([0,a],b,c)},getRadius:function(){return this.getSectionArray()[1]},setRadius:function(a){this.setSectionArray([0,a])}})}),define("graphic/point",["core/class"],function(a){var b=a("core/class").createClass("Point",{constructor:function(a,b){this.x=a||0,this.y=b||0},offset:function(a,c){return 1==arguments.length&&(c=a.y,a=a.x),new b(this.x+a,this.y+c)},valueOf:function(){return[this.x,this.y]},toString:function(){return this.valueOf().join(" ")},spof:function(){return new b((0|this.x)+.5,(0|this.y)+.5)}});return b.fromPolar=function(a,c,d){return"rad"!=d&&(c=c/180*Math.PI),new b(a*Math.cos(c),a*Math.sin(c))},b.parse=function(a){return a instanceof b?a:"string"==typeof a?b.parse(a.split(/\s*[\s,]\s*/)):"0"in a&&"1"in a?new b(a[0],a[1]):void 0},b}),define("graphic/pointcontainer",["core/class","graphic/container"],function(a){return a("core/class").createClass("PointContainer",{base:a("graphic/container"),constructor:function(){this.callBase()},addPoint:function(){return this.addItem.apply(this,arguments)},prependPoint:function(){return this.prependItem.apply(this,arguments)},appendPoint:function(){return this.appendItem.apply(this,arguments)},removePoint:function(){return this.removeItem.apply(this,arguments)},addPoints:function(){return this.addItems.apply(this,arguments)},setPoints:function(){return this.setItems.apply(this,arguments)},getPoint:function(){return this.getItem.apply(this,arguments)},getPoints:function(){return this.getItems.apply(this,arguments)},getFirstPoint:function(){return this.getFirstItem.apply(this,arguments)},getLastPoint:function(){return this.getLastItem.apply(this,arguments)}})}),define("graphic/poly",["core/utils","core/class","graphic/path","graphic/shape","graphic/svg","graphic/geometry","graphic/pointcontainer","graphic/container"],function(a){a("core/utils");return a("core/class").createClass("Poly",{base:a("graphic/path"),mixins:[a("graphic/pointcontainer")],constructor:function(a,b){this.callBase(),this.closeable=!!b,this.setPoints(a||[]),this.changeable=!0,this.update()},onContainerChanged:function(){this.changeable&&this.update()},update:function(){var a=this.getDrawer(),b=this.getPoints();if(a.clear(),!b.length)return this;a.moveTo(b[0]);for(var c,d=1,e=b.length;e>d;d++)c=b[d],a.lineTo(c);return this.closeable&&b.length>2&&a.close(),this}})}),define("graphic/polygon",["core/class","graphic/poly","core/utils","graphic/path","graphic/pointcontainer"],function(a){return a("core/class").createClass("Polygon",{base:a("graphic/poly"),constructor:function(a){this.callBase(a,!0)}})}),define("graphic/polyline",["core/class","graphic/poly","core/utils","graphic/path","graphic/pointcontainer"],function(a){return a("core/class").createClass("Polyline",{base:a("graphic/poly"),constructor:function(a){this.callBase(a)}})}),define("graphic/radialgradientbrush",["graphic/gradientbrush","graphic/svg","graphic/defbrush","graphic/color","core/class"],function(a){var b=a("graphic/gradientbrush");return a("core/class").createClass("RadialGradientBrush",{base:b,constructor:function(a){this.callBase("radialGradient"),this.setCenter(.5,.5),this.setFocal(.5,.5),this.setRadius(.5),"function"==typeof a&&a.call(this,this)},setCenter:function(a,b){return this.node.setAttribute("cx",a),this.node.setAttribute("cy",b),this},getCenter:function(){return{x:+this.node.getAttribute("cx"),y:+this.node.getAttribute("cy")}},setFocal:function(a,b){return this.node.setAttribute("fx",a),this.node.setAttribute("fy",b),this},getFocal:function(){return{x:+this.node.getAttribute("fx"),y:+this.node.getAttribute("fy")}},setRadius:function(a){return this.node.setAttribute("r",a),this},getRadius:function(){return+this.node.getAttribute("r")}})}),define("graphic/rect",["core/utils","graphic/point","core/class","graphic/box","graphic/path","graphic/shape","graphic/svg","graphic/geometry"],function(a){var b={},c=a("core/utils"),d=a("graphic/point"),e=a("graphic/box");c.extend(b,{formatRadius:function(a,b,c){var d=Math.floor(Math.min(a/2,b/2));return Math.min(d,c)}});var f=a("core/class").createClass("Rect",{base:a("graphic/path"),constructor:function(a,c,d,e,f){this.callBase(),this.x=d||0,this.y=e||0,this.width=a||0,this.height=c||0,this.radius=b.formatRadius(this.width,this.height,f||0),this.update()},update:function(){var a=this.x,b=this.y,c=this.width,d=this.height,e=this.radius,f=this.getDrawer().redraw();return e?(c-=2*e,d-=2*e,f.push("M",a+e,b),f.push("h",c),f.push("a",e,e,0,0,1,e,e),f.push("v",d),f.push("a",e,e,0,0,1,-e,e),f.push("h",-c),f.push("a",e,e,0,0,1,-e,-e),f.push("v",-d),f.push("a",e,e,0,0,1,e,-e),f.push("z")):(f.push("M",a,b),f.push("h",c),f.push("v",d),f.push("h",-c),f.push("z")),f.done(),this},setWidth:function(a){return this.width=a,this.update()},setHeight:function(a){return this.height=a,this.update()},setSize:function(a,b){return this.width=a,this.height=b,this.update()},setBox:function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this.update()},getBox:function(){return new e(this.x,this.y,this.width,this.height)},getRadius:function(){return this.radius},setRadius:function(a){return this.radius=a,this.update()},getPosition:function(){return new d(this.x,this.y)},setPosition:function(a,b){if(1==arguments.length){var c=d.parse(arguments[0]);b=c.y,a=c.x}return this.x=a,this.y=b,this.update()},getWidth:function(){return this.width},getHeight:function(){return this.height},getPositionX:function(){return this.x},getPositionY:function(){return this.y},setPositionX:function(a){return this.x=a,this.update()},setPositionY:function(a){return this.y=a,this.update()}});return f}),define("graphic/regularpolygon",["graphic/point","core/class","graphic/path","core/utils","graphic/shape","graphic/svg","graphic/geometry"],function(a){var b=a("graphic/point");return a("core/class").createClass("RegularPolygon",{base:a("graphic/path"),constructor:function(a,c,d,e){this.callBase(),this.radius=c||0,this.side=Math.max(a||3,3),arguments.length>2&&3==arguments.length&&(e=d.y,d=d.x),this.center=new b(d,e),this.draw()},getSide:function(){return this.side},setSide:function(a){return this.side=a,this.draw()},getRadius:function(){return this.radius},setRadius:function(a){return this.radius=a,this.draw()},draw:function(){var a,c=this.radius,d=this.side,e=2*Math.PI/d,f=this.getDrawer();for(f.clear(),f.moveTo(b.fromPolar(c,Math.PI/2,"rad").offset(this.center)),a=0;d>=a;a++)f.lineTo(b.fromPolar(c,e*a+Math.PI/2,"rad").offset(this.center));return f.close(),this}})}),define("graphic/resource",["graphic/svg","core/class"],function(a){var b=a("graphic/svg");return a("core/class").createClass("Resource",{constructor:function(a){this.callBase(),this.node=b.createNode(a)},toString:function(){return"url(#"+this.node.id+")"}})}),define("graphic/ring",["core/class","graphic/sweep","graphic/point","graphic/path"],function(a){return a("core/class").createClass({base:a("graphic/sweep"),constructor:function(a,b){this.callBase([a,b],360,0)},getInnerRadius:function(){return this.getSectionArray()[0]},getOuterRadius:function(){return this.getSectionArray()[1]},setInnerRadius:function(a){this.setSectionArray([a,this.getOuterRadius()])},setOuterRadius:function(a){this.setSectionArray([this.getInnerRadius(),a])}})}),define("graphic/shape",["graphic/svg","core/utils","graphic/eventhandler","graphic/shapeevent","core/class","graphic/styled","graphic/data","graphic/matrix","graphic/box","graphic/point","graphic/pen","graphic/color"],function(a){var b=a("graphic/svg"),c=a("core/utils"),d=a("graphic/eventhandler"),e=a("graphic/styled"),f=a("graphic/data"),g=a("graphic/matrix"),h=(a("graphic/pen"),Array.prototype.slice),i=a("graphic/box"),j=a("core/class").createClass("Shape",{mixins:[d,e,f],constructor:function(a){this.node=b.createNode(a),this.node.shape=this,this.transform={translate:null,rotate:null,scale:null,matrix:null},this.callMixin()},getId:function(){return this.node.id},setId:function(a){return this.node.id=a,this},getNode:function(){return this.node},getBoundaryBox:function(){var a;try{a=this.node.getBBox()}catch(b){a={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}return new i(a)},getRenderBox:function(a){var b=this.getBoundaryBox(),c=this.getTransform(a);return c.transformBox(b)},getWidth:function(){return this.getRenderBox().width},getHeight:function(){return this.getRenderBox().height},getSize:function(){var a=this.getRenderBox();return delete a.x,delete a.y,a},setOpacity:function(a){return this.node.setAttribute("opacity",a),this},getOpacity:function(){var a=this.node.getAttribute("opacity");return a?+a:1},setVisible:function(a){return a?this.node.removeAttribute("display"):this.node.setAttribute("display","none"),this},getVisible:function(){this.node.getAttribute("display")},hasAncestor:function(a){for(var b=this.container;b;){if(b===a)return!0;b=b.container}return!1},getTransform:function(a){return g.getCTM(this,a)},clearTransform:function(){return this.node.removeAttribute("transform"),this.transform={translate:null,rotate:null,scale:null,matrix:null},this.trigger("shapeupdate",{type:"transform"}),this},_applyTransform:function(){var a=this.transform,b=[];return a.translate&&b.push(["translate(",a.translate,")"]),a.rotate&&b.push(["rotate(",a.rotate,")"]),a.scale&&b.push(["scale(",a.scale,")"]),a.matrix&&b.push(["matrix(",a.matrix,")"]),this.node.setAttribute("transform",c.flatten(b).join(" ")),this},setMatrix:function(a){return this.transform.matrix=a,this._applyTransform()},setTranslate:function(a){return this.transform.translate=null!==a&&h.call(arguments)||null,this._applyTransform()},setRotate:function(a){return this.transform.rotate=null!==a&&h.call(arguments)||null,this._applyTransform()},setScale:function(a){return this.transform.scale=null!==a&&h.call(arguments)||null,this._applyTransform()},translate:function(a,b){var c=this.transform.matrix||new g;return void 0===b&&(b=0),this.transform.matrix=c.translate(a,b),this._applyTransform()},rotate:function(a){var b=this.transform.matrix||new g;return this.transform.matrix=b.rotate(a),this._applyTransform()},scale:function(a,b){var c=this.transform.matrix||new g;return void 0===b&&(b=a),this.transform.matrix=c.scale(a,b),this._applyTransform()},skew:function(a,b){var c=this.transform.matrix||new g;return void 0===b&&(b=a),this.transform.matrix=c.skew(a,b),this._applyTransform()},stroke:function(a,b){return a&&a.stroke?a.stroke(this):a?(this.node.setAttribute("stroke",a.toString()),b&&this.node.setAttribute("stroke-width",b)):null===a&&this.node.removeAttribute("stroe"),this},fill:function(a){return a&&this.node.setAttribute("fill",a.toString()),null===a&&this.node.removeAttribute("fill"),this},setAttr:function(a,b){var d=this;c.isObject(a)&&c.each(a,function(a,b){d.setAttr(b,a)}),void 0===b||null===b||""===b?this.node.removeAttribute(a):this.node.setAttribute(a,b)},getAttr:function(a){return this.node.getAttribute(a)}});return j}),define("graphic/shapecontainer",["graphic/container","core/class","core/utils","graphic/shape","graphic/svg","graphic/eventhandler","graphic/styled","graphic/data","graphic/matrix","graphic/pen","graphic/box"],function(a){var b=a("graphic/container"),c=a("core/utils"),d=a("core/class").createClass("ShapeContainer",{base:b,isShapeContainer:!0,handleAdd:function(a,b){var c=this.getShapeNode();c.insertBefore(a.node,c.childNodes[b]||null),a.trigger("add",{container:this}),a.notifyTreeModification&&a.notifyTreeModification("treeadd",this)},handleRemove:function(a){var b=this.getShapeNode();b.removeChild(a.node),a.trigger("remove",{container:this}),a.notifyTreeModification&&a.notifyTreeModification("treeremove",this)},notifyTreeModification:function(a,b){this.eachItem(function(c,d){d.notifyTreeModification&&d.notifyTreeModification(a,b),d.trigger(a,{container:b})})},getShape:function(a){return this.getItem(a)},addShape:function(a,b){return this.addItem(a,b)},put:function(a){return this.addShape(a),a},appendShape:function(a){return this.addShape(a)},prependShape:function(a){return this.addShape(a,0)},replaceShape:function(a,b){var c=this.indexOf(b);if(-1!==c)return this.removeShape(c),this.addShape(a,c),this},addShapeBefore:function(a,b){var c=this.indexOf(b);return this.addShape(a,c)},addShapeAfter:function(a,b){var c=this.indexOf(b);return this.addShape(a,-1===c?void 0:c+1)},addShapes:function(a){return this.addItems(a)},removeShape:function(a){return this.removeItem(a)},getShapes:function(){return this.getItems()},getShapesByType:function(a){function b(e){a.toLowerCase()==e.getType().toLowerCase()&&d.push(e),e.isShapeContainer&&c.each(e.getShapes(),function(a){b(a)})}var d=[];return b(this),d},getShapeById:function(a){return this.getShapeNode().getElementById(a).shape},arrangeShape:function(a,b){return this.removeShape(a).addShape(a,b)},getShapeNode:function(){return this.shapeNode||this.node}}),e=a("graphic/shape");return a("core/class").extendClass(e,{bringTo:function(a){return this.container.arrangeShape(this,a),this},bringFront:function(){return this.bringTo(this.container.indexOf(this)+1)},bringBack:function(){return this.bringTo(this.container.indexOf(this)-1)},bringTop:function(){return this.container.removeShape(this).addShape(this),this},bringRear:function(){return this.bringTo(0)},bringRefer:function(a,b){return a.container&&(this.remove&&this.remove(),a.container.addShape(this,a.container.indexOf(a)+(b||0))),this},bringAbove:function(a){return this.bringRefer(a)},bringBelow:function(a){return this.bringRefer(a,1)},replaceBy:function(a){return this.container&&(a.bringAbove(this),this.remove()),this}}),d}),define("graphic/shapeevent",["graphic/matrix","core/utils","graphic/box","graphic/point","core/class"],function(a){{var b=a("graphic/matrix"),c=a("core/utils");a("graphic/point")}return a("core/class").createClass("ShapeEvent",{constructor:function(a){var b=null;c.isObject(a.target)?c.extend(this,a):(this.type=a.type,b=a.target,b.correspondingUseElement&&(b=b.correspondingUseElement),this.originEvent=a,this.targetShape=b.shape||b.paper||a.currentTarget&&(a.currentTarget.shape||a.currentTarget.paper),a._kityParam&&c.extend(this,a._kityParam))},preventDefault:function(){var a=this.originEvent;return a?a.preventDefault?(a.preventDefault(),a.cancelable):(a.returnValue=!1,!0):!0},getPosition:function(a,c){if(!this.originEvent)return null;var d=this.originEvent.touches?this.originEvent.touches[c||0]:this.originEvent,e=d&&d.clientX||0,f=d&&d.clientY||0,g=this.targetShape.shapeNode||this.targetShape.node,h=b.transformPoint(e,f,g.getScreenCTM().inverse());return b.getCTM(this.targetShape,a||"view").transformPoint(h)},stopPropagation:function(){var a=this.originEvent;return a?void(a.stopPropagation?a.stopPropagation():a.cancelBubble=!1):!0}})}),define("graphic/shapepoint",["core/class","graphic/point"],function(a){return a("core/class").createClass("ShapePoint",{base:a("graphic/point"),constructor:function(a,b){this.callBase(a,b)},setX:function(a){return this.setPoint(a,this.y)},setY:function(a){return this.setPoint(this.x,a)},setPoint:function(a,b){return this.x=a,this.y=b,this.update(),this},getPoint:function(){return this},update:function(){return this.container&&this.container.update&&this.container.update(),this}})}),define("graphic/standardcolor",[],{COLOR_STANDARD:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00"},EXTEND_STANDARD:{}}),define("graphic/star",["graphic/point","core/class","graphic/path","core/utils","graphic/shape","graphic/svg","graphic/geometry"],function(a){var b={3:.2,5:.38196601125,6:.57735026919,8:.541196100146,10:.726542528005,12:.707106781187},c=a("graphic/point");return a("core/class").createClass("Star",{base:a("graphic/path"),constructor:function(a,b,d,e,f){this.callBase(),this.vertex=a||3,this.radius=b||0,this.shrink=d,this.offset=e||new c(0,0),this.angleOffset=f||0,this.draw()},getVertex:function(){return this.vertex},setVertex:function(a){return this.vertex=a,this.draw()},getRadius:function(){return this.radius},setRadius:function(a){return this.radius=a,this.draw()},getShrink:function(){return this.shrink},setShrink:function(a){return this.shrink=a,this.draw()},getOffset:function(){return this.offset},setOffset:function(a){return this.offset=a,this.draw()},getAngleOffset:function(){return this.angleOffset},setAngleOffset:function(a){return this.angleOffset=a,this.draw()},draw:function(){var a,d,e=this.radius,f=this.radius*(this.shrink||b[this.vertex]||.5),g=this.vertex,h=this.offset,i=90,j=180/g,k=this.angleOffset,l=this.getDrawer();for(l.clear(),l.moveTo(c.fromPolar(f,i)),a=1;2*g>=a;a++)d=i+j*a,l.lineTo(a%2?c.fromPolar(e,d+k).offset(h):c.fromPolar(f,d));l.close()}})}),define("graphic/styled",["core/class"],function(a){function b(a){return a.classList||(a.classList=new c(a)),a.classList}var c=a("core/class").createClass("ClassList",{constructor:function(a){this._node=a,this._list=a.className.toString().split(" ")},_update:function(){this._node.className=this._list.join(" ")},add:function(a){this._list.push(a),this._update()},remove:function(a){var b=this._list.indexOf(a);~b&&this._list.splice(b,1),this._update()},contains:function(a){return!!~this._list.indexOf(a)}});return a("core/class").createClass("Styled",{addClass:function(a){return b(this.node).add(a),this},removeClass:function(a){return b(this.node).remove(a),this},hasClass:function(a){return b(this.node).contains(a)},setStyle:function(a){if(2==arguments.length)return this.node.style[arguments[0]]=arguments[1],this;for(var b in a)a.hasOwnProperty(b)&&(this.node.style[b]=a[b]);return this}})}),define("graphic/svg",[],function(){var a=document,b=0,c={createNode:function(d){var e=a.createElementNS(c.ns,d);return e.id="kity_"+d+"_"+b++,e},defaults:{stroke:"none",fill:"none"},xlink:"http://www.w3.org/1999/xlink",ns:"http://www.w3.org/2000/svg"};return c}),define("graphic/sweep",["graphic/point","core/class","graphic/path","core/utils","graphic/shape","graphic/svg","graphic/geometry"],function(a){var b=a("graphic/point");return a("core/class").createClass("Sweep",{base:a("graphic/path"),constructor:function(a,b,c){this.callBase(),this.sectionArray=a||[],this.angle=b||0,this.angleOffset=c||0,this.draw()},getSectionArray:function(){return this.sectionArray},setSectionArray:function(a){return this.sectionArray=a,this.draw()},getAngle:function(){return this.angle},setAngle:function(a){return this.angle=a,this.draw()},getAngleOffset:function(){return this.angleOffset},setAngleOffset:function(a){return this.angleOffset=a,this.draw()},draw:function(){var a,b=this.sectionArray;for(a=0;a0?1:-1;return 180*c*b/Math.PI}});return d.fromPoints=function(a,b){return new d(b.x-a.x,b.y-a.y)},a("core/class").extendClass(b,{asVector:function(){return new d(this.x,this.y)}}),d}),define("graphic/view",["graphic/shapecontainer","graphic/container","core/utils","core/class","graphic/shape","graphic/viewbox","graphic/view"],function(a){var b=a("graphic/shapecontainer"),c=a("graphic/viewbox");return a("core/class").createClass("View",{mixins:[b,c],base:a("graphic/view"),constructor:function(){this.callBase("view")}})}),define("graphic/viewbox",["core/class"],function(a){return a("core/class").createClass("ViewBox",{getViewBox:function(){var a=this.node.getAttribute("viewBox");return null===a?{x:0,y:0,width:this.node.clientWidth||this.node.parentNode.clientWidth,height:this.node.clientHeight||this.node.parentNode.clientHeight}:(a=a.split(" "),{x:+a[0],y:+a[1],width:+a[2],height:+a[3]})},setViewBox:function(a,b,c,d){return this.node.setAttribute("viewBox",[a,b,c,d].join(" ")),this}})}),define("kity",["core/utils","core/class","core/browser","graphic/box","graphic/bezier","graphic/pointcontainer","graphic/path","graphic/bezierpoint","graphic/shapepoint","graphic/vector","graphic/circle","graphic/ellipse","graphic/clip","graphic/shape","graphic/shapecontainer","graphic/color","graphic/standardcolor","graphic/container","graphic/curve","graphic/point","graphic/gradientbrush","graphic/svg","graphic/defbrush","graphic/group","graphic/hyperlink","graphic/image","graphic/line","graphic/lineargradientbrush","graphic/mask","graphic/matrix","graphic/marker","graphic/resource","graphic/viewbox","graphic/palette","graphic/paper","graphic/eventhandler","graphic/styled","graphic/geometry","graphic/patternbrush","graphic/pen","graphic/polygon","graphic/poly","graphic/polyline","graphic/pie","graphic/sweep","graphic/radialgradientbrush","graphic/rect","graphic/regularpolygon","graphic/ring","graphic/data","graphic/star","graphic/text","graphic/textcontent","graphic/textspan","graphic/use","animate/animator","animate/timeline","animate/easing","animate/opacityanimator","animate/rotateanimator","animate/scaleanimator","animate/frame","animate/translateanimator","animate/pathanimator","animate/motionanimator","filter/filter","filter/effectcontainer","filter/gaussianblurfilter","filter/effect/gaussianblureffect","filter/projectionfilter","filter/effect/effect","filter/effect/colormatrixeffect","filter/effect/compositeeffect","filter/effect/offseteffect","filter/effect/convolvematrixeffect"],function(a){var b={},c=a("core/utils");return b.version="2.0.0",c.extend(b,{createClass:a("core/class").createClass,extendClass:a("core/class").extendClass,Utils:c,Browser:a("core/browser"),Box:a("graphic/box"),Bezier:a("graphic/bezier"),BezierPoint:a("graphic/bezierpoint"),Circle:a("graphic/circle"),Clip:a("graphic/clip"),Color:a("graphic/color"),Container:a("graphic/container"),Curve:a("graphic/curve"),Ellipse:a("graphic/ellipse"),GradientBrush:a("graphic/gradientbrush"),Group:a("graphic/group"),HyperLink:a("graphic/hyperlink"),Image:a("graphic/image"),Line:a("graphic/line"),LinearGradientBrush:a("graphic/lineargradientbrush"),Mask:a("graphic/mask"),Matrix:a("graphic/matrix"),Marker:a("graphic/marker"),Palette:a("graphic/palette"),Paper:a("graphic/paper"),Path:a("graphic/path"),PatternBrush:a("graphic/patternbrush"),Pen:a("graphic/pen"),Point:a("graphic/point"),Polygon:a("graphic/polygon"),Polyline:a("graphic/polyline"),Pie:a("graphic/pie"),RadialGradientBrush:a("graphic/radialgradientbrush"),Rect:a("graphic/rect"),RegularPolygon:a("graphic/regularpolygon"),Ring:a("graphic/ring"),Shape:a("graphic/shape"),ShapePoint:a("graphic/shapepoint"),ShapeContainer:a("graphic/shapecontainer"),Sweep:a("graphic/sweep"),Star:a("graphic/star"),Text:a("graphic/text"),TextSpan:a("graphic/textspan"),Use:a("graphic/use"),Vector:a("graphic/vector"),g:a("graphic/geometry"),Animator:a("animate/animator"),Easing:a("animate/easing"),OpacityAnimator:a("animate/opacityanimator"),RotateAnimator:a("animate/rotateanimator"),ScaleAnimator:a("animate/scaleanimator"),Timeline:a("animate/timeline"),TranslateAnimator:a("animate/translateanimator"),PathAnimator:a("animate/pathanimator"),MotionAnimator:a("animate/motionanimator"),Filter:a("filter/filter"),GaussianblurFilter:a("filter/gaussianblurfilter"),ProjectionFilter:a("filter/projectionfilter"),ColorMatrixEffect:a("filter/effect/colormatrixeffect"),CompositeEffect:a("filter/effect/compositeeffect"),ConvolveMatrixEffect:a("filter/effect/convolvematrixeffect"),Effect:a("filter/effect/effect"),GaussianblurEffect:a("filter/effect/gaussianblureffect"),OffsetEffect:a("filter/effect/offseteffect")}),window.kity=b}),function(){try{inc.use("kity")}catch(a){use("kity")}}()}(); \ No newline at end of file diff --git a/doc/images/hello-kity.png b/doc/images/hello-kity.png new file mode 100644 index 0000000000000000000000000000000000000000..500d765351218a9e310f0848528248b50e335ee1 GIT binary patch literal 4643 zcmbW5=QA7(7sVGFEqW(J2`jp=2%?wG>LjA~x_a~yHOiy+=md)>izv~1ud9n*SMNmM zc=I>BAMQOfXXbpn^E)#)QbP?wh);(P000P~@8z}rY3#p&;9~#VVm!TG006!WOioS% zDksOJ;p%J+bFcyc-V^40^ZNKBt-up-_$rk{ApDI0RX$!p z1U*)V!EHVezkJ}%mn*R0M$Z-U9b&-I-P_r&k2Gc()i(B%KR9s!7$vA zGZM-InX&{bIB|yT9LWoPTpu|Zjkgq7eR7crBuUbD6QCb7oL|fG zp%=4Z{>g04T#0`+-6H*y3iXb#HHl#GT}YAn?9XCd_6jLaJYmwTSf1Wbrtzi*)oDMm zew!VM(-RGJ(r(hb1T@kZ3OET>0vm|uV_Jd^dk8l`=iaTHs}!dp#9eM@=3kiG@dN1t zU#`V7_II!+;OPVHLx`EbF|j(Zek7s8-Ni+Rl6HeNgMX;IvxJlQ^ctFT{EYi8(+Z^r zsU=fD!&#}dSUEE4f!Xp$*L>!>GGLWX`bdwYUUyG;2n?-gTUd=38qEU zXql|8ANf)F9cH;^g&P*H$`Z>bIScg*#rxk{{Q4YqF1cj@s*cQoCP8C|R6qQlS^a3* zjI2Wv*zeeaz~w?M0|nK~dU_R#bKgaK-VJ^!^vSy8dM**I8=XV7LS@2z%>9AqkegAD zL+_ccW8FdZea~WVroEAc|3J9imPPG&@ybp;qLgRNv*XxbJkzLpg{noZ1$j+$&GGj@~%OIN^BVa{}r!>KPsy z*U8Ttjr6XGyq3H%Cf+XjGulh3Tl$ChqpI_LfI z1>PP$9HPm5v}Q6HL1FK6Ac&!N{;i@)Swl zU5ZkvyfSI>LILNKTOuBkcKf+@W6zCltsWDBX`wZtlk#c3Mv)fKN+>0C3sYUDe%+(S zXQjeGF?B+gH8kwRSbDHV~`4Va-v}ovZE4ZKn~2q06C%03mB3FAtk`&%fc1 zT|y`JM2N7tO2eflH7}#C=8Zq?hw+X~j_()FMifV4tzN7-MXkwCq%$6L$ z4}$69Gk4k!{2GpP76+E*JJuWnr!iu&`fwy)QqZ>s4&G?kBV-)=%$7GQdXR?&2hANe zfhK|S$M4S*k&rM*(Li^+$E^6wyvPrc6yfgJr2d~wo0@$jkRN1PhyPfp3{b z&o>8d8BcQw-Yxh<`Iqgpqw}tRP3TAI=g%$AMgD>d!~9hI*7k#@a~Q@Mc%-tPzFfsz zXJpn6+bAOw$0@V3MDx4?E@b<|&Z8r#BgAyvC7bKEr*bN*D_2K?)2fWmn_Nqm+8!RY z)5>isMUBM$bNt(m!_l#GFI#fInH&Yc_Ulg_+xA^*(ciWZaqZ9ickhiJ_*So*{ZVmG zIWMrHvF}fK+x?!5mnHW7SJ9I=rNqWkqrPv^wrGo^tpav@bN^{WNt@mZ>)`nN>n3%w zJTJiOq0Pp8sQ1i%@-Rb6Y4u0D=>6QaLKb`yH}ARwj}007|RK;>mVdSe{x`~OF&P4Of_?w)^9J{U4c z$@Q6IOhuLZ=M29lxzKY}aztwHjFKwzOvvw~8Oq2%2AV8FT!M+NB5xE_1%)nN@fbbf zQjWwkNfr2_$Fnm0z1G?rPFiy^azy-ikFvyXa@|gvIxe&PkU0yw+0XPTFsO0CF3jZx zQPP+gY_VirLYPW)^9iLPNs6NDbpIUt!H+V~LVB0jprn2w%d+oqO`=9cY3LT6fVRfe zYaGK@-{GGLGdN$vQm`sXHKrQFRVY)y!x;0puVIFA#rTBikabHRdIh#ODGZnP!1^qr zVD=?U=eX!Xk8<5+C-p`1fJgGV%~|OU%=?=vcF8i*2Ha&Jw=bpl-Lr-$q2!xv@B?w* zB&;rwyK15CqY}w&fC4>n!;K_W?k<>o*ZUN%#Uu`Vj0)T3QavJ7(`YCm}POS^Qv74)9*v1zAt3m)YY^V}Y>AU6acW_w=b7A=J z{<>=_x#I{Kdq!{}q1}SfHOz1% zYQx^+q98e%Ed`#4k7)assOG(QAy6BB#=jO{z>YiB7fbp2i(M|d$*w3<@4rxk^ZHGdU= z?Ld9ztp#>ey@;0(Hj6u{zp|o-1iI)WhGPvHSn&kmRkQ5CaeIOa9<1T_?i{k)d_$W# zu4};8#cS3XI<^SY7D-`)9s_3@;rVRTmnFk>JTj1`?o%wD5!YR%RT>#6Dyf3P6N^eb zwlyx7koy$*y=|bxGjcLf3#~%->6?{`@POD5D0!Bwl0M9knMy0L2dv!xm`blO9Ovvk zY;Q+eK&$g>rY55OhNZMJVZ!DH11*ZfLH#zKs7FsPvr+XiCW&&Np5NQ6hG(>XA`$zG z(z8zd?%#W<7chn)ZTU|@J9 zxo5WFq=dR`5p-)B3sO#Y460446E^SNd^1FOqol=tS+y?%aPrPA@{4RuXEoiHpe(P!5BfKLL zDN@s0;-36$N*k*@O6P@$^7C=3De!S=9f*G!r*xew2`{n)2yaiIDVhhjmP>ND}b zLQwu;PGA5zL2c{oPviP84JT)&jIgdfHfnnX=(v_=LN9VNkLyAYGqd2#;es@E=Hj*% zcqhRgqt978Ha@h)M4p6_Q%yw5&jd`3-HRt5eHY}Td-L)(5BG8i*CcE&4GrJWp-6ZO#~LYVF$}uFk?|Tx{9j(Z2lj|J8rS9(K44&G_%|F)ppX zl-KkijO{sK2OhVzS*=MR@#Ta1Z#Qt5an(7&{I>r;`oc371q~Z#ZJeoMFKn)JJ4mTS zEZT0}x)>v7?Z!xK`%X@NEjUDV4;SKmbQZ>IBc#folC z9doRq$J7vhane;UA6*aK&U3($4^=yd01T5~C1U9jM6^tpN|}JJxM2;Y%pdXsoj$K& zm_Tt(ISyC>*$`kiAC55CK9;3{J(=wSOuMR#-3-n S0{@;r0H}hRe5I^u$o~LQP5o>D literal 0 HcmV?d00001 diff --git a/example/first.html b/example/first.html index 2bb5573..82729ed 100644 --- a/example/first.html +++ b/example/first.html @@ -10,22 +10,16 @@ \ No newline at end of file diff --git a/src/graphic/box.js b/src/graphic/box.js index 82ddc47..66ab7cf 100644 --- a/src/graphic/box.js +++ b/src/graphic/box.js @@ -44,7 +44,7 @@ define(function(require, exports, module) { }, expand: function(ex, ey, ew, eh) { - return new Box(this.x + ex, this.y + ey, this.width + ew, this.height + eh); + return new Box(this.x + ex, this.y + ey, this.width - ex + ew, this.height - ey + eh); }, valueOf: function() { diff --git a/src/graphic/paper.js b/src/graphic/paper.js index e51ff50..682e4be 100644 --- a/src/graphic/paper.js +++ b/src/graphic/paper.js @@ -167,6 +167,9 @@ define(function(require, exports, module) { } return parent; }, + isAttached: function() { + return !!this.getPaper(); + }, whenPaperReady: function(fn) { var me = this; diff --git a/src/graphic/rect.js b/src/graphic/rect.js index 06c168e..cbaa6cc 100644 --- a/src/graphic/rect.js +++ b/src/graphic/rect.js @@ -167,10 +167,6 @@ define(function(require, exports, module) { }); - var ShapeContainer = require('graphic/shapecontainer'); - - ShapeContainer.creators.rect = Rect; - return Rect; }); \ No newline at end of file diff --git a/src/graphic/shapecontainer.js b/src/graphic/shapecontainer.js index 170642a..eb977f0 100644 --- a/src/graphic/shapecontainer.js +++ b/src/graphic/shapecontainer.js @@ -2,29 +2,11 @@ define(function(require, exports, module) { var Container = require('graphic/container'); var utils = require('core/utils'); - function construct(constructor, args) { - var obj = Object.create(constructor.prototype); - constructor.apply(obj, args); - return obj; - } - var ShapeContainer = require('core/class').createClass('ShapeContainer', { base: Container, isShapeContainer: true, - create: function(name) { - - var CreatorClass = ShapeContainer.creators[name]; - if (CreatorClass) { - var args = Array.prototype.slice.call(arguments, 1); - var shape = construct(CreatorClass, args); - this.addShape(shape); - return shape; - } - return null; - }, - /* private */ handleAdd: function(shape, index) { var parent = this.getShapeNode(); @@ -71,6 +53,11 @@ define(function(require, exports, module) { return this.addItem(shape, index); }, + put: function(shape) { + this.addShape(shape); + return shape; + }, + appendShape: function(shape) { return this.addShape(shape); }, @@ -189,8 +176,6 @@ define(function(require, exports, module) { } }); - ShapeContainer.creators = {}; - return ShapeContainer; }); \ No newline at end of file