提交 31c35216 编写于 作者: P pah100

release 3.6.2

上级 8c7637db
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -1586,9 +1586,9 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* @type {number}
*/
version: '3.6.1',
version: '3.6.2',
dependencies: {
zrender: '3.5.1'
zrender: '3.5.2'
}
};
......@@ -1864,6 +1864,20 @@ return /******/ (function(modules) { // webpackBootstrap
CoordinateSystemManager.register(type, CoordinateSystem);
};
/**
* Get dimensions of specified coordinate system.
* @param {string} type
* @return {Array.<string|Object>}
*/
echarts.getCoordinateSystemDimensions = function (type) {
var coordSysCreator = CoordinateSystemManager.get(type);
if (coordSysCreator) {
return coordSysCreator.getDimensionsInfo
? coordSysCreator.getDimensionsInfo()
: coordSysCreator.dimensions.slice();
}
};
/**
* Layout is a special stage of visual encoding
* Most visual encoding like color are common for different chart
......@@ -3689,9 +3703,10 @@ return /******/ (function(modules) { // webpackBootstrap
* @param {string} [status='normal'] 'normal' or 'emphasis'
* @param {string} [dataType]
* @param {number} [dimIndex]
* @param {string} [labelProp='label']
* @return {string}
*/
getFormattedLabel: function (dataIndex, status, dataType, dimIndex) {
getFormattedLabel: function (dataIndex, status, dataType, dimIndex, labelProp) {
status = status || 'normal';
var data = this.getData(dataType);
var itemModel = data.getItemModel(dataIndex);
......@@ -3701,7 +3716,7 @@ return /******/ (function(modules) { // webpackBootstrap
params.value = params.value[dimIndex];
}
var formatter = itemModel.get(['label', status, 'formatter']);
var formatter = itemModel.get([labelProp || 'label', status, 'formatter']);
if (typeof formatter === 'function') {
params.status = status;
......@@ -4395,7 +4410,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ },
/* 7 */
/***/ function(module, exports) {
/***/ function(module, exports, __webpack_require__) {
/**
* 数值处理模块
......@@ -4404,6 +4419,8 @@ return /******/ (function(modules) { // webpackBootstrap
var zrUtil = __webpack_require__(4);
var number = {};
var RADIAN_EPSILON = 1e-4;
......@@ -4584,6 +4601,68 @@ return /******/ (function(modules) { // webpackBootstrap
return !isFinite(precision) ? 20 : precision;
};
/**
* Get a data of given precision, assuring the sum of percentages
* in valueList is 1.
* The largest remainer method is used.
* https://en.wikipedia.org/wiki/Largest_remainder_method
*
* @param {Array.<number>} valueList a list of all data
* @param {number} idx index of the data to be processed in valueList
* @param {number} precision integer number showing digits of precision
* @return {number} percent ranging from 0 to 100
*/
number.getPercentWithPrecision = function (valueList, idx, precision) {
if (!valueList[idx]) {
return 0;
}
var sum = zrUtil.reduce(valueList, function (acc, val) {
return acc + (isNaN(val) ? 0 : val);
}, 0);
if (sum === 0) {
return 0;
}
var digits = Math.pow(10, precision);
var votesPerQuota = zrUtil.map(valueList, function (val) {
return (isNaN(val) ? 0 : val) / sum * digits * 100;
});
var targetSeats = digits * 100;
var seats = zrUtil.map(votesPerQuota, function (votes) {
// Assign automatic seats.
return Math.floor(votes);
});
var currentSum = zrUtil.reduce(seats, function (acc, val) {
return acc + val;
}, 0);
var remainder = zrUtil.map(votesPerQuota, function (votes, idx) {
return votes - seats[idx];
});
// Has remainding votes.
while (currentSum < targetSeats) {
// Find next largest remainder.
var max = Number.NEGATIVE_INFINITY;
var maxId = null;
for (var i = 0, len = remainder.length; i < len; ++i) {
if (remainder[i] > max) {
max = remainder[i];
maxId = i;
}
}
// Add a vote to max remainder.
++seats[maxId];
remainder[maxId] = 0;
++currentSum;
}
return seats[idx] / digits;
};
// Number.MAX_SAFE_INTEGER, ie do not support.
number.MAX_SAFE_INTEGER = 9007199254740991;
......@@ -5839,7 +5918,7 @@ return /******/ (function(modules) { // webpackBootstrap
},
/**
* @param {string|Array.<string>} path
* @param {string|Array.<string>} [path]
* @param {module:echarts/model/Model} [parentModel]
* @return {module:echarts/model/Model}
*/
......@@ -5923,6 +6002,7 @@ return /******/ (function(modules) { // webpackBootstrap
return obj;
}
// `path` can be null/undefined
function getParent(model, path) {
var getParentMethod = clazzUtil.get(model, 'getParent');
return getParentMethod ? getParentMethod.call(model, path) : model.parentModel;
......@@ -7565,7 +7645,6 @@ return /******/ (function(modules) { // webpackBootstrap
// Draw rect text
if (style.text != null) {
// var rect = this.getBoundingRect();
this.drawRectText(ctx, this.getBoundingRect());
}
},
......@@ -8208,6 +8287,12 @@ return /******/ (function(modules) { // webpackBootstrap
*/
textPosition: 'inside',
/**
* If not specified, use the boundingRect of a `displayable`.
* @type {Object}
*/
textPositionRect: null,
/**
* [x, y]
* @type {Array.<number>}
......@@ -11532,6 +11617,7 @@ return /******/ (function(modules) { // webpackBootstrap
var font = style.textFont || style.font;
var baseline = style.textBaseline;
var verticalAlign = style.textVerticalAlign;
rect = style.textPositionRect || rect;
textRect = textRect || textContain.getBoundingRect(text, font, align, baseline);
......@@ -11616,7 +11702,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
for (var i = 0; i < textLines.length; i++) {
// Fill after stroke so the outline will not cover the main part.
// Fill after stroke so the outline will not cover the main part.
textStroke && ctx.strokeText(textLines[i], x, y);
textFill && ctx.fillText(textLines[i], x, y);
y += textRect.lineHeight;
......@@ -17471,7 +17557,7 @@ return /******/ (function(modules) { // webpackBootstrap
function formatArrayValue(value) {
var vertially = zrUtil.reduce(value, function (vertially, val, idx) {
var dimItem = data.getDimensionInfo(idx);
return vertially |= dimItem.tooltip !== false && dimItem.tooltipName != null;
return vertially |= dimItem && dimItem.tooltip !== false && dimItem.tooltipName != null;
}, 0);
var result = [];
......@@ -17989,7 +18075,7 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* @type {string}
*/
zrender.version = '3.5.1';
zrender.version = '3.5.2';
/**
* Initializing a zrender instance
......@@ -24557,6 +24643,8 @@ return /******/ (function(modules) { // webpackBootstrap
// Dropped auto calculated niceExtent and use user setted extent
// We assume user wan't to set both interval, min, max to get a better result
this._niceExtent = this._extent.slice();
this._intervalPrecision = helper.getIntervalPrecision(interval);
},
/**
......@@ -24731,7 +24819,7 @@ return /******/ (function(modules) { // webpackBootstrap
interval = result.interval = minInterval;
}
// Tow more digital for tick.
var precision = result.intervalPrecision = numberUtil.getPrecisionSafe(interval) + 2;
var precision = result.intervalPrecision = helper.getIntervalPrecision(interval);
// Niced extent inside original extent
var niceTickExtent = result.niceTickExtent = [
roundNumber(Math.ceil(extent[0] / interval) * interval, precision),
......@@ -24743,6 +24831,15 @@ return /******/ (function(modules) { // webpackBootstrap
return result;
};
/**
* @param {number} interval
* @return {number} interval precision
*/
helper.getIntervalPrecision = function (interval) {
// Tow more digital for tick.
return numberUtil.getPrecisionSafe(interval) + 2;
};
function clamp(niceTickExtent, idx, extent) {
niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);
}
......@@ -25695,7 +25792,6 @@ return /******/ (function(modules) { // webpackBootstrap
if (resultDimIdx != null && resultDimIdx < dimCount) {
dataDims[coordDimIndex] = resultDimIdx;
applyDim(result[resultDimIdx], coordDim, coordDimIndex);
// coordDim === 'value' && valueCandidate == null && (valueCandidate = resultDimIdx);
}
});
});
......@@ -25735,7 +25831,6 @@ return /******/ (function(modules) { // webpackBootstrap
each(dataDims, function (resultDimIdx, coordDimIndex) {
var resultItem = result[resultDimIdx];
applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);
// coordDim === 'value' && valueCandidate == null && (valueCandidate = resultDimIdx);
if (resultItem.name == null && sysDimItemDimsDef) {
resultItem.name = resultItem.tooltipName = sysDimItemDimsDef[coordDimIndex];
}
......@@ -25758,14 +25853,6 @@ return /******/ (function(modules) { // webpackBootstrap
);
resultItem.name == null && (resultItem.name = genName(
// Ensure At least one value dim.
// (dataDimNameMap.get('value') == null
// && (valueCandidate == null || valueCandidate === resultDimIdx)
// // Try to set as 'value' only if coordDim is not set as 'extra'.
// && coordDim == null
// )
// ? 'value'
// :
resultItem.coordDim,
dataDimNameMap
));
......@@ -26365,6 +26452,7 @@ return /******/ (function(modules) { // webpackBootstrap
// If clip the overflow value
clipOverflow: true,
// cursor: null,
label: {
normal: {
......@@ -27177,7 +27265,8 @@ return /******/ (function(modules) { // webpackBootstrap
hoverAnimation: seriesModel.get('hoverAnimation'),
labelModel: seriesModel.getModel('label.normal'),
hoverLabelModel: seriesModel.getModel('label.emphasis')
hoverLabelModel: seriesModel.getModel('label.emphasis'),
cursorStyle: seriesModel.get('cursor')
};
data.diff(oldData)
......@@ -27439,6 +27528,7 @@ return /******/ (function(modules) { // webpackBootstrap
var labelModel = seriesScope && seriesScope.labelModel;
var hoverLabelModel = seriesScope && seriesScope.hoverLabelModel;
var hoverAnimation = seriesScope && seriesScope.hoverAnimation;
var cursorStyle = seriesScope && seriesScope.cursorStyle;
if (!seriesScope || data.hasItemOption) {
var itemModel = data.getItemModel(idx);
......@@ -27454,6 +27544,7 @@ return /******/ (function(modules) { // webpackBootstrap
labelModel = itemModel.getModel(normalLabelAccessPath);
hoverLabelModel = itemModel.getModel(emphasisLabelAccessPath);
hoverAnimation = itemModel.getShallow('hoverAnimation');
cursorStyle = itemModel.getShallow('cursor');
}
else {
hoverItemStyle = zrUtil.extend({}, hoverItemStyle);
......@@ -27470,6 +27561,8 @@ return /******/ (function(modules) { // webpackBootstrap
]);
}
cursorStyle && symbolPath.attr('cursor', cursorStyle);
// PENDING setColor before setStyle!!!
symbolPath.setColor(color);
......@@ -30813,10 +30906,12 @@ return /******/ (function(modules) { // webpackBootstrap
// Notice this case: this coordSys is `cartesian2D` but not `grid`.
var coordSys = seriesModel.coordinateSystem;
var seriesTooltipTrigger = seriesModel.get('tooltip.trigger', true);
var seriesTooltipShow = seriesModel.get('tooltip.show', true);
if (!coordSys
|| seriesTooltipTrigger === 'none'
|| seriesTooltipTrigger === false
|| seriesTooltipTrigger === 'item'
|| seriesTooltipShow === false
|| seriesModel.get('axisPointer.show', true) === false
) {
return;
......@@ -31120,6 +31215,7 @@ return /******/ (function(modules) { // webpackBootstrap
barMinHeight: 0,
// 最小角度为0,仅对极坐标系下的柱状图有效
barMinAngle: 0,
// cursor: null,
// barMaxWidth: null,
// 默认自适应
......@@ -31388,7 +31484,7 @@ return /******/ (function(modules) { // webpackBootstrap
var itemStyleModel = itemModel.getModel('itemStyle.normal');
var hoverStyle = itemModel.getModel('itemStyle.emphasis').getBarItemStyle();
if (!isPolar && isHorizontal) {
if (!isPolar) {
el.setShape('r', itemStyleModel.get('barBorderRadius') || 0);
}
......@@ -31400,6 +31496,9 @@ return /******/ (function(modules) { // webpackBootstrap
itemStyleModel.getBarItemStyle()
));
var cursorStyle = itemModel.getShallow('cursor');
cursorStyle && el.attr('cursor', cursorStyle);
var labelPositionOutside = isHorizontal
? (layout.height > 0 ? 'bottom' : 'top')
: (layout.width > 0 ? 'left' : 'right');
......@@ -31883,6 +31982,7 @@ return /******/ (function(modules) { // webpackBootstrap
var List = __webpack_require__(98);
var zrUtil = __webpack_require__(4);
var modelUtil = __webpack_require__(5);
var numberUtil = __webpack_require__(7);
var completeDimensions = __webpack_require__(110);
var dataSelectableMixin = __webpack_require__(148);
......@@ -31923,11 +32023,18 @@ return /******/ (function(modules) { // webpackBootstrap
getDataParams: function (dataIndex) {
var data = this.getData();
var params = PieSeries.superCall(this, 'getDataParams', dataIndex);
var sum = data.getSum('value');
// FIXME toFixed?
//
// Percent is 0 if sum is 0
params.percent = !sum ? 0 : +(data.get('value', dataIndex) / sum * 100).toFixed(2);
var valueList = [];
data.each('value', function (value) {
valueList.push(value);
});
params.percent = numberUtil.getPercentWithPrecision(
valueList,
dataIndex,
data.hostModel.get('percentPrecision')
);
params.$vars.push('percent');
return params;
......@@ -31970,9 +32077,13 @@ return /******/ (function(modules) { // webpackBootstrap
// 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积)
// roseType: null,
percentPrecision: 2,
// If still show when all data zero.
stillShowZeroSum: true,
// cursor: null,
label: {
normal: {
// If rotate around circle
......@@ -32263,6 +32374,9 @@ return /******/ (function(modules) { // webpackBootstrap
);
sector.hoverStyle = itemStyleModel.getModel('emphasis').getItemStyle();
var cursorStyle = itemModel.getShallow('cursor');
cursorStyle && sector.attr('cursor', cursorStyle);
// Toggle selected
toggleItemSelected(
this,
......
此差异已折叠。
......@@ -96,6 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
var echarts = __webpack_require__(1);
var zrUtil = echarts.util;
function BMapCoordSys(bmap, api) {
this._bmap = bmap;
......@@ -160,6 +161,38 @@ return /******/ (function(modules) { // webpackBootstrap
return echarts.matrix.create();
};
BMapCoordSys.prototype.prepareCustoms = function (data) {
var rect = this.getViewRect();
return {
coordSys: {
// The name exposed to user is always 'cartesian2d' but not 'grid'.
type: 'bmap',
x: rect.x,
y: rect.y,
width: rect.width,
height: rect.height
},
api: {
coord: zrUtil.bind(this.dataToPoint, this),
size: zrUtil.bind(dataToCoordSize, this)
}
};
};
function dataToCoordSize(dataSize, dataItem) {
dataItem = dataItem || [0, 0];
return zrUtil.map([0, 1], function (dimIdx) {
var val = dataItem[dimIdx];
var halfSize = dataSize[dimIdx] / 2;
var p1 = [];
var p2 = [];
p1[dimIdx] = val - halfSize;
p2[dimIdx] = val + halfSize;
p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];
return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);
}, this);
}
var Overlay;
// For deciding which dimensions to use when creating list data
......
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("echarts")):"function"==typeof define&&define.amd?define(["echarts"],t):"object"==typeof exports?exports.bmap=t(require("echarts")):(e.echarts=e.echarts||{},e.echarts.bmap=t(e.echarts))}(this,function(e){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){var n;n=function(e){return o(1).registerCoordinateSystem("bmap",o(2)),o(3),o(4),o(1).registerAction({type:"bmapRoam",event:"bmapRoam",update:"updateLayout"},function(e,t){t.eachComponent("bmap",function(e){var t=e.getBMap(),o=t.getCenter();e.setCenterAndZoom([o.lng,o.lat],t.getZoom())})}),{version:"1.0.0"}}.call(t,o,t,e),!(void 0!==n&&(e.exports=n))},function(t,o){t.exports=e},function(e,t,o){var n;n=function(e){function t(e,t){this._bmap=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t,this._projection=new BMap.MercatorProjection}function n(){function e(e){this._root=e}return e.prototype=new BMap.Overlay,e.prototype.initialize=function(e){return e.getPanes().labelPane.appendChild(this._root),this._root},e.prototype.draw=function(){},e}var r=o(1);t.prototype.dimensions=["lng","lat"],t.prototype.setZoom=function(e){this._zoom=e},t.prototype.setCenter=function(e){this._center=this._projection.lngLatToPoint(new BMap.Point(e[0],e[1]))},t.prototype.setMapOffset=function(e){this._mapOffset=e},t.prototype.getBMap=function(){return this._bmap},t.prototype.dataToPoint=function(e){var t=new BMap.Point(e[0],e[1]),o=this._bmap.pointToOverlayPixel(t),n=this._mapOffset;return[o.x-n[0],o.y-n[1]]},t.prototype.pointToData=function(e){var t=this._mapOffset,e=this._bmap.overlayPixelToPoint({x:e[0]+t[0],y:e[1]+t[1]});return[e.lng,e.lat]},t.prototype.getViewRect=function(){var e=this._api;return new r.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},t.prototype.getRoamTransform=function(){return r.matrix.create()};var i;return t.dimensions=t.prototype.dimensions,t.create=function(e,o){var r,a=o.getDom();e.eachComponent("bmap",function(e){var p=o.getZr().painter.getViewportRoot();if("undefined"==typeof BMap)throw new Error("BMap api is not loaded");if(i=i||n(),r)throw new Error("Only one bmap component can exist");if(!e.__bmap){var s=a.querySelector(".ec-extension-bmap");s&&(p.style.left="0px",p.style.top="0px",a.removeChild(s)),s=document.createElement("div"),s.style.cssText="width:100%;height:100%",s.classList.add("ec-extension-bmap"),a.appendChild(s);var c=e.__bmap=new BMap.Map(s),m=new i(p);c.addOverlay(m)}var c=e.__bmap,l=e.get("center"),d=e.get("zoom");if(l&&d){var f=new BMap.Point(l[0],l[1]);c.centerAndZoom(f,d)}r=new t(c,o),r.setMapOffset(e.__mapOffset||[0,0]),r.setZoom(d),r.setCenter(l),e.coordinateSystem=r}),e.eachSeries(function(e){"bmap"===e.get("coordinateSystem")&&(e.coordinateSystem=r)})},t}.call(t,o,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,o){var n;n=function(e){function t(e,t){return e&&t&&e[0]===t[0]&&e[1]===t[1]}return o(1).extendComponentModel({type:"bmap",getBMap:function(){return this.__bmap},setCenterAndZoom:function(e,t){this.option.center=e,this.option.zoom=t},centerOrZoomChanged:function(e,o){var n=this.option;return!(t(e,n.center)&&o===n.zoom)},defaultOption:{center:[104.114129,37.550339],zoom:5,mapStyle:{},roam:!1}})}.call(t,o,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,o){var n;n=function(e){return o(1).extendComponentView({type:"bmap",render:function(e,t,o){function n(){r||o.dispatchAction({type:"bmapRoam"})}var r=!0,i=e.getBMap(),a=o.getZr().painter.getViewportRoot(),p=e.coordinateSystem,s=function(t,n){if(!r){var i=a.parentNode.parentNode.parentNode,s=[-parseInt(i.style.left,10)||0,-parseInt(i.style.top,10)||0];a.style.left=s[0]+"px",a.style.top=s[1]+"px",p.setMapOffset(s),e.__mapOffset=s,o.dispatchAction({type:"bmapRoam"})}};i.removeEventListener("moving",this._oldMoveHandler),i.removeEventListener("zoomend",this._oldZoomEndHandler),i.addEventListener("moving",s),i.addEventListener("zoomend",n),this._oldMoveHandler=s,this._oldZoomEndHandler=n;var c=e.get("roam");c&&"scale"!==c?i.enableDragging():i.disableDragging(),c&&"move"!==c?(i.enableScrollWheelZoom(),i.enableDoubleClickZoom(),i.enablePinchToZoom()):(i.disableScrollWheelZoom(),i.disableDoubleClickZoom(),i.disablePinchToZoom());var m=e.__mapStyle,l=e.get("mapStyle")||{},d=JSON.stringify(l);JSON.stringify(m)!==d&&(Object.keys(l).length&&i.setMapStyle(l),e.__mapStyle=JSON.parse(d)),r=!1}})}.call(t,o,t,e),!(void 0!==n&&(e.exports=n))}])});
\ No newline at end of file
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("echarts")):"function"==typeof define&&define.amd?define(["echarts"],e):"object"==typeof exports?exports.bmap=e(require("echarts")):(t.echarts=t.echarts||{},t.echarts.bmap=e(t.echarts))}(this,function(t){return function(t){function e(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){var n;n=function(t){return o(1).registerCoordinateSystem("bmap",o(2)),o(3),o(4),o(1).registerAction({type:"bmapRoam",event:"bmapRoam",update:"updateLayout"},function(t,e){e.eachComponent("bmap",function(t){var e=t.getBMap(),o=e.getCenter();t.setCenterAndZoom([o.lng,o.lat],e.getZoom())})}),{version:"1.0.0"}}.call(e,o,e,t),!(void 0!==n&&(t.exports=n))},function(e,o){e.exports=t},function(t,e,o){var n;n=function(t){function e(t,e){this._bmap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e,this._projection=new BMap.MercatorProjection}function n(t,e){return e=e||[0,0],a.map([0,1],function(o){var n=e[o],r=t[o]/2,i=[],a=[];return i[o]=n-r,a[o]=n+r,i[1-o]=a[1-o]=e[1-o],Math.abs(this.dataToPoint(i)[o]-this.dataToPoint(a)[o])},this)}function r(){function t(t){this._root=t}return t.prototype=new BMap.Overlay,t.prototype.initialize=function(t){return t.getPanes().labelPane.appendChild(this._root),this._root},t.prototype.draw=function(){},t}var i=o(1),a=i.util;e.prototype.dimensions=["lng","lat"],e.prototype.setZoom=function(t){this._zoom=t},e.prototype.setCenter=function(t){this._center=this._projection.lngLatToPoint(new BMap.Point(t[0],t[1]))},e.prototype.setMapOffset=function(t){this._mapOffset=t},e.prototype.getBMap=function(){return this._bmap},e.prototype.dataToPoint=function(t){var e=new BMap.Point(t[0],t[1]),o=this._bmap.pointToOverlayPixel(e),n=this._mapOffset;return[o.x-n[0],o.y-n[1]]},e.prototype.pointToData=function(t){var e=this._mapOffset,t=this._bmap.overlayPixelToPoint({x:t[0]+e[0],y:t[1]+e[1]});return[t.lng,t.lat]},e.prototype.getViewRect=function(){var t=this._api;return new i.graphic.BoundingRect(0,0,t.getWidth(),t.getHeight())},e.prototype.getRoamTransform=function(){return i.matrix.create()},e.prototype.prepareCustoms=function(t){var e=this.getViewRect();return{coordSys:{type:"bmap",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:a.bind(this.dataToPoint,this),size:a.bind(n,this)}}};var p;return e.dimensions=e.prototype.dimensions,e.create=function(t,o){var n,i=o.getDom();t.eachComponent("bmap",function(t){var a=o.getZr().painter.getViewportRoot();if("undefined"==typeof BMap)throw new Error("BMap api is not loaded");if(p=p||r(),n)throw new Error("Only one bmap component can exist");if(!t.__bmap){var s=i.querySelector(".ec-extension-bmap");s&&(a.style.left="0px",a.style.top="0px",i.removeChild(s)),s=document.createElement("div"),s.style.cssText="width:100%;height:100%",s.classList.add("ec-extension-bmap"),i.appendChild(s);var c=t.__bmap=new BMap.Map(s),m=new p(a);c.addOverlay(m)}var c=t.__bmap,d=t.get("center"),l=t.get("zoom");if(d&&l){var f=new BMap.Point(d[0],d[1]);c.centerAndZoom(f,l)}n=new e(c,o),n.setMapOffset(t.__mapOffset||[0,0]),n.setZoom(l),n.setCenter(d),t.coordinateSystem=n}),t.eachSeries(function(t){"bmap"===t.get("coordinateSystem")&&(t.coordinateSystem=n)})},e}.call(e,o,e,t),!(void 0!==n&&(t.exports=n))},function(t,e,o){var n;n=function(t){function e(t,e){return t&&e&&t[0]===e[0]&&t[1]===e[1]}return o(1).extendComponentModel({type:"bmap",getBMap:function(){return this.__bmap},setCenterAndZoom:function(t,e){this.option.center=t,this.option.zoom=e},centerOrZoomChanged:function(t,o){var n=this.option;return!(e(t,n.center)&&o===n.zoom)},defaultOption:{center:[104.114129,37.550339],zoom:5,mapStyle:{},roam:!1}})}.call(e,o,e,t),!(void 0!==n&&(t.exports=n))},function(t,e,o){var n;n=function(t){return o(1).extendComponentView({type:"bmap",render:function(t,e,o){function n(){r||o.dispatchAction({type:"bmapRoam"})}var r=!0,i=t.getBMap(),a=o.getZr().painter.getViewportRoot(),p=t.coordinateSystem,s=function(e,n){if(!r){var i=a.parentNode.parentNode.parentNode,s=[-parseInt(i.style.left,10)||0,-parseInt(i.style.top,10)||0];a.style.left=s[0]+"px",a.style.top=s[1]+"px",p.setMapOffset(s),t.__mapOffset=s,o.dispatchAction({type:"bmapRoam"})}};i.removeEventListener("moving",this._oldMoveHandler),i.removeEventListener("zoomend",this._oldZoomEndHandler),i.addEventListener("moving",s),i.addEventListener("zoomend",n),this._oldMoveHandler=s,this._oldZoomEndHandler=n;var c=t.get("roam");c&&"scale"!==c?i.enableDragging():i.disableDragging(),c&&"move"!==c?(i.enableScrollWheelZoom(),i.enableDoubleClickZoom(),i.enablePinchToZoom()):(i.disableScrollWheelZoom(),i.disableDoubleClickZoom(),i.disablePinchToZoom());var m=t.__mapStyle,d=t.get("mapStyle")||{},l=JSON.stringify(d);JSON.stringify(m)!==l&&(Object.keys(d).length&&i.setMapStyle(d),t.__mapStyle=JSON.parse(l)),r=!1}})}.call(e,o,e,t),!(void 0!==n&&(t.exports=n))}])});
\ No newline at end of file
{
"name": "echarts",
"version": "3.6.1",
"version": "3.6.2",
"description": "A powerful charting and visualization library for browser",
"keywords": [
"visualization",
......@@ -35,7 +35,7 @@
"prepublish": "node build/amd2common.js"
},
"dependencies": {
"zrender": "^3.5.1"
"zrender": "^3.5.2"
},
"devDependencies": {
"coordtransform": "^2.0.2",
......@@ -45,6 +45,6 @@
"fs-extra": "^0.26.5",
"glob": "^7.0.0",
"webpack": "^1.12.13",
"zrender": "^3.5.1"
"zrender": "^3.5.2"
}
}
......@@ -1516,9 +1516,9 @@ define(function (require) {
/**
* @type {number}
*/
version: '3.6.1',
version: '3.6.2',
dependencies: {
zrender: '3.5.1'
zrender: '3.5.2'
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册