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kI,EAAWokB,EACfnkB,EAAOhI,QAAU+H,C","sources":["webpack://i4proportal/./node_modules/zrender/lib/core/vector.js","webpack://i4proportal/./node_modules/zrender/lib/dom/HandlerProxy.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/CompoundPath.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/Displayable.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/Gradient.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/Image.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/IncrementalDisplayable.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/LinearGradient.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/Path.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/Pattern.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/RadialGradient.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/Style.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/Text.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/constant.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/helper/fixShadow.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/helper/image.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/helper/poly.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/helper/roundRect.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/helper/smoothBezier.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/helper/smoothSpline.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/helper/text.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/mixin/RectText.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/shape/Arc.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/shape/BezierCurve.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/shape/Circle.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/shape/Ellipse.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/shape/Line.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/shape/Polygon.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/shape/Polyline.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/shape/Rect.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/shape/Ring.js","webpack://i4proportal/./node_modules/zrender/lib/graphic/shape/Sector.js","webpack://i4proportal/./node_modules/zrender/lib/mixin/Animatable.js","webpack://i4proportal/./node_modules/zrender/lib/mixin/Draggable.js","webpack://i4proportal/./node_modules/zrender/lib/mixin/Eventful.js","webpack://i4proportal/./node_modules/zrender/lib/mixin/Transformable.js"],"sourcesContent":["/* global Float32Array */\nvar ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;\n/**\n * 创建一个向量\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @return {Vector2}\n */\n\nfunction create(x, y) {\n var out = new ArrayCtor(2);\n\n if (x == null) {\n x = 0;\n }\n\n if (y == null) {\n y = 0;\n }\n\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * 复制向量数据\n * @param {Vector2} out\n * @param {Vector2} v\n * @return {Vector2}\n */\n\n\nfunction copy(out, v) {\n out[0] = v[0];\n out[1] = v[1];\n return out;\n}\n/**\n * 克隆一个向量\n * @param {Vector2} v\n * @return {Vector2}\n */\n\n\nfunction clone(v) {\n var out = new ArrayCtor(2);\n out[0] = v[0];\n out[1] = v[1];\n return out;\n}\n/**\n * 设置向量的两个项\n * @param {Vector2} out\n * @param {number} a\n * @param {number} b\n * @return {Vector2} 结果\n */\n\n\nfunction set(out, a, b) {\n out[0] = a;\n out[1] = b;\n return out;\n}\n/**\n * 向量相加\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction add(out, v1, v2) {\n out[0] = v1[0] + v2[0];\n out[1] = v1[1] + v2[1];\n return out;\n}\n/**\n * 向量缩放后相加\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @param {number} a\n */\n\n\nfunction scaleAndAdd(out, v1, v2, a) {\n out[0] = v1[0] + v2[0] * a;\n out[1] = v1[1] + v2[1] * a;\n return out;\n}\n/**\n * 向量相减\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction sub(out, v1, v2) {\n out[0] = v1[0] - v2[0];\n out[1] = v1[1] - v2[1];\n return out;\n}\n/**\n * 向量长度\n * @param {Vector2} v\n * @return {number}\n */\n\n\nfunction len(v) {\n return Math.sqrt(lenSquare(v));\n}\n\nvar length = len; // jshint ignore:line\n\n/**\n * 向量长度平方\n * @param {Vector2} v\n * @return {number}\n */\n\nfunction lenSquare(v) {\n return v[0] * v[0] + v[1] * v[1];\n}\n\nvar lengthSquare = lenSquare;\n/**\n * 向量乘法\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\nfunction mul(out, v1, v2) {\n out[0] = v1[0] * v2[0];\n out[1] = v1[1] * v2[1];\n return out;\n}\n/**\n * 向量除法\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction div(out, v1, v2) {\n out[0] = v1[0] / v2[0];\n out[1] = v1[1] / v2[1];\n return out;\n}\n/**\n * 向量点乘\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @return {number}\n */\n\n\nfunction dot(v1, v2) {\n return v1[0] * v2[0] + v1[1] * v2[1];\n}\n/**\n * 向量缩放\n * @param {Vector2} out\n * @param {Vector2} v\n * @param {number} s\n */\n\n\nfunction scale(out, v, s) {\n out[0] = v[0] * s;\n out[1] = v[1] * s;\n return out;\n}\n/**\n * 向量归一化\n * @param {Vector2} out\n * @param {Vector2} v\n */\n\n\nfunction normalize(out, v) {\n var d = len(v);\n\n if (d === 0) {\n out[0] = 0;\n out[1] = 0;\n } else {\n out[0] = v[0] / d;\n out[1] = v[1] / d;\n }\n\n return out;\n}\n/**\n * 计算向量间距离\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @return {number}\n */\n\n\nfunction distance(v1, v2) {\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]));\n}\n\nvar dist = distance;\n/**\n * 向量距离平方\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @return {number}\n */\n\nfunction distanceSquare(v1, v2) {\n return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);\n}\n\nvar distSquare = distanceSquare;\n/**\n * 求负向量\n * @param {Vector2} out\n * @param {Vector2} v\n */\n\nfunction negate(out, v) {\n out[0] = -v[0];\n out[1] = -v[1];\n return out;\n}\n/**\n * 插值两个点\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @param {number} t\n */\n\n\nfunction lerp(out, v1, v2, t) {\n out[0] = v1[0] + t * (v2[0] - v1[0]);\n out[1] = v1[1] + t * (v2[1] - v1[1]);\n return out;\n}\n/**\n * 矩阵左乘向量\n * @param {Vector2} out\n * @param {Vector2} v\n * @param {Vector2} m\n */\n\n\nfunction applyTransform(out, v, m) {\n var x = v[0];\n var y = v[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\n * 求两个向量最小值\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction min(out, v1, v2) {\n out[0] = Math.min(v1[0], v2[0]);\n out[1] = Math.min(v1[1], v2[1]);\n return out;\n}\n/**\n * 求两个向量最大值\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction max(out, v1, v2) {\n out[0] = Math.max(v1[0], v2[0]);\n out[1] = Math.max(v1[1], v2[1]);\n return out;\n}\n\nexports.create = create;\nexports.copy = copy;\nexports.clone = clone;\nexports.set = set;\nexports.add = add;\nexports.scaleAndAdd = scaleAndAdd;\nexports.sub = sub;\nexports.len = len;\nexports.length = length;\nexports.lenSquare = lenSquare;\nexports.lengthSquare = lengthSquare;\nexports.mul = mul;\nexports.div = div;\nexports.dot = dot;\nexports.scale = scale;\nexports.normalize = normalize;\nexports.distance = distance;\nexports.dist = dist;\nexports.distanceSquare = distanceSquare;\nexports.distSquare = distSquare;\nexports.negate = negate;\nexports.lerp = lerp;\nexports.applyTransform = applyTransform;\nexports.min = min;\nexports.max = max;","var _event = require(\"../core/event\");\n\nvar addEventListener = _event.addEventListener;\nvar removeEventListener = _event.removeEventListener;\nvar normalizeEvent = _event.normalizeEvent;\nvar getNativeEvent = _event.getNativeEvent;\n\nvar zrUtil = require(\"../core/util\");\n\nvar Eventful = require(\"../mixin/Eventful\");\n\nvar env = require(\"../core/env\");\n\n/* global document */\nvar TOUCH_CLICK_DELAY = 300;\nvar globalEventSupported = env.domSupported;\n\nvar localNativeListenerNames = function () {\n var mouseHandlerNames = ['click', 'dblclick', 'mousewheel', 'mouseout', 'mouseup', 'mousedown', 'mousemove', 'contextmenu'];\n var touchHandlerNames = ['touchstart', 'touchend', 'touchmove'];\n var pointerEventNameMap = {\n pointerdown: 1,\n pointerup: 1,\n pointermove: 1,\n pointerout: 1\n };\n var pointerHandlerNames = zrUtil.map(mouseHandlerNames, function (name) {\n var nm = name.replace('mouse', 'pointer');\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\n });\n return {\n mouse: mouseHandlerNames,\n touch: touchHandlerNames,\n pointer: pointerHandlerNames\n };\n}();\n\nvar globalNativeListenerNames = {\n mouse: ['mousemove', 'mouseup'],\n pointer: ['pointermove', 'pointerup']\n};\n\nfunction eventNameFix(name) {\n return name === 'mousewheel' && env.browser.firefox ? 'DOMMouseScroll' : name;\n}\n\nfunction isPointerFromTouch(event) {\n var pointerType = event.pointerType;\n return pointerType === 'pen' || pointerType === 'touch';\n} // function useMSGuesture(handlerProxy, event) {\n// return isPointerFromTouch(event) && !!handlerProxy._msGesture;\n// }\n// function onMSGestureChange(proxy, event) {\n// if (event.translationX || event.translationY) {\n// // mousemove is carried by MSGesture to reduce the sensitivity.\n// proxy.handler.dispatchToElement(event.target, 'mousemove', event);\n// }\n// if (event.scale !== 1) {\n// event.pinchX = event.offsetX;\n// event.pinchY = event.offsetY;\n// event.pinchScale = event.scale;\n// proxy.handler.dispatchToElement(event.target, 'pinch', event);\n// }\n// }\n\n/**\n * Prevent mouse event from being dispatched after Touch Events action\n * @see \n * 1. Mobile browsers dispatch mouse events 300ms after touchend.\n * 2. Chrome for Android dispatch mousedown for long-touch about 650ms\n * Result: Blocking Mouse Events for 700ms.\n *\n * @param {DOMHandlerScope} scope\n */\n\n\nfunction setTouchTimer(scope) {\n scope.touching = true;\n\n if (scope.touchTimer != null) {\n clearTimeout(scope.touchTimer);\n scope.touchTimer = null;\n }\n\n scope.touchTimer = setTimeout(function () {\n scope.touching = false;\n scope.touchTimer = null;\n }, 700);\n} // Mark touch, which is useful in distinguish touch and\n// mouse event in upper applicatoin.\n\n\nfunction markTouch(event) {\n event && (event.zrByTouch = true);\n} // function markTriggeredFromLocal(event) {\n// event && (event.__zrIsFromLocal = true);\n// }\n// function isTriggeredFromLocal(instance, event) {\n// return !!(event && event.__zrIsFromLocal);\n// }\n\n\nfunction normalizeGlobalEvent(instance, event) {\n // offsetX, offsetY still need to be calculated. They are necessary in the event\n // handlers of the upper applications. Set `true` to force calculate them.\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\n}\n/**\n * Detect whether the given el is in `painterRoot`.\n */\n\n\nfunction isLocalEl(instance, el) {\n var elTmp = el;\n var isLocal = false;\n\n while (elTmp && elTmp.nodeType !== 9 && !(isLocal = elTmp.domBelongToZr || elTmp !== el && elTmp === instance.painterRoot)) {\n elTmp = elTmp.parentNode;\n }\n\n return isLocal;\n}\n/**\n * Make a fake event but not change the original event,\n * becuase the global event probably be used by other\n * listeners not belonging to zrender.\n * @class\n */\n\n\nfunction FakeGlobalEvent(instance, event) {\n this.type = event.type;\n this.target = this.currentTarget = instance.dom;\n this.pointerType = event.pointerType; // Necessray for the force calculation of zrX, zrY\n\n this.clientX = event.clientX;\n this.clientY = event.clientY; // Because we do not mount global listeners to touch events,\n // we do not copy `targetTouches` and `changedTouches` here.\n}\n\nvar fakeGlobalEventProto = FakeGlobalEvent.prototype; // we make the default methods on the event do nothing,\n// otherwise it is dangerous. See more details in\n// [Drag outside] in `Handler.js`.\n\nfakeGlobalEventProto.stopPropagation = fakeGlobalEventProto.stopImmediatePropagation = fakeGlobalEventProto.preventDefault = zrUtil.noop;\n/**\n * Local DOM Handlers\n * @this {HandlerProxy}\n */\n\nvar localDOMHandlers = {\n mousedown: function (event) {\n event = normalizeEvent(this.dom, event);\n this._mayPointerCapture = [event.zrX, event.zrY];\n this.trigger('mousedown', event);\n },\n mousemove: function (event) {\n event = normalizeEvent(this.dom, event);\n var downPoint = this._mayPointerCapture;\n\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\n togglePointerCapture(this, true);\n }\n\n this.trigger('mousemove', event);\n },\n mouseup: function (event) {\n event = normalizeEvent(this.dom, event);\n togglePointerCapture(this, false);\n this.trigger('mouseup', event);\n },\n mouseout: function (event) {\n event = normalizeEvent(this.dom, event); // Similarly to the browser did on `document` and touch event,\n // `globalout` will be delayed to final pointer cature release.\n\n if (this._pointerCapturing) {\n event.zrEventControl = 'no_globalout';\n } // There might be some doms created by upper layer application\n // at the same level of painter.getViewportRoot() (e.g., tooltip\n // dom created by echarts), where 'globalout' event should not\n // be triggered when mouse enters these doms. (But 'mouseout'\n // should be triggered at the original hovered element as usual).\n\n\n var element = event.toElement || event.relatedTarget;\n event.zrIsToLocalDOM = isLocalEl(this, element);\n this.trigger('mouseout', event);\n },\n touchstart: function (event) {\n // Default mouse behaviour should not be disabled here.\n // For example, page may needs to be slided.\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this._lastTouchMoment = new Date();\n this.handler.processGesture(event, 'start'); // For consistent event listener for both touch device and mouse device,\n // we simulate \"mouseover-->mousedown\" in touch device. So we trigger\n // `mousemove` here (to trigger `mouseover` inside), and then trigger\n // `mousedown`.\n\n localDOMHandlers.mousemove.call(this, event);\n localDOMHandlers.mousedown.call(this, event);\n },\n touchmove: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.handler.processGesture(event, 'change'); // Mouse move should always be triggered no matter whether\n // there is gestrue event, because mouse move and pinch may\n // be used at the same time.\n\n localDOMHandlers.mousemove.call(this, event);\n },\n touchend: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.handler.processGesture(event, 'end');\n localDOMHandlers.mouseup.call(this, event); // Do not trigger `mouseout` here, in spite of `mousemove`(`mouseover`) is\n // triggered in `touchstart`. This seems to be illogical, but by this mechanism,\n // we can conveniently implement \"hover style\" in both PC and touch device just\n // by listening to `mouseover` to add \"hover style\" and listening to `mouseout`\n // to remove \"hover style\" on an element, without any additional code for\n // compatibility. (`mouseout` will not be triggered in `touchend`, so \"hover\n // style\" will remain for user view)\n // click event should always be triggered no matter whether\n // there is gestrue event. System click can not be prevented.\n\n if (+new Date() - this._lastTouchMoment < TOUCH_CLICK_DELAY) {\n localDOMHandlers.click.call(this, event);\n }\n },\n pointerdown: function (event) {\n localDOMHandlers.mousedown.call(this, event); // if (useMSGuesture(this, event)) {\n // this._msGesture.addPointer(event.pointerId);\n // }\n },\n pointermove: function (event) {\n // FIXME\n // pointermove is so sensitive that it always triggered when\n // tap(click) on touch screen, which affect some judgement in\n // upper application. So, we dont support mousemove on MS touch\n // device yet.\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mousemove.call(this, event);\n }\n },\n pointerup: function (event) {\n localDOMHandlers.mouseup.call(this, event);\n },\n pointerout: function (event) {\n // pointerout will be triggered when tap on touch screen\n // (IE11+/Edge on MS Surface) after click event triggered,\n // which is inconsistent with the mousout behavior we defined\n // in touchend. So we unify them.\n // (check localDOMHandlers.touchend for detailed explanation)\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mouseout.call(this, event);\n }\n }\n};\n/**\n * Othere DOM UI Event handlers for zr dom.\n * @this {HandlerProxy}\n */\n\nzrUtil.each(['click', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\n localDOMHandlers[name] = function (event) {\n event = normalizeEvent(this.dom, event);\n this.trigger(name, event);\n };\n});\n/**\n * DOM UI Event handlers for global page.\n *\n * [Caution]:\n * those handlers should both support in capture phase and bubble phase!\n *\n * @this {HandlerProxy}\n */\n\nvar globalDOMHandlers = {\n pointermove: function (event) {\n // FIXME\n // pointermove is so sensitive that it always triggered when\n // tap(click) on touch screen, which affect some judgement in\n // upper application. So, we dont support mousemove on MS touch\n // device yet.\n if (!isPointerFromTouch(event)) {\n globalDOMHandlers.mousemove.call(this, event);\n }\n },\n pointerup: function (event) {\n globalDOMHandlers.mouseup.call(this, event);\n },\n mousemove: function (event) {\n this.trigger('mousemove', event);\n },\n mouseup: function (event) {\n var pointerCaptureReleasing = this._pointerCapturing;\n togglePointerCapture(this, false);\n this.trigger('mouseup', event);\n\n if (pointerCaptureReleasing) {\n event.zrEventControl = 'only_globalout';\n this.trigger('mouseout', event);\n }\n }\n};\n/**\n * @param {HandlerProxy} instance\n * @param {DOMHandlerScope} scope\n */\n\nfunction mountLocalDOMEventListeners(instance, scope) {\n var domHandlers = scope.domHandlers;\n\n if (env.pointerEventsSupported) {\n // Only IE11+/Edge\n // 1. On devices that both enable touch and mouse (e.g., MS Surface and lenovo X240),\n // IE11+/Edge do not trigger touch event, but trigger pointer event and mouse event\n // at the same time.\n // 2. On MS Surface, it probablely only trigger mousedown but no mouseup when tap on\n // screen, which do not occurs in pointer event.\n // So we use pointer event to both detect touch gesture and mouse behavior.\n zrUtil.each(localNativeListenerNames.pointer, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n // markTriggeredFromLocal(event);\n domHandlers[nativeEventName].call(instance, event);\n });\n }); // FIXME\n // Note: MS Gesture require CSS touch-action set. But touch-action is not reliable,\n // which does not prevent defuault behavior occasionally (which may cause view port\n // zoomed in but use can not zoom it back). And event.preventDefault() does not work.\n // So we have to not to use MSGesture and not to support touchmove and pinch on MS\n // touch screen. And we only support click behavior on MS touch screen now.\n // MS Gesture Event is only supported on IE11+/Edge and on Windows 8+.\n // We dont support touch on IE on win7.\n // See \n // if (typeof MSGesture === 'function') {\n // (this._msGesture = new MSGesture()).target = dom; // jshint ignore:line\n // dom.addEventListener('MSGestureChange', onMSGestureChange);\n // }\n } else {\n if (env.touchEventsSupported) {\n zrUtil.each(localNativeListenerNames.touch, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n // markTriggeredFromLocal(event);\n domHandlers[nativeEventName].call(instance, event);\n setTouchTimer(scope);\n });\n }); // Handler of 'mouseout' event is needed in touch mode, which will be mounted below.\n // addEventListener(root, 'mouseout', this._mouseoutHandler);\n } // 1. Considering some devices that both enable touch and mouse event (like on MS Surface\n // and lenovo X240, @see #2350), we make mouse event be always listened, otherwise\n // mouse event can not be handle in those devices.\n // 2. On MS Surface, Chrome will trigger both touch event and mouse event. How to prevent\n // mouseevent after touch event triggered, see `setTouchTimer`.\n\n\n zrUtil.each(localNativeListenerNames.mouse, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n event = getNativeEvent(event);\n\n if (!scope.touching) {\n // markTriggeredFromLocal(event);\n domHandlers[nativeEventName].call(instance, event);\n }\n });\n });\n }\n}\n/**\n * @param {HandlerProxy} instance\n * @param {DOMHandlerScope} scope\n */\n\n\nfunction mountGlobalDOMEventListeners(instance, scope) {\n // Only IE11+/Edge. See the comment in `mountLocalDOMEventListeners`.\n if (env.pointerEventsSupported) {\n zrUtil.each(globalNativeListenerNames.pointer, mount);\n } // Touch event has implemented \"drag outside\" so we do not mount global listener for touch event.\n // (see https://www.w3.org/TR/touch-events/#the-touchmove-event)\n // We do not consider \"both-support-touch-and-mouse device\" for this feature (see the comment of\n // `mountLocalDOMEventListeners`) to avoid bugs util some requirements come.\n else if (!env.touchEventsSupported) {\n zrUtil.each(globalNativeListenerNames.mouse, mount);\n }\n\n function mount(nativeEventName) {\n function nativeEventListener(event) {\n event = getNativeEvent(event); // See the reason in [Drag outside] in `Handler.js`\n // This checking supports both `useCapture` or not.\n // PENDING: if there is performance issue in some devices,\n // we probably can not use `useCapture` and change a easier\n // to judes whether local (mark).\n\n if (!isLocalEl(instance, event.target)) {\n event = normalizeGlobalEvent(instance, event);\n scope.domHandlers[nativeEventName].call(instance, event);\n }\n }\n\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, {\n capture: true\n } // See [Drag Outside] in `Handler.js`\n );\n }\n}\n\nfunction mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\n scope.mounted[nativeEventName] = listener;\n scope.listenerOpts[nativeEventName] = opt;\n addEventListener(scope.domTarget, eventNameFix(nativeEventName), listener, opt);\n}\n\nfunction unmountDOMEventListeners(scope) {\n var mounted = scope.mounted;\n\n for (var nativeEventName in mounted) {\n if (mounted.hasOwnProperty(nativeEventName)) {\n removeEventListener(scope.domTarget, eventNameFix(nativeEventName), mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\n }\n }\n\n scope.mounted = {};\n}\n/**\n * See [Drag Outside] in `Handler.js`.\n * @implement\n * @param {boolean} isPointerCapturing Should never be `null`/`undefined`.\n * `true`: start to capture pointer if it is not capturing.\n * `false`: end the capture if it is capturing.\n */\n\n\nfunction togglePointerCapture(instance, isPointerCapturing) {\n instance._mayPointerCapture = null;\n\n if (globalEventSupported && instance._pointerCapturing ^ isPointerCapturing) {\n instance._pointerCapturing = isPointerCapturing;\n var globalHandlerScope = instance._globalHandlerScope;\n isPointerCapturing ? mountGlobalDOMEventListeners(instance, globalHandlerScope) : unmountDOMEventListeners(globalHandlerScope);\n }\n}\n/**\n * @inner\n * @class\n */\n\n\nfunction DOMHandlerScope(domTarget, domHandlers) {\n this.domTarget = domTarget;\n this.domHandlers = domHandlers; // Key: eventName, value: mounted handler funcitons.\n // Used for unmount.\n\n this.mounted = {};\n this.listenerOpts = {};\n this.touchTimer = null;\n this.touching = false;\n}\n/**\n * @public\n * @class\n */\n\n\nfunction HandlerDomProxy(dom, painterRoot) {\n Eventful.call(this);\n this.dom = dom;\n this.painterRoot = painterRoot;\n this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\n\n if (globalEventSupported) {\n this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\n }\n /**\n * @type {boolean}\n */\n\n\n this._pointerCapturing = false;\n /**\n * @type {Array.} [x, y] or null.\n */\n\n this._mayPointerCapture = null;\n mountLocalDOMEventListeners(this, this._localHandlerScope);\n}\n\nvar handlerDomProxyProto = HandlerDomProxy.prototype;\n\nhandlerDomProxyProto.dispose = function () {\n unmountDOMEventListeners(this._localHandlerScope);\n\n if (globalEventSupported) {\n unmountDOMEventListeners(this._globalHandlerScope);\n }\n};\n\nhandlerDomProxyProto.setCursor = function (cursorStyle) {\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\n};\n\nzrUtil.mixin(HandlerDomProxy, Eventful);\nvar _default = HandlerDomProxy;\nmodule.exports = _default;","var Path = require(\"./Path\");\n\n// CompoundPath to improve performance\nvar _default = Path.extend({\n type: 'compound',\n shape: {\n paths: null\n },\n _updatePathDirty: function () {\n var dirtyPath = this.__dirtyPath;\n var paths = this.shape.paths;\n\n for (var i = 0; i < paths.length; i++) {\n // Mark as dirty if any subpath is dirty\n dirtyPath = dirtyPath || paths[i].__dirtyPath;\n }\n\n this.__dirtyPath = dirtyPath;\n this.__dirty = this.__dirty || dirtyPath;\n },\n beforeBrush: function () {\n this._updatePathDirty();\n\n var paths = this.shape.paths || [];\n var scale = this.getGlobalScale(); // Update path scale\n\n for (var i = 0; i < paths.length; i++) {\n if (!paths[i].path) {\n paths[i].createPathProxy();\n }\n\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\n }\n },\n buildPath: function (ctx, shape) {\n var paths = shape.paths || [];\n\n for (var i = 0; i < paths.length; i++) {\n paths[i].buildPath(ctx, paths[i].shape, true);\n }\n },\n afterBrush: function () {\n var paths = this.shape.paths || [];\n\n for (var i = 0; i < paths.length; i++) {\n paths[i].__dirtyPath = false;\n }\n },\n getBoundingRect: function () {\n this._updatePathDirty();\n\n return Path.prototype.getBoundingRect.call(this);\n }\n});\n\nmodule.exports = _default;","var zrUtil = require(\"../core/util\");\n\nvar Style = require(\"./Style\");\n\nvar Element = require(\"../Element\");\n\nvar RectText = require(\"./mixin/RectText\");\n\n/**\n * Base class of all displayable graphic objects\n * @module zrender/graphic/Displayable\n */\n\n/**\n * @alias module:zrender/graphic/Displayable\n * @extends module:zrender/Element\n * @extends module:zrender/graphic/mixin/RectText\n */\nfunction Displayable(opts) {\n opts = opts || {};\n Element.call(this, opts); // Extend properties\n\n for (var name in opts) {\n if (opts.hasOwnProperty(name) && name !== 'style') {\n this[name] = opts[name];\n }\n }\n /**\n * @type {module:zrender/graphic/Style}\n */\n\n\n this.style = new Style(opts.style, this);\n this._rect = null; // Shapes for cascade clipping.\n // Can only be `null`/`undefined` or an non-empty array, MUST NOT be an empty array.\n // because it is easy to only using null to check whether clipPaths changed.\n\n this.__clipPaths = null; // FIXME Stateful must be mixined after style is setted\n // Stateful.call(this, opts);\n}\n\nDisplayable.prototype = {\n constructor: Displayable,\n type: 'displayable',\n\n /**\n * Dirty flag. From which painter will determine if this displayable object needs brush.\n * @name module:zrender/graphic/Displayable#__dirty\n * @type {boolean}\n */\n __dirty: true,\n\n /**\n * Whether the displayable object is visible. when it is true, the displayable object\n * is not drawn, but the mouse event can still trigger the object.\n * @name module:/zrender/graphic/Displayable#invisible\n * @type {boolean}\n * @default false\n */\n invisible: false,\n\n /**\n * @name module:/zrender/graphic/Displayable#z\n * @type {number}\n * @default 0\n */\n z: 0,\n\n /**\n * @name module:/zrender/graphic/Displayable#z\n * @type {number}\n * @default 0\n */\n z2: 0,\n\n /**\n * The z level determines the displayable object can be drawn in which layer canvas.\n * @name module:/zrender/graphic/Displayable#zlevel\n * @type {number}\n * @default 0\n */\n zlevel: 0,\n\n /**\n * Whether it can be dragged.\n * @name module:/zrender/graphic/Displayable#draggable\n * @type {boolean}\n * @default false\n */\n draggable: false,\n\n /**\n * Whether is it dragging.\n * @name module:/zrender/graphic/Displayable#draggable\n * @type {boolean}\n * @default false\n */\n dragging: false,\n\n /**\n * Whether to respond to mouse events.\n * @name module:/zrender/graphic/Displayable#silent\n * @type {boolean}\n * @default false\n */\n silent: false,\n\n /**\n * If enable culling\n * @type {boolean}\n * @default false\n */\n culling: false,\n\n /**\n * Mouse cursor when hovered\n * @name module:/zrender/graphic/Displayable#cursor\n * @type {string}\n */\n cursor: 'pointer',\n\n /**\n * If hover area is bounding rect\n * @name module:/zrender/graphic/Displayable#rectHover\n * @type {string}\n */\n rectHover: false,\n\n /**\n * Render the element progressively when the value >= 0,\n * usefull for large data.\n * @type {boolean}\n */\n progressive: false,\n\n /**\n * @type {boolean}\n */\n incremental: false,\n\n /**\n * Scale ratio for global scale.\n * @type {boolean}\n */\n globalScaleRatio: 1,\n beforeBrush: function (ctx) {},\n afterBrush: function (ctx) {},\n\n /**\n * Graphic drawing method.\n * @param {CanvasRenderingContext2D} ctx\n */\n // Interface\n brush: function (ctx, prevEl) {},\n\n /**\n * Get the minimum bounding box.\n * @return {module:zrender/core/BoundingRect}\n */\n // Interface\n getBoundingRect: function () {},\n\n /**\n * If displayable element contain coord x, y\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\n contain: function (x, y) {\n return this.rectContain(x, y);\n },\n\n /**\n * @param {Function} cb\n * @param {} context\n */\n traverse: function (cb, context) {\n cb.call(context, this);\n },\n\n /**\n * If bounding rect of element contain coord x, y\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\n rectContain: function (x, y) {\n var coord = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n return rect.contain(coord[0], coord[1]);\n },\n\n /**\n * Mark displayable element dirty and refresh next frame\n */\n dirty: function () {\n this.__dirty = this.__dirtyText = true;\n this._rect = null;\n this.__zr && this.__zr.refresh();\n },\n\n /**\n * If displayable object binded any event\n * @return {boolean}\n */\n // TODO, events bound by bind\n // isSilent: function () {\n // return !(\n // this.hoverable || this.draggable\n // || this.onmousemove || this.onmouseover || this.onmouseout\n // || this.onmousedown || this.onmouseup || this.onclick\n // || this.ondragenter || this.ondragover || this.ondragleave\n // || this.ondrop\n // );\n // },\n\n /**\n * Alias for animate('style')\n * @param {boolean} loop\n */\n animateStyle: function (loop) {\n return this.animate('style', loop);\n },\n attrKV: function (key, value) {\n if (key !== 'style') {\n Element.prototype.attrKV.call(this, key, value);\n } else {\n this.style.set(value);\n }\n },\n\n /**\n * @param {Object|string} key\n * @param {*} value\n */\n setStyle: function (key, value) {\n this.style.set(key, value);\n this.dirty(false);\n return this;\n },\n\n /**\n * Use given style object\n * @param {Object} obj\n */\n useStyle: function (obj) {\n this.style = new Style(obj, this);\n this.dirty(false);\n return this;\n },\n\n /**\n * The string value of `textPosition` needs to be calculated to a real postion.\n * For example, `'inside'` is calculated to `[rect.width/2, rect.height/2]`\n * by default. See `contain/text.js#calculateTextPosition` for more details.\n * But some coutom shapes like \"pin\", \"flag\" have center that is not exactly\n * `[width/2, height/2]`. So we provide this hook to customize the calculation\n * for those shapes. It will be called if the `style.textPosition` is a string.\n * @param {Obejct} [out] Prepared out object. If not provided, this method should\n * be responsible for creating one.\n * @param {module:zrender/graphic/Style} style\n * @param {Object} rect {x, y, width, height}\n * @return {Obejct} out The same as the input out.\n * {\n * x: number. mandatory.\n * y: number. mandatory.\n * textAlign: string. optional. use style.textAlign by default.\n * textVerticalAlign: string. optional. use style.textVerticalAlign by default.\n * }\n */\n calculateTextPosition: null\n};\nzrUtil.inherits(Displayable, Element);\nzrUtil.mixin(Displayable, RectText); // zrUtil.mixin(Displayable, Stateful);\n\nvar _default = Displayable;\nmodule.exports = _default;","/**\n * @param {Array.} colorStops\n */\nvar Gradient = function (colorStops) {\n this.colorStops = colorStops || [];\n};\n\nGradient.prototype = {\n constructor: Gradient,\n addColorStop: function (offset, color) {\n this.colorStops.push({\n offset: offset,\n color: color\n });\n }\n};\nvar _default = Gradient;\nmodule.exports = _default;","var Displayable = require(\"./Displayable\");\n\nvar BoundingRect = require(\"../core/BoundingRect\");\n\nvar zrUtil = require(\"../core/util\");\n\nvar imageHelper = require(\"./helper/image\");\n\n/**\n * @alias zrender/graphic/Image\n * @extends module:zrender/graphic/Displayable\n * @constructor\n * @param {Object} opts\n */\nfunction ZImage(opts) {\n Displayable.call(this, opts);\n}\n\nZImage.prototype = {\n constructor: ZImage,\n type: 'image',\n brush: function (ctx, prevEl) {\n var style = this.style;\n var src = style.image; // Must bind each time\n\n style.bind(ctx, this, prevEl);\n var image = this._image = imageHelper.createOrUpdateImage(src, this._image, this, this.onload);\n\n if (!image || !imageHelper.isImageReady(image)) {\n return;\n } // 图片已经加载完成\n // if (image.nodeName.toUpperCase() == 'IMG') {\n // if (!image.complete) {\n // return;\n // }\n // }\n // Else is canvas\n\n\n var x = style.x || 0;\n var y = style.y || 0;\n var width = style.width;\n var height = style.height;\n var aspect = image.width / image.height;\n\n if (width == null && height != null) {\n // Keep image/height ratio\n width = height * aspect;\n } else if (height == null && width != null) {\n height = width / aspect;\n } else if (width == null && height == null) {\n width = image.width;\n height = image.height;\n } // 设置transform\n\n\n this.setTransform(ctx);\n\n if (style.sWidth && style.sHeight) {\n var sx = style.sx || 0;\n var sy = style.sy || 0;\n ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\n } else if (style.sx && style.sy) {\n var sx = style.sx;\n var sy = style.sy;\n var sWidth = width - sx;\n var sHeight = height - sy;\n ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\n } else {\n ctx.drawImage(image, x, y, width, height);\n } // Draw rect text\n\n\n if (style.text != null) {\n // Only restore transform when needs draw text.\n this.restoreTransform(ctx);\n this.drawRectText(ctx, this.getBoundingRect());\n }\n },\n getBoundingRect: function () {\n var style = this.style;\n\n if (!this._rect) {\n this._rect = new BoundingRect(style.x || 0, style.y || 0, style.width || 0, style.height || 0);\n }\n\n return this._rect;\n }\n};\nzrUtil.inherits(ZImage, Displayable);\nvar _default = ZImage;\nmodule.exports = _default;","var _util = require(\"../core/util\");\n\nvar inherits = _util.inherits;\n\nvar Displayble = require(\"./Displayable\");\n\nvar BoundingRect = require(\"../core/BoundingRect\");\n\n/**\n * Displayable for incremental rendering. It will be rendered in a separate layer\n * IncrementalDisplay have two main methods. `clearDisplayables` and `addDisplayables`\n * addDisplayables will render the added displayables incremetally.\n *\n * It use a not clearFlag to tell the painter don't clear the layer if it's the first element.\n */\n// TODO Style override ?\nfunction IncrementalDisplayble(opts) {\n Displayble.call(this, opts);\n this._displayables = [];\n this._temporaryDisplayables = [];\n this._cursor = 0;\n this.notClear = true;\n}\n\nIncrementalDisplayble.prototype.incremental = true;\n\nIncrementalDisplayble.prototype.clearDisplaybles = function () {\n this._displayables = [];\n this._temporaryDisplayables = [];\n this._cursor = 0;\n this.dirty();\n this.notClear = false;\n};\n\nIncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) {\n if (notPersistent) {\n this._temporaryDisplayables.push(displayable);\n } else {\n this._displayables.push(displayable);\n }\n\n this.dirty();\n};\n\nIncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) {\n notPersistent = notPersistent || false;\n\n for (var i = 0; i < displayables.length; i++) {\n this.addDisplayable(displayables[i], notPersistent);\n }\n};\n\nIncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) {\n for (var i = this._cursor; i < this._displayables.length; i++) {\n cb && cb(this._displayables[i]);\n }\n\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n cb && cb(this._temporaryDisplayables[i]);\n }\n};\n\nIncrementalDisplayble.prototype.update = function () {\n this.updateTransform();\n\n for (var i = this._cursor; i < this._displayables.length; i++) {\n var displayable = this._displayables[i]; // PENDING\n\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n var displayable = this._temporaryDisplayables[i]; // PENDING\n\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n};\n\nIncrementalDisplayble.prototype.brush = function (ctx, prevEl) {\n // Render persistant displayables.\n for (var i = this._cursor; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n displayable.beforeBrush && displayable.beforeBrush(ctx);\n displayable.brush(ctx, i === this._cursor ? null : this._displayables[i - 1]);\n displayable.afterBrush && displayable.afterBrush(ctx);\n }\n\n this._cursor = i; // Render temporary displayables.\n\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n var displayable = this._temporaryDisplayables[i];\n displayable.beforeBrush && displayable.beforeBrush(ctx);\n displayable.brush(ctx, i === 0 ? null : this._temporaryDisplayables[i - 1]);\n displayable.afterBrush && displayable.afterBrush(ctx);\n }\n\n this._temporaryDisplayables = [];\n this.notClear = true;\n};\n\nvar m = [];\n\nIncrementalDisplayble.prototype.getBoundingRect = function () {\n if (!this._rect) {\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\n\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n var childRect = displayable.getBoundingRect().clone();\n\n if (displayable.needLocalTransform()) {\n childRect.applyTransform(displayable.getLocalTransform(m));\n }\n\n rect.union(childRect);\n }\n\n this._rect = rect;\n }\n\n return this._rect;\n};\n\nIncrementalDisplayble.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n\n if (rect.contain(localPos[0], localPos[1])) {\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n\n if (displayable.contain(x, y)) {\n return true;\n }\n }\n }\n\n return false;\n};\n\ninherits(IncrementalDisplayble, Displayble);\nvar _default = IncrementalDisplayble;\nmodule.exports = _default;","var zrUtil = require(\"../core/util\");\n\nvar Gradient = require(\"./Gradient\");\n\n/**\n * x, y, x2, y2 are all percent from 0 to 1\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @param {number} [x2=1]\n * @param {number} [y2=0]\n * @param {Array.} colorStops\n * @param {boolean} [globalCoord=false]\n */\nvar LinearGradient = function (x, y, x2, y2, colorStops, globalCoord) {\n // Should do nothing more in this constructor. Because gradient can be\n // declard by `color: {type: 'linear', colorStops: ...}`, where\n // this constructor will not be called.\n this.x = x == null ? 0 : x;\n this.y = y == null ? 0 : y;\n this.x2 = x2 == null ? 1 : x2;\n this.y2 = y2 == null ? 0 : y2; // Can be cloned\n\n this.type = 'linear'; // If use global coord\n\n this.global = globalCoord || false;\n Gradient.call(this, colorStops);\n};\n\nLinearGradient.prototype = {\n constructor: LinearGradient\n};\nzrUtil.inherits(LinearGradient, Gradient);\nvar _default = LinearGradient;\nmodule.exports = _default;","var Displayable = require(\"./Displayable\");\n\nvar zrUtil = require(\"../core/util\");\n\nvar PathProxy = require(\"../core/PathProxy\");\n\nvar pathContain = require(\"../contain/path\");\n\nvar Pattern = require(\"./Pattern\");\n\nvar getCanvasPattern = Pattern.prototype.getCanvasPattern;\nvar abs = Math.abs;\nvar pathProxyForDraw = new PathProxy(true);\n/**\n * @alias module:zrender/graphic/Path\n * @extends module:zrender/graphic/Displayable\n * @constructor\n * @param {Object} opts\n */\n\nfunction Path(opts) {\n Displayable.call(this, opts);\n /**\n * @type {module:zrender/core/PathProxy}\n * @readOnly\n */\n\n this.path = null;\n}\n\nPath.prototype = {\n constructor: Path,\n type: 'path',\n __dirtyPath: true,\n strokeContainThreshold: 5,\n // This item default to be false. But in map series in echarts,\n // in order to improve performance, it should be set to true,\n // so the shorty segment won't draw.\n segmentIgnoreThreshold: 0,\n\n /**\n * See `module:zrender/src/graphic/helper/subPixelOptimize`.\n * @type {boolean}\n */\n subPixelOptimize: false,\n brush: function (ctx, prevEl) {\n var style = this.style;\n var path = this.path || pathProxyForDraw;\n var hasStroke = style.hasStroke();\n var hasFill = style.hasFill();\n var fill = style.fill;\n var stroke = style.stroke;\n var hasFillGradient = hasFill && !!fill.colorStops;\n var hasStrokeGradient = hasStroke && !!stroke.colorStops;\n var hasFillPattern = hasFill && !!fill.image;\n var hasStrokePattern = hasStroke && !!stroke.image;\n style.bind(ctx, this, prevEl);\n this.setTransform(ctx);\n\n if (this.__dirty) {\n var rect; // Update gradient because bounding rect may changed\n\n if (hasFillGradient) {\n rect = rect || this.getBoundingRect();\n this._fillGradient = style.getGradient(ctx, fill, rect);\n }\n\n if (hasStrokeGradient) {\n rect = rect || this.getBoundingRect();\n this._strokeGradient = style.getGradient(ctx, stroke, rect);\n }\n } // Use the gradient or pattern\n\n\n if (hasFillGradient) {\n // PENDING If may have affect the state\n ctx.fillStyle = this._fillGradient;\n } else if (hasFillPattern) {\n ctx.fillStyle = getCanvasPattern.call(fill, ctx);\n }\n\n if (hasStrokeGradient) {\n ctx.strokeStyle = this._strokeGradient;\n } else if (hasStrokePattern) {\n ctx.strokeStyle = getCanvasPattern.call(stroke, ctx);\n }\n\n var lineDash = style.lineDash;\n var lineDashOffset = style.lineDashOffset;\n var ctxLineDash = !!ctx.setLineDash; // Update path sx, sy\n\n var scale = this.getGlobalScale();\n path.setScale(scale[0], scale[1], this.segmentIgnoreThreshold); // Proxy context\n // Rebuild path in following 2 cases\n // 1. Path is dirty\n // 2. Path needs javascript implemented lineDash stroking.\n // In this case, lineDash information will not be saved in PathProxy\n\n if (this.__dirtyPath || lineDash && !ctxLineDash && hasStroke) {\n path.beginPath(ctx); // Setting line dash before build path\n\n if (lineDash && !ctxLineDash) {\n path.setLineDash(lineDash);\n path.setLineDashOffset(lineDashOffset);\n }\n\n this.buildPath(path, this.shape, false); // Clear path dirty flag\n\n if (this.path) {\n this.__dirtyPath = false;\n }\n } else {\n // Replay path building\n ctx.beginPath();\n this.path.rebuildPath(ctx);\n }\n\n if (hasFill) {\n if (style.fillOpacity != null) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.fillOpacity * style.opacity;\n path.fill(ctx);\n ctx.globalAlpha = originalGlobalAlpha;\n } else {\n path.fill(ctx);\n }\n }\n\n if (lineDash && ctxLineDash) {\n ctx.setLineDash(lineDash);\n ctx.lineDashOffset = lineDashOffset;\n }\n\n if (hasStroke) {\n if (style.strokeOpacity != null) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\n path.stroke(ctx);\n ctx.globalAlpha = originalGlobalAlpha;\n } else {\n path.stroke(ctx);\n }\n }\n\n if (lineDash && ctxLineDash) {\n // PENDING\n // Remove lineDash\n ctx.setLineDash([]);\n } // Draw rect text\n\n\n if (style.text != null) {\n // Only restore transform when needs draw text.\n this.restoreTransform(ctx);\n this.drawRectText(ctx, this.getBoundingRect());\n }\n },\n // When bundling path, some shape may decide if use moveTo to begin a new subpath or closePath\n // Like in circle\n buildPath: function (ctx, shapeCfg, inBundle) {},\n createPathProxy: function () {\n this.path = new PathProxy();\n },\n getBoundingRect: function () {\n var rect = this._rect;\n var style = this.style;\n var needsUpdateRect = !rect;\n\n if (needsUpdateRect) {\n var path = this.path;\n\n if (!path) {\n // Create path on demand.\n path = this.path = new PathProxy();\n }\n\n if (this.__dirtyPath) {\n path.beginPath();\n this.buildPath(path, this.shape, false);\n }\n\n rect = path.getBoundingRect();\n }\n\n this._rect = rect;\n\n if (style.hasStroke()) {\n // Needs update rect with stroke lineWidth when\n // 1. Element changes scale or lineWidth\n // 2. Shape is changed\n var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone());\n\n if (this.__dirty || needsUpdateRect) {\n rectWithStroke.copy(rect); // FIXME Must after updateTransform\n\n var w = style.lineWidth; // PENDING, Min line width is needed when line is horizontal or vertical\n\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1; // Only add extra hover lineWidth when there are no fill\n\n if (!style.hasFill()) {\n w = Math.max(w, this.strokeContainThreshold || 4);\n } // Consider line width\n // Line scale can't be 0;\n\n\n if (lineScale > 1e-10) {\n rectWithStroke.width += w / lineScale;\n rectWithStroke.height += w / lineScale;\n rectWithStroke.x -= w / lineScale / 2;\n rectWithStroke.y -= w / lineScale / 2;\n }\n } // Return rect with stroke\n\n\n return rectWithStroke;\n }\n\n return rect;\n },\n contain: function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n var style = this.style;\n x = localPos[0];\n y = localPos[1];\n\n if (rect.contain(x, y)) {\n var pathData = this.path.data;\n\n if (style.hasStroke()) {\n var lineWidth = style.lineWidth;\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1; // Line scale can't be 0;\n\n if (lineScale > 1e-10) {\n // Only add extra hover lineWidth when there are no fill\n if (!style.hasFill()) {\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\n }\n\n if (pathContain.containStroke(pathData, lineWidth / lineScale, x, y)) {\n return true;\n }\n }\n }\n\n if (style.hasFill()) {\n return pathContain.contain(pathData, x, y);\n }\n }\n\n return false;\n },\n\n /**\n * @param {boolean} dirtyPath\n */\n dirty: function (dirtyPath) {\n if (dirtyPath == null) {\n dirtyPath = true;\n } // Only mark dirty, not mark clean\n\n\n if (dirtyPath) {\n this.__dirtyPath = dirtyPath;\n this._rect = null;\n }\n\n this.__dirty = this.__dirtyText = true;\n this.__zr && this.__zr.refresh(); // Used as a clipping path\n\n if (this.__clipTarget) {\n this.__clipTarget.dirty();\n }\n },\n\n /**\n * Alias for animate('shape')\n * @param {boolean} loop\n */\n animateShape: function (loop) {\n return this.animate('shape', loop);\n },\n // Overwrite attrKV\n attrKV: function (key, value) {\n // FIXME\n if (key === 'shape') {\n this.setShape(value);\n this.__dirtyPath = true;\n this._rect = null;\n } else {\n Displayable.prototype.attrKV.call(this, key, value);\n }\n },\n\n /**\n * @param {Object|string} key\n * @param {*} value\n */\n setShape: function (key, value) {\n var shape = this.shape; // Path from string may not have shape\n\n if (shape) {\n if (zrUtil.isObject(key)) {\n for (var name in key) {\n if (key.hasOwnProperty(name)) {\n shape[name] = key[name];\n }\n }\n } else {\n shape[key] = value;\n }\n\n this.dirty(true);\n }\n\n return this;\n },\n getLineScale: function () {\n var m = this.transform; // Get the line scale.\n // Determinant of `m` means how much the area is enlarged by the\n // transformation. So its square root can be used as a scale factor\n // for width.\n\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10 ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1])) : 1;\n }\n};\n/**\n * 扩展一个 Path element, 比如星形,圆等。\n * Extend a path element\n * @param {Object} props\n * @param {string} props.type Path type\n * @param {Function} props.init Initialize\n * @param {Function} props.buildPath Overwrite buildPath method\n * @param {Object} [props.style] Extended default style config\n * @param {Object} [props.shape] Extended default shape config\n */\n\nPath.extend = function (defaults) {\n var Sub = function (opts) {\n Path.call(this, opts);\n\n if (defaults.style) {\n // Extend default style\n this.style.extendFrom(defaults.style, false);\n } // Extend default shape\n\n\n var defaultShape = defaults.shape;\n\n if (defaultShape) {\n this.shape = this.shape || {};\n var thisShape = this.shape;\n\n for (var name in defaultShape) {\n if (!thisShape.hasOwnProperty(name) && defaultShape.hasOwnProperty(name)) {\n thisShape[name] = defaultShape[name];\n }\n }\n }\n\n defaults.init && defaults.init.call(this, opts);\n };\n\n zrUtil.inherits(Sub, Path); // FIXME 不能 extend position, rotation 等引用对象\n\n for (var name in defaults) {\n // Extending prototype values and methods\n if (name !== 'style' && name !== 'shape') {\n Sub.prototype[name] = defaults[name];\n }\n }\n\n return Sub;\n};\n\nzrUtil.inherits(Path, Displayable);\nvar _default = Path;\nmodule.exports = _default;","var Pattern = function (image, repeat) {\n // Should do nothing more in this constructor. Because gradient can be\n // declard by `color: {image: ...}`, where this constructor will not be called.\n this.image = image;\n this.repeat = repeat; // Can be cloned\n\n this.type = 'pattern';\n};\n\nPattern.prototype.getCanvasPattern = function (ctx) {\n return ctx.createPattern(this.image, this.repeat || 'repeat');\n};\n\nvar _default = Pattern;\nmodule.exports = _default;","var zrUtil = require(\"../core/util\");\n\nvar Gradient = require(\"./Gradient\");\n\n/**\n * x, y, r are all percent from 0 to 1\n * @param {number} [x=0.5]\n * @param {number} [y=0.5]\n * @param {number} [r=0.5]\n * @param {Array.} [colorStops]\n * @param {boolean} [globalCoord=false]\n */\nvar RadialGradient = function (x, y, r, colorStops, globalCoord) {\n // Should do nothing more in this constructor. Because gradient can be\n // declard by `color: {type: 'radial', colorStops: ...}`, where\n // this constructor will not be called.\n this.x = x == null ? 0.5 : x;\n this.y = y == null ? 0.5 : y;\n this.r = r == null ? 0.5 : r; // Can be cloned\n\n this.type = 'radial'; // If use global coord\n\n this.global = globalCoord || false;\n Gradient.call(this, colorStops);\n};\n\nRadialGradient.prototype = {\n constructor: RadialGradient\n};\nzrUtil.inherits(RadialGradient, Gradient);\nvar _default = RadialGradient;\nmodule.exports = _default;","var fixShadow = require(\"./helper/fixShadow\");\n\nvar _constant = require(\"./constant\");\n\nvar ContextCachedBy = _constant.ContextCachedBy;\nvar STYLE_COMMON_PROPS = [['shadowBlur', 0], ['shadowOffsetX', 0], ['shadowOffsetY', 0], ['shadowColor', '#000'], ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]]; // var SHADOW_PROPS = STYLE_COMMON_PROPS.slice(0, 4);\n// var LINE_PROPS = STYLE_COMMON_PROPS.slice(4);\n\nvar Style = function (opts) {\n this.extendFrom(opts, false);\n};\n\nfunction createLinearGradient(ctx, obj, rect) {\n var x = obj.x == null ? 0 : obj.x;\n var x2 = obj.x2 == null ? 1 : obj.x2;\n var y = obj.y == null ? 0 : obj.y;\n var y2 = obj.y2 == null ? 0 : obj.y2;\n\n if (!obj.global) {\n x = x * rect.width + rect.x;\n x2 = x2 * rect.width + rect.x;\n y = y * rect.height + rect.y;\n y2 = y2 * rect.height + rect.y;\n } // Fix NaN when rect is Infinity\n\n\n x = isNaN(x) ? 0 : x;\n x2 = isNaN(x2) ? 1 : x2;\n y = isNaN(y) ? 0 : y;\n y2 = isNaN(y2) ? 0 : y2;\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\n return canvasGradient;\n}\n\nfunction createRadialGradient(ctx, obj, rect) {\n var width = rect.width;\n var height = rect.height;\n var min = Math.min(width, height);\n var x = obj.x == null ? 0.5 : obj.x;\n var y = obj.y == null ? 0.5 : obj.y;\n var r = obj.r == null ? 0.5 : obj.r;\n\n if (!obj.global) {\n x = x * width + rect.x;\n y = y * height + rect.y;\n r = r * min;\n }\n\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\n return canvasGradient;\n}\n\nStyle.prototype = {\n constructor: Style,\n\n /**\n * @type {string}\n */\n fill: '#000',\n\n /**\n * @type {string}\n */\n stroke: null,\n\n /**\n * @type {number}\n */\n opacity: 1,\n\n /**\n * @type {number}\n */\n fillOpacity: null,\n\n /**\n * @type {number}\n */\n strokeOpacity: null,\n\n /**\n * `true` is not supported.\n * `false`/`null`/`undefined` are the same.\n * `false` is used to remove lineDash in some\n * case that `null`/`undefined` can not be set.\n * (e.g., emphasis.lineStyle in echarts)\n * @type {Array.|boolean}\n */\n lineDash: null,\n\n /**\n * @type {number}\n */\n lineDashOffset: 0,\n\n /**\n * @type {number}\n */\n shadowBlur: 0,\n\n /**\n * @type {number}\n */\n shadowOffsetX: 0,\n\n /**\n * @type {number}\n */\n shadowOffsetY: 0,\n\n /**\n * @type {number}\n */\n lineWidth: 1,\n\n /**\n * If stroke ignore scale\n * @type {Boolean}\n */\n strokeNoScale: false,\n // Bounding rect text configuration\n // Not affected by element transform\n\n /**\n * @type {string}\n */\n text: null,\n\n /**\n * If `fontSize` or `fontFamily` exists, `font` will be reset by\n * `fontSize`, `fontStyle`, `fontWeight`, `fontFamily`.\n * So do not visit it directly in upper application (like echarts),\n * but use `contain/text#makeFont` instead.\n * @type {string}\n */\n font: null,\n\n /**\n * The same as font. Use font please.\n * @deprecated\n * @type {string}\n */\n textFont: null,\n\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n * @type {string}\n */\n fontStyle: null,\n\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n * @type {string}\n */\n fontWeight: null,\n\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n * Should be 12 but not '12px'.\n * @type {number}\n */\n fontSize: null,\n\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n * @type {string}\n */\n fontFamily: null,\n\n /**\n * Reserved for special functinality, like 'hr'.\n * @type {string}\n */\n textTag: null,\n\n /**\n * @type {string}\n */\n textFill: '#000',\n\n /**\n * @type {string}\n */\n textStroke: null,\n\n /**\n * @type {number}\n */\n textWidth: null,\n\n /**\n * Only for textBackground.\n * @type {number}\n */\n textHeight: null,\n\n /**\n * textStroke may be set as some color as a default\n * value in upper applicaion, where the default value\n * of textStrokeWidth should be 0 to make sure that\n * user can choose to do not use text stroke.\n * @type {number}\n */\n textStrokeWidth: 0,\n\n /**\n * @type {number}\n */\n textLineHeight: null,\n\n /**\n * 'inside', 'left', 'right', 'top', 'bottom'\n * [x, y]\n * Based on x, y of rect.\n * @type {string|Array.}\n * @default 'inside'\n */\n textPosition: 'inside',\n\n /**\n * If not specified, use the boundingRect of a `displayable`.\n * @type {Object}\n */\n textRect: null,\n\n /**\n * [x, y]\n * @type {Array.}\n */\n textOffset: null,\n\n /**\n * @type {string}\n */\n textAlign: null,\n\n /**\n * @type {string}\n */\n textVerticalAlign: null,\n\n /**\n * @type {number}\n */\n textDistance: 5,\n\n /**\n * @type {string}\n */\n textShadowColor: 'transparent',\n\n /**\n * @type {number}\n */\n textShadowBlur: 0,\n\n /**\n * @type {number}\n */\n textShadowOffsetX: 0,\n\n /**\n * @type {number}\n */\n textShadowOffsetY: 0,\n\n /**\n * @type {string}\n */\n textBoxShadowColor: 'transparent',\n\n /**\n * @type {number}\n */\n textBoxShadowBlur: 0,\n\n /**\n * @type {number}\n */\n textBoxShadowOffsetX: 0,\n\n /**\n * @type {number}\n */\n textBoxShadowOffsetY: 0,\n\n /**\n * Whether transform text.\n * Only available in Path and Image element,\n * where the text is called as `RectText`.\n * @type {boolean}\n */\n transformText: false,\n\n /**\n * Text rotate around position of Path or Image.\n * The origin of the rotation can be specified by `textOrigin`.\n * Only available in Path and Image element,\n * where the text is called as `RectText`.\n */\n textRotation: 0,\n\n /**\n * Text origin of text rotation.\n * Useful in the case like label rotation of circular symbol.\n * Only available in Path and Image element, where the text is called\n * as `RectText` and the element is called as \"host element\".\n * The value can be:\n * + If specified as a coordinate like `[10, 40]`, it is the `[x, y]`\n * base on the left-top corner of the rect of its host element.\n * + If specified as a string `center`, it is the center of the rect of\n * its host element.\n * + By default, this origin is the `textPosition`.\n * @type {string|Array.}\n */\n textOrigin: null,\n\n /**\n * @type {string}\n */\n textBackgroundColor: null,\n\n /**\n * @type {string}\n */\n textBorderColor: null,\n\n /**\n * @type {number}\n */\n textBorderWidth: 0,\n\n /**\n * @type {number}\n */\n textBorderRadius: 0,\n\n /**\n * Can be `2` or `[2, 4]` or `[2, 3, 4, 5]`\n * @type {number|Array.}\n */\n textPadding: null,\n\n /**\n * Text styles for rich text.\n * @type {Object}\n */\n rich: null,\n\n /**\n * {outerWidth, outerHeight, ellipsis, placeholder}\n * @type {Object}\n */\n truncate: null,\n\n /**\n * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation\n * @type {string}\n */\n blend: null,\n\n /**\n * @param {CanvasRenderingContext2D} ctx\n */\n bind: function (ctx, el, prevEl) {\n var style = this;\n var prevStyle = prevEl && prevEl.style; // If no prevStyle, it means first draw.\n // Only apply cache if the last time cachced by this function.\n\n var notCheckCache = !prevStyle || ctx.__attrCachedBy !== ContextCachedBy.STYLE_BIND;\n ctx.__attrCachedBy = ContextCachedBy.STYLE_BIND;\n\n for (var i = 0; i < STYLE_COMMON_PROPS.length; i++) {\n var prop = STYLE_COMMON_PROPS[i];\n var styleName = prop[0];\n\n if (notCheckCache || style[styleName] !== prevStyle[styleName]) {\n // FIXME Invalid property value will cause style leak from previous element.\n ctx[styleName] = fixShadow(ctx, styleName, style[styleName] || prop[1]);\n }\n }\n\n if (notCheckCache || style.fill !== prevStyle.fill) {\n ctx.fillStyle = style.fill;\n }\n\n if (notCheckCache || style.stroke !== prevStyle.stroke) {\n ctx.strokeStyle = style.stroke;\n }\n\n if (notCheckCache || style.opacity !== prevStyle.opacity) {\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\n }\n\n if (notCheckCache || style.blend !== prevStyle.blend) {\n ctx.globalCompositeOperation = style.blend || 'source-over';\n }\n\n if (this.hasStroke()) {\n var lineWidth = style.lineWidth;\n ctx.lineWidth = lineWidth / (this.strokeNoScale && el && el.getLineScale ? el.getLineScale() : 1);\n }\n },\n hasFill: function () {\n var fill = this.fill;\n return fill != null && fill !== 'none';\n },\n hasStroke: function () {\n var stroke = this.stroke;\n return stroke != null && stroke !== 'none' && this.lineWidth > 0;\n },\n\n /**\n * Extend from other style\n * @param {zrender/graphic/Style} otherStyle\n * @param {boolean} overwrite true: overwrirte any way.\n * false: overwrite only when !target.hasOwnProperty\n * others: overwrite when property is not null/undefined.\n */\n extendFrom: function (otherStyle, overwrite) {\n if (otherStyle) {\n for (var name in otherStyle) {\n if (otherStyle.hasOwnProperty(name) && (overwrite === true || (overwrite === false ? !this.hasOwnProperty(name) : otherStyle[name] != null))) {\n this[name] = otherStyle[name];\n }\n }\n }\n },\n\n /**\n * Batch setting style with a given object\n * @param {Object|string} obj\n * @param {*} [obj]\n */\n set: function (obj, value) {\n if (typeof obj === 'string') {\n this[obj] = value;\n } else {\n this.extendFrom(obj, true);\n }\n },\n\n /**\n * Clone\n * @return {zrender/graphic/Style} [description]\n */\n clone: function () {\n var newStyle = new this.constructor();\n newStyle.extendFrom(this, true);\n return newStyle;\n },\n getGradient: function (ctx, obj, rect) {\n var method = obj.type === 'radial' ? createRadialGradient : createLinearGradient;\n var canvasGradient = method(ctx, obj, rect);\n var colorStops = obj.colorStops;\n\n for (var i = 0; i < colorStops.length; i++) {\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\n }\n\n return canvasGradient;\n }\n};\nvar styleProto = Style.prototype;\n\nfor (var i = 0; i < STYLE_COMMON_PROPS.length; i++) {\n var prop = STYLE_COMMON_PROPS[i];\n\n if (!(prop[0] in styleProto)) {\n styleProto[prop[0]] = prop[1];\n }\n} // Provide for others\n\n\nStyle.getGradient = styleProto.getGradient;\nvar _default = Style;\nmodule.exports = _default;","var Displayable = require(\"./Displayable\");\n\nvar zrUtil = require(\"../core/util\");\n\nvar textContain = require(\"../contain/text\");\n\nvar textHelper = require(\"./helper/text\");\n\nvar _constant = require(\"./constant\");\n\nvar ContextCachedBy = _constant.ContextCachedBy;\n\n/**\n * @alias zrender/graphic/Text\n * @extends module:zrender/graphic/Displayable\n * @constructor\n * @param {Object} opts\n */\nvar Text = function (opts) {\n // jshint ignore:line\n Displayable.call(this, opts);\n};\n\nText.prototype = {\n constructor: Text,\n type: 'text',\n brush: function (ctx, prevEl) {\n var style = this.style; // Optimize, avoid normalize every time.\n\n this.__dirty && textHelper.normalizeTextStyle(style, true); // Use props with prefix 'text'.\n\n style.fill = style.stroke = style.shadowBlur = style.shadowColor = style.shadowOffsetX = style.shadowOffsetY = null;\n var text = style.text; // Convert to string\n\n text != null && (text += ''); // Do not apply style.bind in Text node. Because the real bind job\n // is in textHelper.renderText, and performance of text render should\n // be considered.\n // style.bind(ctx, this, prevEl);\n\n if (!textHelper.needDrawText(text, style)) {\n // The current el.style is not applied\n // and should not be used as cache.\n ctx.__attrCachedBy = ContextCachedBy.NONE;\n return;\n }\n\n this.setTransform(ctx);\n textHelper.renderText(this, ctx, text, style, null, prevEl);\n this.restoreTransform(ctx);\n },\n getBoundingRect: function () {\n var style = this.style; // Optimize, avoid normalize every time.\n\n this.__dirty && textHelper.normalizeTextStyle(style, true);\n\n if (!this._rect) {\n var text = style.text;\n text != null ? text += '' : text = '';\n var rect = textContain.getBoundingRect(style.text + '', style.font, style.textAlign, style.textVerticalAlign, style.textPadding, style.textLineHeight, style.rich);\n rect.x += style.x || 0;\n rect.y += style.y || 0;\n\n if (textHelper.getStroke(style.textStroke, style.textStrokeWidth)) {\n var w = style.textStrokeWidth;\n rect.x -= w / 2;\n rect.y -= w / 2;\n rect.width += w;\n rect.height += w;\n }\n\n this._rect = rect;\n }\n\n return this._rect;\n }\n};\nzrUtil.inherits(Text, Displayable);\nvar _default = Text;\nmodule.exports = _default;","var ContextCachedBy = {\n NONE: 0,\n STYLE_BIND: 1,\n PLAIN_TEXT: 2\n}; // Avoid confused with 0/false.\n\nvar WILL_BE_RESTORED = 9;\nexports.ContextCachedBy = ContextCachedBy;\nexports.WILL_BE_RESTORED = WILL_BE_RESTORED;","var env = require(\"../../core/env\");\n\n// Fix weird bug in some version of IE11 (like 11.0.9600.178**),\n// where exception \"unexpected call to method or property access\"\n// might be thrown when calling ctx.fill or ctx.stroke after a path\n// whose area size is zero is drawn and ctx.clip() is called and\n// shadowBlur is set. See #4572, #3112, #5777.\n// (e.g.,\n// ctx.moveTo(10, 10);\n// ctx.lineTo(20, 10);\n// ctx.closePath();\n// ctx.clip();\n// ctx.shadowBlur = 10;\n// ...\n// ctx.fill();\n// )\nvar shadowTemp = [['shadowBlur', 0], ['shadowColor', '#000'], ['shadowOffsetX', 0], ['shadowOffsetY', 0]];\n\nfunction _default(orignalBrush) {\n // version string can be: '11.0'\n return env.browser.ie && env.browser.version >= 11 ? function () {\n var clipPaths = this.__clipPaths;\n var style = this.style;\n var modified;\n\n if (clipPaths) {\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n var shape = clipPath && clipPath.shape;\n var type = clipPath && clipPath.type;\n\n if (shape && (type === 'sector' && shape.startAngle === shape.endAngle || type === 'rect' && (!shape.width || !shape.height))) {\n for (var j = 0; j < shadowTemp.length; j++) {\n // It is save to put shadowTemp static, because shadowTemp\n // will be all modified each item brush called.\n shadowTemp[j][2] = style[shadowTemp[j][0]];\n style[shadowTemp[j][0]] = shadowTemp[j][1];\n }\n\n modified = true;\n break;\n }\n }\n }\n\n orignalBrush.apply(this, arguments);\n\n if (modified) {\n for (var j = 0; j < shadowTemp.length; j++) {\n style[shadowTemp[j][0]] = shadowTemp[j][2];\n }\n }\n } : orignalBrush;\n}\n\nmodule.exports = _default;","var SHADOW_PROPS = {\n 'shadowBlur': 1,\n 'shadowOffsetX': 1,\n 'shadowOffsetY': 1,\n 'textShadowBlur': 1,\n 'textShadowOffsetX': 1,\n 'textShadowOffsetY': 1,\n 'textBoxShadowBlur': 1,\n 'textBoxShadowOffsetX': 1,\n 'textBoxShadowOffsetY': 1\n};\n\nfunction _default(ctx, propName, value) {\n if (SHADOW_PROPS.hasOwnProperty(propName)) {\n return value *= ctx.dpr;\n }\n\n return value;\n}\n\nmodule.exports = _default;","var LRU = require(\"../../core/LRU\");\n\nvar globalImageCache = new LRU(50);\n/**\n * @param {string|HTMLImageElement|HTMLCanvasElement|Canvas} newImageOrSrc\n * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image\n */\n\nfunction findExistImage(newImageOrSrc) {\n if (typeof newImageOrSrc === 'string') {\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n return cachedImgObj && cachedImgObj.image;\n } else {\n return newImageOrSrc;\n }\n}\n/**\n * Caution: User should cache loaded images, but not just count on LRU.\n * Consider if required images more than LRU size, will dead loop occur?\n *\n * @param {string|HTMLImageElement|HTMLCanvasElement|Canvas} newImageOrSrc\n * @param {HTMLImageElement|HTMLCanvasElement|Canvas} image Existent image.\n * @param {module:zrender/Element} [hostEl] For calling `dirty`.\n * @param {Function} [cb] params: (image, cbPayload)\n * @param {Object} [cbPayload] Payload on cb calling.\n * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image\n */\n\n\nfunction createOrUpdateImage(newImageOrSrc, image, hostEl, cb, cbPayload) {\n if (!newImageOrSrc) {\n return image;\n } else if (typeof newImageOrSrc === 'string') {\n // Image should not be loaded repeatly.\n if (image && image.__zrImageSrc === newImageOrSrc || !hostEl) {\n return image;\n } // Only when there is no existent image or existent image src\n // is different, this method is responsible for load.\n\n\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n var pendingWrap = {\n hostEl: hostEl,\n cb: cb,\n cbPayload: cbPayload\n };\n\n if (cachedImgObj) {\n image = cachedImgObj.image;\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\n } else {\n image = new Image();\n image.onload = image.onerror = imageOnLoad;\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\n image: image,\n pending: [pendingWrap]\n });\n image.src = image.__zrImageSrc = newImageOrSrc;\n }\n\n return image;\n } // newImageOrSrc is an HTMLImageElement or HTMLCanvasElement or Canvas\n else {\n return newImageOrSrc;\n }\n}\n\nfunction imageOnLoad() {\n var cachedImgObj = this.__cachedImgObj;\n this.onload = this.onerror = this.__cachedImgObj = null;\n\n for (var i = 0; i < cachedImgObj.pending.length; i++) {\n var pendingWrap = cachedImgObj.pending[i];\n var cb = pendingWrap.cb;\n cb && cb(this, pendingWrap.cbPayload);\n pendingWrap.hostEl.dirty();\n }\n\n cachedImgObj.pending.length = 0;\n}\n\nfunction isImageReady(image) {\n return image && image.width && image.height;\n}\n\nexports.findExistImage = findExistImage;\nexports.createOrUpdateImage = createOrUpdateImage;\nexports.isImageReady = isImageReady;","var smoothSpline = require(\"./smoothSpline\");\n\nvar smoothBezier = require(\"./smoothBezier\");\n\nfunction buildPath(ctx, shape, closePath) {\n var points = shape.points;\n var smooth = shape.smooth;\n\n if (points && points.length >= 2) {\n if (smooth && smooth !== 'spline') {\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\n ctx.moveTo(points[0][0], points[0][1]);\n var len = points.length;\n\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\n var cp1 = controlPoints[i * 2];\n var cp2 = controlPoints[i * 2 + 1];\n var p = points[(i + 1) % len];\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\n }\n } else {\n if (smooth === 'spline') {\n points = smoothSpline(points, closePath);\n }\n\n ctx.moveTo(points[0][0], points[0][1]);\n\n for (var i = 1, l = points.length; i < l; i++) {\n ctx.lineTo(points[i][0], points[i][1]);\n }\n }\n\n closePath && ctx.closePath();\n }\n}\n\nexports.buildPath = buildPath;","/**\n * @param {Object} ctx\n * @param {Object} shape\n * @param {number} shape.x\n * @param {number} shape.y\n * @param {number} shape.width\n * @param {number} shape.height\n * @param {number} shape.r\n */\nfunction buildPath(ctx, shape) {\n var x = shape.x;\n var y = shape.y;\n var width = shape.width;\n var height = shape.height;\n var r = shape.r;\n var r1;\n var r2;\n var r3;\n var r4; // Convert width and height to positive for better borderRadius\n\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n\n if (typeof r === 'number') {\n r1 = r2 = r3 = r4 = r;\n } else if (r instanceof Array) {\n if (r.length === 1) {\n r1 = r2 = r3 = r4 = r[0];\n } else if (r.length === 2) {\n r1 = r3 = r[0];\n r2 = r4 = r[1];\n } else if (r.length === 3) {\n r1 = r[0];\n r2 = r4 = r[1];\n r3 = r[2];\n } else {\n r1 = r[0];\n r2 = r[1];\n r3 = r[2];\n r4 = r[3];\n }\n } else {\n r1 = r2 = r3 = r4 = 0;\n }\n\n var total;\n\n if (r1 + r2 > width) {\n total = r1 + r2;\n r1 *= width / total;\n r2 *= width / total;\n }\n\n if (r3 + r4 > width) {\n total = r3 + r4;\n r3 *= width / total;\n r4 *= width / total;\n }\n\n if (r2 + r3 > height) {\n total = r2 + r3;\n r2 *= height / total;\n r3 *= height / total;\n }\n\n if (r1 + r4 > height) {\n total = r1 + r4;\n r1 *= height / total;\n r4 *= height / total;\n }\n\n ctx.moveTo(x + r1, y);\n ctx.lineTo(x + width - r2, y);\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\n ctx.lineTo(x + width, y + height - r3);\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\n ctx.lineTo(x + r4, y + height);\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\n ctx.lineTo(x, y + r1);\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\n}\n\nexports.buildPath = buildPath;","var _vector = require(\"../../core/vector\");\n\nvar v2Min = _vector.min;\nvar v2Max = _vector.max;\nvar v2Scale = _vector.scale;\nvar v2Distance = _vector.distance;\nvar v2Add = _vector.add;\nvar v2Clone = _vector.clone;\nvar v2Sub = _vector.sub;\n\n/**\n * 贝塞尔平滑曲线\n * @module zrender/shape/util/smoothBezier\n * @author pissang (https://www.github.com/pissang)\n * Kener (@Kener-林峰, kener.linfeng@gmail.com)\n * errorrik (errorrik@gmail.com)\n */\n\n/**\n * 贝塞尔平滑曲线\n * @alias module:zrender/shape/util/smoothBezier\n * @param {Array} points 线段顶点数组\n * @param {number} smooth 平滑等级, 0-1\n * @param {boolean} isLoop\n * @param {Array} constraint 将计算出来的控制点约束在一个包围盒内\n * 比如 [[0, 0], [100, 100]], 这个包围盒会与\n * 整个折线的包围盒做一个并集用来约束控制点。\n * @param {Array} 计算出来的控制点数组\n */\nfunction _default(points, smooth, isLoop, constraint) {\n var cps = [];\n var v = [];\n var v1 = [];\n var v2 = [];\n var prevPoint;\n var nextPoint;\n var min;\n var max;\n\n if (constraint) {\n min = [Infinity, Infinity];\n max = [-Infinity, -Infinity];\n\n for (var i = 0, len = points.length; i < len; i++) {\n v2Min(min, min, points[i]);\n v2Max(max, max, points[i]);\n } // 与指定的包围盒做并集\n\n\n v2Min(min, min, constraint[0]);\n v2Max(max, max, constraint[1]);\n }\n\n for (var i = 0, len = points.length; i < len; i++) {\n var point = points[i];\n\n if (isLoop) {\n prevPoint = points[i ? i - 1 : len - 1];\n nextPoint = points[(i + 1) % len];\n } else {\n if (i === 0 || i === len - 1) {\n cps.push(v2Clone(points[i]));\n continue;\n } else {\n prevPoint = points[i - 1];\n nextPoint = points[i + 1];\n }\n }\n\n v2Sub(v, nextPoint, prevPoint); // use degree to scale the handle length\n\n v2Scale(v, v, smooth);\n var d0 = v2Distance(point, prevPoint);\n var d1 = v2Distance(point, nextPoint);\n var sum = d0 + d1;\n\n if (sum !== 0) {\n d0 /= sum;\n d1 /= sum;\n }\n\n v2Scale(v1, v, -d0);\n v2Scale(v2, v, d1);\n var cp0 = v2Add([], point, v1);\n var cp1 = v2Add([], point, v2);\n\n if (constraint) {\n v2Max(cp0, cp0, min);\n v2Min(cp0, cp0, max);\n v2Max(cp1, cp1, min);\n v2Min(cp1, cp1, max);\n }\n\n cps.push(cp0);\n cps.push(cp1);\n }\n\n if (isLoop) {\n cps.push(cps.shift());\n }\n\n return cps;\n}\n\nmodule.exports = _default;","var _vector = require(\"../../core/vector\");\n\nvar v2Distance = _vector.distance;\n\n/**\n * Catmull-Rom spline 插值折线\n * @module zrender/shape/util/smoothSpline\n * @author pissang (https://www.github.com/pissang)\n * Kener (@Kener-林峰, kener.linfeng@gmail.com)\n * errorrik (errorrik@gmail.com)\n */\n\n/**\n * @inner\n */\nfunction interpolate(p0, p1, p2, p3, t, t2, t3) {\n var v0 = (p2 - p0) * 0.5;\n var v1 = (p3 - p1) * 0.5;\n return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;\n}\n/**\n * @alias module:zrender/shape/util/smoothSpline\n * @param {Array} points 线段顶点数组\n * @param {boolean} isLoop\n * @return {Array}\n */\n\n\nfunction _default(points, isLoop) {\n var len = points.length;\n var ret = [];\n var distance = 0;\n\n for (var i = 1; i < len; i++) {\n distance += v2Distance(points[i - 1], points[i]);\n }\n\n var segs = distance / 2;\n segs = segs < len ? len : segs;\n\n for (var i = 0; i < segs; i++) {\n var pos = i / (segs - 1) * (isLoop ? len : len - 1);\n var idx = Math.floor(pos);\n var w = pos - idx;\n var p0;\n var p1 = points[idx % len];\n var p2;\n var p3;\n\n if (!isLoop) {\n p0 = points[idx === 0 ? idx : idx - 1];\n p2 = points[idx > len - 2 ? len - 1 : idx + 1];\n p3 = points[idx > len - 3 ? len - 1 : idx + 2];\n } else {\n p0 = points[(idx - 1 + len) % len];\n p2 = points[(idx + 1) % len];\n p3 = points[(idx + 2) % len];\n }\n\n var w2 = w * w;\n var w3 = w * w2;\n ret.push([interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3), interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)]);\n }\n\n return ret;\n}\n\nmodule.exports = _default;","/**\n * Sub-pixel optimize for canvas rendering, prevent from blur\n * when rendering a thin vertical/horizontal line.\n */\nvar round = Math.round;\n/**\n * Sub pixel optimize line for canvas\n *\n * @param {Object} outputShape The modification will be performed on `outputShape`.\n * `outputShape` and `inputShape` can be the same object.\n * `outputShape` object can be used repeatly, because all of\n * the `x1`, `x2`, `y1`, `y2` will be assigned in this method.\n * @param {Object} [inputShape]\n * @param {number} [inputShape.x1]\n * @param {number} [inputShape.y1]\n * @param {number} [inputShape.x2]\n * @param {number} [inputShape.y2]\n * @param {Object} [style]\n * @param {number} [style.lineWidth] If `null`/`undefined`/`0`, do not optimize.\n */\n\nfunction subPixelOptimizeLine(outputShape, inputShape, style) {\n if (!inputShape) {\n return;\n }\n\n var x1 = inputShape.x1;\n var x2 = inputShape.x2;\n var y1 = inputShape.y1;\n var y2 = inputShape.y2;\n outputShape.x1 = x1;\n outputShape.x2 = x2;\n outputShape.y1 = y1;\n outputShape.y2 = y2;\n var lineWidth = style && style.lineWidth;\n\n if (!lineWidth) {\n return;\n }\n\n if (round(x1 * 2) === round(x2 * 2)) {\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n }\n\n if (round(y1 * 2) === round(y2 * 2)) {\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n }\n}\n/**\n * Sub pixel optimize rect for canvas\n *\n * @param {Object} outputShape The modification will be performed on `outputShape`.\n * `outputShape` and `inputShape` can be the same object.\n * `outputShape` object can be used repeatly, because all of\n * the `x`, `y`, `width`, `height` will be assigned in this method.\n * @param {Object} [inputShape]\n * @param {number} [inputShape.x]\n * @param {number} [inputShape.y]\n * @param {number} [inputShape.width]\n * @param {number} [inputShape.height]\n * @param {Object} [style]\n * @param {number} [style.lineWidth] If `null`/`undefined`/`0`, do not optimize.\n */\n\n\nfunction subPixelOptimizeRect(outputShape, inputShape, style) {\n if (!inputShape) {\n return;\n }\n\n var originX = inputShape.x;\n var originY = inputShape.y;\n var originWidth = inputShape.width;\n var originHeight = inputShape.height;\n outputShape.x = originX;\n outputShape.y = originY;\n outputShape.width = originWidth;\n outputShape.height = originHeight;\n var lineWidth = style && style.lineWidth;\n\n if (!lineWidth) {\n return;\n }\n\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\n}\n/**\n * Sub pixel optimize for canvas\n *\n * @param {number} position Coordinate, such as x, y\n * @param {number} lineWidth If `null`/`undefined`/`0`, do not optimize.\n * @param {boolean=} positiveOrNegative Default false (negative).\n * @return {number} Optimized position.\n */\n\n\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\n if (!lineWidth) {\n return position;\n } // Assure that (position + lineWidth / 2) is near integer edge,\n // otherwise line will be fuzzy in canvas.\n\n\n var doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\n\nexports.subPixelOptimizeLine = subPixelOptimizeLine;\nexports.subPixelOptimizeRect = subPixelOptimizeRect;\nexports.subPixelOptimize = subPixelOptimize;","var _util = require(\"../../core/util\");\n\nvar retrieve2 = _util.retrieve2;\nvar retrieve3 = _util.retrieve3;\nvar each = _util.each;\nvar normalizeCssArray = _util.normalizeCssArray;\nvar isString = _util.isString;\nvar isObject = _util.isObject;\n\nvar textContain = require(\"../../contain/text\");\n\nvar roundRectHelper = require(\"./roundRect\");\n\nvar imageHelper = require(\"./image\");\n\nvar fixShadow = require(\"./fixShadow\");\n\nvar _constant = require(\"../constant\");\n\nvar ContextCachedBy = _constant.ContextCachedBy;\nvar WILL_BE_RESTORED = _constant.WILL_BE_RESTORED;\nvar DEFAULT_FONT = textContain.DEFAULT_FONT; // TODO: Have not support 'start', 'end' yet.\n\nvar VALID_TEXT_ALIGN = {\n left: 1,\n right: 1,\n center: 1\n};\nvar VALID_TEXT_VERTICAL_ALIGN = {\n top: 1,\n bottom: 1,\n middle: 1\n}; // Different from `STYLE_COMMON_PROPS` of `graphic/Style`,\n// the default value of shadowColor is `'transparent'`.\n\nvar SHADOW_STYLE_COMMON_PROPS = [['textShadowBlur', 'shadowBlur', 0], ['textShadowOffsetX', 'shadowOffsetX', 0], ['textShadowOffsetY', 'shadowOffsetY', 0], ['textShadowColor', 'shadowColor', 'transparent']];\nvar _tmpTextPositionResult = {};\nvar _tmpBoxPositionResult = {};\n/**\n * @param {module:zrender/graphic/Style} style\n * @return {module:zrender/graphic/Style} The input style.\n */\n\nfunction normalizeTextStyle(style) {\n normalizeStyle(style);\n each(style.rich, normalizeStyle);\n return style;\n}\n\nfunction normalizeStyle(style) {\n if (style) {\n style.font = textContain.makeFont(style);\n var textAlign = style.textAlign;\n textAlign === 'middle' && (textAlign = 'center');\n style.textAlign = textAlign == null || VALID_TEXT_ALIGN[textAlign] ? textAlign : 'left'; // Compatible with textBaseline.\n\n var textVerticalAlign = style.textVerticalAlign || style.textBaseline;\n textVerticalAlign === 'center' && (textVerticalAlign = 'middle');\n style.textVerticalAlign = textVerticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[textVerticalAlign] ? textVerticalAlign : 'top';\n var textPadding = style.textPadding;\n\n if (textPadding) {\n style.textPadding = normalizeCssArray(style.textPadding);\n }\n }\n}\n/**\n * @param {CanvasRenderingContext2D} ctx\n * @param {string} text\n * @param {module:zrender/graphic/Style} style\n * @param {Object|boolean} [rect] {x, y, width, height}\n * If set false, rect text is not used.\n * @param {Element|module:zrender/graphic/helper/constant.WILL_BE_RESTORED} [prevEl] For ctx prop cache.\n */\n\n\nfunction renderText(hostEl, ctx, text, style, rect, prevEl) {\n style.rich ? renderRichText(hostEl, ctx, text, style, rect, prevEl) : renderPlainText(hostEl, ctx, text, style, rect, prevEl);\n} // Avoid setting to ctx according to prevEl if possible for\n// performance in scenarios of large amount text.\n\n\nfunction renderPlainText(hostEl, ctx, text, style, rect, prevEl) {\n 'use strict';\n\n var needDrawBg = needDrawBackground(style);\n var prevStyle;\n var checkCache = false;\n var cachedByMe = ctx.__attrCachedBy === ContextCachedBy.PLAIN_TEXT; // Only take and check cache for `Text` el, but not RectText.\n\n if (prevEl !== WILL_BE_RESTORED) {\n if (prevEl) {\n prevStyle = prevEl.style;\n checkCache = !needDrawBg && cachedByMe && prevStyle;\n } // Prevent from using cache in `Style::bind`, because of the case:\n // ctx property is modified by other properties than `Style::bind`\n // used, and Style::bind is called next.\n\n\n ctx.__attrCachedBy = needDrawBg ? ContextCachedBy.NONE : ContextCachedBy.PLAIN_TEXT;\n } // Since this will be restored, prevent from using these props to check cache in the next\n // entering of this method. But do not need to clear other cache like `Style::bind`.\n else if (cachedByMe) {\n ctx.__attrCachedBy = ContextCachedBy.NONE;\n }\n\n var styleFont = style.font || DEFAULT_FONT; // PENDING\n // Only `Text` el set `font` and keep it (`RectText` will restore). So theoretically\n // we can make font cache on ctx, which can cache for text el that are discontinuous.\n // But layer save/restore needed to be considered.\n // if (styleFont !== ctx.__fontCache) {\n // ctx.font = styleFont;\n // if (prevEl !== WILL_BE_RESTORED) {\n // ctx.__fontCache = styleFont;\n // }\n // }\n\n if (!checkCache || styleFont !== (prevStyle.font || DEFAULT_FONT)) {\n ctx.font = styleFont;\n } // Use the final font from context-2d, because the final\n // font might not be the style.font when it is illegal.\n // But get `ctx.font` might be time consuming.\n\n\n var computedFont = hostEl.__computedFont;\n\n if (hostEl.__styleFont !== styleFont) {\n hostEl.__styleFont = styleFont;\n computedFont = hostEl.__computedFont = ctx.font;\n }\n\n var textPadding = style.textPadding;\n var textLineHeight = style.textLineHeight;\n var contentBlock = hostEl.__textCotentBlock;\n\n if (!contentBlock || hostEl.__dirtyText) {\n contentBlock = hostEl.__textCotentBlock = textContain.parsePlainText(text, computedFont, textPadding, textLineHeight, style.truncate);\n }\n\n var outerHeight = contentBlock.outerHeight;\n var textLines = contentBlock.lines;\n var lineHeight = contentBlock.lineHeight;\n var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect);\n var baseX = boxPos.baseX;\n var baseY = boxPos.baseY;\n var textAlign = boxPos.textAlign || 'left';\n var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing.\n\n applyTextRotation(ctx, style, rect, baseX, baseY);\n var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);\n var textX = baseX;\n var textY = boxY;\n\n if (needDrawBg || textPadding) {\n // Consider performance, do not call getTextWidth util necessary.\n var textWidth = textContain.getWidth(text, computedFont);\n var outerWidth = textWidth;\n textPadding && (outerWidth += textPadding[1] + textPadding[3]);\n var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);\n needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight);\n\n if (textPadding) {\n textX = getTextXForPadding(baseX, textAlign, textPadding);\n textY += textPadding[0];\n }\n } // Always set textAlign and textBase line, because it is difficute to calculate\n // textAlign from prevEl, and we dont sure whether textAlign will be reset if\n // font set happened.\n\n\n ctx.textAlign = textAlign; // Force baseline to be \"middle\". Otherwise, if using \"top\", the\n // text will offset downward a little bit in font \"Microsoft YaHei\".\n\n ctx.textBaseline = 'middle'; // Set text opacity\n\n ctx.globalAlpha = style.opacity || 1; // Always set shadowBlur and shadowOffset to avoid leak from displayable.\n\n for (var i = 0; i < SHADOW_STYLE_COMMON_PROPS.length; i++) {\n var propItem = SHADOW_STYLE_COMMON_PROPS[i];\n var styleProp = propItem[0];\n var ctxProp = propItem[1];\n var val = style[styleProp];\n\n if (!checkCache || val !== prevStyle[styleProp]) {\n ctx[ctxProp] = fixShadow(ctx, ctxProp, val || propItem[2]);\n }\n } // `textBaseline` is set as 'middle'.\n\n\n textY += lineHeight / 2;\n var textStrokeWidth = style.textStrokeWidth;\n var textStrokeWidthPrev = checkCache ? prevStyle.textStrokeWidth : null;\n var strokeWidthChanged = !checkCache || textStrokeWidth !== textStrokeWidthPrev;\n var strokeChanged = !checkCache || strokeWidthChanged || style.textStroke !== prevStyle.textStroke;\n var textStroke = getStroke(style.textStroke, textStrokeWidth);\n var textFill = getFill(style.textFill);\n\n if (textStroke) {\n if (strokeWidthChanged) {\n ctx.lineWidth = textStrokeWidth;\n }\n\n if (strokeChanged) {\n ctx.strokeStyle = textStroke;\n }\n }\n\n if (textFill) {\n if (!checkCache || style.textFill !== prevStyle.textFill) {\n ctx.fillStyle = textFill;\n }\n } // Optimize simply, in most cases only one line exists.\n\n\n if (textLines.length === 1) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[0], textX, textY);\n textFill && ctx.fillText(textLines[0], textX, textY);\n } else {\n for (var i = 0; i < textLines.length; i++) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[i], textX, textY);\n textFill && ctx.fillText(textLines[i], textX, textY);\n textY += lineHeight;\n }\n }\n}\n\nfunction renderRichText(hostEl, ctx, text, style, rect, prevEl) {\n // Do not do cache for rich text because of the complexity.\n // But `RectText` this will be restored, do not need to clear other cache like `Style::bind`.\n if (prevEl !== WILL_BE_RESTORED) {\n ctx.__attrCachedBy = ContextCachedBy.NONE;\n }\n\n var contentBlock = hostEl.__textCotentBlock;\n\n if (!contentBlock || hostEl.__dirtyText) {\n contentBlock = hostEl.__textCotentBlock = textContain.parseRichText(text, style);\n }\n\n drawRichText(hostEl, ctx, contentBlock, style, rect);\n}\n\nfunction drawRichText(hostEl, ctx, contentBlock, style, rect) {\n var contentWidth = contentBlock.width;\n var outerWidth = contentBlock.outerWidth;\n var outerHeight = contentBlock.outerHeight;\n var textPadding = style.textPadding;\n var boxPos = getBoxPosition(_tmpBoxPositionResult, hostEl, style, rect);\n var baseX = boxPos.baseX;\n var baseY = boxPos.baseY;\n var textAlign = boxPos.textAlign;\n var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing.\n\n applyTextRotation(ctx, style, rect, baseX, baseY);\n var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);\n var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);\n var xLeft = boxX;\n var lineTop = boxY;\n\n if (textPadding) {\n xLeft += textPadding[3];\n lineTop += textPadding[0];\n }\n\n var xRight = xLeft + contentWidth;\n needDrawBackground(style) && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight);\n\n for (var i = 0; i < contentBlock.lines.length; i++) {\n var line = contentBlock.lines[i];\n var tokens = line.tokens;\n var tokenCount = tokens.length;\n var lineHeight = line.lineHeight;\n var usedWidth = line.width;\n var leftIndex = 0;\n var lineXLeft = xLeft;\n var lineXRight = xRight;\n var rightIndex = tokenCount - 1;\n var token;\n\n while (leftIndex < tokenCount && (token = tokens[leftIndex], !token.textAlign || token.textAlign === 'left')) {\n placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft, 'left');\n usedWidth -= token.width;\n lineXLeft += token.width;\n leftIndex++;\n }\n\n while (rightIndex >= 0 && (token = tokens[rightIndex], token.textAlign === 'right')) {\n placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXRight, 'right');\n usedWidth -= token.width;\n lineXRight -= token.width;\n rightIndex--;\n } // The other tokens are placed as textAlign 'center' if there is enough space.\n\n\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - usedWidth) / 2;\n\n while (leftIndex <= rightIndex) {\n token = tokens[leftIndex]; // Consider width specified by user, use 'center' rather than 'left'.\n\n placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center');\n lineXLeft += token.width;\n leftIndex++;\n }\n\n lineTop += lineHeight;\n }\n}\n\nfunction applyTextRotation(ctx, style, rect, x, y) {\n // textRotation only apply in RectText.\n if (rect && style.textRotation) {\n var origin = style.textOrigin;\n\n if (origin === 'center') {\n x = rect.width / 2 + rect.x;\n y = rect.height / 2 + rect.y;\n } else if (origin) {\n x = origin[0] + rect.x;\n y = origin[1] + rect.y;\n }\n\n ctx.translate(x, y); // Positive: anticlockwise\n\n ctx.rotate(-style.textRotation);\n ctx.translate(-x, -y);\n }\n}\n\nfunction placeToken(hostEl, ctx, token, style, lineHeight, lineTop, x, textAlign) {\n var tokenStyle = style.rich[token.styleName] || {};\n tokenStyle.text = token.text; // 'ctx.textBaseline' is always set as 'middle', for sake of\n // the bias of \"Microsoft YaHei\".\n\n var textVerticalAlign = token.textVerticalAlign;\n var y = lineTop + lineHeight / 2;\n\n if (textVerticalAlign === 'top') {\n y = lineTop + token.height / 2;\n } else if (textVerticalAlign === 'bottom') {\n y = lineTop + lineHeight - token.height / 2;\n }\n\n !token.isLineHolder && needDrawBackground(tokenStyle) && drawBackground(hostEl, ctx, tokenStyle, textAlign === 'right' ? x - token.width : textAlign === 'center' ? x - token.width / 2 : x, y - token.height / 2, token.width, token.height);\n var textPadding = token.textPadding;\n\n if (textPadding) {\n x = getTextXForPadding(x, textAlign, textPadding);\n y -= token.height / 2 - textPadding[2] - token.textHeight / 2;\n }\n\n setCtx(ctx, 'shadowBlur', retrieve3(tokenStyle.textShadowBlur, style.textShadowBlur, 0));\n setCtx(ctx, 'shadowColor', tokenStyle.textShadowColor || style.textShadowColor || 'transparent');\n setCtx(ctx, 'shadowOffsetX', retrieve3(tokenStyle.textShadowOffsetX, style.textShadowOffsetX, 0));\n setCtx(ctx, 'shadowOffsetY', retrieve3(tokenStyle.textShadowOffsetY, style.textShadowOffsetY, 0));\n setCtx(ctx, 'textAlign', textAlign); // Force baseline to be \"middle\". Otherwise, if using \"top\", the\n // text will offset downward a little bit in font \"Microsoft YaHei\".\n\n setCtx(ctx, 'textBaseline', 'middle');\n setCtx(ctx, 'font', token.font || DEFAULT_FONT);\n var textStroke = getStroke(tokenStyle.textStroke || style.textStroke, textStrokeWidth);\n var textFill = getFill(tokenStyle.textFill || style.textFill);\n var textStrokeWidth = retrieve2(tokenStyle.textStrokeWidth, style.textStrokeWidth); // Fill after stroke so the outline will not cover the main part.\n\n if (textStroke) {\n setCtx(ctx, 'lineWidth', textStrokeWidth);\n setCtx(ctx, 'strokeStyle', textStroke);\n ctx.strokeText(token.text, x, y);\n }\n\n if (textFill) {\n setCtx(ctx, 'fillStyle', textFill);\n ctx.fillText(token.text, x, y);\n }\n}\n\nfunction needDrawBackground(style) {\n return !!(style.textBackgroundColor || style.textBorderWidth && style.textBorderColor);\n} // style: {textBackgroundColor, textBorderWidth, textBorderColor, textBorderRadius, text}\n// shape: {x, y, width, height}\n\n\nfunction drawBackground(hostEl, ctx, style, x, y, width, height) {\n var textBackgroundColor = style.textBackgroundColor;\n var textBorderWidth = style.textBorderWidth;\n var textBorderColor = style.textBorderColor;\n var isPlainBg = isString(textBackgroundColor);\n setCtx(ctx, 'shadowBlur', style.textBoxShadowBlur || 0);\n setCtx(ctx, 'shadowColor', style.textBoxShadowColor || 'transparent');\n setCtx(ctx, 'shadowOffsetX', style.textBoxShadowOffsetX || 0);\n setCtx(ctx, 'shadowOffsetY', style.textBoxShadowOffsetY || 0);\n\n if (isPlainBg || textBorderWidth && textBorderColor) {\n ctx.beginPath();\n var textBorderRadius = style.textBorderRadius;\n\n if (!textBorderRadius) {\n ctx.rect(x, y, width, height);\n } else {\n roundRectHelper.buildPath(ctx, {\n x: x,\n y: y,\n width: width,\n height: height,\n r: textBorderRadius\n });\n }\n\n ctx.closePath();\n }\n\n if (isPlainBg) {\n setCtx(ctx, 'fillStyle', textBackgroundColor);\n\n if (style.fillOpacity != null) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.fillOpacity * style.opacity;\n ctx.fill();\n ctx.globalAlpha = originalGlobalAlpha;\n } else {\n ctx.fill();\n }\n } else if (isObject(textBackgroundColor)) {\n var image = textBackgroundColor.image;\n image = imageHelper.createOrUpdateImage(image, null, hostEl, onBgImageLoaded, textBackgroundColor);\n\n if (image && imageHelper.isImageReady(image)) {\n ctx.drawImage(image, x, y, width, height);\n }\n }\n\n if (textBorderWidth && textBorderColor) {\n setCtx(ctx, 'lineWidth', textBorderWidth);\n setCtx(ctx, 'strokeStyle', textBorderColor);\n\n if (style.strokeOpacity != null) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\n ctx.stroke();\n ctx.globalAlpha = originalGlobalAlpha;\n } else {\n ctx.stroke();\n }\n }\n}\n\nfunction onBgImageLoaded(image, textBackgroundColor) {\n // Replace image, so that `contain/text.js#parseRichText`\n // will get correct result in next tick.\n textBackgroundColor.image = image;\n}\n\nfunction getBoxPosition(out, hostEl, style, rect) {\n var baseX = style.x || 0;\n var baseY = style.y || 0;\n var textAlign = style.textAlign;\n var textVerticalAlign = style.textVerticalAlign; // Text position represented by coord\n\n if (rect) {\n var textPosition = style.textPosition;\n\n if (textPosition instanceof Array) {\n // Percent\n baseX = rect.x + parsePercent(textPosition[0], rect.width);\n baseY = rect.y + parsePercent(textPosition[1], rect.height);\n } else {\n var res = hostEl && hostEl.calculateTextPosition ? hostEl.calculateTextPosition(_tmpTextPositionResult, style, rect) : textContain.calculateTextPosition(_tmpTextPositionResult, style, rect);\n baseX = res.x;\n baseY = res.y; // Default align and baseline when has textPosition\n\n textAlign = textAlign || res.textAlign;\n textVerticalAlign = textVerticalAlign || res.textVerticalAlign;\n } // textOffset is only support in RectText, otherwise\n // we have to adjust boundingRect for textOffset.\n\n\n var textOffset = style.textOffset;\n\n if (textOffset) {\n baseX += textOffset[0];\n baseY += textOffset[1];\n }\n }\n\n out = out || {};\n out.baseX = baseX;\n out.baseY = baseY;\n out.textAlign = textAlign;\n out.textVerticalAlign = textVerticalAlign;\n return out;\n}\n\nfunction setCtx(ctx, prop, value) {\n ctx[prop] = fixShadow(ctx, prop, value);\n return ctx[prop];\n}\n/**\n * @param {string} [stroke] If specified, do not check style.textStroke.\n * @param {string} [lineWidth] If specified, do not check style.textStroke.\n * @param {number} style\n */\n\n\nfunction getStroke(stroke, lineWidth) {\n return stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none' ? null // TODO pattern and gradient?\n : stroke.image || stroke.colorStops ? '#000' : stroke;\n}\n\nfunction getFill(fill) {\n return fill == null || fill === 'none' ? null // TODO pattern and gradient?\n : fill.image || fill.colorStops ? '#000' : fill;\n}\n\nfunction parsePercent(value, maxValue) {\n if (typeof value === 'string') {\n if (value.lastIndexOf('%') >= 0) {\n return parseFloat(value) / 100 * maxValue;\n }\n\n return parseFloat(value);\n }\n\n return value;\n}\n\nfunction getTextXForPadding(x, textAlign, textPadding) {\n return textAlign === 'right' ? x - textPadding[1] : textAlign === 'center' ? x + textPadding[3] / 2 - textPadding[1] / 2 : x + textPadding[3];\n}\n/**\n * @param {string} text\n * @param {module:zrender/Style} style\n * @return {boolean}\n */\n\n\nfunction needDrawText(text, style) {\n return text != null && (text || style.textBackgroundColor || style.textBorderWidth && style.textBorderColor || style.textPadding);\n}\n\nexports.normalizeTextStyle = normalizeTextStyle;\nexports.renderText = renderText;\nexports.getBoxPosition = getBoxPosition;\nexports.getStroke = getStroke;\nexports.getFill = getFill;\nexports.parsePercent = parsePercent;\nexports.needDrawText = needDrawText;","var textHelper = require(\"../helper/text\");\n\nvar BoundingRect = require(\"../../core/BoundingRect\");\n\nvar _constant = require(\"../constant\");\n\nvar WILL_BE_RESTORED = _constant.WILL_BE_RESTORED;\n\n/**\n * Mixin for drawing text in a element bounding rect\n * @module zrender/mixin/RectText\n */\nvar tmpRect = new BoundingRect();\n\nvar RectText = function () {};\n\nRectText.prototype = {\n constructor: RectText,\n\n /**\n * Draw text in a rect with specified position.\n * @param {CanvasRenderingContext2D} ctx\n * @param {Object} rect Displayable rect\n */\n drawRectText: function (ctx, rect) {\n var style = this.style;\n rect = style.textRect || rect; // Optimize, avoid normalize every time.\n\n this.__dirty && textHelper.normalizeTextStyle(style, true);\n var text = style.text; // Convert to string\n\n text != null && (text += '');\n\n if (!textHelper.needDrawText(text, style)) {\n return;\n } // FIXME\n // Do not provide prevEl to `textHelper.renderText` for ctx prop cache,\n // but use `ctx.save()` and `ctx.restore()`. Because the cache for rect\n // text propably break the cache for its host elements.\n\n\n ctx.save(); // Transform rect to view space\n\n var transform = this.transform;\n\n if (!style.transformText) {\n if (transform) {\n tmpRect.copy(rect);\n tmpRect.applyTransform(transform);\n rect = tmpRect;\n }\n } else {\n this.setTransform(ctx);\n } // transformText and textRotation can not be used at the same time.\n\n\n textHelper.renderText(this, ctx, text, style, rect, WILL_BE_RESTORED);\n ctx.restore();\n }\n};\nvar _default = RectText;\nmodule.exports = _default;","var Path = require(\"../Path\");\n\n/**\n * 圆弧\n * @module zrender/graphic/shape/Arc\n */\nvar _default = Path.extend({\n type: 'arc',\n shape: {\n cx: 0,\n cy: 0,\n r: 0,\n startAngle: 0,\n endAngle: Math.PI * 2,\n clockwise: true\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var r = Math.max(shape.r, 0);\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var clockwise = shape.clockwise;\n var unitX = Math.cos(startAngle);\n var unitY = Math.sin(startAngle);\n ctx.moveTo(unitX * r + x, unitY * r + y);\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\nvar vec2 = require(\"../../core/vector\");\n\nvar _curve = require(\"../../core/curve\");\n\nvar quadraticSubdivide = _curve.quadraticSubdivide;\nvar cubicSubdivide = _curve.cubicSubdivide;\nvar quadraticAt = _curve.quadraticAt;\nvar cubicAt = _curve.cubicAt;\nvar quadraticDerivativeAt = _curve.quadraticDerivativeAt;\nvar cubicDerivativeAt = _curve.cubicDerivativeAt;\n\n/**\n * 贝塞尔曲线\n * @module zrender/shape/BezierCurve\n */\nvar out = [];\n\nfunction someVectorAt(shape, t, isTangent) {\n var cpx2 = shape.cpx2;\n var cpy2 = shape.cpy2;\n\n if (cpx2 === null || cpy2 === null) {\n return [(isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t), (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)];\n } else {\n return [(isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t), (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)];\n }\n}\n\nvar _default = Path.extend({\n type: 'bezier-curve',\n shape: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n cpx1: 0,\n cpy1: 0,\n // cpx2: 0,\n // cpy2: 0\n // Curve show percent, for animating\n percent: 1\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n var x1 = shape.x1;\n var y1 = shape.y1;\n var x2 = shape.x2;\n var y2 = shape.y2;\n var cpx1 = shape.cpx1;\n var cpy1 = shape.cpy1;\n var cpx2 = shape.cpx2;\n var cpy2 = shape.cpy2;\n var percent = shape.percent;\n\n if (percent === 0) {\n return;\n }\n\n ctx.moveTo(x1, y1);\n\n if (cpx2 == null || cpy2 == null) {\n if (percent < 1) {\n quadraticSubdivide(x1, cpx1, x2, percent, out);\n cpx1 = out[1];\n x2 = out[2];\n quadraticSubdivide(y1, cpy1, y2, percent, out);\n cpy1 = out[1];\n y2 = out[2];\n }\n\n ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\n } else {\n if (percent < 1) {\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\n cpx1 = out[1];\n cpx2 = out[2];\n x2 = out[3];\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\n cpy1 = out[1];\n cpy2 = out[2];\n y2 = out[3];\n }\n\n ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\n }\n },\n\n /**\n * Get point at percent\n * @param {number} t\n * @return {Array.}\n */\n pointAt: function (t) {\n return someVectorAt(this.shape, t, false);\n },\n\n /**\n * Get tangent at percent\n * @param {number} t\n * @return {Array.}\n */\n tangentAt: function (t) {\n var p = someVectorAt(this.shape, t, true);\n return vec2.normalize(p, p);\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\n/**\n * 圆形\n * @module zrender/shape/Circle\n */\nvar _default = Path.extend({\n type: 'circle',\n shape: {\n cx: 0,\n cy: 0,\n r: 0\n },\n buildPath: function (ctx, shape, inBundle) {\n // Better stroking in ShapeBundle\n // Always do it may have performence issue ( fill may be 2x more cost)\n if (inBundle) {\n ctx.moveTo(shape.cx + shape.r, shape.cy);\n } // else {\n // if (ctx.allocate && !ctx.data.length) {\n // ctx.allocate(ctx.CMD_MEM_SIZE.A);\n // }\n // }\n // Better stroking in ShapeBundle\n // ctx.moveTo(shape.cx + shape.r, shape.cy);\n\n\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2, true);\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\n/**\n * 椭圆形状\n * @module zrender/graphic/shape/Ellipse\n */\nvar _default = Path.extend({\n type: 'ellipse',\n shape: {\n cx: 0,\n cy: 0,\n rx: 0,\n ry: 0\n },\n buildPath: function (ctx, shape) {\n var k = 0.5522848;\n var x = shape.cx;\n var y = shape.cy;\n var a = shape.rx;\n var b = shape.ry;\n var ox = a * k; // 水平控制点偏移量\n\n var oy = b * k; // 垂直控制点偏移量\n // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线\n\n ctx.moveTo(x - a, y);\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\n ctx.closePath();\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\nvar _subPixelOptimize = require(\"../helper/subPixelOptimize\");\n\nvar subPixelOptimizeLine = _subPixelOptimize.subPixelOptimizeLine;\n\n/**\n * 直线\n * @module zrender/graphic/shape/Line\n */\n// Avoid create repeatly.\nvar subPixelOptimizeOutputShape = {};\n\nvar _default = Path.extend({\n type: 'line',\n shape: {\n // Start point\n x1: 0,\n y1: 0,\n // End point\n x2: 0,\n y2: 0,\n percent: 1\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n var x1;\n var y1;\n var x2;\n var y2;\n\n if (this.subPixelOptimize) {\n subPixelOptimizeLine(subPixelOptimizeOutputShape, shape, this.style);\n x1 = subPixelOptimizeOutputShape.x1;\n y1 = subPixelOptimizeOutputShape.y1;\n x2 = subPixelOptimizeOutputShape.x2;\n y2 = subPixelOptimizeOutputShape.y2;\n } else {\n x1 = shape.x1;\n y1 = shape.y1;\n x2 = shape.x2;\n y2 = shape.y2;\n }\n\n var percent = shape.percent;\n\n if (percent === 0) {\n return;\n }\n\n ctx.moveTo(x1, y1);\n\n if (percent < 1) {\n x2 = x1 * (1 - percent) + x2 * percent;\n y2 = y1 * (1 - percent) + y2 * percent;\n }\n\n ctx.lineTo(x2, y2);\n },\n\n /**\n * Get point at percent\n * @param {number} percent\n * @return {Array.}\n */\n pointAt: function (p) {\n var shape = this.shape;\n return [shape.x1 * (1 - p) + shape.x2 * p, shape.y1 * (1 - p) + shape.y2 * p];\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\nvar polyHelper = require(\"../helper/poly\");\n\n/**\n * 多边形\n * @module zrender/shape/Polygon\n */\nvar _default = Path.extend({\n type: 'polygon',\n shape: {\n points: null,\n smooth: false,\n smoothConstraint: null\n },\n buildPath: function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, true);\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\nvar polyHelper = require(\"../helper/poly\");\n\n/**\n * @module zrender/graphic/shape/Polyline\n */\nvar _default = Path.extend({\n type: 'polyline',\n shape: {\n points: null,\n smooth: false,\n smoothConstraint: null\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, false);\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\nvar roundRectHelper = require(\"../helper/roundRect\");\n\nvar _subPixelOptimize = require(\"../helper/subPixelOptimize\");\n\nvar subPixelOptimizeRect = _subPixelOptimize.subPixelOptimizeRect;\n\n/**\n * 矩形\n * @module zrender/graphic/shape/Rect\n */\n// Avoid create repeatly.\nvar subPixelOptimizeOutputShape = {};\n\nvar _default = Path.extend({\n type: 'rect',\n shape: {\n // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4\n // r缩写为1 相当于 [1, 1, 1, 1]\n // r缩写为[1] 相当于 [1, 1, 1, 1]\n // r缩写为[1, 2] 相当于 [1, 2, 1, 2]\n // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2]\n r: 0,\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n buildPath: function (ctx, shape) {\n var x;\n var y;\n var width;\n var height;\n\n if (this.subPixelOptimize) {\n subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\n x = subPixelOptimizeOutputShape.x;\n y = subPixelOptimizeOutputShape.y;\n width = subPixelOptimizeOutputShape.width;\n height = subPixelOptimizeOutputShape.height;\n subPixelOptimizeOutputShape.r = shape.r;\n shape = subPixelOptimizeOutputShape;\n } else {\n x = shape.x;\n y = shape.y;\n width = shape.width;\n height = shape.height;\n }\n\n if (!shape.r) {\n ctx.rect(x, y, width, height);\n } else {\n roundRectHelper.buildPath(ctx, shape);\n }\n\n ctx.closePath();\n return;\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\n/**\n * 圆环\n * @module zrender/graphic/shape/Ring\n */\nvar _default = Path.extend({\n type: 'ring',\n shape: {\n cx: 0,\n cy: 0,\n r: 0,\n r0: 0\n },\n buildPath: function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var PI2 = Math.PI * 2;\n ctx.moveTo(x + shape.r, y);\n ctx.arc(x, y, shape.r, 0, PI2, false);\n ctx.moveTo(x + shape.r0, y);\n ctx.arc(x, y, shape.r0, 0, PI2, true);\n }\n});\n\nmodule.exports = _default;","var Path = require(\"../Path\");\n\nvar fixClipWithShadow = require(\"../helper/fixClipWithShadow\");\n\n/**\n * 扇形\n * @module zrender/graphic/shape/Sector\n */\nvar _default = Path.extend({\n type: 'sector',\n shape: {\n cx: 0,\n cy: 0,\n r0: 0,\n r: 0,\n startAngle: 0,\n endAngle: Math.PI * 2,\n clockwise: true\n },\n brush: fixClipWithShadow(Path.prototype.brush),\n buildPath: function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var r0 = Math.max(shape.r0 || 0, 0);\n var r = Math.max(shape.r, 0);\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var clockwise = shape.clockwise;\n var unitX = Math.cos(startAngle);\n var unitY = Math.sin(startAngle);\n ctx.moveTo(unitX * r0 + x, unitY * r0 + y);\n ctx.lineTo(unitX * r + x, unitY * r + y);\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\n ctx.lineTo(Math.cos(endAngle) * r0 + x, Math.sin(endAngle) * r0 + y);\n\n if (r0 !== 0) {\n ctx.arc(x, y, r0, endAngle, startAngle, clockwise);\n }\n\n ctx.closePath();\n }\n});\n\nmodule.exports = _default;","var Animator = require(\"../animation/Animator\");\n\nvar logError = require(\"../core/log\");\n\nvar _util = require(\"../core/util\");\n\nvar isString = _util.isString;\nvar isFunction = _util.isFunction;\nvar isObject = _util.isObject;\nvar isArrayLike = _util.isArrayLike;\nvar indexOf = _util.indexOf;\n\n/**\n * @alias module:zrender/mixin/Animatable\n * @constructor\n */\nvar Animatable = function () {\n /**\n * @type {Array.}\n * @readOnly\n */\n this.animators = [];\n};\n\nAnimatable.prototype = {\n constructor: Animatable,\n\n /**\n * 动画\n *\n * @param {string} path The path to fetch value from object, like 'a.b.c'.\n * @param {boolean} [loop] Whether to loop animation.\n * @return {module:zrender/animation/Animator}\n * @example:\n * el.animate('style', false)\n * .when(1000, {x: 10} )\n * .done(function(){ // Animation done })\n * .start()\n */\n animate: function (path, loop) {\n var target;\n var animatingShape = false;\n var el = this;\n var zr = this.__zr;\n\n if (path) {\n var pathSplitted = path.split('.');\n var prop = el; // If animating shape\n\n animatingShape = pathSplitted[0] === 'shape';\n\n for (var i = 0, l = pathSplitted.length; i < l; i++) {\n if (!prop) {\n continue;\n }\n\n prop = prop[pathSplitted[i]];\n }\n\n if (prop) {\n target = prop;\n }\n } else {\n target = el;\n }\n\n if (!target) {\n logError('Property \"' + path + '\" is not existed in element ' + el.id);\n return;\n }\n\n var animators = el.animators;\n var animator = new Animator(target, loop);\n animator.during(function (target) {\n el.dirty(animatingShape);\n }).done(function () {\n // FIXME Animator will not be removed if use `Animator#stop` to stop animation\n animators.splice(indexOf(animators, animator), 1);\n });\n animators.push(animator); // If animate after added to the zrender\n\n if (zr) {\n zr.animation.addAnimator(animator);\n }\n\n return animator;\n },\n\n /**\n * 停止动画\n * @param {boolean} forwardToLast If move to last frame before stop\n */\n stopAnimation: function (forwardToLast) {\n var animators = this.animators;\n var len = animators.length;\n\n for (var i = 0; i < len; i++) {\n animators[i].stop(forwardToLast);\n }\n\n animators.length = 0;\n return this;\n },\n\n /**\n * Caution: this method will stop previous animation.\n * So do not use this method to one element twice before\n * animation starts, unless you know what you are doing.\n * @param {Object} target\n * @param {number} [time=500] Time in ms\n * @param {string} [easing='linear']\n * @param {number} [delay=0]\n * @param {Function} [callback]\n * @param {Function} [forceAnimate] Prevent stop animation and callback\n * immediently when target values are the same as current values.\n *\n * @example\n * // Animate position\n * el.animateTo({\n * position: [10, 10]\n * }, function () { // done })\n *\n * // Animate shape, style and position in 100ms, delayed 100ms, with cubicOut easing\n * el.animateTo({\n * shape: {\n * width: 500\n * },\n * style: {\n * fill: 'red'\n * }\n * position: [10, 10]\n * }, 100, 100, 'cubicOut', function () { // done })\n */\n // TODO Return animation key\n animateTo: function (target, time, delay, easing, callback, forceAnimate) {\n animateTo(this, target, time, delay, easing, callback, forceAnimate);\n },\n\n /**\n * Animate from the target state to current state.\n * The params and the return value are the same as `this.animateTo`.\n */\n animateFrom: function (target, time, delay, easing, callback, forceAnimate) {\n animateTo(this, target, time, delay, easing, callback, forceAnimate, true);\n }\n};\n\nfunction animateTo(animatable, target, time, delay, easing, callback, forceAnimate, reverse) {\n // animateTo(target, time, easing, callback);\n if (isString(delay)) {\n callback = easing;\n easing = delay;\n delay = 0;\n } // animateTo(target, time, delay, callback);\n else if (isFunction(easing)) {\n callback = easing;\n easing = 'linear';\n delay = 0;\n } // animateTo(target, time, callback);\n else if (isFunction(delay)) {\n callback = delay;\n delay = 0;\n } // animateTo(target, callback)\n else if (isFunction(time)) {\n callback = time;\n time = 500;\n } // animateTo(target)\n else if (!time) {\n time = 500;\n } // Stop all previous animations\n\n\n animatable.stopAnimation();\n animateToShallow(animatable, '', animatable, target, time, delay, reverse); // Animators may be removed immediately after start\n // if there is nothing to animate\n\n var animators = animatable.animators.slice();\n var count = animators.length;\n\n function done() {\n count--;\n\n if (!count) {\n callback && callback();\n }\n } // No animators. This should be checked before animators[i].start(),\n // because 'done' may be executed immediately if no need to animate.\n\n\n if (!count) {\n callback && callback();\n } // Start after all animators created\n // Incase any animator is done immediately when all animation properties are not changed\n\n\n for (var i = 0; i < animators.length; i++) {\n animators[i].done(done).start(easing, forceAnimate);\n }\n}\n/**\n * @param {string} path=''\n * @param {Object} source=animatable\n * @param {Object} target\n * @param {number} [time=500]\n * @param {number} [delay=0]\n * @param {boolean} [reverse] If `true`, animate\n * from the `target` to current state.\n *\n * @example\n * // Animate position\n * el._animateToShallow({\n * position: [10, 10]\n * })\n *\n * // Animate shape, style and position in 100ms, delayed 100ms\n * el._animateToShallow({\n * shape: {\n * width: 500\n * },\n * style: {\n * fill: 'red'\n * }\n * position: [10, 10]\n * }, 100, 100)\n */\n\n\nfunction animateToShallow(animatable, path, source, target, time, delay, reverse) {\n var objShallow = {};\n var propertyCount = 0;\n\n for (var name in target) {\n if (!target.hasOwnProperty(name)) {\n continue;\n }\n\n if (source[name] != null) {\n if (isObject(target[name]) && !isArrayLike(target[name])) {\n animateToShallow(animatable, path ? path + '.' + name : name, source[name], target[name], time, delay, reverse);\n } else {\n if (reverse) {\n objShallow[name] = source[name];\n setAttrByPath(animatable, path, name, target[name]);\n } else {\n objShallow[name] = target[name];\n }\n\n propertyCount++;\n }\n } else if (target[name] != null && !reverse) {\n setAttrByPath(animatable, path, name, target[name]);\n }\n }\n\n if (propertyCount > 0) {\n animatable.animate(path, false).when(time == null ? 500 : time, objShallow).delay(delay || 0);\n }\n}\n\nfunction setAttrByPath(el, path, name, value) {\n // Attr directly if not has property\n // FIXME, if some property not needed for element ?\n if (!path) {\n el.attr(name, value);\n } else {\n // Only support set shape or style\n var props = {};\n props[path] = {};\n props[path][name] = value;\n el.attr(props);\n }\n}\n\nvar _default = Animatable;\nmodule.exports = _default;","// TODO Draggable for group\n// FIXME Draggable on element which has parent rotation or scale\nfunction Draggable() {\n this.on('mousedown', this._dragStart, this);\n this.on('mousemove', this._drag, this);\n this.on('mouseup', this._dragEnd, this); // `mosuemove` and `mouseup` can be continue to fire when dragging.\n // See [Drag outside] in `Handler.js`. So we do not need to trigger\n // `_dragEnd` when globalout. That would brings better user experience.\n // this.on('globalout', this._dragEnd, this);\n // this._dropTarget = null;\n // this._draggingTarget = null;\n // this._x = 0;\n // this._y = 0;\n}\n\nDraggable.prototype = {\n constructor: Draggable,\n _dragStart: function (e) {\n var draggingTarget = e.target; // Find if there is draggable in the ancestor\n\n while (draggingTarget && !draggingTarget.draggable) {\n draggingTarget = draggingTarget.parent;\n }\n\n if (draggingTarget) {\n this._draggingTarget = draggingTarget;\n draggingTarget.dragging = true;\n this._x = e.offsetX;\n this._y = e.offsetY;\n this.dispatchToElement(param(draggingTarget, e), 'dragstart', e.event);\n }\n },\n _drag: function (e) {\n var draggingTarget = this._draggingTarget;\n\n if (draggingTarget) {\n var x = e.offsetX;\n var y = e.offsetY;\n var dx = x - this._x;\n var dy = y - this._y;\n this._x = x;\n this._y = y;\n draggingTarget.drift(dx, dy, e);\n this.dispatchToElement(param(draggingTarget, e), 'drag', e.event);\n var dropTarget = this.findHover(x, y, draggingTarget).target;\n var lastDropTarget = this._dropTarget;\n this._dropTarget = dropTarget;\n\n if (draggingTarget !== dropTarget) {\n if (lastDropTarget && dropTarget !== lastDropTarget) {\n this.dispatchToElement(param(lastDropTarget, e), 'dragleave', e.event);\n }\n\n if (dropTarget && dropTarget !== lastDropTarget) {\n this.dispatchToElement(param(dropTarget, e), 'dragenter', e.event);\n }\n }\n }\n },\n _dragEnd: function (e) {\n var draggingTarget = this._draggingTarget;\n\n if (draggingTarget) {\n draggingTarget.dragging = false;\n }\n\n this.dispatchToElement(param(draggingTarget, e), 'dragend', e.event);\n\n if (this._dropTarget) {\n this.dispatchToElement(param(this._dropTarget, e), 'drop', e.event);\n }\n\n this._draggingTarget = null;\n this._dropTarget = null;\n }\n};\n\nfunction param(target, e) {\n return {\n target: target,\n topTarget: e && e.topTarget\n };\n}\n\nvar _default = Draggable;\nmodule.exports = _default;","/**\n * Event Mixin\n * @module zrender/mixin/Eventful\n * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)\n * pissang (https://www.github.com/pissang)\n */\nvar arrySlice = Array.prototype.slice;\n/**\n * Event dispatcher.\n *\n * @alias module:zrender/mixin/Eventful\n * @constructor\n * @param {Object} [eventProcessor] The object eventProcessor is the scope when\n * `eventProcessor.xxx` called.\n * @param {Function} [eventProcessor.normalizeQuery]\n * param: {string|Object} Raw query.\n * return: {string|Object} Normalized query.\n * @param {Function} [eventProcessor.filter] Event will be dispatched only\n * if it returns `true`.\n * param: {string} eventType\n * param: {string|Object} query\n * return: {boolean}\n * @param {Function} [eventProcessor.afterTrigger] Called after all handlers called.\n * param: {string} eventType\n */\n\nvar Eventful = function (eventProcessor) {\n this._$handlers = {};\n this._$eventProcessor = eventProcessor;\n};\n\nEventful.prototype = {\n constructor: Eventful,\n\n /**\n * The handler can only be triggered once, then removed.\n *\n * @param {string} event The event name.\n * @param {string|Object} [query] Condition used on event filter.\n * @param {Function} handler The event handler.\n * @param {Object} context\n */\n one: function (event, query, handler, context) {\n return on(this, event, query, handler, context, true);\n },\n\n /**\n * Bind a handler.\n *\n * @param {string} event The event name.\n * @param {string|Object} [query] Condition used on event filter.\n * @param {Function} handler The event handler.\n * @param {Object} [context]\n */\n on: function (event, query, handler, context) {\n return on(this, event, query, handler, context, false);\n },\n\n /**\n * Whether any handler has bound.\n *\n * @param {string} event\n * @return {boolean}\n */\n isSilent: function (event) {\n var _h = this._$handlers;\n return !_h[event] || !_h[event].length;\n },\n\n /**\n * Unbind a event.\n *\n * @param {string} [event] The event name.\n * If no `event` input, \"off\" all listeners.\n * @param {Function} [handler] The event handler.\n * If no `handler` input, \"off\" all listeners of the `event`.\n */\n off: function (event, handler) {\n var _h = this._$handlers;\n\n if (!event) {\n this._$handlers = {};\n return this;\n }\n\n if (handler) {\n if (_h[event]) {\n var newList = [];\n\n for (var i = 0, l = _h[event].length; i < l; i++) {\n if (_h[event][i].h !== handler) {\n newList.push(_h[event][i]);\n }\n }\n\n _h[event] = newList;\n }\n\n if (_h[event] && _h[event].length === 0) {\n delete _h[event];\n }\n } else {\n delete _h[event];\n }\n\n return this;\n },\n\n /**\n * Dispatch a event.\n *\n * @param {string} type The event name.\n */\n trigger: function (type) {\n var _h = this._$handlers[type];\n var eventProcessor = this._$eventProcessor;\n\n if (_h) {\n var args = arguments;\n var argLen = args.length;\n\n if (argLen > 3) {\n args = arrySlice.call(args, 1);\n }\n\n var len = _h.length;\n\n for (var i = 0; i < len;) {\n var hItem = _h[i];\n\n if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(type, hItem.query)) {\n i++;\n continue;\n } // Optimize advise from backbone\n\n\n switch (argLen) {\n case 1:\n hItem.h.call(hItem.ctx);\n break;\n\n case 2:\n hItem.h.call(hItem.ctx, args[1]);\n break;\n\n case 3:\n hItem.h.call(hItem.ctx, args[1], args[2]);\n break;\n\n default:\n // have more than 2 given arguments\n hItem.h.apply(hItem.ctx, args);\n break;\n }\n\n if (hItem.one) {\n _h.splice(i, 1);\n\n len--;\n } else {\n i++;\n }\n }\n }\n\n eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(type);\n return this;\n },\n\n /**\n * Dispatch a event with context, which is specified at the last parameter.\n *\n * @param {string} type The event name.\n */\n triggerWithContext: function (type) {\n var _h = this._$handlers[type];\n var eventProcessor = this._$eventProcessor;\n\n if (_h) {\n var args = arguments;\n var argLen = args.length;\n\n if (argLen > 4) {\n args = arrySlice.call(args, 1, args.length - 1);\n }\n\n var ctx = args[args.length - 1];\n var len = _h.length;\n\n for (var i = 0; i < len;) {\n var hItem = _h[i];\n\n if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(type, hItem.query)) {\n i++;\n continue;\n } // Optimize advise from backbone\n\n\n switch (argLen) {\n case 1:\n hItem.h.call(ctx);\n break;\n\n case 2:\n hItem.h.call(ctx, args[1]);\n break;\n\n case 3:\n hItem.h.call(ctx, args[1], args[2]);\n break;\n\n default:\n // have more than 2 given arguments\n hItem.h.apply(ctx, args);\n break;\n }\n\n if (hItem.one) {\n _h.splice(i, 1);\n\n len--;\n } else {\n i++;\n }\n }\n }\n\n eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(type);\n return this;\n }\n};\n\nfunction normalizeQuery(host, query) {\n var eventProcessor = host._$eventProcessor;\n\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\n query = eventProcessor.normalizeQuery(query);\n }\n\n return query;\n}\n\nfunction on(eventful, event, query, handler, context, isOnce) {\n var _h = eventful._$handlers;\n\n if (typeof query === 'function') {\n context = handler;\n handler = query;\n query = null;\n }\n\n if (!handler || !event) {\n return eventful;\n }\n\n query = normalizeQuery(eventful, query);\n\n if (!_h[event]) {\n _h[event] = [];\n }\n\n for (var i = 0; i < _h[event].length; i++) {\n if (_h[event][i].h === handler) {\n return eventful;\n }\n }\n\n var wrap = {\n h: handler,\n one: isOnce,\n query: query,\n ctx: context || eventful,\n // FIXME\n // Do not publish this feature util it is proved that it makes sense.\n callAtLast: handler.zrEventfulCallAtLast\n };\n var lastIndex = _h[event].length - 1;\n var lastWrap = _h[event][lastIndex];\n lastWrap && lastWrap.callAtLast ? _h[event].splice(lastIndex, 0, wrap) : _h[event].push(wrap);\n return eventful;\n} // ----------------------\n// The events in zrender\n// ----------------------\n\n/**\n * @event module:zrender/mixin/Eventful#onclick\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmouseover\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmouseout\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmousemove\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmousewheel\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmousedown\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmouseup\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondrag\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragstart\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragend\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragenter\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragleave\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragover\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondrop\n * @type {Function}\n * @default null\n */\n\n\nvar _default = Eventful;\nmodule.exports = _default;","var matrix = require(\"../core/matrix\");\n\nvar vector = require(\"../core/vector\");\n\n/**\n * 提供变换扩展\n * @module zrender/mixin/Transformable\n * @author pissang (https://www.github.com/pissang)\n */\nvar mIdentity = matrix.identity;\nvar EPSILON = 5e-5;\n\nfunction isNotAroundZero(val) {\n return val > EPSILON || val < -EPSILON;\n}\n/**\n * @alias module:zrender/mixin/Transformable\n * @constructor\n */\n\n\nvar Transformable = function (opts) {\n opts = opts || {}; // If there are no given position, rotation, scale\n\n if (!opts.position) {\n /**\n * 平移\n * @type {Array.}\n * @default [0, 0]\n */\n this.position = [0, 0];\n }\n\n if (opts.rotation == null) {\n /**\n * 旋转\n * @type {Array.}\n * @default 0\n */\n this.rotation = 0;\n }\n\n if (!opts.scale) {\n /**\n * 缩放\n * @type {Array.}\n * @default [1, 1]\n */\n this.scale = [1, 1];\n }\n /**\n * 旋转和缩放的原点\n * @type {Array.}\n * @default null\n */\n\n\n this.origin = this.origin || null;\n};\n\nvar transformableProto = Transformable.prototype;\ntransformableProto.transform = null;\n/**\n * 判断是否需要有坐标变换\n * 如果有坐标变换, 则从position, rotation, scale以及父节点的transform计算出自身的transform矩阵\n */\n\ntransformableProto.needLocalTransform = function () {\n return isNotAroundZero(this.rotation) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1);\n};\n\nvar scaleTmp = [];\n\ntransformableProto.updateTransform = function () {\n var parent = this.parent;\n var parentHasTransform = parent && parent.transform;\n var needLocalTransform = this.needLocalTransform();\n var m = this.transform;\n\n if (!(needLocalTransform || parentHasTransform)) {\n m && mIdentity(m);\n return;\n }\n\n m = m || matrix.create();\n\n if (needLocalTransform) {\n this.getLocalTransform(m);\n } else {\n mIdentity(m);\n } // 应用父节点变换\n\n\n if (parentHasTransform) {\n if (needLocalTransform) {\n matrix.mul(m, parent.transform, m);\n } else {\n matrix.copy(m, parent.transform);\n }\n } // 保存这个变换矩阵\n\n\n this.transform = m;\n var globalScaleRatio = this.globalScaleRatio;\n\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\n this.getGlobalScale(scaleTmp);\n var relX = scaleTmp[0] < 0 ? -1 : 1;\n var relY = scaleTmp[1] < 0 ? -1 : 1;\n var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\n var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\n m[0] *= sx;\n m[1] *= sx;\n m[2] *= sy;\n m[3] *= sy;\n }\n\n this.invTransform = this.invTransform || matrix.create();\n matrix.invert(this.invTransform, m);\n};\n\ntransformableProto.getLocalTransform = function (m) {\n return Transformable.getLocalTransform(this, m);\n};\n/**\n * 将自己的transform应用到context上\n * @param {CanvasRenderingContext2D} ctx\n */\n\n\ntransformableProto.setTransform = function (ctx) {\n var m = this.transform;\n var dpr = ctx.dpr || 1;\n\n if (m) {\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\n } else {\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n }\n};\n\ntransformableProto.restoreTransform = function (ctx) {\n var dpr = ctx.dpr || 1;\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n};\n\nvar tmpTransform = [];\nvar originTransform = matrix.create();\n\ntransformableProto.setLocalTransform = function (m) {\n if (!m) {\n // TODO return or set identity?\n return;\n }\n\n var sx = m[0] * m[0] + m[1] * m[1];\n var sy = m[2] * m[2] + m[3] * m[3];\n var position = this.position;\n var scale = this.scale;\n\n if (isNotAroundZero(sx - 1)) {\n sx = Math.sqrt(sx);\n }\n\n if (isNotAroundZero(sy - 1)) {\n sy = Math.sqrt(sy);\n }\n\n if (m[0] < 0) {\n sx = -sx;\n }\n\n if (m[3] < 0) {\n sy = -sy;\n }\n\n position[0] = m[4];\n position[1] = m[5];\n scale[0] = sx;\n scale[1] = sy;\n this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);\n};\n/**\n * 分解`transform`矩阵到`position`, `rotation`, `scale`\n */\n\n\ntransformableProto.decomposeTransform = function () {\n if (!this.transform) {\n return;\n }\n\n var parent = this.parent;\n var m = this.transform;\n\n if (parent && parent.transform) {\n // Get local transform and decompose them to position, scale, rotation\n matrix.mul(tmpTransform, parent.invTransform, m);\n m = tmpTransform;\n }\n\n var origin = this.origin;\n\n if (origin && (origin[0] || origin[1])) {\n originTransform[4] = origin[0];\n originTransform[5] = origin[1];\n matrix.mul(tmpTransform, m, originTransform);\n tmpTransform[4] -= origin[0];\n tmpTransform[5] -= origin[1];\n m = tmpTransform;\n }\n\n this.setLocalTransform(m);\n};\n/**\n * Get global scale\n * @return {Array.}\n */\n\n\ntransformableProto.getGlobalScale = function (out) {\n var m = this.transform;\n out = out || [];\n\n if (!m) {\n out[0] = 1;\n out[1] = 1;\n return out;\n }\n\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\n\n if (m[0] < 0) {\n out[0] = -out[0];\n }\n\n if (m[3] < 0) {\n out[1] = -out[1];\n }\n\n return out;\n};\n/**\n * 变换坐标位置到 shape 的局部坐标空间\n * @method\n * @param {number} x\n * @param {number} y\n * @return {Array.}\n */\n\n\ntransformableProto.transformCoordToLocal = function (x, y) {\n var v2 = [x, y];\n var invTransform = this.invTransform;\n\n if (invTransform) {\n vector.applyTransform(v2, v2, invTransform);\n }\n\n return v2;\n};\n/**\n * 变换局部坐标位置到全局坐标空间\n * @method\n * @param {number} x\n * @param {number} y\n * @return {Array.}\n */\n\n\ntransformableProto.transformCoordToGlobal = function (x, y) {\n var v2 = [x, y];\n var transform = this.transform;\n\n if (transform) {\n vector.applyTransform(v2, v2, transform);\n }\n\n return v2;\n};\n/**\n * @static\n * @param {Object} target\n * @param {Array.} target.origin\n * @param {number} target.rotation\n * @param {Array.} target.position\n * @param {Array.} [m]\n */\n\n\nTransformable.getLocalTransform = function (target, m) {\n m = m || [];\n mIdentity(m);\n var origin = target.origin;\n var scale = target.scale || [1, 1];\n var rotation = target.rotation || 0;\n var position = target.position || [0, 0];\n\n if (origin) {\n // Translate to origin\n m[4] -= origin[0];\n m[5] -= origin[1];\n }\n\n matrix.scale(m, m, scale);\n\n if (rotation) {\n matrix.rotate(m, m, rotation);\n }\n\n if (origin) {\n // Translate back from origin\n m[4] += origin[0];\n m[5] += origin[1];\n }\n\n m[4] += position[0];\n m[5] += position[1];\n return m;\n};\n\nvar _default = Transformable;\nmodule.exports = _default;"],"names":["ArrayCtor","Float32Array","Array","create","x","y","out","copy","v","clone","set","a","b","add","v1","v2","scaleAndAdd","sub","len","Math","sqrt","lenSquare","length","lengthSquare","mul","div","dot","scale","s","normalize","d","distance","dist","distanceSquare","distSquare","negate","lerp","t","applyTransform","m","min","max","exports","_event","addEventListener","removeEventListener","normalizeEvent","getNativeEvent","zrUtil","Eventful","env","TOUCH_CLICK_DELAY","globalEventSupported","domSupported","localNativeListenerNames","mouseHandlerNames","touchHandlerNames","pointerEventNameMap","pointerdown","pointerup","pointermove","pointerout","pointerHandlerNames","map","name","nm","replace","hasOwnProperty","mouse","touch","pointer","globalNativeListenerNames","eventNameFix","browser","firefox","isPointerFromTouch","event","pointerType","setTouchTimer","scope","touching","touchTimer","clearTimeout","setTimeout","markTouch","zrByTouch","normalizeGlobalEvent","instance","dom","FakeGlobalEvent","isLocalEl","el","elTmp","isLocal","nodeType","domBelongToZr","painterRoot","parentNode","this","type","target","currentTarget","clientX","clientY","fakeGlobalEventProto","prototype","stopPropagation","stopImmediatePropagation","preventDefault","noop","localDOMHandlers","mousedown","_mayPointerCapture","zrX","zrY","trigger","mousemove","downPoint","togglePointerCapture","mouseup","mouseout","_pointerCapturing","zrEventControl","element","toElement","relatedTarget","zrIsToLocalDOM","touchstart","_lastTouchMoment","Date","handler","processGesture","call","touchmove","touchend","click","each","globalDOMHandlers","pointerCaptureReleasing","mountLocalDOMEventListeners","domHandlers","pointerEventsSupported","nativeEventName","mountSingleDOMEventListener","touchEventsSupported","mountGlobalDOMEventListeners","mount","nativeEventListener","capture","listener","opt","mounted","listenerOpts","domTarget","unmountDOMEventListeners","isPointerCapturing","globalHandlerScope","_globalHandlerScope","DOMHandlerScope","HandlerDomProxy","_localHandlerScope","document","handlerDomProxyProto","dispose","setCursor","cursorStyle","style","cursor","mixin","_default","module","Path","extend","shape","paths","_updatePathDirty","dirtyPath","__dirtyPath","i","__dirty","beforeBrush","getGlobalScale","path","createPathProxy","setScale","segmentIgnoreThreshold","buildPath","ctx","afterBrush","getBoundingRect","Style","Element","RectText","Displayable","opts","_rect","__clipPaths","constructor","invisible","z","z2","zlevel","draggable","dragging","silent","culling","rectHover","progressive","incremental","globalScaleRatio","brush","prevEl","contain","rectContain","traverse","cb","context","coord","transformCoordToLocal","rect","dirty","__dirtyText","__zr","refresh","animateStyle","loop","animate","attrKV","key","value","setStyle","useStyle","obj","calculateTextPosition","inherits","Gradient","colorStops","addColorStop","offset","color","push","BoundingRect","imageHelper","ZImage","src","image","bind","_image","createOrUpdateImage","onload","isImageReady","width","height","aspect","setTransform","sWidth","sHeight","sx","sy","drawImage","text","restoreTransform","drawRectText","_util","Displayble","IncrementalDisplayble","_displayables","_temporaryDisplayables","_cursor","notClear","clearDisplaybles","addDisplayable","displayable","notPersistent","addDisplayables","displayables","eachPendingDisplayable","update","updateTransform","parent","Infinity","childRect","needLocalTransform","getLocalTransform","union","localPos","LinearGradient","x2","y2","globalCoord","global","PathProxy","pathContain","Pattern","getCanvasPattern","abs","pathProxyForDraw","strokeContainThreshold","subPixelOptimize","hasStroke","hasFill","fill","stroke","hasFillGradient","hasStrokeGradient","hasFillPattern","hasStrokePattern","_fillGradient","getGradient","_strokeGradient","fillStyle","strokeStyle","lineDash","lineDashOffset","ctxLineDash","setLineDash","beginPath","setLineDashOffset","rebuildPath","fillOpacity","originalGlobalAlpha","globalAlpha","opacity","strokeOpacity","shapeCfg","inBundle","needsUpdateRect","rectWithStroke","_rectWithStroke","w","lineWidth","lineScale","strokeNoScale","getLineScale","pathData","data","containStroke","__clipTarget","animateShape","setShape","isObject","transform","defaults","Sub","extendFrom","defaultShape","thisShape","init","repeat","createPattern","RadialGradient","r","fixShadow","_constant","ContextCachedBy","STYLE_COMMON_PROPS","createLinearGradient","isNaN","canvasGradient","createRadialGradient","shadowBlur","shadowOffsetX","shadowOffsetY","font","textFont","fontStyle","fontWeight","fontSize","fontFamily","textTag","textFill","textStroke","textWidth","textHeight","textStrokeWidth","textLineHeight","textPosition","textRect","textOffset","textAlign","textVerticalAlign","textDistance","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","textBoxShadowColor","textBoxShadowBlur","textBoxShadowOffsetX","textBoxShadowOffsetY","transformText","textRotation","textOrigin","textBackgroundColor","textBorderColor","textBorderWidth","textBorderRadius","textPadding","rich","truncate","blend","prevStyle","notCheckCache","__attrCachedBy","STYLE_BIND","prop","styleName","globalCompositeOperation","otherStyle","overwrite","newStyle","method","styleProto","textContain","textHelper","Text","normalizeTextStyle","shadowColor","needDrawText","renderText","NONE","getStroke","PLAIN_TEXT","WILL_BE_RESTORED","shadowTemp","orignalBrush","ie","version","modified","clipPaths","clipPath","startAngle","endAngle","j","apply","arguments","SHADOW_PROPS","propName","dpr","LRU","globalImageCache","findExistImage","newImageOrSrc","cachedImgObj","get","hostEl","cbPayload","__zrImageSrc","pendingWrap","pending","Image","onerror","imageOnLoad","put","__cachedImgObj","smoothSpline","smoothBezier","closePath","points","smooth","controlPoints","smoothConstraint","moveTo","cp1","cp2","p","bezierCurveTo","l","lineTo","r1","r2","r3","r4","total","arc","PI","_vector","v2Min","v2Max","v2Scale","v2Distance","v2Add","v2Clone","v2Sub","isLoop","constraint","prevPoint","nextPoint","cps","point","d0","d1","sum","cp0","shift","interpolate","p0","p1","p2","p3","t2","t3","v0","ret","segs","pos","idx","floor","w2","w3","round","subPixelOptimizeLine","outputShape","inputShape","x1","y1","subPixelOptimizeRect","originX","originY","originWidth","originHeight","position","positiveOrNegative","doubledPosition","retrieve2","retrieve3","normalizeCssArray","isString","roundRectHelper","DEFAULT_FONT","VALID_TEXT_ALIGN","left","right","center","VALID_TEXT_VERTICAL_ALIGN","top","bottom","middle","SHADOW_STYLE_COMMON_PROPS","_tmpTextPositionResult","_tmpBoxPositionResult","normalizeStyle","makeFont","textBaseline","renderRichText","renderPlainText","needDrawBg","needDrawBackground","checkCache","cachedByMe","styleFont","computedFont","__computedFont","__styleFont","contentBlock","__textCotentBlock","parsePlainText","outerHeight","textLines","lines","lineHeight","boxPos","getBoxPosition","baseX","baseY","applyTextRotation","boxY","adjustTextY","textX","textY","getWidth","outerWidth","boxX","adjustTextX","drawBackground","getTextXForPadding","propItem","styleProp","ctxProp","val","textStrokeWidthPrev","strokeWidthChanged","strokeChanged","getFill","strokeText","fillText","parseRichText","drawRichText","contentWidth","xLeft","lineTop","xRight","token","line","tokens","tokenCount","usedWidth","leftIndex","lineXLeft","lineXRight","rightIndex","placeToken","origin","translate","rotate","tokenStyle","isLineHolder","setCtx","isPlainBg","onBgImageLoaded","parsePercent","res","maxValue","lastIndexOf","parseFloat","tmpRect","save","restore","cx","cy","clockwise","unitX","cos","unitY","sin","vec2","_curve","quadraticSubdivide","cubicSubdivide","quadraticAt","cubicAt","quadraticDerivativeAt","cubicDerivativeAt","someVectorAt","isTangent","cpx2","cpy2","cpx1","cpy1","percent","quadraticCurveTo","pointAt","tangentAt","rx","ry","k","ox","oy","_subPixelOptimize","subPixelOptimizeOutputShape","polyHelper","r0","PI2","fixClipWithShadow","Animator","logError","isFunction","isArrayLike","indexOf","Animatable","animators","animateTo","animatable","time","delay","easing","callback","forceAnimate","reverse","stopAnimation","animateToShallow","slice","count","done","start","source","objShallow","propertyCount","setAttrByPath","when","props","attr","animatingShape","zr","pathSplitted","split","animator","during","splice","animation","addAnimator","id","forwardToLast","stop","animateFrom","Draggable","on","_dragStart","_drag","_dragEnd","param","e","topTarget","draggingTarget","_draggingTarget","_x","offsetX","_y","offsetY","dispatchToElement","dx","dy","drift","dropTarget","findHover","lastDropTarget","_dropTarget","arrySlice","eventProcessor","_$handlers","_$eventProcessor","normalizeQuery","host","query","eventful","isOnce","_h","h","wrap","one","callAtLast","zrEventfulCallAtLast","lastIndex","lastWrap","isSilent","off","newList","args","argLen","hItem","filter","afterTrigger","triggerWithContext","matrix","vector","mIdentity","identity","EPSILON","isNotAroundZero","Transformable","rotation","transformableProto","scaleTmp","parentHasTransform","relX","relY","invTransform","invert","tmpTransform","originTransform","setLocalTransform","atan2","decomposeTransform","transformCoordToGlobal"],"sourceRoot":""}