marker.js 3 Documentation
    Preparing search index...

    Class SvgHelper

    Utility class to simplify SVG operations.

    Index

    Constructors

    Methods

    • Returns local coordinates relative to the provided localRoot of a client (screen) point.

      Parameters

      • localRoot: undefined | SVGElement

        relative coordinate root

      • x: number

        horizontal client coordinate

      • y: number

        vertical client coordinate

      • zoomLevel: number = 1

        zoom level

      Returns IPoint

      local coordinates relative to localRoot

    • Creates an SVG circle with the specified radius.

      Parameters

      • radius: number
      • Optionalattributes: [string, string][]

        additional attributes.

      Returns SVGCircleElement

    • Creates an SVG ellipse with the specified horizontal and vertical radii.

      Parameters

      • rx: number
      • ry: number
      • Optionalattributes: [string, string][]

        additional attributes.

      Returns SVGEllipseElement

    • Creates an SVG filter element.

      Parameters

      • id: string

        filter id

      • Optionalattributes: [string, string][]

        other filter element attributes

      • OptionalinnerHTML: string

        filter definition as string

      Returns SVGFilterElement

      filter element

    • Creates an SVG text element.

      Parameters

      • Optionalattributes: [string, string][]

        additional attributes.

      Returns SVGForeignObjectElement

    • Creates an SVG group.

      Parameters

      • Optionalattributes: [string, string][]

        additional attributes.

      Returns SVGGElement

    • Creates an SVG image element.

      Parameters

      • Optionalattributes: [string, string][]

        additional attributes.

      Returns SVGImageElement

    • Creates an SVG line with specified end-point coordinates.

      Parameters

      • x1: string | number
      • y1: string | number
      • x2: string | number
      • y2: string | number
      • Optionalattributes: [string, string][]

        additional attributes.

      Returns SVGLineElement

    • Creates an SVG marker.

      Parameters

      • id: string
      • orient: string
      • markerWidth: string | number
      • markerHeight: string | number
      • refX: string | number
      • refY: string | number
      • markerElement: SVGGraphicsElement

      Returns SVGMarkerElement

    • Creates an SVG path with the specified shape (d).

      Parameters

      • d: string

        path shape

      • Optionalattributes: [string, string][]

        additional attributes.

      Returns SVGPathElement

    • Creates an SVG point with the specified coordinates.

      Parameters

      • x: number
      • y: number

      Returns DOMPoint

    • Creates an SVG polygon with specified points.

      Parameters

      • points: string

        points as string.

      • Optionalattributes: [string, string][]

        additional attributes.

      Returns SVGPolygonElement

    • Creates an SVG rectangle with the specified width and height.

      Parameters

      • width: string | number
      • height: string | number
      • Optionalattributes: [string, string][]

        additional attributes.

      Returns SVGRectElement

    • Creates an SVG image element from a supplied inner SVG markup string.

      Parameters

      • stringSvg: string

        SVG markup (without the root svg tags)

      Returns SVGSVGElement

      SVG image element

    • Creates an SVG text element.

      Parameters

      • Optionalattributes: [string, string][]

        additional attributes.

      Returns SVGTextElement

    • Creates an SVG TSpan.

      Parameters

      • text: string

        inner text.

      • Optionalattributes: [string, string][]

        additional attributes.

      Returns SVGTSpanElement

    • Sets attributes on an arbitrary SVG element

      Parameters

      • el: SVGElement

        target SVG element.

      • attributes: [string, string][]

        set of name-value attribute pairs.

      Returns void