Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function setTextStyle(textStyle, textStyleModel, specifiedTextStyle, opt, isEmphasis) {
setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis);
specifiedTextStyle && zrUtil.extend(textStyle, specifiedTextStyle); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);
return textStyle;
}
/**
if (isInit) {
// Default label emphasis `position` and `show`
fillLabel(markerOpt);
}
zrUtil.each(markerOpt.data, function (item) {
// FIXME Overwrite fillLabel method ?
if (item instanceof Array) {
fillLabel(item[0]);
fillLabel(item[1]);
} else {
fillLabel(item);
}
});
markerModel = new MarkerModel(markerOpt, this, ecModel);
zrUtil.extend(markerModel, {
mainType: this.mainType,
// Use the same series index and name
seriesIndex: seriesModel.seriesIndex,
name: seriesModel.name,
createdBySelf: true
});
markerModel.__hostSeries = seriesModel;
} else {
markerModel._mergeOption(markerOpt, ecModel, true);
}
seriesModel[modelPropName] = markerModel;
}, this);
}
}
mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;
item = [mlFrom, mlTo, { // Extra option for tooltip and label
type: mlType,
valueIndex: item.valueIndex,
// Force to use the value of calculated value.
value: value
}];
}
item = [
markerHelper.dataTransform(seriesModel, item[0]),
markerHelper.dataTransform(seriesModel, item[1]),
zrUtil.extend({}, item[2])
];
// Avoid line data type is extended by from(to) data type
item[2].type = item[2].type || '';
// Merge from option and to option into line option
zrUtil.merge(item[2], item[0]);
zrUtil.merge(item[2], item[1]);
return item;
};
}
opt = opt || {};
sysDims = (sysDims || []).slice();
var dimsDef = (opt.dimsDef || []).slice();
var encodeDef = createHashMap(opt.encodeDef);
var dataDimNameMap = createHashMap();
var coordDimNameMap = createHashMap();
// var valueCandidate;
var result = [];
var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount);
// Apply user defined dims (`name` and `type`) and init result.
for (var i = 0; i < dimCount; i++) {
var dimDefItem = dimsDef[i] = extend(
{}, isObject(dimsDef[i]) ? dimsDef[i] : {name: dimsDef[i]}
);
var userDimName = dimDefItem.name;
var resultItem = result[i] = {otherDims: {}};
// Name will be applied later for avoiding duplication.
if (userDimName != null && dataDimNameMap.get(userDimName) == null) {
// Only if `series.dimensions` is defined in option
// displayName, will be set, and dimension will be diplayed vertically in
// tooltip by default.
resultItem.name = resultItem.displayName = userDimName;
dataDimNameMap.set(userDimName, i);
}
dimDefItem.type != null && (resultItem.type = dimDefItem.type);
dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);
}
if (!axisModel.get('axisLine.show')) {
return;
}
var extent = this.axisModel.axis.getExtent();
var matrix = this._transform;
var pt1 = [extent[0], 0];
var pt2 = [extent[1], 0];
if (matrix) {
v2ApplyTransform(pt1, pt1, matrix);
v2ApplyTransform(pt2, pt2, matrix);
}
var lineStyle = extend(
{
lineCap: 'round'
},
axisModel.getModel('axisLine.lineStyle').getLineStyle()
);
this.group.add(new graphic.Line({
// Id for animation
anid: 'line',
subPixelOptimize: true,
shape: {
x1: pt1[0],
y1: pt1[1],
x2: pt2[0],
y2: pt2[1]
},
function mergeNewElOptionToExist(existList, index, newElOption) {
// Update existing options, for `getOption` feature.
var newElOptCopy = zrUtil.extend({}, newElOption);
var existElOption = existList[index];
var $action = newElOption.$action || 'merge';
if ($action === 'merge') {
if (existElOption) {
if (__DEV__) {
var newType = newElOption.type;
zrUtil.assert(
!newType || existElOption.type === newType,
'Please set $action: "replace" to change `type`'
);
}
// We can ensure that newElOptCopy and existElOption are not
// the same object, so `merge` will not change newElOptCopy.
function mergeNewElOptionToExist(existList, index, newElOption) {
// Update existing options, for `getOption` feature.
var newElOptCopy = zrUtil.extend({}, newElOption);
var existElOption = existList[index];
var $action = newElOption.$action || 'merge';
if ($action === 'merge') {
if (existElOption) {
// We can ensure that newElOptCopy and existElOption are not
// the same object, so `merge` will not change newElOptCopy.
zrUtil.merge(existElOption, newElOptCopy, true); // Rigid body, use ignoreSize.
layoutUtil.mergeLayoutParam(existElOption, newElOptCopy, {
ignoreSize: true
}); // Will be used in render.
layoutUtil.copyLayoutParams(newElOption, existElOption);
} else {
existList[index] = newElOptCopy;
function prepareAnimationWhenHasOld(lasts, element, storageName) {
var lastCfg = lasts[thisRawIndex] = {};
lastCfg.old = storageName === 'nodeGroup' ? element.position.slice() : zrUtil.extend({}, element.shape);
} // If a element is new, we need to find the animation start point carefully,
// otherwise it will looks strange when 'zoomToNode'.
function getCleanedElOption(elOption) {
elOption = zrUtil.extend({}, elOption);
zrUtil.each(
['id', 'parentId', '$action', 'hv', 'bounding'].concat(layoutUtil.LOCATION_PARAMS),
function (name) {
delete elOption[name];
}
);
return elOption;
}
function getAnimatableProps(el) {
var obj = {
position: vector.clone(el.position),
rotation: el.rotation
};
if (el.shape) {
obj.shape = zrUtil.extend({}, el.shape);
}
return obj;
}
var elMap1 = getElMap(g1);