Module: zrender/shape/Trochold

zrender/shape/Trochold

new require("zrender/shape/Trochold")(options)

shape/Trochoid.js, line 56
Name Type Description
options Object

内外旋轮曲线

Author:
  • Neil (杨骥, 511415343@qq.com)

Example

var Trochold = require('zrender/shape/Trochold');
    var shape = new Trochold({
        style: {
            x: 100,
            y: 100,
            r: 50,
            r0: 30,
            d: 50,
            strokeColor: '#eee',
            text: 'trochold'
        }
    });
    zr.addShape(shape);

Members

内外旋轮曲线高亮绘制样式

内外旋轮曲线绘制样式

Methods

buildPath(ctx, style)

shape/Trochoid.js, line 79

创建内外旋轮曲线路径

Name Type Description
ctx CanvasRenderingContext2D
style module:zrender/shape/Trochold~ITrocholdStyle

getRect(style){module:zrender/shape/Base~IBoundingRect}

shape/Trochoid.js, line 136

返回内外旋轮曲线包围盒矩形

Name Type Description
style module:zrender/shape/Trochold~ITrocholdStyle

Type Definitions

ITrocholdStyleObject

Properties:
Name Type Argument Default Description
x number

中心x坐标

y number

中心y坐标

r number

固定圆半径 内旋曲线时必须大于转动圆半径

r0 number

转动圆半径

d number

点到内部转动圆的距离,等于r时曲线为摆线

location string <optional>
'in'

内旋 out 外旋

strokeColor string <optional>
'#000000'

描边颜色

lineCape string <optional>
'butt'

线帽样式,可以是 butt, round, square

lineWidth number <optional>
1

描边宽度

opacity number <optional>
1

绘制透明度

shadowBlur number <optional>
0

阴影模糊度,大于0有效

shadowColor string <optional>
'#000000'

阴影颜色

shadowOffsetX number <optional>
0

阴影横向偏移

shadowOffsetY number <optional>
0

阴影纵向偏移

text string <optional>

图形中的附加文本

textColor string <optional>
'#000000'

文本颜色

textFont string <optional>

附加文本样式,eg:'bold 18px verdana'

textPosition string <optional>
'end'

附加文本位置, 可以是 inside, left, right, top, bottom

textAlign string <optional>

默认根据textPosition自动设置,附加文本水平对齐。 可以是start, end, left, right, center

textBaseline string <optional>

默认根据textPosition自动设置,附加文本垂直对齐。 可以是top, bottom, middle, alphabetic, hanging, ideographic