Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ecModel.eachComponent({mainType: 'brush'}, function (brushModel, brushIndex) {
var thisBrushSelected = {
brushId: brushModel.id,
brushIndex: brushIndex,
brushName: brushModel.name,
areas: zrUtil.clone(brushModel.areas),
selected: []
};
// Every brush component exists in event params, convenient
// for user to find by index.
brushSelected.push(thisBrushSelected);
var brushOption = brushModel.option;
var brushLink = brushOption.brushLink;
var linkedSeriesMap = [];
var selectedDataIndexForLink = [];
var rangeInfoBySeries = [];
var hasBrushExists = 0;
if (!brushIndex) { // Only the first throttle setting works.
throttleType = brushOption.throttleType;
throttleDelay = brushOption.throttleDelay;
* @private
*/
var zr = this._zr = zrender.init(dom, {
renderer: opts.renderer || defaultRenderer,
devicePixelRatio: opts.devicePixelRatio,
width: opts.width,
height: opts.height
});
/**
* Expect 60 fps.
* @type {Function}
* @private
*/
this._throttledZrFlush = throttle(zrUtil.bind(zr.flush, zr), 17);
var theme = zrUtil.clone(theme);
theme && backwardCompat(theme, true);
/**
* @type {Object}
* @private
*/
this._theme = theme;
/**
* @type {Array.}
* @private
*/
this._chartsViews = [];
/**
* @type {Object.}
* @private
function updateEl(el, dataIndex, elOption, animatableModel, data, isInit, isRoot) {
var transitionProps = {};
var elOptionStyle = elOption.style || {};
elOption.shape && (transitionProps.shape = zrUtil.clone(elOption.shape));
elOption.position && (transitionProps.position = elOption.position.slice());
elOption.scale && (transitionProps.scale = elOption.scale.slice());
elOption.origin && (transitionProps.origin = elOption.origin.slice());
elOption.rotation && (transitionProps.rotation = elOption.rotation);
if (el.type === 'image' && elOption.style) {
var targetStyle = transitionProps.style = {};
zrUtil.each(['x', 'y', 'width', 'height'], function (prop) {
prepareStyleTransition(prop, targetStyle, elOptionStyle, el.style, isInit);
});
}
if (el.type === 'text' && elOption.style) {
var targetStyle = transitionProps.style = {};
zrUtil.each(['x', 'y'], function (prop) {
prepareStyleTransition(prop, targetStyle, elOptionStyle, el.style, isInit);
getMinMaxSpan: function () {
return zrUtil.clone(this._minMaxSpan);
},
function clipByPanel(controller, cover, data) {
var panel = getPanelByCover(controller, cover);
return panel && panel !== true ? panel.clipPath(data, controller._transform) : zrUtil.clone(data);
}
function updateCoverByMouse(controller, e, localCursorPoint, isEnd) {
var creatingCover = controller._creatingCover;
var panel = controller._creatingPanel;
var thisBrushOption = controller._brushOption;
var eventParams;
controller._track.push(localCursorPoint.slice());
if (shouldShowCover(controller) || creatingCover) {
if (panel && !creatingCover) {
thisBrushOption.brushMode === 'single' && clearCovers(controller);
var brushOption = zrUtil.clone(thisBrushOption);
brushOption.brushType = determineBrushType(brushOption.brushType, panel);
brushOption.panelId = panel === true ? null : panel.panelId;
creatingCover = controller._creatingCover = createCover(controller, brushOption);
controller._covers.push(creatingCover);
}
if (creatingCover) {
var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];
var coverBrushOption = creatingCover.__brushOption;
coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));
if (isEnd) {
endCreating(controller, creatingCover);
coverRenderer.updateCommon(controller, creatingCover);
}
clone: function () {
var Ctor = this.constructor;
return new Ctor(zrUtil.clone(this.option));
},
brushOptionList = zrUtil.map(brushOptionList, function (brushOption) {
return zrUtil.merge(zrUtil.clone(DEFAULT_BRUSH_OPT), brushOption, true);
});