Class: EndpointNearest
端点:以两个对象之间最短距离来定位
js
import {EndpointNearest} from '@jtopo/core';
// 示例
let endpoint = new EndpointNearest(node);
link.setBegin(endpoint);
等价于:
link.setBegin(node, 'nearest');
Hierarchy
↳
EndpointNearest
Table of contents
Constructors
Properties
Methods
Constructors
constructor
new EndpointNearest(target
)
Parameters
Name | Type |
---|---|
target | DisplayObject |
Overrides
Properties
className
className: string
Overrides
target
target: DisplayObject
被连接的对象
Overrides
Methods
getAngle
getAngle(p
): number
Parameters
Name | Type | Description |
---|---|---|
p | PointLike | 边框上的交点 |
Returns
number
hasTarget
hasTarget(): boolean
Returns
boolean
Inherited from
isDisplayObjectTarget
isDisplayObjectTarget(): boolean
Returns
boolean
Inherited from
Endpoint.isDisplayObjectTarget
isNodeTarget
isNodeTarget(): any
Returns
any
Inherited from
toJSON
toJSON(objIndexMap?
): any
Parameters
Name | Type |
---|---|
objIndexMap? | Map <DisplayObject , number > |
Returns
any
Inherited from
fromJSON
Static
fromJSON(json
, objIndexMap?
): any
Parameters
Name | Type |
---|---|
json | any |
objIndexMap? | Object |
Returns
any