Skip to content

Class: ArrowShape

箭头形状

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new ArrowShape(unitPoints?)

Parameters

NameType
unitPoints{ x: number = -0.5; y: number = -0.5 }[]

Overrides

Shape.constructor

Properties

className

className: any

Overrides

Shape.className


dirty

dirty: boolean

Inherited from

Shape.dirty


isClosed

isClosed: any

是否封闭图形(最后一个点是否连接到第一个点形成封闭图形),默认true

Overrides

Shape.isClosed


points

points: PointLike[]

单位点列表 x:[-0.5, 0.5] y: [-0.5, 0.5]

Inherited from

Shape.points


Arc

Static Arc: any

一个全局的Arc实例对象

Inherited from

Shape.Arc


Arrow

Static Arrow: any

一个全局的箭头形状实例对象

Inherited from

Shape.Arrow


ArrowShape

Static ArrowShape: any

已过时,不推荐使用,未来将移除

请使用 Shape.Arrow 来替代: Shape.ArrowShape

Deprecated

Inherited from

Shape.ArrowShape


BezierCurve

Static BezierCurve: any

一个全局的贝塞尔实例对象

Inherited from

Shape.BezierCurve


Circle

Static Circle: any

一个全局的圆形实例对象

Inherited from

Shape.Circle


Curve

Static Curve: any

一个全局的曲线实例对象

Inherited from

Shape.Curve


Damond

Static Damond: Shape

菱形

Inherited from

Shape.Damond


Ellipse

Static Ellipse: any

一个全局的椭圆实例对象

Inherited from

Shape.Ellipse


Line

Static Line: any

一个全局的线条实例对象

Inherited from

Shape.Line


Polygon

Static Polygon: any

生成多边形对象

已过时,不推荐使用,未来将移除

请使用 Shape.polygon (p小写) 来替代:Shape.Polygon

Deprecated

Inherited from

Shape.Polygon


Rect

Static Rect: any

一个全局的矩形实例对象

Inherited from

Shape.Rect


RectShape

Static RectShape: any

已过时,不推荐使用,未来将移除

请使用 Shape.Rect 来替代: Shape.RectShape

Deprecated

Inherited from

Shape.RectShape


Triangle

Static Triangle: Shape

一个全局的三角型, 右朝向

Inherited from

Shape.Triangle


tip

Static tip: Shape

Inherited from

Shape.tip

Methods

clone

clone(): Shape

Returns

Shape

Inherited from

Shape.clone


draw

draw(ctx, points, object): void

Parameters

NameType
ctxCanvasRenderingContext2D
pointsPointLike[]
objectDisplayObject

Returns

void

Overrides

Shape.draw


rotate

rotate(angle): ArrowShape

旋转,会修改points属性

Parameters

NameType
anglenumber

Returns

ArrowShape

Inherited from

Shape.rotate


scale

scale(sx, sy): ArrowShape

缩放,会修改points属性

Parameters

NameType
sxnumber
synumber

Returns

ArrowShape

Inherited from

Shape.scale


skew

skew(sx, sy): ArrowShape

Parameters

NameType
sxnumber
synumber

Returns

ArrowShape

Inherited from

Shape.skew


toJSON

toJSON(): any

Returns

any

Inherited from

Shape.toJSON


updatePoints

updatePoints(unitPoints): void

更新数据点

Parameters

NameTypeDescription
unitPointsPointLike[]单位点列表 x:[-0.5, 0.5] y: [-0.5, 0.5]

Returns

void

Inherited from

Shape.updatePoints


Scale

Static Scale(sx, sy): (p: PointLike) => PointLike

Deprecated

Parameters

NameType
sxnumber
synumber

Returns

fn

(p): PointLike

Parameters
NameType
pPointLike
Returns

PointLike

Inherited from

Shape.Scale


circlePoints

Static circlePoints(opt): any[]

生成圆上一列的点

Parameters

NameType
optObject
opt.beginnumber
opt.endnumber
opt.pointCount?number
opt.stepnumber

Returns

any[]

Inherited from

Shape.circlePoints


fn

Static fn(f): Shape

自定义函数来构

Parameters

NameType
fFunction

Returns

Shape

Inherited from

Shape.fn


fromJSON

Static fromJSON(json): any

Parameters

NameType
jsonany

Returns

any

Inherited from

Shape.fromJSON


fromPoints

Static fromPoints(points, keepAspectRatio?): Shape

Parameters

NameTypeDefault value
pointsPointLike[]undefined
keepAspectRatiobooleantrue

Returns

Shape

Inherited from

Shape.fromPoints


innerGrid

Static innerGrid(rows, cols): Shape

生成内网格坐标

Parameters

NameTypeDescription
rowsnumber
colsnumber

Returns

Shape

Inherited from

Shape.innerGrid


normalPoints

Static normalPoints(points, keepAspectRatio?): { x: number ; y: number }[]

将指定点坐标单位化

Parameters

NameTypeDefault value
pointsPointLike[]undefined
keepAspectRatiobooleantrue

Returns

{ x: number ; y: number }[]

Inherited from

Shape.normalPoints


outerGrid

Static outerGrid(rows, cols): Shape

生成网格坐标(外边框)

Parameters

NameTypeDescription
rowsnumber
colsnumber

Returns

Shape

一维数组(单位坐标)

Inherited from

Shape.outerGrid


parallelogram

Static parallelogram(beginX?): Shape

生成一个平行四边形实例(上面一条边向右倾斜)

Parameters

NameTypeDefault valueDescription
beginXnumber0.2X偏移百分比

Returns

Shape

Inherited from

Shape.parallelogram


pointToSize

Static pointToSize(points, width, height, keepAspectRatio?): { x: number ; y: number }[]

Parameters

NameTypeDefault value
pointsPointLike[]undefined
widthnumberundefined
heightnumberundefined
keepAspectRatiobooleanfalse

Returns

{ x: number ; y: number }[]

Inherited from

Shape.pointToSize


polygon

Static polygon(edgeCount?, initAngle?): Shape

生成多边形Shape对象

Parameters

NameTypeDefault valueDescription
edgeCountnumber3边的条数
initAnglenumber0初始角度

Returns

Shape

Inherited from

Shape.polygon