Methods

static

drawTextInto(options) → external:SVG

Draws text in a SVG node.

Parameters

Name Type Optional Description

options

Object

 

Options.

Values in options have the following properties:

Name Type Optional Description

node

external:SVG

 

SVG node.

text

string

 

Text.

x

number

 

X coordinate.

y

number

 

Base Y coordinate.

horizontalMargin

number

Yes

Padding in x direction.

Defaults to 0.

verticalMargin

number

Yes

Padding in y direction.

Defaults to 0.

font

module:meteoJS/thermodynamicDiagram~fontOptions

Yes

Font style.

fill

(string, Object, or undefined)

Yes

Fill for background. If undefined, no background is drawn.

Returns

external:SVG - SVG group containing the inserted elements.

static

drawWindbarbInto(options)

Draws a windbarb into an SVG node.

Parameters

Name Type Optional Description

options

Object

 

Options.

Values in options have the following properties:

Name Type Optional Description

node

external:SVG

 

SVG node.

x

number

Yes

X coordinate for windbarb tip.

Defaults to 0.

y

number

Yes

Y coordinate for windbarb tip.

Defaults to 0.

wspd

number

Yes

Wind speed [m/s].

Defaults to 0.

wdir

number

Yes

Wind direction [°].

Defaults to 0.

length

number

Yes

Windbarb length.

Defaults to 50.

strokeStyle

module:meteoJS/thermodynamicDiagram~lineStyleOptions

Yes

Line style.

fillTriangle

boolean

Yes

Fill the 50 knots triangles.

Defaults to true.

triangleRatio

boolean

Yes

Width of the 50 knots triangles according to length.

Defaults to 0.2.

barbDistanceRatio

boolean

Yes

Distance between triangles and/or 10 knot lines according to length.

Defaults to 0.1.

barbHeightRatio

boolean

Yes

Height of the triangles and lines according to length.

Defaults to 0.375.

static

getFirstDefinedValue() → (mixed or undefined)

Returns the first defined argument.

Parameter

Name Type Optional Description

...params

(mixed or undefined)

Yes

Some values.

Returns

(mixed or undefined) - First defined value, if available.

static

getNormalizedLineOptions([options][, defaults]) → module:meteoJS/thermodynamicDiagram~lineOptions

Returns normalized line options with visibility and line style.

Parameters

Name Type Optional Description

options

module:meteoJS/thermodynamicDiagram~lineOptions

Yes

Options.

defaults

module:meteoJS/thermodynamicDiagram~lineOptions

Yes

Optional defaults.

Returns

module:meteoJS/thermodynamicDiagram~lineOptions Normalized options.

static

getNormalizedLineTextOptions([options][, defaults]) → module:meteoJS/thermodynamicDiagram~lineTextOptions

Returns normalized text options with visibility, line and font style.

Parameters

Name Type Optional Description

options

module:meteoJS/thermodynamicDiagram~lineTextOptions

Yes

Options.

defaults

module:meteoJS/thermodynamicDiagram~lineTextOptions

Yes

Optional defaults.

Returns

module:meteoJS/thermodynamicDiagram~lineTextOptions Normalized options.

static

getNormalizedTextOptions([options][, defaults]) → module:meteoJS/thermodynamicDiagram~textOptions

Returns normalized text options with visibility and line style.

Parameters

Name Type Optional Description

options

module:meteoJS/thermodynamicDiagram~textOptions

Yes

Options.

defaults

module:meteoJS/thermodynamicDiagram~textOptions

Yes

Optional defaults.

Returns

module:meteoJS/thermodynamicDiagram~textOptions Normalized options.