Class SVGRenderer

Renders onto an SVGElement.

Hierarchy (view full)

Constructors

Properties

objectLevel: number = 0

Methods

  • Notes the end of an object.

    Parameters

    • Optional loaderData: LoadSaveDataTable

      a map from strings to JSON-ifyable objects and contains properties attached to the object by whatever loader loaded the image. This is used to preserve attributes not supported by js-draw when loading/saving an image. Renderers may ignore this.

    • Optional elemClassNames: string[]

      a list of labels (e.g. classNames) to be attached to the object. Renderers may ignore this.

    Returns void

  • Creates a new SVG element and SVGRenerer with width, height, viewBox, and other metadata attributes set for the given Viewport.

    If options is a boolean, it is interpreted as whether to sanitize (not add unknown SVG entities to) the output.

    Parameters

    • viewport: Viewport
    • options: boolean | FromViewportOptions = true

    Returns {
        element: SVGSVGElement;
        renderer: SVGRenderer;
    }

Generated using TypeDoc

OpenSource licenses