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