Class: EndpointFixedName
端点:以节点上某个位置名字来定位
js
import {EndpointFixedName} from '@jtopo/core';
// 示例
let endpoint = new EndpointFixedName(node, 'ct');
link.setBegin(endpoint);
等价于:
link.setBegin(node, 'ct');
Hierarchy
↳
EndpointFixedName
Table of contents
Constructors
Properties
Methods
Constructors
constructor
new EndpointFixedName(target
, name
)
Parameters
Name | Type | Description |
---|---|---|
target | DisplayObject | - |
name | RectPosition | 位置名称, 例如: ct、center、lm |
Overrides
Properties
className
className: string
Overrides
name
name: RectPosition
位置名称:例如: ct、center、lm
target
target: DisplayObject
被连接的对象
Overrides
Methods
getAngle
getAngle(): number
Returns
number
getVec
getVec(): number
[]
获取朝向中心的向量
Returns
number
[]
isDisplayObjectTarget
isDisplayObjectTarget(): boolean
Returns
boolean
Inherited from
Endpoint.isDisplayObjectTarget
isNodeTarget
isNodeTarget(): any
Returns
any
Inherited from
toJSON
toJSON(): { className
: string
} & EndpointFixedName
Returns
{ className
: string
} & EndpointFixedName