Skip to content

Commit

Permalink
release 4.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
100pah committed Jan 17, 2018
1 parent 6b10351 commit debcd7f
Show file tree
Hide file tree
Showing 16 changed files with 375 additions and 89 deletions.
72 changes: 60 additions & 12 deletions dist/echarts-en.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -9013,6 +9013,11 @@ Painter.prototype = {
finished = false;
}

if (scope.prevElClipPaths) {
// Needs restore the state. If last drawn element is in the clipping area.
ctx.restore();
}

ctx.restore();
}

Expand Down Expand Up @@ -9048,13 +9053,13 @@ Painter.prototype = {
var clipPaths = el.__clipPaths;

// Optimize when clipping on group with several elements
if (scope.prevClipLayer !== currentLayer
if (!scope.prevElClipPaths
|| isClipPathChanged(clipPaths, scope.prevElClipPaths)
) {
// If has previous clipping state, restore from it
if (scope.prevElClipPaths) {
scope.prevClipLayer.ctx.restore();
scope.prevClipLayer = scope.prevElClipPaths = null;
currentLayer.ctx.restore();
scope.prevElClipPaths = null;

// Reset prevEl since context has been restored
scope.prevEl = null;
Expand All @@ -9063,7 +9068,6 @@ Painter.prototype = {
if (clipPaths) {
ctx.save();
doClip(clipPaths, ctx);
scope.prevClipLayer = currentLayer;
scope.prevElClipPaths = clipPaths;
}
}
Expand Down Expand Up @@ -10479,7 +10483,7 @@ var instances$1 = {}; // ZRender实例map索引
/**
* @type {string}
*/
var version$1 = '4.0.0';
var version$1 = '4.0.1';

/**
* Initializing a zrender instance
Expand Down Expand Up @@ -14539,7 +14543,6 @@ function createPathOptions(str, opts) {

opts.applyTransform = function (m) {
transformPath(pathProxy, m);

this.dirty(true);
};

Expand Down Expand Up @@ -20737,13 +20740,20 @@ function compatEC2ItemStyle(opt) {
}
}

function convertNormalEmphasis(opt, optType) {
function convertNormalEmphasis(opt, optType, useExtend) {
if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {
var normalOpt = opt[optType].normal;
var emphasisOpt = opt[optType].emphasis;

if (normalOpt) {
opt[optType] = normalOpt;
// Timeline controlStyle has other properties besides normal and emphasis
if (useExtend) {
opt[optType].normal = opt[optType].emphasis = null;
defaults(opt[optType], normalOpt);
}
else {
opt[optType] = normalOpt;
}
}
if (emphasisOpt) {
opt.emphasis = opt.emphasis || {};
Expand Down Expand Up @@ -20942,7 +20952,7 @@ var compatStyle = function (option, isTheme) {
compatEC3CommonStyles(timelineOpt);
convertNormalEmphasis(timelineOpt, 'label');
convertNormalEmphasis(timelineOpt, 'itemStyle');
convertNormalEmphasis(timelineOpt, 'controlStyle');
convertNormalEmphasis(timelineOpt, 'controlStyle', true);
convertNormalEmphasis(timelineOpt, 'checkpointStyle');

var data = timelineOpt.data;
Expand Down Expand Up @@ -21374,6 +21384,40 @@ function retrieveRawValue(data, dataIndex, dim) {
return rawValueGetters[sourceFormat](dataItem, dataIndex, dimIndex, dimName);
}

/**
* Compatible with some cases (in pie, map) like:
* data: [{name: 'xx', value: 5, selected: true}, ...]
* where only sourceFormat is 'original' and 'objectRows' supported.
*
* ??? TODO
* Supported detail options in data item when using 'arrayRows'.
*
* @param {module:echarts/data/List} data
* @param {number} dataIndex
* @param {string} attr like 'selected'
*/
function retrieveRawAttr(data, dataIndex, attr) {
if (!data) {
return;
}

var sourceFormat = data.getProvider().getSource().sourceFormat;

if (sourceFormat !== SOURCE_FORMAT_ORIGINAL
&& sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS
) {
return;
}

var dataItem = data.getRawDataItem(dataIndex);
if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject$1(dataItem)) {
dataItem = null;
}
if (dataItem) {
return dataItem[attr];
}
}

var DIMENSION_LABEL_REG = /\{@(.+?)\}/g;

// PENDING A little ugly
Expand Down Expand Up @@ -23550,10 +23594,10 @@ var isFunction = isFunction$1;
var isObject = isObject$1;
var parseClassType = ComponentModel.parseClassType;

var version = '4.0.1';
var version = '4.0.2';

var dependencies = {
zrender: '4.0.0'
zrender: '4.0.1'
};

var TEST_FRAME_REMAIN_TIME = 1;
Expand Down Expand Up @@ -35932,7 +35976,11 @@ var dataSelectableMixin = {
var valueDim = ecList.mapDimension('value');
var targetList = this._targetList = [];
for (var i = 0, len = ecList.count(); i < len; i++) {
targetList.push({name: ecList.getName(i), value: ecList.get(valueDim, i)});
targetList.push({
name: ecList.getName(i),
value: ecList.get(valueDim, i),
selected: retrieveRawAttr(ecList, i, 'selected')
});
}
}
this._selectTargetMap = reduce(targetList || [], function (targetMap, target) {
Expand Down
2 changes: 1 addition & 1 deletion dist/echarts-en.common.min.js

Large diffs are not rendered by default.

75 changes: 61 additions & 14 deletions dist/echarts-en.js
Original file line number Diff line number Diff line change
Expand Up @@ -9013,6 +9013,11 @@ Painter.prototype = {
finished = false;
}

if (scope.prevElClipPaths) {
// Needs restore the state. If last drawn element is in the clipping area.
ctx.restore();
}

ctx.restore();
}

Expand Down Expand Up @@ -9048,13 +9053,13 @@ Painter.prototype = {
var clipPaths = el.__clipPaths;

// Optimize when clipping on group with several elements
if (scope.prevClipLayer !== currentLayer
if (!scope.prevElClipPaths
|| isClipPathChanged(clipPaths, scope.prevElClipPaths)
) {
// If has previous clipping state, restore from it
if (scope.prevElClipPaths) {
scope.prevClipLayer.ctx.restore();
scope.prevClipLayer = scope.prevElClipPaths = null;
currentLayer.ctx.restore();
scope.prevElClipPaths = null;

// Reset prevEl since context has been restored
scope.prevEl = null;
Expand All @@ -9063,7 +9068,6 @@ Painter.prototype = {
if (clipPaths) {
ctx.save();
doClip(clipPaths, ctx);
scope.prevClipLayer = currentLayer;
scope.prevElClipPaths = clipPaths;
}
}
Expand Down Expand Up @@ -10479,7 +10483,7 @@ var instances$1 = {}; // ZRender实例map索引
/**
* @type {string}
*/
var version$1 = '4.0.0';
var version$1 = '4.0.1';

/**
* Initializing a zrender instance
Expand Down Expand Up @@ -14582,7 +14586,6 @@ function createPathOptions(str, opts) {

opts.applyTransform = function (m) {
transformPath(pathProxy, m);

this.dirty(true);
};

Expand Down Expand Up @@ -20803,13 +20806,20 @@ function compatEC2ItemStyle(opt) {
}
}

function convertNormalEmphasis(opt, optType) {
function convertNormalEmphasis(opt, optType, useExtend) {
if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {
var normalOpt = opt[optType].normal;
var emphasisOpt = opt[optType].emphasis;

if (normalOpt) {
opt[optType] = normalOpt;
// Timeline controlStyle has other properties besides normal and emphasis
if (useExtend) {
opt[optType].normal = opt[optType].emphasis = null;
defaults(opt[optType], normalOpt);
}
else {
opt[optType] = normalOpt;
}
}
if (emphasisOpt) {
opt.emphasis = opt.emphasis || {};
Expand Down Expand Up @@ -21008,7 +21018,7 @@ var compatStyle = function (option, isTheme) {
compatEC3CommonStyles(timelineOpt);
convertNormalEmphasis(timelineOpt, 'label');
convertNormalEmphasis(timelineOpt, 'itemStyle');
convertNormalEmphasis(timelineOpt, 'controlStyle');
convertNormalEmphasis(timelineOpt, 'controlStyle', true);
convertNormalEmphasis(timelineOpt, 'checkpointStyle');

var data = timelineOpt.data;
Expand Down Expand Up @@ -21440,6 +21450,40 @@ function retrieveRawValue(data, dataIndex, dim) {
return rawValueGetters[sourceFormat](dataItem, dataIndex, dimIndex, dimName);
}

/**
* Compatible with some cases (in pie, map) like:
* data: [{name: 'xx', value: 5, selected: true}, ...]
* where only sourceFormat is 'original' and 'objectRows' supported.
*
* ??? TODO
* Supported detail options in data item when using 'arrayRows'.
*
* @param {module:echarts/data/List} data
* @param {number} dataIndex
* @param {string} attr like 'selected'
*/
function retrieveRawAttr(data, dataIndex, attr) {
if (!data) {
return;
}

var sourceFormat = data.getProvider().getSource().sourceFormat;

if (sourceFormat !== SOURCE_FORMAT_ORIGINAL
&& sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS
) {
return;
}

var dataItem = data.getRawDataItem(dataIndex);
if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject$1(dataItem)) {
dataItem = null;
}
if (dataItem) {
return dataItem[attr];
}
}

var DIMENSION_LABEL_REG = /\{@(.+?)\}/g;

// PENDING A little ugly
Expand Down Expand Up @@ -23616,10 +23660,10 @@ var isFunction = isFunction$1;
var isObject = isObject$1;
var parseClassType = ComponentModel.parseClassType;

var version = '4.0.1';
var version = '4.0.2';

var dependencies = {
zrender: '4.0.0'
zrender: '4.0.1'
};

var TEST_FRAME_REMAIN_TIME = 1;
Expand Down Expand Up @@ -36025,7 +36069,11 @@ var selectableMixin = {
var valueDim = ecList.mapDimension('value');
var targetList = this._targetList = [];
for (var i = 0, len = ecList.count(); i < len; i++) {
targetList.push({name: ecList.getName(i), value: ecList.get(valueDim, i)});
targetList.push({
name: ecList.getName(i),
value: ecList.get(valueDim, i),
selected: retrieveRawAttr(ecList, i, 'selected')
});
}
}
this._selectTargetMap = reduce(targetList || [], function (targetMap, target) {
Expand Down Expand Up @@ -75238,7 +75286,7 @@ TimelineView.extend({
var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width;

var controlModel = timelineModel.getModel('controlStyle');
var showControl = controlModel.get('show');
var showControl = controlModel.get('show', true);
var controlSize = showControl ? controlModel.get('itemSize') : 0;
var controlGap = showControl ? controlModel.get('itemGap') : 0;
var sizePlusGap = controlSize + controlGap;
Expand All @@ -75252,7 +75300,6 @@ TimelineView.extend({
var nextBtnPosition;
var axisExtent;
var controlPosition = controlModel.get('position', true);
var showControl = controlModel.get('show', true);
var showPlayBtn = showControl && controlModel.get('showPlayBtn', true);
var showPrevBtn = showControl && controlModel.get('showPrevBtn', true);
var showNextBtn = showControl && controlModel.get('showNextBtn', true);
Expand Down
2 changes: 1 addition & 1 deletion dist/echarts-en.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/echarts-en.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit debcd7f

Please sign in to comment.