提交 a7aaf66a 编写于 作者: L lang

Clone is always deep

上级 50b6d14f
...@@ -28,6 +28,8 @@ define(function(require) { ...@@ -28,6 +28,8 @@ define(function(require) {
// 最小高度改为0 // 最小高度改为0
barMinHeight: 0, barMinHeight: 0,
// barMaxWidth: null,
// 默认自适应 // 默认自适应
// barWidth: null, // barWidth: null,
// 柱间距离,默认为柱形宽度的30%,可设固定值 // 柱间距离,默认为柱形宽度的30%,可设固定值
...@@ -52,8 +54,6 @@ define(function(require) { ...@@ -52,8 +54,6 @@ define(function(require) {
// color: '各异', // color: '各异',
// 柱条边线 // 柱条边线
barBorderColor: '#fff', barBorderColor: '#fff',
// 柱条边线圆角,单位px,默认为0
barBorderRadius: 0,
// 柱条边线线宽,单位px,默认为1 // 柱条边线线宽,单位px,默认为1
barBorderWidth: 0 barBorderWidth: 0
}, },
...@@ -61,8 +61,6 @@ define(function(require) { ...@@ -61,8 +61,6 @@ define(function(require) {
// color: '各异', // color: '各异',
// 柱条边线 // 柱条边线
barBorderColor: '#fff', barBorderColor: '#fff',
// 柱条边线圆角,单位px,默认为0
barBorderRadius: 0,
// 柱条边线线宽,单位px,默认为1 // 柱条边线线宽,单位px,默认为1
barBorderWidth: 0 barBorderWidth: 0
} }
......
...@@ -149,7 +149,7 @@ define(function (require) { ...@@ -149,7 +149,7 @@ define(function (require) {
seriesOpt.name = dataOpt.name; seriesOpt.name = dataOpt.name;
for (var i = 1; i < dataList.length; i++) { for (var i = 1; i < dataList.length; i++) {
var dataOpt = dataList[i]; var dataOpt = dataList[i];
var newSeriesOpt = zrUtil.clone(seriesOpt, true); var newSeriesOpt = zrUtil.clone(seriesOpt);
option.series.push(zrUtil.extend(newSeriesOpt, { option.series.push(zrUtil.extend(newSeriesOpt, {
name: dataOpt.name, name: dataOpt.name,
data: dataOpt.value, data: dataOpt.value,
......
...@@ -50,7 +50,7 @@ define(function (require) { ...@@ -50,7 +50,7 @@ define(function (require) {
* @type {Object} * @type {Object}
* @readOnly * @readOnly
*/ */
this.opt = zrUtil.clone(opt, true); this.opt = zrUtil.clone(opt);
/** /**
* @type {module:zrender/container/Group} * @type {module:zrender/container/Group}
...@@ -131,7 +131,7 @@ define(function (require) { ...@@ -131,7 +131,7 @@ define(function (require) {
// TODO // TODO
// Only support one interval yet. // Only support one interval yet.
if (ranges) { if (ranges) {
renderCover.call(this, zrUtil.clone(ranges, true)); renderCover.call(this, zrUtil.clone(ranges));
} }
}, },
...@@ -218,7 +218,7 @@ define(function (require) { ...@@ -218,7 +218,7 @@ define(function (require) {
renderCover.call(this, ranges); renderCover.call(this, ranges);
this.trigger('selected', zrUtil.clone(ranges, true)); this.trigger('selected', zrUtil.clone(ranges));
} }
} }
......
...@@ -635,7 +635,7 @@ define(function (require) { ...@@ -635,7 +635,7 @@ define(function (require) {
function makeIcon(timelineModel, objPath, rect, opts) { function makeIcon(timelineModel, objPath, rect, opts) {
var icon = graphic.makePath( var icon = graphic.makePath(
timelineModel.get(objPath).replace(/^path:\/\//, ''), timelineModel.get(objPath).replace(/^path:\/\//, ''),
zrUtil.clone(opts || {}, true), zrUtil.clone(opts || {}),
new BoundingRect(rect[0], rect[1], rect[2], rect[3]), new BoundingRect(rect[0], rect[1], rect[2], rect[3]),
'center' 'center'
); );
......
...@@ -151,7 +151,7 @@ define(function(require) { ...@@ -151,7 +151,7 @@ define(function(require) {
var newItem; var newItem;
if (zrUtil.isObject(item)) { if (zrUtil.isObject(item)) {
newItem = zrUtil.clone(item, true); newItem = zrUtil.clone(item);
newItem.value = index; newItem.value = index;
} }
else { else {
......
...@@ -790,14 +790,14 @@ define(function (require) { ...@@ -790,14 +790,14 @@ define(function (require) {
if (lastHover.payloadBatch && !contentNotChange) { if (lastHover.payloadBatch && !contentNotChange) {
this._api.dispatchAction({ this._api.dispatchAction({
type: 'downplay', type: 'downplay',
batch: zrUtil.clone(lastHover.payloadBatch, true) batch: zrUtil.clone(lastHover.payloadBatch)
}); });
} }
// Dispatch highlight action // Dispatch highlight action
if (!contentNotChange) { if (!contentNotChange) {
this._api.dispatchAction({ this._api.dispatchAction({
type: 'highlight', type: 'highlight',
batch: zrUtil.clone(payloadBatch, true) batch: zrUtil.clone(payloadBatch)
}); });
lastHover.payloadBatch = payloadBatch; lastHover.payloadBatch = payloadBatch;
} }
......
...@@ -56,7 +56,7 @@ define(function(require) { ...@@ -56,7 +56,7 @@ define(function(require) {
this.resetVisual(function (mappingOption, state) { this.resetVisual(function (mappingOption, state) {
mappingOption.mappingMethod = mappingMethod; mappingOption.mappingMethod = mappingMethod;
mappingOption.categories = categories && zrUtil.clone(categories, true); mappingOption.categories = categories && zrUtil.clone(categories);
var intervals = mappingOption.intervals = []; var intervals = mappingOption.intervals = [];
var specifiedVisuals = mappingOption.specifiedVisuals = []; var specifiedVisuals = mappingOption.specifiedVisuals = [];
......
...@@ -150,7 +150,7 @@ define(function(require) { ...@@ -150,7 +150,7 @@ define(function(require) {
*/ */
_onItemClick: function (index) { _onItemClick: function (index) {
var visualMapModel = this.visualMapModel; var visualMapModel = this.visualMapModel;
var selected = zrUtil.clone(visualMapModel.get('selected'), true); var selected = zrUtil.clone(visualMapModel.get('selected'));
if (visualMapModel.get('selectedMode') === 'single') { if (visualMapModel.get('selectedMode') === 'single') {
zrUtil.each(selected, function (item, index) { zrUtil.each(selected, function (item, index) {
......
...@@ -389,12 +389,12 @@ define(function(require) { ...@@ -389,12 +389,12 @@ define(function(require) {
// Consistent symbol and symbolSize if not specified. // Consistent symbol and symbolSize if not specified.
if (!visuals.symbol) { if (!visuals.symbol) {
visuals.symbol = symbolExists visuals.symbol = symbolExists
&& zrUtil.clone(symbolExists, true) && zrUtil.clone(symbolExists)
|| (isCategory ? 'roundRect' : ['roundRect']); || (isCategory ? 'roundRect' : ['roundRect']);
} }
if (!visuals.symbolSize) { if (!visuals.symbolSize) {
visuals.symbolSize = symbolSizeExists visuals.symbolSize = symbolSizeExists
&& zrUtil.clone(symbolSizeExists, true) && zrUtil.clone(symbolSizeExists)
|| (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]); || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);
} }
......
...@@ -47,7 +47,7 @@ define(function(require) { ...@@ -47,7 +47,7 @@ define(function(require) {
* @public * @public
*/ */
setActiveIntervals: function (intervals) { setActiveIntervals: function (intervals) {
var activeIntervals = this.activeIntervals = zrUtil.clone(intervals, true); var activeIntervals = this.activeIntervals = zrUtil.clone(intervals);
// Normalize // Normalize
if (activeIntervals) { if (activeIntervals) {
......
...@@ -280,7 +280,7 @@ define(function(require) { ...@@ -280,7 +280,7 @@ define(function(require) {
* Get axis layout. * Get axis layout.
*/ */
getAxisLayout: function (dim) { getAxisLayout: function (dim) {
return zrUtil.clone(this._axesLayout[dim], true); return zrUtil.clone(this._axesLayout[dim]);
} }
}; };
......
...@@ -83,7 +83,7 @@ define(function (require) { ...@@ -83,7 +83,7 @@ define(function (require) {
* @type {Object} * @type {Object}
* @private * @private
*/ */
this._theme = zrUtil.clone(theme, true); this._theme = zrUtil.clone(theme);
/** /**
* @type {Array.<module:echarts/view/Chart>} * @type {Array.<module:echarts/view/Chart>}
......
...@@ -110,7 +110,7 @@ define(function (require) { ...@@ -110,7 +110,7 @@ define(function (require) {
if (!ComponentModel.hasClass(mainType)) { if (!ComponentModel.hasClass(mainType)) {
option[mainType] = option[mainType] == null option[mainType] = option[mainType] == null
? zrUtil.clone(componentOption, true) ? zrUtil.clone(componentOption)
: zrUtil.merge(option[mainType], componentOption, true); : zrUtil.merge(option[mainType], componentOption, true);
} }
else { else {
......
...@@ -123,7 +123,7 @@ define(function (require) { ...@@ -123,7 +123,7 @@ define(function (require) {
// Pending // Pending
clone: function () { clone: function () {
var Ctor = this.constructor; var Ctor = this.constructor;
return new Ctor(zrUtil.clone(this.option, true)); return new Ctor(zrUtil.clone(this.option));
}, },
setReadOnly: function (properties) { setReadOnly: function (properties) {
......
...@@ -56,7 +56,7 @@ define(function (require) { ...@@ -56,7 +56,7 @@ define(function (require) {
* @readOnly * @readOnly
* @type {Object} * @type {Object}
*/ */
var thisOption = this.option = zrUtil.clone(option, true); var thisOption = this.option = zrUtil.clone(option);
/** /**
* @private * @private
......
...@@ -12,8 +12,7 @@ define(function (require) { ...@@ -12,8 +12,7 @@ define(function (require) {
*/ */
get: function (visualType, key, isCategory) { get: function (visualType, key, isCategory) {
var value = zrUtil.clone( var value = zrUtil.clone(
(defaultOption[visualType] || {})[key], (defaultOption[visualType] || {})[key]
true
); );
return isCategory return isCategory
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册