UNPKG

@antv/x6

Version:

JavaScript diagramming library that uses SVG and HTML for rendering

23 lines (20 loc) 428 B
import type { SimpleAttrs } from '../attr' import type { MarkerFactory } from './index' import { normalize } from './util' export interface PathMarkerOptions extends SimpleAttrs { d: string offsetX?: number offsetY?: number } export const path: MarkerFactory<PathMarkerOptions> = ({ d, offsetX, offsetY, ...attrs }) => { return { ...attrs, tagName: 'path', d: normalize(d, offsetX, offsetY), } }