You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2018/04/24 14:46:50 UTC
[incubator-echarts] branch master updated: release 4.1.0
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
The following commit(s) were added to refs/heads/master by this push:
new 097e093 release 4.1.0
097e093 is described below
commit 097e093a2e488adb0feb286283cf8e6e3ee31847
Author: sushuang <su...@gmail.com>
AuthorDate: Tue Apr 24 22:46:24 2018 +0800
release 4.1.0
---
build/config.js | 7 +-
build/pre-publish.js | 10 +-
index.simple.js => build/preamble.js | 21 +-
dist/echarts-en.common.js | 6544 ++++++++++++---
dist/echarts-en.common.min.js | 22 +-
dist/echarts-en.js | 12559 ++++++++++++++++++++++++-----
dist/echarts-en.js.map | 2 +-
dist/echarts-en.min.js | 22 +-
dist/echarts-en.simple.js | 4576 +++++++++--
dist/echarts-en.simple.min.js | 22 +-
dist/echarts.common.js | 6544 ++++++++++++---
dist/echarts.common.min.js | 22 +-
dist/echarts.js | 12559 ++++++++++++++++++++++++-----
dist/echarts.js.map | 2 +-
dist/echarts.min.js | 22 +-
dist/echarts.simple.js | 4576 +++++++++--
dist/echarts.simple.min.js | 22 +-
dist/extension/bmap.js | 76 +
dist/extension/bmap.js.map | 2 +-
dist/extension/bmap.min.js | 20 +
dist/extension/dataTool.js | 95 +
dist/extension/dataTool.js.map | 2 +-
dist/extension/dataTool.min.js | 20 +
extension/bmap/BMapCoordSys.js | 12 +-
extension/bmap/BMapModel.js | 5 +-
extension/bmap/BMapView.js | 5 +-
extension/bmap/bmap.js | 16 +-
extension/dataTool/gexf.js | 5 +-
extension/dataTool/index.js | 20 +-
extension/dataTool/prepareBoxplotData.js | 8 +-
index.common.js | 2 +-
index.js | 2 +-
index.simple.js | 2 +-
package.json | 6 +-
src/echarts.js | 4 +-
35 files changed, 40288 insertions(+), 7546 deletions(-)
diff --git a/build/config.js b/build/config.js
index 2b32d83..b7f5127 100644
--- a/build/config.js
+++ b/build/config.js
@@ -22,6 +22,7 @@ const uglifyPlugin = require('rollup-plugin-uglify');
const ecRemoveDevPlugin = require('./rollup-plugin-ec-remove-dev');
const ecLangPlugin = require('./rollup-plugin-ec-lang');
const {resolve} = require('path');
+const preamble = require('./preamble');
function getPathBasedOnECharts(path) {
return resolve(__dirname, '../', path);
@@ -58,6 +59,9 @@ function getPlugins({min, lang, sourcemap, removeDev, addBundleVersion}) {
// __DEV__: false
// },
'dead_code': true
+ },
+ output: {
+ preamble: preamble
}
}));
@@ -77,9 +81,10 @@ function getPlugins({min, lang, sourcemap, removeDev, addBundleVersion}) {
* @param {boolean} [opt.addBundleVersion=false] Only for debug in watch, prompt that the two build is different.
*/
exports.createECharts = function (opt = {}) {
+ let min = opt.min;
let srcType = opt.type ? '.' + opt.type : '.all';
let postfixType = opt.type ? '.' + opt.type : '';
- let postfixMin = opt.min ? '.min' : '';
+ let postfixMin = min ? '.min' : '';
let postfixLang = opt.lang ? '-' + opt.lang.toLowerCase() : '';
let input = opt.input;
let output = opt.output;
diff --git a/build/pre-publish.js b/build/pre-publish.js
index 7b7a7ba..d0d5291 100644
--- a/build/pre-publish.js
+++ b/build/pre-publish.js
@@ -33,6 +33,7 @@ const srcDir = path.resolve(__dirname, '../src');
const extensionSrcDir = path.resolve(__dirname, '../extension-src');
const extensionDir = path.resolve(__dirname, '../extension');
const libDir = path.resolve(__dirname, '../lib');
+const preamble = require('./preamble');
module.exports = function () {
@@ -58,15 +59,18 @@ module.exports = function () {
prePulishSrc({
inputPath: path.resolve(ecDir, 'echarts.all.js'),
- outputPath: path.resolve(ecDir, 'index.js')
+ outputPath: path.resolve(ecDir, 'index.js'),
+ preamble: preamble
});
prePulishSrc({
inputPath: path.resolve(ecDir, 'echarts.common.js'),
- outputPath: path.resolve(ecDir, 'index.common.js')
+ outputPath: path.resolve(ecDir, 'index.common.js'),
+ preamble: preamble
});
prePulishSrc({
inputPath: path.resolve(ecDir, 'echarts.simple.js'),
- outputPath: path.resolve(ecDir, 'index.simple.js')
+ outputPath: path.resolve(ecDir, 'index.simple.js'),
+ preamble: preamble
});
function transform({code, inputPath, outputPath}) {
diff --git a/index.simple.js b/build/preamble.js
similarity index 65%
copy from index.simple.js
copy to build/preamble.js
index 186fffb..0deb2ec 100644
--- a/index.simple.js
+++ b/build/preamble.js
@@ -1,3 +1,4 @@
+module.exports = `
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -16,22 +17,4 @@
* specific language governing permissions and limitations
* under the License.
*/
-
-var _echarts = require("./lib/echarts");
-
-(function () {
- for (var key in _echarts) {
- if (_echarts == null || !_echarts.hasOwnProperty(key) || key === 'default' || key === '__esModule') return;
- exports[key] = _echarts[key];
- }
-})();
-
-require("./lib/component/dataset");
-
-require("./lib/chart/line");
-
-require("./lib/chart/bar");
-
-require("./lib/chart/pie");
-
-require("./lib/component/gridSimple");
\ No newline at end of file
+`;
diff --git a/dist/echarts-en.common.js b/dist/echarts-en.common.js
index 0e09912..c33bd9d 100644
--- a/dist/echarts-en.common.js
+++ b/dist/echarts-en.common.js
@@ -4,6 +4,25 @@
(factory((global.echarts = {})));
}(this, (function (exports) { 'use strict';
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// (1) The code `if (__DEV__) ...` can be removed by build tool.
// (2) If intend to use `__DEV__`, this module should be imported. Use a global
// variable `__DEV__` may cause that miss the declaration (see #6535), or the
@@ -49,7 +68,7 @@ var guid = function () {
var env = {};
-if (typeof wx !== 'undefined') {
+if (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {
// In Weixin Application
env = {
browser: {},
@@ -8788,6 +8807,7 @@ var Painter = function (root, storage, opts) {
// FIXME Use canvas width and height
// mainLayer.resize(width, height);
layers[CANVAS_ZLEVEL] = mainLayer;
+ mainLayer.zlevel = CANVAS_ZLEVEL;
// Not use common zlevel.
zlevelList.push(CANVAS_ZLEVEL);
@@ -10555,7 +10575,7 @@ var instances$1 = {}; // ZRender实例map索引
/**
* @type {string}
*/
-var version$1 = '4.0.3';
+var version$1 = '4.0.4';
/**
* Initializing a zrender instance
@@ -10763,7 +10783,6 @@ ZRender.prototype = {
*/
this._needsRefresh = false;
// var end = new Date();
-
// var log = document.getElementById('log');
// if (log) {
// log.innerHTML = log.innerHTML + '<br>' + (end - start);
@@ -10988,6 +11007,25 @@ var zrender = (Object.freeze || Object)({
registerPainter: registerPainter
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var each$2 = each$1;
var isObject$2 = isObject$1;
var isArray$1 = isArray;
@@ -11028,6 +11066,7 @@ function normalizeToArray(value) {
* @param {Array.<string>} subOpts
*/
function defaultEmphasis(opt, key, subOpts) {
+ // Caution: performance sensitive.
if (opt) {
opt[key] = opt[key] || {};
opt.emphasis = opt.emphasis || {};
@@ -11449,6 +11488,25 @@ function getAttribute(dom, key) {
: dom[key];
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var TYPE_DELIMITER = '.';
var IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';
@@ -11684,6 +11742,25 @@ function enableClassManagement(entity, options) {
* @param {string|Array.<string>} properties
*/
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// TODO Parse shadow style
// TODO Only shallow path support
var makeStyleMapper = function (properties) {
@@ -11711,6 +11788,25 @@ var makeStyleMapper = function (properties) {
};
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var getLineStyle = makeStyleMapper(
[
['lineWidth', 'width'],
@@ -11743,6 +11839,25 @@ var lineStyleMixin = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var getAreaStyle = makeStyleMapper(
[
['fill', 'color'],
@@ -13464,7 +13579,8 @@ function windingLine(x0, y0, x1, y1, x, y) {
var x_ = t * (x1 - x0) + x0;
- return x_ > x ? dir : 0;
+ // If (x, y) on the line, considered as "contain".
+ return x_ === x ? Infinity : x_ > x ? dir : 0;
}
var CMD$1 = PathProxy.CMD;
@@ -15717,7 +15833,7 @@ IncrementalDisplayble.prototype.update = function () {
IncrementalDisplayble.prototype.brush = function (ctx, prevEl) {
// Render persistant displayables.
for (var i = this._cursor; i < this._displayables.length; i++) {
- var displayable = this._temporaryDisplayables[i];
+ var displayable = this._displayables[i];
displayable.beforeBrush && displayable.beforeBrush(ctx);
displayable.brush(ctx, i === this._cursor ? null : this._displayables[i - 1]);
displayable.afterBrush && displayable.afterBrush(ctx);
@@ -15770,6 +15886,25 @@ IncrementalDisplayble.prototype.contain = function (x, y) {
inherits(IncrementalDisplayble, Displayable);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var round = Math.round;
var mathMax$1 = Math.max;
var mathMin$1 = Math.min;
@@ -16850,6 +16985,25 @@ var graphic = (Object.freeze || Object)({
BoundingRect: BoundingRect
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var PATH_COLOR = ['textStyle', 'color'];
var textStyleMixin = {
@@ -16892,6 +17046,25 @@ var textStyleMixin = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var getItemStyle = makeStyleMapper(
[
['fill', 'color'],
@@ -16922,6 +17095,25 @@ var itemStyleMixin = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @module echarts/model/Model
*/
@@ -17117,6 +17309,25 @@ mixin$1(Model, areaStyleMixin);
mixin$1(Model, textStyleMixin);
mixin$1(Model, itemStyleMixin);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var base = 0;
/**
@@ -17280,6 +17491,25 @@ function enableTopologicalTravel(entity, dependencyGetter) {
}
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var RADIAN_EPSILON = 1e-4;
function _trim(str) {
@@ -17766,6 +17996,25 @@ var number = (Object.freeze || Object)({
isNumeric: isNumeric
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* 每三位默认加,格式化
* @param {string|number} x
@@ -17799,13 +18048,22 @@ function toCamelCase(str, upperCaseFirst) {
var normalizeCssArray$1 = normalizeCssArray;
+
+var replaceReg = /([&<>"'])/g;
+var replaceMap = {
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ '\'': '''
+};
+
function encodeHTML(source) {
- return String(source)
- .replace(/&/g, '&')
- .replace(/</g, '<')
- .replace(/>/g, '>')
- .replace(/"/g, '"')
- .replace(/'/g, ''');
+ return source == null
+ ? ''
+ : (source + '').replace(replaceReg, function (str, c) {
+ return replaceMap[c];
+ });
}
var TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];
@@ -17972,6 +18230,25 @@ var format = (Object.freeze || Object)({
getTextRect: getTextRect
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// Layout helpers for each component positioning
var each$3 = each$1;
@@ -18431,6 +18708,26 @@ function copyLayoutParams(target, source) {
return target;
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+
var boxLayoutMixin = {
getBoxLayoutParams: function () {
return {
@@ -18444,6 +18741,25 @@ var boxLayoutMixin = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Component model
*
@@ -18644,6 +18960,26 @@ function getDependencies(componentType) {
mixin(ComponentModel, boxLayoutMixin);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+
var platform = '';
// Navigator not exists in node
if (typeof navigator !== 'undefined') {
@@ -18704,6 +19040,25 @@ var globalDefault = {
useUTC: false
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var inner$2 = makeInner();
function getNearestColorPalette(colors, requestColorNum) {
@@ -18761,6 +19116,25 @@ var colorPaletteMixin = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Helper for model references.
* There are many manners to refer axis/coordSys.
@@ -18914,6 +19288,25 @@ function isCategory(axisModel) {
return axisModel.get('type') === 'category';
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// Avoid typo.
var SOURCE_FORMAT_ORIGINAL = 'original';
var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';
@@ -18926,6 +19319,25 @@ var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';
var SERIES_LAYOUT_BY_COLUMN = 'column';
var SERIES_LAYOUT_BY_ROW = 'row';
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* [sourceFormat]
*
@@ -19045,6 +19457,25 @@ Source.seriesDataToSource = function (data) {
enableClassCheck(Source);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var inner$3 = makeInner();
/**
@@ -19582,6 +20013,25 @@ function doGuessOrdinal(
return false;
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* ECharts global model
*
@@ -19613,8 +20063,6 @@ var OPTION_INNER_KEY = '\0_ec_inner';
*/
var GlobalModel = Model.extend({
- constructor: GlobalModel,
-
init: function (option, parentModel, theme, optionManager) {
theme = theme || {};
@@ -20322,6 +20770,25 @@ function assertSeriesInitialized(ecModel) {
mixin(GlobalModel, colorPaletteMixin);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var echartsAPIList = [
'getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isDisposed',
'on', 'off', 'getDataURL', 'getConnectedDataURL', 'getModel', 'getOption',
@@ -20335,6 +20802,25 @@ function ExtensionAPI(chartInstance) {
}, this);
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var coordinateSystemCreators = {};
function CoordinateSystemManager() {
@@ -20375,6 +20861,25 @@ CoordinateSystemManager.get = function (type) {
return coordinateSystemCreators[type];
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* ECharts option manager
*
@@ -20814,6 +21319,25 @@ function mergeOption(oldOption, newOption) {
});
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var each$5 = each$1;
var isObject$3 = isObject$1;
@@ -21006,6 +21530,9 @@ function processSeries(seriesOpt) {
removeEC3NormalStatus(opt);
});
}
+ else if (seriesOpt.type === 'tree') {
+ removeEC3NormalStatus(seriesOpt.leaves);
+ }
// sunburst starts from ec4, so it does not need to compat levels.
}
@@ -21090,6 +21617,25 @@ var compatStyle = function (option, isTheme) {
compatTextStyle(toObj(option.tooltip).axisPointer, 'label');
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// Compatitable with 2.0
function get(opt, path) {
@@ -21181,6 +21727,25 @@ var backwardCompat = function (option, isTheme) {
});
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// (1) [Caution]: the logic is correct based on the premises:
// data processing stage is blocked in stream.
// See <module:echarts/stream/Scheduler#performDataProcessorTasks>
@@ -21290,6 +21855,25 @@ function calculateStack(stackInfoList) {
});
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// TODO
// ??? refactor? check the outer usage of data provider.
// merge with defaultDimValueGetter?
@@ -21423,14 +22007,14 @@ var providerMethods = {
count: function () {
return this._data ? (this._data.length / this._dimSize) : 0;
},
- getItem: function (idx) {
+ getItem: function (idx, out) {
idx = idx - this._offset;
- var item = [];
+ out = out || [];
var offset = this._dimSize * idx;
for (var i = 0; i < this._dimSize; i++) {
- item[i] = this._data[offset + i];
+ out[i] = this._data[offset + i];
}
- return item;
+ return out;
},
appendData: function (newData) {
if (__DEV__) {
@@ -21642,6 +22226,25 @@ function retrieveRawAttr(data, dataIndex, attr) {
}
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var DIMENSION_LABEL_REG = /\{@(.+?)\}/g;
// PENDING A little ugly
@@ -21656,7 +22259,7 @@ var dataFormatMixin = {
var data = this.getData(dataType);
var rawValue = this.getRawValue(dataIndex, dataType);
var rawDataIndex = data.getRawIndex(dataIndex);
- var name = data.getName(dataIndex, true);
+ var name = data.getName(dataIndex);
var itemOpt = data.getRawDataItem(dataIndex);
var color = data.getItemVisual(dataIndex, 'color');
@@ -21746,6 +22349,25 @@ var dataFormatMixin = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @param {Object} define
* @return See the return of `createTask`.
@@ -21783,6 +22405,8 @@ var taskProto = Task.prototype;
* @param {Object} performArgs
* @param {number} [performArgs.step] Specified step.
* @param {number} [performArgs.skip] Skip customer perform call.
+ * @param {number} [performArgs.modBy] Sampling window size.
+ * @param {number} [performArgs.modDataCount] Sampling count.
*/
taskProto.perform = function (performArgs) {
var upTask = this._upstream;
@@ -21805,12 +22429,30 @@ taskProto.perform = function (performArgs) {
planResult = this._plan(this.context);
}
+ // Support sharding by mod, which changes the render sequence and makes the rendered graphic
+ // elements uniformed distributed when progress, especially when moving or zooming.
+ var lastModBy = normalizeModBy(this._modBy);
+ var lastModDataCount = this._modDataCount || 0;
+ var modBy = normalizeModBy(performArgs && performArgs.modBy);
+ var modDataCount = performArgs && performArgs.modDataCount || 0;
+ if (lastModBy !== modBy || lastModDataCount !== modDataCount) {
+ planResult = 'reset';
+ }
+
+ function normalizeModBy(val) {
+ !(val >= 1) && (val = 1); // jshint ignore:line
+ return val;
+ }
+
var forceFirstProgress;
if (this._dirty || planResult === 'reset') {
this._dirty = false;
forceFirstProgress = reset(this, skip);
}
+ this._modBy = modBy;
+ this._modDataCount = modDataCount;
+
var step = performArgs && performArgs.step;
if (upTask) {
@@ -21818,8 +22460,6 @@ taskProto.perform = function (performArgs) {
if (__DEV__) {
assert$1(upTask._outputDueEnd != null);
}
- // ??? FIXME move to schedueler?
- // this._dueEnd = Math.max(upTask._outputDueEnd, this._dueEnd);
this._dueEnd = upTask._outputDueEnd;
}
// DataTask or overallTask
@@ -21839,9 +22479,17 @@ taskProto.perform = function (performArgs) {
this._dueEnd
);
- !skip && (forceFirstProgress || start < end) && (
- this._progress({start: start, end: end}, this.context)
- );
+ if (!skip && (forceFirstProgress || start < end)) {
+ var progress = this._progress;
+ if (isArray(progress)) {
+ for (var i = 0; i < progress.length; i++) {
+ doProgress(this, progress[i], start, end, modBy, modDataCount);
+ }
+ }
+ else {
+ doProgress(this, progress, start, end, modBy, modDataCount);
+ }
+ }
this._dueIndex = end;
// If no `outputDueEnd`, assume that output data and
@@ -21867,14 +22515,60 @@ taskProto.perform = function (performArgs) {
return this.unfinished();
};
+var iterator = (function () {
+
+ var end;
+ var current;
+ var modBy;
+ var modDataCount;
+ var winCount;
+
+ var it = {
+ reset: function (s, e, sStep, sCount) {
+ current = s;
+ end = e;
+
+ modBy = sStep;
+ modDataCount = sCount;
+ winCount = Math.ceil(modDataCount / modBy);
+
+ it.next = (modBy > 1 && modDataCount > 0) ? modNext : sequentialNext;
+ }
+ };
+
+ return it;
+
+ function sequentialNext() {
+ return current < end ? current++ : null;
+ }
+
+ function modNext() {
+ var dataIndex = (current % winCount) * modBy + Math.ceil(current / winCount);
+ var result = current >= end
+ ? null
+ : dataIndex < modDataCount
+ ? dataIndex
+ // If modDataCount is smaller than data.count() (consider `appendData` case),
+ // Use normal linear rendering mode.
+ : current;
+ current++;
+ return result;
+ }
+})();
+
taskProto.dirty = function () {
this._dirty = true;
this._onDirty && this._onDirty(this.context);
};
-/**
- * @param {Object} [params]
- */
+function doProgress(taskIns, progress, start, end, modBy, modDataCount) {
+ iterator.reset(start, end, modBy, modDataCount);
+ taskIns._callingProgress = progress;
+ taskIns._callingProgress({
+ start: start, end: end, count: end - start, next: iterator.next
+ }, taskIns.context);
+}
+
function reset(taskIns, skip) {
taskIns._dueIndex = taskIns._outputDueEnd = taskIns._dueEnd = 0;
taskIns._settedOutputEnd = null;
@@ -21888,9 +22582,14 @@ function reset(taskIns, skip) {
forceFirstProgress = progress.forceFirstProgress;
progress = progress.progress;
}
+ // To simplify no progress checking, array must has item.
+ if (isArray(progress) && !progress.length) {
+ progress = null;
+ }
}
taskIns._progress = progress;
+ taskIns._modBy = taskIns._modDataCount = null;
var downstream = taskIns._downstream;
downstream && downstream.dirty();
@@ -21943,14 +22642,12 @@ taskProto.getDownstream = function () {
};
taskProto.setOutputEnd = function (end) {
- // ??? FIXME: check
// This only happend in dataTask, dataZoom, map, currently.
// where dataZoom do not set end each time, but only set
// when reset. So we should record the setted end, in case
// that the stub of dataZoom perform again and earse the
// setted end by upstream.
this._outputDueEnd = this._settedOutputEnd = end;
- // this._outputDueEnd = end;
};
@@ -21998,6 +22695,25 @@ taskProto.setOutputEnd = function (end) {
// // console.log(this);
// }
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var inner$4 = makeInner();
var SeriesModel = ComponentModel.extend({
@@ -22147,7 +22863,7 @@ var SeriesModel = ComponentModel.extend({
// Default data label emphasis `show`
// FIXME Tree structure data ?
// FIXME Performance ?
- if (data) {
+ if (data && !isTypedArray(data)) {
var props = ['show'];
for (var i = 0; i < data.length; i++) {
if (data[i] && data[i].label) {
@@ -22207,7 +22923,7 @@ var SeriesModel = ComponentModel.extend({
if (task) {
var context = task.context;
// Consider case: filter, data sample.
- if (context.data !== data && task.isOverallFilter) {
+ if (context.data !== data && task.modifyOutputEnd) {
task.setOutputEnd(data.count());
}
context.outputData = data;
@@ -22522,6 +23238,25 @@ function getCurrentTask(seriesModel) {
}
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var Component$1 = function () {
/**
* @type {module:zrender/container/Group}
@@ -22561,6 +23296,25 @@ enableClassExtend(Component$1);
// Enable capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on.
enableClassManagement(Component$1, {registerWhenExtend: true});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @return {string} If large mode changed, return string 'reset';
*/
@@ -22572,15 +23326,34 @@ var createRenderPlanner = function () {
var pipelineContext = seriesModel.pipelineContext;
var originalLarge = fields.large;
- var originalProgressive = fields.canProgressiveRender;
+ var originalProgressive = fields.progressiveRender;
var large = fields.large = pipelineContext.large;
- var progressive = fields.canProgressiveRender = pipelineContext.canProgressiveRender;
+ var progressive = fields.progressiveRender = pipelineContext.progressiveRender;
return !!((originalLarge ^ large) || (originalProgressive ^ progressive)) && 'reset';
};
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var inner$5 = makeInner();
var renderPlanner = createRenderPlanner();
@@ -22764,11 +23537,11 @@ function renderTaskReset(context) {
var api = context.api;
var payload = context.payload;
// ???! remove updateView updateVisual
- var canProgressiveRender = seriesModel.pipelineContext.canProgressiveRender;
+ var progressiveRender = seriesModel.pipelineContext.progressiveRender;
var view = context.view;
var updateMethod = payload && inner$5(payload).updateMethod;
- var methodName = canProgressiveRender
+ var methodName = progressiveRender
? 'incrementalPrepareRender'
: (updateMethod && view[updateMethod])
? updateMethod
@@ -22805,6 +23578,26 @@ var progressMethodMap = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+
var ORIGIN_METHOD = '\0__throttleOriginMethod';
var RATE = '\0__throttleRate';
var THROTTLE_TYPE = '\0__throttleType';
@@ -22848,6 +23641,14 @@ function throttle(fn, delay, debounce) {
clearTimeout(timer);
+ // Here we should make sure that: the `exec` SHOULD NOT be called later
+ // than a new call of `cb`, that is, preserving the command order. Consider
+ // calculating "scale rate" when roaming as an example. When a call of `cb`
+ // happens, either the `exec` is called dierectly, or the call is delayed.
+ // But the delayed call should never be later than next call of `cb`. Under
+ // this assurance, we can simply update view state each time `dispatchAction`
+ // triggered by user roaming, but not need to add extra code to avoid the
+ // state being "rolled-back".
if (thisDebounce) {
timer = setTimeout(exec, thisDelay);
}
@@ -22952,6 +23753,25 @@ function clear(obj, fnAttr) {
}
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var seriesColor = {
createOnAllSeries: true,
performRawSeries: true,
@@ -22991,6 +23811,26 @@ var seriesColor = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+
var lang = {
toolbox: {
brush: {
@@ -23031,6 +23871,25 @@ var lang = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var aria = function (dom, ecModel) {
var ariaModel = ecModel.getModel('aria');
if (!ariaModel.get('show')) {
@@ -23177,6 +24036,25 @@ var aria = function (dom, ecModel) {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var PI$1 = Math.PI;
/**
@@ -23272,6 +24150,25 @@ var loadingDefault = function (api, opts) {
return group;
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @module echarts/stream/Scheduler
*/
@@ -23280,8 +24177,6 @@ var loadingDefault = function (api, opts) {
* @constructor
*/
function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {
- // this._pipelineMap = createHashMap();
-
this.ecInstance = ecInstance;
this.api = api;
this.unfinished;
@@ -23290,8 +24185,9 @@ function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {
// processors might be registered after echarts instance created.
// Register processors incrementally for a echarts instance is
// not supported by this stream architecture.
- this._dataProcessorHandlers = dataProcessorHandlers.slice();
- this._visualHandlers = visualHandlers.slice();
+ var dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();
+ var visualHandlers = this._visualHandlers = visualHandlers.slice();
+ this._allHandlers = dataProcessorHandlers.concat(visualHandlers);
/**
* @private
@@ -23309,6 +24205,44 @@ function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {
var proto = Scheduler.prototype;
+/**
+ * @param {module:echarts/model/Global} ecModel
+ * @param {Object} payload
+ */
+proto.restoreData = function (ecModel, payload) {
+ // TODO: Only restroe needed series and components, but not all components.
+ // Currently `restoreData` of all of the series and component will be called.
+ // But some independent components like `title`, `legend`, `graphic`, `toolbox`,
+ // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`,
+ // and some components like coordinate system, axes, dataZoom, visualMap only
+ // need their target series refresh.
+ // (1) If we are implementing this feature some day, we should consider these cases:
+ // if a data processor depends on a component (e.g., dataZoomProcessor depends
+ // on the settings of `dataZoom`), it should be re-performed if the component
+ // is modified by `setOption`.
+ // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`,
+ // it should be re-performed when the result array of `getTargetSeries` changed.
+ // We use `dependencies` to cover these issues.
+ // (3) How to update target series when coordinate system related components modified.
+
+ // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty,
+ // and this case all of the tasks will be set as dirty.
+
+ ecModel.restoreData(payload);
+
+ // Theoretically an overall task not only depends on each of its target series, but also
+ // depends on all of the series.
+ // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks
+ // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure
+ // that the overall task is set as dirty and to be performed, otherwise it probably cause
+ // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it
+ // probably cause state chaos (consider `dataZoomProcessor`).
+ this._stageTaskMap.each(function (taskRecord) {
+ var overallTask = taskRecord.overallTask;
+ overallTask && overallTask.dirty();
+ });
+};
+
// If seriesModel provided, incremental threshold is check by series data.
proto.getPerformArgs = function (task, isBlock) {
// For overall task
@@ -23320,10 +24254,14 @@ proto.getPerformArgs = function (task, isBlock) {
var pCtx = pipeline.context;
var incremental = !isBlock
&& pipeline.progressiveEnabled
- && (!pCtx || pCtx.canProgressiveRender)
- && task.__idxInPipeline > pipeline.bockIndex;
+ && (!pCtx || pCtx.progressiveRender)
+ && task.__idxInPipeline > pipeline.blockIndex;
+
+ var step = incremental ? pipeline.step : null;
+ var modDataCount = pCtx && pCtx.modDataCount;
+ var modBy = modDataCount != null ? Math.ceil(modDataCount / step): null;
- return {step: incremental ? pipeline.step : null};
+ return {step: step, modBy: modBy, modDataCount: modDataCount};
};
proto.getPipeline = function (pipelineId) {
@@ -23342,19 +24280,24 @@ proto.updateStreamModes = function (seriesModel, view) {
var data = seriesModel.getData();
var dataLen = data.count();
- // `canProgressiveRender` means that can render progressively in each
+ // `progressiveRender` means that can render progressively in each
// animation frame. Note that some types of series do not provide
// `view.incrementalPrepareRender` but support `chart.appendData`. We
// use the term `incremental` but not `progressive` to describe the
// case that `chart.appendData`.
- var canProgressiveRender = pipeline.progressiveEnabled
+ var progressiveRender = pipeline.progressiveEnabled
&& view.incrementalPrepareRender
&& dataLen >= pipeline.threshold;
var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold');
+ // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint.
+ // see `test/candlestick-large3.html`
+ var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;
+
seriesModel.pipelineContext = pipeline.context = {
- canProgressiveRender: canProgressiveRender,
+ progressiveRender: progressiveRender,
+ modDataCount: modDataCount,
large: large
};
};
@@ -23362,6 +24305,7 @@ proto.updateStreamModes = function (seriesModel, view) {
proto.restorePipelines = function (ecModel) {
var scheduler = this;
var pipelineMap = scheduler._pipelineMap = createHashMap();
+
ecModel.eachSeries(function (seriesModel) {
var progressive = seriesModel.getProgressive();
var pipelineId = seriesModel.uid;
@@ -23373,8 +24317,8 @@ proto.restorePipelines = function (ecModel) {
threshold: seriesModel.getProgressiveThreshold(),
progressiveEnabled: progressive
&& !(seriesModel.preventIncremental && seriesModel.preventIncremental()),
- bockIndex: -1,
- step: progressive || 700, // ??? Temporarily number
+ blockIndex: -1,
+ step: Math.round(progressive || 700),
count: 0
});
@@ -23387,13 +24331,11 @@ proto.prepareStageTasks = function () {
var ecModel = this.ecInstance.getModel();
var api = this.api;
- each$1([this._dataProcessorHandlers, this._visualHandlers], function (stageHandlers) {
- each$1(stageHandlers, function (handler) {
- var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, []);
+ each$1(this._allHandlers, function (handler) {
+ var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, []);
- handler.reset && createSeriesStageTask(this, handler, record, ecModel, api);
- handler.overallReset && createOverallStageTask(this, handler, record, ecModel, api);
- }, this);
+ handler.reset && createSeriesStageTask(this, handler, record, ecModel, api);
+ handler.overallReset && createOverallStageTask(this, handler, record, ecModel, api);
}, this);
};
@@ -23495,7 +24437,7 @@ proto.plan = function () {
var task = pipeline.tail;
do {
if (task.__block) {
- pipeline.bockIndex = task.__idxInPipeline;
+ pipeline.blockIndex = task.__idxInPipeline;
break;
}
task = task.getUpstream();
@@ -23578,7 +24520,7 @@ function createOverallStageTask(scheduler, stageHandler, stageHandlerRecord, ecM
var seriesType = stageHandler.seriesType;
var getTargetSeries = stageHandler.getTargetSeries;
var overallProgress = true;
- var isOverallFilter = stageHandler.isOverallFilter;
+ var modifyOutputEnd = stageHandler.modifyOutputEnd;
// An overall task with seriesType detected or has `getTargetSeries`, we add
// stub in each pipelines, it will set the overall task dirty when the pipeline
@@ -23601,13 +24543,19 @@ function createOverallStageTask(scheduler, stageHandler, stageHandlerRecord, ecM
function createStub(seriesModel) {
var pipelineId = seriesModel.uid;
- var stub = agentStubMap.get(pipelineId) || agentStubMap.set(pipelineId, createTask(
- {reset: stubReset, onDirty: stubOnDirty}
- ));
+ var stub = agentStubMap.get(pipelineId);
+ if (!stub) {
+ stub = agentStubMap.set(pipelineId, createTask(
+ {reset: stubReset, onDirty: stubOnDirty}
+ ));
+ // When the result of `getTargetSeries` changed, the overallTask
+ // should be set as dirty and re-performed.
+ overallTask.dirty();
+ }
stub.context = {
model: seriesModel,
overallProgress: overallProgress,
- isOverallFilter: isOverallFilter
+ modifyOutputEnd: modifyOutputEnd
};
stub.agent = overallTask;
stub.__block = overallProgress;
@@ -23620,6 +24568,9 @@ function createOverallStageTask(scheduler, stageHandler, stageHandlerRecord, ecM
agentStubMap.each(function (stub, pipelineId) {
if (!pipelineMap.get(pipelineId)) {
stub.dispose();
+ // When the result of `getTargetSeries` changed, the overallTask
+ // should be set as dirty and re-performed.
+ overallTask.dirty();
agentStubMap.removeKey(pipelineId);
}
});
@@ -23657,17 +24608,20 @@ function seriesTaskReset(context) {
var resetDefines = context.resetDefines = normalizeToArray(context.reset(
context.model, context.ecModel, context.api, context.payload
));
- if (resetDefines.length) {
- return seriesTaskProgress;
- }
+ return resetDefines.length > 1
+ ? map(resetDefines, function (v, idx) {
+ return makeSeriesTaskProgress(idx);
+ })
+ : singleSeriesTaskProgress;
}
-function seriesTaskProgress(params, context) {
- var data = context.data;
- var resetDefines = context.resetDefines;
+var singleSeriesTaskProgress = makeSeriesTaskProgress(0);
+
+function makeSeriesTaskProgress(resetDefineIdx) {
+ return function (params, context) {
+ var data = context.data;
+ var resetDefine = context.resetDefines[resetDefineIdx];
- for (var k = 0; k < resetDefines.length; k++) {
- var resetDefine = resetDefines[k];
if (resetDefine && resetDefine.dataEach) {
for (var i = params.start; i < params.end; i++) {
resetDefine.dataEach(data, i);
@@ -23676,7 +24630,7 @@ function seriesTaskProgress(params, context) {
else if (resetDefine && resetDefine.progress) {
resetDefine.progress(params, data);
}
- }
+ };
}
function seriesTaskCount(context) {
@@ -23749,6 +24703,25 @@ function mockMethods(target, Clz) {
}
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var colorAll = ['#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C','#ff9f7f', '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'];
var lightTheme = {
@@ -23763,6 +24736,25 @@ var lightTheme = {
]
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var contrastColor = '#eee';
var axisCommon = function () {
return {
@@ -23893,26 +24885,94 @@ var theme = {
};
theme.categoryAxis.splitLine.show = false;
-/*!
- * ECharts, a free, powerful charting and visualization library.
- *
- * Copyright (c) 2017, Baidu Inc.
- * All rights reserved.
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+/**
+ * This module is imported by echarts directly.
*
- * LICENSE
- * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt
+ * Notice:
+ * Always keep this file exists for backward compatibility.
+ * Because before 4.1.0, dataset is an optional component,
+ * some users may import this module manually.
*/
+ComponentModel.extend({
+
+ type: 'dataset',
+
+ /**
+ * @protected
+ */
+ defaultOption: {
+
+ // 'row', 'column'
+ seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,
+
+ // null/'auto': auto detect header, see "module:echarts/data/helper/sourceHelper"
+ sourceHeader: null,
+
+ dimensions: null,
+
+ source: null
+ },
+
+ optionUpdated: function () {
+ detectSourceFormat(this);
+ }
+
+});
+
+Component$1.extend({
+
+ type: 'dataset'
+
+});
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
var assert = assert$1;
var each = each$1;
var isFunction = isFunction$1;
var isObject = isObject$1;
var parseClassType = ComponentModel.parseClassType;
-var version = '4.0.4';
+var version = '4.1.0';
var dependencies = {
- zrender: '4.0.3'
+ zrender: '4.0.4'
};
var TEST_FRAME_REMAIN_TIME = 1;
@@ -24643,7 +25703,7 @@ var updateMethods = {
return;
}
- ecModel.restoreData(payload);
+ scheduler.restoreData(ecModel, payload);
scheduler.performSeriesTasks(ecModel);
@@ -24662,8 +25722,10 @@ var updateMethods = {
// deteming whether use progressive rendering.
updateStreamModes(this, ecModel);
- // stackSeriesData(ecModel);
-
+ // We update stream modes before coordinate system updated, then the modes info
+ // can be fetched when coord sys updating (consider the barGrid extent fix). But
+ // the drawback is the full coord info can not be fetched. Fortunately this full
+ // coord is not requied in stream mode updater currently.
coordSysMgr.update(ecModel, api);
clearColorPalette(ecModel);
@@ -24861,11 +25923,18 @@ function updateDirectly(ecIns, method, payload, mainType, subType) {
var condition = {mainType: mainType, query: query};
subType && (condition.subType = subType); // subType may be '' by parseClassType;
+ var excludeSeriesId = payload.excludeSeriesId;
+ if (excludeSeriesId != null) {
+ excludeSeriesId = createHashMap(normalizeToArray(excludeSeriesId));
+ }
+
// If dispatchAction before setOption, do nothing.
- ecModel && ecModel.eachComponent(condition, function (model, index) {
- callView(ecIns[
- mainType === 'series' ? '_chartsMap' : '_componentsMap'
- ][model.__viewId]);
+ ecModel && ecModel.eachComponent(condition, function (model) {
+ if (!excludeSeriesId || excludeSeriesId.get(model.id) == null) {
+ callView(ecIns[
+ mainType === 'series' ? '_chartsMap' : '_componentsMap'
+ ][model.__viewId]);
+ }
}, ecIns);
function callView(view) {
@@ -26028,6 +27097,26 @@ registerTheme('dark', theme);
// be mounted on `echarts` is the extension `dataTool` is imported.
var dataTool = {};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+
function defaultKeyGetter(item) {
return item;
}
@@ -26155,6 +27244,25 @@ function initIndexMap(arr, map, keyArr, keyGetterName, dataDiffer) {
}
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var OTHER_DIMENSIONS = createHashMap([
'tooltip', 'label', 'itemName', 'itemId', 'seriesName'
]);
@@ -26164,6 +27272,7 @@ function summarizeDimensions(data) {
var encode = summary.encode = {};
var notExtraCoordDimMap = createHashMap();
var defaultedLabel = [];
+ var defaultedTooltip = [];
each$1(data.dimensions, function (dimName) {
var dimItem = data.getDimensionInfo(dimName);
@@ -26190,6 +27299,9 @@ function summarizeDimensions(data) {
defaultedLabel[0] = dimName;
}
}
+ if (dimItem.defaultTooltip) {
+ defaultedTooltip.push(dimName);
+ }
}
OTHER_DIMENSIONS.each(function (v, otherDim) {
@@ -26229,11 +27341,13 @@ function summarizeDimensions(data) {
defaultedLabel = encodeLabel.slice();
}
- var defaultedTooltip = defaultedLabel.slice();
var encodeTooltip = encode.tooltip;
if (encodeTooltip && encodeTooltip.length) {
defaultedTooltip = encodeTooltip.slice();
}
+ else if (!defaultedTooltip.length) {
+ defaultedTooltip = defaultedLabel.slice();
+ }
encode.defaultedLabel = defaultedLabel;
encode.defaultedTooltip = defaultedTooltip;
@@ -26268,6 +27382,25 @@ function mayLabelDimType(dimType) {
// return valueDim;
// }
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* List for data storage
* @module echarts/data/List
@@ -26276,25 +27409,26 @@ function mayLabelDimType(dimType) {
var isObject$4 = isObject$1;
var UNDEFINED = 'undefined';
-var globalObj = typeof window === UNDEFINED ? global : window;
// Use prefix to avoid index to be the same as otherIdList[idx],
// which will cause weird udpate animation.
var ID_PREFIX = 'e\0\0';
var dataCtors = {
- 'float': typeof globalObj.Float64Array === UNDEFINED
- ? Array : globalObj.Float64Array,
- 'int': typeof globalObj.Int32Array === UNDEFINED
- ? Array : globalObj.Int32Array,
+ 'float': typeof Float64Array === UNDEFINED
+ ? Array : Float64Array,
+ 'int': typeof Int32Array === UNDEFINED
+ ? Array : Int32Array,
// Ordinal data type can be string or int
'ordinal': Array,
'number': Array,
'time': Array
};
-var CtorUint32Array = typeof globalObj.Uint32Array === UNDEFINED ? Array : globalObj.Uint32Array;
-var CtorUint16Array = typeof globalObj.Uint16Array === UNDEFINED ? Array : globalObj.Uint16Array;
+// Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is
+// different from the Ctor of typed array.
+var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;
+var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;
function getIndicesCtor(list) {
// The possible max value in this._indicies is always this._rawCount despite of filtering.
@@ -26308,21 +27442,29 @@ function cloneChunk(originalChunk) {
}
var TRANSFERABLE_PROPERTIES = [
- 'hasItemOption', '_nameList', '_idList', '_calculationInfo', '_invertedIndicesMap',
- '_rawData', '_rawExtent', '_chunkSize', '_chunkCount',
- '_dimValueGetter', '_count', '_rawCount', '_nameDimIdx', '_idDimIdx'
+ 'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap',
+ '_rawData', '_chunkSize', '_chunkCount', '_dimValueGetter',
+ '_count', '_rawCount', '_nameDimIdx', '_idDimIdx'
+];
+var CLONE_PROPERTIES = [
+ '_extent', '_approximateExtent', '_rawExtent'
];
-function transferProperties(a, b) {
- each$1(TRANSFERABLE_PROPERTIES.concat(b.__wrappedMethods || []), function (propName) {
- if (b.hasOwnProperty(propName)) {
- a[propName] = b[propName];
+function transferProperties(target, source) {
+ each$1(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {
+ if (source.hasOwnProperty(propName)) {
+ target[propName] = source[propName];
}
});
- a.__wrappedMethods = b.__wrappedMethods;
-}
+ target.__wrappedMethods = source.__wrappedMethods;
+ each$1(CLONE_PROPERTIES, function (propName) {
+ target[propName] = clone(source[propName]);
+ });
+
+ target._calculationInfo = extend(source._calculationInfo);
+}
@@ -26691,6 +27833,7 @@ listProto._initDataFromProvider = function (start, end) {
var rawData = this._rawData;
var storage = this._storage;
var dimensions = this.dimensions;
+ var dimLen = dimensions.length;
var dimensionInfoMap = this._dimensionInfos;
var nameList = this._nameList;
var idList = this._idList;
@@ -26700,7 +27843,7 @@ listProto._initDataFromProvider = function (start, end) {
var chunkCount = this._chunkCount;
var lastChunkIndex = chunkCount - 1;
- for (var i = 0; i < dimensions.length; i++) {
+ for (var i = 0; i < dimLen; i++) {
var dim = dimensions[i];
if (!rawExtent[dim]) {
rawExtent[dim] = getInitialExtent();
@@ -26736,9 +27879,10 @@ listProto._initDataFromProvider = function (start, end) {
this._chunkCount = storage[dim].length;
}
+ var dataItem = new Array(dimLen);
for (var idx = start; idx < end; idx++) {
// NOTICE: Try not to write things into dataItem
- var dataItem = rawData.getItem(idx);
+ dataItem = rawData.getItem(idx, dataItem);
// Each data item is value
// [1, 2]
// 2
@@ -26749,18 +27893,19 @@ listProto._initDataFromProvider = function (start, end) {
var chunkOffset = idx % chunkSize;
// Store the data by dimensions
- for (var k = 0; k < dimensions.length; k++) {
+ for (var k = 0; k < dimLen; k++) {
var dim = dimensions[k];
var dimStorage = storage[dim][chunkIndex];
// PENDING NULL is empty or zero
var val = this._dimValueGetter(dataItem, dim, idx, k);
dimStorage[chunkOffset] = val;
- if (val < rawExtent[dim][0]) {
- rawExtent[dim][0] = val;
+ var dimRawExtent = rawExtent[dim];
+ if (val < dimRawExtent[0]) {
+ dimRawExtent[0] = val;
}
- if (val > rawExtent[dim][1]) {
- rawExtent[dim][1] = val;
+ if (val > dimRawExtent[1]) {
+ dimRawExtent[1] = val;
}
}
@@ -26769,15 +27914,25 @@ listProto._initDataFromProvider = function (start, end) {
if (!rawData.pure) {
var name = nameList[idx];
- if (dataItem && !name) {
- if (nameDimIdx != null) {
- name = this._getNameFromStore(idx);
- }
- else if (dataItem.name != null) {
+ if (dataItem && name == null) {
+ // If dataItem is {name: ...}, it has highest priority.
+ // That is appropriate for many common cases.
+ if (dataItem.name != null) {
// There is no other place to persistent dataItem.name,
// so save it to nameList.
nameList[idx] = name = dataItem.name;
}
+ else if (nameDimIdx != null) {
+ var nameDim = dimensions[nameDimIdx];
+ var nameDimChunk = storage[nameDim][chunkIndex];
+ if (nameDimChunk) {
+ name = nameDimChunk[chunkOffset];
+ var ordinalMeta = dimensionInfoMap[nameDim].ordinalMeta;
+ if (ordinalMeta && ordinalMeta.categories.length) {
+ name = ordinalMeta.categories[name];
+ }
+ }
+ }
}
// Try using the id in option
@@ -26834,43 +27989,24 @@ function prepareInvertedIndex(list) {
});
}
-// TODO refactor
-listProto._getNameFromStore = function (rawIndex) {
- var nameDimIdx = this._nameDimIdx;
- if (nameDimIdx != null) {
- var chunkSize = this._chunkSize;
+function getRawValueFromStore(list, dimIndex, rawIndex) {
+ var val;
+ if (dimIndex != null) {
+ var chunkSize = list._chunkSize;
var chunkIndex = Math.floor(rawIndex / chunkSize);
var chunkOffset = rawIndex % chunkSize;
- var dim = this.dimensions[nameDimIdx];
- var ordinalMeta = this._dimensionInfos[dim].ordinalMeta;
- if (ordinalMeta) {
- return ordinalMeta.categories[rawIndex];
- }
- else {
- var chunk = this._storage[dim][chunkIndex];
- return chunk && chunk[chunkOffset];
- }
- }
-};
-
-// TODO refactor
-listProto._getIdFromStore = function (rawIndex) {
- var idDimIdx = this._idDimIdx;
- if (idDimIdx != null) {
- var chunkSize = this._chunkSize;
- var chunkIndex = Math.floor(rawIndex / chunkSize);
- var chunkOffset = rawIndex % chunkSize;
- var dim = this.dimensions[idDimIdx];
- var ordinalMeta = this._dimensionInfos[dim].ordinalMeta;
- if (ordinalMeta) {
- return ordinalMeta.categories[rawIndex];
- }
- else {
- var chunk = this._storage[dim][chunkIndex];
- return chunk && chunk[chunkOffset];
+ var dim = list.dimensions[dimIndex];
+ var chunk = list._storage[dim][chunkIndex];
+ if (chunk) {
+ val = chunk[chunkOffset];
+ var ordinalMeta = list._dimensionInfos[dim].ordinalMeta;
+ if (ordinalMeta && ordinalMeta.categories.length) {
+ val = ordinalMeta.categories[val];
+ }
}
}
-};
+ return val;
+}
/**
* @return {number}
@@ -26880,17 +28016,32 @@ listProto.count = function () {
};
listProto.getIndices = function () {
- if (this._indices) {
- var Ctor = this._indices.constructor;
- return new Ctor(this._indices.buffer, 0, this._count);
- }
+ var newIndices;
- var Ctor = getIndicesCtor(this);
- var arr = new Ctor(this.count());
- for (var i = 0; i < arr.length; i++) {
- arr[i] = i;
+ var indices = this._indices;
+ if (indices) {
+ var Ctor = indices.constructor;
+ var thisCount = this._count;
+ // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.
+ if (Ctor === Array) {
+ newIndices = new Ctor(thisCount);
+ for (var i = 0; i < thisCount; i++) {
+ newIndices[i] = indices[i];
+ }
+ }
+ else {
+ newIndices = new Ctor(indices.buffer, 0, thisCount);
+ }
}
- return arr;
+ else {
+ var Ctor = getIndicesCtor(this);
+ var newIndices = new Ctor(this.count());
+ for (var i = 0; i < newIndices.length; i++) {
+ newIndices[i] = i;
+ }
+ }
+
+ return newIndices;
};
/**
@@ -27123,6 +28274,33 @@ listProto.getSum = function (dim /*, stack */) {
return sum;
};
+/**
+ * Get median of data in one dimension
+ * @param {string} dim
+ */
+listProto.getMedian = function (dim /*, stack */) {
+ var dimDataArray = [];
+ // map all data of one dimension
+ this.each(dim, function (val, idx) {
+ if (!isNaN(val)) {
+ dimDataArray.push(val);
+ }
+ });
+
+ // TODO
+ // Use quick select?
+
+ // immutability & sort
+ var sortedDimDataArray = [].concat(dimDataArray).sort(function(a, b) {
+ return a - b;
+ });
+ var len = this.count();
+ // calculate median
+ return len === 0 ? 0 :
+ len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] :
+ (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;
+};
+
// /**
// * Retreive the index with given value
// * @param {string} dim Concrete dimension.
@@ -27311,7 +28489,7 @@ listProto.getRawDataItem = function (idx) {
listProto.getName = function (idx) {
var rawIndex = this.getRawIndex(idx);
return this._nameList[rawIndex]
- || this._getNameFromStore(rawIndex)
+ || getRawValueFromStore(this, this._nameDimIdx, rawIndex)
|| '';
};
@@ -27327,7 +28505,7 @@ listProto.getId = function (idx) {
function getId(list, rawIndex) {
var id = list._idList[rawIndex];
if (id == null) {
- id = list._getIdFromStore(rawIndex);
+ id = getRawValueFromStore(list, list._idDimIdx, rawIndex);
}
if (id == null) {
// FIXME Check the usage in graph, should not use prefix.
@@ -27495,15 +28673,13 @@ listProto.filterSelf = function (dimensions, cb, context, contextCompat) {
* Select data in range. (For optimization of filter)
* (Manually inline code, support 5 million data filtering in data zoom.)
*/
-listProto.selectRange = function (range /*, stack */) {
+listProto.selectRange = function (range) {
'use strict';
if (!this._count) {
return;
}
- // stack = stack || false;
-
var dimensions = [];
for (var dim in range) {
if (range.hasOwnProperty(dim)) {
@@ -27531,7 +28707,7 @@ listProto.selectRange = function (range /*, stack */) {
var max = range[dim0][1];
var quickFinished = false;
- if (!this._indices /* && !stack */) {
+ if (!this._indices) {
// Extreme optimization for common case. About 2x faster in chrome.
var idx = 0;
if (dimSize === 1) {
@@ -27541,7 +28717,14 @@ listProto.selectRange = function (range /*, stack */) {
var len = Math.min(this._count - k * this._chunkSize, this._chunkSize);
for (var i = 0; i < len; i++) {
var val = chunkStorage[i];
- if (val >= min && val <= max) {
+ // NaN will not be filtered. Consider the case, in line chart, empty
+ // value indicates the line should be broken. But for the case like
+ // scatter plot, a data item with empty value will not be rendered,
+ // but the axis extent may be effected if some other dim of the data
+ // item has value. Fortunately it is not a significant negative effect.
+ if (
+ (val >= min && val <= max) || isNaN(val)
+ ) {
newIndices[offset++] = idx;
}
idx++;
@@ -27561,7 +28744,14 @@ listProto.selectRange = function (range /*, stack */) {
for (var i = 0; i < len; i++) {
var val = chunkStorage[i];
var val2 = chunkStorage2[i];
- if (val >= min && val <= max && val2 >= min2 && val2 <= max2) {
+ // Do not filter NaN, see comment above.
+ if ((
+ (val >= min && val <= max) || isNaN(val)
+ )
+ && (
+ (val2 >= min2 && val2 <= max2) || isNaN(val2)
+ )
+ ) {
newIndices[offset++] = idx;
}
idx++;
@@ -27572,12 +28762,13 @@ listProto.selectRange = function (range /*, stack */) {
}
if (!quickFinished) {
if (dimSize === 1) {
- // stack = stack || !!this.getCalculationInfo(dim0);
for (var i = 0; i < originalCount; i++) {
var rawIndex = this.getRawIndex(i);
- // var val = stack ? this.get(dim0, i, true) : this._getFast(dim0, rawIndex);
var val = this._getFast(dim0, rawIndex);
- if (val >= min && val <= max) {
+ // Do not filter NaN, see comment above.
+ if (
+ (val >= min && val <= max) || isNaN(val)
+ ) {
newIndices[offset++] = rawIndex;
}
}
@@ -27588,8 +28779,8 @@ listProto.selectRange = function (range /*, stack */) {
var rawIndex = this.getRawIndex(i);
for (var k = 0; k < dimSize; k++) {
var dimk = dimensions[k];
- // var val = stack ? this.get(dimk, i, true) : this._getFast(dim, rawIndex);
var val = this._getFast(dim, rawIndex);
+ // Do not filter NaN, see comment above.
if (val < range[dimk][0] || val > range[dimk][1]) {
keep = false;
}
@@ -27653,15 +28844,17 @@ function cloneListForMapAndSample(original, excludeDimensions) {
var storage = list._storage = {};
var originalStorage = original._storage;
- var rawExtent = extend({}, original._rawExtent);
// Init storage
for (var i = 0; i < allDimensions.length; i++) {
var dim = allDimensions[i];
if (originalStorage[dim]) {
+ // Notice that we do not reset invertedIndicesMap here, becuase
+ // there is no scenario of mapping or sampling ordinal dimension.
if (indexOf(excludeDimensions, dim) >= 0) {
storage[dim] = cloneDimStore(originalStorage[dim]);
- rawExtent[dim] = getInitialExtent();
+ list._rawExtent[dim] = getInitialExtent();
+ list._extent[dim] = null;
}
else {
// Direct reference for other dimensions
@@ -28067,9 +29260,6 @@ listProto.cloneShallow = function (list) {
}
list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;
- list._extent = clone(this._extent);
- list._approximateExtent = clone(this._approximateExtent);
-
return list;
};
@@ -28097,6 +29287,25 @@ listProto.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'map'];
// Methods that change indices of this list should be listed here.
listProto.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @deprecated
* Use `echarts/data/helper/createDimensions` instead.
@@ -28114,7 +29323,7 @@ listProto.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];
* provides not only dim template, but also default order.
* properties: 'name', 'type', 'displayName'.
* `name` of each item provides default coord name.
- * [{dimsDef: [string...]}, ...] dimsDef of sysDim item provides default dim name, and
+ * [{dimsDef: [string|Object, ...]}, ...] dimsDef of sysDim item provides default dim name, and
* provide dims count that the sysDim required.
* [{ordinalMeta}] can be specified.
* @param {module:echarts/data/Source|Array|Object} source or data (for compatibal with pervious)
@@ -28238,7 +29447,10 @@ function completeDimensions(sysDims, source, opt) {
var resultItem = result[resultDimIdx];
applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);
if (resultItem.name == null && sysDimItemDimsDef) {
- resultItem.name = resultItem.displayName = sysDimItemDimsDef[coordDimIndex];
+ var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];
+ !isObject$1(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {name: sysDimItemDimsDefItem});
+ resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;
+ resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;
}
// FIXME refactor, currently only used in case: {otherDims: {tooltip: false}}
sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);
@@ -28330,6 +29542,25 @@ function genName(name, map$$1, fromZero) {
return name;
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Substitute `completeDimensions`.
* `completeDimensions` is to be deprecated.
@@ -28356,6 +29587,25 @@ var createDimensions = function (source, opt) {
});
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Note that it is too complicated to support 3d stack by value
* (have to create two-dimension inverted index), so in 3d case
@@ -28480,6 +29730,25 @@ function isDimensionStacked(data, stackedDim, stackedByDim) {
);
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @param {module:echarts/data/Source|Array} source Or raw data.
* @param {module:echarts/model/Series} seriesModel
@@ -28583,6 +29852,25 @@ function firstDataNotNull(data) {
return data[i];
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* // Scale class management
* @module echarts/scale/Scale
@@ -28701,18 +29989,6 @@ Scale.prototype.setExtent = function (start, end) {
};
/**
- * @return {Array.<string>}
- */
-Scale.prototype.getTicksLabels = function () {
- var labels = [];
- var ticks = this.getTicks();
- for (var i = 0; i < ticks.length; i++) {
- labels.push(this.getLabel(ticks[i]));
- }
- return labels;
-};
-
-/**
* When axis extent depends on data and no data exists,
* axis ticks should not be drawn, which is named 'blank'.
*/
@@ -28728,12 +30004,38 @@ Scale.prototype.setBlank = function (isBlank) {
this._isBlank = isBlank;
};
+/**
+ * @abstract
+ * @param {*} tick
+ * @return {string} label of the tick.
+ */
+Scale.prototype.getLabel = null;
+
enableClassExtend(Scale);
enableClassManagement(Scale, {
registerWhenExtend: true
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @constructor
* @param {Object} [opt]
@@ -28859,6 +30161,25 @@ function getName(obj) {
}
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Linear continuous scale
* @module echarts/coord/scale/Ordinal
@@ -28935,7 +30256,10 @@ var OrdinalScale = Scale.extend({
* @return {string}
*/
getLabel: function (n) {
- return this._ordinalMeta.categories[n];
+ if (!this.isBlank()) {
+ // Note that if no data, ordinalMeta.categories is an empty array.
+ return this._ordinalMeta.categories[n];
+ }
},
/**
@@ -28952,6 +30276,10 @@ var OrdinalScale = Scale.extend({
this.unionExtent(data.getApproximateExtent(dim));
},
+ getOrdinalMeta: function () {
+ return this._ordinalMeta;
+ },
+
niceTicks: noop,
niceExtent: noop
});
@@ -28963,6 +30291,25 @@ OrdinalScale.create = function () {
return new OrdinalScale();
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* For testable.
*/
@@ -29063,6 +30410,25 @@ function intervalScaleGetTicks(interval, extent, niceTickExtent, intervalPrecisi
return ticks;
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Interval scale
* @module echarts/scale/Interval
@@ -29131,18 +30497,6 @@ var IntervalScale = Scale.extend({
},
/**
- * @return {Array.<string>}
- */
- getTicksLabels: function () {
- var labels = [];
- var ticks = this.getTicks();
- for (var i = 0; i < ticks.length; i++) {
- labels.push(this.getLabel(ticks[i]));
- }
- return labels;
- },
-
- /**
* @param {number} data
* @param {Object} [opt]
* @param {number|string} [opt.precision] If 'auto', use nice presision.
@@ -29262,7 +30616,29 @@ IntervalScale.create = function () {
return new IntervalScale();
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var STACK_PREFIX = '__ec_stack_';
+var LARGE_BAR_MIN_WIDTH = 0.5;
+
+var LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array;
function getSeriesStackId(seriesModel) {
return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;
@@ -29284,8 +30660,20 @@ function getAxisKey(axis) {
*/
-function calBarWidthAndOffset(barSeries, api) {
- var seriesInfoList = map(barSeries, function (seriesModel) {
+function prepareLayoutBarSeries(seriesType, ecModel) {
+ var seriesModels = [];
+ ecModel.eachSeriesByType(seriesType, function (seriesModel) {
+ // Check series coordinate, do layout for cartesian2d only
+ if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) {
+ seriesModels.push(seriesModel);
+ }
+ });
+ return seriesModels;
+}
+
+function makeColumnLayout(barSeries) {
+ var seriesInfoList = [];
+ each$1(barSeries, function (seriesModel) {
var data = seriesModel.getData();
var cartesian = seriesModel.coordinateSystem;
var baseAxis = cartesian.getBaseAxis();
@@ -29303,7 +30691,7 @@ function calBarWidthAndOffset(barSeries, api) {
var barGap = seriesModel.get('barGap');
var barCategoryGap = seriesModel.get('barCategoryGap');
- return {
+ seriesInfoList.push({
bandWidth: bandWidth,
barWidth: barWidth,
barMaxWidth: barMaxWidth,
@@ -29311,13 +30699,13 @@ function calBarWidthAndOffset(barSeries, api) {
barCategoryGap: barCategoryGap,
axisKey: getAxisKey(baseAxis),
stackId: getSeriesStackId(seriesModel)
- };
+ });
});
- return doCalBarWidthAndOffset(seriesInfoList, api);
+ return doCalBarWidthAndOffset(seriesInfoList);
}
-function doCalBarWidthAndOffset(seriesInfoList, api) {
+function doCalBarWidthAndOffset(seriesInfoList) {
// Columns info on each category axis. Key is cartesian name
var columnsMap = {};
@@ -29431,21 +30819,29 @@ function doCalBarWidthAndOffset(seriesInfoList, api) {
}
/**
+ * @param {Object} barWidthAndOffset The result of makeColumnLayout
+ * @param {module:echarts/coord/Axis} axis
+ * @param {module:echarts/model/Series} [seriesModel] If not provided, return all.
+ * @return {Object} {stackId: {offset, width}} or {offset, width} if seriesModel provided.
+ */
+function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {
+ if (barWidthAndOffset && axis) {
+ var result = barWidthAndOffset[getAxisKey(axis)];
+ if (result != null && seriesModel != null) {
+ result = result[getSeriesStackId(seriesModel)];
+ }
+ return result;
+ }
+}
+
+/**
* @param {string} seriesType
* @param {module:echarts/model/Global} ecModel
- * @param {module:echarts/ExtensionAPI} api
*/
-function layout(seriesType, ecModel, api) {
+function layout(seriesType, ecModel) {
- var seriesModels = [];
- ecModel.eachSeriesByType(seriesType, function (seriesModel) {
- // Check series coordinate, do layout for cartesian2d only
- if (seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d') {
- seriesModels.push(seriesModel);
- }
- });
-
- var barWidthAndOffset = calBarWidthAndOffset(seriesModels);
+ var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);
+ var barWidthAndOffset = makeColumnLayout(seriesModels);
var lastStackCoords = {};
each$1(seriesModels, function (seriesModel) {
@@ -29473,9 +30869,7 @@ function layout(seriesType, ecModel, api) {
var stacked = isDimensionStacked(data, valueDim, baseDim);
var isValueAxisH = valueAxis.isHorizontal();
- var valueAxisStart = (baseAxis.onZero || stacked)
- ? valueAxis.toGlobalCoord(valueAxis.dataToCoord(0))
- : valueAxis.getGlobalExtent()[0];
+ var valueAxisStart = getValueAxisStart(baseAxis, valueAxis, stacked);
for (var idx = 0, len = data.count(); idx < len; idx++) {
var value = data.get(valueDim, idx);
@@ -29544,6 +30938,98 @@ function layout(seriesType, ecModel, api) {
}, this);
}
+// TODO: Do not support stack in large mode yet.
+var largeLayout = {
+
+ seriesType: 'bar',
+
+ plan: createRenderPlanner(),
+
+ reset: function (seriesModel) {
+ if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) {
+ return;
+ }
+
+ var data = seriesModel.getData();
+ var cartesian = seriesModel.coordinateSystem;
+ var baseAxis = cartesian.getBaseAxis();
+ var valueAxis = cartesian.getOtherAxis(baseAxis);
+ var valueDim = data.mapDimension(valueAxis.dim);
+ var baseDim = data.mapDimension(baseAxis.dim);
+ var valueAxisHorizontal = valueAxis.isHorizontal();
+ var valueDimIdx = valueAxisHorizontal ? 0 : 1;
+
+ var barWidth = retrieveColumnLayout(
+ makeColumnLayout([seriesModel]), baseAxis, seriesModel
+ ).width;
+ if (!(barWidth > LARGE_BAR_MIN_WIDTH)) { // jshint ignore:line
+ barWidth = LARGE_BAR_MIN_WIDTH;
+ }
+
+ return {progress: progress};
+
+ function progress(params, data) {
+ var largePoints = new LargeArr(params.count * 2);
+ var dataIndex;
+ var coord = [];
+ var valuePair = [];
+ var offset = 0;
+
+ while ((dataIndex = params.next()) != null) {
+ valuePair[valueDimIdx] = data.get(valueDim, dataIndex);
+ valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex);
+
+ coord = cartesian.dataToPoint(valuePair, null, coord);
+ largePoints[offset++] = coord[0];
+ largePoints[offset++] = coord[1];
+ }
+
+ data.setLayout({
+ largePoints: largePoints,
+ barWidth: barWidth,
+ valueAxisStart: getValueAxisStart(baseAxis, valueAxis, false),
+ valueAxisHorizontal: valueAxisHorizontal
+ });
+ }
+ }
+};
+
+function isOnCartesian(seriesModel) {
+ return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';
+}
+
+function isInLargeMode(seriesModel) {
+ return seriesModel.pipelineContext && seriesModel.pipelineContext.large;
+}
+
+function getValueAxisStart(baseAxis, valueAxis, stacked) {
+ return (
+ indexOf(baseAxis.getAxesOnZeroOf(), valueAxis) >= 0
+ || stacked
+ )
+ ? valueAxis.toGlobalCoord(valueAxis.dataToCoord(0))
+ : valueAxis.getGlobalExtent()[0];
+}
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// [About UTC and local time zone]:
// In most cases, `number.parseDate` will treat input data string as local time
// (except time zone is specified in time string). And `format.formateTime` returns
@@ -29734,6 +31220,25 @@ TimeScale.create = function (model) {
return new TimeScale({useUTC: model.ecModel.get('useUTC')});
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Log scale
* @module echarts/scale/Log
@@ -29914,6 +31419,25 @@ function fixRoundingError(val, originalVal) {
return roundingErrorFix(val, getPrecisionSafe$1(originalVal));
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Get axis scale extent before niced.
* Item of returned array can only be number (including Infinity and NaN).
@@ -30002,7 +31526,11 @@ function getScaleExtent(scale, model) {
(min == null || !isFinite(min)) && (min = NaN);
(max == null || !isFinite(max)) && (max = NaN);
- scale.setBlank(eqNaN(min) || eqNaN(max));
+ scale.setBlank(
+ eqNaN(min)
+ || eqNaN(max)
+ || (scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length)
+ );
// Evaluate if axis needs cross zero
if (model.getNeedCrossZero()) {
@@ -30020,26 +31548,26 @@ function getScaleExtent(scale, model) {
// is base axis
// FIXME
// (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.
- // (2) Refactor the logic with `barGrid`. Is it not need to `calBarWidthAndOffset` twice with different extent?
+ // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?
// Should not depend on series type `bar`?
// (3) Fix that might overlap when using dataZoom.
// (4) Consider other chart types using `barGrid`?
// See #6728, #4862, `test/bar-overflow-time-plot.html`
var ecModel = model.ecModel;
if (ecModel && (scaleType === 'time' /*|| scaleType === 'interval' */)) {
- var barSeriesModels = [];
+ var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);
var isBaseAxisAndHasBarSeries;
- ecModel.eachSeriesByType('bar', function (seriesModel) {
- if (seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d') {
- barSeriesModels.push(seriesModel);
- isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis;
- }
+ each$1(barSeriesModels, function (seriesModel) {
+ isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis;
});
if (isBaseAxisAndHasBarSeries) {
+ // Calculate placement of bars on axis
+ var barWidthAndOffset = makeColumnLayout(barSeriesModels);
+
// Adjust axis min and max to account for overflow
- var adjustedScale = adjustScaleForOverflow(min, max, model, barSeriesModels);
+ var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);
min = adjustedScale.min;
max = adjustedScale.max;
}
@@ -30048,18 +31576,14 @@ function getScaleExtent(scale, model) {
return [min, max];
}
-function adjustScaleForOverflow(min, max, model, barSeriesModels) {
+function adjustScaleForOverflow(min, max, model, barWidthAndOffset) {
// Get Axis Length
var axisExtent = model.axis.getExtent();
var axisLength = axisExtent[1] - axisExtent[0];
- // Calculate placement of bars on axis
- var barWidthAndOffset = calBarWidthAndOffset(barSeriesModels);
-
// Get bars on current base axis and calculate min and max overflow
- var baseAxisKey = model.axis.dim + model.axis.index;
- var barsOnCurrentAxis = barWidthAndOffset[baseAxisKey];
+ var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);
if (barsOnCurrentAxis === undefined) {
return {min: min, max: max};
}
@@ -30157,69 +31681,17 @@ function ifAxisCrossZero(axis) {
}
/**
- * @param {Array.<number>} tickCoords In axis self coordinate.
- * @param {Array.<string>} labels
- * @param {string} font
- * @param {number} axisRotate 0: towards right horizontally, clock-wise is negative.
- * @param {number} [labelRotate=0] 0: towards right horizontally, clock-wise is negative.
- * @return {number}
+ * @param {module:echarts/coord/Axis} axis
+ * @return {Function} Label formatter function.
+ * param: {number} tickValue,
+ * param: {number} idx, the index in all ticks.
+ * If category axis, this param is not requied.
+ * return: {string} label string.
*/
-function getAxisLabelInterval(tickCoords, labels, font, axisRotate, labelRotate) {
- var textSpaceTakenRect;
- var autoLabelInterval = 0;
- var accumulatedLabelInterval = 0;
- var rotation = (axisRotate - labelRotate) / 180 * Math.PI;
-
- var step = 1;
- if (labels.length > 40) {
- // Simple optimization for large amount of labels
- step = Math.floor(labels.length / 40);
- }
-
- for (var i = 0; i < tickCoords.length; i += step) {
- var tickCoord = tickCoords[i];
-
- // Not precise, do not consider align and vertical align
- // and each distance from axis line yet.
- var rect = getBoundingRect(
- labels[i], font, 'center', 'top'
- );
- rect.x += tickCoord * Math.cos(rotation);
- rect.y += tickCoord * Math.sin(rotation);
-
- // Magic number
- rect.width *= 1.3;
- rect.height *= 1.3;
+function makeLabelFormatter(axis) {
+ var labelFormatter = axis.getLabelModel().get('formatter');
+ var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;
- if (!textSpaceTakenRect) {
- textSpaceTakenRect = rect.clone();
- }
- // There is no space for current label;
- else if (textSpaceTakenRect.intersect(rect)) {
- accumulatedLabelInterval++;
- autoLabelInterval = Math.max(autoLabelInterval, accumulatedLabelInterval);
- }
- else {
- textSpaceTakenRect.union(rect);
- // Reset
- accumulatedLabelInterval = 0;
- }
- }
- if (autoLabelInterval === 0 && step > 1) {
- return step;
- }
- return (autoLabelInterval + 1) * step - 1;
-}
-
-/**
- * @param {Object} axis
- * @param {Function} labelFormatter
- * @return {Array.<string>}
- */
-function getFormattedLabels(axis, labelFormatter) {
- var scale = axis.scale;
- var labels = scale.getTicksLabels();
- var ticks = scale.getTicks();
if (typeof labelFormatter === 'string') {
labelFormatter = (function (tpl) {
return function (val) {
@@ -30227,18 +31699,26 @@ function getFormattedLabels(axis, labelFormatter) {
};
})(labelFormatter);
// Consider empty array
- return map(labels, labelFormatter);
+ return labelFormatter;
}
else if (typeof labelFormatter === 'function') {
- return map(ticks, function (tick, idx) {
- return labelFormatter(
- getAxisRawValue(axis, tick),
- idx
- );
- }, this);
+ return function (tickValue, idx) {
+ // The original intention of `idx` is "the index of the tick in all ticks".
+ // But the previous implementation of category axis do not consider the
+ // `axisLabel.interval`, which cause that, for example, the `interval` is
+ // `1`, then the ticks "name5", "name7", "name9" are displayed, where the
+ // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep
+ // the definition here for back compatibility.
+ if (categoryTickStart != null) {
+ idx = tickValue - categoryTickStart;
+ }
+ return labelFormatter(getAxisRawValue(axis, tickValue), idx);
+ };
}
else {
- return labels;
+ return function (tick) {
+ return axis.scale.getLabel(tick);
+ };
}
}
@@ -30249,18 +31729,86 @@ function getAxisRawValue(axis, value) {
return axis.type === 'category' ? axis.scale.getLabel(value) : value;
}
-var axisModelCommonMixin = {
+/**
+ * @param {module:echarts/coord/Axis} axis
+ * @return {module:zrender/core/BoundingRect} Be null/undefined if no labels.
+ */
+function estimateLabelUnionRect(axis) {
+ var axisModel = axis.model;
+ var scale = axis.scale;
- /**
- * Format labels
- * @return {Array.<string>}
- */
- getFormattedLabels: function () {
- return getFormattedLabels(
- this.axis,
- this.get('axisLabel.formatter')
- );
- },
+ if (!axisModel.get('axisLabel.show') || scale.isBlank()) {
+ return;
+ }
+
+ var isCategory = axis.type === 'category';
+
+ var realNumberScaleTicks;
+ var tickCount;
+ var categoryScaleExtent = scale.getExtent();
+
+ // Optimize for large category data, avoid call `getTicks()`.
+ if (isCategory) {
+ tickCount = scale.count();
+ }
+ else {
+ realNumberScaleTicks = scale.getTicks();
+ tickCount = realNumberScaleTicks.length;
+ }
+
+ var axisLabelModel = axis.getLabelModel();
+ var labelFormatter = makeLabelFormatter(axis);
+
+ var rect;
+ var step = 1;
+ // Simple optimization for large amount of labels
+ if (tickCount > 40) {
+ step = Math.ceil(tickCount / 40);
+ }
+ for (var i = 0; i < tickCount; i += step) {
+ var tickValue = realNumberScaleTicks ? realNumberScaleTicks[i] : categoryScaleExtent[0] + i;
+ var label = labelFormatter(tickValue);
+ var unrotatedSingleRect = axisLabelModel.getTextRect(label);
+ var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);
+
+ rect ? rect.union(singleRect) : (rect = singleRect);
+ }
+
+ return rect;
+}
+
+function rotateTextRect(textRect, rotate) {
+ var rotateRadians = rotate * Math.PI / 180;
+ var boundingBox = textRect.plain();
+ var beforeWidth = boundingBox.width;
+ var beforeHeight = boundingBox.height;
+ var afterWidth = beforeWidth * Math.cos(rotateRadians) + beforeHeight * Math.sin(rotateRadians);
+ var afterHeight = beforeWidth * Math.sin(rotateRadians) + beforeHeight * Math.cos(rotateRadians);
+ var rotatedRect = new BoundingRect(boundingBox.x, boundingBox.y, afterWidth, afterHeight);
+
+ return rotatedRect;
+}
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+var axisModelCommonMixin = {
/**
* @param {boolean} origin
@@ -30335,6 +31883,25 @@ var axisModelCommonMixin = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// Symbol factory
/**
@@ -30688,6 +32255,25 @@ function createSymbol(symbolType, x, y, w, h, color, keepAspect) {
return symbolPath;
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// import createGraphFromNodeEdge from './chart/helper/createGraphFromNodeEdge';
/**
* Create a muti dimension List structure from seriesModel.
@@ -30778,6 +32364,25 @@ function contain$1(points, x, y) {
return w !== 0;
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @module echarts/coord/geo/Region
*/
@@ -30927,6 +32532,25 @@ Region.prototype = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Parse and decode geo json
* @module echarts/coord/geo/parseGeoJson
@@ -31052,25 +32676,407 @@ var parseGeoJSON = function (geoJson) {
});
};
-var linearMap$1 = linearMap;
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
-function fixExtentWithBands(extent, nTick) {
- var size = extent[1] - extent[0];
- var len = nTick;
- var margin = size / len / 2;
- extent[0] += margin;
- extent[1] -= margin;
+var inner$6 = makeInner();
+
+/**
+ * @param {module:echats/coord/Axis} axis
+ * @return {Object} {
+ * labels: [{
+ * formattedLabel: string,
+ * rawLabel: string,
+ * tickValue: number
+ * }, ...],
+ * labelCategoryInterval: number
+ * }
+ */
+function createAxisLabels(axis) {
+ // Only ordinal scale support tick interval
+ return axis.type === 'category'
+ ? makeCategoryLabels(axis)
+ : makeRealNumberLabels(axis);
+}
+
+/**
+ * @param {module:echats/coord/Axis} axis
+ * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea.
+ * @return {Object} {
+ * ticks: Array.<number>
+ * tickCategoryInterval: number
+ * }
+ */
+function createAxisTicks(axis, tickModel) {
+ // Only ordinal scale support tick interval
+ return axis.type === 'category'
+ ? makeCategoryTicks(axis, tickModel)
+ : {ticks: axis.scale.getTicks()};
+}
+
+function makeCategoryLabels(axis) {
+ var labelModel = axis.getLabelModel();
+
+ var labelsCache = getListCache(axis, 'labels');
+ var optionLabelInterval = getOptionCategoryInterval(labelModel);
+ var result = listCacheGet(labelsCache, optionLabelInterval);
+
+ if (result) {
+ return result;
+ }
+
+ var labels;
+ var numericLabelInterval;
+
+ if (!labelModel.get('show') || axis.scale.isBlank()) {
+ labels = [];
+ }
+ else if (isFunction$1(optionLabelInterval)) {
+ labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);
+ }
+ else {
+ numericLabelInterval = optionLabelInterval === 'auto'
+ ? makeAutoCategoryInterval(axis) : optionLabelInterval;
+ labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);
+ }
+
+ // Cache to avoid calling interval function repeatly.
+ return listCacheSet(labelsCache, optionLabelInterval, {
+ labels: labels, labelCategoryInterval: numericLabelInterval
+ });
+}
+
+function makeCategoryTicks(axis, tickModel) {
+ var ticksCache = getListCache(axis, 'ticks');
+ var optionTickInterval = getOptionCategoryInterval(tickModel);
+ var result = listCacheGet(ticksCache, optionTickInterval);
+
+ if (result) {
+ return result;
+ }
+
+ var ticks;
+ var numericTickInterval = optionTickInterval;
+
+ // Optimize for the case that large category data and no label displayed,
+ // we should not return all ticks.
+ if (!tickModel.get('show') || axis.scale.isBlank()) {
+ ticks = [];
+ }
+
+ if (isFunction$1(numericTickInterval)) {
+ ticks = makeLabelsByCustomizedCategoryInterval(axis, numericTickInterval, true);
+ }
+ // Always use label interval by default.
+ else {
+ if (numericTickInterval === 'auto') {
+ var labelsResult = makeCategoryLabels(axis);
+ numericTickInterval = labelsResult.labelCategoryInterval;
+ if (numericTickInterval != null) {
+ ticks = map(labelsResult.labels, function (labelItem) {
+ return labelItem.tickValue;
+ });
+ }
+ else {
+ numericTickInterval = makeAutoCategoryInterval(axis, true);
+ }
+ }
+ if (ticks == null) {
+ ticks = makeLabelsByNumericCategoryInterval(axis, numericTickInterval, true);
+ }
+ }
+
+ // Cache to avoid calling interval function repeatly.
+ return listCacheSet(ticksCache, optionTickInterval, {
+ ticks: ticks, tickCategoryInterval: numericTickInterval
+ });
+}
+
+function makeRealNumberLabels(axis) {
+ var ticks = axis.scale.getTicks();
+ var labelFormatter = makeLabelFormatter(axis);
+ return {
+ labels: map(ticks, function (tickValue, idx) {
+ return {
+ formattedLabel: labelFormatter(tickValue, idx),
+ rawLabel: axis.scale.getLabel(tickValue),
+ tickValue: tickValue
+ };
+ })
+ };
+}
+
+// Large category data calculation is performence sensitive, and ticks and label
+// probably be fetched by multiple times. So we cache the result.
+// axis is created each time during a ec process, so we do not need to clear cache.
+function getListCache(axis, prop) {
+ // Because key can be funciton, and cache size always be small, we use array cache.
+ return inner$6(axis)[prop] || (inner$6(axis)[prop] = []);
+}
+
+function listCacheGet(cache, key) {
+ for (var i = 0; i < cache.length; i++) {
+ if (cache[i].key === key) {
+ return cache[i].value;
+ }
+ }
+}
+
+function listCacheSet(cache, key, value) {
+ cache.push({key: key, value: value});
+ return value;
+}
+
+function makeAutoCategoryInterval(axis, hideLabel) {
+ var cacheKey = hideLabel ? 'tickAutoInterval' : 'autoInterval';
+ var result = inner$6(axis)[cacheKey];
+ if (result != null) {
+ return result;
+ }
+
+ return (
+ inner$6(axis)[cacheKey] = axis.calculateCategoryInterval(hideLabel)
+ );
+}
+
+/**
+ * Calculate interval for category axis ticks and labels.
+ * To get precise result, at least one of `getRotate` and `isHorizontal`
+ * should be implemented in axis.
+ */
+function calculateCategoryInterval(axis, hideLabel) {
+ var params = fetchAutoCategoryIntervalCalculationParams(axis);
+ var labelFormatter = makeLabelFormatter(axis);
+ var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;
+
+ var ordinalScale = axis.scale;
+ var ordinalExtent = ordinalScale.getExtent();
+ // Providing this method is for optimization:
+ // avoid generating a long array by `getTicks`
+ // in large category data case.
+ var tickCount = ordinalScale.count();
+
+ if (ordinalExtent[1] - ordinalExtent[0] < 1) {
+ return 0;
+ }
+
+ var step = 1;
+ // Simple optimization. Empirical value: tick count should less than 40.
+ if (tickCount > 40) {
+ step = Math.max(1, Math.floor(tickCount / 40));
+ }
+ var tickValue = ordinalExtent[0];
+ var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);
+ var unitW = Math.abs(unitSpan * Math.cos(rotation));
+ var unitH = Math.abs(unitSpan * Math.sin(rotation));
+
+ var maxW = 0;
+ var maxH = 0;
+
+ // Caution: Performance sensitive for large category data.
+ // Consider dataZoom, we should make appropriate step to avoid O(n) loop.
+ for (; tickValue <= ordinalExtent[1]; tickValue += step) {
+ var width = 0;
+ var height = 0;
+
+ if (!hideLabel) {
+ // Polar is also calculated in assumptive linear layout here.
+ // Not precise, do not consider align and vertical align
+ // and each distance from axis line yet.
+ var rect = getBoundingRect(
+ labelFormatter(tickValue), params.font, 'center', 'top'
+ );
+ // Magic number
+ width = rect.width * 1.3;
+ height = rect.height * 1.3;
+ }
+
+ // Min size, void long loop.
+ maxW = Math.max(maxW, width, 7);
+ maxH = Math.max(maxH, height, 7);
+ }
+
+ var dw = maxW / unitW;
+ var dh = maxH / unitH;
+ // 0/0 is NaN, 1/0 is Infinity.
+ isNaN(dw) && (dw = Infinity);
+ isNaN(dh) && (dh = Infinity);
+ var interval = Math.max(0, Math.floor(Math.min(dw, dh)));
+
+ var cache = inner$6(axis.model);
+ var lastAutoInterval = cache.lastAutoInterval;
+ var lastTickCount = cache.lastTickCount;
+
+ // Use cache to keep interval stable while moving zoom window,
+ // otherwise the calculated interval might jitter when the zoom
+ // window size is close to the interval-changing size.
+ if (lastAutoInterval != null
+ && lastTickCount != null
+ && Math.abs(lastAutoInterval - interval) <= 1
+ && Math.abs(lastTickCount - tickCount) <= 1
+ // Always choose the bigger one, otherwise the critical
+ // point is not the same when zooming in or zooming out.
+ && lastAutoInterval > interval
+ ) {
+ interval = lastAutoInterval;
+ }
+ // Only update cache if cache not used, otherwise the
+ // changing of interval is too insensitive.
+ else {
+ cache.lastTickCount = tickCount;
+ cache.lastAutoInterval = interval;
+ }
+
+ return interval;
+}
+
+function fetchAutoCategoryIntervalCalculationParams(axis) {
+ var labelModel = axis.getLabelModel();
+ return {
+ axisRotate: axis.getRotate
+ ? axis.getRotate()
+ : (axis.isHorizontal && !axis.isHorizontal())
+ ? 90
+ : 0,
+ labelRotate: labelModel.get('rotate') || 0,
+ font: labelModel.getFont()
+ };
}
-var normalizedExtent = [0, 1];
+function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {
+ var labelFormatter = makeLabelFormatter(axis);
+ var ordinalScale = axis.scale;
+ var ordinalExtent = ordinalScale.getExtent();
+ var labelModel = axis.getLabelModel();
+ var result = [];
+
+ // TODO: axisType: ordinalTime, pick the tick from each month/day/year/...
+
+ var step = Math.max((categoryInterval || 0) + 1, 1);
+ var startTick = ordinalExtent[0];
+ var tickCount = ordinalScale.count();
+
+ // Calculate start tick based on zero if possible to keep label consistent
+ // while zooming and moving while interval > 0. Otherwise the selection
+ // of displayable ticks and symbols probably keep changing.
+ // 3 is empirical value.
+ if (startTick !== 0 && step > 1 && tickCount / step > 2) {
+ startTick = Math.round(Math.ceil(startTick / step) * step);
+ }
+
+ // (1) Only add min max label here but leave overlap checking
+ // to render stage, which also ensure the returned list
+ // suitable for splitLine and splitArea rendering.
+ // (2) Scales except category always contain min max label so
+ // do not need to perform this process.
+ var showMinMax = {
+ min: labelModel.get('showMinLabel'),
+ max: labelModel.get('showMaxLabel')
+ };
+
+ if (showMinMax.min && startTick !== ordinalExtent[0]) {
+ addItem(ordinalExtent[0]);
+ }
+
+ // Optimize: avoid generating large array by `ordinalScale.getTicks()`.
+ var tickValue = startTick;
+ for (; tickValue <= ordinalExtent[1]; tickValue += step) {
+ addItem(tickValue);
+ }
+
+ if (showMinMax.max && tickValue !== ordinalExtent[1]) {
+ addItem(ordinalExtent[1]);
+ }
+
+ function addItem(tVal) {
+ result.push(onlyTick
+ ? tVal
+ : {
+ formattedLabel: labelFormatter(tVal),
+ rawLabel: ordinalScale.getLabel(tVal),
+ tickValue: tVal
+ }
+ );
+ }
+
+ return result;
+}
+
+// When interval is function, the result `false` means ignore the tick.
+// It is time consuming for large category data.
+function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {
+ var ordinalScale = axis.scale;
+ var labelFormatter = makeLabelFormatter(axis);
+ var result = [];
+
+ each$1(ordinalScale.getTicks(), function (tickValue) {
+ var rawLabel = ordinalScale.getLabel(tickValue);
+ if (categoryInterval(tickValue, rawLabel)) {
+ result.push(onlyTick
+ ? tickValue
+ : {
+ formattedLabel: labelFormatter(tickValue),
+ rawLabel: rawLabel,
+ tickValue: tickValue
+ }
+ );
+ }
+ });
+
+ return result;
+}
+
+// Can be null|'auto'|number|function
+function getOptionCategoryInterval(model) {
+ var interval = model.get('interval');
+ return interval == null ? 'auto' : interval;
+}
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+var NORMALIZED_EXTENT = [0, 1];
+
/**
- * @name module:echarts/coord/CartesianAxis
+ * Base class of Axis.
* @constructor
*/
var Axis = function (dim, scale, extent) {
/**
- * Axis dimension. Such as 'x', 'y', 'z', 'angle', 'radius'
+ * Axis dimension. Such as 'x', 'y', 'z', 'angle', 'radius'.
* @type {string}
*/
this.dim = dim;
@@ -31097,12 +33103,6 @@ var Axis = function (dim, scale, extent) {
* @type {boolean}
*/
this.onBand = false;
-
- /**
- * @private
- * @type {number}
- */
- this._labelInterval;
};
Axis.prototype = {
@@ -31177,7 +33177,7 @@ Axis.prototype = {
fixExtentWithBands(extent, scale.count());
}
- return linearMap$1(data, normalizedExtent, extent, clamp);
+ return linearMap(data, NORMALIZED_EXTENT, extent, clamp);
},
/**
@@ -31195,7 +33195,7 @@ Axis.prototype = {
fixExtentWithBands(extent, scale.count());
}
- var t = linearMap$1(coord, extent, normalizedExtent, clamp);
+ var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);
return this.scale.scale(t);
},
@@ -31211,57 +33211,70 @@ Axis.prototype = {
},
/**
- * @return {Array.<number>}
- */
- getTicksCoords: function (alignWithLabel) {
- if (this.onBand && !alignWithLabel) {
- var bands = this.getBands();
- var coords = [];
- for (var i = 0; i < bands.length; i++) {
- coords.push(bands[i][0]);
- }
- if (bands[i - 1]) {
- coords.push(bands[i - 1][1]);
- }
- return coords;
- }
- else {
- return map(this.scale.getTicks(), this.dataToCoord, this);
- }
+ * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,
+ * `axis.getTicksCoords` considers `onBand`, which is used by
+ * `boundaryGap:true` of category axis and splitLine and splitArea.
+ * @param {Object} [opt]
+ * @param {number} [opt.tickModel=axis.model.getModel('axisTick')]
+ * @param {boolean} [opt.clamp] If `true`, the first and the last
+ * tick must be at the axis end points. Otherwise, clip ticks
+ * that outside the axis extent.
+ * @return {Array.<Object>} [{
+ * coord: ...,
+ * tickValue: ...
+ * }, ...]
+ */
+ getTicksCoords: function (opt) {
+ opt = opt || {};
+
+ var tickModel = opt.tickModel || this.getTickModel();
+
+ var result = createAxisTicks(this, tickModel);
+ var ticks = result.ticks;
+
+ var ticksCoords = map(ticks, function (tickValue) {
+ return {
+ coord: this.dataToCoord(tickValue),
+ tickValue: tickValue
+ };
+ }, this);
+
+ var alignWithLabel = tickModel.get('alignWithLabel');
+ fixOnBandTicksCoords(
+ this, ticksCoords, result.tickCategoryInterval, alignWithLabel, opt.clamp
+ );
+
+ return ticksCoords;
},
/**
- * Coords of labels are on the ticks or on the middle of bands
- * @return {Array.<number>}
+ * @return {Array.<Object>} [{
+ * formattedLabel: string,
+ * rawLabel: axis.scale.getLabel(tickValue)
+ * tickValue: number
+ * }, ...]
*/
- getLabelsCoords: function () {
- return map(this.scale.getTicks(), this.dataToCoord, this);
+ getViewLabels: function () {
+ return createAxisLabels(this).labels;
},
/**
- * Get bands.
- *
- * If axis has labels [1, 2, 3, 4]. Bands on the axis are
- * |---1---|---2---|---3---|---4---|.
- *
- * @return {Array}
+ * @return {module:echarts/coord/model/Model}
*/
- // FIXME Situation when labels is on ticks
- getBands: function () {
- var extent = this.getExtent();
- var bands = [];
- var len = this.scale.count();
- var start = extent[0];
- var end = extent[1];
- var span = end - start;
+ getLabelModel: function () {
+ return this.model.getModel('axisLabel');
+ },
- for (var i = 0; i < len; i++) {
- bands.push([
- span * i / len + start,
- span * (i + 1) / len + start
- ]);
- }
- return bands;
+ /**
+ * Notice here we only get the default tick model. For splitLine
+ * or splitArea, we should pass the splitLineModel or splitAreaModel
+ * manually when calling `getTicksCoords`.
+ * In GL, this method may be overrided to:
+ * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`
+ * @return {module:echarts/coord/model/Model}
+ */
+ getTickModel: function () {
+ return this.model.getModel('axisTick');
},
/**
@@ -31294,40 +33307,99 @@ Axis.prototype = {
getRotate: null,
/**
- * Get interval of the axis label.
- * To get precise result, at least one of `getRotate` and `isHorizontal`
- * should be implemented.
- * @return {number}
+ * Only be called in category axis.
+ * Can be overrided, consider other axes like in 3D.
+ * @param {boolean} hideLabel
+ * @return {number} Auto interval for cateogry axis tick and label
*/
- getLabelInterval: function () {
- var labelInterval = this._labelInterval;
- if (!labelInterval) {
- var axisModel = this.model;
- var labelModel = axisModel.getModel('axisLabel');
- labelInterval = labelModel.get('interval');
+ calculateCategoryInterval: function (hideLabel) {
+ return calculateCategoryInterval(this, hideLabel);
+ }
- if (this.type === 'category'
- && (labelInterval == null || labelInterval === 'auto')
- ) {
- labelInterval = getAxisLabelInterval(
- map(this.scale.getTicks(), this.dataToCoord, this),
- axisModel.getFormattedLabels(),
- labelModel.getFont(),
- this.getRotate
- ? this.getRotate()
- : (this.isHorizontal && !this.isHorizontal())
- ? 90
- : 0,
- labelModel.get('rotate')
- );
+};
+
+function fixExtentWithBands(extent, nTick) {
+ var size = extent[1] - extent[0];
+ var len = nTick;
+ var margin = size / len / 2;
+ extent[0] += margin;
+ extent[1] -= margin;
+}
+
+// If axis has labels [1, 2, 3, 4]. Bands on the axis are
+// |---1---|---2---|---3---|---4---|.
+// So the displayed ticks and splitLine/splitArea should between
+// each data item, otherwise cause misleading (e.g., split tow bars
+// of a single data item when there are two bar series).
+// Also consider if tickCategoryInterval > 0 and onBand, ticks and
+// splitLine/spliteArea should layout appropriately corresponding
+// to displayed labels. (So we should not use `getBandWidth` in this
+// case).
+function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) {
+ var ticksLen = ticksCoords.length;
+
+ if (!axis.onBand || alignWithLabel || !ticksLen) {
+ return;
+ }
+
+ var axisExtent = axis.getExtent();
+ var last;
+ if (ticksLen === 1) {
+ ticksCoords[0].coord = axisExtent[0];
+ last = ticksCoords[1] = {coord: axisExtent[0]};
+ }
+ else {
+ var shift = (ticksCoords[1].coord - ticksCoords[0].coord);
+ each$1(ticksCoords, function (ticksItem) {
+ ticksItem.coord -= shift / 2;
+ var tickCategoryInterval = tickCategoryInterval || 0;
+ // Avoid split a single data item when odd interval.
+ if (tickCategoryInterval % 2 > 0) {
+ ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2);
}
+ });
+ last = {coord: ticksCoords[ticksLen - 1].coord + shift};
+ ticksCoords.push(last);
+ }
- this._labelInterval = labelInterval;
- }
- return labelInterval;
+ var inverse = axisExtent[0] > axisExtent[1];
+
+ if (littleThan(ticksCoords[0].coord, axisExtent[0])) {
+ clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift();
+ }
+ if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {
+ ticksCoords.unshift({coord: axisExtent[0]});
+ }
+ if (littleThan(axisExtent[1], last.coord)) {
+ clamp ? (last.coord = axisExtent[1]) : ticksCoords.pop();
+ }
+ if (clamp && littleThan(last.coord, axisExtent[1])) {
+ ticksCoords.push({coord: axisExtent[1]});
}
-};
+ function littleThan(a, b) {
+ return inverse ? a > b : a < b;
+ }
+}
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
/**
* Do not mount those modules on 'src/echarts' for better tree shaking.
@@ -31346,33 +33418,24 @@ each$1([
}
);
-var DatasetModel = extendComponentModel({
-
- type: 'dataset',
-
- /**
- * @protected
- */
- defaultOption: {
-
- // 'row', 'column'
- seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,
-
- // null/'auto': auto detect header, see "module:echarts/data/helper/sourceHelper"
- sourceHeader: null,
-
- dimensions: null,
-
- source: null
- },
-
- optionUpdated: function () {
- detectSourceFormat(this);
- }
-
-});
-
-extendComponentView({type: 'dataset'});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
SeriesModel.extend({
@@ -31391,8 +33454,8 @@ SeriesModel.extend({
},
defaultOption: {
- zlevel: 0, // 一级层叠
- z: 2, // 二级层叠
+ zlevel: 0,
+ z: 2,
coordinateSystem: 'cartesian2d',
legendHoverLink: true,
@@ -31430,22 +33493,21 @@ SeriesModel.extend({
// Disabled if step is true
smooth: false,
smoothMonotone: null,
- // 拐点图形类型
symbol: 'emptyCircle',
- // 拐点图形大小
symbolSize: 4,
- // 拐点图形旋转控制
symbolRotate: null,
- // 是否显示 symbol, 只有在 tooltip hover 的时候显示
showSymbol: true,
- // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略)
- showAllSymbol: false,
+ // `false`: follow the label interval strategy.
+ // `true`: show all symbols.
+ // `'auto'`: If possible, show all symbols, otherwise
+ // follow the label interval strategy.
+ showAllSymbol: 'auto',
- // 是否连接断点
+ // Whether to connect break point.
connectNulls: false,
- // 数据过滤,'average', 'max', 'min', 'sum'
+ // Sampling for large data. Can be: 'average', 'max', 'min', 'sum'.
sampling: 'none',
animationEasing: 'linear',
@@ -31456,6 +33518,25 @@ SeriesModel.extend({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @param {module:echarts/data/List} data
* @param {number} dataIndex
@@ -31479,21 +33560,29 @@ function getDefaultLabel(data, dataIndex) {
}
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @module echarts/chart/helper/Symbol
*/
-function getSymbolSize(data, idx) {
- var symbolSize = data.getItemVisual(idx, 'symbolSize');
- return symbolSize instanceof Array
- ? symbolSize.slice()
- : [+symbolSize, +symbolSize];
-}
-
-function getScale(symbolSize) {
- return [symbolSize[0] / 2, symbolSize[1] / 2];
-}
-
/**
* @constructor
* @alias {module:echarts/chart/helper/Symbol}
@@ -31508,11 +33597,35 @@ function SymbolClz$1(data, idx, seriesScope) {
var symbolProto = SymbolClz$1.prototype;
+/**
+ * @public
+ * @static
+ * @param {module:echarts/data/List} data
+ * @param {number} dataIndex
+ * @return {Array.<number>} [width, height]
+ */
+var getSymbolSize = SymbolClz$1.getSymbolSize = function (data, idx) {
+ var symbolSize = data.getItemVisual(idx, 'symbolSize');
+ return symbolSize instanceof Array
+ ? symbolSize.slice()
+ : [+symbolSize, +symbolSize];
+};
+
+function getScale(symbolSize) {
+ return [symbolSize[0] / 2, symbolSize[1] / 2];
+}
+
function driftSymbol(dx, dy) {
this.parent.drift(dx, dy);
}
-symbolProto._createSymbol = function (symbolType, data, idx, symbolSize) {
+symbolProto._createSymbol = function (
+ symbolType,
+ data,
+ idx,
+ symbolSize,
+ keepAspect
+) {
// Remove paths created before
this.removeAll();
@@ -31525,7 +33638,7 @@ symbolProto._createSymbol = function (symbolType, data, idx, symbolSize) {
// and macOS Sierra, a circle stroke become a rect, no matter what
// the scale is set. So we set width/height as 2. See #4150.
var symbolPath = createSymbol(
- symbolType, -1, -1, 2, 2, color
+ symbolType, -1, -1, 2, 2, color, keepAspect
);
symbolPath.attr({
@@ -31626,7 +33739,8 @@ symbolProto.updateData = function (data, idx, seriesScope) {
var isInit = symbolType !== this._symbolType;
if (isInit) {
- this._createSymbol(symbolType, data, idx, symbolSize);
+ var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');
+ this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);
}
else {
var symbolPath = this.childAt(0);
@@ -31731,6 +33845,19 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) {
elStyle.opacity = opacity;
}
+ var liftZ = data.getItemVisual(idx, 'liftZ');
+ var z2Origin = symbolPath.__z2Origin;
+ if (liftZ != null) {
+ if (z2Origin == null) {
+ symbolPath.__z2Origin = symbolPath.z2;
+ symbolPath.z2 += liftZ;
+ }
+ }
+ else if (z2Origin != null) {
+ symbolPath.z2 = z2Origin;
+ symbolPath.__z2Origin = null;
+ }
+
var useNameLabel = seriesScope && seriesScope.useNameLabel;
setLabelStyle(
@@ -31818,6 +33945,25 @@ symbolProto.fadeOut = function (cb, opt) {
inherits(SymbolClz$1, Group);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @module echarts/chart/helper/SymbolDraw
*/
@@ -31838,11 +33984,13 @@ var symbolDrawProto = SymbolDraw.prototype;
function symbolNeedsDraw(data, point, idx, opt) {
return point && !isNaN(point[0]) && !isNaN(point[1])
&& !(opt.isIgnore && opt.isIgnore(idx))
- // We do not set clipShape on group, because it will
- // cut part of the symbol element shape.
+ // We do not set clipShape on group, because it will cut part of
+ // the symbol element shape. We use the same clip shape here as
+ // the line clip.
&& !(opt.clipShape && !opt.clipShape.contain(point[0], point[1]))
&& data.getItemVisual(idx, 'symbol') !== 'none';
}
+
/**
* Update symbols draw by new data
* @param {module:echarts/data/List} data
@@ -31995,6 +34143,25 @@ function makeSeriesScope(data) {
};
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @param {Object} coordSys
* @param {module:echarts/data/List} data
@@ -32011,18 +34178,25 @@ function prepareDataCoordInfo(coordSys, data, valueOrigin) {
var baseDim = data.mapDimension(baseAxisDim);
var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;
- var stacked = isDimensionStacked(data, valueDim, baseDim);
-
- var dataDimsForPoint = map(coordSys.dimensions, function (coordDim) {
+ var dims = map(coordSys.dimensions, function (coordDim) {
return data.mapDimension(coordDim);
});
+ var stacked;
+ var stackResultDim = data.getCalculationInfo('stackResultDimension');
+ if (stacked |= isDimensionStacked(data, dims[0], dims[1])) { // jshint ignore:line
+ dims[0] = stackResultDim;
+ }
+ if (stacked |= isDimensionStacked(data, dims[1], dims[0])) { // jshint ignore:line
+ dims[1] = stackResultDim;
+ }
+
return {
- dataDimsForPoint: dataDimsForPoint,
+ dataDimsForPoint: dims,
valueStart: valueStart,
valueAxisDim: valueAxisDim,
baseAxisDim: baseAxisDim,
- stacked: stacked,
+ stacked: !!stacked,
valueDim: valueDim,
baseDim: baseDim,
baseDataOffset: baseDataOffset,
@@ -32073,6 +34247,25 @@ function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {
return coordSys.dataToPoint(stackedData);
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// var arrayDiff = require('zrender/src/core/arrayDiff');
// 'zrender/src/core/arrayDiff' has been used before, but it did
// not do well in performance when roam with fixed dataZoom window.
@@ -32253,6 +34446,25 @@ var lineAnimationDiff = function (
};
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// Poly path support NaN point
var vec2Min = min;
@@ -32624,6 +34836,25 @@ var Polygon$1 = Path.extend({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// FIXME step not support polar
function isPointsSame(points1, points2) {
@@ -32675,7 +34906,7 @@ function getStackedOnPoints(coordSys, data, dataCoordInfo) {
return points;
}
-function createGridClipShape(cartesian, hasAnimation, seriesModel) {
+function createGridClipShape(cartesian, hasAnimation, forSymbol, seriesModel) {
var xExtent = getAxisExtentWithGap(cartesian.getAxis('x'));
var yExtent = getAxisExtentWithGap(cartesian.getAxis('y'));
var isHorizontal = cartesian.getBaseAxis().isHorizontal();
@@ -32684,16 +34915,27 @@ function createGridClipShape(cartesian, hasAnimation, seriesModel) {
var y = Math.min(yExtent[0], yExtent[1]);
var width = Math.max(xExtent[0], xExtent[1]) - x;
var height = Math.max(yExtent[0], yExtent[1]) - y;
- var lineWidth = seriesModel.get('lineStyle.width') || 2;
- // Expand clip shape to avoid clipping when line value exceeds axis
- var expandSize = seriesModel.get('clipOverflow') ? lineWidth / 2 : Math.max(width, height);
- if (isHorizontal) {
- y -= expandSize;
- height += expandSize * 2;
+
+ // Avoid float number rounding error for symbol on the edge of axis extent.
+ // See #7913 and `test/dataZoom-clip.html`.
+ if (forSymbol) {
+ x -= 0.5;
+ width += 0.5;
+ y -= 0.5;
+ height += 0.5;
}
else {
- x -= expandSize;
- width += expandSize * 2;
+ var lineWidth = seriesModel.get('lineStyle.width') || 2;
+ // Expand clip shape to avoid clipping when line value exceeds axis
+ var expandSize = seriesModel.get('clipOverflow') ? lineWidth / 2 : Math.max(width, height);
+ if (isHorizontal) {
+ y -= expandSize;
+ height += expandSize * 2;
+ }
+ else {
+ x -= expandSize;
+ width += expandSize * 2;
+ }
}
var clipPath = new Rect({
@@ -32718,21 +34960,28 @@ function createGridClipShape(cartesian, hasAnimation, seriesModel) {
return clipPath;
}
-function createPolarClipShape(polar, hasAnimation, seriesModel) {
+function createPolarClipShape(polar, hasAnimation, forSymbol, seriesModel) {
var angleAxis = polar.getAngleAxis();
var radiusAxis = polar.getRadiusAxis();
- var radiusExtent = radiusAxis.getExtent();
+ var radiusExtent = radiusAxis.getExtent().slice();
+ radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();
var angleExtent = angleAxis.getExtent();
var RADIAN = Math.PI / 180;
+ // Avoid float number rounding error for symbol on the edge of axis extent.
+ if (forSymbol) {
+ radiusExtent[0] -= 0.5;
+ radiusExtent[1] += 0.5;
+ }
+
var clipPath = new Sector({
shape: {
- cx: polar.cx,
- cy: polar.cy,
- r0: radiusExtent[0],
- r: radiusExtent[1],
+ cx: round$1(polar.cx, 1),
+ cy: round$1(polar.cy, 1),
+ r0: round$1(radiusExtent[0], 1),
+ r: round$1(radiusExtent[1], 1),
startAngle: -angleExtent[0] * RADIAN,
endAngle: -angleExtent[1] * RADIAN,
clockwise: angleAxis.inverse
@@ -32751,10 +35000,10 @@ function createPolarClipShape(polar, hasAnimation, seriesModel) {
return clipPath;
}
-function createClipShape(coordSys, hasAnimation, seriesModel) {
+function createClipShape(coordSys, hasAnimation, forSymbol, seriesModel) {
return coordSys.type === 'polar'
- ? createPolarClipShape(coordSys, hasAnimation, seriesModel)
- : createGridClipShape(coordSys, hasAnimation, seriesModel);
+ ? createPolarClipShape(coordSys, hasAnimation, forSymbol, seriesModel)
+ : createGridClipShape(coordSys, hasAnimation, forSymbol, seriesModel);
}
function turnPointsIntoStep(points, coordSys, stepTurnAt) {
@@ -32890,6 +35139,69 @@ function getVisualGradient(data, coordSys) {
return gradient;
}
+function getIsIgnoreFunc(seriesModel, data, coordSys) {
+ var showAllSymbol = seriesModel.get('showAllSymbol');
+ var isAuto = showAllSymbol === 'auto';
+
+ if (showAllSymbol && !isAuto) {
+ return;
+ }
+
+ var categoryAxis = coordSys.getAxesByScale('ordinal')[0];
+ if (!categoryAxis) {
+ return;
+ }
+
+ // Note that category label interval strategy might bring some weird effect
+ // in some scenario: users may wonder why some of the symbols are not
+ // displayed. So we show all symbols as possible as we can.
+ if (isAuto
+ // Simplify the logic, do not determine label overlap here.
+ && canShowAllSymbolForCategory(categoryAxis, data)
+ ) {
+ return;
+ }
+
+ // Otherwise follow the label interval strategy on category axis.
+ var categoryDataDim = data.mapDimension(categoryAxis.dim);
+ var labelMap = {};
+
+ each$1(categoryAxis.getViewLabels(), function (labelItem) {
+ labelMap[labelItem.tickValue] = 1;
+ });
+
+ return function (dataIndex) {
+ return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));
+ };
+}
+
+function canShowAllSymbolForCategory(categoryAxis, data) {
+ // In mose cases, line is monotonous on category axis, and the label size
+ // is close with each other. So we check the symbol size and some of the
+ // label size alone with the category axis to estimate whether all symbol
+ // can be shown without overlap.
+ var axisExtent = categoryAxis.getExtent();
+ var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();
+ isNaN(availSize) && (availSize = 0); // 0/0 is NaN.
+
+ // Sampling some points, max 5.
+ var dataLen = data.count();
+ var step = Math.max(1, Math.round(dataLen / 5));
+ for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {
+ if (SymbolClz$1.getSymbolSize(
+ data, dataIndex
+ // Only for cartesian, where `isHorizontal` exists.
+ )[categoryAxis.isHorizontal() ? 1 : 0]
+ // Empirical number
+ * 1.5 > availSize
+ ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
Chart.extend({
type: 'line',
@@ -32933,8 +35245,8 @@ Chart.extend({
var showSymbol = seriesModel.get('showSymbol');
- var isSymbolIgnore = showSymbol && !isCoordSysPolar && !seriesModel.get('showAllSymbol')
- && this._getSymbolIgnoreFunc(data, coordSys);
+ var isIgnoreFunc = showSymbol && !isCoordSysPolar
+ && getIsIgnoreFunc(seriesModel, data, coordSys);
// Remove temporary symbols
var oldData = this._data;
@@ -32959,8 +35271,8 @@ Chart.extend({
!(polyline && prevCoordSys.type === coordSys.type && step === this._step)
) {
showSymbol && symbolDraw.updateData(data, {
- isIgnore: isSymbolIgnore,
- clipShape: createClipShape(coordSys, false, seriesModel)
+ isIgnore: isIgnoreFunc,
+ clipShape: createClipShape(coordSys, false, true, seriesModel)
});
if (step) {
@@ -32976,7 +35288,7 @@ Chart.extend({
coordSys, hasAnimation
);
}
- lineGroup.setClipPath(createClipShape(coordSys, true, seriesModel));
+ lineGroup.setClipPath(createClipShape(coordSys, true, false, seriesModel));
}
else {
if (isAreaChart && !polygon) {
@@ -32992,16 +35304,14 @@ Chart.extend({
polygon = this._polygon = null;
}
- var coordSysClipShape = createClipShape(coordSys, false, seriesModel);
-
// Update clipPath
- lineGroup.setClipPath(coordSysClipShape);
+ lineGroup.setClipPath(createClipShape(coordSys, false, false, seriesModel));
// Always update, or it is wrong in the case turning on legend
// because points are not changed
showSymbol && symbolDraw.updateData(data, {
- isIgnore: isSymbolIgnore,
- clipShape: coordSysClipShape
+ isIgnore: isIgnoreFunc,
+ clipShape: createClipShape(coordSys, false, true, seriesModel)
});
// Stop symbol animation and sync with line points
@@ -33211,16 +35521,6 @@ Chart.extend({
this._polygon = polygon;
return polygon;
},
- /**
- * @private
- */
- _getSymbolIgnoreFunc: function (data, coordSys) {
- var categoryAxis = coordSys.getAxesByScale('ordinal')[0];
- // `getLabelInterval` is provided by echarts/component/axis
- if (categoryAxis && categoryAxis.isLabelIgnored) {
- return bind(categoryAxis.isLabelIgnored, categoryAxis);
- }
- },
/**
* @private
@@ -33322,21 +35622,46 @@ Chart.extend({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+
var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) {
// Encoding visual for all series include which is filtered for legend drawing
return {
seriesType: seriesType,
+
+ // For legend.
performRawSeries: true,
+
reset: function (seriesModel, ecModel, api) {
var data = seriesModel.getData();
var symbolType = seriesModel.get('symbol') || defaultSymbolType;
var symbolSize = seriesModel.get('symbolSize');
+ var keepAspect = seriesModel.get('symbolKeepAspect');
data.setVisual({
legendSymbol: legendSymbol || symbolType,
symbol: symbolType,
- symbolSize: symbolSize
+ symbolSize: symbolSize,
+ symbolKeepAspect: keepAspect
});
// Only visible series has each data be visual encoded
@@ -33357,7 +35682,11 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) {
if (data.hasItemOption) {
var itemModel = data.getItemModel(idx);
var itemSymbolType = itemModel.getShallow('symbol', true);
- var itemSymbolSize = itemModel.getShallow('symbolSize', true);
+ var itemSymbolSize = itemModel.getShallow('symbolSize',
+ true);
+ var itemSymbolKeepAspect =
+ itemModel.getShallow('symbolKeepAspect',true);
+
// If has item symbol
if (itemSymbolType != null) {
data.setItemVisual(idx, 'symbol', itemSymbolType);
@@ -33366,6 +35695,10 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) {
// PENDING Transform symbolSize ?
data.setItemVisual(idx, 'symbolSize', itemSymbolSize);
}
+ if (itemSymbolKeepAspect != null) {
+ data.setItemVisual(idx, 'symbolKeepAspect',
+ itemSymbolKeepAspect);
+ }
}
}
@@ -33374,6 +35707,25 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) {
};
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var pointsLayout = function (seriesType) {
return {
seriesType: seriesType,
@@ -33395,11 +35747,12 @@ var pointsLayout = function (seriesType) {
}).slice(0, 2);
var dimLen = dims.length;
+ var stackResultDim = data.getCalculationInfo('stackResultDimension');
if (isDimensionStacked(data, dims[0], dims[1])) {
- dims[0] = data.getCalculationInfo('stackResultDimension');
+ dims[0] = stackResultDim;
}
if (isDimensionStacked(data, dims[1], dims[0])) {
- dims[1] = data.getCalculationInfo('stackResultDimension');
+ dims[1] = stackResultDim;
}
function progress(params, data) {
@@ -33410,12 +35763,12 @@ var pointsLayout = function (seriesType) {
var point;
if (dimLen === 1) {
- var x = data.get(dims[0], i, true);
+ var x = data.get(dims[0], i);
point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut);
}
else {
- var x = tmpIn[0] = data.get(dims[0], i, true);
- var y = tmpIn[1] = data.get(dims[1], i, true);
+ var x = tmpIn[0] = data.get(dims[0], i);
+ var y = tmpIn[1] = data.get(dims[1], i);
// Also {Array.<number>}, not undefined to avoid if...else... statement
point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut);
}
@@ -33437,6 +35790,26 @@ var pointsLayout = function (seriesType) {
};
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+
var samplers = {
average: function (frame) {
var sum = 0;
@@ -33463,14 +35836,16 @@ var samplers = {
for (var i = 0; i < frame.length; i++) {
frame[i] > max && (max = frame[i]);
}
- return max;
+ // NaN will cause illegal axis extent.
+ return isFinite(max) ? max : NaN;
},
min: function (frame) {
var min = Infinity;
for (var i = 0; i < frame.length; i++) {
frame[i] < min && (min = frame[i]);
}
- return min;
+ // NaN will cause illegal axis extent.
+ return isFinite(min) ? min : NaN;
},
// TODO
// Median
@@ -33485,7 +35860,11 @@ var indexSampler = function (frame, value) {
var dataSample = function (seriesType) {
return {
+
seriesType: seriesType,
+
+ modifyOutputEnd: true,
+
reset: function (seriesModel, ecModel, api) {
var data = seriesModel.getData();
var sampling = seriesModel.get('sampling');
@@ -33507,8 +35886,9 @@ var dataSample = function (seriesType) {
sampler = sampling;
}
if (sampler) {
+ // Only support sample the first dim mapped from value axis.
seriesModel.setData(data.downSample(
- valueAxis.dim, 1 / rate, sampler, indexSampler
+ data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler
));
}
}
@@ -33517,6 +35897,25 @@ var dataSample = function (seriesType) {
};
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Cartesian coordinate system
* @module echarts/coord/Cartesian
@@ -33624,6 +36023,26 @@ Cartesian.prototype = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+
function Cartesian2D(name) {
Cartesian.call(this, name);
@@ -33694,15 +36113,19 @@ Cartesian2D.prototype = {
* @return {Array.<number>}
*/
clampData: function (data, out) {
- var xAxisExtent = this.getAxis('x').scale.getExtent();
- var yAxisExtent = this.getAxis('y').scale.getExtent();
+ var xScale = this.getAxis('x').scale;
+ var yScale = this.getAxis('y').scale;
+ var xAxisExtent = xScale.getExtent();
+ var yAxisExtent = yScale.getExtent();
+ var x = xScale.parse(data[0]);
+ var y = yScale.parse(data[1]);
out = out || [];
out[0] = Math.min(
- Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), data[0]),
+ Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x),
Math.max(xAxisExtent[0], xAxisExtent[1])
);
out[1] = Math.min(
- Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), data[1]),
+ Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y),
Math.max(yAxisExtent[0], yAxisExtent[1])
);
@@ -33735,6 +36158,25 @@ Cartesian2D.prototype = {
inherits(Cartesian2D, Cartesian);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Extend axis 2d
* @constructor module:echarts/coord/cartesian/Axis2D
@@ -33775,11 +36217,14 @@ Axis2D.prototype = {
* Index of axis, can be used as key
*/
index: 0,
+
/**
- * If axis is on the zero position of the other axis
- * @type {boolean}
+ * Implemented in <module:echarts/coord/cartesian/Grid>.
+ * @return {Array.<module:echarts/coord/cartesian/Axis2D>}
+ * If not on zero of other axis, return null/undefined.
+ * If no axes, return an empty array.
*/
- onZero: false,
+ getAxesOnZeroOf: null,
/**
* Axis model
@@ -33813,21 +36258,6 @@ Axis2D.prototype = {
},
/**
- * If label is ignored.
- * Automatically used when axis is category and label can not be all shown
- * @param {number} idx
- * @return {boolean}
- */
- isLabelIgnored: function (idx) {
- if (this.type === 'category') {
- var labelInterval = this.getLabelInterval();
- return ((typeof labelInterval === 'function')
- && !labelInterval(idx, this.scale.getLabel(idx)))
- || idx % (labelInterval + 1);
- }
- },
-
- /**
* @override
*/
pointToData: function (point, clamp) {
@@ -33854,31 +36284,52 @@ Axis2D.prototype = {
inherits(Axis2D, Axis);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var defaultOption = {
show: true,
- zlevel: 0, // 一级层叠
- z: 0, // 二级层叠
- // 反向坐标轴
+ zlevel: 0,
+ z: 0,
+ // Inverse the axis.
inverse: false,
- // 坐标轴名字,默认为空
+ // Axis name displayed.
name: '',
- // 坐标轴名字位置,支持'start' | 'middle' | 'end'
+ // 'start' | 'middle' | 'end'
nameLocation: 'end',
- // 坐标轴名字旋转,degree。
- nameRotate: null, // Adapt to axis rotate, when nameLocation is 'middle'.
+ // By degree. By defualt auto rotate by nameLocation.
+ nameRotate: null,
nameTruncate: {
maxWidth: null,
ellipsis: '...',
placeholder: '.'
},
- // 坐标轴文字样式,默认取全局样式
+ // Use global text style by default.
nameTextStyle: {},
- // 文字与轴线距离
+ // The gap between axisName and axisLine.
nameGap: 15,
- silent: false, // Default false to support tooltip.
- triggerEvent: false, // Default false to avoid legacy user event listener fail.
+ // Default `false` to support tooltip.
+ silent: false,
+ // Default `false` to avoid legacy user event listener fail.
+ triggerEvent: false,
tooltip: {
show: false
@@ -33886,64 +36337,52 @@ var defaultOption = {
axisPointer: {},
- // 坐标轴线
axisLine: {
- // 默认显示,属性show控制显示与否
show: true,
onZero: true,
onZeroAxisIndex: null,
- // 属性lineStyle控制线条样式
lineStyle: {
color: '#333',
width: 1,
type: 'solid'
},
- // 坐标轴两端的箭头
+ // The arrow at both ends the the axis.
symbol: ['none', 'none'],
symbolSize: [10, 15]
},
- // 坐标轴小标记
axisTick: {
- // 属性show控制显示与否,默认显示
show: true,
- // 控制小标记是否在grid里
+ // Whether axisTick is inside the grid or outside the grid.
inside: false,
- // 属性length控制线长
+ // The length of axisTick.
length: 5,
- // 属性lineStyle控制线条样式
lineStyle: {
width: 1
}
},
- // 坐标轴文本标签,详见axis.axisLabel
axisLabel: {
show: true,
- // 控制文本标签是否在grid里
+ // Whether axisLabel is inside the grid or outside the grid.
inside: false,
rotate: 0,
- showMinLabel: null, // true | false | null (auto)
- showMaxLabel: null, // true | false | null (auto)
+ // true | false | null/undefined (auto)
+ showMinLabel: null,
+ // true | false | null/undefined (auto)
+ showMaxLabel: null,
margin: 8,
// formatter: null,
- // 其余属性默认使用全局文本样式,详见TEXTSTYLE
fontSize: 12
},
- // 分隔线
splitLine: {
- // 默认显示,属性show控制显示与否
show: true,
- // 属性lineStyle(详见lineStyle)控制线条样式
lineStyle: {
color: ['#ccc'],
width: 1,
type: 'solid'
}
},
- // 分隔区域
splitArea: {
- // 默认不显示,属性show控制显示与否
show: false,
- // 属性areaStyle(详见areaStyle)控制区域样式
areaStyle: {
color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)']
}
@@ -33953,7 +36392,7 @@ var defaultOption = {
var axisDefault = {};
axisDefault.categoryAxis = merge({
- // 类目起始和结束两端空白策略
+ // The gap at both ends of the axis. For categoryAxis, boolean.
boundaryGap: true,
// Set false to faster category collection.
// Only usefull in the case like: category is
@@ -33969,43 +36408,61 @@ axisDefault.categoryAxis = merge({
splitLine: {
show: false
},
- // 坐标轴小标记
axisTick: {
// If tick is align with label when boundaryGap is true
alignWithLabel: false,
interval: 'auto'
},
- // 坐标轴文本标签,详见axis.axisLabel
axisLabel: {
interval: 'auto'
}
}, defaultOption);
axisDefault.valueAxis = merge({
- // 数值起始和结束两端空白策略
+ // The gap at both ends of the axis. For value axis, [GAP, GAP], where
+ // `GAP` can be an absolute pixel number (like `35`), or percent (like `'30%'`)
boundaryGap: [0, 0],
// TODO
// min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]
- // 最小值, 设置成 'dataMin' 则从数据中计算最小值
+ // Min value of the axis. can be:
+ // + a number
+ // + 'dataMin': use the min value in data.
+ // + null/undefined: auto decide min value (consider pretty look and boundaryGap).
// min: null,
- // 最大值,设置成 'dataMax' 则从数据中计算最大值
+
+ // Max value of the axis. can be:
+ // + a number
+ // + 'dataMax': use the max value in data.
+ // + null/undefined: auto decide max value (consider pretty look and boundaryGap).
// max: null,
+
// Readonly prop, specifies start value of the range when using data zoom.
// rangeStart: null
+
// Readonly prop, specifies end value of the range when using data zoom.
// rangeEnd: null
- // 脱离0值比例,放大聚焦到最终_min,_max区间
+
+ // Optional value can be:
+ // + `false`: always include value 0.
+ // + `true`: the extent do not consider value 0.
// scale: false,
- // 分割段数,默认为5
+
+ // AxisTick and axisLabel and splitLine are caculated based on splitNumber.
splitNumber: 5
- // Minimum interval
+
+ // Interval specifies the span of the ticks is mandatorily.
+ // interval: null
+
+ // Specify min interval when auto calculate tick interval.
// minInterval: null
+
+ // Specify max interval when auto calculate tick interval.
// maxInterval: null
+
}, defaultOption);
-// FIXME
axisDefault.timeAxis = defaults({
scale: true,
min: 'dataMin',
@@ -34017,6 +36474,25 @@ axisDefault.logAxis = defaults({
logBase: 10
}, axisDefault.valueAxis);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// FIXME axisType is fixed ?
var AXIS_TYPES = ['value', 'category', 'time', 'log'];
@@ -34068,10 +36544,14 @@ var axisModelCreator = function (axisName, BaseAxisModelClass, axisTypeDefaulter
* Should not be called before all of 'getInitailData' finished.
* Because categories are collected during initializing data.
*/
- getCategories: function () {
+ getCategories: function (rawData) {
+ var option = this.option;
// FIXME
// warning if called before all of 'getInitailData' finished.
- if (this.option.type === 'category') {
+ if (option.type === 'category') {
+ if (rawData) {
+ return option.data;
+ }
return this.__ordinalMeta.categories;
}
},
@@ -34097,6 +36577,25 @@ var axisModelCreator = function (axisName, BaseAxisModelClass, axisTypeDefaulter
);
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var AxisModel = ComponentModel.extend({
type: 'cartesian2dAxis',
@@ -34162,6 +36661,25 @@ var extraOption = {
axisModelCreator('x', AxisModel, getAxisType, extraOption);
axisModelCreator('y', AxisModel, getAxisType, extraOption);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// Grid 是在有直角坐标系的时候必须要存在的
// 所以这里也要被 Cartesian2D 依赖
@@ -34196,6 +36714,25 @@ ComponentModel.extend({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Grid is a region which contains at most 4 cartesian systems
*
@@ -34203,10 +36740,6 @@ ComponentModel.extend({
*/
// Depends on GridModel, AxisModel, which performs preprocess.
-var each$6 = each$1;
-var ifAxisCrossZero$1 = ifAxisCrossZero;
-var niceScaleExtent$1 = niceScaleExtent;
-
/**
* Check if the axis is used in the specified grid
* @inner
@@ -34215,40 +36748,6 @@ function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {
return axisModel.getCoordSysModel() === gridModel;
}
-function rotateTextRect(textRect, rotate) {
- var rotateRadians = rotate * Math.PI / 180;
- var boundingBox = textRect.plain();
- var beforeWidth = boundingBox.width;
- var beforeHeight = boundingBox.height;
- var afterWidth = beforeWidth * Math.cos(rotateRadians) + beforeHeight * Math.sin(rotateRadians);
- var afterHeight = beforeWidth * Math.sin(rotateRadians) + beforeHeight * Math.cos(rotateRadians);
- var rotatedRect = new BoundingRect(boundingBox.x, boundingBox.y, afterWidth, afterHeight);
-
- return rotatedRect;
-}
-
-function getLabelUnionRect(axis) {
- var axisModel = axis.model;
- var labels = axisModel.get('axisLabel.show') ? axisModel.getFormattedLabels() : [];
- var axisLabelModel = axisModel.getModel('axisLabel');
- var rect;
- var step = 1;
- var labelCount = labels.length;
- if (labelCount > 40) {
- // Simple optimization for large amount of labels
- step = Math.ceil(labelCount / 40);
- }
- for (var i = 0; i < labelCount; i += step) {
- if (!axis.isLabelIgnored(i)) {
- var unrotatedSingleRect = axisLabelModel.getTextRect(labels[i]);
- var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);
-
- rect ? rect.union(singleRect) : (rect = singleRect);
- }
- }
- return rect;
-}
-
function Grid(gridModel, ecModel, api) {
/**
* @type {Object.<string, module:echarts/coord/cartesian/Cartesian2D>}
@@ -34295,16 +36794,16 @@ gridProto.update = function (ecModel, api) {
this._updateScale(ecModel, this.model);
- each$6(axesMap.x, function (xAxis) {
- niceScaleExtent$1(xAxis.scale, xAxis.model);
+ each$1(axesMap.x, function (xAxis) {
+ niceScaleExtent(xAxis.scale, xAxis.model);
});
- each$6(axesMap.y, function (yAxis) {
- niceScaleExtent$1(yAxis.scale, yAxis.model);
+ each$1(axesMap.y, function (yAxis) {
+ niceScaleExtent(yAxis.scale, yAxis.model);
});
- each$6(axesMap.x, function (xAxis) {
+ each$1(axesMap.x, function (xAxis) {
fixAxisOnZero(axesMap, 'y', xAxis);
});
- each$6(axesMap.y, function (yAxis) {
+ each$1(axesMap.y, function (yAxis) {
fixAxisOnZero(axesMap, 'x', yAxis);
});
@@ -34314,44 +36813,45 @@ gridProto.update = function (ecModel, api) {
};
function fixAxisOnZero(axesMap, otherAxisDim, axis) {
+
+ axis.getAxesOnZeroOf = function () {
+ // TODO: onZero of multiple axes.
+ return otherAxis ? [otherAxis] : [];
+ };
+
// onZero can not be enabled in these two situations:
// 1. When any other axis is a category axis.
// 2. When no axis is cross 0 point.
- var axes = axesMap[otherAxisDim];
+ var otherAxes = axesMap[otherAxisDim];
- if (!axis.onZero) {
+ var otherAxis;
+ var axisModel = axis.model;
+ var onZero = axisModel.get('axisLine.onZero');
+ var onZeroAxisIndex = axisModel.get('axisLine.onZeroAxisIndex');
+
+ if (!onZero) {
return;
}
- var onZeroAxisIndex = axis.onZeroAxisIndex;
-
// If target axis is specified.
if (onZeroAxisIndex != null) {
- var otherAxis = axes[onZeroAxisIndex];
- if (otherAxis && canNotOnZeroToAxis(otherAxis)) {
- axis.onZero = false;
+ if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {
+ otherAxis = otherAxes[onZeroAxisIndex];
}
return;
}
- for (var idx in axes) {
- if (axes.hasOwnProperty(idx)) {
- var otherAxis = axes[idx];
- if (otherAxis && !canNotOnZeroToAxis(otherAxis)) {
- onZeroAxisIndex = +idx;
- break;
- }
+ // Find the first available other axis.
+ for (var idx in otherAxes) {
+ if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx])) {
+ otherAxis = otherAxes[idx];
+ break;
}
}
-
- if (onZeroAxisIndex == null) {
- axis.onZero = false;
- }
- axis.onZeroAxisIndex = onZeroAxisIndex;
}
-function canNotOnZeroToAxis(axis) {
- return axis.type === 'category' || axis.type === 'time' || !ifAxisCrossZero$1(axis);
+function canOnZeroToAxis(axis) {
+ return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);
}
/**
@@ -34375,9 +36875,9 @@ gridProto.resize = function (gridModel, api, ignoreContainLabel) {
// Minus label size
if (!ignoreContainLabel && gridModel.get('containLabel')) {
- each$6(axesList, function (axis) {
+ each$1(axesList, function (axis) {
if (!axis.model.get('axisLabel.inside')) {
- var labelUnionRect = getLabelUnionRect(axis);
+ var labelUnionRect = estimateLabelUnionRect(axis);
if (labelUnionRect) {
var dim = axis.isHorizontal() ? 'height' : 'width';
var margin = axis.model.get('axisLabel.margin');
@@ -34396,7 +36896,7 @@ gridProto.resize = function (gridModel, api, ignoreContainLabel) {
}
function adjustAxes() {
- each$6(axesList, function (axis) {
+ each$1(axesList, function (axis) {
var isHorizontal = axis.isHorizontal();
var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];
var idx = axis.inverse ? 1 : 0;
@@ -34578,8 +37078,8 @@ gridProto._initCartesian = function (gridModel, ecModel, api) {
this._axesMap = axesMap;
/// Create cartesian2d
- each$6(axesMap.x, function (xAxis, xAxisIndex) {
- each$6(axesMap.y, function (yAxis, yAxisIndex) {
+ each$1(axesMap.x, function (xAxis, xAxisIndex) {
+ each$1(axesMap.y, function (yAxis, yAxisIndex) {
var key = 'x' + xAxisIndex + 'y' + yAxisIndex;
var cartesian = new Cartesian2D(key);
@@ -34634,9 +37134,6 @@ gridProto._initCartesian = function (gridModel, ecModel, api) {
axis.onBand = isCategory && axisModel.get('boundaryGap');
axis.inverse = axisModel.get('inverse');
- axis.onZero = axisModel.get('axisLine.onZero');
- axis.onZeroAxisIndex = axisModel.get('axisLine.onZeroAxisIndex');
-
// Inject axis into axisModel
axisModel.axis = axis;
@@ -34694,7 +37191,7 @@ gridProto._updateScale = function (ecModel, gridModel) {
}, this);
function unionExtent(data, axis, seriesModel) {
- each$6(data.mapDimension(axis.dim, true), function (dim) {
+ each$1(data.mapDimension(axis.dim, true), function (dim) {
axis.scale.unionExtentFromData(data, dim);
});
}
@@ -34708,7 +37205,7 @@ gridProto.getTooltipAxes = function (dim) {
var baseAxes = [];
var otherAxes = [];
- each$6(this.getCartesians(), function (cartesian) {
+ each$1(this.getCartesians(), function (cartesian) {
var baseAxis = (dim != null && dim !== 'auto')
? cartesian.getAxis(dim) : cartesian.getBaseAxis();
var otherAxis = cartesian.getOtherAxis(baseAxis);
@@ -34827,6 +37324,25 @@ Grid.dimensions = Grid.prototype.dimensions = Cartesian2D.prototype.dimensions;
CoordinateSystemManager.register('cartesian2d', Grid);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var PI$2 = Math.PI;
function makeAxisEventDataBase(axisModel) {
@@ -34872,8 +37388,6 @@ function makeAxisEventDataBase(axisModel) {
* @param {string} [opt.axisName] default get from axisModel.
* @param {number} [opt.axisNameAvailableWidth]
* @param {number} [opt.labelRotate] by degree, default get from axisModel.
- * @param {number} [opt.labelInterval] Default label interval when label
- * interval from model is null or 'auto'.
* @param {number} [opt.strokeContainThreshold] Default label interval when label
* @param {number} [opt.nameTruncateMaxWidth]
*/
@@ -35361,48 +37875,6 @@ function isNameLocationCenter(nameLocation) {
return nameLocation === 'middle' || nameLocation === 'center';
}
-/**
- * @static
- */
-var ifIgnoreOnTick$1 = AxisBuilder.ifIgnoreOnTick = function (
- axis,
- i,
- interval,
- ticksCnt,
- showMinLabel,
- showMaxLabel
-) {
- if (i === 0 && showMinLabel || i === ticksCnt - 1 && showMaxLabel) {
- return false;
- }
-
- // FIXME
- // Have not consider label overlap (if label is too long) yet.
-
- var rawTick;
- var scale$$1 = axis.scale;
- return scale$$1.type === 'ordinal'
- && (
- typeof interval === 'function'
- ? (
- rawTick = scale$$1.getTicks()[i],
- !interval(rawTick, scale$$1.getLabel(rawTick))
- )
- : i % (interval + 1)
- );
-};
-
-/**
- * @static
- */
-var getInterval$1 = AxisBuilder.getInterval = function (model, labelInterval) {
- var interval = model.get('interval');
- if (interval == null || interval == 'auto') {
- interval = labelInterval;
- }
- return interval;
-};
-
function buildAxisTick(axisBuilder, axisModel, opt) {
var axis = axisModel.axis;
@@ -35415,14 +37887,7 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
var lineStyleModel = tickModel.getModel('lineStyle');
var tickLen = tickModel.get('length');
- var tickInterval = getInterval$1(tickModel, opt.labelInterval);
- var ticksCoords = axis.getTicksCoords(tickModel.get('alignWithLabel'));
- // FIXME
- // Corresponds to ticksCoords ?
- var ticks = axis.scale.getTicks();
-
- var showMinLabel = axisModel.get('axisLabel.showMinLabel');
- var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
+ var ticksCoords = axis.getTicksCoords();
var pt1 = [];
var pt2 = [];
@@ -35430,17 +37895,8 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
var tickEls = [];
- var ticksCnt = ticksCoords.length;
- for (var i = 0; i < ticksCnt; i++) {
- // Only ordinal scale support tick interval
- if (ifIgnoreOnTick$1(
- axis, i, tickInterval, ticksCnt,
- showMinLabel, showMaxLabel
- )) {
- continue;
- }
-
- var tickCoord = ticksCoords[i];
+ for (var i = 0; i < ticksCoords.length; i++) {
+ var tickCoord = ticksCoords[i].coord;
pt1[0] = tickCoord;
pt1[1] = 0;
@@ -35454,7 +37910,7 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
// Tick line, Not use group transform to have better line draw
var tickEl = new Line(subPixelOptimizeLine({
// Id for animation
- anid: 'tick_' + ticks[i],
+ anid: 'tick_' + ticksCoords[i].tickValue,
shape: {
x1: pt1[0],
@@ -35488,8 +37944,7 @@ function buildAxisLabel(axisBuilder, axisModel, opt) {
var labelModel = axisModel.getModel('axisLabel');
var labelMargin = labelModel.get('margin');
- var ticks = axis.scale.getTicks();
- var labels = axisModel.getFormattedLabels();
+ var labels = axis.getViewLabels();
// Special label rotate.
var labelRotation = (
@@ -35497,43 +37952,36 @@ function buildAxisLabel(axisBuilder, axisModel, opt) {
) * PI$2 / 180;
var labelLayout = innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);
- var categoryData = axisModel.getCategories();
+ var rawCategoryData = axisModel.getCategories(true);
var labelEls = [];
var silent = isSilent(axisModel);
var triggerEvent = axisModel.get('triggerEvent');
- var showMinLabel = axisModel.get('axisLabel.showMinLabel');
- var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
-
- each$1(ticks, function (tickVal, index) {
- if (ifIgnoreOnTick$1(
- axis, index, opt.labelInterval, ticks.length,
- showMinLabel, showMaxLabel
- )) {
- return;
- }
+ each$1(labels, function (labelItem, index) {
+ var tickValue = labelItem.tickValue;
+ var formattedLabel = labelItem.formattedLabel;
+ var rawLabel = labelItem.rawLabel;
var itemLabelModel = labelModel;
- if (categoryData && categoryData[tickVal] && categoryData[tickVal].textStyle) {
+ if (rawCategoryData && rawCategoryData[tickValue] && rawCategoryData[tickValue].textStyle) {
itemLabelModel = new Model(
- categoryData[tickVal].textStyle, labelModel, axisModel.ecModel
+ rawCategoryData[tickValue].textStyle, labelModel, axisModel.ecModel
);
}
var textColor = itemLabelModel.getTextColor()
|| axisModel.get('axisLine.lineStyle.color');
- var tickCoord = axis.dataToCoord(tickVal);
+ var tickCoord = axis.dataToCoord(tickValue);
var pos = [
tickCoord,
opt.labelOffset + opt.labelDirection * labelMargin
];
- var labelStr = axis.scale.getLabel(tickVal);
var textEl = new Text({
// Id for animation
- anid: 'label_' + tickVal,
+ anid: 'label_' + tickValue,
position: pos,
rotation: labelLayout.rotation,
silent: silent,
@@ -35541,7 +37989,7 @@ function buildAxisLabel(axisBuilder, axisModel, opt) {
});
setTextStyle(textEl.style, itemLabelModel, {
- text: labels[index],
+ text: formattedLabel,
textAlign: itemLabelModel.getShallow('align', true)
|| labelLayout.textAlign,
textVerticalAlign: itemLabelModel.getShallow('verticalAlign', true)
@@ -35552,11 +38000,15 @@ function buildAxisLabel(axisBuilder, axisModel, opt) {
// (1) In category axis with data zoom, tick is not the original
// index of axis.data. So tick should not be exposed to user
// in category axis.
- // (2) Compatible with previous version, which always returns labelStr.
- // But in interval scale labelStr is like '223,445', which maked
- // user repalce ','. So we modify it to return original val but remain
+ // (2) Compatible with previous version, which always use formatted label as
+ // input. But in interval scale the formatted label is like '223,445', which
+ // maked user repalce ','. So we modify it to return original val but remain
// it as 'string' to avoid error in replacing.
- axis.type === 'category' ? labelStr : axis.type === 'value' ? tickVal + '' : tickVal,
+ axis.type === 'category'
+ ? rawLabel
+ : axis.type === 'value'
+ ? tickValue + ''
+ : tickValue,
index
)
: textColor
@@ -35566,7 +38018,7 @@ function buildAxisLabel(axisBuilder, axisModel, opt) {
if (triggerEvent) {
textEl.eventData = makeAxisEventDataBase(axisModel);
textEl.eventData.targetType = 'axisLabel';
- textEl.eventData.value = labelStr;
+ textEl.eventData.value = rawLabel;
}
// FIXME
@@ -35583,7 +38035,26 @@ function buildAxisLabel(axisBuilder, axisModel, opt) {
return labelEls;
}
-var each$7 = each$1;
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+var each$6 = each$1;
var curry$1 = curry;
// Build axisPointerModel, mergin tooltip.axisPointer model for each axis.
@@ -35629,7 +38100,7 @@ function collectAxesInfo(result, ecModel, api) {
var linkGroups = [];
// Collect axes info.
- each$7(api.getCoordinateSystems(), function (coordSys) {
+ each$6(api.getCoordinateSystems(), function (coordSys) {
// Some coordinate system do not support axes, like geo.
if (!coordSys.axisPointerEnabled) {
return;
@@ -35644,7 +38115,7 @@ function collectAxesInfo(result, ecModel, api) {
var coordSysModel = coordSys.model;
var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);
- each$7(coordSys.getAxes(), curry$1(saveTooltipAxisInfo, false, null));
+ each$6(coordSys.getAxes(), curry$1(saveTooltipAxisInfo, false, null));
// If axis tooltip used, choose tooltip axis for each coordSys.
// Notice this case: coordSys is `grid` but not `cartesian2D` here.
@@ -35660,12 +38131,12 @@ function collectAxesInfo(result, ecModel, api) {
var cross = baseTooltipModel.get('axisPointer.type') === 'cross';
var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get('axisPointer.axis'));
if (triggerAxis || cross) {
- each$7(tooltipAxes.baseAxes, curry$1(
+ each$6(tooltipAxes.baseAxes, curry$1(
saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis
));
}
if (cross) {
- each$7(tooltipAxes.otherAxes, curry$1(saveTooltipAxisInfo, 'cross', false));
+ each$6(tooltipAxes.otherAxes, curry$1(saveTooltipAxisInfo, 'cross', false));
}
}
@@ -35730,7 +38201,7 @@ function makeAxisPointerModel(
var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');
var volatileOption = {};
- each$7(
+ each$6(
[
'type', 'snap', 'lineStyle', 'shadowStyle', 'label',
'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'
@@ -35790,7 +38261,7 @@ function collectSeriesInfo(result, ecModel) {
return;
}
- each$7(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {
+ each$6(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {
var axis = axisInfo.axis;
if (coordSys.getAxis(axis.dim) === axis) {
axisInfo.seriesModels.push(seriesModel);
@@ -35905,6 +38376,25 @@ function makeKey(model) {
return model.type + '||' + model.id;
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Base class of AxisView.
*/
@@ -36003,11 +38493,33 @@ AxisView.getAxisPointerClass = function (type) {
return type && axisPointerClazz[type];
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
+ * Can only be called after coordinate system creation stage.
+ * (Can be called before coordinate system update stage).
+ *
* @param {Object} opt {labelInside}
* @return {Object} {
* position, rotation, labelDirection, labelOffset,
- * tickDirection, labelRotate, labelInterval, z2
+ * tickDirection, labelRotate, z2
* }
*/
function layout$1(gridModel, axisModel, opt) {
@@ -36015,9 +38527,10 @@ function layout$1(gridModel, axisModel, opt) {
var grid = gridModel.coordinateSystem;
var axis = axisModel.axis;
var layout = {};
+ var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];
var rawAxisPosition = axis.position;
- var axisPosition = axis.onZero ? 'onZero' : rawAxisPosition;
+ var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;
var axisDim = axis.dim;
var rect = grid.getRect();
@@ -36029,9 +38542,8 @@ function layout$1(gridModel, axisModel, opt) {
? [rectBound[2] - axisOffset, rectBound[3] + axisOffset]
: [rectBound[0] - axisOffset, rectBound[1] + axisOffset];
- if (axis.onZero) {
- var otherAxis = grid.getAxis(axisDim === 'x' ? 'y' : 'x', axis.onZeroAxisIndex);
- var onZeroCoord = otherAxis.toGlobalCoord(otherAxis.dataToCoord(0));
+ if (otherAxisOnZeroOf) {
+ var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));
posBound[idx['onZero']] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);
}
@@ -36048,7 +38560,7 @@ function layout$1(gridModel, axisModel, opt) {
var dirMap = {top: -1, bottom: 1, left: -1, right: 1};
layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];
- layout.labelOffset = axis.onZero ? posBound[idx[rawAxisPosition]] - posBound[idx['onZero']] : 0;
+ layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx['onZero']] : 0;
if (axisModel.get('axisTick.inside')) {
layout.tickDirection = -layout.tickDirection;
@@ -36061,17 +38573,30 @@ function layout$1(gridModel, axisModel, opt) {
var labelRotate = axisModel.get('axisLabel.rotate');
layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate;
- // label interval when auto mode.
- layout.labelInterval = axis.getLabelInterval();
-
// Over splitLine and splitArea
layout.z2 = 1;
return layout;
}
-var ifIgnoreOnTick = AxisBuilder.ifIgnoreOnTick;
-var getInterval = AxisBuilder.getInterval;
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
var axisBuilderAttrs = [
'axisLine', 'axisTickLabel', 'axisName'
@@ -36122,7 +38647,7 @@ var CartesianAxisView = AxisView.extend({
each$1(selfBuilderAttrs, function (name) {
if (axisModel.get(name + '.show')) {
- this['_' + name](axisModel, gridModel, layout.labelInterval);
+ this['_' + name](axisModel, gridModel);
}
}, this);
@@ -36131,13 +38656,16 @@ var CartesianAxisView = AxisView.extend({
CartesianAxisView.superCall(this, 'render', axisModel, ecModel, api, payload);
},
+ remove: function () {
+ this._splitAreaColors = null;
+ },
+
/**
* @param {module:echarts/coord/cartesian/AxisModel} axisModel
* @param {module:echarts/coord/cartesian/GridModel} gridModel
- * @param {number|Function} labelInterval
* @private
*/
- _splitLine: function (axisModel, gridModel, labelInterval) {
+ _splitLine: function (axisModel, gridModel) {
var axis = axisModel.axis;
if (axis.scale.isBlank()) {
@@ -36148,8 +38676,6 @@ var CartesianAxisView = AxisView.extend({
var lineStyleModel = splitLineModel.getModel('lineStyle');
var lineColors = lineStyleModel.get('color');
- var lineInterval = getInterval(splitLineModel, labelInterval);
-
lineColors = isArray(lineColors) ? lineColors : [lineColors];
var gridRect = gridModel.coordinateSystem.getRect();
@@ -36157,28 +38683,18 @@ var CartesianAxisView = AxisView.extend({
var lineCount = 0;
- var ticksCoords = axis.getTicksCoords(
- // splitLineModel.get('alignWithLabel')
- );
- var ticks = axis.scale.getTicks();
-
- var showMinLabel = axisModel.get('axisLabel.showMinLabel');
- var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
+ var ticksCoords = axis.getTicksCoords({
+ tickModel: splitLineModel
+ });
var p1 = [];
var p2 = [];
+
// Simple optimization
// Batching the lines if color are the same
var lineStyle = lineStyleModel.getLineStyle();
for (var i = 0; i < ticksCoords.length; i++) {
- if (ifIgnoreOnTick(
- axis, i, lineInterval, ticksCoords.length,
- showMinLabel, showMaxLabel
- )) {
- continue;
- }
-
- var tickCoord = axis.toGlobalCoord(ticksCoords[i]);
+ var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);
if (isHorizontal) {
p1[0] = tickCoord;
@@ -36195,8 +38711,7 @@ var CartesianAxisView = AxisView.extend({
var colorIndex = (lineCount++) % lineColors.length;
this._axisGroup.add(new Line(subPixelOptimizeLine({
- anid: 'line_' + ticks[i],
-
+ anid: 'line_' + ticksCoords[i].tickValue,
shape: {
x1: p1[0],
y1: p1[1],
@@ -36214,10 +38729,9 @@ var CartesianAxisView = AxisView.extend({
/**
* @param {module:echarts/coord/cartesian/AxisModel} axisModel
* @param {module:echarts/coord/cartesian/GridModel} gridModel
- * @param {number|Function} labelInterval
* @private
*/
- _splitArea: function (axisModel, gridModel, labelInterval) {
+ _splitArea: function (axisModel, gridModel) {
var axis = axisModel.axis;
if (axis.scale.isBlank()) {
@@ -36230,55 +38744,63 @@ var CartesianAxisView = AxisView.extend({
var gridRect = gridModel.coordinateSystem.getRect();
- var ticksCoords = axis.getTicksCoords(
- // splitAreaModel.get('alignWithLabel')
- );
- var ticks = axis.scale.getTicks();
+ var ticksCoords = axis.getTicksCoords({
+ tickModel: splitAreaModel,
+ clamp: true
+ });
- var prevX = axis.toGlobalCoord(ticksCoords[0]);
- var prevY = axis.toGlobalCoord(ticksCoords[0]);
+ if (!ticksCoords.length) {
+ return;
+ }
- var count = 0;
+ // For Making appropriate splitArea animation, the color and anid
+ // should be corresponding to previous one if possible.
+ var areaColorsLen = areaColors.length;
+ var lastSplitAreaColors = this._splitAreaColors;
+ var newSplitAreaColors = createHashMap();
+ var colorIndex = 0;
+ if (lastSplitAreaColors) {
+ for (var i = 0; i < ticksCoords.length; i++) {
+ var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);
+ if (cIndex != null) {
+ colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;
+ break;
+ }
+ }
+ }
- var areaInterval = getInterval(splitAreaModel, labelInterval);
+ var prev = axis.toGlobalCoord(ticksCoords[0].coord);
var areaStyle = areaStyleModel.getAreaStyle();
areaColors = isArray(areaColors) ? areaColors : [areaColors];
- var showMinLabel = axisModel.get('axisLabel.showMinLabel');
- var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
-
for (var i = 1; i < ticksCoords.length; i++) {
- if (ifIgnoreOnTick(
- axis, i, areaInterval, ticksCoords.length,
- showMinLabel, showMaxLabel
- ) && (i < ticksCoords.length - 1)) {
- continue;
- }
-
- var tickCoord = axis.toGlobalCoord(ticksCoords[i]);
+ var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);
var x;
var y;
var width;
var height;
if (axis.isHorizontal()) {
- x = prevX;
+ x = prev;
y = gridRect.y;
width = tickCoord - x;
height = gridRect.height;
+ prev = x + width;
}
else {
x = gridRect.x;
- y = prevY;
+ y = prev;
width = gridRect.width;
height = tickCoord - y;
+ prev = y + height;
}
- var colorIndex = (count++) % areaColors.length;
- this._axisGroup.add(new Rect({
- anid: 'area_' + ticks[i],
+ var tickValue = ticksCoords[i - 1].tickValue;
+ tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);
+ this._axisGroup.add(new Rect({
+ anid: 'area_' + tickValue,
shape: {
x: x,
y: y,
@@ -36291,9 +38813,10 @@ var CartesianAxisView = AxisView.extend({
silent: true
}));
- prevX = x + width;
- prevY = y + height;
+ colorIndex = (colorIndex + 1) % areaColorsLen;
}
+
+ this._splitAreaColors = newSplitAreaColors;
}
});
@@ -36304,6 +38827,44 @@ CartesianAxisView.extend({
type: 'yAxis'
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// Grid view
extendComponentView({
@@ -36332,6 +38893,25 @@ registerPreprocessor(function (option) {
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// In case developer forget to include grid component
registerVisual(visualSymbol('line', 'circle', 'line'));
registerLayout(pointsLayout('line'));
@@ -36342,6 +38922,25 @@ registerProcessor(
dataSample('line')
);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var BaseBarSeries = SeriesModel.extend({
type: 'series.__base_bar__',
@@ -36382,6 +38981,11 @@ var BaseBarSeries = SeriesModel.extend({
barMinAngle: 0,
// cursor: null,
+ large: false,
+ largeThreshold: 400,
+ progressive: 5e3,
+ progressiveChunkMode: 'mod',
+
// barMaxWidth: null,
// 默认自适应
// barWidth: null,
@@ -36397,15 +39001,77 @@ var BaseBarSeries = SeriesModel.extend({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
BaseBarSeries.extend({
type: 'series.bar',
dependencies: ['grid', 'polar'],
- brushSelector: 'rect'
+ brushSelector: 'rect',
+
+ /**
+ * @override
+ */
+ getProgressive: function () {
+ // Do not support progressive in normal mode.
+ return this.get('large')
+ ? this.get('progressive')
+ : false;
+ },
+
+ /**
+ * @override
+ */
+ getProgressiveThreshold: function () {
+ // Do not support progressive in normal mode.
+ var progressiveThreshold = this.get('progressiveThreshold');
+ var largeThreshold = this.get('largeThreshold');
+ if (largeThreshold > progressiveThreshold) {
+ progressiveThreshold = largeThreshold;
+ }
+ return progressiveThreshold;
+ }
+
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
function setLabel(
normalStyle, hoverStyle, itemModel, color, seriesModel, dataIndex, labelPositionOutside
) {
@@ -36433,6 +39099,25 @@ function fixPosition(style, labelPositionOutside) {
}
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var getBarItemStyle = makeStyleMapper(
[
['fill', 'color'],
@@ -36460,6 +39145,25 @@ var barItemStyle = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'barBorderWidth'];
// FIXME
@@ -36471,12 +39175,16 @@ extendChartView({
type: 'bar',
render: function (seriesModel, ecModel, api) {
+ this._updateDrawMode(seriesModel);
+
var coordinateSystemType = seriesModel.get('coordinateSystem');
if (coordinateSystemType === 'cartesian2d'
|| coordinateSystemType === 'polar'
) {
- this._render(seriesModel, ecModel, api);
+ this._isLargeDraw
+ ? this._renderLarge(seriesModel, ecModel, api)
+ : this._renderNormal(seriesModel, ecModel, api);
}
else if (__DEV__) {
console.warn('Only cartesian2d and polar supported for bar.');
@@ -36485,9 +39193,25 @@ extendChartView({
return this.group;
},
- dispose: noop,
+ incrementalPrepareRender: function (seriesModel, ecModel, api) {
+ this._clear();
+ this._updateDrawMode(seriesModel);
+ },
- _render: function (seriesModel, ecModel, api) {
+ incrementalRender: function (params, seriesModel, ecModel, api) {
+ // Do not support progressive in normal mode.
+ this._incrementalRenderLarge(params, seriesModel);
+ },
+
+ _updateDrawMode: function (seriesModel) {
+ var isLargeDraw = seriesModel.pipelineContext.large;
+ if (this._isLargeDraw == null || isLargeDraw ^ this._isLargeDraw) {
+ this._isLargeDraw = isLargeDraw;
+ this._clear();
+ }
+ },
+
+ _renderNormal: function (seriesModel, ecModel, api) {
var group = this.group;
var data = seriesModel.getData();
var oldData = this._data;
@@ -36567,25 +39291,40 @@ extendChartView({
this._data = data;
},
- remove: function (ecModel, api) {
+ _renderLarge: function (seriesModel, ecModel, api) {
+ this._clear();
+ createLarge(seriesModel, this.group);
+ },
+
+ _incrementalRenderLarge: function (params, seriesModel) {
+ createLarge(seriesModel, this.group, true);
+ },
+
+ dispose: noop,
+
+ remove: function (ecModel) {
+ this._clear(ecModel);
+ },
+
+ _clear: function (ecModel) {
var group = this.group;
var data = this._data;
- if (ecModel.get('animation')) {
- if (data) {
- data.eachItemGraphicEl(function (el) {
- if (el.type === 'sector') {
- removeSector(el.dataIndex, ecModel, el);
- }
- else {
- removeRect(el.dataIndex, ecModel, el);
- }
- });
- }
+ if (ecModel && ecModel.get('animation') && data && !this._isLargeDraw) {
+ data.eachItemGraphicEl(function (el) {
+ if (el.type === 'sector') {
+ removeSector(el.dataIndex, ecModel, el);
+ }
+ else {
+ removeRect(el.dataIndex, ecModel, el);
+ }
+ });
}
else {
group.removeAll();
}
+ this._data = null;
}
+
});
var elementCreator = {
@@ -36736,17 +39475,107 @@ function getLineWidth(itemModel, rawLayout) {
return Math.min(lineWidth, Math.abs(rawLayout.width), Math.abs(rawLayout.height));
}
+
+var LargePath = Path.extend({
+
+ type: 'largeBar',
+
+ shape: {points: []},
+
+ buildPath: function (ctx, shape) {
+ // Drawing lines is more efficient than drawing
+ // a whole line or drawing rects.
+ var points = shape.points;
+ var startPoint = this.__startPoint;
+ var valueIdx = this.__valueIdx;
+
+ for (var i = 0; i < points.length; i += 2) {
+ startPoint[this.__valueIdx] = points[i + valueIdx];
+ ctx.moveTo(startPoint[0], startPoint[1]);
+ ctx.lineTo(points[i], points[i + 1]);
+ }
+ }
+});
+
+function createLarge(seriesModel, group, incremental) {
+ // TODO support polar
+ var data = seriesModel.getData();
+ var startPoint = [];
+ var valueIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;
+ startPoint[1 - valueIdx] = data.getLayout('valueAxisStart');
+
+ var el = new LargePath({
+ shape: {points: data.getLayout('largePoints')},
+ incremental: !!incremental,
+ __startPoint: startPoint,
+ __valueIdx: valueIdx
+ });
+ group.add(el);
+ setLargeStyle(el, seriesModel, data);
+}
+
+function setLargeStyle(el, seriesModel, data) {
+ var borderColor = data.getVisual('borderColor') || data.getVisual('color');
+ var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(['color', 'borderColor']);
+
+ el.useStyle(itemStyle);
+ el.style.fill = null;
+ el.style.stroke = borderColor;
+ el.style.lineWidth = data.getLayout('barWidth');
+}
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// In case developer forget to include grid component
registerLayout(curry(layout, 'bar'));
+// Should after normal bar layout, otherwise it is blocked by normal bar layout.
+registerLayout(largeLayout);
-// Visual coding for legend
-registerVisual(function (ecModel) {
- ecModel.eachSeriesByType('bar', function (seriesModel) {
- var data = seriesModel.getData();
- data.setVisual('legendSymbol', 'roundRect');
- });
+registerVisual({
+ seriesType: 'bar',
+ reset: function (seriesModel) {
+ // Visual coding for legend
+ seriesModel.getData().setVisual('legendSymbol', 'roundRect');
+ }
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+
/**
* [Usage]:
* (1)
@@ -36776,6 +39605,25 @@ var createListSimply = function (seriesModel, opt, nameList) {
return list;
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Data selectable mixin for chart series.
* To eanble data select, option of series must have `selectedMode`.
@@ -36867,6 +39715,25 @@ var dataSelectableMixin = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var PieSeries = extendSeriesModel({
type: 'series.pie',
@@ -37015,6 +39882,25 @@ var PieSeries = extendSeriesModel({
mixin(PieSeries, dataSelectableMixin);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @param {module:echarts/model/Series} seriesModel
* @param {boolean} hasAnimation
@@ -37405,6 +40291,25 @@ var PieView = Chart.extend({
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var createDataSelectAction = function (seriesType, actionInfos) {
each$1(actionInfos, function (actionInfo) {
actionInfo.update = 'updateView';
@@ -37441,6 +40346,25 @@ var createDataSelectAction = function (seriesType, actionInfos) {
});
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// Pick color from palette for each data item.
// Applicable for charts that require applying color palette
// in data level (like pie, funnel, chord).
@@ -37501,6 +40425,25 @@ var dataColor = function (seriesType) {
};
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// FIXME emphasis label position is not same with normal label position
function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) {
@@ -37723,6 +40666,26 @@ var labelLayout = function (seriesModel, r, viewWidth, viewHeight) {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+
var PI2$4 = Math.PI * 2;
var RADIAN = Math.PI / 180;
@@ -37866,6 +40829,25 @@ var pieLayout = function (seriesType, ecModel, api, payload) {
});
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var dataFilter = function (seriesType) {
return {
seriesType: seriesType,
@@ -37891,6 +40873,25 @@ var dataFilter = function (seriesType) {
};
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
createDataSelectAction('pie', [{
type: 'pieToggleSelect',
event: 'pieselectchanged',
@@ -37909,6 +40910,25 @@ registerVisual(dataColor('pie'));
registerLayout(curry(pieLayout, 'pie'));
registerProcessor(dataFilter('pie'));
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
SeriesModel.extend({
type: 'series.scatter',
@@ -37976,13 +40996,32 @@ SeriesModel.extend({
itemStyle: {
opacity: 0.8
// color: 各异
- },
+ }
- progressive: null
+ // progressive: null
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// TODO Batch by color
var BOOST_SIZE_THRESHOLD = 4;
@@ -38234,6 +41273,25 @@ largeSymbolProto._clearIncremental = function () {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
extendChartView({
type: 'scatter',
@@ -38310,6 +41368,25 @@ extendChartView({
dispose: function () {}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// import * as zrUtil from 'zrender/src/core/util';
// In case developer forget to include grid component
@@ -38337,6 +41414,25 @@ registerLayout(pointsLayout('scatter'));
// });
// });
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// -------------
// Preprocessor
// -------------
@@ -38843,6 +41939,25 @@ function setLayoutInfoToExist(existItem, newElOption) {
}
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @param {Object} finder contains {seriesIndex, dataIndex, dataIndexInside}
* @param {module:echarts/model/Global} ecModel
@@ -38892,9 +42007,28 @@ var findPointFromSeries = function (finder, ecModel) {
return {point: point, el: el};
};
-var each$8 = each$1;
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+var each$7 = each$1;
var curry$2 = curry;
-var inner$6 = makeInner();
+var inner$7 = makeInner();
/**
* Basic logic: check all axis, if they do not demand show/highlight,
@@ -38966,11 +42100,11 @@ var axisTrigger = function (payload, ecModel, api) {
};
// Process for triggered axes.
- each$8(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {
+ each$7(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {
// If a point given, it must be contained by the coordinate system.
var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);
- each$8(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {
+ each$7(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {
var axis = axisInfo.axis;
var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);
// If no inputAxesInfo, no axis is restricted.
@@ -38986,12 +42120,12 @@ var axisTrigger = function (payload, ecModel, api) {
// Process for linked axes.
var linkTriggers = {};
- each$8(axesInfo, function (tarAxisInfo, tarKey) {
+ each$7(axesInfo, function (tarAxisInfo, tarKey) {
var linkGroup = tarAxisInfo.linkGroup;
// If axis has been triggered in the previous stage, it should not be triggered by link.
if (linkGroup && !showValueMap[tarKey]) {
- each$8(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {
+ each$7(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {
var srcValItem = showValueMap[srcKey];
// If srcValItem exist, source axis is triggered, so link to target axis.
if (srcAxisInfo !== tarAxisInfo && srcValItem) {
@@ -39004,7 +42138,7 @@ var axisTrigger = function (payload, ecModel, api) {
});
}
});
- each$8(linkTriggers, function (val, tarKey) {
+ each$7(linkTriggers, function (val, tarKey) {
processOnAxis(axesInfo[tarKey], val, updaters, true, outputFinder);
});
@@ -39060,7 +42194,7 @@ function buildPayloadsBySeries(value, axisInfo) {
var minDist = Number.MAX_VALUE;
var minDiff = -1;
- each$8(axisInfo.seriesModels, function (series, idx) {
+ each$7(axisInfo.seriesModels, function (series, idx) {
var dataDim = series.getData().mapDimension(dim, true);
var seriesNestestValue;
var dataIndices;
@@ -39099,7 +42233,7 @@ function buildPayloadsBySeries(value, axisInfo) {
snapToValue = seriesNestestValue;
payloadBatch.length = 0;
}
- each$8(dataIndices, function (dataIndex) {
+ each$7(dataIndices, function (dataIndex) {
payloadBatch.push({
seriesIndex: series.seriesIndex,
dataIndexInside: dataIndex,
@@ -39166,7 +42300,7 @@ function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {
function updateModelActually(showValueMap, axesInfo, outputFinder) {
var outputAxesInfo = outputFinder.axesInfo = [];
// Basic logic: If no 'show' required, 'hide' this axisPointer.
- each$8(axesInfo, function (axisInfo, key) {
+ each$7(axesInfo, function (axisInfo, key) {
var option = axisInfo.axisPointerModel.option;
var valItem = showValueMap[key];
@@ -39227,14 +42361,14 @@ function dispatchHighDownActually(axesInfo, dispatchAction, api) {
var zr = api.getZr();
var highDownKey = 'axisPointerLastHighlights';
- var lastHighlights = inner$6(zr)[highDownKey] || {};
- var newHighlights = inner$6(zr)[highDownKey] = {};
+ var lastHighlights = inner$7(zr)[highDownKey] || {};
+ var newHighlights = inner$7(zr)[highDownKey] = {};
// Update highlight/downplay status according to axisPointer model.
// Build hash map and remove duplicate incidentally.
- each$8(axesInfo, function (axisInfo, key) {
+ each$7(axesInfo, function (axisInfo, key) {
var option = axisInfo.axisPointerModel.option;
- option.status === 'show' && each$8(option.seriesDataIndices, function (batchItem) {
+ option.status === 'show' && each$7(option.seriesDataIndices, function (batchItem) {
var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;
newHighlights[key] = batchItem;
});
@@ -39283,6 +42417,25 @@ function illegalPoint(point) {
return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var AxisPointerModel = extendComponentModel({
type: 'axisPointer',
@@ -39374,8 +42527,27 @@ var AxisPointerModel = extendComponentModel({
});
-var inner$7 = makeInner();
-var each$9 = each$1;
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+var inner$8 = makeInner();
+var each$8 = each$1;
/**
* @param {string} key
@@ -39390,20 +42562,20 @@ function register(key, api, handler) {
}
var zr = api.getZr();
- inner$7(zr).records || (inner$7(zr).records = {});
+ inner$8(zr).records || (inner$8(zr).records = {});
initGlobalListeners(zr, api);
- var record = inner$7(zr).records[key] || (inner$7(zr).records[key] = {});
+ var record = inner$8(zr).records[key] || (inner$8(zr).records[key] = {});
record.handler = handler;
}
function initGlobalListeners(zr, api) {
- if (inner$7(zr).initialized) {
+ if (inner$8(zr).initialized) {
return;
}
- inner$7(zr).initialized = true;
+ inner$8(zr).initialized = true;
useHandler('click', curry(doEnter, 'click'));
useHandler('mousemove', curry(doEnter, 'mousemove'));
@@ -39414,7 +42586,7 @@ function initGlobalListeners(zr, api) {
zr.on(eventType, function (e) {
var dis = makeDispatchAction(api);
- each$9(inner$7(zr).records, function (record) {
+ each$8(inner$8(zr).records, function (record) {
record && cb(record, e, dis.dispatchAction);
});
@@ -39484,12 +42656,31 @@ function unregister(key, api) {
return;
}
var zr = api.getZr();
- var record = (inner$7(zr).records || {})[key];
+ var record = (inner$8(zr).records || {})[key];
if (record) {
- inner$7(zr).records[key] = null;
+ inner$8(zr).records[key] = null;
}
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var AxisPointerView = extendComponentView({
type: 'axisPointer',
@@ -39538,7 +42729,26 @@ var AxisPointerView = extendComponentView({
});
-var inner$8 = makeInner();
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+var inner$9 = makeInner();
var clone$4 = clone;
var bind$1 = bind;
@@ -39725,7 +42935,7 @@ BaseAxisPointer.prototype = {
createPointerEl: function (group, elOption, axisModel, axisPointerModel) {
var pointerOption = elOption.pointer;
if (pointerOption) {
- var pointerEl = inner$8(group).pointerEl = new graphic[pointerOption.type](
+ var pointerEl = inner$9(group).pointerEl = new graphic[pointerOption.type](
clone$4(elOption.pointer)
);
group.add(pointerEl);
@@ -39737,7 +42947,7 @@ BaseAxisPointer.prototype = {
*/
createLabelEl: function (group, elOption, axisModel, axisPointerModel) {
if (elOption.label) {
- var labelEl = inner$8(group).labelEl = new Rect(
+ var labelEl = inner$9(group).labelEl = new Rect(
clone$4(elOption.label)
);
@@ -39750,7 +42960,7 @@ BaseAxisPointer.prototype = {
* @protected
*/
updatePointerEl: function (group, elOption, updateProps$$1) {
- var pointerEl = inner$8(group).pointerEl;
+ var pointerEl = inner$9(group).pointerEl;
if (pointerEl) {
pointerEl.setStyle(elOption.pointer.style);
updateProps$$1(pointerEl, {shape: elOption.pointer.shape});
@@ -39761,7 +42971,7 @@ BaseAxisPointer.prototype = {
* @protected
*/
updateLabelEl: function (group, elOption, updateProps$$1, axisPointerModel) {
- var labelEl = inner$8(group).labelEl;
+ var labelEl = inner$9(group).labelEl;
if (labelEl) {
labelEl.setStyle(elOption.label.style);
updateProps$$1(labelEl, {
@@ -39877,7 +43087,7 @@ BaseAxisPointer.prototype = {
handle.stopAnimation();
handle.attr(getHandleTransProps(trans));
- inner$8(handle).lastProp = null;
+ inner$9(handle).lastProp = null;
this._doDispatchAxisPointer();
},
@@ -39999,8 +43209,8 @@ BaseAxisPointer.prototype.constructor = BaseAxisPointer;
function updateProps$1(animationModel, moveAnimation, el, props) {
// Animation optimize.
- if (!propsEqual(inner$8(el).lastProp, props)) {
- inner$8(el).lastProp = props;
+ if (!propsEqual(inner$9(el).lastProp, props)) {
+ inner$9(el).lastProp = props;
moveAnimation
? updateProps(el, props, animationModel)
: (el.stopAnimation(), el.attr(props));
@@ -40046,6 +43256,25 @@ function updateMandatoryProps(group, axisPointerModel, silent) {
enableClassExtend(BaseAxisPointer);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @param {module:echarts/model/Model} axisPointerModel
*/
@@ -40147,6 +43376,7 @@ function confineInContainer(position, width, height, api) {
* @param {string|Function} opt.formatter label formatter
*/
function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {
+ value = axis.scale.parse(value);
var text = axis.scale.getLabel(
// If `precision` is set, width can be fixed (like '12.00500'), which
// helps to debounce when when moving label.
@@ -40240,6 +43470,25 @@ function makeRectShape(xy, wh, xDimIndex) {
};
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var CartesianAxisPointer = BaseAxisPointer.extend({
/**
@@ -40339,7 +43588,7 @@ var pointerShapeBuilder = {
},
shadow: function (axis, pixelValue, otherExtent, elStyle) {
- var bandWidth = axis.getBandWidth();
+ var bandWidth = Math.max(1, axis.getBandWidth());
var span = otherExtent[1] - otherExtent[0];
return {
type: 'Rect',
@@ -40358,6 +43607,25 @@ function getAxisDimIndex(axis) {
AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// CartesianAxisPointer is not supposed to be required here. But consider
// echarts.simple.js and online build tooltip, which only require gridSimple,
// CartesianAxisPointer should be able to required somewhere.
@@ -40393,6 +43661,25 @@ registerAction({
update: ':updateAxisPointer'
}, axisTrigger);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
extendComponentModel({
type: 'tooltip',
@@ -40496,7 +43783,26 @@ extendComponentModel({
}
});
-var each$11 = each$1;
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+var each$10 = each$1;
var toCamelCase$1 = toCamelCase;
var vendors = ['', '-webkit-', '-moz-', '-o-'];
@@ -40535,7 +43841,7 @@ function assembleFont(textStyleModel) {
fontSize &&
cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');
- each$11(['decoration', 'align'], function (name) {
+ each$10(['decoration', 'align'], function (name) {
var val = textStyleModel.get(name);
val && cssText.push('text-' + name + ':' + val);
});
@@ -40575,7 +43881,7 @@ function assembleCssText(tooltipModel) {
}
// Border style
- each$11(['width', 'color', 'radius'], function (name) {
+ each$10(['width', 'color', 'radius'], function (name) {
var borderName = 'border-' + name;
var camelCase = toCamelCase$1(borderName);
var val = tooltipModel.get(camelCase);
@@ -40749,8 +44055,27 @@ TooltipContent.prototype = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var bind$2 = bind;
-var each$10 = each$1;
+var each$9 = each$1;
var parsePercent$2 = parsePercent$1;
var proxyRect = new Rect({
@@ -41063,7 +44388,7 @@ extendComponentView({
globalTooltipModel
]);
- each$10(dataByCoordSys, function (itemCoordSys) {
+ each$9(dataByCoordSys, function (itemCoordSys) {
// var coordParamList = [];
// var coordDefaultHTML = [];
// var coordTooltipModel = buildTooltipModel([
@@ -41075,7 +44400,7 @@ extendComponentView({
// var displayMode = coordTooltipModel.get('displayMode');
// var paramsList = displayMode === 'single' ? singleParamsList : [];
- each$10(itemCoordSys.dataByAxis, function (item) {
+ each$9(itemCoordSys.dataByAxis, function (item) {
var axisModel = ecModel.getComponent(item.axisDim + 'Axis', item.axisIndex);
var axisValue = item.value;
var seriesDefaultHTML = [];
@@ -41349,13 +44674,13 @@ extendComponentView({
var contentNotChanged = !!lastCoordSys
&& lastCoordSys.length === dataByCoordSys.length;
- contentNotChanged && each$10(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {
+ contentNotChanged && each$9(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {
var lastDataByAxis = lastItemCoordSys.dataByAxis || {};
var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};
var thisDataByAxis = thisItemCoordSys.dataByAxis || [];
contentNotChanged &= lastDataByAxis.length === thisDataByAxis.length;
- contentNotChanged && each$10(lastDataByAxis, function (lastItem, indexAxis) {
+ contentNotChanged && each$9(lastDataByAxis, function (lastItem, indexAxis) {
var thisItem = thisDataByAxis[indexAxis] || {};
var lastIndices = lastItem.seriesDataIndices || [];
var newIndices = thisItem.seriesDataIndices || [];
@@ -41366,7 +44691,7 @@ extendComponentView({
&& lastItem.axisId === thisItem.axisId
&& lastIndices.length === newIndices.length;
- contentNotChanged && each$10(lastIndices, function (lastIdxItem, j) {
+ contentNotChanged && each$9(lastIndices, function (lastIdxItem, j) {
var newIdxItem = newIndices[j];
contentNotChanged &=
lastIdxItem.seriesIndex === newIdxItem.seriesIndex
@@ -41394,7 +44719,7 @@ extendComponentView({
},
dispose: function (ecModel, api) {
- if (env$1.node) {
+ if (env$1.node || env$1.wxa) {
return;
}
this._tooltipContent.hide();
@@ -41525,6 +44850,25 @@ function isCenterAlign(align) {
return align === 'center' || align === 'middle';
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// FIXME Better way to pack data in graphic element
/**
@@ -41555,6 +44899,25 @@ registerAction(
function () {}
);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var LegendModel = extendComponentModel({
type: 'legend.plain',
@@ -41779,6 +45142,25 @@ var LegendModel = extendComponentModel({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
function legendSelectActionHandler(methodName, payload, ecModel) {
var selectedMap = {};
var isToggleSelect = methodName === 'toggleSelected';
@@ -41853,6 +45235,25 @@ registerAction(
curry(legendSelectActionHandler, 'unSelect')
);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Layout list like component.
* It will box layout each items in group of component and then position the whole group in the viewport
@@ -41913,8 +45314,27 @@ function makeBackground(rect, componentModel) {
return rect;
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var curry$3 = curry;
-var each$12 = each$1;
+var each$11 = each$1;
var Group$2 = Group;
var LegendView = extendComponentView({
@@ -42007,7 +45427,12 @@ var LegendView = extendComponentView({
var legendDrawnMap = createHashMap();
var selectMode = legendModel.get('selectedMode');
- each$12(legendModel.getData(), function (itemModel, dataIndex) {
+ var excludeSeriesId = [];
+ ecModel.eachRawSeries(function (seriesModel) {
+ !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);
+ });
+
+ each$11(legendModel.getData(), function (itemModel, dataIndex) {
var name = itemModel.get('name');
// Use empty string or \n as a newline string
@@ -42018,6 +45443,7 @@ var LegendView = extendComponentView({
return;
}
+ // Representitive series.
var seriesModel = ecModel.getSeriesByName(name)[0];
if (legendDrawnMap.get(name)) {
@@ -42048,8 +45474,8 @@ var LegendView = extendComponentView({
);
itemGroup.on('click', curry$3(dispatchSelectAction, name, api))
- .on('mouseover', curry$3(dispatchHighlightAction, seriesModel, null, api))
- .on('mouseout', curry$3(dispatchDownplayAction, seriesModel, null, api));
+ .on('mouseover', curry$3(dispatchHighlightAction, seriesModel, null, api, excludeSeriesId))
+ .on('mouseout', curry$3(dispatchDownplayAction, seriesModel, null, api, excludeSeriesId));
legendDrawnMap.set(name, true);
}
@@ -42060,6 +45486,7 @@ var LegendView = extendComponentView({
if (legendDrawnMap.get(name)) {
return;
}
+
if (seriesModel.legendDataProvider) {
var data = seriesModel.legendDataProvider();
var idx = data.indexOfName(name);
@@ -42078,13 +45505,15 @@ var LegendView = extendComponentView({
selectMode
);
+ // FIXME: consider different series has items with the same name.
itemGroup.on('click', curry$3(dispatchSelectAction, name, api))
// FIXME Should not specify the series name
- .on('mouseover', curry$3(dispatchHighlightAction, seriesModel, name, api))
- .on('mouseout', curry$3(dispatchDownplayAction, seriesModel, name, api));
+ .on('mouseover', curry$3(dispatchHighlightAction, seriesModel, name, api, excludeSeriesId))
+ .on('mouseout', curry$3(dispatchDownplayAction, seriesModel, name, api, excludeSeriesId));
legendDrawnMap.set(name, true);
}
+
}, this);
}
@@ -42104,6 +45533,7 @@ var LegendView = extendComponentView({
var itemWidth = legendModel.get('itemWidth');
var itemHeight = legendModel.get('itemHeight');
var inactiveColor = legendModel.get('inactiveColor');
+ var symbolKeepAspect = legendModel.get('symbolKeepAspect');
var isSelected = legendModel.isSelected(name);
var itemGroup = new Group$2();
@@ -42124,7 +45554,8 @@ var LegendView = extendComponentView({
itemWidth,
itemHeight,
isSelected ? color : inactiveColor,
- true
+ // symbolKeepAspect default true for legend
+ symbolKeepAspect == null ? true : symbolKeepAspect
));
// Compose symbols
@@ -42139,8 +45570,14 @@ var LegendView = extendComponentView({
}
// Put symbol in the center
itemGroup.add(createSymbol(
- symbolType, (itemWidth - size) / 2, (itemHeight - size) / 2, size, size,
- isSelected ? color : inactiveColor
+ symbolType,
+ (itemWidth - size) / 2,
+ (itemHeight - size) / 2,
+ size,
+ size,
+ isSelected ? color : inactiveColor,
+ // symbolKeepAspect default true for legend
+ symbolKeepAspect == null ? true : symbolKeepAspect
));
}
@@ -42232,30 +45669,51 @@ function dispatchSelectAction(name, api) {
});
}
-function dispatchHighlightAction(seriesModel, dataName, api) {
+function dispatchHighlightAction(seriesModel, dataName, api, excludeSeriesId) {
// If element hover will move to a hoverLayer.
var el = api.getZr().storage.getDisplayList()[0];
if (!(el && el.useHoverLayer)) {
- seriesModel.get('legendHoverLink') && api.dispatchAction({
+ api.dispatchAction({
type: 'highlight',
seriesName: seriesModel.name,
- name: dataName
+ name: dataName,
+ excludeSeriesId: excludeSeriesId
});
}
}
-function dispatchDownplayAction(seriesModel, dataName, api) {
+function dispatchDownplayAction(seriesModel, dataName, api, excludeSeriesId) {
// If element hover will move to a hoverLayer.
var el = api.getZr().storage.getDisplayList()[0];
if (!(el && el.useHoverLayer)) {
- seriesModel.get('legendHoverLink') && api.dispatchAction({
+ api.dispatchAction({
type: 'downplay',
seriesName: seriesModel.name,
- name: dataName
+ name: dataName,
+ excludeSeriesId: excludeSeriesId
});
}
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var legendFilter = function (ecModel) {
var legendModels = ecModel.findComponents({
@@ -42276,6 +45734,26 @@ var legendFilter = function (ecModel) {
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+
// Do not contain scrollable legend, for sake of file size.
// Series Filter
@@ -42286,6 +45764,25 @@ ComponentModel.registerSubTypeDefaulter('legend', function () {
return 'plain';
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var ScrollableLegendModel = LegendModel.extend({
type: 'legend.scroll',
@@ -42355,6 +45852,25 @@ function mergeAndNormalizeLayoutParams(legendModel, target, raw) {
});
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Separate legend and scrollable legend to reduce package size.
*/
@@ -42729,6 +46245,25 @@ var ScrollableLegendView = LegendView.extend({
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @event legendScroll
* @type {Object}
@@ -42749,10 +46284,67 @@ registerAction(
}
);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Legend component entry file8
*/
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// Model
extendComponentModel({
@@ -42954,6 +46546,25 @@ extendComponentView({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var addCommas$1 = addCommas;
var encodeHTML$1 = encodeHTML;
@@ -42998,7 +46609,7 @@ var MarkerModel = extendComponentModel({
if (!createdBySelf) {
ecModel.eachSeries(function (seriesModel) {
- var markerOpt = seriesModel.get(this.mainType);
+ var markerOpt = seriesModel.get(this.mainType, true);
var markerModel = seriesModel[modelPropName];
if (!markerOpt || !markerOpt.data) {
@@ -43076,6 +46687,25 @@ var MarkerModel = extendComponentModel({
mixin(MarkerModel, dataFormatMixin);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
MarkerModel.extend({
type: 'markPoint',
@@ -43105,6 +46735,25 @@ MarkerModel.extend({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var indexOf$1 = indexOf;
function hasXOrY(item) {
@@ -43315,11 +46964,34 @@ function numCalculate(data, valueDataDim, type) {
});
return sum / count;
}
+ else if (type === 'median') {
+ return data.getMedian(valueDataDim);
+ }
else {
+ // max & min
return data.getDataExtent(valueDataDim, true)[type === 'max' ? 1 : 0];
}
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var MarkerView = extendComponentView({
type: 'marker',
@@ -43353,6 +47025,25 @@ var MarkerView = extendComponentView({
renderSeries: function () {}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
function updateMarkerLayout(mpData, seriesModel, api) {
var coordSys = seriesModel.coordinateSystem;
mpData.each(function (idx) {
@@ -43507,12 +47198,50 @@ function createList$1(coordSys, seriesModel, mpModel) {
return mpData;
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// HINT Markpoint can't be used too much
registerPreprocessor(function (opt) {
// Make sure markPoint component is enabled
opt.markPoint = opt.markPoint || {};
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
MarkerModel.extend({
type: 'markLine',
@@ -43549,6 +47278,25 @@ MarkerModel.extend({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Line path for bezier and straight line draw
*/
@@ -43598,6 +47346,25 @@ var LinePath = extendShape({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @module echarts/chart/helper/Line
*/
@@ -43889,30 +47656,36 @@ lineProto._updateCommonStl = function (lineData, idx, seriesScope) {
var label = this.childOfName('label');
var defaultLabelColor;
- var normalText;
- var emphasisText;
+ var baseText;
+ // FIXME: the logic below probably should be merged to `graphic.setLabelStyle`.
if (showLabel || hoverShowLabel) {
defaultLabelColor = visualColor || '#000';
- normalText = seriesModel.getFormattedLabel(idx, 'normal', lineData.dataType);
- if (normalText == null) {
+ baseText = seriesModel.getFormattedLabel(idx, 'normal', lineData.dataType);
+ if (baseText == null) {
var rawVal = seriesModel.getRawValue(idx);
- normalText = rawVal == null
+ baseText = rawVal == null
? lineData.getName(idx)
: isFinite(rawVal)
? round$1(rawVal)
: rawVal;
}
- emphasisText = retrieve2(
- seriesModel.getFormattedLabel(idx, 'emphasis', lineData.dataType),
- normalText
- );
}
+ var normalText = showLabel ? baseText : null;
+ var emphasisText = hoverShowLabel
+ ? retrieve2(
+ seriesModel.getFormattedLabel(idx, 'emphasis', lineData.dataType),
+ baseText
+ )
+ : null;
+
+ var labelStyle = label.style;
- // label.afterUpdate = lineAfterUpdate;
- if (showLabel) {
- var labelStyle = setTextStyle(label.style, labelModel, {
+ // Always set `textStyle` even if `normalStyle.text` is null, because default
+ // values have to be set on `normalStyle`.
+ if (normalText != null || emphasisText != null) {
+ setTextStyle(label.style, labelModel, {
text: normalText
}, {
autoColor: defaultLabelColor
@@ -43923,11 +47696,8 @@ lineProto._updateCommonStl = function (lineData, idx, seriesScope) {
// 'start', 'middle', 'end'
label.__position = labelModel.get('position') || 'middle';
}
- else {
- label.setStyle('text', null);
- }
- if (hoverShowLabel) {
+ if (emphasisText != null) {
// Only these properties supported in this emphasis style here.
label.hoverStyle = {
text: emphasisText,
@@ -43971,6 +47741,25 @@ lineProto.setLinePoints = function (points) {
inherits(Line$1, Group);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @module echarts/chart/helper/LineDraw
*/
@@ -44058,6 +47847,12 @@ function doUpdate(lineDraw, oldLineData, newLineData, oldIdx, newIdx, seriesScop
lineDrawProto.updateLayout = function () {
var lineData = this._lineData;
+
+ // Do not support update layout in incremental mode.
+ if (!lineData) {
+ return;
+ }
+
lineData.eachItemGraphicEl(function (el, idx) {
el.updateLayout(lineData, idx);
}, this);
@@ -44082,7 +47877,9 @@ lineDrawProto.incrementalUpdate = function (taskParams, lineData) {
if (lineNeedsDraw(itemLayout)) {
var el = new this._ctor(lineData, idx, this._seriesScope);
el.traverse(updateIncrementalAndHover);
+
this.group.add(el);
+ lineData.setItemGraphicEl(idx, el);
}
}
};
@@ -44118,14 +47915,33 @@ function lineNeedsDraw(pts) {
return !isPointNaN(pts[0]) && !isPointNaN(pts[1]);
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var markLineTransform = function (seriesModel, coordSys, mlModel, item) {
var data = seriesModel.getData();
- // Special type markLine like 'min', 'max', 'average'
+ // Special type markLine like 'min', 'max', 'average', 'median'
var mlType = item.type;
if (!isArray(item)
&& (
- mlType === 'min' || mlType === 'max' || mlType === 'average'
+ mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median'
// In case
// data: [{
// yAxis: 10
@@ -44488,11 +48304,49 @@ function createList$2(coordSys, seriesModel, mlModel) {
};
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
registerPreprocessor(function (opt) {
// Make sure markLine component is enabled
opt.markLine = opt.markLine || {};
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
MarkerModel.extend({
type: 'markArea',
@@ -44526,6 +48380,25 @@ MarkerModel.extend({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// TODO Better on polar
var markAreaTransform = function (seriesModel, coordSys, maModel, item) {
@@ -44690,12 +48563,12 @@ MarkerView.extend({
renderSeries: function (seriesModel, maModel, ecModel, api) {
var coordSys = seriesModel.coordinateSystem;
- var seriesName = seriesModel.name;
+ var seriesId = seriesModel.id;
var seriesData = seriesModel.getData();
var areaGroupMap = this.markerGroupMap;
- var polygonGroup = areaGroupMap.get(seriesName)
- || areaGroupMap.set(seriesName, {group: new Group()});
+ var polygonGroup = areaGroupMap.get(seriesId)
+ || areaGroupMap.set(seriesId, {group: new Group()});
this.group.add(polygonGroup.group);
polygonGroup.__keep = true;
@@ -44838,16 +48711,73 @@ function createList$3(coordSys, seriesModel, maModel) {
return areaData;
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
registerPreprocessor(function (opt) {
// Make sure markArea component is enabled
opt.markArea = opt.markArea || {};
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
ComponentModel.registerSubTypeDefaulter('dataZoom', function () {
// Default 'slider' when no type specified.
return 'slider';
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var AXIS_DIMS = ['x', 'y', 'z', 'radius', 'angle', 'single'];
// Supported coords.
var COORDS = ['cartesian2d', 'polar', 'singleAxis'];
@@ -44973,7 +48903,26 @@ function createLinkedNodesFinder(forEachNode, forEachEdgeType, edgeIdGetter) {
}
}
-var each$14 = each$1;
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+var each$13 = each$1;
var asc$1 = asc;
/**
@@ -45152,12 +49101,12 @@ AxisProxy.prototype = {
];
var valueWindow = [];
- each$14(['startValue', 'endValue'], function (prop) {
+ each$13(['startValue', 'endValue'], function (prop) {
valueWindow.push(opt[prop] != null ? scale.parse(opt[prop]) : null);
});
// Normalize bound.
- each$14([0, 1], function (idx) {
+ each$13([0, 1], function (idx) {
var boundValue = valueWindow[idx];
var boundPercent = percentWindow[idx];
@@ -45291,7 +49240,7 @@ AxisProxy.prototype = {
// filterMode 'weakFilter' and 'empty' is not optimized for huge data yet.
// Process series data
- each$14(seriesModels, function (seriesModel) {
+ each$13(seriesModels, function (seriesModel) {
var seriesData = seriesModel.getData();
var dataDims = seriesData.mapDimension(axisDim, true);
@@ -45317,7 +49266,7 @@ AxisProxy.prototype = {
});
}
else {
- each$14(dataDims, function (dim) {
+ each$13(dataDims, function (dim) {
if (filterMode === 'empty') {
seriesModel.setData(
seriesData.map(dim, function (value) {
@@ -45336,7 +49285,7 @@ AxisProxy.prototype = {
});
}
- each$14(dataDims, function (dim) {
+ each$13(dataDims, function (dim) {
seriesData.setApproximateExtent(valueWindow, dim);
});
});
@@ -45350,10 +49299,10 @@ AxisProxy.prototype = {
function calculateDataExtent(axisProxy, axisDim, seriesModels) {
var dataExtent = [Infinity, -Infinity];
- each$14(seriesModels, function (seriesModel) {
+ each$13(seriesModels, function (seriesModel) {
var seriesData = seriesModel.getData();
if (seriesData) {
- each$14(seriesData.mapDimension(axisDim, true), function (dim) {
+ each$13(seriesData.mapDimension(axisDim, true), function (dim) {
var seriesExtent = seriesData.getApproximateExtent(dim);
seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);
seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);
@@ -45442,7 +49391,7 @@ function setMinMaxSpan(axisProxy) {
var minMaxSpan = axisProxy._minMaxSpan = {};
var dataZoomModel = axisProxy._dataZoomModel;
- each$14(['min', 'max'], function (minMax) {
+ each$13(['min', 'max'], function (minMax) {
minMaxSpan[minMax + 'Span'] = dataZoomModel.get(minMax + 'Span');
// minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan
@@ -45462,7 +49411,26 @@ function setMinMaxSpan(axisProxy) {
});
}
-var each$13 = each$1;
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+var each$12 = each$1;
var eachAxisDim = eachAxisDim$1;
var DataZoomModel = extendComponentModel({
@@ -45587,7 +49555,7 @@ var DataZoomModel = extendComponentModel({
updateRangeUse(this, rawOption);
- each$13([['start', 'startValue'], ['end', 'endValue']], function (names, index) {
+ each$12([['start', 'startValue'], ['end', 'endValue']], function (names, index) {
// start/end has higher priority over startValue/endValue if they
// both set, but we should make chart.setOption({endValue: 1000})
// effective, rather than chart.setOption({endValue: 1000, end: null}).
@@ -45700,7 +49668,7 @@ var DataZoomModel = extendComponentModel({
autoAxisIndex = false;
}
else {
- each$13(dependentModels.singleAxis, function (singleAxisModel) {
+ each$12(dependentModels.singleAxis, function (singleAxisModel) {
if (autoAxisIndex && singleAxisModel.get('orient', true) === orient) {
thisOption.singleAxisIndex = [singleAxisModel.componentIndex];
autoAxisIndex = false;
@@ -45849,7 +49817,7 @@ var DataZoomModel = extendComponentModel({
eachTargetAxis: function (callback, context) {
var ecModel = this.ecModel;
eachAxisDim(function (dimNames) {
- each$13(
+ each$12(
this.get(dimNames.axisIndex),
function (axisIndex) {
callback.call(context, dimNames, axisIndex, this, ecModel);
@@ -45891,7 +49859,7 @@ var DataZoomModel = extendComponentModel({
*/
setRawRange: function (opt, ignoreUpdateRangeUsg) {
var option = this.option;
- each$13([['start', 'startValue'], ['end', 'endValue']], function (names) {
+ each$12([['start', 'startValue'], ['end', 'endValue']], function (names) {
// If only one of 'start' and 'startValue' is not null/undefined, the other
// should be cleared, which enable clear the option.
// If both of them are not set, keep option with the original value, which
@@ -45979,7 +49947,7 @@ var DataZoomModel = extendComponentModel({
function retrieveRaw(option) {
var ret = {};
- each$13(
+ each$12(
['start', 'end', 'startValue', 'endValue', 'throttle'],
function (name) {
option.hasOwnProperty(name) && (ret[name] = option[name]);
@@ -45992,7 +49960,7 @@ function updateRangeUse(dataZoomModel, rawOption) {
var rangePropMode = dataZoomModel._rangePropMode;
var rangeModeInOption = dataZoomModel.get('rangeMode');
- each$13([['start', 'startValue'], ['end', 'endValue']], function (names, index) {
+ each$12([['start', 'startValue'], ['end', 'endValue']], function (names, index) {
var percentSpecified = rawOption[names[0]] != null;
var valueSpecified = rawOption[names[1]] != null;
if (percentSpecified && !valueSpecified) {
@@ -46011,6 +49979,25 @@ function updateRangeUse(dataZoomModel, rawOption) {
});
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var DataZoomView = Component$1.extend({
type: 'dataZoom',
@@ -46078,6 +50065,25 @@ var DataZoomView = Component$1.extend({
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var SliderZoomModel = DataZoomModel.extend({
type: 'dataZoom.slider',
@@ -46142,6 +50148,25 @@ var SliderZoomModel = DataZoomModel.extend({
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* Calculate slider move result.
* Usage:
@@ -46223,11 +50248,30 @@ function restrict(value, extend) {
return Math.min(extend[1], Math.max(extend[0], value));
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var Rect$1 = Rect;
-var linearMap$2 = linearMap;
+var linearMap$1 = linearMap;
var asc$2 = asc;
var bind$3 = bind;
-var each$15 = each$1;
+var each$14 = each$1;
// Constants
var DEFAULT_LOCATION_EDGE_GAP = 7;
@@ -46542,7 +50586,7 @@ var SliderZoomView = DataZoomView.extend({
var isEmpty = value == null || isNaN(value) || value === '';
// See #4235.
var otherCoord = isEmpty
- ? 0 : linearMap$2(value, otherDataExtent, otherShadowExtent, true);
+ ? 0 : linearMap$1(value, otherDataExtent, otherShadowExtent, true);
// Attempt to draw data shadow precisely when there are empty value.
if (isEmpty && !lastIsEmpty && index) {
@@ -46678,7 +50722,7 @@ var SliderZoomView = DataZoomView.extend({
}
})));
- each$15([0, 1], function (handleIndex) {
+ each$14([0, 1], function (handleIndex) {
var path = createIcon(
dataZoomModel.get('handleIcon'),
{
@@ -46736,8 +50780,8 @@ var SliderZoomView = DataZoomView.extend({
var viewExtent = this._getViewExtent();
this._handleEnds = [
- linearMap$2(range[0], [0, 100], viewExtent, true),
- linearMap$2(range[1], [0, 100], viewExtent, true)
+ linearMap$1(range[0], [0, 100], viewExtent, true),
+ linearMap$1(range[1], [0, 100], viewExtent, true)
];
},
@@ -46745,6 +50789,7 @@ var SliderZoomView = DataZoomView.extend({
* @private
* @param {(number|string)} handleIndex 0 or 1 or 'all'
* @param {number} delta
+ * @return {boolean} changed
*/
_updateInterval: function (handleIndex, delta) {
var dataZoomModel = this.dataZoomModel;
@@ -46759,15 +50804,18 @@ var SliderZoomView = DataZoomView.extend({
viewExtend,
dataZoomModel.get('zoomLock') ? 'all' : handleIndex,
minMaxSpan.minSpan != null
- ? linearMap$2(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null,
+ ? linearMap$1(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null,
minMaxSpan.maxSpan != null
- ? linearMap$2(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null
+ ? linearMap$1(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null
);
- this._range = asc$2([
- linearMap$2(handleEnds[0], viewExtend, percentExtent, true),
- linearMap$2(handleEnds[1], viewExtend, percentExtent, true)
+ var lastRange = this._range;
+ var range = this._range = asc$2([
+ linearMap$1(handleEnds[0], viewExtend, percentExtent, true),
+ linearMap$1(handleEnds[1], viewExtend, percentExtent, true)
]);
+
+ return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];
},
/**
@@ -46779,7 +50827,7 @@ var SliderZoomView = DataZoomView.extend({
var handleInterval = asc$2(handleEnds.slice());
var size = this._size;
- each$15([0, 1], function (handleIndex) {
+ each$14([0, 1], function (handleIndex) {
// Handles
var handle = displaybles.handles[handleIndex];
var handleHeight = this._handleHeight;
@@ -46913,13 +50961,15 @@ var SliderZoomView = DataZoomView.extend({
var barTransform = this._displayables.barGroup.getLocalTransform();
var vertex = applyTransform$1([dx, dy], barTransform, true);
- this._updateInterval(handleIndex, vertex[0]);
+ var changed = this._updateInterval(handleIndex, vertex[0]);
var realtime = this.dataZoomModel.get('realtime');
this._updateView(!realtime);
- realtime && this._dispatchZoomAction();
+ // Avoid dispatch dataZoom repeatly but range not changed,
+ // which cause bad visual effect when progressive enabled.
+ changed && realtime && this._dispatchZoomAction();
},
_onDragEnd: function () {
@@ -46945,9 +50995,9 @@ var SliderZoomView = DataZoomView.extend({
var handleEnds = this._handleEnds;
var center = (handleEnds[0] + handleEnds[1]) / 2;
- this._updateInterval('all', localPoint[0] - center);
+ var changed = this._updateInterval('all', localPoint[0] - center);
this._updateView();
- this._dispatchZoomAction();
+ changed && this._dispatchZoomAction();
},
/**
@@ -46972,7 +51022,7 @@ var SliderZoomView = DataZoomView.extend({
_findCoordRect: function () {
// Find the grid coresponding to the first axis referred by dataZoom.
var rect;
- each$15(this.getTargetCoordInfo(), function (coordInfoList) {
+ each$14(this.getTargetCoordInfo(), function (coordInfoList) {
if (!rect && coordInfoList.length) {
var coordSys = coordInfoList[0].model.coordinateSystem;
rect = coordSys.getRect && coordSys.getRect();
@@ -47005,6 +51055,25 @@ function getCursor(orient) {
return orient === 'vertical' ? 'ns-resize' : 'ew-resize';
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
DataZoomModel.extend({
type: 'dataZoom.inside',
@@ -47021,6 +51090,25 @@ DataZoomModel.extend({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var ATTR$1 = '\0_ec_interaction_mutex';
function take(zr, resourceKey, userKey) {
@@ -47057,6 +51145,25 @@ registerAction(
function () {}
);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* @alias module:echarts/component/helper/RoamController
* @constructor
@@ -47251,6 +51358,25 @@ function checkKeyBinding(roamController, prop, e) {
&& (!isString(setting) || e.event[setting + 'Key']);
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
// Only create one roam controller for each coordinate system.
// one roam controller might be refered by two inside data zoom
// components (for example, one for x and one for y). When user
@@ -47349,20 +51475,6 @@ function unregister$1(api, dataZoomId) {
/**
* @public
*/
-function shouldRecordRange(payload, dataZoomId) {
- if (payload && payload.type === 'dataZoom' && payload.batch) {
- for (var i = 0, len = payload.batch.length; i < len; i++) {
- if (payload.batch[i].dataZoomId === dataZoomId) {
- return false;
- }
- }
- }
- return true;
-}
-
-/**
- * @public
- */
function generateCoordId(coordModel) {
return coordModel.type + '\0_' + coordModel.id;
}
@@ -47419,7 +51531,7 @@ function wrapAndDispatch(record, getRange) {
});
});
- record.dispatchAction(batch);
+ batch.length && record.dispatchAction(batch);
}
/**
@@ -47462,6 +51574,25 @@ function mergeControllerParams(dataZoomInfos) {
};
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var bind$4 = bind;
var InsideZoomView = DataZoomView.extend({
@@ -47487,12 +51618,10 @@ var InsideZoomView = DataZoomView.extend({
render: function (dataZoomModel, ecModel, api, payload) {
InsideZoomView.superApply(this, 'render', arguments);
- // Notice: origin this._range should be maintained, and should not be re-fetched
- // from dataZoomModel when payload.type is 'dataZoom', otherwise 'pan' or 'zoom'
- // info will be missed because of 'throttle' of this.dispatchAction.
- if (shouldRecordRange(payload, dataZoomModel.id)) {
- this._range = dataZoomModel.getPercentRange();
- }
+ // Hance the `throttle` util ensures to preserve command order,
+ // here simply updating range all the time will not cause missing
+ // any of the the roam change.
+ this._range = dataZoomModel.getPercentRange();
// Reset controllers.
each$1(this.getTargetCoordInfo(), function (coordInfoList, coordSysName) {
@@ -47544,7 +51673,8 @@ var InsideZoomView = DataZoomView.extend({
* @private
*/
_onPan: function (coordInfo, coordSysName, controller, dx, dy, oldX, oldY, newX, newY) {
- var range = this._range.slice();
+ var lastRange = this._range;
+ var range = lastRange.slice();
// Calculate transform by the first axis.
var axisModel = coordInfo.axisModels[0];
@@ -47562,14 +51692,19 @@ var InsideZoomView = DataZoomView.extend({
sliderMove(percentDelta, range, [0, 100], 'all');
- return (this._range = range);
+ this._range = range;
+
+ if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {
+ return range;
+ }
},
/**
* @private
*/
_onZoom: function (coordInfo, coordSysName, controller, scale, mouseX, mouseY) {
- var range = this._range.slice();
+ var lastRange = this._range;
+ var range = lastRange.slice();
// Calculate transform by the first axis.
var axisModel = coordInfo.axisModels[0];
@@ -47595,7 +51730,11 @@ var InsideZoomView = DataZoomView.extend({
sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);
- return (this._range = range);
+ this._range = range;
+
+ if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {
+ return range;
+ }
}
});
@@ -47678,8 +51817,30 @@ var getDirectionInfo = {
}
};
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
registerProcessor({
+ // `dataZoomProcessor` will only be performed in needed series. Consider if
+ // there is a line series and a pie series, it is better not to update the
+ // line series if only pie series is needed to be updated.
getTargetSeries: function (ecModel) {
var seriesModelMap = createHashMap();
@@ -47695,12 +51856,13 @@ registerProcessor({
return seriesModelMap;
},
- isOverallFilter: true,
+ modifyOutputEnd: true,
// Consider appendData, where filter should be performed. Because data process is
// in block mode currently, it is not need to worry about that the overallProgress
// execute every frame.
overallReset: function (ecModel, api) {
+
ecModel.eachComponent('dataZoom', function (dataZoomModel) {
// We calculate window and reset axis here but not in model
// init stage and not after action dispatch handler, because
@@ -47745,6 +51907,25 @@ registerProcessor({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
registerAction('dataZoom', function (payload, ecModel) {
var linkedNodesFinder = createLinkedNodesFinder(
@@ -47777,10 +51958,49 @@ registerAction('dataZoom', function (payload, ecModel) {
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
/**
* DataZoom component entry
*/
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+
var features = {};
function register$2(name, ctor) {
@@ -47791,6 +52011,25 @@ function get$1(name) {
return features[name];
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var ToolboxModel = extendComponentModel({
type: 'toolbox',
@@ -47800,8 +52039,8 @@ var ToolboxModel = extendComponentModel({
ignoreSize: true
},
- mergeDefaultAndTheme: function (option) {
- ToolboxModel.superApply(this, 'mergeDefaultAndTheme', arguments);
+ optionUpdated: function () {
+ ToolboxModel.superApply(this, 'optionUpdated', arguments);
each$1(this.option.feature, function (featureOpt, featureName) {
var Feature = get$1(featureName);
@@ -47857,6 +52096,25 @@ var ToolboxModel = extendComponentModel({
}
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
extendComponentView({
type: 'toolbox',
@@ -48084,6 +52342,25 @@ function isUserFeatureName(featureName) {
return featureName.indexOf('my') === 0;
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var saveAsImageLang = lang.toolbox.saveAsImage;
function SaveAsImage(model) {
@@ -48159,6 +52436,25 @@ register$2(
'saveAsImage', SaveAsImage
);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var magicTypeLang = lang.toolbox.magicType;
function MagicType(model) {
@@ -48324,6 +52620,25 @@ registerAction({
register$2('magicType', MagicType);
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var dataViewLang = lang.toolbox.dataView;
var BLOCK_SPLITER = new Array(60).join('-');
@@ -48792,8 +53107,27 @@ registerAction({
}, payload.newOption));
});
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
var curry$6 = curry;
-var each$17 = each$1;
+var each$16 = each$1;
var map$2 = map;
var mathMin$4 = Math.min;
var mathMax$4 = Math.max;
@@ -48948,7 +53282,7 @@ function BrushController(zr) {
* @type {Object}
*/
this._handlers = {};
- each$17(mouseHandlers, function (handler, eventName) {
+ each$16(mouseHandlers, function (handler, eventName) {
this._handlers[eventName] = bind(handler, this);
}, this);
}
@@ -49035,7 +53369,7 @@ BrushController.prototype = {
},
eachCover: function (cb, context) {
- each$17(this._covers, cb, context);
+ each$16(this._covers, cb, context);
},
/**
@@ -49144,7 +53478,7 @@ function doEnableBrush(controller, brushOption) {
take(zr, MUTEX_RESOURCE_KEY, controller._uid);
}
- each$17(controller._handlers, function (handler, eventName) {
+ each$16(controller._handlers, function (handler, eventName) {
zr.on(eventName, handler);
});
@@ -49157,7 +53491,7 @@ function doDisableBrush(controller) {
release(zr, MUTEX_RESOURCE_KEY, controller._uid);
- each$17(controller._handlers, function (handler, eventName) {
+ each$16(controller._handlers, function (handler, eventName) {
zr.off(eventName, handler);
});
@@ -49214,7 +53548,7 @@ function getPanelByPoint(controller, e, localCursorPoint) {
}
var panel;
var transform = controller._transform;
- each$17(panels, function (pn) {
+ each$16(panels, function (pn) {
pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);
});
return panel;
@@ -49235,7 +53569,7 @@ function getPanelByCover(controller, cover) {
function clearCovers(controller) {
var covers = controller._covers;
var originalLength = covers.length;
- each$17(covers, function (cover) {
+ each$16(covers, function (cover) {
controller.group.remove(cover);
}, controller);
covers.length = 0;
@@ -49295,7 +53629,7 @@ function createBaseRectCover(doDrift, controller, brushOption, edgeNames) {
ondragend: curry$6(trigger, controller, {isEnd: true})
}));
- each$17(
+ each$16(
edgeNames,
function (name) {
cover.add(new Rect({
@@ -49355,7 +53689,7 @@ function updateCommon(controller, cover) {
cursor: transformable ? 'move' : 'default'
});
- each$17(
+ each$16(
['w', 'e', 'n', 's', 'se', 'sw', 'ne', 'nw'],
function (name) {
var el = cover.childOfName(name);
@@ -49420,7 +53754,7 @@ function driftRect(toRectRange, fromRectRange, controller, cover, name, dx, dy,
var rectRange = toRectRange(brushOption.range);
var localDelta = toLocalDelta(controller, dx, dy);
- each$17(name.split(''), function (namePart) {
+ each$16(name.split(''), function (namePart) {
var ind = DIRECTION_MAP[namePart];
rectRange[ind[0]][ind[1]] += localDelta[ind[0]];
});
@@ -49437,7 +53771,7 @@ function driftPolygon(controller, cover, dx, dy, e) {
var range = cover.__brushOption.range;
var localDelta = toLocalDelta(controller, dx, dy);
- each$17(range, function (point) {
+ each$16(range, function (point) {
point[0] += localDelta[0];
point[1] += localDelta[1];
});
@@ -49770,6 +54104,26 @@ function getLineRenderer(xyIndex) {
};
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+
var IRRELEVANT_EXCLUDES = {'axisPointer': 1, 'tooltip': 1, 'brush': 1};
/**
@@ -49786,6 +54140,25 @@ function onIrrelevantElement(e, api, targetCoordSysModel) {
&& (coordSys && coordSys.model !== targetCoordSysModel);
}
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
function makeRectPanelClipPath(rect) {
rect = normalizeRect(rect);
return function (localPoints, transform) {
@@ -49816,7 +54189,26 @@ function normalizeRect(rect) {
return BoundingRect.create(rect);
}
-var each$18 = each$1;
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+var each$17 = each$1;
var indexOf$2 = indexOf;
var curry$7 = curry;
@@ -49896,7 +54288,7 @@ function BrushTargetManager(option, ecModel, opt) {
var info = {};
var foundCpts = parseFinder$1(ecModel, option);
- each$18(targetInfoBuilders, function (builder, type) {
+ each$17(targetInfoBuilders, function (builder, type) {
if (!opt || !opt.include || indexOf$2(opt.include, type) >= 0) {
builder(foundCpts, targetInfoList, info);
}
@@ -49926,7 +54318,7 @@ proto$5.setOutputRanges = function (areas, ecModel) {
};
proto$5.matchOutputRanges = function (areas, ecModel, cb) {
- each$18(areas, function (area) {
+ each$17(areas, function (area) {
var targetInfo = this.findTargetInfo(area, ecModel);
if (targetInfo && targetInfo !== true) {
@@ -49942,7 +54334,7 @@ proto$5.matchOutputRanges = function (areas, ecModel, cb) {
};
proto$5.setInputRanges = function (areas, ecModel) {
- each$18(areas, function (area) {
+ each$17(areas, function (area) {
var targetInfo = this.findTargetInfo(area, ecModel);
if (__DEV__) {
@@ -50063,17 +54455,17 @@ var targetInfoBuilders = {
return;
}
- each$18(xAxisModels, function (axisModel) {
+ each$17(xAxisModels, function (axisModel) {
var gridModel = axisModel.axis.grid.model;
gridModelMap.set(gridModel.id, gridModel);
xAxesHas[gridModel.id] = true;
});
- each$18(yAxisModels, function (axisModel) {
+ each$17(yAxisModels, function (axisModel) {
var gridModel = axisModel.axis.grid.model;
gridModelMap.set(gridModel.id, gridModel);
yAxesHas[gridModel.id] = true;
... 62293 lines suppressed ...
--
To stop receiving notification emails like this one, please contact
sushuang@apache.org.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org