@antv/x6-next
Version:
JavaScript diagramming library that uses SVG and HTML for rendering.
22 lines (19 loc) • 476 B
text/typescript
import { Dom } from '@antv/x6-common'
import { Grid } from './index'
export interface DotOptions extends Grid.Options {}
export const dot: Grid.Definition<DotOptions> = {
color: '#aaaaaa',
thickness: 1,
markup: 'rect',
update(elem, options) {
const width = options.thickness * options.sx
const height = options.thickness * options.sy
Dom.attr(elem, {
width,
height,
rx: width,
ry: height,
fill: options.color,
})
},
}