Class RoughJsRenderer

Hierarchy

Constructors

Properties

container?: string | HTMLElement
containerNode: HTMLElement
doc: Document
rc: RoughSVG
svgNode: SVGSVGElement

Methods

  • This will embed all defs defined in the defs.html file. Specifically this is used to embed the base64 encoded font into the SVG so that the font always looks correct.

    Returns void

  • Parameters

    • x1: number
    • y1: number
    • x2: number
    • y2: number
    • strokeWidth: number
    • color: string
    • Optional classes: string | string[]

    Returns void

  • Parameters

    • x: number
    • y: number
    • size: number
    • strokeWidth: number
    • strokeColor: string
    • Optional fill: string
    • Optional classes: string | string[]
    • spikes: number = 5

    Returns GraphcisElement

  • Parameters

    • x: number
    • y: number
    • width: number
    • height: number
    • strokeWidth: number
    • strokeColor: string
    • Optional classes: string | string[]
    • Optional fill: string
    • Optional radius: number

    Returns GraphcisElement

  • Serialize the current state of the diagram to an SVG string. The returned string is a standalone <svg> document (including the xmlns attribute) and can be written to a file or used without ever attaching it to the DOM.

    Returns string

  • Adds classes to an SVG element via the "class" attribute rather than the classList API, since classList isn't implemented by svgdom (used to render server-side / in tests).

    Parameters

    • element: Element
    • Optional classes: string | string[]

    Returns void

  • Parameters

    • x: number
    • y: number
    • size: number
    • edges: number

    Returns string

  • Parameters

    • w: number
    • h: number
    • tlr: number
    • trr: number
    • brr: number
    • blr: number

    Returns string

Generated using TypeDoc