@antv/x6
Version:
JavaScript diagramming library that uses SVG and HTML for rendering.
21 lines (17 loc) • 597 B
text/typescript
import { Dom } from '../../util'
import { Util } from '../../global'
import { Highlighter } from './index'
export interface ClassHighlighterOptions {
className?: string
}
const defaultClassName = Util.prefix('highlighted')
export const className: Highlighter.Definition<ClassHighlighterOptions> = {
highlight(cellView, magnet, options) {
const cls = (options && options.className) || defaultClassName
Dom.addClass(magnet, cls)
},
unhighlight(cellView, magnet, options) {
const cls = (options && options.className) || defaultClassName
Dom.removeClass(magnet, cls)
},
}