图形相关函数
Methods
-
static extendPath()
-
Extend path
-
static extendShape()
-
Extend shape with parameters
-
static makePath(pathData, opts, rect, layoutopt)
-
Create a path element from path data string
Parameters:
Name Type Attributes Default Description pathDatastring optsObject rectmodule:zrender/core/BoundingRect layoutstring <optional>
cover 'center' or 'cover'
-
static resizePath(path, rect)
-
Resize a path to fit the rect
Parameters:
Name Type Description pathmodule:zrender/graphic/Path rectObject -
static setHoverStyle(el, hoverStyleopt, optopt)
-
Set hover style of element. This method can be called repeatly without side-effects.
Parameters:
Name Type Attributes Description elmodule:zrender/Element hoverStyleObject <optional>
optObject <optional>
Properties
Name Type Attributes Default Description hoverSilentOnTouchboolean <optional>
false In touch device, mouseover event will be trigger on touchstart event (see module:zrender/dom/HandlerProxy). By this mechanism, we can conviniently use hoverStyle when tap on touch screen without additional code for compatibility. But if the chart/component has select feature, which usually also use hoverStyle, there might be conflict between 'select-highlight' and 'hover-highlight' especially when roam is enabled (see geo for example). In this case, hoverSilentOnTouch should be used to disable hover-highlight on touch device.
-
static subPixelOptimize(xOrY, lineWidth, positiveOrNegativeopt) → {number}
-
Sub pixel optimize for canvas
Parameters:
Name Type Attributes Description xOrYnumber Coordinate, such as x, y
lineWidthnumber Should be nonnegative integer.
positiveOrNegativeboolean <optional>
Default false (negative).
Returns:
number -Optimized position.
-
static subPixelOptimizeLine(param) → {Object}
-
Sub pixel optimize line for canvas
Parameters:
Name Type Description paramObject Properties
Name Type Attributes Description shapeObject <optional>
Properties
Name Type Attributes Description x1number <optional>
y1number <optional>
x2number <optional>
y2number <optional>
styleObject <optional>
Properties
Name Type Attributes Description lineWidthnumber <optional>
Returns:
Object -Modified param
-
static subPixelOptimizeRect(param) → {Object}
-
Sub pixel optimize rect for canvas
Parameters:
Name Type Description paramObject Properties
Name Type Attributes Description shapeObject <optional>
Properties
Name Type Attributes Description xnumber <optional>
ynumber <optional>
widthnumber <optional>
heightnumber <optional>
styleObject <optional>
Properties
Name Type Attributes Description lineWidthnumber <optional>
Returns:
Object -Modified param
-
inner doEnterHover()
-
-
inner doSingleLeaveHover()
-
-
inner enterEmphasis()
-
-
inner leaveEmphasis()
-
-
inner onElementMouseOut()
-
-
inner onElementMouseOver()
-
-
inner setElementHoverStl()
-