ixfx
    Preparing search index...

    Type Alias SvgHelper

    SvgHelper: {
        get height(): number;
        set height(height: number): void;
        get parent(): SVGElement;
        get width(): number;
        set width(width: number): void;
        circle(
            circle: Geometry.Circles.CirclePositioned,
            opts?: CircleDrawingOpts,
            queryOrExisting?: string | SVGCircleElement,
        ): SVGCircleElement;
        clear(): void;
        grid(
            center: Geometry.Point,
            spacing: number,
            width: number,
            height: number,
            opts?: LineDrawingOpts,
        ): SVGGElement;
        line(
            line: Geometry.Line,
            opts?: LineDrawingOpts,
            queryOrExisting?: string | SVGLineElement,
        ): SVGLineElement;
        path(
            svgString: string | readonly string[],
            opts?: PathDrawingOpts,
            queryOrExisting?: string | SVGPathElement,
        ): SVGPathElement;
        query<V extends SVGElement>(selectors: string): null | V;
        remove(queryOrExisting: string | SVGElement): void;
        text(
            text: string,
            pos: Geometry.Point,
            opts?: TextDrawingOpts,
            queryOrExisting?: string | SVGTextElement,
        ): SVGTextElement;
        textPath(
            pathReference: string,
            text: string,
            opts?: TextDrawingOpts,
            textQueryOrExisting?: string | SVGTextElement,
            pathQueryOrExisting?: string | SVGTextPathElement,
        ): SVGTextPathElement;
    }

    Helper to make SVG elements with a common parent.

    Create with makeHelper.

    Type declaration

    • getheight():number

      Gets/sets the height of the parent

    • setheight(height:number):void
    • getparent():SVGElement

      Gets the parent

    • getwidth():number

      Gets/sets the width of the parent

    • setwidth(width:number):void
    • circle:function
    • clear:function
      • Deletes all child elements

        Returns void

    • grid:function
      • Creates a grid of horizontal and vertical lines inside of a group

        Parameters

        • center: Geometry.Point

          Grid origin

        • spacing: number

          Cell size

        • width: number

          Width of grid

        • height: number

          Height of grid

        • Optionalopts: LineDrawingOpts

          Drawing options

        Returns SVGGElement

    • line:function
      • Creates a line

        Parameters

        • line: Geometry.Line

          Line

        • Optionalopts: LineDrawingOpts

          Drawing options

        • OptionalqueryOrExisting: string | SVGLineElement

          DOM query to look up existing element, or the element instance

        Returns SVGLineElement

    • path:function
      • Creates a path

        Parameters

        • svgString: string | readonly string[]

          Path description, or empty string

        • Optionalopts: PathDrawingOpts

          Drawing options

        • OptionalqueryOrExisting: string | SVGPathElement

          DOM query to look up existing element, or the element instance

        Returns SVGPathElement

    • query:function
      • Returns an element if it exists in parent

        Type Parameters

        • VextendsSVGElement

        Parameters

        • selectors: string

          Eg #path

        Returns null | V

    • remove:function
      • Parameters

        • queryOrExisting: string | SVGElement

        Returns void

    • text:function
      • Creates a text element

        Parameters

        • text: string

          Text

        • pos: Geometry.Point

          Position

        • Optionalopts: TextDrawingOpts

          Drawing options

        • OptionalqueryOrExisting: string | SVGTextElement

          DOM query to look up existing element, or the element instance

        Returns SVGTextElement

    • textPath:function
      • Creates text on a path

        Parameters

        • pathReference: string

          Reference to path element

        • text: string

          Text

        • Optionalopts: TextDrawingOpts

          Drawing options

        • OptionaltextQueryOrExisting: string | SVGTextElement

          DOM query to look up existing element, or the element instance

        • OptionalpathQueryOrExisting: string | SVGTextPathElement

          DOM query to look up existing element, or the element instance

        Returns SVGTextPathElement