Skip to content
本页目录

Class: EndpointNearest

端点:以两个对象之间最短距离来定位

js
import {EndpointNearest} from '@jtopo/core';

// 示例
let endpoint = new EndpointNearest(node);
link.setBegin(endpoint);

等价于:
link.setBegin(node, 'nearest');

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new EndpointNearest(target)

Parameters

NameType
targetDisplayObject

Overrides

Endpoint.constructor

Properties

className

className: string

Overrides

Endpoint.className


target

target: DisplayObject

被连接的对象

Overrides

Endpoint.target

Methods

getAngle

getAngle(p): number

Parameters

NameTypeDescription
pPointLike边框上的交点

Returns

number


isDisplayObjectTarget

isDisplayObjectTarget(): boolean

Returns

boolean

Inherited from

Endpoint.isDisplayObjectTarget


isNodeTarget

isNodeTarget(): any

Returns

any

Inherited from

Endpoint.isNodeTarget


toJSON

toJSON(): { className: string } & EndpointNearest

Returns

{ className: string } & EndpointNearest

Inherited from

Endpoint.toJSON