未验证 提交 90243fca 编写于 作者: Y Yi Shen 提交者: GitHub

Merge pull request #13092 from apache/release-dev

Release 4.9.0
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -11289,7 +11289,7 @@ var painterCtors = {
/**
* @type {string}
*/
var version$1 = '4.3.1';
var version$1 = '4.3.2';
/**
* Initializing a zrender instance
......@@ -25578,7 +25578,7 @@ var proto = Scheduler.prototype;
* @param {Object} payload
*/
proto.restoreData = function (ecModel, payload) {
// TODO: Only restroe needed series and components, but not all components.
// TODO: Only restore 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`,
......@@ -27155,10 +27155,10 @@ var isFunction = isFunction$1;
var isObject = isObject$1;
var parseClassType = ComponentModel.parseClassType;
var version = '4.8.0';
var version = '4.9.0';
var dependencies = {
zrender: '4.3.1'
zrender: '4.3.2'
};
var TEST_FRAME_REMAIN_TIME = 1;
......@@ -30401,7 +30401,7 @@ listProto.mapDimension = function (coordDim, idx) {
* Initialize from data
* @param {Array.<Object|number|Array>} data source or data or data provider.
* @param {Array.<string>} [nameLIst] The name of a datum is used on data diff and
* defualt label/tooltip.
* default label/tooltip.
* A name can be specified in encode.itemName,
* or dataItem.name (only for series option data),
* or provided in nameList from outside.
......@@ -33594,7 +33594,7 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) {
}
else {
symbolPath.setStyle({
opacity: null,
opacity: 1,
shadowBlur: null,
shadowOffsetX: null,
shadowOffsetY: null,
......@@ -35779,7 +35779,7 @@ var dataSample = function (seriesType) {
var valueAxis = coordSys.getOtherAxis(baseAxis);
var extent = baseAxis.getExtent();
// Coordinste system has been resized
var size = extent[1] - extent[0];
var size = Math.abs(extent[1] - extent[0]);
var rate = Math.round(data.count() / size);
if (rate > 1) {
var sampler;
......@@ -37945,8 +37945,8 @@ function rotateTextRect(textRect, rotate) {
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 afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians));
var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians));
var rotatedRect = new BoundingRect(boundingBox.x, boundingBox.y, afterWidth, afterHeight);
return rotatedRect;
......@@ -39141,7 +39141,7 @@ var defaultOption = {
name: '',
// 'start' | 'middle' | 'end'
nameLocation: 'end',
// By degree. By defualt auto rotate by nameLocation.
// By degree. By default auto rotate by nameLocation.
nameRotate: null,
nameTruncate: {
maxWidth: null,
......@@ -42231,20 +42231,25 @@ extendChartView({
var bgEls = [];
var oldBgEls = this._backgroundEls || [];
var createBackground = function (dataIndex) {
var bgLayout = getLayout[coord.type](data, dataIndex);
var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);
bgEl.useStyle(backgroundModel.getBarItemStyle());
// Only cartesian2d support borderRadius.
if (coord.type === 'cartesian2d') {
bgEl.setShape('r', barBorderRadius);
}
bgEls[dataIndex] = bgEl;
return bgEl;
};
data.diff(oldData)
.add(function (dataIndex) {
var itemModel = data.getItemModel(dataIndex);
var layout = getLayout[coord.type](data, dataIndex, itemModel);
if (drawBackground) {
var bgLayout = getLayout[coord.type](data, dataIndex);
var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);
bgEl.useStyle(backgroundModel.getBarItemStyle());
// Only cartesian2d support borderRadius.
if (coord.type === 'cartesian2d') {
bgEl.setShape('r', barBorderRadius);
}
bgEls[dataIndex] = bgEl;
createBackground(dataIndex);
}
// If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy".
......@@ -42278,13 +42283,19 @@ extendChartView({
var layout = getLayout[coord.type](data, newIndex, itemModel);
if (drawBackground) {
var bgEl = oldBgEls[oldIndex];
bgEl.useStyle(backgroundModel.getBarItemStyle());
// Only cartesian2d support borderRadius.
if (coord.type === 'cartesian2d') {
bgEl.setShape('r', barBorderRadius);
var bgEl;
if (oldBgEls.length === 0) {
bgEl = createBackground(oldIndex);
}
else {
bgEl = oldBgEls[oldIndex];
bgEl.useStyle(backgroundModel.getBarItemStyle());
// Only cartesian2d support borderRadius.
if (coord.type === 'cartesian2d') {
bgEl.setShape('r', barBorderRadius);
}
bgEls[newIndex] = bgEl;
}
bgEls[newIndex] = bgEl;
var bgLayout = getLayout[coord.type](data, newIndex);
var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);
......@@ -42444,8 +42455,31 @@ var clip = {
return clipped;
},
polar: function (coordSysClipArea) {
return false;
polar: function (coordSysClipArea, layout) {
var signR = layout.r0 <= layout.r ? 1 : -1;
// Make sure r is larger than r0
if (signR < 0) {
var r = layout.r;
layout.r = layout.r0;
layout.r0 = r;
}
var r = mathMin$4(layout.r, coordSysClipArea.r);
var r0 = mathMax$4(layout.r0, coordSysClipArea.r0);
layout.r = r;
layout.r0 = r0;
var clipped = r - r0 < 0;
// Reverse back
if (signR < 0) {
var r = layout.r;
layout.r = layout.r0;
layout.r0 = r;
}
return clipped;
}
};
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -11289,7 +11289,7 @@ var painterCtors = {
/**
* @type {string}
*/
var version$1 = '4.3.1';
var version$1 = '4.3.2';
/**
* Initializing a zrender instance
......@@ -25578,7 +25578,7 @@ var proto = Scheduler.prototype;
* @param {Object} payload
*/
proto.restoreData = function (ecModel, payload) {
// TODO: Only restroe needed series and components, but not all components.
// TODO: Only restore 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`,
......@@ -27155,10 +27155,10 @@ var isFunction = isFunction$1;
var isObject = isObject$1;
var parseClassType = ComponentModel.parseClassType;
var version = '4.8.0';
var version = '4.9.0';
var dependencies = {
zrender: '4.3.1'
zrender: '4.3.2'
};
var TEST_FRAME_REMAIN_TIME = 1;
......@@ -30401,7 +30401,7 @@ listProto.mapDimension = function (coordDim, idx) {
* Initialize from data
* @param {Array.<Object|number|Array>} data source or data or data provider.
* @param {Array.<string>} [nameLIst] The name of a datum is used on data diff and
* defualt label/tooltip.
* default label/tooltip.
* A name can be specified in encode.itemName,
* or dataItem.name (only for series option data),
* or provided in nameList from outside.
......@@ -33594,7 +33594,7 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) {
}
else {
symbolPath.setStyle({
opacity: null,
opacity: 1,
shadowBlur: null,
shadowOffsetX: null,
shadowOffsetY: null,
......@@ -35779,7 +35779,7 @@ var dataSample = function (seriesType) {
var valueAxis = coordSys.getOtherAxis(baseAxis);
var extent = baseAxis.getExtent();
// Coordinste system has been resized
var size = extent[1] - extent[0];
var size = Math.abs(extent[1] - extent[0]);
var rate = Math.round(data.count() / size);
if (rate > 1) {
var sampler;
......@@ -37945,8 +37945,8 @@ function rotateTextRect(textRect, rotate) {
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 afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians));
var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians));
var rotatedRect = new BoundingRect(boundingBox.x, boundingBox.y, afterWidth, afterHeight);
return rotatedRect;
......@@ -39141,7 +39141,7 @@ var defaultOption = {
name: '',
// 'start' | 'middle' | 'end'
nameLocation: 'end',
// By degree. By defualt auto rotate by nameLocation.
// By degree. By default auto rotate by nameLocation.
nameRotate: null,
nameTruncate: {
maxWidth: null,
......@@ -42231,20 +42231,25 @@ extendChartView({
var bgEls = [];
var oldBgEls = this._backgroundEls || [];
var createBackground = function (dataIndex) {
var bgLayout = getLayout[coord.type](data, dataIndex);
var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);
bgEl.useStyle(backgroundModel.getBarItemStyle());
// Only cartesian2d support borderRadius.
if (coord.type === 'cartesian2d') {
bgEl.setShape('r', barBorderRadius);
}
bgEls[dataIndex] = bgEl;
return bgEl;
};
data.diff(oldData)
.add(function (dataIndex) {
var itemModel = data.getItemModel(dataIndex);
var layout = getLayout[coord.type](data, dataIndex, itemModel);
if (drawBackground) {
var bgLayout = getLayout[coord.type](data, dataIndex);
var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);
bgEl.useStyle(backgroundModel.getBarItemStyle());
// Only cartesian2d support borderRadius.
if (coord.type === 'cartesian2d') {
bgEl.setShape('r', barBorderRadius);
}
bgEls[dataIndex] = bgEl;
createBackground(dataIndex);
}
// If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy".
......@@ -42278,13 +42283,19 @@ extendChartView({
var layout = getLayout[coord.type](data, newIndex, itemModel);
if (drawBackground) {
var bgEl = oldBgEls[oldIndex];
bgEl.useStyle(backgroundModel.getBarItemStyle());
// Only cartesian2d support borderRadius.
if (coord.type === 'cartesian2d') {
bgEl.setShape('r', barBorderRadius);
var bgEl;
if (oldBgEls.length === 0) {
bgEl = createBackground(oldIndex);
}
else {
bgEl = oldBgEls[oldIndex];
bgEl.useStyle(backgroundModel.getBarItemStyle());
// Only cartesian2d support borderRadius.
if (coord.type === 'cartesian2d') {
bgEl.setShape('r', barBorderRadius);
}
bgEls[newIndex] = bgEl;
}
bgEls[newIndex] = bgEl;
var bgLayout = getLayout[coord.type](data, newIndex);
var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);
......@@ -42444,8 +42455,31 @@ var clip = {
return clipped;
},
polar: function (coordSysClipArea) {
return false;
polar: function (coordSysClipArea, layout) {
var signR = layout.r0 <= layout.r ? 1 : -1;
// Make sure r is larger than r0
if (signR < 0) {
var r = layout.r;
layout.r = layout.r0;
layout.r0 = r;
}
var r = mathMin$4(layout.r, coordSysClipArea.r);
var r0 = mathMax$4(layout.r0, coordSysClipArea.r0);
layout.r = r;
layout.r0 = r0;
var clipped = r - r0 < 0;
// Reverse back
if (signR < 0) {
var r = layout.r;
layout.r = layout.r0;
layout.r0 = r;
}
return clipped;
}
};
此差异已折叠。
......@@ -179,7 +179,12 @@ BMapCoordSys.create = function (ecModel, api) {
// Not support IE8
bmapRoot.classList.add('ec-extension-bmap');
root.appendChild(bmapRoot);
var bmap = bmapModel.__bmap = new BMap.Map(bmapRoot);
// initialize bmap
var mapOptions = bmapModel.get('mapOptions') || {};
// Not support `mapType`, use `bmap.setMapType(MapType)` instead.
delete mapOptions.mapType;
var bmap = bmapModel.__bmap = new BMap.Map(bmapRoot, mapOptions);
var overlay = new Overlay(viewportRoot);
bmap.addOverlay(overlay);
......@@ -196,8 +201,13 @@ BMapCoordSys.create = function (ecModel, api) {
var center = bmapModel.get('center');
var zoom = bmapModel.get('zoom');
if (center && zoom) {
var pt = new BMap.Point(center[0], center[1]);
bmap.centerAndZoom(pt, zoom);
var bmapCenter = bmap.getCenter();
var bmapZoom = bmap.getZoom();
var centerOrZoomChanged = bmapModel.centerOrZoomChanged([bmapCenter.lng, bmapCenter.lat], bmapZoom);
if (centerOrZoomChanged) {
var pt = new BMap.Point(center[0], center[1]);
bmap.centerAndZoom(pt, zoom);
}
}
bmapCoordSys = new BMapCoordSys(bmap, api);
......@@ -262,348 +272,19 @@ echarts.extendComponentModel({
zoom: 5,
// 2.0 http://lbsyun.baidu.com/custom/index.htm
mapStyle: {},
// 3.0 http://lbsyun.baidu.com/index.php?title=open/custom
mapStyleV2: {},
// See https://lbsyun.baidu.com/cms/jsapi/reference/jsapi_reference.html#a0b1
mapOptions: {},
roam: false
}
});
/**
* @module zrender/core/util
*/
// 用于处理merge时无法遍历Date等对象的问题
var BUILTIN_OBJECT = {
'[object Function]': 1,
'[object RegExp]': 1,
'[object Date]': 1,
'[object Error]': 1,
'[object CanvasGradient]': 1,
'[object CanvasPattern]': 1,
// For node-canvas
'[object Image]': 1,
'[object Canvas]': 1
};
var TYPED_ARRAY = {
'[object Int8Array]': 1,
'[object Uint8Array]': 1,
'[object Uint8ClampedArray]': 1,
'[object Int16Array]': 1,
'[object Uint16Array]': 1,
'[object Int32Array]': 1,
'[object Uint32Array]': 1,
'[object Float32Array]': 1,
'[object Float64Array]': 1
};
var objToString = Object.prototype.toString;
/**
* Those data types can be cloned:
* Plain object, Array, TypedArray, number, string, null, undefined.
* Those data types will be assgined using the orginal data:
* BUILTIN_OBJECT
* Instance of user defined class will be cloned to a plain object, without
* properties in prototype.
* Other data types is not supported (not sure what will happen).
*
* Caution: do not support clone Date, for performance consideration.
* (There might be a large number of date in `series.data`).
* So date should not be modified in and out of echarts.
*
* @param {*} source
* @return {*} new
*/
function clone(source) {
if (source == null || typeof source !== 'object') {
return source;
}
var result = source;
var typeStr = objToString.call(source);
if (typeStr === '[object Array]') {
if (!isPrimitive(source)) {
result = [];
for (var i = 0, len = source.length; i < len; i++) {
result[i] = clone(source[i]);
}
}
}
else if (TYPED_ARRAY[typeStr]) {
if (!isPrimitive(source)) {
var Ctor = source.constructor;
if (source.constructor.from) {
result = Ctor.from(source);
}
else {
result = new Ctor(source.length);
for (var i = 0, len = source.length; i < len; i++) {
result[i] = clone(source[i]);
}
}
}
}
else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {
result = {};
for (var key in source) {
if (source.hasOwnProperty(key)) {
result[key] = clone(source[key]);
}
}
}
return result;
}
/**
* @memberOf module:zrender/core/util
* @param {*} target
* @param {*} source
* @param {boolean} [overwrite=false]
*/
/**
* @param {Array} targetAndSources The first item is target, and the rests are source.
* @param {boolean} [overwrite=false]
* @return {*} target
*/
/**
* @param {*} target
* @param {*} source
* @memberOf module:zrender/core/util
*/
/**
* @param {*} target
* @param {*} source
* @param {boolean} [overlay=false]
* @memberOf module:zrender/core/util
*/
/**
* 查询数组中元素的index
* @memberOf module:zrender/core/util
*/
/**
* 构造类继承关系
*
* @memberOf module:zrender/core/util
* @param {Function} clazz 源类
* @param {Function} baseClazz 基类
*/
/**
* @memberOf module:zrender/core/util
* @param {Object|Function} target
* @param {Object|Function} sorce
* @param {boolean} overlay
*/
/**
* Consider typed array.
* @param {Array|TypedArray} data
*/
/**
* 数组或对象遍历
* @memberOf module:zrender/core/util
* @param {Object|Array} obj
* @param {Function} cb
* @param {*} [context]
*/
/**
* 数组映射
* @memberOf module:zrender/core/util
* @param {Array} obj
* @param {Function} cb
* @param {*} [context]
* @return {Array}
*/
/**
* @memberOf module:zrender/core/util
* @param {Array} obj
* @param {Function} cb
* @param {Object} [memo]
* @param {*} [context]
* @return {Array}
*/
/**
* 数组过滤
* @memberOf module:zrender/core/util
* @param {Array} obj
* @param {Function} cb
* @param {*} [context]
* @return {Array}
*/
/**
* 数组项查找
* @memberOf module:zrender/core/util
* @param {Array} obj
* @param {Function} cb
* @param {*} [context]
* @return {*}
*/
/**
* @memberOf module:zrender/core/util
* @param {Function} func
* @param {*} context
* @return {Function}
*/
/**
* @memberOf module:zrender/core/util
* @param {Function} func
* @return {Function}
*/
/**
* @memberOf module:zrender/core/util
* @param {*} value
* @return {boolean}
*/
/**
* @memberOf module:zrender/core/util
* @param {*} value
* @return {boolean}
*/
/**
* @memberOf module:zrender/core/util
* @param {*} value
* @return {boolean}
*/
/**
* @memberOf module:zrender/core/util
* @param {*} value
* @return {boolean}
*/
/**
* @memberOf module:zrender/core/util
* @param {*} value
* @return {boolean}
*/
/**
* @memberOf module:zrender/core/util
* @param {*} value
* @return {boolean}
*/