Skip to content
本页目录

Class: Endpoint

端点基类,表示link连接对象上的具体位置(边框上还是中心等)

实例有:

EndpointFixedPoint: 表示连接到一个固定的坐标(x,y)

EndpointSegment: 表示连接到Node或Link的某一个线段上

EndpointFixedName: 表示连接到Node或Link的某个 ’连接点上‘,如: 'center'、'ct'、'lm'

EndpointNearest: 表示连接到Node的边框上

EndpointFunction: 表示连接到一个函数上

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

// 示例
link.setBegin({x: 10, y: 10});

// 等价于:
let endpoint = new EndpointFixedPoint(10, 10);
link.setBegin(endpoint);

let endpointBegin = link.begin;
console.log(endpointBegin.x); // => 10

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Endpoint()

Properties

className

className: string


target

Optional target: DisplayObject

被连接的对象, 可能为空

Methods

isDisplayObjectTarget

isDisplayObjectTarget(): boolean

Returns

boolean


isNodeTarget

isNodeTarget(): any

Returns

any


toJSON

toJSON(): { className: string } & Endpoint

Returns

{ className: string } & Endpoint