@antv/x6
Version:
JavaScript diagramming library that uses SVG and HTML for rendering
24 lines (21 loc) • 432 B
text/typescript
import type { SimpleAttrs } from '../attr'
import type { MarkerFactory } from './index'
export interface EllipseMarkerOptions extends SimpleAttrs {
rx?: number
ry?: number
}
export const ellipse: MarkerFactory<EllipseMarkerOptions> = ({
rx,
ry,
...attrs
}) => {
const radiusX = rx || 5
const radiusy = ry || 5
return {
cx: radiusX,
...attrs,
tagName: 'ellipse',
rx: radiusX,
ry: radiusy,
}
}