Extends
Members
-
_cachePoints :Array.<Array.<number>>
-
连线控制点缓存
Type:
- Array.<Array.<number>>
- Inherited From:
- Overrides:
-
_isHit :boolean
-
当前单元碰撞检测状态
Type:
- boolean
- Inherited From:
-
_isMoving :boolean
-
当前单元移动状态
Type:
- boolean
- Inherited From:
-
_isTargeting :boolean
-
当前单元选中状态
Type:
- boolean
- Inherited From:
-
_jflow :JFlow
-
canvas上 jflow 实体
Type:
- Inherited From:
-
backgroundColor :string
-
连线颜色,默认为 #000
Type:
- string
- Inherited From:
-
borderColor :string
-
边框颜色 默认 transparent
Type:
- string
- Inherited From:
-
borderWidth :number
-
边的宽度 默认是 0
Type:
- number
- Inherited From:
-
from :Instance
-
起始单元
Type:
- Inherited From:
-
fromDir :DIRECTION
-
起始方向
Type:
- Inherited From:
-
opacity :number
-
透明度
Type:
- number
- Inherited From:
-
shadowBlur :string
-
阴影扩散范围 默认 5
Type:
- string
- Inherited From:
-
shadowColor :string
-
阴影颜色 空就不显示阴影
Type:
- string
- Inherited From:
-
shadowOffsetX :string
-
阴影偏移 X
Type:
- string
- Inherited From:
-
shadowOffsetY :string
-
阴影偏移 Y
Type:
- string
- Inherited From:
-
to :Instance
-
终止单元
Type:
- Inherited From:
-
toDir :DIRECTION
-
终止方向
Type:
- Inherited From:
-
visible :boolean
-
元素可见 默认 true
Type:
- boolean
- Inherited From:
Methods
-
bubbleEvent(customEvent)
-
冒泡事件
Parameters:
Name Type Description customEvent
JFlowEvent 自定义事件
- Inherited From:
-
calculateToRealWorld(point)
-
反算回页面的像素坐标
Parameters:
Name Type Description point
Array.<Number> - Inherited From:
Returns:
世界坐标
- Type
- Array.<Number>
-
getBoundingDimension()
-
获取宽高
- Inherited From:
Returns:
-
demension 宽高
- Type
- Object
-
demension.width 宽
- Type
- number
-
demension.height 高
- Type
- number
-
getBoundingRect()
-
计算当前的最大外接矩形的
- Inherited From:
Returns:
[leftx, lefty, rightx, righty]
- Type
- Array.<number>
-
getCenter()
-
获取当前所在层级的坐标
- Inherited From:
Returns:
坐标
- Type
- Array.<Number>
-
getIntersectionsInFourDimension()
-
计算当前连线接入点的位置
- Inherited From:
Returns:
-
intersection 交叉点
- Type
- Object
-
intersection[DIRECTION.TOP] 上
- Type
- number
-
intersection[DIRECTION.BOTTOM] 下
- Type
- number
-
intersection[DIRECTION.LEFT] 上
- Type
- number
-
intersection[DIRECTION.RIGHT] 右
- Type
- number
-
isHit(point)
-
判断当前单元是否被命中
Parameters:
Name Type Description point
Array.<number> - Inherited From:
- Overrides:
Returns:
- Type
- Boolean
-
isInViewBox(viewbox)
-
是否出现在当前视窗内
Parameters:
Name Type Description viewbox
Array.<number> - Inherited From:
- Overrides:
-
onEnterViewbox()
-
当节点离开可视区域的回调
- Inherited From:
-
onLeaveViewbox()
-
当节点离开可视区域的回调
- Inherited From:
-
recalculateUp()
-
从当前布局中删除虚拟布局节点
- Inherited From:
-
render(ctx)
-
绘制单元
Parameters:
Name Type Description ctx
Context2d - Inherited From:
- Overrides:
-
setConfig(configs)
-
改变当前配置
Parameters:
Name Type Description configs
Configs The string containing two comma-separated numbers.
- Inherited From:
Type Definitions
-
Configs
-
Type:
Properties:
Name Type Description approximate
Number 点击响应范围
lineDash
Array.<Number> 虚线数组
doubleLink
Boolean 双向箭头
fontFamily
String 连线上的文字字体
fontSize
Number 连线上的文字大小
content
String 连线上的文字
Events
-
contextclick
-
点击事件(冒泡)
Type: object
-
dblclick
-
右键事件
Type: object
-
dragenter
-
dragenter 进入事件
Type: object
- Inherited From:
Properties:
Name Type Description event
Event 原始事件
instance
Object dragenter的对象
target
target drag 携带的对象(特指从外面拖进canvas的对象)
-
dragleave
-
dragleave 退出事件
Type: object
- Inherited From:
Properties:
Name Type Description event
Event 原始事件
instance
Object dragleave的对象
target
target drag 携带的对象(特指从外面拖进canvas的对象)
-
dragover
-
dragover 进入事件
Type: object
- Inherited From:
Properties:
Name Type Description event
Event 原始事件
instance
Object dragover的对象
target
target drag 携带的对象(特指从外面拖进canvas的对象)
-
drop
-
丢在线上事件
Type: object
-
mouseenter
-
鼠标移入事件
Type: object
- Inherited From:
Properties:
Name Type Description instance
Instance 移入的对象
-
mouseleave
-
鼠标移出事件
Type: object
- Inherited From:
Properties:
Name Type Description instance
Instance 移入的对象