提交 e2e443c7 编写于 作者: D deqingli

Merge remote-tracking branch 'upstream/master'

......@@ -32,17 +32,23 @@ ECharts-GL is an extension pack of ECharts, which provides 3D plots, globe visua
## Docs
+ [Tutorial](http://echarts.baidu.com/tutorial.html)
+ [中文](http://echarts.baidu.com/tutorial.html)
+ [English](http://ecomfe.github.io/echarts-doc/public/en/tutorial.html)
+ Tutorial
+ [中文](https://echarts.apache.org/zh/tutorial.html)
+ [English](https://echarts.apache.org/en/tutorial.html)
+ [API](http://echarts.baidu.com/api.html)
+ [中文](http://echarts.baidu.com/api.html)
+ [English](http://ecomfe.github.io/echarts-doc/public/en/api.html)
+ API
+ [中文](https://echarts.apache.org/zh/api.html)
+ [English](https://echarts.apache.org/en/api.html)
+ [Option Manual](http://echarts.baidu.com/option.html)
+ [中文](http://echarts.baidu.com/option.html)
+ [English](http://ecomfe.github.io/echarts-doc/public/en/option.html)
+ Option Manual
+ [中文](https://echarts.apache.org/zh/option.html)
+ [English](https://echarts.apache.org/en/option.html)
## Get Helped
+ [GitHub Issues](https://github.com/apache/incubator-echarts/issues) for bug report and feature requests
+ Email [dev@echarts.apache.org](dev@echarts.apache.org) for general questions
+ Subscribe [mailing list](https://echarts.apache.org/en/maillist.html) to get updated with the project
## Resources
......@@ -160,7 +166,7 @@ ECharts-GL is an extension pack of ECharts, which provides 3D plots, globe visua
## Build
Check this tutorial [Create Custom Build of ECharts](https://ecomfe.github.io/echarts-doc/public/en/tutorial.html#Create%20Custom%20Build%20of%20ECharts)
Check this tutorial [Create Custom Build of ECharts](https://echarts.apache.org/en/tutorial.html#Create%20Custom%20Build%20of%20ECharts)
please.
## License
......
......@@ -49,6 +49,8 @@ export default echarts.extendComponentModel({
mapStyle: {},
mapStyleV2: {},
roam: false
}
});
\ No newline at end of file
......@@ -87,6 +87,7 @@ export default echarts.extendComponentView({
bmap.disablePinchToZoom();
}
/* map 2.0 */
var originalStyle = bMapModel.__mapStyle;
var newMapStyle = bMapModel.get('mapStyle') || {};
......@@ -100,6 +101,20 @@ export default echarts.extendComponentView({
bMapModel.__mapStyle = JSON.parse(mapStyleStr);
}
/* map 3.0 */
var originalStyle2 = bMapModel.__mapStyle2;
var newMapStyle2 = bMapModel.get('mapStyleV2') || {};
// FIXME, Not use JSON methods
var mapStyleStr2 = JSON.stringify(newMapStyle2);
if (JSON.stringify(originalStyle2) !== mapStyleStr2) {
// FIXME May have blank tile when dragging if setMapStyle
if (Object.keys(newMapStyle2).length) {
bmap.setMapStyleV2(newMapStyle2);
}
bMapModel.__mapStyle2 = JSON.parse(mapStyleStr2);
}
rendering = false;
}
});
\ No newline at end of file
......@@ -38,13 +38,14 @@ function normalizeSymbolSize(symbolSize) {
}
function updateRipplePath(rippleGroup, effectCfg) {
const color = effectCfg.rippleEffectColor || effectCfg.color;
rippleGroup.eachChild(function (ripplePath) {
ripplePath.attr({
z: effectCfg.z,
zlevel: effectCfg.zlevel,
style: {
stroke: effectCfg.brushType === 'stroke' ? effectCfg.color : null,
fill: effectCfg.brushType === 'fill' ? effectCfg.color : null
stroke: effectCfg.brushType === 'stroke' ? color : null,
fill: effectCfg.brushType === 'fill' ? color : null
}
});
});
......@@ -81,9 +82,6 @@ effectSymbolProto.startEffectAnimation = function (effectCfg) {
var rippleGroup = this.childAt(1);
for (var i = 0; i < EFFECT_RIPPLE_NUMBER; i++) {
// var ripplePath = createSymbol(
// symbolType, -0.5, -0.5, 1, 1, color
// );
// If width/height are set too small (e.g., set to 1) on ios10
// and macOS Sierra, a circle stroke become a rect, no matter what
// the scale is set. So we set width/height as 2. See #4136.
......@@ -198,6 +196,7 @@ effectSymbolProto.updateData = function (data, idx) {
effectCfg.zlevel = itemModel.getShallow('zlevel') || 0;
effectCfg.symbolType = symbolType;
effectCfg.color = color;
effectCfg.rippleEffectColor = itemModel.get('rippleEffect.color');
this.off('mouseover').off('mouseout').off('emphasis').off('normal');
......
......@@ -120,7 +120,7 @@ Radar.prototype.pointToData = function (pt) {
}
}
return [closestAxisIdx, +(closestAxis && closestAxis.coodToData(radius))];
return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];
};
Radar.prototype.resize = function (radarModel, api) {
......
......@@ -98,8 +98,13 @@ var OPTION_UPDATED = '__optionUpdated';
var ACTION_REG = /^[a-zA-Z0-9_]+$/;
function createRegisterEventWithLowercaseName(method) {
function createRegisterEventWithLowercaseName(method, ignoreDisposed) {
return function (eventName, handler, context) {
if (!ignoreDisposed && this._disposed) {
disposedWarning(this.id);
return;
}
// Event name is all lowercase
eventName = eventName && eventName.toLowerCase();
Eventful.prototype[method].call(this, eventName, handler, context);
......@@ -112,9 +117,9 @@ function createRegisterEventWithLowercaseName(method) {
function MessageCenter() {
Eventful.call(this);
}
MessageCenter.prototype.on = createRegisterEventWithLowercaseName('on');
MessageCenter.prototype.off = createRegisterEventWithLowercaseName('off');
MessageCenter.prototype.one = createRegisterEventWithLowercaseName('one');
MessageCenter.prototype.on = createRegisterEventWithLowercaseName('on', true);
MessageCenter.prototype.off = createRegisterEventWithLowercaseName('off', true);
MessageCenter.prototype.one = createRegisterEventWithLowercaseName('one', true);
zrUtil.mixin(MessageCenter, Eventful);
/**
......@@ -350,6 +355,10 @@ echartsProto.setOption = function (option, notMerge, lazyUpdate) {
if (__DEV__) {
assert(!this[IN_MAIN_PROCESS], '`setOption` should not be called during main process.');
}
if (this._disposed) {
disposedWarning(this.id);
return;
}
var silent;
if (isObject(notMerge)) {
......@@ -485,6 +494,11 @@ echartsProto.getSvgDataUrl = function () {
* @param {string} [opts.excludeComponents]
*/
echartsProto.getDataURL = function (opts) {
if (this._disposed) {
disposedWarning(this.id);
return;
}
opts = opts || {};
var excludeComponents = opts.excludeComponents;
var ecModel = this._model;
......@@ -525,6 +539,11 @@ echartsProto.getDataURL = function (opts) {
* @param {string} [opts.backgroundColor]
*/
echartsProto.getConnectedDataURL = function (opts) {
if (this._disposed) {
disposedWarning(this.id);
return;
}
if (!env.canvasSupported) {
return;
}
......@@ -644,6 +663,11 @@ echartsProto.convertToPixel = zrUtil.curry(doConvertPixel, 'convertToPixel');
echartsProto.convertFromPixel = zrUtil.curry(doConvertPixel, 'convertFromPixel');
function doConvertPixel(methodName, finder, value) {
if (this._disposed) {
disposedWarning(this.id);
return;
}
var ecModel = this._model;
var coordSysList = this._coordSysMgr.getCoordinateSystems();
var result;
......@@ -684,6 +708,11 @@ function doConvertPixel(methodName, finder, value) {
* @return {boolean} result
*/
echartsProto.containPixel = function (finder, value) {
if (this._disposed) {
disposedWarning(this.id);
return;
}
var ecModel = this._model;
var result;
......@@ -1056,6 +1085,10 @@ echartsProto.resize = function (opts) {
if (__DEV__) {
assert(!this[IN_MAIN_PROCESS], '`resize` should not be called during main process.');
}
if (this._disposed) {
disposedWarning(this.id);
return;
}
this._zr.resize(opts);
......@@ -1098,6 +1131,11 @@ function updateStreamModes(ecIns, ecModel) {
* @param {Object} [cfg]
*/
echartsProto.showLoading = function (name, cfg) {
if (this._disposed) {
disposedWarning(this.id);
return;
}
if (isObject(name)) {
cfg = name;
name = '';
......@@ -1122,6 +1160,11 @@ echartsProto.showLoading = function (name, cfg) {
* Hide loading effect
*/
echartsProto.hideLoading = function () {
if (this._disposed) {
disposedWarning(this.id);
return;
}
this._loadingFX && this._zr.remove(this._loadingFX);
this._loadingFX = null;
};
......@@ -1149,6 +1192,11 @@ echartsProto.makeActionFromEvent = function (eventObj) {
* undefined: Auto decide whether perform flush.
*/
echartsProto.dispatchAction = function (payload, opt) {
if (this._disposed) {
disposedWarning(this.id);
return;
}
if (!isObject(opt)) {
opt = {silent: !!opt};
}
......@@ -1317,6 +1365,11 @@ function bindRenderedEvent(zr, ecIns) {
* @param {Array|TypedArray} params.data
*/
echartsProto.appendData = function (params) {
if (this._disposed) {
disposedWarning(this.id);
return;
}
var seriesIndex = params.seriesIndex;
var ecModel = this.getModel();
var seriesModel = ecModel.getSeriesByIndex(seriesIndex);
......@@ -1342,9 +1395,9 @@ echartsProto.appendData = function (params) {
* Register event
* @method
*/
echartsProto.on = createRegisterEventWithLowercaseName('on');
echartsProto.off = createRegisterEventWithLowercaseName('off');
echartsProto.one = createRegisterEventWithLowercaseName('one');
echartsProto.on = createRegisterEventWithLowercaseName('on', false);
echartsProto.off = createRegisterEventWithLowercaseName('off', false);
echartsProto.one = createRegisterEventWithLowercaseName('one', false);
/**
* Prepare view instances of charts and components
......@@ -1622,6 +1675,10 @@ echartsProto.isDisposed = function () {
* Clear
*/
echartsProto.clear = function () {
if (this._disposed) {
disposedWarning(this.id);
return;
}
this.setOption({ series: [] }, true);
};
......@@ -1630,9 +1687,7 @@ echartsProto.clear = function () {
*/
echartsProto.dispose = function () {
if (this._disposed) {
if (__DEV__) {
console.warn('Instance ' + this.id + ' has been disposed');
}
disposedWarning(this.id);
return;
}
this._disposed = true;
......@@ -1657,6 +1712,12 @@ echartsProto.dispose = function () {
zrUtil.mixin(ECharts, Eventful);
function disposedWarning(id) {
if (__DEV__) {
console.warn('Instance ' + id + ' has been disposed');
}
}
function updateHoverLayerStatus(ecIns, ecModel) {
var zr = ecIns._zr;
var storage = zr.storage;
......@@ -2006,9 +2067,9 @@ export function init(dom, theme, opts) {
)
) {
console.warn('Can\'t get DOM width or height. Please check '
+ 'dom.clientWidth and dom.clientHeight. They should not be 0.'
+ 'For example, you may need to call this in the callback '
+ 'of window.onload.');
+ 'dom.clientWidth and dom.clientHeight. They should not be 0.'
+ 'For example, you may need to call this in the callback '
+ 'of window.onload.');
}
}
......
......@@ -31,7 +31,7 @@ import * as zrUtil from 'zrender/src/core/util';
var RADIAN_EPSILON = 1e-4;
function _trim(str) {
return str.replace(/^\s+/, '').replace(/\s+$/, '');
return str.replace(/^\s+|\s+$/g, '');
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册