Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SvgElement

Hierarchy

Index

Constructors

Properties

cache: Map<any, any> = ...
cx?: number
cy?: number
dblclick: boolean = false
dirtyEnable: boolean = false

是否开启脏记录

dirtyStatus: number = 0b000
effectStatus: number = 0b000
element?: Element
eventStop: Set<unknown> = ...
fill?: string | number
fillOpacity?: number
fontFamily?: string
fontSize?: number
height?: number
id: string
offset?: number
opacity?: number
props: any = ...
r?: number
rx?: number
ry?: number
sid?: string
stopColor?: string
stopOpacity?: number
stroke?: string
strokeLinecap?: string
strokeLinejoin?: string
strokeOpacity?: number
strokeWidth?: number
textAnchor?: string
width?: number
x?: number
y?: number

Accessors

  • get eventEnable(): boolean
  • set eventEnable(enable: boolean): void
  • Returns boolean

  • Parameters

    • enable: boolean

    Returns void

Methods

  • Parameters

    Returns void

  • Parameters

    Returns void

  • attr(arg1?: string | object | string[], arg2?: any, arg3?: string): any
  • 获取属性 attr(): any;

    Parameters

    • Optional arg1: string | object | string[]
    • Optional arg2: any
    • Optional arg3: string

    Returns any

    属性内容

    设置属性 attr(name: string, value: any, namespace?: string): this;

  • clearProps(): void
  • Returns void

  • css<T>(style?: Partial<CSSStyleDeclaration> | T, val?: CSSStyleDeclaration[T]): SvgElement | Partial<CSSStyleDeclaration> | CSSStyleDeclaration[T]
  • 获取样式 css(): Partial

    Type parameters

    • T: CSSStyleName

    Parameters

    • Optional style: Partial<CSSStyleDeclaration> | T

      样式名

    • Optional val: CSSStyleDeclaration[T]

      样式值

    Returns SvgElement | Partial<CSSStyleDeclaration> | CSSStyleDeclaration[T]

    样式集合

    获取某个样式 css(style: T): CSSStyleDeclaration[T]

  • delDirtyStatus(flag: number): void
  • Parameters

    • flag: number

    Returns void

  • delEffectStatus(flag: number): void
  • Parameters

    • flag: number

    Returns void

  • dispose(): void
  • 注销

    Returns void

  • emit(event: string, ...args: any[]): void
  • 事件发送

    Parameters

    • event: string

      事件名

    • Rest ...args: any[]

      参数

    Returns void

  • Returns SvgElement

  • isDirty(flag: number): boolean
  • Parameters

    • flag: number

    Returns boolean

  • isEffect(flag: number): boolean
  • Parameters

    • flag: number

    Returns boolean

  • move(x: string | number, y: string | number): void
  • Parameters

    • x: string | number
    • y: string | number

    Returns void

  • moveBy(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

  • off(event: string, callback: Function): void
  • 关闭事件

    Parameters

    • event: string

      事件名

    • callback: Function

      回调

    Returns void

  • on(event: string, callback: Function): void
  • 开启事件

    Parameters

    • event: string

      事件名

    • callback: Function

      回调

    Returns void

  • remove(): void
  • Returns void

  • setDirtyStatus(flag: number): void
  • Parameters

    • flag: number

    Returns void

  • setEffectStatus(flag: number): void
  • Parameters

    • flag: number

    Returns void

  • Returns SvgElement