Class styledGeometry

A geometry object decorated with a geometry style object

class

styledGeometry

Index

Constructor methods

Methods

Constructor methods

constructor(geom: geometry, gStyle?: geometryStyle): styledGeometry

Parameters

Returns

styledGeometry

Methods

public createSvgPathElement(key: string, mapUnitsPerPix: number): HTMLElement

Renders this geometry as an SVG path. Note: We attach original geometry bounds to svg doc as an expando.

Parameters

  • key: string

    Identifer to keep track of the SVG DOM element.

  • mapUnitsPerPix: number

Returns

HTMLElement

A new SVG document root.

public getAnimation(): (pathElement: HTMLElement, loopback: () => void) => void

Gets optional animation function called when SVG node is created.

Returns

(pathElement: HTMLElement, loopback: () => void) => void

Function with the signature animation(pathElement, loopback).

public getDashArray(): string

Gets the dash array as a string.

Returns

string

Dash array as astring.

public getFillColor(): string

Gets fill color as a CSS style string.

Returns

string

Fill color as a CSS style string.

public getFillOpacity(): number

Gets fill opacity in decimal format.

Returns

number

Fill opacity.

public getGeometry(): geometry

Gets the styledGeometry's underlying geometry object.

Returns

geometry

The underlying geometry.

public getGeometryStyle(): geometryStyle

Gets the styledGeometry's underlying geometryStyle object.

Returns

geometryStyle

The underlying geometry style.

public getOutlineColor(): string

Gets path outline color as a CSS style string.

Returns

string

Outline color as a CSS style string.

public getOutlineOpacity(): number

Gets path outline opacity in decimal format.

Returns

number

Outline opacity.

public getOutlineThicknessPix(): number

Gets path outline thickness in pixels.

Returns

number

Thickness in pixels.

public renderPathToCanvasContext(ctx: CanvasRenderingContext2D)

Renders this to a canvas context.

Parameters

  • ctx: CanvasRenderingContext2D

    Canvas context to which to render.

public setAnimation(action: (pathElement: HTMLElement, loopback: () => void) => void)

You can use the loopback parameter on complete to call itself and create repeating animation.

Parameters

  • action: (pathElement: HTMLElement, loopback: () => void) => void

public setDashArray(da: string)

Sets dash array string from a CSS style string. Defaults to solid stroke if no dash array string is provided.

Parameters

  • da: string

public setFillColor(c: string)

Sets fill color as a CSS style string.

Parameters

  • c: string

    Fill color as a CSS style string.

public setFillOpacity(o: number)

Sets fill opacity to a decimal between 0 and 1.

Parameters

  • o: number

    Fill opacity.

public setGeometry(g: geometry)

Set this styledGeometry's geometry.

Parameters

public setGeometryStyle(gs: geometryStyle)

Set this styledGeometry's geometryStyle.

Parameters

public setOutlineColor(c: string)

Gets path outline opacity in decimal format.

Parameters

  • c: string

public setOutlineOpacity(o: number)

Set path outline opacity to a decimal between 0 and 1.

Parameters

  • o: number

    Outline opacity.

public setOutlineThicknessPix(t: number)

Sets path outline thickness in pixels.

Parameters

  • t: number

    Thickness in pixels.