diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..45018df
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..eba1110
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+# Auto detect text files and perform LF normalization
+* text=auto
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6143e53
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,22 @@
+# Compiled class file
+*.class
+
+# Log file
+*.log
+
+# BlueJ files
+*.ctxt
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.ear
+*.zip
+*.tar.gz
+*.rar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
diff --git a/.project b/.project
new file mode 100644
index 0000000..72b83ba
--- /dev/null
+++ b/.project
@@ -0,0 +1,42 @@
+
+
+ web1
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.wst.common.project.facet.core.builder
+
+
+
+
+ org.eclipse.wst.validation.validationbuilder
+
+
+
+
+ com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator
+
+
+
+
+ org.eclipse.m2e.core.maven2Builder
+
+
+
+
+
+ org.eclipse.m2e.core.maven2Nature
+ org.eclipse.jem.workbench.JavaEMFNature
+ org.eclipse.wst.common.modulecore.ModuleCoreNature
+ org.eclipse.wst.common.project.facet.core.nature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.wst.jsdt.core.jsNature
+
+
diff --git a/.settings/.jsdtscope b/.settings/.jsdtscope
new file mode 100644
index 0000000..f2f9fad
--- /dev/null
+++ b/.settings/.jsdtscope
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..7a53139
--- /dev/null
+++ b/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+encoding/=UTF-8
+encoding/src=UTF-8
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..443e085
--- /dev/null
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component
new file mode 100644
index 0000000..ef88d1f
--- /dev/null
+++ b/.settings/org.eclipse.wst.common.component
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
new file mode 100644
index 0000000..e1beff3
--- /dev/null
+++ b/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml
new file mode 100644
index 0000000..a771ed0
--- /dev/null
+++ b/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.container b/.settings/org.eclipse.wst.jsdt.ui.superType.container
new file mode 100644
index 0000000..3bd5d0a
--- /dev/null
+++ b/.settings/org.eclipse.wst.jsdt.ui.superType.container
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.name b/.settings/org.eclipse.wst.jsdt.ui.superType.name
new file mode 100644
index 0000000..05bd71b
--- /dev/null
+++ b/.settings/org.eclipse.wst.jsdt.ui.superType.name
@@ -0,0 +1 @@
+Window
\ No newline at end of file
diff --git a/.settings/org.eclipse.wst.validation.prefs b/.settings/org.eclipse.wst.validation.prefs
new file mode 100644
index 0000000..04cad8c
--- /dev/null
+++ b/.settings/org.eclipse.wst.validation.prefs
@@ -0,0 +1,2 @@
+disabled=06target
+eclipse.preferences.version=1
diff --git a/.tern-project b/.tern-project
new file mode 100644
index 0000000..665e539
--- /dev/null
+++ b/.tern-project
@@ -0,0 +1,12 @@
+{
+ "plugins": {
+ "guess-types": {
+
+ }
+ },
+ "libs": [
+ "ecma5",
+ "browser",
+ "jquery"
+ ]
+}
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..c506225
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+# web1
diff --git a/WebRoot/META-INF/MANIFEST.MF b/WebRoot/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..254272e
--- /dev/null
+++ b/WebRoot/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
diff --git a/WebRoot/WEB-INF/web.xml b/WebRoot/WEB-INF/web.xml
new file mode 100644
index 0000000..4c854da
--- /dev/null
+++ b/WebRoot/WEB-INF/web.xml
@@ -0,0 +1,23 @@
+
+
+ web1
+
+ This is the description of my J2EE component
+ This is the display name of my J2EE component
+ S1
+ com.server.S1
+
+
+
+ S1
+ /S1
+
+
+ index.html
+ index.htm
+ index.jsp
+ default.html
+ default.htm
+ default.jsp
+
+
\ No newline at end of file
diff --git a/WebRoot/index.jsp b/WebRoot/index.jsp
new file mode 100644
index 0000000..6618522
--- /dev/null
+++ b/WebRoot/index.jsp
@@ -0,0 +1,221 @@
+<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
+<%
+String path = request.getContextPath();
+String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
+%>
+
+
+
+
+
+
+ My JSP 'index.jsp' starting page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WebRoot/js/dark.js b/WebRoot/js/dark.js
new file mode 100644
index 0000000..79ff8c1
--- /dev/null
+++ b/WebRoot/js/dark.js
@@ -0,0 +1,147 @@
+(function (root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['exports', 'echarts'], factory);
+ } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
+ // CommonJS
+ factory(exports, require('echarts'));
+ } else {
+ // Browser globals
+ factory({}, root.echarts);
+ }
+}(this, function (exports, echarts) {
+ var log = function (msg) {
+ if (typeof console !== 'undefined') {
+ console && console.error && console.error(msg);
+ }
+ };
+ if (!echarts) {
+ log('ECharts is not Loaded');
+ return;
+ }
+ var contrastColor = '#eee';
+ var axisCommon = function () {
+ return {
+ axisLine: {
+ lineStyle: {
+ color: contrastColor
+ }
+ },
+ axisTick: {
+ lineStyle: {
+ color: contrastColor
+ }
+ },
+ axisLabel: {
+ textStyle: {
+ color: contrastColor
+ }
+ },
+ splitLine: {
+ lineStyle: {
+ type: 'dashed',
+ color: '#aaa'
+ }
+ },
+ splitArea: {
+ areaStyle: {
+ color: contrastColor
+ }
+ }
+ };
+ };
+
+ var colorPalette = ['#dd6b66','#759aa0','#e69d87','#8dc1a9','#ea7e53','#eedd78','#73a373','#73b9bc','#7289ab', '#91ca8c','#f49f42'];
+ var theme = {
+ color: colorPalette,
+ backgroundColor: '#333',
+ tooltip: {
+ axisPointer: {
+ lineStyle: {
+ color: contrastColor
+ },
+ crossStyle: {
+ color: contrastColor
+ }
+ }
+ },
+ legend: {
+ textStyle: {
+ color: contrastColor
+ }
+ },
+ textStyle: {
+ color: contrastColor
+ },
+ title: {
+ textStyle: {
+ color: contrastColor
+ }
+ },
+ toolbox: {
+ iconStyle: {
+ normal: {
+ borderColor: contrastColor
+ }
+ }
+ },
+ dataZoom: {
+ textStyle: {
+ color: contrastColor
+ }
+ },
+ timeline: {
+ lineStyle: {
+ color: contrastColor
+ },
+ itemStyle: {
+ normal: {
+ color: colorPalette[1]
+ }
+ },
+ label: {
+ normal: {
+ textStyle: {
+ color: contrastColor
+ }
+ }
+ },
+ controlStyle: {
+ normal: {
+ color: contrastColor,
+ borderColor: contrastColor
+ }
+ }
+ },
+ timeAxis: axisCommon(),
+ logAxis: axisCommon(),
+ valueAxis: axisCommon(),
+ categoryAxis: axisCommon(),
+
+ line: {
+ symbol: 'circle'
+ },
+ graph: {
+ color: colorPalette
+ },
+ gauge: {
+ title: {
+ textStyle: {
+ color: contrastColor
+ }
+ }
+ },
+ candlestick: {
+ itemStyle: {
+ normal: {
+ color: '#FD1050',
+ color0: '#0CF49B',
+ borderColor: '#FD1050',
+ borderColor0: '#0CF49B'
+ }
+ }
+ }
+ };
+ theme.categoryAxis.splitLine.show = false;
+ echarts.registerTheme('dark', theme);
+}));
\ No newline at end of file
diff --git a/WebRoot/js/echarts.js b/WebRoot/js/echarts.js
new file mode 100644
index 0000000..ab481ea
--- /dev/null
+++ b/WebRoot/js/echarts.js
@@ -0,0 +1,77756 @@
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory();
+ else if(typeof define === 'function' && define.amd)
+ define([], factory);
+ else if(typeof exports === 'object')
+ exports["echarts"] = factory();
+ else
+ root["echarts"] = factory();
+})(this, function() {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ (function(module, exports, __webpack_require__) {
+
+ /**
+ * Export echarts as CommonJS module
+ */
+ module.exports = __webpack_require__(1);
+
+ // Import all charts and components
+ __webpack_require__(116);
+ __webpack_require__(142);
+ __webpack_require__(149);
+ __webpack_require__(158);
+ __webpack_require__(162);
+
+ __webpack_require__(172);
+ __webpack_require__(196);
+ __webpack_require__(208);
+ __webpack_require__(229);
+ __webpack_require__(233);
+ __webpack_require__(237);
+ __webpack_require__(254);
+ __webpack_require__(260);
+ __webpack_require__(267);
+ __webpack_require__(273);
+ __webpack_require__(277);
+ __webpack_require__(286);
+ __webpack_require__(290);
+ __webpack_require__(293);
+ __webpack_require__(316);
+
+ __webpack_require__(322);
+ __webpack_require__(323);
+ __webpack_require__(324);
+ __webpack_require__(334);
+ __webpack_require__(301);
+ __webpack_require__(338);
+ __webpack_require__(351);
+ __webpack_require__(238);
+ __webpack_require__(294);
+ __webpack_require__(354);
+ __webpack_require__(366);
+
+ __webpack_require__(370);
+
+ __webpack_require__(371);
+ __webpack_require__(384);
+
+ __webpack_require__(399);
+ __webpack_require__(405);
+ __webpack_require__(408);
+
+ __webpack_require__(411);
+ __webpack_require__(420);
+
+ __webpack_require__(432);
+
+
+/***/ }),
+/* 1 */
+/***/ (function(module, exports, __webpack_require__) {
+
+ // Enable DEV mode when using source code without build. which has no __DEV__ variable
+ // In build process 'typeof __DEV__' will be replace with 'boolean'
+ // So this code will be removed or disabled anyway after built.
+ if (false) {
+ // In browser
+ if (typeof window !== 'undefined') {
+ window.__DEV__ = true;
+ }
+ // In node
+ else if (typeof global !== 'undefined') {
+ global.__DEV__ = true;
+ }
+ }
+
+ /*!
+ * ECharts, a javascript interactive chart library.
+ *
+ * Copyright (c) 2015, Baidu Inc.
+ * All rights reserved.
+ *
+ * LICENSE
+ * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt
+ */
+
+ /**
+ * @module echarts
+ */
+
+
+ var env = __webpack_require__(2);
+
+ var GlobalModel = __webpack_require__(3);
+ var ExtensionAPI = __webpack_require__(78);
+ var CoordinateSystemManager = __webpack_require__(79);
+ var OptionManager = __webpack_require__(80);
+ var backwardCompat = __webpack_require__(81);
+
+ var ComponentModel = __webpack_require__(72);
+ var SeriesModel = __webpack_require__(83);
+
+ var ComponentView = __webpack_require__(84);
+ var ChartView = __webpack_require__(85);
+ var graphic = __webpack_require__(20);
+ var modelUtil = __webpack_require__(5);
+ var throttle = __webpack_require__(86);
+
+ var zrender = __webpack_require__(87);
+ var zrUtil = __webpack_require__(4);
+ var colorTool = __webpack_require__(33);
+ var Eventful = __webpack_require__(27);
+ var timsort = __webpack_require__(91);
+
+
+ var each = zrUtil.each;
+ var parseClassType = ComponentModel.parseClassType;
+
+ var PRIORITY_PROCESSOR_FILTER = 1000;
+ var PRIORITY_PROCESSOR_STATISTIC = 5000;
+
+
+ var PRIORITY_VISUAL_LAYOUT = 1000;
+ var PRIORITY_VISUAL_GLOBAL = 2000;
+ var PRIORITY_VISUAL_CHART = 3000;
+ var PRIORITY_VISUAL_COMPONENT = 4000;
+ // FIXME
+ // necessary?
+ var PRIORITY_VISUAL_BRUSH = 5000;
+
+ // Main process have three entries: `setOption`, `dispatchAction` and `resize`,
+ // where they must not be invoked nestedly, except the only case: invoke
+ // dispatchAction with updateMethod "none" in main process.
+ // This flag is used to carry out this rule.
+ // All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]).
+ var IN_MAIN_PROCESS = '__flagInMainProcess';
+ var HAS_GRADIENT_OR_PATTERN_BG = '__hasGradientOrPatternBg';
+ var OPTION_UPDATED = '__optionUpdated';
+ var ACTION_REG = /^[a-zA-Z0-9_]+$/;
+
+
+ function createRegisterEventWithLowercaseName(method) {
+ return function (eventName, handler, context) {
+ // Event name is all lowercase
+ eventName = eventName && eventName.toLowerCase();
+ Eventful.prototype[method].call(this, eventName, handler, context);
+ };
+ }
+
+ /**
+ * @module echarts~MessageCenter
+ */
+ function MessageCenter() {
+ Eventful.call(this);
+ }
+ MessageCenter.prototype.on = createRegisterEventWithLowercaseName('on');
+ MessageCenter.prototype.off = createRegisterEventWithLowercaseName('off');
+ MessageCenter.prototype.one = createRegisterEventWithLowercaseName('one');
+ zrUtil.mixin(MessageCenter, Eventful);
+
+ /**
+ * @module echarts~ECharts
+ */
+ function ECharts(dom, theme, opts) {
+ opts = opts || {};
+
+ // Get theme by name
+ if (typeof theme === 'string') {
+ theme = themeStorage[theme];
+ }
+
+ /**
+ * @type {string}
+ */
+ this.id;
+ /**
+ * Group id
+ * @type {string}
+ */
+ this.group;
+ /**
+ * @type {HTMLElement}
+ * @private
+ */
+ this._dom = dom;
+ /**
+ * @type {module:zrender/ZRender}
+ * @private
+ */
+ var zr = this._zr = zrender.init(dom, {
+ renderer: opts.renderer || 'canvas',
+ devicePixelRatio: opts.devicePixelRatio,
+ width: opts.width,
+ height: opts.height
+ });
+
+ /**
+ * Expect 60 pfs.
+ * @type {Function}
+ * @private
+ */
+ this._throttledZrFlush = throttle.throttle(zrUtil.bind(zr.flush, zr), 17);
+
+ var theme = zrUtil.clone(theme);
+ theme && backwardCompat(theme, true);
+ /**
+ * @type {Object}
+ * @private
+ */
+ this._theme = theme;
+
+ /**
+ * @type {Array.}
+ * @private
+ */
+ this._chartsViews = [];
+
+ /**
+ * @type {Object.}
+ * @private
+ */
+ this._chartsMap = {};
+
+ /**
+ * @type {Array.}
+ * @private
+ */
+ this._componentsViews = [];
+
+ /**
+ * @type {Object.}
+ * @private
+ */
+ this._componentsMap = {};
+
+ /**
+ * @type {module:echarts/CoordinateSystem}
+ * @private
+ */
+ this._coordSysMgr = new CoordinateSystemManager();
+
+ /**
+ * @type {module:echarts/ExtensionAPI}
+ * @private
+ */
+ this._api = createExtensionAPI(this);
+
+ Eventful.call(this);
+
+ /**
+ * @type {module:echarts~MessageCenter}
+ * @private
+ */
+ this._messageCenter = new MessageCenter();
+
+ // Init mouse events
+ this._initEvents();
+
+ // In case some people write `window.onresize = chart.resize`
+ this.resize = zrUtil.bind(this.resize, this);
+
+ // Can't dispatch action during rendering procedure
+ this._pendingActions = [];
+ // Sort on demand
+ function prioritySortFunc(a, b) {
+ return a.prio - b.prio;
+ }
+ timsort(visualFuncs, prioritySortFunc);
+ timsort(dataProcessorFuncs, prioritySortFunc);
+
+ zr.animation.on('frame', this._onframe, this);
+
+ // ECharts instance can be used as value.
+ zrUtil.setAsPrimitive(this);
+ }
+
+ var echartsProto = ECharts.prototype;
+
+ echartsProto._onframe = function () {
+ // Lazy update
+ if (this[OPTION_UPDATED]) {
+ var silent = this[OPTION_UPDATED].silent;
+
+ this[IN_MAIN_PROCESS] = true;
+
+ updateMethods.prepareAndUpdate.call(this);
+
+ this[IN_MAIN_PROCESS] = false;
+
+ this[OPTION_UPDATED] = false;
+
+ flushPendingActions.call(this, silent);
+
+ triggerUpdatedEvent.call(this, silent);
+ }
+ };
+ /**
+ * @return {HTMLElement}
+ */
+ echartsProto.getDom = function () {
+ return this._dom;
+ };
+
+ /**
+ * @return {module:zrender~ZRender}
+ */
+ echartsProto.getZr = function () {
+ return this._zr;
+ };
+
+ /**
+ * Usage:
+ * chart.setOption(option, notMerge, lazyUpdate);
+ * chart.setOption(option, {
+ * notMerge: ...,
+ * lazyUpdate: ...,
+ * silent: ...
+ * });
+ *
+ * @param {Object} option
+ * @param {Object|boolean} [opts] opts or notMerge.
+ * @param {boolean} [opts.notMerge=false]
+ * @param {boolean} [opts.lazyUpdate=false] Useful when setOption frequently.
+ */
+ echartsProto.setOption = function (option, notMerge, lazyUpdate) {
+ if (true) {
+ zrUtil.assert(!this[IN_MAIN_PROCESS], '`setOption` should not be called during main process.');
+ }
+
+ var silent;
+ if (zrUtil.isObject(notMerge)) {
+ lazyUpdate = notMerge.lazyUpdate;
+ silent = notMerge.silent;
+ notMerge = notMerge.notMerge;
+ }
+
+ this[IN_MAIN_PROCESS] = true;
+
+ if (!this._model || notMerge) {
+ var optionManager = new OptionManager(this._api);
+ var theme = this._theme;
+ var ecModel = this._model = new GlobalModel(null, null, theme, optionManager);
+ ecModel.init(null, null, theme, optionManager);
+ }
+
+ this._model.setOption(option, optionPreprocessorFuncs);
+
+ if (lazyUpdate) {
+ this[OPTION_UPDATED] = {silent: silent};
+ this[IN_MAIN_PROCESS] = false;
+ }
+ else {
+ updateMethods.prepareAndUpdate.call(this);
+ // Ensure zr refresh sychronously, and then pixel in canvas can be
+ // fetched after `setOption`.
+ this._zr.flush();
+
+ this[OPTION_UPDATED] = false;
+ this[IN_MAIN_PROCESS] = false;
+
+ flushPendingActions.call(this, silent);
+ triggerUpdatedEvent.call(this, silent);
+ }
+ };
+
+ /**
+ * @DEPRECATED
+ */
+ echartsProto.setTheme = function () {
+ console.log('ECharts#setTheme() is DEPRECATED in ECharts 3.0');
+ };
+
+ /**
+ * @return {module:echarts/model/Global}
+ */
+ echartsProto.getModel = function () {
+ return this._model;
+ };
+
+ /**
+ * @return {Object}
+ */
+ echartsProto.getOption = function () {
+ return this._model && this._model.getOption();
+ };
+
+ /**
+ * @return {number}
+ */
+ echartsProto.getWidth = function () {
+ return this._zr.getWidth();
+ };
+
+ /**
+ * @return {number}
+ */
+ echartsProto.getHeight = function () {
+ return this._zr.getHeight();
+ };
+
+ /**
+ * @return {number}
+ */
+ echartsProto.getDevicePixelRatio = function () {
+ return this._zr.painter.dpr || window.devicePixelRatio || 1;
+ };
+
+ /**
+ * Get canvas which has all thing rendered
+ * @param {Object} opts
+ * @param {string} [opts.backgroundColor]
+ */
+ echartsProto.getRenderedCanvas = function (opts) {
+ if (!env.canvasSupported) {
+ return;
+ }
+ opts = opts || {};
+ opts.pixelRatio = opts.pixelRatio || 1;
+ opts.backgroundColor = opts.backgroundColor
+ || this._model.get('backgroundColor');
+ var zr = this._zr;
+ var list = zr.storage.getDisplayList();
+ // Stop animations
+ zrUtil.each(list, function (el) {
+ el.stopAnimation(true);
+ });
+ return zr.painter.getRenderedCanvas(opts);
+ };
+ /**
+ * @return {string}
+ * @param {Object} opts
+ * @param {string} [opts.type='png']
+ * @param {string} [opts.pixelRatio=1]
+ * @param {string} [opts.backgroundColor]
+ * @param {string} [opts.excludeComponents]
+ */
+ echartsProto.getDataURL = function (opts) {
+ opts = opts || {};
+ var excludeComponents = opts.excludeComponents;
+ var ecModel = this._model;
+ var excludesComponentViews = [];
+ var self = this;
+
+ each(excludeComponents, function (componentType) {
+ ecModel.eachComponent({
+ mainType: componentType
+ }, function (component) {
+ var view = self._componentsMap[component.__viewId];
+ if (!view.group.ignore) {
+ excludesComponentViews.push(view);
+ view.group.ignore = true;
+ }
+ });
+ });
+
+ var url = this.getRenderedCanvas(opts).toDataURL(
+ 'image/' + (opts && opts.type || 'png')
+ );
+
+ each(excludesComponentViews, function (view) {
+ view.group.ignore = false;
+ });
+ return url;
+ };
+
+
+ /**
+ * @return {string}
+ * @param {Object} opts
+ * @param {string} [opts.type='png']
+ * @param {string} [opts.pixelRatio=1]
+ * @param {string} [opts.backgroundColor]
+ */
+ echartsProto.getConnectedDataURL = function (opts) {
+ if (!env.canvasSupported) {
+ return;
+ }
+ var groupId = this.group;
+ var mathMin = Math.min;
+ var mathMax = Math.max;
+ var MAX_NUMBER = Infinity;
+ if (connectedGroups[groupId]) {
+ var left = MAX_NUMBER;
+ var top = MAX_NUMBER;
+ var right = -MAX_NUMBER;
+ var bottom = -MAX_NUMBER;
+ var canvasList = [];
+ var dpr = (opts && opts.pixelRatio) || 1;
+
+ zrUtil.each(instances, function (chart, id) {
+ if (chart.group === groupId) {
+ var canvas = chart.getRenderedCanvas(
+ zrUtil.clone(opts)
+ );
+ var boundingRect = chart.getDom().getBoundingClientRect();
+ left = mathMin(boundingRect.left, left);
+ top = mathMin(boundingRect.top, top);
+ right = mathMax(boundingRect.right, right);
+ bottom = mathMax(boundingRect.bottom, bottom);
+ canvasList.push({
+ dom: canvas,
+ left: boundingRect.left,
+ top: boundingRect.top
+ });
+ }
+ });
+
+ left *= dpr;
+ top *= dpr;
+ right *= dpr;
+ bottom *= dpr;
+ var width = right - left;
+ var height = bottom - top;
+ var targetCanvas = zrUtil.createCanvas();
+ targetCanvas.width = width;
+ targetCanvas.height = height;
+ var zr = zrender.init(targetCanvas);
+
+ each(canvasList, function (item) {
+ var img = new graphic.Image({
+ style: {
+ x: item.left * dpr - left,
+ y: item.top * dpr - top,
+ image: item.dom
+ }
+ });
+ zr.add(img);
+ });
+ zr.refreshImmediately();
+
+ return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));
+ }
+ else {
+ return this.getDataURL(opts);
+ }
+ };
+
+ /**
+ * Convert from logical coordinate system to pixel coordinate system.
+ * See CoordinateSystem#convertToPixel.
+ * @param {string|Object} finder
+ * If string, e.g., 'geo', means {geoIndex: 0}.
+ * If Object, could contain some of these properties below:
+ * {
+ * seriesIndex / seriesId / seriesName,
+ * geoIndex / geoId, geoName,
+ * bmapIndex / bmapId / bmapName,
+ * xAxisIndex / xAxisId / xAxisName,
+ * yAxisIndex / yAxisId / yAxisName,
+ * gridIndex / gridId / gridName,
+ * ... (can be extended)
+ * }
+ * @param {Array|number} value
+ * @return {Array|number} result
+ */
+ echartsProto.convertToPixel = zrUtil.curry(doConvertPixel, 'convertToPixel');
+
+ /**
+ * Convert from pixel coordinate system to logical coordinate system.
+ * See CoordinateSystem#convertFromPixel.
+ * @param {string|Object} finder
+ * If string, e.g., 'geo', means {geoIndex: 0}.
+ * If Object, could contain some of these properties below:
+ * {
+ * seriesIndex / seriesId / seriesName,
+ * geoIndex / geoId / geoName,
+ * bmapIndex / bmapId / bmapName,
+ * xAxisIndex / xAxisId / xAxisName,
+ * yAxisIndex / yAxisId / yAxisName
+ * gridIndex / gridId / gridName,
+ * ... (can be extended)
+ * }
+ * @param {Array|number} value
+ * @return {Array|number} result
+ */
+ echartsProto.convertFromPixel = zrUtil.curry(doConvertPixel, 'convertFromPixel');
+
+ function doConvertPixel(methodName, finder, value) {
+ var ecModel = this._model;
+ var coordSysList = this._coordSysMgr.getCoordinateSystems();
+ var result;
+
+ finder = modelUtil.parseFinder(ecModel, finder);
+
+ for (var i = 0; i < coordSysList.length; i++) {
+ var coordSys = coordSysList[i];
+ if (coordSys[methodName]
+ && (result = coordSys[methodName](ecModel, finder, value)) != null
+ ) {
+ return result;
+ }
+ }
+
+ if (true) {
+ console.warn(
+ 'No coordinate system that supports ' + methodName + ' found by the given finder.'
+ );
+ }
+ }
+
+ /**
+ * Is the specified coordinate systems or components contain the given pixel point.
+ * @param {string|Object} finder
+ * If string, e.g., 'geo', means {geoIndex: 0}.
+ * If Object, could contain some of these properties below:
+ * {
+ * seriesIndex / seriesId / seriesName,
+ * geoIndex / geoId / geoName,
+ * bmapIndex / bmapId / bmapName,
+ * xAxisIndex / xAxisId / xAxisName,
+ * yAxisIndex / yAxisId / yAxisName,
+ * gridIndex / gridId / gridName,
+ * ... (can be extended)
+ * }
+ * @param {Array|number} value
+ * @return {boolean} result
+ */
+ echartsProto.containPixel = function (finder, value) {
+ var ecModel = this._model;
+ var result;
+
+ finder = modelUtil.parseFinder(ecModel, finder);
+
+ zrUtil.each(finder, function (models, key) {
+ key.indexOf('Models') >= 0 && zrUtil.each(models, function (model) {
+ var coordSys = model.coordinateSystem;
+ if (coordSys && coordSys.containPoint) {
+ result |= !!coordSys.containPoint(value);
+ }
+ else if (key === 'seriesModels') {
+ var view = this._chartsMap[model.__viewId];
+ if (view && view.containPoint) {
+ result |= view.containPoint(value, model);
+ }
+ else {
+ if (true) {
+ console.warn(key + ': ' + (view
+ ? 'The found component do not support containPoint.'
+ : 'No view mapping to the found component.'
+ ));
+ }
+ }
+ }
+ else {
+ if (true) {
+ console.warn(key + ': containPoint is not supported');
+ }
+ }
+ }, this);
+ }, this);
+
+ return !!result;
+ };
+
+ /**
+ * Get visual from series or data.
+ * @param {string|Object} finder
+ * If string, e.g., 'series', means {seriesIndex: 0}.
+ * If Object, could contain some of these properties below:
+ * {
+ * seriesIndex / seriesId / seriesName,
+ * dataIndex / dataIndexInside
+ * }
+ * If dataIndex is not specified, series visual will be fetched,
+ * but not data item visual.
+ * If all of seriesIndex, seriesId, seriesName are not specified,
+ * visual will be fetched from first series.
+ * @param {string} visualType 'color', 'symbol', 'symbolSize'
+ */
+ echartsProto.getVisual = function (finder, visualType) {
+ var ecModel = this._model;
+
+ finder = modelUtil.parseFinder(ecModel, finder, {defaultMainType: 'series'});
+
+ var seriesModel = finder.seriesModel;
+
+ if (true) {
+ if (!seriesModel) {
+ console.warn('There is no specified seires model');
+ }
+ }
+
+ var data = seriesModel.getData();
+
+ var dataIndexInside = finder.hasOwnProperty('dataIndexInside')
+ ? finder.dataIndexInside
+ : finder.hasOwnProperty('dataIndex')
+ ? data.indexOfRawIndex(finder.dataIndex)
+ : null;
+
+ return dataIndexInside != null
+ ? data.getItemVisual(dataIndexInside, visualType)
+ : data.getVisual(visualType);
+ };
+
+ /**
+ * Get view of corresponding component model
+ * @param {module:echarts/model/Component} componentModel
+ * @return {module:echarts/view/Component}
+ */
+ echartsProto.getViewOfComponentModel = function (componentModel) {
+ return this._componentsMap[componentModel.__viewId];
+ };
+
+ /**
+ * Get view of corresponding series model
+ * @param {module:echarts/model/Series} seriesModel
+ * @return {module:echarts/view/Chart}
+ */
+ echartsProto.getViewOfSeriesModel = function (seriesModel) {
+ return this._chartsMap[seriesModel.__viewId];
+ };
+
+
+ var updateMethods = {
+
+ /**
+ * @param {Object} payload
+ * @private
+ */
+ update: function (payload) {
+ // console.profile && console.profile('update');
+
+ var ecModel = this._model;
+ var api = this._api;
+ var coordSysMgr = this._coordSysMgr;
+ var zr = this._zr;
+ // update before setOption
+ if (!ecModel) {
+ return;
+ }
+
+ // Fixme First time update ?
+ ecModel.restoreData();
+
+ // TODO
+ // Save total ecModel here for undo/redo (after restoring data and before processing data).
+ // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.
+
+ // Create new coordinate system each update
+ // In LineView may save the old coordinate system and use it to get the orignal point
+ coordSysMgr.create(this._model, this._api);
+
+ processData.call(this, ecModel, api);
+
+ stackSeriesData.call(this, ecModel);
+
+ coordSysMgr.update(ecModel, api);
+
+ doVisualEncoding.call(this, ecModel, payload);
+
+ doRender.call(this, ecModel, payload);
+
+ // Set background
+ var backgroundColor = ecModel.get('backgroundColor') || 'transparent';
+
+ var painter = zr.painter;
+ // TODO all use clearColor ?
+ if (painter.isSingleCanvas && painter.isSingleCanvas()) {
+ zr.configLayer(0, {
+ clearColor: backgroundColor
+ });
+ }
+ else {
+ // In IE8
+ if (!env.canvasSupported) {
+ var colorArr = colorTool.parse(backgroundColor);
+ backgroundColor = colorTool.stringify(colorArr, 'rgb');
+ if (colorArr[3] === 0) {
+ backgroundColor = 'transparent';
+ }
+ }
+ if (backgroundColor.colorStops || backgroundColor.image) {
+ // Gradient background
+ // FIXME Fixed layer?
+ zr.configLayer(0, {
+ clearColor: backgroundColor
+ });
+ this[HAS_GRADIENT_OR_PATTERN_BG] = true;
+
+ this._dom.style.background = 'transparent';
+ }
+ else {
+ if (this[HAS_GRADIENT_OR_PATTERN_BG]) {
+ zr.configLayer(0, {
+ clearColor: null
+ });
+ }
+ this[HAS_GRADIENT_OR_PATTERN_BG] = false;
+
+ this._dom.style.background = backgroundColor;
+ }
+ }
+
+ each(postUpdateFuncs, function (func) {
+ func(ecModel, api);
+ });
+
+ // console.profile && console.profileEnd('update');
+ },
+
+ /**
+ * @param {Object} payload
+ * @private
+ */
+ updateView: function (payload) {
+ var ecModel = this._model;
+
+ // update before setOption
+ if (!ecModel) {
+ return;
+ }
+
+ ecModel.eachSeries(function (seriesModel) {
+ seriesModel.getData().clearAllVisual();
+ });
+
+ doVisualEncoding.call(this, ecModel, payload);
+
+ invokeUpdateMethod.call(this, 'updateView', ecModel, payload);
+ },
+
+ /**
+ * @param {Object} payload
+ * @private
+ */
+ updateVisual: function (payload) {
+ var ecModel = this._model;
+
+ // update before setOption
+ if (!ecModel) {
+ return;
+ }
+
+ ecModel.eachSeries(function (seriesModel) {
+ seriesModel.getData().clearAllVisual();
+ });
+
+ doVisualEncoding.call(this, ecModel, payload, true);
+
+ invokeUpdateMethod.call(this, 'updateVisual', ecModel, payload);
+ },
+
+ /**
+ * @param {Object} payload
+ * @private
+ */
+ updateLayout: function (payload) {
+ var ecModel = this._model;
+
+ // update before setOption
+ if (!ecModel) {
+ return;
+ }
+
+ doLayout.call(this, ecModel, payload);
+
+ invokeUpdateMethod.call(this, 'updateLayout', ecModel, payload);
+ },
+
+ /**
+ * @param {Object} payload
+ * @private
+ */
+ prepareAndUpdate: function (payload) {
+ var ecModel = this._model;
+
+ prepareView.call(this, 'component', ecModel);
+
+ prepareView.call(this, 'chart', ecModel);
+
+ updateMethods.update.call(this, payload);
+ }
+ };
+
+ /**
+ * @private
+ */
+ function updateDirectly(ecIns, method, payload, mainType, subType) {
+ var ecModel = ecIns._model;
+
+ // broadcast
+ if (!mainType) {
+ each(ecIns._componentsViews.concat(ecIns._chartsViews), callView);
+ return;
+ }
+
+ var query = {};
+ query[mainType + 'Id'] = payload[mainType + 'Id'];
+ query[mainType + 'Index'] = payload[mainType + 'Index'];
+ query[mainType + 'Name'] = payload[mainType + 'Name'];
+
+ var condition = {mainType: mainType, query: query};
+ subType && (condition.subType = subType); // subType may be '' by parseClassType;
+
+ // If dispatchAction before setOption, do nothing.
+ ecModel && ecModel.eachComponent(condition, function (model, index) {
+ callView(ecIns[
+ mainType === 'series' ? '_chartsMap' : '_componentsMap'
+ ][model.__viewId]);
+ }, ecIns);
+
+ function callView(view) {
+ view && view.__alive && view[method] && view[method](
+ view.__model, ecModel, ecIns._api, payload
+ );
+ }
+ }
+
+ /**
+ * Resize the chart
+ * @param {Object} opts
+ * @param {number} [opts.width] Can be 'auto' (the same as null/undefined)
+ * @param {number} [opts.height] Can be 'auto' (the same as null/undefined)
+ * @param {boolean} [opts.silent=false]
+ */
+ echartsProto.resize = function (opts) {
+ if (true) {
+ zrUtil.assert(!this[IN_MAIN_PROCESS], '`resize` should not be called during main process.');
+ }
+
+ this[IN_MAIN_PROCESS] = true;
+
+ this._zr.resize(opts);
+
+ var optionChanged = this._model && this._model.resetOption('media');
+ var updateMethod = optionChanged ? 'prepareAndUpdate' : 'update';
+
+ updateMethods[updateMethod].call(this);
+
+ // Resize loading effect
+ this._loadingFX && this._loadingFX.resize();
+
+ this[IN_MAIN_PROCESS] = false;
+
+ var silent = opts && opts.silent;
+
+ flushPendingActions.call(this, silent);
+
+ triggerUpdatedEvent.call(this, silent);
+ };
+
+ /**
+ * Show loading effect
+ * @param {string} [name='default']
+ * @param {Object} [cfg]
+ */
+ echartsProto.showLoading = function (name, cfg) {
+ if (zrUtil.isObject(name)) {
+ cfg = name;
+ name = '';
+ }
+ name = name || 'default';
+
+ this.hideLoading();
+ if (!loadingEffects[name]) {
+ if (true) {
+ console.warn('Loading effects ' + name + ' not exists.');
+ }
+ return;
+ }
+ var el = loadingEffects[name](this._api, cfg);
+ var zr = this._zr;
+ this._loadingFX = el;
+
+ zr.add(el);
+ };
+
+ /**
+ * Hide loading effect
+ */
+ echartsProto.hideLoading = function () {
+ this._loadingFX && this._zr.remove(this._loadingFX);
+ this._loadingFX = null;
+ };
+
+ /**
+ * @param {Object} eventObj
+ * @return {Object}
+ */
+ echartsProto.makeActionFromEvent = function (eventObj) {
+ var payload = zrUtil.extend({}, eventObj);
+ payload.type = eventActionMap[eventObj.type];
+ return payload;
+ };
+
+ /**
+ * @pubilc
+ * @param {Object} payload
+ * @param {string} [payload.type] Action type
+ * @param {Object|boolean} [opt] If pass boolean, means opt.silent
+ * @param {boolean} [opt.silent=false] Whether trigger events.
+ * @param {boolean} [opt.flush=undefined]
+ * true: Flush immediately, and then pixel in canvas can be fetched
+ * immediately. Caution: it might affect performance.
+ * false: Not not flush.
+ * undefined: Auto decide whether perform flush.
+ */
+ echartsProto.dispatchAction = function (payload, opt) {
+ if (!zrUtil.isObject(opt)) {
+ opt = {silent: !!opt};
+ }
+
+ if (!actions[payload.type]) {
+ return;
+ }
+
+ // Avoid dispatch action before setOption. Especially in `connect`.
+ if (!this._model) {
+ return;
+ }
+
+ // May dispatchAction in rendering procedure
+ if (this[IN_MAIN_PROCESS]) {
+ this._pendingActions.push(payload);
+ return;
+ }
+
+ doDispatchAction.call(this, payload, opt.silent);
+
+ if (opt.flush) {
+ this._zr.flush(true);
+ }
+ else if (opt.flush !== false && env.browser.weChat) {
+ // In WeChat embeded browser, `requestAnimationFrame` and `setInterval`
+ // hang when sliding page (on touch event), which cause that zr does not
+ // refresh util user interaction finished, which is not expected.
+ // But `dispatchAction` may be called too frequently when pan on touch
+ // screen, which impacts performance if do not throttle them.
+ this._throttledZrFlush();
+ }
+
+ flushPendingActions.call(this, opt.silent);
+
+ triggerUpdatedEvent.call(this, opt.silent);
+ };
+
+ function doDispatchAction(payload, silent) {
+ var payloadType = payload.type;
+ var escapeConnect = payload.escapeConnect;
+ var actionWrap = actions[payloadType];
+ var actionInfo = actionWrap.actionInfo;
+
+ var cptType = (actionInfo.update || 'update').split(':');
+ var updateMethod = cptType.pop();
+ cptType = cptType[0] != null && parseClassType(cptType[0]);
+
+ this[IN_MAIN_PROCESS] = true;
+
+ var payloads = [payload];
+ var batched = false;
+ // Batch action
+ if (payload.batch) {
+ batched = true;
+ payloads = zrUtil.map(payload.batch, function (item) {
+ item = zrUtil.defaults(zrUtil.extend({}, item), payload);
+ item.batch = null;
+ return item;
+ });
+ }
+
+ var eventObjBatch = [];
+ var eventObj;
+ var isHighDown = payloadType === 'highlight' || payloadType === 'downplay';
+
+ each(payloads, function (batchItem) {
+ // Action can specify the event by return it.
+ eventObj = actionWrap.action(batchItem, this._model, this._api);
+ // Emit event outside
+ eventObj = eventObj || zrUtil.extend({}, batchItem);
+ // Convert type to eventType
+ eventObj.type = actionInfo.event || eventObj.type;
+ eventObjBatch.push(eventObj);
+
+ // light update does not perform data process, layout and visual.
+ if (isHighDown) {
+ // method, payload, mainType, subType
+ updateDirectly(this, updateMethod, batchItem, 'series');
+ }
+ else if (cptType) {
+ updateDirectly(this, updateMethod, batchItem, cptType.main, cptType.sub);
+ }
+ }, this);
+
+ if (updateMethod !== 'none' && !isHighDown && !cptType) {
+ // Still dirty
+ if (this[OPTION_UPDATED]) {
+ // FIXME Pass payload ?
+ updateMethods.prepareAndUpdate.call(this, payload);
+ this[OPTION_UPDATED] = false;
+ }
+ else {
+ updateMethods[updateMethod].call(this, payload);
+ }
+ }
+
+ // Follow the rule of action batch
+ if (batched) {
+ eventObj = {
+ type: actionInfo.event || payloadType,
+ escapeConnect: escapeConnect,
+ batch: eventObjBatch
+ };
+ }
+ else {
+ eventObj = eventObjBatch[0];
+ }
+
+ this[IN_MAIN_PROCESS] = false;
+
+ !silent && this._messageCenter.trigger(eventObj.type, eventObj);
+ }
+
+ function flushPendingActions(silent) {
+ var pendingActions = this._pendingActions;
+ while (pendingActions.length) {
+ var payload = pendingActions.shift();
+ doDispatchAction.call(this, payload, silent);
+ }
+ }
+
+ function triggerUpdatedEvent(silent) {
+ !silent && this.trigger('updated');
+ }
+
+ /**
+ * Register event
+ * @method
+ */
+ echartsProto.on = createRegisterEventWithLowercaseName('on');
+ echartsProto.off = createRegisterEventWithLowercaseName('off');
+ echartsProto.one = createRegisterEventWithLowercaseName('one');
+
+ /**
+ * @param {string} methodName
+ * @private
+ */
+ function invokeUpdateMethod(methodName, ecModel, payload) {
+ var api = this._api;
+
+ // Update all components
+ each(this._componentsViews, function (component) {
+ var componentModel = component.__model;
+ component[methodName](componentModel, ecModel, api, payload);
+
+ updateZ(componentModel, component);
+ }, this);
+
+ // Upate all charts
+ ecModel.eachSeries(function (seriesModel, idx) {
+ var chart = this._chartsMap[seriesModel.__viewId];
+ chart[methodName](seriesModel, ecModel, api, payload);
+
+ updateZ(seriesModel, chart);
+
+ updateProgressiveAndBlend(seriesModel, chart);
+ }, this);
+
+ // If use hover layer
+ updateHoverLayerStatus(this._zr, ecModel);
+
+ // Post render
+ each(postUpdateFuncs, function (func) {
+ func(ecModel, api);
+ });
+ }
+
+ /**
+ * Prepare view instances of charts and components
+ * @param {module:echarts/model/Global} ecModel
+ * @private
+ */
+ function prepareView(type, ecModel) {
+ var isComponent = type === 'component';
+ var viewList = isComponent ? this._componentsViews : this._chartsViews;
+ var viewMap = isComponent ? this._componentsMap : this._chartsMap;
+ var zr = this._zr;
+
+ for (var i = 0; i < viewList.length; i++) {
+ viewList[i].__alive = false;
+ }
+
+ ecModel[isComponent ? 'eachComponent' : 'eachSeries'](function (componentType, model) {
+ if (isComponent) {
+ if (componentType === 'series') {
+ return;
+ }
+ }
+ else {
+ model = componentType;
+ }
+
+ // Consider: id same and type changed.
+ var viewId = '_ec_' + model.id + '_' + model.type;
+ var view = viewMap[viewId];
+ if (!view) {
+ var classType = parseClassType(model.type);
+ var Clazz = isComponent
+ ? ComponentView.getClass(classType.main, classType.sub)
+ : ChartView.getClass(classType.sub);
+ if (Clazz) {
+ view = new Clazz();
+ view.init(ecModel, this._api);
+ viewMap[viewId] = view;
+ viewList.push(view);
+ zr.add(view.group);
+ }
+ else {
+ // Error
+ return;
+ }
+ }
+
+ model.__viewId = view.__id = viewId;
+ view.__alive = true;
+ view.__model = model;
+ view.group.__ecComponentInfo = {
+ mainType: model.mainType,
+ index: model.componentIndex
+ };
+ }, this);
+
+ for (var i = 0; i < viewList.length;) {
+ var view = viewList[i];
+ if (!view.__alive) {
+ zr.remove(view.group);
+ view.dispose(ecModel, this._api);
+ viewList.splice(i, 1);
+ delete viewMap[view.__id];
+ view.__id = view.group.__ecComponentInfo = null;
+ }
+ else {
+ i++;
+ }
+ }
+ }
+
+ /**
+ * Processor data in each series
+ *
+ * @param {module:echarts/model/Global} ecModel
+ * @private
+ */
+ function processData(ecModel, api) {
+ each(dataProcessorFuncs, function (process) {
+ process.func(ecModel, api);
+ });
+ }
+
+ /**
+ * @private
+ */
+ function stackSeriesData(ecModel) {
+ var stackedDataMap = {};
+ ecModel.eachSeries(function (series) {
+ var stack = series.get('stack');
+ var data = series.getData();
+ if (stack && data.type === 'list') {
+ var previousStack = stackedDataMap[stack];
+ // Avoid conflict with Object.prototype
+ if (stackedDataMap.hasOwnProperty(stack) && previousStack) {
+ data.stackedOn = previousStack;
+ }
+ stackedDataMap[stack] = data;
+ }
+ });
+ }
+
+ /**
+ * Layout before each chart render there series, special visual encoding stage
+ *
+ * @param {module:echarts/model/Global} ecModel
+ * @private
+ */
+ function doLayout(ecModel, payload) {
+ var api = this._api;
+ each(visualFuncs, function (visual) {
+ if (visual.isLayout) {
+ visual.func(ecModel, api, payload);
+ }
+ });
+ }
+
+ /**
+ * Encode visual infomation from data after data processing
+ *
+ * @param {module:echarts/model/Global} ecModel
+ * @param {object} layout
+ * @param {boolean} [excludesLayout]
+ * @private
+ */
+ function doVisualEncoding(ecModel, payload, excludesLayout) {
+ var api = this._api;
+ ecModel.clearColorPalette();
+ ecModel.eachSeries(function (seriesModel) {
+ seriesModel.clearColorPalette();
+ });
+ each(visualFuncs, function (visual) {
+ (!excludesLayout || !visual.isLayout)
+ && visual.func(ecModel, api, payload);
+ });
+ }
+
+ /**
+ * Render each chart and component
+ * @private
+ */
+ function doRender(ecModel, payload) {
+ var api = this._api;
+ // Render all components
+ each(this._componentsViews, function (componentView) {
+ var componentModel = componentView.__model;
+ componentView.render(componentModel, ecModel, api, payload);
+
+ updateZ(componentModel, componentView);
+ }, this);
+
+ each(this._chartsViews, function (chart) {
+ chart.__alive = false;
+ }, this);
+
+ // Render all charts
+ ecModel.eachSeries(function (seriesModel, idx) {
+ var chartView = this._chartsMap[seriesModel.__viewId];
+ chartView.__alive = true;
+ chartView.render(seriesModel, ecModel, api, payload);
+
+ chartView.group.silent = !!seriesModel.get('silent');
+
+ updateZ(seriesModel, chartView);
+
+ updateProgressiveAndBlend(seriesModel, chartView);
+
+ }, this);
+
+ // If use hover layer
+ updateHoverLayerStatus(this._zr, ecModel);
+
+ // Remove groups of unrendered charts
+ each(this._chartsViews, function (chart) {
+ if (!chart.__alive) {
+ chart.remove(ecModel, api);
+ }
+ }, this);
+ }
+
+ var MOUSE_EVENT_NAMES = [
+ 'click', 'dblclick', 'mouseover', 'mouseout', 'mousemove',
+ 'mousedown', 'mouseup', 'globalout', 'contextmenu'
+ ];
+ /**
+ * @private
+ */
+ echartsProto._initEvents = function () {
+ each(MOUSE_EVENT_NAMES, function (eveName) {
+ this._zr.on(eveName, function (e) {
+ var ecModel = this.getModel();
+ var el = e.target;
+ var params;
+
+ // no e.target when 'globalout'.
+ if (eveName === 'globalout') {
+ params = {};
+ }
+ else if (el && el.dataIndex != null) {
+ var dataModel = el.dataModel || ecModel.getSeriesByIndex(el.seriesIndex);
+ params = dataModel && dataModel.getDataParams(el.dataIndex, el.dataType) || {};
+ }
+ // If element has custom eventData of components
+ else if (el && el.eventData) {
+ params = zrUtil.extend({}, el.eventData);
+ }
+
+ if (params) {
+ params.event = e;
+ params.type = eveName;
+ this.trigger(eveName, params);
+ }
+
+ }, this);
+ }, this);
+
+ each(eventActionMap, function (actionType, eventType) {
+ this._messageCenter.on(eventType, function (event) {
+ this.trigger(eventType, event);
+ }, this);
+ }, this);
+ };
+
+ /**
+ * @return {boolean}
+ */
+ echartsProto.isDisposed = function () {
+ return this._disposed;
+ };
+
+ /**
+ * Clear
+ */
+ echartsProto.clear = function () {
+ this.setOption({ series: [] }, true);
+ };
+
+ /**
+ * Dispose instance
+ */
+ echartsProto.dispose = function () {
+ if (this._disposed) {
+ if (true) {
+ console.warn('Instance ' + this.id + ' has been disposed');
+ }
+ return;
+ }
+ this._disposed = true;
+
+ var api = this._api;
+ var ecModel = this._model;
+
+ each(this._componentsViews, function (component) {
+ component.dispose(ecModel, api);
+ });
+ each(this._chartsViews, function (chart) {
+ chart.dispose(ecModel, api);
+ });
+
+ // Dispose after all views disposed
+ this._zr.dispose();
+
+ delete instances[this.id];
+ };
+
+ zrUtil.mixin(ECharts, Eventful);
+
+ function updateHoverLayerStatus(zr, ecModel) {
+ var storage = zr.storage;
+ var elCount = 0;
+ storage.traverse(function (el) {
+ if (!el.isGroup) {
+ elCount++;
+ }
+ });
+ if (elCount > ecModel.get('hoverLayerThreshold') && !env.node) {
+ storage.traverse(function (el) {
+ if (!el.isGroup) {
+ el.useHoverLayer = true;
+ }
+ });
+ }
+ }
+
+ /**
+ * Update chart progressive and blend.
+ * @param {module:echarts/model/Series|module:echarts/model/Component} model
+ * @param {module:echarts/view/Component|module:echarts/view/Chart} view
+ */
+ function updateProgressiveAndBlend(seriesModel, chartView) {
+ // Progressive configuration
+ var elCount = 0;
+ chartView.group.traverse(function (el) {
+ if (el.type !== 'group' && !el.ignore) {
+ elCount++;
+ }
+ });
+ var frameDrawNum = +seriesModel.get('progressive');
+ var needProgressive = elCount > seriesModel.get('progressiveThreshold') && frameDrawNum && !env.node;
+ if (needProgressive) {
+ chartView.group.traverse(function (el) {
+ // FIXME marker and other components
+ if (!el.isGroup) {
+ el.progressive = needProgressive ?
+ Math.floor(elCount++ / frameDrawNum) : -1;
+ if (needProgressive) {
+ el.stopAnimation(true);
+ }
+ }
+ });
+ }
+
+ // Blend configration
+ var blendMode = seriesModel.get('blendMode') || null;
+ if (true) {
+ if (!env.canvasSupported && blendMode && blendMode !== 'source-over') {
+ console.warn('Only canvas support blendMode');
+ }
+ }
+ chartView.group.traverse(function (el) {
+ // FIXME marker and other components
+ if (!el.isGroup) {
+ el.setStyle('blend', blendMode);
+ }
+ });
+ }
+
+ /**
+ * @param {module:echarts/model/Series|module:echarts/model/Component} model
+ * @param {module:echarts/view/Component|module:echarts/view/Chart} view
+ */
+ function updateZ(model, view) {
+ var z = model.get('z');
+ var zlevel = model.get('zlevel');
+ // Set z and zlevel
+ view.group.traverse(function (el) {
+ if (el.type !== 'group') {
+ z != null && (el.z = z);
+ zlevel != null && (el.zlevel = zlevel);
+ }
+ });
+ }
+
+ function createExtensionAPI(ecInstance) {
+ var coordSysMgr = ecInstance._coordSysMgr;
+ return zrUtil.extend(new ExtensionAPI(ecInstance), {
+ // Inject methods
+ getCoordinateSystems: zrUtil.bind(
+ coordSysMgr.getCoordinateSystems, coordSysMgr
+ ),
+ getComponentByElement: function (el) {
+ while (el) {
+ var modelInfo = el.__ecComponentInfo;
+ if (modelInfo != null) {
+ return ecInstance._model.getComponent(modelInfo.mainType, modelInfo.index);
+ }
+ el = el.parent;
+ }
+ }
+ });
+ }
+
+ /**
+ * @type {Object} key: actionType.
+ * @inner
+ */
+ var actions = {};
+
+ /**
+ * Map eventType to actionType
+ * @type {Object}
+ */
+ var eventActionMap = {};
+
+ /**
+ * Data processor functions of each stage
+ * @type {Array.>}
+ * @inner
+ */
+ var dataProcessorFuncs = [];
+
+ /**
+ * @type {Array.}
+ * @inner
+ */
+ var optionPreprocessorFuncs = [];
+
+ /**
+ * @type {Array.}
+ * @inner
+ */
+ var postUpdateFuncs = [];
+
+ /**
+ * Visual encoding functions of each stage
+ * @type {Array.>}
+ * @inner
+ */
+ var visualFuncs = [];
+ /**
+ * Theme storage
+ * @type {Object.}
+ */
+ var themeStorage = {};
+ /**
+ * Loading effects
+ */
+ var loadingEffects = {};
+
+
+ var instances = {};
+ var connectedGroups = {};
+
+ var idBase = new Date() - 0;
+ var groupIdBase = new Date() - 0;
+ var DOM_ATTRIBUTE_KEY = '_echarts_instance_';
+
+ /**
+ * @alias module:echarts
+ */
+ var echarts = {
+ /**
+ * @type {number}
+ */
+ version: '3.7.2',
+ dependencies: {
+ zrender: '3.6.2'
+ }
+ };
+
+ function enableConnect(chart) {
+ var STATUS_PENDING = 0;
+ var STATUS_UPDATING = 1;
+ var STATUS_UPDATED = 2;
+ var STATUS_KEY = '__connectUpdateStatus';
+
+ function updateConnectedChartsStatus(charts, status) {
+ for (var i = 0; i < charts.length; i++) {
+ var otherChart = charts[i];
+ otherChart[STATUS_KEY] = status;
+ }
+ }
+
+ zrUtil.each(eventActionMap, function (actionType, eventType) {
+ chart._messageCenter.on(eventType, function (event) {
+ if (connectedGroups[chart.group] && chart[STATUS_KEY] !== STATUS_PENDING) {
+ if (event && event.escapeConnect) {
+ return;
+ }
+
+ var action = chart.makeActionFromEvent(event);
+ var otherCharts = [];
+
+ zrUtil.each(instances, function (otherChart) {
+ if (otherChart !== chart && otherChart.group === chart.group) {
+ otherCharts.push(otherChart);
+ }
+ });
+
+ updateConnectedChartsStatus(otherCharts, STATUS_PENDING);
+ each(otherCharts, function (otherChart) {
+ if (otherChart[STATUS_KEY] !== STATUS_UPDATING) {
+ otherChart.dispatchAction(action);
+ }
+ });
+ updateConnectedChartsStatus(otherCharts, STATUS_UPDATED);
+ }
+ });
+ });
+ }
+
+ /**
+ * @param {HTMLElement} dom
+ * @param {Object} [theme]
+ * @param {Object} opts
+ * @param {number} [opts.devicePixelRatio] Use window.devicePixelRatio by default
+ * @param {string} [opts.renderer] Currently only 'canvas' is supported.
+ * @param {number} [opts.width] Use clientWidth of the input `dom` by default.
+ * Can be 'auto' (the same as null/undefined)
+ * @param {number} [opts.height] Use clientHeight of the input `dom` by default.
+ * Can be 'auto' (the same as null/undefined)
+ */
+ echarts.init = function (dom, theme, opts) {
+ if (true) {
+ // Check version
+ if ((zrender.version.replace('.', '') - 0) < (echarts.dependencies.zrender.replace('.', '') - 0)) {
+ throw new Error(
+ 'ZRender ' + zrender.version
+ + ' is too old for ECharts ' + echarts.version
+ + '. Current version need ZRender '
+ + echarts.dependencies.zrender + '+'
+ );
+ }
+
+ if (!dom) {
+ throw new Error('Initialize failed: invalid dom.');
+ }
+ }
+
+ var existInstance = echarts.getInstanceByDom(dom);
+ if (existInstance) {
+ if (true) {
+ console.warn('There is a chart instance already initialized on the dom.');
+ }
+ return existInstance;
+ }
+
+ if (true) {
+ if (zrUtil.isDom(dom)
+ && dom.nodeName.toUpperCase() !== 'CANVAS'
+ && (
+ (!dom.clientWidth && (!opts || opts.width == null))
+ || (!dom.clientHeight && (!opts || opts.height == null))
+ )
+ ) {
+ console.warn('Can\'t get dom width or height');
+ }
+ }
+
+ var chart = new ECharts(dom, theme, opts);
+ chart.id = 'ec_' + idBase++;
+ instances[chart.id] = chart;
+
+ if (dom.setAttribute) {
+ dom.setAttribute(DOM_ATTRIBUTE_KEY, chart.id);
+ }
+ else {
+ dom[DOM_ATTRIBUTE_KEY] = chart.id;
+ }
+
+ enableConnect(chart);
+
+ return chart;
+ };
+
+ /**
+ * @return {string|Array.} groupId
+ */
+ echarts.connect = function (groupId) {
+ // Is array of charts
+ if (zrUtil.isArray(groupId)) {
+ var charts = groupId;
+ groupId = null;
+ // If any chart has group
+ zrUtil.each(charts, function (chart) {
+ if (chart.group != null) {
+ groupId = chart.group;
+ }
+ });
+ groupId = groupId || ('g_' + groupIdBase++);
+ zrUtil.each(charts, function (chart) {
+ chart.group = groupId;
+ });
+ }
+ connectedGroups[groupId] = true;
+ return groupId;
+ };
+
+ /**
+ * @DEPRECATED
+ * @return {string} groupId
+ */
+ echarts.disConnect = function (groupId) {
+ connectedGroups[groupId] = false;
+ };
+
+ /**
+ * @return {string} groupId
+ */
+ echarts.disconnect = echarts.disConnect;
+
+ /**
+ * Dispose a chart instance
+ * @param {module:echarts~ECharts|HTMLDomElement|string} chart
+ */
+ echarts.dispose = function (chart) {
+ if (typeof chart === 'string') {
+ chart = instances[chart];
+ }
+ else if (!(chart instanceof ECharts)){
+ // Try to treat as dom
+ chart = echarts.getInstanceByDom(chart);
+ }
+ if ((chart instanceof ECharts) && !chart.isDisposed()) {
+ chart.dispose();
+ }
+ };
+
+ /**
+ * @param {HTMLElement} dom
+ * @return {echarts~ECharts}
+ */
+ echarts.getInstanceByDom = function (dom) {
+ var key;
+ if (dom.getAttribute) {
+ key = dom.getAttribute(DOM_ATTRIBUTE_KEY);
+ }
+ else {
+ key = dom[DOM_ATTRIBUTE_KEY];
+ }
+ return instances[key];
+ };
+
+ /**
+ * @param {string} key
+ * @return {echarts~ECharts}
+ */
+ echarts.getInstanceById = function (key) {
+ return instances[key];
+ };
+
+ /**
+ * Register theme
+ */
+ echarts.registerTheme = function (name, theme) {
+ themeStorage[name] = theme;
+ };
+
+ /**
+ * Register option preprocessor
+ * @param {Function} preprocessorFunc
+ */
+ echarts.registerPreprocessor = function (preprocessorFunc) {
+ optionPreprocessorFuncs.push(preprocessorFunc);
+ };
+
+ /**
+ * @param {number} [priority=1000]
+ * @param {Function} processorFunc
+ */
+ echarts.registerProcessor = function (priority, processorFunc) {
+ if (typeof priority === 'function') {
+ processorFunc = priority;
+ priority = PRIORITY_PROCESSOR_FILTER;
+ }
+ if (true) {
+ if (isNaN(priority)) {
+ throw new Error('Unkown processor priority');
+ }
+ }
+ dataProcessorFuncs.push({
+ prio: priority,
+ func: processorFunc
+ });
+ };
+
+ /**
+ * Register postUpdater
+ * @param {Function} postUpdateFunc
+ */
+ echarts.registerPostUpdate = function (postUpdateFunc) {
+ postUpdateFuncs.push(postUpdateFunc);
+ };
+
+ /**
+ * Usage:
+ * registerAction('someAction', 'someEvent', function () { ... });
+ * registerAction('someAction', function () { ... });
+ * registerAction(
+ * {type: 'someAction', event: 'someEvent', update: 'updateView'},
+ * function () { ... }
+ * );
+ *
+ * @param {(string|Object)} actionInfo
+ * @param {string} actionInfo.type
+ * @param {string} [actionInfo.event]
+ * @param {string} [actionInfo.update]
+ * @param {string} [eventName]
+ * @param {Function} action
+ */
+ echarts.registerAction = function (actionInfo, eventName, action) {
+ if (typeof eventName === 'function') {
+ action = eventName;
+ eventName = '';
+ }
+ var actionType = zrUtil.isObject(actionInfo)
+ ? actionInfo.type
+ : ([actionInfo, actionInfo = {
+ event: eventName
+ }][0]);
+
+ // Event name is all lowercase
+ actionInfo.event = (actionInfo.event || actionType).toLowerCase();
+ eventName = actionInfo.event;
+
+ // Validate action type and event name.
+ zrUtil.assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));
+
+ if (!actions[actionType]) {
+ actions[actionType] = {action: action, actionInfo: actionInfo};
+ }
+ eventActionMap[eventName] = actionType;
+ };
+
+ /**
+ * @param {string} type
+ * @param {*} CoordinateSystem
+ */
+ echarts.registerCoordinateSystem = function (type, CoordinateSystem) {
+ CoordinateSystemManager.register(type, CoordinateSystem);
+ };
+
+ /**
+ * Get dimensions of specified coordinate system.
+ * @param {string} type
+ * @return {Array.}
+ */
+ echarts.getCoordinateSystemDimensions = function (type) {
+ var coordSysCreator = CoordinateSystemManager.get(type);
+ if (coordSysCreator) {
+ return coordSysCreator.getDimensionsInfo
+ ? coordSysCreator.getDimensionsInfo()
+ : coordSysCreator.dimensions.slice();
+ }
+ };
+
+ /**
+ * Layout is a special stage of visual encoding
+ * Most visual encoding like color are common for different chart
+ * But each chart has it's own layout algorithm
+ *
+ * @param {number} [priority=1000]
+ * @param {Function} layoutFunc
+ */
+ echarts.registerLayout = function (priority, layoutFunc) {
+ if (typeof priority === 'function') {
+ layoutFunc = priority;
+ priority = PRIORITY_VISUAL_LAYOUT;
+ }
+ if (true) {
+ if (isNaN(priority)) {
+ throw new Error('Unkown layout priority');
+ }
+ }
+ visualFuncs.push({
+ prio: priority,
+ func: layoutFunc,
+ isLayout: true
+ });
+ };
+
+ /**
+ * @param {number} [priority=3000]
+ * @param {Function} visualFunc
+ */
+ echarts.registerVisual = function (priority, visualFunc) {
+ if (typeof priority === 'function') {
+ visualFunc = priority;
+ priority = PRIORITY_VISUAL_CHART;
+ }
+ if (true) {
+ if (isNaN(priority)) {
+ throw new Error('Unkown visual priority');
+ }
+ }
+ visualFuncs.push({
+ prio: priority,
+ func: visualFunc
+ });
+ };
+
+ /**
+ * @param {string} name
+ */
+ echarts.registerLoading = function (name, loadingFx) {
+ loadingEffects[name] = loadingFx;
+ };
+
+ /**
+ * @param {Object} opts
+ * @param {string} [superClass]
+ */
+ echarts.extendComponentModel = function (opts/*, superClass*/) {
+ // var Clazz = ComponentModel;
+ // if (superClass) {
+ // var classType = parseClassType(superClass);
+ // Clazz = ComponentModel.getClass(classType.main, classType.sub, true);
+ // }
+ return ComponentModel.extend(opts);
+ };
+
+ /**
+ * @param {Object} opts
+ * @param {string} [superClass]
+ */
+ echarts.extendComponentView = function (opts/*, superClass*/) {
+ // var Clazz = ComponentView;
+ // if (superClass) {
+ // var classType = parseClassType(superClass);
+ // Clazz = ComponentView.getClass(classType.main, classType.sub, true);
+ // }
+ return ComponentView.extend(opts);
+ };
+
+ /**
+ * @param {Object} opts
+ * @param {string} [superClass]
+ */
+ echarts.extendSeriesModel = function (opts/*, superClass*/) {
+ // var Clazz = SeriesModel;
+ // if (superClass) {
+ // superClass = 'series.' + superClass.replace('series.', '');
+ // var classType = parseClassType(superClass);
+ // Clazz = ComponentModel.getClass(classType.main, classType.sub, true);
+ // }
+ return SeriesModel.extend(opts);
+ };
+
+ /**
+ * @param {Object} opts
+ * @param {string} [superClass]
+ */
+ echarts.extendChartView = function (opts/*, superClass*/) {
+ // var Clazz = ChartView;
+ // if (superClass) {
+ // superClass = superClass.replace('series.', '');
+ // var classType = parseClassType(superClass);
+ // Clazz = ChartView.getClass(classType.main, true);
+ // }
+ return ChartView.extend(opts);
+ };
+
+ /**
+ * ZRender need a canvas context to do measureText.
+ * But in node environment canvas may be created by node-canvas.
+ * So we need to specify how to create a canvas instead of using document.createElement('canvas')
+ *
+ * Be careful of using it in the browser.
+ *
+ * @param {Function} creator
+ * @example
+ * var Canvas = require('canvas');
+ * var echarts = require('echarts');
+ * echarts.setCanvasCreator(function () {
+ * // Small size is enough.
+ * return new Canvas(32, 32);
+ * });
+ */
+ echarts.setCanvasCreator = function (creator) {
+ zrUtil.createCanvas = creator;
+ };
+
+ echarts.registerVisual(PRIORITY_VISUAL_GLOBAL, __webpack_require__(99));
+ echarts.registerPreprocessor(backwardCompat);
+ echarts.registerLoading('default', __webpack_require__(100));
+
+ // Default action
+ echarts.registerAction({
+ type: 'highlight',
+ event: 'highlight',
+ update: 'highlight'
+ }, zrUtil.noop);
+ echarts.registerAction({
+ type: 'downplay',
+ event: 'downplay',
+ update: 'downplay'
+ }, zrUtil.noop);
+
+ // --------
+ // Exports
+ // --------
+ echarts.zrender = zrender;
+
+ echarts.List = __webpack_require__(101);
+ echarts.Model = __webpack_require__(14);
+
+ echarts.Axis = __webpack_require__(103);
+
+ echarts.graphic = __webpack_require__(20);
+ echarts.number = __webpack_require__(7);
+ echarts.format = __webpack_require__(6);
+ echarts.throttle = throttle.throttle;
+ echarts.matrix = __webpack_require__(11);
+ echarts.vector = __webpack_require__(10);
+ echarts.color = __webpack_require__(33);
+
+ echarts.util = {};
+ each([
+ 'map', 'each', 'filter', 'indexOf', 'inherits', 'reduce', 'filter',
+ 'bind', 'curry', 'isArray', 'isString', 'isObject', 'isFunction',
+ 'extend', 'defaults', 'clone', 'merge'
+ ],
+ function (name) {
+ echarts.util[name] = zrUtil[name];
+ }
+ );
+
+ echarts.helper = __webpack_require__(111);
+
+
+ // PRIORITY
+ echarts.PRIORITY = {
+ PROCESSOR: {
+ FILTER: PRIORITY_PROCESSOR_FILTER,
+ STATISTIC: PRIORITY_PROCESSOR_STATISTIC
+ },
+ VISUAL: {
+ LAYOUT: PRIORITY_VISUAL_LAYOUT,
+ GLOBAL: PRIORITY_VISUAL_GLOBAL,
+ CHART: PRIORITY_VISUAL_CHART,
+ COMPONENT: PRIORITY_VISUAL_COMPONENT,
+ BRUSH: PRIORITY_VISUAL_BRUSH
+ }
+ };
+
+ module.exports = echarts;
+
+
+/***/ }),
+/* 2 */
+/***/ (function(module, exports) {
+
+ /**
+ * echarts设备环境识别
+ *
+ * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。
+ * @author firede[firede@firede.us]
+ * @desc thanks zepto.
+ */
+
+ var env = {};
+ if (typeof navigator === 'undefined') {
+ // In node
+ env = {
+ browser: {},
+ os: {},
+ node: true,
+ // Assume canvas is supported
+ canvasSupported: true
+ };
+ }
+ else {
+ env = detect(navigator.userAgent);
+ }
+
+ module.exports = env;
+
+ // Zepto.js
+ // (c) 2010-2013 Thomas Fuchs
+ // Zepto.js may be freely distributed under the MIT license.
+
+ function detect(ua) {
+ var os = {};
+ var browser = {};
+ // var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/);
+ // var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
+ // var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
+ // var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
+ // var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
+ // var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/);
+ // var touchpad = webos && ua.match(/TouchPad/);
+ // var kindle = ua.match(/Kindle\/([\d.]+)/);
+ // var silk = ua.match(/Silk\/([\d._]+)/);
+ // var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/);
+ // var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/);
+ // var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/);
+ // var playbook = ua.match(/PlayBook/);
+ // var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/);
+ var firefox = ua.match(/Firefox\/([\d.]+)/);
+ // var safari = webkit && ua.match(/Mobile\//) && !chrome;
+ // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;
+ var ie = ua.match(/MSIE\s([\d.]+)/)
+ // IE 11 Trident/7.0; rv:11.0
+ || ua.match(/Trident\/.+?rv:(([\d.]+))/);
+ var edge = ua.match(/Edge\/([\d.]+)/); // IE 12 and 12+
+
+ var weChat = (/micromessenger/i).test(ua);
+
+ // Todo: clean this up with a better OS/browser seperation:
+ // - discern (more) between multiple browsers on android
+ // - decide if kindle fire in silk mode is android or not
+ // - Firefox on Android doesn't specify the Android version
+ // - possibly devide in os, device and browser hashes
+
+ // if (browser.webkit = !!webkit) browser.version = webkit[1];
+
+ // if (android) os.android = true, os.version = android[2];
+ // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');
+ // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');
+ // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
+ // if (webos) os.webos = true, os.version = webos[2];
+ // if (touchpad) os.touchpad = true;
+ // if (blackberry) os.blackberry = true, os.version = blackberry[2];
+ // if (bb10) os.bb10 = true, os.version = bb10[2];
+ // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];
+ // if (playbook) browser.playbook = true;
+ // if (kindle) os.kindle = true, os.version = kindle[1];
+ // if (silk) browser.silk = true, browser.version = silk[1];
+ // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;
+ // if (chrome) browser.chrome = true, browser.version = chrome[1];
+ if (firefox) {
+ browser.firefox = true;
+ browser.version = firefox[1];
+ }
+ // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;
+ // if (webview) browser.webview = true;
+
+ if (ie) {
+ browser.ie = true;
+ browser.version = ie[1];
+ }
+
+ if (edge) {
+ browser.edge = true;
+ browser.version = edge[1];
+ }
+
+ // It is difficult to detect WeChat in Win Phone precisely, because ua can
+ // not be set on win phone. So we do not consider Win Phone.
+ if (weChat) {
+ browser.weChat = true;
+ }
+
+ // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||
+ // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));
+ // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos ||
+ // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\/([\d.]+)/)) ||
+ // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));
+
+ return {
+ browser: browser,
+ os: os,
+ node: false,
+ // 原生canvas支持,改极端点了
+ // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)
+ canvasSupported : document.createElement('canvas').getContext ? true : false,
+ // @see
+ // works on most browsers
+ // IE10/11 does not support touch event, and MS Edge supports them but not by
+ // default, so we dont check navigator.maxTouchPoints for them here.
+ touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,
+ // .
+ pointerEventsSupported: 'onpointerdown' in window
+ // Firefox supports pointer but not by default, only MS browsers are reliable on pointer
+ // events currently. So we dont use that on other browsers unless tested sufficiently.
+ // Although IE 10 supports pointer event, it use old style and is different from the
+ // standard. So we exclude that. (IE 10 is hardly used on touch device)
+ && (browser.edge || (browser.ie && browser.version >= 11))
+ };
+ }
+
+
+/***/ }),
+/* 3 */
+/***/ (function(module, exports, __webpack_require__) {
+
+ /**
+ * ECharts global model
+ *
+ * @module {echarts/model/Global}
+ */
+
+
+
+ /**
+ * Caution: If the mechanism should be changed some day, these cases
+ * should be considered:
+ *
+ * (1) In `merge option` mode, if using the same option to call `setOption`
+ * many times, the result should be the same (try our best to ensure that).
+ * (2) In `merge option` mode, if a component has no id/name specified, it
+ * will be merged by index, and the result sequence of the components is
+ * consistent to the original sequence.
+ * (3) `reset` feature (in toolbox). Find detailed info in comments about
+ * `mergeOption` in module:echarts/model/OptionManager.
+ */
+
+ var zrUtil = __webpack_require__(4);
+ var modelUtil = __webpack_require__(5);
+ var Model = __webpack_require__(14);
+ var each = zrUtil.each;
+ var filter = zrUtil.filter;
+ var map = zrUtil.map;
+ var isArray = zrUtil.isArray;
+ var indexOf = zrUtil.indexOf;
+ var isObject = zrUtil.isObject;
+
+ var ComponentModel = __webpack_require__(72);
+
+ var globalDefault = __webpack_require__(76);
+
+ var OPTION_INNER_KEY = '\0_ec_inner';
+
+ /**
+ * @alias module:echarts/model/Global
+ *
+ * @param {Object} option
+ * @param {module:echarts/model/Model} parentModel
+ * @param {Object} theme
+ */
+ var GlobalModel = Model.extend({
+
+ constructor: GlobalModel,
+
+ init: function (option, parentModel, theme, optionManager) {
+ theme = theme || {};
+
+ this.option = null; // Mark as not initialized.
+
+ /**
+ * @type {module:echarts/model/Model}
+ * @private
+ */
+ this._theme = new Model(theme);
+
+ /**
+ * @type {module:echarts/model/OptionManager}
+ */
+ this._optionManager = optionManager;
+ },
+
+ setOption: function (option, optionPreprocessorFuncs) {
+ zrUtil.assert(
+ !(OPTION_INNER_KEY in option),
+ 'please use chart.getOption()'
+ );
+
+ this._optionManager.setOption(option, optionPreprocessorFuncs);
+
+ this.resetOption(null);
+ },
+
+ /**
+ * @param {string} type null/undefined: reset all.
+ * 'recreate': force recreate all.
+ * 'timeline': only reset timeline option
+ * 'media': only reset media query option
+ * @return {boolean} Whether option changed.
+ */
+ resetOption: function (type) {
+ var optionChanged = false;
+ var optionManager = this._optionManager;
+
+ if (!type || type === 'recreate') {
+ var baseOption = optionManager.mountOption(type === 'recreate');
+
+ if (!this.option || type === 'recreate') {
+ initBase.call(this, baseOption);
+ }
+ else {
+ this.restoreData();
+ this.mergeOption(baseOption);
+ }
+ optionChanged = true;
+ }
+
+ if (type === 'timeline' || type === 'media') {
+ this.restoreData();
+ }
+
+ if (!type || type === 'recreate' || type === 'timeline') {
+ var timelineOption = optionManager.getTimelineOption(this);
+ timelineOption && (this.mergeOption(timelineOption), optionChanged = true);
+ }
+
+ if (!type || type === 'recreate' || type === 'media') {
+ var mediaOptions = optionManager.getMediaOption(this, this._api);
+ if (mediaOptions.length) {
+ each(mediaOptions, function (mediaOption) {
+ this.mergeOption(mediaOption, optionChanged = true);
+ }, this);
+ }
+ }
+
+ return optionChanged;
+ },
+
+ /**
+ * @protected
+ */
+ mergeOption: function (newOption) {
+ var option = this.option;
+ var componentsMap = this._componentsMap;
+ var newCptTypes = [];
+
+ // 如果不存在对应的 component model 则直接 merge
+ each(newOption, function (componentOption, mainType) {
+ if (componentOption == null) {
+ return;
+ }
+
+ if (!ComponentModel.hasClass(mainType)) {
+ option[mainType] = option[mainType] == null
+ ? zrUtil.clone(componentOption)
+ : zrUtil.merge(option[mainType], componentOption, true);
+ }
+ else {
+ newCptTypes.push(mainType);
+ }
+ });
+
+ // FIXME OPTION 同步是否要改回原来的
+ ComponentModel.topologicalTravel(
+ newCptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this
+ );
+
+ this._seriesIndices = this._seriesIndices || [];
+
+ function visitComponent(mainType, dependencies) {
+ var newCptOptionList = modelUtil.normalizeToArray(newOption[mainType]);
+
+ var mapResult = modelUtil.mappingToExists(
+ componentsMap.get(mainType), newCptOptionList
+ );
+
+ modelUtil.makeIdAndName(mapResult);
+
+ // Set mainType and complete subType.
+ each(mapResult, function (item, index) {
+ var opt = item.option;
+ if (isObject(opt)) {
+ item.keyInfo.mainType = mainType;
+ item.keyInfo.subType = determineSubType(mainType, opt, item.exist);
+ }
+ });
+
+ var dependentModels = getComponentsByTypes(
+ componentsMap, dependencies
+ );
+
+ option[mainType] = [];
+ componentsMap.set(mainType, []);
+
+ each(mapResult, function (resultItem, index) {
+ var componentModel = resultItem.exist;
+ var newCptOption = resultItem.option;
+
+ zrUtil.assert(
+ isObject(newCptOption) || componentModel,
+ 'Empty component definition'
+ );
+
+ // Consider where is no new option and should be merged using {},
+ // see removeEdgeAndAdd in topologicalTravel and
+ // ComponentModel.getAllClassMainTypes.
+ if (!newCptOption) {
+ componentModel.mergeOption({}, this);
+ componentModel.optionUpdated({}, false);
+ }
+ else {
+ var ComponentModelClass = ComponentModel.getClass(
+ mainType, resultItem.keyInfo.subType, true
+ );
+
+ if (componentModel && componentModel instanceof ComponentModelClass) {
+ componentModel.name = resultItem.keyInfo.name;
+ componentModel.mergeOption(newCptOption, this);
+ componentModel.optionUpdated(newCptOption, false);
+ }
+ else {
+ // PENDING Global as parent ?
+ var extraOpt = zrUtil.extend(
+ {
+ dependentModels: dependentModels,
+ componentIndex: index
+ },
+ resultItem.keyInfo
+ );
+ componentModel = new ComponentModelClass(
+ newCptOption, this, this, extraOpt
+ );
+ zrUtil.extend(componentModel, extraOpt);
+ componentModel.init(newCptOption, this, this, extraOpt);
+ // Call optionUpdated after init.
+ // newCptOption has been used as componentModel.option
+ // and may be merged with theme and default, so pass null
+ // to avoid confusion.
+ componentModel.optionUpdated(null, true);
+ }
+ }
+
+ componentsMap.get(mainType)[index] = componentModel;
+ option[mainType][index] = componentModel.option;
+ }, this);
+
+ // Backup series for filtering.
+ if (mainType === 'series') {
+ this._seriesIndices = createSeriesIndices(componentsMap.get('series'));
+ }
+ }
+ },
+
+ /**
+ * Get option for output (cloned option and inner info removed)
+ * @public
+ * @return {Object}
+ */
+ getOption: function () {
+ var option = zrUtil.clone(this.option);
+
+ each(option, function (opts, mainType) {
+ if (ComponentModel.hasClass(mainType)) {
+ var opts = modelUtil.normalizeToArray(opts);
+ for (var i = opts.length - 1; i >= 0; i--) {
+ // Remove options with inner id.
+ if (modelUtil.isIdInner(opts[i])) {
+ opts.splice(i, 1);
+ }
+ }
+ option[mainType] = opts;
+ }
+ });
+
+ delete option[OPTION_INNER_KEY];
+
+ return option;
+ },
+
+ /**
+ * @return {module:echarts/model/Model}
+ */
+ getTheme: function () {
+ return this._theme;
+ },
+
+ /**
+ * @param {string} mainType
+ * @param {number} [idx=0]
+ * @return {module:echarts/model/Component}
+ */
+ getComponent: function (mainType, idx) {
+ var list = this._componentsMap.get(mainType);
+ if (list) {
+ return list[idx || 0];
+ }
+ },
+
+ /**
+ * If none of index and id and name used, return all components with mainType.
+ * @param {Object} condition
+ * @param {string} condition.mainType
+ * @param {string} [condition.subType] If ignore, only query by mainType
+ * @param {number|Array.} [condition.index] Either input index or id or name.
+ * @param {string|Array.} [condition.id] Either input index or id or name.
+ * @param {string|Array.} [condition.name] Either input index or id or name.
+ * @return {Array.}
+ */
+ queryComponents: function (condition) {
+ var mainType = condition.mainType;
+ if (!mainType) {
+ return [];
+ }
+
+ var index = condition.index;
+ var id = condition.id;
+ var name = condition.name;
+
+ var cpts = this._componentsMap.get(mainType);
+
+ if (!cpts || !cpts.length) {
+ return [];
+ }
+
+ var result;
+
+ if (index != null) {
+ if (!isArray(index)) {
+ index = [index];
+ }
+ result = filter(map(index, function (idx) {
+ return cpts[idx];
+ }), function (val) {
+ return !!val;
+ });
+ }
+ else if (id != null) {
+ var isIdArray = isArray(id);
+ result = filter(cpts, function (cpt) {
+ return (isIdArray && indexOf(id, cpt.id) >= 0)
+ || (!isIdArray && cpt.id === id);
+ });
+ }
+ else if (name != null) {
+ var isNameArray = isArray(name);
+ result = filter(cpts, function (cpt) {
+ return (isNameArray && indexOf(name, cpt.name) >= 0)
+ || (!isNameArray && cpt.name === name);
+ });
+ }
+ else {
+ // Return all components with mainType
+ result = cpts.slice();
+ }
+
+ return filterBySubType(result, condition);
+ },
+
+ /**
+ * The interface is different from queryComponents,
+ * which is convenient for inner usage.
+ *
+ * @usage
+ * var result = findComponents(
+ * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}
+ * );
+ * var result = findComponents(
+ * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}
+ * );
+ * var result = findComponents(
+ * {mainType: 'series'},
+ * function (model, index) {...}
+ * );
+ * // result like [component0, componnet1, ...]
+ *
+ * @param {Object} condition
+ * @param {string} condition.mainType Mandatory.
+ * @param {string} [condition.subType] Optional.
+ * @param {Object} [condition.query] like {xxxIndex, xxxId, xxxName},
+ * where xxx is mainType.
+ * If query attribute is null/undefined or has no index/id/name,
+ * do not filtering by query conditions, which is convenient for
+ * no-payload situations or when target of action is global.
+ * @param {Function} [condition.filter] parameter: component, return boolean.
+ * @return {Array.}
+ */
+ findComponents: function (condition) {
+ var query = condition.query;
+ var mainType = condition.mainType;
+
+ var queryCond = getQueryCond(query);
+ var result = queryCond
+ ? this.queryComponents(queryCond)
+ : this._componentsMap.get(mainType);
+
+ return doFilter(filterBySubType(result, condition));
+
+ function getQueryCond(q) {
+ var indexAttr = mainType + 'Index';
+ var idAttr = mainType + 'Id';
+ var nameAttr = mainType + 'Name';
+ return q && (
+ q[indexAttr] != null
+ || q[idAttr] != null
+ || q[nameAttr] != null
+ )
+ ? {
+ mainType: mainType,
+ // subType will be filtered finally.
+ index: q[indexAttr],
+ id: q[idAttr],
+ name: q[nameAttr]
+ }
+ : null;
+ }
+
+ function doFilter(res) {
+ return condition.filter
+ ? filter(res, condition.filter)
+ : res;
+ }
+ },
+
+ /**
+ * @usage
+ * eachComponent('legend', function (legendModel, index) {
+ * ...
+ * });
+ * eachComponent(function (componentType, model, index) {
+ * // componentType does not include subType
+ * // (componentType is 'xxx' but not 'xxx.aa')
+ * });
+ * eachComponent(
+ * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}},
+ * function (model, index) {...}
+ * );
+ * eachComponent(
+ * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}},
+ * function (model, index) {...}
+ * );
+ *
+ * @param {string|Object=} mainType When mainType is object, the definition
+ * is the same as the method 'findComponents'.
+ * @param {Function} cb
+ * @param {*} context
+ */
+ eachComponent: function (mainType, cb, context) {
+ var componentsMap = this._componentsMap;
+
+ if (typeof mainType === 'function') {
+ context = cb;
+ cb = mainType;
+ componentsMap.each(function (components, componentType) {
+ each(components, function (component, index) {
+ cb.call(context, componentType, component, index);
+ });
+ });
+ }
+ else if (zrUtil.isString(mainType)) {
+ each(componentsMap.get(mainType), cb, context);
+ }
+ else if (isObject(mainType)) {
+ var queryResult = this.findComponents(mainType);
+ each(queryResult, cb, context);
+ }
+ },
+
+ /**
+ * @param {string} name
+ * @return {Array.}
+ */
+ getSeriesByName: function (name) {
+ var series = this._componentsMap.get('series');
+ return filter(series, function (oneSeries) {
+ return oneSeries.name === name;
+ });
+ },
+
+ /**
+ * @param {number} seriesIndex
+ * @return {module:echarts/model/Series}
+ */
+ getSeriesByIndex: function (seriesIndex) {
+ return this._componentsMap.get('series')[seriesIndex];
+ },
+
+ /**
+ * @param {string} subType
+ * @return {Array.}
+ */
+ getSeriesByType: function (subType) {
+ var series = this._componentsMap.get('series');
+ return filter(series, function (oneSeries) {
+ return oneSeries.subType === subType;
+ });
+ },
+
+ /**
+ * @return {Array.}
+ */
+ getSeries: function () {
+ return this._componentsMap.get('series').slice();
+ },
+
+ /**
+ * After filtering, series may be different
+ * frome raw series.
+ *
+ * @param {Function} cb
+ * @param {*} context
+ */
+ eachSeries: function (cb, context) {
+ assertSeriesInitialized(this);
+ each(this._seriesIndices, function (rawSeriesIndex) {
+ var series = this._componentsMap.get('series')[rawSeriesIndex];
+ cb.call(context, series, rawSeriesIndex);
+ }, this);
+ },
+
+ /**
+ * Iterate raw series before filtered.
+ *
+ * @param {Function} cb
+ * @param {*} context
+ */
+ eachRawSeries: function (cb, context) {
+ each(this._componentsMap.get('series'), cb, context);
+ },
+
+ /**
+ * After filtering, series may be different.
+ * frome raw series.
+ *
+ * @parma {string} subType
+ * @param {Function} cb
+ * @param {*} context
+ */
+ eachSeriesByType: function (subType, cb, context) {
+ assertSeriesInitialized(this);
+ each(this._seriesIndices, function (rawSeriesIndex) {
+ var series = this._componentsMap.get('series')[rawSeriesIndex];
+ if (series.subType === subType) {
+ cb.call(context, series, rawSeriesIndex);
+ }
+ }, this);
+ },
+
+ /**
+ * Iterate raw series before filtered of given type.
+ *
+ * @parma {string} subType
+ * @param {Function} cb
+ * @param {*} context
+ */
+ eachRawSeriesByType: function (subType, cb, context) {
+ return each(this.getSeriesByType(subType), cb, context);
+ },
+
+ /**
+ * @param {module:echarts/model/Series} seriesModel
+ */
+ isSeriesFiltered: function (seriesModel) {
+ assertSeriesInitialized(this);
+ return zrUtil.indexOf(this._seriesIndices, seriesModel.componentIndex) < 0;
+ },
+
+ /**
+ * @return {Array.}
+ */
+ getCurrentSeriesIndices: function () {
+ return (this._seriesIndices || []).slice();
+ },
+
+ /**
+ * @param {Function} cb
+ * @param {*} context
+ */
+ filterSeries: function (cb, context) {
+ assertSeriesInitialized(this);
+ var filteredSeries = filter(
+ this._componentsMap.get('series'), cb, context
+ );
+ this._seriesIndices = createSeriesIndices(filteredSeries);
+ },
+
+ restoreData: function () {
+ var componentsMap = this._componentsMap;
+
+ this._seriesIndices = createSeriesIndices(componentsMap.get('series'));
+
+ var componentTypes = [];
+ componentsMap.each(function (components, componentType) {
+ componentTypes.push(componentType);
+ });
+
+ ComponentModel.topologicalTravel(
+ componentTypes,
+ ComponentModel.getAllClassMainTypes(),
+ function (componentType, dependencies) {
+ each(componentsMap.get(componentType), function (component) {
+ component.restoreData();
+ });
+ }
+ );
+ }
+
+ });
+
+ /**
+ * @inner
+ */
+ function mergeTheme(option, theme) {
+ zrUtil.each(theme, function (themeItem, name) {
+ // 如果有 component model 则把具体的 merge 逻辑交给该 model 处理
+ if (!ComponentModel.hasClass(name)) {
+ if (typeof themeItem === 'object') {
+ option[name] = !option[name]
+ ? zrUtil.clone(themeItem)
+ : zrUtil.merge(option[name], themeItem, false);
+ }
+ else {
+ if (option[name] == null) {
+ option[name] = themeItem;
+ }
+ }
+ }
+ });
+ }
+
+ function initBase(baseOption) {
+ baseOption = baseOption;
+
+ // Using OPTION_INNER_KEY to mark that this option can not be used outside,
+ // i.e. `chart.setOption(chart.getModel().option);` is forbiden.
+ this.option = {};
+ this.option[OPTION_INNER_KEY] = 1;
+
+ /**
+ * Init with series: [], in case of calling findSeries method
+ * before series initialized.
+ * @type {Object.>}
+ * @private
+ */
+ this._componentsMap = zrUtil.createHashMap({series: []});
+
+ /**
+ * Mapping between filtered series list and raw series list.
+ * key: filtered series indices, value: raw series indices.
+ * @type {Array.}
+ * @private
+ */
+ this._seriesIndices = null;
+
+ mergeTheme(baseOption, this._theme.option);
+
+ // TODO Needs clone when merging to the unexisted property
+ zrUtil.merge(baseOption, globalDefault, false);
+
+ this.mergeOption(baseOption);
+ }
+
+ /**
+ * @inner
+ * @param {Array.|string} types model types
+ * @return {Object} key: {string} type, value: {Array.