@antv/x6
Version:
JavaScript diagramming library that uses SVG and HTML for rendering
16 lines (13 loc) • 331 B
text/typescript
import type { EdgeAnchorDefinition } from './index'
export interface LengthEndpointOptions {
length?: number
}
export const length: EdgeAnchorDefinition<LengthEndpointOptions> = (
view,
magnet,
ref,
options,
) => {
const length = options.length != null ? options.length : 20
return view.getPointAtLength(length)!
}