Commit 083a7f97 authored by techird's avatar techird

kity fix

parent 9980f44d
/*!
* ====================================================
* kitygraph - v1.0.0 - 2014-01-24
* kitygraph - v1.0.0 - 2014-02-12
* https://github.com/kitygraph/kity
* GitHub: https://github.com/kitygraph/kity.git
* Copyright (c) 2014 Baidu UEditor Group; Licensed MIT
......@@ -8,14 +8,14 @@
*/
(function () {
/**
/**
* cmd 内部定义
*/
// 模块存储
var _modules = {};
var _modules = {};
function define ( id, deps, factory ) {
function define ( id, deps, factory ) {
_modules[ id ] = {
......@@ -45,9 +45,9 @@
}
}
}
function require ( id ) {
function require ( id ) {
var module = _modules[ id ],
exports = null;
......@@ -78,14 +78,14 @@
return module.value;
}
}
function use ( id ) {
function use ( id ) {
return require( id );
}
define("animate/animator", [ "animate/timeline", "graphic/color", "graphic/matrix", "graphic/eventhandler", "core/class", "animate/easing", "core/config", "graphic/shape", "graphic/svg", "core/utils", "graphic/styled", "graphic/data", "graphic/pen" ], function(require, exports, module) {
}
define("animate/animator", [ "animate/timeline", "graphic/color", "graphic/matrix", "graphic/eventhandler", "core/class", "animate/easing", "core/config", "graphic/shape", "graphic/svg", "core/utils", "graphic/styled", "graphic/data", "graphic/pen" ], function(require, exports, module) {
function parseTime(str) {
var value = parseFloat(str, 10);
if (/ms/.test(str)) {
......@@ -180,15 +180,15 @@
}
});
return Animator;
});
/**
});
/**
* Kity Animate Easing modified from jQuery Easing
* Author: techird
* Changes:
* 1. make easing functions standalone
* 2. remove the 'x' parameter
*/
/* ============================================================
/* ============================================================
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Open source under the BSD License.
......@@ -197,7 +197,7 @@
* All rights reserved.
* https://raw.github.com/danro/jquery-easing/master/LICENSE
* ======================================================== */
define("animate/easing", [], function(require, exports, module) {
define("animate/easing", [], function(require, exports, module) {
var easings = {
// t: current_time, b: begin_value, c: change_value, d: duration
linear: function(t, b, c, d) {
......@@ -353,8 +353,8 @@
}
};
return easings;
});
define("animate/opacityanimator", [ "animate/animator", "animate/timeline", "animate/easing", "core/class", "graphic/shape", "graphic/matrix", "core/utils", "graphic/vector", "core/config", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/pen" ], function(require, exports, module) {
});
define("animate/opacityanimator", [ "animate/animator", "animate/timeline", "animate/easing", "core/class", "graphic/shape", "graphic/matrix", "core/utils", "graphic/vector", "core/config", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/pen" ], function(require, exports, module) {
var Animator = require("animate/animator");
var Matrix = require("graphic/matrix");
var OpacityAnimator = require("core/class").createClass("OpacityAnimator", {
......@@ -387,8 +387,8 @@
}
});
return OpacityAnimator;
});
define("animate/rotateanimator", [ "animate/animator", "animate/timeline", "animate/easing", "core/class", "graphic/shape", "graphic/matrix", "core/utils", "graphic/vector", "core/config", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/pen" ], function(require, exports, module) {
});
define("animate/rotateanimator", [ "animate/animator", "animate/timeline", "animate/easing", "core/class", "graphic/shape", "graphic/matrix", "core/utils", "graphic/vector", "core/config", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/pen" ], function(require, exports, module) {
var Animator = require("animate/animator");
var Matrix = require("graphic/matrix");
var RotateAnimator = require("core/class").createClass("RotateAnimator", {
......@@ -414,8 +414,8 @@
}
});
return RotateAnimator;
});
define("animate/scaleanimator", [ "animate/animator", "animate/timeline", "animate/easing", "core/class", "graphic/shape", "graphic/matrix", "core/utils", "graphic/vector", "core/config", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/pen" ], function(require, exports, module) {
});
define("animate/scaleanimator", [ "animate/animator", "animate/timeline", "animate/easing", "core/class", "graphic/shape", "graphic/matrix", "core/utils", "graphic/vector", "core/config", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/pen" ], function(require, exports, module) {
var Animator = require("animate/animator");
var Matrix = require("graphic/matrix");
var ScaleAnimator = require("core/class").createClass("ScaleAnimator", {
......@@ -440,8 +440,8 @@
}
});
return ScaleAnimator;
});
define("animate/timeline", [ "graphic/color", "core/utils", "graphic/standardcolor", "core/class", "graphic/matrix", "graphic/vector", "graphic/eventhandler", "graphic/shapeevent", "core/config" ], function(require, exports, module) {
});
define("animate/timeline", [ "graphic/color", "core/utils", "graphic/standardcolor", "core/class", "graphic/matrix", "graphic/vector", "graphic/eventhandler", "graphic/shapeevent", "core/config" ], function(require, exports, module) {
var Color = require("graphic/color");
var Matrix = require("graphic/matrix");
var EventHandler = require("graphic/eventhandler");
......@@ -692,8 +692,8 @@
}
});
return Timeline;
});
define("animate/translateanimator", [ "animate/animator", "animate/timeline", "animate/easing", "core/class", "graphic/shape", "graphic/matrix", "core/utils", "graphic/vector", "core/config", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/pen" ], function(require, exports, module) {
});
define("animate/translateanimator", [ "animate/animator", "animate/timeline", "animate/easing", "core/class", "graphic/shape", "graphic/matrix", "core/utils", "graphic/vector", "core/config", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/pen" ], function(require, exports, module) {
var Animator = require("animate/animator");
var Matrix = require("graphic/matrix");
var TranslateAnimator = require("core/class").createClass("TranslateAnimator", {
......@@ -718,8 +718,8 @@
}
});
return TranslateAnimator;
});
/**
});
/**
* @description 创建一个类
* @param {String} fullClassName 类全名,包括命名空间。
* @param {Plain} defines 要创建的类的特性
......@@ -731,7 +731,7 @@
* TODO:
* Mixin 构造函数调用支持
*/
define("core/class", [ "core/config" ], function(require, exports) {
define("core/class", [ "core/config" ], function(require, exports) {
// just to bind context
Function.prototype.bind = Function.prototype.bind || function(thisObj) {
var args = Array.prototype.slice.call(arguments, 1);
......@@ -894,14 +894,14 @@
return NewClass;
};
exports.extendClass = extend;
});
define("core/config", [], function(require, exports, module) {
});
define("core/config", [], function(require, exports, module) {
return {
debug: true,
version: "1.0.0"
};
});
define("core/utils", [], function(require, exports, module) {
});
define("core/utils", [], function(require, exports, module) {
var utils = {
each: function(obj, iterator, context) {
if (obj === null) {
......@@ -954,11 +954,11 @@
};
});
return utils;
});
/**
});
/**
* 颜色矩阵运算效果封装
*/
define("filter/effect/colormatrixeffect", [ "filter/effect/effect", "graphic/svg", "core/class", "core/utils", "core/config" ], function(require, exports, module) {
define("filter/effect/colormatrixeffect", [ "filter/effect/effect", "graphic/svg", "core/class", "core/utils", "core/config" ], function(require, exports, module) {
var Effect = require("filter/effect/effect"), Utils = require("core/utils");
var ColorMatrixEffect = require("core/class").createClass("ColorMatrixEffect", {
base: Effect,
......@@ -979,11 +979,11 @@
MATRIX_EMPTY: "00000000000000000000".split("").join(" ")
});
return ColorMatrixEffect;
});
/**
});
/**
* 高斯模糊效果封装
*/
define("filter/effect/compositeeffect", [ "filter/effect/effect", "graphic/svg", "core/class", "core/utils", "core/config" ], function(require, exports, module) {
define("filter/effect/compositeeffect", [ "filter/effect/effect", "graphic/svg", "core/class", "core/utils", "core/config" ], function(require, exports, module) {
var Effect = require("filter/effect/effect"), Utils = require("core/utils");
var CompositeEffect = require("core/class").createClass("CompositeEffect", {
base: Effect,
......@@ -1008,11 +1008,11 @@
OPERATOR_ARITHMETIC: "arithmetic"
});
return CompositeEffect;
});
/**
});
/**
* 像素级别的矩阵卷积运算效果封装
*/
define("filter/effect/convolvematrixeffect", [ "filter/effect/effect", "graphic/svg", "core/class", "core/utils", "core/config" ], function(require, exports, module) {
define("filter/effect/convolvematrixeffect", [ "filter/effect/effect", "graphic/svg", "core/class", "core/utils", "core/config" ], function(require, exports, module) {
var Effect = require("filter/effect/effect"), Utils = require("core/utils");
var ConvolveMatrixEffect = require("core/class").createClass("ConvolveMatrixEffect", {
base: Effect,
......@@ -1028,12 +1028,12 @@
MODE_NONE: "none"
});
return ConvolveMatrixEffect;
});
/*
});
/*
* 效果类
* 该类型的对象不存储任何内部属性, 所有操作都是针对该类对象所维护的节点进行的
*/
define("filter/effect/effect", [ "graphic/svg", "core/class", "core/config", "core/utils" ], function(require, exports, module) {
define("filter/effect/effect", [ "graphic/svg", "core/class", "core/config", "core/utils" ], function(require, exports, module) {
var svg = require("graphic/svg"), Effect = require("core/class").createClass("Effect", {
constructor: function(type) {
this.node = svg.createNode(type);
......@@ -1076,11 +1076,11 @@
INPUT_STROKE_PAINT: "StrokePaint"
});
return Effect;
});
/**
});
/**
* 高斯模糊效果封装
*/
define("filter/effect/gaussianblureffect", [ "filter/effect/effect", "graphic/svg", "core/class", "core/utils", "core/config" ], function(require, exports, module) {
define("filter/effect/gaussianblureffect", [ "filter/effect/effect", "graphic/svg", "core/class", "core/utils", "core/config" ], function(require, exports, module) {
var Effect = require("filter/effect/effect"), Utils = require("core/utils");
return require("core/class").createClass("GaussianblurEffect", {
base: Effect,
......@@ -1090,11 +1090,11 @@
this.set("in", Utils.getValue(input, Effect.INPUT_SOURCE_GRAPHIC));
}
});
});
/**
});
/**
* 偏移效果封装
*/
define("filter/effect/offseteffect", [ "filter/effect/effect", "graphic/svg", "core/class", "core/utils", "core/config" ], function(require, exports, module) {
define("filter/effect/offseteffect", [ "filter/effect/effect", "graphic/svg", "core/class", "core/utils", "core/config" ], function(require, exports, module) {
var Effect = require("filter/effect/effect"), Utils = require("core/utils");
return require("core/class").createClass("OffsetEffect", {
base: Effect,
......@@ -1105,11 +1105,11 @@
this.set("in", Utils.getValue(input, Effect.INPUT_SOURCE_GRAPHIC));
}
});
});
/*
});
/*
* Effect所用的container
*/
define("filter/effectcontainer", [ "core/class", "core/config", "graphic/container" ], function(require, exports, module) {
define("filter/effectcontainer", [ "core/class", "core/config", "graphic/container" ], function(require, exports, module) {
return require("core/class").createClass("EffectContainer", {
base: require("graphic/container"),
addEffect: function(point, pos) {
......@@ -1152,11 +1152,11 @@
this.node.insertBefore(effectItem.getNode(), nextEffectItem.getNode());
}
});
});
/**
});
/**
* Filter 基类
*/
define("filter/filter", [ "graphic/svg", "core/class", "core/config", "filter/effectcontainer", "graphic/container", "graphic/shape", "core/utils", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen" ], function(require, exports, module) {
define("filter/filter", [ "graphic/svg", "core/class", "core/config", "filter/effectcontainer", "graphic/container", "graphic/shape", "core/utils", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen" ], function(require, exports, module) {
var svg = require("graphic/svg");
var Class = require("core/class");
var Filter = Class.createClass("Filter", {
......@@ -1205,11 +1205,11 @@
}
});
return Filter;
});
/*
});
/*
* 高斯模糊滤镜
*/
define("filter/gaussianblurfilter", [ "filter/effect/gaussianblureffect", "filter/effect/effect", "core/utils", "core/class", "core/config", "filter/filter", "graphic/svg", "filter/effectcontainer", "graphic/shape" ], function(require, exports, module) {
define("filter/gaussianblurfilter", [ "filter/effect/gaussianblureffect", "filter/effect/effect", "core/utils", "core/class", "core/config", "filter/filter", "graphic/svg", "filter/effectcontainer", "graphic/shape" ], function(require, exports, module) {
var GaussianblurEffect = require("filter/effect/gaussianblureffect");
return require("core/class").createClass("GaussianblurFilter", {
base: require("filter/filter"),
......@@ -1218,11 +1218,11 @@
this.addEffect(new GaussianblurEffect(stdDeviation));
}
});
});
/*
});
/*
* 投影滤镜
*/
define("filter/projectionfilter", [ "filter/effect/gaussianblureffect", "filter/effect/effect", "core/utils", "core/class", "graphic/svg", "filter/effect/colormatrixeffect", "graphic/color", "graphic/standardcolor", "filter/effect/compositeeffect", "filter/effect/offseteffect", "core/config", "filter/filter", "filter/effectcontainer", "graphic/shape" ], function(require, exports, module) {
define("filter/projectionfilter", [ "filter/effect/gaussianblureffect", "filter/effect/effect", "core/utils", "core/class", "graphic/svg", "filter/effect/colormatrixeffect", "graphic/color", "graphic/standardcolor", "filter/effect/compositeeffect", "filter/effect/offseteffect", "core/config", "filter/filter", "filter/effectcontainer", "graphic/shape" ], function(require, exports, module) {
var GaussianblurEffect = require("filter/effect/gaussianblureffect"), Effect = require("filter/effect/effect"), ColorMatrixEffect = require("filter/effect/colormatrixeffect"), Color = require("graphic/color"), Utils = require("core/utils"), CompositeEffect = require("filter/effect/compositeeffect"), OffsetEffect = require("filter/effect/offseteffect");
return require("core/class").createClass("ProjectionFilter", {
base: require("filter/filter"),
......@@ -1285,11 +1285,11 @@
this.gaussianblurEffect.set("stdDeviation", deviation);
}
});
});
/**
});
/**
* 贝塞尔曲线
*/
define("graphic/bezier", [ "core/class", "core/config", "graphic/pointcontainer", "graphic/container", "graphic/path", "core/utils", "graphic/shape", "graphic/svg" ], function(require, exports, module) {
define("graphic/bezier", [ "core/class", "core/config", "graphic/pointcontainer", "graphic/container", "graphic/path", "core/utils", "graphic/shape", "graphic/svg" ], function(require, exports, module) {
return require("core/class").createClass("Bezier", {
mixins: [ require("graphic/pointcontainer") ],
base: require("graphic/path"),
......@@ -1330,11 +1330,11 @@
return this;
}
});
});
/**
});
/**
* 贝塞尔点
*/
define("graphic/bezierpoint", [ "graphic/shapepoint", "core/class", "graphic/point", "graphic/vector", "core/config" ], function(require, exports, module) {
define("graphic/bezierpoint", [ "graphic/shapepoint", "core/class", "graphic/point", "graphic/vector", "core/config" ], function(require, exports, module) {
var ShapePoint = require("graphic/shapepoint");
var Vector = require("graphic/vector");
var BezierPoint = require("core/class").createClass("BezierPoint", {
......@@ -1430,8 +1430,8 @@
}
});
return BezierPoint;
});
define("graphic/circle", [ "core/class", "core/config", "graphic/ellipse", "core/utils", "graphic/path" ], function(require, exports, module) {
});
define("graphic/circle", [ "core/class", "core/config", "graphic/ellipse", "core/utils", "graphic/path" ], function(require, exports, module) {
return require("core/class").createClass("Circle", {
base: require("graphic/ellipse"),
constructor: function(radius, cx, cy) {
......@@ -1444,8 +1444,8 @@
return this.callBase(radius, radius);
}
});
});
define("graphic/clip", [ "core/class", "core/config", "graphic/shape", "graphic/svg", "core/utils", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen", "graphic/shapecontainer", "graphic/container" ], function(require, exports, module) {
});
define("graphic/clip", [ "core/class", "core/config", "graphic/shape", "graphic/svg", "core/utils", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen", "graphic/shapecontainer", "graphic/container" ], function(require, exports, module) {
var Class = require("core/class");
var Shape = require("graphic/shape");
var Clip = Class.createClass("Clip", {
......@@ -1466,8 +1466,8 @@
}
});
return Clip;
});
define("graphic/color", [ "core/utils", "graphic/standardcolor", "core/class", "core/config" ], function(require, exports, module) {
});
define("graphic/color", [ "core/utils", "graphic/standardcolor", "core/class", "core/config" ], function(require, exports, module) {
var Utils = require("core/utils"), StandardColor = require("graphic/standardcolor"), ColorUtils = {}, Color = require("core/class").createClass("Color", {
constructor: function() {
var colorValue = null;
......@@ -1816,8 +1816,8 @@
}
});
return Color;
});
define("graphic/container", [ "core/class", "core/config" ], function(require, exports, module) {
});
define("graphic/container", [ "core/class", "core/config" ], function(require, exports, module) {
function itemRemove() {
this.container.removeItem(this);
return this;
......@@ -1881,19 +1881,11 @@
if (typeof pos !== "number") {
return this.removeItem(this.indexOf(pos));
}
var items = this.getItems(), length = items.length, item = items[pos], before, after;
var items = this.getItems(), length = items.length, item = items[pos];
if (item === undefined) {
return this;
}
if (pos === 0) {
items.shift();
} else if (pos == length - 1) {
items.pop();
} else {
before = items.slice(0, pos);
after = items.slice(pos + 1);
this.items = before.concat(after);
}
this.items.splice(pos, 1);
if (item.container) {
delete item.container;
}
......@@ -1920,11 +1912,11 @@
handleAdd: function(item, index) {},
handleRemove: function(item, index) {}
});
});
/*
});
/*
* 曲线
* */
define("graphic/curve", [ "core/utils", "core/class", "core/config", "graphic/path", "graphic/shape", "graphic/svg", "graphic/pointcontainer", "graphic/container" ], function(require, exports, module) {
define("graphic/curve", [ "core/utils", "core/class", "core/config", "graphic/path", "graphic/shape", "graphic/svg", "graphic/pointcontainer", "graphic/container" ], function(require, exports, module) {
var Utils = require("core/utils"), CurveUtil = {
/*
* 获取由两个以上的点组成的曲线的平移线
......@@ -2113,8 +2105,8 @@
return !!this.closeState;
}
});
});
define("graphic/data", [ "core/class", "core/config" ], function(require, exports, module) {
});
define("graphic/data", [ "core/class", "core/config" ], function(require, exports, module) {
return require("core/class").createClass("Data", {
constructor: function() {
this._data = {};
......@@ -2131,8 +2123,8 @@
return this;
}
});
});
define("graphic/defbrush", [ "graphic/svg", "core/class", "core/config" ], function(require, exports, module) {
});
define("graphic/defbrush", [ "graphic/svg", "core/class", "core/config" ], function(require, exports, module) {
var svg = require("graphic/svg");
return require("core/class").createClass("GradientBrush", {
constructor: function(nodeType) {
......@@ -2145,8 +2137,8 @@
return this;
}
});
});
define("graphic/ellipse", [ "core/utils", "core/class", "core/config", "graphic/path", "graphic/shape", "graphic/svg" ], function(require, exports, module) {
});
define("graphic/ellipse", [ "core/utils", "core/class", "core/config", "graphic/path", "graphic/shape", "graphic/svg" ], function(require, exports, module) {
var Utils = require("core/utils");
return require("core/class").createClass("Ellipse", {
base: require("graphic/path"),
......@@ -2219,11 +2211,11 @@
return this.update();
}
});
});
/*
});
/*
* kity event 实现
*/
define("graphic/eventhandler", [ "core/utils", "graphic/shapeevent", "graphic/matrix", "core/class", "core/config" ], function(require, exports, module) {
define("graphic/eventhandler", [ "core/utils", "graphic/shapeevent", "graphic/matrix", "core/class", "core/config" ], function(require, exports, module) {
// polyfill
(function() {
function CustomEvent(event, params) {
......@@ -2398,8 +2390,8 @@
return this;
}
});
});
define("graphic/gradientbrush", [ "graphic/svg", "graphic/defbrush", "core/class", "graphic/color", "core/utils", "graphic/standardcolor", "core/config" ], function(require, exports, module) {
});
define("graphic/gradientbrush", [ "graphic/svg", "graphic/defbrush", "core/class", "graphic/color", "core/utils", "graphic/standardcolor", "core/config" ], function(require, exports, module) {
var svg = require("graphic/svg");
var DefBrush = require("graphic/defbrush");
var Color = require("graphic/color");
......@@ -2426,8 +2418,8 @@
return this;
}
});
});
define("graphic/group", [ "graphic/shapecontainer", "graphic/container", "core/utils", "core/class", "graphic/shape", "core/config", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen" ], function(require, exports, module) {
});
define("graphic/group", [ "graphic/shapecontainer", "graphic/container", "core/utils", "core/class", "graphic/shape", "core/config", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen" ], function(require, exports, module) {
var ShapeContainer = require("graphic/shapecontainer");
return require("core/class").createClass("Group", {
mixins: [ ShapeContainer ],
......@@ -2436,8 +2428,8 @@
this.callBase("g");
}
});
});
define("graphic/image", [ "core/class", "core/config", "graphic/shape", "graphic/svg", "core/utils", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen" ], function(require, exports, module) {
});
define("graphic/image", [ "core/class", "core/config", "graphic/shape", "graphic/svg", "core/utils", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen" ], function(require, exports, module) {
return require("core/class").createClass("Image", {
base: require("graphic/shape"),
constructor: function(url, width, height, x, y) {
......@@ -2493,8 +2485,8 @@
return this.y;
}
});
});
define("graphic/line", [ "core/class", "core/config", "graphic/path", "core/utils", "graphic/shape", "graphic/svg" ], function(require, exports, module) {
});
define("graphic/line", [ "core/class", "core/config", "graphic/path", "core/utils", "graphic/shape", "graphic/svg" ], function(require, exports, module) {
return require("core/class").createClass("Line", {
base: require("graphic/path"),
constructor: function(x1, y1, x2, y2) {
......@@ -2539,8 +2531,8 @@
return this;
}
});
});
define("graphic/lineargradientbrush", [ "graphic/svg", "graphic/gradientbrush", "graphic/defbrush", "graphic/color", "core/class", "core/config" ], function(require, exports, module) {
});
define("graphic/lineargradientbrush", [ "graphic/svg", "graphic/gradientbrush", "graphic/defbrush", "graphic/color", "core/class", "core/config" ], function(require, exports, module) {
var className = "LinearGradientBrush";
var svg = require("graphic/svg");
var GradientBrush = require("graphic/gradientbrush");
......@@ -2577,11 +2569,11 @@
};
}
});
});
/**
});
/**
* 蒙板
*/
define("graphic/mask", [ "core/class", "core/config", "graphic/shape", "graphic/svg", "core/utils", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen", "graphic/shapecontainer", "graphic/container" ], function(require, exports, module) {
define("graphic/mask", [ "core/class", "core/config", "graphic/shape", "graphic/svg", "core/utils", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen", "graphic/shapecontainer", "graphic/container" ], function(require, exports, module) {
var Class = require("core/class");
var Shape = require("graphic/shape");
var Mask = Class.createClass("Mask", {
......@@ -2602,8 +2594,8 @@
}
});
return Mask;
});
define("graphic/matrix", [ "core/utils", "graphic/vector", "core/class", "core/config" ], function(require, exports, module) {
});
define("graphic/matrix", [ "core/utils", "graphic/vector", "core/class", "core/config" ], function(require, exports, module) {
var utils = require("core/utils");
var mPattern = /matrix\((.+)\)/i;
var Vector = require("graphic/vector");
......@@ -2731,11 +2723,11 @@
return new Vector(m.a * x + m.c * y + m.e, m.b * x + m.d * y + m.f);
};
return Matrix;
});
/**
});
/**
* 调色板
*/
define("graphic/palette", [ "graphic/standardcolor", "graphic/color", "core/utils", "core/class", "core/config" ], function(require, exports, module) {
define("graphic/palette", [ "graphic/standardcolor", "graphic/color", "core/utils", "core/class", "core/config" ], function(require, exports, module) {
//标准color
var StandardColor = require("graphic/standardcolor"), Color = require("graphic/color"), Utils = require("core/utils");
var Palette = require("core/class").createClass("Palette", {
......@@ -2834,8 +2826,8 @@
}
});
return Palette;
});
define("graphic/paper", [ "core/class", "core/config", "core/utils", "graphic/svg", "graphic/container", "graphic/shapecontainer", "graphic/shape", "graphic/viewbox", "graphic/eventhandler", "graphic/shapeevent", "graphic/styled", "graphic/matrix", "graphic/vector", "graphic/data", "graphic/pen" ], function(require, exports, module) {
});
define("graphic/paper", [ "core/class", "core/config", "core/utils", "graphic/svg", "graphic/container", "graphic/shapecontainer", "graphic/shape", "graphic/viewbox", "graphic/eventhandler", "graphic/shapeevent", "graphic/styled", "graphic/matrix", "graphic/vector", "graphic/data", "graphic/pen" ], function(require, exports, module) {
var Class = require("core/class");
var utils = require("core/utils");
var svg = require("graphic/svg");
......@@ -2963,8 +2955,8 @@
}
});
return Paper;
});
define("graphic/path", [ "core/utils", "core/class", "core/config", "graphic/shape", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen" ], function(require, exports, module) {
});
define("graphic/path", [ "core/utils", "core/class", "core/config", "graphic/shape", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen" ], function(require, exports, module) {
var Utils = require("core/utils");
var createClass = require("core/class").createClass;
var Shape = require("graphic/shape");
......@@ -3071,8 +3063,8 @@
return !!~data.indexOf("z") || !!~data.indexOf("Z");
}
});
});
define("graphic/patternbrush", [ "graphic/defbrush", "graphic/svg", "core/class", "graphic/shapecontainer", "graphic/container", "core/utils", "graphic/shape", "core/config" ], function(require, exports, module) {
});
define("graphic/patternbrush", [ "graphic/defbrush", "graphic/svg", "core/class", "graphic/shapecontainer", "graphic/container", "core/utils", "graphic/shape", "core/config" ], function(require, exports, module) {
var DefBrush = require("graphic/defbrush");
var ShapeContainer = require("graphic/shapecontainer");
var svg = require("graphic/svg");
......@@ -3110,8 +3102,8 @@
return this.height;
}
});
});
define("graphic/pen", [ "graphic/color", "core/utils", "graphic/standardcolor", "core/class", "core/config" ], function(require, exports, module) {
});
define("graphic/pen", [ "graphic/color", "core/utils", "graphic/standardcolor", "core/class", "core/config" ], function(require, exports, module) {
var Color = require("graphic/color");
return require("core/class").createClass("Pen", {
constructor: function(color, width) {
......@@ -3185,11 +3177,11 @@
}
}
});
});
/*
});
/*
* 点对象抽象
*/
define("graphic/point", [ "core/class", "core/config" ], function(require, exports, module) {
define("graphic/point", [ "core/class", "core/config" ], function(require, exports, module) {
return require("core/class").createClass("Point", {
constructor: function(x, y) {
this.px = x || 0;
......@@ -3221,11 +3213,11 @@
return this.py;
}
});
});
/**
});
/**
* 点集合容器
*/
define("graphic/pointcontainer", [ "core/class", "core/config", "graphic/container" ], function(require, exports, module) {
define("graphic/pointcontainer", [ "core/class", "core/config", "graphic/container" ], function(require, exports, module) {
return require("core/class").createClass("PointContainer", {
base: require("graphic/container"),
constructor: function() {
......@@ -3262,11 +3254,11 @@
return this.getLastItem.apply(this, arguments);
}
});
});
/*
});
/*
* 通过点来决定图形的公共父类
*/
define("graphic/poly", [ "core/utils", "core/class", "core/config", "graphic/path", "graphic/shape", "graphic/svg", "graphic/pointcontainer", "graphic/container" ], function(require, exports, module) {
define("graphic/poly", [ "core/utils", "core/class", "core/config", "graphic/path", "graphic/shape", "graphic/svg", "graphic/pointcontainer", "graphic/container" ], function(require, exports, module) {
var Utils = require("core/utils");
return require("core/class").createClass("Poly", {
base: require("graphic/path"),
......@@ -3302,24 +3294,24 @@
return this;
}
});
});
define("graphic/polygon", [ "core/class", "core/config", "graphic/poly", "core/utils", "graphic/path", "graphic/pointcontainer" ], function(require, exports, module) {
});
define("graphic/polygon", [ "core/class", "core/config", "graphic/poly", "core/utils", "graphic/path", "graphic/pointcontainer" ], function(require, exports, module) {
return require("core/class").createClass("Polygon", {
base: require("graphic/poly"),
constructor: function(points) {
this.callBase(points, true);
}
});
});
define("graphic/polyline", [ "core/class", "core/config", "graphic/poly", "core/utils", "graphic/path", "graphic/pointcontainer" ], function(require, exports, module) {
});
define("graphic/polyline", [ "core/class", "core/config", "graphic/poly", "core/utils", "graphic/path", "graphic/pointcontainer" ], function(require, exports, module) {
return require("core/class").createClass("Polyline", {
base: require("graphic/poly"),
constructor: function(points) {
this.callBase(points);
}
});
});
define("graphic/radialgradientbrush", [ "graphic/gradientbrush", "graphic/svg", "graphic/defbrush", "graphic/color", "core/class", "core/config" ], function(require, exports, module) {
});
define("graphic/radialgradientbrush", [ "graphic/gradientbrush", "graphic/svg", "graphic/defbrush", "graphic/color", "core/class", "core/config" ], function(require, exports, module) {
var GradientBrush = require("graphic/gradientbrush");
return require("core/class").createClass("RadialGradientBrush", {
base: GradientBrush,
......@@ -3362,8 +3354,8 @@
return +this.node.getAttribute("r");
}
});
});
define("graphic/rect", [ "core/utils", "core/class", "core/config", "graphic/path", "graphic/shape", "graphic/svg" ], function(require, exports, module) {
});
define("graphic/rect", [ "core/utils", "core/class", "core/config", "graphic/path", "graphic/shape", "graphic/svg" ], function(require, exports, module) {
var RectUtils = {}, Utils = require("core/utils");
Utils.extend(RectUtils, {
//根据传递进来的width、height和radius属性,
......@@ -3453,8 +3445,8 @@
return this.update();
}
});
});
define("graphic/shape", [ "graphic/svg", "core/utils", "graphic/eventhandler", "graphic/shapeevent", "core/class", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/vector", "graphic/pen", "graphic/color", "core/config" ], function(require, exports, module) {
});
define("graphic/shape", [ "graphic/svg", "core/utils", "graphic/eventhandler", "graphic/shapeevent", "core/class", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/vector", "graphic/pen", "graphic/color", "core/config" ], function(require, exports, module) {
var svg = require("graphic/svg");
var utils = require("core/utils");
var EventHandler = require("graphic/eventhandler");
......@@ -3638,25 +3630,25 @@
}
return this;
},
setAttr:function(a,v){
setAttr: function(a, v) {
var me = this;
if(utils.isObject(a)){
utils.each(a,function(val,key){
me.setAttr(key,val)
})
if (utils.isObject(a)) {
utils.each(a, function(val, key) {
me.setAttr(key, val);
});
}
if(v === undefined || v === null || v === ''){
if (v === undefined || v === null || v === "") {
this.node.removeAttribute(a);
}else {
this.node.setAttribute(a,v);
} else {
this.node.setAttribute(a, v);
}
},
getAttr:function(a){
return this.node.getAttribute(a)
getAttr: function(a) {
return this.node.getAttribute(a);
}
});
});
define("graphic/shapecontainer", [ "graphic/container", "core/class", "core/utils", "core/config", "graphic/shape", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen" ], function(require, exports, module) {
});
define("graphic/shapecontainer", [ "graphic/container", "core/class", "core/utils", "core/config", "graphic/shape", "graphic/svg", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen" ], function(require, exports, module) {
var Container = require("graphic/container");
var utils = require("core/utils");
var ShapeContainer = require("core/class").createClass("ShapeContainer", {
......@@ -3739,13 +3731,13 @@
},
getShapesByType: function(name) {
var shapes = [];
function getShapes(shape){
if(name.toLowerCase() == shape.getType().toLowerCase()){
shapes.push(shape)
function getShapes(shape) {
if (name.toLowerCase() == shape.getType().toLowerCase()) {
shapes.push(shape);
}
if(shape.isShapeContainer){
utils.each(shape.getShapes(),function(n){
getShapes(n)
if (shape.isShapeContainer) {
utils.each(shape.getShapes(), function(n) {
getShapes(n);
});
}
}
......@@ -3800,11 +3792,11 @@
}
});
return ShapeContainer;
});
/*
});
/*
* 图形事件包装类
* */
define("graphic/shapeevent", [ "graphic/matrix", "core/utils", "graphic/vector", "core/class", "core/config" ], function(require, exprots, module) {
define("graphic/shapeevent", [ "graphic/matrix", "core/utils", "graphic/vector", "core/class", "core/config" ], function(require, exprots, module) {
var Matrix = require("graphic/matrix"), Utils = require("core/utils");
return require("core/class").createClass("ShapeEvent", {
constructor: function(event) {
......@@ -3865,11 +3857,11 @@
}
}
});
});
/*
});
/*
* 图形上的点抽象
*/
define("graphic/shapepoint", [ "core/class", "core/config", "graphic/point" ], function(require, exports, module) {
define("graphic/shapepoint", [ "core/class", "core/config", "graphic/point" ], function(require, exports, module) {
return require("core/class").createClass("ShapePoint", {
base: require("graphic/point"),
constructor: function(px, py) {
......@@ -3897,11 +3889,11 @@
return this;
}
});
});
/**
});
/**
* 标准颜色映射
*/
define("graphic/standardcolor", [], {
define("graphic/standardcolor", [], {
COLOR_STANDARD: {
aliceblue: "#f0f8ff",
antiquewhite: "#faebd7",
......@@ -4052,8 +4044,8 @@
},
//标准扩展
EXTEND_STANDARD: {}
});
define("graphic/styled", [ "core/class", "core/config" ], function(require, exports, module) {
});
define("graphic/styled", [ "core/class", "core/config" ], function(require, exports, module) {
return require("core/class").createClass("Styled", {
addClass: function(name) {
this.node.classList.add(name);
......@@ -4079,8 +4071,8 @@
return this;
}
});
});
define("graphic/svg", [], function(require, exports, module) {
});
define("graphic/svg", [], function(require, exports, module) {
var doc = document;
var id = 0;
var svg = {
......@@ -4097,8 +4089,8 @@
ns: "http://www.w3.org/2000/svg"
};
return svg;
});
define("graphic/text", [ "graphic/textcontent", "graphic/shape", "core/class", "graphic/shapecontainer", "graphic/container", "core/utils", "graphic/svg", "core/config" ], function(require, exports, module) {
});
define("graphic/text", [ "graphic/textcontent", "graphic/shape", "core/class", "graphic/shapecontainer", "graphic/container", "core/utils", "graphic/svg", "core/config" ], function(require, exports, module) {
var TextContent = require("graphic/textcontent");
var ShapeContainer = require("graphic/shapecontainer");
var svg = require("graphic/svg");
......@@ -4165,8 +4157,8 @@
return this;
}
});
});
define("graphic/textcontent", [ "graphic/shape", "graphic/svg", "core/utils", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen", "core/class", "core/config" ], function(require, exports, module) {
});
define("graphic/textcontent", [ "graphic/shape", "graphic/svg", "core/utils", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen", "core/class", "core/config" ], function(require, exports, module) {
var Shape = require("graphic/shape");
return require("core/class").createClass("TextContent", {
base: Shape,
......@@ -4210,8 +4202,8 @@
return this.node.getCharNumAtPosition(this.node.viewportElement.createSVGPoint(x, y));
}
});
});
define("graphic/textspan", [ "graphic/textcontent", "graphic/shape", "core/class", "graphic/styled", "core/config" ], function(require, exports, module) {
});
define("graphic/textspan", [ "graphic/textcontent", "graphic/shape", "core/class", "graphic/styled", "core/config" ], function(require, exports, module) {
var TextContent = require("graphic/textcontent");
var Styled = require("graphic/styled");
return require("core/class").createClass("TextSpan", {
......@@ -4222,11 +4214,11 @@
this.setContent(content);
}
});
});
/*
});
/*
* USE 功能
*/
define("graphic/use", [ "graphic/svg", "core/class", "core/config", "graphic/shape", "core/utils", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen" ], function(require, exports, module) {
define("graphic/use", [ "graphic/svg", "core/class", "core/config", "graphic/shape", "core/utils", "graphic/eventhandler", "graphic/styled", "graphic/data", "graphic/matrix", "graphic/pen" ], function(require, exports, module) {
var Svg = require("graphic/svg");
var Class = require("core/class");
var Use = Class.createClass("Use", {
......@@ -4256,8 +4248,8 @@
}
});
return Use;
});
define("graphic/vector", [ "core/class", "core/config" ], function(require, exports, module) {
});
define("graphic/vector", [ "core/class", "core/config" ], function(require, exports, module) {
var Vector = require("core/class").createClass("Vector", {
constructor: function(x, y) {
this.x = x || 0;
......@@ -4314,8 +4306,8 @@
return new Vector(d * Math.cos(a), d * Math.sin(a));
};
return Vector;
});
define("graphic/view", [ "graphic/shapecontainer", "graphic/container", "core/utils", "core/class", "graphic/shape", "graphic/viewbox", "core/config", "graphic/view" ], function(require, exports, module) {
});
define("graphic/view", [ "graphic/shapecontainer", "graphic/container", "core/utils", "core/class", "graphic/shape", "graphic/viewbox", "core/config", "graphic/view" ], function(require, exports, module) {
var ShapeContainer = require("graphic/shapecontainer");
var ViewBox = require("graphic/viewbox");
return require("core/class").createClass("View", {
......@@ -4325,8 +4317,8 @@
this.callBase("view");
}
});
});
define("graphic/viewbox", [ "core/class", "core/config" ], function(require, exports, module) {
});
define("graphic/viewbox", [ "core/class", "core/config" ], function(require, exports, module) {
return require("core/class").createClass("ViewBox", {
getViewBox: function() {
var attr = this.node.getAttribute("viewBox");
......@@ -4352,13 +4344,13 @@
return this;
}
});
});
});
/**
/**
* 模块暴露
*/
( function ( global ) {
( function ( global ) {
define( 'kity.start', function ( require ) {
......@@ -4433,5 +4425,5 @@
} catch ( e ) {
}
} )( this );
} )( this );
})();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment