Skip to content

Commit debcd7f

Browse files
committed
release 4.0.2
1 parent 6b10351 commit debcd7f

16 files changed

+375
-89
lines changed

dist/echarts-en.common.js

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9013,6 +9013,11 @@ Painter.prototype = {
90139013
finished = false;
90149014
}
90159015

9016+
if (scope.prevElClipPaths) {
9017+
// Needs restore the state. If last drawn element is in the clipping area.
9018+
ctx.restore();
9019+
}
9020+
90169021
ctx.restore();
90179022
}
90189023

@@ -9048,13 +9053,13 @@ Painter.prototype = {
90489053
var clipPaths = el.__clipPaths;
90499054

90509055
// Optimize when clipping on group with several elements
9051-
if (scope.prevClipLayer !== currentLayer
9056+
if (!scope.prevElClipPaths
90529057
|| isClipPathChanged(clipPaths, scope.prevElClipPaths)
90539058
) {
90549059
// If has previous clipping state, restore from it
90559060
if (scope.prevElClipPaths) {
9056-
scope.prevClipLayer.ctx.restore();
9057-
scope.prevClipLayer = scope.prevElClipPaths = null;
9061+
currentLayer.ctx.restore();
9062+
scope.prevElClipPaths = null;
90589063

90599064
// Reset prevEl since context has been restored
90609065
scope.prevEl = null;
@@ -9063,7 +9068,6 @@ Painter.prototype = {
90639068
if (clipPaths) {
90649069
ctx.save();
90659070
doClip(clipPaths, ctx);
9066-
scope.prevClipLayer = currentLayer;
90679071
scope.prevElClipPaths = clipPaths;
90689072
}
90699073
}
@@ -10479,7 +10483,7 @@ var instances$1 = {}; // ZRender实例map索引
1047910483
/**
1048010484
* @type {string}
1048110485
*/
10482-
var version$1 = '4.0.0';
10486+
var version$1 = '4.0.1';
1048310487

1048410488
/**
1048510489
* Initializing a zrender instance
@@ -14539,7 +14543,6 @@ function createPathOptions(str, opts) {
1453914543

1454014544
opts.applyTransform = function (m) {
1454114545
transformPath(pathProxy, m);
14542-
1454314546
this.dirty(true);
1454414547
};
1454514548

@@ -20737,13 +20740,20 @@ function compatEC2ItemStyle(opt) {
2073720740
}
2073820741
}
2073920742

20740-
function convertNormalEmphasis(opt, optType) {
20743+
function convertNormalEmphasis(opt, optType, useExtend) {
2074120744
if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {
2074220745
var normalOpt = opt[optType].normal;
2074320746
var emphasisOpt = opt[optType].emphasis;
2074420747

2074520748
if (normalOpt) {
20746-
opt[optType] = normalOpt;
20749+
// Timeline controlStyle has other properties besides normal and emphasis
20750+
if (useExtend) {
20751+
opt[optType].normal = opt[optType].emphasis = null;
20752+
defaults(opt[optType], normalOpt);
20753+
}
20754+
else {
20755+
opt[optType] = normalOpt;
20756+
}
2074720757
}
2074820758
if (emphasisOpt) {
2074920759
opt.emphasis = opt.emphasis || {};
@@ -20942,7 +20952,7 @@ var compatStyle = function (option, isTheme) {
2094220952
compatEC3CommonStyles(timelineOpt);
2094320953
convertNormalEmphasis(timelineOpt, 'label');
2094420954
convertNormalEmphasis(timelineOpt, 'itemStyle');
20945-
convertNormalEmphasis(timelineOpt, 'controlStyle');
20955+
convertNormalEmphasis(timelineOpt, 'controlStyle', true);
2094620956
convertNormalEmphasis(timelineOpt, 'checkpointStyle');
2094720957

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

21387+
/**
21388+
* Compatible with some cases (in pie, map) like:
21389+
* data: [{name: 'xx', value: 5, selected: true}, ...]
21390+
* where only sourceFormat is 'original' and 'objectRows' supported.
21391+
*
21392+
* ??? TODO
21393+
* Supported detail options in data item when using 'arrayRows'.
21394+
*
21395+
* @param {module:echarts/data/List} data
21396+
* @param {number} dataIndex
21397+
* @param {string} attr like 'selected'
21398+
*/
21399+
function retrieveRawAttr(data, dataIndex, attr) {
21400+
if (!data) {
21401+
return;
21402+
}
21403+
21404+
var sourceFormat = data.getProvider().getSource().sourceFormat;
21405+
21406+
if (sourceFormat !== SOURCE_FORMAT_ORIGINAL
21407+
&& sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS
21408+
) {
21409+
return;
21410+
}
21411+
21412+
var dataItem = data.getRawDataItem(dataIndex);
21413+
if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject$1(dataItem)) {
21414+
dataItem = null;
21415+
}
21416+
if (dataItem) {
21417+
return dataItem[attr];
21418+
}
21419+
}
21420+
2137721421
var DIMENSION_LABEL_REG = /\{@(.+?)\}/g;
2137821422

2137921423
// PENDING A little ugly
@@ -23550,10 +23594,10 @@ var isFunction = isFunction$1;
2355023594
var isObject = isObject$1;
2355123595
var parseClassType = ComponentModel.parseClassType;
2355223596

23553-
var version = '4.0.1';
23597+
var version = '4.0.2';
2355423598

2355523599
var dependencies = {
23556-
zrender: '4.0.0'
23600+
zrender: '4.0.1'
2355723601
};
2355823602

2355923603
var TEST_FRAME_REMAIN_TIME = 1;
@@ -35932,7 +35976,11 @@ var dataSelectableMixin = {
3593235976
var valueDim = ecList.mapDimension('value');
3593335977
var targetList = this._targetList = [];
3593435978
for (var i = 0, len = ecList.count(); i < len; i++) {
35935-
targetList.push({name: ecList.getName(i), value: ecList.get(valueDim, i)});
35979+
targetList.push({
35980+
name: ecList.getName(i),
35981+
value: ecList.get(valueDim, i),
35982+
selected: retrieveRawAttr(ecList, i, 'selected')
35983+
});
3593635984
}
3593735985
}
3593835986
this._selectTargetMap = reduce(targetList || [], function (targetMap, target) {

dist/echarts-en.common.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/echarts-en.js

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9013,6 +9013,11 @@ Painter.prototype = {
90139013
finished = false;
90149014
}
90159015

9016+
if (scope.prevElClipPaths) {
9017+
// Needs restore the state. If last drawn element is in the clipping area.
9018+
ctx.restore();
9019+
}
9020+
90169021
ctx.restore();
90179022
}
90189023

@@ -9048,13 +9053,13 @@ Painter.prototype = {
90489053
var clipPaths = el.__clipPaths;
90499054

90509055
// Optimize when clipping on group with several elements
9051-
if (scope.prevClipLayer !== currentLayer
9056+
if (!scope.prevElClipPaths
90529057
|| isClipPathChanged(clipPaths, scope.prevElClipPaths)
90539058
) {
90549059
// If has previous clipping state, restore from it
90559060
if (scope.prevElClipPaths) {
9056-
scope.prevClipLayer.ctx.restore();
9057-
scope.prevClipLayer = scope.prevElClipPaths = null;
9061+
currentLayer.ctx.restore();
9062+
scope.prevElClipPaths = null;
90589063

90599064
// Reset prevEl since context has been restored
90609065
scope.prevEl = null;
@@ -9063,7 +9068,6 @@ Painter.prototype = {
90639068
if (clipPaths) {
90649069
ctx.save();
90659070
doClip(clipPaths, ctx);
9066-
scope.prevClipLayer = currentLayer;
90679071
scope.prevElClipPaths = clipPaths;
90689072
}
90699073
}
@@ -10479,7 +10483,7 @@ var instances$1 = {}; // ZRender实例map索引
1047910483
/**
1048010484
* @type {string}
1048110485
*/
10482-
var version$1 = '4.0.0';
10486+
var version$1 = '4.0.1';
1048310487

1048410488
/**
1048510489
* Initializing a zrender instance
@@ -14582,7 +14586,6 @@ function createPathOptions(str, opts) {
1458214586

1458314587
opts.applyTransform = function (m) {
1458414588
transformPath(pathProxy, m);
14585-
1458614589
this.dirty(true);
1458714590
};
1458814591

@@ -20803,13 +20806,20 @@ function compatEC2ItemStyle(opt) {
2080320806
}
2080420807
}
2080520808

20806-
function convertNormalEmphasis(opt, optType) {
20809+
function convertNormalEmphasis(opt, optType, useExtend) {
2080720810
if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {
2080820811
var normalOpt = opt[optType].normal;
2080920812
var emphasisOpt = opt[optType].emphasis;
2081020813

2081120814
if (normalOpt) {
20812-
opt[optType] = normalOpt;
20815+
// Timeline controlStyle has other properties besides normal and emphasis
20816+
if (useExtend) {
20817+
opt[optType].normal = opt[optType].emphasis = null;
20818+
defaults(opt[optType], normalOpt);
20819+
}
20820+
else {
20821+
opt[optType] = normalOpt;
20822+
}
2081320823
}
2081420824
if (emphasisOpt) {
2081520825
opt.emphasis = opt.emphasis || {};
@@ -21008,7 +21018,7 @@ var compatStyle = function (option, isTheme) {
2100821018
compatEC3CommonStyles(timelineOpt);
2100921019
convertNormalEmphasis(timelineOpt, 'label');
2101021020
convertNormalEmphasis(timelineOpt, 'itemStyle');
21011-
convertNormalEmphasis(timelineOpt, 'controlStyle');
21021+
convertNormalEmphasis(timelineOpt, 'controlStyle', true);
2101221022
convertNormalEmphasis(timelineOpt, 'checkpointStyle');
2101321023

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

21453+
/**
21454+
* Compatible with some cases (in pie, map) like:
21455+
* data: [{name: 'xx', value: 5, selected: true}, ...]
21456+
* where only sourceFormat is 'original' and 'objectRows' supported.
21457+
*
21458+
* ??? TODO
21459+
* Supported detail options in data item when using 'arrayRows'.
21460+
*
21461+
* @param {module:echarts/data/List} data
21462+
* @param {number} dataIndex
21463+
* @param {string} attr like 'selected'
21464+
*/
21465+
function retrieveRawAttr(data, dataIndex, attr) {
21466+
if (!data) {
21467+
return;
21468+
}
21469+
21470+
var sourceFormat = data.getProvider().getSource().sourceFormat;
21471+
21472+
if (sourceFormat !== SOURCE_FORMAT_ORIGINAL
21473+
&& sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS
21474+
) {
21475+
return;
21476+
}
21477+
21478+
var dataItem = data.getRawDataItem(dataIndex);
21479+
if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject$1(dataItem)) {
21480+
dataItem = null;
21481+
}
21482+
if (dataItem) {
21483+
return dataItem[attr];
21484+
}
21485+
}
21486+
2144321487
var DIMENSION_LABEL_REG = /\{@(.+?)\}/g;
2144421488

2144521489
// PENDING A little ugly
@@ -23616,10 +23660,10 @@ var isFunction = isFunction$1;
2361623660
var isObject = isObject$1;
2361723661
var parseClassType = ComponentModel.parseClassType;
2361823662

23619-
var version = '4.0.1';
23663+
var version = '4.0.2';
2362023664

2362123665
var dependencies = {
23622-
zrender: '4.0.0'
23666+
zrender: '4.0.1'
2362323667
};
2362423668

2362523669
var TEST_FRAME_REMAIN_TIME = 1;
@@ -36025,7 +36069,11 @@ var selectableMixin = {
3602536069
var valueDim = ecList.mapDimension('value');
3602636070
var targetList = this._targetList = [];
3602736071
for (var i = 0, len = ecList.count(); i < len; i++) {
36028-
targetList.push({name: ecList.getName(i), value: ecList.get(valueDim, i)});
36072+
targetList.push({
36073+
name: ecList.getName(i),
36074+
value: ecList.get(valueDim, i),
36075+
selected: retrieveRawAttr(ecList, i, 'selected')
36076+
});
3602936077
}
3603036078
}
3603136079
this._selectTargetMap = reduce(targetList || [], function (targetMap, target) {
@@ -75238,7 +75286,7 @@ TimelineView.extend({
7523875286
var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width;
7523975287

7524075288
var controlModel = timelineModel.getModel('controlStyle');
75241-
var showControl = controlModel.get('show');
75289+
var showControl = controlModel.get('show', true);
7524275290
var controlSize = showControl ? controlModel.get('itemSize') : 0;
7524375291
var controlGap = showControl ? controlModel.get('itemGap') : 0;
7524475292
var sizePlusGap = controlSize + controlGap;
@@ -75252,7 +75300,6 @@ TimelineView.extend({
7525275300
var nextBtnPosition;
7525375301
var axisExtent;
7525475302
var controlPosition = controlModel.get('position', true);
75255-
var showControl = controlModel.get('show', true);
7525675303
var showPlayBtn = showControl && controlModel.get('showPlayBtn', true);
7525775304
var showPrevBtn = showControl && controlModel.get('showPrevBtn', true);
7525875305
var showNextBtn = showControl && controlModel.get('showNextBtn', true);

dist/echarts-en.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/echarts-en.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)