Skip to content

Commit

Permalink
Dump 3.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Mar 29, 2016
1 parent a0e0c3a commit b73c87e
Show file tree
Hide file tree
Showing 11 changed files with 925 additions and 498 deletions.
519 changes: 337 additions & 182 deletions dist/echarts.common.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions dist/echarts.common.min.js

Large diffs are not rendered by default.

610 changes: 416 additions & 194 deletions dist/echarts.js

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions dist/echarts.min.js

Large diffs are not rendered by default.

172 changes: 99 additions & 73 deletions dist/echarts.simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ return /******/ (function(modules) { // webpackBootstrap
}

var MOUSE_EVENT_NAMES = [
'click', 'dblclick', 'mouseover', 'mouseout', 'globalout'
'click', 'dblclick', 'mouseover', 'mouseout', 'mousedown', 'mouseup', 'globalout'
];
/**
* @private
Expand All @@ -912,8 +912,8 @@ return /******/ (function(modules) { // webpackBootstrap
var ecModel = this.getModel();
var el = e.target;
if (el && el.dataIndex != null) {
var hostModel = el.hostModel || ecModel.getSeriesByIndex(el.seriesIndex);
var params = hostModel && hostModel.getDataParams(el.dataIndex) || {};
var dataModel = el.dataModel || ecModel.getSeriesByIndex(el.seriesIndex);
var params = dataModel && dataModel.getDataParams(el.dataIndex) || {};
params.event = e;
params.type = eveName;
this.trigger(eveName, params);
Expand Down Expand Up @@ -958,7 +958,7 @@ return /******/ (function(modules) { // webpackBootstrap

this._zr.dispose();

instances[this.id] = null;
delete instances[this.id];
};

zrUtil.mixin(ECharts, Eventful);
Expand Down Expand Up @@ -1034,9 +1034,9 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* @type {number}
*/
version: '3.1.4',
version: '3.1.5',
dependencies: {
zrender: '3.0.5'
zrender: '3.0.6'
}
};

Expand Down Expand Up @@ -4953,10 +4953,10 @@ return /******/ (function(modules) { // webpackBootstrap

this.uid = componentUtil.getUID('componentModel');

this.setReadOnly([
'type', 'id', 'uid', 'name', 'mainType', 'subType',
'dependentModels', 'componentIndex'
]);
// this.setReadOnly([
// 'type', 'id', 'uid', 'name', 'mainType', 'subType',
// 'dependentModels', 'componentIndex'
// ]);
}
);

Expand Down Expand Up @@ -10565,43 +10565,49 @@ return /******/ (function(modules) { // webpackBootstrap
getBoundingRect: function () {
var rect = this._rect;
var style = this.style;
if (!rect) {
var needsUpdateRect = !rect;
if (needsUpdateRect) {
var path = this.path;
if (this.__dirtyPath) {
path.beginPath();
this.buildPath(path, this.shape);
}
rect = path.getBoundingRect();
}
/**
* Needs update rect with stroke lineWidth when
* 1. Element changes scale or lineWidth
* 2. First create rect
*/
if (pathHasStroke(style) && (this.__dirty || !this._rect)) {
var rectWithStroke = this._rectWithStroke
|| (this._rectWithStroke = rect.clone());
rectWithStroke.copy(rect);
// FIXME Must after updateTransform
var w = style.lineWidth;
// PENDING, Min line width is needed when line is horizontal or vertical
var lineScale = style.strokeNoScale ? this.getLineScale() : 1;

// Only add extra hover lineWidth when there are no fill
if (!pathHasFill(style)) {
w = Math.max(w, this.strokeContainThreshold);
}
// Consider line width
// Line scale can't be 0;
if (lineScale > 1e-10) {
rectWithStroke.width += w / lineScale;
rectWithStroke.height += w / lineScale;
rectWithStroke.x -= w / lineScale / 2;
rectWithStroke.y -= w / lineScale / 2;
this._rect = rect;

if (pathHasStroke(style)) {
// Needs update rect with stroke lineWidth when
// 1. Element changes scale or lineWidth
// 2. Shape is changed
var rectWithStroke = this._rectWithStroke;
if (this.__dirty || needsUpdateRect) {
var rectWithStroke = this._rectWithStroke
|| (this._rectWithStroke = rect.clone());
rectWithStroke.copy(rect);
// FIXME Must after updateTransform
var w = style.lineWidth;
// PENDING, Min line width is needed when line is horizontal or vertical
var lineScale = style.strokeNoScale ? this.getLineScale() : 1;

// Only add extra hover lineWidth when there are no fill
if (!pathHasFill(style)) {
w = Math.max(w, this.strokeContainThreshold);
}
// Consider line width
// Line scale can't be 0;
if (lineScale > 1e-10) {
rectWithStroke.width += w / lineScale;
rectWithStroke.height += w / lineScale;
rectWithStroke.x -= w / lineScale / 2;
rectWithStroke.y -= w / lineScale / 2;
}
}

// Return rect with stroke
return rectWithStroke;
}
this._rect = rect;

return rect;
},

Expand Down Expand Up @@ -11011,7 +11017,7 @@ return /******/ (function(modules) { // webpackBootstrap
*/
setStyle: function (key, value) {
this.style.set(key, value);
this.dirty();
this.dirty(false);
return this;
}
};
Expand Down Expand Up @@ -12101,7 +12107,8 @@ return /******/ (function(modules) { // webpackBootstrap
var mathPow = Math.pow;
var mathSqrt = Math.sqrt;

var EPSILON = 1e-4;
var EPSILON = 1e-8;
var EPSILON_NUMERIC = 1e-4;

var THREE_SQRT = mathSqrt(3);
var ONE_THIRD = 1 / 3;
Expand Down Expand Up @@ -12367,7 +12374,7 @@ return /******/ (function(modules) { // webpackBootstrap

// At most 32 iteration
for (var i = 0; i < 32; i++) {
if (interval < EPSILON) {
if (interval < EPSILON_NUMERIC) {
break;
}
prev = t - interval;
Expand Down Expand Up @@ -12562,7 +12569,7 @@ return /******/ (function(modules) { // webpackBootstrap

// At most 32 iteration
for (var i = 0; i < 32; i++) {
if (interval < EPSILON) {
if (interval < EPSILON_NUMERIC) {
break;
}
var prev = t - interval;
Expand Down Expand Up @@ -12699,6 +12706,8 @@ return /******/ (function(modules) { // webpackBootstrap
max[1] = mathMax(y0, y1);
};

var xDim = [];
var yDim = [];
/**
* 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入`min`和`max`中
* @memberOf module:zrender/core/bbox
Expand All @@ -12716,34 +12725,36 @@ return /******/ (function(modules) { // webpackBootstrap
bbox.fromCubic = function(
x0, y0, x1, y1, x2, y2, x3, y3, min, max
) {
var xDim = [];
var yDim = [];
var cubicExtrema = curve.cubicExtrema;
var cubicAt = curve.cubicAt;
var left, right, top, bottom;
var i;
var n = cubicExtrema(x0, x1, x2, x3, xDim);
min[0] = Infinity;
min[1] = Infinity;
max[0] = -Infinity;
max[1] = -Infinity;

for (i = 0; i < n; i++) {
xDim[i] = cubicAt(x0, x1, x2, x3, xDim[i]);
var x = cubicAt(x0, x1, x2, x3, xDim[i]);
min[0] = mathMin(x, min[0]);
max[0] = mathMax(x, max[0]);
}
n = cubicExtrema(y0, y1, y2, y3, yDim);
for (i = 0; i < n; i++) {
yDim[i] = cubicAt(y0, y1, y2, y3, yDim[i]);
var y = cubicAt(y0, y1, y2, y3, yDim[i]);
min[1] = mathMin(y, min[1]);
max[1] = mathMax(y, max[1]);
}

xDim.push(x0, x3);
yDim.push(y0, y3);
min[0] = mathMin(x0, min[0]);
max[0] = mathMax(x0, max[0]);
min[0] = mathMin(x3, min[0]);
max[0] = mathMax(x3, max[0]);

left = mathMin.apply(null, xDim);
right = mathMax.apply(null, xDim);
top = mathMin.apply(null, yDim);
bottom = mathMax.apply(null, yDim);

min[0] = left;
min[1] = top;
max[0] = right;
max[1] = bottom;
min[1] = mathMin(y0, min[1]);
max[1] = mathMax(y0, max[1]);
min[1] = mathMin(y3, min[1]);
max[1] = mathMax(y3, max[1]);
};

/**
Expand Down Expand Up @@ -14131,9 +14142,19 @@ return /******/ (function(modules) { // webpackBootstrap
getBoundingRect: function () {
if (!this._rect) {
var style = this.style;
var textVerticalAlign = style.textVerticalAlign;
var rect = textContain.getBoundingRect(
style.text + '', style.textFont || style.font, style.textAlign, style.textBaseline
style.text + '', style.textFont || style.font, style.textAlign,
textVerticalAlign ? 'top' : style.textBaseline
);
switch (textVerticalAlign) {
case 'middle':
rect.y -= rect.height / 2;
break;
case 'bottom':
rect.y -= rect.height;
break;
}
rect.x += style.x || 0;
rect.y += style.y || 0;
this._rect = rect;
Expand Down Expand Up @@ -15029,7 +15050,7 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* @type {string}
*/
zrender.version = '3.0.5';
zrender.version = '3.0.6';

/**
* @param {HTMLElement} dom
Expand Down Expand Up @@ -18899,8 +18920,14 @@ return /******/ (function(modules) { // webpackBootstrap
var minDist = Number.MAX_VALUE;
var nearestIdx = -1;
for (var i = 0, len = this.count(); i < len; i++) {
var dist = Math.abs(this.get(dim, i, stack) - value);
if (dist <= minDist) {
var diff = value - this.get(dim, i, stack);
var dist = Math.abs(diff);
if (dist < minDist
// For the case of two data are same on xAxis, which has sequence data.
// Show the nearest index
// https://github.com/ecomfe/echarts/issues/2869
|| (dist === minDist && diff > 0)
) {
minDist = dist;
nearestIdx = i;
}
Expand Down Expand Up @@ -26094,11 +26121,12 @@ return /******/ (function(modules) { // webpackBootstrap
continue;
}
var deltaY = Math.abs(list[i].y - cy);
var length = list[i].length;
var length = list[i].len;
var length2 = list[i].len2;
var deltaX = (deltaY < r + length)
? Math.sqrt(
(r + length + 20) * (r + length + 20)
- Math.pow(list[i].y - cy, 2)
(r + length + length2) * (r + length + length2)
- deltaY * deltaY
)
: Math.abs(list[i].x - cx);
if (isDownList && deltaX >= lastDeltaX) {
Expand Down Expand Up @@ -26138,8 +26166,8 @@ return /******/ (function(modules) { // webpackBootstrap
upList.push(list[i]);
}
}
changeX(downList, true, cx, cy, r, dir);
changeX(upList, false, cx, cy, r, dir);
changeX(downList, true, cx, cy, r, dir);
}

function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight) {
Expand All @@ -26154,8 +26182,8 @@ return /******/ (function(modules) { // webpackBootstrap
}
}

adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight);
adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight);
adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight);

for (var i = 0; i < labelLayoutList.length; i++) {
var linePoints = labelLayoutList[i].linePoints;
Expand Down Expand Up @@ -26214,15 +26242,13 @@ return /******/ (function(modules) { // webpackBootstrap
var x1 = (isLabelInside ? layout.r / 2 * dx : layout.r * dx) + cx;
var y1 = (isLabelInside ? layout.r / 2 * dy : layout.r * dy) + cy;

// For roseType
labelLineLen += r - layout.r;

textX = x1 + dx * 3;
textY = y1 + dy * 3;

if (!isLabelInside) {
var x2 = x1 + dx * labelLineLen;
var y2 = y1 + dy * labelLineLen;
// For roseType
var x2 = x1 + dx * (labelLineLen + r - layout.r);
var y2 = y1 + dy * (labelLineLen + r - layout.r);
var x3 = x2 + ((dx < 0 ? -1 : 1) * labelLineLen2);
var y3 = y2;

Expand All @@ -26248,8 +26274,8 @@ return /******/ (function(modules) { // webpackBootstrap
y: textY,
position: labelPosition,
height: textRect.height,
length: labelLineLen,
length2: labelLineLen2,
len: labelLineLen,
len2: labelLineLen2,
linePoints: linePoints,
textAlign: textAlign,
verticalAlign: 'middle',
Expand Down
Loading

0 comments on commit b73c87e

Please sign in to comment.